doclific 0.2.8 → 0.3.0

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 (238) hide show
  1. package/dist/bin/doclific.js +50 -1
  2. package/dist/core/ai.js +140 -0
  3. package/dist/core/codebase.js +49 -3
  4. package/dist/public/assets/Assistant-Bold-gm-uSS1B.woff2 +0 -0
  5. package/dist/public/assets/Assistant-Medium-DrcxCXg3.woff2 +0 -0
  6. package/dist/public/assets/Assistant-Regular-DVxZuzxb.woff2 +0 -0
  7. package/dist/public/assets/Assistant-SemiBold-SCI4bEL9.woff2 +0 -0
  8. package/dist/public/assets/Preview-CfLVfmH2.js +1 -0
  9. package/dist/public/assets/Preview-yL612J-Y.js +1 -0
  10. package/dist/public/assets/Tableau10-B-NsZVaP.js +1 -0
  11. package/dist/public/assets/ar-SA-G6X2FPQ2-nSShYC9c.js +10 -0
  12. package/dist/public/assets/ar-SA-G6X2FPQ2-zGa4nmKj.js +10 -0
  13. package/dist/public/assets/arc-DPZnwcfX.js +1 -0
  14. package/dist/public/assets/arc-RHlRFoUH.js +1 -0
  15. package/dist/public/assets/array-BKyUJesY.js +1 -0
  16. package/dist/public/assets/az-AZ-76LH7QW2-2ofaYqg_.js +1 -0
  17. package/dist/public/assets/az-AZ-76LH7QW2-DulzdJU-.js +1 -0
  18. package/dist/public/assets/bg-BG-XCXSNQG7-bifIDIiP.js +5 -0
  19. package/dist/public/assets/bg-BG-XCXSNQG7-djDKLEln.js +5 -0
  20. package/dist/public/assets/blockDiagram-38ab4fdb-BpDJl5wM.js +118 -0
  21. package/dist/public/assets/blockDiagram-38ab4fdb-CkyydZLe.js +118 -0
  22. package/dist/public/assets/bn-BD-2XOGV67Q-BvjZoveq.js +5 -0
  23. package/dist/public/assets/bn-BD-2XOGV67Q-DHBogyv-.js +5 -0
  24. package/dist/public/assets/c4Diagram-3d4e48cf-R8x2FAAi.js +10 -0
  25. package/dist/public/assets/c4Diagram-3d4e48cf-aEsToGmZ.js +10 -0
  26. package/dist/public/assets/ca-ES-6MX7JW3Y-OWWCWvuP.js +8 -0
  27. package/dist/public/assets/ca-ES-6MX7JW3Y-_GJrF93G.js +8 -0
  28. package/dist/public/assets/channel-BE2ulzlx.js +1 -0
  29. package/dist/public/assets/channel-DzTwH3ut.js +1 -0
  30. package/dist/public/assets/classDiagram-70f12bd4-BP-7G8u1.js +2 -0
  31. package/dist/public/assets/classDiagram-70f12bd4-BTycZwZN.js +2 -0
  32. package/dist/public/assets/classDiagram-v2-f2320105-k8KFvaSn.js +2 -0
  33. package/dist/public/assets/classDiagram-v2-f2320105-k_XaW7Mw.js +2 -0
  34. package/dist/public/assets/clone-axZLZjOa.js +1 -0
  35. package/dist/public/assets/clone-rdfclP1b.js +1 -0
  36. package/dist/public/assets/createText-2e5e7dd3-Cbi8xL03.js +7 -0
  37. package/dist/public/assets/createText-2e5e7dd3-DuYw4Tl5.js +7 -0
  38. package/dist/public/assets/cs-CZ-2BRQDIVT-B2fBOA1Y.js +11 -0
  39. package/dist/public/assets/cs-CZ-2BRQDIVT-CP9xiC8w.js +11 -0
  40. package/dist/public/assets/da-DK-5WZEPLOC-Cpbm5Bju.js +5 -0
  41. package/dist/public/assets/da-DK-5WZEPLOC-dDp_pJjn.js +5 -0
  42. package/dist/public/assets/de-DE-XR44H4JA-D8rOmKQW.js +8 -0
  43. package/dist/public/assets/de-DE-XR44H4JA-DC6YpEoE.js +8 -0
  44. package/dist/public/assets/directory-open-01563666-DWU9wJ6I.js +1 -0
  45. package/dist/public/assets/directory-open-4ed118d0-CunoC1EB.js +1 -0
  46. package/dist/public/assets/edges-e0da2a9e-Cv6SpBo3.js +4 -0
  47. package/dist/public/assets/edges-e0da2a9e-DfbFOUG6.js +4 -0
  48. package/dist/public/assets/el-GR-BZB4AONW-BgQNs1cl.js +10 -0
  49. package/dist/public/assets/el-GR-BZB4AONW-BulpRKs1.js +10 -0
  50. package/dist/public/assets/erDiagram-9861fffd-BFVcrfkn.js +51 -0
  51. package/dist/public/assets/erDiagram-9861fffd-CLds4aY4.js +51 -0
  52. package/dist/public/assets/es-ES-U4NZUMDT-C1M-3kUi.js +9 -0
  53. package/dist/public/assets/es-ES-U4NZUMDT-Ct28khSM.js +9 -0
  54. package/dist/public/assets/eu-ES-A7QVB2H4-CbyIkWcA.js +11 -0
  55. package/dist/public/assets/eu-ES-A7QVB2H4-sIoA4F86.js +11 -0
  56. package/dist/public/assets/fa-IR-HGAKTJCU-CBLdXTih.js +8 -0
  57. package/dist/public/assets/fa-IR-HGAKTJCU-CtmSfjBe.js +8 -0
  58. package/dist/public/assets/fi-FI-Z5N7JZ37-BzRFOkPN.js +6 -0
  59. package/dist/public/assets/fi-FI-Z5N7JZ37-CkqAf83a.js +6 -0
  60. package/dist/public/assets/file-open-002ab408-DIuFHtCF.js +1 -0
  61. package/dist/public/assets/file-open-7c801643-684qeFg4.js +1 -0
  62. package/dist/public/assets/file-save-3189631c-C1wFhQhH.js +1 -0
  63. package/dist/public/assets/file-save-745eba88-Bb9F9Kg7.js +1 -0
  64. package/dist/public/assets/flowDb-956e92f1-D2t0qhMs.js +10 -0
  65. package/dist/public/assets/flowDb-956e92f1-VASBzIvX.js +10 -0
  66. package/dist/public/assets/flowDiagram-66a62f08-00amExuc.js +4 -0
  67. package/dist/public/assets/flowDiagram-66a62f08-n0k1fu1f.js +4 -0
  68. package/dist/public/assets/flowDiagram-v2-96b9c2cf-DPV3KQs-.js +1 -0
  69. package/dist/public/assets/flowDiagram-v2-96b9c2cf-DvEC9OW-.js +1 -0
  70. package/dist/public/assets/flowchart-elk-definition-4a651766-Ckm-u0tB.js +139 -0
  71. package/dist/public/assets/flowchart-elk-definition-4a651766-DuK0a8x4.js +139 -0
  72. package/dist/public/assets/fr-FR-RHASNOE6-B0ZsTvE2.js +9 -0
  73. package/dist/public/assets/fr-FR-RHASNOE6-BLTlR38v.js +9 -0
  74. package/dist/public/assets/ganttDiagram-c361ad54--PpHRpmK.js +257 -0
  75. package/dist/public/assets/ganttDiagram-c361ad54-Bfv8sOWo.js +257 -0
  76. package/dist/public/assets/gitGraphDiagram-72cf32ee-CJcs55Tw.js +70 -0
  77. package/dist/public/assets/gitGraphDiagram-72cf32ee-wLpa30-u.js +70 -0
  78. package/dist/public/assets/gl-ES-HMX3MZ6V-8Dvu3COr.js +10 -0
  79. package/dist/public/assets/gl-ES-HMX3MZ6V-DiriMGaf.js +10 -0
  80. package/dist/public/assets/graph-CI2pnyC5.js +1 -0
  81. package/dist/public/assets/graph-CzpZTUYm.js +1 -0
  82. package/dist/public/assets/he-IL-6SHJWFNN-BGgOoPZG.js +10 -0
  83. package/dist/public/assets/he-IL-6SHJWFNN-CIKv515H.js +10 -0
  84. package/dist/public/assets/hi-IN-IWLTKZ5I-C4QTfw3M.js +4 -0
  85. package/dist/public/assets/hi-IN-IWLTKZ5I-Dq9i2dbW.js +4 -0
  86. package/dist/public/assets/hu-HU-A5ZG7DT2-DGtzDRRU.js +7 -0
  87. package/dist/public/assets/hu-HU-A5ZG7DT2-EAD1mJZb.js +7 -0
  88. package/dist/public/assets/id-ID-SAP4L64H-B951c4Ob.js +10 -0
  89. package/dist/public/assets/id-ID-SAP4L64H-CzcaN-wr.js +10 -0
  90. package/dist/public/assets/image-blob-reduce.esm-BLtmMM_J.js +2 -0
  91. package/dist/public/assets/index-3862675e-BHyuTWf3.js +1 -0
  92. package/dist/public/assets/index-3862675e-CyylykW1.js +1 -0
  93. package/dist/public/assets/index-BMiq8nhK.js +95 -0
  94. package/dist/public/assets/index-BZnxyWWd.js +613 -0
  95. package/dist/public/assets/index-Bu97Fipb.js +95 -0
  96. package/dist/public/assets/index-CbwMLPrZ.css +1 -0
  97. package/dist/public/assets/index-CpBi0vus.js +3299 -0
  98. package/dist/public/assets/index-Cr2gUYn7.js +613 -0
  99. package/dist/public/assets/index-DTAYnrjZ.css +1 -0
  100. package/dist/public/assets/index-rmPcGL9S.js +3299 -0
  101. package/dist/public/assets/infoDiagram-f8f76790-Bzs_oiEq.js +7 -0
  102. package/dist/public/assets/infoDiagram-f8f76790-DnC7uKZu.js +7 -0
  103. package/dist/public/assets/init-Gi6I4Gst.js +1 -0
  104. package/dist/public/assets/it-IT-JPQ66NNP-DEqzEHhG.js +11 -0
  105. package/dist/public/assets/it-IT-JPQ66NNP-FqEOs8V_.js +11 -0
  106. package/dist/public/assets/ja-JP-DBVTYXUO-1bI1uZ7i.js +8 -0
  107. package/dist/public/assets/ja-JP-DBVTYXUO-DQOZh6jj.js +8 -0
  108. package/dist/public/assets/journeyDiagram-49397b02-B8902FwX.js +139 -0
  109. package/dist/public/assets/journeyDiagram-49397b02-hbhF2GTs.js +139 -0
  110. package/dist/public/assets/kaa-6HZHGXH3-CIEfiJBq.js +1 -0
  111. package/dist/public/assets/kaa-6HZHGXH3-DAsn8pMz.js +1 -0
  112. package/dist/public/assets/kab-KAB-ZGHBKWFO-DufzFqgZ.js +8 -0
  113. package/dist/public/assets/kab-KAB-ZGHBKWFO-hbSn2yHo.js +8 -0
  114. package/dist/public/assets/kk-KZ-P5N5QNE5-CY4y9tDn.js +1 -0
  115. package/dist/public/assets/kk-KZ-P5N5QNE5-DJbDGpSa.js +1 -0
  116. package/dist/public/assets/km-KH-HSX4SM5Z-5whf9ZS1.js +11 -0
  117. package/dist/public/assets/km-KH-HSX4SM5Z-CF1cSYpx.js +11 -0
  118. package/dist/public/assets/ko-KR-MTYHY66A-CSj-Cw0T.js +9 -0
  119. package/dist/public/assets/ko-KR-MTYHY66A-D0j8sNVo.js +9 -0
  120. package/dist/public/assets/ku-TR-6OUDTVRD-DZ47lKMP.js +9 -0
  121. package/dist/public/assets/ku-TR-6OUDTVRD-ETLSr72d.js +9 -0
  122. package/dist/public/assets/layout-Ch5pbbc5.js +1 -0
  123. package/dist/public/assets/layout-DWyqbrTF.js +1 -0
  124. package/dist/public/assets/line-BEMT2b8O.js +1 -0
  125. package/dist/public/assets/line-OgJiSIcA.js +1 -0
  126. package/dist/public/assets/linear-DrlVBQ0m.js +1 -0
  127. package/dist/public/assets/linear-lQEAUsIr.js +1 -0
  128. package/dist/public/assets/lt-LT-XHIRWOB4-B_rQQq9i.js +3 -0
  129. package/dist/public/assets/lt-LT-XHIRWOB4-VDM_qh72.js +3 -0
  130. package/dist/public/assets/lv-LV-5QDEKY6T-CLpzoE_t.js +7 -0
  131. package/dist/public/assets/lv-LV-5QDEKY6T-owXNC2sk.js +7 -0
  132. package/dist/public/assets/mindmap-definition-fc14e90a-4BkML5nr.js +415 -0
  133. package/dist/public/assets/mindmap-definition-fc14e90a-I2HuZmtK.js +415 -0
  134. package/dist/public/assets/mr-IN-CRQNXWMA-BUEgszaQ.js +13 -0
  135. package/dist/public/assets/mr-IN-CRQNXWMA-mcuymSpi.js +13 -0
  136. package/dist/public/assets/my-MM-5M5IBNSE-BiJAlR2l.js +1 -0
  137. package/dist/public/assets/my-MM-5M5IBNSE-Dn6dj_g-.js +1 -0
  138. package/dist/public/assets/nb-NO-T6EIAALU-CDRfxO5D.js +10 -0
  139. package/dist/public/assets/nb-NO-T6EIAALU-W5EpHGX0.js +10 -0
  140. package/dist/public/assets/nl-NL-IS3SIHDZ-C7BWZ57w.js +8 -0
  141. package/dist/public/assets/nl-NL-IS3SIHDZ-D4djrptd.js +8 -0
  142. package/dist/public/assets/nn-NO-6E72VCQL-BjqkP7Au.js +8 -0
  143. package/dist/public/assets/nn-NO-6E72VCQL-DgWcUCmS.js +8 -0
  144. package/dist/public/assets/oc-FR-POXYY2M6-C64no2Sz.js +8 -0
  145. package/dist/public/assets/oc-FR-POXYY2M6-hkWhLsfj.js +8 -0
  146. package/dist/public/assets/ordinal-Cboi1Yqb.js +1 -0
  147. package/dist/public/assets/pa-IN-N4M65BXN-BzVAnhAz.js +4 -0
  148. package/dist/public/assets/pa-IN-N4M65BXN-CdXAiUa-.js +4 -0
  149. package/dist/public/assets/path-CbwjOpE9.js +1 -0
  150. package/dist/public/assets/percentages-BXMCSKIN-B0roEqNs.js +159 -0
  151. package/dist/public/assets/percentages-BXMCSKIN-DmjnxD3b.js +159 -0
  152. package/dist/public/assets/pica-BI1bTxzy.js +2 -0
  153. package/dist/public/assets/pica-UyEFQr7o.js +2 -0
  154. package/dist/public/assets/pieDiagram-8a3498a8-BnZKl0HM.js +35 -0
  155. package/dist/public/assets/pieDiagram-8a3498a8-DToH0Umi.js +35 -0
  156. package/dist/public/assets/pl-PL-T2D74RX3-BfktR2GC.js +9 -0
  157. package/dist/public/assets/pl-PL-T2D74RX3-I3Od_pte.js +9 -0
  158. package/dist/public/assets/pt-BR-5N22H2LF-BMS0hGhj.js +9 -0
  159. package/dist/public/assets/pt-BR-5N22H2LF-DDlkalmL.js +9 -0
  160. package/dist/public/assets/pt-PT-UZXXM6DQ-BVksmEeI.js +9 -0
  161. package/dist/public/assets/pt-PT-UZXXM6DQ-Clt_m-aW.js +9 -0
  162. package/dist/public/assets/quadrantDiagram-120e2f19-CIZifO3c.js +7 -0
  163. package/dist/public/assets/quadrantDiagram-120e2f19-Cle8VMl3.js +7 -0
  164. package/dist/public/assets/react-8ZZPYhoA.js +6 -0
  165. package/dist/public/assets/react-AWXP2p19.js +6 -0
  166. package/dist/public/assets/react-B3b69yLH.js +21 -0
  167. package/dist/public/assets/react-BY3n_q7a.js +19 -0
  168. package/dist/public/assets/react-BZVgOt_z.js +22 -0
  169. package/dist/public/assets/react-BxN1Fkhi.js +34 -0
  170. package/dist/public/assets/react-COPmcfNO.js +1 -0
  171. package/dist/public/assets/react-Cgkl0rf4.js +19 -0
  172. package/dist/public/assets/react-D70vKkpT.js +19 -0
  173. package/dist/public/assets/react-DBLYdRms.js +21 -0
  174. package/dist/public/assets/react-DGFZQemO.js +1 -0
  175. package/dist/public/assets/react-DMuqKR18.js +17 -0
  176. package/dist/public/assets/react-DPzOK4iK.js +17 -0
  177. package/dist/public/assets/react-Ds4RMtsz.js +19 -0
  178. package/dist/public/assets/react-JOrDKzAZ.js +34 -0
  179. package/dist/public/assets/react-XtS51ONh.js +22 -0
  180. package/dist/public/assets/requirementDiagram-deff3bca-CYs2kOsx.js +52 -0
  181. package/dist/public/assets/requirementDiagram-deff3bca-D-aHYgF7.js +52 -0
  182. package/dist/public/assets/ro-RO-JPDTUUEW-8VZwJRTB.js +11 -0
  183. package/dist/public/assets/ro-RO-JPDTUUEW-CFz9EPTz.js +11 -0
  184. package/dist/public/assets/roundRect-mAH3dD0p.js +1 -0
  185. package/dist/public/assets/ru-RU-B4JR7IUQ-DXB6WjCJ.js +9 -0
  186. package/dist/public/assets/ru-RU-B4JR7IUQ-Dg_Ptvez.js +9 -0
  187. package/dist/public/assets/sankeyDiagram-04a897e0-CjgF0ShR.js +8 -0
  188. package/dist/public/assets/sankeyDiagram-04a897e0-Dfqu1Z59.js +8 -0
  189. package/dist/public/assets/sequenceDiagram-704730f1-DwTvFI-O.js +122 -0
  190. package/dist/public/assets/sequenceDiagram-704730f1-YZDjgz23.js +122 -0
  191. package/dist/public/assets/si-LK-N5RQ5JYF-3OCpve4d.js +1 -0
  192. package/dist/public/assets/si-LK-N5RQ5JYF-BGL74ce-.js +1 -0
  193. package/dist/public/assets/sk-SK-C5VTKIMK-BEWKAYUl.js +6 -0
  194. package/dist/public/assets/sk-SK-C5VTKIMK-a7S9S07m.js +6 -0
  195. package/dist/public/assets/sl-SI-NN7IZMDC-C_2tXhis.js +6 -0
  196. package/dist/public/assets/sl-SI-NN7IZMDC-CjuniHw8.js +6 -0
  197. package/dist/public/assets/stateDiagram-587899a1-BYww5TLf.js +1 -0
  198. package/dist/public/assets/stateDiagram-587899a1-CJKF3UH6.js +1 -0
  199. package/dist/public/assets/stateDiagram-v2-d93cdb3a-CuD2RI5c.js +1 -0
  200. package/dist/public/assets/stateDiagram-v2-d93cdb3a-_alqERD3.js +1 -0
  201. package/dist/public/assets/styles-6aaf32cf-D-L1HpzD.js +207 -0
  202. package/dist/public/assets/styles-6aaf32cf-DD-NSjsR.js +207 -0
  203. package/dist/public/assets/styles-9a916d00-CEw3szBU.js +160 -0
  204. package/dist/public/assets/styles-9a916d00-VifZbF1m.js +160 -0
  205. package/dist/public/assets/styles-c10674c1-BmyOVyx7.js +116 -0
  206. package/dist/public/assets/styles-c10674c1-PtYrOZV8.js +116 -0
  207. package/dist/public/assets/subset-shared.chunk-Brk9kdoc.js +22 -0
  208. package/dist/public/assets/subset-shared.chunk-BwUUnLRt.js +22 -0
  209. package/dist/public/assets/subset-worker.chunk-CHKbzn25.js +1 -0
  210. package/dist/public/assets/subset-worker.chunk-DA7gR3-1.js +1 -0
  211. package/dist/public/assets/sv-SE-XGPEYMSR-C02T2BPU.js +10 -0
  212. package/dist/public/assets/sv-SE-XGPEYMSR-tBT_anCV.js +10 -0
  213. package/dist/public/assets/svgDrawCommon-08f97a94-CEqvQOUt.js +1 -0
  214. package/dist/public/assets/svgDrawCommon-08f97a94-DKUomX3W.js +1 -0
  215. package/dist/public/assets/ta-IN-2NMHFXQM-BqK8b4tL.js +9 -0
  216. package/dist/public/assets/ta-IN-2NMHFXQM-Dwu_LpR7.js +9 -0
  217. package/dist/public/assets/th-TH-HPSO5L25-BAmgMbAJ.js +2 -0
  218. package/dist/public/assets/th-TH-HPSO5L25-DKdxRh3E.js +2 -0
  219. package/dist/public/assets/timeline-definition-85554ec2-B0w8BliX.js +61 -0
  220. package/dist/public/assets/timeline-definition-85554ec2-CFt0t_Cz.js +61 -0
  221. package/dist/public/assets/tr-TR-DEFEU3FU-8fP_g7lX.js +7 -0
  222. package/dist/public/assets/tr-TR-DEFEU3FU-vTO9xmBO.js +7 -0
  223. package/dist/public/assets/uk-UA-QMV73CPH-Mx0VvPGB.js +6 -0
  224. package/dist/public/assets/uk-UA-QMV73CPH-yUd9Af6s.js +6 -0
  225. package/dist/public/assets/vi-VN-M7AON7JQ-Cy6tHM0s.js +5 -0
  226. package/dist/public/assets/vi-VN-M7AON7JQ-_lTRG-8u.js +5 -0
  227. package/dist/public/assets/xychartDiagram-e933f94c-2LytheaB.js +7 -0
  228. package/dist/public/assets/xychartDiagram-e933f94c-3I_ghsu8.js +7 -0
  229. package/dist/public/assets/zh-CN-LNUGB5OW-BKmxs4M8.js +10 -0
  230. package/dist/public/assets/zh-CN-LNUGB5OW-CEpRPAMM.js +10 -0
  231. package/dist/public/assets/zh-HK-E62DVLB3-B7dqTsZx.js +1 -0
  232. package/dist/public/assets/zh-HK-E62DVLB3-CB9sD2Uu.js +1 -0
  233. package/dist/public/assets/zh-TW-RAJ6MFWO-C9A8RaNK.js +9 -0
  234. package/dist/public/assets/zh-TW-RAJ6MFWO-TZmXrCyi.js +9 -0
  235. package/dist/public/index.html +3 -3
  236. package/dist/server/index.js +1 -1
  237. package/dist/server/router.js +9 -0
  238. package/package.json +7 -1
@@ -0,0 +1,159 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/subset-worker.chunk-CHKbzn25.js","assets/subset-shared.chunk-BwUUnLRt.js","assets/index-Cr2gUYn7.js","assets/index-CbwMLPrZ.css","assets/pica-UyEFQr7o.js","assets/ar-SA-G6X2FPQ2-zGa4nmKj.js","assets/az-AZ-76LH7QW2-2ofaYqg_.js","assets/bg-BG-XCXSNQG7-djDKLEln.js","assets/bn-BD-2XOGV67Q-DHBogyv-.js","assets/ca-ES-6MX7JW3Y-OWWCWvuP.js","assets/cs-CZ-2BRQDIVT-CP9xiC8w.js","assets/da-DK-5WZEPLOC-Cpbm5Bju.js","assets/de-DE-XR44H4JA-D8rOmKQW.js","assets/el-GR-BZB4AONW-BgQNs1cl.js","assets/es-ES-U4NZUMDT-C1M-3kUi.js","assets/eu-ES-A7QVB2H4-sIoA4F86.js","assets/fa-IR-HGAKTJCU-CtmSfjBe.js","assets/fi-FI-Z5N7JZ37-CkqAf83a.js","assets/fr-FR-RHASNOE6-BLTlR38v.js","assets/gl-ES-HMX3MZ6V-DiriMGaf.js","assets/he-IL-6SHJWFNN-BGgOoPZG.js","assets/hi-IN-IWLTKZ5I-C4QTfw3M.js","assets/hu-HU-A5ZG7DT2-DGtzDRRU.js","assets/id-ID-SAP4L64H-CzcaN-wr.js","assets/it-IT-JPQ66NNP-DEqzEHhG.js","assets/ja-JP-DBVTYXUO-DQOZh6jj.js","assets/kaa-6HZHGXH3-DAsn8pMz.js","assets/kab-KAB-ZGHBKWFO-hbSn2yHo.js","assets/kk-KZ-P5N5QNE5-DJbDGpSa.js","assets/km-KH-HSX4SM5Z-CF1cSYpx.js","assets/ko-KR-MTYHY66A-D0j8sNVo.js","assets/ku-TR-6OUDTVRD-DZ47lKMP.js","assets/lt-LT-XHIRWOB4-B_rQQq9i.js","assets/lv-LV-5QDEKY6T-CLpzoE_t.js","assets/mr-IN-CRQNXWMA-BUEgszaQ.js","assets/my-MM-5M5IBNSE-Dn6dj_g-.js","assets/nb-NO-T6EIAALU-CDRfxO5D.js","assets/nl-NL-IS3SIHDZ-C7BWZ57w.js","assets/nn-NO-6E72VCQL-DgWcUCmS.js","assets/oc-FR-POXYY2M6-C64no2Sz.js","assets/pa-IN-N4M65BXN-CdXAiUa-.js","assets/pl-PL-T2D74RX3-BfktR2GC.js","assets/pt-BR-5N22H2LF-BMS0hGhj.js","assets/pt-PT-UZXXM6DQ-Clt_m-aW.js","assets/ro-RO-JPDTUUEW-8VZwJRTB.js","assets/ru-RU-B4JR7IUQ-DXB6WjCJ.js","assets/si-LK-N5RQ5JYF-3OCpve4d.js","assets/sk-SK-C5VTKIMK-BEWKAYUl.js","assets/sl-SI-NN7IZMDC-CjuniHw8.js","assets/sv-SE-XGPEYMSR-C02T2BPU.js","assets/ta-IN-2NMHFXQM-Dwu_LpR7.js","assets/th-TH-HPSO5L25-BAmgMbAJ.js","assets/tr-TR-DEFEU3FU-vTO9xmBO.js","assets/uk-UA-QMV73CPH-yUd9Af6s.js","assets/vi-VN-M7AON7JQ-Cy6tHM0s.js","assets/zh-CN-LNUGB5OW-BKmxs4M8.js","assets/zh-HK-E62DVLB3-B7dqTsZx.js","assets/zh-TW-RAJ6MFWO-C9A8RaNK.js","assets/index-Bu97Fipb.js"])))=>i.map(i=>d[i]);
2
+ import{g as Hr,a as ji,_ as ne,j as h,v as Z,r as C,b as Kt,$ as f6,u as Tx,o as jx,s as Ax,f as Dx,e as Lx,h as Rx,i as Px,l as Nx,k as Ox,R as $x,m as Fx,n as zx,p as Bx,q as wn}from"./index-Cr2gUYn7.js";var be={VITE_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",VITE_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",VITE_APP_LIBRARY_URL:"https://libraries.excalidraw.com",VITE_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",VITE_APP_PLUS_LP:"https://plus.excalidraw.com",VITE_APP_PLUS_APP:"https://app.excalidraw.com",VITE_APP_AI_BACKEND:"https://oss-ai.excalidraw.com",VITE_APP_WS_SERVER_URL:"https://oss-collab.excalidraw.com",VITE_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',VITE_APP_ENABLE_TRACKING:"false",VITE_APP_PLUS_EXPORT_PUBLIC_KEY:`MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApQ0jM9Qz8TdFLzcuAZZX
3
+ /WvuKSOJxiw6AR/ZcE3eFQWM/mbFdhQgyK8eHGkKQifKzH1xUZjCxyXcxW6ZO02t
4
+ kPOPxhz+nxUrIoWCD/V4NGmUA1lxwHuO21HN1gzKrN3xHg5EGjyouR9vibT9VDGF
5
+ gq6+4Ic/kJX+AD2MM7Yre2+FsOdysrmuW2Fu3ahuC1uQE7pOe1j0k7auNP0y1q53
6
+ PrB8Ts2LUpepWC1l7zIXFm4ViDULuyWXTEpUcHSsEH8vpd1tckjypxCwkipfZsXx
7
+ iPszy0o0Dx2iArPfWMXlFAI9mvyFCyFC3+nSvfyAUb2C4uZgCwAuyFh/ydPF4DEE
8
+ PQIDAQAB`,VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX:"false",VITE_APP_COLLAPSE_OVERLAY:"false",VITE_APP_ENABLE_ESLINT:"false",PKG_NAME:"@excalidraw/excalidraw",PKG_VERSION:"0.18.0",PROD:!0},p6=Object.defineProperty,Hx=(e,t,n)=>t in e?p6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JX=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Xx=e=>t=>{var n=e[t];if(n)return n();throw new Error("Module not found in bundle: "+t)},U6=(e,t)=>{for(var n in t)p6(e,n,{get:t[n],enumerable:!0})},j=(e,t,n)=>(Hx(e,typeof t!="symbol"?t+"":t,n),n),Ou={},Ap;function m6(){return Ap||(Ap=1,(function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="0.3.0";function n(){for(var c=0,l=new Array(256),u=0;u!=256;++u)c=u,c=c&1?-306674912^c>>>1:c>>>1,c=c&1?-306674912^c>>>1:c>>>1,c=c&1?-306674912^c>>>1:c>>>1,c=c&1?-306674912^c>>>1:c>>>1,c=c&1?-306674912^c>>>1:c>>>1,c=c&1?-306674912^c>>>1:c>>>1,c=c&1?-306674912^c>>>1:c>>>1,c=c&1?-306674912^c>>>1:c>>>1,l[u]=c;return typeof Int32Array<"u"?new Int32Array(l):l}var a=n(),i=typeof Buffer<"u";function r(c){if(c.length>32768&&i)return o(new Buffer(c));for(var l=-1,u=c.length-1,f=0;f<u;)l=a[(l^c.charCodeAt(f++))&255]^l>>>8,l=a[(l^c.charCodeAt(f++))&255]^l>>>8;return f===u&&(l=l>>>8^a[(l^c.charCodeAt(f))&255]),l^-1}function s(c){if(c.length>1e4)return o(c);for(var l=-1,u=0,f=c.length-3;u<f;)l=l>>>8^a[(l^c[u++])&255],l=l>>>8^a[(l^c[u++])&255],l=l>>>8^a[(l^c[u++])&255],l=l>>>8^a[(l^c[u++])&255];for(;u<f+3;)l=l>>>8^a[(l^c[u++])&255];return l^-1}function o(c){for(var l=-1,u=0,f=c.length-7;u<f;)l=l>>>8^a[(l^c[u++])&255],l=l>>>8^a[(l^c[u++])&255],l=l>>>8^a[(l^c[u++])&255],l=l>>>8^a[(l^c[u++])&255],l=l>>>8^a[(l^c[u++])&255],l=l>>>8^a[(l^c[u++])&255],l=l>>>8^a[(l^c[u++])&255],l=l>>>8^a[(l^c[u++])&255];for(;u<f+7;)l=l>>>8^a[(l^c[u++])&255];return l^-1}function d(c){for(var l=-1,u=0,f=c.length,p,U;u<f;)p=c.charCodeAt(u++),p<128?l=l>>>8^a[(l^p)&255]:p<2048?(l=l>>>8^a[(l^(192|p>>6&31))&255],l=l>>>8^a[(l^(128|p&63))&255]):p>=55296&&p<57344?(p=(p&1023)+64,U=c.charCodeAt(u++)&1023,l=l>>>8^a[(l^(240|p>>8&7))&255],l=l>>>8^a[(l^(128|p>>2&63))&255],l=l>>>8^a[(l^(128|U>>6&15|p&3))&255],l=l>>>8^a[(l^(128|U&63))&255]):(l=l>>>8^a[(l^(224|p>>12&15))&255],l=l>>>8^a[(l^(128|p>>6&63))&255],l=l>>>8^a[(l^(128|p&63))&255]);return l^-1}t.table=a,t.bstr=r,t.buf=s,t.str=d})})(Ou)),Ou}var $u,Dp;function Wx(){if(Dp)return $u;Dp=1;var e=m6();$u=i;var t=new Uint8Array(4),n=new Int32Array(t.buffer),a=new Uint32Array(t.buffer);function i(r){if(r[0]!==137)throw new Error("Invalid .png file header");if(r[1]!==80)throw new Error("Invalid .png file header");if(r[2]!==78)throw new Error("Invalid .png file header");if(r[3]!==71)throw new Error("Invalid .png file header");if(r[4]!==13)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(r[5]!==10)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(r[6]!==26)throw new Error("Invalid .png file header");if(r[7]!==10)throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");for(var s=!1,o=[],d=8;d<r.length;){t[3]=r[d++],t[2]=r[d++],t[1]=r[d++],t[0]=r[d++];var c=a[0]+4,l=new Uint8Array(c);l[0]=r[d++],l[1]=r[d++],l[2]=r[d++],l[3]=r[d++];var u=String.fromCharCode(l[0])+String.fromCharCode(l[1])+String.fromCharCode(l[2])+String.fromCharCode(l[3]);if(!o.length&&u!=="IHDR")throw new Error("IHDR header missing");if(u==="IEND"){s=!0,o.push({name:u,data:new Uint8Array(0)});break}for(var f=4;f<c;f++)l[f]=r[d++];t[3]=r[d++],t[2]=r[d++],t[1]=r[d++],t[0]=r[d++];var p=n[0],U=e.buf(l);if(U!==p)throw new Error("CRC values for "+u+" header do not match, PNG file is likely corrupted");var m=new Uint8Array(l.buffer.slice(4));o.push({name:u,data:m})}if(!s)throw new Error(".png file ended prematurely: no IEND header was found");return o}return $u}var Vx=Wx();const g6=Hr(Vx);var Yo={},Fu,Lp;function Gx(){if(Lp)return Fu;Lp=1,Fu=e;function e(t,n){if(t=String(t),n=String(n),!/^[\x00-\xFF]+$/.test(t)||!/^[\x00-\xFF]+$/.test(n))throw new Error("Only Latin-1 characters are permitted in PNG tEXt chunks. You might want to consider base64 encoding and/or zEXt compression");if(t.length>=80)throw new Error('Keyword "'+t+'" is longer than the 79-character limit imposed by the PNG specification');for(var a=t.length+n.length+1,i=new Uint8Array(a),r=0,s,o=0;o<t.length;o++){if(!(s=t.charCodeAt(o)))throw new Error("0x00 character is not permitted in tEXt keywords");i[r++]=s}i[r++]=0;for(var d=0;d<n.length;d++){if(!(s=n.charCodeAt(d)))throw new Error("0x00 character is not permitted in tEXt content");i[r++]=s}return{name:"tEXt",data:i}}return Fu}var zu,Rp;function Zx(){if(Rp)return zu;Rp=1,zu=e;function e(t){t.data&&t.name&&(t=t.data);for(var n=!0,a="",i="",r=0;r<t.length;r++){var s=t[r];if(n)s?i+=String.fromCharCode(s):n=!1;else if(s)a+=String.fromCharCode(s);else throw new Error("Invalid NULL character found. 0x00 character is not permitted in tEXt content")}return{keyword:i,text:a}}return zu}var Pp;function Yx(){return Pp||(Pp=1,Yo.encode=Gx(),Yo.decode=Zx()),Yo}var Kx=Yx();const b6=Hr(Kx);var Bu,Np;function qx(){return Np||(Np=1,Bu=function(e,t,n){var a=[],i=e.length;if(i===0)return a;var r=t<0?Math.max(0,t+i):t||0;for(n!==void 0&&(i=n<0?n+i:n);i-- >r;)a[i-r]=e[i];return a}),Bu}var Hu,Op;function Jx(){if(Op)return Hu;Op=1;var e=qx(),t=m6();Hu=r;var n=new Uint8Array(4),a=new Int32Array(n.buffer),i=new Uint32Array(n.buffer);function r(s){var o=8,d=o,c;for(c=0;c<s.length;c++)o+=s[c].data.length,o+=12;var l=new Uint8Array(o);for(l[0]=137,l[1]=80,l[2]=78,l[3]=71,l[4]=13,l[5]=10,l[6]=26,l[7]=10,c=0;c<s.length;c++){var u=s[c],f=u.name,p=u.data,U=p.length,m=[f.charCodeAt(0),f.charCodeAt(1),f.charCodeAt(2),f.charCodeAt(3)];i[0]=U,l[d++]=n[3],l[d++]=n[2],l[d++]=n[1],l[d++]=n[0],l[d++]=m[0],l[d++]=m[1],l[d++]=m[2],l[d++]=m[3];for(var g=0;g<U;)l[d++]=p[g++];var b=m.concat(e(p)),v=t.buf(b);a[0]=v,l[d++]=n[3],l[d++]=n[2],l[d++]=n[1],l[d++]=n[0]}return l}return Hu}var Qx=Jx();const ev=Hr(Qx);const tv=4,$p=0,Fp=1,nv=2;function Fs(e){let t=e.length;for(;--t>=0;)e[t]=0}const av=0,x6=1,iv=2,rv=3,sv=258,E1=29,So=256,Zl=So+1+E1,bs=30,S1=19,v6=2*Zl+1,pr=15,Xu=16,lv=7,k1=256,y6=16,w6=17,E6=18,Jh=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),xd=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),ov=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),S6=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),dv=512,Za=new Array((Zl+2)*2);Fs(Za);const jl=new Array(bs*2);Fs(jl);const Yl=new Array(dv);Fs(Yl);const Kl=new Array(sv-rv+1);Fs(Kl);const M1=new Array(E1);Fs(M1);const Kd=new Array(bs);Fs(Kd);function Wu(e,t,n,a,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=a,this.max_length=i,this.has_stree=e&&e.length}let k6,M6,C6;function Vu(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const I6=e=>e<256?Yl[e]:Yl[256+(e>>>7)],ql=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},gn=(e,t,n)=>{e.bi_valid>Xu-n?(e.bi_buf|=t<<e.bi_valid&65535,ql(e,e.bi_buf),e.bi_buf=t>>Xu-e.bi_valid,e.bi_valid+=n-Xu):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Ca=(e,t,n)=>{gn(e,n[t*2],n[t*2+1])},_6=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},cv=e=>{e.bi_valid===16?(ql(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},uv=(e,t)=>{const n=t.dyn_tree,a=t.max_code,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,d=t.stat_desc.max_length;let c,l,u,f,p,U,m=0;for(f=0;f<=pr;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<v6;c++)l=e.heap[c],f=n[n[l*2+1]*2+1]+1,f>d&&(f=d,m++),n[l*2+1]=f,!(l>a)&&(e.bl_count[f]++,p=0,l>=o&&(p=s[l-o]),U=n[l*2],e.opt_len+=U*(f+p),r&&(e.static_len+=U*(i[l*2+1]+p)));if(m!==0){do{for(f=d-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[d]--,m-=2}while(m>0);for(f=d;f!==0;f--)for(l=e.bl_count[f];l!==0;)u=e.heap[--c],!(u>a)&&(n[u*2+1]!==f&&(e.opt_len+=(f-n[u*2+1])*n[u*2],n[u*2+1]=f),l--)}},T6=(e,t,n)=>{const a=new Array(pr+1);let i=0,r,s;for(r=1;r<=pr;r++)a[r]=i=i+n[r-1]<<1;for(s=0;s<=t;s++){let o=e[s*2+1];o!==0&&(e[s*2]=_6(a[o]++,o))}},hv=()=>{let e,t,n,a,i;const r=new Array(pr+1);for(n=0,a=0;a<E1-1;a++)for(M1[a]=n,e=0;e<1<<Jh[a];e++)Kl[n++]=a;for(Kl[n-1]=a,i=0,a=0;a<16;a++)for(Kd[a]=i,e=0;e<1<<xd[a];e++)Yl[i++]=a;for(i>>=7;a<bs;a++)for(Kd[a]=i<<7,e=0;e<1<<xd[a]-7;e++)Yl[256+i++]=a;for(t=0;t<=pr;t++)r[t]=0;for(e=0;e<=143;)Za[e*2+1]=8,e++,r[8]++;for(;e<=255;)Za[e*2+1]=9,e++,r[9]++;for(;e<=279;)Za[e*2+1]=7,e++,r[7]++;for(;e<=287;)Za[e*2+1]=8,e++,r[8]++;for(T6(Za,Zl+1,r),e=0;e<bs;e++)jl[e*2+1]=5,jl[e*2]=_6(e,5);k6=new Wu(Za,Jh,So+1,Zl,pr),M6=new Wu(jl,xd,0,bs,pr),C6=new Wu(new Array(0),ov,0,S1,lv)},j6=e=>{let t;for(t=0;t<Zl;t++)e.dyn_ltree[t*2]=0;for(t=0;t<bs;t++)e.dyn_dtree[t*2]=0;for(t=0;t<S1;t++)e.bl_tree[t*2]=0;e.dyn_ltree[k1*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},A6=e=>{e.bi_valid>8?ql(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},fv=(e,t,n,a)=>{A6(e),ql(e,n),ql(e,~n),e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},zp=(e,t,n,a)=>{const i=t*2,r=n*2;return e[i]<e[r]||e[i]===e[r]&&a[t]<=a[n]},Gu=(e,t,n)=>{const a=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&zp(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!zp(t,a,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=a},Bp=(e,t,n)=>{let a,i,r=0,s,o;if(e.last_lit!==0)do a=e.pending_buf[e.d_buf+r*2]<<8|e.pending_buf[e.d_buf+r*2+1],i=e.pending_buf[e.l_buf+r],r++,a===0?Ca(e,i,t):(s=Kl[i],Ca(e,s+So+1,t),o=Jh[s],o!==0&&(i-=M1[s],gn(e,i,o)),a--,s=I6(a),Ca(e,s,n),o=xd[s],o!==0&&(a-=Kd[s],gn(e,a,o)));while(r<e.last_lit);Ca(e,k1,t)},Qh=(e,t)=>{const n=t.dyn_tree,a=t.stat_desc.static_tree,i=t.stat_desc.has_stree,r=t.stat_desc.elems;let s,o,d=-1,c;for(e.heap_len=0,e.heap_max=v6,s=0;s<r;s++)n[s*2]!==0?(e.heap[++e.heap_len]=d=s,e.depth[s]=0):n[s*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=d<2?++d:0,n[c*2]=1,e.depth[c]=0,e.opt_len--,i&&(e.static_len-=a[c*2+1]);for(t.max_code=d,s=e.heap_len>>1;s>=1;s--)Gu(e,n,s);c=r;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Gu(e,n,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,n[c*2]=n[s*2]+n[o*2],e.depth[c]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1,n[s*2+1]=n[o*2+1]=c,e.heap[1]=c++,Gu(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],uv(e,t),T6(n,d,e.bl_count)},Hp=(e,t,n)=>{let a,i=-1,r,s=t[1],o=0,d=7,c=4;for(s===0&&(d=138,c=3),t[(n+1)*2+1]=65535,a=0;a<=n;a++)r=s,s=t[(a+1)*2+1],!(++o<d&&r===s)&&(o<c?e.bl_tree[r*2]+=o:r!==0?(r!==i&&e.bl_tree[r*2]++,e.bl_tree[y6*2]++):o<=10?e.bl_tree[w6*2]++:e.bl_tree[E6*2]++,o=0,i=r,s===0?(d=138,c=3):r===s?(d=6,c=3):(d=7,c=4))},Xp=(e,t,n)=>{let a,i=-1,r,s=t[1],o=0,d=7,c=4;for(s===0&&(d=138,c=3),a=0;a<=n;a++)if(r=s,s=t[(a+1)*2+1],!(++o<d&&r===s)){if(o<c)do Ca(e,r,e.bl_tree);while(--o!==0);else r!==0?(r!==i&&(Ca(e,r,e.bl_tree),o--),Ca(e,y6,e.bl_tree),gn(e,o-3,2)):o<=10?(Ca(e,w6,e.bl_tree),gn(e,o-3,3)):(Ca(e,E6,e.bl_tree),gn(e,o-11,7));o=0,i=r,s===0?(d=138,c=3):r===s?(d=6,c=3):(d=7,c=4)}},pv=e=>{let t;for(Hp(e,e.dyn_ltree,e.l_desc.max_code),Hp(e,e.dyn_dtree,e.d_desc.max_code),Qh(e,e.bl_desc),t=S1-1;t>=3&&e.bl_tree[S6[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Uv=(e,t,n,a)=>{let i;for(gn(e,t-257,5),gn(e,n-1,5),gn(e,a-4,4),i=0;i<a;i++)gn(e,e.bl_tree[S6[i]*2+1],3);Xp(e,e.dyn_ltree,t-1),Xp(e,e.dyn_dtree,n-1)},mv=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return $p;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return Fp;for(n=32;n<So;n++)if(e.dyn_ltree[n*2]!==0)return Fp;return $p};let Wp=!1;const gv=e=>{Wp||(hv(),Wp=!0),e.l_desc=new Vu(e.dyn_ltree,k6),e.d_desc=new Vu(e.dyn_dtree,M6),e.bl_desc=new Vu(e.bl_tree,C6),e.bi_buf=0,e.bi_valid=0,j6(e)},D6=(e,t,n,a)=>{gn(e,(av<<1)+(a?1:0),3),fv(e,t,n)},bv=e=>{gn(e,x6<<1,3),Ca(e,k1,Za),cv(e)},xv=(e,t,n,a)=>{let i,r,s=0;e.level>0?(e.strm.data_type===nv&&(e.strm.data_type=mv(e)),Qh(e,e.l_desc),Qh(e,e.d_desc),s=pv(e),i=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r<=i&&(i=r)):i=r=n+5,n+4<=i&&t!==-1?D6(e,t,n,a):e.strategy===tv||r===i?(gn(e,(x6<<1)+(a?1:0),3),Bp(e,Za,jl)):(gn(e,(iv<<1)+(a?1:0),3),Uv(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),Bp(e,e.dyn_ltree,e.dyn_dtree)),j6(e),a&&A6(e)},vv=(e,t,n)=>(e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Kl[n]+So+1)*2]++,e.dyn_dtree[I6(t)*2]++),e.last_lit===e.lit_bufsize-1);var yv=gv,wv=D6,Ev=xv,Sv=vv,kv=bv,Mv={_tr_init:yv,_tr_stored_block:wv,_tr_flush_block:Ev,_tr_tally:Sv,_tr_align:kv};const Cv=(e,t,n,a)=>{let i=e&65535|0,r=e>>>16&65535|0,s=0;for(;n!==0;){s=n>2e3?2e3:n,n-=s;do i=i+t[a++]|0,r=r+i|0;while(--s);i%=65521,r%=65521}return i|r<<16|0};var Jl=Cv;const Iv=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var a=0;a<8;a++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},_v=new Uint32Array(Iv()),Tv=(e,t,n,a)=>{const i=_v,r=a+n;e^=-1;for(let s=a;s<r;s++)e=e>>>8^i[(e^t[s])&255];return e^-1};var Nt=Tv,Cr={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Hc={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:jv,_tr_stored_block:Av,_tr_flush_block:Dv,_tr_tally:Ni,_tr_align:Lv}=Mv,{Z_NO_FLUSH:Xr,Z_PARTIAL_FLUSH:Rv,Z_FULL_FLUSH:Pv,Z_FINISH:Oi,Z_BLOCK:Vp,Z_OK:Ia,Z_STREAM_END:Gp,Z_STREAM_ERROR:Nn,Z_DATA_ERROR:Nv,Z_BUF_ERROR:Zu,Z_DEFAULT_COMPRESSION:Ov,Z_FILTERED:$v,Z_HUFFMAN_ONLY:Ko,Z_RLE:Fv,Z_FIXED:zv,Z_DEFAULT_STRATEGY:Bv,Z_UNKNOWN:Hv,Z_DEFLATED:Xc}=Hc,Xv=9,Wv=15,Vv=8,Gv=29,Zv=256,ef=Zv+1+Gv,Yv=30,Kv=19,qv=2*ef+1,Jv=15,_e=3,Ai=258,ra=Ai+_e+1,Qv=32,Wc=42,tf=69,vd=73,yd=91,wd=103,Ur=113,gl=666,Rt=1,ko=2,Ir=3,zs=4,ey=3,Di=(e,t)=>(e.msg=Cr[t],t),Zp=e=>(e<<1)-(e>4?9:0),Ti=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let ty=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,$i=ty;const Ei=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Xt=(e,t)=>{Dv(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ei(e.strm)},Oe=(e,t)=>{e.pending_buf[e.pending++]=t},qs=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},ny=(e,t,n,a)=>{let i=e.avail_in;return i>a&&(i=a),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=Jl(e.adler,t,i,n):e.state.wrap===2&&(e.adler=Nt(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},L6=(e,t)=>{let n=e.max_chain_length,a=e.strstart,i,r,s=e.prev_length,o=e.nice_match;const d=e.strstart>e.w_size-ra?e.strstart-(e.w_size-ra):0,c=e.window,l=e.w_mask,u=e.prev,f=e.strstart+Ai;let p=c[a+s-1],U=c[a+s];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do if(i=t,!(c[i+s]!==U||c[i+s-1]!==p||c[i]!==c[a]||c[++i]!==c[a+1])){a+=2,i++;do;while(c[++a]===c[++i]&&c[++a]===c[++i]&&c[++a]===c[++i]&&c[++a]===c[++i]&&c[++a]===c[++i]&&c[++a]===c[++i]&&c[++a]===c[++i]&&c[++a]===c[++i]&&a<f);if(r=Ai-(f-a),a=f-Ai,r>s){if(e.match_start=t,s=r,r>=o)break;p=c[a+s-1],U=c[a+s]}}while((t=u[t&l])>d&&--n!==0);return s<=e.lookahead?s:e.lookahead},_r=e=>{const t=e.w_size;let n,a,i,r,s;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-ra)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,a=e.hash_size,n=a;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--a);a=t,n=a;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--a);r+=t}if(e.strm.avail_in===0)break;if(a=ny(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=a,e.lookahead+e.insert>=_e)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=$i(e,e.ins_h,e.window[s+1]);e.insert&&(e.ins_h=$i(e,e.ins_h,e.window[s+_e-1]),e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<_e)););}while(e.lookahead<ra&&e.strm.avail_in!==0)},ay=(e,t)=>{let n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(_r(e),e.lookahead===0&&t===Xr)return Rt;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;const a=e.block_start+n;if((e.strstart===0||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,Xt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-ra&&(Xt(e,!1),e.strm.avail_out===0))return Rt}return e.insert=0,t===Oi?(Xt(e,!0),e.strm.avail_out===0?Ir:zs):(e.strstart>e.block_start&&(Xt(e,!1),e.strm.avail_out===0),Rt)},Yu=(e,t)=>{let n,a;for(;;){if(e.lookahead<ra){if(_r(e),e.lookahead<ra&&t===Xr)return Rt;if(e.lookahead===0)break}if(n=0,e.lookahead>=_e&&(e.ins_h=$i(e,e.ins_h,e.window[e.strstart+_e-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-ra&&(e.match_length=L6(e,n)),e.match_length>=_e)if(a=Ni(e,e.strstart-e.match_start,e.match_length-_e),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=_e){e.match_length--;do e.strstart++,e.ins_h=$i(e,e.ins_h,e.window[e.strstart+_e-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=$i(e,e.ins_h,e.window[e.strstart+1]);else a=Ni(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(a&&(Xt(e,!1),e.strm.avail_out===0))return Rt}return e.insert=e.strstart<_e-1?e.strstart:_e-1,t===Oi?(Xt(e,!0),e.strm.avail_out===0?Ir:zs):e.last_lit&&(Xt(e,!1),e.strm.avail_out===0)?Rt:ko},Yr=(e,t)=>{let n,a,i;for(;;){if(e.lookahead<ra){if(_r(e),e.lookahead<ra&&t===Xr)return Rt;if(e.lookahead===0)break}if(n=0,e.lookahead>=_e&&(e.ins_h=$i(e,e.ins_h,e.window[e.strstart+_e-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=_e-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-ra&&(e.match_length=L6(e,n),e.match_length<=5&&(e.strategy===$v||e.match_length===_e&&e.strstart-e.match_start>4096)&&(e.match_length=_e-1)),e.prev_length>=_e&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-_e,a=Ni(e,e.strstart-1-e.prev_match,e.prev_length-_e),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=$i(e,e.ins_h,e.window[e.strstart+_e-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=_e-1,e.strstart++,a&&(Xt(e,!1),e.strm.avail_out===0))return Rt}else if(e.match_available){if(a=Ni(e,0,e.window[e.strstart-1]),a&&Xt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Rt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(a=Ni(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<_e-1?e.strstart:_e-1,t===Oi?(Xt(e,!0),e.strm.avail_out===0?Ir:zs):e.last_lit&&(Xt(e,!1),e.strm.avail_out===0)?Rt:ko},iy=(e,t)=>{let n,a,i,r;const s=e.window;for(;;){if(e.lookahead<=Ai){if(_r(e),e.lookahead<=Ai&&t===Xr)return Rt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=_e&&e.strstart>0&&(i=e.strstart-1,a=s[i],a===s[++i]&&a===s[++i]&&a===s[++i])){r=e.strstart+Ai;do;while(a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&a===s[++i]&&i<r);e.match_length=Ai-(r-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=_e?(n=Ni(e,1,e.match_length-_e),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Ni(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Xt(e,!1),e.strm.avail_out===0))return Rt}return e.insert=0,t===Oi?(Xt(e,!0),e.strm.avail_out===0?Ir:zs):e.last_lit&&(Xt(e,!1),e.strm.avail_out===0)?Rt:ko},ry=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(_r(e),e.lookahead===0)){if(t===Xr)return Rt;break}if(e.match_length=0,n=Ni(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Xt(e,!1),e.strm.avail_out===0))return Rt}return e.insert=0,t===Oi?(Xt(e,!0),e.strm.avail_out===0?Ir:zs):e.last_lit&&(Xt(e,!1),e.strm.avail_out===0)?Rt:ko};function ga(e,t,n,a,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=a,this.func=i}const bl=[new ga(0,0,0,0,ay),new ga(4,4,8,4,Yu),new ga(4,5,16,8,Yu),new ga(4,6,32,32,Yu),new ga(4,4,16,16,Yr),new ga(8,16,32,32,Yr),new ga(8,16,128,128,Yr),new ga(8,32,128,256,Yr),new ga(32,128,258,1024,Yr),new ga(32,258,258,4096,Yr)],sy=e=>{e.window_size=2*e.w_size,Ti(e.head),e.max_lazy_match=bl[e.level].max_lazy,e.good_match=bl[e.level].good_length,e.nice_match=bl[e.level].nice_length,e.max_chain_length=bl[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=_e-1,e.match_available=0,e.ins_h=0};function ly(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Xc,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(qv*2),this.dyn_dtree=new Uint16Array((2*Yv+1)*2),this.bl_tree=new Uint16Array((2*Kv+1)*2),Ti(this.dyn_ltree),Ti(this.dyn_dtree),Ti(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Jv+1),this.heap=new Uint16Array(2*ef+1),Ti(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*ef+1),Ti(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const R6=e=>{if(!e||!e.state)return Di(e,Nn);e.total_in=e.total_out=0,e.data_type=Hv;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Wc:Ur,e.adler=t.wrap===2?0:1,t.last_flush=Xr,jv(t),Ia},P6=e=>{const t=R6(e);return t===Ia&&sy(e.state),t},oy=(e,t)=>!e||!e.state||e.state.wrap!==2?Nn:(e.state.gzhead=t,Ia),N6=(e,t,n,a,i,r)=>{if(!e)return Nn;let s=1;if(t===Ov&&(t=6),a<0?(s=0,a=-a):a>15&&(s=2,a-=16),i<1||i>Xv||n!==Xc||a<8||a>15||t<0||t>9||r<0||r>zv)return Di(e,Nn);a===8&&(a=9);const o=new ly;return e.state=o,o.strm=e,o.wrap=s,o.gzhead=null,o.w_bits=a,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+_e-1)/_e),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=r,o.method=n,P6(e)},dy=(e,t)=>N6(e,t,Xc,Wv,Vv,Bv),cy=(e,t)=>{let n,a;if(!e||!e.state||t>Vp||t<0)return e?Di(e,Nn):Nn;const i=e.state;if(!e.output||!e.input&&e.avail_in!==0||i.status===gl&&t!==Oi)return Di(e,e.avail_out===0?Zu:Nn);i.strm=e;const r=i.last_flush;if(i.last_flush=t,i.status===Wc)if(i.wrap===2)e.adler=0,Oe(i,31),Oe(i,139),Oe(i,8),i.gzhead?(Oe(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Oe(i,i.gzhead.time&255),Oe(i,i.gzhead.time>>8&255),Oe(i,i.gzhead.time>>16&255),Oe(i,i.gzhead.time>>24&255),Oe(i,i.level===9?2:i.strategy>=Ko||i.level<2?4:0),Oe(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(Oe(i,i.gzhead.extra.length&255),Oe(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=Nt(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=tf):(Oe(i,0),Oe(i,0),Oe(i,0),Oe(i,0),Oe(i,0),Oe(i,i.level===9?2:i.strategy>=Ko||i.level<2?4:0),Oe(i,ey),i.status=Ur);else{let s=Xc+(i.w_bits-8<<4)<<8,o=-1;i.strategy>=Ko||i.level<2?o=0:i.level<6?o=1:i.level===6?o=2:o=3,s|=o<<6,i.strstart!==0&&(s|=Qv),s+=31-s%31,i.status=Ur,qs(i,s),i.strstart!==0&&(qs(i,e.adler>>>16),qs(i,e.adler&65535)),e.adler=1}if(i.status===tf)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Nt(e.adler,i.pending_buf,i.pending-n,n)),Ei(e),n=i.pending,i.pending===i.pending_buf_size));)Oe(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(e.adler=Nt(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=vd)}else i.status=vd;if(i.status===vd)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Nt(e.adler,i.pending_buf,i.pending-n,n)),Ei(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}i.gzindex<i.gzhead.name.length?a=i.gzhead.name.charCodeAt(i.gzindex++)&255:a=0,Oe(i,a)}while(a!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=Nt(e.adler,i.pending_buf,i.pending-n,n)),a===0&&(i.gzindex=0,i.status=yd)}else i.status=yd;if(i.status===yd)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(e.adler=Nt(e.adler,i.pending_buf,i.pending-n,n)),Ei(e),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}i.gzindex<i.gzhead.comment.length?a=i.gzhead.comment.charCodeAt(i.gzindex++)&255:a=0,Oe(i,a)}while(a!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=Nt(e.adler,i.pending_buf,i.pending-n,n)),a===0&&(i.status=wd)}else i.status=wd;if(i.status===wd&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Ei(e),i.pending+2<=i.pending_buf_size&&(Oe(i,e.adler&255),Oe(i,e.adler>>8&255),e.adler=0,i.status=Ur)):i.status=Ur),i.pending!==0){if(Ei(e),e.avail_out===0)return i.last_flush=-1,Ia}else if(e.avail_in===0&&Zp(t)<=Zp(r)&&t!==Oi)return Di(e,Zu);if(i.status===gl&&e.avail_in!==0)return Di(e,Zu);if(e.avail_in!==0||i.lookahead!==0||t!==Xr&&i.status!==gl){let s=i.strategy===Ko?ry(i,t):i.strategy===Fv?iy(i,t):bl[i.level].func(i,t);if((s===Ir||s===zs)&&(i.status=gl),s===Rt||s===Ir)return e.avail_out===0&&(i.last_flush=-1),Ia;if(s===ko&&(t===Rv?Lv(i):t!==Vp&&(Av(i,0,0,!1),t===Pv&&(Ti(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Ei(e),e.avail_out===0))return i.last_flush=-1,Ia}return t!==Oi?Ia:i.wrap<=0?Gp:(i.wrap===2?(Oe(i,e.adler&255),Oe(i,e.adler>>8&255),Oe(i,e.adler>>16&255),Oe(i,e.adler>>24&255),Oe(i,e.total_in&255),Oe(i,e.total_in>>8&255),Oe(i,e.total_in>>16&255),Oe(i,e.total_in>>24&255)):(qs(i,e.adler>>>16),qs(i,e.adler&65535)),Ei(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?Ia:Gp)},uy=e=>{if(!e||!e.state)return Nn;const t=e.state.status;return t!==Wc&&t!==tf&&t!==vd&&t!==yd&&t!==wd&&t!==Ur&&t!==gl?Di(e,Nn):(e.state=null,t===Ur?Di(e,Nv):Ia)},hy=(e,t)=>{let n=t.length;if(!e||!e.state)return Nn;const a=e.state,i=a.wrap;if(i===2||i===1&&a.status!==Wc||a.lookahead)return Nn;if(i===1&&(e.adler=Jl(e.adler,t,n,0)),a.wrap=0,n>=a.w_size){i===0&&(Ti(a.head),a.strstart=0,a.block_start=0,a.insert=0);let d=new Uint8Array(a.w_size);d.set(t.subarray(n-a.w_size,n),0),t=d,n=a.w_size}const r=e.avail_in,s=e.next_in,o=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,_r(a);a.lookahead>=_e;){let d=a.strstart,c=a.lookahead-(_e-1);do a.ins_h=$i(a,a.ins_h,a.window[d+_e-1]),a.prev[d&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=d,d++;while(--c);a.strstart=d,a.lookahead=_e-1,_r(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=_e-1,a.match_available=0,e.next_in=s,e.input=o,e.avail_in=r,a.wrap=i,Ia};var fy=dy,py=N6,Uy=P6,my=R6,gy=oy,by=cy,xy=uy,vy=hy,yy="pako deflate (from Nodeca project)",Al={deflateInit:fy,deflateInit2:py,deflateReset:Uy,deflateResetKeep:my,deflateSetHeader:gy,deflate:by,deflateEnd:xy,deflateSetDictionary:vy,deflateInfo:yy};const wy=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Ey=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const a in n)wy(n,a)&&(e[a]=n[a])}}return e},Sy=e=>{let t=0;for(let a=0,i=e.length;a<i;a++)t+=e[a].length;const n=new Uint8Array(t);for(let a=0,i=0,r=e.length;a<r;a++){let s=e[a];n.set(s,i),i+=s.length}return n},Vc={assign:Ey,flattenChunks:Sy};let O6=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{O6=!1}const Ql=new Uint8Array(256);for(let e=0;e<256;e++)Ql[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Ql[254]=Ql[254]=1;var ky=e=>{let t,n,a,i,r,s=e.length,o=0;for(i=0;i<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<s&&(a=e.charCodeAt(i+1),(a&64512)===56320&&(n=65536+(n-55296<<10)+(a-56320),i++)),o+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(o),r=0,i=0;r<o;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<s&&(a=e.charCodeAt(i+1),(a&64512)===56320&&(n=65536+(n-55296<<10)+(a-56320),i++)),n<128?t[r++]=n:n<2048?(t[r++]=192|n>>>6,t[r++]=128|n&63):n<65536?(t[r++]=224|n>>>12,t[r++]=128|n>>>6&63,t[r++]=128|n&63):(t[r++]=240|n>>>18,t[r++]=128|n>>>12&63,t[r++]=128|n>>>6&63,t[r++]=128|n&63);return t};const My=(e,t)=>{if(t<65534&&e.subarray&&O6)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let a=0;a<t;a++)n+=String.fromCharCode(e[a]);return n};var Cy=(e,t)=>{let n,a;const i=t||e.length,r=new Array(i*2);for(a=0,n=0;n<i;){let s=e[n++];if(s<128){r[a++]=s;continue}let o=Ql[s];if(o>4){r[a++]=65533,n+=o-1;continue}for(s&=o===2?31:o===3?15:7;o>1&&n<i;)s=s<<6|e[n++]&63,o--;if(o>1){r[a++]=65533;continue}s<65536?r[a++]=s:(s-=65536,r[a++]=55296|s>>10&1023,r[a++]=56320|s&1023)}return My(r,a)},Iy=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Ql[e[n]]>t?n:t},eo={string2buf:ky,buf2string:Cy,utf8border:Iy};function _y(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var $6=_y;const F6=Object.prototype.toString,{Z_NO_FLUSH:Ty,Z_SYNC_FLUSH:jy,Z_FULL_FLUSH:Ay,Z_FINISH:Dy,Z_OK:qd,Z_STREAM_END:Ly,Z_DEFAULT_COMPRESSION:Ry,Z_DEFAULT_STRATEGY:Py,Z_DEFLATED:Ny}=Hc;function Gc(e){this.options=Vc.assign({level:Ry,method:Ny,chunkSize:16384,windowBits:15,memLevel:8,strategy:Py},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $6,this.strm.avail_out=0;let n=Al.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==qd)throw new Error(Cr[n]);if(t.header&&Al.deflateSetHeader(this.strm,t.header),t.dictionary){let a;if(typeof t.dictionary=="string"?a=eo.string2buf(t.dictionary):F6.call(t.dictionary)==="[object ArrayBuffer]"?a=new Uint8Array(t.dictionary):a=t.dictionary,n=Al.deflateSetDictionary(this.strm,a),n!==qd)throw new Error(Cr[n]);this._dict_set=!0}}Gc.prototype.push=function(e,t){const n=this.strm,a=this.options.chunkSize;let i,r;if(this.ended)return!1;for(t===~~t?r=t:r=t===!0?Dy:Ty,typeof e=="string"?n.input=eo.string2buf(e):F6.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(a),n.next_out=0,n.avail_out=a),(r===jy||r===Ay)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Al.deflate(n,r),i===Ly)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Al.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===qd;if(n.avail_out===0){this.onData(n.output);continue}if(r>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};Gc.prototype.onData=function(e){this.chunks.push(e)};Gc.prototype.onEnd=function(e){e===qd&&(this.result=Vc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Oy(e,t){const n=new Gc(t);if(n.push(e,!0),n.err)throw n.msg||Cr[n.err];return n.result}var $y=Oy,Fy={deflate:$y};const qo=30,zy=12;var By=function(t,n){let a,i,r,s,o,d,c,l,u,f,p,U,m,g,b,v,x,y,w,k,M,I,A,_;const T=t.state;a=t.next_in,A=t.input,i=a+(t.avail_in-5),r=t.next_out,_=t.output,s=r-(n-t.avail_out),o=r+(t.avail_out-257),d=T.dmax,c=T.wsize,l=T.whave,u=T.wnext,f=T.window,p=T.hold,U=T.bits,m=T.lencode,g=T.distcode,b=(1<<T.lenbits)-1,v=(1<<T.distbits)-1;e:do{U<15&&(p+=A[a++]<<U,U+=8,p+=A[a++]<<U,U+=8),x=m[p&b];t:for(;;){if(y=x>>>24,p>>>=y,U-=y,y=x>>>16&255,y===0)_[r++]=x&65535;else if(y&16){w=x&65535,y&=15,y&&(U<y&&(p+=A[a++]<<U,U+=8),w+=p&(1<<y)-1,p>>>=y,U-=y),U<15&&(p+=A[a++]<<U,U+=8,p+=A[a++]<<U,U+=8),x=g[p&v];n:for(;;){if(y=x>>>24,p>>>=y,U-=y,y=x>>>16&255,y&16){if(k=x&65535,y&=15,U<y&&(p+=A[a++]<<U,U+=8,U<y&&(p+=A[a++]<<U,U+=8)),k+=p&(1<<y)-1,k>d){t.msg="invalid distance too far back",T.mode=qo;break e}if(p>>>=y,U-=y,y=r-s,k>y){if(y=k-y,y>l&&T.sane){t.msg="invalid distance too far back",T.mode=qo;break e}if(M=0,I=f,u===0){if(M+=c-y,y<w){w-=y;do _[r++]=f[M++];while(--y);M=r-k,I=_}}else if(u<y){if(M+=c+u-y,y-=u,y<w){w-=y;do _[r++]=f[M++];while(--y);if(M=0,u<w){y=u,w-=y;do _[r++]=f[M++];while(--y);M=r-k,I=_}}}else if(M+=u-y,y<w){w-=y;do _[r++]=f[M++];while(--y);M=r-k,I=_}for(;w>2;)_[r++]=I[M++],_[r++]=I[M++],_[r++]=I[M++],w-=3;w&&(_[r++]=I[M++],w>1&&(_[r++]=I[M++]))}else{M=r-k;do _[r++]=_[M++],_[r++]=_[M++],_[r++]=_[M++],w-=3;while(w>2);w&&(_[r++]=_[M++],w>1&&(_[r++]=_[M++]))}}else if((y&64)===0){x=g[(x&65535)+(p&(1<<y)-1)];continue n}else{t.msg="invalid distance code",T.mode=qo;break e}break}}else if((y&64)===0){x=m[(x&65535)+(p&(1<<y)-1)];continue t}else if(y&32){T.mode=zy;break e}else{t.msg="invalid literal/length code",T.mode=qo;break e}break}}while(a<i&&r<o);w=U>>3,a-=w,U-=w<<3,p&=(1<<U)-1,t.next_in=a,t.next_out=r,t.avail_in=a<i?5+(i-a):5-(a-i),t.avail_out=r<o?257+(o-r):257-(r-o),T.hold=p,T.bits=U};const Kr=15,Yp=852,Kp=592,qp=0,Ku=1,Jp=2,Hy=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Xy=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Wy=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Vy=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Gy=(e,t,n,a,i,r,s,o)=>{const d=o.bits;let c=0,l=0,u=0,f=0,p=0,U=0,m=0,g=0,b=0,v=0,x,y,w,k,M,I=null,A=0,_;const T=new Uint16Array(Kr+1),L=new Uint16Array(Kr+1);let R=null,F=0,P,$,O;for(c=0;c<=Kr;c++)T[c]=0;for(l=0;l<a;l++)T[t[n+l]]++;for(p=d,f=Kr;f>=1&&T[f]===0;f--);if(p>f&&(p=f),f===0)return i[r++]=1<<24|64<<16|0,i[r++]=1<<24|64<<16|0,o.bits=1,0;for(u=1;u<f&&T[u]===0;u++);for(p<u&&(p=u),g=1,c=1;c<=Kr;c++)if(g<<=1,g-=T[c],g<0)return-1;if(g>0&&(e===qp||f!==1))return-1;for(L[1]=0,c=1;c<Kr;c++)L[c+1]=L[c]+T[c];for(l=0;l<a;l++)t[n+l]!==0&&(s[L[t[n+l]]++]=l);if(e===qp?(I=R=s,_=19):e===Ku?(I=Hy,A-=257,R=Xy,F-=257,_=256):(I=Wy,R=Vy,_=-1),v=0,l=0,c=u,M=r,U=p,m=0,w=-1,b=1<<p,k=b-1,e===Ku&&b>Yp||e===Jp&&b>Kp)return 1;for(;;){P=c-m,s[l]<_?($=0,O=s[l]):s[l]>_?($=R[F+s[l]],O=I[A+s[l]]):($=96,O=0),x=1<<c-m,y=1<<U,u=y;do y-=x,i[M+(v>>m)+y]=P<<24|$<<16|O|0;while(y!==0);for(x=1<<c-1;v&x;)x>>=1;if(x!==0?(v&=x-1,v+=x):v=0,l++,--T[c]===0){if(c===f)break;c=t[n+s[l]]}if(c>p&&(v&k)!==w){for(m===0&&(m=p),M+=u,U=c-m,g=1<<U;U+m<f&&(g-=T[U+m],!(g<=0));)U++,g<<=1;if(b+=1<<U,e===Ku&&b>Yp||e===Jp&&b>Kp)return 1;w=v&k,i[w]=p<<24|U<<16|M-r|0}}return v!==0&&(i[M+v]=c-m<<24|64<<16|0),o.bits=p,0};var Dl=Gy;const Zy=0,z6=1,B6=2,{Z_FINISH:Qp,Z_BLOCK:Yy,Z_TREES:Jo,Z_OK:Tr,Z_STREAM_END:Ky,Z_NEED_DICT:qy,Z_STREAM_ERROR:Fn,Z_DATA_ERROR:H6,Z_MEM_ERROR:X6,Z_BUF_ERROR:Jy,Z_DEFLATED:eU}=Hc,W6=1,tU=2,nU=3,aU=4,iU=5,rU=6,sU=7,lU=8,oU=9,dU=10,Jd=11,Ba=12,qu=13,cU=14,Ju=15,uU=16,hU=17,fU=18,pU=19,Qo=20,ed=21,UU=22,mU=23,gU=24,bU=25,xU=26,Qu=27,vU=28,yU=29,st=30,V6=31,Qy=32,ew=852,tw=592,nw=15,aw=nw,wU=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function iw(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const G6=e=>{if(!e||!e.state)return Fn;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=W6,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(ew),t.distcode=t.distdyn=new Int32Array(tw),t.sane=1,t.back=-1,Tr},Z6=e=>{if(!e||!e.state)return Fn;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,G6(e)},Y6=(e,t)=>{let n;if(!e||!e.state)return Fn;const a=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?Fn:(a.window!==null&&a.wbits!==t&&(a.window=null),a.wrap=n,a.wbits=t,Z6(e))},K6=(e,t)=>{if(!e)return Fn;const n=new iw;e.state=n,n.window=null;const a=Y6(e,t);return a!==Tr&&(e.state=null),a},rw=e=>K6(e,aw);let EU=!0,eh,th;const sw=e=>{if(EU){eh=new Int32Array(512),th=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Dl(z6,e.lens,0,288,eh,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Dl(B6,e.lens,0,32,th,0,e.work,{bits:5}),EU=!1}e.lencode=eh,e.lenbits=9,e.distcode=th,e.distbits=5},q6=(e,t,n,a)=>{let i;const r=e.state;return r.window===null&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),a>=r.wsize?(r.window.set(t.subarray(n-r.wsize,n),0),r.wnext=0,r.whave=r.wsize):(i=r.wsize-r.wnext,i>a&&(i=a),r.window.set(t.subarray(n-a,n-a+i),r.wnext),a-=i,a?(r.window.set(t.subarray(n-a,n),0),r.wnext=a,r.whave=r.wsize):(r.wnext+=i,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=i))),0},lw=(e,t)=>{let n,a,i,r,s,o,d,c,l,u,f,p,U,m,g=0,b,v,x,y,w,k,M,I;const A=new Uint8Array(4);let _,T;const L=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Fn;n=e.state,n.mode===Ba&&(n.mode=qu),s=e.next_out,i=e.output,d=e.avail_out,r=e.next_in,a=e.input,o=e.avail_in,c=n.hold,l=n.bits,u=o,f=d,I=Tr;e:for(;;)switch(n.mode){case W6:if(n.wrap===0){n.mode=qu;break}for(;l<16;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}if(n.wrap&2&&c===35615){n.check=0,A[0]=c&255,A[1]=c>>>8&255,n.check=Nt(n.check,A,2,0),c=0,l=0,n.mode=tU;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=st;break}if((c&15)!==eU){e.msg="unknown compression method",n.mode=st;break}if(c>>>=4,l-=4,M=(c&15)+8,n.wbits===0)n.wbits=M;else if(M>n.wbits){e.msg="invalid window size",n.mode=st;break}n.dmax=1<<n.wbits,e.adler=n.check=1,n.mode=c&512?dU:Ba,c=0,l=0;break;case tU:for(;l<16;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}if(n.flags=c,(n.flags&255)!==eU){e.msg="unknown compression method",n.mode=st;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=st;break}n.head&&(n.head.text=c>>8&1),n.flags&512&&(A[0]=c&255,A[1]=c>>>8&255,n.check=Nt(n.check,A,2,0)),c=0,l=0,n.mode=nU;case nU:for(;l<32;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}n.head&&(n.head.time=c),n.flags&512&&(A[0]=c&255,A[1]=c>>>8&255,A[2]=c>>>16&255,A[3]=c>>>24&255,n.check=Nt(n.check,A,4,0)),c=0,l=0,n.mode=aU;case aU:for(;l<16;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}n.head&&(n.head.xflags=c&255,n.head.os=c>>8),n.flags&512&&(A[0]=c&255,A[1]=c>>>8&255,n.check=Nt(n.check,A,2,0)),c=0,l=0,n.mode=iU;case iU:if(n.flags&1024){for(;l<16;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}n.length=c,n.head&&(n.head.extra_len=c),n.flags&512&&(A[0]=c&255,A[1]=c>>>8&255,n.check=Nt(n.check,A,2,0)),c=0,l=0}else n.head&&(n.head.extra=null);n.mode=rU;case rU:if(n.flags&1024&&(p=n.length,p>o&&(p=o),p&&(n.head&&(M=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(a.subarray(r,r+p),M)),n.flags&512&&(n.check=Nt(n.check,a,p,r)),o-=p,r+=p,n.length-=p),n.length))break e;n.length=0,n.mode=sU;case sU:if(n.flags&2048){if(o===0)break e;p=0;do M=a[r+p++],n.head&&M&&n.length<65536&&(n.head.name+=String.fromCharCode(M));while(M&&p<o);if(n.flags&512&&(n.check=Nt(n.check,a,p,r)),o-=p,r+=p,M)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=lU;case lU:if(n.flags&4096){if(o===0)break e;p=0;do M=a[r+p++],n.head&&M&&n.length<65536&&(n.head.comment+=String.fromCharCode(M));while(M&&p<o);if(n.flags&512&&(n.check=Nt(n.check,a,p,r)),o-=p,r+=p,M)break e}else n.head&&(n.head.comment=null);n.mode=oU;case oU:if(n.flags&512){for(;l<16;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}if(c!==(n.check&65535)){e.msg="header crc mismatch",n.mode=st;break}c=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Ba;break;case dU:for(;l<32;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}e.adler=n.check=wU(c),c=0,l=0,n.mode=Jd;case Jd:if(n.havedict===0)return e.next_out=s,e.avail_out=d,e.next_in=r,e.avail_in=o,n.hold=c,n.bits=l,qy;e.adler=n.check=1,n.mode=Ba;case Ba:if(t===Yy||t===Jo)break e;case qu:if(n.last){c>>>=l&7,l-=l&7,n.mode=Qu;break}for(;l<3;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}switch(n.last=c&1,c>>>=1,l-=1,c&3){case 0:n.mode=cU;break;case 1:if(sw(n),n.mode=Qo,t===Jo){c>>>=2,l-=2;break e}break;case 2:n.mode=hU;break;case 3:e.msg="invalid block type",n.mode=st}c>>>=2,l-=2;break;case cU:for(c>>>=l&7,l-=l&7;l<32;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=st;break}if(n.length=c&65535,c=0,l=0,n.mode=Ju,t===Jo)break e;case Ju:n.mode=uU;case uU:if(p=n.length,p){if(p>o&&(p=o),p>d&&(p=d),p===0)break e;i.set(a.subarray(r,r+p),s),o-=p,r+=p,d-=p,s+=p,n.length-=p;break}n.mode=Ba;break;case hU:for(;l<14;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}if(n.nlen=(c&31)+257,c>>>=5,l-=5,n.ndist=(c&31)+1,c>>>=5,l-=5,n.ncode=(c&15)+4,c>>>=4,l-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=st;break}n.have=0,n.mode=fU;case fU:for(;n.have<n.ncode;){for(;l<3;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}n.lens[L[n.have++]]=c&7,c>>>=3,l-=3}for(;n.have<19;)n.lens[L[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,_={bits:n.lenbits},I=Dl(Zy,n.lens,0,19,n.lencode,0,n.work,_),n.lenbits=_.bits,I){e.msg="invalid code lengths set",n.mode=st;break}n.have=0,n.mode=pU;case pU:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[c&(1<<n.lenbits)-1],b=g>>>24,v=g>>>16&255,x=g&65535,!(b<=l);){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}if(x<16)c>>>=b,l-=b,n.lens[n.have++]=x;else{if(x===16){for(T=b+2;l<T;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}if(c>>>=b,l-=b,n.have===0){e.msg="invalid bit length repeat",n.mode=st;break}M=n.lens[n.have-1],p=3+(c&3),c>>>=2,l-=2}else if(x===17){for(T=b+3;l<T;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}c>>>=b,l-=b,M=0,p=3+(c&7),c>>>=3,l-=3}else{for(T=b+7;l<T;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}c>>>=b,l-=b,M=0,p=11+(c&127),c>>>=7,l-=7}if(n.have+p>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=st;break}for(;p--;)n.lens[n.have++]=M}}if(n.mode===st)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=st;break}if(n.lenbits=9,_={bits:n.lenbits},I=Dl(z6,n.lens,0,n.nlen,n.lencode,0,n.work,_),n.lenbits=_.bits,I){e.msg="invalid literal/lengths set",n.mode=st;break}if(n.distbits=6,n.distcode=n.distdyn,_={bits:n.distbits},I=Dl(B6,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,_),n.distbits=_.bits,I){e.msg="invalid distances set",n.mode=st;break}if(n.mode=Qo,t===Jo)break e;case Qo:n.mode=ed;case ed:if(o>=6&&d>=258){e.next_out=s,e.avail_out=d,e.next_in=r,e.avail_in=o,n.hold=c,n.bits=l,By(e,f),s=e.next_out,i=e.output,d=e.avail_out,r=e.next_in,a=e.input,o=e.avail_in,c=n.hold,l=n.bits,n.mode===Ba&&(n.back=-1);break}for(n.back=0;g=n.lencode[c&(1<<n.lenbits)-1],b=g>>>24,v=g>>>16&255,x=g&65535,!(b<=l);){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}if(v&&(v&240)===0){for(y=b,w=v,k=x;g=n.lencode[k+((c&(1<<y+w)-1)>>y)],b=g>>>24,v=g>>>16&255,x=g&65535,!(y+b<=l);){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=b,l-=b,n.back+=b,n.length=x,v===0){n.mode=xU;break}if(v&32){n.back=-1,n.mode=Ba;break}if(v&64){e.msg="invalid literal/length code",n.mode=st;break}n.extra=v&15,n.mode=UU;case UU:if(n.extra){for(T=n.extra;l<T;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=mU;case mU:for(;g=n.distcode[c&(1<<n.distbits)-1],b=g>>>24,v=g>>>16&255,x=g&65535,!(b<=l);){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}if((v&240)===0){for(y=b,w=v,k=x;g=n.distcode[k+((c&(1<<y+w)-1)>>y)],b=g>>>24,v=g>>>16&255,x=g&65535,!(y+b<=l);){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=b,l-=b,n.back+=b,v&64){e.msg="invalid distance code",n.mode=st;break}n.offset=x,n.extra=v&15,n.mode=gU;case gU:if(n.extra){for(T=n.extra;l<T;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=st;break}n.mode=bU;case bU:if(d===0)break e;if(p=f-d,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=st;break}p>n.wnext?(p-=n.wnext,U=n.wsize-p):U=n.wnext-p,p>n.length&&(p=n.length),m=n.window}else m=i,U=s-n.offset,p=n.length;p>d&&(p=d),d-=p,n.length-=p;do i[s++]=m[U++];while(--p);n.length===0&&(n.mode=ed);break;case xU:if(d===0)break e;i[s++]=n.length,d--,n.mode=ed;break;case Qu:if(n.wrap){for(;l<32;){if(o===0)break e;o--,c|=a[r++]<<l,l+=8}if(f-=d,e.total_out+=f,n.total+=f,f&&(e.adler=n.check=n.flags?Nt(n.check,i,f,s-f):Jl(n.check,i,f,s-f)),f=d,(n.flags?c:wU(c))!==n.check){e.msg="incorrect data check",n.mode=st;break}c=0,l=0}n.mode=vU;case vU:if(n.wrap&&n.flags){for(;l<32;){if(o===0)break e;o--,c+=a[r++]<<l,l+=8}if(c!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=st;break}c=0,l=0}n.mode=yU;case yU:I=Ky;break e;case st:I=H6;break e;case V6:return X6;case Qy:default:return Fn}return e.next_out=s,e.avail_out=d,e.next_in=r,e.avail_in=o,n.hold=c,n.bits=l,(n.wsize||f!==e.avail_out&&n.mode<st&&(n.mode<Qu||t!==Qp))&&q6(e,e.output,e.next_out,f-e.avail_out),u-=e.avail_in,f-=e.avail_out,e.total_in+=u,e.total_out+=f,n.total+=f,n.wrap&&f&&(e.adler=n.check=n.flags?Nt(n.check,i,f,e.next_out-f):Jl(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Ba?128:0)+(n.mode===Qo||n.mode===Ju?256:0),(u===0&&f===0||t===Qp)&&I===Tr&&(I=Jy),I},ow=e=>{if(!e||!e.state)return Fn;let t=e.state;return t.window&&(t.window=null),e.state=null,Tr},dw=(e,t)=>{if(!e||!e.state)return Fn;const n=e.state;return(n.wrap&2)===0?Fn:(n.head=t,t.done=!1,Tr)},cw=(e,t)=>{const n=t.length;let a,i,r;return!e||!e.state||(a=e.state,a.wrap!==0&&a.mode!==Jd)?Fn:a.mode===Jd&&(i=1,i=Jl(i,t,n,0),i!==a.check)?H6:(r=q6(e,t,n,n),r?(a.mode=V6,X6):(a.havedict=1,Tr))};var uw=Z6,hw=Y6,fw=G6,pw=rw,Uw=K6,mw=lw,gw=ow,bw=dw,xw=cw,vw="pako inflate (from Nodeca project)",Ya={inflateReset:uw,inflateReset2:hw,inflateResetKeep:fw,inflateInit:pw,inflateInit2:Uw,inflate:mw,inflateEnd:gw,inflateGetHeader:bw,inflateSetDictionary:xw,inflateInfo:vw};function yw(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var ww=yw;const J6=Object.prototype.toString,{Z_NO_FLUSH:Ew,Z_FINISH:Sw,Z_OK:to,Z_STREAM_END:nh,Z_NEED_DICT:ah,Z_STREAM_ERROR:kw,Z_DATA_ERROR:SU,Z_MEM_ERROR:Mw}=Hc;function Zc(e){this.options=Vc.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $6,this.strm.avail_out=0;let n=Ya.inflateInit2(this.strm,t.windowBits);if(n!==to)throw new Error(Cr[n]);if(this.header=new ww,Ya.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=eo.string2buf(t.dictionary):J6.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Ya.inflateSetDictionary(this.strm,t.dictionary),n!==to)))throw new Error(Cr[n])}Zc.prototype.push=function(e,t){const n=this.strm,a=this.options.chunkSize,i=this.options.dictionary;let r,s,o;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?Sw:Ew,J6.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(a),n.next_out=0,n.avail_out=a),r=Ya.inflate(n,s),r===ah&&i&&(r=Ya.inflateSetDictionary(n,i),r===to?r=Ya.inflate(n,s):r===SU&&(r=ah));n.avail_in>0&&r===nh&&n.state.wrap>0&&e[n.next_in]!==0;)Ya.inflateReset(n),r=Ya.inflate(n,s);switch(r){case kw:case SU:case ah:case Mw:return this.onEnd(r),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(n.avail_out===0||r===nh))if(this.options.to==="string"){let d=eo.utf8border(n.output,n.next_out),c=n.next_out-d,l=eo.buf2string(n.output,d);n.next_out=c,n.avail_out=a-c,c&&n.output.set(n.output.subarray(d,d+c),0),this.onData(l)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(r===to&&o===0)){if(r===nh)return r=Ya.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};Zc.prototype.onData=function(e){this.chunks.push(e)};Zc.prototype.onEnd=function(e){e===to&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Vc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Cw(e,t){const n=new Zc(t);if(n.push(e),n.err)throw n.msg||Cr[n.err];return n.result}var Iw=Cw,_w={inflate:Iw};const{deflate:Tw}=Fy,{inflate:jw}=_w;var Aw=Tw,Dw=jw;const Lw="#ffffff",Rw="#000000",Pw=["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],Nw=["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],Ow=["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],$w=["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],Fw=["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],zw=["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],Bw=["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],Hw=["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],Xw=["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],Ww=["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],Vw=["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],Gw=["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],Zw=["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"],Ft={white:Lw,black:Rw,gray:Pw,red:Nw,pink:Ow,grape:$w,violet:Fw,indigo:zw,blue:Bw,cyan:Hw,teal:Xw,green:Ww,lime:Vw,yellow:Gw,orange:Zw};let C1=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");var ih,kU;function Yw(){if(kU)return ih;kU=1;var e="Expected a function",t=NaN,n="[object Symbol]",a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,d=typeof ji=="object"&&ji&&ji.Object===Object&&ji,c=typeof self=="object"&&self&&self.Object===Object&&self,l=d||c||Function("return this")(),u=Object.prototype,f=u.toString,p=Math.max,U=Math.min,m=function(){return l.Date.now()};function g(k,M,I){var A,_,T,L,R,F,P=0,$=!1,O=!1,V=!0;if(typeof k!="function")throw new TypeError(e);M=w(M)||0,v(I)&&($=!!I.leading,O="maxWait"in I,T=O?p(w(I.maxWait)||0,M):T,V="trailing"in I?!!I.trailing:V);function W(me){var Be=A,ye=_;return A=_=void 0,P=me,L=k.apply(ye,Be),L}function K(me){return P=me,R=setTimeout(Ie,M),$?W(me):L}function se(me){var Be=me-F,ye=me-P,Ae=M-Be;return O?U(Ae,T-ye):Ae}function le(me){var Be=me-F,ye=me-P;return F===void 0||Be>=M||Be<0||O&&ye>=T}function Ie(){var me=m();if(le(me))return Qe(me);R=setTimeout(Ie,se(me))}function Qe(me){return R=void 0,V&&A?W(me):(A=_=void 0,L)}function rt(){R!==void 0&&clearTimeout(R),P=0,A=F=_=R=void 0}function at(){return R===void 0?L:Qe(m())}function ce(){var me=m(),Be=le(me);if(A=arguments,_=this,F=me,Be){if(R===void 0)return K(F);if(O)return R=setTimeout(Ie,M),W(F)}return R===void 0&&(R=setTimeout(Ie,M)),L}return ce.cancel=rt,ce.flush=at,ce}function b(k,M,I){var A=!0,_=!0;if(typeof k!="function")throw new TypeError(e);return v(I)&&(A="leading"in I?!!I.leading:A,_="trailing"in I?!!I.trailing:_),g(k,M,{leading:A,maxWait:M,trailing:_})}function v(k){var M=typeof k;return!!k&&(M=="object"||M=="function")}function x(k){return!!k&&typeof k=="object"}function y(k){return typeof k=="symbol"||x(k)&&f.call(k)==n}function w(k){if(typeof k=="number")return k;if(y(k))return t;if(v(k)){var M=typeof k.valueOf=="function"?k.valueOf():k;k=v(M)?M+"":M}if(typeof k!="string")return k===0?k:+k;k=k.replace(a,"");var I=r.test(k);return I||s.test(k)?o(k.slice(2),I?2:8):i.test(k)?t:+k}return ih=b,ih}var Kw=Yw();const Mo=Hr(Kw);var Ed={exports:{}},qw=Ed.exports,MU;function Jw(){return MU||(MU=1,(function(e,t){(function(n,a){e.exports=a()})(qw,function(){var n=function(){this._listeners={}};n.prototype.addEventListener=function(c,l){this._listeners[c]=this._listeners[c]||[],this._listeners[c].indexOf(l)<0&&this._listeners[c].push(l)},n.prototype.removeEventListener=function(c,l){if(this._listeners[c]){var u=this._listeners[c].indexOf(l);u>=0&&this._listeners[c].splice(u,1)}},n.prototype.dispatchEvent=function(c){if(this._listeners[c.type]&&this._listeners[c.type].length)for(var l=this._listeners[c.type].slice(),u=0,f=l.length;u<f;++u)l[u].call(this,c)};var a=function(c){return typeof c.constructor=="function"&&c.constructor.name==="GeneratorFunction"},i=function(c){return{next:function(){var l=c();return l?{value:l}:{done:!0}}}},r=function(c){var l=!1;return{next:function(){return l?{done:!0}:(l=!0,{value:c})}}},s=function(c,l){var u=typeof c;if(u==="object"){if(typeof c.next=="function")return c;if(typeof c.then=="function")return r(c)}return u==="function"?a(c)?c():i(c):r(l.resolve(c))},o=function(c,l,u){this.target=c,this.type=l,this.data=u},d=function(c,l,u){if(n.call(this),typeof l!="number"||Math.floor(l)!==l||l<1)throw new Error("Invalid concurrency");this._concurrency=l,this._options=u||{},this._options.promise=this._options.promise||Promise,this._iterator=s(c,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return d.prototype=new n,d.prototype.constructor=d,d.prototype.concurrency=function(c){return typeof c<"u"&&(this._concurrency=c,this.active()&&this._proceed()),this._concurrency},d.prototype.size=function(){return this._size},d.prototype.active=function(){return!!this._promise},d.prototype.promise=function(){return this._promise},d.prototype.start=function(){var c=this,l=this._options.promise;return this._promise=new l(function(u,f){c._callbacks={reject:f,resolve:u},c._proceed()}),this._promise},d.prototype._fireEvent=function(c,l){this.dispatchEvent(new o(this,c,l))},d.prototype._settle=function(c){c?this._callbacks.reject(c):this._callbacks.resolve(),this._promise=null,this._callbacks=null},d.prototype._onPooledPromiseFulfilled=function(c,l){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:c,result:l}),this._proceed())},d.prototype._onPooledPromiseRejected=function(c,l){this._size--,this.active()&&(this._fireEvent("rejected",{promise:c,error:l}),this._settle(l||new Error("Unknown error")))},d.prototype._trackPromise=function(c){var l=this;c.then(function(u){l._onPooledPromiseFulfilled(c,u)},function(u){l._onPooledPromiseRejected(c,u)}).catch(function(u){l._settle(new Error("Promise processing failed: "+u))})},d.prototype._proceed=function(){if(!this._done){for(var c={done:!1};this._size<this._concurrency&&!(c=this._iterator.next()).done;)this._size++,this._trackPromise(c.value);this._done=c===null||!!c.done}this._done&&this._size===0&&this._settle()},d.PromisePoolEvent=o,d.PromisePool=d,d})})(Ed)),Ed.exports}var Qw=Jw();const eE=Hr(Qw);function nf(e,t,n){if(e&&e.length){const[a,i]=t,r=Math.PI/180*n,s=Math.cos(r),o=Math.sin(r);for(const d of e){const[c,l]=d;d[0]=(c-a)*s-(l-i)*o+a,d[1]=(c-a)*o+(l-i)*s+i}}}function tE(e,t,n){const a=[];e.forEach(i=>a.push(...i)),nf(a,t,n)}function nE(e,t){return e[0]===t[0]&&e[1]===t[1]}function aE(e,t,n,a=1){const i=n,r=Math.max(t,.1),s=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,o=[0,0];if(i)for(const c of s)nf(c,o,i);const d=iE(s,r,a);if(i){for(const c of s)nf(c,o,-i);tE(d,o,-i)}return d}function iE(e,t,n){const a=[];for(const c of e){const l=[...c];nE(l[0],l[l.length-1])||l.push([l[0][0],l[0][1]]),l.length>2&&a.push(l)}const i=[];t=Math.max(t,.1);const r=[];for(const c of a)for(let l=0;l<c.length-1;l++){const u=c[l],f=c[l+1];if(u[1]!==f[1]){const p=Math.min(u[1],f[1]);r.push({ymin:p,ymax:Math.max(u[1],f[1]),x:p===u[1]?u[0]:f[0],islope:(f[0]-u[0])/(f[1]-u[1])})}}if(r.sort((c,l)=>c.ymin<l.ymin?-1:c.ymin>l.ymin?1:c.x<l.x?-1:c.x>l.x?1:c.ymax===l.ymax?0:(c.ymax-l.ymax)/Math.abs(c.ymax-l.ymax)),!r.length)return i;let s=[],o=r[0].ymin,d=0;for(;s.length||r.length;){if(r.length){let c=-1;for(let u=0;u<r.length&&!(r[u].ymin>o);u++)c=u;r.splice(0,c+1).forEach(u=>{s.push({s:o,edge:u})})}if(s=s.filter(c=>!(c.edge.ymax<=o)),s.sort((c,l)=>c.edge.x===l.edge.x?0:(c.edge.x-l.edge.x)/Math.abs(c.edge.x-l.edge.x)),(n!==1||d%t===0)&&s.length>1)for(let c=0;c<s.length;c=c+2){const l=c+1;if(l>=s.length)break;const u=s[c].edge,f=s[l].edge;i.push([[Math.round(u.x),o],[Math.round(f.x),o]])}o+=n,s.forEach(c=>{c.edge.x=c.edge.x+n*c.edge.islope}),d++}return i}function Co(e,t){var n;const a=t.hachureAngle+90;let i=t.hachureGap;i<0&&(i=t.strokeWidth*4),i=Math.max(i,.1);let r=1;return t.roughness>=1&&(((n=t.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(r=i),aE(e,i,a,r||1)}class I1{constructor(t){this.helper=t}fillPolygons(t,n){return this._fillPolygons(t,n)}_fillPolygons(t,n){const a=Co(t,n);return{type:"fillSketch",ops:this.renderLines(a,n)}}renderLines(t,n){const a=[];for(const i of t)a.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],n));return a}}function Yc(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}class rE extends I1{fillPolygons(t,n){let a=n.hachureGap;a<0&&(a=n.strokeWidth*4),a=Math.max(a,.1);const i=Object.assign({},n,{hachureGap:a}),r=Co(t,i),s=Math.PI/180*n.hachureAngle,o=[],d=a*.5*Math.cos(s),c=a*.5*Math.sin(s);for(const[u,f]of r)Yc([u,f])&&o.push([[u[0]-d,u[1]+c],[...f]],[[u[0]+d,u[1]-c],[...f]]);return{type:"fillSketch",ops:this.renderLines(o,n)}}}class sE extends I1{fillPolygons(t,n){const a=this._fillPolygons(t,n),i=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),r=this._fillPolygons(t,i);return a.ops=a.ops.concat(r.ops),a}}class lE{constructor(t){this.helper=t}fillPolygons(t,n){n=Object.assign({},n,{hachureAngle:0});const a=Co(t,n);return this.dotsOnLines(a,n)}dotsOnLines(t,n){const a=[];let i=n.hachureGap;i<0&&(i=n.strokeWidth*4),i=Math.max(i,.1);let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const s=i/4;for(const o of t){const d=Yc(o),c=d/i,l=Math.ceil(c)-1,u=d-l*i,f=(o[0][0]+o[1][0])/2-i/4,p=Math.min(o[0][1],o[1][1]);for(let U=0;U<l;U++){const m=p+u+U*i,g=f-s+Math.random()*2*s,b=m-s+Math.random()*2*s,v=this.helper.ellipse(g,b,r,r,n);a.push(...v.ops)}}return{type:"fillSketch",ops:a}}}class oE{constructor(t){this.helper=t}fillPolygons(t,n){const a=Co(t,n);return{type:"fillSketch",ops:this.dashedLine(a,n)}}dashedLine(t,n){const a=n.dashOffset<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashOffset,i=n.dashGap<0?n.hachureGap<0?n.strokeWidth*4:n.hachureGap:n.dashGap,r=[];return t.forEach(s=>{const o=Yc(s),d=Math.floor(o/(a+i)),c=(o+i-d*(a+i))/2;let l=s[0],u=s[1];l[0]>u[0]&&(l=s[1],u=s[0]);const f=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let p=0;p<d;p++){const U=p*(a+i),m=U+a,g=[l[0]+U*Math.cos(f)+c*Math.cos(f),l[1]+U*Math.sin(f)+c*Math.sin(f)],b=[l[0]+m*Math.cos(f)+c*Math.cos(f),l[1]+m*Math.sin(f)+c*Math.sin(f)];r.push(...this.helper.doubleLineOps(g[0],g[1],b[0],b[1],n))}}),r}}class dE{constructor(t){this.helper=t}fillPolygons(t,n){const a=n.hachureGap<0?n.strokeWidth*4:n.hachureGap,i=n.zigzagOffset<0?a:n.zigzagOffset;n=Object.assign({},n,{hachureGap:a+i});const r=Co(t,n);return{type:"fillSketch",ops:this.zigzagLines(r,i,n)}}zigzagLines(t,n,a){const i=[];return t.forEach(r=>{const s=Yc(r),o=Math.round(s/(2*n));let d=r[0],c=r[1];d[0]>c[0]&&(d=r[1],c=r[0]);const l=Math.atan((c[1]-d[1])/(c[0]-d[0]));for(let u=0;u<o;u++){const f=u*2*n,p=(u+1)*2*n,U=Math.sqrt(2*Math.pow(n,2)),m=[d[0]+f*Math.cos(l),d[1]+f*Math.sin(l)],g=[d[0]+p*Math.cos(l),d[1]+p*Math.sin(l)],b=[m[0]+U*Math.cos(l+Math.PI/4),m[1]+U*Math.sin(l+Math.PI/4)];i.push(...this.helper.doubleLineOps(m[0],m[1],b[0],b[1],a),...this.helper.doubleLineOps(b[0],b[1],g[0],g[1],a))}}),i}}const un={};function cE(e,t){let n=e.fillStyle||"hachure";if(!un[n])switch(n){case"zigzag":un[n]||(un[n]=new rE(t));break;case"cross-hatch":un[n]||(un[n]=new sE(t));break;case"dots":un[n]||(un[n]=new lE(t));break;case"dashed":un[n]||(un[n]=new oE(t));break;case"zigzag-line":un[n]||(un[n]=new dE(t));break;case"hachure":default:n="hachure",un[n]||(un[n]=new I1(t));break}return un[n]}function uE(){return Math.floor(Math.random()*2**31)}class Q6{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const hE=0,af=1,e5=2,td={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function fE(e){const t=new Array;for(;e!=="";)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:hE,text:RegExp.$1},e=e.substr(RegExp.$1.length);else if(e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))t[t.length]={type:af,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length);else return[];return t[t.length]={type:e5,text:""},t}function rh(e,t){return e.type===t}function _1(e){const t=[],n=fE(e);let a="BOD",i=0,r=n[i];for(;!rh(r,e5);){let s=0;const o=[];if(a==="BOD")if(r.text==="M"||r.text==="m")i++,s=td[r.text],a=r.text;else return _1("M0,0"+e);else rh(r,af)?s=td[a]:(i++,s=td[r.text],a=r.text);if(i+s<n.length){for(let d=i;d<i+s;d++){const c=n[d];if(rh(c,af))o[o.length]=+c.text;else throw new Error("Param not a number: "+a+","+c.text)}if(typeof td[a]=="number"){const d={key:a,data:o};t.push(d),i+=s,r=n[i],a==="M"&&(a="L"),a==="m"&&(a="l")}else throw new Error("Bad segment: "+a)}else throw new Error("Path data ended short")}return t}function t5(e){let t=0,n=0,a=0,i=0;const r=[];for(const{key:s,data:o}of e)switch(s){case"M":r.push({key:"M",data:[...o]}),[t,n]=o,[a,i]=o;break;case"m":t+=o[0],n+=o[1],r.push({key:"M",data:[t,n]}),a=t,i=n;break;case"L":r.push({key:"L",data:[...o]}),[t,n]=o;break;case"l":t+=o[0],n+=o[1],r.push({key:"L",data:[t,n]});break;case"C":r.push({key:"C",data:[...o]}),t=o[4],n=o[5];break;case"c":{const d=o.map((c,l)=>l%2?c+n:c+t);r.push({key:"C",data:d}),t=d[4],n=d[5];break}case"Q":r.push({key:"Q",data:[...o]}),t=o[2],n=o[3];break;case"q":{const d=o.map((c,l)=>l%2?c+n:c+t);r.push({key:"Q",data:d}),t=d[2],n=d[3];break}case"A":r.push({key:"A",data:[...o]}),t=o[5],n=o[6];break;case"a":t+=o[5],n+=o[6],r.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],t,n]});break;case"H":r.push({key:"H",data:[...o]}),t=o[0];break;case"h":t+=o[0],r.push({key:"H",data:[t]});break;case"V":r.push({key:"V",data:[...o]}),n=o[0];break;case"v":n+=o[0],r.push({key:"V",data:[n]});break;case"S":r.push({key:"S",data:[...o]}),t=o[2],n=o[3];break;case"s":{const d=o.map((c,l)=>l%2?c+n:c+t);r.push({key:"S",data:d}),t=d[2],n=d[3];break}case"T":r.push({key:"T",data:[...o]}),t=o[0],n=o[1];break;case"t":t+=o[0],n+=o[1],r.push({key:"T",data:[t,n]});break;case"Z":case"z":r.push({key:"Z",data:[]}),t=a,n=i;break}return r}function n5(e){const t=[];let n="",a=0,i=0,r=0,s=0,o=0,d=0;for(const{key:c,data:l}of e){switch(c){case"M":t.push({key:"M",data:[...l]}),[a,i]=l,[r,s]=l;break;case"C":t.push({key:"C",data:[...l]}),a=l[4],i=l[5],o=l[2],d=l[3];break;case"L":t.push({key:"L",data:[...l]}),[a,i]=l;break;case"H":a=l[0],t.push({key:"L",data:[a,i]});break;case"V":i=l[0],t.push({key:"L",data:[a,i]});break;case"S":{let u=0,f=0;n==="C"||n==="S"?(u=a+(a-o),f=i+(i-d)):(u=a,f=i),t.push({key:"C",data:[u,f,...l]}),o=l[0],d=l[1],a=l[2],i=l[3];break}case"T":{const[u,f]=l;let p=0,U=0;n==="Q"||n==="T"?(p=a+(a-o),U=i+(i-d)):(p=a,U=i);const m=a+2*(p-a)/3,g=i+2*(U-i)/3,b=u+2*(p-u)/3,v=f+2*(U-f)/3;t.push({key:"C",data:[m,g,b,v,u,f]}),o=p,d=U,a=u,i=f;break}case"Q":{const[u,f,p,U]=l,m=a+2*(u-a)/3,g=i+2*(f-i)/3,b=p+2*(u-p)/3,v=U+2*(f-U)/3;t.push({key:"C",data:[m,g,b,v,p,U]}),o=u,d=f,a=p,i=U;break}case"A":{const u=Math.abs(l[0]),f=Math.abs(l[1]),p=l[2],U=l[3],m=l[4],g=l[5],b=l[6];u===0||f===0?(t.push({key:"C",data:[a,i,g,b,g,b]}),a=g,i=b):(a!==g||i!==b)&&(a5(a,i,g,b,u,f,p,U,m).forEach(function(x){t.push({key:"C",data:x})}),a=g,i=b);break}case"Z":t.push({key:"Z",data:[]}),a=r,i=s;break}n=c}return t}function pE(e){return Math.PI*e/180}function Js(e,t,n){const a=e*Math.cos(n)-t*Math.sin(n),i=e*Math.sin(n)+t*Math.cos(n);return[a,i]}function a5(e,t,n,a,i,r,s,o,d,c){const l=pE(s);let u=[],f=0,p=0,U=0,m=0;if(c)[f,p,U,m]=c;else{[e,t]=Js(e,t,-l),[n,a]=Js(n,a,-l);const L=(e-n)/2,R=(t-a)/2;let F=L*L/(i*i)+R*R/(r*r);F>1&&(F=Math.sqrt(F),i=F*i,r=F*r);const P=o===d?-1:1,$=i*i,O=r*r,V=$*O-$*R*R-O*L*L,W=$*R*R+O*L*L,K=P*Math.sqrt(Math.abs(V/W));U=K*i*R/r+(e+n)/2,m=K*-r*L/i+(t+a)/2,f=Math.asin(parseFloat(((t-m)/r).toFixed(9))),p=Math.asin(parseFloat(((a-m)/r).toFixed(9))),e<U&&(f=Math.PI-f),n<U&&(p=Math.PI-p),f<0&&(f=Math.PI*2+f),p<0&&(p=Math.PI*2+p),d&&f>p&&(f=f-Math.PI*2),!d&&p>f&&(p=p-Math.PI*2)}let g=p-f;if(Math.abs(g)>Math.PI*120/180){const L=p,R=n,F=a;d&&p>f?p=f+Math.PI*120/180*1:p=f+Math.PI*120/180*-1,n=U+i*Math.cos(p),a=m+r*Math.sin(p),u=a5(n,a,R,F,i,r,s,0,d,[p,L,U,m])}g=p-f;const b=Math.cos(f),v=Math.sin(f),x=Math.cos(p),y=Math.sin(p),w=Math.tan(g/4),k=4/3*i*w,M=4/3*r*w,I=[e,t],A=[e+k*v,t-M*b],_=[n+k*y,a-M*x],T=[n,a];if(A[0]=2*I[0]-A[0],A[1]=2*I[1]-A[1],c)return[A,_,T].concat(u);{u=[A,_,T].concat(u);const L=[];for(let R=0;R<u.length;R+=3){const F=Js(u[R][0],u[R][1],l),P=Js(u[R+1][0],u[R+1][1],l),$=Js(u[R+2][0],u[R+2][1],l);L.push([F[0],F[1],P[0],P[1],$[0],$[1]])}return L}}const UE={randOffset:vE,randOffsetWithRange:yE,ellipse:bE,doubleLineOps:wE};function i5(e,t,n,a,i){return{type:"path",ops:ii(e,t,n,a,i)}}function Sd(e,t,n){const a=(e||[]).length;if(a>2){const i=[];for(let r=0;r<a-1;r++)i.push(...ii(e[r][0],e[r][1],e[r+1][0],e[r+1][1],n));return t&&i.push(...ii(e[a-1][0],e[a-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}else if(a===2)return i5(e[0][0],e[0][1],e[1][0],e[1][1],n);return{type:"path",ops:[]}}function mE(e,t){return Sd(e,!0,t)}function gE(e,t,n,a,i){const r=[[e,t],[e+n,t],[e+n,t+a],[e,t+a]];return mE(r,i)}function CU(e,t){let n=jU(e,1*(1+t.roughness*.2),t);if(!t.disableMultiStroke){const a=jU(e,1.5*(1+t.roughness*.22),EE(t));n=n.concat(a)}return{type:"path",ops:n}}function bE(e,t,n,a,i){const r=r5(n,a,i);return rf(e,t,i,r).opset}function r5(e,t,n){const a=Math.sqrt(Math.PI*2*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*a)),r=Math.PI*2/i;let s=Math.abs(e/2),o=Math.abs(t/2);const d=1-n.curveFitting;return s+=he(s*d,n),o+=he(o*d,n),{increment:r,rx:s,ry:o}}function rf(e,t,n,a){const[i,r]=AU(a.increment,e,t,a.rx,a.ry,1,a.increment*Qd(.1,Qd(.4,1,n),n),n);let s=ec(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){const[o]=AU(a.increment,e,t,a.rx,a.ry,1.5,0,n),d=ec(o,null,n);s=s.concat(d)}return{estimatedPoints:r,opset:{type:"path",ops:s}}}function IU(e,t,n,a,i,r,s,o,d){const c=e,l=t;let u=Math.abs(n/2),f=Math.abs(a/2);u+=he(u*.01,d),f+=he(f*.01,d);let p=i,U=r;for(;p<0;)p+=Math.PI*2,U+=Math.PI*2;U-p>Math.PI*2&&(p=0,U=Math.PI*2);const m=Math.PI*2/d.curveStepCount,g=Math.min(m/2,(U-p)/2),b=DU(g,c,l,u,f,p,U,1,d);if(!d.disableMultiStroke){const v=DU(g,c,l,u,f,p,U,1.5,d);b.push(...v)}return s&&(o?b.push(...ii(c,l,c+u*Math.cos(p),l+f*Math.sin(p),d),...ii(c,l,c+u*Math.cos(U),l+f*Math.sin(U),d)):b.push({op:"lineTo",data:[c,l]},{op:"lineTo",data:[c+u*Math.cos(p),l+f*Math.sin(p)]})),{type:"path",ops:b}}function _U(e,t){const n=n5(t5(_1(e))),a=[];let i=[0,0],r=[0,0];for(const{key:s,data:o}of n)switch(s){case"M":{r=[o[0],o[1]],i=[o[0],o[1]];break}case"L":a.push(...ii(r[0],r[1],o[0],o[1],t)),r=[o[0],o[1]];break;case"C":{const[d,c,l,u,f,p]=o;a.push(...SE(d,c,l,u,f,p,r,t)),r=[f,p];break}case"Z":a.push(...ii(r[0],r[1],i[0],i[1],t)),r=[i[0],i[1]];break}return{type:"path",ops:a}}function sh(e,t){const n=[];for(const a of e)if(a.length){const i=t.maxRandomnessOffset||0,r=a.length;if(r>2){n.push({op:"move",data:[a[0][0]+he(i,t),a[0][1]+he(i,t)]});for(let s=1;s<r;s++)n.push({op:"lineTo",data:[a[s][0]+he(i,t),a[s][1]+he(i,t)]})}}return{type:"fillPath",ops:n}}function rs(e,t){return cE(t,UE).fillPolygons(e,t)}function xE(e,t,n,a,i,r,s){const o=e,d=t;let c=Math.abs(n/2),l=Math.abs(a/2);c+=he(c*.01,s),l+=he(l*.01,s);let u=i,f=r;for(;u<0;)u+=Math.PI*2,f+=Math.PI*2;f-u>Math.PI*2&&(u=0,f=Math.PI*2);const p=(f-u)/s.curveStepCount,U=[];for(let m=u;m<=f;m=m+p)U.push([o+c*Math.cos(m),d+l*Math.sin(m)]);return U.push([o+c*Math.cos(f),d+l*Math.sin(f)]),U.push([o,d]),rs([U],s)}function vE(e,t){return he(e,t)}function yE(e,t,n){return Qd(e,t,n)}function wE(e,t,n,a,i){return ii(e,t,n,a,i,!0)}function EE(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function s5(e){return e.randomizer||(e.randomizer=new Q6(e.seed||0)),e.randomizer.next()}function Qd(e,t,n,a=1){return n.roughness*a*(s5(n)*(t-e)+e)}function he(e,t,n=1){return Qd(-e,e,t,n)}function ii(e,t,n,a,i,r=!1){const s=r?i.disableMultiStrokeFill:i.disableMultiStroke,o=TU(e,t,n,a,i,!0,!1);if(s)return o;const d=TU(e,t,n,a,i,!0,!0);return o.concat(d)}function TU(e,t,n,a,i,r,s){const o=Math.pow(e-n,2)+Math.pow(t-a,2),d=Math.sqrt(o);let c=1;d<200?c=1:d>500?c=.4:c=-.0016668*d+1.233334;let l=i.maxRandomnessOffset||0;l*l*100>o&&(l=d/10);const u=l/2,f=.2+s5(i)*.2;let p=i.bowing*i.maxRandomnessOffset*(a-t)/200,U=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=he(p,i,c),U=he(U,i,c);const m=[],g=()=>he(u,i,c),b=()=>he(l,i,c),v=i.preserveVertices;return s?m.push({op:"move",data:[e+(v?0:g()),t+(v?0:g())]}):m.push({op:"move",data:[e+(v?0:he(l,i,c)),t+(v?0:he(l,i,c))]}),s?m.push({op:"bcurveTo",data:[p+e+(n-e)*f+g(),U+t+(a-t)*f+g(),p+e+2*(n-e)*f+g(),U+t+2*(a-t)*f+g(),n+(v?0:g()),a+(v?0:g())]}):m.push({op:"bcurveTo",data:[p+e+(n-e)*f+b(),U+t+(a-t)*f+b(),p+e+2*(n-e)*f+b(),U+t+2*(a-t)*f+b(),n+(v?0:b()),a+(v?0:b())]}),m}function jU(e,t,n){const a=[];a.push([e[0][0]+he(t,n),e[0][1]+he(t,n)]),a.push([e[0][0]+he(t,n),e[0][1]+he(t,n)]);for(let i=1;i<e.length;i++)a.push([e[i][0]+he(t,n),e[i][1]+he(t,n)]),i===e.length-1&&a.push([e[i][0]+he(t,n),e[i][1]+he(t,n)]);return ec(a,null,n)}function ec(e,t,n){const a=e.length,i=[];if(a>3){const r=[],s=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let o=1;o+2<a;o++){const d=e[o];r[0]=[d[0],d[1]],r[1]=[d[0]+(s*e[o+1][0]-s*e[o-1][0])/6,d[1]+(s*e[o+1][1]-s*e[o-1][1])/6],r[2]=[e[o+1][0]+(s*e[o][0]-s*e[o+2][0])/6,e[o+1][1]+(s*e[o][1]-s*e[o+2][1])/6],r[3]=[e[o+1][0],e[o+1][1]],i.push({op:"bcurveTo",data:[r[1][0],r[1][1],r[2][0],r[2][1],r[3][0],r[3][1]]})}}else a===3?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):a===2&&i.push(...ii(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function AU(e,t,n,a,i,r,s,o){const d=o.roughness===0,c=[],l=[];if(d){e=e/4,l.push([t+a*Math.cos(-e),n+i*Math.sin(-e)]);for(let u=0;u<=Math.PI*2;u=u+e){const f=[t+a*Math.cos(u),n+i*Math.sin(u)];c.push(f),l.push(f)}l.push([t+a*Math.cos(0),n+i*Math.sin(0)]),l.push([t+a*Math.cos(e),n+i*Math.sin(e)])}else{const u=he(.5,o)-Math.PI/2;l.push([he(r,o)+t+.9*a*Math.cos(u-e),he(r,o)+n+.9*i*Math.sin(u-e)]);const f=Math.PI*2+u-.01;for(let p=u;p<f;p=p+e){const U=[he(r,o)+t+a*Math.cos(p),he(r,o)+n+i*Math.sin(p)];c.push(U),l.push(U)}l.push([he(r,o)+t+a*Math.cos(u+Math.PI*2+s*.5),he(r,o)+n+i*Math.sin(u+Math.PI*2+s*.5)]),l.push([he(r,o)+t+.98*a*Math.cos(u+s),he(r,o)+n+.98*i*Math.sin(u+s)]),l.push([he(r,o)+t+.9*a*Math.cos(u+s*.5),he(r,o)+n+.9*i*Math.sin(u+s*.5)])}return[l,c]}function DU(e,t,n,a,i,r,s,o,d){const c=r+he(.1,d),l=[];l.push([he(o,d)+t+.9*a*Math.cos(c-e),he(o,d)+n+.9*i*Math.sin(c-e)]);for(let u=c;u<=s;u=u+e)l.push([he(o,d)+t+a*Math.cos(u),he(o,d)+n+i*Math.sin(u)]);return l.push([t+a*Math.cos(s),n+i*Math.sin(s)]),l.push([t+a*Math.cos(s),n+i*Math.sin(s)]),ec(l,null,d)}function SE(e,t,n,a,i,r,s,o){const d=[],c=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3];let l=[0,0];const u=o.disableMultiStroke?1:2,f=o.preserveVertices;for(let p=0;p<u;p++)p===0?d.push({op:"move",data:[s[0],s[1]]}):d.push({op:"move",data:[s[0]+(f?0:he(c[0],o)),s[1]+(f?0:he(c[0],o))]}),l=f?[i,r]:[i+he(c[p],o),r+he(c[p],o)],d.push({op:"bcurveTo",data:[e+he(c[p],o),t+he(c[p],o),n+he(c[p],o),a+he(c[p],o),l[0],l[1]]});return d}function Qs(e){return[...e]}function kE(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const a=[];if(n===3)a.push(Qs(e[0]),Qs(e[1]),Qs(e[2]),Qs(e[2]));else{const i=[];i.push(e[0],e[0]);for(let o=1;o<e.length;o++)i.push(e[o]),o===e.length-1&&i.push(e[o]);const r=[],s=1-t;a.push(Qs(i[0]));for(let o=1;o+2<i.length;o++){const d=i[o];r[0]=[d[0],d[1]],r[1]=[d[0]+(s*i[o+1][0]-s*i[o-1][0])/6,d[1]+(s*i[o+1][1]-s*i[o-1][1])/6],r[2]=[i[o+1][0]+(s*i[o][0]-s*i[o+2][0])/6,i[o+1][1]+(s*i[o][1]-s*i[o+2][1])/6],r[3]=[i[o+1][0],i[o+1][1]],a.push(r[1],r[2],r[3])}}return a}function ME(e,t){return Math.sqrt(kd(e,t))}function kd(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function CE(e,t,n){const a=kd(t,n);if(a===0)return kd(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/a;return i=Math.max(0,Math.min(1,i)),kd(e,rr(t,n,i))}function rr(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function IE(e,t){const n=e[t+0],a=e[t+1],i=e[t+2],r=e[t+3];let s=3*a[0]-2*n[0]-r[0];s*=s;let o=3*a[1]-2*n[1]-r[1];o*=o;let d=3*i[0]-2*r[0]-n[0];d*=d;let c=3*i[1]-2*r[1]-n[1];return c*=c,s<d&&(s=d),o<c&&(o=c),s+o}function sf(e,t,n,a){const i=a||[];if(IE(e,t)<n){const r=e[t+0];i.length?ME(i[i.length-1],r)>1&&i.push(r):i.push(r),i.push(e[t+3])}else{const s=e[t+0],o=e[t+1],d=e[t+2],c=e[t+3],l=rr(s,o,.5),u=rr(o,d,.5),f=rr(d,c,.5),p=rr(l,u,.5),U=rr(u,f,.5),m=rr(p,U,.5);sf([s,l,p,m],0,n,i),sf([m,U,f,c],0,n,i)}return i}function lf(e,t,n,a,i){const r=i||[],s=e[t],o=e[n-1];let d=0,c=1;for(let l=t+1;l<n-1;++l){const u=CE(e[l],s,o);u>d&&(d=u,c=l)}return Math.sqrt(d)>a?(lf(e,t,c+1,a,r),lf(e,c,n,a,r)):(r.length||r.push(s),r.push(o)),r}function _E(e,t=.15,n){const a=[],i=(e.length-1)/3;for(let r=0;r<i;r++){const s=r*3;sf(e,s,t,a)}return n&&n>0?lf(a,0,a.length,n):a}function TE(e,t){return Math.sqrt(Md(e,t))}function Md(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function jE(e,t,n){const a=Md(t,n);if(a===0)return Md(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/a;return i=Math.max(0,Math.min(1,i)),Md(e,sr(t,n,i))}function sr(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function AE(e,t){const n=e[t+0],a=e[t+1],i=e[t+2],r=e[t+3];let s=3*a[0]-2*n[0]-r[0];s*=s;let o=3*a[1]-2*n[1]-r[1];o*=o;let d=3*i[0]-2*r[0]-n[0];d*=d;let c=3*i[1]-2*r[1]-n[1];return c*=c,s<d&&(s=d),o<c&&(o=c),s+o}function of(e,t,n,a){const i=a||[];if(AE(e,t)<n){const r=e[t+0];i.length?TE(i[i.length-1],r)>1&&i.push(r):i.push(r),i.push(e[t+3])}else{const s=e[t+0],o=e[t+1],d=e[t+2],c=e[t+3],l=sr(s,o,.5),u=sr(o,d,.5),f=sr(d,c,.5),p=sr(l,u,.5),U=sr(u,f,.5),m=sr(p,U,.5);of([s,l,p,m],0,n,i),of([m,U,f,c],0,n,i)}return i}function DE(e,t){return df(e,0,e.length,t)}function df(e,t,n,a,i){const r=i||[],s=e[t],o=e[n-1];let d=0,c=1;for(let l=t+1;l<n-1;++l){const u=jE(e[l],s,o);u>d&&(d=u,c=l)}return Math.sqrt(d)>a?(df(e,t,c+1,a,r),df(e,c,n,a,r)):(r.length||r.push(s),r.push(o)),r}function LE(e,t=.15,n){const a=[],i=(e.length-1)/3;for(let r=0;r<i;r++){const s=r*3;of(e,s,t,a)}return a}function RE(e,t,n){const a=_1(e),i=n5(t5(a)),r=[];let s=[],o=[0,0],d=[];const c=()=>{d.length>=4&&s.push(...LE(d,t)),d=[]},l=()=>{c(),s.length&&(r.push(s),s=[])};for(const{key:f,data:p}of i)switch(f){case"M":l(),o=[p[0],p[1]],s.push(o);break;case"L":c(),s.push([p[0],p[1]]);break;case"C":if(!d.length){const U=s.length?s[s.length-1]:o;d.push([U[0],U[1]])}d.push([p[0],p[1]]),d.push([p[2],p[3]]),d.push([p[4],p[5]]);break;case"Z":c(),s.push([o[0],o[1]]);break}if(l(),!n)return r;const u=[];for(const f of r){const p=DE(f,n);p.length&&u.push(p)}return u}const Sn="none";class no{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return uE()}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,n,a){return{shape:t,sets:n||[],options:a||this.defaultOptions}}line(t,n,a,i,r){const s=this._o(r);return this._d("line",[i5(t,n,a,i,s)],s)}rectangle(t,n,a,i,r){const s=this._o(r),o=[],d=gE(t,n,a,i,s);if(s.fill){const c=[[t,n],[t+a,n],[t+a,n+i],[t,n+i]];s.fillStyle==="solid"?o.push(sh([c],s)):o.push(rs([c],s))}return s.stroke!==Sn&&o.push(d),this._d("rectangle",o,s)}ellipse(t,n,a,i,r){const s=this._o(r),o=[],d=r5(a,i,s),c=rf(t,n,s,d);if(s.fill)if(s.fillStyle==="solid"){const l=rf(t,n,s,d).opset;l.type="fillPath",o.push(l)}else o.push(rs([c.estimatedPoints],s));return s.stroke!==Sn&&o.push(c.opset),this._d("ellipse",o,s)}circle(t,n,a,i){const r=this.ellipse(t,n,a,a,i);return r.shape="circle",r}linearPath(t,n){const a=this._o(n);return this._d("linearPath",[Sd(t,!1,a)],a)}arc(t,n,a,i,r,s,o=!1,d){const c=this._o(d),l=[],u=IU(t,n,a,i,r,s,o,!0,c);if(o&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const p=IU(t,n,a,i,r,s,!0,!1,f);p.type="fillPath",l.push(p)}else l.push(xE(t,n,a,i,r,s,c));return c.stroke!==Sn&&l.push(u),this._d("arc",l,c)}curve(t,n){const a=this._o(n),i=[],r=CU(t,a);if(a.fill&&a.fill!==Sn&&t.length>=3)if(a.fillStyle==="solid"){const s=CU(t,Object.assign(Object.assign({},a),{disableMultiStroke:!0,roughness:a.roughness?a.roughness+a.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=kE(t),o=_E(s,10,(1+a.roughness)/2);i.push(rs([o],a))}return a.stroke!==Sn&&i.push(r),this._d("curve",i,a)}polygon(t,n){const a=this._o(n),i=[],r=Sd(t,!0,a);return a.fill&&(a.fillStyle==="solid"?i.push(sh([t],a)):i.push(rs([t],a))),a.stroke!==Sn&&i.push(r),this._d("polygon",i,a)}path(t,n){const a=this._o(n),i=[];if(!t)return this._d("path",i,a);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const r=a.fill&&a.fill!=="transparent"&&a.fill!==Sn,s=a.stroke!==Sn,o=!!(a.simplification&&a.simplification<1),d=o?4-4*(a.simplification||1):(1+a.roughness)/2,c=RE(t,1,d),l=_U(t,a);if(r)if(a.fillStyle==="solid")if(c.length===1){const u=_U(t,Object.assign(Object.assign({},a),{disableMultiStroke:!0,roughness:a.roughness?a.roughness+a.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(u.ops)})}else i.push(sh(c,a));else i.push(rs(c,a));return s&&(o?c.forEach(u=>{i.push(Sd(u,!1,a))}):i.push(l)),this._d("path",i,a)}opsToPath(t,n){let a="";for(const i of t.ops){const r=typeof n=="number"&&n>=0?i.data.map(s=>+s.toFixed(n)):i.data;switch(i.op){case"move":a+=`M${r[0]} ${r[1]} `;break;case"bcurveTo":a+=`C${r[0]} ${r[1]}, ${r[2]} ${r[3]}, ${r[4]} ${r[5]} `;break;case"lineTo":a+=`L${r[0]} ${r[1]} `;break}}return a.trim()}toPaths(t){const n=t.sets||[],a=t.options||this.defaultOptions,i=[];for(const r of n){let s=null;switch(r.type){case"path":s={d:this.opsToPath(r),stroke:a.stroke,strokeWidth:a.strokeWidth,fill:Sn};break;case"fillPath":s={d:this.opsToPath(r),stroke:Sn,strokeWidth:0,fill:a.fill||Sn};break;case"fillSketch":s=this.fillSketch(r,a);break}s&&i.push(s)}return i}fillSketch(t,n){let a=n.fillWeight;return a<0&&(a=n.strokeWidth/2),{d:this.opsToPath(t),stroke:n.fill||Sn,strokeWidth:a,fill:Sn}}_mergedShape(t){return t.filter((n,a)=>a===0?!0:n.op!=="move")}}class PE{constructor(t,n){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new no(n)}draw(t){const n=t.sets||[],a=t.options||this.getDefaultOptions(),i=this.ctx,r=t.options.fixedDecimalPlaceDigits;for(const s of n)switch(s.type){case"path":i.save(),i.strokeStyle=a.stroke==="none"?"transparent":a.stroke,i.lineWidth=a.strokeWidth,a.strokeLineDash&&i.setLineDash(a.strokeLineDash),a.strokeLineDashOffset&&(i.lineDashOffset=a.strokeLineDashOffset),this._drawToContext(i,s,r),i.restore();break;case"fillPath":{i.save(),i.fillStyle=a.fill||"";const o=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,r,o),i.restore();break}case"fillSketch":this.fillSketch(i,s,a);break}}fillSketch(t,n,a){let i=a.fillWeight;i<0&&(i=a.strokeWidth/2),t.save(),a.fillLineDash&&t.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(t.lineDashOffset=a.fillLineDashOffset),t.strokeStyle=a.fill||"",t.lineWidth=i,this._drawToContext(t,n,a.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,n,a,i="nonzero"){t.beginPath();for(const r of n.ops){const s=typeof a=="number"&&a>=0?r.data.map(o=>+o.toFixed(a)):r.data;switch(r.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1]);break}}n.type==="fillPath"?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,n,a,i,r){const s=this.gen.line(t,n,a,i,r);return this.draw(s),s}rectangle(t,n,a,i,r){const s=this.gen.rectangle(t,n,a,i,r);return this.draw(s),s}ellipse(t,n,a,i,r){const s=this.gen.ellipse(t,n,a,i,r);return this.draw(s),s}circle(t,n,a,i){const r=this.gen.circle(t,n,a,i);return this.draw(r),r}linearPath(t,n){const a=this.gen.linearPath(t,n);return this.draw(a),a}polygon(t,n){const a=this.gen.polygon(t,n);return this.draw(a),a}arc(t,n,a,i,r,s,o=!1,d){const c=this.gen.arc(t,n,a,i,r,s,o,d);return this.draw(c),c}curve(t,n){const a=this.gen.curve(t,n);return this.draw(a),a}path(t,n){const a=this.gen.path(t,n);return this.draw(a),a}}const nd="http://www.w3.org/2000/svg";class NE{constructor(t,n){this.svg=t,this.gen=new no(n)}draw(t){const n=t.sets||[],a=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,r=i.createElementNS(nd,"g"),s=t.options.fixedDecimalPlaceDigits;for(const o of n){let d=null;switch(o.type){case"path":{d=i.createElementNS(nd,"path"),d.setAttribute("d",this.opsToPath(o,s)),d.setAttribute("stroke",a.stroke),d.setAttribute("stroke-width",a.strokeWidth+""),d.setAttribute("fill","none"),a.strokeLineDash&&d.setAttribute("stroke-dasharray",a.strokeLineDash.join(" ").trim()),a.strokeLineDashOffset&&d.setAttribute("stroke-dashoffset",`${a.strokeLineDashOffset}`);break}case"fillPath":{d=i.createElementNS(nd,"path"),d.setAttribute("d",this.opsToPath(o,s)),d.setAttribute("stroke","none"),d.setAttribute("stroke-width","0"),d.setAttribute("fill",a.fill||""),(t.shape==="curve"||t.shape==="polygon")&&d.setAttribute("fill-rule","evenodd");break}case"fillSketch":{d=this.fillSketch(i,o,a);break}}d&&r.appendChild(d)}return r}fillSketch(t,n,a){let i=a.fillWeight;i<0&&(i=a.strokeWidth/2);const r=t.createElementNS(nd,"path");return r.setAttribute("d",this.opsToPath(n,a.fixedDecimalPlaceDigits)),r.setAttribute("stroke",a.fill||""),r.setAttribute("stroke-width",i+""),r.setAttribute("fill","none"),a.fillLineDash&&r.setAttribute("stroke-dasharray",a.fillLineDash.join(" ").trim()),a.fillLineDashOffset&&r.setAttribute("stroke-dashoffset",`${a.fillLineDashOffset}`),r}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,n){return this.gen.opsToPath(t,n)}line(t,n,a,i,r){const s=this.gen.line(t,n,a,i,r);return this.draw(s)}rectangle(t,n,a,i,r){const s=this.gen.rectangle(t,n,a,i,r);return this.draw(s)}ellipse(t,n,a,i,r){const s=this.gen.ellipse(t,n,a,i,r);return this.draw(s)}circle(t,n,a,i){const r=this.gen.circle(t,n,a,i);return this.draw(r)}linearPath(t,n){const a=this.gen.linearPath(t,n);return this.draw(a)}polygon(t,n){const a=this.gen.polygon(t,n);return this.draw(a)}arc(t,n,a,i,r,s,o=!1,d){const c=this.gen.arc(t,n,a,i,r,s,o,d);return this.draw(c)}curve(t,n){const a=this.gen.curve(t,n);return this.draw(a)}path(t,n){const a=this.gen.path(t,n);return this.draw(a)}}const Ki={canvas(e,t){return new PE(e,t)},svg(e,t){return new NE(e,t)},generator(e){return new no(e)},newSeed(){return no.newSeed()}};function LU(e,t,n,a=i=>i){return e*a(.5-t*(.5-n))}function OE(e){return[-e[0],-e[1]]}function qn(e,t){return[e[0]+t[0],e[1]+t[1]]}function jn(e,t){return[e[0]-t[0],e[1]-t[1]]}function Yn(e,t){return[e[0]*t,e[1]*t]}function $E(e,t){return[e[0]/t,e[1]/t]}function el(e){return[e[1],-e[0]]}function RU(e,t){return e[0]*t[0]+e[1]*t[1]}function FE(e,t){return e[0]===t[0]&&e[1]===t[1]}function zE(e){return Math.hypot(e[0],e[1])}function BE(e){return e[0]*e[0]+e[1]*e[1]}function PU(e,t){return BE(jn(e,t))}function l5(e){return $E(e,zE(e))}function HE(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function tl(e,t,n){let a=Math.sin(n),i=Math.cos(n),r=e[0]-t[0],s=e[1]-t[1],o=r*i-s*a,d=r*a+s*i;return[o+t[0],d+t[1]]}function cf(e,t,n){return qn(e,Yn(jn(t,e),n))}function NU(e,t,n){return qn(e,Yn(t,n))}var{min:qr,PI:XE}=Math,OU=.275,nl=XE+1e-4;function WE(e,t={}){let{size:n=16,smoothing:a=.5,thinning:i=.5,simulatePressure:r=!0,easing:s=O=>O,start:o={},end:d={},last:c=!1}=t,{cap:l=!0,easing:u=O=>O*(2-O)}=o,{cap:f=!0,easing:p=O=>--O*O*O+1}=d;if(e.length===0||n<=0)return[];let U=e[e.length-1].runningLength,m=o.taper===!1?0:o.taper===!0?Math.max(n,U):o.taper,g=d.taper===!1?0:d.taper===!0?Math.max(n,U):d.taper,b=Math.pow(n*a,2),v=[],x=[],y=e.slice(0,10).reduce((O,V)=>{let W=V.pressure;if(r){let K=qr(1,V.distance/n),se=qr(1,1-K);W=qr(1,O+(se-O)*(K*OU))}return(O+W)/2},e[0].pressure),w=LU(n,i,e[e.length-1].pressure,s),k,M=e[0].vector,I=e[0].point,A=I,_=I,T=A,L=!1;for(let O=0;O<e.length;O++){let{pressure:V}=e[O],{point:W,vector:K,distance:se,runningLength:le}=e[O];if(O<e.length-1&&U-le<3)continue;if(i){if(r){let ye=qr(1,se/n),Ae=qr(1,1-ye);V=qr(1,y+(Ae-y)*(ye*OU))}w=LU(n,i,V,s)}else w=n/2;k===void 0&&(k=w);let Ie=le<m?u(le/m):1,Qe=U-le<g?p((U-le)/g):1;w=Math.max(.01,w*Math.min(Ie,Qe));let rt=(O<e.length-1?e[O+1]:e[O]).vector,at=O<e.length-1?RU(K,rt):1,ce=RU(K,M)<0&&!L,me=at!==null&&at<0;if(ce||me){let ye=Yn(el(M),w);for(let Ae=1/13,kt=0;kt<=1;kt+=Ae)_=tl(jn(W,ye),W,nl*kt),v.push(_),T=tl(qn(W,ye),W,nl*-kt),x.push(T);I=_,A=T,me&&(L=!0);continue}if(L=!1,O===e.length-1){let ye=Yn(el(K),w);v.push(jn(W,ye)),x.push(qn(W,ye));continue}let Be=Yn(el(cf(rt,K,at)),w);_=jn(W,Be),(O<=1||PU(I,_)>b)&&(v.push(_),I=_),T=qn(W,Be),(O<=1||PU(A,T)>b)&&(x.push(T),A=T),y=V,M=K}let R=e[0].point.slice(0,2),F=e.length>1?e[e.length-1].point.slice(0,2):qn(e[0].point,[1,1]),P=[],$=[];if(e.length===1){if(!(m||g)||c){let O=NU(R,l5(el(jn(R,F))),-(k||w)),V=[];for(let W=1/13,K=W;K<=1;K+=W)V.push(tl(O,R,nl*2*K));return V}}else{if(!(m||g&&e.length===1))if(l)for(let V=1/13,W=V;W<=1;W+=V){let K=tl(x[0],R,nl*W);P.push(K)}else{let V=jn(v[0],x[0]),W=Yn(V,.5),K=Yn(V,.51);P.push(jn(R,W),jn(R,K),qn(R,K),qn(R,W))}let O=el(OE(e[e.length-1].vector));if(g||m&&e.length===1)$.push(F);else if(f){let V=NU(F,O,w);for(let W=1/29,K=W;K<1;K+=W)$.push(tl(V,F,nl*3*K))}else $.push(qn(F,Yn(O,w)),qn(F,Yn(O,w*.99)),jn(F,Yn(O,w*.99)),jn(F,Yn(O,w)))}return v.concat($,x.reverse(),P)}function VE(e,t={}){var n;let{streamline:a=.5,size:i=16,last:r=!1}=t;if(e.length===0)return[];let s=.15+(1-a)*.85,o=Array.isArray(e[0])?e:e.map(({x:p,y:U,pressure:m=.5})=>[p,U,m]);if(o.length===2){let p=o[1];o=o.slice(0,-1);for(let U=1;U<5;U++)o.push(cf(o[0],p,U/4))}o.length===1&&(o=[...o,[...qn(o[0],[1,1]),...o[0].slice(2)]]);let d=[{point:[o[0][0],o[0][1]],pressure:o[0][2]>=0?o[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],c=!1,l=0,u=d[0],f=o.length-1;for(let p=1;p<o.length;p++){let U=r&&p===f?o[p].slice(0,2):cf(u.point,o[p],s);if(FE(u.point,U))continue;let m=HE(U,u.point);if(l+=m,p<f&&!c){if(l<i)continue;c=!0}u={point:U,pressure:o[p][2]>=0?o[p][2]:.5,vector:l5(jn(u.point,U)),distance:m,runningLength:l},d.push(u)}return d[0].vector=((n=d[1])==null?void 0:n.vector)||[0,0],d}function GE(e,t={}){return WE(VE(e,t),t)}function o5(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=o5(e[t]))&&(a&&(a+=" "),a+=n);else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}function te(){for(var e=0,t,n,a="";e<arguments.length;)(t=arguments[e++])&&(n=o5(t))&&(a&&(a+=" "),a+=n);return a}function ZE(e,t){return Math.sqrt(Cd(e,t))}function Cd(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function YE(e,t,n){const a=Cd(t,n);if(a===0)return Cd(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/a;return i=Math.max(0,Math.min(1,i)),Cd(e,lr(t,n,i))}function lr(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function KE(e,t){const n=e[t+0],a=e[t+1],i=e[t+2],r=e[t+3];let s=3*a[0]-2*n[0]-r[0];s*=s;let o=3*a[1]-2*n[1]-r[1];o*=o;let d=3*i[0]-2*r[0]-n[0];d*=d;let c=3*i[1]-2*r[1]-n[1];return c*=c,s<d&&(s=d),o<c&&(o=c),s+o}function uf(e,t,n,a){const i=a||[];if(KE(e,t)<n){const r=e[t+0];i.length?ZE(i[i.length-1],r)>1&&i.push(r):i.push(r),i.push(e[t+3])}else{const s=e[t+0],o=e[t+1],d=e[t+2],c=e[t+3],l=lr(s,o,.5),u=lr(o,d,.5),f=lr(d,c,.5),p=lr(l,u,.5),U=lr(u,f,.5),m=lr(p,U,.5);uf([s,l,p,m],0,n,i),uf([m,U,f,c],0,n,i)}return i}function qE(e,t){return tc(e,0,e.length,t)}function tc(e,t,n,a,i){const r=i||[],s=e[t],o=e[n-1];let d=0,c=1;for(let l=t+1;l<n-1;++l){const u=YE(e[l],s,o);u>d&&(d=u,c=l)}return Math.sqrt(d)>a?(tc(e,t,c+1,a,r),tc(e,c,n,a,r)):(r.length||r.push(s),r.push(o)),r}function JE(e,t=.15,n){const a=[],i=(e.length-1)/3;for(let r=0;r<i;r++){const s=r*3;uf(e,s,t,a)}return tc(a,0,a.length,n)}var al={},$U;function QE(){if($U)return al;$U=1,Object.defineProperty(al,"__esModule",{value:!0}),al.sanitizeUrl=void 0;var e=/^([^\w]*)(javascript|data|vbscript)/im,t=/&#(\w+)(^\w|;)?/g,n=/&(newline|tab);/gi,a=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,i=/^.+(:|&colon;)/gim,r=[".","/"];function s(c){return r.indexOf(c[0])>-1}function o(c){return c.replace(t,function(l,u){return String.fromCharCode(u)})}function d(c){var l=o(c||"").replace(n,"").replace(a,"").trim();if(!l)return"about:blank";if(s(l))return l;var u=l.match(i);if(!u)return l;var f=u[0];return e.test(f)?"about:blank":l}return al.sanitizeUrl=d,al}var eS=QE();const d5="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function os(e,t,n){const a=n[0];if(t!=null&&e>=t)throw new Error(e+" >= "+t);if(e.slice(-1)===a||t&&t.slice(-1)===a)throw new Error("trailing zero");if(t){let s=0;for(;(e[s]||a)===t[s];)s++;if(s>0)return t.slice(0,s)+os(e.slice(s),t.slice(s),n)}const i=e?n.indexOf(e[0]):0,r=t!=null?n.indexOf(t[0]):n.length;if(r-i>1){const s=Math.round(.5*(i+r));return n[s]}else return t&&t.length>1?t.slice(0,1):n[i]+os(e.slice(1),null,n)}function c5(e){if(e.length!==u5(e[0]))throw new Error("invalid integer part of order key: "+e)}function u5(e){if(e>="a"&&e<="z")return e.charCodeAt(0)-97+2;if(e>="A"&&e<="Z")return 90-e.charCodeAt(0)+2;throw new Error("invalid order key head: "+e)}function xl(e){const t=u5(e[0]);if(t>e.length)throw new Error("invalid order key: "+e);return e.slice(0,t)}function FU(e,t){if(e==="A"+t[0].repeat(26))throw new Error("invalid order key: "+e);const n=xl(e);if(e.slice(n.length).slice(-1)===t[0])throw new Error("invalid order key: "+e)}function zU(e,t){c5(e);const[n,...a]=e.split("");let i=!0;for(let r=a.length-1;i&&r>=0;r--){const s=t.indexOf(a[r])+1;s===t.length?a[r]=t[0]:(a[r]=t[s],i=!1)}if(i){if(n==="Z")return"a"+t[0];if(n==="z")return null;const r=String.fromCharCode(n.charCodeAt(0)+1);return r>"a"?a.push(t[0]):a.pop(),r+a.join("")}else return n+a.join("")}function tS(e,t){c5(e);const[n,...a]=e.split("");let i=!0;for(let r=a.length-1;i&&r>=0;r--){const s=t.indexOf(a[r])-1;s===-1?a[r]=t.slice(-1):(a[r]=t[s],i=!1)}if(i){if(n==="a")return"Z"+t.slice(-1);if(n==="A")return null;const r=String.fromCharCode(n.charCodeAt(0)-1);return r<"Z"?a.push(t.slice(-1)):a.pop(),r+a.join("")}else return n+a.join("")}function Jr(e,t,n=d5){if(e!=null&&FU(e,n),t!=null&&FU(t,n),e!=null&&t!=null&&e>=t)throw new Error(e+" >= "+t);if(e==null){if(t==null)return"a"+n[0];const d=xl(t),c=t.slice(d.length);if(d==="A"+n[0].repeat(26))return d+os("",c,n);if(d<t)return d;const l=tS(d,n);if(l==null)throw new Error("cannot decrement any more");return l}if(t==null){const d=xl(e),c=e.slice(d.length),l=zU(d,n);return l??d+os(c,null,n)}const a=xl(e),i=e.slice(a.length),r=xl(t),s=t.slice(r.length);if(a===r)return a+os(i,s,n);const o=zU(a,n);if(o==null)throw new Error("cannot increment any more");return o<t?o:a+os(i,null,n)}function hf(e,t,n,a=d5){if(n===0)return[];if(n===1)return[Jr(e,t,a)];if(t==null){let s=Jr(e,t,a);const o=[s];for(let d=0;d<n-1;d++)s=Jr(s,t,a),o.push(s);return o}if(e==null){let s=Jr(e,t,a);const o=[s];for(let d=0;d<n-1;d++)s=Jr(e,s,a),o.push(s);return o.reverse(),o}const i=Math.floor(n/2),r=Jr(e,t,a);return[...hf(e,r,i,a),r,...hf(r,t,n-i-1,a)]}const Wr=(()=>{if(typeof self>"u")return!1;if(!("top"in self&&self!==top)){if("showOpenFilePicker"in self)return"showOpenFilePicker"}return!1})(),nS=Wr?ne(()=>import("./file-open-002ab408-DIuFHtCF.js"),[]):ne(()=>import("./file-open-7c801643-684qeFg4.js"),[]);async function aS(...e){return(await nS).default(...e)}Wr?ne(()=>import("./directory-open-4ed118d0-CunoC1EB.js"),[]):ne(()=>import("./directory-open-01563666-DWU9wJ6I.js"),[]);const iS=Wr?ne(()=>import("./file-save-745eba88-Bb9F9Kg7.js"),[]):ne(()=>import("./file-save-3189631c-C1wFhQhH.js"),[]);async function rS(...e){return(await iS).default(...e)}var sS=(e,t)=>t.reduce((n,a)=>(a in e&&(n[a]=e[a]),n),{}),lS=5,ss=5,oS=4,vl=4,yl=1,Vn=[0,2,4,6,8],Gn=(e,t)=>t.map(n=>Ft[e][n]),Ee={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:Gn("gray",Vn),red:Gn("red",Vn),pink:Gn("pink",Vn),grape:Gn("grape",Vn),violet:Gn("violet",Vn),blue:Gn("blue",Vn),cyan:Gn("cyan",Vn),teal:Gn("teal",Vn),green:Gn("green",Vn),yellow:Gn("yellow",Vn),orange:Gn("orange",Vn),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},h5=sS(Ee,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),f5=[Ee.black,Ee.red[vl],Ee.green[vl],Ee.blue[vl],Ee.yellow[vl]],p5=[Ee.transparent,Ee.red[yl],Ee.green[yl],Ee.blue[yl],Ee.yellow[yl]],U5=[Ee.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],dS={transparent:Ee.transparent,white:Ee.white,gray:Ee.gray,black:Ee.black,bronze:Ee.bronze,...h5},cS={transparent:Ee.transparent,white:Ee.white,gray:Ee.gray,black:Ee.black,bronze:Ee.bronze,...h5},uS=e=>[Ee.cyan[e],Ee.blue[e],Ee.violet[e],Ee.grape[e],Ee.pink[e],Ee.green[e],Ee.teal[e],Ee.yellow[e],Ee.orange[e],Ee.red[e]],hS=(e,t,n)=>`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`,Aa=/Mac|iPod|iPhone|iPad/.test(navigator.platform),m5=/^Win/.test(navigator.platform),fS=/\b(android)\b/i.test(navigator.userAgent),ao="netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,pS=navigator.userAgent.indexOf("Chrome")!==-1,US=!pS&&navigator.userAgent.indexOf("Safari")!==-1,g5=/iPad|iPhone/.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,mS=()=>navigator.brave?.isBrave?.name==="isBrave",ff=typeof window<"u"&&"ResizeObserver"in window,pf="Excalidraw",gS=36,or=10,Id=8,bS=5,BU=1,xS=30,Hi=Math.PI/12,b5="red",Fe={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},Si={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},Qr={enabled:"all",disabled:"none"},ad={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},bn={TEST:"test"},Ss={SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper"},ds="Xiaolai",io="Segoe UI Emoji",it={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9},cs={[ds]:100,[io]:1e3},x5=e=>{switch(e){case it.Excalifont:return[ds,io];default:return[io]}},Me={LIGHT:"light",DARK:"dark"},dt={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},T1=1,pi=20,qi=it.Excalifont,Io="left",nc="top",jr=2,ac=2*jr,vS=1e-5,yS=2*ac-vS,id="#ffffff",wS="#1e1e1e",ES="#a2f1a6",ic=20,v5=5,ks={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},ae={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json","excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...ks},SS=[ae.text,ae.html,...Object.values(ks)],lh={png:"png",svg:"svg",clipboard:"clipboard"},On={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},j1=window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,kS=500,MS=300,CS=500,IS=100,Kc=.1,A1=.1,D1=30,_S=300,L1="invert(93%) hue-rotate(180deg)",Uf={addLibrary:"addLibrary"},mf={addLibrary:"addLibrary"},HU={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0}},TS=730,jS=1e3,AS=500,DS=1229,il=2,R1=[1,2,3],Bs=10,LS=1440,XU=4*1024*1024,je="http://www.w3.org/2000/svg",qc={excalidraw:2,excalidrawLibrary:2},It=5,RS=.7,PS=11,Mn={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},ro={LEFT:"left",CENTER:"center",RIGHT:"right"},NS=20,oh=.25,OS=32,St={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},y5={artist:1,cartoonist:2},dh={thin:1,bold:2,extraBold:4},ft={strokeColor:Ee.black,backgroundColor:Ee.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:y5.artist,opacity:100,locked:!1},rc="library",xs="search",sa={name:"default",defaultTab:rc},w5=new Set(["iframe","embeddable","image"]),Lt={selection:"selection",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",text:"text",image:"image",eraser:"eraser",frame:"frame",magicframe:"magicframe",laser:"laser"},Ll={MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},E5="Untitled",us={generalStats:1,elementProperties:2},An=1,Ot={sharp:"sharp",round:"round",elbow:"elbow"},S5=.3,sc="element",$S=Symbol.for("__test__originalId__"),k5=(e=>(e.ACTIVE="active",e.AWAY="away",e.IDLE="idle",e))(k5||{}),FS=R1.includes(devicePixelRatio)?devicePixelRatio:1,Da=()=>({showWelcomeScreen:!1,theme:Me.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:ft.backgroundColor,currentItemEndArrowhead:"arrow",currentItemFillStyle:ft.fillStyle,currentItemFontFamily:qi,currentItemFontSize:pi,currentItemOpacity:ft.opacity,currentItemRoughness:ft.roughness,currentItemStartArrowhead:null,currentItemStrokeColor:ft.strokeColor,currentItemRoundness:"round",currentItemArrowType:Ot.round,currentItemStrokeStyle:ft.strokeStyle,currentItemStrokeWidth:ft.strokeWidth,currentItemTextAlign:Io,currentHoveredFontFamily:null,cursorButton:"up",activeEmbeddable:null,newElement:null,editingTextElement:null,editingGroupId:null,editingLinearElement:null,activeTool:{type:"selection",customType:null,locked:ft.locked,lastActiveTool:null},penMode:!1,penDetected:!1,errorMessage:null,exportBackground:!0,exportScale:FS,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:ic,gridStep:v5,gridModeEnabled:!1,isBindingEnabled:!0,defaultSidebarDockedPreference:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:null,contextMenu:null,openMenu:null,openPopup:null,openSidebar:null,openDialog:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},hoveredElementIds:{},selectedGroupIds:{},selectedElementsAreBeingDragged:!1,selectionElement:null,shouldCacheIgnoreZoom:!1,stats:{open:!1,panels:us.generalStats|us.elementProperties},startBoundElement:null,suggestedBindings:[],frameRendering:{enabled:!0,clip:!0,name:!0,outline:!0},frameToHighlight:null,editingFrame:null,elementsToHighlight:null,toast:null,viewBackgroundColor:Ee.white,zenModeEnabled:!1,zoom:{value:1},viewModeEnabled:!1,pendingImageElementId:null,showHyperlinkPopup:!1,selectedLinearElement:null,snapLines:[],originSnapOffset:{x:0,y:0},objectsSnapModeEnabled:!1,userToFollow:null,followedBy:new Set,isCropping:!1,croppingElementId:null,searchMatches:[]}),zS=(e=>e)({showWelcomeScreen:{browser:!0,export:!1,server:!1},theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemRoundness:{browser:!0,export:!1,server:!1},currentItemArrowType:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},currentHoveredFontFamily:{browser:!1,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},activeEmbeddable:{browser:!1,export:!1,server:!1},newElement:{browser:!1,export:!1,server:!1},editingTextElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},activeTool:{browser:!0,export:!1,server:!1},penMode:{browser:!0,export:!1,server:!1},penDetected:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},gridStep:{browser:!0,export:!0,server:!0},gridModeEnabled:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},defaultSidebarDockedPreference:{browser:!0,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},contextMenu:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},openSidebar:{browser:!0,export:!1,server:!1},openDialog:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},hoveredElementIds:{browser:!1,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectedElementsAreBeingDragged:{browser:!1,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},stats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},frameRendering:{browser:!1,export:!1,server:!1},frameToHighlight:{browser:!1,export:!1,server:!1},editingFrame:{browser:!1,export:!1,server:!1},elementsToHighlight:{browser:!1,export:!1,server:!1},toast:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElementId:{browser:!1,export:!1,server:!1},showHyperlinkPopup:{browser:!1,export:!1,server:!1},selectedLinearElement:{browser:!0,export:!1,server:!1},snapLines:{browser:!1,export:!1,server:!1},originSnapOffset:{browser:!1,export:!1,server:!1},objectsSnapModeEnabled:{browser:!0,export:!1,server:!1},userToFollow:{browser:!1,export:!1,server:!1},followedBy:{browser:!1,export:!1,server:!1},isCropping:{browser:!1,export:!1,server:!1},croppingElementId:{browser:!1,export:!1,server:!1},searchMatches:{browser:!1,export:!1,server:!1}}),M5=(e,t)=>{let n={};for(let a of Object.keys(e))if(zS[a]?.[t]){let i=e[a];n[a]=i}return n},C5=e=>M5(e,"export"),BS=e=>M5(e,"server"),Ea=({activeTool:e})=>e.type==="eraser",Ms=({activeTool:e})=>e.type==="hand",Se=(e,t,n)=>Math.min(Math.max(e,t),n),ja=(e,t,n="round")=>{let a=Math.pow(10,t);return Math[n]((e+Number.EPSILON)*a)/a},HS=(e,t,n="round")=>{let a=1/t;return Math[n](e*a)/a},rd=(e,t)=>(e+t)/2,Rl=e=>typeof e=="number"&&Number.isFinite(e),WU=(e,t,n=1e-4)=>Math.abs(e-t)<n,lc=e=>e<0?e+2*Math.PI:e>=2*Math.PI?e-2*Math.PI:e;function vr(e){return e*Math.PI/180}function _o(e){return e*180/Math.PI}function XS(e){return Math.abs(Math.sin(2*e))<1e-4}function Ht(e,t,n=0,a=0){return[e-n,t-a]}function ie(e,t=[0,0]){return Ht(e[0]-t[0],e[1]-t[1])}function Dt(e,t){return e[0]*t[1]-t[0]*e[1]}function VU(e,t){return e[0]*t[0]+e[1]*t[1]}function Li(e,t){return[e[0]+t[0],e[1]+t[1]]}function oc(e,t){return[e[0]-t[0],e[1]-t[1]]}function Ut(e,t){return Ht(e[0]*t,e[1]*t)}function WS(e){return e[0]*e[0]+e[1]*e[1]}function VS(e){return Math.sqrt(WS(e))}var Qt=e=>{let t=VS(e);return t===0?Ht(0,0):Ht(e[0]/t,e[1]/t)};function E(e,t){return[e,t]}function P1(e){return e.length===2?E(e[0],e[1]):void 0}function ke(e,t=E(0,0)){return E(t[0]+e[0],t[1]+e[1])}function GS(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&!isNaN(e[0])&&typeof e[1]=="number"&&!isNaN(e[1])}function ca(e,t){let n=Math.abs;return n(e[0]-t[0])<1e-4&&n(e[1]-t[1])<1e-4}function z([e,t],[n,a],i){return E((e-n)*Math.cos(i)-(t-a)*Math.sin(i)+n,(e-n)*Math.sin(i)+(t-a)*Math.cos(i)+a)}function dc(e,t=[0,0]){return E(e[0]+t[0],e[1]+t[1])}function To(e,t){return E((e[0]+t[0])/2,(e[1]+t[1])/2)}function Pe(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function so(e,t){let n=t[0]-e[0],a=t[1]-e[1];return n*n+a*a}var Wa=(e,t,n)=>dc(t,Ut(ie(e,t),n)),I5=(e,t,n)=>t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1]);function gf(e,t){return[e,t]}function ZS(e,t){let n=e[1][1]-e[0][1],a=e[0][0]-e[1][0],i=t[1][1]-t[0][1],r=t[0][0]-t[1][0],s=n*r-i*a;if(s!==0){let o=n*e[0][0]+a*e[0][1],d=i*t[0][0]+r*t[0][1];return E((o*r-d*a)/s,(n*d-i*o)/s)}return null}function re(e,t){return[e,t]}var Ar=(e,t,n=1e-4)=>{let a=N1(e,t);return a===0?!0:a<n},N1=(e,t)=>{let[n,a]=e,[[i,r],[s,o]]=t,d=n-i,c=a-r,l=s-i,u=o-r,f=d*l+c*u,p=l*l+u*u,U=-1;p!==0&&(U=f/p);let m,g;U<0?(m=i,g=r):U>1?(m=s,g=o):(m=i+U*l,g=r+U*u);let b=n-m,v=a-g;return Math.sqrt(b*b+v*v)};function lo(e,t){let n=ZS(gf(e[0],e[1]),gf(t[0],t[1]));return!n||!Ar(n,t)||!Ar(n,e)?null:n}function bf(e,t){return[e,t]}function YS(e,t){return[re(e[0],E(e[1][0],e[0][1])),re(E(e[1][0],e[0][1]),e[1]),re(e[1],E(e[0][0],e[1][1])),re(E(e[0][0],e[1][1]),e[0])].map(n=>lo(t,n)).filter(n=>!!n)}function Ja(e,t,n,a){return[e,t,n,a]}function GU(e,t,n,a=1e-6){return[(e(t+a,n)-e(t-a,n))/(2*a),(e(t,n+a)-e(t,n-a))/(2*a)]}function KS(e,t,n,a=.001,i=10){let r=1/0,s=0;for(;r>=a;){if(s>=i)return null;let o=e(t,n),d=[GU((m,g)=>e(m,g)[0],t,n),GU((m,g)=>e(m,g)[1],t,n)],c=[[-o[0]],[-o[1]]],l=d[0][0]*d[1][1]-d[0][1]*d[1][0];if(l===0)return null;let u=[[d[1][1]/l,-d[0][1]/l],[-d[1][0]/l,d[0][0]/l]],f=[[u[0][0]*c[0][0]+u[0][1]*c[1][0]],[u[1][0]*c[0][0]+u[1][1]*c[1][0]]];t=t+f[0][0],n=n+f[1][0];let[p,U]=e(t,n);r=Math.max(Math.abs(p),Math.abs(U)),s+=1}return[t,n]}var Pl=(e,t)=>E((1-t)**3*e[0][0]+3*(1-t)**2*t*e[1][0]+3*(1-t)*t**2*e[2][0]+t**3*e[3][0],(1-t)**3*e[0][1]+3*(1-t)**2*t*e[1][1]+3*(1-t)*t**2*e[2][1]+t**3*e[3][1]);function _5(e,t){let n=JS(e);if(YS(bf(E(n[0],n[1]),E(n[2],n[3])),t).length===0)return[];let a=o=>E(t[0][0]+o*(t[1][0]-t[0][0]),t[0][1]+o*(t[1][1]-t[0][1])),i=[[.5,0],[.2,0],[.8,0]],r=([o,d])=>{let c=KS((f,p)=>{let U=Pl(e,f),m=a(p);return[U[0]-m[0],U[1]-m[1]]},o,d);if(!c)return null;let[l,u]=c;return l<0||l>1||u<0||u>1?null:Pl(e,l)},s=r(i[0]);return s?[s]:(s=r(i[1]),s?[s]:(s=r(i[2]),s?[s]:[]))}function qS(e,t,n=.001){let a=(d,c,l,u=n)=>{let f=d,p=c,U;for(;p-f>u;)U=(p+f)/2,l(U-u)<l(U+u)?p=U:f=U;return U},i=0;for(let d=1/0,c=0;c<30;c++){let l=Pe(t,Pl(e,c/30));l<d&&(d=l,i=c)}let r=Math.max((i-1)/30,0),s=Math.min((i+1)/30,1),o=a(r,s,d=>Pe(t,Pl(e,d)));return o?Pl(e,o):null}function T5(e,t){let n=qS(e,t);return n?Pe(t,n):0}function JS(e){let[t,n,a,i]=e,r=[t[0],n[0],a[0],i[0]],s=[t[1],n[1],a[1],i[1]];return[Math.min(...r),Math.min(...s),Math.max(...r),Math.max(...s)]}function ZU(...e){return j5(e)}function cc(e){return j5(e)}var YU=(e,t)=>{let n=e[0],a=e[1],i=!1;for(let r=0,s=t.length-1;r<t.length;s=r++){let o=t[r][0],d=t[r][1],c=t[s][0],l=t[s][1];(d>a&&l<=a||d<=a&&l>a)&&n<(c-o)*(a-d)/(l-d)+o&&(i=!i)}return i},QS=(e,t,n=1e-4)=>{let a=!1;for(let i=0,r=t.length-1;i<r;i++)if(Ar(e,re(t[i],t[i+1]),n)){a=!0;break}return a};function j5(e){return ek(e)?e:[...e,e[0]]}function ek(e){return ca(e[0],e[e.length-1])}function Yt(e,t){return zn([e,t])}var uc=([e,t],[n,a])=>e<=n?t>=n:e>=n?a>=e:!1,hc=([e,t],[n,a])=>{let i=Math.max(e,n),r=Math.min(t,a);return i<=r?zn([i,r]):null},sd=(e,[t,n])=>e>=t&&e<=n;function es([e,t,n],a){let i=(l,u,f)=>(l[0]-f[0])*(u[1]-f[1])-(u[0]-f[0])*(l[1]-f[1]),r=i(a,e,t),s=i(a,t,n),o=i(a,n,e),d=r<0||s<0||o<0,c=r>0||s>0||o>0;return!(d&&c)}var KU=()=>{let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),a=`${e.getDate()}`.padStart(2,"0"),i=`${e.getHours()}`.padStart(2,"0"),r=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${a}-${i}${r}`},Nl=e=>e.charAt(0).toUpperCase()+e.slice(1),tk=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),xf=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,nk=e=>xf(e)||e instanceof Element&&!!e.closest("label, button"),cr=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"),Cs=({fontFamily:e})=>{for(let[t,n]of Object.entries(it))if(n===e)return`${t}${x5(n).map(a=>`, ${a}`).join("")}`;return io},Xe=({fontSize:e,fontFamily:t})=>`${e}px ${Cs({fontFamily:t})}`,Is=(e,t)=>{let n=0,a=null,i=(...r)=>{a=r,clearTimeout(n),n=window.setTimeout(()=>{a=null,e(...r)},t)};return i.flush=()=>{if(clearTimeout(n),a){let r=a;a=null,e(...r)}},i.cancel=()=>{a=null,clearTimeout(n)},i},Jc=(e,t)=>{let n=null,a=null,i=null,r=o=>{n=window.requestAnimationFrame(()=>{n=null,e(...o),a=null,i&&(a=i,i=null,r(a))})},s=(...o)=>{if(be.MODE==="test"){e(...o);return}a=o,n===null?r(a):t?.trailing&&(i=o)};return s.flush=()=>{n!==null&&(cancelAnimationFrame(n),n=null),a&&(e(...i||a),a=i=null)},s.cancel=()=>{a=i=null,n!==null&&(cancelAnimationFrame(n),n=null)},s},yr=e=>1-Math.pow(1-e,4),qU=(e,t,n)=>(t-e)*yr(n)+e,ak=({fromValues:e,toValues:t,onStep:n,duration:a=250,interpolateValue:i,onStart:r,onEnd:s,onCancel:o})=>{let d=!1,c=0,l;function u(f){if(d)return;l===void 0&&(l=f,r?.());let p=Math.min(f-l,a),U=yr(p/a),m={};if(Object.keys(e).forEach(g=>{let b=g,v=(t[b]-e[b])*U+e[b];m[b]=v}),n(m),p<a){let g=p/a,b={};Object.keys(e).forEach(v=>{let x=v,y=e[x],w=t[x],k;k=i?i(y,w,g,x):qU(y,w,g),k==null&&(k=qU(y,w,g)),b[x]=k}),n(b),c=window.requestAnimationFrame(u)}else n(t),s?.()}return c=window.requestAnimationFrame(u),()=>{o?.(),d=!0,window.cancelAnimationFrame(c)}},ik=(e,t)=>{if(!e.length||t<1)return[];let n=0,a=0,i=Array(Math.ceil(e.length/t));for(;n<e.length;)i[a++]=e.slice(n,n+=t);return i},qt=(e,t)=>Math.abs(e-t),Et=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked},H=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter"),Aa?e.replace(/\bCtrlOrCmd\b/gi,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/gi,"Ctrl")),Ge=({clientX:e,clientY:t},{zoom:n,offsetLeft:a,offsetTop:i,scrollX:r,scrollY:s})=>{let o=(e-a)/n.value-r,d=(t-i)/n.value-s;return{x:o,y:d}},Rn=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:a,offsetTop:i,scrollX:r,scrollY:s})=>{let o=(e+r)*n.value+a,d=(t+s)*n.value+i;return{x:o,y:d}},ld=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),rk="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿",sk="֑-߿יִ-﷽ﹰ-ﻼ",lk=new RegExp(`^[^${rk}]*[${sk}]`),A5=e=>lk.test(e),ta=e=>{let[t,n]=e;return{x:t,y:n}},D5=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},L5=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let a=n-1;for(;++a<e.length;)if(t(e[a],a,e))return a;return-1},ur=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let a=n+1;for(;--a>-1;)if(t(e[a],a,e))return a;return-1},na=e=>{let t=e.length===5&&e.substr(4,1)==="0",n=e.length===9&&e.substr(7,2)==="00";return t||n||e===Ee.transparent},ch=e=>e.fillStyle!=="solid"||na(e.backgroundColor),R5=()=>{let e,t,n=new Promise((a,i)=>{e=a,t=i});return n.resolve=e,n.reject=t,n},ok=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},dk=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},ck=e=>{e.preventDefault(),e.returnValue=""},uk=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),Hs=()=>ri()?1:Date.now(),oe=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),hk=e=>e.reduce((t,n,a)=>(t.set(n.id,[n,a]),t),new Map),Ha=(e,t)=>e.reduce((n,a)=>(n[t?t(a):String(a)]=a,n),{}),fk=e=>e.reduce((t,n,a)=>{let i={...n,prev:null,next:null};if(a!==0){let r=t[a-1];if(i.prev=r,r.next=i,a===e.length-1){let s=t[0];i.next=s,s.prev=i}}return t.push(i),t},[]),ri=()=>be.MODE==="test",P5=()=>be.MODE==="development",pk=()=>typeof process<"u"&&!0,N5=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),_d=(e,t)=>{let n=!1;for(let a in t){let i=t[a];if(typeof i<"u"){if(e[a]===i&&(typeof i!="object"||i===null))continue;n=!0}}return n?{...e,...t}:e},Uk=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},jo=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,vf=e=>{let t=e?.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},JU=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,Wt=(e,t,n,a=!1)=>{let i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return a&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let s of n)if(!(e[s]===t[s]||JU(e[s],t[s])))return a&&console.warn(`%cisShallowEqual: ${s} not equal ->`,"color: #8B4000",e[s],t[s]),!1;return!0}return i.every(s=>{let o=n?.[s],d=o?o(e[s],t[s]):e[s]===t[s]||JU(e[s],t[s]);return!d&&a&&console.warn(`%cisShallowEqual: ${s} not equal ->`,"color: #8B4000",e[s],t[s]),d})},Qc=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(a){if(e?.(a),!n||!a?.defaultPrevented)return t?.(a)},Dr=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function tn(e,t){if(!e)throw new Error(t)}var mk=e=>{let t,n,a=function(i){let r=Object.entries(i);if(t){let o=!0;for(let[d,c]of r)if(t.get(d)!==c){o=!1;break}if(o)return n}let s=e(i);return t=new Map(r),n=s,s};return a.clear=()=>{t=void 0,n=void 0},a},O5=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),ti=e=>JSON.parse(JSON.stringify(e)),rl=(e,t)=>Wt(e,t)?e:t;function lt(e,t,n,a){return e?(e?.addEventListener?.(t,n,a),()=>{e?.removeEventListener?.(t,n,a)}):()=>{}}function gk(e,t=!0){let n=e.length;if(n<4)return"";let a=e[0],i=e[1],r=e[2],s=`M${a[0].toFixed(2)},${a[1].toFixed(2)} Q${i[0].toFixed(2)},${i[1].toFixed(2)} ${rd(i[0],r[0]).toFixed(2)},${rd(i[1],r[1]).toFixed(2)} T`;for(let o=2,d=n-1;o<d;o++)a=e[o],i=e[o+1],s+=`${rd(a[0],i[0]).toFixed(2)},${rd(a[1],i[1]).toFixed(2)} `;return t&&(s+="Z"),s}var $5=e=>e.replace(/\r?\n|\r/g,`
9
+ `),zn=e=>e,Xi=async(e,...t)=>new Promise(n=>{n(e(...t))}),bk=(...e)=>Math.max(...e.map(t=>t?1:0))>0,QU=class{constructor(e,t){j(this,"pool"),j(this,"entries",{}),this.pool=new eE(e,t)}all(){let e=t=>{if(t.data.result){let[n,a]=t.data.result;this.entries[n]=a}};return this.pool.addEventListener("fulfilled",e),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",e)}),Object.values(this.entries)))}},Td=e=>e.replace(/"/g,"&quot;"),e2=e=>Array.isArray(e)?e:[e],Dn=e=>!!e&&e.type==="image"&&!!e.fileId,Re=e=>!!e&&e.type==="image",pn=e=>!!e&&e.type==="embeddable",Ii=e=>!!e&&e.type==="iframe",Ln=e=>!!e&&(e.type==="iframe"||e.type==="embeddable"),q=e=>e!=null&&e.type==="text",F5=e=>e!=null&&e.type==="frame",jd=e=>e!=null&&e.type==="magicframe",de=e=>e!=null&&(e.type==="frame"||e.type==="magicframe"),Bn=e=>e!=null&&xk(e.type),xk=e=>e==="freedraw",ue=e=>e!=null&&O1(e.type),ve=e=>e!=null&&e.type==="arrow",Q=e=>ve(e)&&e.elbowed,O1=e=>e==="arrow"||e==="line",_a=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&z5(e.type),z5=e=>e==="arrow",ua=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),vk=e=>e!=null&&(e.type==="rectangle"||e.type==="diamond"||e.type==="image"||e.type==="iframe"||e.type==="embeddable"||e.type==="frame"||e.type==="magicframe"||e.type==="text"&&!e.containerId),wr=(e,t=!0)=>e!=null&&(!e.locked||t===!0)&&(e.type==="rectangle"||e.type==="diamond"||e.type==="ellipse"||ve(e)),B5=e=>{let t=e?.type;if(!t)return!1;switch(t){case"text":case"diamond":case"rectangle":case"iframe":case"embeddable":case"ellipse":case"arrow":case"freedraw":case"line":case"frame":case"magicframe":case"image":case"selection":return!0;default:return Dr(t,null),!1}},eu=e=>e.type==="rectangle"||e.type==="ellipse"||e.type==="diamond",Hn=e=>wr(e)&&!!e.boundElements?.some(({type:t})=>t==="text"),nt=e=>e!==null&&"containerId"in e&&e.containerId!==null&&q(e),Xs=e=>e==="rectangle"||e==="embeddable"||e==="iframe"||e==="image",H5=e=>e==="line"||e==="arrow"||e==="diamond",yk=(e,t)=>!!((e===St.ADAPTIVE_RADIUS||e===St.LEGACY)&&Xs(t.type)||e===St.PROPORTIONAL_RADIUS&&H5(t.type)),wk=e=>H5(e.type)?{type:St.PROPORTIONAL_RADIUS}:Xs(e.type)?{type:St.ADAPTIVE_RADIUS}:null,fc=e=>Object.hasOwn(e,"fixedPoint")&&e.fixedPoint!=null,nn=(e,t,n)=>{let a=e.split(`
10
+ `).map(s=>s||" ").join(`
11
+ `),i=parseFloat(t),r=Ck(a,i,n);return{width:z1(a,t),height:r}},X5="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),W5=(e,t)=>{let n=Ik(e);return n===0?nn(X5.split("").join(`
12
+ `),e,t).width+It*2:n+It*2},$1=(e,t)=>nn("",e,t).width+It*2,Ek=()=>z1(X5,Xe({fontSize:pi,fontFamily:qi}))>0,_s=e=>$5(e).replace(/\t/g," "),F1=e=>_s(e).split(`
13
+ `),Sk=e=>{let t=F1(e.text).length;return e.height/t/e.fontSize},Ao=(e,t)=>e*t,V5=(e,t)=>Ao(e,t)+It*2,Ad,kk=e=>{Ad=e},Mk=class{constructor(){j(this,"canvas"),this.canvas=document.createElement("canvas")}getLineWidth(e,t){let n=this.canvas.getContext("2d");n.font=t;let a=n.measureText(e).width;return ri()?a*10:a}},Lr=(e,t)=>(Ad||(Ad=new Mk),Ad.getLineWidth(e,t)),z1=(e,t)=>{let n=F1(e),a=0;return n.forEach(i=>{a=Math.max(a,Lr(i,t))}),a},Ck=(e,t,n)=>{let a=F1(e).length;return Ao(t,n)*a},Do=(()=>{let e={};return{calculate:(t,n)=>{let a=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][a]){let i=Lr(t,n);e[n][a]=i}return e[n][a]},getCache:t=>e[t],clearCache:t=>{e[t]=[]}}})(),Ik=e=>{let t=Do.getCache(e);if(!t)return 0;let n=t.filter(a=>a!==void 0);return Math.max(...n)},uh,od,hh,_k=e=>(uh||(uh=$e.class(...Object.values(Va))),uh.test(e)),Tk=()=>{if(!od)try{od=Ak()}catch{od=jk()}return od},B1=()=>(hh||(hh=Dk()),hh),_n={WHITESPACE:/\s/u,HYPHEN:/-/u,OPENING:/<\(\[\{/u,CLOSING:/>\)\]\}.,:;!\?…\//u},Va={CHAR:new RegExp("\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}`'^〃〰〆#&*+-ー/\=|¦〒¬ ̄","u"),OPENING:/([{〈《⦅「「『【〖〔〘〚<〝/u,CLOSING:/)]}〉》⦆」」』】〗〕〙〛>。.,、〟‥?!:;・〜〞/u,CURRENCY:/¥₩£¢$/u},nr={FLAG:new RegExp("\\p{RI}\\p{RI}","u"),JOINER:new RegExp("(?:\\p{Emoji_Modifier}|\\uFE0F\\u20E3?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?","u"),ZWJ:/\u200D/u,ANY:/[\p{Emoji}]/u,MOST:/[\p{Extended_Pictographic}\p{Emoji_Presentation}]/u},jk=()=>$e.or(B1(),yt.On(_n.HYPHEN,_n.WHITESPACE,Va.CHAR)),Ak=()=>$e.or(B1(),yt.Before(_n.WHITESPACE).Build(),yt.After(_n.WHITESPACE,_n.HYPHEN).Build(),yt.Before(Va.CHAR,Va.CURRENCY).NotPrecededBy(_n.OPENING,Va.OPENING).Build(),yt.After(Va.CHAR).NotFollowedBy(_n.HYPHEN,_n.CLOSING,Va.CLOSING).Build(),yt.BeforeMany(Va.OPENING).NotPrecededBy(_n.OPENING).Build(),yt.AfterMany(Va.CLOSING).NotFollowedBy(_n.CLOSING).Build(),yt.AfterMany(_n.CLOSING).FollowedBy(_n.OPENING).Build()),Dk=()=>$e.group($e.or(nr.FLAG,$e.and(nr.MOST,nr.JOINER,$e.build(`(?:${nr.ZWJ.source}(?:${nr.FLAG.source}|${nr.ANY.source}${nr.JOINER.source}))*`)))),$e={build:e=>new RegExp(e,"u"),join:(...e)=>e.map(t=>t.source).join(""),and:(...e)=>$e.build($e.join(...e)),or:(...e)=>$e.build(e.map(t=>t.source).join("|")),group:(...e)=>$e.build(`(${$e.join(...e)})`),class:(...e)=>$e.build(`[${$e.join(...e)}]`)},yt={On:(...e)=>{let t=$e.join(...e);return $e.build(`([${t}])`)},Before:(...e)=>{let t=$e.join(...e),n=()=>$e.build(`(?=[${t}])`);return yt.Chain(n)},After:(...e)=>{let t=$e.join(...e),n=()=>$e.build(`(?<=[${t}])`);return yt.Chain(n)},BeforeMany:(...e)=>{let t=$e.join(...e),n=()=>$e.build(`(?<![${t}])(?=[${t}])`);return yt.Chain(n)},AfterMany:(...e)=>{let t=$e.join(...e),n=()=>$e.build(`(?<=[${t}])(?![${t}])`);return yt.Chain(n)},NotBefore:(...e)=>{let t=$e.join(...e),n=()=>$e.build(`(?![${t}])`);return yt.Chain(n)},NotAfter:(...e)=>{let t=$e.join(...e),n=()=>$e.build(`(?<![${t}])`);return yt.Chain(n)},Chain:e=>({Build:e,PreceededBy:(...t)=>{let n=e(),a=yt.After(...t).Build(),i=()=>$e.and(a,n);return yt.Chain(i)},FollowedBy:(...t)=>{let n=e(),a=yt.Before(...t).Build(),i=()=>$e.and(n,a);return yt.Chain(i)},NotPrecededBy:(...t)=>{let n=e(),a=yt.NotAfter(...t).Build(),i=()=>$e.and(a,n);return yt.Chain(i)},NotFollowedBy:(...t)=>{let n=e(),a=yt.NotBefore(...t).Build(),i=()=>$e.and(n,a);return yt.Chain(i)}})},Lk=e=>{let t=Tk();return e.normalize("NFC").split(t).filter(Boolean)},Vr=(e,t,n)=>{if(!Number.isFinite(n)||n<0)return e;let a=[],i=e.split(`
14
+ `);for(let r of i){if(Lr(r,t)<=n){a.push(r);continue}let s=Rk(r,t,n);a.push(...s)}return a.join(`
15
+ `)},Rk=(e,t,n)=>{let a=[],i=Lk(e)[Symbol.iterator](),r="",s=0,o=i.next();for(;!o.done;){let d=o.value,c=r+d,l=Ok(d)?s+Do.calculate(d,t):Lr(c,t);if(/\s/.test(d)||l<=n){r=c,s=l,o=i.next();continue}if(r)a.push(r.trimEnd()),r="",s=0;else{let u=Pk(d,t,n),f=u[u.length-1]??"",p=u.slice(0,-1);a.push(...p),r=f,s=Lr(f,t),o=i.next()}}if(r){let d=Nk(r,t,n);a.push(d)}return a},Pk=(e,t,n)=>{if(B1().test(e))return[e];$k(e);let a=[],i=Array.from(e),r="",s=0;for(let o of i){let d=Do.calculate(o,t),c=s+d;if(c<=n){r=r+o,s=c;continue}r&&a.push(r),r=o,s=d}return r&&a.push(r),a},Nk=(e,t,n)=>{if(!(Lr(e,t)>n))return e;let[,a,i]=e.match(/^(.+?)(\s+)$/)??[e,e.trimEnd(),""],r=Lr(a,t);for(let s of Array.from(i)){let o=Do.calculate(s,t),d=r+o;if(d>n)break;a=a+s,r=d}return a},Ok=e=>e.codePointAt(0)!==void 0&&e.codePointAt(1)===void 0,$k=e=>{if((be.MODE===bn.TEST||be.DEV)&&/\s/.test(e))throw new Error("Word should not contain any whitespaces!")},an=class{};j(an,"rg",new no),j(an,"cache",new WeakMap),j(an,"get",e=>an.cache.get(e)),j(an,"set",(e,t)=>an.cache.set(e,t)),j(an,"delete",e=>an.cache.delete(e)),j(an,"destroy",()=>{an.cache=new WeakMap}),j(an,"generateElementShape",(e,t)=>{let n=t?.isExporting?void 0:an.get(e);if(n!==void 0)return n;_f.delete(e);let a=ZA(e,an.rg,t||{isExporting:!1,canvasBackgroundColor:Ee.white,embedsValidationStatus:null});return an.cache.set(e,a),a});var ut=an,ea=e=>"var(--icon-fill-color)",G5=e=>e===Me.LIGHT?Ft.white:"#1e1e1e",N=(e,t=512)=>{let{width:n=512,height:a=n,mirror:i,style:r,...s}=typeof t=="number"?{width:t}:t;return h.jsx("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:`0 0 ${n} ${a}`,className:te({"rtl-mirror":i}),style:r,...s,children:typeof e=="string"?h.jsx("path",{fill:"currentColor",d:e}):e})},Y={width:24,height:24,fill:"none",strokeWidth:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},Ue={width:20,height:20,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"};N(h.jsxs("g",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("rect",{x:3,y:8,width:18,height:4,rx:1}),h.jsx("line",{x1:12,y1:8,x2:12,y2:21}),h.jsx("path",{d:"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7"}),h.jsx("path",{d:"M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5"})]}),Y);var H1=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),h.jsx("path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0"}),h.jsx("line",{x1:"3",y1:"6",x2:"3",y2:"19"}),h.jsx("line",{x1:"12",y1:"6",x2:"12",y2:"19"}),h.jsx("line",{x1:"21",y1:"6",x2:"21",y2:"19"})]}),Y),Fk=N(h.jsxs("svg",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),h.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),Y),zk=N(h.jsxs("g",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("circle",{cx:"12",cy:"12",r:"1"}),h.jsx("circle",{cx:"12",cy:"19",r:"1"}),h.jsx("circle",{cx:"12",cy:"5",r:"1"})]}),Y),Bk=N(h.jsxs("svg",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M9 4v6l-2 4v2h10v-2l-2 -4v-6"}),h.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"21"}),h.jsx("line",{x1:"8",y1:"4",x2:"16",y2:"4"})]}),Y),tu=N(h.jsxs("g",{children:[h.jsx("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("mask",{id:"UnlockedIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:6,y:1,width:9,height:9,children:h.jsx("path",{stroke:"none",d:"M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481",fill:"#fff"})}),h.jsx("g",{mask:"url(#UnlockedIcon)",children:h.jsx("path",{stroke:"none",d:"M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z",fill:"currentColor"})})]}),Ue),X1=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{d:"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z"}),h.jsx("path",{d:"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z"}),h.jsx("path",{d:"M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916"})]}),Ue),Hk=N(h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z",fill:"currentColor"}),h.jsx("path",{d:"M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:41,height:94,fill:"none"}),Xk=N(h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z",fill:"currentColor"}),h.jsx("path",{d:"M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:85,height:71,fill:"none"}),Wk=N(h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z",fill:"currentColor"}),h.jsx("path",{d:"M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})]}),{width:38,height:78,fill:"none"});N(h.jsx("g",{fill:"currentColor",children:h.jsx("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),{width:40,height:40,fill:"none"});var Vk=N(h.jsxs("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z"}),h.jsx("path",{d:"M13.5 13.5l4.5 4.5"})]}),{fill:"none",width:22,height:22,strokeWidth:1.25}),Gk=N(h.jsxs("g",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})]}),Y),Zk=N(h.jsxs("g",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z"})]}),Y),Yk=N(h.jsxs("g",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("circle",{cx:"12",cy:"12",r:"9"})]}),Y),Kk=N(h.jsxs("g",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),h.jsx("line",{x1:"15",y1:"16",x2:"19",y2:"12"}),h.jsx("line",{x1:"15",y1:"8",x2:"19",y2:"12"})]}),Y),qk=N(h.jsx("path",{d:"M4.167 10h11.666",strokeWidth:"1.5"}),Ue),Jk=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z"}),h.jsx("path",{d:"M16 7h4"}),h.jsx("path",{d:"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3"})]}),Y),oo=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{clipRule:"evenodd",d:"m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z"}),h.jsx("path",{d:"m11.25 5.417 3.333 3.333"})]}),Ue),Z5=N(h.jsxs("g",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("line",{x1:"4",y1:"20",x2:"7",y2:"20"}),h.jsx("line",{x1:"14",y1:"20",x2:"21",y2:"20"}),h.jsx("line",{x1:"6.9",y1:"15",x2:"13.8",y2:"15"}),h.jsx("line",{x1:"10.2",y1:"6.3",x2:"16",y2:"20"}),h.jsx("polyline",{points:"5 20 11 4 13 4 20 20"})]}),Y),Qk=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{d:"M12.5 6.667h.01"}),h.jsx("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z"}),h.jsx("path",{d:"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166"}),h.jsx("path",{d:"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667"})]}),Ue),eM=N(h.jsxs("g",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"}),h.jsx("path",{d:"M18 13.3l-6.3 -6.3"})]}),Y),t2=N(h.jsx("path",{strokeWidth:"1.25",d:"M10 4.167v11.666M4.167 10h11.666"}),Ue),n2=N(h.jsx("path",{d:"M5 10h10",strokeWidth:"1.25"}),Ue),tM=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M21 21l-6 -6"}),h.jsx("path",{d:"M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403"}),h.jsx("path",{d:"M3 4v4h4"})]}),Y),Rr=N(h.jsx("path",{strokeWidth:"1.25",d:"M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5"}),Ue),nM=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("polyline",{points:"12 16 18 10 12 4"}),h.jsx("polyline",{points:"8 4 2 10 8 16"})]}),Ue),yf=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{d:"M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z"}),h.jsx("path",{clipRule:"evenodd",d:"M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z"})]}),Ue),wf=N(h.jsx("path",{clipRule:"evenodd",d:"M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z",stroke:"currentColor"}),Ue),Ef=N(h.jsx("g",{stroke:"currentColor",strokeLinejoin:"round",children:h.jsx("path",{d:"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667"})}),{...Ue,strokeWidth:1.5}),Y5=N(h.jsxs("g",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),h.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),h.jsx("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]}),Y),nu=N(h.jsx("path",{strokeWidth:"1.25",d:"M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10"}),Ue),W1=N(h.jsxs("g",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),h.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),Y),aM=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"17.01"}),h.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),Y),a2=N(h.jsx("path",{strokeWidth:"1.25",d:"M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5"}),Ue),K5=N(h.jsx("path",{d:"M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5",strokeWidth:"1.25"}),Ue),iM=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{d:"M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0"}),h.jsx("path",{d:"M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084"})]}),Ue),rM=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M4 4l11.733 16h4.267l-11.733 -16z"}),h.jsx("path",{d:"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772"})]}),Y),sM=N(h.jsx("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Sf=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{d:"M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416"}),h.jsx("path",{d:"M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416"})]}),Ue),lM=N("M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z",{width:448,height:512}),oM=N("M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z",{width:448,height:512}),V1=N(h.jsx("path",{d:"m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z",strokeWidth:"1.25"}),Ue);N("M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z",{width:384,height:512});var dM=N("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"),fh=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z"}),h.jsx("path",{d:"M13.737 9.737c2.299 -2.3 3.23 -5.095 2.081 -6.245c-1.15 -1.15 -3.945 -.217 -6.244 2.082c-2.3 2.299 -3.231 5.095 -2.082 6.244c1.15 1.15 3.946 .218 6.245 -2.081z"}),h.jsx("path",{d:"M7.492 11.818c.362 .362 .768 .676 1.208 .934l6.895 4.047c1.078 .557 2.255 -.075 3.692 -1.512c1.437 -1.437 2.07 -2.614 1.512 -3.692c-.372 -.718 -1.72 -3.017 -4.047 -6.895a6.015 6.015 0 0 0 -.934 -1.208"})]}),Y),q5=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M15 8h.01"}),h.jsx("path",{d:"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5"}),h.jsx("path",{d:"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4"}),h.jsx("path",{d:"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598"}),h.jsx("path",{d:"M19 16v6"}),h.jsx("path",{d:"M22 19l-3 3l-3 -3"})]}),Y),cM=N("M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z",{width:512,height:512});N("M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512});N("M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512});var uM=N("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z");N("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z");var i2=N(h.jsx("path",{d:"M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5",strokeWidth:"1.25"}),Ue),r2=N(h.jsx("path",{d:"M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5",strokeWidth:"1.25"}),Ue),hM=N("M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z",{mirror:!0}),fM=N(h.jsx("path",{d:"M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834",strokeWidth:"1.5"}),Ue);N("M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z");N("M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z",{width:24,height:24});N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1"}),h.jsx("path",{d:"M12 14v-11"}),h.jsx("path",{d:"M9 6l3 -3l3 3"})]}),Y);N(h.jsxs(h.Fragment,{children:[h.jsx("path",{fill:"currentColor",d:"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z"}),h.jsx("path",{stroke:"currentColor",fill:"currentColor",d:"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z"})]}),{width:64,height:64});N(h.jsx("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024});var J5=h.jsxs("g",{strokeWidth:1.5,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M12 10l0 10"}),h.jsx("path",{d:"M12 10l4 4"}),h.jsx("path",{d:"M12 10l-4 4"}),h.jsx("path",{d:"M4 4l16 0"})]}),Q5=h.jsxs("g",{strokeWidth:1.5,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M12 5l0 14"}),h.jsx("path",{d:"M16 9l-4 -4"}),h.jsx("path",{d:"M8 9l4 -4"})]}),s2=N(Q5,Y),l2=N(Q5,{...Y,style:{transform:"rotate(180deg)"}}),o2=N(J5,Y),d2=N(J5,{...Y,style:{transform:"rotate(180deg)"}}),c2=N(h.jsxs(h.Fragment,{children:[h.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[h.jsx("path",{d:"M3.333 3.333h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ue),u2=N(h.jsxs(h.Fragment,{children:[h.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[h.jsx("path",{d:"M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ue),h2=N(h.jsxs(h.Fragment,{children:[h.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[h.jsx("path",{d:"M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ue),f2=N(h.jsxs(h.Fragment,{children:[h.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[h.jsx("path",{d:"M16.667 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ue),pM=N(h.jsxs(h.Fragment,{children:[h.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[h.jsx("path",{d:"M16.667 3.333v13.334M3.333 3.333v13.334",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ue),UM=N(h.jsxs(h.Fragment,{children:[h.jsxs("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",children:[h.jsx("path",{d:"M3.333 3.333h13.334M3.333 16.667h13.334",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z"})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ue),p2=N(h.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",children:[h.jsx("path",{d:"M1.667 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M8.333 10h3.334",strokeLinejoin:"round"}),h.jsx("path",{d:"M15.417 10h2.916",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z"})]}),Ue),U2=N(h.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",children:[h.jsx("path",{d:"M10 18.333v-2.916",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M10 11.667V8.333",strokeLinejoin:"round"}),h.jsx("path",{d:"M10 4.583V1.667",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z"})]}),Ue),eb=N(h.jsxs("g",{strokeWidth:"1.5",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("circle",{cx:"9",cy:"7",r:"4"}),h.jsx("path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"}),h.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}),h.jsx("path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85"})]}),Y);N("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z");N("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z");var Ws=N(h.jsxs(h.Fragment,{children:[h.jsx("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"M15 5 5 15M5 5l10 10"})}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ue);N("M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",{mirror:!0});N("M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z",{width:24});N("M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z",{width:384,height:512});var m2=Z.memo(({theme:e})=>N(h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M25 26H111V111H25",fill:ea()}),h.jsx("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:ea(),strokeWidth:"2"}),h.jsx("path",{d:"M100 100H160V160H100",fill:ea()}),h.jsx("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:ea(),strokeWidth:"2"}),h.jsxs("g",{fill:G5(e),stroke:ea(),strokeWidth:"6",children:[h.jsx("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),h.jsx("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),h.jsx("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),h.jsx("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),g2=Z.memo(({theme:e})=>N(h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M25 26H111V111H25",fill:ea()}),h.jsx("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:ea(),strokeWidth:"2"}),h.jsx("path",{d:"M100 100H160V160H100",fill:ea()}),h.jsx("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:ea(),strokeWidth:"2"}),h.jsxs("g",{fill:G5(e),stroke:ea(),strokeWidth:"6",children:[h.jsx("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),h.jsx("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),h.jsx("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),h.jsx("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),h.jsx("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),h.jsx("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})),mM=N(h.jsx("g",{strokeWidth:1.25,children:h.jsx("path",{d:"M5.879 2.625h8.242a3.27 3.27 0 0 1 3.254 3.254v8.242a3.27 3.27 0 0 1-3.254 3.254H5.88a3.27 3.27 0 0 1-3.254-3.254V5.88A3.27 3.27 0 0 1 5.88 2.626l-.001-.001ZM4.518 16.118l7.608-12.83m.198 13.934 5.051-9.897M2.778 9.675l9.348-6.387m-7.608 12.83 12.857-8.793"})}),Ue),gM=N(h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("mask",{id:"FillHachureIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:2,y:2,width:16,height:16,children:h.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.25"})}),h.jsx("g",{mask:"url(#FillHachureIcon)",children:h.jsx("path",{d:"M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})]}),Ue),bM=N(h.jsxs(h.Fragment,{children:[h.jsxs("g",{clipPath:"url(#a)",children:[h.jsx("path",{d:"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("mask",{id:"FillCrossHatchIcon",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:-1,y:-1,width:22,height:22,children:h.jsx("path",{d:"M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),h.jsx("g",{mask:"url(#FillCrossHatchIcon)",children:h.jsx("path",{d:"M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z",fill:"currentColor"})})]}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ue),xM=N(h.jsxs(h.Fragment,{children:[h.jsx("g",{clipPath:"url(#a)",children:h.jsx("path",{d:"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z",stroke:"currentColor",strokeWidth:"1.25"})}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),{...Ue,fill:"currentColor"}),tb=N(h.jsx(h.Fragment,{children:h.jsx("path",{d:"M4.167 10h11.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Ue),vM=N(h.jsx("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),Ue),yM=N(h.jsx("path",{d:"M5 10h10",stroke:"currentColor",strokeWidth:"3.75",strokeLinecap:"round",strokeLinejoin:"round"}),Ue);Z.memo(({theme:e})=>N(h.jsx("path",{d:"M6 10H34",stroke:ea(),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20}));var wM=N(h.jsxs("g",{strokeWidth:"2",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M5 12h2"}),h.jsx("path",{d:"M17 12h2"}),h.jsx("path",{d:"M11 12h2"})]}),Y),EM=N(h.jsxs("g",{strokeWidth:"2",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M4 12v.01"}),h.jsx("path",{d:"M8 12v.01"}),h.jsx("path",{d:"M12 12v.01"}),h.jsx("path",{d:"M16 12v.01"}),h.jsx("path",{d:"M20 12v.01"})]}),Y),SM=N(h.jsx("path",{d:"M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814",strokeWidth:"1.25"}),Ue),kM=N(h.jsx("path",{d:"M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43",strokeWidth:"1.25"}),Ue),MM=N(h.jsx("path",{d:"M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42",strokeWidth:"1.25"}),Ue),CM=N(h.jsxs("svg",{strokeWidth:"1.5",children:[h.jsx("path",{d:"M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10"}),h.jsx("path",{d:"M13.3333 3.33331V3.34331"}),h.jsx("path",{d:"M16.6667 3.33331V3.34331"}),h.jsx("path",{d:"M16.6667 6.66669V6.67669"}),h.jsx("path",{d:"M16.6667 10V10.01"}),h.jsx("path",{d:"M3.33334 13.3333V13.3433"}),h.jsx("path",{d:"M16.6667 13.3333V13.3433"}),h.jsx("path",{d:"M3.33334 16.6667V16.6767"}),h.jsx("path",{d:"M6.66666 16.6667V16.6767"}),h.jsx("path",{d:"M10 16.6667V16.6767"}),h.jsx("path",{d:"M13.3333 16.6667V16.6767"}),h.jsx("path",{d:"M16.6667 16.6667V16.6767"})]}),Ue),IM=N(h.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M4 12v-4a4 4 0 0 1 4 -4h4"}),h.jsx("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),h.jsx("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),h.jsx("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),h.jsx("line",{x1:"20",y1:"12",x2:"20",y2:"12.01"}),h.jsx("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),h.jsx("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),h.jsx("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),h.jsx("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),h.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),h.jsx("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),h.jsx("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})]}),Y),_M=N(h.jsxs("g",{stroke:"currentColor",opacity:.3,strokeWidth:2,children:[h.jsx("path",{d:"M12 12l9 0"}),h.jsx("path",{d:"M3 9l6 6"}),h.jsx("path",{d:"M3 15l6 -6"})]}),Y),TM=Z.memo(({flip:e=!1})=>N(h.jsxs("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",stroke:"currentColor",strokeWidth:2,fill:"none",children:[h.jsx("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),h.jsx("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})),jM=Z.memo(({flip:e=!1})=>N(h.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[h.jsx("path",{d:"M32 10L6 10",strokeWidth:2}),h.jsx("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),AM=Z.memo(({flip:e=!1})=>N(h.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,children:[h.jsx("path",{d:"M26 10L6 10"}),h.jsx("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})),DM=Z.memo(({flip:e=!1})=>N(h.jsx("g",{transform:e?"translate(40, 0) scale(-1, 1)":"",children:h.jsx("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"currentColor",strokeWidth:2,fill:"none"})}),{width:40,height:20})),LM=Z.memo(({flip:e=!1})=>N(h.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",children:[h.jsx("path",{d:"M32 10L6 10",strokeWidth:2}),h.jsx("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})),RM=Z.memo(({flip:e=!1})=>N(h.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeWidth:2,strokeLinejoin:"round",children:[h.jsx("path",{d:"M6,9.5H27"}),h.jsx("path",{d:"M27,5L34,10L27,14Z",fill:"none"})]}),{width:40,height:20})),PM=Z.memo(({flip:e=!1})=>N(h.jsxs("g",{stroke:"currentColor",fill:"currentColor",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[h.jsx("path",{d:"M6,9.5H20"}),h.jsx("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),NM=Z.memo(({flip:e=!1})=>N(h.jsxs("g",{stroke:"currentColor",fill:"none",transform:e?"translate(40, 0) scale(-1, 1)":"",strokeLinejoin:"round",strokeWidth:2,children:[h.jsx("path",{d:"M6,9.5H20"}),h.jsx("path",{d:"M27,5L34,10L27,14L20,9.5Z"})]}),{width:40,height:20})),OM=Z.memo(({flip:e=!1})=>N(h.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:h.jsx("path",{d:"M34,10 H6 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),$M=Z.memo(({flip:e=!1})=>N(h.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:h.jsx("path",{d:"M34,10 H6 M15,10 L15,15 L15,5"})}),{width:40,height:20})),FM=Z.memo(({flip:e=!1})=>N(h.jsx("g",{stroke:"currentColor",fill:"none",transform:e?"":"translate(40, 0) scale(-1, 1)",strokeLinejoin:"round",strokeWidth:2,children:h.jsx("path",{d:"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15"})}),{width:40,height:20})),zM=N(h.jsxs(h.Fragment,{children:[h.jsx("g",{clipPath:"url(#a)",children:h.jsx("path",{d:"M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ue),BM=N(h.jsxs(h.Fragment,{children:[h.jsx("g",{clipPath:"url(#a)",children:h.jsx("path",{d:"M5 16.667V3.333L10 15l5-11.667v13.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ue),HM=N(h.jsxs(h.Fragment,{children:[h.jsx("g",{clipPath:"url(#a)",children:h.jsx("path",{d:"M5.833 3.333v13.334h8.334",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ue),XM=N(h.jsx(h.Fragment,{children:h.jsx("path",{d:"m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Ue),au=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M3 7v-2h13v2"}),h.jsx("path",{d:"M10 5v14"}),h.jsx("path",{d:"M12 19h-4"}),h.jsx("path",{d:"M15 13v-1h6v1"}),h.jsx("path",{d:"M18 12v7"}),h.jsx("path",{d:"M17 19h2"})]}),Y),WM=N(h.jsx(h.Fragment,{children:h.jsxs("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M7 12h10"}),h.jsx("path",{d:"M7 5v14"}),h.jsx("path",{d:"M17 5v14"}),h.jsx("path",{d:"M15 19h4"}),h.jsx("path",{d:"M15 5h4"}),h.jsx("path",{d:"M5 19h4"}),h.jsx("path",{d:"M5 5h4"})]})}),Y),pc=N(h.jsx(h.Fragment,{children:h.jsx("g",{stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334"})})}),Ue),kf=N(h.jsxs(h.Fragment,{children:[h.jsx("g",{clipPath:"url(#a)",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"M5.833 6.667 2.5 10l3.333 3.333M14.167 6.667 17.5 10l-3.333 3.333M11.667 3.333 8.333 16.667"})}),h.jsx("defs",{children:h.jsx("clipPath",{id:"a",children:h.jsx("path",{fill:"#fff",d:"M0 0h20v20H0z"})})})]}),Ue),VM=N(h.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),h.jsx("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),h.jsx("line",{x1:"4",y1:"16",x2:"16",y2:"16"})]}),Y),GM=N(h.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),h.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),h.jsx("line",{x1:"6",y1:"16",x2:"18",y2:"16"})]}),Y),ZM=N(h.jsxs("g",{stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("line",{x1:"4",y1:"8",x2:"20",y2:"8"}),h.jsx("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),h.jsx("line",{x1:"8",y1:"16",x2:"20",y2:"16"})]}),Y),YM=Z.memo(({theme:e})=>N(h.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("line",{x1:"4",y1:"4",x2:"20",y2:"4"}),h.jsx("rect",{x:"9",y:"8",width:"6",height:"12",rx:"2"})]}),Y)),KM=Z.memo(({theme:e})=>N(h.jsxs("g",{strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("line",{x1:"4",y1:"20",x2:"20",y2:"20"}),h.jsx("rect",{x:"9",y:"4",width:"6",height:"12",rx:"2"})]}),Y)),qM=Z.memo(({theme:e})=>N(h.jsxs("g",{strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("line",{x1:"4",y1:"12",x2:"9",y2:"12"}),h.jsx("line",{x1:"15",y1:"12",x2:"20",y2:"12"}),h.jsx("rect",{x:"9",y:"6",width:"6",height:"12",rx:"2"})]}),Y)),nb=N(h.jsxs("g",{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M21 19h-18l9 -15"}),h.jsx("path",{d:"M20.615 15.171h.015"}),h.jsx("path",{d:"M19.515 11.771h.015"}),h.jsx("path",{d:"M17.715 8.671h.015"}),h.jsx("path",{d:"M15.415 5.971h.015"})]}),Y),JM=N(h.jsx("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512});N(h.jsx("path",{d:"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z"}));var ab=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5"}),h.jsx("path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5"}),h.jsx("path",{d:"M14 5.5a1.5 1.5 0 0 1 3 0v6.5"}),h.jsx("path",{d:"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47"})]}),Y),b2=N(h.jsxs(h.Fragment,{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"}),h.jsx("path",{d:"M7 11l5 5l5 -5"}),h.jsx("path",{d:"M12 4l0 12"})]}),Y),G1=N(h.jsxs(h.Fragment,{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z"}),h.jsx("path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2"})]}),Y),QM=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),h.jsx("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),h.jsx("path",{d:"M9.15 14.85l8.85 -10.85"}),h.jsx("path",{d:"M6 4l8.85 10.85"})]}),Y),eC=N(h.jsxs(h.Fragment,{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),h.jsx("path",{d:"M12 17l0 .01"}),h.jsx("path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4"})]}),Y);N(h.jsxs(h.Fragment,{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M7 4v16l13 -8z"})]}),Y);N(h.jsxs(h.Fragment,{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z",strokeWidth:"0",fill:"currentColor"})]}),Y);var tC=N(h.jsxs(h.Fragment,{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M5 12l5 5l10 -10"})]}),Y),nC=N(h.jsxs(h.Fragment,{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z"}),h.jsx("path",{d:"M12 9v4"}),h.jsx("path",{d:"M12 17h.01"})]}),Y),aC=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M11 7l6 6"}),h.jsx("path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z"})]}),Y),iC=N(h.jsxs("g",{strokeWidth:1.5,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M12 3l-4 7h8z"}),h.jsx("path",{d:"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),h.jsx("path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"})]}),Y),ib=N(h.jsxs("g",{strokeWidth:1.5,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M4 7l16 0"}),h.jsx("path",{d:"M4 17l16 0"}),h.jsx("path",{d:"M7 4l0 16"}),h.jsx("path",{d:"M17 4l0 16"})]}),Y),rb=N(h.jsx("path",{fill:"currentColor",d:"M407.48,111.18C335.587,108.103 269.573,152.338 245.08,220C220.587,152.338 154.573,108.103 82.68,111.18C80.285,168.229 107.577,222.632 154.74,254.82C178.908,271.419 193.35,298.951 193.27,328.27L193.27,379.13L296.9,379.13L296.9,328.27C296.816,298.953 311.255,271.42 335.42,254.82C382.596,222.644 409.892,168.233 407.48,111.18Z"})),Dd=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{d:"M4.16602 10H15.8327"}),h.jsx("path",{d:"M12.5 13.3333L15.8333 10"}),h.jsx("path",{d:"M12.5 6.66666L15.8333 9.99999"})]}),Ue),sb=N(h.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",transform:"rotate(90 10 10)",children:[h.jsx("path",{clipRule:"evenodd",d:"m9.644 13.69 7.774-7.773a2.357 2.357 0 0 0-3.334-3.334l-7.773 7.774L8 12l1.643 1.69Z"}),h.jsx("path",{d:"m13.25 3.417 3.333 3.333M10 10l2-2M5 15l3-3M2.156 17.894l1-1M5.453 19.029l-.144-1.407M2.377 11.887l.866 1.118M8.354 17.273l-1.194-.758M.953 14.652l1.408.13"})]}),20),lb=N(h.jsxs("g",{stroke:"currentColor",fill:"none",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),h.jsx("path",{d:"M15 6l3 3"}),h.jsx("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),h.jsx("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),Y);N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}),h.jsx("path",{d:"M15 6l3 3"}),h.jsx("path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}),h.jsx("path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"})]}),Y);N(h.jsxs("g",{stroke:"currentColor",fill:"none",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35"}),h.jsx("path",{d:"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946"}),h.jsx("path",{d:"M6 7.63c-1.391 -.236 -2.787 .395 -3.534 1.689a3.474 3.474 0 0 0 1.271 4.745l4.263 2.514l6 -3.348"}),h.jsx("path",{d:"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45"}),h.jsx("path",{d:"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946"}),h.jsx("path",{d:"M18 16.302c1.391 .236 2.787 -.395 3.534 -1.689a3.474 3.474 0 0 0 -1.271 -4.745l-4.308 -2.514l-5.955 3.42"})]}),Y);var rC=N(h.jsxs("g",{stroke:"currentColor",fill:"none",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2"}),h.jsx("path",{d:"M4 16v2a2 2 0 0 0 2 2h2"}),h.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v2"}),h.jsx("path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2"})]}),Y),Z1=N(h.jsxs("g",{stroke:"currentColor",fill:"none",strokeWidth:1.5,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"}),h.jsx("path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"})]}),Y),sC=N(h.jsxs("g",{stroke:"currentColor",fill:"none",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828"}),h.jsx("path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"}),h.jsx("path",{d:"M3 3l18 18"})]}),Y),lC=N(h.jsxs("g",{stroke:"currentColor",fill:"none",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),h.jsx("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),h.jsx("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),h.jsx("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),h.jsx("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),h.jsx("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),Y),oC=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8"}),h.jsx("path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8"}),h.jsx("path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5"}),h.jsx("path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0"}),h.jsx("path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5"}),h.jsx("path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10"})]}),Y),Pr=N(h.jsxs("g",{strokeWidth:1.5,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),h.jsx("path",{d:"M21 21l-6 -6"})]}),Y),dC=N(h.jsxs("g",{strokeWidth:1.5,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M20.984 12.53a9 9 0 1 0 -7.552 8.355"}),h.jsx("path",{d:"M12 7v5l3 3"}),h.jsx("path",{d:"M19 16l-2 3h4l-2 3"})]}),Y),cC=N(h.jsxs("g",{strokeWidth:1.5,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z"}),h.jsx("path",{d:"M5 10a7 7 0 0 0 14 0"}),h.jsx("path",{d:"M8 21l8 0"}),h.jsx("path",{d:"M12 17l0 4"})]}),Y),uC=N(h.jsxs("g",{strokeWidth:1.5,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M3 3l18 18"}),h.jsx("path",{d:"M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1"}),h.jsx("path",{d:"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85"}),h.jsx("path",{d:"M8 21l8 0"}),h.jsx("path",{d:"M12 17l0 4"})]}),Y),ob=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11"})]}),Y),hC=N(h.jsxs("g",{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M8 8m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z"}),h.jsx("path",{d:"M12 20v.01"}),h.jsx("path",{d:"M16 20v.01"}),h.jsx("path",{d:"M8 20v.01"}),h.jsx("path",{d:"M4 20v.01"}),h.jsx("path",{d:"M4 16v.01"}),h.jsx("path",{d:"M4 12v.01"}),h.jsx("path",{d:"M4 8v.01"}),h.jsx("path",{d:"M4 4v.01"}),h.jsx("path",{d:"M8 4v.01"}),h.jsx("path",{d:"M12 4v.01"}),h.jsx("path",{d:"M16 4v.01"}),h.jsx("path",{d:"M20 4v.01"}),h.jsx("path",{d:"M20 8v.01"}),h.jsx("path",{d:"M20 12v.01"}),h.jsx("path",{d:"M20 16v.01"}),h.jsx("path",{d:"M20 20v.01"})]}),Y),fC=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M5 3v18"}),h.jsx("path",{d:"M19 21v-18"}),h.jsx("path",{d:"M5 7h14"}),h.jsx("path",{d:"M5 15h14"}),h.jsx("path",{d:"M8 13v4"}),h.jsx("path",{d:"M11 13v4"}),h.jsx("path",{d:"M16 13v4"}),h.jsx("path",{d:"M14 5v4"}),h.jsx("path",{d:"M11 5v4"}),h.jsx("path",{d:"M8 5v4"}),h.jsx("path",{d:"M3 21h18"})]}),Y),pC=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M3 12l18 0"}),h.jsx("path",{d:"M7 16l10 0l-10 5l0 -5"}),h.jsx("path",{d:"M7 8l10 0l-10 -5l0 5"})]}),Y),UC=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M12 3l0 18"}),h.jsx("path",{d:"M16 7l0 10l5 0l-5 -10"}),h.jsx("path",{d:"M8 7l0 10l-5 0l5 -10"})]}),Y),db=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M5 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"}),h.jsx("path",{d:"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2"}),h.jsx("path",{d:"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"})]}),Y),Y1=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0"}),h.jsx("path",{d:"M22 22l-3 -3"}),h.jsx("path",{d:"M6 18h-1a2 2 0 0 1 -2 -2v-1"}),h.jsx("path",{d:"M3 11v-1"}),h.jsx("path",{d:"M3 6v-1a2 2 0 0 1 2 -2h1"}),h.jsx("path",{d:"M10 3h1"}),h.jsx("path",{d:"M15 3h1a2 2 0 0 1 2 2v1"})]}),Y),mC=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),h.jsx("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),h.jsx("path",{d:"M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"}),h.jsx("path",{d:"M10 15l2 6l2 -6"}),h.jsx("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"})]}),Y),gC=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),h.jsx("path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"}),h.jsx("path",{d:"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"}),h.jsx("path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"}),h.jsx("path",{d:"M11 21v-6l3 6v-6"})]}),Y),bC=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0"}),h.jsx("path",{d:"M4 8l5 0"}),h.jsx("path",{d:"M15 8l4 0"})]}),Y),xC=N(h.jsxs("g",{strokeWidth:1.25,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1"}),h.jsx("path",{d:"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),h.jsx("path",{d:"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2"}),h.jsx("path",{d:"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z"}),h.jsx("path",{d:"M16.746 16.726a3 3 0 1 0 .252 -5.555"})]}),Y),vC=N(h.jsxs("g",{stroke:"currentColor",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4"})]}),{...Y,strokeWidth:1.5});N(h.jsxs("g",{strokeWidth:1.5,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"}),h.jsx("path",{d:"M21 12h-13l3 -3"}),h.jsx("path",{d:"M11 15l-3 -3"})]}),Y);var yC=N(h.jsxs("g",{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z"}),h.jsx("path",{d:"M10 9l5 3l-5 3z"})]}),Y),wC=N(h.jsxs("g",{strokeWidth:1.5,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M3 6h18"}),h.jsx("path",{d:"M3 12h18"}),h.jsx("path",{d:"M3 18h18"}),h.jsx("path",{d:"M6 3v18"}),h.jsx("path",{d:"M12 3v18"}),h.jsx("path",{d:"M18 3v18"})]}),Y),EC=N(h.jsxs("g",{strokeWidth:1.5,children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),h.jsx("path",{d:"M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"}),h.jsx("path",{d:"M17 5c-6.627 0 -12 5.373 -12 12"})]}),Y),SC=N(h.jsxs("g",{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M6 18l12 -12"}),h.jsx("path",{d:"M18 10v-4h-4"})]}),Y),kC=N(h.jsxs("g",{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7"}),h.jsx("path",{d:"M18 4l3 3l-3 3"})]}),Y),MC=N(h.jsxs("g",{children:[h.jsx("path",{d:"M16,12L20,9L16,6"}),h.jsx("path",{d:"M6 20c0 -6.075 4.925 -11 11 -11h3"})]}),Y),cb=N(h.jsxs("g",{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M6 9l6 6l6 -6"})]}),Y),CC=N(h.jsxs("g",{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M6 15l6 -6l6 6"})]}),Y),IC=N(h.jsxs("g",{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M6 15l6 -6l6 6"})]}),Y),x2=N(h.jsxs("g",{strokeWidth:"1.25",children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M8 5v10a1 1 0 0 0 1 1h10"}),h.jsx("path",{d:"M5 8h10a1 1 0 0 1 1 1v10"})]}),Y),ub=N(h.jsxs("g",{children:[h.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h.jsx("path",{d:"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h.jsx("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h.jsx("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"}),h.jsx("path",{d:"M5 7l0 10"}),h.jsx("path",{d:"M7 5l10 0"}),h.jsx("path",{d:"M7 19l10 0"}),h.jsx("path",{d:"M19 7l0 10"})]}),Y),Uc={[it.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:oo},[it.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.35},icon:pc},[it["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15},icon:WM},[it["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25},icon:kf},[it.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},icon:oo,deprecated:!0},[it.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},icon:pc,deprecated:!0,local:!0},[it.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},icon:kf,deprecated:!0},[it["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},serverSide:!0},[cs.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.15},fallback:!0},[cs["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},hr={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},K1="local:",_C=class extends Error{constructor(e="Couldn't export canvas.",t="CANVAS_ERROR"){super(),this.name=t,this.message=e}},iu=class extends DOMException{constructor(e="Request Aborted"){super(e,"AbortError")}},mr=class extends Error{constructor(e="Image Scene Data Error",t="IMAGE_SCENE_DATA_ERROR"){super(e),j(this,"code"),this.name="EncodingError",this.code=t}},TC=class extends Error{constructor(){super(...arguments),j(this,"code","ELEMENT_HAS_INVALID_INDEX")}},hb=class extends Error{constructor(e="Worker URL is not defined!",t="WORKER_URL_NOT_DEFINED"){super(e),j(this,"code"),this.name="WorkerUrlNotDefinedError",this.code=t}},fb=class extends Error{constructor(e="Worker has to be in a separate chunk!",t="WORKER_IN_THE_MAIN_CHUNK"){super(e),j(this,"code"),this.name="WorkerInTheMainChunkError",this.code=t}},v2=class extends Error{constructor(e){super(e),this.name="ExcalidrawError"}},jC=class{constructor(e){j(this,"instance"),j(this,"debounceTerminate"),this.instance=new Worker(e,{type:"module"})}},AC=class pb{constructor(t,n){j(this,"idleWorkers",new Set),j(this,"workerUrl"),j(this,"workerTTL"),this.workerUrl=t,this.workerTTL=n.ttl||1e3}static create(t,n={}){if(!t)throw new hb;if(!import.meta.url||t.toString()===import.meta.url)throw new fb;return new pb(t,n)}async postMessage(t,n){let a,i=Array.from(this.idleWorkers).shift();return i?(this.idleWorkers.delete(i),a=i):a=await this.createWorker(),new Promise((r,s)=>{a.instance.onmessage=this.onMessageHandler(a,r),a.instance.onerror=this.onErrorHandler(a,s),a.instance.postMessage(t,n),a.debounceTerminate(()=>s(new Error(`Active worker did not respond for ${this.workerTTL}ms!`)))})}async clear(){for(let t of this.idleWorkers)t.debounceTerminate.cancel(),t.instance.terminate();this.idleWorkers.clear()}async createWorker(){let t=new jC(this.workerUrl);return t.debounceTerminate=Is(n=>{t.instance.terminate(),this.idleWorkers.has(t)?(this.idleWorkers.delete(t),console.debug("Job finished! Idle worker has been released from the pool.")):n?n():console.error("Worker has been terminated!")},this.workerTTL),t}onMessageHandler(t,n){return a=>{t.debounceTerminate(),this.idleWorkers.add(t),n(a.data)}}onErrorHandler(t,n){return a=>{t.debounceTerminate(()=>n(a)),t.debounceTerminate.flush(),this.clear()}}},y2=typeof Worker<"u",DC=async(e,t)=>{let{Commands:n,subsetToBase64:a,toBase64:i}=await RC();return y2?Xi(async()=>{try{let r=await PC(),s=e.slice(0),o=await r.postMessage({command:n.Subset,arrayBuffer:s,codePoints:t},{transfer:[s]});return i(o)}catch(r){return y2=!1,pk()&&(r instanceof hb||r instanceof fb)||console.error("Failed to use workers for subsetting, falling back to the main thread.",r),a(e,t)}}):a(e,t)},ph=null,Uh=null,LC=async()=>(ph||(ph=ne(()=>import("./subset-worker.chunk-CHKbzn25.js"),__vite__mapDeps([0,1,2,3]))),ph),RC=async()=>(Uh||(Uh=ne(()=>import("./subset-shared.chunk-BwUUnLRt.js"),__vite__mapDeps([1,2,3]))),Uh),mh=null,PC=()=>(mh||(mh=Xi(async()=>{let{WorkerUrl:e}=await LC();return AC.create(e)})),mh),Ub=class Ld{constructor(t,n,a){j(this,"urls"),j(this,"fontFace"),this.urls=Ld.createUrls(n);let i=this.urls.map(r=>`url(${r}) ${Ld.getFormat(r)}`).join(", ");this.fontFace=new FontFace(t,i,{display:"swap",style:"normal",weight:"400",...a})}toCSS(t){if(!this.getUnicodeRangeRegex().test(t))return;let n=Array.from(t).map(a=>a.codePointAt(0));return this.getContent(n).then(a=>`@font-face { font-family: ${this.fontFace.family}; src: url(${a}); }`)}async getContent(t){let n=0,a=[];for(;n<this.urls.length;){let i=this.urls[n];try{let r=await this.fetchFont(i);return await DC(r,t)}catch(r){a.push(`"${i.toString()}" returned error "${r}"`)}n++}return console.error(`Failed to fetch font family "${this.fontFace.family}"`,JSON.stringify(a,void 0,2)),this.urls.length?this.urls[this.urls.length-1].toString():""}fetchFont(t){return Xi(async()=>{let n=await fetch(t,{cache:"force-cache",headers:{Accept:"font/woff2"}});if(!n.ok){let a=t instanceof URL?t.toString():"dataurl";throw new Error(`Failed to fetch "${a}": ${n.statusText}`)}return await n.arrayBuffer()})}getUnicodeRangeRegex(){let t=this.fontFace.unicodeRange.split(/,\s*/).map(n=>{let[a,i]=n.replace("U+","").split("-");return i?`\\u{${a}}-\\u{${i}}`:`\\u{${a}}`}).join("");return new RegExp(`[${t}]`,"u")}static createUrls(t){if(t.startsWith("data"))return[t];if(t.startsWith(K1))return[];if(t.startsWith("http"))return[new URL(t)];let n=t.replace(/^\/+/,""),a=[];if(typeof window.EXCALIDRAW_ASSET_PATH=="string"){let i=this.normalizeBaseUrl(window.EXCALIDRAW_ASSET_PATH);a.push(new URL(n,i))}else Array.isArray(window.EXCALIDRAW_ASSET_PATH)&&window.EXCALIDRAW_ASSET_PATH.forEach(i=>{let r=this.normalizeBaseUrl(i);a.push(new URL(n,r))});return a.push(new URL(n,Ld.ASSETS_FALLBACK_URL)),a}static getFormat(t){if(!(t instanceof URL))return"";try{let n=new URL(t).pathname.split(".");return n.length===1?"":`format('${n.pop()}')`}catch{return""}}static normalizeBaseUrl(t){let n=t;return/^\.?\//.test(n)&&(n=new URL(n.replace(/^\.?\/+/,""),window?.location?.origin).toString()),n=`${n.replace(/\/+$/,"")}/`,n}};j(Ub,"ASSETS_FALLBACK_URL",`https://esm.sh/${`${be.PKG_NAME}@${be.PKG_VERSION}`}/dist/prod/`);var NC=Ub,OC="./fonts/Cascadia/CascadiaCode-Regular.woff2",$C=[{uri:OC}],FC="./fonts/ComicShanns/ComicShanns-Regular-279a7b317d12eb88de06167bd672b4b4.woff2",zC="./fonts/ComicShanns/ComicShanns-Regular-fcb0fc02dcbee4c9846b3e2508668039.woff2",BC="./fonts/ComicShanns/ComicShanns-Regular-dc6a8806fa96795d7b3be5026f989a17.woff2",HC="./fonts/ComicShanns/ComicShanns-Regular-6e066e8de2ac57ea9283adb9c24d7f0c.woff2",XC=[{uri:FC,descriptors:{unicodeRange:"U+20-7e,U+a1-a6,U+a8,U+ab-ac,U+af-b1,U+b4,U+b8,U+bb-bc,U+bf-cf,U+d1-d7,U+d9-de,U+e0-ef,U+f1-f7,U+f9-ff,U+131,U+152-153,U+2c6,U+2da,U+2dc,U+2013-2014,U+2018-201a,U+201c-201d,U+2020-2022,U+2026,U+2039-203a,U+2044,U+20ac,U+2191,U+2193,U+2212"}},{uri:zC,descriptors:{unicodeRange:"U+100-10f,U+112-125,U+128-130,U+134-137,U+139-13c,U+141-148,U+14c-151,U+154-161,U+164-165,U+168-17f,U+1bf,U+1f7,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+a75b"}},{uri:BC,descriptors:{unicodeRange:"U+2c7,U+2d8-2d9,U+2db,U+2dd,U+315,U+2190,U+2192,U+2200,U+2203-2204,U+2264-2265,U+f6c3"}},{uri:HC,descriptors:{unicodeRange:"U+3bb"}}],WC=[{uri:K1}],VC="./fonts/Excalifont/Excalifont-Regular-a88b72a24fb54c9f94e3b5fdaa7481c9.woff2",GC="./fonts/Excalifont/Excalifont-Regular-be310b9bcd4f1a43f571c46df7809174.woff2",ZC="./fonts/Excalifont/Excalifont-Regular-b9dcf9d2e50a1eaf42fc664b50a3fd0d.woff2",YC="./fonts/Excalifont/Excalifont-Regular-41b173a47b57366892116a575a43e2b6.woff2",KC="./fonts/Excalifont/Excalifont-Regular-3f2c5db56cc93c5a6873b1361d730c16.woff2",qC="./fonts/Excalifont/Excalifont-Regular-349fac6ca4700ffec595a7150a0d1e1d.woff2",JC="./fonts/Excalifont/Excalifont-Regular-623ccf21b21ef6b3a0d87738f77eb071.woff2",QC=[{uri:VC,descriptors:{unicodeRange:"U+20-7e,U+a0-a3,U+a5-a6,U+a8-ab,U+ad-b1,U+b4,U+b6-b8,U+ba-ff,U+131,U+152-153,U+2bc,U+2c6,U+2da,U+2dc,U+304,U+308,U+2013-2014,U+2018-201a,U+201c-201e,U+2020,U+2022,U+2024-2026,U+2030,U+2039-203a,U+20ac,U+2122,U+2212"}},{uri:GC,descriptors:{unicodeRange:"U+100-130,U+132-137,U+139-149,U+14c-151,U+154-17e,U+192,U+1fc-1ff,U+218-21b,U+237,U+1e80-1e85,U+1ef2-1ef3,U+2113"}},{uri:ZC,descriptors:{unicodeRange:"U+400-45f,U+490-491,U+2116"}},{uri:YC,descriptors:{unicodeRange:"U+37e,U+384-38a,U+38c,U+38e-393,U+395-3a1,U+3a3-3a8,U+3aa-3cf,U+3d7"}},{uri:KC,descriptors:{unicodeRange:"U+2c7,U+2d8-2d9,U+2db,U+2dd,U+302,U+306-307,U+30a-30c,U+326-328,U+212e,U+2211,U+fb01-fb02"}},{uri:qC,descriptors:{unicodeRange:"U+462-463,U+472-475,U+4d8-4d9,U+4e2-4e3,U+4e6-4e9,U+4ee-4ef"}},{uri:JC,descriptors:{unicodeRange:"U+300-301,U+303"}}],eI=[{uri:K1}],tI="./fonts/Liberation/LiberationSans-Regular.woff2",nI=[{uri:tI}],aI="./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYEF8RXi4EwQ.woff2",iI="./fonts/Lilita/Lilita-Regular-i7dPIFZ9Zz-WBtRtedDbYE98RXi4EwSsbg.woff2",rI=[{uri:iI,descriptors:{unicodeRange:hr.LATIN_EXT}},{uri:aI,descriptors:{unicodeRange:hr.LATIN}}],sI="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTQ3j6zbXWjgeg.woff2",lI="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTo3j6zbXWjgevT5.woff2",oI="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTA3j6zbXWjgevT5.woff2",dI="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTk3j6zbXWjgevT5.woff2",cI="./fonts/Nunito/Nunito-Regular-XRXI3I6Li01BKofiOc5wtlZ2di8HDIkhdTs3j6zbXWjgevT5.woff2",uI=[{uri:dI,descriptors:{unicodeRange:hr.CYRILIC_EXT,weight:"500"}},{uri:oI,descriptors:{unicodeRange:hr.CYRILIC,weight:"500"}},{uri:cI,descriptors:{unicodeRange:hr.VIETNAMESE,weight:"500"}},{uri:lI,descriptors:{unicodeRange:hr.LATIN_EXT,weight:"500"}},{uri:sI,descriptors:{unicodeRange:hr.LATIN,weight:"500"}}],hI="./fonts/Virgil/Virgil-Regular.woff2",fI=[{uri:hI}],pI="./fonts/Xiaolai/Xiaolai-Regular-09850c4077f3fffe707905872e0e2460.woff2",UI="./fonts/Xiaolai/Xiaolai-Regular-7eb9fffd1aa890d07d0f88cc82e6cfe4.woff2",mI="./fonts/Xiaolai/Xiaolai-Regular-60a3089806700d379f11827ee9843b6b.woff2",gI="./fonts/Xiaolai/Xiaolai-Regular-6fe5c5973cc06f74b2387a631ea36b88.woff2",bI="./fonts/Xiaolai/Xiaolai-Regular-b96d9226ce77ec94ceca043d712182e6.woff2",xI="./fonts/Xiaolai/Xiaolai-Regular-6ae5b42180ad70b971c91e7eefb8eba2.woff2",vI="./fonts/Xiaolai/Xiaolai-Regular-a4c34be6d42152e64b0df90bc4607f64.woff2",yI="./fonts/Xiaolai/Xiaolai-Regular-c69f61a4ab18d0488c8d1fc12e7028e8.woff2",wI="./fonts/Xiaolai/Xiaolai-Regular-e3fcf5180fd466c8915c4e8069491054.woff2",EI="./fonts/Xiaolai/Xiaolai-Regular-c1f94158256bb1f3bf665b053d895af9.woff2",SI="./fonts/Xiaolai/Xiaolai-Regular-544fc28abe2c5c30e62383fd4dac255f.woff2",kI="./fonts/Xiaolai/Xiaolai-Regular-7197d6fda6cba7c3874c53d6381ca239.woff2",MI="./fonts/Xiaolai/Xiaolai-Regular-70c2eb8d64e71a42a834eb857ea9df51.woff2",CI="./fonts/Xiaolai/Xiaolai-Regular-069e77aac84590e2e991d0a0176d34f2.woff2",II="./fonts/Xiaolai/Xiaolai-Regular-41521fade99856108931b4768b1b2648.woff2",_I="./fonts/Xiaolai/Xiaolai-Regular-a004ddfcb26e67bd6e678c8ed19e25ce.woff2",TI="./fonts/Xiaolai/Xiaolai-Regular-04b718e5623574919c8b0dea5f301444.woff2",jI="./fonts/Xiaolai/Xiaolai-Regular-7e4bde7e9c7f84cd34d8a845e384c746.woff2",AI="./fonts/Xiaolai/Xiaolai-Regular-23686f7f29da6e8008c36dd3a80c83d6.woff2",DI="./fonts/Xiaolai/Xiaolai-Regular-69c09cc5fa3e55c74fc4821f76909cc3.woff2",LI="./fonts/Xiaolai/Xiaolai-Regular-25b7f38e18f035f96cb5e547bd2bd08c.woff2",RI="./fonts/Xiaolai/Xiaolai-Regular-ba3de316d63c7e339987b16f41a0b879.woff2",PI="./fonts/Xiaolai/Xiaolai-Regular-12b52b58eb3df36804b9a654ec9ee194.woff2",NI="./fonts/Xiaolai/Xiaolai-Regular-b1220a3c61f85cc0408deedb4c5f57a2.woff2",OI="./fonts/Xiaolai/Xiaolai-Regular-4535823663ad81405188a528d8f2b1a2.woff2",$I="./fonts/Xiaolai/Xiaolai-Regular-3eaa538115d76932653c21d8dc28f207.woff2",FI="./fonts/Xiaolai/Xiaolai-Regular-7e929f262f30c8ee78bf398150b1a7cd.woff2",zI="./fonts/Xiaolai/Xiaolai-Regular-73e309718fd16cea44b4d54a33581811.woff2",BI="./fonts/Xiaolai/Xiaolai-Regular-9eb5a99df4e76ac3363453ac9ca288b1.woff2",HI="./fonts/Xiaolai/Xiaolai-Regular-3e63ed8162808a9e425ed80a8bc79114.woff2",XI="./fonts/Xiaolai/Xiaolai-Regular-cb17fc3db95f6d139afc9d31a8e93293.woff2",WI="./fonts/Xiaolai/Xiaolai-Regular-c8b71798409ccc126ee264a00aadcf21.woff2",VI="./fonts/Xiaolai/Xiaolai-Regular-11c345711937f0ba4b8f7b6b919c8440.woff2",GI="./fonts/Xiaolai/Xiaolai-Regular-e480d9c614742d05f0e78f274f1e69e6.woff2",ZI="./fonts/Xiaolai/Xiaolai-Regular-95429962233afd82db1c27df1500a28c.woff2",YI="./fonts/Xiaolai/Xiaolai-Regular-2cf96d082d35ea3d8106851223ad0d16.woff2",KI="./fonts/Xiaolai/Xiaolai-Regular-2d43040e86ff03ba677f6f9c04cd0805.woff2",qI="./fonts/Xiaolai/Xiaolai-Regular-2a26d20a23b00898ce82f09d2ee47c3f.woff2",JI="./fonts/Xiaolai/Xiaolai-Regular-a365e82ed54697a52f27adcea1315fe8.woff2",QI="./fonts/Xiaolai/Xiaolai-Regular-f5d079153c99a25b9be5b8583c4cc8a7.woff2",e_="./fonts/Xiaolai/Xiaolai-Regular-10a7ae9a371830a80c3d844acf1c02d7.woff2",t_="./fonts/Xiaolai/Xiaolai-Regular-e4bca6cfa53e499cae0a6be4894a90e9.woff2",n_="./fonts/Xiaolai/Xiaolai-Regular-60a41c7e1c68f22424e6d22df544bc82.woff2",a_="./fonts/Xiaolai/Xiaolai-Regular-7ab2bed91166a9dca83a5ebfbe2a7f38.woff2",i_="./fonts/Xiaolai/Xiaolai-Regular-670ba603758d94268e8606f240a42e12.woff2",r_="./fonts/Xiaolai/Xiaolai-Regular-e656f091b9dc4709722c9f4b84d3c797.woff2",s_="./fonts/Xiaolai/Xiaolai-Regular-15dc6d811c9cd078f9086a740d5a1038.woff2",l_="./fonts/Xiaolai/Xiaolai-Regular-f0f13b5c60e0af5553bd359f5513be1b.woff2",o_="./fonts/Xiaolai/Xiaolai-Regular-8c2f33cee3993174f7e87c28e4bf42ee.woff2",d_="./fonts/Xiaolai/Xiaolai-Regular-761d05e3cd968cf574166867998ef06a.woff2",c_="./fonts/Xiaolai/Xiaolai-Regular-642b26e2e5f5fb780b51b593dbc8c851.woff2",u_="./fonts/Xiaolai/Xiaolai-Regular-5572b3513ba8df57a3d5d7303ee6b11b.woff2",h_="./fonts/Xiaolai/Xiaolai-Regular-3c9de2ae0ea4bc91a510942dfa4be8d2.woff2",f_="./fonts/Xiaolai/Xiaolai-Regular-671a2c20b1eb9e4ef8a192833940e319.woff2",p_="./fonts/Xiaolai/Xiaolai-Regular-4dc6d5f188d5c96d44815cd1e81aa885.woff2",U_="./fonts/Xiaolai/Xiaolai-Regular-ce4884f96f11589608b76b726a755803.woff2",m_="./fonts/Xiaolai/Xiaolai-Regular-8f476c4c99813d57cbe6eca4727388ad.woff2",g_="./fonts/Xiaolai/Xiaolai-Regular-5935a5775af3d5c6307ac667bd9ae74e.woff2",b_="./fonts/Xiaolai/Xiaolai-Regular-79f007c1c6d07557120982951ea67998.woff2",x_="./fonts/Xiaolai/Xiaolai-Regular-bafff7a14c27403dcc6cf1432e8ea836.woff2",v_="./fonts/Xiaolai/Xiaolai-Regular-543fa46ace099a7099dad69123399400.woff2",y_="./fonts/Xiaolai/Xiaolai-Regular-4ddc14ed3eb0c3e46364317dfc0144a3.woff2",w_="./fonts/Xiaolai/Xiaolai-Regular-0fa55a080fcd0f9dc2e0b0058b793df8.woff2",E_="./fonts/Xiaolai/Xiaolai-Regular-66493ba5a8367f2928812f446f47b56a.woff2",S_="./fonts/Xiaolai/Xiaolai-Regular-57862b464a55b18c7bf234ce22907d73.woff2",k_="./fonts/Xiaolai/Xiaolai-Regular-8d3bcabb847b56243b16afe62adaaf21.woff2",M_="./fonts/Xiaolai/Xiaolai-Regular-2b77e8ebfb2367ab2662396a60e7d320.woff2",C_="./fonts/Xiaolai/Xiaolai-Regular-0b5d723fdc4e249c140f0909e87d03b4.woff2",I_="./fonts/Xiaolai/Xiaolai-Regular-cdbce89e82cc1ab53a2decbf5819278f.woff2",__="./fonts/Xiaolai/Xiaolai-Regular-739bc1a567439c7cffcd1614644593d2.woff2",T_="./fonts/Xiaolai/Xiaolai-Regular-72252d73220fa3cd856677888cee1635.woff2",j_="./fonts/Xiaolai/Xiaolai-Regular-08e0dc436ad0ad61ba5558db0674d762.woff2",A_="./fonts/Xiaolai/Xiaolai-Regular-cf6ff4e0f491ca0cf3038187a997b9b4.woff2",D_="./fonts/Xiaolai/Xiaolai-Regular-9cfb2a77a4e45025105ad29a1748b90d.woff2",L_="./fonts/Xiaolai/Xiaolai-Regular-450da755d5bcb70906e1295e559b9602.woff2",R_="./fonts/Xiaolai/Xiaolai-Regular-0986d134c05864f5025962eef9f994a0.woff2",P_="./fonts/Xiaolai/Xiaolai-Regular-1ee544f0f1dac422545c505baa788992.woff2",N_="./fonts/Xiaolai/Xiaolai-Regular-4806e761d750087c2d734fc64596eaff.woff2",O_="./fonts/Xiaolai/Xiaolai-Regular-33432927cd87d40cfe393c7482bf221f.woff2",$_="./fonts/Xiaolai/Xiaolai-Regular-be549ab72f0719d606a5c01e2c0219b6.woff2",F_="./fonts/Xiaolai/Xiaolai-Regular-019d66dcad46dc156b162d267f981c20.woff2",z_="./fonts/Xiaolai/Xiaolai-Regular-b5c1596551c256e0e9cf02028595b092.woff2",B_="./fonts/Xiaolai/Xiaolai-Regular-e5f453bb04da18eed01675eeebd88bf8.woff2",H_="./fonts/Xiaolai/Xiaolai-Regular-cf2cc71752631e579e35b0e423bf2638.woff2",X_="./fonts/Xiaolai/Xiaolai-Regular-6f3256af8454371776bc46670d33cc65.woff2",W_="./fonts/Xiaolai/Xiaolai-Regular-23f228f3999c01983860012330e4be08.woff2",V_="./fonts/Xiaolai/Xiaolai-Regular-21430ee05a1248901da8d0de08744d47.woff2",G_="./fonts/Xiaolai/Xiaolai-Regular-5330a2119a716e4e7224ed108b085dac.woff2",Z_="./fonts/Xiaolai/Xiaolai-Regular-cd145ce4a0ea18469358df53c207bc1b.woff2",Y_="./fonts/Xiaolai/Xiaolai-Regular-36925dfe329a45086cbb7fc5c20d45ac.woff2",K_="./fonts/Xiaolai/Xiaolai-Regular-4bfaa8ffa64c5ee560aa2daba7c9cbd3.woff2",q_="./fonts/Xiaolai/Xiaolai-Regular-112c051027b2d766c19a519f6ee1f4f7.woff2",J_="./fonts/Xiaolai/Xiaolai-Regular-5b0ed6971aaab9c8ad563230bd5471a7.woff2",Q_="./fonts/Xiaolai/Xiaolai-Regular-98f2ad84457de7f3740d9920b8fa8667.woff2",eT="./fonts/Xiaolai/Xiaolai-Regular-733171b4ffcd17ea1fe1c0ba627173bf.woff2",tT="./fonts/Xiaolai/Xiaolai-Regular-684d65f1793cac449dde5d59cb3c47fb.woff2",nT="./fonts/Xiaolai/Xiaolai-Regular-cbaaefaaf326668277aa24dfa93c4d28.woff2",aT="./fonts/Xiaolai/Xiaolai-Regular-58fd02350d0bc52cf1ca3bb32ce9766e.woff2",iT="./fonts/Xiaolai/Xiaolai-Regular-7ccce86603f80a099ddb0cb21d4ae3e3.woff2",rT="./fonts/Xiaolai/Xiaolai-Regular-3717077e38f98d89eae729b6c14e56dc.woff2",sT="./fonts/Xiaolai/Xiaolai-Regular-dbea1af6dcd9860be40c3d18254338f5.woff2",lT="./fonts/Xiaolai/Xiaolai-Regular-4a0fdb40036e87b40aa08dd30584cb85.woff2",oT="./fonts/Xiaolai/Xiaolai-Regular-0f626226ba1272e832aea87bafd9720e.woff2",dT="./fonts/Xiaolai/Xiaolai-Regular-938d90c10ff8c20386af7f242c05d6b0.woff2",cT="./fonts/Xiaolai/Xiaolai-Regular-b6d128682ee29e471486354d486a1b90.woff2",uT="./fonts/Xiaolai/Xiaolai-Regular-e51ef413167c6e14e0c0fdcc585f2fc9.woff2",hT="./fonts/Xiaolai/Xiaolai-Regular-9d81066dd2b337c938df6e90380a00dc.woff2",fT="./fonts/Xiaolai/Xiaolai-Regular-20e7bf72fa05de9adf7dbcc7bf51dde6.woff2",pT="./fonts/Xiaolai/Xiaolai-Regular-4095eb84ef3874e2600247bee0b04026.woff2",UT="./fonts/Xiaolai/Xiaolai-Regular-4ee10ae43505e2e0bc62656ced49c0fa.woff2",mT="./fonts/Xiaolai/Xiaolai-Regular-7494dc504ae00ee9cd0505f990f88c5d.woff2",gT="./fonts/Xiaolai/Xiaolai-Regular-8de5b863cb50dfefdd07cb11c774d579.woff2",bT="./fonts/Xiaolai/Xiaolai-Regular-3e1f8f654357353bf0e04ba5c34b5f7f.woff2",xT="./fonts/Xiaolai/Xiaolai-Regular-2e33e8dc771ef5e1d9127d60a6b73679.woff2",vT="./fonts/Xiaolai/Xiaolai-Regular-173945821411c09f70c95f98d590e697.woff2",yT="./fonts/Xiaolai/Xiaolai-Regular-b358f7a51ece39a3247942b1feabdb29.woff2",wT="./fonts/Xiaolai/Xiaolai-Regular-23ad2d71b280f00b1363b95b7bea94eb.woff2",ET="./fonts/Xiaolai/Xiaolai-Regular-5882ffa04f32584d26109137e2da4352.woff2",ST="./fonts/Xiaolai/Xiaolai-Regular-a203b91dad570bf05a58c3c3ddb529bf.woff2",kT="./fonts/Xiaolai/Xiaolai-Regular-bd77e3c7f9e0b072d96af37f73d1aa32.woff2",MT="./fonts/Xiaolai/Xiaolai-Regular-5a45d991244d4c7140217e1e5f5ca4f4.woff2",CT="./fonts/Xiaolai/Xiaolai-Regular-f56414bf9bced67990def8660e306759.woff2",IT="./fonts/Xiaolai/Xiaolai-Regular-583d166e56ba0de4b77eabb47ef67839.woff2",_T="./fonts/Xiaolai/Xiaolai-Regular-7f855356ab893b0d2b9c1c83b8116f0e.woff2",TT="./fonts/Xiaolai/Xiaolai-Regular-b57aaedfd8ebdf3931f25119dc6a5eb2.woff2",jT="./fonts/Xiaolai/Xiaolai-Regular-b6fd38ca30869792244804b04bc058da.woff2",AT="./fonts/Xiaolai/Xiaolai-Regular-452225341522a7942f0f6aab1a5c91a3.woff2",DT="./fonts/Xiaolai/Xiaolai-Regular-866fa7613df6b3fd272bcfd4530c0bb9.woff2",LT="./fonts/Xiaolai/Xiaolai-Regular-52a84a22fd1369bffeaf21da2d6158dc.woff2",RT="./fonts/Xiaolai/Xiaolai-Regular-829615148e6357d826b9242eb7fbbd1e.woff2",PT="./fonts/Xiaolai/Xiaolai-Regular-c99eda15fc26a2941579560f76c3a5cf.woff2",NT="./fonts/Xiaolai/Xiaolai-Regular-395c35dd584b56b0789f58a0559beaf1.woff2",OT="./fonts/Xiaolai/Xiaolai-Regular-203b0e569e3b14aac86a003dc3fa523e.woff2",$T="./fonts/Xiaolai/Xiaolai-Regular-51a0e808bbc8361236ac521a119758a3.woff2",FT="./fonts/Xiaolai/Xiaolai-Regular-6e092f71c1e634059ada0e52abadce67.woff2",zT="./fonts/Xiaolai/Xiaolai-Regular-0f7fb1e0d5015bb1371343153ecf7ce3.woff2",BT="./fonts/Xiaolai/Xiaolai-Regular-d0cf73942fea1c74edbdf0b3011f4656.woff2",HT="./fonts/Xiaolai/Xiaolai-Regular-968cffdc8ee679da094e77ebf50f58ef.woff2",XT="./fonts/Xiaolai/Xiaolai-Regular-7a07ddc0f0c0f5f4a9bad6ee3dda66b5.woff2",WT="./fonts/Xiaolai/Xiaolai-Regular-ec181b795ac1fb5a50d700b6e996d745.woff2",VT="./fonts/Xiaolai/Xiaolai-Regular-cfb211578629b7e8153b37240de6a9d5.woff2",GT="./fonts/Xiaolai/Xiaolai-Regular-59e9ff77b0efaf684bc09274fb6908c9.woff2",ZT="./fonts/Xiaolai/Xiaolai-Regular-2adbc89c11e65905393d3dfc468b9d5b.woff2",YT="./fonts/Xiaolai/Xiaolai-Regular-70e811fd7994e61f408c923de6ddd078.woff2",KT="./fonts/Xiaolai/Xiaolai-Regular-c4a687ac4f0c2766eefc9f77ed99cddf.woff2",qT="./fonts/Xiaolai/Xiaolai-Regular-51502f1206be09c565f1547c406e9558.woff2",JT="./fonts/Xiaolai/Xiaolai-Regular-1fdc0c67ed57263a80fd108c1f6ccf24.woff2",QT="./fonts/Xiaolai/Xiaolai-Regular-e11567fd2accf9957cd0d3c2be937d87.woff2",ej="./fonts/Xiaolai/Xiaolai-Regular-20cc1bbf50e7efb442756cb605672c1f.woff2",tj="./fonts/Xiaolai/Xiaolai-Regular-5d2898fbc097a7e24c6f38d80587621e.woff2",nj="./fonts/Xiaolai/Xiaolai-Regular-ac9ceb44437becc3e9c4dbfebab7fc2d.woff2",aj="./fonts/Xiaolai/Xiaolai-Regular-c16ed9740b85badf16e86ea782a3062f.woff2",ij="./fonts/Xiaolai/Xiaolai-Regular-aa0d470430e6391eca720c7cfa44446f.woff2",rj="./fonts/Xiaolai/Xiaolai-Regular-f2b54d4e7be0eaefe1c2c56836fa5368.woff2",sj="./fonts/Xiaolai/Xiaolai-Regular-99a16ef6a64934d5781933dbd9c46b2e.woff2",lj="./fonts/Xiaolai/Xiaolai-Regular-c40533fdf4cc57177b12803598af7e59.woff2",oj="./fonts/Xiaolai/Xiaolai-Regular-91ddb2969bf2d31ba02ad82998d1314c.woff2",dj="./fonts/Xiaolai/Xiaolai-Regular-774d4f764a1299da5d28ec2f2ffe0d69.woff2",cj="./fonts/Xiaolai/Xiaolai-Regular-7718fe60986d8b42b1be9c5ace5ccf25.woff2",uj="./fonts/Xiaolai/Xiaolai-Regular-aa5c9ca6cf4fba00433b7aa3fa10671a.woff2",hj="./fonts/Xiaolai/Xiaolai-Regular-4f50e5136e136527280bc902c5817561.woff2",fj="./fonts/Xiaolai/Xiaolai-Regular-093b9ef39a46ceae95a1df18a0a3a326.woff2",pj="./fonts/Xiaolai/Xiaolai-Regular-a0ca5df4258213d7fc9fce80f65ce760.woff2",Uj="./fonts/Xiaolai/Xiaolai-Regular-d2666cbed13462c5dc36fa2f15c202ca.woff2",mj="./fonts/Xiaolai/Xiaolai-Regular-1e6fd68f1f3902ce48ce8c69df385622.woff2",gj="./fonts/Xiaolai/Xiaolai-Regular-87599f94b6cc129d505b375798d0d751.woff2",bj="./fonts/Xiaolai/Xiaolai-Regular-06c77b8c66e51ed6c63ccb502dd8b8af.woff2",xj="./fonts/Xiaolai/Xiaolai-Regular-13ae07ed2e272d26d59bc0691cd7117a.woff2",vj="./fonts/Xiaolai/Xiaolai-Regular-353f33792a8f60dc69323ddf635a269e.woff2",yj="./fonts/Xiaolai/Xiaolai-Regular-0facdf1ea213ba40261022f5d5ed4493.woff2",wj="./fonts/Xiaolai/Xiaolai-Regular-f8ee5d36068a42b51d0e4a1116cfcec1.woff2",Ej="./fonts/Xiaolai/Xiaolai-Regular-79d494361ae093b69e74ee9dbe65bfd4.woff2",Sj="./fonts/Xiaolai/Xiaolai-Regular-74e2263a91439c25b91d5132ce9f4d62.woff2",kj="./fonts/Xiaolai/Xiaolai-Regular-ee8bae97908d5147b423f77ad0d3c1bb.woff2",Mj="./fonts/Xiaolai/Xiaolai-Regular-56467a5c8840c4d23a60b2f935114848.woff2",Cj="./fonts/Xiaolai/Xiaolai-Regular-145aa02cdd91946e67dc934e1acffe75.woff2",Ij="./fonts/Xiaolai/Xiaolai-Regular-54acdfc2166ad7fcbd074f75fd4a56ba.woff2",_j="./fonts/Xiaolai/Xiaolai-Regular-29cec36cd205b211da97acabaa62f055.woff2",Tj="./fonts/Xiaolai/Xiaolai-Regular-3756e81d3e149cf6099163ee79944fec.woff2",jj="./fonts/Xiaolai/Xiaolai-Regular-8e9f97f01034820170065b2921b4fb5e.woff2",Aj="./fonts/Xiaolai/Xiaolai-Regular-13d2887ec8ee73c43acdabc52a05af7b.woff2",Dj="./fonts/Xiaolai/Xiaolai-Regular-72536a3d71b694a0d53dd90ddceae41e.woff2",Lj="./fonts/Xiaolai/Xiaolai-Regular-603aefd23e350ba7eb124273e3c9bcf1.woff2",Rj="./fonts/Xiaolai/Xiaolai-Regular-095c169f3314805276f603a362766abd.woff2",Pj="./fonts/Xiaolai/Xiaolai-Regular-9544732d2e62d1a429674f8ee41b5d3a.woff2",Nj="./fonts/Xiaolai/Xiaolai-Regular-d3716376641d615e2995605b29bca7b6.woff2",Oj="./fonts/Xiaolai/Xiaolai-Regular-5a1ce3117cfe90c48e8fb4a9a00f694d.woff2",$j="./fonts/Xiaolai/Xiaolai-Regular-b7d203b051eff504ff59ddca7576b6a9.woff2",Fj="./fonts/Xiaolai/Xiaolai-Regular-4a38cc3e9cf104e69ba246d37f8cf135.woff2",zj="./fonts/Xiaolai/Xiaolai-Regular-982b630266d87db93d2539affb1275c6.woff2",Bj="./fonts/Xiaolai/Xiaolai-Regular-9592bfc861f07bcb8d75c196b370e548.woff2",Hj="./fonts/Xiaolai/Xiaolai-Regular-a7accba310e821da5505f71c03b76bdb.woff2",Xj="./fonts/Xiaolai/Xiaolai-Regular-dac48066b5883d8b4551fc584f0c2a3e.woff2",Wj="./fonts/Xiaolai/Xiaolai-Regular-a1f916d6039285c4ffb900cd654e418f.woff2",Vj="./fonts/Xiaolai/Xiaolai-Regular-95bfd249da4902577b4b7d76ebdd0b44.woff2",Gj="./fonts/Xiaolai/Xiaolai-Regular-93fc8f28a33234bcadf1527cafabd502.woff2",Zj="./fonts/Xiaolai/Xiaolai-Regular-903bb6865f3452e2fda42e3a25547bc5.woff2",Yj="./fonts/Xiaolai/Xiaolai-Regular-4aca6a43e59aceee2166b0c7e4e85ef1.woff2",Kj="./fonts/Xiaolai/Xiaolai-Regular-24476a126f129212beb33f66853ea151.woff2",qj="./fonts/Xiaolai/Xiaolai-Regular-1b611157cd46bb184d4fa4dae2d6a2b8.woff2",Jj="./fonts/Xiaolai/Xiaolai-Regular-56a32a7689abd0326e57c10c6c069bb4.woff2",Qj="./fonts/Xiaolai/Xiaolai-Regular-3cc70dbb64df5b21f1326cc24dee2195.woff2",eA="./fonts/Xiaolai/Xiaolai-Regular-f6032fc06eb20480f096199713f70885.woff2",tA="./fonts/Xiaolai/Xiaolai-Regular-e2ead7ea7da0437f085f42ffc05f8d13.woff2",nA="./fonts/Xiaolai/Xiaolai-Regular-97f7f48ce90c9429bf32ae51469db74d.woff2",aA="./fonts/Xiaolai/Xiaolai-Regular-24a21c1e4449222e8d1898d69ff3a404.woff2",iA="./fonts/Xiaolai/Xiaolai-Regular-726303e0774b4e678bff8c2deb6ca603.woff2",rA="./fonts/Xiaolai/Xiaolai-Regular-5a7fac4b8b23a6e4e5ba0c9bf1756c91.woff2",sA="./fonts/Xiaolai/Xiaolai-Regular-2b7441d46298788ac94e610ffcc709b6.woff2",lA=[{uri:pI,descriptors:{unicodeRange:"U+f9b8-fa6d,U+fe32,U+fe45-fe4f,U+ff02-ff0b,U+ff0d-ff1e,U+ff20-ff2a"}},{uri:UI,descriptors:{unicodeRange:"U+20dd-20de,U+25ef,U+ff2b-ffbe,U+ffc2-ffc7,U+ffca-ffcf,U+ffd2-ffd7,U+ffda-ffdc,U+ffe0-ffe6,U+ffe8-ffee"}},{uri:mI,descriptors:{unicodeRange:"U+d7eb-d7fb,U+f900-f9b7"}},{uri:gI,descriptors:{unicodeRange:"U+d6f2-d7a3,U+d7b0-d7c6,U+d7cb-d7ea"}},{uri:bI,descriptors:{unicodeRange:"U+d609-d6f1"}},{uri:xI,descriptors:{unicodeRange:"U+d520-d608"}},{uri:vI,descriptors:{unicodeRange:"U+d437-d51f"}},{uri:yI,descriptors:{unicodeRange:"U+d34e-d436"}},{uri:wI,descriptors:{unicodeRange:"U+d265-d34d"}},{uri:EI,descriptors:{unicodeRange:"U+d17c-d264"}},{uri:SI,descriptors:{unicodeRange:"U+d093-d17b"}},{uri:kI,descriptors:{unicodeRange:"U+cfaa-d092"}},{uri:MI,descriptors:{unicodeRange:"U+cec1-cfa9"}},{uri:CI,descriptors:{unicodeRange:"U+cdd8-cec0"}},{uri:II,descriptors:{unicodeRange:"U+ccf1-cdd7"}},{uri:_I,descriptors:{unicodeRange:"U+cc08-ccf0"}},{uri:TI,descriptors:{unicodeRange:"U+cb43-cc07"}},{uri:jI,descriptors:{unicodeRange:"U+ca83-cb42"}},{uri:AI,descriptors:{unicodeRange:"U+c9a1-ca82"}},{uri:DI,descriptors:{unicodeRange:"U+c8b8-c9a0"}},{uri:LI,descriptors:{unicodeRange:"U+c7cf-c8b7"}},{uri:RI,descriptors:{unicodeRange:"U+c6e6-c7ce"}},{uri:PI,descriptors:{unicodeRange:"U+c5fd-c6e5"}},{uri:NI,descriptors:{unicodeRange:"U+c514-c5fc"}},{uri:OI,descriptors:{unicodeRange:"U+c42b-c513"}},{uri:$I,descriptors:{unicodeRange:"U+c341-c34e,U+c350-c42a"}},{uri:FI,descriptors:{unicodeRange:"U+c258-c340"}},{uri:zI,descriptors:{unicodeRange:"U+c16f-c257"}},{uri:BI,descriptors:{unicodeRange:"U+c086-c16e"}},{uri:HI,descriptors:{unicodeRange:"U+bf9d-c085"}},{uri:XI,descriptors:{unicodeRange:"U+beb4-bf9c"}},{uri:WI,descriptors:{unicodeRange:"U+bdcb-beb3"}},{uri:VI,descriptors:{unicodeRange:"U+bce2-bdca"}},{uri:GI,descriptors:{unicodeRange:"U+bbf9-bce1"}},{uri:ZI,descriptors:{unicodeRange:"U+bb10-bbf8"}},{uri:YI,descriptors:{unicodeRange:"U+ba27-bb0f"}},{uri:KI,descriptors:{unicodeRange:"U+b93e-ba26"}},{uri:qI,descriptors:{unicodeRange:"U+b855-b93d"}},{uri:JI,descriptors:{unicodeRange:"U+b76c-b854"}},{uri:QI,descriptors:{unicodeRange:"U+b683-b76b"}},{uri:e_,descriptors:{unicodeRange:"U+b59a-b682"}},{uri:t_,descriptors:{unicodeRange:"U+b4b1-b599"}},{uri:n_,descriptors:{unicodeRange:"U+11fb-11ff,U+b3cd-b4b0"}},{uri:a_,descriptors:{unicodeRange:"U+11e6-11fa,U+b2f9-b3cc"}},{uri:i_,descriptors:{unicodeRange:"U+11d1-11e5,U+b225-b2f8"}},{uri:r_,descriptors:{unicodeRange:"U+11bc-11d0,U+b151-b224"}},{uri:s_,descriptors:{unicodeRange:"U+11a7-11bb,U+b07d-b150"}},{uri:l_,descriptors:{unicodeRange:"U+1191-11a6,U+afaa-b07c"}},{uri:o_,descriptors:{unicodeRange:"U+117c-1190,U+aed6-afa9"}},{uri:d_,descriptors:{unicodeRange:"U+1167-117b,U+ae02-aed5"}},{uri:c_,descriptors:{unicodeRange:"U+1152-115e,U+1160-1166,U+ad2d-ae01"}},{uri:u_,descriptors:{unicodeRange:"U+113d-1151,U+ac59-ad2c"}},{uri:h_,descriptors:{unicodeRange:"U+1100-113c,U+9f95-9f98,U+9f9c-9f9e,U+9fa1-9fce,U+9fd0,U+a960-a97c,U+ac00-ac58"}},{uri:f_,descriptors:{unicodeRange:"U+9771-9772,U+9775,U+9777-977b,U+977d-9784,U+9786-978a,U+978c,U+978e-9790,U+9793,U+9795-9797,U+9799-979f,U+97a1-97a2,U+97a4-97aa,U+97ac,U+97ae,U+97b0-97b1,U+97b3,U+97b5-97e5,U+97e8,U+97ee-97f2,U+97f4,U+97f7-982d"}},{uri:p_,descriptors:{unicodeRange:"U+9491,U+9496,U+9498,U+94c7,U+94cf,U+94d3-94d4,U+94da,U+94e6,U+94fb,U+951c,U+9520,U+9527,U+9533,U+953d,U+9543,U+9548,U+954b,U+9555,U+955a,U+9560,U+956e,U+9574-9575,U+9577-957e,U+9580-95e7,U+95ec,U+95ff,U+9607,U+9613,U+9618,U+961b,U+961e,U+9620,U+9623-9629,U+962b-962d,U+962f-9630,U+9637-963a,U+963e,U+9641,U+9643,U+964a,U+964e-964f,U+9651-9653,U+9656-965a,U+965c-965e,U+9660,U+9663,U+9665-9666,U+966b,U+966d-9671,U+9673,U+9678-9684,U+9687,U+9689-968a,U+968c,U+968e,U+9691-9693"}},{uri:U_,descriptors:{unicodeRange:"U+923c-9273,U+9275-928d,U+928f-92ad,U+92af-92c7,U+92c9-92ee"}},{uri:m_,descriptors:{unicodeRange:"U+9159,U+915b-915c,U+915f-9160,U+9166-9168,U+916b,U+916d,U+9173,U+917a-917c,U+9180-9184,U+9186,U+9188,U+918a,U+918e-918f,U+9193-9199,U+919c-91a1,U+91a4-91a9,U+91ab-91ac,U+91b0-91b3,U+91b6-91b9,U+91bb-91c6,U+91c8,U+91cb,U+91d0,U+91d2-91db,U+91dd-923b"}},{uri:g_,descriptors:{unicodeRange:"U+902b-902c,U+9030-9034,U+9037,U+9039-903a,U+903d,U+903f-9040,U+9043,U+9045-9046,U+9048-904c,U+904e,U+9054-9056,U+9059-905a,U+905c-9061,U+9064,U+9066-9067,U+9069-906c,U+906f-9073,U+9076-907c,U+907e,U+9081,U+9084-9087,U+9089-908a,U+908c-9090,U+9092,U+9094,U+9096,U+9098,U+909a,U+909c,U+909e-90a0,U+90a4-90a5,U+90a7-90a9,U+90ab,U+90ad,U+90b2,U+90b7,U+90bc-90bd,U+90bf-90c0,U+90c2-90c3,U+90c6,U+90c8-90c9,U+90cb-90cd,U+90d2,U+90d4-90d6,U+90d8-90da,U+90de-90e0,U+90e3-90e5,U+90e9-90ea,U+90ec,U+90ee,U+90f0-90f3,U+90f5-90f7,U+90f9-90fc,U+90ff-9101,U+9103,U+9105-9118,U+911a-911d,U+911f-9121,U+9124-912e,U+9130,U+9132-9138,U+913a-9142,U+9144-9145,U+9147-9148,U+9151,U+9153-9156,U+9158"}},{uri:b_,descriptors:{unicodeRange:"U+8f03-8f65,U+8f6a,U+8f80,U+8f8c,U+8f92,U+8f9d,U+8fa0-8fa2,U+8fa4-8fa7,U+8faa,U+8fac-8faf,U+8fb2-8fb5,U+8fb7-8fb8,U+8fba-8fbc,U+8fbf-8fc0,U+8fc3,U+8fc6,U+8fc9-8fcd,U+8fcf,U+8fd2,U+8fd6-8fd7,U+8fda,U+8fe0-8fe1,U+8fe3,U+8fe7,U+8fec,U+8fef,U+8ff1-8ff2,U+8ff4-8ff6,U+8ffa-8ffc,U+8ffe-8fff,U+9007-9008,U+900c,U+900e,U+9013,U+9015,U+9018-9019,U+901c,U+9023-9025,U+9027-902a"}},{uri:x_,descriptors:{unicodeRange:"U+8d03-8d1c,U+8d20,U+8d51-8d52,U+8d57,U+8d5f,U+8d65,U+8d68-8d6a,U+8d6c,U+8d6e-8d6f,U+8d71-8d72,U+8d78-8d80,U+8d82-8d83,U+8d86-8d89,U+8d8c-8d90,U+8d92-8d93,U+8d95-8d9e,U+8da0-8da2,U+8da4-8db0,U+8db2,U+8db6-8db7,U+8db9,U+8dbb,U+8dbd,U+8dc0-8dc2,U+8dc5,U+8dc7-8dca,U+8dcd,U+8dd0,U+8dd2-8dd5,U+8dd8-8dd9,U+8ddc,U+8de0-8de2,U+8de5-8de7,U+8de9,U+8ded-8dee,U+8df0-8df2,U+8df4,U+8df6,U+8dfc,U+8dfe-8e04,U+8e06-8e08,U+8e0b,U+8e0d-8e0e,U+8e10-8e13,U+8e15-8e1c,U+8e20-8e21,U+8e24-8e28,U+8e2b,U+8e2d,U+8e30,U+8e32-8e34,U+8e36-8e38,U+8e3b-8e3c,U+8e3e-8e3f,U+8e43,U+8e45-8e46"}},{uri:v_,descriptors:{unicodeRange:"U+8bea,U+8c09,U+8c1e,U+8c38-8c40,U+8c42-8c45,U+8c48,U+8c4a-8c4b,U+8c4d-8c54,U+8c56-8c59,U+8c5b-8c60,U+8c63-8c69,U+8c6c-8c72,U+8c74-8c77,U+8c7b-8c81,U+8c83-8c84,U+8c86-8c88,U+8c8b,U+8c8d-8c93,U+8c95-8c97,U+8c99-8d02"}},{uri:y_,descriptors:{unicodeRange:"U+8a64-8a78,U+8a7a-8a88,U+8a8b-8a92,U+8a94-8b06,U+8b08-8b1b"}},{uri:w_,descriptors:{unicodeRange:"U+8987-89c0,U+89c3,U+89cd,U+89d3-89d5,U+89d7-89d9,U+89db,U+89dd,U+89df-89e2,U+89e4,U+89e7-89ea,U+89ec-89ee,U+89f0-89f2,U+89f4-89ff,U+8a01-8a06,U+8a08-8a3d,U+8a3f-8a47,U+8a49-8a63"}},{uri:E_,descriptors:{unicodeRange:"U+87e3-87e4,U+87e6-87e9,U+87eb-87ed,U+87ef-87f8,U+87fa-87fd,U+87ff-8802,U+8804-8809,U+880b-8812,U+8814,U+8817-881a,U+881c-8820,U+8823-8831,U+8833-8838,U+883a-883b,U+883d-883f,U+8841-8843,U+8846-884b,U+884e-8853,U+8855-8856,U+8858,U+885a-8860,U+8866-8867,U+886a,U+886d,U+886f,U+8871,U+8873-8876,U+8878-887c,U+8880,U+8883,U+8886-8887,U+8889-888a,U+888c,U+888e-8891,U+8893-8895,U+8897-889b,U+889d-88a1,U+88a3,U+88a5-88aa,U+88ac,U+88ae-88b0,U+88b2-88b6,U+88b8-88bb"}},{uri:S_,descriptors:{unicodeRange:"U+86e7-86e8,U+86ea-86ec,U+86ef,U+86f5-86f7,U+86fa-86fd,U+86ff,U+8701,U+8704-8706,U+870b-870c,U+870e-8711,U+8714,U+8716,U+8719,U+871b,U+871d,U+871f-8720,U+8724,U+8726-8728,U+872a-872d,U+872f-8730,U+8732-8733,U+8735-8736,U+8738-873a,U+873c-873d,U+8740-8746,U+874a-874b,U+874d,U+874f-8752,U+8754-8756,U+8758,U+875a-875f,U+8761-8762,U+8766-876d,U+876f,U+8771-8773,U+8775,U+8777-877a,U+877f-8781,U+8784,U+8786-8787,U+8789-878a,U+878c,U+878e-8792,U+8794-8796,U+8798-879e,U+87a0-87a7,U+87a9-87aa,U+87ae,U+87b0-87b2,U+87b4,U+87b6-87b9,U+87bb-87bc,U+87be-87bf,U+87c1-87c5,U+87c7-87c9,U+87cc-87d0,U+87d4-87da,U+87dc-87df,U+87e1-87e2"}},{uri:k_,descriptors:{unicodeRange:"U+8604,U+8606-8610,U+8612-8615,U+8617-8626,U+8628,U+862a-8637,U+8639-863b,U+863d-864c,U+8652-8653,U+8655-8659,U+865b-865d,U+865f-8661,U+8663-866a,U+866d,U+866f-8670,U+8672-8678,U+8683-8689,U+868e-8692,U+8694,U+8696-869b,U+869e-86a2,U+86a5-86a6,U+86ab,U+86ad-86ae,U+86b2-86b3,U+86b7-86b9,U+86bb-86bf,U+86c1-86c3,U+86c5,U+86c8,U+86cc-86cd,U+86d2-86d3,U+86d5-86d7,U+86da,U+86dc-86dd,U+86e0-86e3,U+86e5-86e6"}},{uri:M_,descriptors:{unicodeRange:"U+8456,U+8458,U+845d-8460,U+8462,U+8464-8468,U+846a,U+846e-8470,U+8472,U+8474,U+8477,U+8479,U+847b-8481,U+8483-8486,U+848a,U+848d,U+848f-8496,U+8498,U+849a-849b,U+849d-84a0,U+84a2-84ae,U+84b0-84b1,U+84b3,U+84b5-84b7,U+84bb-84bc,U+84be,U+84c0,U+84c2-84c3,U+84c5-84c8,U+84cb-84cc,U+84ce-84cf,U+84d2,U+84d4-84d5,U+84d7-84dc,U+84de,U+84e1-84e2,U+84e4,U+84e7-84eb,U+84ed-84ef,U+84f1-84fb,U+84fd-84fe,U+8500-850b,U+850d-8510,U+8512,U+8514-8516,U+8518-8519,U+851b-851e,U+8520,U+8522-852a,U+852d-8536,U+853e-8542,U+8544-8547,U+854b-854f"}},{uri:C_,descriptors:{unicodeRange:"U+82c2-82c3,U+82c5-82c6,U+82c9,U+82d0,U+82d6,U+82d9-82da,U+82dd,U+82e2,U+82e7-82ea,U+82ec-82ee,U+82f0,U+82f2-82f3,U+82f5-82f6,U+82f8,U+82fa,U+82fc-8300,U+830a-830b,U+830d,U+8310,U+8312-8313,U+8316,U+8318-8319,U+831d-8326,U+8329-832a,U+832e,U+8330,U+8332,U+8337,U+833b,U+833d-833f,U+8341-8342,U+8344-8345,U+8348,U+834a-834e,U+8353,U+8355-8359,U+835d,U+8362,U+8370-8376,U+8379-837a,U+837e-8384,U+8387-8388,U+838a-838d,U+838f-8391,U+8394-8397,U+8399-839a,U+839d,U+839f,U+83a1-83a7,U+83ac-83af,U+83b5,U+83bb,U+83be-83bf,U+83c2-83c4,U+83c6,U+83c8-83c9,U+83cb,U+83cd-83ce,U+83d0-83d3,U+83d5,U+83d7,U+83d9-83db,U+83de,U+83e2-83e4,U+83e6-83e8,U+83eb-83ef,U+83f3-83f7,U+83fa-83fc,U+83fe-8400,U+8402,U+8405,U+8407-840a,U+8410,U+8412-8417,U+8419-841b,U+841e-8423,U+8429-8430,U+8432-8437,U+8439-843b,U+843e-8445,U+8447-8450,U+8452-8455"}},{uri:I_,descriptors:{unicodeRange:"U+81a4-81a5,U+81a7,U+81a9,U+81ab-81b2,U+81b4-81b9,U+81bc-81bf,U+81c4-81c5,U+81c7-81c9,U+81cb,U+81cd-81e2,U+81e4-81e6,U+81e8-81e9,U+81eb,U+81ee-81f2,U+81f5-81fa,U+81fd,U+81ff,U+8203,U+8207-820b,U+820e-820f,U+8211,U+8213,U+8215-821a,U+821d,U+8220,U+8224-8227,U+8229,U+822e,U+8232,U+823a,U+823c-823d,U+823f-8243,U+8245-8246,U+8248,U+824a,U+824c-824e,U+8250-8257,U+8259,U+825b-825e,U+8260-8267,U+8269-826d,U+8271,U+8275-8278,U+827b-827c,U+8280-8281,U+8283,U+8285-8287,U+8289,U+828c,U+8290,U+8293-8296,U+829a-829b,U+829e,U+82a0,U+82a2-82a3,U+82a7,U+82b2,U+82b5-82b6,U+82ba-82bc,U+82bf-82c0"}},{uri:__,descriptors:{unicodeRange:"U+8059,U+805b-8068,U+806b-8070,U+8072-807e,U+8081-8082,U+8085,U+8088,U+808a,U+808d-8092,U+8094-8095,U+8097,U+8099,U+809e,U+80a3,U+80a6-80a8,U+80ac,U+80b0,U+80b3,U+80b5-80b6,U+80b8-80b9,U+80bb,U+80c5,U+80c7-80cb,U+80cf-80d5,U+80d8,U+80df-80e0,U+80e2-80e3,U+80e6,U+80ee,U+80f5,U+80f7,U+80f9,U+80fb,U+80fe-8101,U+8103-8105,U+8107-8108,U+810b-810c,U+8115,U+8117,U+8119,U+811b-811d,U+811f-812b,U+812d-812e,U+8130,U+8133-8135,U+8137,U+8139-813d,U+813f-8145,U+8147,U+8149,U+814d-814f,U+8152,U+8156-8158,U+815b-815f,U+8161-8164,U+8166,U+8168,U+816a-816c,U+816f,U+8172-8173,U+8175-8178,U+8181,U+8183-8187,U+8189,U+818b-818e,U+8190,U+8192-8197,U+8199-819a,U+819e-81a2"}},{uri:T_,descriptors:{unicodeRange:"U+7f3c-7f41,U+7f43,U+7f46-7f4f,U+7f52-7f53,U+7f56,U+7f59,U+7f5b-7f5e,U+7f60,U+7f63-7f67,U+7f6b-7f6d,U+7f6f-7f70,U+7f73,U+7f75-7f78,U+7f7a-7f7d,U+7f7f-7f80,U+7f82-7f89,U+7f8b,U+7f8d,U+7f8f-7f93,U+7f95-7f99,U+7f9b-7f9c,U+7fa0,U+7fa2-7fa3,U+7fa5-7fa6,U+7fa8-7fae,U+7fb1,U+7fb3-7fb7,U+7fba-7fbb,U+7fbe,U+7fc0,U+7fc2-7fc4,U+7fc6-7fc9,U+7fcb,U+7fcd,U+7fcf-7fd3,U+7fd6-7fd7,U+7fd9-7fde,U+7fe2-7fe4,U+7fe7-7fe8,U+7fea-7fed,U+7fef,U+7ff2,U+7ff4-7ffa,U+7ffd-7fff,U+8002,U+8007-800a,U+800e-800f,U+8011,U+8013,U+801a-801b,U+801d-801f,U+8021,U+8023-8024,U+802b-8030,U+8032,U+8034,U+8039-803a,U+803c,U+803e,U+8040-8041,U+8044-8045,U+8047-8049,U+804e-8051,U+8053,U+8055-8057"}},{uri:j_,descriptors:{unicodeRange:"U+7cd8,U+7cda-7cdb,U+7cdd-7cde,U+7ce1-7ce7,U+7ce9-7cee,U+7cf0-7cf7,U+7cf9-7cfa,U+7cfc-7d09,U+7d0b-7d1f,U+7d21,U+7d23-7d26,U+7d28-7d2a,U+7d2c-7d2e,U+7d30-7d6d,U+7d6f-7d76,U+7d78-7d94"}},{uri:A_,descriptors:{unicodeRange:"U+7afe,U+7b00-7b02,U+7b05,U+7b07,U+7b09,U+7b0c-7b0e,U+7b10,U+7b12-7b13,U+7b16-7b18,U+7b1a,U+7b1c-7b1d,U+7b1f,U+7b21-7b23,U+7b27,U+7b29,U+7b2d,U+7b2f-7b30,U+7b32,U+7b34-7b37,U+7b39,U+7b3b,U+7b3d,U+7b3f-7b44,U+7b46,U+7b48,U+7b4a,U+7b4d-7b4e,U+7b53,U+7b55,U+7b57,U+7b59,U+7b5c,U+7b5e-7b5f,U+7b61,U+7b63-7b6d,U+7b6f-7b70,U+7b73-7b74,U+7b76,U+7b78,U+7b7a,U+7b7c-7b7d,U+7b7f,U+7b81-7b84,U+7b86-7b8c,U+7b8e-7b8f,U+7b91-7b93,U+7b96,U+7b98-7b9b,U+7b9e-7ba0,U+7ba3-7ba5,U+7bae-7bb0,U+7bb2-7bb3,U+7bb5-7bb7,U+7bb9-7bc0,U+7bc2-7bc5,U+7bc8-7bcb,U+7bcd-7bd0,U+7bd2,U+7bd4-7bd8,U+7bdb-7bdc,U+7bde-7be0,U+7be2-7be4,U+7be7-7be9,U+7beb-7bed,U+7bef-7bf0,U+7bf2-7bf6,U+7bf8-7bfb,U+7bfd,U+7bff-7c06,U+7c08-7c0a,U+7c0d-7c0e,U+7c10-7c13"}},{uri:D_,descriptors:{unicodeRange:"U+7a10-7a13,U+7a15-7a16,U+7a18-7a19,U+7a1b-7a1d,U+7a1f,U+7a21-7a22,U+7a24-7a32,U+7a34-7a36,U+7a38,U+7a3a,U+7a3e,U+7a40-7a45,U+7a47-7a50,U+7a52-7a56,U+7a58-7a6f,U+7a71-7a73,U+7a75,U+7a7b-7a7e,U+7a82,U+7a85,U+7a87,U+7a89-7a8c,U+7a8e-7a90,U+7a93-7a94,U+7a99-7a9b,U+7a9e,U+7aa1-7aa4,U+7aa7,U+7aa9-7aab,U+7aae-7ab2,U+7ab4-7abe,U+7ac0-7aca,U+7acc-7ad5,U+7ad7-7ad8,U+7ada-7add,U+7ae1-7ae2,U+7ae4,U+7ae7-7aec,U+7aee,U+7af0-7af8,U+7afb-7afc"}},{uri:L_,descriptors:{unicodeRange:"U+790d-7912,U+7914-791d,U+791f-7923,U+7925-7933,U+7935-7939,U+793d,U+793f,U+7942-7945,U+7947,U+794a-7952,U+7954-7955,U+7958-7959,U+7961,U+7963-7964,U+7966,U+7969-796c,U+796e,U+7970-7976,U+7979,U+797b-797f,U+7982-7983,U+7986-7989,U+798b-798e,U+7990-7999,U+799b-79a6,U+79a8-79b2,U+79b4-79b8,U+79bc,U+79bf,U+79c2,U+79c4-79c5,U+79c7-79c8,U+79ca,U+79cc,U+79ce-79d0,U+79d3-79d4,U+79d6-79d7,U+79d9-79de,U+79e0-79e2,U+79e5,U+79e8,U+79ea,U+79ec,U+79ee,U+79f1-79f7,U+79f9-79fa,U+79fc,U+79fe-79ff,U+7a01,U+7a04-7a05,U+7a07-7a0a,U+7a0c,U+7a0f"}},{uri:R_,descriptors:{unicodeRange:"U+77d8-77da,U+77dd-77e1,U+77e4,U+77e6,U+77e8,U+77ea,U+77ef-77f2,U+77f4-77f5,U+77f7,U+77f9-77fc,U+7803-7808,U+780a-780b,U+780e-7810,U+7813,U+7815,U+7819,U+781b,U+781e,U+7820-7822,U+7824,U+7828,U+782a-782b,U+782e-782f,U+7831-7833,U+7835-7836,U+783d,U+783f,U+7841-7844,U+7846,U+7848-784b,U+784d,U+784f,U+7851,U+7853-7854,U+7858-785c,U+785e-7869,U+786f-7876,U+7878-787b,U+787d-7886,U+7888,U+788a-788b,U+788f-7890,U+7892,U+7894-7896,U+7899,U+789d-789e,U+78a0,U+78a2,U+78a4,U+78a6,U+78a8-78af,U+78b5-78b8,U+78ba-78bd,U+78bf-78c0,U+78c2-78c4,U+78c6-78c8,U+78cc-78cf,U+78d1-78d3,U+78d6-78d8,U+78da-78e7,U+78e9-78eb,U+78ed-78f1,U+78f3,U+78f5-78f6,U+78f8-78f9,U+78fb-7900,U+7902-7904,U+7906-790c"}},{uri:P_,descriptors:{unicodeRange:"U+76af-76b0,U+76b3,U+76b5-76be,U+76c0-76c1,U+76c3-76c4,U+76c7,U+76c9,U+76cb-76cc,U+76d3,U+76d5,U+76d9-76da,U+76dc-76de,U+76e0-76e4,U+76e6-76ed,U+76f0,U+76f3,U+76f5-76f7,U+76fa-76fb,U+76fd,U+76ff-7703,U+7705-7706,U+770a,U+770c,U+770e-7718,U+771b-771e,U+7721,U+7723-7725,U+7727,U+772a-772c,U+772e,U+7730-7734,U+7739,U+773b,U+773d-773f,U+7742,U+7744-7746,U+7748-774f,U+7752-7759,U+775c-7760,U+7764,U+7767,U+7769-776a,U+776d-7778,U+777a-777c,U+7781-7783,U+7786-778b,U+778f-7790,U+7793-779e,U+77a1,U+77a3-77a4,U+77a6,U+77a8,U+77ab,U+77ad-77af,U+77b1-77b2,U+77b4,U+77b6-77ba,U+77bc,U+77be,U+77c0-77cc,U+77ce-77d6"}},{uri:N_,descriptors:{unicodeRange:"U+7589-758a,U+758c-758e,U+7590,U+7593,U+7595,U+7598,U+759b-759c,U+759e,U+75a2,U+75a6-75aa,U+75ad,U+75b6-75b7,U+75ba-75bb,U+75bf-75c1,U+75c6,U+75cb-75cc,U+75ce-75d1,U+75d3,U+75d7,U+75d9-75da,U+75dc-75dd,U+75df-75e1,U+75e5,U+75e9,U+75ec-75ef,U+75f2-75f3,U+75f5-75f8,U+75fa-75fb,U+75fd-75fe,U+7602,U+7604,U+7606-7609,U+760b,U+760d-760f,U+7611-7614,U+7616,U+761a,U+761c-761e,U+7621,U+7623,U+7627-7628,U+762c,U+762e-762f,U+7631-7632,U+7636-7637,U+7639-763b,U+763d,U+7641-7642,U+7644-764b,U+764e-7653,U+7655,U+7657-765b,U+765d,U+765f-7662,U+7664-766a,U+766c-766e,U+7670-7677,U+7679-767a,U+767c,U+767f-7681,U+7683,U+7685,U+7689-768a,U+768c-768d,U+768f-7690,U+7692,U+7694-7695,U+7697-7698,U+769a-76a3,U+76a5-76ad"}},{uri:O_,descriptors:{unicodeRange:"U+7492-749b,U+749d,U+749f-74a6,U+74aa-74b9,U+74bb-74d1,U+74d3-74db,U+74dd,U+74df,U+74e1,U+74e5,U+74e7-74ed,U+74f0-74f3,U+74f5,U+74f8-74fe,U+7500-7503,U+7505-750c,U+750e,U+7510,U+7512,U+7514-7517,U+751b,U+751d-751e,U+7520-7524,U+7526-7527,U+752a,U+752e,U+7534,U+7536,U+7539,U+753c-753d,U+753f,U+7541-7544,U+7546-7547,U+7549-754a,U+754d,U+7550-7553,U+7555-7558,U+755d-7564,U+7567-7569,U+756b-7571,U+7573,U+7575-7577,U+757a-757e,U+7580-7582,U+7584-7585,U+7587-7588"}},{uri:$_,descriptors:{unicodeRange:"U+7372-737d,U+737f-7383,U+7385-7386,U+7388,U+738a,U+738c-738d,U+738f-7390,U+7392-7395,U+7397-739a,U+739c-739e,U+73a0-73a1,U+73a3-73a8,U+73aa,U+73ac-73ad,U+73b1,U+73b4-73b6,U+73b8-73b9,U+73bc-73bf,U+73c1,U+73c3-73c7,U+73cb-73cc,U+73ce,U+73d2-73d8,U+73da-73dd,U+73df,U+73e1-73e4,U+73e6,U+73e8,U+73ea-73ec,U+73ee-73f1,U+73f3-7402,U+7404,U+7407-7408,U+740b-740e,U+7411-7419,U+741c-7421,U+7423-7424,U+7427,U+7429,U+742b,U+742d,U+742f,U+7431-7432,U+7437-743b,U+743d-7440,U+7442-7454,U+7456,U+7458,U+745d,U+7460-746c,U+746e-746f,U+7471-7475,U+7478-747d,U+747f,U+7482,U+7484-7486,U+7488-748a,U+748c-748d,U+748f,U+7491"}},{uri:F_,descriptors:{unicodeRange:"U+7054-705d,U+705f-706a,U+706e,U+7071-7074,U+7077,U+7079-707b,U+707d,U+7081-7084,U+7086-7088,U+708b-708d,U+708f-7091,U+7093,U+7097-7098,U+709a-709b,U+709e-70aa,U+70b0,U+70b2,U+70b4-70b6,U+70ba,U+70be-70bf,U+70c4-70c7,U+70c9,U+70cb-70d7,U+70da,U+70dc-70de,U+70e0-70e3,U+70e5,U+70ea,U+70ee,U+70f0-70f6,U+70f8,U+70fa-70fc,U+70fe-7108,U+710b-710f,U+7111-7112,U+7114,U+7117,U+711b-7125,U+7127-712e,U+7132-7135,U+7137-7144,U+7146-7149,U+714b,U+714d,U+714f-715b,U+715d,U+715f-7163,U+7165,U+7169-716d,U+716f-7171,U+7174-7177"}},{uri:z_,descriptors:{unicodeRange:"U+722e-722f,U+7232-7234,U+723a,U+723c,U+723e,U+7240-7246,U+7249-724b,U+724e-7251,U+7253-7255,U+7257-7258,U+725a,U+725c,U+725e,U+7260,U+7263-7265,U+7268,U+726a-726d,U+7270-7271,U+7273-7274,U+7276-7278,U+727b-727d,U+7282-7283,U+7285-7289,U+728c,U+728e,U+7290-7291,U+7293-729e,U+72a0-72ab,U+72ae,U+72b1-72b3,U+72b5,U+72ba-72c0,U+72c5-72c7,U+72c9-72cc,U+72cf,U+72d1,U+72d3-72d6,U+72d8,U+72da-72dd,U+72df,U+72e2-72e7,U+72ea-72eb,U+72f5-72f6,U+72f9,U+72fd-7300,U+7302,U+7304-7309,U+730b-730d,U+730f-7312,U+7314,U+7318-731a,U+731f-7320,U+7323-7324,U+7326-7328,U+732d,U+732f-7330,U+7332-7333,U+7335-7336,U+733a-733d,U+7340-734c,U+734e-734f,U+7351,U+7353-7356,U+7358-735f,U+7361-736b,U+736e,U+7370-7371"}},{uri:B_,descriptors:{unicodeRange:"U+6ec5-6ec6,U+6ec8-6eca,U+6ecc-6ece,U+6ed0,U+6ed2,U+6ed6,U+6ed8-6ed9,U+6edb-6edd,U+6ee3,U+6ee7,U+6eea-6ef3,U+6ef5-6ef8,U+6efa-6f01,U+6f03-6f05,U+6f07-6f08,U+6f0a-6f0e,U+6f10-6f12,U+6f16-6f1f,U+6f21-6f23,U+6f25-6f28,U+6f2c,U+6f2e,U+6f30,U+6f32,U+6f34-6f35,U+6f37-6f3d,U+6f3f-6f45,U+6f48-6f4a,U+6f4c,U+6f4e-6f57,U+6f59-6f5b,U+6f5d,U+6f5f-6f61,U+6f63-6f65,U+6f67-6f6c,U+6f6f-6f71,U+6f73,U+6f75-6f77,U+6f79,U+6f7b,U+6f7d-6f83,U+6f85-6f87,U+6f8a-6f8b,U+6f8f-6f9b,U+6f9d-6fa0,U+6fa2-6fa6,U+6fa8-6fb1"}},{uri:H_,descriptors:{unicodeRange:"U+6d73,U+6d75-6d76,U+6d79-6d7b,U+6d7d-6d81,U+6d83-6d84,U+6d86-6d87,U+6d8a-6d8b,U+6d8d,U+6d8f-6d90,U+6d92,U+6d96-6d9a,U+6d9c,U+6da2,U+6da5,U+6dac-6dad,U+6db0-6db1,U+6db3-6db4,U+6db6-6db7,U+6db9-6dbe,U+6dc1-6dc3,U+6dc8-6dca,U+6dcd-6dd0,U+6dd2-6dd5,U+6dd7,U+6dda-6ddc,U+6ddf,U+6de2-6de3,U+6de5,U+6de7-6dea,U+6ded,U+6def-6df0,U+6df2,U+6df4-6df6,U+6df8,U+6dfa,U+6dfd-6e04,U+6e06-6e09,U+6e0b,U+6e0f,U+6e12-6e13,U+6e15,U+6e18-6e19,U+6e1b-6e1c,U+6e1e-6e1f,U+6e22,U+6e26-6e28,U+6e2a,U+6e2c,U+6e2e,U+6e30-6e31,U+6e33,U+6e35-6e37,U+6e39,U+6e3b-6e42,U+6e45-6e4c,U+6e4f-6e52,U+6e55,U+6e57,U+6e59-6e5a,U+6e5c-6e5e,U+6e60-6e6a,U+6e6c-6e6d,U+6e6f-6e7d,U+6e80-6e82,U+6e84,U+6e87-6e88,U+6e8a-6e8e,U+6e91-6e97,U+6e99-6e9b,U+6e9d-6e9e,U+6ea0-6ea1,U+6ea3-6ea4,U+6ea6,U+6ea8-6ea9,U+6eab-6eae,U+6eb0,U+6eb3,U+6eb5,U+6eb8-6eb9,U+6ebc,U+6ebe-6ec0,U+6ec3-6ec4"}},{uri:X_,descriptors:{unicodeRange:"U+6bbb-6bbe,U+6bc0,U+6bc3-6bc4,U+6bc6-6bca,U+6bcc,U+6bce,U+6bd0-6bd1,U+6bd8,U+6bda,U+6bdc-6be0,U+6be2-6be9,U+6bec-6bee,U+6bf0-6bf2,U+6bf4,U+6bf6-6bf8,U+6bfa-6bfc,U+6bfe-6c04,U+6c08-6c0c,U+6c0e,U+6c12,U+6c17,U+6c1c-6c1e,U+6c20,U+6c23,U+6c25,U+6c2b-6c2d,U+6c31,U+6c33,U+6c36-6c37,U+6c39-6c3c,U+6c3e-6c3f,U+6c43-6c45,U+6c48,U+6c4b-6c4f,U+6c51-6c53,U+6c56,U+6c58-6c5a,U+6c62-6c63,U+6c65-6c67,U+6c6b-6c6f,U+6c71,U+6c73,U+6c75,U+6c77-6c78,U+6c7a-6c7c,U+6c7f-6c80,U+6c84,U+6c87,U+6c8a-6c8b,U+6c8d-6c8e,U+6c91-6c92,U+6c95-6c98,U+6c9a,U+6c9c-6c9e,U+6ca0,U+6ca2,U+6ca8,U+6cac,U+6caf-6cb0,U+6cb4-6cb7,U+6cba,U+6cc0-6cc3,U+6cc6-6cc8,U+6ccb,U+6ccd-6ccf,U+6cd1-6cd2,U+6cd8-6cda,U+6cdc-6cdd,U+6cdf,U+6ce4,U+6ce6-6ce7,U+6ce9,U+6cec-6ced,U+6cf2,U+6cf4,U+6cf9,U+6cff-6d00,U+6d02-6d03,U+6d05-6d06,U+6d08-6d0a,U+6d0d,U+6d0f-6d11,U+6d13-6d16,U+6d18,U+6d1c-6d1d,U+6d1f-6d24,U+6d26,U+6d28-6d29,U+6d2c-6d2d,U+6d2f-6d30,U+6d34,U+6d36-6d38,U+6d3a,U+6d3f-6d40,U+6d42,U+6d44,U+6d49,U+6d4c,U+6d50,U+6d55-6d58,U+6d5b,U+6d5d,U+6d5f,U+6d61-6d62,U+6d64-6d65,U+6d67-6d68,U+6d6b-6d6d,U+6d70-6d72"}},{uri:W_,descriptors:{unicodeRange:"U+6967-696a,U+696c-696d,U+696f-6970,U+6972-6976,U+697a-697b,U+697d-697f,U+6981,U+6983,U+6985,U+698a-698c,U+698e-6993,U+6996-6997,U+6999-699a,U+699d-69a6,U+69a9-69aa,U+69ac,U+69ae-69b0,U+69b2-69b3,U+69b5-69b6,U+69b8-69ba,U+69bc-69c0,U+69c2-69c9,U+69cb,U+69cd,U+69cf,U+69d1-69d3,U+69d5-69da,U+69dc-69de,U+69e1-69ec,U+69ee-69f1,U+69f3-69fc,U+69fe,U+6a00-6a09,U+6a0b-6a16,U+6a19-6a1e,U+6a20,U+6a22-6a27,U+6a29,U+6a2b-6a2e,U+6a30,U+6a32-6a34,U+6a36-6a3c,U+6a3f-6a43,U+6a45-6a46,U+6a48-6a4a"}},{uri:V_,descriptors:{unicodeRange:"U+6830-6831,U+6834-6836,U+683a-683b,U+683f,U+6847,U+684b,U+684d,U+684f,U+6852,U+6856-685f,U+686a,U+686c-6873,U+6875,U+6878-6880,U+6882,U+6884,U+6887-688e,U+6890-6892,U+6894-6896,U+6898-68a1,U+68a3-68a5,U+68a9-68ac,U+68ae,U+68b1-68b2,U+68b4,U+68b6-68bf,U+68c1,U+68c3-68c8,U+68ca,U+68cc,U+68ce-68d1,U+68d3-68d4,U+68d6-68d7,U+68d9,U+68db-68df,U+68e1-68e2,U+68e4-68ed,U+68ef,U+68f2-68f4,U+68f6-68f8,U+68fb,U+68fd-6900,U+6902-6904,U+6906-690a,U+690c,U+690f,U+6911,U+6913-691e,U+6921-6923,U+6925-692c,U+692e-692f,U+6931-6933,U+6935-6938,U+693a-693c,U+693e,U+6940-6941,U+6943-6953,U+6955-6956,U+6958-6959,U+695b-695c,U+695f,U+6961-6962,U+6964-6965"}},{uri:G_,descriptors:{unicodeRange:"U+66b8,U+66ba-66bd,U+66bf-66d8,U+66da,U+66de-66e5,U+66e7-66e8,U+66ea-66ef,U+66f1,U+66f5-66f6,U+66f8,U+66fa-66fb,U+66fd,U+6701-6707,U+670c,U+670e-670f,U+6711-6713,U+6716,U+6718-671a,U+671c,U+671e,U+6720-6725,U+6727,U+6729,U+672e,U+6730,U+6732-6733,U+6736-6739,U+673b-673c,U+673e-673f,U+6741,U+6744-6745,U+6747,U+674a-674b,U+674d,U+6752,U+6754-6755,U+6757-675b,U+675d,U+6762-6764,U+6766-6767,U+676b-676c,U+676e,U+6771,U+6774,U+6776,U+6778-677b,U+677d,U+6780,U+6782-6783,U+6785-6786,U+6788,U+678a,U+678c-678f,U+6791-6794,U+6796,U+6799,U+679b,U+679f-67a1,U+67a4,U+67a6,U+67a9,U+67ac,U+67ae,U+67b1-67b2,U+67b4,U+67b9-67c0,U+67c2,U+67c5-67ce,U+67d5-67d7,U+67db,U+67df,U+67e1,U+67e3-67e4,U+67e6-67e8,U+67ea-67eb,U+67ed-67ee,U+67f2,U+67f5-67fc,U+67fe,U+6801-6804,U+6806,U+680d,U+6810,U+6812,U+6814-6815,U+6818-681c,U+681e-6820,U+6822-6828,U+682b-682f"}},{uri:Z_,descriptors:{unicodeRange:"U+6569-656a,U+656d-656f,U+6571,U+6573,U+6575-6576,U+6578-6586,U+6588-658a,U+658d-658f,U+6592,U+6594-6596,U+6598,U+659a,U+659d-659e,U+65a0,U+65a2-65a3,U+65a6,U+65a8,U+65aa,U+65ac,U+65ae,U+65b1-65b8,U+65ba-65bb,U+65be-65c0,U+65c2,U+65c7-65ca,U+65cd,U+65d0-65d1,U+65d3-65d5,U+65d8-65df,U+65e1,U+65e3-65e4,U+65ea-65eb,U+65f2-65f5,U+65f8-65f9,U+65fb-65ff,U+6601,U+6604-6605,U+6607-6609,U+660b,U+660d,U+6610-6612,U+6616-6618,U+661a-661c,U+661e,U+6621-6624,U+6626,U+6629-662c,U+662e,U+6630,U+6632-6633,U+6637-663b,U+663d,U+663f-6640,U+6642,U+6644-664a,U+664d-664e,U+6650-6651,U+6658-6659,U+665b-665e,U+6660,U+6662-6663,U+6665,U+6667,U+6669-666d,U+6671-6673,U+6675,U+6678-6679,U+667b-667d,U+667f-6681,U+6683,U+6685-6686,U+6688-668b,U+668d-6690,U+6692-6695,U+6698-669c,U+669e-66a6,U+66a9-66ad,U+66af-66b3,U+66b5-66b7"}},{uri:Y_,descriptors:{unicodeRange:"U+5f30,U+5f32-5f38,U+5f3b,U+5f3d-5f3f,U+5f41-5f4f,U+5f51,U+5f54,U+5f59-5f5c,U+5f5e-5f60,U+5f63,U+5f65,U+5f67-5f68,U+5f6b,U+5f6e-5f6f,U+5f72,U+5f74-5f76,U+5f78,U+5f7a,U+5f7d-5f7f,U+5f83,U+5f86,U+5f8d-5f8f,U+5f91,U+5f93-5f94,U+5f96,U+5f9a-5f9b,U+5f9d-5fa0,U+5fa2-5fa7,U+5fa9,U+5fab-5fac,U+5faf-5fb4,U+5fb6,U+5fb8-5fbb,U+5fbe-5fc2,U+5fc7-5fc8,U+5fca-5fcb,U+5fce,U+5fd3-5fd5,U+5fda-5fdc,U+5fde-5fdf,U+5fe2-5fe3,U+5fe5-5fe6,U+5fe8-5fe9,U+5fec,U+5fef-5ff0,U+5ff2-5ff4,U+5ff6-5ff7,U+5ff9-5ffa,U+5ffc,U+6007-6009,U+600b-600c,U+6010-6011,U+6013,U+6017-6018,U+601a,U+601e-601f,U+6022-6024,U+602c-602e,U+6030-6034,U+6036-603a,U+603d-603e,U+6040,U+6044-604a,U+604c,U+604e-604f,U+6051,U+6053-6054,U+6056-6058,U+605b-605c,U+605e-6061,U+6065-6066,U+606e,U+6071-6072,U+6074-6075,U+6077,U+607e,U+6080-6082,U+6085-6088,U+608a-608b,U+608e-6091,U+6093,U+6095,U+6097-6099,U+609c,U+609e,U+60a1-60a2,U+60a4-60a5,U+60a7,U+60a9-60aa,U+60ae,U+60b0,U+60b3,U+60b5-60b7,U+60b9-60ba,U+60bd-60c4,U+60c7-60c9,U+60cc"}},{uri:K_,descriptors:{unicodeRange:"U+635a-635d,U+6360,U+6364-6366,U+6368,U+636a-636c,U+636f-6370,U+6372-6375,U+6378-6379,U+637c-637f,U+6381,U+6383-6386,U+638b,U+638d,U+6391,U+6393-6395,U+6397,U+6399-639f,U+63a1,U+63a4,U+63a6,U+63ab,U+63af,U+63b1-63b2,U+63b5-63b6,U+63b9,U+63bb,U+63bd,U+63bf-63c3,U+63c5,U+63c7-63c8,U+63ca-63cc,U+63d1,U+63d3-63d5,U+63d7-63dd,U+63df,U+63e2,U+63e4-63e8,U+63eb-63ec,U+63ee-63f1,U+63f3,U+63f5,U+63f7,U+63f9-63fc,U+63fe,U+6403-6404,U+6406-640a,U+640d-640e,U+6411-6412,U+6415-641a,U+641d,U+641f,U+6422-6425,U+6427-6429,U+642b,U+642e-6433,U+6435-6439,U+643b-643c,U+643e,U+6440,U+6442-6443,U+6449,U+644b-6451,U+6453,U+6455-6457,U+6459-645d,U+645f-6466,U+6468,U+646a-646c,U+646e-6477,U+647b-6481,U+6483,U+6486,U+6488-648f"}},{uri:q_,descriptors:{unicodeRange:"U+61c5-61c7,U+61c9,U+61cc-61d0,U+61d3,U+61d5-61e5,U+61e7-61f4,U+61f6-61fe,U+6200-6205,U+6207,U+6209,U+6213-6214,U+6219,U+621c-621e,U+6220,U+6223,U+6226-6229,U+622b,U+622d,U+622f-6232,U+6235-6236,U+6238-623c,U+6242,U+6244-6246,U+624a,U+624f-6250,U+6255-6257,U+6259-625a,U+625c-6262,U+6264-6265,U+6268,U+6271-6272,U+6274-6275,U+6277-6278,U+627a-627b,U+627d,U+6281-6283,U+6285-6288,U+628b-6290,U+6294,U+6299,U+629c-629e,U+62a3,U+62a6-62a7,U+62a9-62aa,U+62ad-62b0,U+62b2-62b4,U+62b6-62b8,U+62ba,U+62be,U+62c0-62c1,U+62c3,U+62cb,U+62cf,U+62d1,U+62d5,U+62dd-62de,U+62e0-62e1,U+62e4,U+62ea-62eb,U+62f0,U+62f2,U+62f5,U+62f8-62fb,U+6300,U+6303-6306,U+630a-630d,U+630f-6310,U+6312-6315,U+6317-6319,U+631c,U+6326-6327,U+6329,U+632c-632e,U+6330-6331,U+6333-6338,U+633b-633c,U+633e-6341,U+6344,U+6347-6348,U+634a,U+6351-6354,U+6356-6359"}},{uri:J_,descriptors:{unicodeRange:"U+5dd0-5dda,U+5ddc,U+5ddf-5de0,U+5de3-5de4,U+5dea,U+5dec-5ded,U+5df0,U+5df5-5df6,U+5df8-5dfc,U+5dff-5e00,U+5e04,U+5e07,U+5e09-5e0b,U+5e0d-5e0e,U+5e12-5e13,U+5e17,U+5e1e-5e25,U+5e28-5e2c,U+5e2f-5e30,U+5e32-5e36,U+5e39-5e3a,U+5e3e-5e41,U+5e43,U+5e46-5e4b,U+5e4d-5e53,U+5e56-5e5a,U+5e5c-5e5d,U+5e5f-5e60,U+5e63-5e71,U+5e75,U+5e77,U+5e79,U+5e7e,U+5e81-5e83,U+5e85,U+5e88-5e89,U+5e8c-5e8e,U+5e92,U+5e98,U+5e9b,U+5e9d,U+5ea1-5ea4,U+5ea8-5eac,U+5eae-5eb2,U+5eb4,U+5eba-5ebd,U+5ebf-5ec8,U+5ecb-5ed0,U+5ed4-5ed5,U+5ed7-5eda,U+5edc-5ee7,U+5ee9,U+5eeb-5ef3,U+5ef5,U+5ef8-5ef9,U+5efb-5efd,U+5f05-5f07,U+5f09,U+5f0c-5f0e,U+5f10,U+5f12,U+5f14,U+5f16,U+5f19-5f1a,U+5f1c-5f1e,U+5f21-5f24,U+5f28,U+5f2b-5f2c,U+5f2e"}},{uri:Q_,descriptors:{unicodeRange:"U+60cd-60d0,U+60d2-60d4,U+60d6-60d7,U+60d9,U+60db,U+60de,U+60e1-60e5,U+60ea,U+60f1-60f2,U+60f5,U+60f7-60f8,U+60fb-60ff,U+6102-6105,U+6107,U+610a-610c,U+6110-6114,U+6116-6119,U+611b-611e,U+6121-6122,U+6125,U+6128-612a,U+612c-613e,U+6140-6147,U+6149,U+614b,U+614d,U+614f-6150,U+6152-6154,U+6156-615c,U+615e-6161,U+6163-6166,U+6169-616f,U+6171-6174,U+6176,U+6178-618a,U+618c-618d,U+618f-6193,U+6195-619c,U+619e-61a6,U+61aa-61ab,U+61ad-61b6,U+61b8-61bd,U+61bf-61c1,U+61c3-61c4"}},{uri:eT,descriptors:{unicodeRange:"U+5cf4-5cfa,U+5cfc-5d01,U+5d04-5d05,U+5d08-5d0d,U+5d0f-5d13,U+5d15,U+5d17-5d1a,U+5d1c-5d1d,U+5d1f-5d23,U+5d25,U+5d28,U+5d2a-5d2c,U+5d2f-5d33,U+5d35-5d3c,U+5d3f-5d46,U+5d48-5d49,U+5d4d-5d57,U+5d59-5d5a,U+5d5c,U+5d5e-5d68,U+5d6a,U+5d6d-5d6e,U+5d70-5d73,U+5d75-5d81,U+5d83-5d98,U+5d9a-5d9c,U+5d9e-5db6,U+5db8-5dc4,U+5dc6-5dcc,U+5dce-5dcf"}},{uri:tT,descriptors:{unicodeRange:"U+5b52,U+5b56,U+5b5e,U+5b60-5b61,U+5b67-5b68,U+5b6b,U+5b6d-5b6f,U+5b72,U+5b74,U+5b76-5b79,U+5b7b-5b7c,U+5b7e-5b7f,U+5b82,U+5b86,U+5b8a,U+5b8d-5b8e,U+5b90-5b92,U+5b94,U+5b96,U+5b9f,U+5ba7-5ba9,U+5bac-5baf,U+5bb1-5bb2,U+5bb7,U+5bba-5bbc,U+5bc0-5bc1,U+5bc3,U+5bc8-5bcb,U+5bcd-5bcf,U+5bd1,U+5bd4-5bdc,U+5be0,U+5be2-5be3,U+5be6-5be7,U+5be9-5bed,U+5bef,U+5bf1-5bf7,U+5bfd-5bfe,U+5c00,U+5c02-5c03,U+5c05,U+5c07-5c08,U+5c0b-5c0e,U+5c10,U+5c12-5c13,U+5c17,U+5c19,U+5c1b,U+5c1e-5c21,U+5c23,U+5c26,U+5c28-5c2b,U+5c2d-5c30,U+5c32-5c33,U+5c35-5c37,U+5c43-5c44,U+5c46-5c47,U+5c4c-5c4d,U+5c52-5c54,U+5c56-5c58,U+5c5a-5c5d,U+5c5f,U+5c62,U+5c64,U+5c67-5c6d,U+5c70,U+5c72-5c78,U+5c7b-5c7e,U+5c80,U+5c83-5c87,U+5c89-5c8b,U+5c8e-5c8f,U+5c92-5c93,U+5c95,U+5c9d-5ca1,U+5ca4-5ca8,U+5caa,U+5cae-5cb0,U+5cb2,U+5cb4,U+5cb6,U+5cb9-5cbc,U+5cbe,U+5cc0,U+5cc2-5cc3,U+5cc5-5cca,U+5ccc-5cd1,U+5cd3-5cd8,U+5cda-5ce0,U+5ce2-5ce3,U+5ce7,U+5ce9,U+5ceb-5cec,U+5cee-5cef,U+5cf1-5cf3"}},{uri:nT,descriptors:{unicodeRange:"U+593b,U+593d-5940,U+5943,U+5945-5946,U+594a,U+594c-594d,U+5950,U+5952-5953,U+5959,U+595b-595f,U+5961,U+5963-5964,U+5966-5972,U+5975,U+5977,U+597a-597c,U+597e-5980,U+5985,U+5989,U+598b-598c,U+598e-5991,U+5994-5995,U+5998,U+599a-599d,U+599f-59a2,U+59a6-59a7,U+59ac-59ad,U+59b0-59b1,U+59b3-59b8,U+59ba,U+59bc-59bd,U+59bf-59c5,U+59c7-59c9,U+59cc-59cf,U+59d5-59d6,U+59d9,U+59db,U+59de-59e2,U+59e4,U+59e6-59e7,U+59e9-59eb,U+59ed-59f8,U+59fa,U+59fc-59fe,U+5a00,U+5a02,U+5a0a-5a0b,U+5a0d-5a10,U+5a12,U+5a14-5a17,U+5a19-5a1b,U+5a1d-5a1e,U+5a21-5a22,U+5a24,U+5a26-5a28,U+5a2a-5a30,U+5a33,U+5a35,U+5a37-5a3b,U+5a3d-5a3f,U+5a41-5a45,U+5a47-5a48,U+5a4b-5a54,U+5a56-5a59,U+5a5b-5a61,U+5a63-5a66,U+5a68-5a69,U+5a6b-5a73,U+5a78-5a79,U+5a7b-5a7e,U+5a80-5a90"}},{uri:aT,descriptors:{unicodeRange:"U+5a91,U+5a93-5a99,U+5a9c-5aa9,U+5aab-5ab1,U+5ab4,U+5ab6-5ab7,U+5ab9-5abd,U+5abf-5ac0,U+5ac3-5ac8,U+5aca-5acb,U+5acd-5ad1,U+5ad3,U+5ad5,U+5ad7,U+5ad9-5adb,U+5add-5adf,U+5ae2,U+5ae4-5ae5,U+5ae7-5ae8,U+5aea,U+5aec-5af0,U+5af2-5b08,U+5b0a-5b15,U+5b18-5b31,U+5b33,U+5b35-5b36,U+5b38-5b3f,U+5b41-5b4f"}},{uri:iT,descriptors:{unicodeRange:"U+5843,U+5845-584b,U+584e-5850,U+5852-5853,U+5855-5857,U+5859-585d,U+585f-5864,U+5866-586a,U+586d-587d,U+587f,U+5882,U+5884,U+5886-5888,U+588a-5891,U+5894-5898,U+589b-589d,U+58a0-58a7,U+58aa-58bb,U+58bd-58c0,U+58c2-58c4,U+58c6-58d0,U+58d2-58d4,U+58d6-58e3,U+58e5-58ea,U+58ed,U+58ef,U+58f1-58f2,U+58f4-58f5,U+58f7-58f8,U+58fa-5901,U+5903,U+5905-5906,U+5908-590c,U+590e,U+5910-5913,U+5917-5918,U+591b,U+591d-591e,U+5920-5923,U+5926,U+5928,U+592c,U+5930,U+5932-5933,U+5935-5936"}},{uri:rT,descriptors:{unicodeRange:"U+56d0-56d3,U+56d5-56d6,U+56d8-56d9,U+56dc,U+56e3,U+56e5-56ea,U+56ec,U+56ee-56ef,U+56f2-56f3,U+56f6-56f8,U+56fb-56fc,U+5700-5702,U+5705,U+5707,U+570b-571b,U+571d-571e,U+5720-5722,U+5724-5727,U+572b,U+5731-5732,U+5734-5738,U+573c-573d,U+573f,U+5741,U+5743-5746,U+5748-5749,U+574b,U+5752-5756,U+5758-5759,U+5762-5763,U+5765,U+5767,U+576c,U+576e,U+5770-5772,U+5774-5775,U+5778-577a,U+577d-5781,U+5787-578a,U+578d-5791,U+5794-579a,U+579c-579f,U+57a5,U+57a8,U+57aa,U+57ac,U+57af-57b1,U+57b3,U+57b5-57b7,U+57b9-57c1,U+57c4-57ca,U+57cc-57cd,U+57d0-57d1,U+57d3,U+57d6-57d7,U+57db-57dc,U+57de,U+57e1-57e3,U+57e5-57ec,U+57ee,U+57f0-57f3,U+57f5-57f7,U+57fb-57fc,U+57fe-57ff,U+5801,U+5803-5805,U+5808-580a,U+580c,U+580e-5810,U+5812-5814,U+5816-5818,U+581a-581d,U+581f,U+5822-5823,U+5825-5829,U+582b-582f,U+5831-5834,U+5836-5842"}},{uri:sT,descriptors:{unicodeRange:"U+55f9-55fc,U+55ff,U+5602-5607,U+560a-560b,U+560d,U+5610-5617,U+5619-561a,U+561c-561d,U+5620-5622,U+5625-5626,U+5628-562b,U+562e-5630,U+5633,U+5635,U+5637-5638,U+563a,U+563c-563e,U+5640-564b,U+564f-5653,U+5655-5656,U+565a-565b,U+565d-5661,U+5663,U+5665-5667,U+566d-5670,U+5672-5675,U+5677-567a,U+567d-5684,U+5687-568d,U+5690-5692,U+5694-56a2,U+56a4-56ae,U+56b0-56b6,U+56b8-56bb,U+56bd-56c9,U+56cb-56cf"}},{uri:lT,descriptors:{unicodeRange:"U+5286-5287,U+5289-528f,U+5291-5292,U+5294-529a,U+529c,U+52a4-52a7,U+52ae-52b0,U+52b4-52bd,U+52c0-52c2,U+52c4-52c6,U+52c8,U+52ca,U+52cc-52cf,U+52d1,U+52d3-52d5,U+52d7,U+52d9-52de,U+52e0-52e3,U+52e5-52ef,U+52f1-52f8,U+52fb-52fd,U+5301-5304,U+5307,U+5309-530c,U+530e,U+5311-5314,U+5318,U+531b-531c,U+531e-531f,U+5322,U+5324-5325,U+5327-5329,U+532b-532d,U+532f-5338,U+533c-533d,U+5340,U+5342,U+5344,U+5346,U+534b-534d,U+5350,U+5354,U+5358-5359,U+535b,U+535d,U+5365,U+5368,U+536a,U+536c-536d,U+5372,U+5376,U+5379,U+537b-537e,U+5380-5381,U+5383,U+5387-5388,U+538a,U+538e-5394,U+5396-5397,U+5399,U+539b-539c,U+539e,U+53a0-53a1,U+53a4,U+53a7,U+53aa-53ad,U+53af-53b5,U+53b7-53ba,U+53bc-53be,U+53c0,U+53c3-53c7,U+53ce-53d0,U+53d2-53d3,U+53d5,U+53da,U+53dc-53de,U+53e1-53e2,U+53e7,U+53f4,U+53fa,U+53fe-5400,U+5402,U+5405,U+5407,U+540b,U+5414,U+5418-541a,U+541c,U+5422,U+5424-5425,U+542a,U+5430,U+5433,U+5436-5437,U+543a"}},{uri:oT,descriptors:{unicodeRange:"U+5101-5105,U+5108-510a,U+510c-5111,U+5113-5120,U+5122-513e,U+5142,U+5147,U+514a,U+514c,U+514e-5150,U+5152-5153,U+5157-5159,U+515b,U+515d-5161,U+5163-5164,U+5166-5167,U+5169-516a,U+516f,U+5172,U+517a,U+517e-517f,U+5183-5184,U+5186-5187,U+518a-518b,U+518e-5191,U+5193-5194,U+5198,U+519a,U+519d-519f,U+51a1,U+51a3,U+51a6-51aa,U+51ad-51ae,U+51b4,U+51b8-51ba,U+51be-51bf,U+51c1-51c3,U+51c5,U+51c8,U+51ca,U+51cd-51ce,U+51d0,U+51d2-51da,U+51dc,U+51de-51df,U+51e2-51e3,U+51e5-51ea,U+51ec,U+51ee,U+51f1-51f2,U+51f4,U+51f7,U+51fe,U+5204-5205,U+5209,U+520b-520c,U+520f-5210,U+5213-5215,U+521c,U+521e-521f,U+5221-5223,U+5225-5227,U+522a,U+522c,U+522f,U+5231-5232,U+5234-5235,U+523c,U+523e,U+5244-5249,U+524b,U+524e-524f,U+5252-5253,U+5255,U+5257-525b,U+525d,U+525f-5260,U+5262-5264,U+5266,U+5268,U+526b-526e,U+5270-5271,U+5273-527c,U+527e,U+5280,U+5283-5285"}},{uri:dT,descriptors:{unicodeRange:"U+543d,U+543f,U+5441-5442,U+5444-5445,U+5447,U+5449,U+544c-544f,U+5451,U+545a,U+545d-5461,U+5463,U+5465,U+5467,U+5469-5470,U+5474,U+5479-547a,U+547e-547f,U+5481,U+5483,U+5485,U+5487-548a,U+548d,U+5491,U+5493,U+5497-5498,U+549c,U+549e-54a2,U+54a5,U+54ae,U+54b0,U+54b2,U+54b5-54b7,U+54b9-54ba,U+54bc,U+54be,U+54c3,U+54c5,U+54ca-54cb,U+54d6,U+54d8,U+54db,U+54e0-54e4,U+54eb-54ec,U+54ef-54f1,U+54f4-54f9,U+54fb,U+54fe,U+5500,U+5502-5505,U+5508,U+550a-550e,U+5512-5513,U+5515-551a,U+551c-551f,U+5521,U+5525-5526,U+5528-5529,U+552b,U+552d,U+5532,U+5534-5536,U+5538-553b,U+553d,U+5540,U+5542,U+5545,U+5547-5548,U+554b-554f,U+5551-5554,U+5557-555b,U+555d-5560,U+5562-5563,U+5568-5569,U+556b,U+556f-5574,U+5579-557a,U+557d,U+557f,U+5585-5586,U+558c-558e,U+5590,U+5592-5593,U+5595-5597,U+559a-559b,U+559e,U+55a0-55a6,U+55a8-55b0,U+55b2,U+55b4,U+55b6,U+55b8,U+55ba,U+55bc,U+55bf-55c3,U+55c6-55c8,U+55ca-55cb,U+55ce-55d0,U+55d5,U+55d7-55db,U+55de,U+55e0,U+55e2,U+55e7,U+55e9,U+55ed-55ee,U+55f0-55f1,U+55f4,U+55f6,U+55f8"}},{uri:cT,descriptors:{unicodeRange:"U+4fe0,U+4fe2,U+4fe4-4fe5,U+4fe7,U+4feb-4fec,U+4ff0,U+4ff2,U+4ff4-4ff7,U+4ff9,U+4ffb-4ffd,U+4fff-500b,U+500e,U+5010-5011,U+5013,U+5015-5017,U+501b,U+501d-501e,U+5020,U+5022-5024,U+5027,U+502b,U+502f-5039,U+503b,U+503d,U+503f-5042,U+5044-5046,U+5049-504b,U+504d,U+5050-5054,U+5056-5059,U+505b,U+505d-5064,U+5066-506b,U+506d-5075,U+5078-507a,U+507c-507d,U+5081-5084,U+5086-5087,U+5089-508c,U+508e-50a2,U+50a4,U+50a6,U+50aa-50ab,U+50ad-50b1,U+50b3-50b9,U+50bc-50ce,U+50d0-50d5,U+50d7-50d9,U+50db-50e5,U+50e8-50eb,U+50ef-50f2,U+50f4,U+50f6-50fa,U+50fc-5100"}},{uri:uT,descriptors:{unicodeRange:"U+49d5-4a77"}},{uri:hT,descriptors:{unicodeRange:"U+4dac-4dad,U+4daf-4db5,U+4e02,U+4e04-4e06,U+4e0f,U+4e12,U+4e17,U+4e1f-4e21,U+4e23,U+4e26,U+4e29,U+4e2e-4e2f,U+4e31,U+4e33,U+4e35,U+4e37,U+4e3c,U+4e40-4e42,U+4e44,U+4e46,U+4e4a,U+4e51,U+4e55,U+4e57,U+4e5a-4e5b,U+4e62-4e65,U+4e67-4e68,U+4e6a-4e6f,U+4e72,U+4e74-4e7d,U+4e7f-4e85,U+4e87,U+4e8a,U+4e90,U+4e96-4e97,U+4e99,U+4e9c-4e9e,U+4ea3,U+4eaa,U+4eaf-4eb1,U+4eb4,U+4eb6-4eb9,U+4ebc-4ebe,U+4ec8,U+4ecc,U+4ecf-4ed0,U+4ed2,U+4eda-4edc,U+4ee0,U+4ee2,U+4ee6-4ee7,U+4ee9,U+4eed-4eef,U+4ef1,U+4ef4,U+4ef8-4efa,U+4efc,U+4efe,U+4f00,U+4f02-4f08,U+4f0b-4f0c,U+4f12-4f16,U+4f1c-4f1d,U+4f21,U+4f23,U+4f28-4f29,U+4f2c-4f2e,U+4f31,U+4f33,U+4f35,U+4f37,U+4f39,U+4f3b,U+4f3e-4f42,U+4f44-4f45,U+4f47-4f4c,U+4f52,U+4f54,U+4f56,U+4f61-4f62,U+4f66,U+4f68,U+4f6a-4f6b,U+4f6d-4f6e,U+4f71-4f72,U+4f75,U+4f77-4f7a,U+4f7d,U+4f80-4f82,U+4f85-4f87,U+4f8a,U+4f8c,U+4f8e,U+4f90,U+4f92-4f93,U+4f95-4f96,U+4f98-4f9a,U+4f9c,U+4f9e-4f9f,U+4fa1-4fa2,U+4fa4,U+4fab,U+4fad,U+4fb0-4fb4,U+4fb6-4fbe,U+4fc0-4fc2,U+4fc6-4fc9,U+4fcb-4fcd,U+4fd2-4fd6,U+4fd9,U+4fdb"}},{uri:fT,descriptors:{unicodeRange:"U+4933-49d4"}},{uri:pT,descriptors:{unicodeRange:"U+487a-4932"}},{uri:UT,descriptors:{unicodeRange:"U+47d2-4879,U+2ce7c,U+2ce88,U+2ce93"}},{uri:mT,descriptors:{unicodeRange:"U+4756-47d1,U+2ca02,U+2ca0e,U+2ca7d,U+2caa9,U+2cb29,U+2cb2e,U+2cb31,U+2cb38-2cb39,U+2cb3f,U+2cb41,U+2cb4e,U+2cb5a,U+2cb64,U+2cb69,U+2cb6c,U+2cb6f,U+2cb76,U+2cb78,U+2cb7c,U+2cbb1,U+2cbbf-2cbc0,U+2cbce,U+2cc5f,U+2ccf5-2ccf6,U+2ccfd,U+2ccff,U+2cd02-2cd03,U+2cd0a,U+2cd8b,U+2cd8d,U+2cd8f-2cd90,U+2cd9f-2cda0,U+2cda8,U+2cdad-2cdae,U+2cdd5,U+2ce18,U+2ce1a,U+2ce23,U+2ce26,U+2ce2a"}},{uri:gT,descriptors:{unicodeRange:"U+46c3-4755,U+2c488,U+2c494,U+2c497,U+2c542,U+2c613,U+2c618,U+2c621,U+2c629,U+2c62b-2c62d,U+2c62f,U+2c642,U+2c64a-2c64b,U+2c72c,U+2c72f,U+2c79f,U+2c7c1,U+2c7fd,U+2c8d9,U+2c8de,U+2c8e1,U+2c8f3,U+2c907,U+2c90a,U+2c91d"}},{uri:bT,descriptors:{unicodeRange:"U+4629-46c2,U+2bdf7,U+2be29,U+2c029-2c02a,U+2c0a9,U+2c0ca,U+2c1d5,U+2c1d9,U+2c1f9,U+2c27c,U+2c288,U+2c2a4,U+2c317,U+2c35b,U+2c361,U+2c364"}},{uri:xT,descriptors:{unicodeRange:"U+458e-4628,U+2b7a9,U+2b7c5,U+2b7e6,U+2b7f9,U+2b806,U+2b80a,U+2b81c,U+2b8b8,U+2bac7,U+2bb5f,U+2bb62,U+2bb7c,U+2bb83,U+2bc1b,U+2bd77,U+2bd87"}},{uri:vT,descriptors:{unicodeRange:"U+4449-4511,U+2afa2,U+2b127-2b128,U+2b137-2b138,U+2b1ed"}},{uri:yT,descriptors:{unicodeRange:"U+439b-4448,U+2a437,U+2a5f1,U+2a602,U+2a61a,U+2a6b2,U+2a7dd,U+2a8fb,U+2a917,U+2aa30,U+2aa36,U+2aa58"}},{uri:wT,descriptors:{unicodeRange:"U+4275-430d,U+298c6,U+29a72,U+29d98,U+29ddb,U+29e15,U+29e3d,U+29e49"}},{uri:ET,descriptors:{unicodeRange:"U+4132-41de,U+28bef,U+28c47,U+28c4f,U+28c51,U+28c54,U+28d10,U+28d71,U+28dfb,U+28e1f,U+28e36,U+28e89,U+28e99,U+28eeb,U+28f32,U+28ff8,U+292a0"}},{uri:ST,descriptors:{unicodeRange:"U+41df-4274,U+292b1,U+29490,U+295cf,U+2967f,U+296f0,U+29719,U+29750"}},{uri:kT,descriptors:{unicodeRange:"U+408e-4131,U+285c8-285c9,U+28678,U+28695,U+286d7,U+286fa,U+287e0,U+28946,U+28949,U+2896b,U+28987-28988,U+289ba-289bb,U+28a1e,U+28a29,U+28a43,U+28a71,U+28a99,U+28acd,U+28add,U+28ae4,U+28b49,U+28bc1"}},{uri:MT,descriptors:{unicodeRange:"U+3e83-3f2f,U+27139,U+273da-273db,U+273fe,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770e,U+27723,U+27752"}},{uri:CT,descriptors:{unicodeRange:"U+3f30-3fdb,U+27985,U+27a84,U+27bb3,U+27bbe,U+27bc7,U+27cb8,U+27da0,U+27e10"}},{uri:IT,descriptors:{unicodeRange:"U+3fdc-408d,U+27fb7,U+27ff9,U+2808a,U+280bb,U+2815d,U+28277,U+28282,U+282e2,U+282f3,U+283cd,U+28408,U+2840c,U+28455,U+28468,U+2856b"}},{uri:_T,descriptors:{unicodeRange:"U+3dd2-3e82,U+26a58,U+26a8c,U+26ab7,U+26aff,U+26b5c,U+26c21,U+26c29,U+26c73,U+26cdd,U+26e40,U+26e65,U+26f94,U+26ff6-26ff8,U+270f4,U+2710d"}},{uri:TT,descriptors:{unicodeRange:"U+3d34-3dd1,U+2648d,U+26676,U+2667e,U+266b0,U+2671d,U+2677c,U+267cc,U+268dd,U+268ea,U+26951,U+2696f,U+269dd,U+269fa,U+26a1e"}},{uri:jT,descriptors:{unicodeRange:"U+3c76-3d33,U+25d0a,U+25da1,U+25e2e,U+25e56,U+25e62,U+25e65,U+25ec2,U+25ed7-25ed8,U+25ee8,U+25f23,U+25f5c,U+25fd4,U+25fe0,U+25ffb,U+2600c,U+26017,U+26060,U+260ed,U+26221,U+26270,U+26286,U+2634c,U+26402"}},{uri:AT,descriptors:{unicodeRange:"U+3bda-3c75,U+25771,U+257a9,U+257b4,U+259c4,U+259d4,U+25ae3-25ae4,U+25af1,U+25bb2,U+25c14,U+25c4b,U+25c64"}},{uri:DT,descriptors:{unicodeRange:"U+3b25-3bd9,U+2504a,U+25055,U+25122,U+2512b,U+251a9,U+251cd,U+251e5,U+2521e,U+2524c,U+2542e,U+2548e,U+254d9,U+2550e,U+25532,U+25562,U+255a7-255a8"}},{uri:LT,descriptors:{unicodeRange:"U+3a6b-3b24,U+24896,U+249db,U+24a4d,U+24a7d,U+24ac9,U+24b56,U+24b6f,U+24c16,U+24d14,U+24dea,U+24e0e,U+24e37,U+24e6a,U+24e8b,U+24eaa"}},{uri:RT,descriptors:{unicodeRange:"U+39a9-3a6a,U+24096,U+24103,U+241ac,U+241c6,U+241fe,U+243bc,U+243f8,U+244d3,U+24629,U+246a5,U+247f1"}},{uri:PT,descriptors:{unicodeRange:"U+38e3-39a8,U+23a98,U+23c7f,U+23c97-23c98,U+23cfe,U+23d00,U+23d0e,U+23d40,U+23dd3,U+23df9-23dfa,U+23e23,U+23f7e"}},{uri:NT,descriptors:{unicodeRange:"U+3760-382a,U+22ab8,U+22b43,U+22b46,U+22b4f-22b50,U+22ba6,U+22bca,U+22c1d,U+22c24,U+22c55,U+22d4c,U+22de1"}},{uri:OT,descriptors:{unicodeRange:"U+382b-38e2,U+231b6,U+231c3-231c4,U+231f5,U+23350,U+23372,U+233d0,U+233d2-233d3,U+233d5,U+233da,U+233df,U+233e4,U+2344a-2344b,U+23451,U+23465,U+234e4,U+2355a,U+23594,U+235c4,U+235cb,U+23638-2363a,U+23647,U+2370c,U+2371c,U+2373f,U+23763-23764,U+237e7,U+237ff,U+23824,U+2383d"}},{uri:$T,descriptors:{unicodeRange:"U+3698-375f,U+22218,U+2231e,U+223ad,U+224dc,U+226f3,U+2285b,U+228ab,U+2298f"}},{uri:FT,descriptors:{unicodeRange:"U+35e6-3697,U+21c56,U+21cde,U+21d2d,U+21d45,U+21d62,U+21d78,U+21d92,U+21d9c,U+21da1,U+21db7,U+21de0,U+21e33-21e34,U+21f1e,U+21f76,U+21ffa,U+2217b"}},{uri:zT,descriptors:{unicodeRange:"U+3444-350e,U+20ad3,U+20b1d,U+20b9f,U+20c41,U+20cbf,U+20cd0,U+20d45,U+20de1,U+20e64,U+20e6d,U+20e95,U+20e9d,U+20ea2,U+20f5f,U+210c1,U+21201,U+2123d,U+21255,U+21274,U+2127b"}},{uri:BT,descriptors:{unicodeRange:"U+350f-35e5,U+212d7,U+212e4,U+212fd,U+2131b,U+21336,U+21344,U+2139a,U+213c4,U+21413,U+2146d-2146e,U+215d7,U+21647,U+216b4,U+21706,U+21742,U+218bd,U+219c3"}},{uri:HT,descriptors:{unicodeRange:"U+336d-3443,U+2032b,U+20371,U+20381,U+203f9,U+2044a,U+20509,U+20547,U+205d6,U+20628,U+20676,U+2074f,U+20779,U+20807,U+2083a,U+20895,U+208b9,U+2097c,U+2099d"}},{uri:XT,descriptors:{unicodeRange:"U+328b-336c,U+2000b,U+20089,U+200a2,U+200a4,U+20164,U+201a2,U+20213"}},{uri:WT,descriptors:{unicodeRange:"U+3192-31ba,U+31c0-31e3,U+31f0-321e,U+3220-328a,U+1f250-1f251"}},{uri:VT,descriptors:{unicodeRange:"U+2f74-2fd5,U+3000,U+3003-3007,U+3012-3013,U+3018-301c,U+3020-3029,U+302f-303f,U+3041-3096,U+3099-30a1"}},{uri:GT,descriptors:{unicodeRange:"U+30a2-30ff,U+3105-312f,U+3131-318e,U+3190-3191"}},{uri:ZT,descriptors:{unicodeRange:"U+4e36,U+4ea0,U+4f74,U+4f91,U+4f94,U+4fc5,U+507e,U+50ed,U+5182,U+51f5,U+525e,U+5282,U+52f9,U+5326,U+537a,U+53a3,U+5423,U+5459,U+54b4,U+54d9,U+55c9,U+57f4,U+580b,U+5902,U+5925,U+5a08,U+5ab5,U+5b84,U+5be4,U+5c22,U+5cb5,U+5cbd,U+5d3e,U+5e31,U+5e5e,U+5e80,U+5ee8,U+5f82,U+5fc9,U+5fed,U+600a,U+605d,U+609b,U+609d,U+60dd,U+6243,U+6322,U+63ce,U+640c,U+643f,U+6445,U+64d7,U+6534,U+6549,U+656b,U+6603,U+674c,U+680a,U+6864,U+69d4,U+6a65,U+6c2a,U+6c46,U+6c5c,U+6d0e,U+6d48,U+6e2b,U+6eb2,U+6eb7,U+6f89,U+706c,U+70b1,U+7113,U+71d4,U+727f,U+72f3,U+7303,U+7321,U+736c,U+736f,U+74a9,U+74de,U+750d,U+7513,U+7592,U+75c4,U+7605,U+760a,U+761b,U+7625,U+762d,U+7643,U+7707,U+7747,U+77b5,U+7839,U+784e,U+78a5,U+7924,U+793b,U+798a,U+7a03,U+7a06,U+7a78,U+7a80,U+7aad,U+7ba8,U+7be5,U+7cc8,U+7ec1,U+7f0b,U+7f0f,U+7f12,U+7f68,U+7f9d,U+8025,U+809c,U+80ad,U+80b7,U+80e8,U+811e,U+8204,U+8223,U+822d,U+823b,U+824b,U+825a,U+827d,U+827f,U+828f,U+82c8,U+8307,U+831b,U+8347,U+837d,U+839b,U+83a9,U+83f9,U+84b9,U+8579,U+864d,U+867f,U+86b0,U+86d1,U+86d8,U+86f2,U+8764,U+8770,U+8788,U+8797,U+87ac-87ad,U+87b5,U+881b,U+8844,U+88bc,U+88fc,U+8930,U+89cf,U+89d6,U+8ba0,U+8bd4,U+8c02,U+8c2b,U+8c85,U+8e23,U+8f81-8f82,U+8fd5,U+90b6,U+90db,U+914e,U+9164,U+91ad,U+943e,U+94b7-94b8,U+94eb,U+950d,U+9514,U+9516,U+9518,U+9529,U+9538,U+953f,U+954e,U+955f,U+95fc,U+9667,U+96b3,U+9792,U+97b2,U+98a1,U+9969,U+9987,U+9998,U+9a80,U+9a92,U+9a96,U+9adf,U+9cb4,U+9cbd,U+9cd0,U+9cd4,U+9e31,U+9e3a,U+9e71,U+9ee5,U+9eea,U+9ef9,U+9fa0"}},{uri:YT,descriptors:{unicodeRange:"U+4e0c,U+4e28,U+4e3f,U+4ec2,U+502e,U+50ba,U+5155,U+5181,U+522d,U+5281,U+5290,U+5369,U+53b6,U+54d5,U+54dc,U+54ff,U+552a,U+553c,U+5588,U+55b5,U+5686,U+570a,U+5776,U+5786,U+57a4,U+5820,U+5865,U+58bc,U+5b32,U+5b65,U+5c1c,U+5c66,U+5c6e,U+5c8d,U+5ddb,U+5f2a,U+5f50,U+5f61,U+6067,U+614a,U+615d,U+619d,U+61d4,U+620b,U+6224-6225,U+6343,U+63ad,U+63f2,U+640b,U+6420,U+6434,U+6496,U+64d0,U+6509,U+652e,U+67a8,U+6833,U+6844,U+684a,U+6920,U+6957,U+6971,U+6a8e,U+6a91,U+6aa0,U+6b43,U+6bea,U+6bf5,U+6c15,U+6cd0,U+6ee0,U+6f24,U+6f2d,U+70c0,U+721d,U+728b,U+72c3,U+72e8,U+730a,U+7338-7339,U+734d,U+746d,U+752f,U+754e,U+770d,U+7735,U+778d,U+77a2,U+77e7,U+7857,U+786d,U+78c9,U+78f2,U+791e,U+7953,U+7b58,U+7b9d,U+7bda,U+7cd7,U+7f32-7f33,U+8022,U+8028-8029,U+8035,U+804d,U+8080,U+80c2,U+80e9,U+80ec,U+80f2,U+810e,U+8221,U+8274,U+82b0,U+82e0,U+83b0,U+8487-8488,U+848e,U+84cd,U+84d0,U+8539,U+857a,U+85a8,U+85b7,U+867c,U+871e,U+8723,U+877e,U+878b,U+8793,U+8803,U+88d2,U+8966,U+89cc,U+89eb,U+8b26,U+8c8a,U+8c98,U+8d33,U+8d47,U+8d55,U+8dbc,U+8e40,U+8e94,U+8f77,U+8f79,U+9058,U+91a2,U+91b5,U+928e,U+9494,U+94b6,U+94de,U+94f4,U+94f9,U+950a,U+950e,U+951e,U+952b,U+953c,U+953e,U+9544,U+9561,U+9564,U+9569,U+95f6,U+9603,U+960d,U+963d,U+9674,U+9794,U+97ab,U+98a5,U+9a9f,U+9ab1,U+9ad1,U+9b0f,U+9b2f,U+9c92,U+9c95,U+9cba,U+9cbc,U+9cc6,U+9ccb,U+9cd8,U+9e32,U+9e38,U+9e5b,U+9e7e,U+9eb4,U+9efb-9efc,U+9f3d"}},{uri:KT,descriptors:{unicodeRange:"U+2e3b,U+2e80-2e99,U+2e9b-2ef3,U+2f00-2f73,U+ffffd"}},{uri:qT,descriptors:{unicodeRange:"U+4e69,U+4f1b,U+4f67,U+4f7e,U+4fdc,U+50e6,U+5196,U+5202,U+5233,U+523f,U+52a2,U+536e,U+5476,U+54ad,U+54cf,U+5537,U+561e,U+56dd,U+56df,U+5709,U+572c,U+57cf,U+57f8,U+580d,U+5881,U+589a,U+5941,U+59b2,U+5c25,U+5d24,U+5d74,U+5e42,U+5e8b,U+5eb3,U+5ed2,U+5fad,U+6003,U+603c,U+6083,U+6100,U+6126,U+6206,U+62ca,U+638e,U+63b4,U+6426,U+646d,U+6535,U+65c4,U+66db,U+6715,U+6769,U+6798,U+67c3,U+6861,U+698d,U+69ca,U+69ed,U+69f2,U+69ff,U+6a18,U+6b39,U+6bb3,U+6c0d,U+6cb2,U+6cd6,U+6cf7,U+6cfa,U+6d33,U+6e16,U+6e53-6e54,U+6ebb,U+6fb6,U+709d,U+72ad,U+72f7,U+72fb,U+7313,U+739f,U+74ba,U+754b,U+755b,U+758b,U+75ac,U+75d6,U+7617,U+7635,U+7640,U+76a4,U+76b2,U+775a,U+77bd,U+781f,U+79b3,U+7b2b,U+7b31,U+7b3e,U+7b6e,U+7b9c,U+7c0b,U+7c9e,U+7cc1,U+7ce8,U+7ea5,U+7f21,U+7f27,U+7f74,U+7fb0,U+8031,U+8071,U+80ea,U+8114,U+8160,U+81a6,U+81c1,U+829f,U+82a4,U+82fb,U+831a,U+8333,U+836c,U+83b6,U+83f8,U+8411,U+841c,U+8489,U+848c,U+85a4,U+8627,U+8629,U+866e,U+86b5,U+872e,U+8731,U+877b,U+877d,U+87ea,U+8813,U+8816,U+8864,U+88ce,U+88e5,U+897b,U+89cb,U+89f3,U+8bfc,U+8c35,U+8d46,U+8d4d,U+8dba,U+8e3a,U+8f75,U+8f7e,U+8fd3,U+9161,U+9179,U+917e,U+91a3,U+94ac,U+94d7,U+94e5,U+952a,U+952c,U+9545,U+9565,U+9568,U+956a,U+961d,U+96e0,U+972a,U+9730,U+989f,U+98e7,U+990d,U+9967,U+9993,U+9aa3,U+9ac0,U+9ae1,U+9aeb,U+9af9,U+9c86,U+9c8b,U+9ca0-9ca1,U+9ca3,U+9ce2,U+9e48,U+9e6a,U+9e87,U+9ee2,U+9ee9,U+9f17,U+9f19,U+9f2c,U+9f80"}},{uri:JT,descriptors:{unicodeRange:"U+4ef3,U+50d6,U+50ec,U+51ab,U+51b1,U+52d6,U+54a9,U+54da,U+55be,U+55cd,U+564d,U+572f,U+574c,U+576b,U+57d8,U+57fd,U+5844,U+59d2,U+5ae0,U+5b16,U+5b37,U+5b5b,U+5b80,U+5d1e,U+5d6b,U+5efe,U+5f11,U+5f56,U+5f58,U+5f73,U+5f8c,U+5fc4,U+5fe4,U+602b,U+6106,U+610d,U+63de,U+63f8,U+641b,U+64e4,U+6634,U+676a,U+67b5,U+681d,U+6883,U+69b1,U+69e0,U+6b37,U+6b9b,U+6d7c,U+6ed7,U+6f36,U+6f72,U+6f8c,U+7035,U+7039,U+7173,U+7178,U+7228,U+728f,U+72b4,U+72ef,U+72f4,U+7331,U+7481,U+74e0,U+7540,U+75c3,U+75e6,U+763c,U+764d,U+76cd,U+7704,U+7743,U+7780,U+7847,U+786a,U+78b9,U+7962,U+7a02,U+7aac,U+7ab3,U+7b0a,U+7b4c,U+7b7b,U+7bfc,U+7c0f,U+7c16,U+7c40,U+7ca2,U+7cc7,U+7cf8,U+7d77,U+7e3b,U+7ea1,U+7ea9,U+7ef2,U+7f02,U+7f07,U+7f0c,U+7f23,U+7f2f,U+7fbc,U+8016,U+8020,U+812c,U+8136,U+8182,U+822f,U+8233,U+825f,U+8268,U+8284,U+8288,U+8291,U+8308,U+8311,U+835b,U+836d,U+83dd,U+8406,U+840f,U+845c,U+84b4,U+84e3,U+850c,U+855e,U+863c,U+86ba,U+86c4,U+86de,U+86f1,U+873e,U+87bd,U+87db,U+880a,U+883c,U+887f,U+88f0,U+890a,U+892b,U+895e,U+89ef,U+8a48,U+8bdc,U+8c18,U+8c33,U+8c94,U+8db1,U+8dcf,U+8dd6,U+8de3,U+8e6f,U+8e90,U+8f7a,U+8fb6,U+902d,U+90be,U+91af,U+936a,U+948b,U+94d8,U+9513,U+953a,U+956c,U+963c,U+9654,U+966c,U+9688,U+97b4,U+996b,U+9a75,U+9a7a,U+9aba,U+9aed,U+9b08,U+9b43,U+9c8e,U+9c94,U+9c9a,U+9e2b,U+9e36,U+9e4b,U+9e4e,U+9e55,U+9e63,U+9e68-9e69,U+9ebd,U+9ec9,U+9f0d,U+9f37,U+9f51"}},{uri:QT,descriptors:{unicodeRange:"U+50a7,U+5240,U+5261,U+52ac,U+531a,U+5363,U+5432,U+5452,U+5456,U+5472,U+5478,U+553f,U+5575,U+5581,U+55cc,U+55fe,U+5601,U+572e,U+57d2,U+57ef,U+581e,U+5924,U+5981,U+5997,U+59a3,U+5aaa,U+5ab8,U+5b34,U+5d5d,U+5def,U+5e11,U+5e91,U+5ed1,U+5ef4,U+5f40,U+600d,U+6019,U+601b,U+605a,U+6092,U+60ab,U+6217,U+623d,U+6369,U+65d2,U+6661,U+670a,U+6753,U+67a7,U+6855,U+68f9,U+6939,U+696e,U+6980,U+6a7c,U+6aab,U+6b82,U+6bf3,U+6bf9,U+6c05,U+6c19-6c1a,U+6ca9,U+6cf6,U+6d1a,U+6dab,U+6f74,U+7085,U+7198,U+71b5,U+7256,U+725d,U+727e,U+72fa,U+7322,U+738e,U+73e5,U+750f,U+755a,U+7594,U+75b3,U+760c,U+7615,U+7630,U+763f,U+77ec,U+7817,U+78a1,U+78d9,U+7905,U+7b2a,U+7b2e,U+7b62,U+7b85,U+7bcc,U+7bea,U+7c26,U+7c74,U+7c9c-7c9d,U+7e47,U+7e9b,U+7e9f,U+7ee0,U+7ee8,U+7ef1,U+7f01,U+7f11,U+7f17,U+7f36,U+7f7e,U+7fee,U+802a,U+80cd,U+8112,U+8169,U+8234,U+8279,U+8298,U+82ca,U+82d8,U+82e1,U+83c0,U+83d4,U+83df,U+8401,U+8451,U+845a,U+8476,U+8478,U+84ba,U+84bd,U+84e0,U+851f,U+8548,U+8556,U+8585,U+868d,U+86e9,U+86f4,U+86f8,U+8765,U+8785,U+87ab,U+87ee,U+8832,U+8872,U+88b7,U+88e2-88e3,U+89da,U+8bce,U+8bd3,U+8bd6,U+8bf9,U+8c16,U+8c73,U+8d5c,U+8dde,U+8f6d,U+8f94,U+8fe8,U+9011,U+915e,U+9185,U+918c,U+94ab,U+94d1,U+94f3,U+9515,U+951d,U+9558,U+9567,U+96ce,U+96e9,U+9785,U+9878,U+987c,U+9883,U+98d1,U+9954,U+9963,U+9a93,U+9ac1,U+9acc,U+9b1f,U+9b49,U+9b4d,U+9b51,U+9ca7,U+9cae,U+9cce,U+9cd3,U+9e37,U+9e39,U+9e41,U+9e46,U+9f22,U+9f2f,U+9f39,U+9f85"}},{uri:ej,descriptors:{unicodeRange:"U+4e5c,U+4edf,U+4f25,U+4f32,U+4f5e,U+4f76,U+4faa,U+4fe6,U+5028,U+5048,U+5250,U+535f,U+538d,U+53c1,U+5412,U+5443,U+54d4,U+54dd,U+5541,U+5550,U+5577,U+55dd,U+55f3,U+560f,U+562c,U+5657-5658,U+5664,U+56af,U+575c,U+577c,U+57b2,U+57da,U+5800,U+5a62,U+5aeb,U+5c3b,U+5ca3,U+5d26,U+5d9d,U+5f01,U+5fb5,U+5fdd,U+5ff8,U+6029,U+6041,U+6079,U+60b1,U+6222,U+629f,U+6332,U+63bc,U+63e0,U+6485,U+65ab,U+65c3,U+65c6,U+668c,U+669d,U+66be,U+67fd,U+6800,U+68fc,U+690b,U+6924,U+6978,U+69a7,U+6a3e,U+6a50,U+6a5b,U+6a97,U+6b24,U+6b8d,U+6baa,U+6c10,U+6c54,U+6ceb,U+6d04,U+6d4d,U+6eb1,U+6ebd,U+7110,U+71b3,U+71f9,U+7230,U+728d,U+7292,U+72b8,U+72d2,U+7360,U+73a2,U+7511,U+75a0,U+75c8,U+779f,U+7826,U+7877,U+7a39,U+7aa8,U+7ae6,U+7b04,U+7b0f,U+7baa,U+7bac,U+7c1f,U+7ccd,U+7ecb,U+7ed4,U+7ed7,U+7efb,U+7f0d,U+7f5f,U+7faf,U+7fd5,U+7fe5,U+8027,U+80bc,U+80dd,U+80fc,U+8132,U+815a,U+8167,U+816d,U+81ca,U+8228,U+82a1,U+82a9,U+82ab,U+82cc,U+8351,U+8368,U+83b8,U+83d8,U+83ea,U+83f0,U+8497,U+84c1,U+858f,U+85ff,U+867b,U+86a8-86a9,U+870a,U+8722,U+876e,U+877c,U+87e5,U+8888,U+88df,U+8919,U+8bcc,U+8bdf,U+8be8,U+8bee,U+8c20,U+8c2f,U+8d36,U+8df8,U+8e05,U+8e2f,U+8f9a,U+9021,U+908b,U+90b4,U+90ba,U+90d0,U+90eb,U+90fe,U+91aa,U+933e,U+9486-9487,U+948d,U+9490,U+94ad,U+94bd,U+94d6,U+94d9,U+9507,U+9546,U+955e,U+956b,U+95e9,U+9604,U+960b,U+9612,U+9615,U+9617,U+96b9,U+989a-989b,U+989e,U+9a78,U+9a7d,U+9aa0,U+9aa2,U+9ac2,U+9b23,U+9b3b,U+9c82,U+9cca,U+9cd9,U+9e28,U+9e5a,U+9e5e,U+9e6c,U+9efe,U+9f0b"}},{uri:tj,descriptors:{unicodeRange:"U+4e47,U+4e8d,U+4f65,U+4f89,U+50ee,U+520e,U+5416,U+5454,U+54bb,U+54c2,U+54d3,U+54de,U+5591,U+55e5,U+560c,U+566b,U+5769,U+578c,U+5793,U+57e4,U+5889,U+593c,U+59ab,U+5ad4,U+5ad8,U+5af1,U+5b53,U+5ba5,U+5c59,U+5c63,U+5d5b,U+5e0f,U+5e14,U+5edb,U+5fbc,U+6004,U+60ad,U+610e,U+61b7,U+624c,U+634c,U+647a,U+64ba,U+65f0,U+6600,U+66f7,U+67e2,U+67f0,U+680c,U+686b,U+6874,U+691f,U+6989,U+6a17,U+6b81,U+6b84,U+6c06-6c07,U+6c3d,U+6d07,U+6d27,U+6d2b,U+6d91,U+6e6b,U+6e8f,U+6fde,U+70bb,U+723b,U+726e,U+72b0,U+72ce,U+72f2,U+7301,U+731e,U+737e,U+7477,U+748e,U+74ff,U+7633,U+7654,U+771a,U+7726,U+7765,U+7768,U+781c,U+7829,U+78d4,U+7913,U+7957,U+79d5,U+79eb,U+7a70,U+7a86,U+7b25,U+7b38,U+7b47,U+7b72,U+7ba6-7ba7,U+7dae,U+7ee1,U+7efe,U+7f26,U+7f31,U+7f35,U+801c,U+8043,U+809f,U+80ab,U+80d7,U+8118,U+8188,U+81cc,U+823e,U+8244,U+824f,U+82b4,U+82c1,U+82e4,U+82f4,U+8306,U+833a,U+835c,U+839c,U+83b3,U+83bc,U+846d,U+867a,U+868b,U+8734,U+87ca,U+886e,U+887e,U+88a2,U+88c9,U+8921,U+8bb5,U+8bf3,U+8c04,U+8c17,U+8c1d,U+8c25,U+8c36,U+8c55,U+8c78,U+8d3d,U+8d40,U+8d59,U+8d67,U+8d91,U+8dbf,U+8deb-8dec,U+8dfd,U+8e14,U+8e41,U+8f8e,U+900b,U+9044,U+9062,U+90cf,U+9123,U+9146,U+9162,U+9172,U+918d,U+9190,U+92c8,U+93ca,U+948c,U+94aa,U+94b2,U+94c8,U+94ca,U+94d5,U+94df,U+94e9-94ea,U+94f7,U+94fc-94fd,U+951b,U+954f,U+9554,U+9559,U+9566,U+9571-9572,U+95f1,U+9608,U+960f,U+97af,U+988f,U+98d5,U+992e,U+9955,U+9ab0,U+9b32,U+9c90,U+9c9e,U+9ca5,U+9ca9,U+9cad,U+9cb1,U+9cc3,U+9e47,U+9ee7,U+9f87"}},{uri:nj,descriptors:{unicodeRange:"U+4e93,U+4ec4,U+4ef5,U+4f27,U+4f7b,U+4fe3,U+5080,U+5121,U+51eb,U+5208,U+52f0,U+53f5,U+5453,U+5466,U+54a6,U+54bf,U+54d0,U+5533,U+5549,U+5556,U+556d,U+558f,U+55f2,U+55f5,U+5627,U+567b,U+56d4,U+571c,U+5739,U+57b4,U+5807,U+58c5,U+59a4,U+59af,U+59d8,U+5a09,U+5a0c,U+5a4a,U+5ad2,U+5b6c,U+5ca2,U+5cac,U+5d03,U+5d6c,U+5db7,U+5ebe,U+5f2d,U+5fea,U+6042,U+6120,U+6175,U+6221,U+623e,U+6339,U+638a,U+643d,U+64b8,U+64e2,U+66e9,U+67b3,U+67c1,U+67d2,U+6832,U+6877,U+68f0,U+6934,U+6966,U+6987,U+6998,U+69c1,U+69ce,U+6a3d,U+6a84,U+6aa9,U+6b87,U+6bd6,U+6c16,U+6c18,U+6cd4,U+6cee,U+6de0,U+6e0c,U+6ecf,U+6f4b,U+70b7,U+7168,U+72d9,U+7352,U+73b3,U+73d0,U+7441,U+74d2,U+75a5,U+75e7-75e8,U+7610,U+7619,U+765e,U+772d,U+7812,U+782c,U+784c,U+7850,U+7856,U+789b,U+78f4,U+7a51,U+7b15,U+7b1e,U+7b24,U+7b5a,U+7bb8,U+7bc1,U+7bd9,U+7ed0,U+7ee6,U+7efa,U+7f1b,U+7f1f,U+7f22,U+7f45,U+7f71,U+7fa7,U+7fbf,U+7ff3,U+8052,U+80b1,U+80db,U+80f4,U+81bb,U+81ec,U+8202,U+8210,U+8249,U+828a,U+828e,U+82e3,U+8315,U+8369,U+8378,U+83a8,U+83aa,U+83b4,U+83e1,U+84fc,U+8538,U+853b,U+859c,U+85ae,U+86b4,U+86c9,U+86cf,U+8725,U+879f,U+87b3,U+887d,U+88fe,U+8a8a,U+8ba7,U+8c07,U+8c14,U+8c30,U+8c47,U+8db5,U+8dd7,U+8e1f,U+8e69,U+8e70,U+8e85,U+8f78,U+8f87,U+8f8b,U+8f8f,U+90c4,U+9143,U+917d,U+948f,U+94cd,U+94d2,U+94ef,U+954a,U+9609-960a,U+96d2,U+9708,U+9765,U+97ea,U+9880,U+98a7,U+996c,U+9980,U+9991,U+9a88,U+9ab6,U+9afb,U+9b47,U+9c87,U+9c9b,U+9cb5,U+9cc7,U+9e2c,U+9e42,U+9e58,U+9ecd,U+9ecf,U+9f8a,U+9f8c"}},{uri:aj,descriptors:{unicodeRange:"U+4ebb,U+4edd,U+4fa9,U+502c,U+50a5,U+51c7,U+51fc,U+523d,U+5241,U+530f,U+5464,U+549d,U+54a3,U+5514,U+5527,U+555c,U+556e,U+5576,U+55b1,U+55b9,U+55eb,U+5624,U+564c,U+5671,U+5685,U+568f,U+56d7,U+56e1,U+57a1,U+57d9,U+5942,U+5a67,U+5c50,U+5c7a,U+5c98,U+5d06,U+5d27,U+5d6f,U+5df3,U+5dfd,U+5e19,U+5ea0,U+5eb9,U+5eea,U+5ffe,U+600f,U+606b,U+6215,U+622c,U+6266,U+62bb,U+62bf,U+6308,U+6387,U+63b8,U+63c4,U+63c6,U+63f6,U+6441,U+6555,U+659b,U+6677,U+66a7,U+6775,U+678b,U+679e,U+6840,U+6849,U+6860,U+68c2,U+6910,U+6a28,U+6a2f,U+6a79,U+6b92-6b93,U+6bc2,U+6bfd,U+6c29,U+6c32,U+6c86,U+6cc5,U+6d0c,U+6d60,U+6da0,U+6ddd,U+6e86,U+6ed3,U+6edf,U+6fb9,U+6fd1,U+6fef,U+7023,U+7080,U+70ca,U+712f,U+7145,U+7284,U+732c,U+73c8,U+73d9,U+740a,U+7457,U+7596,U+759d,U+75a3,U+75d8,U+75e3-75e4,U+75ff,U+7622,U+7688,U+76b4,U+76e5,U+7818,U+7887,U+789a,U+78b2,U+7b08,U+7b33,U+7c2a,U+7ccc,U+7ea8,U+7ec0,U+7fe6,U+8012,U+8084,U+8093,U+80e4,U+80ef,U+8297,U+82a8,U+82be,U+8331,U+8366,U+83c5,U+83fd,U+8473,U+84a1,U+84ca,U+84d1,U+857b,U+85c1,U+85d3,U+8605,U+8662,U+86aa,U+86b1,U+86d4,U+86ed,U+86f3,U+8709,U+8748,U+874c,U+8763,U+89c7,U+89de,U+89e5,U+8a3e,U+8ba6,U+8c00,U+8c21,U+8c49,U+8c7a,U+8d30,U+8df9,U+8e51,U+8e59,U+8f6b,U+8f73,U+8ff3,U+9016,U+9026,U+902f,U+9099,U+909b,U+90c7,U+914a,U+91ae,U+91ba,U+9495,U+94a3,U+94af,U+94ba,U+94bf,U+94cc,U+94e1,U+94f0,U+9531,U+955d,U+95f3,U+9697,U+96bc,U+975b,U+977c,U+98a2,U+998a,U+9994-9995,U+9a9b,U+9ab7,U+9ac5,U+9c91,U+9ccf,U+9cd5,U+9e29,U+9edc,U+9edf,U+9f83,U+9f88-9f89"}},{uri:ij,descriptors:{unicodeRange:"U+4ee8,U+4f22,U+4f43,U+4f57,U+4f5d,U+4f6f,U+4ff8,U+502d,U+507b,U+5345,U+53df,U+53fb,U+544b,U+5482,U+54a7,U+54cc,U+550f,U+5544,U+5555,U+5594,U+55e8,U+55ec,U+55ef,U+564e,U+56f9,U+5704,U+576d,U+5785,U+57ad,U+5914,U+5958,U+599e,U+59aa,U+59be,U+5a06,U+5abe,U+5ae1,U+5b40,U+5bee,U+5cbf,U+5cc4,U+5ccb,U+5d47,U+603f,U+6078,U+607d,U+607f,U+608c,U+609a,U+60fa,U+61ff,U+621b,U+622e,U+626a,U+6371,U+63ae,U+63cd,U+63d6,U+6410,U+6414,U+6421,U+6448,U+64d8,U+6710,U+6748,U+6772,U+680e,U+6954,U+69ab,U+6c68,U+6c8f,U+6ca4,U+6d2e,U+6e4e,U+6e98,U+6fe0,U+7094,U+70e9,U+7116,U+7119,U+723f,U+73c9,U+74e4,U+753e,U+7548,U+75bd,U+75cd,U+7618,U+7634,U+76c5,U+76f1,U+7708,U+7719,U+777e,U+7791,U+77b3,U+7823,U+7827,U+7830,U+7889,U+7893,U+7949,U+795c,U+79e3,U+7a14,U+7a88,U+7a95,U+7aa0,U+7afd,U+7b90,U+7bd1,U+7bfe,U+7da6,U+7ec2,U+7eef,U+7f03-7f04,U+7f08,U+7f58,U+7f61,U+7f9f,U+8174,U+8200,U+828d,U+82c4,U+82d5,U+82dc,U+82f7,U+832d,U+835a,U+840b,U+8438,U+852b,U+869d,U+86ac,U+86d0,U+86f0,U+8782,U+87a8,U+87d1-87d2,U+87e0,U+8839,U+8913,U+891b,U+8934,U+8941,U+89ca,U+89ce,U+8a07,U+8ba3,U+8bc5,U+8bcb,U+8bdb,U+8c11,U+8c15,U+8c29,U+8c32,U+8dc4,U+8dce,U+8ddb,U+8dfa,U+8e09,U+8e1d,U+8e39,U+8e42,U+8e49,U+8e4b,U+8e8f,U+8f71-8f72,U+9004,U+9036,U+9097,U+90dc,U+90e2,U+90e6,U+90ef,U+9104,U+919a,U+91b4,U+938f,U+9497,U+950f,U+9557,U+9562-9563,U+9573,U+9606,U+9649,U+972d,U+973e,U+97a3,U+97eb,U+988c,U+9894,U+98a6,U+9974,U+9977,U+997d,U+9a90,U+9a9d,U+9aef,U+9ca2,U+9ccd,U+9cdf,U+9e20,U+9e4c,U+9e6b,U+9f3e"}},{uri:rj,descriptors:{unicodeRange:"U+4ede,U+4ee1,U+4eeb,U+4fda,U+4ffe,U+5025,U+506c,U+50f3,U+5106,U+520d,U+525c,U+52ad,U+530d,U+5310,U+539d,U+53a9,U+53fc,U+5421,U+5477,U+54e7,U+551b,U+5530,U+557e,U+5599,U+55c4,U+55d1,U+55d4,U+55df,U+55e4,U+55ea,U+5623,U+562d,U+5654,U+56eb,U+56f5,U+57a7,U+57d5,U+57dd,U+584d,U+5880,U+58ec,U+59dd,U+5a32,U+5a55,U+5a75,U+5b51,U+5b71,U+5b73,U+5cd2,U+5ce4,U+5e5b,U+5e96,U+5fd2,U+607b,U+61d1,U+634b,U+636d,U+63b3,U+63ff,U+64c0,U+661d,U+6657,U+66dc,U+67a5,U+6841,U+6867,U+6901,U+699b,U+6a47,U+6b46,U+6c21,U+6c24,U+6c35,U+6c4a,U+6c94,U+6ca3,U+6d39,U+6d63,U+6d6f,U+6d94,U+705e,U+71e7,U+726f,U+72cd,U+72de,U+72f0,U+7325,U+7350,U+7391,U+741a,U+757f,U+7583,U+75b1,U+75b4,U+75b8,U+75c2,U+75f1,U+766f,U+7699,U+7751,U+789c,U+7a17,U+7be6,U+7cb2,U+7ea3,U+7eb0,U+7ebe,U+7eeb,U+7f25,U+7f2c,U+7fb8,U+8026,U+8037,U+8153,U+8171,U+8191,U+8214,U+821b,U+8222,U+826e,U+82eb,U+830c,U+8314,U+8334,U+83d6,U+8418,U+843c,U+84ff,U+8564,U+8572,U+8616,U+866c,U+8693,U+86a3,U+86a7,U+86af,U+86b6,U+86c6,U+86ca,U+8708,U+870d,U+8759,U+8760,U+87af,U+87c6,U+8869,U+88c6,U+89d0,U+8b07,U+8baa-8bab,U+8bc2,U+8be4,U+8bf0,U+8c2a,U+8c62,U+8c89,U+8d49,U+8d6d,U+8d84,U+8d94,U+8db8,U+8dc6,U+8e2e,U+8e3d,U+8e47,U+8e7f,U+9005,U+9051,U+907d,U+9082,U+9088,U+90b0,U+90d3,U+9150,U+949c,U+94a4,U+94b9,U+94cb,U+94e0,U+9509,U+9512,U+951f,U+9534,U+9552-9553,U+965f,U+96b0,U+9791,U+9889,U+9990,U+9a9c,U+9aa7,U+9c88,U+9cb2-9cb3,U+9cb6-9cb7,U+9cc5,U+9cdc,U+9e22,U+9e2a,U+9e57,U+9e67,U+9e73,U+9e82,U+9eb8,U+9ee0,U+9f9b"}},{uri:sj,descriptors:{unicodeRange:"U+4eb5,U+4f09,U+4f5a,U+4f8f,U+4fce,U+4fdf,U+4fea,U+4ff3,U+500c,U+500f,U+504e,U+5088,U+52be,U+5420,U+5457,U+5499,U+549b,U+54c6,U+54d2,U+558b,U+559f,U+55bd,U+55d6,U+565c,U+567c,U+568e,U+5768,U+577b,U+57a9,U+57ed,U+59f9,U+5a11,U+5a40,U+5ae6,U+5b6a,U+5b93,U+5bb8,U+5c15,U+5c99,U+5c9c,U+5cc1,U+5d2e,U+5d4b,U+5d99,U+5e54,U+5e61,U+5fcf-5fd1,U+6002,U+6006,U+6014,U+60af,U+60c6,U+60da,U+60f4,U+621f,U+62c8,U+631b,U+631e,U+63e9,U+64b5,U+655d,U+6619,U+6635,U+6641,U+67ad,U+67b0,U+67b7,U+67e9,U+684e,U+688f,U+695d,U+696b,U+69b7,U+6a58,U+6c26,U+6d35,U+6d43,U+6d9e,U+6dd9,U+6dec,U+6e11,U+6e6e,U+6e9f,U+6ec2,U+6ee2,U+6ef9,U+6f09,U+6f66,U+6f8d,U+6fc2,U+6fc9,U+729f,U+72c8,U+73de,U+7430,U+7566,U+7579,U+75c9,U+75e2,U+75fc,U+762a,U+7638,U+7678,U+76c2,U+76f9,U+778c,U+77cd,U+77dc,U+7800,U+781d,U+782d,U+783b-783c,U+78a3,U+78ec,U+7980,U+7a23,U+7b95,U+7bdd,U+7c0c,U+7c41,U+7c91,U+7cb3,U+7cc5,U+7ecc,U+7f19,U+7fca,U+8006,U+8069,U+807f,U+80bd,U+80ed,U+814b,U+8198,U+82cb,U+82d2,U+834f,U+8360,U+847a,U+84d6,U+84e5,U+8537,U+85d0,U+8671,U+86a4,U+86ce,U+86f9,U+8703,U+8707,U+8737,U+873b,U+8815,U+8936,U+8bc3,U+8bcf,U+8bd2,U+8bd8,U+8be9,U+8c0c,U+8c0f,U+8c4c,U+8d45,U+8d5d,U+8d73,U+8e31,U+8e6d,U+8e76,U+8fe4,U+9041,U+90d7,U+9169,U+92ae,U+94a1,U+94c4,U+94c9,U+94db,U+94e7,U+9503,U+9506,U+9517,U+9528,U+9537,U+9542,U+9549,U+95fe,U+9616,U+961a,U+96c9,U+96f3,U+9701,U+970e,U+9739,U+9753,U+9798,U+98d2-98d3,U+98d9-98da,U+9968,U+996f,U+9984,U+9997,U+9acb,U+9b03,U+9c85,U+9ca8,U+9cab,U+9e49,U+9e51,U+9e66,U+9f10"}},{uri:lj,descriptors:{unicodeRange:"U+4e15,U+4e1e,U+4e2b,U+4eb3,U+4ec9,U+4f0e,U+4f64,U+501c,U+50a9,U+510b,U+51a2,U+51bc,U+527d,U+52d0,U+53fd,U+5429,U+542e,U+5486,U+54af,U+5506,U+5511,U+5522,U+552c,U+556c,U+55b3,U+55d2,U+55e6,U+55fd,U+561f,U+5639,U+5659,U+5662,U+5693,U+572a,U+5892,U+598a,U+5992,U+59a9,U+5a20,U+5ae3,U+5b17,U+5b7d,U+5d34,U+5d3d,U+5d4a,U+5d82,U+5e1a-5e1b,U+5ea5,U+5f0b,U+5f77,U+5fd6,U+5fff,U+6026,U+6035,U+6063,U+60b4,U+60bb,U+60ee,U+612b,U+6194,U+61ca,U+61e6,U+61f5,U+620a,U+6248,U+62a1,U+62d7,U+6376,U+637b,U+652b,U+65bc,U+65cc,U+65ce,U+65d6,U+664c,U+665f,U+6666,U+6684,U+66b9,U+6773,U+6777,U+6787,U+67de,U+6845,U+693d,U+6994,U+6a35,U+6d54,U+6d5c,U+6d8e,U+6dd6,U+6eb4,U+6f2a,U+6f78,U+704f,U+70ec,U+7118,U+714a,U+7172,U+71b9,U+724d,U+728a,U+7337,U+733e,U+7396,U+73b7,U+73cf,U+7428,U+742c,U+742e,U+74ee,U+74f4,U+7525,U+753a,U+7572,U+75d4,U+765c,U+768e,U+7762,U+777d,U+77fd,U+7825,U+7837,U+78b4,U+795f,U+79ed,U+7a1e,U+7b06,U+7b20,U+7ba9,U+7bab,U+7c7c,U+7cbd,U+7cdc,U+7ec9,U+7ef6,U+7f30,U+7f42,U+7f44,U+7f54,U+7f94,U+8004,U+800b,U+8019,U+809b,U+80ae,U+80c4,U+80f1,U+8146,U+816e,U+817c,U+81c0,U+81fc,U+81fe,U+822b,U+830f,U+832f,U+8340,U+8365,U+8385,U+8392,U+83a0,U+8424,U+84af,U+869c,U+8713,U+8717-8718,U+87c0,U+87cb,U+87fe,U+8821,U+8902,U+89d1,U+8bb9,U+8c12,U+8d32,U+8d53,U+8df7,U+8e7c,U+8f7c,U+8f95,U+8fab,U+9052,U+905b,U+9095,U+909d,U+90c5,U+911e,U+9122,U+916a,U+919b,U+948e,U+9492,U+949a,U+94b5,U+94bc,U+94c6,U+94f1,U+9502,U+9511,U+9536,U+956f-9570,U+9602,U+9621,U+9631,U+998b,U+99a5,U+9a81,U+9a9e,U+9ebe,U+9f8b"}},{uri:oj,descriptors:{unicodeRange:"U+4f2b,U+4f3d,U+4fac,U+5043,U+5055,U+5140,U+5156,U+51cb,U+5243,U+531d,U+536f,U+53a5,U+53ae,U+53f1,U+541d,U+5431,U+547b,U+5492,U+5494,U+54a4,U+54aa,U+54ce,U+54fd,U+5509,U+5520,U+553e,U+557b,U+55c5,U+55e1,U+55f7,U+5608,U+5636,U+563b,U+5773,U+57a0,U+5811,U+587e,U+58d5,U+59e3,U+5a29,U+5a6a,U+5a76,U+5a7a,U+5ac9,U+5b62,U+5b95,U+5c49,U+5c8c,U+5cab,U+5cb7,U+5d02,U+5d58,U+5e44,U+5e7a,U+5eff,U+5f29,U+5f89,U+5f9c,U+5fa8,U+6005,U+6043,U+60b8,U+60d8,U+60ec,U+60f0,U+6115,U+618e,U+630e,U+637a,U+6390,U+63ac,U+63b0,U+64de,U+6525,U+6538,U+65ee-65ef,U+6631,U+6636,U+6654,U+677c,U+67b8,U+67d8,U+683e,U+6886,U+68b5,U+692d,U+6963,U+6979,U+6988,U+6b59,U+6b9a,U+6c69,U+6c74,U+6cae,U+6ce0,U+6cef,U+6d95,U+6dc5,U+6dde,U+6de6,U+6dfc,U+6ea7,U+6f15,U+6f29,U+7096,U+70c3,U+7131,U+715c,U+7166,U+7266,U+7317,U+731d,U+7329,U+73e9,U+7425,U+7455,U+7490,U+74ef,U+7519,U+75b5,U+75b9,U+75de,U+7656,U+7663,U+7691,U+7729,U+77fe,U+783e,U+787c,U+795a,U+7a79,U+7abf,U+7b3a,U+7b4f,U+7b60,U+7b75,U+7b8d,U+7bb4,U+7bd3,U+7be1,U+7cbc,U+7edb,U+7f1c,U+7f8c,U+7fb2,U+7fb9,U+7fce,U+7ff1,U+810d,U+81c6,U+82a5,U+82aa,U+82de,U+8317,U+8343,U+835e,U+8364,U+836a,U+853a,U+8543,U+854a,U+8559,U+8568,U+85b0,U+85b9,U+864f,U+86e4,U+8715,U+8845,U+8884,U+88e8,U+88f1,U+8983,U+8be1,U+8c1f,U+8c27,U+8c5a,U+8c82,U+8d58,U+8dbe,U+8f98,U+9035,U+9074,U+90a1,U+9149,U+9157,U+93d6,U+949d,U+94c2,U+94e3-94e4,U+95eb,U+95f0,U+9611,U+9619,U+9642,U+968d,U+9706,U+970f,U+97ed,U+988a,U+9893,U+98e8,U+9a77,U+9a87,U+9aa1,U+9abc,U+9cdd,U+9e2f,U+9e33,U+9e44,U+9e5c,U+9e9d,U+9edd"}},{uri:dj,descriptors:{unicodeRange:"U+4f58,U+4f6c,U+4f70,U+4fd0,U+5014,U+51bd,U+524c,U+5315,U+5323,U+535e,U+540f,U+542d,U+545b,U+548e,U+549a,U+54ab,U+54fc,U+5567,U+556a,U+5600,U+5618,U+563f,U+5669,U+56f1,U+56ff,U+573b,U+574d,U+579b,U+57b8,U+57c2,U+586c,U+58f9,U+595a,U+598d,U+5993,U+5996,U+59d7,U+5b7a,U+5ba6,U+5c4e,U+5c96,U+5ce5,U+5eb6,U+5f08,U+5f99,U+602f,U+6059,U+606c,U+607a,U+60ed,U+61a9,U+620c,U+6249,U+62a8,U+62c4,U+62ed,U+62fd,U+6342,U+6345,U+6396,U+63a3,U+6402,U+6413,U+642a,U+6487,U+64a9,U+64ac,U+64ae,U+64b7,U+659f,U+65a1,U+667e,U+66f3,U+67e0,U+69db,U+69df,U+6aac,U+6b86,U+6c50,U+6c5e,U+6c76,U+6c85,U+6c8c,U+6cde,U+6d19,U+6d52,U+6da7,U+6db8,U+6e1a,U+6e25,U+6e4d,U+6e5f,U+6ec1,U+6f31,U+6f7a,U+6fa7,U+6fe1,U+701b,U+70ab,U+70f7,U+717d,U+71a8,U+7252,U+72c4,U+72e1,U+7315,U+736d,U+73ae,U+73c0,U+73c2,U+740f,U+75a4,U+7600-7601,U+768b,U+76bf,U+76d4,U+7728,U+772f,U+776c,U+77a0,U+77b0,U+77f8,U+783a,U+78d0,U+78fa,U+7977,U+7a37,U+7a92,U+7afa,U+7b71,U+7b94,U+7cef,U+7f28,U+7fe1,U+808b,U+80e5,U+80eb,U+8110,U+8113,U+812f,U+814c,U+81c3,U+8235,U+82d4,U+8309,U+83c1,U+8431,U+8469,U+84bf,U+84d3,U+84df,U+84e6,U+8511,U+8638,U+86c0,U+86db,U+86fe,U+8757,U+8822,U+8882,U+8885,U+8892,U+88f3,U+892a,U+8ba5,U+8bd9,U+8be0,U+8be7,U+8bfd,U+8c1a,U+8d4a,U+8d4e,U+8d66,U+8dda,U+8e0c,U+8e52,U+8e74,U+8e87,U+8f76,U+8fc2,U+8fe6,U+900d,U+9068,U+90ac,U+90b3,U+90b8,U+90e7,U+9119,U+9131,U+915a,U+916e,U+94b4,U+94d0,U+94e2,U+94ec,U+94ff,U+9522,U+9535,U+9556,U+965b,U+96f9,U+9774,U+9981,U+998d,U+998f,U+9a6e,U+9a7f,U+9a8a,U+9b13,U+9c9f,U+9e3e,U+9e43,U+9e6d,U+9e8b,U+9e92,U+9edb,U+9eef"}},{uri:cj,descriptors:{unicodeRange:"U+4e10,U+4e56,U+4e98,U+4ec3,U+4f3a,U+4f5f,U+4f88,U+4f97,U+4fa5,U+4fe8,U+504c,U+5197,U+52fa,U+5364,U+53e8,U+5406,U+543c,U+545c,U+5471,U+5480,U+5495,U+54b3,U+54df,U+54e6,U+54ee,U+557c,U+5583,U+55dc,U+55e3,U+566c,U+592f,U+5944,U+5983,U+59ca,U+59e5,U+5a13,U+5a7f,U+5b09,U+5bd0,U+5e4c,U+5eb5,U+5f1b,U+5f3c,U+608d,U+60cb,U+61a7,U+61ac,U+61cb,U+6233,U+62a0,U+62e7,U+62ee,U+62f4,U+62f7,U+634e,U+6382,U+63c9,U+63ea,U+6400,U+645e,U+6482,U+6556,U+6593,U+6615,U+664f,U+66e6,U+672d,U+675e,U+67da,U+6805,U+6808,U+6868,U+68a2,U+695e,U+69ad,U+6a80,U+6a90,U+6b83,U+6be1,U+6c30,U+6cad,U+6cb1,U+6cf1,U+6d31,U+6d93,U+6dae,U+6dbf,U+6dc6-6dc7,U+6e0d,U+6e32,U+6e3a,U+6e85,U+6eba,U+6f3e,U+6f5e,U+6f7c,U+6fee,U+71ee,U+722a,U+72b7,U+72e9,U+73ba,U+73d1,U+7409,U+7435-7436,U+7459-745a,U+747e,U+7487,U+74e2,U+7504,U+752c-752d,U+7599,U+759f,U+75a1,U+75ca,U+75f0,U+761f,U+7629,U+777f,U+7785,U+77a5,U+77bf,U+78d5,U+7934,U+7940,U+79a7,U+7b19,U+7c38,U+7c95,U+7cb1,U+7ce0,U+7eca,U+7ef7,U+7f2b,U+7f81,U+7fcc,U+8046,U+8148,U+8165,U+819b,U+81ba,U+828b,U+82ae,U+82b7,U+82d3,U+8301,U+830e,U+831c,U+8338,U+837c,U+8393,U+8398,U+83ba,U+83e0,U+83e9,U+853c,U+8654,U+86df,U+8712,U+873f,U+874e,U+8783,U+8859,U+88a4,U+8925,U+8bb7,U+8bff,U+8c19,U+8c1b,U+8c24,U+8c2c,U+8d61,U+8db4,U+8e6c,U+8f8a,U+8fe5,U+8ff8,U+901e,U+90f4,U+912f,U+9163,U+9170,U+91dc,U+949b,U+94a8,U+94b3,U+94c0,U+94e8,U+9525,U+9530,U+9539,U+954c-954d,U+9550,U+955b,U+962a,U+9685,U+96cc,U+9776,U+988d,U+9975,U+9985,U+9a6f,U+9aa5,U+9ab8,U+9c7f,U+9ca4,U+9cb8,U+9e25,U+9e35,U+9e4a"}},{uri:uj,descriptors:{unicodeRange:"U+4ea2,U+4ea5,U+4f36,U+4f84,U+4f8d,U+501a,U+5029,U+516e,U+51a5,U+51c4,U+51f8,U+5201,U+527f,U+5321,U+5352,U+5366,U+53e9,U+54c7,U+5632,U+5676,U+56b7,U+56bc,U+56da,U+56e4,U+5703,U+5729,U+5742,U+57a2-57a3,U+5815,U+58d1,U+5919,U+592d,U+5955,U+5a05,U+5a25,U+5a34,U+5b70,U+5b75,U+5bdd,U+5bf0,U+5c41,U+5c79,U+5c91,U+5c94,U+5ce6,U+5ced,U+5d69,U+5dc5,U+5e16,U+5e27,U+5f27,U+5f95,U+5ffb,U+6020,U+604d,U+6055,U+60e6,U+60eb,U+6123,U+618b,U+61a8,U+620d,U+62c7,U+62ce,U+62d9,U+631f,U+634d,U+6452,U+6479,U+64ce,U+64d2,U+655b,U+660a,U+6726,U+67c4,U+6809,U+6853,U+68e3,U+68f1,U+68fa,U+693f,U+6942,U+6995,U+69a8,U+69b4,U+6a71,U+6b89,U+6bcb,U+6bd3,U+6bd9,U+6c40,U+6cf8,U+6cfe,U+6d85,U+6da3,U+6daa,U+6e0e,U+6e43-6e44,U+6f88,U+7078,U+7099,U+70bd,U+70d9,U+70fd,U+7109,U+7184,U+7239,U+733f,U+73f2,U+748b,U+749c,U+749e,U+759a,U+75d2,U+75eb,U+7620,U+766b,U+7693,U+76cf,U+7738,U+773a,U+776b,U+778e,U+77aa,U+7852,U+78be,U+7948,U+795b,U+7960,U+796f,U+79ba,U+7a20,U+7a96,U+7aa5,U+7b03,U+7b28,U+7b50,U+7b77,U+7bc6,U+7bf1,U+7c27,U+7d0a,U+7ead,U+7ec5,U+7ee2,U+7ef0,U+7efd,U+7f0e,U+7f2e,U+7f79,U+7f9a,U+8098,U+80da,U+80e7,U+80f0,U+80f3,U+80fa,U+818a,U+81e7,U+8237-8238,U+8299,U+82b8,U+82ce,U+837b,U+83bd,U+83cf,U+8426,U+8475,U+85c9,U+85d5,U+85dc,U+85e9,U+871a,U+8747,U+8749,U+888d,U+8910,U+891a,U+8bb4,U+8be3,U+8bec,U+8bf2,U+8c06,U+8c0d,U+8d31,U+8d48,U+8de4,U+8e1e,U+8e4a,U+8e66,U+8f84,U+8f97,U+9083,U+90e1,U+9165,U+91c9,U+94b0,U+94f5,U+9504,U+9532,U+956d,U+95f5,U+95fa,U+9668,U+9698,U+96bd,U+9704,U+9773,U+9890,U+996a,U+997a,U+9a74,U+9a8b,U+9cc4,U+9ccc"}},{uri:hj,descriptors:{unicodeRange:"U+4ea8,U+4f1e,U+4f51,U+4f63,U+4f7c,U+4f83,U+4fa0,U+4fd1,U+4ffa,U+5018,U+5026,U+508d,U+50bb,U+50f5,U+50fb,U+5162,U+5319,U+5320,U+538c,U+5413,U+541f,U+5475,U+54bd,U+54d1,U+5589,U+5598,U+575f,U+57ae,U+57e0,U+5937,U+5974,U+5978,U+59ae,U+5a1f,U+5a49,U+5ab3,U+5b99,U+5b9b,U+5ba0,U+5be1,U+5be5,U+5c09,U+5c27,U+5de2,U+5e9a,U+5f26,U+5f8a,U+5f98,U+6021,U+606d,U+60bc,U+60d5,U+60e7,U+611a,U+614c,U+6254,U+626f,U+6292,U+6296,U+62b9,U+62e2,U+631a,U+631d,U+6320,U+6346,U+63ba,U+6467,U+64bc,U+658b,U+663c,U+6643,U+6652,U+6656,U+6687,U+66d9,U+66dd,U+66f0,U+673d,U+67ab,U+6816-6817,U+68a7,U+68ad,U+68cd,U+68e0,U+6986,U+69fd,U+6b47,U+6bd7,U+6c1f,U+6c2e-6c2f,U+6cbe,U+6de4,U+6e1d,U+6e83,U+6e9c,U+6ed4-6ed5,U+6f4d,U+70f9,U+7130,U+716e,U+718f,U+71ac,U+71e5,U+72fc,U+731c,U+7334,U+73ca,U+7422,U+7426,U+745f,U+7470,U+75af,U+75f4,U+762b,U+763e,U+7696,U+7737,U+7741,U+77a7,U+77bb,U+77ee,U+785d,U+788c,U+78ca,U+7901,U+796d,U+7985,U+79fd,U+7a3c,U+7a57,U+7a74,U+7b5b,U+7caa,U+7cb9,U+7cd5,U+7eac,U+7eb6,U+7ed1,U+7ee5,U+7f20,U+7f2a,U+7f38,U+7f69,U+7fa1,U+8018,U+8038,U+803f,U+804b,U+80a2,U+80be,U+80d6,U+817a,U+81fb,U+820c,U+82ad,U+82af,U+82bd,U+8327,U+8354,U+835f,U+8367,U+836b,U+840c,U+841d,U+8471,U+849c,U+84b2,U+84c9,U+8517,U+851a,U+8549,U+8681,U+8721,U+8776,U+88d9,U+88f9,U+89c5,U+8c1c,U+8c34,U+8d81,U+8d9f,U+8e0a,U+8e72,U+8eb2,U+8fed,U+901b,U+902e,U+906e,U+9091,U+90aa,U+90af,U+915d,U+9171,U+946b,U+9489,U+9499,U+94a5,U+9508,U+9524,U+952d,U+9551,U+9576,U+95f7,U+9600,U+96b6,U+96c0,U+9756,U+97f6,U+98a0,U+98a4,U+997f,U+9a73,U+9a86,U+9ad3,U+9e3d,U+9ed4"}},{uri:fj,descriptors:{unicodeRange:"U+4e4d,U+4e5e,U+4ec7,U+4ed5,U+50da,U+50e7,U+515c,U+51a4,U+51ff,U+5203,U+5254,U+5300,U+533e,U+5375,U+53ee,U+5435,U+543b,U+5455,U+548b,U+548f,U+54d7,U+54fa,U+5578,U+5587,U+55a7,U+560e,U+5760,U+576f,U+5777,U+5830,U+58a9,U+5962,U+59e8,U+5a07,U+5a23,U+5a3c,U+5b5a,U+5bb5,U+5bc5,U+5bde,U+5c7f,U+5cb1,U+5ce8,U+5cea,U+5d29,U+5d4c,U+5e18,U+5f57,U+5f5d,U+5f87,U+5ff1,U+6016,U+601c,U+6064,U+6177,U+61d2,U+625b,U+62e3,U+62f1,U+634f,U+63a0,U+6401,U+6405,U+6495,U+64c2,U+6512,U+6577,U+6590,U+65a7,U+65a9,U+65f7,U+6627,U+6655,U+6714,U+6795,U+67d1,U+67ff,U+68b3,U+68d5,U+68d8,U+6930,U+6960,U+6977,U+69bb,U+69d0,U+6a31,U+6b7c,U+6bb4,U+6c22,U+6c72,U+6c79,U+6c7e,U+6c81,U+6c93,U+6ca5,U+6cbc,U+6ce3,U+6cfb,U+6d3c,U+6da9,U+6df3,U+6e2d,U+6eaf,U+6ec7,U+6f13,U+6f33,U+6f62,U+6fa1,U+7011,U+707c,U+708a,U+70c1,U+70d8,U+70eb,U+711a,U+7194,U+7281,U+7316,U+7357,U+7384,U+7405,U+742a,U+745b,U+7574,U+7578,U+75ea,U+7682,U+7792,U+77d7,U+77e9,U+77eb,U+77f6,U+780c,U+78c5,U+7941,U+79e4,U+7a1a,U+7a9c,U+7ad6,U+7b5d,U+7bf7,U+7c07,U+7c3f,U+7c9f,U+7ca5,U+7cdf,U+7e82,U+7eab,U+7ece,U+7eda,U+7f09,U+7f15,U+7f9e,U+7fdf,U+7fe9,U+803b,U+803d,U+80aa,U+80b4,U+813e,U+8155,U+817b,U+819d,U+821c,U+82b9,U+82df,U+82ef,U+8304,U+83b9,U+8446,U+853d,U+85af,U+85fb,U+8650,U+865e,U+86d9,U+86ee,U+8700,U+8862,U+889c,U+88d4,U+88f8,U+895f,U+8a79,U+8bb3,U+8bb6,U+8bc0,U+8beb,U+8bf5,U+8c23,U+8c79,U+8d1e,U+8dcb,U+8e29,U+8e44,U+8e81,U+8eac,U+8eaf,U+8f8d,U+9050,U+90f8,U+914b,U+948a,U+94be,U+94ee,U+950c,U+9540,U+962e,U+9647,U+9661,U+9699,U+96cf,U+9716,U+9761,U+97a0,U+97e7,U+9a7c,U+9a8f,U+9ae6,U+9cd6,U+9e26"}},{uri:pj,descriptors:{unicodeRange:"U+4fa3,U+4fae,U+4fd8,U+4fef,U+50a3,U+5189,U+5195,U+51db,U+51f3,U+51f9,U+5220,U+5228,U+5288,U+52ff,U+532e,U+533f,U+5351,U+53db,U+53ed,U+5450,U+5484,U+5490,U+54c9,U+54e9,U+5501,U+5507,U+5543,U+55d3,U+56a3,U+575e,U+589f,U+5984,U+59ec,U+5a04,U+5a36,U+5a77,U+5a9a-5a9b,U+5ab2,U+5ac2,U+5ad6,U+5bc7,U+5c2c,U+5c34,U+5c51,U+5cd9,U+5d0e,U+5deb,U+5e3c,U+5e87,U+5ed3,U+5f13,U+5f64,U+5fe1,U+606a,U+6096,U+60df,U+60f6,U+60f9,U+6151,U+620e,U+6241,U+6252,U+6273,U+627c,U+6289,U+62c2,U+62cc,U+62ef,U+6361,U+6363,U+63b7,U+63e3,U+6518,U+66ae,U+6756,U+6789,U+6813,U+6829,U+6862,U+6866,U+6893,U+6897,U+690e,U+6984,U+69cc,U+6a1f,U+6a44,U+6a59,U+6ba1,U+6c13,U+6c90,U+6ca6,U+6cbd,U+6ccc,U+6cd3,U+6cd7,U+6d4a,U+6d4f,U+6d5a,U+6d9f,U+6da1,U+6dcc,U+6ea5,U+6ee4,U+6ee6,U+6f2f,U+6f8e,U+701a,U+7095,U+709c,U+70af,U+70db,U+70e8,U+714e,U+715e,U+71a0,U+71ce,U+7235,U+7280,U+72d0,U+72f8,U+73ab,U+7410,U+745c,U+7480,U+74a7-74a8,U+74e3,U+75ae,U+75f9,U+76b1,U+76ce,U+7736,U+77e2-77e3,U+781a,U+789f,U+797a,U+79be,U+79c3,U+79c6,U+79f8,U+7a8d,U+7a98,U+7aa6,U+7aff,U+7b1b,U+7cd9,U+7d6e,U+7ede,U+7eee,U+7f00,U+7f24,U+7f2d,U+7fd8,U+800d,U+8116,U+8151,U+81b3,U+8205,U+82c7,U+82db,U+832c,U+8335,U+8339,U+8386,U+846b,U+8587,U+8611,U+8682,U+868a,U+868c,U+8774,U+88d8,U+88f4,U+8912,U+8b6c,U+8bbd,U+8c0e,U+8c41,U+8d26,U+8d3b-8d3c,U+8d50,U+8dea,U+8e35,U+8f99,U+8fe2,U+8fe9,U+9017,U+914c,U+916f,U+9175-9176,U+918b,U+94a0,U+94ae,U+94ce,U+94f2,U+951a,U+952f,U+9541,U+9640,U+9672,U+968b,U+96cd,U+96ef,U+9713,U+97ec,U+9885,U+9992,U+9a6d,U+9a79,U+9a85,U+9cbb,U+9cd7,U+9cde,U+9e93,U+9f9f"}},{uri:Uj,descriptors:{unicodeRange:"U+4e11,U+4ed7,U+4fcf,U+4fe9,U+4fed,U+50ac,U+50b2,U+5112,U+5180,U+5188,U+51f6,U+522e,U+5265,U+52cb,U+52df,U+5349,U+5367,U+5378,U+537f,U+5395,U+5398,U+53d4,U+543e,U+5440,U+5446,U+54b8,U+5565-5566,U+5580,U+55bb,U+56ca,U+572d,U+573e,U+574e,U+5782-5784,U+58f3,U+5938-5939,U+5948,U+594e,U+5a1c,U+5a74,U+5ae9,U+5b55,U+5b5c,U+5bb0,U+5bd3,U+5bf8,U+5c3f,U+5d14,U+5d2d,U+5df7,U+5dfe,U+5e05-5e06,U+5e1c,U+5e62,U+5e7b,U+5e7d,U+5ed6,U+5f2f,U+5f66,U+5f6c,U+5fa1,U+604b,U+609f,U+60a6,U+60e8,U+6101,U+6124,U+6127,U+6148,U+61be,U+6247,U+62d8,U+62da,U+633d,U+635e,U+6367,U+6380,U+638f,U+63a9,U+63fd,U+641c,U+64e6,U+655e,U+6572,U+6591,U+65a5,U+6691,U+6735,U+67a2-67a3,U+67ef,U+680b,U+6876,U+6905,U+6a0a,U+6a61,U+6b79,U+6bb7,U+6bbf,U+6c41,U+6c55,U+6c83,U+6c9b,U+6ca7,U+6cfc,U+6d46,U+6d51,U+6d74,U+6d9d,U+6daf,U+6dc0,U+6deb,U+6e17,U+6e24,U+6e89,U+6ea2,U+6ef4,U+6f6d,U+707f,U+70b3,U+70e4,U+70ef,U+710a,U+722c,U+725f,U+7261,U+72ee,U+72f1,U+730e,U+732b,U+7433,U+7538,U+75bc,U+7624,U+7709,U+7750,U+7779,U+7802,U+7898,U+78a7,U+78b1,U+78cb,U+78f7,U+7984,U+7a83,U+7aed,U+7b3c,U+7b4b,U+7c92,U+7c98,U+7ca4,U+7eb9,U+7ee3,U+7ef3,U+7ef5,U+7f05,U+7f55,U+7f62,U+7fc1,U+7fd4,U+7fe0,U+8042,U+806a,U+80a0,U+80a4,U+80c3,U+8102,U+8106,U+814a,U+8154,U+8247,U+8258,U+82cd,U+8328,U+832b,U+8389,U+83ca,U+845b,U+846c,U+84b8,U+8574,U+859b,U+8680,U+8695,U+86c7,U+8702,U+886c,U+8896,U+88b1,U+88e4,U+8bc8,U+8c10,U+8c26,U+8c28,U+8c2d,U+8d4c,U+8d63,U+8f67,U+8f74,U+8fc4,U+9006,U+9063,U+90a2,U+90b1,U+90c1,U+9177,U+9189,U+9493,U+949e,U+94fe,U+9610,U+961c,U+96a7,U+96fe,U+978d,U+97f5,U+9888,U+997c,U+9a84,U+9b3c,U+9b44-9b45,U+9b54,U+9e64,U+9f0e,U+9f9a"}},{uri:mj,descriptors:{unicodeRange:"U+4e19,U+4e38,U+4e53,U+4e7e,U+4e9f,U+4ec6,U+4f50,U+4fde,U+502a,U+5154,U+517d,U+51d1,U+51f0,U+5239,U+5256,U+52c9,U+52fe,U+5308,U+532a,U+535c,U+5384,U+53a2,U+53a8,U+53c9,U+53e0,U+5496,U+54ac,U+54c0,U+54c4,U+54e8,U+5561,U+5582,U+561b,U+5631,U+566a,U+5764,U+576a,U+5792,U+57ab,U+584c,U+5885,U+58f6,U+59a8,U+5acc,U+5bc2,U+5c38-5c39,U+5c60,U+5c6f,U+5c82,U+5c90,U+5d16,U+5dcd,U+5e37,U+5e90,U+5eb8,U+5f6a,U+5fcc,U+6012,U+6068,U+6073,U+607c,U+6094,U+6109,U+621a,U+626e,U+6284,U+62d0,U+62e6,U+62fe,U+6321,U+6328,U+632b,U+6349,U+6454,U+65ed,U+660f,U+6674,U+66a8,U+6749,U+674f,U+6760,U+67af,U+6850,U+6854,U+6869,U+68a8,U+68d2,U+68f5,U+6912,U+6b49,U+6b6a,U+6bef,U+6c28,U+6c5d,U+6c82,U+6cab,U+6cb8,U+6cc4,U+6cf5,U+6d47,U+6d78,U+6da4,U+6dc4,U+6dcb,U+6df9,U+6e0a,U+6e23,U+6e5b,U+6eb6,U+6f06,U+6f47,U+6f84,U+6f9c,U+6fd2,U+7076,U+70ac,U+7199,U+723d,U+72ac,U+72ed,U+7476,U+7529,U+752b,U+754f,U+7554,U+75d5,U+7626,U+76ef,U+7720,U+7766,U+7784,U+77ac,U+780d,U+7838,U+7845,U+786b,U+78b3,U+7978,U+79b9,U+79c9,U+79e7,U+7a3d,U+7a84,U+7a9f,U+7b0b,U+7b52,U+7c7d,U+7f1a,U+7fc5,U+7ff0,U+804a,U+8086-8087,U+808c,U+809a,U+80ba,U+810a,U+8180,U+818f,U+81c2,U+81ed,U+8231,U+8292,U+829c,U+82a6,U+82d1,U+8346,U+838e,U+839e,U+83c7,U+83f1,U+8403,U+840e,U+8513,U+857e,U+85e4,U+867e,U+871c,U+87ba,U+87f9,U+884d,U+8944,U+8a93,U+8c05,U+8d2c,U+8d2e,U+8d42-8d43,U+8dfb,U+8e22,U+8eba,U+8f69,U+8f9c,U+8fa3,U+8fa8,U+8fb1,U+900a,U+9038,U+903b,U+9042,U+904f,U+90b5,U+90dd,U+9102,U+9187,U+94a7,U+94c5,U+9523,U+95f8,U+95fd,U+960e,U+964b-964c,U+96c1,U+9709,U+971c,U+97ad,U+9882,U+9965,U+9976,U+9988,U+99a8,U+9a82,U+9a9a,U+9b41,U+9c8d,U+9e45,U+9e70,U+9e9f,U+9f3b,U+9f7f"}},{uri:gj,descriptors:{unicodeRange:"U+4e08,U+4e18,U+4e1b,U+4e22,U+4e27,U+4e32,U+4e52,U+4e73,U+4ead,U+4ed4,U+4ed9,U+4ef0,U+4fa6,U+5076,U+5179,U+51bb,U+51c9,U+51ef,U+51fd,U+524a,U+526a,U+529d,U+52ab,U+5306,U+5339,U+53d9,U+540a,U+5410,U+541e,U+5439,U+54b1,U+54ed,U+5564,U+558a,U+55b7,U+5634,U+574a,U+5751,U+57a6,U+57cb,U+57d4,U+5824,U+582a,U+5835,U+5858,U+5893,U+58e4,U+5951,U+5986,U+59da,U+59fb,U+59ff,U+5a03,U+5a46,U+5ac1,U+5b5d,U+5bfa,U+5c18,U+5c3a,U+5c48,U+5c4f,U+5c61,U+5cb3,U+5d1b,U+5e15,U+5e3d,U+5e99,U+5e9e,U+5eca,U+5f0a,U+5f17-5f18,U+5f25,U+5f7c,U+5fcd,U+6028,U+60a0,U+60ac,U+60d1,U+614e,U+6155,U+6168,U+61c8,U+6208,U+6212,U+6251,U+629a-629b,U+62ab-62ac,U+62fc,U+6323,U+632a,U+63d2,U+643a,U+6491-6492,U+649e,U+64b0,U+64c5,U+659c,U+6614,U+662d,U+6664,U+6670,U+6676,U+6746,U+67cf,U+67d4,U+682a,U+6843,U+6846,U+68da,U+6b3a,U+6b67,U+6c27,U+6c5b,U+6c64,U+6c70,U+6caa,U+6cca,U+6ce1,U+6d12,U+6d45,U+6dd1,U+6dd8,U+6e34,U+6e7f,U+6ee5,U+6f02,U+7092,U+70c2,U+70e6,U+7115,U+7237,U+7272,U+727a,U+72c2,U+739b,U+73b2,U+743c,U+751c,U+758f,U+75b2,U+7686,U+76c6,U+76d2,U+76fc,U+775b,U+77a9,U+7816,U+788e,U+7897,U+78b0,U+79bd,U+7a0d,U+7a91,U+7a9d,U+7ae3,U+7bad,U+7cca,U+7d2b,U+7eb1,U+7f06,U+7f14,U+7f1d,U+7f50,U+7ffc,U+8036,U+80bf,U+80c1,U+80ce,U+80f8,U+8109,U+810f,U+8170,U+8179,U+819c,U+821f,U+8230,U+8236,U+8273,U+829d,U+82f9,U+8305,U+8350,U+83b2,U+83cc,U+8404,U+840d,U+8427,U+8482,U+8679,U+8854,U+886b,U+8bbc,U+8be6,U+8c31,U+8c6b,U+8d4b,U+8dcc,U+8e2a,U+8e48,U+8f90,U+8fb0,U+9022,U+903c,U+903e,U+9065,U+916c,U+917f,U+94a9,U+94c3,U+94dd,U+94ed,U+9510,U+953b,U+96c7,U+970d,U+9738,U+9877,U+987d,U+989c,U+98d8,U+9a70,U+9a91,U+9aa4,U+9b42,U+9b4f,U+9e2d,U+9e3f,U+9e7f,U+9f20"}},{uri:bj,descriptors:{unicodeRange:"U+4e59,U+4ed3,U+4f0f,U+4f38,U+4f69,U+4fa7,U+4faf,U+4ff1,U+5077,U+5085,U+5144,U+5151,U+51af,U+51b6,U+51cc,U+523a,U+5251,U+5269,U+5272,U+52d8,U+5353,U+5389,U+53f9,U+5401,U+5415,U+541b,U+54f2,U+5524,U+554a,U+559d,U+5609,U+5740,U+575d,U+5806,U+5821,U+586b,U+5915,U+594f,U+5960,U+5999,U+59a5,U+59b9,U+59c6,U+59d1,U+59dc,U+5b5f,U+5b64,U+5b87,U+5bb4,U+5bbf,U+5c16,U+5c1d,U+5c3e,U+5c9a,U+5ca9,U+5cad,U+5cfb,U+5de1,U+5de7,U+5de9,U+5ef7,U+5f04,U+5f70,U+5f79,U+5fc6,U+602a,U+6050,U+6052,U+6070,U+6084,U+60b2,U+60dc,U+60e9,U+6167,U+6170,U+61c2,U+6270,U+6291,U+62b1,U+62bc,U+62dc,U+62df,U+62f3,U+6324,U+633a,U+6377,U+6398,U+63cf,U+640f,U+642c-642d,U+6458,U+6478,U+6500,U+654c,U+6566,U+658c,U+65c1,U+65cb,U+65e8,U+65ec,U+6696-6697,U+6734,U+679a,U+679d,U+67dc,U+67f3-67f4,U+680f,U+683d,U+684c,U+68af,U+699c,U+6bc1,U+6c0f,U+6c1b,U+6c57,U+6c6a,U+6d3d,U+6d6e,U+6d82,U+6db5,U+6dee,U+6e58,U+6eaa,U+6ecb,U+6ede,U+6ee9,U+6f0f,U+6f20,U+6f58,U+704c,U+7070,U+70b8,U+718a,U+7238,U+7262,U+7275,U+72b9,U+72d7,U+72e0,U+741b,U+7434,U+7483,U+74f6-74f7,U+75ab,U+764c,U+7761,U+7855,U+7891,U+78c1,U+79d2,U+7a00,U+7a3b,U+7c97,U+7ea4,U+7eb2,U+7ed2,U+7eea,U+7ef8,U+7f18,U+7fbd,U+8000,U+8010,U+8096,U+809d,U+80a9,U+817f,U+81e3,U+8206,U+8212,U+82ac,U+8302,U+8361,U+8377,U+83f2,U+8461,U+848b,U+84ec,U+8521,U+85aa,U+8870,U+8877,U+8881,U+888b,U+88ad,U+88c2,U+8986,U+8bd1,U+8bf1,U+8d24,U+8d2a,U+8d3e-8d3f,U+8d41,U+8d56,U+8d64,U+8d6b,U+8e0f,U+8f70,U+8f85,U+8f88,U+8fa9,U+9003,U+901d,U+90b9,U+90ce,U+94a6,U+94f8,U+9505,U+95ea,U+95ef,U+95f2,U+95f9,U+9601,U+9605,U+9634,U+966a,U+9677,U+9690,U+9694,U+96d5,U+971e,U+9896-9897,U+9972,U+9a71,U+9a76,U+9a7e,U+9e1f,U+9e23"}},{uri:xj,descriptors:{unicodeRange:"U+4e01,U+4e43,U+4ea6,U+4ef2,U+4eff,U+4f26,U+4f2a,U+4f2f,U+4f5b,U+4fa8,U+4fca,U+4fd7,U+5021,U+504f,U+5141,U+51c0,U+51dd,U+51e4,U+51ed,U+5200,U+5237,U+5427,U+5448,U+54a8,U+5706,U+5708,U+5723,U+575b,U+57c3,U+5899,U+58a8,U+58c1,U+5976,U+5988,U+59bb,U+59d0,U+59d3,U+5a18,U+5a31,U+5a92,U+5b54,U+5b85,U+5baa-5bab,U+5bc4,U+5bd2,U+5be8,U+5bff,U+5c65,U+5d07,U+5e1d,U+5e78,U+5e7c,U+5f03,U+5f1f,U+5f39,U+5f6d,U+5f92,U+5faa,U+5fbd,U+5fe7,U+5ffd,U+60a8,U+60ef,U+6108,U+6162,U+622a,U+6234,U+626b,U+626d,U+62c6,U+62d2,U+62d4,U+62d6,U+62e8,U+6316,U+6355,U+63ed,U+6447,U+64a4,U+65f1,U+6606,U+6628,U+664b,U+6668,U+6682,U+66f9,U+66fc,U+66ff,U+6717,U+6740,U+676d,U+67aa,U+67ec,U+67f1,U+6842,U+6851,U+695a,U+6982,U+6a2a,U+6b20,U+6b23,U+6b32,U+6b96,U+6bc5,U+6beb,U+6c60,U+6c9f,U+6cea,U+6cf3,U+6d1e,U+6d53,U+6d66,U+6d69,U+6d8c,U+6d9b,U+6db2,U+6de1,U+6dfb,U+6e14,U+6ed1,U+6eda,U+6ee8,U+6f2b,U+706d,U+7089,U+708e,U+70ad-70ae,U+70e7,U+7126,U+714c,U+71c3,U+71d5,U+7206,U+7259,U+731b,U+73a9,U+73bb,U+74dc,U+7532,U+7545,U+755c,U+75c7,U+7687,U+76d7,U+76f2,U+788d,U+78e8,U+79e6,U+79e9,U+7a3f,U+7a46,U+7a97,U+7af9,U+7bee,U+7c4d,U+7c89,U+7cd6,U+7eb5,U+7ebd,U+7ed8,U+8017,U+8033,U+80c0,U+80de,U+80f6,U+8138,U+817e,U+81a8,U+820d,U+827e,U+82b3,U+82d7,U+83b1,U+84c4,U+84dd,U+8584,U+864e,U+865a,U+866b,U+86cb,U+88d5,U+89e6,U+8bca,U+8bde,U+8bfa,U+8c0a,U+8c37,U+8c46,U+8c6a,U+8c8c,U+8d1d,U+8d29,U+8d4f,U+8d54,U+8d5a,U+8d60,U+8d62,U+8f7f,U+8f96,U+8f9e-8f9f,U+8fc1,U+8fdf,U+8fea,U+8ff7,U+9012,U+906d,U+9075,U+90a6,U+90bb,U+90ca,U+9178,U+9192,U+91ca,U+94bb,U+94dc,U+94fa,U+9501,U+950b,U+9521,U+955c,U+963b,U+9655,U+9675-9676,U+9887,U+9891,U+9971,U+9a97,U+9ece,U+9ed8"}},{uri:vj,descriptors:{unicodeRange:"U+4e1d,U+4e39,U+4e4c,U+4e4f,U+4e54,U+4e58,U+4e95,U+4ea1,U+4eab,U+4eae,U+4ec1,U+4f10,U+4f19,U+4f30,U+4f34,U+4fb5,U+503e,U+518c,U+5192,U+51a0,U+51ac,U+51b0,U+51e1,U+5211,U+5242,U+52a3,U+52b2,U+52c3,U+52c7,U+52d2,U+52e4,U+5377,U+539a,U+53a6,U+53e5,U+5417,U+5510,U+552f,U+5531,U+574f-5750,U+5761,U+5851,U+5854,U+58ee,U+593a,U+5949,U+5954,U+5a5a,U+5b8b,U+5bbd,U+5c04,U+5c0a,U+5c4b,U+5ce1,U+5cf0,U+5e10,U+5e8a,U+5e9f,U+5ec9,U+5f31,U+5f84,U+5fd8-5fd9,U+5fe0,U+6015,U+6062,U+6069,U+6076,U+6089,U+60a3,U+60ca,U+620f,U+624e,U+6263,U+6298,U+62a2,U+62bd,U+6311,U+6350,U+6389,U+638c,U+63f4,U+6446,U+644a,U+6469,U+64cd,U+654f,U+6562,U+656c,U+65d7,U+65e6,U+65fa,U+660c,U+6653,U+66b4,U+670b,U+672b,U+676f-6770,U+6881,U+6885,U+68a6,U+68cb,U+68ee,U+6b8a,U+6c88-6c89,U+6cc9,U+6ce5,U+6d01,U+6d17,U+6d1b,U+6d59,U+6d6a,U+6da8,U+6df7,U+6e10,U+6e20-6e21,U+6f5c,U+706f,U+70bc,U+719f,U+7267,U+732a,U+73cd,U+7518,U+756a,U+7586,U+7591,U+75db,U+76c8,U+76d0,U+76d6,U+76d8,U+76df,U+76fe,U+77db,U+7801,U+786c,U+795d,U+7965,U+79cb,U+7a77,U+7a7f,U+7aef,U+7b11,U+7bb1,U+7bc7,U+7ea0,U+7eaf,U+7ed5,U+7edc,U+7f13,U+7f29,U+7f34,U+7f8a,U+7ffb,U+8015,U+8058,U+805a,U+8083,U+80af,U+80c6,U+80cc,U+811a,U+8150,U+82e5,U+8336,U+8352,U+83ab,U+8428,U+8463,U+852c,U+8861,U+89c8,U+8bcd,U+8bd7,U+8bda,U+8be2,U+8bef,U+8bf8,U+8c0b,U+8c13,U+8d34,U+8d3a,U+8d74,U+8d76,U+8da3,U+8dd1,U+8ddd,U+8ddf,U+8df3,U+8f68,U+8f6f,U+8f7d,U+8f91,U+8f9b,U+8fbd,U+8fc8,U+8fd4,U+8feb,U+8ff9,U+900f,U+9057,U+907f-9080,U+90d1,U+90ed,U+91ce,U+9519,U+9526,U+95ed,U+9614,U+9635,U+9644,U+9686,U+96c5,U+96ea,U+9707,U+9732,U+9759,U+978b,U+9876,U+9881,U+9910,U+996e,U+9970,U+9c81,U+9e21,U+9ebb,U+9f84"}},{uri:yj,descriptors:{unicodeRange:"U+4e3d,U+4e4e,U+4e71,U+4e8f,U+4ed8,U+4eea,U+4f0a,U+4f0d,U+4f11,U+4f1f,U+4f24,U+4f3c,U+4f73,U+4fc4,U+500d,U+5012,U+501f,U+503a,U+505c,U+507f,U+50a8,U+514d,U+5178,U+517c,U+51b2,U+51b7,U+520a,U+5238,U+523b,U+52b1,U+535a,U+5371,U+5385,U+53eb-53ec,U+53f3,U+53f6,U+5409,U+542b,U+542f,U+5434,U+5462,U+5473,U+547c,U+54c8,U+54ea,U+56fa,U+5733,U+5757,U+5766,U+5802,U+585e,U+590f,U+591c,U+591f,U+5947,U+594b,U+5987,U+5a01,U+5b59,U+5b63,U+5b88,U+5b97,U+5b9c,U+5bbe,U+5bfb,U+5c01,U+5c1a,U+5c24,U+5c3c,U+5c97,U+5c9b,U+5cb8,U+5de6,U+5e01,U+5e2e,U+5e45,U+5e55,U+5e84,U+5ef6,U+5f02,U+5f52,U+5f69,U+5f7b,U+5f90,U+5fae,U+6000,U+600e,U+6025,U+60e0,U+6276,U+6297,U+62b5,U+62cd,U+62d3,U+62e5,U+62e9,U+62ff,U+6302,U+632f,U+63e1,U+6444,U+64ad,U+653b,U+6551,U+6563,U+65a4,U+65e7,U+6620,U+667a,U+66f2,U+671d,U+6731,U+6742,U+675f,U+6768,U+677e-677f,U+6790,U+67b6,U+67d3,U+6863,U+68b0,U+68c9,U+690d,U+6b8b,U+6bcd,U+6bd2,U+6bd5,U+6c38,U+6c61,U+6cbf,U+6cdb,U+6cf0,U+6d2a,U+6d89,U+6da6,U+6f6e,U+6fb3,U+7075,U+707e,U+70df,U+7164,U+7236,U+725b,U+7389,U+73e0,U+745e,U+74e6,U+751a,U+7537,U+75be,U+76ae,U+76db,U+793c,U+7956,U+7981,U+79d8,U+79df,U+79fb,U+7adf,U+7ae5,U+7b14,U+7b26,U+7b54,U+7b79,U+7d2f,U+7eb8,U+7eba,U+7ec6,U+7ee9,U+7eff,U+7f5a,U+7f6a,U+7f72,U+8089,U+80a5,U+80e1,U+8111,U+8131,U+821e,U+822c,U+8270,U+8499,U+8651,U+867d,U+8840,U+8857,U+8863,U+88c1,U+89c9,U+89d2,U+8a89,U+8bed,U+8bfe,U+8c01,U+8c22,U+8d21,U+8d25,U+8d2f,U+8d5e,U+8d75,U+8d8b,U+8dc3,U+8de8,U+8df5,U+8f6e,U+8f86,U+8f89,U+8fc5,U+8ff0,U+8ffd,U+9014,U+904d,U+90ae,U+9274,U+949f,U+952e,U+969c,U+96c4,U+96e8,U+96f6-96f7,U+97e9,U+987f,U+996d,U+9a7b,U+9aa8,U+9c7c,U+9c9c,U+9e4f,U+9f13,U+9f50"}},{uri:wj,descriptors:{unicodeRange:"U+4e13,U+4e16,U+4e1c,U+4e24,U+4e3e,U+4e49,U+4e61,U+4e66,U+4e89,U+4e8c,U+4e94,U+4e9b,U+4ea4,U+4eac,U+4ebf,U+4eca,U+4ef6-4ef7,U+4efb,U+4f18,U+4f20,U+4f46,U+4f7f,U+4fe1,U+503c,U+505a,U+5146,U+5148,U+515a,U+5171,U+5177,U+519b,U+51b3,U+51c6,U+51e0,U+5212,U+521b,U+522b,U+529e,U+52bf,U+534e-534f,U+5355,U+5357,U+5382,U+539f,U+53bb,U+53bf,U+53c2,U+53c8,U+53ca,U+53d6-53d8,U+53e3,U+53ea,U+53f0,U+540d,U+5411,U+56db,U+56de,U+56e0,U+56e2,U+578b,U+57ce,U+57fa,U+589e,U+5904,U+5934,U+5982,U+5b89,U+5b8c,U+5bfc,U+5c06,U+5c11,U+5c40,U+5c71,U+5e38,U+5e72,U+5e76,U+5e7f,U+5e94,U+5e9c,U+5f0f,U+5f15,U+5f20,U+5f3a,U+5f62,U+5f88,U+5fc5,U+5fd7,U+5feb,U+601d,U+6027,U+60c5,U+60f3,U+610f,U+6216,U+6218,U+624b,U+624d,U+6279,U+628a,U+6295,U+6301,U+6307,U+636e,U+63a5,U+63a8,U+652f,U+6536,U+653e,U+6548,U+6559,U+6570,U+65bd,U+65e0,U+6602,U+660e,U+6613,U+66f4,U+6700,U+670d,U+671f,U+672f,U+6743,U+674e,U+6751,U+6761,U+6784,U+6797,U+679c,U+67e5,U+6807,U+6837,U+683c,U+6b21,U+6b63-6b65,U+6bcf,U+6bd4,U+6c42,U+6c5f,U+6ca1,U+6cbb,U+6d3b,U+6d41,U+6d88,U+6df1,U+70b9,U+7136,U+7269,U+7279,U+7531,U+754c,U+767e,U+76ca,U+76f8,U+770b,U+7740,U+7814,U+79ef,U+7a0b,U+7a0e,U+7a76,U+7b80,U+7cbe,U+7cfb,U+7e41,U+7ea7,U+7ec4,U+7ec7,U+7ed3,U+7ed9,U+7edf,U+7f8e,U+8001,U+804c,U+8054,U+80b2,U+81f3,U+8425,U+8868,U+88ab,U+897f,U+89c1-89c2,U+89c4,U+89c6,U+89e3,U+8ba1,U+8ba4,U+8bae,U+8bb0,U+8bba,U+8bc1,U+8c03,U+8d28,U+8d39,U+8def,U+8f66,U+8f6c,U+8fd0-8fd1,U+9020,U+9053,U+90a3,U+90fd,U+91cc,U+9500,U+9547,U+95e8,U+95f4,U+961f,U+9645,U+9662,U+96be,U+96c6,U+9700,U+9769,U+97e6,U+9875,U+9879,U+9886,U+9898,U+98ce,U+9996,U+2b5af,U+2cc56,U+2e9f5,U+30edd-30ede"}},{uri:Ej,descriptors:{unicodeRange:"U+4e03,U+4e30,U+4e34,U+4e45,U+4e60,U+4e70,U+4e88,U+4e91-4e92,U+4ea9,U+4eb2,U+4ec0,U+4ecb,U+4ecd,U+4ee4,U+4fee,U+5019,U+5047,U+50cf,U+5145,U+516d,U+5170,U+5175,U+5199,U+51cf,U+51fb,U+521a,U+5224,U+5267,U+52aa,U+5347-5348,U+534a,U+5356,U+5361,U+536b,U+5370,U+538b,U+53e4,U+53e6,U+5403,U+5426,U+5428,U+542c,U+5438,U+5668,U+56ed,U+56f4,U+56fe,U+57df,U+592a,U+5957,U+5b69,U+5b81,U+5b8f,U+5b98,U+5b9d,U+5ba1,U+5ba4,U+5bb3,U+5bc6,U+5bdf,U+5c3d,U+5c5e,U+5c81,U+5ddd,U+5de8,U+5dee,U+5e0c,U+5e86,U+5e8f,U+5e93,U+5e95,U+5e97,U+5ea7,U+5ead,U+5eb7,U+5f55,U+5f81,U+5f85,U+5ff5,U+6001,U+613f,U+6258,U+6267,U+6269,U+626c,U+627e,U+62db,U+62ec,U+6325,U+635f,U+6362,U+6388,U+6392,U+63a2,U+63a7,U+63aa,U+641e,U+6545,U+6597,U+65e2,U+65e9,U+661f,U+665a,U+666e-666f,U+66fe,U+6728,U+67d0,U+6811,U+6838,U+6865,U+697c,U+6b22,U+6b27,U+6b4c,U+6b62,U+6b66,U+6b7b,U+6bdb,U+6c47,U+6c49,U+6c7d,U+6c99,U+6cfd,U+6d0b,U+6d25,U+6d32,U+6d3e,U+6d4b,U+6e29,U+6e56,U+6e7e,U+6f14,U+6fc0,U+706b,U+70c8,U+7247,U+72af,U+72b6,U+72ec,U+732e,U+73ed,U+7403,U+7533,U+753b,U+7559,U+7565,U+7597,U+767b,U+773c,U+7763,U+77ed,U+77ff,U+7968,U+798f,U+79bb,U+79c0-79c1,U+7ad9,U+7ae0,U+7b51,U+7b7e,U+7cae,U+7d22,U+7ea2,U+7eb3,U+7eb7,U+7ec3,U+7ec8,U+7ecd,U+7edd,U+7efc,U+7f16,U+7f3a,U+7f51,U+7f57,U+7f6e,U+80dc,U+822a,U+8239,U+826f,U+82cf,U+82e6,U+8349,U+8363,U+83dc,U+8457,U+85cf,U+878d,U+8865,U+8a00,U+8b66,U+8ba2,U+8ba8,U+8bad,U+8bb2,U+8bc9,U+8bd5,U+8bfb,U+8d2b,U+8d35,U+8d37,U+8f7b,U+8f93,U+8fce,U+8fdd,U+9000-9002,U+9010,U+9047,U+9093,U+9152,U+9488,U+94a2,U+9633,U+9636,U+963f,U+9646,U+9648,U+964d,U+9664,U+9669,U+9760,U+97f3,U+987a,U+987e,U+9884,U+98de,U+9986,U+9ed1"}},{uri:Sj,descriptors:{unicodeRange:"U+4e14,U+4e25,U+4e48,U+4e50,U+4e5d,U+4e9a,U+4ec5,U+4efd,U+4f17,U+4f4e-4f4f,U+4f55,U+4f59,U+4f60,U+4f8b,U+4f9b,U+4f9d,U+4fbf,U+4fc3,U+5065,U+513f,U+5149,U+514b,U+516b,U+5174,U+517b,U+518d,U+51b5,U+5207,U+5217-5219,U+521d,U+526f,U+529f,U+52a9,U+52b3,U+5305,U+533b,U+5343,U+5360,U+5373-5374,U+5386,U+53cb-53cd,U+53f2,U+53f7,U+544a,U+5468,U+547d,U+54cd,U+552e,U+5584,U+56f0,U+571f,U+5747,U+575a,U+57f9,U+5883,U+58eb,U+58f0,U+5907,U+590d,U+592e,U+5931,U+5956,U+5965,U+5973,U+5979,U+59cb,U+5b57-5b58,U+5b83,U+5ba2-5ba3,U+5bb9,U+5bcc,U+5c42,U+5c45,U+5c4a,U+5dde,U+5df1,U+5df4,U+5e03,U+5e08,U+5e26,U+5e2d,U+5f71,U+5f80,U+5f8b,U+5fb7,U+606f,U+611f,U+6237,U+623f,U+6253,U+627f,U+6293,U+62a4,U+62c5,U+62c9,U+6309,U+6574,U+6599,U+65ad,U+65af,U+65c5,U+65cf,U+6625,U+663e,U+671b,U+672a,U+6750,U+6781,U+6821,U+6839,U+6848,U+68c0,U+6a21,U+6b3e,U+6bb5,U+6c14,U+6cb3,U+6cb9,U+6ce8,U+6e05,U+6e2f,U+6e38,U+6e90,U+6ee1,U+70ed,U+7167,U+7231,U+7248,U+724c,U+7387,U+738b,U+73af,U+7530,U+75c5,U+767d,U+76d1,U+76f4,U+771f,U+77e5,U+77f3,U+7834,U+7840,U+786e,U+793a,U+795e,U+79f0,U+7a33,U+7a7a,U+7a81,U+7ade,U+7b56,U+7b97,U+7c73,U+7c7b,U+7d20,U+7d27,U+7ea6,U+7eaa,U+7ebf,U+7ee7,U+7eed,U+7ef4,U+7fa4,U+8003,U+80a1,U+81f4,U+8272,U+827a,U+8282,U+82b1,U+82f1,U+8303,U+836f,U+83b7,U+843d,U+88c5,U+8ba9,U+8baf,U+8bb8,U+8bbf,U+8bc4,U+8bc6,U+8bdd,U+8be5,U+8bf7,U+8c08,U+8c61,U+8d1f,U+8d22-8d23,U+8d27,U+8d2d,U+8d38,U+8d5b,U+8d70,U+8d85,U+8d8a,U+8db3,U+8eab,U+8f83,U+8fb9,U+8fdc,U+8fde,U+9009,U+901f,U+914d,U+91c7,U+94b1,U+94c1,U+94f6,U+95fb,U+9632,U+9650,U+968f,U+9752,U+975e,U+987b,U+989d,U+98df,U+9999,U+9a6c,U+9a8c,U+9ec4,U+9feb-9fec"}},{uri:kj,descriptors:{unicodeRange:"U+98fb-990c,U+990e-990f,U+9911-992d,U+992f-9953,U+9956-9962,U+9964,U+9966,U+9973,U+9978-9979,U+997b,U+997e,U+9982-9983,U+9989,U+998c,U+998e,U+999a-99a4,U+99a6-99a7,U+99a9-99c8"}},{uri:Mj,descriptors:{unicodeRange:"U+8e4c-8e50,U+8e53-8e58,U+8e5a-8e65,U+8e67-8e68,U+8e6a-8e6b,U+8e6e,U+8e71,U+8e73,U+8e75,U+8e77-8e7b,U+8e7d-8e7e,U+8e80,U+8e82-8e84,U+8e86,U+8e88-8e8e,U+8e91-8e93,U+8e95-8e9b,U+8e9d,U+8e9f-8eaa,U+8ead-8eae,U+8eb0-8eb1,U+8eb3-8eb9,U+8ebb-8ecd,U+8ecf-8f02"}},{uri:Cj,descriptors:{unicodeRange:"U+2e3a,U+3001-3002,U+3008-3011,U+3014-3017,U+301d-301f,U+4dae,U+4e00,U+4e07,U+4e09-4e0b,U+4e0d-4e0e,U+4e1a,U+4e2a,U+4e2d,U+4e3a-4e3b,U+4e4b,U+4e5f,U+4e86,U+4e8b,U+4e8e,U+4ea7,U+4eba,U+4ece,U+4ed1,U+4ed6,U+4ee3,U+4ee5,U+4eec,U+4f01,U+4f1a,U+4f4d,U+4f53,U+4f5c,U+4fdd,U+5143,U+5165,U+5168,U+516c,U+5173,U+5176,U+5185,U+519c,U+51fa,U+5206,U+5229,U+5230,U+5236,U+524d,U+529b,U+52a0-52a1,U+52a8,U+5316-5317,U+533a,U+5341,U+5362,U+53d1,U+53ef,U+53f8,U+5404,U+5408,U+540c,U+540e,U+5458,U+548c,U+54c1,U+54e5,U+5546,U+559c,U+56fd,U+5728,U+5730,U+573a,U+5916,U+591a,U+5927,U+5929,U+592b,U+597d,U+59d4,U+5b50,U+5b66,U+5b9a,U+5b9e,U+5bb6,U+5bf9,U+5c0f,U+5c14,U+5c31,U+5c55,U+5de5,U+5df2,U+5e02,U+5e73-5e74,U+5ea6,U+5efa,U+5f00,U+5f53,U+5f97,U+5fc3,U+603b,U+6210-6211,U+6240,U+6280,U+62a5,U+63d0,U+6539,U+653f,U+6587,U+65b0,U+65b9,U+65e5,U+65f6,U+662f,U+6708-6709,U+672c,U+673a,U+675c,U+6765,U+6c11,U+6c34,U+6cd5,U+6ce2,U+6d4e,U+6d77,U+73b0,U+7406,U+751f,U+7528,U+7535,U+7684,U+76ee,U+793e,U+79cd,U+79d1,U+7acb,U+7b2c,U+7b49,U+7ba1,U+7ecf,U+8005,U+800c,U+80fd,U+81ea,U+884c,U+8981,U+8bbe,U+8bf4,U+8d44,U+8d77,U+8fbe,U+8fc7,U+8fd8-8fd9,U+8fdb,U+901a,U+90e8,U+91cd,U+91cf,U+91d1,U+9485,U+957f,U+95ee,U+9762,U+9ad8,U+9ea6,U+9f99,U+9fcf,U+9fd4,U+9fed,U+fe10-fe19,U+fe30-fe31,U+fe33-fe44,U+ff01,U+ff0c,U+ff1f,U+2b4e7,U+2b7f7,U+2b7fc,U+2cb2d,U+2cb3b,U+2cb4a,U+2cb5b,U+2cb73"}},{uri:Ij,descriptors:{unicodeRange:"U+6490,U+6493-6494,U+6497-6498,U+649a-649d,U+649f-64a3,U+64a5-64a8,U+64aa-64ab,U+64af,U+64b1-64b4,U+64b6,U+64b9,U+64bb,U+64bd-64bf,U+64c1,U+64c3-64c4,U+64c6-64cc,U+64cf,U+64d1,U+64d3-64d6,U+64d9-64dd,U+64df-64e1,U+64e3,U+64e5,U+64e7-64ff,U+6501-6508,U+650a-6511,U+6513-6517,U+6519-6524,U+6526-652a,U+652c-652d,U+6530-6533,U+6537,U+653a,U+653c-653d,U+6540-6544,U+6546-6547,U+654a-654b,U+654d-654e,U+6550,U+6552-6554,U+6557-6558,U+655a,U+655c,U+655f-6561,U+6564-6565,U+6567-6568"}},{uri:_j,descriptors:{unicodeRange:"U+9695-9696,U+969a-969b,U+969d-96a6,U+96a8-96af,U+96b1-96b2,U+96b4-96b5,U+96b7-96b8,U+96ba-96bb,U+96bf,U+96c2-96c3,U+96c8,U+96ca-96cb,U+96d0-96d1,U+96d3-96d4,U+96d6-96df,U+96e1-96e7,U+96eb-96ee,U+96f0-96f2,U+96f4-96f5,U+96f8,U+96fa-96fd,U+96ff,U+9702-9703,U+9705,U+970a-970c,U+9710-9712,U+9714-9715,U+9717-971b,U+971d,U+971f-9729,U+972b-972c,U+972e-972f,U+9731,U+9733-9737,U+973a-973d,U+973f-9751,U+9754-9755,U+9757-9758,U+975a,U+975c-975d,U+975f,U+9763-9764,U+9766-9768,U+976a-9770"}},{uri:Tj,descriptors:{unicodeRange:"U+6af0-6b1f,U+6b25-6b26,U+6b28-6b31,U+6b33-6b36,U+6b38,U+6b3b-6b3d,U+6b3f-6b42,U+6b44-6b45,U+6b48,U+6b4a-6b4b,U+6b4d-6b58,U+6b5a-6b61,U+6b68-6b69,U+6b6b-6b78,U+6b7a,U+6b7d-6b80,U+6b85,U+6b88,U+6b8c,U+6b8e-6b91,U+6b94-6b95,U+6b97-6b99,U+6b9c-6ba0,U+6ba2-6ba9,U+6bab-6bb2,U+6bb6,U+6bb8-6bba"}},{uri:jj,descriptors:{unicodeRange:"U+430e-439a,U+29e8a,U+29ec4,U+29edb,U+29ee9,U+29f7e,U+29f83,U+29f8c,U+29fce,U+2a01a,U+2a02f,U+2a082,U+2a0f9,U+2a190,U+2a38c"}},{uri:Aj,descriptors:{unicodeRange:"U+92ef-933d,U+933f-9369,U+936b-9388"}},{uri:Dj,descriptors:{unicodeRange:"U+4512-458d,U+2b300,U+2b363,U+2b36f,U+2b372,U+2b37d,U+2b404,U+2b410,U+2b413,U+2b461,U+2b4ef,U+2b4f6,U+2b4f9,U+2b50d-2b50e,U+2b536,U+2b5ae,U+2b5b3,U+2b5e7,U+2b5f4,U+2b61c-2b61d,U+2b626-2b628,U+2b62a,U+2b62c,U+2b695-2b696,U+2b6ad,U+2b6ed"}},{uri:Lj,descriptors:{unicodeRange:"U+88bd-88c0,U+88c3-88c4,U+88c7-88c8,U+88ca-88cd,U+88cf-88d1,U+88d3,U+88d6-88d7,U+88da-88de,U+88e0-88e1,U+88e6-88e7,U+88e9-88ef,U+88f2,U+88f5-88f7,U+88fa-88fb,U+88fd,U+88ff-8901,U+8903-8909,U+890b-890f,U+8911,U+8914-8918,U+891c-8920,U+8922-8924,U+8926-8929,U+892c-892f,U+8931-8933,U+8935,U+8937-8940,U+8942-8943,U+8945-895d,U+8960-8965,U+8967-897a,U+897c-897e,U+8980,U+8982,U+8984-8985"}},{uri:Rj,descriptors:{unicodeRange:"U+4b0b-4ba0"}},{uri:Pj,descriptors:{unicodeRange:"U+7179,U+717b-717c,U+717e-7183,U+7185-7189,U+718b-718e,U+7190-7193,U+7195-7197,U+719a-719e,U+71a1-71a7,U+71a9-71ab,U+71ad-71b2,U+71b4,U+71b6-71b8,U+71ba-71c2,U+71c4-71cd,U+71cf-71d3,U+71d6-71df,U+71e1-71e4,U+71e6,U+71e8-71ed,U+71ef-71f8,U+71fa-7205,U+7207-721c,U+721e-7227,U+7229,U+722b,U+722d"}},{uri:Nj,descriptors:{unicodeRange:"U+982e-9874,U+988b,U+988e,U+9892,U+9895,U+9899,U+98a3,U+98a8-98cd,U+98cf-98d0,U+98d4,U+98d6-98d7,U+98db-98dd,U+98e0-98e6,U+98e9-98fa"}},{uri:Oj,descriptors:{unicodeRange:"U+7c14-7c15,U+7c17-7c1e,U+7c20-7c25,U+7c28-7c29,U+7c2b-7c37,U+7c39-7c3e,U+7c42-7c4c,U+7c4e-7c72,U+7c75-7c7a,U+7c7e-7c88,U+7c8a-7c90,U+7c93-7c94,U+7c96,U+7c99-7c9b,U+7ca0-7ca1,U+7ca3,U+7ca6-7ca9,U+7cab-7cad,U+7caf-7cb0,U+7cb4-7cb8,U+7cba-7cbb,U+7cbf-7cc0,U+7cc2-7cc4,U+7cc6,U+7cc9,U+7ccb,U+7cce-7cd4"}},{uri:$j,descriptors:{unicodeRange:"U+7d95-7da5,U+7da7-7dad,U+7daf-7e2a"}},{uri:Fj,descriptors:{unicodeRange:"U+4a78-4b0a"}},{uri:zj,descriptors:{unicodeRange:"U+9b30-9b31,U+9b33-9b3a,U+9b3d-9b40,U+9b46,U+9b4a-9b4c,U+9b4e,U+9b50,U+9b52-9b53,U+9b55-9bcf"}},{uri:Bj,descriptors:{unicodeRange:"U+6a4b-6a4f,U+6a51-6a57,U+6a5a,U+6a5c-6a60,U+6a62-6a64,U+6a66-6a70,U+6a72-6a78,U+6a7a-6a7b,U+6a7d-6a7f,U+6a81-6a83,U+6a85-6a8d,U+6a8f,U+6a92-6a96,U+6a98-6a9f,U+6aa1-6aa8,U+6aaa,U+6aad-6aef"}},{uri:Hj,descriptors:{unicodeRange:"U+99c9-9a53"}},{uri:Xj,descriptors:{unicodeRange:"U+8550-8555,U+8557-8558,U+855a-855d,U+855f-8563,U+8565-8567,U+8569-8571,U+8573,U+8575-8578,U+857c-857d,U+857f-8583,U+8586,U+8588-858e,U+8590-859a,U+859d-85a3,U+85a5-85a7,U+85a9,U+85ab-85ad,U+85b1-85b6,U+85b8,U+85ba-85c0,U+85c2-85c8,U+85ca-85ce,U+85d1-85d2,U+85d4,U+85d6-85db,U+85dd-85e3,U+85e5-85e8,U+85ea-85fa,U+85fc-85fe,U+8600-8603"}},{uri:Wj,descriptors:{unicodeRange:"U+6fb2,U+6fb4-6fb5,U+6fb7-6fb8,U+6fba-6fbf,U+6fc1,U+6fc3-6fc8,U+6fca-6fd0,U+6fd3-6fdd,U+6fdf,U+6fe2-6fed,U+6ff0-7010,U+7012-7019,U+701c-7022,U+7024-7034,U+7036-7038,U+703a-704b,U+704d-704e,U+7050-7053"}},{uri:Vj,descriptors:{unicodeRange:"U+4ba1-4c2c"}},{uri:Gj,descriptors:{unicodeRange:"U+9a54-9a6b,U+9a72,U+9a83,U+9a89,U+9a8d-9a8e,U+9a94-9a95,U+9a99,U+9aa6,U+9aa9-9aaf,U+9ab2-9ab5,U+9ab9,U+9abb,U+9abd-9abf,U+9ac3-9ac4,U+9ac6-9aca,U+9acd-9ad0,U+9ad2,U+9ad4-9ad7,U+9ad9-9ade,U+9ae0,U+9ae2-9ae5,U+9ae7-9aea,U+9aec,U+9aee,U+9af0-9af8,U+9afa,U+9afc-9b02,U+9b04-9b07,U+9b09-9b0e,U+9b10-9b12,U+9b14-9b1e,U+9b20-9b22,U+9b24-9b2e"}},{uri:Zj,descriptors:{unicodeRange:"U+9d1a-9da1"}},{uri:Yj,descriptors:{unicodeRange:"U+9e13-9e1e,U+9e24,U+9e27,U+9e2e,U+9e30,U+9e34,U+9e3b-9e3c,U+9e40,U+9e4d,U+9e50,U+9e52-9e54,U+9e56,U+9e59,U+9e5d,U+9e5f-9e62,U+9e65,U+9e6e-9e6f,U+9e72,U+9e74-9e7d,U+9e80-9e81,U+9e83-9e86,U+9e89-9e8a,U+9e8c-9e91,U+9e94-9e9c,U+9e9e,U+9ea0-9ea5,U+9ea7-9eb3,U+9eb5-9eb7,U+9eb9-9eba,U+9ebc,U+9ebf-9ec3,U+9ec5-9ec8,U+9eca-9ecc,U+9ed0,U+9ed2-9ed3,U+9ed5-9ed7,U+9ed9-9eda,U+9ede,U+9ee1,U+9ee3-9ee4,U+9ee6,U+9ee8,U+9eeb-9eee,U+9ef0-9ef8"}},{uri:Kj,descriptors:{unicodeRange:"U+8b1c-8b25,U+8b27-8b65,U+8b67-8b6b,U+8b6d-8b9f,U+8bac,U+8bb1,U+8bbb,U+8bc7,U+8bd0"}},{uri:qj,descriptors:{unicodeRange:"U+4cad-4d2f"}},{uri:Jj,descriptors:{unicodeRange:"U+9c4b-9c7b,U+9c7d-9c7e,U+9c80,U+9c83-9c84,U+9c89-9c8a,U+9c8c,U+9c8f,U+9c93,U+9c96-9c99,U+9c9d,U+9caa,U+9cac,U+9caf,U+9cb9,U+9cbe-9cc2,U+9cc8-9cc9,U+9cd1-9cd2,U+9cda-9cdb,U+9ce0-9ce1,U+9ce3-9d19"}},{uri:Qj,descriptors:{unicodeRange:"U+9389-938e,U+9390-93c9,U+93cb-93d5,U+93d7-9410"}},{uri:eA,descriptors:{unicodeRange:"U+20a0-20b5,U+20b9-20ba,U+20bc-20bd,U+4e2c,U+5107,U+5216,U+5293,U+54f3,U+5523,U+5819,U+5adc,U+5c88,U+5e3b,U+5fee,U+62f6,U+63be,U+6484,U+6499,U+67d9,U+67dd,U+6d5e,U+6f46,U+717a,U+71e0,U+72c1,U+73e7,U+75b0,U+7603,U+7722,U+7809,U+7811,U+7946,U+7967,U+799a,U+7b45,U+7ba2,U+8014,U+80d9,U+8159,U+817d,U+81a3,U+81aa,U+8201,U+833c,U+836e,U+83e5,U+8459,U+84f0,U+8729,U+8753,U+87d3,U+89dc,U+8bf6,U+8c2e,U+8e2c,U+8e9c,U+8e9e,U+8ece,U+8fee,U+9139,U+914f,U+9174,U+9191,U+960c,U+9622,U+9a98,U+9b48,U+9ca6,U+9cb0,U+9da2-9e12,U+9e88,U+9f44,U+9f86"}},{uri:tA,descriptors:{unicodeRange:"U+9bd0-9c4a"}},{uri:nA,descriptors:{unicodeRange:"U+4c2d-4cac"}},{uri:aA,descriptors:{unicodeRange:"U+4d30-4dab"}},{uri:iA,descriptors:{unicodeRange:"U+9411-943d,U+943f-946a,U+946c-9484"}},{uri:rA,descriptors:{unicodeRange:"U+9efa,U+9efd,U+9eff-9f0a,U+9f0c,U+9f0f,U+9f11-9f12,U+9f14-9f16,U+9f18,U+9f1a-9f1f,U+9f21,U+9f23-9f2b,U+9f2d-9f2e,U+9f30-9f36,U+9f38,U+9f3a,U+9f3c,U+9f3f-9f43,U+9f45-9f4f,U+9f52-9f7e,U+9f81-9f82,U+9f8d-9f94"}},{uri:sA,descriptors:{unicodeRange:"U+7e2b-7e3a,U+7e3c-7e40,U+7e42-7e46,U+7e48-7e81,U+7e83-7e9a,U+7e9c-7e9e,U+7eae,U+7eb4,U+7ebb-7ebc,U+7ed6,U+7ee4,U+7eec,U+7ef9,U+7f0a,U+7f10,U+7f1e,U+7f37,U+7f39,U+7f3b"}}],ki=class We{constructor(t){j(this,"scene"),j(this,"getSceneFamilies",()=>We.getUniqueFamilies(this.scene.getNonDeletedElements())),j(this,"onLoaded",n=>{let a=!0;for(let s of n){let o=`${s.family}-${s.style}-${s.weight}-${s.unicodeRange}`;We.loadedFontsCache.has(o)||(We.loadedFontsCache.add(o),a=!1)}if(a)return;let i=!1,r=this.scene.getNonDeletedElementsMap();for(let s of this.scene.getNonDeletedElements())if(q(s)){i=!0,ut.delete(s),Do.clearCache(Xe(s));let o=zt(s,r);o&&ut.delete(o)}i&&this.scene.triggerUpdate()}),j(this,"loadSceneFonts",async()=>{let n=this.getSceneFamilies(),a=We.getCharsPerFamily(this.scene.getNonDeletedElements());return We.loadFontFaces(n,a)}),this.scene=t}static get registered(){return We._registered?We._initialized||(We._registered=new Map([...We.init().entries(),...We._registered.entries()])):We._registered=We.init(),We._registered}get registered(){return We.registered}static async generateFontFaceDeclarations(t){let n=We.getUniqueFamilies(t),a=We.getCharsPerFamily(t),i=n.find(d=>x5(d).includes(ds));if(i){let d=We.getCharacters(a,i);if(_k(d)){let c=cs[ds];a[c]=new Set(d),n.unshift(cs[ds])}}let r=We.fontFacesStylesGenerator(n,a),s=3,o=await new QU(r,s).all();return Array.from(new Set(o))}static async loadFontFaces(t,n){for(let{fontFaces:r,metadata:s}of We.registered.values())if(!s.local)for(let{fontFace:o}of r)window.document.fonts.has(o)||window.document.fonts.add(o);let a=We.fontFacesLoader(t,n),i=10;return(await new QU(a,i).all()).flat().filter(Boolean)}static*fontFacesLoader(t,n){for(let[a,i]of t.entries()){let r=Xe({fontFamily:i,fontSize:16}),s=We.getCharacters(n,i);window.document.fonts.check(r,s)||(yield Xi(async()=>{try{let o=await window.document.fonts.load(r,s);return[a,o]}catch(o){console.error(`Failed to load font "${r}" from urls "${We.registered.get(i)?.fontFaces.map(d=>d.urls)}"`,o)}}))}}static*fontFacesStylesGenerator(t,n){for(let[a,i]of t.entries()){let{fontFaces:r,metadata:s}=We.registered.get(i)??{};if(!Array.isArray(r)){console.error(`Couldn't find registered fonts for font-family "${i}"`,We.registered);continue}if(!s?.local)for(let[o,d]of r.entries())yield Xi(async()=>{try{let c=We.getCharacters(n,i),l=await d.toCSS(c);return l?[a*1e4+o,l]:void 0}catch(c){console.error(`Couldn't transform font-face to css for family "${d.fontFace.family}"`,c)}})}}static register(t,n,...a){let i=it[t]??cs[t];return this.registered.get(i)||this.registered.set(i,{metadata:n,fontFaces:a.map(({uri:r,descriptors:s})=>new NC(t,r,s))}),this.registered}static init(){let t={registered:new Map},n=(a,...i)=>{let r=it[a]??cs[a],s=Uc[r]??Uc[it.Excalifont];We.register.call(t,a,s,...i)};return n("Cascadia",...$C),n("Comic Shanns",...XC),n("Excalifont",...QC),n("Helvetica",...eI),n("Liberation Sans",...nI),n("Lilita One",...rI),n("Nunito",...uI),n("Virgil",...fI),n(ds,...lA),n(io,...WC),We._initialized=!0,t.registered}static getUniqueFamilies(t){return Array.from(t.reduce((n,a)=>(q(a)&&n.add(a.fontFamily),n),new Set))}static getCharsPerFamily(t){let n={};for(let a of t)if(q(a))for(let i of a.originalText)n[a.fontFamily]||(n[a.fontFamily]=new Set),n[a.fontFamily].add(i);return n}static getCharacters(t,n){return t[n]?Array.from(t[n]).join(""):""}static getAllFamilies(){return Array.from(We.registered.keys())}};j(ki,"loadedFontsCache",new Set),j(ki,"_registered"),j(ki,"_initialized",!1),j(ki,"loadElementsFonts",async e=>{let t=ki.getUniqueFamilies(e),n=ki.getCharsPerFamily(e);return ki.loadFontFaces(t,n)});var ni=ki,mb=(e,t,n)=>{let{unitsPerEm:a,ascender:i,descender:r}=ni.registered.get(e)?.metadata.metrics||Uc[it.Virgil].metrics,s=t/a,o=(n-s*i+s*r)/2;return s*i+o},Nr=e=>{let{lineHeight:t}=ni.registered.get(e)?.metadata.metrics||Uc[it.Excalifont].metrics;return t},gb=e=>{let{angle:t,width:n,height:a,x:i,y:r}=e,s=i+n/2,o=r+a/2,d=E(s,o),c;return e.type==="diamond"?c=ZU(z(E(s,r),d,t),z(E(i+n,o),d,t),z(E(s,r+a),d,t),z(E(i,o),d,t)):c=ZU(z(E(i,r),d,t),z(E(i+n,r),d,t),z(E(i+n,r+a),d,t),z(E(i,r+a),d,t)),{type:"polygon",data:c}},oA=(e,t,n=10)=>{let[a,i,r,s,o,d]=fe(e,t,!0);a-=n,r+=n,i-=n,s+=n;let c=E(o,d),l=z(E(a,i),c,e.angle),u=z(E(r,i),c,e.angle),f=z(E(a,s),c,e.angle),p=z(E(r,s),c,e.angle);return{type:"polygon",data:[l,u,p,f]}},dA=e=>{let{width:t,height:n,angle:a,x:i,y:r}=e;return{type:"ellipse",data:{center:E(i+t/2,r+n/2),angle:a,halfWidth:t/2,halfHeight:n/2}}},Ji=e=>{if(!e)return[];for(let t of e.sets)if(t.type==="path")return t.ops;return e.sets[0].ops},cA=(e,t=E(0,0),n,a)=>{let i=d=>z(E(d[0]+t[0],d[1]+t[1]),a,n),r=Ji(e),s=[],o=E(0,0);for(let d of r){if(d.op==="move"){let c=P1(d.data);tn(c!=null,"Ops data is not a point"),o=i(c)}if(d.op==="bcurveTo"){let c=i(E(d.data[0],d.data[1])),l=i(E(d.data[2],d.data[3])),u=i(E(d.data[4],d.data[5]));s.push(Ja(o,c,l,u)),o=u}}return{type:"polycurve",data:s}},uA=e=>{let t=e[0],n=[];for(let a=1;a<e.length;a++){let i=e[a];n.push(re(t,i)),t=i}return n},hA=(e,t,n=!1)=>{let a=r=>z(ke(Li(ie(r),Ht(e.x,e.y))),t,e.angle),i=uA(e.points.map(r=>a(r)));return n?{type:"polygon",data:cc(i.flat())}:{type:"polyline",data:i}},fA=(e,t,n=E(0,0),a,i)=>{let r=l=>z(E(l[0]+n[0],l[1]+n[1]),i,a);if(e.roundness===null)return{type:"polygon",data:cc(e.points.map(l=>r(l)))};let s=Ji(t),o=[],d=!1;for(let l of s)l.op==="move"?(d=!d,d&&o.push(E(l.data[0],l.data[1]))):l.op==="bcurveTo"?d&&(o.push(E(l.data[0],l.data[1])),o.push(E(l.data[2],l.data[3])),o.push(E(l.data[4],l.data[5]))):l.op==="lineTo"&&d&&o.push(E(l.data[0],l.data[1]));let c=JE(o,10,5).map(l=>r(l));return{type:"polygon",data:cc(c)}},pA=(e,t)=>{let{angle:n,halfWidth:a,halfHeight:i,center:r}=t,s=a,o=i,d=Li(ie(e),Ut(ie(r),-1)),[c,l]=z(ke(d),E(0,0),-n),u=Math.abs(c),f=Math.abs(l),p=.707,U=.707;for(let b=0;b<3;b++){let v=s*p,x=o*U,y=(s*s-o*o)*p**3/s,w=(o*o-s*s)*U**3/o,k=v-y,M=x-w,I=u-y,A=f-w,_=Math.hypot(M,k),T=Math.hypot(A,I);p=Math.min(1,Math.max(0,(I*_/T+y)/s)),U=Math.min(1,Math.max(0,(A*_/T+w)/o));let L=Math.hypot(U,p);p/=L,U/=L}let[m,g]=[s*p*Math.sign(c),o*U*Math.sign(l)];return Pe(E(c,l),E(m,g))},UA=(e,t,n=1e-4)=>pA(e,t)<=n,mA=(e,t)=>{let{center:n,angle:a,halfWidth:i,halfHeight:r}=t,s=Li(ie(e),Ut(ie(n),-1)),[o,d]=z(ke(s),E(0,0),-a);return o/i*(o/i)+d/r*(d/r)<=1},Mf=(e,t,n=0)=>{switch(t.type){case"polygon":return QS(e,t.data,n);case"ellipse":return UA(e,t.data,n);case"line":return Ar(e,t.data,n);case"polyline":return xb(e,t.data,n);case"curve":return bb(e,t.data,n);case"polycurve":return gA(e,t.data,n);default:throw Error(`shape ${t} is not implemented`)}},mc=(e,t)=>{switch(t.type){case"polygon":return YU(e,t.data);case"line":return!1;case"curve":return!1;case"ellipse":return mA(e,t.data);case"polyline":{let n=cc(t.data.flat());return YU(e,n)}case"polycurve":return!1;default:throw Error(`shape ${t} is not implemented`)}},gA=(e,t,n)=>t.some(a=>bb(e,a,n)),bA=e=>{let[t,n,a,i]=e;return(r,s)=>Math.pow(1-r,3)*i[s]+3*r*Math.pow(1-r,2)*a[s]+3*Math.pow(r,2)*(1-r)*n[s]+t[s]*Math.pow(r,3)},xA=(e,t=10)=>{let n=bA(e),a=[n(0,0),n(0,1)],i=[],r=0,s=1/t;for(let o=0;o<t;o++)if(r+=s,r<=1){let d=E(n(r,0),n(r,1));i.push(re(a,d)),a=d}return i},bb=(e,t,n)=>xb(e,xA(t),n),xb=(e,t,n=1e-4)=>t.some(a=>Ar(e,a,n));function vb(e,t,n){return{center:e,halfWidth:t,halfHeight:n}}var vA=(e,t)=>{let{halfWidth:n,halfHeight:a,center:i}=t,r=n,s=a,o=Li(ie(e),Ut(ie(i),-1)),d=Math.abs(o[0]),c=Math.abs(o[1]),l=.707,u=.707;for(let U=0;U<3;U++){let m=r*l,g=s*u,b=(r*r-s*s)*l**3/r,v=(s*s-r*r)*u**3/s,x=m-b,y=g-v,w=d-b,k=c-v,M=Math.hypot(y,x),I=Math.hypot(k,w);l=Math.min(1,Math.max(0,(w*M/I+b)/r)),u=Math.min(1,Math.max(0,(k*M/I+v)/s));let A=Math.hypot(u,l);l/=A,u/=A}let[f,p]=[r*l*Math.sign(o[0]),s*u*Math.sign(o[1])];return Pe(ke(o),E(f,p))};function yA({center:e,halfWidth:t,halfHeight:n},[a,i]){let[r,s]=e,o=a[0]-r,d=a[1]-s,c=i[0]-r,l=i[1]-s,u=Math.pow(c-o,2)/Math.pow(t,2)+Math.pow(l-d,2)/Math.pow(n,2),f=2*(o*(c-o)/Math.pow(t,2)+d*(l-d)/Math.pow(n,2)),p=Math.pow(o,2)/Math.pow(t,2)+Math.pow(d,2)/Math.pow(n,2)-1,U=(-f+Math.sqrt(Math.pow(f,2)-4*u*p))/(2*u),m=(-f-Math.sqrt(Math.pow(f,2)-4*u*p))/(2*u),g=[E(o+U*(c-o)+r,d+U*(l-d)+s),E(o+m*(c-o)+r,d+m*(l-d)+s)].filter(b=>!isNaN(b[0])&&!isNaN(b[1]));return g.length===2&&ca(g[0],g[1])?[g[0]]:g}function yb(e,t=0){let n=la(Math.min(e.width,e.height),e);if(n<=0){let u=bf(E(e.x-t,e.y-t),E(e.x+e.width+t,e.y+e.height+t)),f=re(E(u[0][0]+n,u[0][1]),E(u[1][0]-n,u[0][1])),p=re(E(u[1][0],u[0][1]+n),E(u[1][0],u[1][1]-n)),U=re(E(u[0][0]+n,u[1][1]),E(u[1][0]-n,u[1][1])),m=re(E(u[0][0],u[1][1]-n),E(u[0][0],u[0][1]+n));return[[f,p,U,m],[]]}let a=E(e.x+e.width/2,e.y+e.height/2),i=bf(E(e.x,e.y),E(e.x+e.width,e.y+e.height)),r=re(E(i[0][0]+n,i[0][1]),E(i[1][0]-n,i[0][1])),s=re(E(i[1][0],i[0][1]+n),E(i[1][0],i[1][1]-n)),o=re(E(i[0][0]+n,i[1][1]),E(i[1][0]-n,i[1][1])),d=re(E(i[0][0],i[1][1]-n),E(i[0][0],i[0][1]+n)),c=[Ut(Qt(ie(E(i[0][0]-t,i[0][1]-t),a)),t),Ut(Qt(ie(E(i[1][0]+t,i[0][1]-t),a)),t),Ut(Qt(ie(E(i[1][0]+t,i[1][1]+t),a)),t),Ut(Qt(ie(E(i[0][0]-t,i[1][1]+t),a)),t)],l=[Ja(ke(c[0],d[1]),ke(c[0],E(d[1][0]+2/3*(i[0][0]-d[1][0]),d[1][1]+2/3*(i[0][1]-d[1][1]))),ke(c[0],E(r[0][0]+2/3*(i[0][0]-r[0][0]),r[0][1]+2/3*(i[0][1]-r[0][1]))),ke(c[0],r[0])),Ja(ke(c[1],r[1]),ke(c[1],E(r[1][0]+2/3*(i[1][0]-r[1][0]),r[1][1]+2/3*(i[0][1]-r[1][1]))),ke(c[1],E(s[0][0]+2/3*(i[1][0]-s[0][0]),s[0][1]+2/3*(i[0][1]-s[0][1]))),ke(c[1],s[0])),Ja(ke(c[2],s[1]),ke(c[2],E(s[1][0]+2/3*(i[1][0]-s[1][0]),s[1][1]+2/3*(i[1][1]-s[1][1]))),ke(c[2],E(o[1][0]+2/3*(i[1][0]-o[1][0]),o[1][1]+2/3*(i[1][1]-o[1][1]))),ke(c[2],o[1])),Ja(ke(c[3],o[0]),ke(c[3],E(o[0][0]+2/3*(i[0][0]-o[0][0]),o[0][1]+2/3*(i[1][1]-o[0][1]))),ke(c[3],E(d[0][0]+2/3*(i[0][0]-d[0][0]),d[0][1]+2/3*(i[1][1]-d[0][1]))),ke(c[3],d[0]))];return[[re(l[0][3],l[1][0]),re(l[1][3],l[2][0]),re(l[2][3],l[3][0]),re(l[3][3],l[0][0])],l]}function wb(e,t=0){let[n,a,i,r,s,o,d,c]=zb(e),l=la(Math.abs(n-d),e),u=la(Math.abs(r-a),e);if(e.roundness?.type==null){let[x,y,w,k]=[E(e.x+n,e.y+a-t),E(e.x+i+t,e.y+r),E(e.x+s,e.y+o+t),E(e.x+d-t,e.y+c)],M=re(E(x[0]+l,x[1]+u),E(y[0]-l,y[1]-u)),I=re(E(y[0]-l,y[1]+u),E(w[0]+l,w[1]-u)),A=re(E(w[0]-l,w[1]-u),E(k[0]+l,k[1]+u)),_=re(E(k[0]+l,k[1]-u),E(x[0]-l,x[1]+u));return[[M,I,A,_],[]]}let f=E(e.x+e.width/2,e.y+e.height/2),[p,U,m,g]=[E(e.x+n,e.y+a),E(e.x+i,e.y+r),E(e.x+s,e.y+o),E(e.x+d,e.y+c)],b=[Ut(Qt(ie(U,f)),t),Ut(Qt(ie(m,f)),t),Ut(Qt(ie(g,f)),t),Ut(Qt(ie(p,f)),t)],v=[Ja(ke(b[0],E(U[0]-l,U[1]-u)),ke(b[0],U),ke(b[0],U),ke(b[0],E(U[0]-l,U[1]+u))),Ja(ke(b[1],E(m[0]+l,m[1]-u)),ke(b[1],m),ke(b[1],m),ke(b[1],E(m[0]-l,m[1]-u))),Ja(ke(b[2],E(g[0]+l,g[1]+u)),ke(b[2],g),ke(b[2],g),ke(b[2],E(g[0]+l,g[1]-u))),Ja(ke(b[3],E(p[0]-l,p[1]+u)),ke(b[3],p),ke(b[3],p),ke(b[3],E(p[0]+l,p[1]+u)))];return[[re(v[0][3],v[1][0]),re(v[1][3],v[2][0]),re(v[2][3],v[3][0]),re(v[3][3],v[0][0])],v]}var Cf=e=>{if(e.type==="arrow")return!1;let t=!na(e.backgroundColor)||Hn(e)||Ln(e)||q(e);return e.type==="line"||e.type==="freedraw"?t&&si(e.points):t||Re(e)},ls=({x:e,y:t,element:n,shape:a,threshold:i=10,frameNameBound:r=null})=>{let s=Cf(n)&&mc(E(e,t),a)||Mf(E(e,t),a,i);return!s&&r&&(s=mc(E(e,t),{type:"polygon",data:gb(r).data})),s},q1=(e,t,n,a,i=0)=>{let[r,s,o,d]=ha(n,a);return r-=i,s-=i,o+=i,d+=i,I5(E(r,s),E(e,t),E(o,d))},wA=(e,t)=>!ls(e)&&!Eb(e.x,e.y,kb(e.element,t))&&q1(e.x,e.y,e.element,t),Eb=(e,t,n)=>!!n&&mc(E(e,t),n),Sb=(e,t,n=0)=>{switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return EA(e,t,n);case"diamond":return SA(e,t,n);case"ellipse":return kA(e,t,n);default:throw new Error(`Unimplemented element type '${e.type}'`)}},EA=(e,t,n=0)=>{let a=E(e.x+e.width/2,e.y+e.height/2),i=z(t[0],a,-e.angle),r=z(t[1],a,-e.angle),[s,o]=yb(e,n);return[...s.map(d=>lo(re(i,r),d)).filter(d=>d!=null).map(d=>z(d,a,e.angle)),...o.flatMap(d=>_5(d,re(i,r))).filter(d=>d!=null).map(d=>z(d,a,e.angle))].filter((d,c,l)=>l.findIndex(u=>ca(d,u))===c)},SA=(e,t,n=0)=>{let a=E(e.x+e.width/2,e.y+e.height/2),i=z(t[0],a,-e.angle),r=z(t[1],a,-e.angle),[s,o]=wb(e,n);return[...s.map(d=>lo(re(i,r),d)).filter(d=>d!=null).map(d=>z(d,a,e.angle)),...o.flatMap(d=>_5(d,re(i,r))).filter(d=>d!=null).map(d=>z(d,a,e.angle))].filter((d,c,l)=>l.findIndex(u=>ca(d,u))===c)},kA=(e,t,n=0)=>{let a=E(e.x+e.width/2,e.y+e.height/2),i=z(t[0],a,-e.angle),r=z(t[1],a,-e.angle);return yA(vb(a,e.width/2+n,e.height/2+n),gf(i,r)).map(s=>z(s,a,e.angle))},Te={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},D={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:Aa?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SLASH:"/",A:"a",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},MA=new Map([[D.Z,Te.Z],[D.Y,Te.Y]]),CA=e=>/^[a-z]$/.test(e.toLowerCase()),If=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=MA.get(t);return!!(n&&!CA(e.key)&&e.code===n)},wl=e=>e===D.ARROW_LEFT||e===D.ARROW_RIGHT||e===D.ARROW_DOWN||e===D.ARROW_UP,gh=e=>e.altKey,sl=e=>e.shiftKey,Ol=e=>e.shiftKey,J1=[{icon:Vk,value:"selection",key:D.V,numericKey:D[1],fillable:!0},{icon:Gk,value:"rectangle",key:D.R,numericKey:D[2],fillable:!0},{icon:Zk,value:"diamond",key:D.D,numericKey:D[3],fillable:!0},{icon:Yk,value:"ellipse",key:D.O,numericKey:D[4],fillable:!0},{icon:Kk,value:"arrow",key:D.A,numericKey:D[5],fillable:!0},{icon:qk,value:"line",key:D.L,numericKey:D[6],fillable:!0},{icon:oo,value:"freedraw",key:[D.P,D.X],numericKey:D[7],fillable:!1},{icon:Z5,value:"text",key:D.T,numericKey:D[8],fillable:!1},{icon:Qk,value:"image",key:null,numericKey:D[9],fillable:!1},{icon:eM,value:"eraser",key:D.E,numericKey:D[0],fillable:!1}],IA=e=>J1.find((t,n)=>t.numericKey!=null&&e===t.numericKey.toString()||t.key&&(typeof t.key=="string"?t.key===e:t.key.includes(e)))?.value||null,Ka=(e,t)=>{switch(e.type){case"rectangle":case"diamond":case"frame":case"magicframe":case"embeddable":case"image":case"iframe":case"text":case"selection":return gb(e);case"arrow":case"line":{let n=ut.get(e)?.[0]??ut.generateElementShape(e,null)[0],[,,,,a,i]=fe(e,t);return Cf(e)?fA(e,n,E(e.x,e.y),e.angle,E(a,i)):cA(n,E(e.x,e.y),e.angle,E(a,i))}case"ellipse":return dA(e);case"freedraw":{let[,,,,n,a]=fe(e,t);return hA(e,E(n,a),Cf(e))}}},kb=(e,t)=>{let n=ge(e,t);return n?e.type==="arrow"?Ka({...n,...J.getBoundTextElementPosition(e,n,t)},t):Ka(n,t):null},Mb=(e,t)=>{let n=ut.generateElementShape(e,null);if(!n)return null;let a=Ji(n[0]),i=E(0,0),r=0,s=1/0,o=null;for(;r<a.length;){let{op:d,data:c}=a[r];if(d==="move"&&(tn(GS(c),"The returned ops is not compatible with a point"),i=c),d==="bcurveTo"){let l=i,u=E(c[0],c[1]),f=E(c[2],c[3]),p=E(c[4],c[5]),U=Pe(p,t);U<s&&(s=U,o=[l,u,f,p]),i=p}r++}return o},Cb=(e,t,n,a,i)=>{let r=(d,c)=>Math.pow(1-d,3)*a[c]+3*d*Math.pow(1-d,2)*n[c]+3*Math.pow(d,2)*(1-d)*t[c]+e[c]*Math.pow(d,3),s=r(i,0),o=r(i,1);return E(s,o)},_A=(e,t)=>{let n=Mb(e,t);if(!n)return[];let a=[],i=1;for(;i>0;){let r=Cb(n[0],n[1],n[2],n[3],i);a.push(E(r[0],r[1])),i-=.05}return a.length&&ca(a.at(-1),t)&&a.push(E(t[0],t[1])),a},Ib=(e,t)=>{let n=[];n[0]=0;let a=_A(e,t),i=0,r=0;for(;i<a.length-1;){let s=Pe(a[i],a[i+1]);r+=s,n.push(r),i++}return n},TA=(e,t)=>Ib(e,t).at(-1),jA=(e,t,n)=>{let a=Ib(e,t),i=a.length-1,r=a.at(-1),s=n*r,o=0,d=i,c=0;for(;o<d;)c=Math.floor(o+(d-o)/2),a[c]<s?o=c+1:d=c;return a[c]>s&&c--,a[c]===s?c/i:1-(c+(s-a[c])/(a[c+1]-a[c]))/i},Ma=(e,t)=>{let n={minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height,midX:e.x+e.width/2,midY:e.y+e.height/2},a=E(n.midX,n.midY),[i,r]=z(E(n.minX,n.minY),a,e.angle),[s,o]=z(E(n.maxX,n.minY),a,e.angle),[d,c]=z(E(n.maxX,n.maxY),a,e.angle),[l,u]=z(E(n.minX,n.maxY),a,e.angle),f=[Math.min(i,s,d,l),Math.min(r,o,c,u),Math.max(i,s,d,l),Math.max(r,o,c,u)];if(t){let[p,U,m,g]=t;return[f[0]-g,f[1]-p,f[2]+U,f[3]+m]}return f},Ts=(e,t)=>e[0]>t[0]&&e[0]<t[2]&&e[1]>t[1]&&e[1]<t[3],la=(e,t)=>{if(t.roundness?.type===St.PROPORTIONAL_RADIUS||t.roundness?.type===St.LEGACY)return e*oh;if(t.roundness?.type===St.ADAPTIVE_RADIUS){let n=t.roundness?.value??OS,a=n/oh;return e<=a?e*oh:n}return 0},si=(e,t=1)=>{if(e.length>=3){let[n,a]=[e[0],e[e.length-1]];return Pe(n,a)<=Id/t}return!1},Pt=10,AA=(e,t,n,a,i,r,s)=>{let{width:o,height:d}=li(e),c=n/o,l=a/d,u=(e.crop?.x??0)/c,f=(e.crop?.y??0)/l,p=z(E(i,r),E(e.x+e.width/2,e.y+e.height/2),-e.angle);i=p[0],r=p[1];let U=e.width,m=e.height,g=e.crop??{x:0,y:0,width:n,height:a,naturalWidth:n,naturalHeight:a},b=g.height,v=g.width,x=e.scale[0]===-1,y=e.scale[1]===-1,w=r-e.y,k=i-e.x;t.includes("n")&&(m=Se(e.height-w,Pt,y?d-f:e.height+f)),t.includes("s")&&(w=r-e.y-e.height,m=Se(e.height+w,Pt,y?e.height+f:d-f)),t.includes("e")&&(k=i-e.x-e.width,U=Se(e.width+k,Pt,x?e.width+u:o-u)),t.includes("w")&&(U=Se(e.width-k,Pt,x?o-u:e.width+u));let M=_=>{_.height=m*l,_.width=U*c};M(g);let I=(_,T)=>{M(T),_.includes("n")&&(y||(T.y+=b-T.height)),_.includes("s")&&y&&(T.y+=b-T.height),_.includes("e")&&x&&(T.x+=v-T.width),_.includes("w")&&(x||(T.x+=v-T.width))};switch(t){case"n":{if(s){let _=u+e.width/2,T=o-u-e.width/2,L=Math.min(_,T)*2;U=Se(m*s,Pt,L),m=U/s}I(t,g),s&&(g.x+=(v-g.width)/2);break}case"s":{if(s){let _=u+e.width/2,T=o-u-e.width/2,L=Math.min(_,T)*2;U=Se(m*s,Pt,L),m=U/s}I(t,g),s&&(g.x+=(v-g.width)/2);break}case"w":{if(s){let _=f+e.height/2,T=d-f-e.height/2,L=Math.min(_,T)*2;m=Se(U/s,Pt,L),U=m*s}I(t,g),s&&(g.y+=(b-g.height)/2);break}case"e":{if(s){let _=f+e.height/2,T=d-f-e.height/2,L=Math.min(_,T)*2;m=Se(U/s,Pt,L),U=m*s}I(t,g),s&&(g.y+=(b-g.height)/2);break}case"ne":{if(s)if(k>-w){let _=y?d-f:f+e.height;m=Se(U/s,Pt,_),U=m*s}else{let _=x?u+e.width:o-u;U=Se(m*s,Pt,_),m=U/s}I(t,g);break}case"nw":{if(s)if(k<w){let _=y?d-f:f+e.height;m=Se(U/s,Pt,_),U=m*s}else{let _=x?o-u:u+e.width;U=Se(m*s,Pt,_),m=U/s}I(t,g);break}case"se":{if(s)if(k>w){let _=y?f+e.height:d-f;m=Se(U/s,Pt,_),U=m*s}else{let _=x?u+e.width:o-u;U=Se(m*s,Pt,_),m=U/s}I(t,g);break}case"sw":{if(s)if(-k>w){let _=y?f+e.height:d-f;m=Se(U/s,Pt,_),U=m*s}else{let _=x?o-u:u+e.width;U=Se(m*s,Pt,_),m=U/s}I(t,g);break}}let A=DA(e,t,U,m,!!s);return WU(g.width,g.naturalWidth)&&WU(g.height,g.naturalHeight)&&(g=null),{x:A[0],y:A[1],width:U,height:m,crop:g}},DA=(e,t,n,a,i)=>{let[r,s,o,d]=Fi(e,e.width,e.height,!0),c=E(r,s),l=E(o,d),u=To(c,l),[f,p,U,m]=Fi(e,n,a,!0),g=U-f,b=m-p,v=[...c];if(["n","w","nw"].includes(t)&&(v=[l[0]-Math.abs(g),l[1]-Math.abs(b)]),t==="ne"){let I=[c[0],l[1]];v=[I[0],I[1]-Math.abs(b)]}if(t==="sw"){let I=[l[0],c[1]];v=[I[0]-Math.abs(g),I[1]]}i&&(["s","n"].includes(t)&&(v[0]=u[0]-g/2),["e","w"].includes(t)&&(v[1]=u[1]-b/2));let x=e.angle,y=z(v,u,x),w=[v[0]+Math.abs(g)/2,v[1]+Math.abs(b)/2],k=z(w,u,x);v=z(y,k,-x);let M=[...v];return M[0]+=e.x-f,M[1]+=e.y-p,M},LA=(e,t)=>{if(e.crop){let{width:n,height:a}=li(e),[i,r,s,o,d,c]=fe(e,t),l=ie(z(E(i,r),E(d,c),e.angle)),u=ie(z(E(s,r),E(d,c),e.angle)),f=Qt(oc(u,l)),p=ie(z(E(i,o),E(d,c),e.angle)),U=oc(p,l),m=Qt(U),{cropX:g,cropY:b}=RA(e.crop,e.scale),v=Li(Li(l,Ut(f,-g*n/e.crop.naturalWidth)),Ut(m,-b*a/e.crop.naturalHeight)),x=ke(Li(Li(v,Ut(f,n/2)),Ut(m,a/2))),y=z(ke(v),x,-e.angle);return{...e,x:y[0],y:y[1],width:n,height:a,crop:null}}return e},li=e=>{if(e.crop){let t=e.width/(e.crop.width/e.crop.naturalWidth),n=e.height/(e.crop.height/e.crop.naturalHeight);return{width:t,height:n}}return{width:e.width,height:e.height}},RA=(e,t)=>{let n=e.x,a=e.y,i=t[0]===-1,r=t[1]===-1;return i&&(n=e.naturalWidth-Math.abs(n)-e.width),r&&(a=e.naturalHeight-Math.abs(a)-e.height),{cropX:n,cropY:a}},PA=(e,t=!1)=>{let n=e.crop;if(!n)return null;let a=e.scale[0]===-1,i=e.scale[1]===-1,r=n.x,s=n.y;if(a&&(r=n.naturalWidth-n.width-n.x),i&&(s=n.naturalHeight-n.height-n.y),t)return{x:r,y:s};let{width:o,height:d}=li(e);return{x:r/(n.naturalWidth/o),y:s/(n.naturalHeight/d)}},_b="invert(100%) hue-rotate(180deg) saturate(1.25)",NA=Da(),Tb=(e,t)=>Dn(e)&&!t.imageCache.has(e.fileId),jb=(e,t,n)=>n.theme===Me.DARK&&Dn(e)&&!Tb(e,t)&&t.imageCache.get(e.fileId)?.mimeType!==ae.svg,ru=e=>{switch(e.type){case"freedraw":return e.strokeWidth*12;case"text":return e.fontSize/2;default:return 20}},Ab=(e,t,n,a,i=1)=>{let r=(t?.opacity??100)*e.opacity/1e4*i;return(n.has(e.id)||a&&a.some(s=>s.id===e.id)||t&&n.has(t.id))&&(r*=NS/100),r},OA=(e,t,n)=>{let a=ru(e),[i,r,s,o]=fe(e,t),d=ue(e)||Bn(e)?qt(i,s):e.width,c=ue(e)||Bn(e)?qt(r,o):e.height,l=d*window.devicePixelRatio+a*2,u=c*window.devicePixelRatio+a*2,f=n.value;return(l*f>32767||u*f>32767)&&(f=Math.min(32767/l,32767/u)),l*u*f*f>16777216&&(f=Math.sqrt(16777216/(l*u))),l=Math.floor(l*f),u=Math.floor(u*f),{width:l,height:u,scale:f}},Db=(e,t,n,a,i)=>{let r=document.createElement("canvas"),s=r.getContext("2d"),o=ru(e),{width:d,height:c,scale:l}=OA(e,t,n);if(!d||!c)return null;r.width=d,r.height=c;let u=-100,f=0;if(ue(e)||Bn(e)){let[b,v]=fe(e,t);u=e.x>b?qt(e.x,b)*window.devicePixelRatio*l:0,f=e.y>v?qt(e.y,v)*window.devicePixelRatio*l:0,s.translate(u,f)}s.save(),s.translate(o*l,o*l),s.scale(window.devicePixelRatio*l,window.devicePixelRatio*l);let p=Ki.canvas(r);jb(e,a,i)&&(s.filter=_b),Rd(e,p,s,a),s.restore();let U=ge(e,t),m=document.createElement("canvas"),g=m.getContext("2d");if(ve(e)&&U){let[b,v,x,y]=fe(e,t),w=Math.max(qt(b,x),qt(v,y));m.width=w*window.devicePixelRatio*l+o*l*10,m.height=w*window.devicePixelRatio*l+o*l*10,g.translate(m.width/2,m.height/2),g.rotate(e.angle),g.drawImage(r,-r.width/2,-r.height/2,r.width,r.height);let[,,,,k,M]=fe(U,t);g.rotate(-e.angle);let I=(m.width-r.width)/2,A=(m.height-r.height)/2,_=m.width/2-(k-b)*window.devicePixelRatio*l-I-o*l,T=m.height/2-(M-v)*window.devicePixelRatio*l-A-o*l;g.translate(-_,-T),g.clearRect(-(U.width/2+It)*window.devicePixelRatio*l,-(U.height/2+It)*window.devicePixelRatio*l,(U.width+It*2)*window.devicePixelRatio*l,(U.height+It*2)*window.devicePixelRatio*l)}return{element:e,canvas:r,theme:i.theme,scale:l,zoomValue:n.value,canvasOffsetX:u,canvasOffsetY:f,boundTextElementVersion:ge(e,t)?.version||null,containingFrameOpacity:yn(e,t)?.opacity||100,boundTextCanvas:m,angle:e.angle,imageCrop:Re(e)?e.crop:null}},$A=14,Lb=document.createElement("img");Lb.src=`data:${ae.svg},${encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>')}`;var Rb=document.createElement("img");Rb.src=`data:${ae.svg},${encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>')}`;var FA=(e,t)=>{t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);let n=Math.min(e.width,e.height),a=Math.min(n,Math.min(n*.4,100));t.drawImage(e.status==="error"?Rb:Lb,e.width/2-a/2,e.height/2-a/2,a,a)},Rd=(e,t,n,a,i)=>{switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":{n.lineJoin="round",n.lineCap="round",t.draw(ut.get(e));break}case"arrow":case"line":{n.lineJoin="round",n.lineCap="round",ut.get(e).forEach(r=>{t.draw(r)});break}case"freedraw":{n.save(),n.fillStyle=e.strokeColor;let r=HA(e),s=ut.get(e);s&&t.draw(s),n.fillStyle=e.strokeColor,n.fill(r),n.restore();break}case"image":{let r=Dn(e)?a.imageCache.get(e.fileId)?.image:void 0;if(r!=null&&!(r instanceof Promise)){e.roundness&&n.roundRect&&(n.beginPath(),n.roundRect(0,0,e.width,e.height,la(Math.min(e.width,e.height),e)),n.clip());let{x:s,y:o,width:d,height:c}=e.crop?e.crop:{x:0,y:0,width:r.naturalWidth,height:r.naturalHeight};n.drawImage(r,s,o,d,c,0,0,e.width,e.height)}else FA(e,n);break}default:if(q(e)){let r=A5(e.text),s=r&&!n.canvas.isConnected;s&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",r?"rtl":"ltr"),n.save(),n.font=Xe(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;let o=e.text.replace(/\r\n?/g,`
16
+ `).split(`
17
+ `),d=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,c=Ao(e.fontSize,e.lineHeight),l=mb(e.fontFamily,e.fontSize,c);for(let u=0;u<o.length;u++)n.fillText(o[u],d,u*c+l);n.restore(),s&&n.canvas.remove()}else throw new Error(`Unimplemented type ${e.type}`)}},_f=new WeakMap,w2=(e,t,n,a)=>{let i=n?a.zoom:NA.zoom,r=_f.get(e),s=r&&r.zoomValue!==i.value&&!a?.shouldCacheIgnoreZoom,o=ge(e,t),d=o?.version||null,c=Re(e)?e.crop:null,l=yn(e,t)?.opacity||100;if(!r||s||r.theme!==a.theme||r.boundTextElementVersion!==d||r.imageCrop!==c||r.containingFrameOpacity!==l||ve(e)&&o&&e.angle!==r.angle){let u=Db(e,t,i,n,a);return u?(_f.set(e,u),u):null}return r},bh=(e,t,n,a,i)=>{let r=e.element,s=ru(r),o=e.scale,[d,c,l,u]=fe(r,i),f=((d+l)/2+a.scrollX)*window.devicePixelRatio,p=((c+u)/2+a.scrollY)*window.devicePixelRatio;t.save(),t.scale(1/window.devicePixelRatio,1/window.devicePixelRatio);let U=ge(r,i);if(ve(r)&&U){let m=(e.boundTextCanvas.width-e.canvas.width)/2,g=(e.boundTextCanvas.height-e.canvas.height)/2;t.translate(f,p),t.drawImage(e.boundTextCanvas,-(l-d)/2*window.devicePixelRatio-m/o-s,-(u-c)/2*window.devicePixelRatio-g/o-s,e.boundTextCanvas.width/o,e.boundTextCanvas.height/o)}else t.translate(f,p),t.rotate(r.angle),"scale"in e.element&&!Tb(r,n)&&t.scale(e.element.scale[0],e.element.scale[1]),t.translate(-f,-p),t.drawImage(e.canvas,(d+a.scrollX)*window.devicePixelRatio-s*e.scale/e.scale,(c+a.scrollY)*window.devicePixelRatio-s*e.scale/e.scale,e.canvas.width/e.scale,e.canvas.height/e.scale),be.VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX;t.restore()},zA=(e,t,n,a)=>{t.save(),t.translate(e.x+n.scrollX,e.y+n.scrollY),t.fillStyle="rgba(0, 0, 200, 0.04)";let i=.5/n.zoom.value;t.fillRect(i,i,e.width,e.height),t.lineWidth=1/n.zoom.value,t.strokeStyle=a,t.strokeRect(i,i,e.width,e.height),t.restore()},dr=(e,t,n,a,i,r,s)=>{let o=s.openDialog?.name==="elementLinkSelector"&&!s.selectedElementIds[e.id]&&!s.hoveredElementIds[e.id];switch(i.globalAlpha=Ab(e,yn(e,t),r.elementsPendingErasure,r.pendingFlowchartNodes,o?S5:1),e.type){case"magicframe":case"frame":{s.frameRendering.enabled&&s.frameRendering.outline&&(i.save(),i.translate(e.x+s.scrollX,e.y+s.scrollY),i.fillStyle="rgba(0, 0, 200, 0.04)",i.lineWidth=dt.strokeWidth/s.zoom.value,i.strokeStyle=dt.strokeColor,jd(e)&&(i.strokeStyle=s.theme===Me.LIGHT?"#7affd7":"#1d8264"),i.roundRect?(i.beginPath(),i.roundRect(0,0,e.width,e.height,dt.radius/s.zoom.value),i.stroke(),i.closePath()):i.strokeRect(0,0,e.width,e.height),i.restore());break}case"freedraw":{if(ut.generateElementShape(e,null),r.isExporting){let[d,c,l,u]=fe(e,t),f=(d+l)/2+s.scrollX,p=(c+u)/2+s.scrollY,U=(l-d)/2-(e.x-d),m=(u-c)/2-(e.y-c);i.save(),i.translate(f,p),i.rotate(e.angle),i.translate(-U,-m),Rd(e,a,i,r),i.restore()}else{let d=w2(e,n,r,s);if(!d)return;bh(d,i,r,s,n)}break}case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":case"iframe":case"embeddable":{if(ut.generateElementShape(e,r),r.isExporting){let[d,c,l,u]=fe(e,t),f=(d+l)/2+s.scrollX,p=(c+u)/2+s.scrollY,U=(l-d)/2-(e.x-d),m=(u-c)/2-(e.y-c);if(q(e)){let b=zt(e,t);if(ve(b)){let v=J.getBoundTextElementPosition(b,e,t);U=(l-d)/2-(v.x-d),m=(u-c)/2-(v.y-c)}}i.save(),i.translate(f,p),jb(e,r,s)&&(i.filter="none");let g=ge(e,t);if(ve(e)&&g){let b=document.createElement("canvas"),v=b.getContext("2d"),x=Math.max(qt(d,l),qt(c,u)),y=ru(e);b.width=x*s.exportScale+y*10*s.exportScale,b.height=x*s.exportScale+y*10*s.exportScale,v.translate(b.width/2,b.height/2),v.scale(s.exportScale,s.exportScale),U=e.width/2-(e.x-d),m=e.height/2-(e.y-c),v.rotate(e.angle);let w=Ki.canvas(b);v.translate(-U,-m),Rd(e,w,v,r),v.translate(U,m),v.rotate(-e.angle);let[,,,,k,M]=fe(g,t),I=(d+l)/2-k,A=(c+u)/2-M;v.translate(-I,-A),v.clearRect(-g.width/2,-g.height/2,g.width,g.height),i.scale(1/s.exportScale,1/s.exportScale),i.drawImage(b,-b.width/2,-b.height/2,b.width,b.height)}else i.rotate(e.angle),e.type==="image"&&i.scale(e.scale[0],e.scale[1]),i.translate(-U,-m),Rd(e,a,i,r);i.restore()}else{let d=w2(e,n,r,s);if(!d)return;let c=i.imageSmoothingEnabled;if(!s?.shouldCacheIgnoreZoom&&(!e.angle||XS(e.angle))&&(i.imageSmoothingEnabled=!1),e.id===s.croppingElementId&&Re(d.element)&&d.element.crop!==null){i.save(),i.globalAlpha=.1;let l=Db(LA(d.element,t),n,s.zoom,r,s);l&&bh(l,i,r,s,n),i.restore()}bh(d,i,r,s,n),i.imageSmoothingEnabled=c}break}default:throw new Error(`Unimplemented type ${e.type}`)}i.globalAlpha=1},Pb=new WeakMap([]);function BA(e){let t=Q1(e),n=new Path2D(t);return Pb.set(e,n),n}function HA(e){return Pb.get(e)}function Q1(e){let t=e.simulatePressure?e.points:e.points.length?e.points.map(([a,i],r)=>[a,i,e.pressures[r]]):[[0,0,.5]],n={simulatePressure:e.simulatePressure,size:e.strokeWidth*4.25,thinning:.6,smoothing:.5,streamline:.5,easing:a=>Math.sin(a*Math.PI/2),last:!!e.lastCommittedPoint};return WA(GE(t,n))}function E2(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var XA=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;function WA(e){if(!e.length)return"";let t=e.length-1;return e.reduce((n,a,i,r)=>(i===t?n.push(a,E2(a,r[0]),"L",r[0],"Z"):n.push(a,E2(a,r[i+1])),n),["M",e[0],"Q"]).join(" ").replace(XA,"$1")}var js=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="line"||e==="freedraw",Tf=e=>e!=="image"&&e!=="frame"&&e!=="magicframe",S2=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="freedraw"||e==="arrow"||e==="line",k2=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="ellipse"||e==="diamond"||e==="arrow"||e==="line",jf=e=>e==="rectangle"||e==="iframe"||e==="embeddable"||e==="line"||e==="diamond"||e==="image",M2=e=>e==="arrow",gc=e=>e==="arrow",pt=[1,0],$t=[0,1],Un=[-1,0],mn=[0,-1],dd=(e,t)=>{let n=_o(Math.atan2(t[1]-e[1],t[0]-e[0]));return n>=315||n<45?mn:n>=45&&n<135?pt:n>=135&&n<225?$t:Un},Or=e=>{let[t,n]=e,a=Math.abs(t),i=Math.abs(n);return t>i?pt:t<=-i?Un:n>a?$t:mn},co=(e,t)=>Or(ie(e,t)),qa=(e,t)=>Qa(co(e,t)),mt=(e,t)=>e[0]===t[0]&&e[1]===t[1],Qa=e=>mt(e,pt)||mt(e,Un),Nb=(e,t,n)=>{let a=n0(t);if(e.type==="diamond"){if(n[0]<e.x)return Un;if(n[1]<e.y)return mn;if(n[0]>e.x+e.width)return pt;if(n[1]>e.y+e.height)return $t;let d=z(Wa(E(e.x+e.width/2,e.y),a,2),a,e.angle),c=z(Wa(E(e.x+e.width,e.y+e.height/2),a,2),a,e.angle),l=z(Wa(E(e.x+e.width/2,e.y+e.height),a,2),a,e.angle),u=z(Wa(E(e.x,e.y+e.height/2),a,2),a,e.angle);return es([d,c,a],n)?dd(d,c):es([c,l,a],n)?dd(c,l):es([l,u,a],n)?dd(l,u):dd(u,d)}let i=Wa(E(t[0],t[1]),a,2),r=Wa(E(t[2],t[1]),a,2),s=Wa(E(t[0],t[3]),a,2),o=Wa(E(t[2],t[3]),a,2);return es([i,r,a],n)?mn:es([r,o,a],n)?pt:es([o,s,a],n)?$t:Un},Ob=e=>[e[0]===0?0:e[0]>0?-1:1,e[1]===0?0:e[1]>0?-1:1],VA=e=>[8,8+e],$b=e=>[1.5,6+e];function GA(e){let t=e.roughness,n=Math.max(e.width,e.height),a=Math.min(e.width,e.height);return a>=20&&n>=50||a>=15&&e.roundness&&jf(e.type)||ue(e)&&n>=50?t:Math.min(t/(n<10?3:2),2.5)}var kn=(e,t=!1)=>{let n={seed:e.seed,strokeLineDash:e.strokeStyle==="dashed"?VA(e.strokeWidth):e.strokeStyle==="dotted"?$b(e.strokeWidth):void 0,disableMultiStroke:e.strokeStyle!=="solid",strokeWidth:e.strokeStyle!=="solid"?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:e.strokeWidth*4,roughness:GA(e),stroke:e.strokeColor,preserveVertices:t||e.roughness<y5.cartoonist};switch(e.type){case"rectangle":case"iframe":case"embeddable":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill=na(e.backgroundColor)?void 0:e.backgroundColor,e.type==="ellipse"&&(n.curveFitting=1),n;case"line":case"freedraw":return si(e.points)&&(n.fillStyle=e.fillStyle,n.fill=e.backgroundColor==="transparent"?void 0:e.backgroundColor),n;case"arrow":return n;default:throw new Error(`Unimplemented type ${e.type}`)}},C2=(e,t,n)=>Ln(e)&&(t||pn(e)&&n?.get(e.id)!==!0)&&na(e.backgroundColor)&&na(e.strokeColor)?{...e,roughness:0,backgroundColor:"#d3d3d3",fillStyle:"solid"}:Ii(e)?{...e,strokeColor:na(e.strokeColor)?"#000000":e.strokeColor,backgroundColor:na(e.backgroundColor)?"#f4f4f6":e.backgroundColor}:e,I2=(e,t,n,a,i,r,s)=>{let o=A2(e,t,n,a);if(o===null)return[];let d=(c,l)=>{if(c===null)return[];let[,,u,f,p,U]=c;return[i.line(u,f,p,U,l)]};switch(a){case"dot":case"circle":case"circle_outline":{let[c,l,u]=o;return delete r.strokeLineDash,[i.circle(c,l,u,{...r,fill:a==="circle_outline"?s:e.strokeColor,fillStyle:"solid",stroke:e.strokeColor,roughness:Math.min(.5,r.roughness||0)})]}case"triangle":case"triangle_outline":{let[c,l,u,f,p,U]=o;return delete r.strokeLineDash,[i.polygon([[c,l],[u,f],[p,U],[c,l]],{...r,fill:a==="triangle_outline"?s:e.strokeColor,fillStyle:"solid",roughness:Math.min(1,r.roughness||0)})]}case"diamond":case"diamond_outline":{let[c,l,u,f,p,U,m,g]=o;return delete r.strokeLineDash,[i.polygon([[c,l],[u,f],[p,U],[m,g],[c,l]],{...r,fill:a==="diamond_outline"?s:e.strokeColor,fillStyle:"solid",roughness:Math.min(1,r.roughness||0)})]}case"crowfoot_one":return d(o,r);case"bar":case"arrow":case"crowfoot_many":case"crowfoot_one_or_many":default:{let[c,l,u,f,p,U]=o;if(e.strokeStyle==="dotted"){let m=$b(e.strokeWidth-1);r.strokeLineDash=[m[0],m[1]-1]}else delete r.strokeLineDash;return r.roughness=Math.min(1,r.roughness||0),[i.line(u,f,c,l,r),i.line(p,U,c,l,r),...a==="crowfoot_one_or_many"?d(A2(e,t,n,"crowfoot_one"),r):[]]}}},ZA=(e,t,{isExporting:n,canvasBackgroundColor:a,embedsValidationStatus:i})=>{switch(e.type){case"rectangle":case"iframe":case"embeddable":{let r;if(e.roundness){let s=e.width,o=e.height,d=la(Math.min(s,o),e);r=t.path(`M ${d} 0 L ${s-d} 0 Q ${s} 0, ${s} ${d} L ${s} ${o-d} Q ${s} ${o}, ${s-d} ${o} L ${d} ${o} Q 0 ${o}, 0 ${o-d} L 0 ${d} Q 0 0, ${d} 0`,kn(C2(e,n,i),!0))}else r=t.rectangle(0,0,e.width,e.height,kn(C2(e,n,i),!1));return r}case"diamond":{let r,[s,o,d,c,l,u,f,p]=zb(e);if(e.roundness){let U=la(Math.abs(s-f),e),m=la(Math.abs(c-o),e);r=t.path(`M ${s+U} ${o+m} L ${d-U} ${c-m}
18
+ C ${d} ${c}, ${d} ${c}, ${d-U} ${c+m}
19
+ L ${l+U} ${u-m}
20
+ C ${l} ${u}, ${l} ${u}, ${l-U} ${u-m}
21
+ L ${f+U} ${p+m}
22
+ C ${f} ${p}, ${f} ${p}, ${f+U} ${p-m}
23
+ L ${s-U} ${o+m}
24
+ C ${s} ${o}, ${s} ${o}, ${s+U} ${o+m}`,kn(e,!0))}else r=t.polygon([[s,o],[d,c],[l,u],[f,p]],kn(e));return r}case"ellipse":return t.ellipse(e.width/2,e.height/2,e.width,e.height,kn(e));case"line":case"arrow":{let r,s=kn(e),o=e.points.length?e.points:[E(0,0)];if(Q(e)?o.every(d=>Math.abs(d[0])<=1e6&&Math.abs(d[1])<=1e6)?r=[t.path(YA(o,16),kn(e,!0))]:(console.error("Elbow arrow with extreme point positions detected. Arrow not rendered.",e.id,JSON.stringify(o)),r=[]):e.roundness?r=[t.curve(o,s)]:s.fill?r=[t.polygon(o,s)]:r=[t.linearPath(o,s)],e.type==="arrow"){let{startArrowhead:d=null,endArrowhead:c="arrow"}=e;if(d!==null){let l=I2(e,r,"start",d,t,s,a);r.push(...l)}if(c!==null){let l=I2(e,r,"end",c,t,s,a);r.push(...l)}}return r}case"freedraw":{let r;if(BA(e),si(e.points)){let s=qE(e.points,.75);r=t.curve(s,{...kn(e),stroke:"none"})}else r=null;return r}case"frame":case"magicframe":case"text":case"image":return null;default:return Dr(e,`generateElementShape(): Unimplemented type ${e?.type}`),null}},YA=(e,t)=>{let n=[];for(let i=1;i<e.length-1;i+=1){let r=e[i-1],s=e[i+1],o=e[i],d=qa(o,r),c=qa(s,o),l=Math.min(t,Pe(e[i],s)/2,Pe(e[i],r)/2);d?r[0]<o[0]?n.push([e[i][0]-l,e[i][1]]):n.push([e[i][0]+l,e[i][1]]):r[1]<o[1]?n.push([e[i][0],e[i][1]-l]):n.push([e[i][0],e[i][1]+l]),n.push(e[i]),c?s[0]<o[0]?n.push([e[i][0]-l,e[i][1]]):n.push([e[i][0]+l,e[i][1]]):s[1]<o[1]?n.push([e[i][0],e[i][1]-l]):n.push([e[i][0],e[i][1]+l])}let a=[`M ${e[0][0]} ${e[0][1]}`];for(let i=0;i<n.length;i+=3)a.push(`L ${n[i][0]} ${n[i][1]}`),a.push(`Q ${n[i+1][0]} ${n[i+1][1]}, ${n[i+2][0]} ${n[i+2][1]}`);return a.push(`L ${e[e.length-1][0]} ${e[e.length-1][1]}`),a.join(" ")},As=e=>{let t=e.map(a=>a[0]),n=e.map(a=>a[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},bc=(e,t,n,a)=>{let i=n.map(f=>f[e]),r=Math.max(...i),s=Math.min(...i),o=r-s,d=o===0?1:t/o,c=1/0,l=n.map(f=>{let p=f[e]*d,U=[...f];return U[e]=p,p<c&&(c=p),U});if(!a||l.length===2)return l;let u=s-c;return l.map(f=>f.map((p,U)=>U===e?p+u:p))},Fb=class Pd{static getBounds(t,n){let a=Pd.boundsCache.get(t);if(a?.version&&a.version===t.version&&!nt(t))return a.bounds;let i=Pd.calculateBounds(t,n);return Pd.boundsCache.set(t,{version:t.version,bounds:i}),i}static calculateBounds(t,n){let a,[i,r,s,o,d,c]=fe(t,n);if(Bn(t)){let[l,u,f,p]=e0(t.points.map(([U,m])=>z(E(U,m),E(d-t.x,c-t.y),t.angle)));return[l+t.x,u+t.y,f+t.x,p+t.y]}else if(ue(t))a=nD(t,d,c,n);else if(t.type==="diamond"){let[l,u]=z(E(d,r),E(d,c),t.angle),[f,p]=z(E(d,o),E(d,c),t.angle),[U,m]=z(E(i,c),E(d,c),t.angle),[g,b]=z(E(s,c),E(d,c),t.angle),v=Math.min(l,f,U,g),x=Math.min(u,p,m,b),y=Math.max(l,f,U,g),w=Math.max(u,p,m,b);a=[v,x,y,w]}else if(t.type==="ellipse"){let l=(s-i)/2,u=(o-r)/2,f=Math.cos(t.angle),p=Math.sin(t.angle),U=Math.hypot(l*f,u*p),m=Math.hypot(u*f,l*p);a=[d-U,c-m,d+U,c+m]}else{let[l,u]=z(E(i,r),E(d,c),t.angle),[f,p]=z(E(i,o),E(d,c),t.angle),[U,m]=z(E(s,o),E(d,c),t.angle),[g,b]=z(E(s,r),E(d,c),t.angle),v=Math.min(l,f,U,g),x=Math.min(u,p,m,b),y=Math.max(l,f,U,g),w=Math.max(u,p,m,b);a=[v,x,y,w]}return a}};j(Fb,"boundsCache",new WeakMap);var KA=Fb,fe=(e,t,n=!1)=>{if(Bn(e))return JA(e);if(ue(e))return J.getElementAbsoluteCoords(e,t,n);if(q(e)){let a=t?zt(e,t):null;if(ve(a)){let{x:i,y:r}=J.getBoundTextElementPosition(a,e,t);return[i,r,i+e.width,r+e.height,i+e.width/2,r+e.height/2]}}return[e.x,e.y,e.x+e.width,e.y+e.height,e.x+e.width/2,e.y+e.height/2]},_2=(e,t)=>{let[n,a,i,r,s,o]=fe(e,t),d=E(s,o);if(ue(e)||Bn(e)){let b=[],v=0;for(;v<e.points.length-1;)b.push(re(z(E(e.points[v][0]+e.x,e.points[v][1]+e.y),d,e.angle),z(E(e.points[v+1][0]+e.x,e.points[v+1][1]+e.y),d,e.angle))),v++;return b}let[c,l,u,f,p,U,m,g]=[[n,a],[i,a],[n,r],[i,r],[s,a],[s,r],[n,o],[i,o]].map(b=>z(b,d,e.angle));return e.type==="diamond"?[re(p,m),re(p,g),re(U,m),re(U,g)]:e.type==="ellipse"?[re(p,m),re(p,g),re(U,m),re(U,g),re(p,m),re(p,g),re(U,m),re(U,g)]:[re(c,l),re(u,f),re(c,u),re(l,f),re(c,g),re(u,g),re(l,m),re(f,m)]},zb=e=>{let t=Math.floor(e.width/2)+1,n=0,a=e.width,i=Math.floor(e.height/2)+1,r=t,s=e.height;return[t,n,a,i,r,s,0,i]},T2=(e,t,n,a,i)=>{let r=1-e;return Math.pow(r,3)*t+3*Math.pow(r,2)*e*n+3*r*Math.pow(e,2)*a+Math.pow(e,3)*i},j2=(e,t,n,a)=>{let i=t-e,r=n-t,s=a-n,o=3*i-6*r+3*s,d=6*r-6*i,c=3*i,l=d*d-4*o*c;if(!(l>=0))return!1;let u=null,f=null,p=1/0,U=1/0;return o===0?p=U=-c/d:(p=(-d+Math.sqrt(l))/(2*o),U=(-d-Math.sqrt(l))/(2*o)),p>=0&&p<=1&&(u=T2(p,e,t,n,a)),U>=0&&U<=1&&(f=T2(U,e,t,n,a)),[u,f]},qA=(e,t,n,a)=>{let i=j2(e[0],t[0],n[0],a[0]),r=j2(e[1],t[1],n[1],a[1]),s=Math.min(e[0],a[0]),o=Math.max(e[0],a[0]);if(i){let l=i.filter(u=>u!==null);s=Math.min(s,...l),o=Math.max(o,...l)}let d=Math.min(e[1],a[1]),c=Math.max(e[1],a[1]);if(r){let l=r.filter(u=>u!==null);d=Math.min(d,...l),c=Math.max(c,...l)}return[s,d,o,c]},su=(e,t)=>{let n=E(0,0),{minX:a,minY:i,maxX:r,maxY:s}=e.reduce((o,{op:d,data:c})=>{if(d==="move"){let l=P1(c);tn(l!=null,"Op data is not a point"),n=l}else if(d==="bcurveTo"){let l=E(c[0],c[1]),u=E(c[2],c[3]),f=E(c[4],c[5]),p=t?t(l):l,U=t?t(u):u,m=t?t(f):f,g=t?t(n):n;n=f;let[b,v,x,y]=qA(g,p,U,m);o.minX=Math.min(o.minX,b),o.minY=Math.min(o.minY,v),o.maxX=Math.max(o.maxX,x),o.maxY=Math.max(o.maxY,y)}return o},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[a,i,r,s]},e0=e=>{let t=1/0,n=1/0,a=-1/0,i=-1/0;for(let[r,s]of e)t=Math.min(t,r),n=Math.min(n,s),a=Math.max(a,r),i=Math.max(i,s);return[t,n,a,i]},JA=e=>{let[t,n,a,i]=e0(e.points),r=t+e.x,s=n+e.y,o=a+e.x,d=i+e.y;return[r,s,o,d,(r+o)/2,(s+d)/2]},QA=e=>{switch(e){case"arrow":return 25;case"diamond":case"diamond_outline":return 12;case"crowfoot_many":case"crowfoot_one":case"crowfoot_one_or_many":return 20;default:return 15}},eD=e=>{switch(e){case"bar":return 90;case"arrow":return 20;default:return 25}},A2=(e,t,n,a)=>{if(t.length<1)return null;let i=Ji(t[0]);if(i.length<1)return null;let r=n==="start"?1:i.length-1,s=i[r].data;tn(s.length===6,"Op data length is not 6");let o=E(s[4],s[5]),d=E(s[2],s[3]),c=E(s[0],s[1]),l=i[r-1],u=E(0,0);if(l.op==="move"){let F=P1(l.data);tn(F!=null,"Op data is not a point"),u=F}else l.op==="bcurveTo"&&(u=E(l.data[4],l.data[5]));let f=(F,P)=>Math.pow(1-F,3)*o[P]+3*F*Math.pow(1-F,2)*d[P]+3*Math.pow(F,2)*(1-F)*c[P]+u[P]*Math.pow(F,3),[p,U]=n==="start"?u:o,[m,g]=[f(.3,0),f(.3,1)],b=Math.hypot(p-m,U-g),v=(p-m)/b,x=(U-g)/b,y=QA(a),w=0;{let[F,P]=n==="end"?e.points[e.points.length-1]:e.points[0],[$,O]=e.points.length>1?n==="end"?e.points[e.points.length-2]:e.points[1]:[0,0];w=Math.hypot(F-$,P-O)}let k=Math.min(y,w*(a==="diamond"||a==="diamond_outline"?.25:.5)),M=p-v*k,I=U-x*k;if(a==="dot"||a==="circle"||a==="circle_outline"){let F=Math.hypot(I-U,M-p)+e.strokeWidth-2;return[p,U,F]}let A=eD(a);if(a==="crowfoot_many"||a==="crowfoot_one_or_many"){let[F,P]=z(E(p,U),E(M,I),vr(-A)),[$,O]=z(E(p,U),E(M,I),vr(A));return[M,I,F,P,$,O]}let[_,T]=z(E(M,I),E(p,U),-A*Math.PI/180),[L,R]=z(E(M,I),E(p,U),vr(A));if(a==="diamond"||a==="diamond_outline"){let F,P;if(n==="start"){let[$,O]=e.points.length>1?e.points[1]:[0,0];[F,P]=z(E(p+k*2,U),E(p,U),Math.atan2(O-U,$-p))}else{let[$,O]=e.points.length>1?e.points[e.points.length-2]:[0,0];[F,P]=z(E(p-k*2,U),E(p,U),Math.atan2(U-O,p-$))}return[p,U,_,T,F,P,L,R]}return[p,U,_,T,L,R]},tD=e=>{let t=Ki.generator(),n=kn(e),a=e.roundness?"curve":n.fill?"polygon":"linearPath";return t[a](e.points,n)},nD=(e,t,n,a)=>{let i=ge(e,a);if(e.points.length<2){let[c,l]=e.points[0],[u,f]=z(E(e.x+c,e.y+l),E(t,n),e.angle),p=[u,f,u,f];if(i){let U=J.getMinMaxXYWithBoundText(e,a,[u,f,u,f],i);p=[U[0],U[1],U[2],U[3]]}return p}let r=ut.get(e)?.[0]??tD(e),s=Ji(r),o=su(s,([c,l])=>z(E(e.x+c,e.y+l),E(t,n),e.angle)),d=[o[0],o[1],o[2],o[3]];if(i){let c=J.getMinMaxXYWithBoundText(e,a,d,i);d=[c[0],c[1],c[2],c[3]]}return d},ha=(e,t)=>KA.getBounds(e,t),Ne=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,a=-1/0,i=1/0,r=-1/0,s=t||oe(e);return e.forEach(o=>{let[d,c,l,u]=ha(o,s);n=Math.min(n,d),i=Math.min(i,c),a=Math.max(a,l),r=Math.max(r,u)}),[n,i,a,r]},t0=(e,t)=>{let[n,a,i,r]=Ne(e);return[n+t.x,a+t.y,i+t.x,r+t.y]},Fi=(e,t,n,a)=>{if(!(ue(e)||Bn(e)))return[e.x,e.y,e.x+t,e.y+n];let i=bc(0,t,bc(1,n,e.points,a),a),r;if(Bn(e))r=e0(i);else{let l=Ki.generator(),u=e.roundness?l.curve(i,kn(e)):l.linearPath(i,kn(e)),f=Ji(u);r=su(f)}let[s,o,d,c]=r;return[s+e.x,o+e.y,d+e.x,c+e.y]},D2=(e,t)=>{let n=Ki.generator(),a=e.roundness==null?n.linearPath(t,kn(e)):n.curve(t,kn(e)),i=Ji(a),[r,s,o,d]=su(i);return[r+e.x,s+e.y,o+e.x,d+e.y]},aD=(e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,a=e[0],i=oe(e);return e.forEach(r=>{let[s,o,d,c]=ha(r,i),l=Pe(E((s+d)/2,(o+c)/2),E(t.x,t.y));l<n&&(n=l,a=r)}),ha(a,i)},oa=e=>{let[t,n,a,i]=Ne(e);return{minX:t,minY:n,maxX:a,maxY:i,width:a-t,height:i-n,midX:(t+a)/2,midY:(n+i)/2}},Bb=({scrollX:e,scrollY:t,width:n,height:a,zoom:i})=>[-e,-t,-e+n/i.value,-t+a/i.value],n0=e=>E(e[0]+(e[2]-e[0])/2,e[1]+(e[3]-e[1])/2),iD=(e,t)=>{if(e==null||t==null)return!1;let[n,a,i,r]=e,[s,o,d,c]=t;return n<d&&i>s&&a<c&&r>o},lu=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":case"iframe":case"embeddable":case"frame":case"magicframe":return rD(e,t);case"diamond":return sD(e,t);case"ellipse":return lD(e,t)}},rD=(e,t)=>{let n=E(e.x+e.width/2,e.y+e.height/2),a=z(t,n,-e.angle),[i,r]=yb(e);return Math.min(...i.map(s=>N1(a,s)),...r.map(s=>T5(s,a)).filter(s=>s!==null))},sD=(e,t)=>{let n=E(e.x+e.width/2,e.y+e.height/2),a=z(t,n,-e.angle),[i,r]=wb(e);return Math.min(...i.map(s=>N1(a,s)),...r.map(s=>T5(s,a)).filter(s=>s!==null))},lD=(e,t)=>{let n=E(e.x+e.width/2,e.y+e.height/2);return vA(z(t,n,-e.angle),vb(n,e.width/2,e.height/2))},oD=e=>!e[D.CTRL_OR_CMD],gr=e=>e.isBindingEnabled,Ke=5,a0=10,i0=4,dD=(e,t)=>{let n=[];return t.forEach(a=>{let i=e.getNonDeletedElement(a);i!=null&&n.push(i)}),n},ou=(e,t,n,a,i)=>{let r=new Set,s=new Set;L2(e,t,n,"start",r,s,a),L2(e,n,t,"end",r,s,a);let o=Array.from(s).filter(d=>!r.has(d));dD(i,o).forEach(d=>{X(d,{boundElements:d.boundElements?.filter(c=>c.type!=="arrow"||c.id!==e.id)})})},L2=(e,t,n,a,i,r,s)=>{if(t!=="keep"){if(t===null){let o=pD(e,a);o!=null&&r.add(o);return}Vb(e)?(n==null||(n==="keep"?!Xb(e,t,a):a==="start"||n.id!==t.id))&&(La(e,t,a,s),i.add(t.id)):(La(e,t,a,s),i.add(t.id))}},cD=(e,t,n,a)=>{let i=Gb(e,t,n),r=t==="start"?e.startBinding?.elementId:e.endBinding?.elementId;if(r){let s=n.get(r);if(ua(s)&&Nd(s,i,n,a))return s}return null},Hb=(e,t,n)=>["start","end"].map(a=>cD(e,a,t,n)),uD=(e,t,n,a,i,r)=>{let s=e.points.length-1,o=n.findIndex(u=>u===0)>-1,d=n.findIndex(u=>u===s)>-1,c=o?t?hs(e,"start",a,i,r):null:Q(e)?"keep":hs(e,"start",a,i,r),l=d?t?hs(e,"end",a,i,r):null:Q(e)?"keep":hs(e,"end",a,i,r);return[c,l]},hD=(e,t,n,a,i)=>{if(Q(e))return["keep","keep"];let[r,s]=Hb(e,t,i),o=r&&a?hs(e,"start",t,n,i):null,d=s&&a?hs(e,"end",t,n,i):null;return[o,d]},xc=(e,t,n,a,i,r,s)=>{e.forEach(o=>{let[d,c]=r?.length?uD(o,i,r??[],t,n,s):hD(o,t,n,i,s);ou(o,d,c,t,a)})},xh=(e,t,n)=>e.length>50?[]:e.filter(ue).flatMap(a=>Hb(a,t,n)).filter(a=>a!==null).filter(a=>e.filter(i=>i.id===a?.id).length===0),Af=(e,t,n,a,i)=>{t.startBoundElement!=null&&La(e,t.startBoundElement,"start",a);let r=aa(n,i,a,t.zoom,Q(e),Q(e));r!==null&&(Xb(e,r,"end")||La(e,r,"end",a))},fD=(e,t)=>{let n=e.gap,a=Lo(t,t.width,t.height);return n>a&&(n=a0+i0),{...e,gap:n}},La=(e,t,n,a)=>{if(!ve(e))return;let i={elementId:t.id,...Q(e)?{...vc(e,t,n),focus:0,gap:0}:{...fD(gD(e,t,n,a),t)}};X(e,{[n==="start"?"startBinding":"endBinding"]:i}),oe(t.boundElements||[]).has(e.id)||X(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},Xb=(e,t,n)=>{let a=e[n==="start"?"endBinding":"startBinding"];return Wb(e,a?.elementId,t)},Wb=(e,t,n)=>t===n.id&&Vb(e),Vb=e=>e.points.length<3,pD=(e,t)=>{let n=t==="start"?"startBinding":"endBinding",a=e[n];return a==null?null:(X(e,{[n]:null}),a.elementId)},aa=(e,t,n,a,i,r)=>{if(r){let s=!1,o=mD(t,c=>ua(c,!1)&&Nd(c,e,n,a,(i||!ch(c))&&!de(c))).filter(c=>s?!1:(ch(c)||(s=!0),!0));if(!o||o.length===0)return null;if(o.length===1)return o[0];let d=o.filter(c=>Nd(c,e,n,a,!1));return d.length===1?d[0]:o.sort((c,l)=>l.width**2+l.height**2-(c.width**2+c.height**2)).pop()}return UD(t,s=>ua(s,!1)&&Nd(s,e,n,a,(i||!ch(s))&&!de(s)))},UD=(e,t)=>{let n=null;for(let a=e.length-1;a>=0;--a){let i=e[a];if(!i.isDeleted&&t(i)){n=i;break}}return n},mD=(e,t)=>{let n=[];for(let a=e.length-1;a>=0;--a){let i=e[a];i.isDeleted||t(i)&&n.push(i)}return n},gD=(e,t,n,a)=>{let i=n==="start"?-1:1,r=i===-1?0:e.points.length-1,s=r-i,o=J.getPointAtIndexGlobalCoordinates(e,r,a),d=J.getPointAtIndexGlobalCoordinates(e,s,a);return{focus:MD(t,d,o),gap:Math.max(1,lu(t,o))}},xn=(e,t,n)=>{let{newSize:a,simultaneouslyUpdated:i}=n??{},r=xD(i);ua(e)&&du(t,e,s=>{if(!ue(s)||s.isDeleted||!bD(s,e))return;let o=s.startBinding?t.get(s.startBinding.elementId):null,d=s.endBinding?t.get(s.endBinding.elementId):null,c=null,l=null;o&&d&&(c=ha(o,t),l=ha(d,t));let u={startBinding:R2(e,s.startBinding,a),endBinding:R2(e,s.endBinding,a)};if(r.has(s.id)){X(s,u,!0);return}let f=cu(t,s,(U,m)=>{if(U&&ua(U)&&(m==="startBinding"||m==="endBinding")&&(e.id===s[m]?.elementId||e.id===s[m==="startBinding"?"endBinding":"startBinding"]?.elementId&&!iD(c,l))){let g=kD(s,m,u[m],U,t);if(g)return{index:m==="startBinding"?0:s.points.length-1,point:g}}return null}).filter(U=>U!==null);J.movePoints(s,f,{...e.id===s.startBinding?.elementId?{startBinding:u.startBinding}:{},...e.id===s.endBinding?.elementId?{endBinding:u.endBinding}:{}});let p=ge(s,t);p&&!p.isDeleted&&Ro(s,t,!1)})},bD=(e,t)=>e.startBinding?.elementId===t.id||e.endBinding?.elementId===t.id,xD=e=>new Set((e||[]).map(t=>t.id)),vD=(e,t,n,a,i,r,s)=>{let o=Or(ie(t,e));return!n||!a?o:yD(r,n,i,s)?Nb(n,a,e):Or(ie(e,E(n.x+n.width/2,n.y+n.height/2)))},yD=(e,t,n,a)=>{let i=lu(t,e),r=Lo(t,t.width,t.height,a);return i>r?null:i},uo=(e,t,n)=>{let a=t&&Ma(t),i=e.points[n==="start"?0:e.points.length-1],r=E(e.x+i[0],e.y+i[1]),s=vk(t)?ED(t,r):r;if(t&&a){let o=n0(a),d=Sb(t,re(o,ke(Ut(Qt(ie(s,o)),Math.max(t.width,t.height)),o)))[0],c=Pe(s,o),l=Math.max(Pe(d??s,o),1e-4),u=ja(c/l,6);switch(!0){case u>.9:return c-l>Ke||so(s,d)<1e-4?s:ke(Ut(Qt(ie(s,d??o)),u>1?Ke:-Ke),d??o);default:return wD(s,t,a)}}return s},wD=(e,t,n)=>{let a=n0(n),i=Or(ie(e,a));switch(!0){case mt(i,mn):return z(E((n[0]+n[2])/2+.1,n[1]),a,t.angle);case mt(i,pt):return z(E(n[2],(n[1]+n[3])/2+.1),a,t.angle);case mt(i,$t):return z(E((n[0]+n[2])/2-.1,n[3]),a,t.angle);default:return z(E(n[0],(n[1]+n[3])/2-.1),a,t.angle)}},ED=(e,t)=>{let n=E(e.x+e.width/2,e.y+e.height/2),a=z(t,n,-e.angle);return a[0]<e.x&&a[1]<e.y?a[1]-e.y>-Ke?z(E(e.x-Ke,e.y),n,e.angle):z(E(e.x,e.y-Ke),n,e.angle):a[0]<e.x&&a[1]>e.y+e.height?a[0]-e.x>-Ke?z(E(e.x,e.y+e.height+Ke),n,e.angle):z(E(e.x-Ke,e.y+e.height),n,e.angle):a[0]>e.x+e.width&&a[1]>e.y+e.height?a[0]-e.x<e.width+Ke?z(E(e.x+e.width,e.y+e.height+Ke),n,e.angle):z(E(e.x+e.width+Ke,e.y+e.height),n,e.angle):a[0]>e.x+e.width&&a[1]<e.y?a[0]-e.x<e.width+Ke?z(E(e.x+e.width,e.y-Ke),n,e.angle):z(E(e.x+e.width+Ke,e.y),n,e.angle):t},SD=(e,t,n=.05)=>{let{x:a,y:i,width:r,height:s,angle:o}=e,d=E(a+r/2-.1,i+s/2-.1),c=z(t,d,-o),l=Se(n*s,5,80),u=Se(n*r,5,80);return c[0]<=a+r/2&&c[1]>d[1]-l&&c[1]<d[1]+l?z(E(a-Ke,d[1]),d,o):c[1]<=i+s/2&&c[0]>d[0]-u&&c[0]<d[0]+u?z(E(d[0],i-Ke),d,o):c[0]>=a+r/2&&c[1]>d[1]-l&&c[1]<d[1]+l?z(E(a+r+Ke,d[1]),d,o):c[1]>=i+s/2&&c[0]>d[0]-u&&c[0]<d[0]+u?z(E(d[0],i+s+Ke),d,o):t},kD=(e,t,n,a,i)=>{if(n==null||n.elementId!==a.id&&e.points.length>2)return null;let r=t==="startBinding"?-1:1,s=r===-1?0:e.points.length-1;if(Q(e)&&fc(n)){let u=uu(n.fixedPoint)??vc(e,a,t==="startBinding"?"start":"end").fixedPoint,f=E(a.x+a.width/2,a.y+a.height/2),p=E(a.x+u[0]*a.width,a.y+u[1]*a.height),U=z(p,f,a.angle);return J.pointFromAbsoluteCoords(e,U,i)}let o=s-r,d=J.getPointAtIndexGlobalCoordinates(e,o,i),c=CD(a,n.focus,d),l;if(n.gap===0)l=c;else{let u=J.getPointAtIndexGlobalCoordinates(e,s,i),f=E(a.x+a.width/2,a.y+a.height/2),p=Pe(d,u)+Pe(d,f)+Math.max(a.width,a.height)*2,U=Sb(a,re(d,ke(Ut(Qt(ie(c,d)),p),d)),n.gap).sort((m,g)=>so(m,d)-so(g,d));U.length>1?l=U[0]:U.length===1?l=c:l=u}return J.pointFromAbsoluteCoords(e,l,i)},vc=(e,t,n,a)=>{let i=[t.x,t.y,t.x+t.width,t.y+t.height],r=uo(e,t,n),s=E(i[0]+(i[2]-i[0])/2,i[1]+(i[3]-i[1])/2),o=z(r,s,-t.angle);return{fixedPoint:uu([(o[0]-t.x)/t.width,(o[1]-t.y)/t.height])}},R2=(e,t,n)=>{if(t==null||n==null)return t;let{width:a,height:i}=n,{width:r,height:s}=e,o=Math.max(1,Math.min(Lo(e,a,i),t.gap*(a<i?a/r:i/s)));return{...t,gap:o}},hs=(e,t,n,a,i)=>aa(Gb(e,t,n),a,n,i,Q(e),Q(e)),Gb=(e,t,n)=>{let a=t==="start"?0:-1;return ta(J.getPointAtIndexGlobalCoordinates(e,a,n))},Zb=(e,t,n,a)=>{let i=new Set,r=new Set,s=a==="duplicatesServeAsOld",o=new Map([...n].map(([d,c])=>[c,d]));t.forEach(d=>{let{boundElements:c}=d;if(c!=null&&c.length>0&&(c.forEach(l=>{s&&!n.has(l.id)&&i.add(l.id)}),r.add(n.get(d.id))),_a(d)){if(d.startBinding!=null){let{elementId:l}=d.startBinding;s&&!n.has(l)&&r.add(l)}if(d.endBinding!=null){let{elementId:l}=d.endBinding;s&&!n.has(l)&&r.add(l)}(d.startBinding!=null||d.endBinding!=null)&&i.add(n.get(d.id))}}),e.filter(({id:d})=>i.has(d)).forEach(d=>{let{startBinding:c,endBinding:l}=d;X(d,{startBinding:P2(c,n),endBinding:P2(l,n)})}),e.filter(({id:d})=>r.has(d)).forEach(d=>{let c=o.get(d.id),l=e.find(({id:u})=>u===c)?.boundElements;l&&l.length>0&&X(d,{boundElements:l.map(u=>n.has(u.id)?{id:n.get(u.id),type:u.type}:u)})})},P2=(e,t)=>e==null?null:{...e,elementId:t.get(e.elementId)??e.elementId},Yb=(e,t)=>{let n=oe(e);for(let a of t)fs.unbindAffected(n,a,X),ps.unbindAffected(n,a,X)},ho=(e,t,n=[])=>{if(!e)return null;let a=e.filter(i=>!t.has(i.id));return a.push(...n.map(i=>({id:i.id,type:i.type}))),a},Nd=(e,{x:t,y:n},a,i,r)=>{let s=Lo(e,e.width,e.height,i),o=Ka(e,a);return Mf(E(t,n),o,s)||r===!0&&Ts(E(t,n),Ma(e))},Lo=(e,t,n,a)=>{let i=a?.value&&a.value<1?a.value:1,r=(e.type==="diamond"?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*r,32),a0/i+i0)},MD=(e,t,n)=>{let a=E(e.x+e.width/2,e.y+e.height/2);if(ca(t,n))return 0;let i=z(t,a,-e.angle),r=z(n,a,-e.angle),s=Math.sign(Dt(ie(r,t),ie(r,a)))*-1,o=re(r,ke(Ut(Qt(ie(r,i)),Math.max(e.width*2,e.height*2)),r)),d=e.type==="diamond"?[re(E(e.x+e.width/2,e.y),E(e.x+e.width/2,e.y+e.height)),re(E(e.x,e.y+e.height/2),E(e.x+e.width,e.y+e.height/2))]:[re(E(e.x,e.y),E(e.x+e.width,e.y+e.height)),re(E(e.x+e.width,e.y),E(e.x,e.y+e.height))],c=e.type==="diamond"?[re(E(e.x+e.width/2,e.y-e.height),E(e.x+e.width/2,e.y+e.height*2)),re(E(e.x-e.width,e.y+e.height/2),E(e.x+e.width*2,e.y+e.height/2))]:[re(E(e.x-e.width,e.y-e.height),E(e.x+e.width*2,e.y+e.height*2)),re(E(e.x+e.width*2,e.y-e.height),E(e.x-e.width,e.y+e.height*2))];return[lo(o,c[0]),lo(o,c[1])].filter(l=>l!==null).sort((l,u)=>so(l,n)-so(u,n)).map((l,u)=>s*Pe(a,l)/(e.type==="diamond"?Pe(d[u][0],d[u][1])/2:Math.sqrt(e.width**2+e.height**2)/2)).sort((l,u)=>Math.abs(l)-Math.abs(u))[0]??0},CD=(e,t,n)=>{let a=E(e.x+e.width/2,e.y+e.height/2);if(t===0)return a;let i=(e.type==="diamond"?[E(e.x,e.y+e.height/2),E(e.x+e.width/2,e.y),E(e.x+e.width,e.y+e.height/2),E(e.x+e.width/2,e.y+e.height)]:[E(e.x,e.y),E(e.x+e.width,e.y),E(e.x+e.width,e.y+e.height),E(e.x,e.y+e.height)]).map(s=>ke(Ut(ie(s,a),Math.abs(t)),a)).map(s=>z(s,a,e.angle)),r=[Dt(ie(n,i[0]),ie(i[1],i[0]))>0&&(t>0?Dt(ie(n,i[1]),ie(i[2],i[1]))<0:Dt(ie(n,i[3]),ie(i[0],i[3]))<0),Dt(ie(n,i[1]),ie(i[2],i[1]))>0&&(t>0?Dt(ie(n,i[2]),ie(i[3],i[2]))<0:Dt(ie(n,i[0]),ie(i[1],i[0]))<0),Dt(ie(n,i[2]),ie(i[3],i[2]))>0&&(t>0?Dt(ie(n,i[3]),ie(i[0],i[3]))<0:Dt(ie(n,i[1]),ie(i[2],i[1]))<0),Dt(ie(n,i[3]),ie(i[0],i[3]))>0&&(t>0?Dt(ie(n,i[0]),ie(i[1],i[0]))<0:Dt(ie(n,i[2]),ie(i[3],i[2]))<0)];return r[0]?t>0?i[1]:i[0]:r[1]?t>0?i[2]:i[1]:r[2]?t>0?i[3]:i[2]:t>0?i[0]:i[3]},ID=new Set(["boundElements","frameId","containerId","startBinding","endBinding"]),du=(e,t,n)=>{ua(t)&&(t.boundElements?.slice()??[]).forEach(({id:a})=>{n(e.get(a),"boundElements",a)})},cu=(e,t,n)=>{let a=[];if(t.frameId){let i=t.frameId;a.push(n(e.get(i),"frameId",i))}if(nt(t)){let i=t.containerId;a.push(n(e.get(i),"containerId",i))}if(ve(t)){if(t.startBinding){let i=t.startBinding.elementId;a.push(n(e.get(i),"startBinding",i))}if(t.endBinding){let i=t.endBinding.elementId;a.push(n(e.get(i),"endBinding",i))}}return a},fs=class{static unbindAffected(e,t,n){t&&cu(e,t,a=>{!a||a.isDeleted||du(e,a,(i,r,s)=>{s===t.id&&n(a,{boundElements:ho(a.boundElements,new Set([s]))})})})}};j(fs,"rebindAffected",(e,t,n)=>{!t||t.isDeleted||cu(e,t,(a,i)=>{if(!a||a.isDeleted){n(t,{[i]:null});return}i!=="frameId"&&(a.boundElements?.find(r=>r.id===t.id)||(ve(t)&&n(a,{boundElements:ho(a.boundElements,new Set,new Array(t))}),q(t)&&(a.boundElements?.find(r=>r.type==="text")?n(t,{[i]:null}):n(a,{boundElements:ho(a.boundElements,new Set,new Array(t))}))))})});var ps=class{static unbindAffected(e,t,n){t&&du(e,t,a=>{!a||a.isDeleted||cu(e,a,(i,r,s)=>{s===t.id&&n(a,{[r]:null})})})}};j(ps,"rebindAffected",(e,t,n)=>{!t||t.isDeleted||du(e,t,(a,i,r)=>{if(!a||a.isDeleted){n(t,{boundElements:ho(t.boundElements,new Set([r]))});return}q(a)&&((t.boundElements?.slice()??[]).reverse().find(s=>s.type==="text")?.id===a.id?a.containerId!==t.id&&n(a,{containerId:t.id}):(a.containerId!==null&&n(a,{containerId:null}),n(t,{boundElements:ho(t.boundElements,new Set([a.id]))})))})});var Df=(e,t)=>{let[n,a]=uu(e);return z(E(t.x+t.width*n,t.y+t.height*a),E(t.x+t.width/2,t.y+t.height/2),t.angle)},_D=(e,t)=>{let n=e.startBinding&&t.get(e.startBinding.elementId),a=e.endBinding&&t.get(e.endBinding.elementId),i=n&&e.startBinding?Df(e.startBinding.fixedPoint,n):E(e.x+e.points[0][0],e.y+e.points[0][1]),r=a&&e.endBinding?Df(e.endBinding.fixedPoint,a):E(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]);return[i,r]},TD=(e,t)=>{let[n,a]=_D(e,t);return[J.pointFromAbsoluteCoords(e,n,t),J.pointFromAbsoluteCoords(e,a,t)]},uu=e=>e&&(Math.abs(e[0]-.5)<1e-4||Math.abs(e[1]-.5)<1e-4)?e.map(t=>Math.abs(t-.5)<1e-4?.5001:t):e,jD=(e,t)=>{let[n,a,i,r]=t,{x:s,y:o}=Rn({sceneX:n,sceneY:a},e),{x:d,y:c}=Rn({sceneX:i,sceneY:r},e);return d-s>e.width||c-o>e.height},Kb=({scenePoint:e,viewportDimensions:t,zoom:n,offsets:a})=>{let i=(t.width-(a?.right??0))/2/n.value-e.x;i+=(a?.left??0)/2/n.value;let r=(t.height-(a?.bottom??0))/2/n.value-e.y;return r+=(a?.top??0)/2/n.value,{scrollX:i,scrollY:r}},fo=(e,t)=>{if(e=qR(e),!e.length)return{scrollX:0,scrollY:0};let[n,a,i,r]=Ne(e);jD(t,[n,a,i,r])&&([n,a,i,r]=aD(e,Ge({clientX:t.scrollX,clientY:t.scrollY},t)));let s=(n+i)/2,o=(a+r)/2;return Kb({scenePoint:{x:s,y:o},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},ei=e=>Se(ja(e,6),A1,D1),AD=e=>Se(Math.round(e),1,100),qb=e=>Se(Math.round(e),1,100),Jb=(e,t,n)=>{let a=n.reduce((i,r)=>(r.groupIds.includes(e)&&(i[r.id]=!0),i),{});return Object.keys(a).length<2?t.selectedGroupIds[e]||t.editingGroupId===e?{selectedElementIds:t.selectedElementIds,selectedGroupIds:{...t.selectedGroupIds,[e]:!1},editingGroupId:null}:t:{editingGroupId:t.editingGroupId,selectedGroupIds:{...t.selectedGroupIds,[e]:!0},selectedElementIds:{...t.selectedElementIds,...a}}},sn=(function(){let e=null,t=null,n=null,a=(r,s,o,d)=>{if(n!==void 0&&s===t&&r===e&&o.editingGroupId===n?.editingGroupId)return n;let c={};for(let f of r){let p=f.groupIds;if(o.editingGroupId){let U=p.indexOf(o.editingGroupId);U>-1&&(p=p.slice(0,U))}if(p.length>0){let U=p[p.length-1];c[U]=!0}}let l={},u=s.reduce((f,p)=>{if(p.isDeleted)return f;let U=p.groupIds.find(m=>c[m]);return U&&(f[p.id]=!0,Array.isArray(l[U])?l[U].push(p.id):l[U]=[p.id]),f},{});for(let f of Object.keys(l))l[f].length<2&&c[f]&&(c[f]=!1);return t=s,e=r,n={editingGroupId:o.editingGroupId,selectedGroupIds:c,selectedElementIds:Le({...o.selectedElementIds,...u},d)},n},i=(r,s,o,d)=>{let c=d?d.scene.getSelectedElements({selectedElementIds:r.selectedElementIds,elements:s}):xe(s,r);return c.length?a(c,s,r,o):{selectedGroupIds:{},editingGroupId:null,selectedElementIds:Le(r.selectedElementIds,o)}};return i.clearCache=()=>{t=null,e=null,n=null},i})(),Qb=(e,t)=>e8(e,t)!=null,e8=(e,t)=>t.groupIds.filter(n=>n!==e.editingGroupId).find(n=>e.selectedGroupIds[n]),Er=e=>Object.entries(e.selectedGroupIds).filter(([t,n])=>n).map(([t,n])=>t),t8=(e,t)=>{let n={...t,selectedGroupIds:{}};for(let a of e){let i=a.groupIds;if(t.editingGroupId){let r=i.indexOf(t.editingGroupId);r>-1&&(i=i.slice(0,r))}if(i.length>0){let r=i[i.length-1];n={...n,...Jb(r,n,e)}}}return n.selectedGroupIds},DD=(e,t)=>({...e,editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[t.id]:!0}}),po=(e,t)=>e.groupIds.includes(t),tt=(e,t)=>{let n=[];for(let a of e.values())po(a,t)&&n.push(a);return n},LD=(e,t)=>e.groupIds.find(n=>t[n]),RD=(e,t,n)=>{let a=[...e],i=t?e.indexOf(t):-1,r=i>-1?i:e.length;for(let s=0;s<r;s++)a[s]=n(a[s]);return a},PD=(e,t,n)=>{let a=[...e],i=n?a.indexOf(n):-1,r=i>-1?i:a.length;return a.splice(r,0,t),a},ND=(e,t)=>e.filter(n=>!t[n]),hu=(e,t)=>{let n=new Map;return e.forEach(a=>{let i=a.groupIds.length===0?a.id:a.groupIds[a.groupIds.length-1],r=n.get(i)||[],s=ge(a,t);s&&r.push(s),n.set(i,[...r,a])}),Array.from(n.values())},OD=e=>{let t=new Set;for(let[,n]of e)if(!n.isDeleted)for(let a of n.groupIds??[])t.add(a);return t},n8=e=>{let t=e.flatMap(i=>i.groupIds),n=new Map,a=0;for(let i of t)n.set(i,(n.get(i)??0)+1),n.get(i)>a&&(a=n.get(i));return a===e.length},Ds=e=>e.groupIds.length>0,$D=8,N2=99999,fu=e=>$D/e,hn=class{};j(hn,"referenceSnapPoints",null),j(hn,"visibleGaps",null),j(hn,"setReferenceSnapPoints",e=>{hn.referenceSnapPoints=e}),j(hn,"getReferenceSnapPoints",()=>hn.referenceSnapPoints),j(hn,"setVisibleGaps",e=>{hn.visibleGaps=e}),j(hn,"getVisibleGaps",()=>hn.visibleGaps),j(hn,"destroy",()=>{hn.referenceSnapPoints=null,hn.visibleGaps=null});var Ga=hn,Uo=e=>e.props.gridModeEnabled??e.state.gridModeEnabled,Wi=({event:e,app:t,selectedElements:n})=>e?t.state.objectsSnapModeEnabled&&!e[D.CTRL_OR_CMD]||!t.state.objectsSnapModeEnabled&&e[D.CTRL_OR_CMD]&&!Uo(t):n.length===1&&n[0].type==="arrow"?!1:t.state.objectsSnapModeEnabled,FD=(e,t,n=.01)=>Math.abs(e-t)<=n,mo=(e,t,{omitCenter:n,boundingBoxCorners:a,dragOffset:i}={omitCenter:!1,boundingBoxCorners:!1})=>{let r=[];if(e.length===1){let s=e[0],[o,d,c,l,u,f]=fe(s,t);i&&(o+=i.x,c+=i.x,u+=i.x,d+=i.y,l+=i.y,f+=i.y);let p=(c-o)/2,U=(l-d)/2;if((s.type==="diamond"||s.type==="ellipse")&&!a){let m=z(E(o,d+U),E(u,f),s.angle),g=z(E(o+p,d),E(u,f),s.angle),b=z(E(c,d+U),E(u,f),s.angle),v=z(E(o+p,l),E(u,f),s.angle),x=E(u,f);r=n?[m,g,b,v]:[m,g,b,v,x]}else{let m=z(E(o,d),E(u,f),s.angle),g=z(E(c,d),E(u,f),s.angle),b=z(E(o,l),E(u,f),s.angle),v=z(E(c,l),E(u,f),s.angle),x=E(u,f);r=n?[m,g,b,v]:[m,g,b,v,x]}}else if(e.length>1){let[s,o,d,c]=t0(e,i??{x:0,y:0}),l=d-s,u=c-o,f=E(s,o),p=E(d,o),U=E(s,c),m=E(d,c),g=E(s+l/2,o+u/2);r=n?[f,p,U,m]:[f,p,U,m,g]}return r.map(s=>E(ct(s[0]),ct(s[1])))},a8=(e,t,n,a)=>{let i=t.filter(r=>de(r)).map(r=>r.id);return n7(e,t,n,a).filter(r=>!(r.frameId&&i.includes(r.frameId)))},zD=(e,t,n,a)=>{let i=a8(e,t,n,a),r=hu(i,a).filter(u=>!(u.length===1&&nt(u[0]))).map(u=>Ne(u).map(f=>ct(f))),s=r.sort((u,f)=>u[0]-f[0]),o=[],d=0;e:for(let u=0;u<s.length;u++){let f=s[u];for(let p=u+1;p<s.length;p++){if(++d>N2)break e;let U=s[p],[,m,g,b]=f,[v,x,,y]=U;g<v&&uc(Yt(m,b),Yt(x,y))&&o.push({startBounds:f,endBounds:U,startSide:[E(g,m),E(g,b)],endSide:[E(v,x),E(v,y)],length:v-g,overlap:hc(Yt(m,b),Yt(x,y))})}}let c=r.sort((u,f)=>u[1]-f[1]),l=[];d=0;e:for(let u=0;u<c.length;u++){let f=c[u];for(let p=u+1;p<c.length;p++){if(++d>N2)break e;let U=c[p],[m,,g,b]=f,[v,x,y]=U;b<x&&uc(Yt(m,g),Yt(v,y))&&l.push({startBounds:f,endBounds:U,startSide:[E(m,b),E(g,b)],endSide:[E(v,x),E(y,x)],length:x-b,overlap:hc(Yt(m,g),Yt(v,y))})}}return{horizontalGaps:o,verticalGaps:l}},O2=(e,t,n,a,i,r,s)=>{if(!Wi({app:n,event:a,selectedElements:e}))return[];if(e.length===0)return[];let o=Ga.getVisibleGaps();if(o){let{horizontalGaps:d,verticalGaps:c}=o,[l,u,f,p]=t0(e,t).map(g=>ct(g)),U=(l+f)/2,m=(u+p)/2;for(let g of d){if(!uc(Yt(u,p),g.overlap))continue;let b=g.startSide[0][0]+g.length/2,v=ct(b-U);if(g.length>f-l&&Math.abs(v)<=s.x){Math.abs(v)<s.x&&(i.length=0),s.x=Math.abs(v);let A={type:"gap",direction:"center_horizontal",gap:g,offset:v};i.push(A);continue}let[,,x]=g.endBounds,y=l-x,w=ct(g.length-y);if(Math.abs(w)<=s.x){Math.abs(w)<s.x&&(i.length=0),s.x=Math.abs(w);let A={type:"gap",direction:"side_right",gap:g,offset:w};i.push(A);continue}let[k,,,]=g.startBounds,M=k-f,I=ct(M-g.length);if(Math.abs(I)<=s.x){Math.abs(I)<s.x&&(i.length=0),s.x=Math.abs(I);let A={type:"gap",direction:"side_left",gap:g,offset:I};i.push(A);continue}}for(let g of c){if(!uc(Yt(l,f),g.overlap))continue;let b=g.startSide[0][1]+g.length/2,v=ct(b-m);if(g.length>p-u&&Math.abs(v)<=s.y){Math.abs(v)<s.y&&(r.length=0),s.y=Math.abs(v);let A={type:"gap",direction:"center_vertical",gap:g,offset:v};r.push(A);continue}let[,x,,]=g.startBounds,y=x-p,w=ct(y-g.length);if(Math.abs(w)<=s.y){Math.abs(w)<s.y&&(r.length=0),s.y=Math.abs(w);let A={type:"gap",direction:"side_top",gap:g,offset:w};r.push(A);continue}let[,,,k]=g.endBounds,M=ct(u-k),I=g.length-M;if(Math.abs(I)<=s.y){Math.abs(I)<s.y&&(r.length=0),s.y=Math.abs(I);let A={type:"gap",direction:"side_bottom",gap:g,offset:I};r.push(A);continue}}}},BD=(e,t,n,a)=>{let i=a8(e,t,n,a);return hu(i,a).filter(r=>!(r.length===1&&nt(r[0]))).flatMap(r=>mo(r,a))},Ls=(e,t,n,a,i,r,s)=>{if(!Wi({app:n,event:a,selectedElements:e})||e.length===0&&t.length===0)return[];let o=Ga.getReferenceSnapPoints();if(o)for(let d of t)for(let c of o){let l=c[0]-d[0],u=c[1]-d[1];Math.abs(l)<=s.x&&(Math.abs(l)<s.x&&(i.length=0),i.push({type:"point",points:[d,c],offset:l}),s.x=Math.abs(l)),Math.abs(u)<=s.y&&(Math.abs(u)<s.y&&(r.length=0),r.push({type:"point",points:[d,c],offset:u}),s.y=Math.abs(u))}},HD=(e,t,n,a,i)=>{let r=n.state,s=xe(e,r);if(!Wi({app:n,event:a,selectedElements:s})||s.length===0)return{snapOffset:{x:0,y:0},snapLines:[]};t.x=ct(t.x),t.y=ct(t.y);let o=[],d=[],c=fu(r.zoom.value),l={x:c,y:c},u=mo(s,i,{dragOffset:t});Ls(s,u,n,a,o,d,l),O2(s,t,n,a,o,d,l);let f={x:o[0]?.offset??0,y:d[0]?.offset??0};l.x=0,l.y=0,o.length=0,d.length=0;let p={x:ct(t.x+f.x),y:ct(t.y+f.y)};Ls(s,mo(s,i,{dragOffset:p}),n,a,o,d,l),O2(s,p,n,a,o,d,l);let U=r0(o,d),m=WD(s,p,[...o,...d].filter(g=>g.type==="gap"));return{snapOffset:f,snapLines:[...U,...m]}},ct=e=>Math.round(e*10**6)/10**6,$2=e=>{let t=new Map;for(let n of e){let a=n.join(",");t.has(a)||t.set(a,n)}return Array.from(t.values())},r0=(e,t)=>{let n={},a={};if(e.length>0){for(let i of e)if(i.type==="point"){let r=ct(i.points[0][0]);n[r]||(n[r]=[]),n[r].push(...i.points.map(s=>E(ct(s[0]),ct(s[1]))))}}if(t.length>0){for(let i of t)if(i.type==="point"){let r=ct(i.points[0][1]);a[r]||(a[r]=[]),a[r].push(...i.points.map(s=>E(ct(s[0]),ct(s[1]))))}}return Object.entries(n).map(([i,r])=>({type:"points",points:$2(r.map(s=>E(Number(i),s[1])).sort((s,o)=>s[1]-o[1]))})).concat(Object.entries(a).map(([i,r])=>({type:"points",points:$2(r.map(s=>E(s[0],Number(i))).sort((s,o)=>s[0]-o[0]))})))},XD=e=>{let t=new Map;for(let n of e){let a=n.points.flat().map(i=>[ct(i)]).join(",");t.has(a)||t.set(a,n)}return Array.from(t.values())},WD=(e,t,n)=>{let[a,i,r,s]=t0(e,t),o=[];for(let d of n){let[c,l,u,f]=d.gap.startBounds,[p,U,m,g]=d.gap.endBounds,b=hc(Yt(i,s),d.gap.overlap),v=hc(Yt(a,r),d.gap.overlap);switch(d.direction){case"center_horizontal":{if(b){let x=(b[0]+b[1])/2;o.push({type:"gap",direction:"horizontal",points:[E(d.gap.startSide[0][0],x),E(a,x)]},{type:"gap",direction:"horizontal",points:[E(r,x),E(d.gap.endSide[0][0],x)]})}break}case"center_vertical":{if(v){let x=(v[0]+v[1])/2;o.push({type:"gap",direction:"vertical",points:[E(x,d.gap.startSide[0][1]),E(x,i)]},{type:"gap",direction:"vertical",points:[E(x,s),E(x,d.gap.endSide[0][1])]})}break}case"side_right":{if(b){let x=(b[0]+b[1])/2;o.push({type:"gap",direction:"horizontal",points:[E(u,x),E(p,x)]},{type:"gap",direction:"horizontal",points:[E(m,x),E(a,x)]})}break}case"side_left":{if(b){let x=(b[0]+b[1])/2;o.push({type:"gap",direction:"horizontal",points:[E(r,x),E(c,x)]},{type:"gap",direction:"horizontal",points:[E(u,x),E(p,x)]})}break}case"side_top":{if(v){let x=(v[0]+v[1])/2;o.push({type:"gap",direction:"vertical",points:[E(x,s),E(x,l)]},{type:"gap",direction:"vertical",points:[E(x,f),E(x,U)]})}break}case"side_bottom":{if(v){let x=(v[0]+v[1])/2;o.push({type:"gap",direction:"vertical",points:[E(x,f),E(x,U)]},{type:"gap",direction:"vertical",points:[E(x,g),E(x,i)]})}break}}}return XD(o.map(d=>({...d,points:d.points.map(c=>E(ct(c[0]),ct(c[1])))})))},F2=(e,t,n,a,i,r)=>{if(!Wi({event:a,selectedElements:e,app:n})||e.length===0||e.length===1&&!FD(e[0].angle,0))return{snapOffset:{x:0,y:0},snapLines:[]};let[s,o,d,c]=Ne(t);r&&(r.includes("e")?d+=i.x:r.includes("w")&&(s+=i.x),r.includes("n")?o+=i.y:r.includes("s")&&(c+=i.y));let l=[];if(r)switch(r){case"e":{l.push(E(d,o),E(d,c));break}case"w":{l.push(E(s,o),E(s,c));break}case"n":{l.push(E(s,o),E(d,o));break}case"s":{l.push(E(s,c),E(d,c));break}case"ne":{l.push(E(d,o));break}case"nw":{l.push(E(s,o));break}case"se":{l.push(E(d,c));break}case"sw":{l.push(E(s,c));break}}let u=fu(n.state.zoom.value),f={x:u,y:u},p=[],U=[];Ls(t,l,n,a,p,U,f);let m={x:p[0]?.offset??0,y:U[0]?.offset??0};f.x=0,f.y=0,p.length=0,U.length=0;let[g,b,v,x]=Ne(e).map(k=>ct(k)),y=[E(g,b),E(g,x),E(v,b),E(v,x)];Ls(e,y,n,a,p,U,f);let w=r0(p,U);return{snapOffset:m,snapLines:w}},VD=(e,t,n,a,i,r)=>{if(!Wi({event:n,selectedElements:[e],app:t}))return{snapOffset:{x:0,y:0},snapLines:[]};let s=[E(a.x+i.x,a.y+i.y)],o=fu(t.state.zoom.value),d={x:o,y:o},c=[],l=[];Ls([e],s,t,n,c,l,d);let u={x:c[0]?.offset??0,y:l[0]?.offset??0};d.x=0,d.y=0,c.length=0,l.length=0;let f=mo([e],r,{boundingBoxCorners:!0,omitCenter:!0});Ls([e],f,t,n,c,l,d);let p=r0(c,l);return{snapOffset:u,snapLines:p}},GD=(e,t,n,a,i)=>{if(!Wi({event:a,selectedElements:[],app:t}))return{originOffset:{x:0,y:0},snapLines:[]};let r=n7(e,[],t.state,i),s=fu(t.state.zoom.value),o={x:s,y:s},d=[],c=[];for(let l of r){let u=mo([l],i);for(let f of u){let p=f[0]-n.x;Math.abs(p)<=Math.abs(o.x)&&(Math.abs(p)<Math.abs(o.x)&&(c.length=0),c.push({type:"pointer",points:[f,E(f[0],n.y)],direction:"vertical"}),o.x=p);let U=f[1]-n.y;Math.abs(U)<=Math.abs(o.y)&&(Math.abs(U)<Math.abs(o.y)&&(d.length=0),d.push({type:"pointer",points:[f,E(n.x,f[1])],direction:"horizontal"}),o.y=U)}}return{originOffset:{x:c.length>0?c[0].points[0][0]-n.x:0,y:d.length>0?d[0].points[0][1]-n.y:0},snapLines:[...c,...d]}},ZD=e=>e===Lt.rectangle||e===Lt.ellipse||e===Lt.diamond||e===Lt.frame||e===Lt.magicframe||e===Lt.image||e===Lt.text,Ct=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t],xi={version:null,points:[],zoom:null},bt=class we{constructor(t){j(this,"elementId"),j(this,"selectedPointsIndices"),j(this,"pointerDownState"),j(this,"isDragging"),j(this,"lastUncommittedPoint"),j(this,"pointerOffset"),j(this,"startBindingElement"),j(this,"endBindingElement"),j(this,"hoverPointIndex"),j(this,"segmentMidPointHoveredCoords"),j(this,"elbowed"),this.elementId=t.id,ca(t.points[0],E(0,0))||console.error("Linear element is not normalized",Error().stack),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep",this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:null,segmentMidpoint:{value:null,index:null,added:!1}},this.hoverPointIndex=-1,this.segmentMidPointHoveredCoords=null,this.elbowed=Q(t)&&t.elbowed}static getElement(t,n){return n.get(t)||null}static handleBoxSelection(t,n,a,i){if(!n.editingLinearElement||!n.selectionElement)return!1;let{editingLinearElement:r}=n,{selectedPointsIndices:s,elementId:o}=r,d=we.getElement(o,i);if(!d)return!1;let[c,l,u,f]=fe(n.selectionElement,i),p=we.getPointsGlobalCoordinates(d,i).reduce((U,m,g)=>((m[0]>=c&&m[0]<=u&&m[1]>=l&&m[1]<=f||t.shiftKey&&s?.includes(g))&&U.push(g),U),[]).filter(U=>!(Q(d)&&U!==0&&U!==d.points.length-1));a({editingLinearElement:{...r,selectedPointsIndices:p.length?p:null}})}static handlePointDragging(t,n,a,i,r,s,o){if(!s)return!1;let{elementId:d}=s,c=o.getNonDeletedElementsMap(),l=we.getElement(d,c);if(!l||Q(l)&&!s.pointerDownState.lastClickedIsEndPoint&&s.pointerDownState.lastClickedPoint!==0)return!1;let u=Q(l)?s.selectedPointsIndices?.reduce((U,m)=>m===0?[0,U[1]]:[U[0],l.points.length-1],[!1,!1]).filter(U=>typeof U=="number"):s.selectedPointsIndices,f=Q(l)?s.pointerDownState.lastClickedPoint>0?l.points.length-1:0:s.pointerDownState.lastClickedPoint,p=l.points[f];if(u&&p){if(Ol(t)&&u.length===1&&l.points.length>1){let U=u[0],m=l.points[U===0?1:U-1],[g,b]=we._getShiftLockedDelta(l,c,m,E(a,i),t[D.CTRL_OR_CMD]?null:n.getEffectiveGridSize());we.movePoints(l,[{index:U,point:E(g+m[0],b+m[1]),isDragging:U===f}])}else{let U=we.createPointAt(l,c,a-s.pointerOffset.x,i-s.pointerOffset.y,t[D.CTRL_OR_CMD]?null:n.getEffectiveGridSize()),m=U[0]-p[0],g=U[1]-p[1];we.movePoints(l,u.map(b=>{let v=b===f?we.createPointAt(l,c,a-s.pointerOffset.x,i-s.pointerOffset.y,t[D.CTRL_OR_CMD]?null:n.getEffectiveGridSize()):E(l.points[b][0]+m,l.points[b][1]+g);return{index:b,point:v,isDragging:b===f}}))}if(ge(l,c)&&Ro(l,c,!1),_a(l,!1)){let U=[];u[0]===0&&U.push(ta(we.getPointGlobalCoordinates(l,l.points[0],c)));let m=u[u.length-1];m===l.points.length-1&&U.push(ta(we.getPointGlobalCoordinates(l,l.points[m],c))),U.length&&r(l,U)}return!0}return!1}static handlePointerUp(t,n,a,i){let r=i.getNonDeletedElementsMap(),s=i.getNonDeletedElements(),{elementId:o,selectedPointsIndices:d,isDragging:c,pointerDownState:l}=n,u=we.getElement(o,r);if(!u)return n;let f={};if(c&&d){for(let p of d)if(p===0||p===u.points.length-1){si(u.points,a.zoom.value)&&we.movePoints(u,[{index:p,point:p===0?u.points[u.points.length-1]:u.points[0]}]);let U=gr(a)?aa(ta(we.getPointAtIndexGlobalCoordinates(u,p,r)),s,r,a.zoom,Q(u),Q(u)):null;f[p===0?"startBindingElement":"endBindingElement"]=U}}return{...n,...f,selectedPointsIndices:c||t.shiftKey?!c&&t.shiftKey&&l.prevSelectedPointsIndices?.includes(l.lastClickedPoint)?d&&d.filter(p=>p!==l.lastClickedPoint):d:d?.includes(l.lastClickedPoint)?[l.lastClickedPoint]:d,isDragging:!1,pointerOffset:{x:0,y:0}}}static isSegmentTooShort(t,n,a,i,r){if(Q(t))return i>=0&&i<t.points.length?Pe(n,a)*r.value<we.POINT_HANDLE_SIZE/2:!1;let s=Pe(n,a);return t.points.length>2&&t.roundness&&(s=TA(t,a)),s*r.value<we.POINT_HANDLE_SIZE*4}static getSegmentMidPoint(t,n,a,i,r){let s=To(n,a);if(t.points.length>2&&t.roundness){let o=Mb(t,t.points[i]);if(o){let d=jA(t,t.points[i],.5);s=we.getPointGlobalCoordinates(t,Cb(o[0],o[1],o[2],o[3],d),r)}}return s}static getSegmentMidPointIndex(t,n,a,i){let r=we.getElement(t.elementId,i);if(!r)return-1;let s=we.getEditorMidPoints(r,i,n),o=0;for(;o<s.length;){if(we.arePointsEqual(a,s[o]))return o+1;o++}return-1}static handlePointerDown(t,n,a,i,r,s){let o=n.state,d=s.getNonDeletedElementsMap(),c=s.getNonDeletedElements(),l={didAddPoint:!1,hitElement:null,linearElementEditor:null};if(!r)return l;let{elementId:u}=r,f=we.getElement(u,d);if(!f)return l;let p=we.getSegmentMidpointHitCoords(r,i,o,d),U=null;if(p)U=we.getSegmentMidPointIndex(r,o,p,d);else if(t.altKey&&o.editingLinearElement)return r.lastUncommittedPoint==null&&(X(f,{points:[...f.points,we.createPointAt(f,d,i.x,i.y,t[D.CTRL_OR_CMD]?null:n.getEffectiveGridSize())]}),l.didAddPoint=!0),a.shouldCaptureIncrement(),l.linearElementEditor={...r,pointerDownState:{prevSelectedPointsIndices:r.selectedPointsIndices,lastClickedPoint:-1,lastClickedIsEndPoint:!1,origin:{x:i.x,y:i.y},segmentMidpoint:{value:p,index:U,added:!1}},selectedPointsIndices:[f.points.length-1],lastUncommittedPoint:null,endBindingElement:aa(i,c,d,n.state.zoom,r.elbowed)},l.didAddPoint=!0,l;let m=we.getPointIndexUnderCursor(f,d,o.zoom,i.x,i.y);if(m>=0||p)l.hitElement=f;else{let{startBindingElement:I,endBindingElement:A}=r;gr(o)&&_a(f)&&ou(f,I,A,d,s)}let[g,b,v,x]=fe(f,d),y=(g+v)/2,w=(b+x)/2,k=m>-1&&z(E(f.x+f.points[m][0],f.y+f.points[m][1]),E(y,w),f.angle),M=m>-1||t.shiftKey?t.shiftKey||r.selectedPointsIndices?.includes(m)?YD([...r.selectedPointsIndices||[],m]):[m]:null;return l.linearElementEditor={...r,pointerDownState:{prevSelectedPointsIndices:r.selectedPointsIndices,lastClickedPoint:m,lastClickedIsEndPoint:m===f.points.length-1,origin:{x:i.x,y:i.y},segmentMidpoint:{value:p,index:U,added:!1}},selectedPointsIndices:M,pointerOffset:k?{x:i.x-k[0],y:i.y-k[1]}:{x:0,y:0}},l}static arePointsEqual(t,n){return!t&&!n?!0:!t||!n?!1:ca(t,n)}static handlePointerMove(t,n,a,i,r){let s=i.state;if(!s.editingLinearElement)return null;let{elementId:o,lastUncommittedPoint:d}=s.editingLinearElement,c=we.getElement(o,r);if(!c)return s.editingLinearElement;let{points:l}=c,u=l[l.length-1];if(!t.altKey)return u===d&&we.deletePoints(c,[l.length-1]),{...s.editingLinearElement,lastUncommittedPoint:null};let f;if(Ol(t)&&l.length>=2){let p=l[l.length-2],[U,m]=we._getShiftLockedDelta(c,r,p,E(n,a),t[D.CTRL_OR_CMD]?null:i.getEffectiveGridSize());f=E(U+p[0],m+p[1])}else f=we.createPointAt(c,r,n-s.editingLinearElement.pointerOffset.x,a-s.editingLinearElement.pointerOffset.y,t[D.CTRL_OR_CMD]||Q(c)?null:i.getEffectiveGridSize());return u===d?we.movePoints(c,[{index:c.points.length-1,point:f}]):we.addPoints(c,[{point:f}]),{...s.editingLinearElement,lastUncommittedPoint:c.points[c.points.length-1]}}static getPointGlobalCoordinates(t,n,a){let[i,r,s,o]=fe(t,a),d=(i+s)/2,c=(r+o)/2,{x:l,y:u}=t;return z(E(l+n[0],u+n[1]),E(d,c),t.angle)}static getPointsGlobalCoordinates(t,n){let[a,i,r,s]=fe(t,n),o=(a+r)/2,d=(i+s)/2;return t.points.map(c=>{let{x:l,y:u}=t;return z(E(l+c[0],u+c[1]),E(o,d),t.angle)})}static getPointAtIndexGlobalCoordinates(t,n,a){let i=n<0?t.points.length+n:n,[r,s,o,d]=fe(t,a),c=(r+o)/2,l=(s+d)/2,u=t.points[i],{x:f,y:p}=t;return z(u?E(f+u[0],p+u[1]):E(f,p),E(c,l),t.angle)}static pointFromAbsoluteCoords(t,n,a){if(Q(t))return E(n[0]-t.x,n[1]-t.y);let[i,r,s,o]=fe(t,a),d=(i+s)/2,c=(r+o)/2,[l,u]=z(E(n[0],n[1]),E(d,c),-t.angle);return E(l-t.x,u-t.y)}static getPointIndexUnderCursor(t,n,a,i,r){let s=we.getPointsGlobalCoordinates(t,n),o=s.length;for(;--o>-1;){let d=s[o];if(Pe(E(i,r),E(d[0],d[1]))*a.value<we.POINT_HANDLE_SIZE+1)return o}return-1}static createPointAt(t,n,a,i,r){let s=Ct(a,i,r),[o,d,c,l]=fe(t,n),u=(o+c)/2,f=(d+l)/2,[p,U]=z(E(s[0],s[1]),E(u,f),-t.angle);return E(p-t.x,U-t.y)}static getNormalizedPoints(t){let{points:n}=t,a=n[0][0],i=n[0][1];return{points:n.map(r=>E(r[0]-a,r[1]-i)),x:t.x+a,y:t.y+i}}static normalizePoints(t){X(t,we.getNormalizedPoints(t))}static duplicateSelectedPoints(t,n){tn(t.editingLinearElement,"Not currently editing a linear element");let{selectedPointsIndices:a,elementId:i}=t.editingLinearElement,r=we.getElement(i,n);tn(r,"The linear element does not exist in the provided Scene"),tn(a!=null,"There are no selected points to duplicate");let{points:s}=r,o=[],d=!1,c=-1,l=s.reduce((u,f,p)=>{if(++c,u.push(f),a.includes(p)){let U=s[p+1];U||(d=!0),u.push(U?E((f[0]+U[0])/2,(f[1]+U[1])/2):E(f[0],f[1])),o.push(c+1),++c}return u},[]);if(X(r,{points:l}),d){let u=r.points[r.points.length-1];we.movePoints(r,[{index:r.points.length-1,point:E(u[0]+30,u[1]+30)}])}return{...t,editingLinearElement:{...t.editingLinearElement,selectedPointsIndices:o}}}static deletePoints(t,n){let a=0,i=0;if(n.includes(0)){let s=t.points.find((o,d)=>!n.includes(d));s&&(a=s[0],i=s[1])}let r=t.points.reduce((s,o,d)=>(n.includes(d)||s.push(s.length?E(o[0]-a,o[1]-i):E(0,0)),s),[]);we._updatePoints(t,r,a,i)}static addPoints(t,n){let a=[...t.points,...n.map(i=>i.point)];we._updatePoints(t,a,0,0)}static movePoints(t,n,a){let{points:i}=t,[r,s]=n.find(({index:l})=>l===0)?.point??E(0,0),[o,d]=E(r-i[0][0],s-i[0][1]),c=Q(t)?[n.find(l=>l.index===0)?.point??i[0],n.find(l=>l.index===i.length-1)?.point??i[i.length-1]]:i.map((l,u)=>{let f=n.find(p=>p.index===u)?.point??l;return E(f[0]-o,f[1]-d)});we._updatePoints(t,c,o,d,a,{isDragging:n.reduce((l,u)=>l||u.isDragging===!0,!1)})}static shouldAddMidpoint(t,n,a,i){let r=we.getElement(t.elementId,i);if(r&&Q(r)||!r)return!1;let{segmentMidpoint:s}=t.pointerDownState;if(s.added||s.value===null||s.index===null||t.pointerDownState.origin===null)return!1;let o=t.pointerDownState.origin,d=Pe(E(o.x,o.y),E(n.x,n.y));return!(!a.editingLinearElement&&d<or/a.zoom.value)}static addMidpoint(t,n,a,i,r){let s=we.getElement(t.elementId,r);if(!s)return;let{segmentMidpoint:o}=t.pointerDownState,d={pointerDownState:t.pointerDownState,selectedPointsIndices:t.selectedPointsIndices},c=we.createPointAt(s,r,n.x,n.y,i&&!Q(s)?a.getEffectiveGridSize():null),l=[...s.points.slice(0,o.index),c,...s.points.slice(o.index)];return X(s,{points:l}),d.pointerDownState={...t.pointerDownState,segmentMidpoint:{...t.pointerDownState.segmentMidpoint,added:!0},lastClickedPoint:o.index},d.selectedPointsIndices=[o.index],d}static _updatePoints(t,n,a,i,r,s){if(Q(t)){let o={};r?.startBinding!==void 0&&(o.startBinding=r.startBinding!==null&&fc(r.startBinding)?r.startBinding:null),r?.endBinding!==void 0&&(o.endBinding=r.endBinding!==null&&fc(r.endBinding)?r.endBinding:null),o.points=Array.from(n),X(t,o,!0,{isDragging:s?.isDragging})}else{let o=D2(t,n),d=D2(t,t.points),c=(o[0]+o[2])/2,l=(o[1]+o[3])/2,u=(d[0]+d[2])/2,f=(d[1]+d[3])/2,p=u-c,U=f-l,m=z(E(a,i),E(p,U),t.angle);X(t,{...r,points:n,x:t.x+m[0],y:t.y+m[1]})}}static _getShiftLockedDelta(t,n,a,i,r){let s=we.getPointGlobalCoordinates(t,a,n);if(Q(t))return[i[0]-s[0],i[1]-s[1]];let[o,d]=Ct(i[0],i[1],r),{width:c,height:l}=Hf(s[0],s[1],o,d);return z(E(c,l),E(0,0),-t.angle)}static moveFixedSegment(t,n,a,i,r){let s=we.getElement(t.elementId,r);if(!s||!Q(s))return t;if(n&&n>0&&n<s.points.length){let o=Qa(Or(ie(s.points[n],s.points[n-1]))),d=(s.fixedSegments??[]).reduce((f,p)=>(f[p.index]=p,f),{});d[n]={index:n,start:E(o?s.points[n-1][0]:a-s.x,o?i-s.y:s.points[n-1][1]),end:E(o?s.points[n][0]:a-s.x,o?i-s.y:s.points[n][1])};let c=Object.values(d).sort((f,p)=>f.index-p.index),l=c.map(f=>f.index).reduce((f,p)=>p<n?f+1:f,0);X(s,{fixedSegments:c});let u=E(s.x+(s.fixedSegments[l].start[0]+s.fixedSegments[l].end[0])/2,s.y+(s.fixedSegments[l].start[1]+s.fixedSegments[l].end[1])/2);return{...t,segmentMidPointHoveredCoords:u,pointerDownState:{...t.pointerDownState,segmentMidpoint:{added:!1,index:s.fixedSegments[l].index,value:u}}}}return t}static deleteFixedSegment(t,n){X(t,{fixedSegments:t.fixedSegments?.filter(a=>a.index!==n)}),X(t,{},!0)}};j(bt,"POINT_HANDLE_SIZE",10),j(bt,"getEditorMidPoints",(e,t,n)=>{let a=ge(e,t);return!Q(e)&&!n.editingLinearElement&&e.points.length>2&&!a?[]:(xi.version===e.version&&xi.zoom===n.zoom.value||bt.updateEditorMidPointsCache(e,t,n),xi.points)}),j(bt,"updateEditorMidPointsCache",(e,t,n)=>{let a=bt.getPointsGlobalCoordinates(e,t),i=0,r=[];for(;i<a.length-1;){if(bt.isSegmentTooShort(e,e.points[i],e.points[i+1],i,n.zoom)){r.push(null),i++;continue}let s=bt.getSegmentMidPoint(e,a[i],a[i+1],i+1,t);r.push(s),i++}xi.points=r,xi.version=e.version,xi.zoom=n.zoom.value}),j(bt,"getSegmentMidpointHitCoords",(e,t,n,a)=>{let{elementId:i}=e,r=bt.getElement(i,a);if(!r)return null;let s=bt.getPointIndexUnderCursor(r,a,n.zoom,t.x,t.y);if(!Q(r)&&s>=0||bt.getPointsGlobalCoordinates(r,a).length>=3&&!n.editingLinearElement&&!Q(r))return null;let o=(bt.POINT_HANDLE_SIZE+1)/n.zoom.value,d=e.segmentMidPointHoveredCoords;if(d&&Pe(E(d[0],d[1]),E(t.x,t.y))<=o)return d;let c=0,l=bt.getEditorMidPoints(r,a,n);for(;c<l.length;){if(l[c]!==null&&Pe(l[c],E(t.x,t.y))<=o)return l[c];c++}return null}),j(bt,"getBoundTextElementPosition",(e,t,n)=>{let a=bt.getPointsGlobalCoordinates(e,n);a.length<2&&X(t,{isDeleted:!0});let i=0,r=0;if(e.points.length%2===1){let s=Math.floor(e.points.length/2),o=bt.getPointGlobalCoordinates(e,e.points[s],n);i=o[0]-t.width/2,r=o[1]-t.height/2}else{let s=e.points.length/2-1,o=xi.points[s];e.points.length===2&&(o=To(a[0],a[1])),(!o||xi.version!==e.version)&&(o=bt.getSegmentMidPoint(e,a[s],a[s+1],s+1,n)),i=o[0]-t.width/2,r=o[1]-t.height/2}return{x:i,y:r}}),j(bt,"getMinMaxXYWithBoundText",(e,t,n,a)=>{let[i,r,s,o]=n,d=(i+s)/2,c=(r+o)/2,{x:l,y:u}=bt.getBoundTextElementPosition(e,a,t),f=l+a.width,p=u+a.height,U=E(d,c),m=z(E(i,r),U,e.angle),g=z(E(s,r),U,e.angle),b=z(E(l,u),U,-e.angle),v=z(E(f,u),U,-e.angle),x=z(E(l,p),U,-e.angle),y=z(E(f,p),U,-e.angle);return m[0]<g[0]&&m[1]>=g[1]?(i=Math.min(i,x[0]),s=Math.max(s,Math.max(v[0],y[0])),r=Math.min(r,b[1]),o=Math.max(o,y[1])):m[0]>=g[0]&&m[1]>g[1]?(i=Math.min(i,y[0]),s=Math.max(s,Math.max(b[0],v[0])),r=Math.min(r,x[1]),o=Math.max(o,v[1])):m[0]>=g[0]?(i=Math.min(i,v[0]),s=Math.max(s,x[0]),r=Math.min(r,y[1]),o=Math.max(o,b[1])):m[1]<=g[1]&&(i=Math.min(i,Math.min(v[0],b[0])),s=Math.max(s,y[0]),r=Math.min(r,v[1]),o=Math.max(o,x[1])),[i,r,s,o,d,c]}),j(bt,"getElementAbsoluteCoords",(e,t,n=!1)=>{let a,i,r,s,o;if(e.points.length<2||!ut.get(e)){let{minX:u,minY:f,maxX:p,maxY:U}=e.points.reduce((m,[g,b])=>(m.minY=Math.min(m.minY,b),m.minX=Math.min(m.minX,g),m.maxX=Math.max(m.maxX,g),m.maxY=Math.max(m.maxY,b),m),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});i=u+e.x,r=f+e.y,s=p+e.x,o=U+e.y}else{let u=ut.generateElementShape(e,null),f=Ji(u[0]),[p,U,m,g]=su(f);i=p+e.x,r=U+e.y,s=m+e.x,o=g+e.y}let d=(i+s)/2,c=(r+o)/2;if(a=[i,r,s,o,d,c],!n)return a;let l=ge(e,t);return l&&(a=bt.getMinMaxXYWithBoundText(e,t,[i,r,s,o],l)),a});var J=bt,YD=e=>{let t=[...new Set(e.filter(n=>n!==null&&n!==-1))];return t=t.sort((n,a)=>n-a),t.length?t:null},Rs={},yc=(e,t)=>{let n=Rs[e]||(Rs[e]={height:t});return n.height=t,n},i8=e=>{Rs[e]&&delete Rs[e]},KD=e=>Rs[e]?.height??null,ln=(e,t,n,a=!0)=>{let i,r={x:e.x,y:e.y,text:e.text,width:e.width,height:e.height,angle:t?.angle??e.angle};r.text=e.text,(t||!e.autoResize)&&(i=t?di(t,e):e.width,r.text=Vr(e.originalText,Xe(e),i));let s=nn(r.text,Xe(e),e.lineHeight);if(e.autoResize&&(r.width=s.width),r.height=s.height,t){let o=Uu(t,e),d=di(t,e);if(!ve(t)&&s.height>o){let f=$r(s.height,t.type);X(t,{height:f},a),yc(t.id,f)}if(s.width>d){let f=$r(s.width,t.type);X(t,{width:f},a)}let c={...e,...r},{x:l,y:u}=pu(t,c,n);r.x=l,r.y=u}X(e,r,a)},r8=(e,t,n)=>{let a=oe(e);t.forEach(i=>{let r=n.get(i.id),s=oi(i);if(s){let o=n.get(s);if(o){let d=a.get(r);d&&X(d,{boundElements:(i.boundElements||[]).filter(l=>l.id!==o&&l.id!==s).concat({type:"text",id:o})});let c=a.get(o);c&&q(c)&&X(c,{containerId:d?r:null})}}})},Ro=(e,t,n,a=!1)=>{if(!oi(e))return;i8(e.id);let i=ge(e,t);if(i&&i.text){if(!e)return;let r=i.text,s=i.height,o=i.width,d=di(e,i),c=Uu(e,i),l=e.height;if(a||n!=="n"&&n!=="s"){r&&(r=Vr(i.originalText,Xe(i),d));let u=nn(r,Xe(i),i.lineHeight);s=u.height,o=u.width}if(s>c){l=$r(s,e.type);let u=l-e.height,f=!ve(e)&&(n==="ne"||n==="nw"||n==="n")?e.y-u:e.y;X(e,{height:l,y:f})}X(i,{text:r,width:o,height:s}),ve(e)||X(i,pu(e,i,t))}},pu=(e,t,n)=>{if(ve(e))return J.getBoundTextElementPosition(e,t,n);let a=qD(e),i=Uu(e,t),r=di(e,t),s,o;return t.verticalAlign===Mn.TOP?o=a.y:t.verticalAlign===Mn.BOTTOM?o=a.y+(i-t.height):o=a.y+(i/2-t.height/2),t.textAlign===ro.LEFT?s=a.x:t.textAlign===ro.RIGHT?s=a.x+(r-t.width):s=a.x+(r/2-t.width/2),{x:s,y:o}},oi=e=>e?.boundElements?.length&&e?.boundElements?.find(t=>t.type==="text")?.id||null,ge=(e,t)=>{if(!e)return null;let n=oi(e);return n&&t.get(n)||null},zt=(e,t)=>e&&e.containerId&&t.get(e.containerId)||null,vh=(e,t,n)=>{if(!ve(e))return{x:e.x+e.width/2,y:e.y+e.height/2};let a=J.getPointsGlobalCoordinates(e,n);if(a.length%2===1){let s=Math.floor(e.points.length/2),o=J.getPointGlobalCoordinates(e,e.points[s],n);return{x:o[0],y:o[1]}}let i=e.points.length/2-1,r=J.getEditorMidPoints(e,n,t)[i];return r||(r=J.getSegmentMidPoint(e,a[i],a[i+1],i+1,n)),{x:r[0],y:r[1]}},qD=e=>{let t=It,n=It;return e.type==="ellipse"&&(t+=e.width/2*(1-Math.sqrt(2)/2),n+=e.height/2*(1-Math.sqrt(2)/2)),e.type==="diamond"&&(t+=e.width/4,n+=e.height/4),{x:e.x+t,y:e.y+n}},JD=(e,t)=>!t||ve(t)?e.angle:t.angle,QD=(e,t)=>e.some(n=>{if(nt(n)){let a=zt(n,t);return!ve(a)}return!1}),eL=(e,t)=>e.some(n=>{if(nt(n)){let a=zt(n,t);return!ve(a)}return q(n)}),tL=new Set(["rectangle","ellipse","diamond","arrow"]),nL=e=>tL.has(e.type),$r=(e,t)=>{e=Math.ceil(e);let n=It*2;return t==="ellipse"?Math.round((e+n)/Math.sqrt(2)*2):t==="arrow"?e+n*8:t==="diamond"?2*(e+n):e+n},di=(e,t)=>{let{width:n}=e;if(ve(e)){let a=(t?.fontSize??pi)*PS;return Math.max(RS*n,a)}return e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-It*2:e.type==="diamond"?Math.round(n/2)-It*2:n-It*2},Uu=(e,t)=>{let{height:n}=e;return ve(e)?n-It*8*2<=0?t.height:n:e.type==="ellipse"?Math.round(n/2*Math.sqrt(2))-It*2:e.type==="diamond"?Math.round(n/2)-It*2:n-It*2},s8=(e,t=`
25
+
26
+ `)=>e.reduce((n,a)=>(q(a)&&n.push(a.text),n),[]).join(t),vn=e=>(e=e.trim(),e&&eS.sanitizeUrl(Td(e))),l8=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),s0=e=>{if(e=vn(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e},Lf=[],G=e=>(Lf=Lf.concat(e),e),o8='<svg viewBox="0 0 24 24" stroke-width="1" width="28" height="28" xmlns="http://www.w3.org/2000/svg">',aL='<path d="M6.164 11.755a5.314 5.314 0 0 1-4.932-5.298 5.314 5.314 0 0 1 5.311-5.311 5.314 5.314 0 0 1 5.307 5.113l8.773 8.773a3.322 3.322 0 0 1 0 4.696l-.895.895a3.322 3.322 0 0 1-4.696 0l-8.868-8.868Z" style="fill:#fff"/>',d8='<path stroke="#1b1b1f" fill="#fff" d="m7.868 11.113 7.773 7.774a2.359 2.359 0 0 0 1.667.691 2.368 2.368 0 0 0 2.357-2.358c0-.625-.248-1.225-.69-1.667L11.201 7.78 9.558 9.469l-1.69 1.643v.001Zm10.273 3.606-3.333 3.333m-3.25-6.583 2 2m-7-7 3 3M3.664 3.625l1 1M2.529 6.922l1.407-.144m5.735-2.932-1.118.866M4.285 9.823l.758-1.194m1.863-6.207-.13 1.408"/>',iL=`data:${ae.svg},${encodeURIComponent(`${o8}${d8}</svg>`)}`,rL=`data:${ae.svg},${encodeURIComponent(`${o8}${aL}${d8}</svg>`)}`,Kn=e=>{e&&(e.style.cursor="")},He=(e,t)=>{e&&(e.style.cursor=t)},ba,z2,c8=(e,t)=>{let n=()=>{let a=t===Me.DARK;ba=document.createElement("canvas"),ba.theme=t,ba.height=20,ba.width=20;let i=ba.getContext("2d");i.lineWidth=1,i.beginPath(),i.arc(ba.width/2,ba.height/2,5,0,2*Math.PI),i.fillStyle=a?Ft.black:Ft.white,i.fill(),i.strokeStyle=a?Ft.white:Ft.black,i.stroke(),z2=ba.toDataURL(ae.svg)};(!ba||ba.theme!==t)&&n(),He(e,`url(${z2}) ${20/2} ${20/2}, auto`)},wa=(e,t)=>{if(e)if(t.activeTool.type==="selection")Kn(e);else if(Ms(t))e.style.cursor=Fe.GRAB;else if(Ea(t))c8(e,t.theme);else if(t.activeTool.type==="laser"){let n=t.theme===Me.LIGHT?iL:rL;e.style.cursor=`url(${n}), auto`}else["image","custom"].includes(t.activeTool.type)?t.activeTool.type!=="image"&&(e.style.cursor=Fe.AUTO):e.style.cursor=Fe.CROSSHAIR},sL=new Q6(Date.now()),lL=0,Ra=()=>Math.floor(sL.next()*2**31),Xn=()=>ri()?`id${lL++}`:C1(),fa=(e,{x:t,y:n,strokeColor:a=ft.strokeColor,backgroundColor:i=ft.backgroundColor,fillStyle:r=ft.fillStyle,strokeWidth:s=ft.strokeWidth,strokeStyle:o=ft.strokeStyle,roughness:d=ft.roughness,opacity:c=ft.opacity,width:l=0,height:u=0,angle:f=0,groupIds:p=[],frameId:U=null,index:m=null,roundness:g=null,boundElements:b=null,link:v=null,locked:x=ft.locked,...y})=>((t<-1e6||t>1e6||n<-1e6||n>1e6||l<-1e6||l>1e6||u<-1e6||u>1e6)&&console.error("New element size or position is too large",{x:t,y:n,width:l,height:u,points:y.points}),{id:y.id||Xn(),type:e,x:t,y:n,width:l,height:u,angle:f,strokeColor:a,backgroundColor:i,fillStyle:r,strokeWidth:s,strokeStyle:o,roughness:d,opacity:c,groupIds:p,frameId:U,index:m,roundness:g,seed:y.seed??Ra(),version:y.version||1,versionNonce:y.versionNonce??0,isDeleted:!1,boundElements:b,updated:Hs(),link:v,locked:x,customData:y.customData}),Pa=e=>fa(e.type,e),B2=e=>fa("embeddable",e),oL=e=>({...fa("iframe",e)}),l0=e=>pe({...fa("frame",e),type:"frame",name:e?.name||null},{}),Rf=e=>pe({...fa("magicframe",e),type:"magicframe",name:e?.name||null},{}),u8=(e,t)=>({x:e.textAlign==="center"?t.width/2:e.textAlign==="right"?t.width:0,y:e.verticalAlign==="middle"?t.height/2:0}),Cn=e=>{let t=e.fontFamily||qi,n=e.fontSize||pi,a=e.lineHeight||Nr(t),i=_s(e.text),r=nn(i,Xe({fontFamily:t,fontSize:n}),a),s=e.textAlign||Io,o=e.verticalAlign||nc,d=u8({textAlign:s,verticalAlign:o},r),c={...fa("text",e),text:i,fontSize:n,fontFamily:t,textAlign:s,verticalAlign:o,x:e.x-d.x,y:e.y-d.y,width:r.width,height:r.height,containerId:e.containerId||null,originalText:e.originalText??i,autoResize:e.autoResize??!0,lineHeight:a};return pe(c,{})},dL=(e,t,n)=>{let{width:a,height:i}=nn(n,Xe(e),e.lineHeight);e.autoResize||(a=e.width);let{textAlign:r,verticalAlign:s}=e,o,d;if(r==="center"&&s===Mn.MIDDLE&&!e.containerId&&e.autoResize){let c=nn(e.text,Xe(e),e.lineHeight),l=u8(e,{width:a-c.width,height:i-c.height});o=e.x-l.x,d=e.y-l.y}else{let[c,l,u,f]=fe(e,t),[p,U,m,g]=Fi(e,a,i,!1),b=(c-p)/2,v=(l-U)/2,x=(u-m)/2,y=(f-g)/2;[o,d]=cL({s:!0,e:r==="center"||r==="left",w:r==="center"||r==="right"},e.x,e.y,e.angle,b,v,x,y)}return{width:a,height:i,x:Number.isFinite(o)?o:e.x,y:Number.isFinite(d)?d:e.y}},cL=(e,t,n,a,i,r,s,o)=>{let d=Math.cos(a),c=Math.sin(a);return e.e&&e.w?t+=i+s:e.e?(t+=i*(1+d),n+=i*c,t+=s*(1-d),n+=s*-c):e.w&&(t+=i*(1-d),n+=i*-c,t+=s*(1+d),n+=s*c),e.n&&e.s?n+=r+o:e.n?(t+=r*c,n+=r*(1-d),t+=o*-c,n+=o*(1+d)):(t+=r*-c,n+=r*(1+d),t+=o*c,n+=o*(1-d)),[t,n]},h8=(e,t,n,a=e.text)=>{if(e.isDeleted)return;(t||!e.autoResize)&&(a=Vr(a,Xe(e),t?di(t,e):e.width));let i=dL(e,n,a);return{text:a,...i}},uL=e=>({...fa(e.type,e),points:e.points||[],pressures:e.pressures||[],simulatePressure:e.simulatePressure,lastCommittedPoint:null}),Sr=e=>({...fa(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:null,endArrowhead:null}),o0=e=>e.elbowed?{...fa(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!0,fixedSegments:e.fixedSegments||[],startIsSpecial:!1,endIsSpecial:!1}:{...fa(e.type,e),points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead||null,endArrowhead:e.endArrowhead||null,elbowed:!1},f8=e=>({...fa("image",e),strokeColor:"transparent",status:e.status??"pending",fileId:e.fileId??null,scale:e.scale??[1,1],crop:e.crop??null}),wc=(e,t=0)=>{if(e==null||typeof e!="object")return e;let n=Object.prototype.toString.call(e);if(n==="[object Object]"){let a=typeof e.constructor=="function"?Object.create(Object.getPrototypeOf(e)):{};for(let i in e)if(e.hasOwnProperty(i)){if(t===0&&(i==="shape"||i==="canvas"))continue;a[i]=wc(e[i],t+1)}return a}if(Array.isArray(e)){let a=e.length,i=new Array(a);for(;a--;)i[a]=wc(e[a],t+1);return i}return be.DEV&&n!=="[object Object]"&&n!=="[object Array]"&&n.startsWith("[object ")&&console.warn(`_deepCloneElement: unexpected object type ${n}. This value will not be cloned!`),e},Gr=e=>wc(e),p8=(e,t)=>{Object.defineProperty(e,$S,{value:t,writable:!1,enumerable:!1})},Ec=()=>Xn(),U8=(e,t,n,a)=>{let i=Gr(n);return ri()&&p8(i,n.id),i.id=Ec(),i.boundElements=null,i.updated=Hs(),i.seed=Ra(),i.groupIds=RD(i.groupIds,e,r=>(t.has(r)||t.set(r,Ec()),t.get(r))),a&&(i=Object.assign(i,a)),i},m8=(e,t)=>{let n=[],a=oe(e),i=new Map,r=o=>{if(i.has(o))return i.get(o);if(a.has(o)){let d=Ec();return i.set(o,d),d}return null},s=new Map;for(let o of e){let d=wc(o);if(d.id=r(o.id),ri()&&p8(d,o.id),t?.randomizeSeed&&(d.seed=Ra(),zo(d)),d.groupIds&&(d.groupIds=d.groupIds.map(c=>(s.has(c)||s.set(c,Ec()),s.get(c)))),"containerId"in d&&d.containerId){let c=r(d.containerId);d.containerId=c}if("boundElements"in d&&d.boundElements&&(d.boundElements=d.boundElements.reduce((c,l)=>{let u=r(l.id);return u&&c.push({...l,id:u}),c},[])),"endBinding"in d&&d.endBinding){let c=r(d.endBinding.elementId);d.endBinding=c?{...d.endBinding,elementId:c}:null}if("startBinding"in d&&d.startBinding){let c=r(d.startBinding.elementId);d.startBinding=c?{...d.startBinding,elementId:c}:null}d.frameId&&(d.frameId=r(d.frameId)),n.push(d)}return n},d0=(e,{shouldThrow:t=!1,includeBoundTextValidation:n=!1,ignoreLogs:a,reconciliationContext:i})=>{let r=[],s=d=>`${d?.index}:${d?.id}:${d?.type}:${d?.isDeleted}:${d?.version}:${d?.versionNonce}`,o=e.map(d=>d.index);for(let[d,c]of o.entries()){let l=o[d-1],u=o[d+1];if(Pf(c,l,u)||r.push(`Fractional indices invariant has been compromised: "${s(e[d-1])}", "${s(e[d])}", "${s(e[d+1])}"`),n&&Hn(e[d])){let f=e[d],p=ge(f,oe(e));p&&p.index<=f.index&&r.push(`Fractional indices invariant for bound elements has been compromised: "${s(p)}", "${s(f)}"`)}}if(r.length){let d=new TC,c=[];if(i&&(c.push("Additional reconciliation context:"),c.push(i.localElements.map(l=>s(l))),c.push(i.remoteElements.map(l=>s(l)))),a||console.error(r.join(`
27
+
28
+ `),d.stack,e.map(l=>s(l)),...c),t)throw d}},g8=e=>e.sort((t,n)=>H2(t)&&H2(n)?t.index<n.index?-1:t.index>n.index?1:t.id<n.id?-1:1:1),Na=(e,t)=>{try{let n=hL(e,t),a=b8(e,n),i=e.map(r=>a.has(r)?{...r,...a.get(r)}:r);d0(i,{includeBoundTextValidation:!1,shouldThrow:!0,ignoreLogs:!0});for(let[r,s]of a)X(r,s,!1)}catch{Oa(e)}return e},Oa=e=>{let t=fL(e),n=b8(e,t);for(let[a,i]of n)X(a,i,!1);return e},hL=(e,t)=>{let n=[],a=0;for(;a<e.length;)if(t.has(e[a].id)){let i=[a-1,a];for(;++a<e.length&&t.has(e[a].id);)i.push(a);i.push(a),n.push(i)}else a++;return n},fL=e=>{let t=[],n,a,i=-1,r=0,s=c=>{let l=e[i]?e[i].index:void 0,u=e[c-1]?.index;return!l&&u||l&&u&&u>l?[u,c-1]:[l,i]},o=c=>{let l=e[r]?e[r].index:void 0;if(l&&c<r)return[l,r];let u=r;for(;++u<e.length;){let f=e[u]?.index;if(!l&&f||l&&f&&f>l)return[f,u]}return[void 0,u]},d=0;for(;d<e.length;){let c=e[d].index;if([n,i]=s(d),[a,r]=o(d),Pf(c,n,a))d++;else{let l=[i,d];for(;++d<e.length;){let u=e[d].index,[f,p]=s(d),[U,m]=o(d);if(Pf(u,f,U))break;[n,i]=[f,p],[a,r]=[U,m],l.push(d)}l.push(r),t.push(l)}}return t},Pf=(e,t,n)=>e?t&&n?t<e&&e<n:!t&&n?e<n:t&&!n?t<e:!!e:!1,b8=(e,t)=>{let n=new Map;for(let a of t){let i=a.shift(),r=a.pop(),s=hf(e[i]?.index,e[r]?.index,a.length);for(let o=0;o<a.length;o++){let d=e[a[o]];n.set(d,{index:s[o]})}}return n},H2=e=>!!e.index,wt=class ya{constructor(t,n){this.deleted=t,this.inserted=n}static create(t,n,a,i){let r=a&&i!=="inserted"?a(t):t,s=a&&i!=="deleted"?a(n):n;return new ya(r,s)}static calculate(t,n,a,i){if(t===n)return ya.empty();let r={},s={};for(let c of this.distinctKeysIterator("full",t,n))r[c]=t[c],s[c]=n[c];let[o,d]=i?i(r,s):[r,s];return ya.create(o,d,a)}static empty(){return new ya({},{})}static isEmpty(t){return!Object.keys(t.deleted).length&&!Object.keys(t.inserted).length}static mergeObjects(t,n,a){let i={...t};for(let r of Object.keys(a))delete i[r];return{...i,...n}}static mergeArrays(t,n,a,i){return Object.values(ya.mergeObjects(Ha(t??[],i),Ha(n??[],i),Ha(a??[],i)))}static diffObjects(t,n,a,i){if(!(!t[a]&&!n[a])&&(typeof t[a]=="object"||typeof n[a]=="object")){let r=t[a]??{},s=n[a]??{},o=ya.getLeftDifferences(r,s).reduce((c,l)=>(c[l]=i(r[l]),c),{}),d=ya.getRightDifferences(r,s).reduce((c,l)=>(c[l]=i(s[l]),c),{});Object.keys(o).length||Object.keys(d).length?(Reflect.set(t,a,o),Reflect.set(n,a,d)):(Reflect.deleteProperty(t,a),Reflect.deleteProperty(n,a))}}static diffArrays(t,n,a,i){if(!(!t[a]&&!n[a])&&(Array.isArray(t[a])||Array.isArray(n[a]))){let r=Array.isArray(t[a])?t[a]:[],s=Array.isArray(n[a])?n[a]:[],o=Ha(ya.getLeftDifferences(Ha(r,i),Ha(s,i))),d=Ha(ya.getRightDifferences(Ha(r,i),Ha(s,i)));if(Object.keys(o).length||Object.keys(d).length){let c=r.filter(u=>o[i?i(u):String(u)]),l=s.filter(u=>d[i?i(u):String(u)]);Reflect.set(t,a,c),Reflect.set(n,a,l)}else Reflect.deleteProperty(t,a),Reflect.deleteProperty(n,a)}}static isLeftDifferent(t,n,a=!1){return!!this.distinctKeysIterator("left",t,n,a).next().value}static isRightDifferent(t,n,a=!1){return!!this.distinctKeysIterator("right",t,n,a).next().value}static getLeftDifferences(t,n,a=!1){return Array.from(this.distinctKeysIterator("left",t,n,a))}static getRightDifferences(t,n,a=!1){return Array.from(this.distinctKeysIterator("right",t,n,a))}static*distinctKeysIterator(t,n,a,i=!1){if(n===a)return;let r=[];t==="left"?r=Object.keys(n):t==="right"?r=Object.keys(a):t==="full"?r=Array.from(new Set([...Object.keys(n),...Object.keys(a)])):Dr(t,`Unknown distinctKeysIterator's join param "${t}"`,!0);for(let s of r){let o=n[s],d=a[s];if(o!==d){if(!i&&typeof o=="object"&&typeof d=="object"&&o!==null&&d!==null&&Wt(o,d))continue;yield s}}}},X2=class fn{constructor(t){this.delta=t}static calculate(t,n){let a=wt.calculate(t,n,void 0,fn.postProcess);return new fn(a)}static empty(){return new fn(wt.create({},{}))}inverse(){let t=wt.create(this.delta.inserted,this.delta.deleted);return new fn(t)}applyTo(t,n){try{let{selectedElementIds:a={},selectedGroupIds:i={}}=this.delta.deleted,{selectedElementIds:r={},selectedGroupIds:s={},selectedLinearElementId:o,editingLinearElementId:d,...c}=this.delta.inserted,l=wt.mergeObjects(t.selectedElementIds,r,a),u=wt.mergeObjects(t.selectedGroupIds,s,i),f=o&&n.has(o)?new J(n.get(o)):null,p=d&&n.has(d)?new J(n.get(d)):null,U={...t,...c,selectedElementIds:l,selectedGroupIds:u,selectedLinearElement:typeof o<"u"?f:t.selectedLinearElement,editingLinearElement:typeof d<"u"?p:t.editingLinearElement},m=this.filterInvisibleChanges(t,U,n);return[U,m]}catch(a){if(console.error("Couldn't apply appstate change",a),be.DEV||be.MODE===bn.TEST)throw a;return[t,!1]}}isEmpty(){return wt.isEmpty(this.delta)}static postProcess(t,n){try{wt.diffObjects(t,n,"selectedElementIds",a=>!0),wt.diffObjects(t,n,"selectedGroupIds",a=>a??!1)}catch(a){if(console.error("Couldn't postprocess appstate change deltas."),be.DEV||be.MODE===bn.TEST)throw a}finally{return[t,n]}}filterInvisibleChanges(t,n,a){let i=Sc(t),r=Sc(n),s=wt.isRightDifferent(fn.stripElementsProps(i),fn.stripElementsProps(r)),o=wt.isRightDifferent(fn.stripStandaloneProps(i),fn.stripStandaloneProps(r));if(!s&&!o)return!1;let d={value:s};if(o){let c=wt.getRightDifferences(fn.stripStandaloneProps(i),fn.stripStandaloneProps(r)),l=new Set;(c.includes("editingGroupId")||c.includes("selectedGroupIds"))&&(l=OD(a));for(let u of c)switch(u){case"selectedElementIds":n[u]=fn.filterSelectedElements(n[u],a,d);break;case"selectedGroupIds":n[u]=fn.filterSelectedGroups(n[u],l,d);break;case"croppingElementId":{let m=n[u],g=m&&a.get(m);g&&!g.isDeleted?d.value=!0:n[u]=null;break}case"editingGroupId":let f=n[u];f?l.has(f)?d.value=!0:n[u]=null:d.value=!0;break;case"selectedLinearElementId":case"editingLinearElementId":let p=fn.convertToAppStateKey(u),U=n[p];if(!U)d.value=!0;else{let m=a.get(U.elementId);m&&!m.isDeleted?d.value=!0:n[p]=null}break;default:Dr(u,`Unknown ObservedElementsAppState's key "${u}"`,!0)}}return d.value}static convertToAppStateKey(t){switch(t){case"selectedLinearElementId":return"selectedLinearElement";case"editingLinearElementId":return"editingLinearElement"}}static filterSelectedElements(t,n,a){let i=Object.keys(t);if(!i.length)return a.value=!0,t;let r={...t};for(let s of i){let o=n.get(s);o&&!o.isDeleted?a.value=!0:delete r[s]}return r}static filterSelectedGroups(t,n,a){if(!Object.keys(t).length)return a.value=!0,t;let i={...t};for(let r of Object.keys(i))n.has(r)?a.value=!0:delete i[r];return i}static stripElementsProps(t){let{editingGroupId:n,selectedGroupIds:a,selectedElementIds:i,editingLinearElementId:r,selectedLinearElementId:s,croppingElementId:o,...d}=t;return d}static stripStandaloneProps(t){let{name:n,viewBackgroundColor:a,...i}=t;return i}},Mi=class ot{constructor(t,n,a){this.added=t,this.removed=n,this.updated=a}static create(t,n,a,i={shouldRedistribute:!1}){let r;if(i.shouldRedistribute){let s=new Map,o=new Map,d=new Map,c=[...t,...n,...a];for(let[l,u]of c)this.satisfiesAddition(u)?s.set(l,u):this.satisfiesRemoval(u)?o.set(l,u):d.set(l,u);r=new ot(s,o,d)}else r=new ot(t,n,a);return(be.DEV||be.MODE===bn.TEST)&&(ot.validate(r,"added",this.satisfiesAddition),ot.validate(r,"removed",this.satisfiesRemoval),ot.validate(r,"updated",this.satisfiesUpdate)),r}static validate(t,n,a){for(let[i,r]of t[n].entries())if(!a(r))throw console.error(`Broken invariant for "${n}" delta, element "${i}", delta:`,r),new Error(`ElementsChange invariant broken for element "${i}".`)}static calculate(t,n){if(t===n)return ot.empty();let a=new Map,i=new Map,r=new Map;for(let s of t.values())if(!n.get(s.id)){let o={...s,isDeleted:!1},d={isDeleted:!0},c=wt.create(o,d,ot.stripIrrelevantProps);i.set(s.id,c)}for(let s of n.values()){let o=t.get(s.id);if(!o){let d={isDeleted:!0},c={...s,isDeleted:!1},l=wt.create(d,c,ot.stripIrrelevantProps);a.set(s.id,l);continue}if(o.versionNonce!==s.versionNonce){let d=wt.calculate(o,s,ot.stripIrrelevantProps,ot.postProcess);if(typeof o.isDeleted=="boolean"&&typeof s.isDeleted=="boolean"&&o.isDeleted!==s.isDeleted){o.isDeleted&&!s.isDeleted?a.set(s.id,d):i.set(s.id,d);continue}wt.isEmpty(d)||r.set(s.id,d)}}return ot.create(a,i,r)}static empty(){return ot.create(new Map,new Map,new Map)}inverse(){let t=r=>{let s=new Map;for(let[o,d]of r.entries())s.set(o,wt.create(d.inserted,d.deleted));return s},n=t(this.added),a=t(this.removed),i=t(this.updated);return ot.create(a,n,i)}isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}applyLatestChanges(t){let n=o=>d=>{let c={};for(let l of Object.keys(d))switch(l){case"boundElements":c[l]=d[l];break;default:c[l]=o[l]}return c},a=o=>{let d=new Map;for(let[c,l]of o.entries()){let u=t.get(c);if(u){let f=wt.create(l.deleted,l.inserted,n(u),"inserted");d.set(c,f)}else d.set(c,l)}return d},i=a(this.added),r=a(this.removed),s=a(this.updated);return ot.create(i,r,s,{shouldRedistribute:!0})}applyTo(t,n){let a=zn(new Map(t)),i,r={containsVisibleDifference:!1,containsZindexDifference:!1};try{let s=ot.createApplier(a,n,r),o=s(this.added),d=s(this.removed),c=s(this.updated),l=this.resolveConflicts(t,a);i=new Map([...o,...d,...c,...l])}catch(s){if(console.error("Couldn't apply elements change",s),be.DEV||be.MODE===bn.TEST)throw s;return[t,!0]}try{ot.redrawTextBoundingBoxes(a,i),a=ot.reorderElements(a,i,r),ot.redrawBoundArrows(a,i)}catch(s){if(console.error("Couldn't mutate elements after applying elements change",s),be.DEV||be.MODE===bn.TEST)throw s}finally{return[a,r.containsVisibleDifference]}}static applyDelta(t,n,a={containsVisibleDifference:!0,containsZindexDifference:!0}){let{boundElements:i,...r}=n.inserted;if(n.deleted.boundElements?.length||n.inserted.boundElements?.length){let s=wt.mergeArrays(t.boundElements,n.inserted.boundElements,n.deleted.boundElements,o=>o.id);Object.assign(r,{boundElements:s})}if(Re(t)){let s=n;(s.deleted.crop||s.inserted.crop)&&Object.assign(r,{crop:s.inserted.crop??null})}if(!a.containsVisibleDifference){let{index:s,...o}=r,d=ot.checkForVisibleDifference(t,o);a.containsVisibleDifference=d}return a.containsZindexDifference||(a.containsZindexDifference=n.deleted.index!==n.inserted.index),pe(t,r)}static checkForVisibleDifference(t,n){return t.isDeleted&&n.isDeleted!==!1?!1:t.isDeleted&&n.isDeleted===!1||t.isDeleted===!1&&n.isDeleted?!0:wt.isRightDifferent(t,n)}resolveConflicts(t,n){let a=new Map,i=(c,l)=>{let u=n.get(c.id);if(!u)return;let f;t.get(c.id)===u?f=pe(u,l):f=X(u,l),a.set(f.id,f),n.set(f.id,f)};for(let[c]of this.removed)ot.unbindAffected(t,n,c,i);for(let[c]of this.added)ot.rebindAffected(t,n,c,i);for(let[c]of Array.from(this.updated).filter(([l,u])=>Object.keys({...u.deleted,...u.inserted}).find(f=>ID.has(f)))){let l=n.get(c);!l||l.isDeleted||ot.rebindAffected(t,n,c,i)}let r=new Map(Array.from(t).filter(([c])=>a.has(c))),{added:s,removed:o,updated:d}=ot.calculate(r,a);for(let[c,l]of s)this.added.set(c,l);for(let[c,l]of o)this.removed.set(c,l);for(let[c,l]of d)this.updated.set(c,l);return a}static unbindAffected(t,n,a,i){let r=()=>t.get(a),s=()=>n.get(a);fs.unbindAffected(n,r(),i),fs.unbindAffected(n,s(),i),ps.unbindAffected(n,r(),i),ps.unbindAffected(n,s(),i)}static rebindAffected(t,n,a,i){let r=()=>t.get(a),s=()=>n.get(a);fs.unbindAffected(n,r(),i),fs.rebindAffected(n,s(),i),ps.unbindAffected(n,r(),(o,d)=>{q(o)&&i(o,d)}),ps.rebindAffected(n,s(),i)}static redrawTextBoundingBoxes(t,n){let a=new Map;for(let i of n.values()){if(nt(i)){let{containerId:r}=i,s=r?t.get(r):void 0;s&&a.set(s.id,{container:s,boundText:i})}if(Hn(i)){let r=oi(i),s=r?t.get(r):void 0;s&&a.set(i.id,{container:i,boundText:s})}}for(let{container:i,boundText:r}of a.values())i.isDeleted||r.isDeleted||ln(r,i,t,!1)}static redrawBoundArrows(t,n){for(let a of n.values())!a.isDeleted&&ua(a)&&xn(a,t,{})}static reorderElements(t,n,a){if(!a.containsZindexDifference)return t;let i=Array.from(t.values()),r=g8([...i]),s=wt.getRightDifferences(i,r,!0).reduce((o,d)=>{let c=i[Number(d)];return c&&n.has(c.id)&&o.set(c.id,c),o},new Map);return!a.containsVisibleDifference&&s.size&&(a.containsVisibleDifference=!0),oe(Na(r,s))}static postProcess(t,n){try{wt.diffArrays(t,n,"boundElements",a=>a.id)}catch(a){if(console.error("Couldn't postprocess elements change deltas."),be.DEV||be.MODE===bn.TEST)throw a}finally{return[t,n]}}static stripIrrelevantProps(t){let{id:n,updated:a,version:i,versionNonce:r,seed:s,...o}=t;return o}};j(Mi,"satisfiesAddition",({deleted:e,inserted:t})=>e.isDeleted===!0&&!t.isDeleted),j(Mi,"satisfiesRemoval",({deleted:e,inserted:t})=>!e.isDeleted&&t.isDeleted===!0),j(Mi,"satisfiesUpdate",({deleted:e,inserted:t})=>!!e.isDeleted==!!t.isDeleted),j(Mi,"createApplier",(e,t,n)=>{let a=Mi.createGetter(e,t,n);return i=>Array.from(i.entries()).reduce((r,[s,o])=>{let d=a(s,o.inserted);if(d){let c=Mi.applyDelta(d,o,n);e.set(c.id,c),r.set(c.id,c)}return r},new Map)}),j(Mi,"createGetter",(e,t,n)=>(a,i)=>{let r=e.get(a);return r||(r=t.get(a),r&&(n.containsZindexDifference=!0,(i.isDeleted===!1||i.isDeleted!==!0&&r.isDeleted===!1)&&(n.containsVisibleDifference=!0))),r});var W2=Mi,Sa=class{constructor(){j(this,"subscribers",[])}on(...e){let t=e.flat().filter(n=>typeof n=="function");return this.subscribers.push(...t),()=>this.off(t)}once(...e){let t=e.flat().filter(a=>typeof a=="function");t.push(()=>n());let n=this.on(...t);return n}off(...e){let t=e.flat();this.subscribers=this.subscribers.filter(n=>!t.includes(n))}trigger(...e){for(let t of this.subscribers)t(...e);return this}clear(){this.subscribers=[]}},x8="__observedAppState",Sc=e=>{let t={name:e.name,editingGroupId:e.editingGroupId,viewBackgroundColor:e.viewBackgroundColor,selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,editingLinearElementId:e.editingLinearElement?.elementId||null,selectedLinearElementId:e.selectedLinearElement?.elementId||null,croppingElementId:e.croppingElementId};return Reflect.defineProperty(t,x8,{value:!0,enumerable:!1}),t},pL=e=>!!Reflect.get(e,x8),B={IMMEDIATELY:"IMMEDIATELY",NEVER:"NEVER",EVENTUALLY:"EVENTUALLY"},UL=class{constructor(e,t){this.elementsChange=e,this.appStateChange=t}},mL=class{constructor(){j(this,"onStoreIncrementEmitter",new Sa),j(this,"scheduledActions",new Set),j(this,"_snapshot",V2.empty()),j(this,"shouldCaptureIncrement",()=>{this.scheduleAction(B.IMMEDIATELY)}),j(this,"shouldUpdateSnapshot",()=>{this.scheduleAction(B.NEVER)}),j(this,"scheduleAction",e=>{this.scheduledActions.add(e),this.satisfiesScheduledActionsInvariant()}),j(this,"commit",(e,t)=>{try{this.scheduledActions.has(B.IMMEDIATELY)?this.captureIncrement(e,t):this.scheduledActions.has(B.NEVER)&&this.updateSnapshot(e,t)}finally{this.satisfiesScheduledActionsInvariant(),this.scheduledActions=new Set}}),j(this,"captureIncrement",(e,t)=>{let n=this.snapshot,a=this.snapshot.maybeClone(e,t);if(n!==a){let i=a.meta.didElementsChange?W2.calculate(n.elements,a.elements):W2.empty(),r=a.meta.didAppStateChange?X2.calculate(n.appState,a.appState):X2.empty();(!i.isEmpty()||!r.isEmpty())&&this.onStoreIncrementEmitter.trigger(new UL(i,r)),this.snapshot=a}}),j(this,"updateSnapshot",(e,t)=>{let n=this.snapshot.maybeClone(e,t);this.snapshot!==n&&(this.snapshot=n)}),j(this,"filterUncomittedElements",(e,t)=>{for(let[n,a]of e.entries()){if(!t.get(n))continue;let i=this.snapshot.elements.get(n);i?i.version<a.version&&t.set(n,i):t.delete(n)}return t}),j(this,"clear",()=>{this.snapshot=V2.empty(),this.scheduledActions=new Set}),j(this,"satisfiesScheduledActionsInvariant",()=>{if(!(this.scheduledActions.size>=0&&this.scheduledActions.size<=3)){let e=`There can be at most three store actions scheduled at the same time, but there are "${this.scheduledActions.size}".`;if(console.error(e,this.scheduledActions.values()),be.DEV||be.MODE===bn.TEST)throw new Error(e)}})}get snapshot(){return this._snapshot}set snapshot(e){this._snapshot=e}},V2=class Nf{constructor(t,n,a={didElementsChange:!1,didAppStateChange:!1,isEmpty:!1}){this.elements=t,this.appState=n,this.meta=a}static empty(){return new Nf(new Map,Sc(Da()),{didElementsChange:!1,didAppStateChange:!1,isEmpty:!0})}isEmpty(){return this.meta.isEmpty}maybeClone(t,n){let a=this.maybeCreateElementsSnapshot(t),i=this.maybeCreateAppStateSnapshot(n),r=!1,s=!1;return this.elements!==a&&(r=!0),this.appState!==i&&(s=!0),!r&&!s?this:new Nf(a,i,{didElementsChange:r,didAppStateChange:s})}maybeCreateAppStateSnapshot(t){if(!t)return this.appState;let n=pL(t)?t:Sc(t);return this.detectChangedAppState(n)?n:this.appState}detectChangedAppState(t){return!Wt(this.appState,t,{selectedElementIds:Wt,selectedGroupIds:Wt})}maybeCreateElementsSnapshot(t){return t?this.detectChangedElements(t)?this.createElementsSnapshot(t):this.elements:this.elements}detectChangedElements(t){if(this.elements===t)return!1;if(this.elements.size!==t.size)return!0;let n=Array.from(t.keys());for(let a=n.length-1;a>=0;a--){let i=this.elements.get(n[a]),r=t.get(n[a]);if(!i||!r||i.id!==r.id||i.versionNonce!==r.versionNonce)return!0}return!1}createElementsSnapshot(t){let n=new Map;for(let[a,i]of this.elements.entries())t.get(a)?n.set(a,i):n.set(a,pe(i,{isDeleted:!0}));for(let[a,i]of t.entries()){let r=n.get(a);(!r||r&&r.versionNonce!==i.versionNonce)&&n.set(a,Gr(i))}return n}},xa=new Map,gL=/^(?:http(?:s)?:\/\/)?(?:www\.)?youtu(?:be\.com|\.be)\/(embed\/|watch\?v=|shorts\/|playlist\?list=|embed\/videoseries\?list=)?([a-zA-Z0-9_-]+)(?:\?t=|&t=|\?start=|&start=)?([a-zA-Z0-9_-]+)?[^\s]*$/,bL=/^(?:http(?:s)?:\/\/)?(?:(?:w){3}\.)?(?:player\.)?vimeo\.com\/(?:video\/)?([^?\s]+)(?:\?.*)?$/,xL=/^https:\/\/(?:www\.)?figma\.com/,G2=/^https:\/\/gist\.github\.com\/([\w_-]+)\/([\w_-]+)/,vL=/^<script[\s\S]*?\ssrc=["'](https:\/\/gist\.github\.com\/.*?)\.js["']/i,Z2=/(?:https?:\/\/)?(?:(?:w){3}\.)?(?:twitter|x)\.com\/[^/]+\/status\/(\d+)/,yL=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:twitter|x)\.com\/[^"']*)/i,wL=/^https:\/\/(?:www\.)?val\.town\/(v|embed)\/[a-zA-Z_$][0-9a-zA-Z_$]+\.[a-zA-Z_$][0-9a-zA-Z_$]+/,EL=/^<(?:iframe|blockquote)[\s\S]*?\s(?:src|href)=["']([^"']*)["'][\s\S]*?>$/i,Y2=/giphy.com\/(?:clips|embed|gifs)\/[a-zA-Z0-9]*?-?([a-zA-Z0-9]+)(?:[^a-zA-Z0-9]|$)/,K2=/^(?:http(?:s)?:\/\/)?(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)\/?(?:\?[^#\s]*)?(?:#[^\s]*)?$/,SL=/^<blockquote[\s\S]*?\shref=["'](https?:\/\/(?:www\.)?reddit\.com\/[^"']*)/i,Of=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","figma.com","link.excalidraw.com","gist.github.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","val.town","giphy.com","reddit.com"]),q2=new Set(["youtube.com","youtu.be","vimeo.com","player.vimeo.com","figma.com","twitter.com","x.com","*.simplepdf.eu","stackblitz.com","reddit.com"]),$l=e=>`<html><body>${e}</body></html>`,Us=e=>{if(!e)return null;if(xa.has(e))return xa.get(e);let t=e,n=q2.has($f(e,q2)||""),a="generic",i={w:560,h:840},r=e.match(gL);if(r?.[2]){let d=r[3]?`&start=${r[3]}`:"",c=e.includes("shorts");switch(a="video",r[1]){case"embed/":case"watch?v=":case"shorts/":e=`https://www.youtube.com/embed/${r[2]}?enablejsapi=1${d}`;break;case"playlist?list=":case"embed/videoseries?list=":e=`https://www.youtube.com/embed/videoseries?list=${r[2]}&enablejsapi=1${d}`;break;default:e=`https://www.youtube.com/embed/${r[2]}?enablejsapi=1${d}`;break}return i=c?{w:315,h:560}:{w:560,h:315},xa.set(t,{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}}let s=e.match(bL);if(s?.[1]){let d=s?.[1],c=/^\d+$/.test(d)?void 0:new URIError("Invalid embed link format");return a="video",e=`https://player.vimeo.com/video/${d}?api=1`,i={w:560,h:315},xa.set(t,{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:a,error:c,sandbox:{allowSameOrigin:n}}}if(e.match(xL))return a="generic",e=`https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(e)}`,i={w:550,h:550},xa.set(t,{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}};let o=e.match(wL);if(o)return e=o[1]==="embed"?o[0]:o[0].replace("/v","/embed"),xa.set(t,{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}};if(Z2.test(e)){let d=e.match(Z2)[1],c=Td(`https://twitter.com/x/status/${d}`),l={type:"document",srcdoc:u=>$l(`<blockquote class="twitter-tweet" data-dnt="true" data-theme="${u}"><a href="${c}"></a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return xa.set(t,l),l}if(K2.test(e)){let[,d,c,l]=e.match(K2),u=Td(`https://reddit.com/r/${d}/comments/${c}/${l}`),f={type:"document",srcdoc:p=>$l(`<blockquote class="reddit-embed-bq" data-embed-theme="${p}"><a href="${u}"></a><br></blockquote><script async="" src="https://embed.reddit.com/widgets.js" charset="UTF-8"><\/script>`),intrinsicSize:{w:480,h:480},sandbox:{allowSameOrigin:n}};return xa.set(t,f),f}if(G2.test(e)){let[,d,c]=e.match(G2),l=Td(`https://gist.github.com/${d}/${c}`),u={type:"document",srcdoc:()=>$l(`
29
+ <script src="${l}.js"><\/script>
30
+ <style type="text/css">
31
+ * { margin: 0px; }
32
+ table, .gist { height: 100%; }
33
+ .gist .gist-file { height: calc(100vh - 2px); padding: 0px; display: grid; grid-template-rows: 1fr auto; }
34
+ </style>
35
+ `),intrinsicSize:{w:550,h:720},sandbox:{allowSameOrigin:n}};return xa.set(e,u),u}return xa.set(e,{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}),{link:e,intrinsicSize:i,type:a,sandbox:{allowSameOrigin:n}}},v8=e=>{let t;Ii(e)?t="IFrame element":t=!e.link||e?.link===""?"Empty Web-Embed":e.link;let n=Math.max(Math.min(e.width/2,e.width/t.length),e.width/30),a=it.Helvetica,i=Xe({fontSize:n,fontFamily:a});return Cn({x:e.x+e.width/2,y:e.y+e.height/2,strokeColor:e.strokeColor!=="transparent"?e.strokeColor:"black",backgroundColor:"transparent",fontFamily:a,fontSize:n,text:Vr(t,i,e.width-20),textAlign:"center",verticalAlign:Mn.MIDDLE,angle:e.angle??0})};G({name:"setEmbeddableAsActiveTool",trackEvent:{category:"toolbar"},target:"Tool",label:"toolBar.embeddable",perform:(e,t,n,a)=>{let i=Et(t,{type:"embeddable"});return wa(a.canvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:Et(t,{type:"embeddable"})},captureUpdate:B.EVENTUALLY}}});var $f=(e,t)=>{try{let{hostname:n}=new URL(e),a=n.replace(/^www\./,"");if(t instanceof Set){if(Of.has(a))return a;let r=a.replace(/^([^.]+)/,"*");return Of.has(r)?r:null}let i=t.replace(/^www\./,"");if(a===i)return i}catch{}return null},kL=e=>{let t=e.match(yL);if(t&&t.length===2)return t[1];let n=e.match(SL);if(n&&n.length===2)return n[1];let a=e.match(vL);if(a&&a.length===2)return a[1];if(Y2.test(e))return`https://giphy.com/embed/${Y2.exec(e)[1]}`;let i=e.match(EL);return i&&i.length===2?i[1]:e},Od=(e,t)=>{if(!e)return!1;if(t!=null)if(typeof t=="function"){let n=t(e);if(typeof n=="boolean")return n}else{if(typeof t=="boolean")return t;if(t instanceof RegExp)return t.test(e);if(Array.isArray(t)){for(let n of t)if(n instanceof RegExp){if(e.match(n))return!0}else if($f(e,n))return!0;return!1}}return!!$f(e,Of)},ll=(e,t,n)=>{let a={sets:t.sets,shape:t.shape,options:{...t.options,fixedDecimalPlaceDigits:n}};return e.draw(a)},ol=(e,t,n,a,i)=>{if(!a.enabled||!a.clip)return null;let r=yn(e,i);if(r){let s=t.ownerDocument.createElementNS(je,"g");return s.setAttributeNS(je,"clip-path",`url(#${r.id})`),n.forEach(o=>s.appendChild(o)),s}return null},$d=(e,t,n,a,i,r,s,o)=>{let d={x:r,y:s},[c,l,u,f]=fe(e,t),p=(u-c)/2-(e.x-c),U=(f-l)/2-(e.y-l);if(q(e)){let x=zt(e,t);if(ve(x)){let[y,w,k,M]=fe(x,t),I=J.getBoundTextElementPosition(x,e,t);p=(k-y)/2-(I.x-y),U=(M-w)/2-(I.y-w),r=r+I.x-e.x,s=s+I.y-e.y}}let m=180*e.angle/Math.PI,g=a;if(e.link){let x=a.ownerDocument.createElementNS(je,"a");x.setAttribute("href",vn(e.link)),g.appendChild(x),g=x}let b=(x,y)=>{ri()&&x.setAttribute("data-id",y.id),g.appendChild(x)},v=(yn(e,t)?.opacity??100)*e.opacity/1e4;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{let x=ut.generateElementShape(e,null),y=ll(n,x,il);v!==1&&(y.setAttribute("stroke-opacity",`${v}`),y.setAttribute("fill-opacity",`${v}`)),y.setAttribute("stroke-linecap","round"),y.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`);let w=ol(e,g,[y],o.frameRendering,t);b(w||y,e);break}case"iframe":case"embeddable":{let x=ut.generateElementShape(e,o),y=ll(n,x,il),w=e.opacity/100;w!==1&&(y.setAttribute("stroke-opacity",`${w}`),y.setAttribute("fill-opacity",`${w}`)),y.setAttribute("stroke-linecap","round"),y.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`),b(y,e);let k=v8(e);$d(k,t,n,g,i,k.x+d.x-e.x,k.y+d.y-e.y,o);let M=ll(n,x,il);for(M.setAttribute("stroke-linecap","round"),M.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`);M.firstChild;)M.removeChild(M.firstChild);let I=la(Math.min(e.width,e.height),e),A=Us(s0(e.link||""));if(o.renderEmbeddables===!1||A?.type==="document"){let _=a.ownerDocument.createElementNS(je,"a");_.setAttribute("href",vn(e.link||"")),_.setAttribute("target","_blank"),_.setAttribute("rel","noopener noreferrer"),_.style.borderRadius=`${I}px`,M.appendChild(_)}else{let _=a.ownerDocument.createElementNS(je,"foreignObject");_.style.width=`${e.width}px`,_.style.height=`${e.height}px`,_.style.border="none";let T=_.ownerDocument.createElementNS(je,"div");T.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),T.style.width="100%",T.style.height="100%";let L=T.ownerDocument.createElement("iframe");L.src=A?.link??"",L.style.width="100%",L.style.height="100%",L.style.border="none",L.style.borderRadius=`${I}px`,L.style.top="0",L.style.left="0",L.allowFullscreen=!0,T.appendChild(L),_.appendChild(T),M.appendChild(_)}b(M,e);break}case"line":case"arrow":{let x=ge(e,t),y=a.ownerDocument.createElementNS(je,"mask");if(x){y.setAttribute("id",`mask-${e.id}`);let M=a.ownerDocument.createElementNS(je,"rect");r=r||0,s=s||0,M.setAttribute("x","0"),M.setAttribute("y","0"),M.setAttribute("fill","#fff"),M.setAttribute("width",`${e.width+100+r}`),M.setAttribute("height",`${e.height+100+s}`),y.appendChild(M);let I=a.ownerDocument.createElementNS(je,"rect"),A=J.getBoundTextElementPosition(e,x,t),_=r+A.x-e.x,T=s+A.y-e.y;I.setAttribute("x",_.toString()),I.setAttribute("y",T.toString()),I.setAttribute("fill","#000"),I.setAttribute("width",`${x.width}`),I.setAttribute("height",`${x.height}`),I.setAttribute("opacity","1"),y.appendChild(I)}let w=a.ownerDocument.createElementNS(je,"g");x&&w.setAttribute("mask",`url(#mask-${e.id})`),w.setAttribute("stroke-linecap","round"),ut.generateElementShape(e,o).forEach(M=>{let I=ll(n,M,il);v!==1&&(I.setAttribute("stroke-opacity",`${v}`),I.setAttribute("fill-opacity",`${v}`)),I.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`),e.type==="line"&&si(e.points)&&e.backgroundColor!=="transparent"&&I.setAttribute("fill-rule","evenodd"),w.appendChild(I)});let k=ol(e,g,[w,y],o.frameRendering,t);k?(b(k,e),g.appendChild(k)):(b(w,e),g.append(y));break}case"freedraw":{let x=ut.generateElementShape(e,o),y=x?ll(n,x,il):a.ownerDocument.createElementNS(je,"g");v!==1&&(y.setAttribute("stroke-opacity",`${v}`),y.setAttribute("fill-opacity",`${v}`)),y.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`),y.setAttribute("stroke","none");let w=a.ownerDocument.createElementNS(je,"path");w.setAttribute("fill",e.strokeColor),w.setAttribute("d",Q1(e)),y.appendChild(w);let k=ol(e,g,[y],o.frameRendering,t);b(k||y,e);break}case"image":{let x=Math.round(e.width),y=Math.round(e.height),w=Dn(e)&&i[e.fileId];if(w){let{reuseImages:k=!0}=o,M=`image-${w.id}`,I=e.width,A=e.height;e.crop&&({width:I,height:A}=li(e),M=`image-crop-${w.id}-${O0(`${I}x${A}`)}`),k||(M=`image-${e.id}`);let _=a.querySelector(`#${M}`);if(!_){_=a.ownerDocument.createElementNS(je,"symbol"),_.id=M;let V=a.ownerDocument.createElementNS(je,"image");V.setAttribute("href",w.dataURL),V.setAttribute("preserveAspectRatio","none"),e.crop||!k?(V.setAttribute("width",`${I}`),V.setAttribute("height",`${A}`)):(V.setAttribute("width","100%"),V.setAttribute("height","100%")),_.appendChild(V),(g.querySelector("defs")||g).prepend(_)}let T=a.ownerDocument.createElementNS(je,"use");T.setAttribute("href",`#${M}`),o.exportWithDarkMode&&w.mimeType!==ae.svg&&T.setAttribute("filter",_b);let L=0,R=0;if(e.crop){let{width:V,height:W}=li(e);L=e.crop.x/(e.crop.naturalWidth/V),R=e.crop.y/(e.crop.naturalHeight/W)}let F=p+L,P=U+R;T.setAttribute("width",`${x+L}`),T.setAttribute("height",`${y+R}`),T.setAttribute("opacity",`${v}`),(e.scale[0]!==1||e.scale[1]!==1)&&T.setAttribute("transform",`translate(${F} ${P}) scale(${e.scale[0]} ${e.scale[1]}) translate(${-F} ${-P})`);let $=a.ownerDocument.createElementNS(je,"g");if(e.crop){let V=a.ownerDocument.createElementNS(je,"mask");V.setAttribute("id",`mask-image-crop-${e.id}`),V.setAttribute("fill","#fff");let W=a.ownerDocument.createElementNS(je,"rect");W.setAttribute("x",`${L}`),W.setAttribute("y",`${R}`),W.setAttribute("width",`${x}`),W.setAttribute("height",`${y}`),V.appendChild(W),g.appendChild(V),$.setAttribute("mask",`url(#${V.id})`)}if($.appendChild(T),$.setAttribute("transform",`translate(${r-L} ${s-R}) rotate(${m} ${F} ${P})`),e.roundness){let V=a.ownerDocument.createElementNS(je,"clipPath");V.id=`image-clipPath-${e.id}`;let W=a.ownerDocument.createElementNS(je,"rect"),K=la(Math.min(e.width,e.height),e);W.setAttribute("width",`${e.width}`),W.setAttribute("height",`${e.height}`),W.setAttribute("rx",`${K}`),W.setAttribute("ry",`${K}`),V.appendChild(W),b(V,e),$.setAttributeNS(je,"clip-path",`url(#${V.id})`)}let O=ol(e,g,[$],o.frameRendering,t);b(O||$,e)}break}case"frame":case"magicframe":{if(o.frameRendering.enabled&&o.frameRendering.outline){let x=document.createElementNS(je,"rect");x.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`),x.setAttribute("width",`${e.width}px`),x.setAttribute("height",`${e.height}px`),x.setAttribute("rx",dt.radius.toString()),x.setAttribute("ry",dt.radius.toString()),x.setAttribute("fill","none"),x.setAttribute("stroke",dt.strokeColor),x.setAttribute("stroke-width",dt.strokeWidth.toString()),b(x,e)}break}default:if(q(e)){let x=a.ownerDocument.createElementNS(je,"g");v!==1&&(x.setAttribute("stroke-opacity",`${v}`),x.setAttribute("fill-opacity",`${v}`)),x.setAttribute("transform",`translate(${r||0} ${s||0}) rotate(${m} ${p} ${U})`);let y=e.text.replace(/\r\n?/g,`
36
+ `).split(`
37
+ `),w=Ao(e.fontSize,e.lineHeight),k=e.textAlign==="center"?e.width/2:e.textAlign==="right"?e.width:0,M=mb(e.fontFamily,e.fontSize,w),I=A5(e.text)?"rtl":"ltr",A=e.textAlign==="center"?"middle":e.textAlign==="right"||I==="rtl"?"end":"start";for(let T=0;T<y.length;T++){let L=a.ownerDocument.createElementNS(je,"text");L.textContent=y[T],L.setAttribute("x",`${k}`),L.setAttribute("y",`${T*w+M}`),L.setAttribute("font-family",Cs(e)),L.setAttribute("font-size",`${e.fontSize}px`),L.setAttribute("fill",e.strokeColor),L.setAttribute("text-anchor",A),L.setAttribute("style","white-space: pre;"),L.setAttribute("direction",I),L.setAttribute("dominant-baseline","alphabetic"),x.appendChild(L)}let _=ol(e,g,[x],o.frameRendering,t);b(_||x,e)}else throw new Error(`Unimplemented type ${e.type}`)}},ML=(e,t,n,a,i,r)=>{a&&(e.filter(s=>!Ln(s)).forEach(s=>{if(!s.isDeleted){if(q(s)&&s.containerId&&t.has(s.containerId))return;try{$d(s,t,n,a,i,s.x+r.offsetX,s.y+r.offsetY,r);let o=ge(s,t);o&&$d(o,t,n,a,i,o.x+r.offsetX,o.y+r.offsetY,r)}catch(o){console.error(o)}}}),e.filter(s=>Ln(s)).forEach(s=>{if(!s.isDeleted)try{$d(s,t,n,a,i,s.x+r.offsetX,s.y+r.offsetY,r)}catch(o){console.error(o)}}))},J2=500,c0=e=>{let t=e.extensions?.reduce((a,i)=>(a.push(ae[i]),a),[]),n=e.extensions?.reduce((a,i)=>i==="jpg"?a.concat(".jpg",".jpeg"):a.concat(`.${i}`),[]);return aS({description:e.description,extensions:n,mimeTypes:t,multiple:e.multiple??!1,legacySetup:(a,i,r)=>{let s=Is(i,J2),o=()=>{d(),document.addEventListener("keyup",s),document.addEventListener("pointerup",s),s()},d=()=>{if(r.files?.length){let l=e.multiple?[...r.files]:r.files[0];a(l)}};requestAnimationFrame(()=>{window.addEventListener("focus",o)});let c=window.setInterval(()=>{d()},J2);return l=>{clearInterval(c),s.cancel(),window.removeEventListener("focus",o),document.removeEventListener("keyup",s),document.removeEventListener("pointerup",s),l&&(console.warn("Opening the file was canceled (legacy-fs)."),l(new iu))}}})},kc=(e,t)=>rS(e,{fileName:`${t.name}.${t.extension}`,description:t.description,extensions:[`.${t.extension}`],mimeTypes:t.mimeTypes},t.fileHandle),CL=(e,t)=>{let n={};for(let a of e)!a.isDeleted&&"fileId"in a&&a.fileId&&t[a.fileId]&&(n[a.fileId]=t[a.fileId]);return n},Po=(e,t,n,a)=>{let i={type:On.excalidraw,version:qc.excalidraw,source:j1,elements:a==="local"?h7(e):JR(e),appState:a==="local"?C5(t):BS(t),files:a==="local"?CL(e,n):void 0};return JSON.stringify(i,null,2)},y8=async(e,t,n,a=t.name||E5)=>{let i=Po(e,t,n,"local"),r=new Blob([i],{type:ae.excalidraw});return{fileHandle:await kc(r,{name:a,extension:"excalidraw",description:"Excalidraw file",fileHandle:$0(t.fileHandle)?null:t.fileHandle})}},IL=async(e,t)=>{let n=await c0({description:"Excalidraw files"});return z0(await B0(n),e,t,n.handle)},_L=e=>e?.type===On.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||typeof e.appState=="object")),w8=e=>typeof e=="object"&&e&&e.type===On.excalidrawLibrary&&(e.version===1||e.version===2),u0=e=>{let t={type:On.excalidrawLibrary,version:qc.excalidrawLibrary,source:j1,libraryItems:e};return JSON.stringify(t,null,2)},TL=async e=>{let t=u0(e);await kc(new Blob([t],{type:ae.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})},E8=e=>new Promise((t,n)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=i=>{n(i)},a.src=e}),S8=async({fileIds:e,files:t,imageCache:n})=>{let a=new Map,i=new Map;return await Promise.all(e.reduce((r,s)=>{let o=t[s];return o&&!a.has(s)?(a.set(s,!0),r.concat((async()=>{try{if(o.mimeType===ae.binary)throw new Error("Only images can be added to ImageCache");let d=E8(o.dataURL),c={image:d,mimeType:o.mimeType};n.set(s,c);let l=await d;n.set(s,{...c,image:l})}catch{i.set(s,!0)}})())):r},[])),{imageCache:n,updatedFiles:a,erroredFiles:i}},k8=e=>e.filter(t=>Dn(t)),jL=e=>e?.nodeName.toLowerCase()==="svg",Q2=e=>{let t=new DOMParser().parseFromString(e,ae.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||!jL(n))throw new Error("Invalid SVG");{n.hasAttribute("xmlns")||n.setAttribute("xmlns",je);let a=n.getAttribute("width"),i=n.getAttribute("height");(a?.includes("%")||a==="auto")&&(a=null),(i?.includes("%")||i==="auto")&&(i=null);let r=n.getAttribute("viewBox");if(!a||!i){if(a=a||"50",i=i||"50",r){let s=r.match(/\d+ +\d+ +(\d+(?:\.\d+)?) +(\d+(?:\.\d+)?)/);s&&([,a,i]=s)}n.setAttribute("width",a),n.setAttribute("height",i)}return r||n.setAttribute("viewBox",`0 0 ${a} ${i}`),n.outerHTML}},M8=document.createElement("img");M8.src=`data:${ae.svg}, ${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>')}`;var C8=document.createElement("img");C8.src=`data:${ae.svg}, ${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-big-right-line"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 9v-3.586a1 1 0 0 1 1.707 -.707l6.586 6.586a1 1 0 0 1 0 1.414l-6.586 6.586a1 1 0 0 1 -1.707 -.707v-3.586h-6v-6h6z" /><path d="M3 9v6" /></svg>')}`;var h0=([e,t,n,a],i,r)=>{let s=$A,o=s/r.zoom.value,d=s/r.zoom.value,c=s/r.zoom.value,l=(e+n)/2,u=(t+a)/2,f=(s-8)/(2*r.zoom.value),p=4/r.zoom.value,U=n+p-f,m=t-p-c+f,[g,b]=z(E(U+o/2,m+d/2),E(l,u),i);return[g-o/2,b-d/2,o,d]},I8=(e,t,n,[a,i])=>{let r=4/n.zoom.value,[s,o,d,c]=fe(e,t),[l,u,f,p]=h0([s,o,d,c],e.angle,n);return a>l-r&&a<l+r+f&&i>u-r&&i<u+p+r},yh=(e,t,n,[a,i],r)=>!e.link||n.selectedElementIds[e.id]?!1:!r&&n.viewModeEnabled&&q1(a,i,e,t)?!0:I8(e,t,n,E(a,i)),mu=(e,t,n,a,i=!0)=>{e.beginPath(),e.arc(t,n,a,0,Math.PI*2),e.fill(),i&&e.stroke()},f0=(e,t)=>[e.width/t,e.height/t],p0=({canvas:e,scale:t,normalizedWidth:n,normalizedHeight:a,theme:i,isExporting:r,viewBackgroundColor:s})=>{let o=e.getContext("2d");return o.setTransform(1,0,0,1,0,0),o.scale(t,t),r&&i===Me.DARK&&(o.filter=L1),typeof s=="string"?((s==="transparent"||s.length===5||s.length===9||/(hsla|rgba)\(/.test(s))&&o.clearRect(0,0,n,a),o.save(),o.fillStyle=s,o.fillRect(0,0,n,a),o.restore()):o.clearRect(0,0,n,a),o},_8=(e,t)=>{let n=window.location.href;try{let a=new URL(n);return a.searchParams.set(sc,e),vn(a.toString())}catch(a){console.error(a)}return vn(n)},T8=(e,t)=>{if(e.length>0&&Mc(e)){if(e.length===1)return{id:e[0].id,type:"element"};if(e.length>1){let n=Object.keys(t.selectedGroupIds)[0];return n?{id:n,type:"group"}:{id:e[0].groupIds[0],type:"group"}}}return null},Mc=e=>!!(e.length===1||e.length>1&&n8(e)),vs=e=>{try{let t=new URL(e);return t.searchParams.has(sc)&&t.host===window.location.host}catch{return!1}},AL=e=>{try{let{searchParams:t}=new URL(e);if(t.has(sc))return t.get(sc)}catch{}return null},cd={Bold:"#dddddd",Regular:"#e5e5e5"},DL=(e,t,n,a,i,r,s,o)=>{let d=a%t-t,c=i%t-t,l=t*r.value,u=1/r.value;e.save(),r.value===1&&e.translate(d%1?0:.5,c%1?0:.5);for(let f=d;f<d+s+t*2;f+=t){let p=n>1&&Math.round(f-a)%(n*t)===0;if(!p&&l<10)continue;let U=Math.min(1/r.value,p?4:1);e.lineWidth=U;let m=[U*3,u+(U+u)];e.beginPath(),e.setLineDash(p?[]:m),e.strokeStyle=p?cd.Bold:cd.Regular,e.moveTo(f,c-t),e.lineTo(f,Math.ceil(c+o+t*2)),e.stroke()}for(let f=c;f<c+o+t*2;f+=t){let p=n>1&&Math.round(f-i)%(n*t)===0;if(!p&&l<10)continue;let U=Math.min(1/r.value,p?4:1);e.lineWidth=U;let m=[U*3,u+(U+u)];e.beginPath(),e.setLineDash(p?[]:m),e.strokeStyle=p?cd.Bold:cd.Regular,e.moveTo(d-t,f),e.lineTo(Math.ceil(d+s+t*2),f),e.stroke()}e.restore()},em=(e,t,n,a)=>{t.translate(e.x+a.scrollX,e.y+a.scrollY),t.beginPath(),t.roundRect?t.roundRect(0,0,e.width,e.height,dt.radius/a.zoom.value):t.rect(0,0,e.width,e.height),t.clip(),t.translate(-(e.x+a.scrollX),-(e.y+a.scrollY))},tm={regularLink:null,elementLink:null},nm=(e,t,n,a)=>{if(e.link&&!n.selectedElementIds[e.id]){let[i,r,s,o]=fe(e,a),[d,c,l,u]=h0([i,r,s,o],e.angle,n),f=d+l/2,p=c+u/2;t.save(),t.translate(n.scrollX+f,n.scrollY+p),t.rotate(e.angle);let U=vs(e.link)?"elementLink":"regularLink",m=tm[U];if(!m||m.zoom!==n.zoom.value){m=Object.assign(document.createElement("canvas"),{zoom:n.zoom.value}),m.width=l*window.devicePixelRatio*n.zoom.value,m.height=u*window.devicePixelRatio*n.zoom.value,tm[U]=m;let g=m.getContext("2d");g.scale(window.devicePixelRatio*n.zoom.value,window.devicePixelRatio*n.zoom.value),g.fillStyle="#fff",g.fillRect(0,0,l,u),U==="elementLink"?g.drawImage(C8,0,0,l,u):g.drawImage(M8,0,0,l,u),g.restore()}t.drawImage(m,d-f,c-p,l,u),t.restore()}},j8=({canvas:e,rc:t,elementsMap:n,allElementsMap:a,visibleElements:i,scale:r,appState:s,renderConfig:o})=>{if(e===null)return;let{renderGrid:d=!0,isExporting:c}=o,[l,u]=f0(e,r),f=p0({canvas:e,scale:r,normalizedWidth:l,normalizedHeight:u,theme:s.theme,isExporting:c,viewBackgroundColor:s.viewBackgroundColor});f.scale(s.zoom.value,s.zoom.value),d&&DL(f,s.gridSize,s.gridStep,s.scrollX,s.scrollY,s.zoom,l/s.zoom.value,u/s.zoom.value);let p=new Set;i.forEach(m=>{m.groupIds.length>0&&s.frameToHighlight&&s.selectedElementIds[m.id]&&(Gi(m,s.frameToHighlight,n)||m.groupIds.find(g=>p.has(g)))&&m.groupIds.forEach(g=>p.add(g))});let U=new Map;i.filter(m=>!Ln(m)).forEach(m=>{try{let g=m.frameId||s.frameToHighlight?.id;if(q(m)&&m.containerId&&n.has(m.containerId))return;if(f.save(),g&&s.frameRendering.enabled&&s.frameRendering.clip){let v=zf(m,n,s);v&&mm(m,v,s,n,U)&&em(v,f,o,s),dr(m,n,a,t,f,o,s)}else dr(m,n,a,t,f,o,s);let b=ge(m,n);b&&dr(b,n,a,t,f,o,s),f.restore(),c||nm(m,f,s,n)}catch(g){console.error(g,m.id,m.x,m.y,m.width,m.height)}}),i.filter(m=>Ln(m)).forEach(m=>{try{let g=()=>{if(dr(m,n,a,t,f,o,s),Ln(m)&&(c||pn(m)&&o.embedsValidationStatus.get(m.id)!==!0)&&m.width&&m.height){let b=v8(m);dr(b,n,a,t,f,o,s)}c||nm(m,f,s,n)};if((m.frameId||s.frameToHighlight?.id)&&s.frameRendering.enabled&&s.frameRendering.clip){f.save();let b=zf(m,n,s);b&&mm(m,b,s,n,U)&&em(b,f,o,s),g(),f.restore()}else g()}catch(g){console.error(g)}}),o.pendingFlowchartNodes?.forEach(m=>{try{dr(m,n,a,t,f,o,s)}catch(g){console.error(g)}})},A8=Jc(e=>{j8(e)},{trailing:!0}),D8=(e,t)=>{if(t){A8(e);return}j8(e)},LL=(e,t)=>{if(e.width<=t)return e;let n=document.createElement("canvas").getContext("2d");n.font=Xe({fontFamily:e.fontFamily,fontSize:e.fontSize});let a=e.text;if(n.measureText(a).width>t)for(let i=a.length;i>0;i--){let r=`${a.slice(0,i)}...`;if(n.measureText(r).width<=t){a=r;break}}return pe(e,{text:a,width:t})},RL=(e,t)=>{let n=[];for(let a of e){if(de(a)){let i=Cn({x:a.x,y:a.y-dt.nameOffsetY,fontFamily:it.Helvetica,fontSize:dt.nameFontSize,lineHeight:dt.nameLineHeight,strokeColor:t.exportWithDarkMode?dt.nameColorDarkTheme:dt.nameColorLightTheme,text:e7(a)});i.y-=i.height,i=LL(i,a.width),n.push(i)}n.push(a)}return n},L8=(e,t)=>(t=t||Da().frameRendering,{enabled:e?!0:t.enabled,outline:e?!1:t.outline,name:e?!1:t.name,clip:e?!0:t.clip}),R8=({elements:e,exportingFrame:t,frameRendering:n,exportWithDarkMode:a})=>{let i;return t?i=T0(e,t):n.enabled&&n.name?i=RL(e,{exportWithDarkMode:a}):i=e,i},P8=async(e,t,n,{exportBackground:a,exportPadding:i=Bs,viewBackgroundColor:r,exportingFrame:s},o=(c,l)=>{let u=document.createElement("canvas");return u.width=c*t.exportScale,u.height=l*t.exportScale,{canvas:u,scale:t.exportScale}},d=async()=>{await ni.loadElementsFonts(e)})=>{await d();let c=L8(s??null,t.frameRendering??null);s&&(c.clip=!1);let l=R8({elements:e,exportingFrame:s,exportWithDarkMode:t.exportWithDarkMode,frameRendering:c});s&&(i=0);let[u,f,p,U]=m0(s?[s]:_0(l),i),{canvas:m,scale:g=1}=o(p,U),b=Da(),{imageCache:v}=await S8({imageCache:new Map,fileIds:k8(l).map(x=>x.fileId),files:n});return D8({canvas:m,rc:Ki.canvas(m),elementsMap:zn(oe(l)),allElementsMap:zn(oe(Oa(e))),visibleElements:l,scale:g,appState:{...t,frameRendering:c,viewBackgroundColor:a?r:null,scrollX:-u+i,scrollY:-f+i,zoom:b.zoom,shouldCacheIgnoreZoom:!1,theme:t.exportWithDarkMode?Me.DARK:Me.LIGHT},renderConfig:{canvasBackgroundColor:r,imageCache:v,renderGrid:!1,isExporting:!0,embedsValidationStatus:new Map,elementsPendingErasure:new Set,pendingFlowchartNodes:null}}),m},El=e=>document.createComment(` ${e} `),U0=async(e,t,n,a)=>{let i=L8(a?.exportingFrame??null,t.frameRendering??null),{exportPadding:r=Bs,exportWithDarkMode:s=!1,viewBackgroundColor:o,exportScale:d=1,exportEmbedScene:c}=t,{exportingFrame:l=null}=a||{},u=R8({elements:e,exportingFrame:l,exportWithDarkMode:s,frameRendering:i});l&&(r=0);let[f,p,U,m]=m0(l?[l]:_0(u),r),g=-f+r,b=-p+r,v=document.createElementNS(je,"svg");v.setAttribute("version","1.1"),v.setAttribute("xmlns",je),v.setAttribute("viewBox",`0 0 ${U} ${m}`),v.setAttribute("width",`${U*d}`),v.setAttribute("height",`${m*d}`),s&&v.setAttribute("filter",L1);let x=v.ownerDocument.createElementNS(je,"defs"),y=v.ownerDocument.createElementNS(je,"metadata");if(v.appendChild(El("svg-source:excalidraw")),v.appendChild(y),v.appendChild(x),c)try{PL({metadataElement:y,payload:Po(e,t,n||{},"local")})}catch(T){console.error(T)}let w=I0(e);if(w.length){let T=oe(e);for(let L of w){let R=v.ownerDocument.createElementNS(je,"clipPath");R.setAttribute("id",L.id);let[F,P,$,O]=fe(L,T),V=($-F)/2-(L.x-F),W=(O-P)/2-(L.y-P),K=v.ownerDocument.createElementNS(je,"rect");K.setAttribute("transform",`translate(${L.x+g} ${L.y+b}) rotate(${L.angle} ${V} ${W})`),K.setAttribute("width",`${L.width}`),K.setAttribute("height",`${L.height}`),l||(K.setAttribute("rx",`${dt.radius}`),K.setAttribute("ry",`${dt.radius}`)),R.appendChild(K),x.appendChild(R)}}let k=a?.skipInliningFonts?[]:await ni.generateFontFaceDeclarations(e),M=`
38
+ `,I=v.ownerDocument.createElementNS(je,"style");if(I.classList.add("style-fonts"),I.appendChild(document.createTextNode(`${M}${k.join(M)}`)),x.appendChild(I),t.exportBackground&&o){let T=v.ownerDocument.createElementNS(je,"rect");T.setAttribute("x","0"),T.setAttribute("y","0"),T.setAttribute("width",`${U}`),T.setAttribute("height",`${m}`),T.setAttribute("fill",o),v.appendChild(T)}let A=Ki.svg(v),_=a?.renderEmbeddables??!1;return ML(u,zn(oe(u)),A,v,n||{},{offsetX:g,offsetY:b,isExporting:!0,exportWithDarkMode:s,renderEmbeddables:_,frameRendering:i,canvasBackgroundColor:o,embedsValidationStatus:_?new Map(u.filter(T=>de(T)).map(T=>[T.id,!0])):new Map,reuseImages:a?.reuseImages??!0}),v},PL=({payload:e,metadataElement:t})=>{let n=v7(JSON.stringify(w7({text:e})),!0);t.appendChild(El(`payload-type:${ae.excalidraw}`)),t.appendChild(El("payload-version:2")),t.appendChild(El("payload-start")),t.appendChild(document.createTextNode(n)),t.appendChild(El("payload-end"))},NL=({svg:e})=>{if(e.includes(`payload-type:${ae.excalidraw}`)){let t=e.match(/<!-- payload-start -->\s*(.+?)\s*<!-- payload-end -->/);if(!t)throw new Error("INVALID");let n=(e.match(/<!-- payload-version:(\d+) -->/)?.[1]||"1")!=="1";try{let a=y7(t[1],n),i=JSON.parse(a);if(!("encoded"in i)){if("type"in i&&i.type===On.excalidraw)return a;throw new Error("FAILED")}return E7(i)}catch(a){throw console.error(a),new Error("FAILED")}}throw new Error("INVALID")},m0=(e,t)=>{let[n,a,i,r]=Ne(e),s=qt(n,i)+t*2,o=qt(a,r)+t*2;return[n,a,s,o]},OL=(e,t,n)=>{let[,,a,i]=m0(e,t).map(r=>Math.trunc(r*n));return[a,i]},$L=class{constructor(t){this.scoreFunction=t,j(this,"content",[])}sinkDown(t){let n=this.content[t];for(;t>0;){let a=(t+1>>1)-1,i=this.content[a];if(this.scoreFunction(n)<this.scoreFunction(i))this.content[a]=n,this.content[t]=i,t=a;else break}}bubbleUp(t){let n=this.content.length,a=this.content[t],i=this.scoreFunction(a);for(;;){let r=t+1<<1,s=r-1,o=null,d=0;if(s<n){let c=this.content[s];d=this.scoreFunction(c),d<i&&(o=s)}if(r<n){let c=this.content[r];this.scoreFunction(c)<(o===null?i:d)&&(o=r)}if(o!==null)this.content[t]=this.content[o],this.content[o]=a,t=o;else break}}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),a=this.content.pop();n<this.content.length&&(this.content[n]=a,this.scoreFunction(a)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}},g0=1,ze=40,FL=(e,t)=>{let n=e.fixedSegments?e.fixedSegments.slice():null;if(n){let a=[];e.points.map(s=>E(e.x+s[0],e.y+s[1])).forEach((s,o,d)=>{if(o<2)return a.push(s);let c=co(s,d[o-1]),l=co(d[o-1],d[o-2]);if(mt(c,l)){let u=n?.findIndex(p=>p.index===o-1)??-1,f=n?.findIndex(p=>p.index===o)??-1;f!==-1&&(n[f].start=E(d[o-2][0]-e.x,d[o-2][1]-e.y)),u!==-1&&n.splice(u,1),a.splice(-1,1),n.forEach(p=>{p.index>o-1&&(p.index-=1)})}return a.push(s)});let i=[];a.forEach((s,o,d)=>{if(o<3)return i.push(s);if(Pe(d[o-2],d[o-1])<g0){let c=n?.findIndex(f=>f.index===o-2)??-1,l=n?.findIndex(f=>f.index===o-1)??-1;l!==-1&&n.splice(l,1),c!==-1&&n.splice(c,1),i.splice(-2,2),n.forEach(f=>{f.index>o-2&&(f.index-=2)});let u=qa(s,d[o-1]);return i.push(E(u?s[0]:d[o-2][0],u?d[o-2][1]:s[1]))}i.push(s)});let r=n.filter(s=>s.index!==1&&s.index!==i.length-1);return r.length===0?Vi(y0(w0(v0(e,x0(e,t,i.map(s=>E(s[0]-e.x,s[1]-e.y)),e.startBinding&&Ps(e.startBinding.elementId,t),e.endBinding&&Ps(e.endBinding.elementId,t)))??[])),r,null,null):(be.DEV&&tn(E0(i),"Invalid elbow points with fixed segments"),Vi(i,r,e.startIsSpecial,e.endIsSpecial))}return{x:e.x,y:e.y,points:e.points,fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}},zL=(e,t,n)=>{let a=t.map(I=>I.index),i=(e.fixedSegments?.map(I=>I.index)??[]).findIndex(I=>!a.includes(I));if(i===-1||!e.fixedSegments?.[i])return{points:e.points};let r=e.fixedSegments[i].index,s=e.fixedSegments[i-1],o=e.fixedSegments[i+1],d=e.x+(s?s.end[0]:0),c=e.y+(s?s.end[1]:0),l=s?null:e.startBinding,u=o?null:e.endBinding,{startHeading:f,endHeading:p,startGlobalPoint:U,endGlobalPoint:m,hoveredStartElement:g,hoveredEndElement:b,...v}=x0({x:d,y:c,startBinding:l,endBinding:u,startArrowhead:null,endArrowhead:null,points:e.points},n,[E(0,0),E(e.x+(o?.start[0]??e.points[e.points.length-1][0])-d,e.y+(o?.start[1]??e.points[e.points.length-1][1])-c)],l&&Ps(l.elementId,n),u&&Ps(u.elementId,n),{isDragging:!1}),{points:x}=Vi(y0(w0(v0(e,{startHeading:f,endHeading:p,startGlobalPoint:U,endGlobalPoint:m,hoveredEndElement:b,...v})??[])),t,null,null),y=[];if(s)for(let I=0;I<s.index;I++)y.push(E(e.x+e.points[I][0],e.y+e.points[I][1]));if(x.forEach(I=>{y.push(E(e.x+(s?s.end[0]:0)+I[0],e.y+(s?s.end[1]:0)+I[1]))}),o)for(let I=o.index;I<e.points.length;I++)y.push(E(e.x+e.points[I][0],e.y+e.points[I][1]));let w=(o?.index??e.points.length)-(s?.index??0)-1,k=t.map(I=>I.index>r?{...I,index:I.index-w+(x.length-1)}:I),M=y.flatMap((I,A)=>{let _=y[A-1],T=y[A+1];if(_&&T){let L=co(I,_),R=co(T,I);if(mt(L,R))return k.forEach(F=>{F.index>A&&(F.index-=1)}),[];if(mt(L,Ob(R)))return k.forEach(F=>{F.index>A&&(F.index+=1)}),[I,I]}return[I]});return Vi(M,k,!1,!1)},BL=(e,t,n,a,i,r)=>{let s=t.map((w,k)=>e.fixedSegments==null||e.fixedSegments[k]===void 0||e.fixedSegments[k].index!==w.index||(w.start[0]!==e.fixedSegments[k].start[0]&&w.end[0]!==e.fixedSegments[k].end[0])!=(w.start[1]!==e.fixedSegments[k].start[1]&&w.end[1]!==e.fixedSegments[k].end[1])?k:null).filter(w=>w!==null).shift();if(s==null)return{points:e.points};let o=e.fixedSegments?.findIndex(w=>w.index===1)??-1,d=e.fixedSegments?.findIndex(w=>w.index===e.points.length-1)??-1,c=Pe(t[s].start,t[s].end),l=c<ze+5;if(o===-1&&t[s].index===1&&i){let w=Qa(n),k=(w?mt(n,pt):mt(n,$t))?l?c/2:ze:l?-c/2:-ze;t[s].start=E(t[s].start[0]+(w?k:0),t[s].start[1]+(w?0:k))}if(d===-1&&t[s].index===e.points.length-1&&r){let w=Qa(a),k=(w?mt(a,pt):mt(a,$t))?l?c/2:ze:l?-c/2:-ze;t[s].end=E(t[s].end[0]+(w?k:0),t[s].end[1]+(w?0:k))}let u=t.map(w=>({...w,start:E(e.x+w.start[0],e.y+w.start[1]),end:E(e.x+w.end[0],e.y+w.end[1])})),f=e.points.map((w,k)=>E(e.x+w[0],e.y+w[1])),p=u[s].index-1,U=u[s].index,m=u[s].start,g=u[s].end,b=f[p-1]&&!ca(f[p],f[p-1])?qa(f[p-1],f[p]):void 0,v=f[U+1]&&!ca(f[U],f[U+1])?qa(f[U+1],f[U]):void 0;if(b!==void 0){let w=b?1:0;f[p-1][w]=m[w]}if(f[p]=m,f[U]=g,v!==void 0){let w=v?1:0;f[U+1][w]=g[w]}let x=u.findIndex(w=>w.index===p);if(x!==-1){let w=qa(u[x].end,u[x].start)?1:0;u[x].start[w]=m[w],u[x].end=m}let y=u.findIndex(w=>w.index===U+1);if(y!==-1){let w=qa(u[y].end,u[y].start)?1:0;u[y].end[w]=g[w],u[y].start=g}if(o===-1&&p===0){let w=i?Qa(n):qa(f[1],f[0]);f.unshift(E(w?m[0]:e.x+e.points[0][0],w?e.y+e.points[0][1]:m[1])),i&&f.unshift(E(e.x+e.points[0][0],e.y+e.points[0][1]));for(let k of u)k.index+=i?2:1}if(d===-1&&U===e.points.length-1){let w=Qa(a);f.push(E(w?g[0]:e.x+e.points[e.points.length-1][0],w?e.y+e.points[e.points.length-1][1]:g[1])),r&&f.push(E(e.x+e.points[e.points.length-1][0],e.y+e.points[e.points.length-1][1]))}return Vi(f,u.map(w=>({...w,start:E(w.start[0]-e.x,w.start[1]-e.y),end:E(w.end[0]-e.x,w.end[1]-e.y)})),!1,!1)},HL=(e,t,n,a,i,r,s,o,d)=>{let c=e.startIsSpecial??null,l=e.endIsSpecial??null,u=t.map((g,b)=>b===0||b===t.length-1?E(e.x+g[0],e.y+g[1]):E(e.x+e.points[b][0],e.y+e.points[b][1])),f=n.map(g=>({...g,start:E(e.x+(g.start[0]-t[0][0]),e.y+(g.start[1]-t[0][1])),end:E(e.x+(g.end[0]-t[0][0]),e.y+(g.end[1]-t[0][1]))})),p=[],U=2+(c?1:0),m=2+(l?1:0);for(;p.length+U<u.length-m;)p.push(u[p.length+U]);{let g=u[c?2:1],b=u[c?3:2],v=Qa(a),x=Qa(Or(ie(g,b)));if(o&&v===x){let y=v?mt(a,pt):mt(a,$t);if(p.unshift(E(x?r[0]+(y?ze:-ze):b[0],x?b[1]:r[1]+(y?ze:-ze))),p.unshift(E(v?r[0]+(y?ze:-ze):r[0],v?r[1]:r[1]+(y?ze:-ze))),!c){c=!0;for(let w of f)w.index>1&&(w.index+=1)}}else if(p.unshift(E(x?r[0]:g[0],x?g[1]:r[1])),c){c=!1;for(let y of f)y.index>1&&(y.index-=1)}p.unshift(r)}{let g=u[u.length-(l?3:2)],b=u[u.length-(l?4:3)],v=Qa(i),x=qa(b,g);if(d&&v===x){let y=v?mt(i,pt):mt(i,$t);p.push(E(x?s[0]+(y?ze:-ze):b[0],x?b[1]:s[1]+(y?ze:-ze))),p.push(E(v?s[0]+(y?ze:-ze):s[0],v?s[1]:s[1]+(y?ze:-ze))),l||(l=!0)}else p.push(E(x?s[0]:g[0],x?g[1]:s[1])),l&&(l=!1)}return p.push(s),Vi(p,f.map(({index:g})=>({index:g,start:p[g-1],end:p[g]})).map(g=>({...g,start:E(g.start[0]-r[0],g.start[1]-r[1]),end:E(g.end[0]-r[0],g.end[1]-r[1])})),c,l)},Ze=1e6,b0=(e,t,n,a)=>{if(e.points.length<2)return{points:n.points??e.points};(e.x<-Ze||e.x>Ze||e.y<-Ze||e.y>Ze||e.x+(n?.points?.[n?.points?.length-1]?.[0]??0)<-Ze||e.x+(n?.points?.[n?.points?.length-1]?.[0]??0)>Ze||e.y+(n?.points?.[n?.points?.length-1]?.[1]??0)<-Ze||e.y+(n?.points?.[n?.points?.length-1]?.[1]??0)>Ze||e.x+(e?.points?.[e?.points?.length-1]?.[0]??0)<-Ze||e.x+(e?.points?.[e?.points?.length-1]?.[0]??0)>Ze||e.y+(e?.points?.[e?.points?.length-1]?.[1]??0)<-Ze||e.y+(e?.points?.[e?.points?.length-1]?.[1]??0)>Ze)&&console.error("Elbow arrow (or update) is outside reasonable bounds (> 1e6)",{arrow:e,updates:n}),e.x=Se(e.x,-Ze,Ze),e.y=Se(e.y,-Ze,Ze),n.points&&(n.points=n.points.map(([b,v])=>E(Se(b,-Ze,Ze),Se(v,-Ze,Ze))));let i=n.points?n.points&&n.points.length===2?e.points.map((b,v)=>v===0?n.points[0]:v===e.points.length-1?n.points[1]:b):n.points.slice():e.points.slice(),r=typeof n.startBinding<"u"?n.startBinding:e.startBinding,s=typeof n.endBinding<"u"?n.endBinding:e.endBinding,o=r&&Ps(r.elementId,t),d=s&&Ps(s.elementId,t);if(t.size===0&&E0(i)||o?.id!==r?.elementId||d?.id!==s?.elementId)return Vi(i.map(b=>E(e.x+b[0],e.y+b[1])),e.fixedSegments,e.startIsSpecial,e.endIsSpecial);let{startHeading:c,endHeading:l,startGlobalPoint:u,endGlobalPoint:f,hoveredStartElement:p,hoveredEndElement:U,...m}=x0({x:e.x,y:e.y,startBinding:r,endBinding:s,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead,points:e.points},t,i,o,d,a),g=n.fixedSegments??e.fixedSegments??[];return!n.points&&!n.fixedSegments&&!n.startBinding&&!n.endBinding?FL(e,t):n.startBinding===e.startBinding&&n.endBinding===e.endBinding&&(n.points??[]).every((b,v)=>ca(b,e.points[v]??E(1/0,1/0)))?{}:g.length===0?Vi(y0(w0(v0(e,{startHeading:c,endHeading:l,startGlobalPoint:u,endGlobalPoint:f,hoveredEndElement:U,...m})??[])),g,null,null):(e.fixedSegments?.length??0)>g.length?zL(e,g,t):n.points?n.points&&n.fixedSegments?n:HL(e,i,g,c,l,u,f,p,U):BL(e,g,c,l,p,U)},x0=(e,t,n,a,i,r)=>{let s=dc(n[0],Ht(e.x,e.y)),o=dc(n[n.length-1],Ht(e.x,e.y)),d=a,c=i;if(r?.isDragging){let M=Array.from(t.values());d=sm(s,t,M,r?.zoom)||a,c=sm(o,t,M,r?.zoom)||i}let l=im({...e,points:n},"start",e.startBinding?.fixedPoint,s,a,d,r?.isDragging),u=im({...e,points:n},"end",e.endBinding?.fixedPoint,o,i,c,r?.isDragging),f=rm(l,u,t,d,s),p=rm(u,l,t,c,o),U=[l[0]-2,l[1]-2,l[0]+2,l[1]+2],m=[u[0]-2,u[1]-2,u[0]+2,u[1]+2],g=d?Ma(d,vi(f,e.startArrowhead?Ke*6:Ke*2,1)):U,b=c?Ma(c,vi(p,e.endArrowhead?Ke*6:Ke*2,1)):m,v=Ts(l,c?Ma(c,vi(p,ze,ze)):m)||Ts(u,d?Ma(d,vi(f,ze,ze)):U),x=N8(v?[U,m]:[g,b]),y=VL(v?U:g,v?m:b,x,v?vi(f,!d&&!c?0:ze,0):vi(f,!d&&!c?0:ze-(e.startArrowhead?Ke*6:Ke*2),ze),v?vi(p,!d&&!c?0:ze,0):vi(p,!d&&!c?0:ze-(e.endArrowhead?Ke*6:Ke*2),ze),v,d&&Ma(d),c&&Ma(c)),w=am(y[0],f,l),k=am(y[1],p,u);return{dynamicAABBs:y,startDonglePosition:w,startGlobalPoint:l,startHeading:f,endDonglePosition:k,endGlobalPoint:u,endHeading:p,commonBounds:x,hoveredStartElement:d,hoveredEndElement:c,boundsOverlap:v,startElementBounds:g,endElementBounds:b}},v0=(e,t)=>{let{dynamicAABBs:n,startDonglePosition:a,startGlobalPoint:i,startHeading:r,endDonglePosition:s,endGlobalPoint:o,endHeading:d,commonBounds:c,hoveredEndElement:l}=t,u=GL(n,a||i,r,s||o,d,c),f=a&&ud(a,u),p=s&&ud(s,u),U=ud(o,u);U&&l&&(U.closed=!0);let m=ud(i,u);m&&e.startBinding&&(m.closed=!0);let g=f&&p&&(Ts(f.pos,n[1])||Ts(p.pos,n[0])),b=XL(f||m,p||U,u,r||pt,d||pt,g?[]:n);if(b){let v=b.map(x=>[x.pos[0],x.pos[1]]);return f&&v.unshift(i),p&&v.push(o),v}return null},vi=(e,t,n)=>{switch(e){case mn:return[t,n,n,n];case pt:return[n,t,n,n];case $t:return[n,n,t,n]}return[n,n,n,t]},XL=(e,t,n,a,i,r)=>{let s=wh(e.pos,t.pos),o=new $L(d=>d.f);for(o.push(e);o.size()>0;){let d=o.pop();if(!d||d.closed)continue;if(d===t)return WL(e,d);d.closed=!0;let c=YL(d.addr,n);for(let l=0;l<4;l++){let u=c[l];if(!u||u.closed)continue;let f=Wa(u.pos,d.pos,.5);if(bk(...r.map(x=>Ts(f,x))))continue;let p=KL(l),U=d.parent?Or(ie(d.pos,d.parent.pos)):a,m=Ob(U);if(mt(m,p)||lm(e.addr,u.addr)&&mt(p,a)||lm(t.addr,u.addr)&&mt(p,i))continue;let g=U!==p,b=d.g+wh(u.pos,d.pos)+(g?Math.pow(s,3):0),v=u.visited;if(!v||b<u.g){let x=ZL(u,t,p,i);u.visited=!0,u.parent=d,u.h=wh(t.pos,u.pos)+x*Math.pow(s,2),u.g=b,u.f=u.g+u.h,v?o.rescoreElement(u):o.push(u)}}}return null},WL=(e,t)=>{let n=t,a=[];for(;n.parent;)a.unshift(n),n=n.parent;return a.unshift(e),a},wh=(e,t)=>Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1]),VL=(e,t,n,a,i,r,s,o)=>{let d=s??e,c=o??t,[l,u,f,p]=a??[0,0,0,0],[U,m,g,b]=i??[0,0,0,0],v=[e[0]>t[2]?e[1]>t[3]||e[3]<t[1]?Math.min((d[0]+c[2])/2,e[0]-p):(d[0]+c[2])/2:e[0]>t[0]?e[0]-p:n[0]-p,e[1]>t[3]?e[0]>t[2]||e[2]<t[0]?Math.min((d[1]+c[3])/2,e[1]-l):(d[1]+c[3])/2:e[1]>t[1]?e[1]-l:n[1]-l,e[2]<t[0]?e[1]>t[3]||e[3]<t[1]?Math.max((d[2]+c[0])/2,e[2]+u):(d[2]+c[0])/2:e[2]<t[2]?e[2]+u:n[2]+u,e[3]<t[1]?e[0]>t[2]||e[2]<t[0]?Math.max((d[3]+c[1])/2,e[3]+f):(d[3]+c[1])/2:e[3]<t[3]?e[3]+f:n[3]+f],x=[t[0]>e[2]?t[1]>e[3]||t[3]<e[1]?Math.min((c[0]+d[2])/2,t[0]-b):(c[0]+d[2])/2:t[0]>e[0]?t[0]-b:n[0]-b,t[1]>e[3]?t[0]>e[2]||t[2]<e[0]?Math.min((c[1]+d[3])/2,t[1]-U):(c[1]+d[3])/2:t[1]>e[1]?t[1]-U:n[1]-U,t[2]<e[0]?t[1]>e[3]||t[3]<e[1]?Math.max((c[2]+d[0])/2,t[2]+m):(c[2]+d[0])/2:t[2]<e[2]?t[2]+m:n[2]+m,t[3]<e[1]?t[0]>e[2]||t[2]<e[0]?Math.max((c[3]+d[1])/2,t[3]+g):(c[3]+d[1])/2:t[3]<e[3]?t[3]+g:n[3]+g],y=N8([v,x]);if(!r&&v[2]-v[0]+x[2]-x[0]>y[2]-y[0]+1e-11&&v[3]-v[1]+x[3]-x[1]>y[3]-y[1]+1e-11){let[w,k]=[(x[0]+x[2])/2,(x[1]+x[3])/2];if(t[0]>e[2]&&e[1]>t[3]){let M=v[2]+(x[0]-v[2])/2,I=x[3]+(v[1]-x[3])/2;return Dt(Ht(e[2]-w,e[1]-k),Ht(e[0]-w,e[3]-k))>0?[[v[0],v[1],M,v[3]],[M,x[1],x[2],x[3]]]:[[v[0],I,v[2],v[3]],[x[0],x[1],x[2],I]]}else if(e[2]<t[0]&&e[3]<t[1]){let M=v[2]+(x[0]-v[2])/2,I=v[3]+(x[1]-v[3])/2;return Dt(Ht(e[0]-w,e[1]-k),Ht(e[2]-w,e[3]-k))>0?[[v[0],v[1],v[2],I],[x[0],I,x[2],x[3]]]:[[v[0],v[1],M,v[3]],[M,x[1],x[2],x[3]]]}else if(e[0]>t[2]&&e[3]<t[1]){let M=x[2]+(v[0]-x[2])/2,I=v[3]+(x[1]-v[3])/2;return Dt(Ht(e[2]-w,e[1]-k),Ht(e[0]-w,e[3]-k))>0?[[M,v[1],v[2],v[3]],[x[0],x[1],M,x[3]]]:[[v[0],v[1],v[2],I],[x[0],I,x[2],x[3]]]}else if(e[0]>t[2]&&e[1]>t[3]){let M=x[2]+(v[0]-x[2])/2,I=x[3]+(v[1]-x[3])/2;return Dt(Ht(e[0]-w,e[1]-k),Ht(e[2]-w,e[3]-k))>0?[[M,v[1],v[2],v[3]],[x[0],x[1],M,x[3]]]:[[v[0],I,v[2],v[3]],[x[0],x[1],x[2],I]]}}return[v,x]},GL=(e,t,n,a,i,r)=>{let s=new Set,o=new Set;n===Un||n===pt?o.add(t[1]):s.add(t[0]),i===Un||i===pt?o.add(a[1]):s.add(a[0]),e.forEach(l=>{s.add(l[0]),s.add(l[2]),o.add(l[1]),o.add(l[3])}),s.add(r[0]),s.add(r[2]),o.add(r[1]),o.add(r[3]);let d=Array.from(o).sort((l,u)=>l-u),c=Array.from(s).sort((l,u)=>l-u);return{row:d.length,col:c.length,data:d.flatMap((l,u)=>c.map((f,p)=>({f:0,g:0,h:0,closed:!1,visited:!1,parent:null,addr:[p,u],pos:[f,l]})))}},am=(e,t,n)=>{switch(t){case mn:return E(n[0],e[1]);case pt:return E(e[2],n[1]);case $t:return E(n[0],e[3])}return E(e[0],n[1])},ZL=(e,t,n,a)=>{if(a===pt)switch(n){case pt:return e.pos[0]>=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2;case mn:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case $t:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case Un:return e.pos[1]===t.pos[1]?4:2}else if(a===Un)switch(n){case pt:return e.pos[1]===t.pos[1]?4:2;case mn:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case $t:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3;case Un:return e.pos[0]<=t.pos[0]?4:e.pos[1]===t.pos[1]?0:2}else if(a===mn)switch(n){case pt:return e.pos[1]>t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case mn:return e.pos[1]>=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case $t:return e.pos[0]===t.pos[0]?4:2;case Un:return e.pos[1]>t.pos[1]&&e.pos[0]>t.pos[0]?1:3}else if(a===$t)switch(n){case pt:return e.pos[1]<t.pos[1]&&e.pos[0]<t.pos[0]?1:3;case mn:return e.pos[0]===t.pos[0]?4:2;case $t:return e.pos[1]<=t.pos[1]?4:e.pos[0]===t.pos[0]?0:2;case Un:return e.pos[1]<t.pos[1]&&e.pos[0]>t.pos[0]?1:3}return 0},YL=([e,t],n)=>[Sl([e,t-1],n),Sl([e+1,t],n),Sl([e,t+1],n),Sl([e-1,t],n)],Sl=([e,t],n)=>e<0||e>=n.col||t<0||t>=n.row?null:n.data[t*n.col+e]??null,ud=(e,t)=>{for(let n=0;n<t.col;n++)for(let a=0;a<t.row;a++){let i=Sl([n,a],t);if(i&&e[0]===i.pos[0]&&e[1]===i.pos[1])return i}return null},N8=e=>[Math.min(...e.map(t=>t[0])),Math.min(...e.map(t=>t[1])),Math.max(...e.map(t=>t[2])),Math.max(...e.map(t=>t[3]))],Ps=(e,t)=>{let n=t.get(e);return n&&ua(n)?n:null},Vi=(e,t,n,a)=>{let i=e[0][0],r=e[0][1],s=e.map(o=>dc(o,Ut(ie(e[0]),-1)));return(i<-Ze||i>Ze||r<-Ze||r>Ze||i+s[s.length-1][0]<-Ze||r+s[s.length-1][0]>Ze||i+s[s.length-1][1]<-Ze||r+s[s.length-1][1]>Ze)&&console.error("Elbow arrow normalization is outside reasonable bounds (> 1e6)",{x:i,y:r,points:s,...As(s)}),s=s.map(([o,d])=>E(Se(o,-1e6,1e6),Se(d,-1e6,1e6))),{points:s,x:Se(i,-1e6,1e6),y:Se(r,-1e6,1e6),fixedSegments:(t?.length??0)>0?t:null,...As(s),startIsSpecial:n,endIsSpecial:a}},y0=e=>{if(e.length>1){let t=Math.abs(e[0][1]-e[1][1])<Math.abs(e[0][0]-e[1][0]);return e.filter((n,a)=>{if(a===0||a===e.length-1)return!0;let i=e[a+1],r=Math.abs(n[1]-i[1])<Math.abs(n[0]-i[0]);return t===r?(t=r,!1):(t=r,!0)})}return e},w0=e=>e.length>=4?e.filter((t,n)=>{if(n===0||n===e.length-1)return!0;let a=e[n-1];return Pe(a,t)>g0}):e,KL=e=>{switch(e){case 0:return mn;case 1:return pt;case 2:return $t}return Un},im=(e,t,n,a,i,r,s)=>{if(s){if(r){let o=uo(e,r,t);return SD(r,o)}return a}if(i){let o=Df(n||[0,0],i);return Math.abs(lu(i,o)-Ke)>.01?uo(e,i,t):o}return a},rm=(e,t,n,a,i)=>vD(e,t,a,a&&Ma(a,Array(4).fill(lu(a,e))),n,i),sm=(e,t,n,a)=>aa(ta(e),n,t,a,!0,!0),lm=(e,t)=>e[0]===t[0]&&e[1]===t[1],E0=(e,t=g0)=>e.slice(1).map((n,a)=>Math.abs(n[0]-e[a][0])<t||Math.abs(n[1]-e[a][1])<t).every(Boolean),qL={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0,eraser:!1,custom:!0,frame:!0,embeddable:!0,hand:!0,laser:!1,magicframe:!1},JL=e=>Object.keys(it).includes(e)?it[e]:qi,ts=(e,t)=>{if(!t)return null;let n=t.focus||0;return Q(e)?fc(t)?{...t,focus:n,fixedPoint:uu(t.fixedPoint??[0,0])}:null:{...t,focus:n}},yi=(e,t)=>{let n={type:t.type||e.type,version:e.version||1,versionNonce:e.versionNonce??0,index:e.index??null,isDeleted:e.isDeleted??!1,id:e.id||Xn(),fillStyle:e.fillStyle||ft.fillStyle,strokeWidth:e.strokeWidth||ft.strokeWidth,strokeStyle:e.strokeStyle??ft.strokeStyle,roughness:e.roughness??ft.roughness,opacity:e.opacity==null?ft.opacity:e.opacity,angle:e.angle||0,x:t.x??e.x??0,y:t.y??e.y??0,strokeColor:e.strokeColor||ft.strokeColor,backgroundColor:e.backgroundColor||ft.backgroundColor,width:e.width||0,height:e.height||0,seed:e.seed??1,groupIds:e.groupIds??[],frameId:e.frameId??null,roundness:e.roundness?e.roundness:e.strokeSharpness==="round"?{type:Xs(e.type)?St.LEGACY:St.PROPORTIONAL_RADIUS}:null,boundElements:e.boundElementIds?e.boundElementIds.map(a=>({type:"arrow",id:a})):e.boundElements??[],updated:e.updated??Hs(),link:e.link?vn(e.link):null,locked:e.locked??!1};return("customData"in e||"customData"in t)&&(n.customData="customData"in t?t.customData:e.customData),{...e,...n,...i7(n),...t}},QL=e=>{switch(e={...e},e.type){case"text":delete e.rawText;let t=e.fontSize,n=e.fontFamily;if("font"in e){let[l,u]=e.font.split(" ");t=parseFloat(l),n=JL(u)}let a=typeof e.text=="string"&&e.text||"",i=e.lineHeight||(e.height?Sk(e):Nr(e.fontFamily));return e=yi(e,{fontSize:t,fontFamily:n,text:a,textAlign:e.textAlign||Io,verticalAlign:e.verticalAlign||nc,containerId:e.containerId??null,originalText:e.originalText||a,autoResize:e.autoResize??!0,lineHeight:i}),!a&&!e.isDeleted&&(e={...e,originalText:a,isDeleted:!0},e=zo(e)),e;case"freedraw":return yi(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return yi(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1],crop:e.crop??null});case"line":case"draw":let{startArrowhead:r=null,endArrowhead:s=null}=e,o=e.x,d=e.y,c=!Array.isArray(e.points)||e.points.length<2?[E(0,0),E(e.width,e.height)]:e.points;return(c[0][0]!==0||c[0][1]!==0)&&({points:c,x:o,y:d}=J.getNormalizedPoints(e)),yi(e,{type:e.type==="draw"?"line":e.type,startBinding:ts(e,e.startBinding),endBinding:ts(e,e.endBinding),lastCommittedPoint:null,startArrowhead:r,endArrowhead:s,points:c,x:o,y:d,...As(c)});case"arrow":{let{startArrowhead:l=null,endArrowhead:u="arrow"}=e,f=e.x,p=e.y,U=!Array.isArray(e.points)||e.points.length<2?[E(0,0),E(e.width,e.height)]:e.points;(U[0][0]!==0||U[0][1]!==0)&&({points:U,x:f,y:p}=J.getNormalizedPoints(e));let m={type:e.type,startBinding:ts(e,e.startBinding),endBinding:ts(e,e.endBinding),lastCommittedPoint:null,startArrowhead:l,endArrowhead:u,points:U,x:f,y:p,elbowed:e.elbowed,...As(U)};return Q(e)?yi(e,{...m,elbowed:!0,startBinding:ts(e,e.startBinding),endBinding:ts(e,e.endBinding),fixedSegments:e.fixedSegments,startIsSpecial:e.startIsSpecial,endIsSpecial:e.endIsSpecial}):yi(e,m)}case"ellipse":case"rectangle":case"diamond":case"iframe":case"embeddable":return yi(e,{});case"magicframe":case"frame":return yi(e,{name:e.name??null})}return null},eR=(e,t)=>{if(e.boundElements){let n=e.boundElements.slice(),a=new Set;e.boundElements=n.reduce((i,r)=>{let s=t.get(r.id);if(s&&!a.has(r.id)){if(a.add(r.id),s.isDeleted)return i;i.push(r),q(s)&&!s.containerId&&(s.containerId=e.id)}return i},[])}},tR=(e,t)=>{let n=e.containerId?t.get(e.containerId):null;if(!n){e.containerId=null;return}if(!e.isDeleted&&n.boundElements&&!n.boundElements.find(a=>a.id===e.id)){let a=(n.boundElements||(n.boundElements=[])).slice();a.push({type:"text",id:e.id}),n.boundElements=a}},nR=(e,t)=>{e.frameId&&(t.get(e.frameId)||(e.frameId=null))},gu=(e,t,n)=>{let a=new Set,i=t?oe(t):null,r=Oa((e||[]).reduce((o,d)=>{if(d.type!=="selection"&&!Fr(d)){let c=QL(d);if(c){let l=i?.get(d.id);l&&l.version>c.version&&(c=zo(c,l.version)),a.has(c.id)&&(c={...c,id:Xn()}),a.add(c.id),o.push(c)}}return o},[]));if(!n?.repairBindings)return r;let s=oe(r);for(let o of r)o.frameId&&nR(o,s),q(o)&&o.containerId?tR(o,s):o.boundElements&&eR(o,s),n.refreshDimensions&&q(o)&&Object.assign(o,h8(o,zt(o,s),s)),ue(o)&&(o.startBinding&&(!s.has(o.startBinding.elementId)||!ve(o))&&(o.startBinding=null),o.endBinding&&(!s.has(o.endBinding.elementId)||!ve(o))&&(o.endBinding=null));return r.map(o=>{if(Q(o)&&o.startBinding==null&&o.endBinding==null&&!E0(o.points))return{...o,...b0(o,s,{points:[E(0,0),o.points[o.points.length-1]]}),index:o.index};if(Q(o)&&o.startBinding&&o.endBinding&&o.startBinding.elementId===o.endBinding.elementId&&o.points.length>1&&o.points.some(([d,c])=>Math.abs(d)>1e6||Math.abs(c)>1e6)){console.error("Fixing self-bound elbow arrow",o.id);let d=s.get(o.startBinding.elementId);return d?{...o,x:d.x+d.width/2,y:d.y-5,width:d.width,height:d.height,points:[E(0,0),E(0,-10),E(d.width/2+5,-10),E(d.width/2+5,d.height/2+5)]}:(console.error("Bound element not found",o.startBinding.elementId),o)}return o})},aR=(e,t,n)=>{let a=t[e];return a!==void 0?a:n[e]},om={isSidebarDocked:(e,t)=>["defaultSidebarDockedPreference",e.isSidebarDocked??aR("defaultSidebarDockedPreference",e,t)]},O8=(e,t)=>{e=e||{};let n=Da(),a={};for(let i of Object.keys(om))if(i in e){let[r,s]=om[i](e,n);a[r]=s}for(let[i,r]of Object.entries(n)){let s=e[i],o=t?t[i]:void 0;a[i]=s!==void 0?s:o!==void 0?o:r}return{...a,cursorButton:t?.cursorButton||"up",penDetected:t?.penDetected??(e.penMode?e.penDetected??!1:!1),activeTool:{...Et(n,a.activeTool.type&&qL[a.activeTool.type]?a.activeTool:{type:"selection"}),lastActiveTool:null,locked:a.activeTool.locked??!1},zoom:{value:ei(Rl(e.zoom)?e.zoom:e.zoom?.value??n.zoom.value)},openSidebar:typeof e.openSidebar=="string"?{name:sa.name}:a.openSidebar,gridSize:AD(Rl(e.gridSize)?e.gridSize:ic),gridStep:qb(Rl(e.gridStep)?e.gridStep:v5),editingFrame:null}},No=(e,t,n,a)=>({elements:gu(e?.elements,n,a),appState:O8(e?.appState,t||null),files:e?.files||{}}),dm=e=>{let t=gu(Ve(e.elements),null);return t.length?{...e,elements:t}:null},Oo=(e=[],t)=>{let n=[];for(let a of e)if(Array.isArray(a)){let i=dm({status:t,elements:a,id:Xn(),created:Date.now()});i&&n.push(i)}else{let i=a,r=dm({...i,id:i.id||Xn(),status:i.status||t,created:i.created||Date.now()});r&&n.push(r)}return n},Qn=32,Ye=12,zi=256,$8=50,fr="NOT_SPREADSHEET",go="VALID_SPREADSHEET",kl=e=>{let t=/^([-+]?)[$€£¥₩]?([-+]?)([\d.,]+)[%]?$/.exec(e);return t?parseFloat(`${(t[1]||t[2])+t[3]}`.replace(/,/g,"")):null},Eh=(e,t)=>e.slice(1).every(n=>kl(n[t])!==null),cm=e=>{let t=e[0].length;if(t>2)return{type:fr,reason:"More than 2 columns"};if(t===1){if(!Eh(e,0))return{type:fr,reason:"Value is not numeric"};let d=kl(e[0][0])===null,c=(d?e.slice(1):e).map(l=>kl(l[0]));return c.length<2?{type:fr,reason:"Less than two rows"}:{type:go,spreadsheet:{title:d?e[0][0]:null,labels:null,values:c}}}let n=Eh(e,0),a=Eh(e,1);if(!n&&!a)return{type:fr,reason:"Value is not numeric"};let[i,r]=a?[0,1]:[1,0],s=kl(e[0][r])===null,o=s?e.slice(1):e;return o.length<2?{type:fr,reason:"Less than 2 rows"}:{type:go,spreadsheet:{title:s?e[0][r]:null,labels:o.map(d=>d[i]),values:o.map(d=>kl(d[r]))}}},iR=e=>{let t=[];for(let n=0;n<e[0].length;n++){let a=[];for(let i=0;i<e.length;i++)a.push(e[i][n]);t.push(a)}return t},rR=e=>{let t=e.trim().split(`
39
+ `).map(i=>i.trim().split(" "));if(t.length&&t[0].length!==2&&(t=e.trim().split(`
40
+ `).map(i=>i.trim().split(","))),t.length===0)return{type:fr,reason:"No values"};let n=t[0].length;if(!t.every(i=>i.length===n))return{type:fr,reason:"All rows don't have same number of columns"};let a=cm(t);if(a.type!==go){let i=cm(iR(t));if(i.type===go)return i}return a},Cc=uS(oS),$n={fillStyle:"hachure",fontFamily:qi,fontSize:pi,opacity:100,roughness:1,strokeColor:Ee.black,roundness:null,strokeStyle:"solid",strokeWidth:1,verticalAlign:Mn.MIDDLE,locked:!1},F8=e=>{let t=(Qn+Ye)*e.values.length+Ye,n=zi+Ye*2;return{chartWidth:t,chartHeight:n}},sR=(e,t,n,a,i)=>e.labels?.map((r,s)=>Cn({groupIds:[a],backgroundColor:i,...$n,text:r.length>8?`${r.slice(0,5)}...`:r,x:t+s*(Qn+Ye)+Ye*2,y:n+Ye/2,width:Qn,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"}))||[],lR=(e,t,n,a,i)=>{let r=Cn({groupIds:[a],backgroundColor:i,...$n,x:t-Ye,y:n-Ye,text:"0",textAlign:"right"}),s=Cn({groupIds:[a],backgroundColor:i,...$n,x:t-Ye,y:n-zi-r.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"});return[r,s]},oR=(e,t,n,a,i)=>{let{chartWidth:r,chartHeight:s}=F8(e),o=Sr({backgroundColor:i,groupIds:[a],...$n,type:"line",x:t,y:n,width:r,points:[E(0,0),E(r,0)]}),d=Sr({backgroundColor:i,groupIds:[a],...$n,type:"line",x:t,y:n,height:s,points:[E(0,0),E(0,-s)]}),c=Sr({backgroundColor:i,groupIds:[a],...$n,type:"line",x:t,y:n-zi-Ye,strokeStyle:"dotted",width:r,opacity:$8,points:[E(0,0),E(r,0)]});return[o,d,c]},z8=(e,t,n,a,i,r)=>{let{chartWidth:s,chartHeight:o}=F8(e),d=e.title?Cn({backgroundColor:i,groupIds:[a],...$n,text:e.title,x:t+s/2,y:n-zi-Ye*2-pi,roundness:null,textAlign:"center"}):null,c=r?Pa({backgroundColor:i,groupIds:[a],...$n,type:"rectangle",x:t,y:n-o,width:s,height:o,strokeColor:Ee.black,fillStyle:"solid",opacity:6}):null;return[...c?[c]:[],...d?[d]:[],...sR(e,t,n,a,i),...lR(e,t,n,a,i),...oR(e,t,n,a,i)]},dR=(e,t,n)=>{let a=Math.max(...e.values),i=Xn(),r=Cc[Math.floor(Math.random()*Cc.length)];return[...e.values.map((s,o)=>{let d=s/a*zi;return Pa({backgroundColor:r,groupIds:[i],...$n,type:"rectangle",x:t+o*(Qn+Ye)+Ye,y:n-d-Ye,width:Qn,height:d})}),...z8(e,t,n,i,r,be.DEV)]},cR=(e,t,n)=>{let a=Math.max(...e.values),i=Xn(),r=Cc[Math.floor(Math.random()*Cc.length)],s=0,o=[];for(let m of e.values){let g=s*(Qn+Ye),b=-(m/a)*zi;o.push([g,b]),s++}let d=Math.max(...o.map(m=>m[0])),c=Math.max(...o.map(m=>m[1])),l=Math.min(...o.map(m=>m[0])),u=Math.min(...o.map(m=>m[1])),f=Sr({backgroundColor:r,groupIds:[i],...$n,type:"line",x:t+Ye+Qn/2,y:n-Ye,height:c-u,width:d-l,strokeWidth:2,points:o}),p=e.values.map((m,g)=>{let b=g*(Qn+Ye)+Ye/2,v=-(m/a)*zi+Ye/2;return Pa({backgroundColor:r,groupIds:[i],...$n,fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+b+Qn/2,y:n+v-Ye*2,width:Ye,height:Ye})}),U=e.values.map((m,g)=>{let b=g*(Qn+Ye)+Ye/2,v=m/a*zi+Ye/2+Ye;return Sr({backgroundColor:r,groupIds:[i],...$n,type:"line",x:t+b+Qn/2+Ye/2,y:n-v,height:v,strokeStyle:"dotted",opacity:$8,points:[E(0,0),E(0,v)]})});return[...z8(e,t,n,i,r,be.DEV),f,...U,...p]},uR=(e,t,n,a)=>e==="line"?cR(t,n,a):dR(t,n,a),S0="clipboard"in navigator&&"writeText"in navigator.clipboard,k0="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,hR=e=>!!([On.excalidraw,On.excalidrawClipboard,On.excalidrawClipboardWithAPI].includes(e?.type)&&Array.isArray(e.elements)),fR=({types:e,files:t})=>{!e&&!t&&console.warn("createPasteEvent: no types or files provided");let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});if(e)for(let[a,i]of Object.entries(e)){if(typeof i!="string"){t=t||[],t.push(i);continue}try{if(n.clipboardData?.setData(a,i),n.clipboardData?.getData(a)!==i)throw new Error(`Failed to set "${a}" as clipboardData item`)}catch(r){throw new Error(r.message)}}if(t){let a=-1;for(let i of t){a++;try{if(n.clipboardData?.items.add(i),n.clipboardData?.files[a]!==i)throw new Error(`Failed to set file "${i.name}" as clipboardData item`)}catch(r){throw new Error(r.message)}}}return n},pR=({elements:e,files:t})=>{let n=oe(e),a=new Set(e.filter(o=>de(o))),i=!1,r=e.reduce((o,d)=>(Dn(d)&&(i=!0,t&&t[d.fileId]&&(o[d.fileId]=t[d.fileId])),o),{});i&&!t&&console.warn("copyToClipboard: attempting to file element(s) without providing associated `files` object.");let s={type:On.excalidrawClipboard,elements:e.map(o=>{if(yn(o,n)&&!a.has(yn(o,n))){let d=Gr(o);return X(d,{frameId:null}),d}return o}),files:t?r:void 0};return JSON.stringify(s)},B8=async(e,t,n)=>{await Vs(pR({elements:e,files:t}),n)},UR=e=>{let t=rR(e);return t.type===go?{spreadsheet:t.spreadsheet}:null};function H8(e){let t=[];for(let n of e.childNodes)if(n.nodeType===3){let a=n.textContent?.trim();a&&t.push({type:"text",value:a})}else if(n instanceof HTMLImageElement){let a=n.getAttribute("src");a&&a.startsWith("http")&&t.push({type:"imageUrl",value:a})}else t=t.concat(H8(n));return t}var mR=e=>{let t=e.clipboardData?.getData(ae.html);if(!t)return null;try{let n=new DOMParser().parseFromString(t,ae.html),a=H8(n.body);if(a.length)return{type:"mixedContent",value:a}}catch(n){console.error(`error in parseHTMLFromPaste: ${n.message}`)}return null},gR=async()=>{let e={},t;try{t=await navigator.clipboard?.read()}catch(n){try{if(navigator.clipboard?.readText){console.warn(`navigator.clipboard.readText() failed (${n.message}). Failling back to navigator.clipboard.read()`);let a=await navigator.clipboard?.readText();if(a)return{[ae.text]:a}}}catch(a){if(navigator.clipboard?.read)console.warn(`navigator.clipboard.readText() failed (${a.message}). Failling back to navigator.clipboard.read()`);else{if(a.name==="DataError")return console.warn(`navigator.clipboard.read() error, clipboard is probably empty: ${a.message}`),e;throw a}}throw n}for(let n of t)for(let a of n.types)if(O5(SS,a))try{if(a===ae.text||a===ae.html)e[a]=await(await n.getType(a)).text();else if(U7(a)){let i=await n.getType(a),r=Ml(i,a,void 0);e[a]=r}else throw new v2(`Unsupported clipboard type: ${a}`)}catch(i){console.warn(i instanceof v2?i.message:`Cannot retrieve ${a} from clipboardItem: ${i.message}`)}return Object.keys(e).length===0&&console.warn("No clipboard data found from clipboard.read()."),e},bR=async(e,t=!1)=>{try{let n=!t&&e&&mR(e);return n?n.value.every(a=>a.type==="text")?{type:"text",value:e.clipboardData?.getData(ae.text)||n.value.map(a=>a.value).join(`
41
+ `).trim()}:n:{type:"text",value:(e.clipboardData?.getData(ae.text)||"").trim()}}catch{return{type:"text",value:""}}},X8=async(e,t=!1)=>{let n=await bR(e,t);if(n.type==="mixedContent")return{mixedContent:n.value};try{let a=!t&&UR(n.value);if(a)return a}catch(a){console.error(a)}try{let a=JSON.parse(n.value),i=a.type===On.excalidrawClipboardWithAPI;if(hR(a))return{elements:a.elements,files:a.files,text:t?JSON.stringify(a.elements,null,2):void 0,programmaticAPI:i}}catch{}return{text:n.value}},W8=async e=>{try{await navigator.clipboard.write([new window.ClipboardItem({[ae.png]:e})])}catch(t){if(jo(e))await navigator.clipboard.write([new window.ClipboardItem({[ae.png]:await e})]);else throw t}},Vs=async(e,t)=>{if(S0)try{await navigator.clipboard.writeText(e||"");return}catch(n){console.error(n)}try{if(t){if(t.clipboardData?.setData(ae.text,e||""),t.clipboardData?.getData(ae.text)!==e)throw new Error("Failed to setData on clipboardEvent");return}}catch(n){console.error(n)}if(!xR(e))throw new Error("Error copying to clipboard.")},xR=e=>{e||(e=" ");let t=document.documentElement.getAttribute("dir")==="rtl",n=document.createElement("textarea");n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";let a=window.pageYOffset||document.documentElement.scrollTop;n.style.top=`${a}px`,n.style.fontSize="12pt",n.setAttribute("readonly",""),n.value=e,document.body.appendChild(n);let i=!1;try{n.select(),n.setSelectionRange(0,n.value.length),i=document.execCommand("copy")}catch(r){console.error(r)}return n.remove(),i},$o=({elements:e,appState:t,files:n,maxWidthOrHeight:a,getDimensions:i,exportPadding:r,exportingFrame:s})=>{let{elements:o,appState:d}=No({elements:e,appState:t},null,null),{exportBackground:c,viewBackgroundColor:l}=d;return P8(o,{...d,offsetTop:0,offsetLeft:0,width:0,height:0},n||{},{exportBackground:c,exportPadding:r,viewBackgroundColor:l,exportingFrame:s},(u,f)=>{let p=document.createElement("canvas");if(a){typeof i=="function"&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");let m=Math.max(u,f),g=a<m?a/m:t?.exportScale??1;return p.width=u*g,p.height=f*g,{canvas:p,scale:g}}let U=i?.(u,f)||{width:u,height:f};return p.width=U.width,p.height=U.height,{canvas:p,scale:U.scale??1}})},V8=async e=>{let{mimeType:t=ae.png,quality:n}=e;t===ae.png&&typeof n=="number"&&console.warn(`"quality" will be ignored for "${ae.png}" mimeType`),t==="image/jpg"&&(t=ae.jpg),t===ae.jpg&&!e.appState?.exportBackground&&(console.warn(`Defaulting "exportBackground" to "true" for "${ae.jpg}" mimeType`),e={...e,appState:{...e.appState,exportBackground:!0}});let a=await $o(e);return n=n||(/image\/jpe?g/.test(t)?.92:.8),new Promise((i,r)=>{a.toBlob(async s=>{if(!s)return r(new Error("couldn't export to blob"));s&&t===ae.png&&e.appState?.exportEmbedScene&&(s=await k7({blob:s,metadata:Po(e.elements,e.appState,e.files||{},"local")})),i(s)},t,n)})},bu=async({elements:e,appState:t=Da(),files:n={},exportPadding:a,renderEmbeddables:i,exportingFrame:r,skipInliningFonts:s,reuseImages:o})=>{let{elements:d,appState:c}=No({elements:e,appState:t},null,null),l={...c,exportPadding:a};return U0(d,l,n,{exportingFrame:r,renderEmbeddables:i,skipInliningFonts:s,reuseImages:o})},vR=async e=>{if(e.type==="svg"){let t=await bu(e);await Vs(t.outerHTML)}else if(e.type==="png")await W8(V8(e));else if(e.type==="json")await B8(e.elements,e.files);else throw new Error("Invalid export type")},yR=e=>e.type==="diamond"?[E(e.width/2,0),E(e.width,e.height/2),E(e.width/2,e.height),E(0,e.height/2)]:[E(0,0),E(0+e.width,0),E(0+e.width,e.height),E(0,e.height)],wR=e=>ue(e)||Bn(e)?e.points:yR(e),um=e=>{let t=e.reduce((n,[a,i])=>(n.minY=Math.min(n.minY,i),n.minX=Math.min(n.minX,a),n.maxX=Math.max(n.maxX,a),n.maxY=Math.max(n.maxY,i),n),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,cx:0,cy:0});return t.cx=(t.maxX+t.minX)/2,t.cy=(t.maxY+t.minY)/2,t},G8=e=>{let t=wR(e),{cx:n,cy:a}=um(t),i=E(n,a),r=t.map(l=>z(l,i,e.angle)),{minX:s,minY:o,maxX:d,maxY:c}=um(r);return[s+e.x,o+e.y,d+e.x,c+e.y]},Ff=(e,t,n=!1)=>{let a=G8(e),i=t[0]<=a[0]&&t[2]>=a[2]&&t[1]<=a[1]&&t[3]>=a[3];return n?i?!0:a[0]<=t[0]&&a[2]>=t[2]&&a[1]<=t[1]&&a[3]>=t[3]:i},Z8=(e,t)=>{let n=G8(e);return(sd(n[0],Yt(t[0],t[2]))||sd(t[0],Yt(n[0],n[2])))&&(sd(n[1],Yt(t[1],t[3]))||sd(t[1],Yt(n[1],n[3])))},Y8=({elements:e,bounds:t,type:n,errorMargin:a=0})=>{B5(t)&&(t=ha(t,oe(e)));let i=[t[0]-a,t[1]-a,t[2]+a,t[3]+a],r=new Set;for(let s of e)if(!r.has(s.id)&&(n==="overlap"?Z8(s,i):n==="inside"?Ff(s,i):Ff(s,i,!0))){if(r.add(s.id),s.boundElements)for(let o of s.boundElements)r.add(o.id);q(s)&&s.containerId&&r.add(s.containerId),ve(s)&&(s.startBinding&&r.add(s.startBinding.elementId),s.endBinding&&r.add(s.endBinding?.elementId))}return e.filter(s=>r.has(s.id))};function hm(e){return[Math.min(e[0][0],e[1][0]),Math.min(e[0][1],e[1][1]),Math.max(e[0][0],e[1][0]),Math.max(e[0][1],e[1][1])]}function ER(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}var SR=1e-6;function fm(e,t){let n=ie(e[1],e[0]),a=ie(t,e[0]),i=Dt(n,a);return Math.abs(i)<SR}function Sh(e,t){let n=ie(e[1],e[0]),a=ie(t,e[0]);return Dt(n,a)<0}function pm(e,t){return fm(e,t[0])||fm(e,t[1])||(Sh(e,t[0])?!Sh(e,t[1]):Sh(e,t[1]))}function kR(e,t){return ER(hm(e),hm(t))&&pm(e,t)&&pm(t,e)}var K8=(e,t,n)=>{let a=oe(e);for(let i of t)if(i.frameId){let r=n.get(i.id),s=n.get(i.frameId);if(r){let o=a.get(r);o&&X(o,{frameId:s??i.frameId},!1)}}};function M0(e,t,n){let a=_2(t,n),i=_2(e,n);return a.some(r=>i.some(s=>kR(r,s)))}var q8=(e,t,n)=>vu(A0(e,t,n,!1)).filter(a=>!de(a)&&!a.frameId||a.frameId===t.id),C0=(e,t,n)=>A0([t],e,n).some(a=>a.id===t.id),Fo=(e,t,n)=>{let[a,i,r,s]=fe(t,n),[o,d,c,l]=Ne(e);return a<=o&&i<=d&&r>=c&&s>=l},Gi=(e,t,n)=>Fo([e],t,n)||M0(e,t,n)||C0(e,t,n),Um=(e,t,n)=>{let[a,i,r,s]=fe(t,n);return I5(E(a,i),E(e.x,e.y),E(r,s))},MR=e=>{let t=new Map;for(let n of e){let a=de(n)?n.id:n.frameId;a&&!t.has(a)&&t.set(a,$a(e,a))}return t},$a=(e,t)=>{let n=[];for(let a of e.values())a.frameId===t&&n.push(a);return n},I0=e=>e.filter(t=>de(t)),_0=e=>{let t=oe(I0(e));return e.filter(n=>t.has(n.id)||!n.frameId||!t.has(n.frameId))},Fd=(e,t,n,a)=>{let i=$a(e,t.id),r=new Set(i),s=new Set([...q8(e,t,a),...i.filter(f=>C0(f,t,a))]),o=i.filter(f=>!s.has(f)),d=new Set(Array.from(s).flatMap(f=>f.groupIds));for(let f of o)if(!M0(f,t,a))f.groupIds.length===0&&r.delete(f);else if(f.groupIds.length>0)for(let p of f.groupIds)d.add(p);for(let f of o)if(f.groupIds.length>0){let p=!0;for(let U of f.groupIds)d.has(U)&&(p=!1);p&&r.delete(f)}let c=Array.from(s).filter(f=>f.groupIds.length===0);for(let f of c)r.add(f);let l=Array.from(s).filter(f=>f.groupIds.length>0),u=t8(l,n);for(let[f,p]of Object.entries(u))if(p){let U=tt(e,f);if(Fo(U,t,a))for(let m of U)r.add(m)}return[...r].filter(f=>!(q(f)&&f.containerId))},CR=(e,t,n)=>IR(vu(e,q8(e,t,n)),t,n),IR=(e,t,n)=>{let a=[],i=new Map;for(let r of e){let s=!1;if(r.groupIds.length>0){if(r.groupIds.some(o=>i.get(o)))s=!0;else{let o=new Set(r.groupIds.flatMap(d=>tt(n,d)));s=!Fo(Array.from(o),t,n)}r.groupIds.forEach(o=>{i.set(o,s)})}s||a.push(r)}return a},yn=(e,t)=>e.frameId&&t.get(e.frameId)||null,_R=(e,t)=>{let n=new Set,a=oe(e);e=vu(e);for(let s of e)de(s)&&s.id!==t.id&&n.add(s.id);let i=new Set,r=[];for(let s of e)if(!(de(s)||s.frameId&&n.has(s.frameId)))if(s.groupIds.length){let o=s.groupIds.at(-1);if(!i.has(o)){i.add(o);let d=tt(e,o);if(d.some(c=>Gi(c,t,a)))for(let c of d)r.push(c)}}else Gi(s,t,a)&&r.push(s);return r},Fl=(e,t,n,a)=>{let i=oe(e),r=new Map;for(let c of e.values())c.frameId===n.id&&r.set(c.id,!0);let s=new Set(t.map(c=>c.id)),o=[],d=new Set;for(let c of t)de(c)&&c.id!==n.id&&d.add(c.id);for(let c of vu(e,t)){if(de(c)||c.frameId&&d.has(c.frameId)||c.frameId&&a.selectedElementIds[c.id]&&a.selectedElementIds[c.frameId])continue;r.has(c.id)||o.push(c);let l=ge(c,i);l&&!s.has(l.id)&&!r.has(l.id)&&o.push(l)}for(let c of o)X(c,{frameId:n.id},!1);return e},xu=(e,t)=>{let n=new Map,a=new Map;for(let i of e)if(i.frameId){n.set(i.id,i);let r=a.get(i.frameId)||[];r.push(i);let s=ge(i,t);s&&(n.set(s.id,s),r.push(s)),a.set(i.frameId,r)}for(let[,i]of n)X(i,{frameId:null},!1)},J8=(e,t)=>{let n=$a(e,t.id);return xu(n,oe(e)),e},Q8=(e,t,n,a)=>Fl(J8(e,n),t,n,a.state).slice(),Ns=(e,t,n)=>{let a=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,elements:e}),i=new Set(a);if(t.editingGroupId)for(let o of a)o.groupIds.length===0?i.add(o):o.groupIds.flatMap(d=>tt(e,d)).forEach(d=>i.add(d));let r=new Set,s=oe(e);return i.forEach(o=>{o.frameId&&!de(o)&&!Ic(o,s,t)&&r.add(o)}),r.size>0&&xu(r,s),e},vu=(e,t)=>{let n=new Set,a=t||e;for(let s of a.values()){let o=s.groupIds[s.groupIds.length-1];o&&n.add(o)}let i=new Set;for(let s of n)tt(e,s).some(o=>de(o))&&i.add(s);let r=[];for(let s of a.values())i.has(s.groupIds[s.groupIds.length-1])||r.push(s);return r},zf=(e,t,n)=>{let a=q(e)&&zt(e,t)||e;return a.frameId&&n.selectedElementIds[a.id]&&n.selectedElementIds[a.frameId]?yn(a,t):n.selectedElementIds[a.id]&&n.selectedElementsAreBeingDragged?n.frameToHighlight:yn(a,t)},Ic=(e,t,n,a)=>{let i=a?.targetFrame??zf(e,t,n);if(!i)return!1;let r=q(e)&&zt(e,t)||e,s=d=>{a?.checkedGroups&&r.groupIds.forEach(c=>{a.checkedGroups?.set(c,d)})};if(!n.selectedElementIds[r.id]||!n.selectedElementsAreBeingDragged||n.selectedElementIds[r.id]&&n.selectedElementIds[i.id])return!0;if(r.groupIds.length===0)return Gi(r,i,t);for(let d of r.groupIds)if(a?.checkedGroups?.has(d))return a.checkedGroups.get(d);let o=new Set(r.groupIds.filter(d=>a?.checkedGroups?!a.checkedGroups.has(d):!0).flatMap(d=>tt(t,d)));if(n.editingGroupId&&n.selectedElementsAreBeingDragged){let d=new Set(xe(t,n));if(n.frameToHighlight!==null)return!0;d.forEach(c=>{o.delete(c)})}for(let d of o)if(de(d))return s(!1),!1;for(let d of o)if(Gi(d,i,t))return s(!0),!0;return!1},mm=(e,t,n,a,i)=>{if(!n.frameRendering||!n.frameRendering.clip)return!1;let r=M0(e,t,a)||C0(e,t,a);if(r){for(let s of e.groupIds)i?.set(s,!0);return!0}if(!r&&e.groupIds.length>0&&!Fo([e],t,a)){let s=!1;if(n.selectedElementsAreBeingDragged)s=Ic(e,a,n,{targetFrame:t,checkedGroups:i});else{s=e.frameId===t.id;for(let o of e.groupIds)i?.set(o,s)}for(let o of e.groupIds)i?.set(o,s);return s}return!1},e7=e=>e.name===null?F5(e)?"Frame":"AI Frame":e.name,T0=(e,t)=>Y8({elements:e,bounds:t,type:"overlap"}).filter(n=>!n.frameId||n.frameId===t.id),t7=e=>{let t=oe(e);return e.length>1&&e.some(n=>n.frameId&&t.has(n.frameId))},j0=e=>{let t=new Set;return e.forEach(n=>{de(n)&&t.add(n.id)}),e.filter(n=>!(n.frameId&&t.has(n.frameId)))},A0=(e,t,n,a=!0)=>{let[i,r,s,o]=fe(t,n),d=e.filter(c=>{let[l,u,f,p]=ha(c,n),U=yn(c,n);if(U){let[m,g,b,v]=ha(U,n);l=Math.max(m,l),u=Math.max(g,u),f=Math.min(b,f),p=Math.min(v,p)}return c.locked===!1&&c.type!=="selection"&&!nt(c)&&i<=l&&r<=u&&s>=f&&o>=p});return d=a?j0(d):d,d=d.filter(c=>{let l=yn(c,n);return l?Gi(c,l,n):!0}),d},n7=(e,t,n,a)=>{let i=new Set(t.map(r=>r.id));return e.filter(r=>{let s=_c(r,n.width,n.height,n,a);return!i.has(r.id)&&s})},_t=(function(){let e=null,t=null,n=null,a=(i,r)=>(n!=null&&i===e&&r.selectedElementIds===t||(n=i.some(s=>r.selectedElementIds[s.id]),e=i,t=r.selectedElementIds),n);return a.clearCache=()=>{e=null,t=null,n=null},a})(),TR=(e,t,n)=>{let a=Array.from(new Set(xe(e,t).map(i=>n(i))));return a.length===1?a[0]:null},xe=(e,t,n)=>{let a=new Set,i=[];for(let r of e.values()){if(t.selectedElementIds[r.id]){i.push(r),a.add(r.id);continue}if(n?.includeBoundTextElement&&nt(r)&&t.selectedElementIds[r?.containerId]){i.push(r),a.add(r.id);continue}}if(n?.includeElementsInFrames){let r=[];return i.forEach(s=>{de(s)&&$a(e,s.id).forEach(o=>!a.has(o.id)&&r.push(o)),r.push(s)}),r}return i},a7=(e,t)=>t.editingTextElement?[t.editingTextElement]:t.newElement?[t.newElement]:xe(e,t,{includeBoundTextElement:!0}),Le=(e,t)=>Wt(t.selectedElementIds,e)?t.selectedElementIds:e,gm=e=>{let t=new Map,n=[];for(let a of e)a.isDeleted||(n.push(a),t.set(a.id,a));return{elementsMap:t,elements:n}},jR=Mo(e=>{(be.DEV||be.MODE===bn.TEST||window?.DEBUG_FRACTIONAL_INDICES)&&d0(e,{shouldThrow:be.DEV||be.MODE===bn.TEST,includeBoundTextValidation:!0})},1e3*60,{leading:!0,trailing:!1}),AR=e=>{let t=["includeBoundTextElement","includeElementsInFrames"],n="";for(let a of t)n+=`${a}:${e[a]?"1":"0"}`;return n},bm=e=>typeof e=="string",Bf=class zd{constructor(){j(this,"callbacks",new Set),j(this,"nonDeletedElements",[]),j(this,"nonDeletedElementsMap",zn(new Map)),j(this,"elements",[]),j(this,"nonDeletedFramesLikes",[]),j(this,"frames",[]),j(this,"elementsMap",zn(new Map)),j(this,"selectedElementsCache",{selectedElementIds:null,elements:null,cache:new Map}),j(this,"sceneNonce"),j(this,"insertElement",t=>{let n=t.frameId?this.getElementIndex(t.frameId):this.elements.length;this.insertElementAtIndex(t,n)}),j(this,"insertElements",t=>{if(!t.length)return;let n=t[0]?.frameId?this.getElementIndex(t[0].frameId):this.elements.length;this.insertElementsAtIndex(t,n)}),j(this,"getContainerElement",t=>t&&t.containerId&&this.getElement(t.containerId)||null),j(this,"getElementsFromId",t=>{let n=this.getNonDeletedElementsMap(),a=n.get(t);return a?[a]:tt(n,t)})}static mapElementToScene(t,n){bm(t)?this.sceneMapById.set(t,n):(this.sceneMapByElement.set(t,n),this.sceneMapById.set(t.id,n))}static getScene(t){return bm(t)?this.sceneMapById.get(t)||null:this.sceneMapByElement.get(t)||null}getSceneNonce(){return this.sceneNonce}getNonDeletedElementsMap(){return this.nonDeletedElementsMap}getElementsIncludingDeleted(){return this.elements}getElementsMapIncludingDeleted(){return this.elementsMap}getNonDeletedElements(){return this.nonDeletedElements}getFramesIncludingDeleted(){return this.frames}getSelectedElements(t){let n=AR(t),a=t?.elements||this.nonDeletedElements;if(this.selectedElementsCache.elements===a&&this.selectedElementsCache.selectedElementIds===t.selectedElementIds){let r=this.selectedElementsCache.cache.get(n);if(r)return r}else t?.elements==null&&this.selectedElementsCache.cache.clear();let i=xe(a,{selectedElementIds:t.selectedElementIds},t);return t?.elements==null&&(this.selectedElementsCache.selectedElementIds=t.selectedElementIds,this.selectedElementsCache.elements=this.nonDeletedElements,this.selectedElementsCache.cache.set(n,i)),i}getNonDeletedFramesLikes(){return this.nonDeletedFramesLikes}getElement(t){return this.elementsMap.get(t)||null}getNonDeletedElement(t){let n=this.getElement(t);return n&&Wf(n)?n:null}mapElements(t){let n=!1,a=this.elements.map(i=>{let r=t(i);return r!==i&&(n=!0),r});return n&&this.replaceAllElements(a),n}replaceAllElements(t){let n=t instanceof Array?t:Array.from(t.values()),a=[];jR(n),this.elements=Oa(n),this.elementsMap.clear(),this.elements.forEach(r=>{de(r)&&a.push(r),this.elementsMap.set(r.id,r),zd.mapElementToScene(r,this)});let i=gm(this.elements);this.nonDeletedElements=i.elements,this.nonDeletedElementsMap=i.elementsMap,this.frames=a,this.nonDeletedFramesLikes=gm(this.frames).elements,this.triggerUpdate()}triggerUpdate(){this.sceneNonce=Ra();for(let t of Array.from(this.callbacks))t()}onUpdate(t){if(this.callbacks.has(t))throw new Error;return this.callbacks.add(t),()=>{if(!this.callbacks.has(t))throw new Error;this.callbacks.delete(t)}}destroy(){this.elements=[],this.nonDeletedElements=[],this.nonDeletedFramesLikes=[],this.frames=[],this.elementsMap.clear(),this.selectedElementsCache.selectedElementIds=null,this.selectedElementsCache.elements=null,this.selectedElementsCache.cache.clear(),zd.sceneMapById.forEach((t,n)=>{t===this&&zd.sceneMapById.delete(n)}),this.callbacks.clear()}insertElementAtIndex(t,n){if(!Number.isFinite(n)||n<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let a=[...this.elements.slice(0,n),t,...this.elements.slice(n)];Na(a,oe([t])),this.replaceAllElements(a)}insertElementsAtIndex(t,n){if(!t.length)return;if(!Number.isFinite(n)||n<0)throw new Error("insertElementAtIndex can only be called with index >= 0");let a=[...this.elements.slice(0,n),...t,...this.elements.slice(n)];Na(a,oe(t)),this.replaceAllElements(a)}getElementIndex(t){return this.elements.findIndex(n=>n.id===t)}};j(Bf,"sceneMapByElement",new WeakMap),j(Bf,"sceneMapById",new Map);var DR=Bf,ci=DR,X=(e,t,n=!0,a)=>{let i=!1,{points:r,fixedSegments:s,fileId:o,startBinding:d,endBinding:c}=t;if(Q(e)&&(Object.keys(t).length===0||typeof r<"u"||typeof s<"u"||typeof d<"u"||typeof c<"u")){let l=zn(ci.getScene(e)?.getNonDeletedElementsMap()??new Map);t={...t,angle:0,...b0({...e,x:t.x||e.x,y:t.y||e.y},l,{fixedSegments:s,points:r,startBinding:d,endBinding:c},{isDragging:a?.isDragging})}}else typeof r<"u"&&(t={...As(r),...t});for(let l in t){let u=t[l];if(typeof u<"u"){if(e[l]===u&&(typeof u!="object"||u===null||l==="groupIds"||l==="scale"))continue;if(l==="scale"){let f=e[l],p=u;if(f[0]===p[0]&&f[1]===p[1])continue}else if(l==="points"){let f=e[l],p=u;if(f.length===p.length){let U=!1,m=f.length;for(;--m;){let g=f[m],b=p[m];if(g[0]!==b[0]||g[1]!==b[1]){U=!0;break}}if(!U)continue}}e[l]=u,i=!0}}return i&&((typeof t.height<"u"||typeof t.width<"u"||typeof o<"u"||typeof r<"u")&&ut.delete(e),e.version++,e.versionNonce=Ra(),e.updated=Hs(),n&&ci.getScene(e)?.triggerUpdate()),e},pe=(e,t,n=!1)=>{let a=!1;for(let i in t){let r=t[i];if(typeof r<"u"){if(e[i]===r&&(typeof r!="object"||r===null))continue;a=!0}}return!a&&!n?e:{...e,...t,updated:Hs(),version:e.version+1,versionNonce:Ra()}},zo=(e,t)=>(e.version=(t??e.version)+1,e.versionNonce=Ra(),e.updated=Hs(),e),Fr=e=>ue(e)||Bn(e)?e.points.length<2:e.width===0&&e.height===0,_c=(e,t,n,a,i)=>{let[r,s,o,d]=ha(e,i),c=Ge({clientX:a.offsetLeft,clientY:a.offsetTop},a),l=Ge({clientX:a.offsetLeft+t,clientY:a.offsetTop+n},a);return c.x<=o&&c.y<=d&&l.x>=r&&l.y>=s},Bd=(e,t,n,a,i,r)=>{let[s,o,d,c]=Ne(e,i),l=Ge({clientX:a.offsetLeft+(r?.left||0),clientY:a.offsetTop+(r?.top||0)},a),u=Ge({clientX:a.offsetLeft+t-(r?.right||0),clientY:a.offsetTop+n-(r?.bottom||0)},a);return s>=l.x&&o>=l.y&&d<=u.x&&c<=u.y},xm=(e,t,n)=>{let a=Math.abs(t),i=Math.abs(n);if(e==="line"||e==="arrow"||e==="freedraw"){let r=Math.round(Math.atan(i/a)/Hi)*Hi;r===0?n=0:r===Math.PI/2?t=0:n=a*Math.tan(r)*Math.sign(n)||n}else e!=="selection"&&(n=a*Math.sign(n));return{width:t,height:n}},Hf=(e,t,n,a)=>{let i=n-e,r=a-t,s=Math.round(Math.atan(r/i)/Hi)*Hi;if(s===0)r=0;else if(s===Math.PI/2)i=0;else{let o=Math.tan(s),d=-1,c=t-o*e,l=-1/o,u=-1,f=a-l*n,p=(d*f-u*c)/(o*u-l*d),U=(c*l-f*o)/(o*u-l*d);i=p-e,r=U-t}return{width:i,height:r}},i7=e=>{let t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){let n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){let n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t},vm={mouse:8,pen:16,touch:28},LR=16,r7={e:!0,s:!0,n:!0,w:!0},ym={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},kh={e:!0,s:!0,n:!0,w:!0},Xa=(e,t,n,a,i,r,s)=>{let[o,d]=z(E(e+n/2,t+a/2),E(i,r),s);return[o-n/2,d-a/2,n,a]},D0=e=>!(e.viewport.isMobile||e.isTouchScreen&&(fS||g5)),zl=e=>D0(e)?r7:{},L0=([e,t,n,a,i,r],s,o,d,c={},l=4,u=jr)=>{let f=vm[d],p=f/o.value,U=f/o.value,m=f/o.value,g=f/o.value,b=n-e,v=a-t,x=l/o.value,y=(f-u*2)/(2*o.value),w={nw:c.nw?void 0:Xa(e-x-m+y,t-x-g+y,p,U,i,r,s),ne:c.ne?void 0:Xa(n+x-y,t-x-g+y,p,U,i,r,s),sw:c.sw?void 0:Xa(e-x-m+y,a+x-y,p,U,i,r,s),se:c.se?void 0:Xa(n+x-y,a+x-y,p,U,i,r,s),rotation:c.rotation?void 0:Xa(e+b/2-p/2,t-x-g+y-LR/o.value,p,U,i,r,s)},k=5*vm.mouse/o.value;return Math.abs(b)>k&&(c.n||(w.n=Xa(e+b/2-p/2,t-x-g+y,p,U,i,r,s)),c.s||(w.s=Xa(e+b/2-p/2,a+x-y,p,U,i,r,s))),Math.abs(v)>k&&(c.w||(w.w=Xa(e-x-m+y,t+v/2-U/2,p,U,i,r,s)),c.e||(w.e=Xa(n+x-y,t+v/2-U/2,p,U,i,r,s))),w},s7=(e,t,n,a="mouse",i=r7)=>{if(e.locked||Q(e))return{};if(e.type==="freedraw"||ue(e)){if(e.points.length===2){let[,s]=e.points;s[0]===0||s[1]===0?i=kh:s[0]>0&&s[1]<0?i=ym:s[0]>0&&s[1]>0?i=kh:s[0]<0&&s[1]>0?i=ym:s[0]<0&&s[1]<0&&(i=kh)}}else de(e)&&(i={...i,rotation:!0});let r=ue(e)?jr+8:Re(e)?0:jr;return L0(fe(e,n,!0),e.angle,t,a,i,r,Re(e)?0:void 0)},l7=(e,t)=>{if(t.editingLinearElement)return!1;if(e.length>1)return!0;let n=e[0];return Q(n)?!1:ue(n)?n.points.length>2:!0},Xf=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],RR=(e,t,n,a,i,r,s,o)=>{if(!n.selectedElementIds[e.id])return!1;let{rotation:d,...c}=s7(e,r,t,s,zl(o));if(d&&Xf(d,a,i))return"rotation";let l=Object.keys(c).filter(u=>{let f=c[u];return f?Xf(f,a,i):!1});if(l.length>0)return l[0];if(D0(o)){let[u,f,p,U,m,g]=fe(e,t);if(!(ue(e)&&e.points.length<=2)){let b=Re(e)?0:ac/r.value,v=ac/r.value,x=o7(E(u-b,f-b),E(p+b,U+b),E(m,g),e.angle);for(let[y,w]of Object.entries(x))if(Ar(E(a,i),w,v))return y}}return!1},wm=(e,t,n,a,i,r,s,o)=>e.reduce((d,c)=>{if(d)return d;let l=RR(c,s,t,n,a,i,r,o);return l?{element:c,transformHandleType:l}:null},null),Em=([e,t,n,a],i,r,s,o,d)=>{let c=L0([e,t,n,a,(e+n)/2,(t+a)/2],0,s,o,zl(d)),l=Object.keys(c).find(u=>{let f=c[u];return f&&Xf(f,i,r)});if(l)return l;if(D0(d)){let u=(e+n)/2,f=(t+a)/2,p=ac/s.value,U=o7(E(e-p,t-p),E(n+p,a+p),E(u,f),0);for(let[m,g]of Object.entries(U))if(Ar(E(i,r),g,p))return m}return!1},Mh=["ns","nesw","ew","nwse"],PR=(e,t)=>{let n=Mh.indexOf(e);if(n>=0){let a=Math.round(t/(Math.PI/4));e=Mh[(n+a)%Mh.length]}return e},Sm=e=>{let{element:t,transformHandleType:n}=e,a=t&&Math.sign(t.height)*Math.sign(t.width)===-1,i=null;switch(n){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":a?i="nesw":i="nwse";break;case"ne":case"sw":a?i="nwse":i="nesw";break;case"rotation":return"grab"}return i&&t&&(i=PR(i,t.angle)),i?`${i}-resize`:""},o7=([e,t],[n,a],i,r)=>{let s=z(E(e,t),i,r),o=z(E(n,t),i,r),d=z(E(e,a),i,r),c=z(E(n,a),i,r);return{n:[s,o],e:[o,c],s:[c,d],w:[d,s]}},NR=(e,t,n,a,i,r,s,o,d,c,l,u)=>{if(n.length===1){let[f]=n;if(t==="rotation")Q(f)||(OR(f,a,i,d,c,r),xn(f,a));else{if(q(f)&&t)return $R(e,f,a,t,s,d,c),xn(f,a),!0;if(t){let p=n[0].id,U=a.get(p),m=e.get(p);if(U&&m){let{nextWidth:g,nextHeight:b}=WR(U,m,a,e,t,d,c,{shouldMaintainAspectRatio:o,shouldResizeFromCenter:s});bo(g,b,U,m,a,e,t,{shouldMaintainAspectRatio:o,shouldResizeFromCenter:s})}}}return!0}else if(n.length>1){if(t==="rotation")return FR(e,n,a,i,d,c,r,l,u),!0;if(t){let{nextWidth:f,nextHeight:p,flipByX:U,flipByY:m,originalBoundingBox:g}=VR(n,e,a,t,d,c,{shouldMaintainAspectRatio:o,shouldResizeFromCenter:s});return d7(n,a,t,i,e,{shouldResizeFromCenter:s,shouldMaintainAspectRatio:o,flipByX:U,flipByY:m,nextWidth:f,nextHeight:p,originalBoundingBox:g}),!0}}return!1},OR=(e,t,n,a,i,r)=>{let[s,o,d,c]=fe(e,t),l=(s+d)/2,u=(o+c)/2,f;de(e)?f=0:(f=5*Math.PI/2+Math.atan2(i-u,a-l),r&&(f=f+Hi/2,f=f-f%Hi),f=lc(f));let p=oi(e);if(X(e,{angle:f}),p){let U=n.getElement(p);U&&!ve(e)&&X(U,{angle:f})}},R0=(e,t,n,a)=>ue(e)||Bn(e)?{points:bc(0,t,bc(1,n,e.points,a),a)}:{},P0=(e,t,n)=>{let a=e.width;if(nt(e)){let r=zt(e,t);r&&(a=di(r,e))}let i=e.fontSize*(n/a);return i<T1?null:{size:i}},$R=(e,t,n,a,i,r,s)=>{let[o,d,c,l,u,f]=fe(t,n),[p,U]=z(E(r,s),E(u,f),-t.angle),m=0,g=0;a!=="e"&&a!=="w"&&(a.includes("e")&&(m=(p-o)/(c-o)),a.includes("w")&&(m=(c-p)/(c-o)),a.includes("n")&&(g=(l-U)/(l-d)),a.includes("s")&&(g=(U-d)/(l-d)));let b=Math.max(m,g);if(b>0){let v=t.width*b,x=t.height*b,y=P0(t,n,v);if(y===null)return;let w=[o,d],k=[c,l],M=[u,f],I=E(o,d);if(["n","w","nw"].includes(a)&&(I=E(k[0]-Math.abs(v),k[1]-Math.abs(x))),a==="ne"){let P=[w[0],k[1]];I=E(P[0],P[1]-Math.abs(x))}if(a==="sw"){let P=[k[0],w[1]];I=E(P[0]-Math.abs(v),P[1])}["s","n"].includes(a)&&(I[0]=M[0]-v/2),["e","w"].includes(a)&&(I[1]=M[1]-x/2),i&&(I[0]=M[0]-Math.abs(v)/2,I[1]=M[1]-Math.abs(x)/2);let A=t.angle,_=z(I,E(u,f),A),T=E(I[0]+Math.abs(v)/2,I[1]+Math.abs(x)/2),L=z(T,E(u,f),A);I=z(_,L,-A);let[R,F]=I;X(t,{fontSize:y.size,width:v,height:x,x:R,y:F})}if(a==="e"||a==="w"){let v=e.get(t.id),[x,y,w,k]=Fi(v,v.width,v.height,!0),M=E(x,y),I=E(w,k),A=To(M,I),_=z(E(r,s),A,-v.angle),[T,,L]=Fi(t,t.width,t.height,!0),R=L-T,F=I[0]-M[0],P=$1(Xe({fontSize:t.fontSize,fontFamily:t.fontFamily}),t.lineHeight),$=F/R;a.includes("e")&&($=(_[0]-M[0])/R),a.includes("w")&&($=(I[0]-_[0])/R);let O=t.width*$<P?P:t.width*$,V=Vr(t.originalText,Xe(t),Math.abs(O)),W=nn(V,Xe(t),t.lineHeight),K=W.height,[se,le,Ie,Qe]=Fi(v,O,K,!0),rt=Ie-se,at=Qe-le,ce=[...M];["n","w","nw"].includes(a)&&(ce=[I[0]-Math.abs(rt),M[1]]);let me=v.angle,Be=z(ce,A,me),ye=E(ce[0]+Math.abs(rt)/2,ce[1]+Math.abs(at)/2),Ae=z(ye,A,me);ce=z(Be,Ae,-me);let kt={width:Math.abs(O),height:Math.abs(W.height),x:ce[0],y:ce[1],text:V,autoResize:!1};X(t,kt)}},FR=(e,t,n,a,i,r,s,o,d)=>{let c=5*Math.PI/2+Math.atan2(r-d,i-o);s&&(c+=Hi/2,c-=c%Hi);for(let l of t)if(!de(l)){let[u,f,p,U]=fe(l,n),m=(u+p)/2,g=(f+U)/2,b=e.get(l.id)?.angle??l.angle,[v,x]=z(E(m,g),E(o,d),c+b-l.angle);Q(l)?X(l,{points:TD(l,n)}):X(l,{x:l.x+(v-m),y:l.y+(x-g),angle:lc(c+b)},!1),xn(l,n,{simultaneouslyUpdated:t});let y=ge(l,n);y&&!ve(l)&&X(y,{x:y.x+(v-m),y:y.y+(x-g),angle:lc(c+b)},!1)}a.triggerUpdate()},zR=(e,t,n,a,i)=>{let[r,s,o,d]=t.length===1?fe(t[0],n):Ne(t),c=(r+o)/2,l=(s+d)/2,u=t.length===1?t[0].angle:0;switch([a,i]=z(E(a,i),E(c,l),-u),e){case"n":return z(E(a-(r+o)/2,i-s),E(0,0),u);case"s":return z(E(a-(r+o)/2,i-d),E(0,0),u);case"w":return z(E(a-r,i-(s+d)/2),E(0,0),u);case"e":return z(E(a-o,i-(s+d)/2),E(0,0),u);case"nw":return z(E(a-r,i-s),E(0,0),u);case"ne":return z(E(a-o,i-s),E(0,0),u);case"sw":return z(E(a-r,i-d),E(0,0),u);case"se":return z(E(a-o,i-d),E(0,0),u);default:return[0,0]}},BR=(e,t)=>{let[,[n,a]]=t.points;return e==="nw"&&(n<0||a<0)||e==="ne"&&n>=0||e==="sw"&&n<=0||e==="se"&&(n>0||a>0)?"end":"origin"},HR=(e,t,n)=>{if(n)return"center";if(t)switch(e){case"n":return"south-side";case"e":return"west-side";case"s":return"north-side";case"w":return"east-side";case"ne":return"bottom-left";case"nw":return"bottom-right";case"se":return"top-left";case"sw":return"top-right"}return["e","se","s"].includes(e)?"top-left":["n","nw","w"].includes(e)?"bottom-right":e==="ne"?"bottom-left":"top-right"},XR=(e,t,n,a,i,r,s,o,d)=>{let c=HR(s,o,d),[l,u]=e;switch(c){case"top-left":return{x:l+(t-a)/2+(a-t)/2*Math.cos(r)+(n-i)/2*Math.sin(r),y:u+(n-i)/2+(a-t)/2*Math.sin(r)+(i-n)/2*Math.cos(r)};case"top-right":return{x:l+(t-a)/2*(Math.cos(r)+1)+(n-i)/2*Math.sin(r),y:u+(n-i)/2+(t-a)/2*Math.sin(r)+(i-n)/2*Math.cos(r)};case"bottom-left":return{x:l+(t-a)/2*(1-Math.cos(r))+(i-n)/2*Math.sin(r),y:u+(n-i)/2*(Math.cos(r)+1)+(a-t)/2*Math.sin(r)};case"bottom-right":return{x:l+(t-a)/2*(Math.cos(r)+1)+(i-n)/2*Math.sin(r),y:u+(n-i)/2*(Math.cos(r)+1)+(t-a)/2*Math.sin(r)};case"center":return{x:l-(a-t)/2,y:u-(i-n)/2};case"east-side":return{x:l+(t-a)/2*(Math.cos(r)+1),y:u+(t-a)/2*Math.sin(r)+(n-i)/2};case"west-side":return{x:l+(t-a)/2*(1-Math.cos(r)),y:u+(a-t)/2*Math.sin(r)+(n-i)/2};case"north-side":return{x:l+(t-a)/2+(n-i)/2*Math.sin(r),y:u+(i-n)/2*(Math.cos(r)-1)};case"south-side":return{x:l+(t-a)/2+(i-n)/2*Math.sin(r),y:u+(n-i)/2*(Math.cos(r)+1)}}},bo=(e,t,n,a,i,r,s,{shouldInformMutation:o=!0,shouldMaintainAspectRatio:d=!1,shouldResizeFromCenter:c=!1}={})=>{let l={},u=ge(n,i);if(u){let m=r.get(u.id);if(m&&(l={fontSize:m.fontSize}),d){let g={...n,width:e},b=P0(u,i,di(g,u));if(b===null)return;l={fontSize:b.size}}else{let g=W5(Xe(u),u.lineHeight),b=V5(u.fontSize,u.lineHeight);e=Math.max(e,g),t=Math.max(t,b)}}let f=R0(a,e,t,!0),p=E(a.x,a.y);if(ue(a)){let[m,g]=ha(a,r);p=E(m,g)}let U=XR(p,a.width,a.height,e,t,a.angle,s,d,c);if(ue(a)&&f.points){let m=a.x-p[0],g=a.y-p[1];U.x+=m,U.y+=g;let b=f.points[0][0],v=f.points[0][1];U.x+=b,U.y+=v,f.points=f.points.map(x=>E(x[0]-b,x[1]-v))}if(e<0&&(U.x=U.x+e),t<0&&(U.y=U.y+t),"scale"in n&&"scale"in a&&X(n,{scale:[(Math.sign(e)||a.scale[0])*a.scale[0],(Math.sign(t)||a.scale[1])*a.scale[1]]}),ve(n)&&u&&d){let m=e/n.width*u.fontSize;if(m<T1)return;l.fontSize=m}if(e!==0&&t!==0&&Number.isFinite(U.x)&&Number.isFinite(U.y)){let m={...U,width:Math.abs(e),height:Math.abs(t),...f};X(n,m,o),xn(n,i,{newSize:{width:e,height:t}}),u&&l!=null&&X(u,{fontSize:l.fontSize}),Ro(n,i,s,d)}},WR=(e,t,n,a,i,r,s,{shouldMaintainAspectRatio:o=!1,shouldResizeFromCenter:d=!1}={})=>{let[c,l,u,f]=Fi(t,t.width,t.height,!0),p=E(c,l),U=E(u,f),m=To(p,U),g=z(E(r,s),m,-t.angle),[b,v,x,y]=Fi(e,e.width,e.height,!0),w=x-b,k=y-v,M=U[0]-p[0],I=U[1]-p[1],A=M/w,_=I/k;i.includes("e")&&(A=(g[0]-p[0])/w),i.includes("s")&&(_=(g[1]-p[1])/k),i.includes("w")&&(A=(U[0]-g[0])/w),i.includes("n")&&(_=(U[1]-g[1])/k);let T=e.width*A,L=e.height*_;if(d&&(T=2*T-t.width,L=2*L-t.height),o){let R=Math.abs(T)/t.width,F=Math.abs(L)/t.height;if(i.length===1&&(L*=R,T*=F),i.length===2){let P=Math.max(R,F);T=t.width*P*Math.sign(T),L=t.height*P*Math.sign(L)}}return{nextWidth:T,nextHeight:L}},VR=(e,t,n,a,i,r,{shouldMaintainAspectRatio:s=!1,shouldResizeFromCenter:o=!1}={})=>{let d=e.map(R=>t.get(R.id)),c=d.reduce((R,F)=>{if(!ue(F))return R;let P=oi(F);if(!P)return R;let $=t.get(P)??null;return nt($)?[...R,{...$,...J.getBoundTextElementPosition(F,$,n)}]:R},[]),l=oa(d.map(R=>R).concat(c)),{minX:u,minY:f,maxX:p,maxY:U,midX:m,midY:g}=l,b=p-u,v=U-f,x={ne:[u,U],se:[u,f],sw:[p,f],nw:[p,U],e:[u,f+v/2],w:[p,f+v/2],n:[u+b/2,U],s:[u+b/2,f]},[y,w]=o?[m,g]:x[a],k=o?2:1,M=Math.max(Math.abs(i-y)/b||0,Math.abs(r-w)/v||0)*k,I=a.includes("e")||a.includes("w")?Math.abs(i-y)*k:b,A=a.includes("n")||a.includes("s")?Math.abs(r-w)*k:v;s&&(I=b*M*Math.sign(i-y),A=v*M*Math.sign(r-w));let _={ne:[i<y,r>w],se:[i<y,r<w],sw:[i>y,r<w],nw:[i>y,r>w],e:[i<y,!1],w:[i>y,!1],n:[!1,r>w],s:[!1,r<w]},[T,L]=_[a].map(R=>R);return{originalBoundingBox:l,nextWidth:I,nextHeight:A,flipByX:T,flipByY:L}},d7=(e,t,n,a,i,{shouldMaintainAspectRatio:r=!1,shouldResizeFromCenter:s=!1,flipByX:o=!1,flipByY:d=!1,nextHeight:c,nextWidth:l,originalBoundingBox:u}={})=>{if(l===void 0&&c===void 0&&o===void 0&&d===void 0||c===0||l===0)return;i||(i=t);let f=e.reduce((k,M)=>{let I=i.get(M.id);return I&&k.push({orig:I,latest:M}),k},[]),p;if(u)p=u;else{let k=f.reduce((M,{orig:I})=>{if(!ue(I))return M;let A=oi(I);if(!A)return M;let _=i.get(A)??null;return nt(_)?[...M,{..._,...J.getBoundTextElementPosition(I,_,t)}]:M},[]);p=oa(f.map(({orig:M})=>M).concat(k))}let{minX:U,minY:m,maxX:g,maxY:b,midX:v,midY:x}=p,y=g-U,w=b-m;if(l===void 0&&c===void 0&&(l=y,c=w),r&&(l===void 0?l=c*(y/w):c===void 0?c=l*(w/y):Math.abs(l/c-y/w)>.001&&(l=c*(y/w))),l&&c){let k=n.includes("e")||n.includes("w")?Math.abs(l)/y:1,M=n.includes("n")||n.includes("s")?Math.abs(c)/w:1,I;n.length===1?I=n.includes("e")||n.includes("w")?k:M:I=Math.max(Math.abs(l)/y||0,Math.abs(c)/w||0);let A={ne:[U,b],se:[U,m],sw:[g,m],nw:[g,b],e:[U,m+w/2],w:[g,m+w/2],n:[U+y/2,b],s:[U+y/2,m]},[_,T]=s?[v,x]:A[n],L=r||f.some(O=>O.latest.angle!==0||q(O.latest)||Ds(O.latest));L&&(k=I,M=I);let[R,F]=[o?-1:1,d?-1:1],P=[];for(let{orig:O,latest:V}of f){if(q(O)&&nt(O))continue;let W=O.width*k,K=O.height*M,se=lc(O.angle*R*F),le=ue(O)||Bn(O),Ie=O.x-_,Qe=O.y-T,rt=o&&!le?W:0,at=d&&!le?K:0,ce=_+R*(Ie*k+rt),me=T+F*(Qe*M+at),Be=R0(O,W*R,K*F,!1),ye={x:ce,y:me,width:W,height:K,angle:se,...Be};if(Q(O)&&(O.startBinding&&(ye.startBinding={...O.startBinding,fixedPoint:[o?-O.startBinding.fixedPoint[0]+1:O.startBinding.fixedPoint[0],d?-O.startBinding.fixedPoint[1]+1:O.startBinding.fixedPoint[1]]}),O.endBinding&&(ye.endBinding={...O.endBinding,fixedPoint:[o?-O.endBinding.fixedPoint[0]+1:O.endBinding.fixedPoint[0],d?-O.endBinding.fixedPoint[1]+1:O.endBinding.fixedPoint[1]]}),O.fixedSegments&&Be.points&&(ye.fixedSegments=O.fixedSegments.map(kt=>({...kt,start:Be.points[kt.index-1],end:Be.points[kt.index]})))),Re(O)&&(ye.scale=[O.scale[0]*R,O.scale[1]*F]),q(O)){let kt=P0(O,t,W);if(!kt)return;ye.fontSize=kt.size}let Ae=i.get(oi(O)??"");if(Ae)if(L){let kt=Ae.fontSize*I;if(kt<T1)return;ye.boundTextFontSize=kt}else ye.boundTextFontSize=Ae.fontSize;P.push({element:V,update:ye})}let $=P.map(({element:O})=>O);for(let{element:O,update:{boundTextFontSize:V,...W}}of P){let{width:K,height:se,angle:le}=W;X(O,W,!1,{isDragging:!0}),xn(O,t,{simultaneouslyUpdated:$,newSize:{width:K,height:se}});let Ie=ge(O,t);Ie&&V&&(X(Ie,{fontSize:V,angle:ue(O)?void 0:le},!1),Ro(O,t,n,!0))}a.triggerUpdate()}},GR=(e,t,n,a,i,r)=>{if(t.length===1&&Q(t[0])&&(t[0].startBinding||t[0].endBinding))return;let s=t.filter(u=>{if(Q(u)&&u.startBinding&&u.endBinding){let f=t.find(U=>U.id===u.startBinding?.elementId),p=t.find(U=>U.id===u.endBinding?.elementId);return f&&p}return!0}),o=new Set(s),d=s.filter(u=>de(u)).map(u=>u.id);if(d.length>0)for(let u of a.getNonDeletedElements())u.frameId!==null&&d.includes(u.frameId)&&o.add(u);let c=Ne(Array.from(o).map(u=>e.originalElements.get(u.id)??u)),l=ZR(c,n,i,r);o.forEach(u=>{if(km(e,u,l),!ve(u)){let f=ge(u,a.getNonDeletedElementsMap());f&&km(e,f,l),xn(u,a.getElementsMapIncludingDeleted(),{simultaneouslyUpdated:Array.from(o)})}})},ZR=(e,t,n,a)=>{let[i,r]=e,s=i+t.x+n.x,o=r+t.y+n.y;if(n.x===0||n.y===0){let[d,c]=Ct(i+t.x,r+t.y,a);n.x===0&&(s=d),n.y===0&&(o=c)}return{x:s-i,y:o-r}},km=(e,t,n)=>{let a=e.originalElements.get(t.id)??t,i=a.x+n.x,r=a.y+n.y;X(t,{x:i,y:r})},YR=(e,t,n)=>{let[a,i]=Ne(e);return[t-a,n-i]},Mm=({newElement:e,elementType:t,originX:n,originY:a,x:i,y:r,width:s,height:o,shouldMaintainAspectRatio:d,shouldResizeFromCenter:c,zoom:l,widthAspectRatio:u=null,originOffset:f=null,informMutation:p=!0})=>{d&&e.type!=="selection"&&(u?o=s/u:(Math.abs(r-a)>Math.abs(i-n)?{width:s,height:o}=xm(t,o,i<n?-s:s):{width:s,height:o}=xm(t,s,r<a?-o:o),o<0&&(o=-o)));let U=i<n?n-s:n,m=r<a?a-o:a;c&&(s+=s,o+=o,U=n-s/2,m=a-o/2);let g=null;if(q(e)){o=e.height;let b=$1(Xe({fontSize:e.fontSize,fontFamily:e.fontFamily}),e.lineHeight);s=Math.max(s,b),Math.abs(i-n)>gS/l&&(g={autoResize:!1}),m=a,c&&(U=n-s/2)}if(s!==0&&o!==0){let b=null;Re(e)&&(b={initialWidth:s,initialHeight:o}),X(e,{x:U+(f?.x??0),y:m+(f?.y??0),width:s,height:o,...g,...b},p)}},N0=(e,t)=>!!(!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&(e.activeTool.type!=="custom"&&(e.editingTextElement||e.activeTool.type!=="selection"&&e.activeTool.type!=="eraser"&&e.activeTool.type!=="hand"&&e.activeTool.type!=="laser")||xe(t,e).length)),KR=e=>e.reduce((t,n)=>t+n.version,0),c7=e=>{let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e[n].versionNonce;return t>>>0},O0=e=>{let t=5381;for(let n=0;n<e.length;n++){let a=e.charCodeAt(n);t=(t<<5)+t+a}return t>>>0},qR=e=>e.filter(t=>!t.isDeleted&&!Fr(t)),Ve=e=>e.filter(t=>!t.isDeleted),Wf=e=>!e.isDeleted,u7=e=>Ve(e).map(t=>O1(t.type)?{...t,lastCommittedPoint:null}:t),JR=e=>u7(e),h7=e=>u7(e),f7=async e=>{let t;if(e.type===ae.png)try{return await(await ne(async()=>{const{decodePngMetadata:n}=await Promise.resolve().then(()=>_x);return{decodePngMetadata:n}},void 0)).decodePngMetadata(e)}catch(n){throw n.message==="INVALID"?new mr("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new mr("Error: cannot restore image")}else if("text"in Blob?t=await e.text():t=await new Promise(n=>{let a=new FileReader;a.readAsText(e,"utf8"),a.onloadend=()=>{a.readyState===FileReader.DONE&&n(a.result)}}),e.type===ae.svg)try{return NL({svg:t})}catch(n){throw n.message==="INVALID"?new mr("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):new mr("Error: cannot restore image")}return t},p7=e=>e&&e.name.match(/\.(json|excalidraw|png|svg)$/)?.[1]||null,QR=e=>e==="png"||e==="svg",$0=e=>{let t=p7(e);return t==="png"||t==="svg"},U7=e=>!!e&&Object.values(ks).includes(e),kr=e=>{let{type:t}=e||{};return U7(t)},F0=async(e,t,n,a)=>{let i=await f7(e),r;try{try{r=JSON.parse(i)}catch(s){throw kr(e)?new mr("Image doesn't contain scene","IMAGE_NOT_CONTAINS_SCENE_DATA"):s}if(_L(r))return{type:ae.excalidraw,data:No({elements:h7(r.elements||[]),appState:{theme:t?.theme,fileHandle:a||e.handle||null,...C5(r.appState||{}),...t?fo(r.elements||[],t):{}},files:r.files},t,n,{repairBindings:!0,refreshDimensions:!1})};if(w8(r))return{type:ae.excalidrawlib,data:r};throw new Error("Error: invalid file")}catch(s){throw s instanceof mr?s:new Error("Error: invalid file")}},z0=async(e,t,n,a)=>{let i=await F0(e,t,n,a);if(i.type!==ae.excalidraw)throw new Error("Error: invalid file");return i.data},m7=(e,t="unpublished")=>{let n=JSON.parse(e);if(!w8(n))throw new Error("Invalid library");let a=n.libraryItems||n.library;return Oo(a,t)},g7=async(e,t="unpublished")=>m7(await f7(e),t),xo=async e=>new Promise(async(t,n)=>{try{jo(e)&&(e=await e),e.toBlob(a=>{if(!a)return n(new _C("Error: Canvas too big","CANVAS_POSSIBLY_TOO_BIG"));t(a)})}catch(a){n(a)}}),eP=async e=>{try{let t=await window.crypto.subtle.digest("SHA-1",await br(e));return uk(new Uint8Array(t))}catch(t){return console.error(t),C1(40)}},Vf=async e=>new Promise((t,n)=>{let a=new FileReader;a.onload=()=>{let i=a.result;t(i)},a.onerror=i=>n(i),a.readAsDataURL(e)}),tP=(e,t)=>`data:${t};base64,${v7(Tc(e),!0)}`,nP=(e,t="")=>{let n=e.indexOf(","),a=atob(e.slice(n+1)),i=e.slice(0,n).split(":")[1].split(";")[0],r=new ArrayBuffer(a.length),s=new Uint8Array(r);for(let o=0;o<a.length;o++)s[o]=a.charCodeAt(o);return new File([r],t,{type:i})},aP=e=>y7(e.slice(e.indexOf(",")+1)),Gf=async(e,t)=>{if(e.type===ae.svg)return e;let[n,a]=await Promise.all([ne(()=>import("./pica-UyEFQr7o.js").then(r=>r.p),__vite__mapDeps([4,2,3])).then(r=>r.default),ne(()=>import("./image-blob-reduce.esm-BLtmMM_J.js"),[]).then(r=>r.default)]),i=a({pica:n({features:["js","wasm"]})});if(t.outputType){let{outputType:r}=t;i._create_blob=function(s){return this.pica.toBlob(s.out_canvas,r,.8).then(o=>(s.out_blob=o,s))}}if(!kr(e))throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"});return new File([await i.toBlob(e,{max:t.maxWidthOrHeight,alpha:!0})],e.name,{type:t.outputType||e.type})},Cm=(e,t="")=>new File([new TextEncoder().encode(e)],t,{type:ae.svg}),iP=async(e,t="")=>{let n;try{n=await fetch(e)}catch{throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"})}if(!n.ok)throw new Error("Error: failed to fetch image",{cause:"FETCH_ERROR"});let a=await n.blob();if(a.type&&kr(a)){let i=t||a.name||"";return new File([a],i,{type:a.type})}throw new Error("Error: unsupported file type",{cause:"UNSUPPORTED"})},rP=async e=>{let t=e.dataTransfer.files.item(0),n=await sP(e);return{file:t?await B0(t):null,fileHandle:n}},sP=async e=>{if(Wr)try{return await e.dataTransfer.items[0].getAsFileSystemHandle()||null}catch(t){return console.warn(t.name,t.message),null}return null},Im=e=>{let t=null,n=`${[...new Uint8Array(e).slice(0,8)].join(" ")} `,a={png:"137 80 78 71 13 10 26 10 ",jpg:"255 216 255 ",gif:"71 73 70 56 57 97 "};return n===a.png?t=ae.png:n.startsWith(a.jpg)?t=ae.jpg:n.startsWith(a.gif)&&(t=ae.gif),t},Ml=(e,t,n)=>new File([e],n||"",{type:t}),B0=async e=>{if(e.type){if(kr(e)){let t=await br(e),n=Im(t);n&&n!==e.type&&(e=Ml(t,n,e.name))}}else if(e?.name?.endsWith(".excalidrawlib"))e=Ml(await br(e),ae.excalidrawlib,e.name);else if(e?.name?.endsWith(".excalidraw"))e=Ml(await br(e),ae.excalidraw,e.name);else{let t=await br(e),n=Im(t);n&&(e=Ml(t,n,e.name))}return e},br=e=>"arrayBuffer"in e?e.arrayBuffer():new Promise((t,n)=>{let a=new FileReader;a.onload=i=>{if(!i.target?.result)return n(new Error("Couldn't convert blob to ArrayBuffer"));t(i.target.result)},a.readAsArrayBuffer(e)}),Tc=e=>{let t=typeof e=="string"?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e),n="";for(let a of t)n+=String.fromCharCode(a);return n},b7=e=>{let t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let a=0,i=e.length;a<i;a++)n[a]=e.charCodeAt(a);return t},x7=e=>new TextDecoder("utf-8").decode(b7(e)),v7=(e,t=!1)=>t?window.btoa(e):window.btoa(Tc(e)),y7=(e,t=!1)=>t?window.atob(e):x7(window.atob(e)),w7=({text:e,compress:t})=>{let n;if(t!==!1)try{n=Tc(Aw(e))}catch(a){console.error("encode: cannot deflate",a)}return{version:"1",encoding:"bstring",compressed:!!n,encoded:n||Tc(e)}},E7=e=>{let t;switch(e.encoding){case"bstring":t=e.compressed?e.encoded:x7(e.encoded);break;default:throw new Error(`decode: unknown encoding "${e.encoding}"`)}return e.compressed?Dw(new Uint8Array(b7(t)),{to:"string"}):t},S7=async e=>{let t=g6(new Uint8Array(await br(e))).find(n=>n.name==="tEXt");return t?b6.decode(t.data):null},k7=async({blob:e,metadata:t})=>{let n=g6(new Uint8Array(await br(e))),a=b6.encode(ae.excalidraw,JSON.stringify(w7({text:t,compress:!0})));return n.splice(-1,0,a),new Blob([ev(n)],{type:ae.png})},lP=async e=>{let t=await S7(e);if(t?.keyword===ae.excalidraw)try{let n=JSON.parse(t.text);if(!("encoded"in n)){if("type"in n&&n.type===On.excalidraw)return t.text;throw new Error("FAILED")}return E7(n)}catch(n){throw console.error(n),new Error("FAILED")}throw new Error("INVALID")},M7={paste:"Paste",pasteAsPlaintext:"Paste as plaintext",pasteCharts:"Paste charts",selectAll:"Select all",multiSelect:"Add element to selection",moveCanvas:"Move canvas",cut:"Cut",copy:"Copy",copyAsPng:"Copy to clipboard as PNG",copyAsSvg:"Copy to clipboard as SVG",copyText:"Copy to clipboard as text",copySource:"Copy source to clipboard",convertToCode:"Convert to code",bringForward:"Bring forward",sendToBack:"Send to back",bringToFront:"Bring to front",sendBackward:"Send backward",delete:"Delete",copyStyles:"Copy styles",pasteStyles:"Paste styles",stroke:"Stroke",changeStroke:"Change stroke color",background:"Background",changeBackground:"Change background color",fill:"Fill",strokeWidth:"Stroke width",strokeStyle:"Stroke style",strokeStyle_solid:"Solid",strokeStyle_dashed:"Dashed",strokeStyle_dotted:"Dotted",sloppiness:"Sloppiness",opacity:"Opacity",textAlign:"Text align",edges:"Edges",sharp:"Sharp",round:"Round",arrowheads:"Arrowheads",arrowhead_none:"None",arrowhead_arrow:"Arrow",arrowhead_bar:"Bar",arrowhead_circle:"Circle",arrowhead_circle_outline:"Circle (outline)",arrowhead_triangle:"Triangle",arrowhead_triangle_outline:"Triangle (outline)",arrowhead_diamond:"Diamond",arrowhead_diamond_outline:"Diamond (outline)",arrowhead_crowfoot_many:"Crow's foot (many)",arrowhead_crowfoot_one:"Crow's foot (one)",arrowhead_crowfoot_one_or_many:"Crow's foot (one or many)",more_options:"More options",arrowtypes:"Arrow type",arrowtype_sharp:"Sharp arrow",arrowtype_round:"Curved arrow",arrowtype_elbowed:"Elbow arrow",fontSize:"Font size",fontFamily:"Font family",addWatermark:'Add "Made with Excalidraw"',handDrawn:"Hand-drawn",normal:"Normal",code:"Code",small:"Small",medium:"Medium",large:"Large",veryLarge:"Very large",solid:"Solid",hachure:"Hachure",zigzag:"Zigzag",crossHatch:"Cross-hatch",thin:"Thin",bold:"Bold",left:"Left",center:"Center",right:"Right",extraBold:"Extra bold",architect:"Architect",artist:"Artist",cartoonist:"Cartoonist",fileTitle:"File name",colorPicker:"Color picker",canvasColors:"Used on canvas",canvasBackground:"Canvas background",drawingCanvas:"Drawing canvas",clearCanvas:"Clear canvas",layers:"Layers",actions:"Actions",language:"Language",liveCollaboration:"Live collaboration...",duplicateSelection:"Duplicate",untitled:"Untitled",name:"Name",yourName:"Your name",madeWithExcalidraw:"Made with Excalidraw",group:"Group selection",ungroup:"Ungroup selection",collaborators:"Collaborators",toggleGrid:"Toggle grid",addToLibrary:"Add to library",removeFromLibrary:"Remove from library",libraryLoadingMessage:"Loading library…",libraries:"Browse libraries",loadingScene:"Loading scene…",loadScene:"Load scene from file",align:"Align",alignTop:"Align top",alignBottom:"Align bottom",alignLeft:"Align left",alignRight:"Align right",centerVertically:"Center vertically",centerHorizontally:"Center horizontally",distributeHorizontally:"Distribute horizontally",distributeVertically:"Distribute vertically",flipHorizontal:"Flip horizontal",flipVertical:"Flip vertical",viewMode:"View mode",share:"Share",showStroke:"Show stroke color picker",showBackground:"Show background color picker",showFonts:"Show font picker",toggleTheme:"Toggle light/dark theme",theme:"Theme",personalLib:"Personal Library",excalidrawLib:"Excalidraw Library",decreaseFontSize:"Decrease font size",increaseFontSize:"Increase font size",unbindText:"Unbind text",bindText:"Bind text to the container",createContainerFromText:"Wrap text in a container",link:{edit:"Edit link",editEmbed:"Edit embeddable link",create:"Add link",label:"Link",labelEmbed:"Link & embed",empty:"No link is set",hint:"Type or paste your link here",goToElement:"Go to target element"},lineEditor:{edit:"Edit line",editArrow:"Edit arrow"},elementLock:{lock:"Lock",unlock:"Unlock",lockAll:"Lock all",unlockAll:"Unlock all"},statusPublished:"Published",sidebarLock:"Keep sidebar open",selectAllElementsInFrame:"Select all elements in frame",removeAllElementsFromFrame:"Remove all elements from frame",eyeDropper:"Pick color from canvas",textToDiagram:"Text to diagram",prompt:"Prompt",followUs:"Follow us",discordChat:"Discord chat",zoomToFitViewport:"Zoom to fit in viewport",zoomToFitSelection:"Zoom to fit selection",zoomToFit:"Zoom to fit all elements",installPWA:"Install Excalidraw locally (PWA)",autoResize:"Enable text auto-resizing",imageCropping:"Image cropping",unCroppedDimension:"Uncropped dimension",copyElementLink:"Copy link to object",linkToElement:"Link to object",wrapSelectionInFrame:"Wrap selection in frame"},C7={title:"Link to object",desc:"Click on a shape on canvas or paste a link.",notFound:"Linked object wasn't found on canvas."},I7={noItems:"No items added yet...",hint_emptyLibrary:"Select an item on canvas to add it here, or install a library from the public repository, below.",hint_emptyPrivateLibrary:"Select an item on canvas to add it here."},_7={title:"Find on canvas",noMatch:"No matches found...",singleResult:"result",multipleResults:"results",placeholder:"Find text on canvas..."},T7={clearReset:"Reset the canvas",exportJSON:"Export to file",exportImage:"Export image...",export:"Save to...",copyToClipboard:"Copy to clipboard",copyLink:"Copy link",save:"Save to current file",saveAs:"Save as",load:"Open",getShareableLink:"Get shareable link",close:"Close",selectLanguage:"Select language",scrollBackToContent:"Scroll back to content",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",menu:"Menu",done:"Done",edit:"Edit",undo:"Undo",redo:"Redo",resetLibrary:"Reset library",createNewRoom:"Create new room",fullScreen:"Full screen",darkMode:"Dark mode",lightMode:"Light mode",systemMode:"System mode",zenMode:"Zen mode",objectsSnapMode:"Snap to objects",exitZenMode:"Exit zen mode",cancel:"Cancel",clear:"Clear",remove:"Remove",embed:"Toggle embedding",publishLibrary:"Publish",submit:"Submit",confirm:"Confirm",embeddableInteractionButton:"Click to interact"},j7={clearReset:"This will clear the whole canvas. Are you sure?",couldNotCreateShareableLink:"Couldn't create shareable link.",couldNotCreateShareableLinkTooBig:"Couldn't create shareable link: the scene is too big",couldNotLoadInvalidFile:"Couldn't load invalid file",importBackendFailed:"Importing from backend failed.",cannotExportEmptyCanvas:"Cannot export empty canvas.",couldNotCopyToClipboard:"Couldn't copy to clipboard.",decryptFailed:"Couldn't decrypt data.",uploadedSecurly:"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can't read the content.",loadSceneOverridePrompt:"Loading external drawing will replace your existing content. Do you wish to continue?",collabStopOverridePrompt:`Stopping the session will overwrite your previous, locally stored drawing. Are you sure?
42
+
43
+ (If you want to keep your local drawing, simply close the browser tab instead.)`,errorAddingToLibrary:"Couldn't add item to the library",errorRemovingFromLibrary:"Couldn't remove item from the library",confirmAddLibrary:"This will add {{numShapes}} shape(s) to your library. Are you sure?",imageDoesNotContainScene:"This image does not seem to contain any scene data. Have you enabled scene embedding during export?",cannotRestoreFromImage:"Scene couldn't be restored from this image file",invalidSceneUrl:"Couldn't import scene from the supplied URL. It's either malformed, or doesn't contain valid Excalidraw JSON data.",resetLibrary:"This will clear your library. Are you sure?",removeItemsFromsLibrary:"Delete {{count}} item(s) from library?",invalidEncryptionKey:"Encryption key must be of 22 characters. Live collaboration is disabled.",collabOfflineWarning:`No internet connection available.
44
+ Your changes will not be saved!`},A7={unsupportedFileType:"Unsupported file type.",imageInsertError:"Couldn't insert image. Try again later...",fileTooBig:"File is too big. Maximum allowed size is {{maxSize}}.",svgImageInsertError:"Couldn't insert SVG image. The SVG markup looks invalid.",failedToFetchImage:"Failed to fetch image.",cannotResolveCollabServer:"Couldn't connect to the collab server. Please reload the page and try again.",importLibraryError:"Couldn't load library",saveLibraryError:"Couldn't save library to storage. Please save your library to a file locally to make sure you don't lose changes.",collabSaveFailed:"Couldn't save to the backend database. If problems persist, you should save your file locally to ensure you don't lose your work.",collabSaveFailed_sizeExceeded:"Couldn't save to the backend database, the canvas seems to be too big. You should save the file locally to ensure you don't lose your work.",imageToolNotSupported:"Images are disabled.",brave_measure_text_error:{line1:"Looks like you are using Brave browser with the <bold>Aggressively Block Fingerprinting</bold> setting enabled.",line2:"This could result in breaking the <bold>Text Elements</bold> in your drawings.",line3:"We strongly recommend disabling this setting. You can follow <link>these steps</link> on how to do so.",line4:"If disabling this setting doesn't fix the display of text elements, please open an <issueLink>issue</issueLink> on our GitHub, or write us on <discordLink>Discord</discordLink>"},libraryElementTypeError:{embeddable:"Embeddable elements cannot be added to the library.",iframe:"IFrame elements cannot be added to the library.",image:"Support for adding images to the library coming soon!"},asyncPasteFailedOnRead:"Couldn't paste (couldn't read from system clipboard).",asyncPasteFailedOnParse:"Couldn't paste.",copyToSystemClipboardFailed:"Couldn't copy to clipboard."},D7={selection:"Selection",image:"Insert image",rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Draw",text:"Text",library:"Library",lock:"Keep selected tool active after drawing",penMode:"Pen mode - prevent touch",link:"Add / Update link for a selected shape",eraser:"Eraser",frame:"Frame tool",magicframe:"Wireframe to code",embeddable:"Web Embed",laser:"Laser pointer",hand:"Hand (panning tool)",extraTools:"More tools",mermaidToExcalidraw:"Mermaid to Excalidraw"},L7={rectangle:"Rectangle",diamond:"Diamond",ellipse:"Ellipse",arrow:"Arrow",line:"Line",freedraw:"Freedraw",text:"Text",image:"Image",group:"Group",frame:"Frame",magicframe:"Wireframe to code",embeddable:"Web Embed",selection:"Selection",iframe:"IFrame"},R7={canvasActions:"Canvas actions",selectedShapeActions:"Selected shape actions",shapes:"Shapes"},P7={dismissSearch:"Escape to dismiss search",canvasPanning:"To move canvas, hold mouse wheel or spacebar while dragging, or use the hand tool",linearElement:"Click to start multiple points, drag for single line",arrowTool:"Click to start multiple points, drag for single line. Press {{arrowShortcut}} again to change arrow type.",freeDraw:"Click and drag, release when you're finished",text:"Tip: you can also add text by double-clicking anywhere with the selection tool",embeddable:"Click-drag to create a website embed",text_selected:"Double-click or press ENTER to edit text",text_editing:"Press Escape or CtrlOrCmd+ENTER to finish editing",linearElementMulti:"Click on last point or press Escape or Enter to finish",lockAngle:"You can constrain angle by holding SHIFT",resize:`You can constrain proportions by holding SHIFT while resizing,
45
+ hold ALT to resize from the center`,resizeImage:`You can resize freely by holding SHIFT,
46
+ hold ALT to resize from the center`,rotate:"You can constrain angles by holding SHIFT while rotating",lineEditor_info:"Hold CtrlOrCmd and Double-click or press CtrlOrCmd + Enter to edit points",lineEditor_pointSelected:`Press Delete to remove point(s),
47
+ CtrlOrCmd+D to duplicate, or drag to move`,lineEditor_nothingSelected:`Select a point to edit (hold SHIFT to select multiple),
48
+ or hold Alt and click to add new points`,placeImage:"Click to place the image, or click and drag to set its size manually",publishLibrary:"Publish your own library",bindTextToElement:"Press enter to add text",createFlowchart:"Hold CtrlOrCmd and Arrow key to create a flowchart",deepBoxSelect:"Hold CtrlOrCmd to deep select, and to prevent dragging",eraserRevert:"Hold Alt to revert the elements marked for deletion",firefox_clipboard_write:'This feature can likely be enabled by setting the "dom.events.asyncClipboard.clipboardItem" flag to "true". To change the browser flags in Firefox, visit the "about:config" page.',disableSnapping:"Hold CtrlOrCmd to disable snapping",enterCropEditor:"Double click the image or press ENTER to crop the image",leaveCropEditor:"Click outside the image or press ENTER or ESCAPE to finish cropping"},N7={cannotShowPreview:"Cannot show preview",canvasTooBig:"The canvas may be too big.",canvasTooBigTip:"Tip: try moving the farthest elements a bit closer together."},O7={headingMain:"Encountered an error. Try <button>reloading the page</button>.",clearCanvasMessage:"If reloading doesn't work, try <button>clearing the canvas</button>.",clearCanvasCaveat:" This will result in loss of work ",trackedToSentry:"The error with identifier {{eventId}} was tracked on our system.",openIssueMessage:"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our <button>bug tracker</button>. Please include information below by copying and pasting into the GitHub issue.",sceneContent:"Scene content:"},$7={or:"Or"},F7={desc_intro:"Invite people to collaborate on your drawing.",desc_privacy:"Don't worry, the session is end-to-end encrypted, and fully private. Not even our server can see what you draw.",button_startSession:"Start session",button_stopSession:"Stop session",desc_inProgressIntro:"Live-collaboration session is now in progress.",desc_shareLink:"Share this link with anyone you want to collaborate with:",desc_exitSession:"Stopping the session will disconnect you from the room, but you'll be able to continue working with the scene, locally. Note that this won't affect other people, and they'll still be able to collaborate on their version.",shareTitle:"Join a live collaboration session on Excalidraw"},z7={title:"Error"},B7={disk_title:"Save to disk",disk_details:"Export the scene data to a file from which you can import later.",disk_button:"Save to file",link_title:"Shareable link",link_details:"Export as a read-only link.",link_button:"Export to Link",excalidrawplus_description:"Save the scene to your Excalidraw+ workspace.",excalidrawplus_button:"Export",excalidrawplus_exportError:"Couldn't export to Excalidraw+ at this moment..."},H7={blog:"Read our blog",click:"click",deepSelect:"Deep select",deepBoxSelect:"Deep select within box, and prevent dragging",createFlowchart:"Create a flowchart from a generic element",navigateFlowchart:"Navigate a flowchart",curvedArrow:"Curved arrow",curvedLine:"Curved line",documentation:"Documentation",doubleClick:"double-click",drag:"drag",editor:"Editor",editLineArrowPoints:"Edit line/arrow points",editText:"Edit text / add label",github:"Found an issue? Submit",howto:"Follow our guides",or:"or",preventBinding:"Prevent arrow binding",tools:"Tools",shortcuts:"Keyboard shortcuts",textFinish:"Finish editing (text editor)",textNewLine:"Add new line (text editor)",title:"Help",view:"View",zoomToFit:"Zoom to fit all elements",zoomToSelection:"Zoom to selection",toggleElementLock:"Lock/unlock selection",movePageUpDown:"Move page up/down",movePageLeftRight:"Move page left/right",cropStart:"Crop image",cropFinish:"Finish image cropping"},X7={title:"Clear canvas"},W7={title:"Publish library",itemName:"Item name",authorName:"Author name",githubUsername:"GitHub username",twitterUsername:"Twitter username",libraryName:"Library name",libraryDesc:"Library description",website:"Website",placeholder:{authorName:"Your name or username",libraryName:"Name of your library",libraryDesc:"Description of your library to help people understand its usage",githubHandle:"GitHub handle (optional), so you can edit the library once submitted for review",twitterHandle:"Twitter username (optional), so we know who to credit when promoting over Twitter",website:"Link to your personal website or elsewhere (optional)"},errors:{required:"Required",website:"Enter a valid URL"},noteDescription:"Submit your library to be included in the <link>public library repository</link> for other people to use in their drawings.",noteGuidelines:"The library needs to be manually approved first. Please read the <link>guidelines</link> before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required.",noteLicense:"By submitting, you agree the library will be published under the <link>MIT License</link>, which in short means anyone can use them without restrictions.",noteItems:"Each library item must have its own name so it's filterable. The following library items will be included:",atleastOneLibItem:"Please select at least one library item to get started",republishWarning:"Note: some of the selected items are marked as already published/submitted. You should only resubmit items when updating an existing library or submission."},V7={title:"Library submitted",content:"Thank you {{authorName}}. Your library has been submitted for review. You can track the status <link>here</link>"},G7={resetLibrary:"Reset library",removeItemsFromLib:"Remove selected items from library"},Z7={header:"Export image",label:{withBackground:"Background",onlySelected:"Only selected",darkMode:"Dark mode",embedScene:"Embed scene",scale:"Scale",padding:"Padding"},tooltip:{embedScene:`Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.
49
+ Will increase exported file size.`},title:{exportToPng:"Export to PNG",exportToSvg:"Export to SVG",copyPngToClipboard:"Copy PNG to clipboard"},button:{exportToPng:"PNG",exportToSvg:"SVG",copyPngToClipboard:"Copy to clipboard"}},Y7={tooltip:"Your drawings are end-to-end encrypted so Excalidraw's servers will never see them.",link:"Blog post on end-to-end encryption in Excalidraw"},K7={angle:"Angle",shapes:"Shapes",height:"Height",scene:"Scene",selected:"Selected",storage:"Storage",fullTitle:"Canvas & Shape properties",title:"Properties",generalStats:"General",elementProperties:"Shape properties",total:"Total",version:"Version",versionCopy:"Click to copy",versionNotAvailable:"Version not available",width:"Width"},q7={addedToLibrary:"Added to library",copyStyles:"Copied styles.",copyToClipboard:"Copied to clipboard.",copyToClipboardAsPng:`Copied {{exportSelection}} to clipboard as PNG
50
+ ({{exportColorScheme}})`,copyToClipboardAsSvg:`Copied {{exportSelection}} to clipboard as SVG
51
+ ({{exportColorScheme}})`,fileSaved:"File saved.",fileSavedToFilename:"Saved to {filename}",canvas:"canvas",selection:"selection",pasteAsSingleElement:`Use {{shortcut}} to paste as a single element,
52
+ or paste into an existing text editor`,unableToEmbed:"Embedding this url is currently not allowed. Raise an issue on GitHub to request the url whitelisted",unrecognizedLinkFormat:"The link you embedded does not match the expected format. Please try to paste the 'embed' string provided by the source site",elementLinkCopied:"Link copied to clipboard"},J7={transparent:"Transparent",black:"Black",white:"White",red:"Red",pink:"Pink",grape:"Grape",violet:"Violet",gray:"Gray",blue:"Blue",cyan:"Cyan",teal:"Teal",green:"Green",yellow:"Yellow",orange:"Orange",bronze:"Bronze"},Q7={app:{center_heading:"All your data is saved locally in your browser.",center_heading_plus:"Did you want to go to the Excalidraw+ instead?",menuHint:"Export, preferences, languages, ..."},defaults:{menuHint:"Export, preferences, and more...",center_heading:"Diagrams. Made. Simple.",toolbarHint:"Pick a tool & Start drawing!",helpHint:"Shortcuts & help"}},e3={mostUsedCustomColors:"Most used custom colors",colors:"Colors",shades:"Shades",hexCode:"Hex code",noShades:"No shades available for this color"},t3={action:{exportToImage:{title:"Export as image",button:"Export as image",description:"Export the scene data as an image from which you can import later."},saveToDisk:{title:"Save to disk",button:"Save to disk",description:"Export the scene data to a file from which you can import later."},excalidrawPlus:{title:"Excalidraw+",button:"Export to Excalidraw+",description:"Save the scene to your Excalidraw+ workspace."}},modal:{loadFromFile:{title:"Load from file",button:"Load from file",description:"Loading from a file will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first using one of the options below."},shareableLink:{title:"Load from link",button:"Replace my content",description:"Loading external drawing will <bold>replace your existing content</bold>.<br></br>You can back up your drawing first by using one of the options below."}}},n3={title:"Mermaid to Excalidraw",button:"Insert",description:"Currently only <flowchartLink>Flowchart</flowchartLink>,<sequenceLink> Sequence, </sequenceLink> and <classLink>Class </classLink>Diagrams are supported. The other types will be rendered as image in Excalidraw.",syntax:"Mermaid Syntax",preview:"Preview"},a3={placeholder:"Quick search"},i3={badge:{old:"old"},sceneFonts:"In this scene",availableFonts:"Available fonts",empty:"No fonts found"},r3={empty:"No users found",hint:{text:"Click on user to follow",followStatus:"You're currently following this user",inCall:"User is in a voice call",micMuted:"User's microphone is muted",isSpeaking:"User is speaking"}},s3={title:"Command palette",shortcuts:{select:"Select",confirm:"Confirm",close:"Close"},recents:"Recently used",search:{placeholder:"Search menus, commands, and discover hidden gems",noMatch:"No matching commands..."},itemNotAvailable:"Command is not available...",shortcutHint:"For Command palette, use {{shortcut}}"},H0={labels:M7,elementLink:C7,library:I7,search:_7,buttons:T7,alerts:j7,errors:A7,toolBar:D7,element:L7,headings:R7,hints:P7,canvasError:N7,errorSplash:O7,shareDialog:$7,roomDialog:F7,errorDialog:z7,exportDialog:B7,helpDialog:H7,clearCanvasDialog:X7,publishDialog:W7,publishSuccessDialog:V7,confirmDialog:G7,imageExportDialog:Z7,encrypted:Y7,stats:K7,toast:q7,colors:J7,welcomeScreen:Q7,colorPicker:e3,overwriteConfirm:t3,mermaid:n3,quickSearch:a3,fontList:i3,userList:r3,commandPalette:s3},l3=100,o3=36,d3={"ar-SA":94,"az-AZ":17,"bg-BG":71,"bn-BD":52,"ca-ES":83,"cs-CZ":86,"da-DK":61,"de-DE":100,"el-GR":80,en:l3,"es-ES":96,"eu-ES":97,"fa-IR":84,"fi-FI":76,"fr-FR":99,"gl-ES":86,"he-IL":77,"hi-IN":76,"hu-HU":76,"id-ID":91,"it-IT":98,"ja-JP":90,kaa:o3,"kab-KAB":76,"kk-KZ":18,"km-KH":83,"ko-KR":100,"ku-TR":87,"lt-LT":48,"lv-LV":77,"mr-IN":98,"my-MM":35,"nb-NO":93,"nl-NL":75,"nn-NO":67,"oc-FR":92,"pa-IN":78,"pl-PL":99,"pt-BR":91,"pt-PT":83,"ro-RO":99,"ru-RU":92,"si-LK":7,"sk-SK":100,"sl-SI":100,"sv-SE":100,"ta-IN":81,"th-TH":44,"tr-TR":87,"uk-UA":93,"vi-VN":49,"zh-CN":100,"zh-HK":22,"zh-TW":100};const ui={};let oP=0;function Bt(e,t){const n=`atom${++oP}`,a={toString(){return(ui?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?a.read=e:(a.init=e,a.read=dP,a.write=cP),a}function dP(e){return e(this)}function cP(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const _m=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,Zf=e=>"init"in e,Ch=e=>!!e.write,jc=new WeakMap,Yf=e=>{var t;return Kf(e)&&!((t=jc.get(e))!=null&&t[1])},uP=(e,t)=>{const n=jc.get(e);if(n)n[1]=!0,n[0].forEach(a=>a(t));else if((ui?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},hP=e=>{if(jc.has(e))return;const t=[new Set,!1];jc.set(e,t);const n=()=>{t[1]=!0};e.then(n,n),e.onCancel=a=>{t[0].add(a)}},Kf=e=>typeof e?.then=="function",Tm=e=>"v"in e||"e"in e,hd=e=>{if("e"in e)throw e.e;if((ui?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},c3=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},jm=(e,t,n,a,i)=>{var r;if((ui?"production":void 0)!=="production"&&a===t)throw new Error("[Bug] atom cannot depend on itself");n.d.set(a,i.n),Yf(n.v)&&c3(t,n.v,i),(r=i.m)==null||r.t.add(t),e&&fP(e,a,t)},dl=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),Bl=(e,t,n)=>{e[t].add(n)},Am=(e,t,n)=>{e.D.has(t)||(e.D.set(t,new Set),Bl(e,"M",()=>{var a;(a=n.m)==null||a.l.forEach(i=>Bl(e,"M",i))}))},fP=(e,t,n)=>{const a=e.D.get(t);a&&a.add(n)},pP=(e,t)=>e.D.get(t),ar=e=>{let t,n=!1;const a=i=>{try{i()}catch(r){n||(t=r,n=!0)}};for(;e.H.size||e.M.size||e.L.size;)e.D.clear(),e.H.forEach(a),e.H.clear(),e.M.forEach(a),e.M.clear(),e.L.forEach(a),e.L.clear();if(n)throw t},u3=(...[e,t,n,a])=>{const i=(b,v,x)=>{const y="v"in v,w=v.v,k=Yf(v.v)?v.v:null;if(Kf(x)){hP(x);for(const M of v.d.keys())c3(b,x,e(M));v.v=x}else v.v=x;delete v.e,delete v.x,(!y||!Object.is(w,v.v))&&(++v.n,k&&uP(k,x))},r=(b,v)=>{var x;const y=e(v);if(Tm(y)&&(y.m&&!y.x||Array.from(y.d).every(([_,T])=>r(b,_).n===T)))return y;y.d.clear();let w=!0;const k=_=>{if(_m(v,_)){const L=e(_);if(!Tm(L))if(Zf(_))i(_,L,_.init);else throw new Error("no atom init");return hd(L)}const T=r(b,_);try{return hd(T)}finally{if(w)jm(b,v,y,_,T);else{const L=dl();jm(L,v,y,_,T),u(L,v,y),ar(L)}}};let M,I;const A={get signal(){return M||(M=new AbortController),M.signal},get setSelf(){return(ui?"production":void 0)!=="production"&&!Ch(v)&&console.warn("setSelf function cannot be used with read-only atom"),!I&&Ch(v)&&(I=(..._)=>{if((ui?"production":void 0)!=="production"&&w&&console.warn("setSelf function cannot be called in sync"),!w)return l(v,..._)}),I}};try{const _=t(v,k,A);if(i(v,y,_),Kf(_)){(x=_.onCancel)==null||x.call(_,()=>M?.abort());const T=()=>{if(y.m){const L=dl();u(L,v,y),ar(L)}};_.then(T,T)}return y}catch(_){return delete y.v,y.e=_,delete y.x,++y.n,y}finally{w=!1}},s=b=>hd(r(void 0,b)),o=(b,v,x)=>{var y,w;const k=new Map;for(const M of((y=x.m)==null?void 0:y.t)||[]){const I=e(M);I.m&&k.set(M,I)}for(const M of x.p)k.set(M,e(M));return(w=pP(b,v))==null||w.forEach(M=>{k.set(M,e(M))}),k},d=(b,v,x)=>{const y=[],w=new Set,k=new Set,M=[[v,x]];for(;M.length>0;){const[I,A]=M[M.length-1];if(k.has(I)){M.pop();continue}if(w.has(I)){y.push([I,A,A.n]),k.add(I),A.x=!0,M.pop();continue}w.add(I);for(const[_,T]of o(b,I,A))I!==_&&!w.has(_)&&M.push([_,T])}Bl(b,"H",()=>{const I=new Set([v]);for(let A=y.length-1;A>=0;--A){const[_,T,L]=y[A];let R=!1;for(const F of T.d.keys())if(F!==_&&I.has(F)){R=!0;break}R&&(r(b,_),u(b,_,T),L!==T.n&&(Am(b,_,T),I.add(_))),delete T.x}})},c=(b,v,...x)=>{let y=!0;const w=M=>hd(r(b,M)),k=(M,...I)=>{const A=e(M);try{if(_m(v,M)){if(!Zf(M))throw new Error("atom not writable");const _=A.n,T=I[0];i(M,A,T),u(b,M,A),_!==A.n&&(Am(b,M,A),d(b,M,A));return}else return c(b,M,...I)}finally{y||ar(b)}};try{return n(v,w,k,...x)}finally{y=!1}},l=(b,...v)=>{const x=dl();try{return c(x,b,...v)}finally{ar(x)}},u=(b,v,x)=>{if(x.m&&!Yf(x.v)){for(const y of x.d.keys())x.m.d.has(y)||(f(b,y,e(y)).t.add(v),x.m.d.add(y));for(const y of x.m.d||[])if(!x.d.has(y)){x.m.d.delete(y);const w=p(b,y,e(y));w?.t.delete(v)}}},f=(b,v,x)=>{if(!x.m){r(b,v);for(const y of x.d.keys())f(b,y,e(y)).t.add(v);if(x.m={l:new Set,d:new Set(x.d.keys()),t:new Set},Ch(v)){const y=x.m;let w;const k=(M,I)=>{let A=!0;w=(..._)=>{try{return c(M,v,..._)}finally{A||ar(M)}};try{return I()}finally{A=!1}};Bl(b,"L",()=>{const M=k(b,()=>a(v,(...I)=>w(...I)));M&&(y.u=I=>k(I,M))})}}return x.m},p=(b,v,x)=>{if(x.m&&!x.m.l.size&&!Array.from(x.m.t).some(y=>{var w;return(w=e(y).m)==null?void 0:w.d.has(v)})){const y=x.m.u;y&&Bl(b,"L",()=>y(b)),delete x.m;for(const w of x.d.keys()){const k=p(b,w,e(w));k?.t.delete(v)}return}return x.m};return{get:s,set:l,sub:(b,v)=>{const x=dl(),y=e(b),k=f(x,b,y).l;return k.add(v),ar(x),()=>{k.delete(v);const M=dl();p(M,b,y),ar(M)}},unstable_derive:b=>u3(...b(e,t,n,a))}},UP=e=>{const t=new WeakMap,n=new Set;let a,i=0;const r=e.unstable_derive((d,c,l,u)=>(a=d,[f=>{let p=t.get(f);if(!p){const U=d(f);p=new Proxy(U,{set(m,g,b){return g==="m"&&n.add(f),Reflect.set(m,g,b)},deleteProperty(m,g){return g==="m"&&n.delete(f),Reflect.deleteProperty(m,g)}}),t.set(f,p)}return p},c,(f,p,U,...m)=>i?U(f,...m):l(f,p,U,...m),u])),s=r.set;return Object.assign(r,{dev4_get_internal_weak_map:()=>({get:d=>{const c=a(d);if(c.n!==0)return c}}),dev4_get_mounted_atoms:()=>n,dev4_restore_atoms:d=>{s({read:()=>null,write:(l,u)=>{++i;try{for(const[f,p]of d)Zf(f)&&u(f,p)}finally{--i}}})}})},X0=()=>{const e=new WeakMap,n=u3(a=>{if((ui?"production":void 0)!=="production"&&!a)throw new Error("Atom is undefined or null");let i=e.get(a);return i||(i={d:new Map,p:new Set,n:0},e.set(a,i)),i},(a,...i)=>a.read(...i),(a,...i)=>a.write(...i),(a,...i)=>{var r;return(r=a.onMount)==null?void 0:r.call(a,...i)});return(ui?"production":void 0)!=="production"?UP(n):n};let cl;const mP=()=>(cl||(cl=X0(),(ui?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=cl),globalThis.__JOTAI_DEFAULT_STORE__!==cl&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),cl),h3={},gP=C.createContext(void 0),yu=e=>{const t=C.useContext(gP);return e?.store||t||mP()},qf=e=>typeof e?.then=="function",f3=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},bP=Z.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(f3(e),e)}),Ih=new WeakMap,Dm=e=>{let t=Ih.get(e);return t||(t=new Promise((n,a)=>{let i=e;const r=d=>c=>{i===d&&n(c)},s=d=>c=>{i===d&&a(c)},o=d=>{"onCancel"in d&&typeof d.onCancel=="function"&&d.onCancel(c=>{if((h3?"production":void 0)!=="production"&&c===d)throw new Error("[Bug] p is not updated even after cancelation");qf(c)?(Ih.set(c,t),i=c,c.then(r(c),s(c)),o(c)):n(c)})};e.then(r(e),s(e)),o(e)}),Ih.set(e,t)),t};function p3(e,t){const n=yu(t),[[a,i,r],s]=C.useReducer(c=>{const l=n.get(e);return Object.is(c[0],l)&&c[1]===n&&c[2]===e?c:[l,n,e]},void 0,()=>[n.get(e),n,e]);let o=a;(i!==n||r!==e)&&(s(),o=n.get(e));const d=t?.delay;if(C.useEffect(()=>{const c=n.sub(e,()=>{if(typeof d=="number"){const l=n.get(e);qf(l)&&f3(Dm(l)),setTimeout(s,d);return}s()});return s(),c},[n,e,d]),C.useDebugValue(o),qf(o)){const c=Dm(o);return bP(c)}return o}function U3(e,t){const n=yu(t);return C.useCallback((...i)=>{if((h3?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...i)},[n,e])}function xP(e,t){return[p3(e,t),U3(e,t)]}const Lm=new WeakMap;function vP(e,t){const n=yu(t),a=yP(n);for(const[i,r]of e)(!a.has(i)||t?.dangerouslyForceHydrate)&&(a.add(i),n.set(i,r))}const yP=e=>{let t=Lm.get(e);return t||(t=new WeakSet,Lm.set(e,t)),t};function ms(){return ms=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},ms.apply(this,arguments)}function m3(){const e=C.createContext(null);function t({store:s,initialValues:o=[],children:d}){const c=C.useRef(s);return c.current||(c.current=X0()),vP(o,{store:c.current}),h.jsx(e.Provider,{value:c.current,children:d})}const n=s=>{const o=C.useContext(e);if(!o)throw new Error("Missing Provider from createIsolation");return yu(ms({store:o},s))};return{Provider:t,useStore:n,useAtom:(s,o)=>{const d=n();return xP(s,ms({store:d},o))},useAtomValue:(s,o)=>{const d=n();return p3(s,ms({store:d},o))},useSetAtom:(s,o)=>{const d=n();return U3(s,ms({store:d},o))}}}const{read:nW,write:aW}=Bt(null);C.createContext({scope:void 0,baseStore:void 0});function Bi(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Rm(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function g3(...e){return t=>{let n=!1;const a=e.map(i=>{const r=Rm(i,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<a.length;i++){const r=a[i];typeof r=="function"?r():Rm(e[i],null)}}}}function Qi(...e){return C.useCallback(g3(...e),e)}function b3(e,t=[]){let n=[];function a(r,s){const o=C.createContext(s),d=n.length;n=[...n,s];const c=u=>{const{scope:f,children:p,...U}=u,m=f?.[e]?.[d]||o,g=C.useMemo(()=>U,Object.values(U));return h.jsx(m.Provider,{value:g,children:p})};c.displayName=r+"Provider";function l(u,f){const p=f?.[e]?.[d]||o,U=C.useContext(p);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${r}\``)}return[c,l]}const i=()=>{const r=n.map(s=>C.createContext(s));return function(o){const d=o?.[e]||r;return C.useMemo(()=>({[`__scope${e}`]:{...o,[e]:d}}),[o,d])}};return i.scopeName=e,[a,wP(i,...t)]}function wP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(r){const s=a.reduce((o,{useScope:d,scopeName:c})=>{const u=d(r)[`__scope${c}`];return{...o,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var W0=C.forwardRef((e,t)=>{const{children:n,...a}=e,i=C.Children.toArray(n),r=i.find(SP);if(r){const s=r.props.children,o=i.map(d=>d===r?C.Children.count(s)>1?C.Children.only(null):C.isValidElement(s)?s.props.children:null:d);return h.jsx(Jf,{...a,ref:t,children:C.isValidElement(s)?C.cloneElement(s,void 0,o):null})}return h.jsx(Jf,{...a,ref:t,children:n})});W0.displayName="Slot";var Jf=C.forwardRef((e,t)=>{const{children:n,...a}=e;if(C.isValidElement(n)){const i=MP(n),r=kP(a,n.props);return n.type!==C.Fragment&&(r.ref=t?g3(t,i):i),C.cloneElement(n,r)}return C.Children.count(n)>1?C.Children.only(null):null});Jf.displayName="SlotClone";var EP=({children:e})=>h.jsx(h.Fragment,{children:e});function SP(e){return C.isValidElement(e)&&e.type===EP}function kP(e,t){const n={...t};for(const a in t){const i=e[a],r=t[a];/^on[A-Z]/.test(a)?i&&r?n[a]=(...o)=>{r(...o),i(...o)}:i&&(n[a]=i):a==="style"?n[a]={...i,...r}:a==="className"&&(n[a]=[i,r].filter(Boolean).join(" "))}return{...e,...n}}function MP(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var CP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ui=CP.reduce((e,t)=>{const n=C.forwardRef((a,i)=>{const{asChild:r,...s}=a,o=r?W0:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(o,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function IP(e,t){e&&Kt.flushSync(()=>e.dispatchEvent(t))}function Zi(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>t.current?.(...n),[])}function _P(e,t=globalThis?.document){const n=Zi(e);C.useEffect(()=>{const a=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var TP="DismissableLayer",Qf="dismissableLayer.update",jP="dismissableLayer.pointerDownOutside",AP="dismissableLayer.focusOutside",Pm,x3=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),v3=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:s,onDismiss:o,...d}=e,c=C.useContext(x3),[l,u]=C.useState(null),f=l?.ownerDocument??globalThis?.document,[,p]=C.useState({}),U=Qi(t,M=>u(M)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(g),v=l?m.indexOf(l):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,y=v>=b,w=RP(M=>{const I=M.target,A=[...c.branches].some(_=>_.contains(I));!y||A||(i?.(M),s?.(M),M.defaultPrevented||o?.())},f),k=PP(M=>{const I=M.target;[...c.branches].some(_=>_.contains(I))||(r?.(M),s?.(M),M.defaultPrevented||o?.())},f);return _P(M=>{v===c.layers.size-1&&(a?.(M),!M.defaultPrevented&&o&&(M.preventDefault(),o()))},f),C.useEffect(()=>{if(l)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Pm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(l)),c.layers.add(l),Nm(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Pm)}},[l,f,n,c]),C.useEffect(()=>()=>{l&&(c.layers.delete(l),c.layersWithOutsidePointerEventsDisabled.delete(l),Nm())},[l,c]),C.useEffect(()=>{const M=()=>p({});return document.addEventListener(Qf,M),()=>document.removeEventListener(Qf,M)},[]),h.jsx(Ui.div,{...d,ref:U,style:{pointerEvents:x?y?"auto":"none":void 0,...e.style},onFocusCapture:Bi(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Bi(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Bi(e.onPointerDownCapture,w.onPointerDownCapture)})});v3.displayName=TP;var DP="DismissableLayerBranch",LP=C.forwardRef((e,t)=>{const n=C.useContext(x3),a=C.useRef(null),i=Qi(t,a);return C.useEffect(()=>{const r=a.current;if(r)return n.branches.add(r),()=>{n.branches.delete(r)}},[n.branches]),h.jsx(Ui.div,{...e,ref:i})});LP.displayName=DP;function RP(e,t=globalThis?.document){const n=Zi(e),a=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const r=o=>{if(o.target&&!a.current){let d=function(){y3(jP,n,c,{discrete:!0})};const c={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);a.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",r),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function PP(e,t=globalThis?.document){const n=Zi(e),a=C.useRef(!1);return C.useEffect(()=>{const i=r=>{r.target&&!a.current&&y3(AP,n,{originalEvent:r},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Nm(){const e=new CustomEvent(Qf);document.dispatchEvent(e)}function y3(e,t,n,{discrete:a}){const i=n.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),a?IP(i,r):i.dispatchEvent(r)}var _h=0;function NP(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Om()),document.body.insertAdjacentElement("beforeend",e[1]??Om()),_h++,()=>{_h===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_h--}},[])}function Om(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Th="focusScope.autoFocusOnMount",jh="focusScope.autoFocusOnUnmount",$m={bubbles:!1,cancelable:!0},OP="FocusScope",w3=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:r,...s}=e,[o,d]=C.useState(null),c=Zi(i),l=Zi(r),u=C.useRef(null),f=Qi(t,m=>d(m)),p=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(a){let m=function(x){if(p.paused||!o)return;const y=x.target;o.contains(y)?u.current=y:Ci(u.current,{select:!0})},g=function(x){if(p.paused||!o)return;const y=x.relatedTarget;y!==null&&(o.contains(y)||Ci(u.current,{select:!0}))},b=function(x){if(document.activeElement===document.body)for(const w of x)w.removedNodes.length>0&&Ci(o)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const v=new MutationObserver(b);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),v.disconnect()}}},[a,o,p.paused]),C.useEffect(()=>{if(o){zm.add(p);const m=document.activeElement;if(!o.contains(m)){const b=new CustomEvent(Th,$m);o.addEventListener(Th,c),o.dispatchEvent(b),b.defaultPrevented||($P(XP(E3(o)),{select:!0}),document.activeElement===m&&Ci(o))}return()=>{o.removeEventListener(Th,c),setTimeout(()=>{const b=new CustomEvent(jh,$m);o.addEventListener(jh,l),o.dispatchEvent(b),b.defaultPrevented||Ci(m??document.body,{select:!0}),o.removeEventListener(jh,l),zm.remove(p)},0)}}},[o,c,l,p]);const U=C.useCallback(m=>{if(!n&&!a||p.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(g&&b){const v=m.currentTarget,[x,y]=FP(v);x&&y?!m.shiftKey&&b===y?(m.preventDefault(),n&&Ci(x,{select:!0})):m.shiftKey&&b===x&&(m.preventDefault(),n&&Ci(y,{select:!0})):b===v&&m.preventDefault()}},[n,a,p.paused]);return h.jsx(Ui.div,{tabIndex:-1,...s,ref:f,onKeyDown:U})});w3.displayName=OP;function $P(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(Ci(a,{select:t}),document.activeElement!==n)return}function FP(e){const t=E3(e),n=Fm(t,e),a=Fm(t.reverse(),e);return[n,a]}function E3(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const i=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||i?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Fm(e,t){for(const n of e)if(!zP(n,{upTo:t}))return n}function zP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function BP(e){return e instanceof HTMLInputElement&&"select"in e}function Ci(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&BP(e)&&t&&e.select()}}var zm=HP();function HP(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Bm(e,t),e.unshift(t)},remove(t){e=Bm(e,t),e[0]?.resume()}}}function Bm(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function XP(e){return e.filter(t=>t.tagName!=="A")}var zr=globalThis?.document?C.useLayoutEffect:()=>{},WP=f6.useId||(()=>{}),VP=0;function GP(e){const[t,n]=C.useState(WP());return zr(()=>{n(a=>a??String(VP++))},[e]),e||(t?`radix-${t}`:"")}var ZP="Arrow",S3=C.forwardRef((e,t)=>{const{children:n,width:a=10,height:i=5,...r}=e;return h.jsx(Ui.svg,{...r,ref:t,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});S3.displayName=ZP;var YP=S3;function KP(e){const[t,n]=C.useState(void 0);return zr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const r=i[0];let s,o;if("borderBoxSize"in r){const d=r.borderBoxSize,c=Array.isArray(d)?d[0]:d;s=c.inlineSize,o=c.blockSize}else s=e.offsetWidth,o=e.offsetHeight;n({width:s,height:o})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var V0="Popper",[k3,M3]=b3(V0),[qP,C3]=k3(V0),I3=e=>{const{__scopePopper:t,children:n}=e,[a,i]=C.useState(null);return h.jsx(qP,{scope:t,anchor:a,onAnchorChange:i,children:n})};I3.displayName=V0;var _3="PopperAnchor",T3=C.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...i}=e,r=C3(_3,n),s=C.useRef(null),o=Qi(t,s);return C.useEffect(()=>{r.onAnchorChange(a?.current||s.current)}),a?null:h.jsx(Ui.div,{...i,ref:o})});T3.displayName=_3;var G0="PopperContent",[JP,QP]=k3(G0),j3=C.forwardRef((e,t)=>{const{__scopePopper:n,side:a="bottom",sideOffset:i=0,align:r="center",alignOffset:s=0,arrowPadding:o=0,avoidCollisions:d=!0,collisionBoundary:c=[],collisionPadding:l=0,sticky:u="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:U,...m}=e,g=C3(G0,n),[b,v]=C.useState(null),x=Qi(t,ce=>v(ce)),[y,w]=C.useState(null),k=KP(y),M=k?.width??0,I=k?.height??0,A=a+(r!=="center"?"-"+r:""),_=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},T=Array.isArray(c)?c:[c],L=T.length>0,R={padding:_,boundary:T.filter(tN),altBoundary:L},{refs:F,floatingStyles:P,placement:$,isPositioned:O,middlewareData:V}=Tx({strategy:"fixed",placement:A,whileElementsMounted:(...ce)=>Ox(...ce,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[jx({mainAxis:i+I,alignmentAxis:s}),d&&Ax({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Nx():void 0,...R}),d&&Dx({...R}),Lx({...R,apply:({elements:ce,rects:me,availableWidth:Be,availableHeight:ye})=>{const{width:Ae,height:kt}=me.reference,tr=ce.floating.style;tr.setProperty("--radix-popper-available-width",`${Be}px`),tr.setProperty("--radix-popper-available-height",`${ye}px`),tr.setProperty("--radix-popper-anchor-width",`${Ae}px`),tr.setProperty("--radix-popper-anchor-height",`${kt}px`)}}),y&&Rx({element:y,padding:o}),nN({arrowWidth:M,arrowHeight:I}),f&&Px({strategy:"referenceHidden",...R})]}),[W,K]=L3($),se=Zi(U);zr(()=>{O&&se?.()},[O,se]);const le=V.arrow?.x,Ie=V.arrow?.y,Qe=V.arrow?.centerOffset!==0,[rt,at]=C.useState();return zr(()=>{b&&at(window.getComputedStyle(b).zIndex)},[b]),h.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:O?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:rt,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(JP,{scope:n,placedSide:W,onArrowChange:w,arrowX:le,arrowY:Ie,shouldHideArrow:Qe,children:h.jsx(Ui.div,{"data-side":W,"data-align":K,...m,ref:x,style:{...m.style,animation:O?void 0:"none"}})})})});j3.displayName=G0;var A3="PopperArrow",eN={top:"bottom",right:"left",bottom:"top",left:"right"},D3=C.forwardRef(function(t,n){const{__scopePopper:a,...i}=t,r=QP(A3,a),s=eN[r.placedSide];return h.jsx("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:h.jsx(YP,{...i,ref:n,style:{...i.style,display:"block"}})})});D3.displayName=A3;function tN(e){return e!==null}var nN=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:a,middlewareData:i}=t,s=i.arrow?.centerOffset!==0,o=s?0:e.arrowWidth,d=s?0:e.arrowHeight,[c,l]=L3(n),u={start:"0%",center:"50%",end:"100%"}[l],f=(i.arrow?.x??0)+o/2,p=(i.arrow?.y??0)+d/2;let U="",m="";return c==="bottom"?(U=s?u:`${f}px`,m=`${-d}px`):c==="top"?(U=s?u:`${f}px`,m=`${a.floating.height+d}px`):c==="right"?(U=`${-d}px`,m=s?u:`${p}px`):c==="left"&&(U=`${a.floating.width+d}px`,m=s?u:`${p}px`),{data:{x:U,y:m}}}});function L3(e){const[t,n="center"]=e.split("-");return[t,n]}var aN=I3,R3=T3,iN=j3,rN=D3,sN="Portal",P3=C.forwardRef((e,t)=>{const{container:n,...a}=e,[i,r]=C.useState(!1);zr(()=>r(!0),[]);const s=n||i&&globalThis?.document?.body;return s?$x.createPortal(h.jsx(Ui.div,{...a,ref:t}),s):null});P3.displayName=sN;function lN(e,t){return C.useReducer((n,a)=>t[n][a]??n,e)}var Z0=e=>{const{present:t,children:n}=e,a=oN(t),i=typeof n=="function"?n({present:a.isPresent}):C.Children.only(n),r=Qi(a.ref,dN(i));return typeof n=="function"||a.isPresent?C.cloneElement(i,{ref:r}):null};Z0.displayName="Presence";function oN(e){const[t,n]=C.useState(),a=C.useRef({}),i=C.useRef(e),r=C.useRef("none"),s=e?"mounted":"unmounted",[o,d]=lN(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const c=fd(a.current);r.current=o==="mounted"?c:"none"},[o]),zr(()=>{const c=a.current,l=i.current;if(l!==e){const f=r.current,p=fd(c);e?d("MOUNT"):p==="none"||c?.display==="none"?d("UNMOUNT"):d(l&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),zr(()=>{if(t){let c;const l=t.ownerDocument.defaultView??window,u=p=>{const m=fd(a.current).includes(p.animationName);if(p.target===t&&m&&(d("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},f=p=>{p.target===t&&(r.current=fd(a.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{l.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:C.useCallback(c=>{c&&(a.current=getComputedStyle(c)),n(c)},[])}}function fd(e){return e?.animationName||"none"}function dN(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function cN({prop:e,defaultProp:t,onChange:n=()=>{}}){const[a,i]=uN({defaultProp:t,onChange:n}),r=e!==void 0,s=r?e:a,o=Zi(n),d=C.useCallback(c=>{if(r){const u=typeof c=="function"?c(e):c;u!==e&&o(u)}else i(c)},[r,e,i,o]);return[s,d]}function uN({defaultProp:e,onChange:t}){const n=C.useState(e),[a]=n,i=C.useRef(a),r=Zi(t);return C.useEffect(()=>{i.current!==a&&(r(a),i.current=a)},[a,i,r]),n}var Y0="Popover",[N3]=b3(Y0,[M3]),Bo=M3(),[hN,er]=N3(Y0),O3=e=>{const{__scopePopover:t,children:n,open:a,defaultOpen:i,onOpenChange:r,modal:s=!1}=e,o=Bo(t),d=C.useRef(null),[c,l]=C.useState(!1),[u=!1,f]=cN({prop:a,defaultProp:i,onChange:r});return h.jsx(aN,{...o,children:h.jsx(hN,{scope:t,contentId:GP(),triggerRef:d,open:u,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:C.useCallback(()=>l(!0),[]),onCustomAnchorRemove:C.useCallback(()=>l(!1),[]),modal:s,children:n})})};O3.displayName=Y0;var $3="PopoverAnchor",fN=C.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,i=er($3,n),r=Bo(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:o}=i;return C.useEffect(()=>(s(),()=>o()),[s,o]),h.jsx(R3,{...r,...a,ref:t})});fN.displayName=$3;var F3="PopoverTrigger",z3=C.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,i=er(F3,n),r=Bo(n),s=Qi(t,i.triggerRef),o=h.jsx(Ui.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":G3(i.open),...a,ref:s,onClick:Bi(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?o:h.jsx(R3,{asChild:!0,...r,children:o})});z3.displayName=F3;var K0="PopoverPortal",[pN,UN]=N3(K0,{forceMount:void 0}),B3=e=>{const{__scopePopover:t,forceMount:n,children:a,container:i}=e,r=er(K0,t);return h.jsx(pN,{scope:t,forceMount:n,children:h.jsx(Z0,{present:n||r.open,children:h.jsx(P3,{asChild:!0,container:i,children:a})})})};B3.displayName=K0;var Os="PopoverContent",H3=C.forwardRef((e,t)=>{const n=UN(Os,e.__scopePopover),{forceMount:a=n.forceMount,...i}=e,r=er(Os,e.__scopePopover);return h.jsx(Z0,{present:a||r.open,children:r.modal?h.jsx(mN,{...i,ref:t}):h.jsx(gN,{...i,ref:t})})});H3.displayName=Os;var mN=C.forwardRef((e,t)=>{const n=er(Os,e.__scopePopover),a=C.useRef(null),i=Qi(t,a),r=C.useRef(!1);return C.useEffect(()=>{const s=a.current;if(s)return Fx(s)},[]),h.jsx(zx,{as:W0,allowPinchZoom:!0,children:h.jsx(X3,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Bi(e.onCloseAutoFocus,s=>{s.preventDefault(),r.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Bi(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,d=o.button===0&&o.ctrlKey===!0,c=o.button===2||d;r.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Bi(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),gN=C.forwardRef((e,t)=>{const n=er(Os,e.__scopePopover),a=C.useRef(!1),i=C.useRef(!1);return h.jsx(X3,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{e.onCloseAutoFocus?.(r),r.defaultPrevented||(a.current||n.triggerRef.current?.focus(),r.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:r=>{e.onInteractOutside?.(r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=r.target;n.triggerRef.current?.contains(s)&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&i.current&&r.preventDefault()}})}),X3=C.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:r,disableOutsidePointerEvents:s,onEscapeKeyDown:o,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:l,...u}=e,f=er(Os,n),p=Bo(n);return NP(),h.jsx(w3,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:r,children:h.jsx(v3,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:l,onEscapeKeyDown:o,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:h.jsx(iN,{"data-state":G3(f.open),role:"dialog",id:f.contentId,...p,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),W3="PopoverClose",bN=C.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,i=er(W3,n);return h.jsx(Ui.button,{type:"button",...a,ref:t,onClick:Bi(e.onClick,()=>i.onOpenChange(!1))})});bN.displayName=W3;var xN="PopoverArrow",V3=C.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,i=Bo(n);return h.jsx(rN,{...i,...a,ref:t})});V3.displayName=xN;function G3(e){return e?"open":"closed"}var wu=O3,Eu=z3,vN=B3,q0=H3,Z3=V3,Ah={exports:{}},Hm;function yN(){return Hm||(Hm=1,(function(e,t){(function(){var n={};e.exports=n,n.simpleFilter=function(a,i){return i.filter(function(r){return n.test(a,r)})},n.test=function(a,i){return n.match(a,i)!==null},n.match=function(a,i,r){r=r||{};var s=0,o=[],d=i.length,c=0,l=0,u=r.pre||"",f=r.post||"",p=r.caseSensitive&&i||i.toLowerCase(),U;a=r.caseSensitive&&a||a.toLowerCase();for(var m=0;m<d;m++)U=i[m],p[m]===a[s]?(U=u+U+f,s+=1,l+=1+l):l=0,c+=l,o[o.length]=U;return s===a.length?(c=p===a?1/0:c,{rendered:o.join(""),score:c}):null},n.filter=function(a,i,r){return!i||i.length===0?[]:typeof a!="string"?i:(r=r||{},i.reduce(function(s,o,d,c){var l=o;r.extract&&(l=r.extract(o));var u=n.match(a,l,r);return u!=null&&(s[s.length]={string:u.rendered,score:u.score,index:d,original:o}),s},[]).sort(function(s,o){var d=o.score-s.score;return d||s.index-o.index}))}})()})(Ah)),Ah.exports}var wN=yN();const EN=Hr(wN),SN={},Xm=e=>{let t;const n=new Set,a=(l,u)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(U=>U(t,p))}},i=()=>t,d={setState:a,getState:i,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(SN?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(a,i,d);return d},kN=e=>e?Xm(e):Xm,Y3={},{useDebugValue:MN}=Z,{useSyncExternalStoreWithSelector:CN}=Bx;let Wm=!1;const IN=e=>e;function _N(e,t=IN,n){(Y3?"production":void 0)!=="production"&&n&&!Wm&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Wm=!0);const a=CN(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return MN(a),a}const Vm=e=>{(Y3?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?kN(e):e,n=(a,i)=>_N(t,a,i);return Object.assign(n,t),n},TN=e=>e?Vm(e):Vm;var Gm,Zm;const Ym=typeof window<"u"&&((Gm=window.document)!=null&&Gm.createElement||((Zm=window.navigator)==null?void 0:Zm.product)==="ReactNative")?Z.useLayoutEffect:Z.useEffect;function va(){const e=TN(t=>({current:new Array,version:0,set:t}));return{In:({children:t})=>{const n=e(i=>i.set),a=e(i=>i.version);return Ym(()=>{n(i=>({version:i.version+1}))},[]),Ym(()=>(n(({current:i})=>({current:[...i,t]})),()=>n(({current:i})=>({current:i.filter(r=>r!==t)}))),[t,a]),null},Out:()=>{const t=e(n=>n.current);return Z.createElement(Z.Fragment,null,t)}}}function ai(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function J0(e,t=[]){let n=[];function a(r,s){const o=C.createContext(s),d=n.length;n=[...n,s];function c(u){const{scope:f,children:p,...U}=u,m=f?.[e][d]||o,g=C.useMemo(()=>U,Object.values(U));return C.createElement(m.Provider,{value:g},p)}function l(u,f){const p=f?.[e][d]||o,U=C.useContext(p);if(U)return U;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${r}\``)}return c.displayName=r+"Provider",[c,l]}const i=()=>{const r=n.map(s=>C.createContext(s));return function(o){const d=o?.[e]||r;return C.useMemo(()=>({[`__scope${e}`]:{...o,[e]:d}}),[o,d])}};return i.scopeName=e,[a,jN(i,...t)]}function jN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(r){const s=a.reduce((o,{useScope:d,scopeName:c})=>{const u=d(r)[`__scope${c}`];return{...o,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function AN(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function K3(...e){return t=>e.forEach(n=>AN(n,t))}function e1(...e){return C.useCallback(K3(...e),e)}const t1=C.forwardRef((e,t)=>{const{children:n,...a}=e,i=C.Children.toArray(n),r=i.find(LN);if(r){const s=r.props.children,o=i.map(d=>d===r?C.Children.count(s)>1?C.Children.only(null):C.isValidElement(s)?s.props.children:null:d);return C.createElement(n1,wn({},a,{ref:t}),C.isValidElement(s)?C.cloneElement(s,void 0,o):null)}return C.createElement(n1,wn({},a,{ref:t}),n)});t1.displayName="Slot";const n1=C.forwardRef((e,t)=>{const{children:n,...a}=e;return C.isValidElement(n)?C.cloneElement(n,{...RN(a,n.props),ref:K3(t,n.ref)}):C.Children.count(n)>1?C.Children.only(null):null});n1.displayName="SlotClone";const DN=({children:e})=>C.createElement(C.Fragment,null,e);function LN(e){return C.isValidElement(e)&&e.type===DN}function RN(e,t){const n={...t};for(const a in t){const i=e[a],r=t[a];/^on[A-Z]/.test(a)?i&&r?n[a]=(...o)=>{r(...o),i(...o)}:i&&(n[a]=i):a==="style"?n[a]={...i,...r}:a==="className"&&(n[a]=[i,r].filter(Boolean).join(" "))}return{...e,...n}}function PN(e){const t=e+"CollectionProvider",[n,a]=J0(t),[i,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:U,children:m}=p,g=Z.useRef(null),b=Z.useRef(new Map).current;return Z.createElement(i,{scope:U,itemMap:b,collectionRef:g},m)},o=e+"CollectionSlot",d=Z.forwardRef((p,U)=>{const{scope:m,children:g}=p,b=r(o,m),v=e1(U,b.collectionRef);return Z.createElement(t1,{ref:v},g)}),c=e+"CollectionItemSlot",l="data-radix-collection-item",u=Z.forwardRef((p,U)=>{const{scope:m,children:g,...b}=p,v=Z.useRef(null),x=e1(U,v),y=r(c,m);return Z.useEffect(()=>(y.itemMap.set(v,{ref:v,...b}),()=>void y.itemMap.delete(v))),Z.createElement(t1,{[l]:"",ref:x},g)});function f(p){const U=r(e+"CollectionConsumer",p);return Z.useCallback(()=>{const g=U.collectionRef.current;if(!g)return[];const b=Array.from(g.querySelectorAll(`[${l}]`));return Array.from(U.itemMap.values()).sort((y,w)=>b.indexOf(y.ref.current)-b.indexOf(w.ref.current))},[U.collectionRef,U.itemMap])}return[{Provider:s,Slot:d,ItemSlot:u},f,a]}const NN=globalThis?.document?C.useLayoutEffect:()=>{},ON=f6.useId||(()=>{});let $N=0;function q3(e){const[t,n]=C.useState(ON());return NN(()=>{n(a=>a??String($N++))},[e]),e||(t?`radix-${t}`:"")}function FN(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function zN(...e){return t=>e.forEach(n=>FN(n,t))}const J3=C.forwardRef((e,t)=>{const{children:n,...a}=e,i=C.Children.toArray(n),r=i.find(HN);if(r){const s=r.props.children,o=i.map(d=>d===r?C.Children.count(s)>1?C.Children.only(null):C.isValidElement(s)?s.props.children:null:d);return C.createElement(a1,wn({},a,{ref:t}),C.isValidElement(s)?C.cloneElement(s,void 0,o):null)}return C.createElement(a1,wn({},a,{ref:t}),n)});J3.displayName="Slot";const a1=C.forwardRef((e,t)=>{const{children:n,...a}=e;return C.isValidElement(n)?C.cloneElement(n,{...XN(a,n.props),ref:zN(t,n.ref)}):C.Children.count(n)>1?C.Children.only(null):null});a1.displayName="SlotClone";const BN=({children:e})=>C.createElement(C.Fragment,null,e);function HN(e){return C.isValidElement(e)&&e.type===BN}function XN(e,t){const n={...t};for(const a in t){const i=e[a],r=t[a];/^on[A-Z]/.test(a)?i&&r?n[a]=(...o)=>{r(...o),i(...o)}:i&&(n[a]=i):a==="style"?n[a]={...i,...r}:a==="className"&&(n[a]=[i,r].filter(Boolean).join(" "))}return{...e,...n}}const WN=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Gs=WN.reduce((e,t)=>{const n=C.forwardRef((a,i)=>{const{asChild:r,...s}=a,o=r?J3:t;return C.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),C.createElement(o,wn({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function VN(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var a;return(a=t.current)===null||a===void 0?void 0:a.call(t,...n)},[])}function Q3(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var a;return(a=t.current)===null||a===void 0?void 0:a.call(t,...n)},[])}function e4({prop:e,defaultProp:t,onChange:n=()=>{}}){const[a,i]=GN({defaultProp:t,onChange:n}),r=e!==void 0,s=r?e:a,o=Q3(n),d=C.useCallback(c=>{if(r){const u=typeof c=="function"?c(e):c;u!==e&&o(u)}else i(c)},[r,e,i,o]);return[s,d]}function GN({defaultProp:e,onChange:t}){const n=C.useState(e),[a]=n,i=C.useRef(a),r=Q3(t);return C.useEffect(()=>{i.current!==a&&(r(a),i.current=a)},[a,i,r]),n}const ZN=C.createContext(void 0);function t4(e){const t=C.useContext(ZN);return e||t||"ltr"}const Dh="rovingFocusGroup.onEntryFocus",YN={bubbles:!1,cancelable:!0},Q0="RovingFocusGroup",[i1,n4,KN]=PN(Q0),[qN,a4]=J0(Q0,[KN]),[JN,QN]=qN(Q0),eO=C.forwardRef((e,t)=>C.createElement(i1.Provider,{scope:e.__scopeRovingFocusGroup},C.createElement(i1.Slot,{scope:e.__scopeRovingFocusGroup},C.createElement(tO,wn({},e,{ref:t}))))),tO=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:i=!1,dir:r,currentTabStopId:s,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:d,onEntryFocus:c,...l}=e,u=C.useRef(null),f=e1(t,u),p=t4(r),[U=null,m]=e4({prop:s,defaultProp:o,onChange:d}),[g,b]=C.useState(!1),v=VN(c),x=n4(n),y=C.useRef(!1),[w,k]=C.useState(0);return C.useEffect(()=>{const M=u.current;if(M)return M.addEventListener(Dh,v),()=>M.removeEventListener(Dh,v)},[v]),C.createElement(JN,{scope:n,orientation:a,dir:p,loop:i,currentTabStopId:U,onItemFocus:C.useCallback(M=>m(M),[m]),onItemShiftTab:C.useCallback(()=>b(!0),[]),onFocusableItemAdd:C.useCallback(()=>k(M=>M+1),[]),onFocusableItemRemove:C.useCallback(()=>k(M=>M-1),[])},C.createElement(Gs.div,wn({tabIndex:g||w===0?-1:0,"data-orientation":a},l,{ref:f,style:{outline:"none",...e.style},onMouseDown:ai(e.onMouseDown,()=>{y.current=!0}),onFocus:ai(e.onFocus,M=>{const I=!y.current;if(M.target===M.currentTarget&&I&&!g){const A=new CustomEvent(Dh,YN);if(M.currentTarget.dispatchEvent(A),!A.defaultPrevented){const _=x().filter(P=>P.focusable),T=_.find(P=>P.active),L=_.find(P=>P.id===U),F=[T,L,..._].filter(Boolean).map(P=>P.ref.current);i4(F)}}y.current=!1}),onBlur:ai(e.onBlur,()=>b(!1))})))}),nO="RovingFocusGroupItem",aO=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:i=!1,tabStopId:r,...s}=e,o=q3(),d=r||o,c=QN(nO,n),l=c.currentTabStopId===d,u=n4(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return C.useEffect(()=>{if(a)return f(),()=>p()},[a,f,p]),C.createElement(i1.ItemSlot,{scope:n,id:d,focusable:a,active:i},C.createElement(Gs.span,wn({tabIndex:l?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:ai(e.onMouseDown,U=>{a?c.onItemFocus(d):U.preventDefault()}),onFocus:ai(e.onFocus,()=>c.onItemFocus(d)),onKeyDown:ai(e.onKeyDown,U=>{if(U.key==="Tab"&&U.shiftKey){c.onItemShiftTab();return}if(U.target!==U.currentTarget)return;const m=sO(U,c.orientation,c.dir);if(m!==void 0){U.preventDefault();let b=u().filter(v=>v.focusable).map(v=>v.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const v=b.indexOf(U.currentTarget);b=c.loop?lO(b,v+1):b.slice(v+1)}setTimeout(()=>i4(b))}})})))}),iO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function sO(e,t,n){const a=rO(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return iO[a]}function i4(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function lO(e,t){return e.map((n,a)=>e[(t+a)%e.length])}const oO=eO,dO=aO;function cO(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function uO(...e){return t=>e.forEach(n=>cO(n,t))}function hO(...e){return C.useCallback(uO(...e),e)}const Km=globalThis?.document?C.useLayoutEffect:()=>{};function fO(e,t){return C.useReducer((n,a)=>{const i=t[n][a];return i??n},e)}const r4=e=>{const{present:t,children:n}=e,a=pO(t),i=typeof n=="function"?n({present:a.isPresent}):C.Children.only(n),r=hO(a.ref,i.ref);return typeof n=="function"||a.isPresent?C.cloneElement(i,{ref:r}):null};r4.displayName="Presence";function pO(e){const[t,n]=C.useState(),a=C.useRef({}),i=C.useRef(e),r=C.useRef("none"),s=e?"mounted":"unmounted",[o,d]=fO(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const c=pd(a.current);r.current=o==="mounted"?c:"none"},[o]),Km(()=>{const c=a.current,l=i.current;if(l!==e){const f=r.current,p=pd(c);e?d("MOUNT"):p==="none"||c?.display==="none"?d("UNMOUNT"):d(l&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),Km(()=>{if(t){const c=u=>{const p=pd(a.current).includes(u.animationName);u.target===t&&p&&Kt.flushSync(()=>d("ANIMATION_END"))},l=u=>{u.target===t&&(r.current=pd(a.current))};return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:C.useCallback(c=>{c&&(a.current=getComputedStyle(c)),n(c)},[])}}function pd(e){return e?.animationName||"none"}const s4="Tabs",[UO]=J0(s4,[a4]),l4=a4(),[mO,ep]=UO(s4),gO=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:i,defaultValue:r,orientation:s="horizontal",dir:o,activationMode:d="automatic",...c}=e,l=t4(o),[u,f]=e4({prop:a,onChange:i,defaultProp:r});return C.createElement(mO,{scope:n,baseId:q3(),value:u,onValueChange:f,orientation:s,dir:l,activationMode:d},C.createElement(Gs.div,wn({dir:l,"data-orientation":s},c,{ref:t})))}),bO="TabsList",xO=C.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...i}=e,r=ep(bO,n),s=l4(n);return C.createElement(oO,wn({asChild:!0},s,{orientation:r.orientation,dir:r.dir,loop:a}),C.createElement(Gs.div,wn({role:"tablist","aria-orientation":r.orientation},i,{ref:t})))}),vO="TabsTrigger",yO=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:i=!1,...r}=e,s=ep(vO,n),o=l4(n),d=o4(s.baseId,a),c=d4(s.baseId,a),l=a===s.value;return C.createElement(dO,wn({asChild:!0},o,{focusable:!i,active:l}),C.createElement(Gs.button,wn({type:"button",role:"tab","aria-selected":l,"aria-controls":c,"data-state":l?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:d},r,{ref:t,onMouseDown:ai(e.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?s.onValueChange(a):u.preventDefault()}),onKeyDown:ai(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&s.onValueChange(a)}),onFocus:ai(e.onFocus,()=>{const u=s.activationMode!=="manual";!l&&!i&&u&&s.onValueChange(a)})})))}),wO="TabsContent",EO=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:i,children:r,...s}=e,o=ep(wO,n),d=o4(o.baseId,a),c=d4(o.baseId,a),l=a===o.value,u=C.useRef(l);return C.useEffect(()=>{const f=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(f)},[]),C.createElement(r4,{present:i||l},({present:f})=>C.createElement(Gs.div,wn({"data-state":l?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":d,hidden:!f,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0}}),f&&r))});function o4(e,t){return`${e}-trigger-${t}`}function d4(e,t){return`${e}-content-${t}`}const c4=gO,u4=xO,h4=yO,f4=EO;var Lh,qm;function SO(){if(qm)return Lh;qm=1;var e="Expected a function",t=NaN,n="[object Symbol]",a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,d=typeof ji=="object"&&ji&&ji.Object===Object&&ji,c=typeof self=="object"&&self&&self.Object===Object&&self,l=d||c||Function("return this")(),u=Object.prototype,f=u.toString,p=Math.max,U=Math.min,m=function(){return l.Date.now()};function g(w,k,M){var I,A,_,T,L,R,F=0,P=!1,$=!1,O=!0;if(typeof w!="function")throw new TypeError(e);k=y(k)||0,b(M)&&(P=!!M.leading,$="maxWait"in M,_=$?p(y(M.maxWait)||0,k):_,O="trailing"in M?!!M.trailing:O);function V(ce){var me=I,Be=A;return I=A=void 0,F=ce,T=w.apply(Be,me),T}function W(ce){return F=ce,L=setTimeout(le,k),P?V(ce):T}function K(ce){var me=ce-R,Be=ce-F,ye=k-me;return $?U(ye,_-Be):ye}function se(ce){var me=ce-R,Be=ce-F;return R===void 0||me>=k||me<0||$&&Be>=_}function le(){var ce=m();if(se(ce))return Ie(ce);L=setTimeout(le,K(ce))}function Ie(ce){return L=void 0,O&&I?V(ce):(I=A=void 0,T)}function Qe(){L!==void 0&&clearTimeout(L),F=0,I=R=A=L=void 0}function rt(){return L===void 0?T:Ie(m())}function at(){var ce=m(),me=se(ce);if(I=arguments,A=this,R=ce,me){if(L===void 0)return W(R);if($)return L=setTimeout(le,k),V(R)}return L===void 0&&(L=setTimeout(le,k)),T}return at.cancel=Qe,at.flush=rt,at}function b(w){var k=typeof w;return!!w&&(k=="object"||k=="function")}function v(w){return!!w&&typeof w=="object"}function x(w){return typeof w=="symbol"||v(w)&&f.call(w)==n}function y(w){if(typeof w=="number")return w;if(x(w))return t;if(b(w)){var k=typeof w.valueOf=="function"?w.valueOf():w;w=b(k)?k+"":k}if(typeof w!="string")return w===0?w:+w;w=w.replace(a,"");var M=r.test(w);return M||s.test(w)?o(w.slice(2),M?2:8):i.test(w)?t:+w}return Lh=g,Lh}var kO=SO();const MO=Hr(kO);function CO(e,t,n,a){Object.defineProperty(e,t,{get:n,set:a,enumerable:!0,configurable:!0})}var IO={};CO(IO,"LaserPointer",()=>Dc);function xt([e,t,n],[a,i,r]){return[e+a,t+i,n+r]}function Cl([e,t,n],[a,i,r]){return[e-a,t-i,n-r]}function Mt([e,t,n],a){return[e*a,t*a,n*a]}function ns([e,t,n]){return[e/Math.sqrt(e**2+t**2),t/Math.sqrt(e**2+t**2),n]}function Zt([e,t,n],a){return[Math.cos(a)*e-Math.sin(a)*t,Math.sin(a)*e+Math.cos(a)*t,n]}function _O(e,t,n){return xt(e,Mt(Cl(t,e),n))}function Jm(e,t,n){return Math.atan2(n[1]-e[1],n[0]-e[0])-Math.atan2(t[1]-e[1],t[0]-e[0])}function Qm(e){return Math.atan2(Math.sin(e),Math.cos(e))}function eg([e,t]){return Math.sqrt(e**2+t**2)}function ys([e,t],[n,a]){return Math.sqrt((n-e)**2+(a-t)**2)}function TO(e){if(e.length<2)return 0;let t=0;for(let n=1;n<=e.length-1;n++)t+=ys(e[n-1],e[n]);return t+=ys(e[e.length-2],e[e.length-1]),t}const jO=(e,t,n)=>Math.max(t,Math.min(n,e));function AO(e,t,n){const a=ys(t,n);if(a===0)return ys(e,t);const i=jO(((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/a**2,0,1),r=[t[0]+i*(n[0]-t[0]),t[1]+i*(n[1]-t[1]),e[2]];return ys(r,e)}function Ac(e,t){if(t===0||e.length<=2)return e;const n=e[0],a=e[e.length-1],[i,r]=e.reduce(([s,o],d,c)=>{const l=AO(d,n,a);return l>s?[l,c]:[s,o]},[0,-1]);if(i>=t){const s=e[r];return[...Ac([n,...e.slice(1,r),s],t).slice(0,-1),s,...Ac([s,...e.slice(r,-1),a],t).slice(1)]}else return[n,a]}const _i=class _i{constructor(t){this.originalPoints=[],this.stablePoints=[],this.tailPoints=[],this.isFresh=!0,this.options=Object.assign({},_i.defaults,t)}get lastPoint(){return this.tailPoints[this.tailPoints.length-1]??this.stablePoints[this.stablePoints.length-1]}addPoint(t){const n=this.originalPoints[this.originalPoints.length-1];if(!(n&&n[0]===t[0]&&n[1]===t[1])){if(this.originalPoints.push(t),this.isFresh){this.isFresh=!1,this.stablePoints.push(t);return}this.options.streamline>0&&(t=_O(this.lastPoint,t,1-this.options.streamline)),this.tailPoints.push(t),TO(this.tailPoints)>_i.constants.maxTailLength&&this.stabilizeTail()}}close(){this.stabilizeTail()}stabilizeTail(){if(this.options.simplify>0&&this.options.simplifyPhase=="tail")throw new Error("Not implemented yet");this.stablePoints.push(...this.tailPoints),this.tailPoints=[]}getSize(t,n,a,i,r){return(t??this.options.size)*this.options.sizeMapping({pressure:n,runningLength:r,currentIndex:a,totalLength:i})}getStrokeOutline(t){if(this.isFresh)return[];let n=[...this.stablePoints,...this.tailPoints];this.options.simplify>0&&this.options.simplifyPhase==="input"&&(n=Ac(n,this.options.simplify));const a=n.length;if(a===0)return[];if(a===1){const M=n[0],I=this.getSize(t,M[2],0,a,0);if(I<.5)return[];const A=[];for(let _=0;_<=Math.PI*2;_+=Math.PI/16)A.push(xt(M,Mt(Zt([1,0,0],_),I)));return A.push(xt(M,Mt([1,0,0],this.getSize(t,M[2],0,a,0)))),A}if(a===2){const M=n[0],I=n[1],A=this.getSize(t,M[2],0,a,0),_=this.getSize(t,I[2],0,a,0);if(A<.5||_<.5)return[];const T=[],L=Jm(M,[M[0],M[1]-100,M[2]],I);for(let R=L;R<=Math.PI+L;R+=Math.PI/16)T.push(xt(M,Mt(Zt([1,0,0],R),A)));for(let R=Math.PI+L;R<=Math.PI*2+L;R+=Math.PI/16)T.push(xt(I,Mt(Zt([1,0,0],R),_)));return T.push(T[0]),T}const i=[],r=[];let s=0,o=0,d=0,c=0;for(let M=1;M<a-1;M++){const I=n[M-1],A=n[M],_=n[M+1];let T=A[2];const L=ys(I,A);c+=L,s=o+(L-o)*.2;const R=this.getSize(t,T,M,a,c);if(R===0){d=M+1;continue}const F=ns(Cl(I,A)),P=ns(Cl(_,A)),$=Zt(F,Math.PI/2),O=Zt(F,-Math.PI/2),V=Zt(P,Math.PI/2),W=Zt(P,-Math.PI/2),K=xt(A,Mt($,R)),se=xt(A,Mt(O,R)),le=xt(A,Mt(V,R)),Ie=xt(A,Mt(W,R)),Qe=xt($,W),rt=xt(O,V),at=xt(A,Mt(eg(Qe)===0?F:ns(Qe),R)),ce=xt(A,Mt(eg(rt)===0?P:ns(rt),R)),me=Qm(Jm(A,I,_)),Be=_i.constants.cornerDetectionMaxAngle/180*Math.PI*_i.constants.cornerDetectionVariance(s);if(Math.abs(me)<Be){const ye=Math.abs(Qm(Math.PI-me));if(ye===0)continue;if(me<0){r.push(se,ce);for(let Ae=0;Ae<=ye;Ae+=ye/4)i.push(xt(A,Zt(Mt($,R),Ae)));for(let Ae=ye;Ae>=0;Ae-=ye/4)r.push(xt(A,Zt(Mt($,R),Ae)));r.push(ce,le)}else{i.push(K,at);for(let Ae=0;Ae<=ye;Ae+=ye/4)r.push(xt(A,Zt(Mt($,-R),-Ae)));for(let Ae=ye;Ae>=0;Ae-=ye/4)i.push(xt(A,Zt(Mt($,-R),-Ae)));i.push(at,Ie)}}else i.push(at),r.push(ce);o=s}if(d>=a-2)if(this.options.keepHead){const M=n[a-1],I=[];for(let A=0;A<=Math.PI*2;A+=Math.PI/16)I.push(xt(M,Mt(Zt([1,0,0],A),this.options.size)));return I.push(xt(M,Mt([1,0,0],this.options.size))),I}else return[];const l=n[d],u=n[d+1],f=n[a-2],p=n[a-1],U=ns(Cl(u,l)),m=ns(Cl(f,p)),g=Zt(U,-Math.PI/2),b=Zt(m,Math.PI/2),v=this.getSize(t,l[2],0,a,0),x=[],y=this.options.keepHead?this.options.size:this.getSize(t,f[2],a-2,a,c),w=[];if(v>1){for(let M=0;M<=Math.PI;M+=Math.PI/16)x.unshift(xt(l,Zt(Mt(g,v),-M)));x.unshift(xt(l,Mt(g,-v)))}else x.push(l);for(let M=0;M<=Math.PI*3;M+=Math.PI/16)w.push(xt(p,Zt(Mt(b,-y),-M)));const k=[...x,...i,...w.reverse(),...r.reverse()];return x.length>0&&k.push(x[0]),this.options.simplify>0&&this.options.simplifyPhase==="output"?Ac(k,this.options.simplify):k}};_i.defaults={size:2,streamline:.45,simplify:.1,simplifyPhase:"output",keepHead:!1,sizeMapping:()=>1},_i.constants={cornerDetectionMaxAngle:75,cornerDetectionVariance:t=>t>35?.5:1,maxTailLength:50};let Dc=_i;var p4=m3(),{useAtom:gt,useSetAtom:Su,useAtomValue:U4,useStore:iW}=p4,DO=p4.Provider,ia=X0(),LO=Xx({"./locales/ar-SA.json":()=>ne(()=>import("./ar-SA-G6X2FPQ2-zGa4nmKj.js"),__vite__mapDeps([5,2,3])),"./locales/az-AZ.json":()=>ne(()=>import("./az-AZ-76LH7QW2-2ofaYqg_.js"),__vite__mapDeps([6,2,3])),"./locales/bg-BG.json":()=>ne(()=>import("./bg-BG-XCXSNQG7-djDKLEln.js"),__vite__mapDeps([7,2,3])),"./locales/bn-BD.json":()=>ne(()=>import("./bn-BD-2XOGV67Q-DHBogyv-.js"),__vite__mapDeps([8,2,3])),"./locales/ca-ES.json":()=>ne(()=>import("./ca-ES-6MX7JW3Y-OWWCWvuP.js"),__vite__mapDeps([9,2,3])),"./locales/cs-CZ.json":()=>ne(()=>import("./cs-CZ-2BRQDIVT-CP9xiC8w.js"),__vite__mapDeps([10,2,3])),"./locales/da-DK.json":()=>ne(()=>import("./da-DK-5WZEPLOC-Cpbm5Bju.js"),__vite__mapDeps([11,2,3])),"./locales/de-DE.json":()=>ne(()=>import("./de-DE-XR44H4JA-D8rOmKQW.js"),__vite__mapDeps([12,2,3])),"./locales/el-GR.json":()=>ne(()=>import("./el-GR-BZB4AONW-BgQNs1cl.js"),__vite__mapDeps([13,2,3])),"./locales/en.json":()=>ne(()=>Promise.resolve().then(()=>YX),void 0),"./locales/es-ES.json":()=>ne(()=>import("./es-ES-U4NZUMDT-C1M-3kUi.js"),__vite__mapDeps([14,2,3])),"./locales/eu-ES.json":()=>ne(()=>import("./eu-ES-A7QVB2H4-sIoA4F86.js"),__vite__mapDeps([15,2,3])),"./locales/fa-IR.json":()=>ne(()=>import("./fa-IR-HGAKTJCU-CtmSfjBe.js"),__vite__mapDeps([16,2,3])),"./locales/fi-FI.json":()=>ne(()=>import("./fi-FI-Z5N7JZ37-CkqAf83a.js"),__vite__mapDeps([17,2,3])),"./locales/fr-FR.json":()=>ne(()=>import("./fr-FR-RHASNOE6-BLTlR38v.js"),__vite__mapDeps([18,2,3])),"./locales/gl-ES.json":()=>ne(()=>import("./gl-ES-HMX3MZ6V-DiriMGaf.js"),__vite__mapDeps([19,2,3])),"./locales/he-IL.json":()=>ne(()=>import("./he-IL-6SHJWFNN-BGgOoPZG.js"),__vite__mapDeps([20,2,3])),"./locales/hi-IN.json":()=>ne(()=>import("./hi-IN-IWLTKZ5I-C4QTfw3M.js"),__vite__mapDeps([21,2,3])),"./locales/hu-HU.json":()=>ne(()=>import("./hu-HU-A5ZG7DT2-DGtzDRRU.js"),__vite__mapDeps([22,2,3])),"./locales/id-ID.json":()=>ne(()=>import("./id-ID-SAP4L64H-CzcaN-wr.js"),__vite__mapDeps([23,2,3])),"./locales/it-IT.json":()=>ne(()=>import("./it-IT-JPQ66NNP-DEqzEHhG.js"),__vite__mapDeps([24,2,3])),"./locales/ja-JP.json":()=>ne(()=>import("./ja-JP-DBVTYXUO-DQOZh6jj.js"),__vite__mapDeps([25,2,3])),"./locales/kaa.json":()=>ne(()=>import("./kaa-6HZHGXH3-DAsn8pMz.js"),__vite__mapDeps([26,2,3])),"./locales/kab-KAB.json":()=>ne(()=>import("./kab-KAB-ZGHBKWFO-hbSn2yHo.js"),__vite__mapDeps([27,2,3])),"./locales/kk-KZ.json":()=>ne(()=>import("./kk-KZ-P5N5QNE5-DJbDGpSa.js"),__vite__mapDeps([28,2,3])),"./locales/km-KH.json":()=>ne(()=>import("./km-KH-HSX4SM5Z-CF1cSYpx.js"),__vite__mapDeps([29,2,3])),"./locales/ko-KR.json":()=>ne(()=>import("./ko-KR-MTYHY66A-D0j8sNVo.js"),__vite__mapDeps([30,2,3])),"./locales/ku-TR.json":()=>ne(()=>import("./ku-TR-6OUDTVRD-DZ47lKMP.js"),__vite__mapDeps([31,2,3])),"./locales/lt-LT.json":()=>ne(()=>import("./lt-LT-XHIRWOB4-B_rQQq9i.js"),__vite__mapDeps([32,2,3])),"./locales/lv-LV.json":()=>ne(()=>import("./lv-LV-5QDEKY6T-CLpzoE_t.js"),__vite__mapDeps([33,2,3])),"./locales/mr-IN.json":()=>ne(()=>import("./mr-IN-CRQNXWMA-BUEgszaQ.js"),__vite__mapDeps([34,2,3])),"./locales/my-MM.json":()=>ne(()=>import("./my-MM-5M5IBNSE-Dn6dj_g-.js"),__vite__mapDeps([35,2,3])),"./locales/nb-NO.json":()=>ne(()=>import("./nb-NO-T6EIAALU-CDRfxO5D.js"),__vite__mapDeps([36,2,3])),"./locales/nl-NL.json":()=>ne(()=>import("./nl-NL-IS3SIHDZ-C7BWZ57w.js"),__vite__mapDeps([37,2,3])),"./locales/nn-NO.json":()=>ne(()=>import("./nn-NO-6E72VCQL-DgWcUCmS.js"),__vite__mapDeps([38,2,3])),"./locales/oc-FR.json":()=>ne(()=>import("./oc-FR-POXYY2M6-C64no2Sz.js"),__vite__mapDeps([39,2,3])),"./locales/pa-IN.json":()=>ne(()=>import("./pa-IN-N4M65BXN-CdXAiUa-.js"),__vite__mapDeps([40,2,3])),"./locales/percentages.json":()=>ne(()=>Promise.resolve().then(()=>KX),void 0),"./locales/pl-PL.json":()=>ne(()=>import("./pl-PL-T2D74RX3-BfktR2GC.js"),__vite__mapDeps([41,2,3])),"./locales/pt-BR.json":()=>ne(()=>import("./pt-BR-5N22H2LF-BMS0hGhj.js"),__vite__mapDeps([42,2,3])),"./locales/pt-PT.json":()=>ne(()=>import("./pt-PT-UZXXM6DQ-Clt_m-aW.js"),__vite__mapDeps([43,2,3])),"./locales/ro-RO.json":()=>ne(()=>import("./ro-RO-JPDTUUEW-8VZwJRTB.js"),__vite__mapDeps([44,2,3])),"./locales/ru-RU.json":()=>ne(()=>import("./ru-RU-B4JR7IUQ-DXB6WjCJ.js"),__vite__mapDeps([45,2,3])),"./locales/si-LK.json":()=>ne(()=>import("./si-LK-N5RQ5JYF-3OCpve4d.js"),__vite__mapDeps([46,2,3])),"./locales/sk-SK.json":()=>ne(()=>import("./sk-SK-C5VTKIMK-BEWKAYUl.js"),__vite__mapDeps([47,2,3])),"./locales/sl-SI.json":()=>ne(()=>import("./sl-SI-NN7IZMDC-CjuniHw8.js"),__vite__mapDeps([48,2,3])),"./locales/sv-SE.json":()=>ne(()=>import("./sv-SE-XGPEYMSR-C02T2BPU.js"),__vite__mapDeps([49,2,3])),"./locales/ta-IN.json":()=>ne(()=>import("./ta-IN-2NMHFXQM-Dwu_LpR7.js"),__vite__mapDeps([50,2,3])),"./locales/th-TH.json":()=>ne(()=>import("./th-TH-HPSO5L25-BAmgMbAJ.js"),__vite__mapDeps([51,2,3])),"./locales/tr-TR.json":()=>ne(()=>import("./tr-TR-DEFEU3FU-vTO9xmBO.js"),__vite__mapDeps([52,2,3])),"./locales/uk-UA.json":()=>ne(()=>import("./uk-UA-QMV73CPH-yUd9Af6s.js"),__vite__mapDeps([53,2,3])),"./locales/vi-VN.json":()=>ne(()=>import("./vi-VN-M7AON7JQ-Cy6tHM0s.js"),__vite__mapDeps([54,2,3])),"./locales/zh-CN.json":()=>ne(()=>import("./zh-CN-LNUGB5OW-BKmxs4M8.js"),__vite__mapDeps([55,2,3])),"./locales/zh-HK.json":()=>ne(()=>import("./zh-HK-E62DVLB3-B7dqTsZx.js"),__vite__mapDeps([56,2,3])),"./locales/zh-TW.json":()=>ne(()=>import("./zh-TW-RAJ6MFWO-C9A8RaNK.js"),__vite__mapDeps([57,2,3]))}),RO=85,Zr={code:"en",label:"English"},ku=[Zr,...[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"cs-CZ",label:"Česky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"eu-ES",label:"Euskara"},{code:"fa-IR",label:"فارسی",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Français"},{code:"gl-ES",label:"Galego"},{code:"he-IL",label:"עברית",rtl:!0},{code:"hi-IN",label:"हिन्दी"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"日本語"},{code:"kab-KAB",label:"Taqbaylit"},{code:"kk-KZ",label:"Қазақ тілі"},{code:"ko-KR",label:"한국어"},{code:"ku-TR",label:"Kurdî"},{code:"lt-LT",label:"Lietuvių"},{code:"lv-LV",label:"Latviešu"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokmål"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"ਪੰਜਾਬੀ"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Português Brasileiro"},{code:"pt-PT",label:"Português"},{code:"ro-RO",label:"Română"},{code:"ru-RU",label:"Русский"},{code:"sk-SK",label:"Slovenčina"},{code:"sv-SE",label:"Svenska"},{code:"sl-SI",label:"Slovenščina"},{code:"tr-TR",label:"Türkçe"},{code:"uk-UA",label:"Українська"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"},{code:"vi-VN",label:"Tiếng Việt"},{code:"mr-IN",label:"मराठी"}].filter(e=>d3[e.code]>=RO).sort((e,t)=>e.label>t.label?1:-1)],Lc="__test__";be.DEV&&ku.unshift({code:Lc,label:"test language"},{code:`${Lc}.rtl`,label:"‪test language (rtl)‬",rtl:!0});var gs=Zr,Hd={},m4=async e=>{if(gs=e,document.documentElement.dir=gs.rtl?"rtl":"ltr",document.documentElement.lang=gs.code,e.code.startsWith(Lc))Hd={};else try{Hd=await LO(`./locales/${gs.code}.json`)}catch(t){console.error(`Failed to load language ${e.code}:`,t.message),Hd=H0}ia.set(g4,e.code)},vo=()=>gs,tg=(e,t)=>{for(let n=0;n<t.length;++n){let a=t[n];if(e[a]===void 0)return;e=e[a]}if(typeof e=="string")return e},S=(e,t,n)=>{if(gs.code.startsWith(Lc))return`‪[[${t?`${e}(${JSON.stringify(t).slice(1,-1)})`:e}]]‬`;let a=e.split("."),i=tg(Hd,a)||tg(H0,a)||n;if(i===void 0){let r=`Can't find translation for ${e}`;return console.warn(r),""}if(t)for(let r in t)i=i.replace(`{{${r}}}`,String(t[r]));return i},g4=Bt(Zr.code),Vt=()=>{let e=U4(g4);return{t:S,langCode:e}},PO=({size:e="1em",circleWidth:t=8,synchronized:n=!1,className:a=""})=>{let i=-(Z.useRef(Date.now()).current%1600);return h.jsx("div",{className:`Spinner ${a}`,children:h.jsx("svg",{viewBox:"0 0 100 100",style:{width:e,height:e,"--spinner-delay":n?`${i}ms`:0},children:h.jsx("circle",{cx:"50",cy:"50",r:50-t/2,strokeWidth:t,fill:"none",strokeMiterlimit:"10"})})})},hi=PO,b4=({delay:e,theme:t})=>{let[n,a]=C.useState(!!e);return C.useEffect(()=>{if(!e)return;let i=setTimeout(()=>{a(!1)},e);return()=>clearTimeout(i)},[e]),n?null:h.jsxs("div",{className:te("LoadingMessage",{"LoadingMessage--dark":t===Me.DARK}),children:[h.jsx("div",{children:h.jsx(hi,{})}),h.jsx("div",{className:"LoadingMessage-text",children:S("labels.loadingScene")})]})},NO=e=>{let[t,n]=C.useState(!0);return C.useEffect(()=>{let a=async()=>{await m4(i),n(!1)},i=ku.find(r=>r.code===e.langCode)||Zr;a()},[e.langCode]),t?h.jsx(b4,{theme:e.theme}):e.children},Ce=Z.forwardRef(({size:e="medium",visible:t=!0,className:n="",...a},i)=>{let{id:r}=za(),s=Z.useRef(null);Z.useImperativeHandle(i,()=>s.current);let o=`ToolIcon_size_${e}`,[d,c]=C.useState(!1),l=C.useRef(!0),u=async p=>{let U="onClick"in a&&a.onClick?.(p);if(jo(U))try{c(!0),await U}catch(m){if(m instanceof iu)console.warn(m);else throw m}finally{l.current&&c(!1)}};C.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);let f=C.useRef(null);if(a.type==="button"||a.type==="icon"||a.type==="submit"){let p=a.type==="icon"?"button":a.type;return h.jsxs("button",{className:te("ToolIcon_type_button",o,n,t&&!a.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!a.hidden,"ToolIcon--selected":a.selected,"ToolIcon--plain":a.type==="icon"}),style:a.style,"data-testid":a["data-testid"],hidden:a.hidden,title:a.title,"aria-label":a["aria-label"],type:p,onClick:u,ref:s,disabled:d||a.isLoading||!!a.disabled,children:[(a.icon||a.label)&&h.jsxs("div",{className:"ToolIcon__icon","aria-hidden":"true","aria-disabled":!!a.disabled,children:[a.icon||a.label,a.keyBindingLabel&&h.jsx("span",{className:"ToolIcon__keybinding",children:a.keyBindingLabel}),a.isLoading&&h.jsx(hi,{})]}),a.showAriaLabel&&h.jsxs("div",{className:"ToolIcon__label",children:[a["aria-label"]," ",d&&h.jsx(hi,{})]}),a.children]})}return h.jsxs("label",{className:te("ToolIcon",n),title:a.title,onPointerDown:p=>{f.current=p.pointerType||null,a.onPointerDown?.({pointerType:p.pointerType||null})},onPointerUp:()=>{requestAnimationFrame(()=>{f.current=null})},children:[h.jsx("input",{className:`ToolIcon_type_radio ${o}`,type:"radio",name:a.name,"aria-label":a["aria-label"],"aria-keyshortcuts":a["aria-keyshortcuts"],"data-testid":a["data-testid"],id:`${r}-${a.id}`,onChange:()=>{a.onChange?.({pointerType:f.current})},checked:a.checked,ref:s}),h.jsxs("div",{className:"ToolIcon__icon",children:[a.icon,a.keyBindingLabel&&h.jsx("span",{className:"ToolIcon__keybinding",children:a.keyBindingLabel})]})]})});Ce.displayName="ToolButton";var OO=(e,t,n)=>{let a=new Set(xe(e.filter(l=>de(l)),t).map(l=>l.id)),i={},r=n.scene.getNonDeletedElementsMap(),s=new Set;for(let l of a){let u=$a(e,l);for(let f of u)if(!s.has(f.id)){if(nt(f)){let p=zt(f,r);p&&(i[p.id]=!0)}else i[f.id]=!0;s.add(f.id)}}let o=!0,d=e.map(l=>{if(t.selectedElementIds[l.id]){let u=nt(l)?zt(l,r):null;return l.frameId&&a.has(l.frameId)?(o=!1,i[l.id]=!0,l):u?.frameId&&a.has(u?.frameId)?l:(l.boundElements&&l.boundElements.forEach(f=>{let p=n.scene.getNonDeletedElementsMap().get(f.id);p&&Q(p)&&(X(p,{startBinding:l.id===p.startBinding?.elementId?null:p.startBinding,endBinding:l.id===p.endBinding?.elementId?null:p.endBinding}),X(p,{points:p.points}))}),pe(l,{isDeleted:!0}))}return l.frameId&&a.has(l.frameId)?(o=!1,nt(l)||(i[l.id]=!0),pe(l,{frameId:null})):nt(l)&&t.selectedElementIds[l.containerId]?pe(l,{isDeleted:!0}):l}),c=t.editingGroupId;if(o&&t.editingGroupId){let l=tt(d,t.editingGroupId).filter(u=>!u.isDeleted);if(l.length>1)l[0]&&(i[l[0].id]=!0);else{c=null,l[0]&&(i[l[0].id]=!0);let u=l[0];if(u){let f=u.groupIds.findIndex(U=>U===t.editingGroupId),p=u.groupIds[f+1];if(p){let U=tt(d,p).filter(m=>!m.isDeleted);U.length>1&&(c=p,U.forEach(m=>{i[m.id]=!0}))}}}}return{elements:d,appState:{...t,...sn({selectedElementIds:i,editingGroupId:c},d,t,null)}}},ng=(e,t)=>{if(e.editingGroupId){let n=tt(Ve(t),e.editingGroupId);if(n.length)return{...e,selectedElementIds:{[n[0].id]:!0}}}return e},x4=G({name:"deleteSelectedElements",label:"labels.delete",icon:Rr,trackEvent:{category:"element",action:"delete"},perform:(e,t,n,a)=>{if(t.editingLinearElement){let{elementId:s,selectedPointsIndices:o,startBindingElement:d,endBindingElement:c}=t.editingLinearElement,l=a.scene.getNonDeletedElementsMap(),u=J.getElement(s,l);if(!u||o==null)return!1;if(u.points.length<2){let p=e.map(m=>m.id===u.id?pe(m,{isDeleted:!0}):m),U=ng(t,p);return{elements:p,appState:{...U,editingLinearElement:null},captureUpdate:B.IMMEDIATELY}}let f={startBindingElement:o?.includes(0)?null:d,endBindingElement:o?.includes(u.points.length-1)?null:c};return J.deletePoints(u,o),{elements:e,appState:{...t,editingLinearElement:{...t.editingLinearElement,...f,selectedPointsIndices:o?.[0]>0?[o[0]-1]:[0]}},captureUpdate:B.IMMEDIATELY}}let{elements:i,appState:r}=OO(e,t,a);return Yb(i,i.filter(s=>s.isDeleted)),r=ng(r,i),{elements:i,appState:{...r,activeTool:Et(t,{type:"selection"}),multiElement:null,activeEmbeddable:null},captureUpdate:_t(Ve(e),t)?B.IMMEDIATELY:B.EVENTUALLY}},keyTest:(e,t,n)=>(e.key===D.BACKSPACE||e.key===D.DELETE)&&!e[D.CTRL_OR_CMD],PanelComponent:({elements:e,appState:t,updateData:n})=>h.jsx(Ce,{type:"button",icon:Rr,title:S("labels.delete"),"aria-label":S("labels.delete"),onClick:()=>n(null),visible:_t(Ve(e),t)})}),r1=(e,t)=>e.frameId===t||e.id===t,v4=(e,t,n)=>{let a=[],i=[],r=null,s=-1,o=oe(n||xe(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0}));for(;++s<e.length;){let d=e[s];o.get(d.id)?(i.length&&(a=a.concat(i),i=[]),a.push(s),r=s+1):d.isDeleted&&r===s?(r=s+1,i.push(s)):i=[]}return a},$O=e=>{let t=0;return e.reduce((n,a,i)=>(i>0&&e[i-1]!==a-1&&(t=++t),(n[t]||(n[t]=[])).push(a),n),[])},ag=(e,t,n)=>{if("containerId"in e&&e.containerId){let a=ci.getScene(e).getElement(e.containerId);if(a)return n==="left"?Math.min(t.indexOf(a),t.indexOf(e)):Math.max(t.indexOf(a),t.indexOf(e))}else{let a=e.boundElements?.find(i=>i.type!=="arrow")?.id;if(a){let i=ci.getScene(e).getElement(a);if(i)return n==="left"?Math.min(t.indexOf(i),t.indexOf(e)):Math.max(t.indexOf(i),t.indexOf(e))}}},FO=(e,t)=>{let n=-1,a=-1;return e.forEach((i,r)=>{r1(i,t)&&(n===-1&&(n=r),a=r)}),n===-1?[]:e.slice(n,a+1)},zO=(e,t,n,a,i)=>{let r=t[n],s=u=>u.isDeleted?!1:i?u.frameId===i:e.editingGroupId?u.groupIds.includes(e.editingGroupId):!0,o=a==="left"?ur(t,u=>s(u),Math.max(0,n-1)):L5(t,u=>s(u),n+1),d=t[o];if(!d)return-1;if(e.editingGroupId){if(r?.groupIds.join("")===d?.groupIds.join(""))return ag(d,t,a)??o;if(!d?.groupIds.includes(e.editingGroupId))return-1}if(!i&&(d.frameId||de(d))){let u=FO(t,d.frameId||d.id);return a==="left"?t.indexOf(u[0]):t.indexOf(u[u.length-1])}if(!d.groupIds.length)return ag(d,t,a)??o;let c=e.editingGroupId?d.groupIds[d.groupIds.indexOf(e.editingGroupId)-1]:d.groupIds[d.groupIds.length-1],l=tt(t,c);return l.length?a==="left"?t.indexOf(l[0]):t.indexOf(l[l.length-1]):o},y4=(e,t)=>t.reduce((n,a)=>{let i=e[a];return n.set(i.id,i),n},new Map),w4=(e,t,n)=>{let a=v4(e,t),i=y4(e,a),r=$O(a);n==="right"&&(r=r.reverse());let s=new Set(a.filter(o=>de(e[o])).map(o=>e[o].id));return r.forEach((o,d)=>{let c=o[0],l=o[o.length-1],u=n==="left"?c:l,f=o.some(v=>{let x=e[v];return x.frameId&&s.has(x.frameId)})?null:e[u]?.frameId,p=zO(t,e,u,n,f);if(p===-1||u===p)return;let U=n==="left"?e.slice(0,p):e.slice(0,c),m=e.slice(c,l+1),g=n==="left"?e.slice(p,c):e.slice(l+1,p+1),b=n==="left"?e.slice(l+1):e.slice(p+1);e=n==="left"?[...U,...m,...g,...b]:[...U,...g,...m,...b]}),Na(e,i),e},E4=(e,t,n,a,i)=>{let r=v4(e,t,i),s=y4(e,r),o=[],d,c;if(n==="left"){if(a)d=L5(e,U=>r1(U,a));else if(t.editingGroupId){let U=tt(e,t.editingGroupId);if(!U.length)return e;d=e.indexOf(U[0])}else d=0;c=r[r.length-1]}else{if(a)c=ur(e,U=>r1(U,a));else if(t.editingGroupId){let U=tt(e,t.editingGroupId);if(!U.length)return e;c=e.indexOf(U[U.length-1])}else c=e.length-1;d=r[0]}d===-1&&(d=0);for(let U=d;U<c+1;U++)r.includes(U)||o.push(e[U]);let l=Array.from(s.values()),u=e.slice(0,d),f=e.slice(c+1),p=n==="left"?[...u,...l,...o,...f]:[...u,...o,...l,...f];return Na(p,s),p};function S4(e,t,n,a){let i=oe(xe(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),r={regularElements:[],frameChildren:new Map},s=new Set;for(let c of e)i.has(c.id)&&de(c)&&s.add(c.id);for(let c of e)if(i.has(c.id))if(de(c)||c.frameId&&s.has(c.frameId))r.regularElements.push(c);else if(!c.frameId)r.regularElements.push(c);else{let l=r.frameChildren.get(c.frameId)||[];l.push(c),r.frameChildren.set(c.frameId,l)}let o=e,d=Array.from(r.frameChildren.entries());for(let[c,l]of d)o=a(e,t,n,c,l);return a(o,t,n,null,r.regularElements)}var BO=(e,t)=>w4(e,t,"left"),HO=(e,t)=>w4(e,t,"right"),XO=(e,t)=>S4(e,t,"left",E4),WO=(e,t)=>S4(e,t,"right",E4),VO=G({name:"sendBackward",label:"labels.sendBackward",keywords:["move down","zindex","layer"],icon:l2,trackEvent:{category:"element"},perform:(e,t)=>({elements:BO(e,t),appState:t,captureUpdate:B.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[D.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Te.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>h.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${S("labels.sendBackward")} — ${H("CtrlOrCmd+[")}`,children:l2})}),GO=G({name:"bringForward",label:"labels.bringForward",keywords:["move up","zindex","layer"],icon:s2,trackEvent:{category:"element"},perform:(e,t)=>({elements:HO(e,t),appState:t,captureUpdate:B.IMMEDIATELY}),keyPriority:40,keyTest:e=>e[D.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Te.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>h.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${S("labels.bringForward")} — ${H("CtrlOrCmd+]")}`,children:s2})}),ZO=G({name:"sendToBack",label:"labels.sendToBack",keywords:["move down","zindex","layer"],icon:d2,trackEvent:{category:"element"},perform:(e,t)=>({elements:XO(e,t),appState:t,captureUpdate:B.IMMEDIATELY}),keyTest:e=>Aa?e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Te.BRACKET_LEFT:e[D.CTRL_OR_CMD]&&e.shiftKey&&e.code===Te.BRACKET_LEFT,PanelComponent:({updateData:e,appState:t})=>h.jsx("button",{type:"button",className:"zIndexButton",onClick:()=>e(null),title:`${S("labels.sendToBack")} — ${H(Aa?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")}`,children:d2})}),YO=G({name:"bringToFront",label:"labels.bringToFront",keywords:["move up","zindex","layer"],icon:o2,trackEvent:{category:"element"},perform:(e,t)=>({elements:WO(e,t),appState:t,captureUpdate:B.IMMEDIATELY}),keyTest:e=>Aa?e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Te.BRACKET_RIGHT:e[D.CTRL_OR_CMD]&&e.shiftKey&&e.code===Te.BRACKET_RIGHT,PanelComponent:({updateData:e,appState:t})=>h.jsx("button",{type:"button",className:"zIndexButton",onClick:n=>e(null),title:`${S("labels.bringToFront")} — ${H(Aa?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")}`,children:o2})}),KO=G({name:"selectAll",label:"labels.selectAll",icon:hC,trackEvent:{category:"canvas"},viewMode:!1,perform:(e,t,n,a)=>{if(t.editingLinearElement)return!1;let i=e.filter(r=>!r.isDeleted&&!(q(r)&&r.containerId)&&!r.locked).reduce((r,s)=>(r[s.id]=!0,r),{});return{appState:{...t,...sn({editingGroupId:null,selectedElementIds:i},Ve(e),t,a),selectedLinearElement:Object.keys(i).length===1&&ue(e[0])?new J(e[0]):null},captureUpdate:B.IMMEDIATELY}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.A}),qO=e=>{let t=e.slice(),n=new Set,a=r=>{let s=r[0]?.groupIds?.join(""),o=[r[0]],d=[];for(let c of r.slice(1))c.groupIds?.join("")===s?o.push(c):d.push(c);return d.length?[...o,...a(d)]:o},i=new Map;return t.forEach((r,s)=>{if(!i.has(r.id))if(r.groupIds?.length){let o=r.groupIds[r.groupIds.length-1],d=t.slice(s).filter(c=>{let l=c?.groupIds?.some(u=>u===o);return l&&i.set(c.id,!0),l});for(let c of a(d))n.add(c)}else n.add(r)}),n.size!==e.length?(console.error("normalizeGroupElementOrder: lost some elements... bailing!"),e):[...n]},JO=e=>{let t=hk(e),n=e.slice(),a=new Set;return n.forEach((i,r)=>{i&&(i.boundElements?.length?(a.add(i),n[r]=null,i.boundElements.forEach(s=>{let o=t.get(s.id);o&&s.type==="text"&&(a.add(o[0]),n[o[1]]=null)})):i.type==="text"&&i.containerId&&t.get(i.containerId)?.[0].boundElements?.find(s=>s.id===i.id)||(a.add(i),n[r]=null))}),a.size!==e.length?(console.error("normalizeBoundElementsOrder: lost some elements... bailing!"),e):[...a]},QO=e=>JO(qO(e)),e$=G({name:"duplicateSelection",label:"labels.duplicateSelection",icon:yf,trackEvent:{category:"element"},perform:(e,t,n,a)=>{if(t.editingLinearElement)try{let r=J.duplicateSelectedPoints(t,a.scene.getNonDeletedElementsMap());return{elements:e,appState:r,captureUpdate:B.IMMEDIATELY}}catch{return!1}let i=t$(e,t);if(a.props.onDuplicate&&i.elements){let r=a.props.onDuplicate(i.elements,e);r&&(i.elements=r)}return{...i,captureUpdate:B.IMMEDIATELY}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.D,PanelComponent:({elements:e,appState:t,updateData:n})=>h.jsx(Ce,{type:"button",icon:yf,title:`${S("labels.duplicateSelection")} — ${H("CtrlOrCmd+D")}`,"aria-label":S("labels.duplicateSelection"),onClick:()=>n(null),visible:_t(Ve(e),t)})}),t$=(e,t)=>{let n=new Map,a=[],i=[],r=new Map,s=new Map,o=oe(e),d=m=>{let g=e2(m).reduce((b,v)=>{if(l.has(v.id))return b;l.set(v.id,!0);let x=U8(t.editingGroupId,n,v,{x:v.x+ic/2,y:v.y+ic/2});return l.set(x.id,!0),s.set(x.id,x),r.set(v.id,x.id),i.push(v),a.push(x),b.push(x),b},[]);return Array.isArray(m)?g:g[0]||null};e=QO(e);let c=oe(xe(e,t,{includeBoundTextElement:!0,includeElementsInFrames:!0})),l=new Map,u=e.slice(),f=(m,g)=>{tn(m!==-1,"targetIndex === -1 "),!(!Array.isArray(g)&&!g)&&u.splice(m+1,0,...e2(g))},p=new Set(e.filter(m=>c.has(m.id)&&de(m)).map(m=>m.id));for(let m of e){if(l.has(m.id)||!c.has(m.id))continue;let g=e8(t,m);if(g){let b=tt(e,g).flatMap(x=>de(x)?[...$a(e,x.id),x]:[x]),v=ur(u,x=>x.groupIds?.includes(g));f(v,d(b));continue}if(!(m.frameId&&p.has(m.frameId))){if(de(m)){let b=m.id,v=$a(e,b),x=ur(u,y=>y.frameId===b||y.id===b);f(x,d([...v,m]));continue}if(Hn(m)){let b=ge(m,o),v=ur(u,x=>x.id===m.id||"containerId"in x&&x.containerId===m.id);b?f(v,d([m,b])):f(v,d(m));continue}if(nt(m)){let b=zt(m,o),v=ur(u,x=>x.id===m.id||x.id===b?.id);b?f(v,d([b,m])):f(v,d(m));continue}f(ur(u,b=>b.id===m.id),d(m))}}r8(u,i,r),Zb(u,i,r),K8(u,i,r);let U=j0(a);return{elements:u,appState:{...t,...sn({editingGroupId:t.editingGroupId,selectedElementIds:U.reduce((m,g)=>(nt(g)||(m[g.id]=!0),m),{})},Ve(u),t,null)}}},n$=new Set(["command_palette","export"]),qe=(e,t,n,a)=>{try{if(typeof window>"u"||be.VITE_WORKER_ID||be.VITE_APP_ENABLE_TRACKING!=="true"||!n$.has(e)||be.DEV)return;be.PROD||console.info("trackEvent",{category:e,action:t,label:n,value:a}),window.sa_event&&window.sa_event(t,{category:e,label:n,value:a})}catch(i){console.error("error during analytics",i)}},k4=C.forwardRef((e,t)=>{let{title:n,className:a,testId:i,active:r,standalone:s,icon:o,onClick:d}=e;return h.jsx("button",{type:"button",ref:t,title:n,"data-testid":i,className:te(a,{standalone:s,active:r}),onClick:d,children:o},n)}),Fa=e=>h.jsx("div",{className:"buttonList",children:e.options.map(t=>e.type==="button"?h.jsx(k4,{icon:t.icon,title:t.text,testId:t.testId,active:t.active??e.value===t.value,onClick:n=>e.onClick(t.value,n)},t.text):h.jsxs("label",{className:te({active:e.value===t.value}),title:t.text,children:[h.jsx("input",{type:"radio",name:e.group,onChange:()=>e.onChange(t.value),checked:e.value===t.value,"data-testid":t.testId}),t.icon]},t.text))}),a$=({onChange:e,type:t,activeColor:n,topPicks:a})=>{let i;return t==="elementStroke"&&(i=f5),t==="elementBackground"&&(i=p5),t==="canvasBackground"&&(i=U5),a&&(i=a),i?h.jsx("div",{className:"color-picker__top-picks",children:i.map(r=>h.jsx("button",{className:te("color-picker__button",{active:r===n,"is-transparent":r==="transparent"||!r}),style:{"--swatch-color":r},type:"button",title:r,onClick:()=>e(r),"data-testid":`color-top-pick-${r}`,children:h.jsx("div",{className:"color-picker__button-outline"})},r))}):(console.error("Invalid type for TopPicks"),null)},M4=()=>h.jsx("div",{style:{width:1,height:"1rem",backgroundColor:"var(--default-border-color)",margin:"0 auto"}}),Mu=({palette:e,color:t})=>{for(let[n,a]of Object.entries(e))if(Array.isArray(a)){let i=a.indexOf(t);if(i>-1)return{colorName:n,shade:i}}else if(a===t)return{colorName:n,shade:null};return null},s1=[["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),C4=({color:e,palette:t})=>!Object.values(t).flat().includes(e),i$=(e,t,n)=>{let a={elementBackground:"backgroundColor",elementStroke:"strokeColor"},i=e.filter(s=>{if(s.isDeleted)return!1;let o=s[a[t]];return C4({color:o,palette:n})}),r=new Map;return i.forEach(s=>{let o=s[a[t]];r.has(o)?r.set(o,r.get(o)+1):r.set(o,1)}),[...r.entries()].sort((s,o)=>o[1]-s[1]).map(s=>s[0]).slice(0,lS)},Zs=Bt(null),ig=(e,t,n)=>(e*299+t*587+n*114)/1e3>=160?"black":"white",r$=(e,t)=>{if(t){let r=new Option().style;if(r.color=e,r.color){let s=r.color.replace(/^(rgb|rgba)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(","),o=parseInt(s[0]),d=parseInt(s[1]),c=parseInt(s[2]);return ig(o,d,c)}}if(e==="transparent")return"black";let n=parseInt(e.substring(1,3),16),a=parseInt(e.substring(3,5),16),i=parseInt(e.substring(5,7),16);return ig(n,a,i)},s$=({color:e,keyLabel:t,isCustomColor:n=!1,isShade:a=!1})=>h.jsxs("div",{className:"color-picker__button__hotkey-label",style:{color:r$(e,n)},children:[a&&"⇧",t]}),tp=s$,l$=({hex:e,onChange:t,palette:n})=>{let a=Mu({color:e||"transparent",palette:n}),[i,r]=gt(Zs),s=C.useRef(null);if(C.useEffect(()=>{s.current&&i==="shades"&&s.current.focus()},[a,i]),a){let{colorName:o,shade:d}=a,c=n[o];if(Array.isArray(c))return h.jsx("div",{className:"color-picker-content--default shades",children:c.map((l,u)=>h.jsxs("button",{ref:u===d&&i==="shades"?s:void 0,tabIndex:-1,type:"button",className:te("color-picker__button color-picker__button--large",{active:u===d}),"aria-label":"Shade",title:`${o} - ${u+1}`,style:l?{"--swatch-color":l}:void 0,onClick:()=>{t(l),r("shades")},children:[h.jsx("div",{className:"color-picker__button-outline"}),h.jsx(tp,{color:l,keyLabel:u+1,isShade:!0})]},u))})}return h.jsxs("div",{className:"color-picker-content--default",style:{position:"relative"},tabIndex:-1,children:[h.jsx("button",{type:"button",tabIndex:-1,className:"color-picker__button color-picker__button--large color-picker__button--no-focus-visible"}),h.jsx("div",{tabIndex:-1,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:"0.75rem"},children:S("colorPicker.noShades")})]})},o$=({palette:e,color:t,onChange:n,label:a,activeShade:i})=>{let r=Mu({color:t||"transparent",palette:e}),[s,o]=gt(Zs),d=C.useRef(null);return C.useEffect(()=>{d.current&&s==="baseColors"&&d.current.focus()},[r?.colorName,s]),h.jsx("div",{className:"color-picker-content--default",children:Object.entries(e).map(([c,l],u)=>{let f=(Array.isArray(l)?l[i]:l)||"transparent",p=s1[u],U=S(`colors.${c.replace(/\d+/,"")}`,null,"");return h.jsxs("button",{ref:r?.colorName===c?d:void 0,tabIndex:-1,type:"button",className:te("color-picker__button color-picker__button--large",{active:r?.colorName===c,"is-transparent":f==="transparent"||!f}),onClick:()=>{n(f),o("baseColors")},title:`${U}${f.startsWith("#")?` ${f}`:""} — ${p}`,"aria-label":`${U} — ${p}`,style:{"--swatch-color":f},"data-testid":`color-${c}`,children:[h.jsx("div",{className:"color-picker__button-outline"}),h.jsx(tp,{color:f,keyLabel:p})]},c)})})},d$=o$,c$=({colors:e,color:t,onChange:n,label:a})=>{let[i,r]=gt(Zs),s=C.useRef(null);return C.useEffect(()=>{s.current&&s.current.focus()},[t,i]),h.jsx("div",{className:"color-picker-content--default",children:e.map((o,d)=>h.jsxs("button",{ref:t===o?s:void 0,tabIndex:-1,type:"button",className:te("color-picker__button color-picker__button--large",{active:t===o,"is-transparent":o==="transparent"||!o}),onClick:()=>{n(o),r("custom")},title:o,"aria-label":a,style:{"--swatch-color":o},children:[h.jsx("div",{className:"color-picker__button-outline"}),h.jsx(tp,{color:o,keyLabel:d+1,isCustomColor:!0})]},d))})},Rh=(e,t,n)=>{let a=Math.ceil(n/ss);switch(t=t??-1,e){case"ArrowLeft":{let i=t-1;return i<0?n-1:i}case"ArrowRight":return(t+1)%n;case"ArrowDown":{let i=t+ss;return i>=n?t%ss:i}case"ArrowUp":{let i=t-ss,r=i<0?ss*a+i:i;return r>=n?void 0:r}}},u$=({e,colorObj:t,onChange:n,palette:a,customColors:i,setActiveColorPickerSection:r,activeShade:s})=>{if(t?.shade!=null&&["Digit1","Digit2","Digit3","Digit4","Digit5"].includes(e.code)&&e.shiftKey){let o=Number(e.code.slice(-1))-1;return n(a[t.colorName][o]),r("shades"),!0}if(["1","2","3","4","5"].includes(e.key)&&i[Number(e.key)-1])return n(i[Number(e.key)-1]),r("custom"),!0;if(s1.includes(e.key)){let o=s1.indexOf(e.key),d=Object.keys(a)[o],c=a[d],l=Array.isArray(c)?c[s]:c;return n(l),r("baseColors"),!0}return!1},h$=({event:e,activeColorPickerSection:t,palette:n,color:a,onChange:i,customColors:r,setActiveColorPickerSection:s,updateData:o,activeShade:d,onEyeDropperToggle:c,onEscape:l})=>{if(e[D.CTRL_OR_CMD])return!1;if(e.key===D.ESCAPE)return l(e),!0;if(e.key===D.ALT)return c(!0),!0;if(e.key===D.I)return c(),!0;let u=Mu({color:a,palette:n});if(e.key===D.TAB){let f={custom:!!r.length,baseColors:!0,shades:u?.shade!=null,hex:!0},p=Object.entries(f).reduce((v,[x,y])=>(y&&v.push(x),v),[]),U=p.indexOf(t),m=e.shiftKey?-1:1,g=U+m>p.length-1?0:U+m<0?p.length-1:U+m,b=p[g];return b&&s(b),b==="custom"?i(r[0]):b==="baseColors"&&(Object.entries(n).find(([v,x])=>Array.isArray(x)?x.includes(a):x===a?v:null)||i(Ee.black)),e.preventDefault(),e.stopPropagation(),!0}if(u$({e,colorObj:u,onChange:i,palette:n,customColors:r,setActiveColorPickerSection:s,activeShade:d}))return!0;if(t==="shades"&&u){let{shade:f}=u,p=Rh(e.key,f,ss);if(p!==void 0)return i(n[u.colorName][p]),!0}if(t==="baseColors"&&u){let{colorName:f}=u,p=Object.keys(n),U=p.indexOf(f),m=Rh(e.key,U,p.length);if(m!==void 0){let g=p[m],b=n[g];return i(Array.isArray(b)?b[d]:b),!0}}if(t==="custom"){let f=r.indexOf(a),p=Rh(e.key,f,r.length);if(p!==void 0){let U=r[p];return i(U),!0}}return!1},f$=({children:e})=>h.jsx("div",{className:"color-picker__heading",children:e}),Xd=f$,p$=({color:e,onChange:t,label:n,type:a,elements:i,palette:r,updateData:s,children:o,onEyeDropperToggle:d,onEscape:c})=>{let[l]=Z.useState(()=>a==="canvasBackground"?[]:i$(i,a,r)),[u,f]=gt(Zs),p=Mu({color:e,palette:r});C.useEffect(()=>{if(!u){let b=C4({color:e,palette:r}),v=b&&!l.includes(e);f(v?"hex":b?"custom":p?.shade!=null?"shades":"baseColors")}},[u,e,r,f,p,l]);let[U,m]=C.useState(p?.shade??(a==="elementBackground"?yl:vl));C.useEffect(()=>{p?.shade!=null&&m(p.shade);let b=v=>{v.key===D.ALT&&d(!1)};return document.addEventListener("keyup",b,{capture:!0}),()=>{document.removeEventListener("keyup",b,{capture:!0})}},[p,d]);let g=Z.useRef(null);return h.jsx("div",{role:"dialog","aria-modal":"true","aria-label":S("labels.colorPicker"),children:h.jsxs("div",{ref:g,onKeyDown:b=>{h$({event:b,activeColorPickerSection:u,palette:r,color:e,onChange:t,onEyeDropperToggle:d,customColors:l,setActiveColorPickerSection:f,updateData:s,activeShade:U,onEscape:c})&&(b.preventDefault(),b.stopPropagation())},className:"color-picker-content properties-content",tabIndex:-1,children:[!!l.length&&h.jsxs("div",{children:[h.jsx(Xd,{children:S("colorPicker.mostUsedCustomColors")}),h.jsx(c$,{colors:l,color:e,label:S("colorPicker.mostUsedCustomColors"),onChange:t})]}),h.jsxs("div",{children:[h.jsx(Xd,{children:S("colorPicker.colors")}),h.jsx(d$,{color:e,label:n,palette:r,onChange:t,activeShade:U})]}),h.jsxs("div",{children:[h.jsx(Xd,{children:S("colorPicker.shades")}),h.jsx(l$,{hex:e,onChange:t,palette:r})]}),o]})})},I4=Z.createContext(null),Gt=()=>Z.useContext(I4),_4=e=>{let[t,n]=C.useState(null),a=Tt(),{theme:i}=Gt(),{container:r}=za();return C.useLayoutEffect(()=>{t&&(t.className="",t.classList.add("excalidraw",...e?.className?.split(/\s+/)||[]),t.classList.toggle("excalidraw--mobile",a.editor.isMobile),t.classList.toggle("theme--dark",i===Me.DARK))},[t,i,a.editor.isMobile,e?.className]),C.useLayoutEffect(()=>{let s=e?.parentSelector?r?.querySelector(e.parentSelector):document.body;if(!s)return;let o=document.createElement("div");return s.appendChild(o),n(o),()=>{s.removeChild(o)}},[r,e?.parentSelector]),t};function np(e,t,n){C.useEffect(()=>{function a(i){let r=i;if(!e.current)return;let s=n?.(r,e.current);if(s!==!0){if(s===!1)return t(r);e.current.contains(r.target)||!document.documentElement.contains(r.target)||r.target.closest("[data-radix-portal]")||r.target===document.documentElement&&document.body.style.pointerEvents==="none"||r.target.closest("[data-prevent-outside-click]")||t(r)}}return document.addEventListener("pointerdown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("pointerdown",a),document.removeEventListener("touchstart",a)}},[e,t,n])}var Cu=e=>{let t=C.useRef(e);return Object.assign(t.current,e),t.current},Iu=Bt(null),U$=({onCancel:e,onChange:t,onSelect:n,colorPickerType:a})=>{let i=_4({className:"excalidraw-eye-dropper-backdrop",parentSelector:".excalidraw-eye-dropper-container"}),r=Gt(),s=Pu(),o=Ua(),d=xe(s,r),c=Cu({app:o,onCancel:e,onChange:t,onSelect:n,selectedElements:d}),{container:l}=za();C.useEffect(()=>{let f=u.current;if(!f||!o.canvas||!i)return;let p=!1,U=o.canvas.getContext("2d"),m=({clientX:k,clientY:M})=>{let I=U.getImageData((k-r.offsetLeft)*window.devicePixelRatio,(M-r.offsetTop)*window.devicePixelRatio,1,1).data;return hS(I[0],I[1],I[2])},g=({clientX:k,clientY:M,altKey:I})=>{f.style.top=`${M+20}px`,f.style.left=`${k+20}px`;let A=m({clientX:k,clientY:M});p&&c.onChange(a,A,c.selectedElements,{altKey:I}),f.style.background=A},b=()=>{c.onCancel()},v=(k,M)=>{c.onSelect(k,M)},x=k=>{p=!0,k.stopImmediatePropagation()},y=k=>{p=!1,l?.focus(),k.stopImmediatePropagation(),k.preventDefault(),v(m(k),k)},w=k=>{k.key===D.ESCAPE&&(k.preventDefault(),k.stopImmediatePropagation(),b())};return i.tabIndex=-1,i.focus(),g({clientX:c.app.lastViewportPosition.x,clientY:c.app.lastViewportPosition.y,altKey:!1}),i.addEventListener("keydown",w),i.addEventListener("pointerdown",x),i.addEventListener("pointerup",y),window.addEventListener("pointermove",g,{passive:!0}),window.addEventListener("blur",b),()=>{p=!1,i.removeEventListener("keydown",w),i.removeEventListener("pointerdown",x),i.removeEventListener("pointerup",y),window.removeEventListener("pointermove",g),window.removeEventListener("blur",b)}},[c,o.canvas,i,a,l,r.offsetLeft,r.offsetTop]);let u=C.useRef(null);return np(u,()=>{e()},f=>!!f.target.closest(".excalidraw-eye-dropper-trigger, .excalidraw-eye-dropper-backdrop")),i?Kt.createPortal(h.jsx("div",{ref:u,className:"excalidraw-eye-dropper-preview"}),i):null},m$=({color:e,onChange:t,label:n,colorPickerType:a})=>{let i=Tt(),[r,s]=C.useState(e),[o,d]=gt(Zs);C.useEffect(()=>{s(e)},[e]);let c=C.useCallback(U=>{let m=U.toLowerCase(),g=g$(m);g&&t(g),s(m)},[t]),l=C.useRef(null),u=C.useRef(null);C.useEffect(()=>{l.current&&l.current.focus()},[o]);let[f,p]=gt(Iu);return C.useEffect(()=>()=>{p(null)},[p]),h.jsxs("div",{className:"color-picker__input-label",children:[h.jsx("div",{className:"color-picker__input-hash",children:"#"}),h.jsx("input",{ref:o==="hex"?l:void 0,style:{border:0,padding:0},spellCheck:!1,className:"color-picker-input","aria-label":n,onChange:U=>{c(U.target.value)},value:(r||"").replace(/^#/,""),onBlur:()=>{s(e)},tabIndex:-1,onFocus:()=>d("hex"),onKeyDown:U=>{U.key!==D.TAB&&(U.key===D.ESCAPE&&u.current?.focus(),U.stopPropagation())}}),!i.editor.isMobile&&h.jsxs(h.Fragment,{children:[h.jsx("div",{style:{width:"1px",height:"1.25rem",backgroundColor:"var(--default-border-color)"}}),h.jsx("div",{ref:u,className:te("excalidraw-eye-dropper-trigger",{selected:f}),onClick:()=>p(U=>U?null:{keepOpenOnAlt:!1,onSelect:m=>t(m),colorPickerType:a}),title:`${S("labels.eyeDropper")} — ${D.I.toLocaleUpperCase()} or ${H("Alt")} `,children:aC})]})]})},da=Z.forwardRef(({children:e,padding:t,className:n,style:a},i)=>h.jsx("div",{className:te("Island",n),style:{"--padding":t,...a},ref:i,children:e})),T4=Z.forwardRef(({className:e,container:t,children:n,style:a,onClose:i,onKeyDown:r,onFocusOutside:s,onPointerLeave:o,onPointerDownOutside:d},c)=>{let l=Tt();return h.jsx(vN,{container:t,children:h.jsxs(q0,{ref:c,className:te("focus-visible-none",e),"data-prevent-outside-click":!0,side:l.editor.isMobile&&!l.viewport.isLandscape?"bottom":"right",align:l.editor.isMobile&&!l.viewport.isLandscape?"center":"start",alignOffset:-16,sideOffset:20,style:{zIndex:"var(--zIndex-popup)"},onPointerLeave:o,onKeyDown:r,onFocusOutside:s,onPointerDownOutside:d,onCloseAutoFocus:u=>{u.stopPropagation(),u.preventDefault(),t&&!nk(document.activeElement)&&t.focus(),i()},children:[h.jsx(da,{padding:3,style:a,children:n}),h.jsx(Z3,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})}),rg=e=>{let t=new Option().style;return t.color=e,!!t.color},g$=e=>na(e)?e:rg(`#${e}`)?`#${e}`:rg(e)?e:null,b$=({type:e,color:t,onChange:n,label:a,elements:i,palette:r=Ee,updateData:s})=>{let{container:o}=za(),[,d]=gt(Zs),[c,l]=gt(Iu),u=h.jsxs("div",{children:[h.jsx(Xd,{children:S("colorPicker.hexCode")}),h.jsx(m$,{color:t,label:a,onChange:U=>{n(U)},colorPickerType:e})]}),f=C.useRef(null),p=()=>{f.current?.querySelector(".color-picker-content")?.focus()};return h.jsx(T4,{container:o,style:{maxWidth:"13rem"},onFocusOutside:U=>{p(),U.preventDefault()},onPointerDownOutside:U=>{c&&U.preventDefault()},onClose:()=>{s({openPopup:null}),d(null)},children:r?h.jsx(p$,{palette:r,color:t,onChange:U=>{n(U)},onEyeDropperToggle:U=>{l(m=>U?(m=m||{keepOpenOnAlt:!0,onSelect:n,colorPickerType:e},m.keepOpenOnAlt=!0,m):U===!1||m?null:{keepOpenOnAlt:!1,onSelect:n,colorPickerType:e})},onEscape:U=>{c?l(null):s({openPopup:null})},label:a,type:e,elements:i,updateData:s,children:u}):u})},x$=({label:e,color:t,type:n})=>h.jsx(Eu,{type:"button",className:te("color-picker__button active-color properties-trigger",{"is-transparent":t==="transparent"||!t}),"aria-label":e,style:t?{"--swatch-color":t}:void 0,title:S(n==="elementStroke"?"labels.showStroke":"labels.showBackground"),children:h.jsx("div",{className:"color-picker__button-outline"})}),ap=({type:e,color:t,onChange:n,label:a,elements:i,palette:r=Ee,topPicks:s,updateData:o,appState:d})=>h.jsx("div",{children:h.jsxs("div",{role:"dialog","aria-modal":"true",className:"color-picker-container",children:[h.jsx(a$,{activeColor:t,onChange:n,type:e,topPicks:s}),h.jsx(M4,{}),h.jsxs(wu,{open:d.openPopup===e,onOpenChange:c=>{o({openPopup:c?e:null})},children:[h.jsx(x$,{color:t,label:a,type:e}),d.openPopup===e&&h.jsx(b$,{type:e,color:t,onChange:n,label:a,elements:i,palette:r,updateData:o})]})]})}),_u=({icon:e})=>h.jsx("span",{style:{width:"1em",margin:"0 0.5ex 0 0.5ex",display:"inline-block",lineHeight:0,verticalAlign:"middle"},children:e}),v$=({label:e,open:t,openTrigger:n,children:a,className:i})=>h.jsxs(h.Fragment,{children:[h.jsxs("div",{style:{cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"},className:i,onClick:n,children:[e,h.jsx(_u,{icon:t?CC:cb})]}),t&&h.jsx("div",{style:{display:"flex",flexDirection:"column"},children:a})]}),l1=v$,y$=Bt(!1);function w$({options:e,value:t,label:n,onChange:a,onClose:i,numberOfOptionsToAlwaysShow:r=e.length}){let s=Tt(),o=p=>{let U=e.find(m=>m.keyBinding===p.key.toLowerCase());if(!(p.metaKey||p.altKey||p.ctrlKey)&&U)a(U.value),p.preventDefault();else if(p.key===D.TAB){let m=e.findIndex(b=>b.value===t),g=p.shiftKey?(e.length+m-1)%e.length:(m+1)%e.length;a(e[g].value)}else if(wl(p.key)){let m=vo().rtl,g=e.findIndex(b=>b.value===t);if(g!==-1){let b=e.length,v=g;switch(p.key){case(m?D.ARROW_LEFT:D.ARROW_RIGHT):v=(g+1)%b;break;case(m?D.ARROW_RIGHT:D.ARROW_LEFT):v=(b+g-1)%b;break;case D.ARROW_DOWN:{v=(g+(r??1))%b;break}case D.ARROW_UP:{v=(b+g-(r??1))%b;break}}a(e[v].value)}p.preventDefault()}else(p.key===D.ESCAPE||p.key===D.ENTER)&&(p.preventDefault(),i());p.nativeEvent.stopImmediatePropagation(),p.stopPropagation()},[d,c]=gt(y$),l=Z.useMemo(()=>e.slice(0,r),[e,r]),u=Z.useMemo(()=>e.slice(r),[e,r]);C.useEffect(()=>{l.some(p=>p.value===t)||c(!0)},[t,l,c]);let f=p=>h.jsx("div",{className:"picker-content",children:p.map((U,m)=>h.jsxs("button",{type:"button",className:te("picker-option",{active:t===U.value}),onClick:g=>{a(U.value)},title:`${U.text} ${U.keyBinding&&`— ${U.keyBinding.toUpperCase()}`}`,"aria-label":U.text||"none","aria-keyshortcuts":U.keyBinding||void 0,ref:g=>{t===U.value&&setTimeout(()=>{g?.focus()},0)},children:[U.icon,U.keyBinding&&h.jsx("span",{className:"picker-keybinding",children:U.keyBinding})]},U.text))});return h.jsx(q0,{side:s.editor.isMobile&&!s.viewport.isLandscape?"top":"bottom",align:"start",sideOffset:12,style:{zIndex:"var(--zIndex-popup)"},onKeyDown:o,children:h.jsxs("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":n,children:[f(l),u.length>0&&h.jsx(l1,{label:S("labels.more_options"),open:d,openTrigger:()=>{c(p=>!p)},className:"picker-collapsible",children:f(u)})]})})}function sg({value:e,label:t,options:n,onChange:a,group:i="",numberOfOptionsToAlwaysShow:r}){let[s,o]=Z.useState(!1),d=Z.useRef(null);return h.jsx("div",{children:h.jsxs(wu,{open:s,onOpenChange:c=>o(c),children:[h.jsx(Eu,{name:i,type:"button","aria-label":t,onClick:()=>o(!s),ref:d,className:s?"active":"",children:n.find(c=>c.value===e)?.icon}),s&&h.jsx(w$,{options:n,value:e,label:t,onChange:a,onClose:()=>{o(!1)},numberOfOptionsToAlwaysShow:r})]})})}var j4=Z.forwardRef(({className:e,placeholder:t,onChange:n},a)=>h.jsxs("div",{className:te("QuickSearch__wrapper",e),children:[Pr,h.jsx("input",{ref:a,className:"QuickSearch__input",type:"text",placeholder:t,onChange:i=>n(i.target.value.trim().toLowerCase())})]})),A4=({className:e,placeholder:t,children:n})=>{let a=!C.Children.count(n);return h.jsx("div",{className:te("ScrollableList__wrapper",e),role:"menu",children:a?h.jsx("div",{className:"empty",children:t}):n})},D4=({children:e,className:t="",style:n,title:a})=>h.jsxs("div",{className:`dropdown-menu-group ${t}`,style:n,children:[a&&h.jsx("p",{className:"dropdown-menu-group-title",children:a}),e]}),o1=D4;D4.displayName="DropdownMenuGroup";var L4=Z.createContext({}),R4=(e="",t=!1,n=!1)=>`dropdown-menu-item dropdown-menu-item-base ${e}
53
+ ${t?"dropdown-menu-item--selected":""} ${n?"dropdown-menu-item--hovered":""}`.trim(),P4=(e,t)=>{let n=C.useContext(L4);return Qc(e,a=>{let i=new CustomEvent("menu.itemSelect",{bubbles:!0,cancelable:!0});t?.(i),i.defaultPrevented||n.onSelect?.(i)})},E$=({textStyle:e,icon:t,shortcut:n,children:a})=>{let i=Tt();return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"dropdown-menu-item__icon",children:t}),h.jsx("div",{style:e,className:"dropdown-menu-item__text",children:a}),n&&!i.editor.isMobile&&h.jsx("div",{className:"dropdown-menu-item__shortcut",children:n})]})},N4=E$,ip=({icon:e,value:t,order:n,children:a,shortcut:i,className:r,hovered:s,selected:o,textStyle:d,onSelect:c,onClick:l,...u})=>{let f=P4(l,c),p=C.useRef(null);return C.useEffect(()=>{s&&(n===0?p.current?.scrollIntoView({block:"end"}):p.current?.scrollIntoView({block:"nearest"}))},[s,n]),h.jsx("button",{...u,ref:p,value:t,onClick:f,className:R4(r,o,s),title:u.title??u["aria-label"],children:h.jsx(N4,{textStyle:d,icon:e,shortcut:i,children:a})})};ip.displayName="DropdownMenuItem";var Il={GREEN:"green",RED:"red",BLUE:"blue"},rp=({type:e=Il.BLUE,children:t})=>{let{theme:n}=Vo(),a={display:"inline-flex",marginLeft:"auto",padding:"2px 4px",borderRadius:6,fontSize:9,fontFamily:"Cascadia, monospace",border:n===Me.LIGHT?"1.5px solid white":"none"};switch(e){case Il.GREEN:Object.assign(a,{backgroundColor:"var(--background-color-badge)",color:"var(--color-badge)"});break;case Il.RED:Object.assign(a,{backgroundColor:"pink",color:"darkred"});break;case Il.BLUE:default:Object.assign(a,{background:"var(--color-promo)",color:"var(--color-surface-lowest)"})}return h.jsx("div",{className:"DropDownMenuItemBadge",style:a,children:t})};rp.displayName="DropdownMenuItemBadge";ip.Badge=rp;var Wn=ip,S$=({event:e,inputRef:t,hoveredFont:n,filteredFonts:a,onClose:i,onSelect:r,onHover:s})=>{if(!e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===D.F)return t.current?.focus(),!0;if(e.key===D.ESCAPE)return i(),!0;if(e.key===D.ENTER)return n?.value&&r(n.value),!0;if(e.key===D.ARROW_DOWN)return n?.next?s(n.next.value):a[0]?.value&&s(a[0].value),!0;if(e.key===D.ARROW_UP)return n?.prev?s(n.prev.value):a[a.length-1]?.value&&s(a[a.length-1].value),!0},k$=Z.memo(({selectedFontFamily:e,hoveredFontFamily:t,onSelect:n,onHover:a,onLeave:i,onOpen:r,onClose:s})=>{let{container:o}=za(),{fonts:d}=Ua(),{showDeprecatedFonts:c}=Wo(),[l,u]=C.useState(""),f=C.useRef(null),p=C.useMemo(()=>Array.from(ni.registered.entries()).filter(([I,{metadata:A}])=>!A.serverSide&&!A.fallback).map(([I,{metadata:A,fontFaces:_}])=>{let T={value:I,icon:A.icon??pc,text:_[0]?.fontFace?.family??"Unknown"};return A.deprecated&&Object.assign(T,{deprecated:A.deprecated,badge:{type:Il.RED,placeholder:S("fontList.badge.old")}}),T}).sort((I,A)=>I.text.toLowerCase()>A.text.toLowerCase()?1:-1),[]),U=C.useMemo(()=>new Set(d.getSceneFamilies()),[e]),m=C.useMemo(()=>p.filter(I=>U.has(I.value)),[p,U]),g=C.useMemo(()=>p.filter(I=>!U.has(I.value)&&(c||!I.deprecated)),[p,U,c]),b=C.useMemo(()=>fk([...m,...g].filter(I=>I.text?.toLowerCase().includes(l))),[m,g,l]),v=C.useMemo(()=>{let I;return t?I=b.find(A=>A.value===t):e&&(I=b.find(A=>A.value===e)),!I&&l&&(b[0]?.value?a(b[0].value):i()),I},[t,e,l,b,a,i]),x=C.useCallback(I=>{S$({event:I,inputRef:f,hoveredFont:v,filteredFonts:b,onSelect:n,onHover:a,onClose:s})&&(I.preventDefault(),I.stopPropagation())},[v,b,n,a,s]);C.useEffect(()=>(r(),()=>{s()}),[]);let y=C.useMemo(()=>b.filter(I=>U.has(I.value)),[b,U]),w=C.useMemo(()=>b.filter(I=>!U.has(I.value)),[b,U]),k=(I,A)=>h.jsxs(Wn,{icon:I.icon,value:I.value,order:A,textStyle:{fontFamily:Cs({fontFamily:I.value})},hovered:I.value===v?.value,selected:I.value===e,tabIndex:I.value===e?0:-1,onClick:_=>{n(Number(_.currentTarget.value))},onMouseMove:()=>{v?.value!==I.value&&a(I.value)},children:[I.text,I.badge&&h.jsx(rp,{type:I.badge.type,children:I.badge.placeholder})]},I.value),M=[];return y.length&&M.push(h.jsx(o1,{title:S("fontList.sceneFonts"),children:y.map(k)},"group_1")),w.length&&M.push(h.jsx(o1,{title:S("fontList.availableFonts"),children:w.map((I,A)=>k(I,A+y.length))},"group_2")),h.jsxs(T4,{className:"properties-content",container:o,style:{width:"15rem"},onClose:s,onPointerLeave:i,onKeyDown:x,children:[h.jsx(j4,{ref:f,placeholder:S("quickSearch.placeholder"),onChange:Is(u,20)}),h.jsx(A4,{className:"dropdown-menu fonts manual-hover",placeholder:S("fontList.empty"),children:M.length?M:null})]})},(e,t)=>e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),M$=({selectedFontFamily:e})=>{let t=C.useMemo(()=>!!(e&&!I$(e)),[e]);return h.jsx(Eu,{asChild:!0,children:h.jsx("div",{children:h.jsx(k4,{standalone:!0,icon:Z5,title:S("labels.showFonts"),className:"properties-trigger",testId:"font-family-show-fonts",active:t,onClick:()=>{}})})})},O4=[{value:it.Excalifont,icon:oo,text:S("labels.handDrawn"),testId:"font-family-hand-drawn"},{value:it.Nunito,icon:pc,text:S("labels.normal"),testId:"font-family-normal"},{value:it["Comic Shanns"],icon:kf,text:S("labels.code"),testId:"font-family-code"}],C$=new Set(O4.map(e=>e.value)),I$=e=>e?C$.has(e):!1,_$=Z.memo(({isOpened:e,selectedFontFamily:t,hoveredFontFamily:n,onSelect:a,onHover:i,onLeave:r,onPopupChange:s})=>{let o=C.useMemo(()=>O4,[]),d=C.useCallback(c=>{c&&a(c)},[a]);return h.jsxs("div",{role:"dialog","aria-modal":"true",className:"FontPicker__container",children:[h.jsx(Fa,{type:"button",options:o,value:t,onClick:d}),h.jsx(M4,{}),h.jsxs(wu,{open:e,onOpenChange:s,children:[h.jsx(M$,{selectedFontFamily:t}),e&&h.jsx(k$,{selectedFontFamily:t,hoveredFontFamily:n,onSelect:d,onHover:i,onLeave:r,onOpen:()=>s(!0),onClose:()=>s(!1)})]})]})},(e,t)=>e.isOpened===t.isOpened&&e.selectedFontFamily===t.selectedFontFamily&&e.hoveredFontFamily===t.hoveredFontFamily),T$=({updateData:e,appState:t,elements:n,testId:a})=>{let i=Z.useRef(null),r=Z.useRef(null),s=dn(n,t,o=>o.opacity,!0,t.currentItemOpacity);return C.useEffect(()=>{if(i.current&&r.current){let o=i.current,d=r.current,c=o.offsetWidth,l=15,u=s/100*(c-l)+l/2;d.style.left=`${u}px`,o.style.background=`linear-gradient(to right, var(--color-slider-track) 0%, var(--color-slider-track) ${s}%, var(--button-bg) ${s}%, var(--button-bg) 100%)`}},[s]),h.jsxs("label",{className:"control-label",children:[S("labels.opacity"),h.jsxs("div",{className:"range-wrapper",children:[h.jsx("input",{ref:i,type:"range",min:"0",max:"100",step:"10",onChange:o=>{e(+o.target.value)},value:s,className:"range-input","data-testid":a}),h.jsx("div",{className:"value-bubble",ref:r,children:s!==0?s:null}),h.jsx("div",{className:"zero-label",children:"0"})]})]})},$4=.1,on=(e,t,n,a=!1)=>{let i=oe(xe(e,t,{includeBoundTextElement:a}));return e.map(r=>i.get(r.id)||r.id===t.editingTextElement?.id?n(r):r)},dn=function(e,t,n,a,i){let r=t.editingTextElement,s=Ve(e),o=null;return r&&(o=n(r)),o||(_t(s,t)?o=TR(a===!0?s:s.filter(d=>a(d)),t,n)??(typeof i=="function"?i(!0):i):o=typeof i=="function"?i(!1):i),o},j$=(e,t)=>nt(t)||!t.autoResize?t:X(t,{x:e.textAlign==="left"?e.x:e.x+(e.width-t.width)/(e.textAlign==="center"?2:1),y:e.y+(e.height-t.height)/2},!1),sp=(e,t,n,a,i)=>{let r=new Set,s=on(e,t,d=>{if(q(d)){let c=a(d);r.add(c);let l=pe(d,{fontSize:c});return ln(l,n.scene.getContainerElement(d),n.scene.getNonDeletedElementsMap()),l=j$(d,l),l}return d},!0),o=oe(s);return xe(e,t,{includeBoundTextElement:!0}).forEach(d=>{q(d)&&xn(d,o)}),{elements:s,appState:{...t,currentItemFontSize:r.size===1?[...r][0]:i??t.currentItemFontSize},captureUpdate:B.IMMEDIATELY}};G({name:"changeStrokeColor",label:"labels.stroke",trackEvent:!1,perform:(e,t,n)=>({...n.currentItemStrokeColor&&{elements:on(e,t,a=>Tf(a.type)?pe(a,{strokeColor:n.currentItemStrokeColor}):a,!0)},appState:{...t,...n},captureUpdate:n.currentItemStrokeColor?B.IMMEDIATELY:B.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:a})=>h.jsxs(h.Fragment,{children:[h.jsx("h3",{"aria-hidden":"true",children:S("labels.stroke")}),h.jsx(ap,{topPicks:f5,palette:dS,type:"elementStroke",label:S("labels.stroke"),color:dn(e,t,i=>i.strokeColor,!0,t.currentItemStrokeColor),onChange:i=>n({currentItemStrokeColor:i}),elements:e,appState:t,updateData:n})]})});G({name:"changeBackgroundColor",label:"labels.changeBackground",trackEvent:!1,perform:(e,t,n)=>({...n.currentItemBackgroundColor&&{elements:on(e,t,a=>pe(a,{backgroundColor:n.currentItemBackgroundColor}))},appState:{...t,...n},captureUpdate:n.currentItemBackgroundColor?B.IMMEDIATELY:B.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:a})=>h.jsxs(h.Fragment,{children:[h.jsx("h3",{"aria-hidden":"true",children:S("labels.background")}),h.jsx(ap,{topPicks:p5,palette:cS,type:"elementBackground",label:S("labels.background"),color:dn(e,t,i=>i.backgroundColor,!0,t.currentItemBackgroundColor),onChange:i=>n({currentItemBackgroundColor:i}),elements:e,appState:t,updateData:n})]})});G({name:"changeFillStyle",label:"labels.fill",trackEvent:!1,perform:(e,t,n,a)=>(qe("element","changeFillStyle",`${n} (${a.device.editor.isMobile?"mobile":"desktop"})`),{elements:on(e,t,i=>pe(i,{fillStyle:n})),appState:{...t,currentItemFillStyle:n},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let a=xe(e,t),i=a.length>0&&a.every(r=>r.fillStyle==="zigzag");return h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.fill")}),h.jsx(Fa,{type:"button",options:[{value:"hachure",text:`${S(i?"labels.zigzag":"labels.hachure")} (${H("Alt-Click")})`,icon:i?mM:gM,active:i?!0:void 0,testId:"fill-hachure"},{value:"cross-hatch",text:S("labels.crossHatch"),icon:bM,testId:"fill-cross-hatch"},{value:"solid",text:S("labels.solid"),icon:xM,testId:"fill-solid"}],value:dn(e,t,r=>r.fillStyle,r=>r.hasOwnProperty("fillStyle"),r=>r?null:t.currentItemFillStyle),onClick:(r,s)=>{let o=s.altKey&&r==="hachure"&&a.every(d=>d.fillStyle==="hachure")?"zigzag":r;n(o)}})]})}});G({name:"changeStrokeWidth",label:"labels.strokeWidth",trackEvent:!1,perform:(e,t,n)=>({elements:on(e,t,a=>pe(a,{strokeWidth:n})),appState:{...t,currentItemStrokeWidth:n},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.strokeWidth")}),h.jsx(Fa,{group:"stroke-width",options:[{value:dh.thin,text:S("labels.thin"),icon:tb,testId:"strokeWidth-thin"},{value:dh.bold,text:S("labels.bold"),icon:vM,testId:"strokeWidth-bold"},{value:dh.extraBold,text:S("labels.extraBold"),icon:yM,testId:"strokeWidth-extraBold"}],value:dn(e,t,a=>a.strokeWidth,a=>a.hasOwnProperty("strokeWidth"),a=>a?null:t.currentItemStrokeWidth),onChange:a=>n(a)})]})});G({name:"changeSloppiness",label:"labels.sloppiness",trackEvent:!1,perform:(e,t,n)=>({elements:on(e,t,a=>pe(a,{seed:Ra(),roughness:n})),appState:{...t,currentItemRoughness:n},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.sloppiness")}),h.jsx(Fa,{group:"sloppiness",options:[{value:0,text:S("labels.architect"),icon:SM},{value:1,text:S("labels.artist"),icon:kM},{value:2,text:S("labels.cartoonist"),icon:MM}],value:dn(e,t,a=>a.roughness,a=>a.hasOwnProperty("roughness"),a=>a?null:t.currentItemRoughness),onChange:a=>n(a)})]})});G({name:"changeStrokeStyle",label:"labels.strokeStyle",trackEvent:!1,perform:(e,t,n)=>({elements:on(e,t,a=>pe(a,{strokeStyle:n})),appState:{...t,currentItemStrokeStyle:n},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.strokeStyle")}),h.jsx(Fa,{group:"strokeStyle",options:[{value:"solid",text:S("labels.strokeStyle_solid"),icon:tb},{value:"dashed",text:S("labels.strokeStyle_dashed"),icon:wM},{value:"dotted",text:S("labels.strokeStyle_dotted"),icon:EM}],value:dn(e,t,a=>a.strokeStyle,a=>a.hasOwnProperty("strokeStyle"),a=>a?null:t.currentItemStrokeStyle),onChange:a=>n(a)})]})});G({name:"changeOpacity",label:"labels.opacity",trackEvent:!1,perform:(e,t,n)=>({elements:on(e,t,a=>pe(a,{opacity:n}),!0),appState:{...t,currentItemOpacity:n},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>h.jsx(T$,{updateData:n,elements:e,appState:t,testId:"opacity"})});G({name:"changeFontSize",label:"labels.fontSize",trackEvent:!1,perform:(e,t,n,a)=>sp(e,t,a,()=>n,n),PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.fontSize")}),h.jsx(Fa,{group:"font-size",options:[{value:16,text:S("labels.small"),icon:zM,testId:"fontSize-small"},{value:20,text:S("labels.medium"),icon:BM,testId:"fontSize-medium"},{value:28,text:S("labels.large"),icon:HM,testId:"fontSize-large"},{value:36,text:S("labels.veryLarge"),icon:XM,testId:"fontSize-veryLarge"}],value:dn(e,t,i=>{if(q(i))return i.fontSize;let r=ge(i,a.scene.getNonDeletedElementsMap());return r?r.fontSize:null},i=>q(i)||ge(i,a.scene.getNonDeletedElementsMap())!==null,i=>i?null:t.currentItemFontSize||pi),onChange:i=>n(i)})]})});var lg=G({name:"decreaseFontSize",label:"labels.decreaseFontSize",icon:au,trackEvent:!1,perform:(e,t,n,a)=>sp(e,t,a,i=>Math.round(1/(1+$4)*i.fontSize)),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&(e.key===D.CHEVRON_LEFT||e.key===D.COMMA)}),og=G({name:"increaseFontSize",label:"labels.increaseFontSize",icon:au,trackEvent:!1,perform:(e,t,n,a)=>sp(e,t,a,i=>Math.round(i.fontSize*(1+$4))),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&(e.key===D.CHEVRON_RIGHT||e.key===D.PERIOD)});G({name:"changeFontFamily",label:"labels.fontFamily",trackEvent:!1,perform:(e,t,n,a)=>{let{cachedElements:i,resetAll:r,resetContainers:s,...o}=n;if(r)return{elements:on(e,t,U=>{let m=i?.get(U.id);return m?pe(U,{...m}):U},!0),appState:{...t,...o},captureUpdate:B.NEVER};let{currentItemFontFamily:d,currentHoveredFontFamily:c}=n,l=B.EVENTUALLY,u,f=!1;if(d)u=d,l=B.IMMEDIATELY;else if(c){u=c,l=B.EVENTUALLY;let U=xe(e,t,{includeBoundTextElement:!0}).filter(m=>q(m));if(U.length>200)f=!0;else{let m=0,g=0;for(;m<U.length&&g<5e3;){let b=U[m];g+=b?.originalText.length||0,m++}g>5e3&&(f=!0)}}let p={appState:{...t,...o},captureUpdate:l};if(u&&!f){let U=new Map,m=new Set,g=!1,b=Array.from(ni.loadedFontsCache.values()),v=Object.entries(it).find(([w,k])=>k===u)?.[0];c&&v&&b.some(w=>w.startsWith(v))&&(g=!0),Object.assign(p,{elements:on(e,t,w=>{if(q(w)&&(w.fontFamily!==u||d)){let k=pe(w,{fontFamily:u,lineHeight:Nr(u)}),M=i?.get(w.containerId||"")||{},I=a.scene.getContainerElement(w);return s&&I&&M&&X(I,{...M},!1),g||(m=new Set([...m,...Array.from(k.originalText)])),U.set(k,I),k}return w},!0)});let x=`10px ${Cs({fontFamily:u})}`,y=Array.from(m.values()).join();if(g||window.document.fonts.check(x,y))for(let[w,k]of U)ln(w,k,a.scene.getNonDeletedElementsMap(),!1);else window.document.fonts.load(x,y).then(w=>{for(let[k,M]of U){let I=a.scene.getElement(k.id),A=M?a.scene.getElement(M.id):null;I&&ln(I,A,a.scene.getNonDeletedElementsMap(),!1)}a.fonts.onLoaded(w)})}return p},PanelComponent:({elements:e,appState:t,app:n,updateData:a})=>{let i=C.useRef(new Map),r=C.useRef(null),[s,o]=C.useState({}),d=C.useRef(!0),c=C.useMemo(()=>{let l=(u,f)=>dn(u,t,p=>{if(q(p))return p.fontFamily;let U=ge(p,f);return U?U.fontFamily:null},p=>q(p)||ge(p,f)!==null,p=>p?null:t.currentItemFontFamily||qi);return s.openPopup==="fontFamily"&&t.openPopup==="fontFamily"?l(Array.from(i.current?.values()??[]),i.current):!s.openPopup&&t.openPopup!=="fontFamily"?l(e,n.scene.getNonDeletedElementsMap()):r.current},[s.openPopup,t,e,n.scene]);return C.useEffect(()=>{r.current=c},[c]),C.useEffect(()=>{Object.keys(s).length&&(a(s),o({}))},[s]),C.useEffect(()=>(d.current=!1,()=>{d.current=!0}),[]),h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.fontFamily")}),h.jsx(_$,{isOpened:t.openPopup==="fontFamily",selectedFontFamily:c,hoveredFontFamily:t.currentHoveredFontFamily,onSelect:l=>{o({openPopup:null,currentHoveredFontFamily:null,currentItemFontFamily:l}),i.current.clear()},onHover:l=>{o({currentHoveredFontFamily:l,cachedElements:new Map(i.current),resetContainers:!0})},onLeave:()=>{o({currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0})},onPopupChange:l=>{if(l){i.current.clear();let{editingTextElement:u}=t;if(u?.type==="text"){let f=n.scene.getElement(u.id);i.current.set(u.id,pe(f||u,{},!0))}else{let f=xe(e,t,{includeBoundTextElement:!0});for(let p of f)i.current.set(p.id,pe(p,{},!0))}o({openPopup:"fontFamily"})}else{let u={openPopup:null,currentHoveredFontFamily:null,cachedElements:new Map(i.current),resetAll:!0};d.current?a({...s,...u}):o(u),i.current.clear()}}})]})}});G({name:"changeTextAlign",label:"Change text alignment",trackEvent:!1,perform:(e,t,n,a)=>({elements:on(e,t,i=>{if(q(i)){let r=pe(i,{textAlign:n});return ln(r,a.scene.getContainerElement(i),a.scene.getNonDeletedElementsMap()),r}return i},!0),appState:{...t,currentItemTextAlign:n},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>{let i=a.scene.getNonDeletedElementsMap();return h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.textAlign")}),h.jsx(Fa,{group:"text-align",options:[{value:"left",text:S("labels.left"),icon:VM,testId:"align-left"},{value:"center",text:S("labels.center"),icon:GM,testId:"align-horizontal-center"},{value:"right",text:S("labels.right"),icon:ZM,testId:"align-right"}],value:dn(e,t,r=>{if(q(r))return r.textAlign;let s=ge(r,i);return s?s.textAlign:null},r=>q(r)||ge(r,i)!==null,r=>r?null:t.currentItemTextAlign),onChange:r=>n(r)})]})}});G({name:"changeVerticalAlign",label:"Change vertical alignment",trackEvent:{category:"element"},perform:(e,t,n,a)=>({elements:on(e,t,i=>{if(q(i)){let r=pe(i,{verticalAlign:n});return ln(r,a.scene.getContainerElement(i),a.scene.getNonDeletedElementsMap()),r}return i},!0),appState:{...t},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>h.jsx("fieldset",{children:h.jsx(Fa,{group:"text-align",options:[{value:Mn.TOP,text:S("labels.alignTop"),icon:h.jsx(YM,{theme:t.theme}),testId:"align-top"},{value:Mn.MIDDLE,text:S("labels.centerVertically"),icon:h.jsx(qM,{theme:t.theme}),testId:"align-middle"},{value:Mn.BOTTOM,text:S("labels.alignBottom"),icon:h.jsx(KM,{theme:t.theme}),testId:"align-bottom"}],value:dn(e,t,i=>{if(q(i)&&i.containerId)return i.verticalAlign;let r=ge(i,a.scene.getNonDeletedElementsMap());return r?r.verticalAlign:null},i=>q(i)||ge(i,a.scene.getNonDeletedElementsMap())!==null,i=>i?null:Mn.MIDDLE),onChange:i=>n(i)})})});G({name:"changeRoundness",label:"Change edge roundness",trackEvent:!1,perform:(e,t,n)=>({elements:on(e,t,a=>Q(a)?a:pe(a,{roundness:n==="round"?{type:Xs(a.type)?St.ADAPTIVE_RADIUS:St.PROPORTIONAL_RADIUS}:null})),appState:{...t,currentItemRoundness:n},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let a=a7(Ve(e),t).some(i=>i.roundness?.type===St.LEGACY);return h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.edges")}),h.jsx(Fa,{group:"edges",options:[{value:"sharp",text:S("labels.sharp"),icon:CM},{value:"round",text:S("labels.round"),icon:IM}],value:dn(e,t,i=>a?null:i.roundness?"round":"sharp",i=>!ve(i)&&i.hasOwnProperty("roundness"),i=>i?null:t.currentItemRoundness),onChange:i=>n(i)})]})}});var dg=e=>[{value:null,text:S("labels.arrowhead_none"),keyBinding:"q",icon:_M},{value:"arrow",text:S("labels.arrowhead_arrow"),keyBinding:"w",icon:h.jsx(TM,{flip:e})},{value:"triangle",text:S("labels.arrowhead_triangle"),icon:h.jsx(LM,{flip:e}),keyBinding:"e"},{value:"triangle_outline",text:S("labels.arrowhead_triangle_outline"),icon:h.jsx(RM,{flip:e}),keyBinding:"r"},{value:"circle",text:S("labels.arrowhead_circle"),keyBinding:"a",icon:h.jsx(jM,{flip:e})},{value:"circle_outline",text:S("labels.arrowhead_circle_outline"),keyBinding:"s",icon:h.jsx(AM,{flip:e})},{value:"diamond",text:S("labels.arrowhead_diamond"),icon:h.jsx(PM,{flip:e}),keyBinding:"d"},{value:"diamond_outline",text:S("labels.arrowhead_diamond_outline"),icon:h.jsx(NM,{flip:e}),keyBinding:"f"},{value:"bar",text:S("labels.arrowhead_bar"),keyBinding:"z",icon:h.jsx(DM,{flip:e})},{value:"crowfoot_one",text:S("labels.arrowhead_crowfoot_one"),icon:h.jsx($M,{flip:e}),keyBinding:"c"},{value:"crowfoot_many",text:S("labels.arrowhead_crowfoot_many"),icon:h.jsx(OM,{flip:e}),keyBinding:"x"},{value:"crowfoot_one_or_many",text:S("labels.arrowhead_crowfoot_one_or_many"),icon:h.jsx(FM,{flip:e}),keyBinding:"v"}];G({name:"changeArrowhead",label:"Change arrowheads",trackEvent:!1,perform:(e,t,n)=>({elements:on(e,t,a=>{if(ue(a)){let{position:i,type:r}=n;if(i==="start")return pe(a,{startArrowhead:r});if(i==="end")return pe(a,{endArrowhead:r})}return a}),appState:{...t,[n.position==="start"?"currentItemStartArrowhead":"currentItemEndArrowhead"]:n.type},captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let a=vo().rtl;return h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.arrowheads")}),h.jsxs("div",{className:"iconSelectList buttonList",children:[h.jsx(sg,{label:"arrowhead_start",options:dg(!a),value:dn(e,t,i=>ue(i)&&gc(i.type)?i.startArrowhead:t.currentItemStartArrowhead,!0,t.currentItemStartArrowhead),onChange:i=>n({position:"start",type:i}),numberOfOptionsToAlwaysShow:4}),h.jsx(sg,{label:"arrowhead_end",group:"arrowheads",options:dg(!!a),value:dn(e,t,i=>ue(i)&&gc(i.type)?i.endArrowhead:t.currentItemEndArrowhead,!0,t.currentItemEndArrowhead),onChange:i=>n({position:"end",type:i}),numberOfOptionsToAlwaysShow:4})]})]})}});G({name:"changeArrowType",label:"Change arrow types",trackEvent:!1,perform:(e,t,n,a)=>{let i=on(e,t,o=>{if(!ve(o))return o;let d=pe(o,{roundness:n===Ot.round?{type:St.PROPORTIONAL_RADIUS}:null,elbowed:n===Ot.elbow,points:n===Ot.elbow||o.elbowed?[o.points[0],o.points[o.points.length-1]]:o.points});if(Q(d)){let c=a.scene.getNonDeletedElementsMap();a.dismissLinearEditor();let l=J.getPointAtIndexGlobalCoordinates(d,0,c),u=J.getPointAtIndexGlobalCoordinates(d,-1,c),f=!d.startBinding&&aa(ta(l),e,c,t.zoom,!1,!0),p=!d.endBinding&&aa(ta(u),e,c,t.zoom,!1,!0),U=f||d.startBinding&&c.get(d.startBinding.elementId),m=p||d.endBinding&&c.get(d.endBinding.elementId),g=f?uo(d,f,"start"):l,b=p?uo(d,p,"end"):u;f&&La(d,f,"start",c),p&&La(d,p,"end",c),X(d,{points:[g,b].map(v=>E(v[0]-d.x,v[1]-d.y)),...U&&d.startBinding?{startBinding:{...d.startBinding,...vc(d,U,"start")}}:{},...m&&d.endBinding?{endBinding:{...d.endBinding,...vc(d,m,"end")}}:{}}),J.updateEditorMidPointsCache(d,c,a.state)}return d}),r={...t,currentItemArrowType:n},s=t.selectedLinearElement?.elementId;if(s){let o=i.find(d=>d.id===s);o&&(r.selectedLinearElement=new J(o))}return{elements:i,appState:r,captureUpdate:B.IMMEDIATELY}},PanelComponent:({elements:e,appState:t,updateData:n})=>h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.arrowtypes")}),h.jsx(Fa,{group:"arrowtypes",options:[{value:Ot.sharp,text:S("labels.arrowtype_sharp"),icon:SC,testId:"sharp-arrow"},{value:Ot.round,text:S("labels.arrowtype_round"),icon:MC,testId:"round-arrow"},{value:Ot.elbow,text:S("labels.arrowtype_elbowed"),icon:kC,testId:"elbow-arrow"}],value:dn(e,t,a=>ve(a)?a.elbowed?Ot.elbow:a.roundness?Ot.round:Ot.sharp:null,a=>ve(a),a=>a?null:t.currentItemArrowType),onChange:a=>n(a)})]})});var xr=({viewportX:e,viewportY:t,nextZoom:n},a)=>{let i=e-a.offsetLeft,r=t-a.offsetTop,s=a.zoom.value,o=a.scrollX+(i-i/s),d=a.scrollY+(r-r/s),c=-(i-i/n),l=-(r-r/n);return{scrollX:o+c,scrollY:d+l,zoom:{value:n}}},Hl=()=>{let e=document.querySelector(".excalidraw-tooltip");if(e)return e;let t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},F4=(e,t,n="bottom")=>{let a=e.getBoundingClientRect(),i=window.innerWidth,r=window.innerHeight,s=5,o=t.left+t.width/2-a.width/2;o<0?o=s:o+a.width>=i&&(o=i-a.width-s);let d;n==="bottom"?(d=t.top+t.height+s,d+a.height>=r&&(d=t.top-a.height-s)):(d=t.top-a.height-s,d<0&&(d=t.top+t.height+s)),Object.assign(e.style,{top:`${d}px`,left:`${o}px`})},A$=(e,t,n,a)=>{t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=a?"50ch":"10ch",t.style.maxWidth=a?"50ch":"15ch",t.textContent=n;let i=e.getBoundingClientRect();F4(t,i)},Br=({children:e,label:t,long:n=!1,style:a,disabled:i})=>(C.useEffect(()=>()=>Hl().classList.remove("excalidraw-tooltip--visible"),[]),i?null:h.jsx("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:r=>A$(r.currentTarget,Hl(),t,n),onPointerLeave:()=>Hl().classList.remove("excalidraw-tooltip--visible"),style:a,children:e}));G({name:"changeViewBackgroundColor",label:"labels.canvasBackground",paletteName:"Change canvas background color",trackEvent:!1,predicate:(e,t,n,a)=>!!a.props.UIOptions.canvasActions.changeViewBackgroundColor&&!t.viewModeEnabled,perform:(e,t,n)=>({appState:{...t,...n},captureUpdate:n.viewBackgroundColor?B.IMMEDIATELY:B.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n,appProps:a})=>h.jsx(ap,{palette:null,topPicks:U5,label:S("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:i=>n({viewBackgroundColor:i}),"data-testid":"canvas-background-picker",elements:e,appState:t,updateData:n})});var Xl=G({name:"clearCanvas",label:"labels.clearCanvas",paletteName:"Clear canvas",icon:Rr,trackEvent:{category:"canvas"},predicate:(e,t,n,a)=>!!a.props.UIOptions.canvasActions.clearCanvas&&!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector",perform:(e,t,n,a)=>(a.imageCache.clear(),{elements:e.map(i=>pe(i,{isDeleted:!0})),appState:{...Da(),files:{},theme:t.theme,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,gridStep:t.gridStep,gridModeEnabled:t.gridModeEnabled,stats:t.stats,pasteDialog:t.pasteDialog,activeTool:t.activeTool.type==="image"?{...t.activeTool,type:"selection"}:t.activeTool},captureUpdate:B.IMMEDIATELY})}),cg=G({name:"zoomIn",label:"buttons.zoomIn",viewMode:!0,icon:t2,trackEvent:{category:"canvas"},perform:(e,t,n,a)=>({appState:{...t,...xr({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:ei(t.zoom.value+Kc)},t),userToFollow:null},captureUpdate:B.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>h.jsx(Ce,{type:"button",className:"zoom-in-button zoom-button",icon:t2,title:`${S("buttons.zoomIn")} — ${H("CtrlOrCmd++")}`,"aria-label":S("buttons.zoomIn"),disabled:t.zoom.value>=D1,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Te.EQUAL||e.code===Te.NUM_ADD)&&(e[D.CTRL_OR_CMD]||e.shiftKey)}),ug=G({name:"zoomOut",label:"buttons.zoomOut",icon:n2,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,a)=>({appState:{...t,...xr({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:ei(t.zoom.value-Kc)},t),userToFollow:null},captureUpdate:B.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>h.jsx(Ce,{type:"button",className:"zoom-out-button zoom-button",icon:n2,title:`${S("buttons.zoomOut")} — ${H("CtrlOrCmd+-")}`,"aria-label":S("buttons.zoomOut"),disabled:t.zoom.value<=A1,onClick:()=>{e(null)}}),keyTest:e=>(e.code===Te.MINUS||e.code===Te.NUM_SUBTRACT)&&(e[D.CTRL_OR_CMD]||e.shiftKey)}),hg=G({name:"resetZoom",label:"buttons.resetZoom",icon:tM,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,a)=>({appState:{...t,...xr({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:ei(1)},t),userToFollow:null},captureUpdate:B.EVENTUALLY}),PanelComponent:({updateData:e,appState:t})=>h.jsx(Br,{label:S("buttons.resetZoom"),style:{height:"100%"},children:h.jsxs(Ce,{type:"button",className:"reset-zoom-button zoom-button",title:S("buttons.resetZoom"),"aria-label":S("buttons.resetZoom"),onClick:()=>{e(null)},children:[(t.zoom.value*100).toFixed(0),"%"]})}),keyTest:e=>(e.code===Te.ZERO||e.code===Te.NUM_ZERO)&&(e[D.CTRL_OR_CMD]||e.shiftKey)}),D$=(e,t,n=1)=>{let[a,i,r,s]=e,o=r-a,d=t.width/o,c=s-i,l=t.height/c,u=Math.min(d,l)*Se(n,.1,1);return Math.min(u,1)},z4=({bounds:e,appState:t,canvasOffsets:n,fitToViewport:a=!1,viewportZoomFactor:i=1,minZoom:r=-1/0,maxZoom:s=1/0})=>{i=Se(i,A1,D1);let[o,d,c,l]=e,u=(o+c)/2,f=(d+l)/2,p=n?.left??0,U=n?.top??0,m=n?.right??0,g=n?.bottom??0,b=t.width-p-m,v=t.height-U-g,x;if(a){let k=c-o,M=l-d;x=Math.min(b/k,v/M)*i}else x=D$(e,{width:b,height:v},i);let y=ei(Se(HS(x,Kc,"floor"),r,s)),w=Kb({scenePoint:{x:u,y:f},viewportDimensions:{width:t.width,height:t.height},offsets:n,zoom:{value:y}});return{appState:{...t,scrollX:w.scrollX,scrollY:w.scrollY,zoom:{value:y}},captureUpdate:B.EVENTUALLY}},Tu=({canvasOffsets:e,targetElements:t,appState:n,fitToViewport:a,viewportZoomFactor:i,minZoom:r,maxZoom:s})=>{let o=Ne(Ve(t));return z4({canvasOffsets:e,bounds:o,appState:n,fitToViewport:a,viewportZoomFactor:i,minZoom:r,maxZoom:s})};G({name:"zoomToFitSelectionInViewport",label:"labels.zoomToFitViewport",icon:Y1,trackEvent:{category:"canvas"},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t);return Tu({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:a.getEditorUIOffsets()})},keyTest:e=>e.code===Te.TWO&&e.shiftKey&&!e.altKey&&!e[D.CTRL_OR_CMD]});G({name:"zoomToFitSelection",label:"helpDialog.zoomToSelection",icon:Y1,trackEvent:{category:"canvas"},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t);return Tu({targetElements:i.length?i:e,appState:{...t,userToFollow:null},fitToViewport:!0,canvasOffsets:a.getEditorUIOffsets()})},keyTest:e=>e.code===Te.THREE&&e.shiftKey&&!e.altKey&&!e[D.CTRL_OR_CMD]});G({name:"zoomToFit",label:"helpDialog.zoomToFit",icon:Y1,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n,a)=>Tu({targetElements:e,appState:{...t,userToFollow:null},fitToViewport:!1,canvasOffsets:a.getEditorUIOffsets()}),keyTest:e=>e.code===Te.ONE&&e.shiftKey&&!e.altKey&&!e[D.CTRL_OR_CMD]});var Rc=G({name:"toggleTheme",label:(e,t)=>t.theme===Me.DARK?"buttons.lightMode":"buttons.darkMode",keywords:["toggle","dark","light","mode","theme"],icon:e=>e.theme===Me.LIGHT?wf:Ef,viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t,n)=>({appState:{...t,theme:n||(t.theme===Me.LIGHT?Me.DARK:Me.LIGHT)},captureUpdate:B.EVENTUALLY}),keyTest:e=>e.altKey&&e.shiftKey&&e.code===Te.D,predicate:(e,t,n,a)=>!!a.props.UIOptions.canvasActions.toggleTheme});G({name:"toggleEraserTool",label:"toolBar.eraser",trackEvent:{category:"toolbar"},perform:(e,t)=>{let n;return Ea(t)?n=Et(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):n=Et(t,{type:"eraser",lastActiveToolBeforeEraser:t.activeTool}),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:n},captureUpdate:B.IMMEDIATELY}},keyTest:e=>e.key===D.E});var L$=G({name:"toggleHandTool",label:"toolBar.hand",paletteName:"Toggle hand tool",trackEvent:{category:"toolbar"},icon:ab,viewMode:!1,perform:(e,t,n,a)=>{let i;return Ms(t)?i=Et(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):(i=Et(t,{type:"hand",lastActiveToolBeforeEraser:t.activeTool}),He(a.interactiveCanvas,Fe.GRAB)),{appState:{...t,selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null,activeTool:i},captureUpdate:B.IMMEDIATELY}},keyTest:e=>!e.altKey&&!e[D.CTRL_OR_CMD]&&e.key===D.H}),Zn=G({name:"finalize",label:"",trackEvent:!1,perform:(e,t,n,a)=>{let{interactiveCanvas:i,focusContainer:r,scene:s}=a,o=s.getNonDeletedElementsMap();if(t.editingLinearElement){let{elementId:f,startBindingElement:p,endBindingElement:U}=t.editingLinearElement,m=J.getElement(f,o);if(m)return _a(m)&&ou(m,p,U,o,s),{elements:m.points.length<2||Fr(m)?e.filter(g=>g.id!==m.id):void 0,appState:{...t,cursorButton:"up",editingLinearElement:null},captureUpdate:B.IMMEDIATELY}}let d=e,c=t.pendingImageElementId&&s.getElement(t.pendingImageElementId);c&&X(c,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&r();let l=t.multiElement?t.multiElement:t.newElement?.type==="freedraw"?t.newElement:null;if(l){if(l.type!=="freedraw"&&t.lastPointerDownWith!=="touch"){let{points:p,lastCommittedPoint:U}=l;(!U||p[p.length-1]!==U)&&X(l,{points:l.points.slice(0,-1)})}Fr(l)&&(d=d.filter(p=>p.id!==l.id));let f=si(l.points,t.zoom.value);if((l.type==="line"||l.type==="freedraw")&&f){let p=l.points,U=p[0];X(l,{points:p.map((m,g)=>g===p.length-1?E(U[0],U[1]):m)})}if(_a(l)&&!f&&l.points.length>1){let[p,U]=J.getPointAtIndexGlobalCoordinates(l,-1,oe(e));Af(l,t,{x:p,y:U},o,e)}}(!t.activeTool.locked&&t.activeTool.type!=="freedraw"||!l)&&Kn(i);let u;return t.activeTool.type==="eraser"?u=Et(t,{...t.activeTool.lastActiveTool||{type:"selection"},lastActiveToolBeforeEraser:null}):u=Et(t,{type:"selection"}),{elements:d,appState:{...t,cursorButton:"up",activeTool:(t.activeTool.locked||t.activeTool.type==="freedraw")&&l?t.activeTool:u,activeEmbeddable:null,newElement:null,selectionElement:null,multiElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:l&&!t.activeTool.locked&&t.activeTool.type!=="freedraw"?{...t.selectedElementIds,[l.id]:!0}:t.selectedElementIds,selectedLinearElement:l&&ue(l)?new J(l):t.selectedLinearElement,pendingImageElementId:null},captureUpdate:B.IMMEDIATELY}},keyTest:(e,t)=>e.key===D.ESCAPE&&(t.editingLinearElement!==null||!t.newElement&&t.multiElement===null)||(e.key===D.ESCAPE||e.key===D.ENTER)&&t.multiElement!==null,PanelComponent:({appState:e,updateData:t,data:n})=>h.jsx(Ce,{type:"button",icon:uM,title:S("buttons.done"),"aria-label":S("buttons.done"),onClick:t,visible:e.multiElement!=null,size:n?.size||"medium",style:{pointerEvents:"all"}})}),R$=e=>{let{id:t}=za(),[n,a]=C.useState(e.value),i=s=>{e.ignoreFocus||dk(s.target);let o=s.target.value;o!==e.value&&e.onChange(o)},r=s=>{if(s.key===D.ENTER){if(s.preventDefault(),s.nativeEvent.isComposing||s.keyCode===229)return;s.currentTarget.blur()}};return h.jsxs("div",{className:"ProjectName",children:[h.jsx("label",{className:"ProjectName-label",htmlFor:"filename",children:`${e.label}:`}),h.jsx("input",{type:"text",className:"TextInput",onBlur:i,onKeyDown:r,id:`${t}-filename`,value:n,onChange:s=>a(s.target.value)})]})},P$=e=>{let t=e.title||(e.value===Me.DARK?S("buttons.lightMode"):S("buttons.darkMode"));return h.jsx(Ce,{type:"icon",icon:e.value===Me.LIGHT?fg.MOON:fg.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===Me.DARK?Me.LIGHT:Me.DARK),"data-testid":"toggle-dark-mode"})},fg={SUN:h.jsx("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:h.jsx("path",{fill:"currentColor",d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"})}),MOON:h.jsx("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:h.jsx("path",{fill:"currentColor",d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"})})},ju=(e,{selectedElementIds:t},n)=>{e=Ve(e);let a=n&&_t(e,{selectedElementIds:t}),i=null,r=a?xe(e,{selectedElementIds:t},{includeBoundTextElement:!0}):e;return a&&(r.length===1&&de(r[0])?(i=r[0],r=T0(e,i)):r.length>1&&(r=xe(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}))),{exportingFrame:i,exportedElements:ti(r)}},Au=async(e,t,n,a,{exportBackground:i,exportPadding:r=Bs,viewBackgroundColor:s,name:o=n.name||E5,fileHandle:d=null,exportingFrame:c=null})=>{if(t.length===0)throw new Error(S("alerts.cannotExportEmptyCanvas"));if(e==="svg"||e==="clipboard-svg"){let u=U0(t,{exportBackground:i,exportWithDarkMode:n.exportWithDarkMode,viewBackgroundColor:s,exportPadding:r,exportScale:n.exportScale,exportEmbedScene:n.exportEmbedScene&&e==="svg"},a,{exportingFrame:c});if(e==="svg")return kc(u.then(f=>new Blob([f.outerHTML],{type:ae.svg})),{description:"Export to SVG",name:o,extension:n.exportEmbedScene?"excalidraw.svg":"svg",mimeTypes:[ks.svg],fileHandle:d});if(e==="clipboard-svg"){let f=await u.then(p=>p.outerHTML);try{await Vs(f)}catch{throw new Error(S("errors.copyToSystemClipboardFailed"))}return}}let l=P8(t,n,a,{exportBackground:i,viewBackgroundColor:s,exportPadding:r,exportingFrame:c});if(e==="png"){let u=xo(l);return n.exportEmbedScene&&(u=u.then(f=>ne(async()=>{const{encodePngMetadata:p}=await Promise.resolve().then(()=>_x);return{encodePngMetadata:p}},void 0).then(({encodePngMetadata:p})=>p({blob:f,metadata:Po(t,n,a,"local")})))),kc(u,{description:"Export to PNG",name:o,extension:n.exportEmbedScene?"excalidraw.png":"png",mimeTypes:[ks.png],fileHandle:d})}else if(e==="clipboard")try{let u=xo(l);await W8(u)}catch(u){throw console.warn(u),u.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(S("canvasError.canvasTooBig")):ao&&u.name==="TypeError"?new Error(`${S("alerts.couldNotCopyToClipboard")}
54
+
55
+ ${S("hints.firefox_clipboard_write")}`):new Error(S("alerts.couldNotCopyToClipboard"))}else throw new Error("Unsupported export type")},N$=async(e,t,n,a)=>{let{exportBackground:i,viewBackgroundColor:r,fileHandle:s}=t,o=p7(s);if(!s||!QR(o))throw new Error("fileHandle should exist and should be of type svg or png when resaving");t={...t,exportEmbedScene:!0};let{exportedElements:d,exportingFrame:c}=ju(e,t,!1);return await Au(o,d,t,n,{exportBackground:i,viewBackgroundColor:r,name:a,fileHandle:s,exportingFrame:c}),{fileHandle:s}},lp=({children:e,checked:t,onChange:n,className:a})=>h.jsxs("div",{className:te("Checkbox",a,{"is-checked":t}),onClick:i=>{n(!t,i),i.currentTarget.querySelector(".Checkbox-box").focus()},children:[h.jsx("button",{type:"button",className:"Checkbox-box",role:"checkbox","aria-checked":t,children:sM}),h.jsx("div",{className:"Checkbox-label",children:e})]}),O$=G({name:"changeProjectName",label:"labels.fileTitle",trackEvent:!1,perform:(e,t,n)=>({appState:{...t,name:n},captureUpdate:B.EVENTUALLY}),PanelComponent:({appState:e,updateData:t,appProps:n,data:a,app:i})=>h.jsx(R$,{label:S("labels.fileTitle"),value:i.getName(),onChange:r=>t(r),ignoreFocus:a?.ignoreFocus??!1})}),$$=G({name:"changeExportScale",label:"imageExportDialog.scale",trackEvent:{category:"export",action:"scale"},perform:(e,t,n)=>({appState:{...t,exportScale:n},captureUpdate:B.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>{let a=Ve(e),i=_t(a,t)?xe(a,t):a;return h.jsx(h.Fragment,{children:R1.map(r=>{let[s,o]=OL(i,Bs,r),d=`${S("imageExportDialog.label.scale")} ${r}x (${s}x${o})`;return h.jsx(Ce,{size:"small",type:"radio",icon:`${r}x`,name:"export-canvas-scale",title:d,"aria-label":d,id:"export-canvas-scale",checked:r===t.exportScale,onChange:()=>n(r)},r)})})}}),F$=G({name:"changeExportBackground",label:"imageExportDialog.label.withBackground",trackEvent:{category:"export",action:"toggleBackground"},perform:(e,t,n)=>({appState:{...t,exportBackground:n},captureUpdate:B.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>h.jsx(lp,{checked:e.exportBackground,onChange:n=>t(n),children:S("imageExportDialog.label.withBackground")})}),B4=G({name:"changeExportEmbedScene",label:"imageExportDialog.tooltip.embedScene",trackEvent:{category:"export",action:"embedScene"},perform:(e,t,n)=>({appState:{...t,exportEmbedScene:n},captureUpdate:B.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>h.jsxs(lp,{checked:e.exportEmbedScene,onChange:n=>t(n),children:[S("imageExportDialog.label.embedScene"),h.jsx(Br,{label:S("imageExportDialog.tooltip.embedScene"),long:!0,children:h.jsx("div",{className:"excalidraw-tooltip-icon",children:hM})})]})}),pg=G({name:"saveToActiveFile",label:"buttons.save",icon:nu,trackEvent:{category:"export"},predicate:(e,t,n,a)=>!!a.props.UIOptions.canvasActions.saveToActiveFile&&!!t.fileHandle&&!t.viewModeEnabled,perform:async(e,t,n,a)=>{let i=!!t.fileHandle;try{let{fileHandle:r}=$0(t.fileHandle)?await N$(e,t,a.files,a.getName()):await y8(e,t,a.files,a.getName());return{captureUpdate:B.EVENTUALLY,appState:{...t,fileHandle:r,toast:i?{message:r?.name?S("toast.fileSavedToFilename").replace("{filename}",`"${r.name}"`):S("toast.fileSaved")}:null}}}catch(r){return r?.name!=="AbortError"?console.error(r):console.warn(r),{captureUpdate:B.EVENTUALLY}}},keyTest:e=>e.key===D.S&&e[D.CTRL_OR_CMD]&&!e.shiftKey}),H4=G({name:"saveFileToDisk",label:"exportDialog.disk_title",icon:nu,viewMode:!0,trackEvent:{category:"export"},perform:async(e,t,n,a)=>{try{let{fileHandle:i}=await y8(e,{...t,fileHandle:null},a.files,a.getName());return{captureUpdate:B.EVENTUALLY,appState:{...t,openDialog:null,fileHandle:i,toast:{message:S("toast.fileSaved")}}}}catch(i){return i?.name!=="AbortError"?console.error(i):console.warn(i),{captureUpdate:B.EVENTUALLY}}},keyTest:e=>e.key===D.S&&e.shiftKey&&e[D.CTRL_OR_CMD],PanelComponent:({updateData:e})=>h.jsx(Ce,{type:"button",icon:oM,title:S("buttons.saveAs"),"aria-label":S("buttons.saveAs"),showAriaLabel:Tt().editor.isMobile,hidden:!Wr,onClick:()=>e(null),"data-testid":"save-as-button"})}),d1=G({name:"loadScene",label:"buttons.load",trackEvent:{category:"export"},predicate:(e,t,n,a)=>!!a.props.UIOptions.canvasActions.loadScene&&!t.viewModeEnabled,perform:async(e,t,n,a)=>{try{let{elements:i,appState:r,files:s}=await IL(t,e);return{elements:i,appState:r,files:s,captureUpdate:B.IMMEDIATELY}}catch(i){return i?.name==="AbortError"?(console.warn(i),!1):{elements:e,appState:{...t,errorMessage:i.message},files:a.files,captureUpdate:B.EVENTUALLY}}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.O}),z$=G({name:"exportWithDarkMode",label:"imageExportDialog.label.darkMode",trackEvent:{category:"export",action:"toggleTheme"},perform:(e,t,n)=>({appState:{...t,exportWithDarkMode:n},captureUpdate:B.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>h.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:h.jsx(P$,{value:e.exportWithDarkMode?Me.DARK:Me.LIGHT,onChange:n=>{t(n===Me.DARK)},title:S("imageExportDialog.label.darkMode")})})}),X4="{}",B$=G({name:"copyStyles",label:"labels.copyStyles",icon:db,trackEvent:{category:"element"},perform:(e,t,n,a)=>{let i=[],r=e.find(s=>t.selectedElementIds[s.id]);if(i.push(r),r&&Hn(r)){let s=ge(r,a.scene.getNonDeletedElementsMap());i.push(s)}return r&&(X4=JSON.stringify(i)),{appState:{...t,toast:{message:S("toast.copyStyles")}},captureUpdate:B.EVENTUALLY}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Te.C}),H$=G({name:"pasteStyles",label:"labels.pasteStyles",icon:db,trackEvent:{category:"element"},perform:(e,t,n,a)=>{let i=JSON.parse(X4),r=i[0],s=i[1];if(!B5(r))return{elements:e,captureUpdate:B.EVENTUALLY};let o=xe(e,t,{includeBoundTextElement:!0}),d=o.map(c=>c.id);return{elements:e.map(c=>{if(d.includes(c.id)){let l=r;if(q(c)&&c.containerId&&(l=s),!l)return c;let u=pe(c,{backgroundColor:l?.backgroundColor,strokeWidth:l?.strokeWidth,strokeColor:l?.strokeColor,strokeStyle:l?.strokeStyle,fillStyle:l?.fillStyle,opacity:l?.opacity,roughness:l?.roughness,roundness:l.roundness?yk(l.roundness.type,c)?l.roundness:wk(c):null});if(q(u)){let f=l.fontSize||pi,p=l.fontFamily||qi;u=pe(u,{fontSize:f,fontFamily:p,textAlign:l.textAlign||Io,lineHeight:l.lineHeight||Nr(p)});let U=null;u.containerId&&(U=o.find(m=>q(u)&&m.id===u.containerId)||null),ln(u,U,a.scene.getNonDeletedElementsMap())}return u.type==="arrow"&&ve(l)&&(u=pe(u,{startArrowhead:l.startArrowhead,endArrowhead:l.endArrowhead})),de(c)&&(u=pe(u,{roundness:null,backgroundColor:"transparent"})),u}return c}),captureUpdate:B.IMMEDIATELY}},keyTest:e=>e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Te.V});G({name:"toggleCanvasMenu",label:"buttons.menu",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="canvas"?null:"canvas"},captureUpdate:B.EVENTUALLY}),PanelComponent:({appState:e,updateData:t})=>h.jsx(Ce,{type:"button",icon:Y5,"aria-label":S("buttons.menu"),onClick:t,selected:e.openMenu==="canvas"})});G({name:"toggleEditMenu",label:"buttons.edit",trackEvent:{category:"menu"},perform:(e,t)=>({appState:{...t,openMenu:t.openMenu==="shape"?null:"shape"},captureUpdate:B.EVENTUALLY}),PanelComponent:({elements:e,appState:t,updateData:n})=>h.jsx(Ce,{visible:N0(t,Ve(e)),type:"button",icon:dM,"aria-label":S("buttons.edit"),onClick:n,selected:t.openMenu==="shape"})});var op=G({name:"toggleShortcuts",label:"welcomeScreen.defaults.helpHint",icon:aM,viewMode:!0,trackEvent:{category:"menu",action:"toggleHelpDialog"},perform:(e,t,n,{focusContainer:a})=>(t.openDialog?.name==="help"&&a(),{appState:{...t,openDialog:t.openDialog?.name==="help"?null:{name:"help"}},captureUpdate:B.EVENTUALLY}),keyTest:e=>e.key===D.QUESTION_MARK}),X$=e=>{if(e.length>=2){let t=e[0].groupIds;for(let n of t)if(e.reduce((a,i)=>a&&po(i,n),!0))return!0}return!1},Ug=(e,t,n)=>{let a=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});return a.length>=2&&!X$(a)&&!t7(a)},W$=G({name:"group",label:"labels.group",icon:e=>h.jsx(m2,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,n,a)=>{let i=_0(a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}));if(i.length<2)return{appState:t,elements:e,captureUpdate:B.EVENTUALLY};let r=Er(t);if(r.length===1){let m=r[0],g=new Set(tt(e,m).map(v=>v.id)),b=new Set(i.map(v=>v.id));if(new Set([...Array.from(g),...Array.from(b)]).size===g.size)return{appState:t,elements:e,captureUpdate:B.EVENTUALLY}}let s=[...e];new Set(i.map(m=>m.frameId)).size>1&&MR(i).forEach((m,g)=>{xu(m,a.scene.getNonDeletedElementsMap())});let o=Xn(),d=oe(i);s=s.map(m=>d.get(m.id)?pe(m,{groupIds:PD(m.groupIds,o,t.editingGroupId)}):m);let c=tt(s,o),l=c[c.length-1],u=s.lastIndexOf(l),f=s.slice(u+1),p=s.slice(0,u).filter(m=>!po(m,o)),U=Na([...p,...c,...f],oe(c));return{appState:{...t,...Jb(o,{...t,selectedGroupIds:{}},Ve(s))},elements:U,captureUpdate:B.IMMEDIATELY}},predicate:(e,t,n,a)=>Ug(e,t,a),keyTest:e=>!e.shiftKey&&e[D.CTRL_OR_CMD]&&e.key===D.G,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>h.jsx(Ce,{hidden:!Ug(e,t,a),type:"button",icon:h.jsx(m2,{theme:t.theme}),onClick:()=>n(null),title:`${S("labels.group")} — ${H("CtrlOrCmd+G")}`,"aria-label":S("labels.group"),visible:_t(Ve(e),t)})}),V$=G({name:"ungroup",label:"labels.ungroup",icon:e=>h.jsx(g2,{theme:e.theme}),trackEvent:{category:"element"},perform:(e,t,n,a)=>{let i=Er(t),r=oe(e);if(i.length===0)return{appState:t,elements:e,captureUpdate:B.EVENTUALLY};let s=[...e],o=[];s=s.map(u=>{nt(u)&&o.push(u.id);let f=ND(u.groupIds,t.selectedGroupIds);return f.length===u.groupIds.length?u:pe(u,{groupIds:f})});let d=sn(t,Ve(s),t,null),c=a.scene.getSelectedElements(t),l=new Set(c.filter(u=>u.frameId).map(u=>u.frameId));return I0(e).filter(u=>l.has(u.id)).forEach(u=>{u&&(s=Q8(s,Fd(s,u,t,r),u,a))}),d.selectedElementIds=Object.entries(d.selectedElementIds).reduce((u,[f,p])=>(p&&!o.includes(f)&&(u[f]=!0),u),{}),{appState:{...t,...d},elements:s,captureUpdate:B.IMMEDIATELY}},keyTest:e=>e.shiftKey&&e[D.CTRL_OR_CMD]&&e.key===D.G.toUpperCase(),predicate:(e,t)=>Er(t).length>0,PanelComponent:({elements:e,appState:t,updateData:n})=>h.jsx(Ce,{type:"button",hidden:Er(t).length===0,icon:h.jsx(g2,{theme:t.theme}),onClick:()=>n(null),title:`${S("labels.ungroup")} — ${H("CtrlOrCmd+Shift+G")}`,"aria-label":S("labels.ungroup"),visible:_t(Ve(e),t)})}),W4=(e,t,n,a,i,r,s)=>{e.beginPath(),e.moveTo(t+r,n),e.lineTo(t+a-r,n),e.quadraticCurveTo(t+a,n,t+a,n+r),e.lineTo(t+a,n+i-r),e.quadraticCurveTo(t+a,n+i,t+a-r,n+i),e.lineTo(t+r,n+i),e.quadraticCurveTo(t,n+i,t,n+i-r),e.lineTo(t,n+r),e.quadraticCurveTo(t,n,t+r,n),e.closePath(),e.fill(),s&&(e.strokeStyle=s),e.stroke()};function G$(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){let a=e.charCodeAt(n);t=(t<<5)-t+a}return t}var Du=(e,t)=>`hsl(${Math.abs(G$(t?.id||e))%37*10}, 100%, 83%)`,Z$=e=>{let t=e?.trim()?.codePointAt(0);return(t?String.fromCodePoint(t):"?").toUpperCase()},Y$=({context:e,renderConfig:t,appState:n,normalizedWidth:a,normalizedHeight:i})=>{for(let[r,s]of t.remotePointerViewportCoords){let{x:o,y:d}=s,c=n.collaborators.get(r);o-=n.offsetLeft,d-=n.offsetTop;let l=11,u=14,f=o<0||o>a-l||d<0||d>i-u;o=Math.max(o,0),o=Math.min(o,a-l),d=Math.max(d,0),d=Math.min(d,i-u);let p=Du(r,c);e.save(),e.strokeStyle=p,e.fillStyle=p;let U=t.remotePointerUserStates.get(r),m=f||U==="idle"||U==="away";m&&(e.globalAlpha=.3),t.remotePointerButton.get(r)==="down"&&(e.beginPath(),e.arc(o,d,15,0,2*Math.PI,!1),e.lineWidth=3,e.strokeStyle="#ffffff88",e.stroke(),e.closePath(),e.beginPath(),e.arc(o,d,15,0,2*Math.PI,!1),e.lineWidth=1,e.strokeStyle=p,e.stroke(),e.closePath());let g=n.theme===Me.DARK?"#2f6330":ES,b=c?.isSpeaking;b&&(e.fillStyle=g,e.strokeStyle=g,e.lineWidth=10,e.lineJoin="round",e.beginPath(),e.moveTo(o,d),e.lineTo(o+0,d+14),e.lineTo(o+4,d+9),e.lineTo(o+11,d+8),e.closePath(),e.stroke(),e.fill()),e.fillStyle=id,e.strokeStyle=id,e.lineWidth=6,e.lineJoin="round",e.beginPath(),e.moveTo(o,d),e.lineTo(o+0,d+14),e.lineTo(o+4,d+9),e.lineTo(o+11,d+8),e.closePath(),e.stroke(),e.fill(),e.fillStyle=p,e.strokeStyle=p,e.lineWidth=2,e.lineJoin="round",e.beginPath(),m?(e.moveTo(o-1,d-1),e.lineTo(o-1,d+15),e.lineTo(o+5,d+10),e.lineTo(o+12,d+9),e.closePath(),e.fill()):(e.moveTo(o,d),e.lineTo(o+0,d+14),e.lineTo(o+4,d+9),e.lineTo(o+11,d+8),e.closePath(),e.fill(),e.stroke());let v=t.remotePointerUsernames.get(r)||"";if(!f&&v){e.font="600 12px sans-serif";let x=(b?o+0:o)+l/2,y=(b?d+0:d)+u+2,w=5,k=3,M=e.measureText(v),I=M.actualBoundingBoxDescent+M.actualBoundingBoxAscent,A=Math.max(I,12),_=x-1,T=y-1,L=M.width+2+w*2+2,R=A+2+k*2+2;if(e.roundRect?(e.beginPath(),e.roundRect(_,T,L,R,8),e.fillStyle=p,e.fill(),e.strokeStyle=id,e.stroke(),b&&(e.beginPath(),e.roundRect(_-2,T-2,L+4,R+4,8),e.strokeStyle=g,e.stroke())):W4(e,_,T,L,R,8,id),e.fillStyle=wS,e.fillText(v,x+w+1,y+k+M.actualBoundingBoxAscent+Math.floor((A-I)/2)+2),b){e.fillStyle=g;let F=8,P=8,$=5;e.fillRect(_+L+P,T+(R/2-F/2),2,F),e.fillRect(_+L+P+$,T+(R/2-F*2/2),2,F*2),e.fillRect(_+L+P+$*2,T+(R/2-F/2),2,F)}}e.restore(),e.closePath()}},mg=({color:e,onClick:t,name:n,src:a,className:i})=>{let r=Z$(n),[s,o]=C.useState(!1),d=!s&&a,c=d?void 0:{background:e};return h.jsx("div",{className:te("Avatar",i),style:c,onClick:t,children:d?h.jsx("img",{className:"Avatar-img",src:a,alt:r,referrerPolicy:"no-referrer",onError:()=>o(!0)}):r})};G({name:"goToCollaborator",label:"Go to a collaborator",viewMode:!0,trackEvent:{category:"collab"},perform:(e,t,n)=>!n.socketId||t.userToFollow?.socketId===n.socketId||n.isCurrentUser?{appState:{...t,userToFollow:null},captureUpdate:B.EVENTUALLY}:{appState:{...t,userToFollow:{socketId:n.socketId,username:n.username||""},openMenu:t.openMenu==="canvas"?null:t.openMenu},captureUpdate:B.EVENTUALLY},PanelComponent:({updateData:e,data:t,appState:n})=>{let{socketId:a,collaborator:i,withName:r,isBeingFollowed:s}=t,o=Du(a,i),d=te({"is-followed":s,"is-current-user":i.isCurrentUser===!0,"is-speaking":i.isSpeaking,"is-in-call":i.isInCall,"is-muted":i.isMuted}),c=i.isInCall?i.isSpeaking?h.jsxs("div",{className:"UserList__collaborator-status-icon-speaking-indicator",title:S("userList.hint.isSpeaking"),children:[h.jsx("div",{}),h.jsx("div",{}),h.jsx("div",{})]}):i.isMuted?h.jsx("div",{className:"UserList__collaborator-status-icon-microphone-muted",title:S("userList.hint.micMuted"),children:uC}):h.jsx("div",{title:S("userList.hint.inCall"),children:cC}):null;return r?h.jsxs("div",{className:`dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${d}`,style:{"--avatar-size":"1.5rem"},onClick:()=>e(i),children:[h.jsx(mg,{color:o,onClick:()=>{},name:i.username||"",src:i.avatarUrl,className:d}),h.jsx("div",{className:"UserList__collaborator-name",children:i.username}),h.jsxs("div",{className:"UserList__collaborator-status-icons","aria-hidden":!0,children:[s&&h.jsx("div",{className:"UserList__collaborator-status-icon-is-followed",title:S("userList.hint.followStatus"),children:Z1}),c]})]}):h.jsxs("div",{className:`UserList__collaborator UserList__collaborator--avatar-only ${d}`,children:[h.jsx(mg,{color:o,onClick:()=>{e(i)},name:i.username||"",src:i.avatarUrl,className:d}),c&&h.jsx("div",{className:"UserList__collaborator-status-icon",children:c})]})}});var K$=G({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});for(let r of w5)if(i.some(s=>s.type===r))return{captureUpdate:B.EVENTUALLY,appState:{...t,errorMessage:S(`errors.libraryElementTypeError.${r}`)}};return a.library.getLatestLibrary().then(r=>a.library.setLibrary([{id:Xn(),status:"unpublished",elements:i.map(Gr),created:Date.now()},...r])).then(()=>({captureUpdate:B.EVENTUALLY,appState:{...t,toast:{message:S("toast.addedToLibrary")}}})).catch(r=>({captureUpdate:B.EVENTUALLY,appState:{...t,errorMessage:r.message}}))},label:"labels.addToLibrary"}),q$=(e,t,n,a)=>{let i=hu(e,t),r=oa(e);return i.flatMap(s=>{let o=J$(s,r,n);return s.map(d=>{let c=X(d,{x:d.x+o.x,y:d.y+o.y});return xn(d,a.getNonDeletedElementsMap(),{simultaneouslyUpdated:s}),c})})},J$=(e,t,{axis:n,position:a})=>{let i=oa(e),[r,s]=n==="x"?["minX","maxX"]:["minY","maxY"],o={x:0,y:0};return a==="start"?{...o,[n]:t[r]-i[r]}:a==="end"?{...o,[n]:t[s]-i[s]}:{...o,[n]:(t[r]+t[s])/2-(i[r]+i[s])/2}},In=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length>1&&!n.some(a=>de(a))},Ys=(e,t,n,a)=>{let i=n.scene.getSelectedElements(t),r=oe(e),s=q$(i,r,a,n.scene),o=oe(s);return Ns(e.map(d=>o.get(d.id)||d),t,n)};G({name:"alignTop",label:"labels.alignTop",icon:c2,trackEvent:{category:"element"},predicate:(e,t,n,a)=>In(t,a),perform:(e,t,n,a)=>({appState:t,elements:Ys(e,t,a,{position:"start",axis:"y"}),captureUpdate:B.IMMEDIATELY}),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key===D.ARROW_UP,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>h.jsx(Ce,{hidden:!In(t,a),type:"button",icon:c2,onClick:()=>n(null),title:`${S("labels.alignTop")} — ${H("CtrlOrCmd+Shift+Up")}`,"aria-label":S("labels.alignTop"),visible:_t(Ve(e),t)})});G({name:"alignBottom",label:"labels.alignBottom",icon:u2,trackEvent:{category:"element"},predicate:(e,t,n,a)=>In(t,a),perform:(e,t,n,a)=>({appState:t,elements:Ys(e,t,a,{position:"end",axis:"y"}),captureUpdate:B.IMMEDIATELY}),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key===D.ARROW_DOWN,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>h.jsx(Ce,{hidden:!In(t,a),type:"button",icon:u2,onClick:()=>n(null),title:`${S("labels.alignBottom")} — ${H("CtrlOrCmd+Shift+Down")}`,"aria-label":S("labels.alignBottom"),visible:_t(Ve(e),t)})});G({name:"alignLeft",label:"labels.alignLeft",icon:h2,trackEvent:{category:"element"},predicate:(e,t,n,a)=>In(t,a),perform:(e,t,n,a)=>({appState:t,elements:Ys(e,t,a,{position:"start",axis:"x"}),captureUpdate:B.IMMEDIATELY}),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key===D.ARROW_LEFT,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>h.jsx(Ce,{hidden:!In(t,a),type:"button",icon:h2,onClick:()=>n(null),title:`${S("labels.alignLeft")} — ${H("CtrlOrCmd+Shift+Left")}`,"aria-label":S("labels.alignLeft"),visible:_t(Ve(e),t)})});G({name:"alignRight",label:"labels.alignRight",icon:f2,trackEvent:{category:"element"},predicate:(e,t,n,a)=>In(t,a),perform:(e,t,n,a)=>({appState:t,elements:Ys(e,t,a,{position:"end",axis:"x"}),captureUpdate:B.IMMEDIATELY}),keyTest:e=>e[D.CTRL_OR_CMD]&&e.shiftKey&&e.key===D.ARROW_RIGHT,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>h.jsx(Ce,{hidden:!In(t,a),type:"button",icon:f2,onClick:()=>n(null),title:`${S("labels.alignRight")} — ${H("CtrlOrCmd+Shift+Right")}`,"aria-label":S("labels.alignRight"),visible:_t(Ve(e),t)})});G({name:"alignVerticallyCentered",label:"labels.centerVertically",icon:p2,trackEvent:{category:"element"},predicate:(e,t,n,a)=>In(t,a),perform:(e,t,n,a)=>({appState:t,elements:Ys(e,t,a,{position:"center",axis:"y"}),captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>h.jsx(Ce,{hidden:!In(t,a),type:"button",icon:p2,onClick:()=>n(null),title:S("labels.centerVertically"),"aria-label":S("labels.centerVertically"),visible:_t(Ve(e),t)})});G({name:"alignHorizontallyCentered",label:"labels.centerHorizontally",icon:U2,trackEvent:{category:"element"},predicate:(e,t,n,a)=>In(t,a),perform:(e,t,n,a)=>({appState:t,elements:Ys(e,t,a,{position:"center",axis:"x"}),captureUpdate:B.IMMEDIATELY}),PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>h.jsx(Ce,{hidden:!In(t,a),type:"button",icon:U2,onClick:()=>n(null),title:S("labels.centerHorizontally"),"aria-label":S("labels.centerHorizontally"),visible:_t(Ve(e),t)})});var Q$=(e,t,n)=>{let[a,i,r,s]=n.axis==="x"?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],o=oa(e),d=hu(e,t).map(f=>[f,oa(f)]).sort((f,p)=>f[1][i]-p[1][i]),c=0;for(let f of d)c+=f[1][s];let l=(o[s]-c)/(d.length-1);if(l<0){let f=d.findIndex(g=>g[1][a]===o[a]),p=d.findIndex(g=>g[1][r]===o[r]),U=(d[p][1][i]-d[f][1][i])/(d.length-1),m=d[f][1][i];return d.flatMap(([g,b],v)=>{let x={x:0,y:0};return v!==f&&v!==p&&(m+=U,x[n.axis]=m-b[i]),g.map(y=>pe(y,{x:y.x+x.x,y:y.y+x.y}))})}let u=o[a];return d.flatMap(([f,p])=>{let U={x:0,y:0};return U[n.axis]=u-p[a],u+=l,u+=p[s],f.map(m=>pe(m,{x:m.x+U.x,y:m.y+U.y}))})},V4=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length>1&&!n.some(a=>de(a))},G4=(e,t,n,a)=>{let i=n.scene.getSelectedElements(t),r=Q$(i,n.scene.getNonDeletedElementsMap(),a),s=oe(r);return Ns(e.map(o=>s.get(o.id)||o),t,n)};G({name:"distributeHorizontally",label:"labels.distributeHorizontally",trackEvent:{category:"element"},perform:(e,t,n,a)=>({appState:t,elements:G4(e,t,a,{axis:"x"}),captureUpdate:B.IMMEDIATELY}),keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Te.H,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>h.jsx(Ce,{hidden:!V4(t,a),type:"button",icon:pM,onClick:()=>n(null),title:`${S("labels.distributeHorizontally")} — ${H("Alt+H")}`,"aria-label":S("labels.distributeHorizontally"),visible:_t(Ve(e),t)})});G({name:"distributeVertically",label:"labels.distributeVertically",trackEvent:{category:"element"},perform:(e,t,n,a)=>({appState:t,elements:G4(e,t,a,{axis:"y"}),captureUpdate:B.IMMEDIATELY}),keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Te.V,PanelComponent:({elements:e,appState:t,updateData:n,app:a})=>h.jsx(Ce,{hidden:!V4(t,a),type:"button",icon:UM,onClick:()=>n(null),title:`${S("labels.distributeVertically")} — ${H("Alt+V")}`,"aria-label":S("labels.distributeVertically"),visible:_t(Ve(e),t)})});var eF=G({name:"flipHorizontal",label:"labels.flipHorizontal",icon:UC,trackEvent:{category:"element"},perform:(e,t,n,a)=>({elements:Ns(Z4(e,a.scene.getNonDeletedElementsMap(),t,"horizontal",a),t,a),appState:t,captureUpdate:B.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===Te.H}),tF=G({name:"flipVertical",label:"labels.flipVertical",icon:pC,trackEvent:{category:"element"},perform:(e,t,n,a)=>({elements:Ns(Z4(e,a.scene.getNonDeletedElementsMap(),t,"vertical",a),t,a),appState:t,captureUpdate:B.IMMEDIATELY}),keyTest:e=>e.shiftKey&&e.code===Te.V&&!e[D.CTRL_OR_CMD]}),Z4=(e,t,n,a,i)=>{let r=xe(Ve(e),n,{includeBoundTextElement:!0,includeElementsInFrames:!0}),s=nF(r,t,n,a,i),o=oe(s);return e.map(d=>o.get(d.id)||d)},nF=(e,t,n,a,i)=>{if(e.every(p=>ve(p)&&(p.startBinding||p.endBinding)))return e.map(p=>{let U=p;return pe(U,{startArrowhead:U.endArrowhead,endArrowhead:U.startArrowhead})});let{midX:r,midY:s}=oa(e);d7(e,t,"nw",i.scene,new Map(Array.from(t.values()).map(p=>[p.id,Gr(p)])),{flipByX:a==="horizontal",flipByY:a==="vertical",shouldResizeFromCenter:!0,shouldMaintainAspectRatio:!0}),xc(e.filter(ue),t,i.scene.getNonDeletedElements(),i.scene,gr(n),[],n.zoom);let{elbowArrows:o,otherElements:d}=e.reduce((p,U)=>Q(U)?{...p,elbowArrows:p.elbowArrows.concat(U)}:{...p,otherElements:p.otherElements.concat(U)},{elbowArrows:[],otherElements:[]}),{midX:c,midY:l}=oa(e),[u,f]=[r-c,s-l];return d.forEach(p=>X(p,{x:p.x+u,y:p.y+f})),o.forEach(p=>X(p,{x:p.x+u,y:p.y+f})),e},Wd=G({name:"copy",label:"labels.copy",icon:yf,trackEvent:{category:"element"},perform:async(e,t,n,a)=>{let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});try{await B8(i,a.files,n)}catch(r){return{captureUpdate:B.EVENTUALLY,appState:{...t,errorMessage:r.message}}}return{captureUpdate:B.EVENTUALLY}},keyTest:void 0}),gg=G({name:"paste",label:"labels.paste",trackEvent:{category:"element"},perform:async(e,t,n,a)=>{let i;try{i=await gR()}catch(r){return r.name==="AbortError"||r.name==="NotAllowedError"?!1:(console.error(`actionPaste ${r.name}: ${r.message}`),ao?{captureUpdate:B.EVENTUALLY,appState:{...t,errorMessage:S("hints.firefox_clipboard_write")}}:{captureUpdate:B.EVENTUALLY,appState:{...t,errorMessage:S("errors.asyncPasteFailedOnRead")}})}try{a.pasteFromClipboard(fR({types:i}))}catch(r){return console.error(r),{captureUpdate:B.EVENTUALLY,appState:{...t,errorMessage:S("errors.asyncPasteFailedOnParse")}}}return{captureUpdate:B.EVENTUALLY}},keyTest:void 0}),bg=G({name:"cut",label:"labels.cut",icon:QM,trackEvent:{category:"element"},perform:(e,t,n,a)=>(Wd.perform(e,t,n,a),x4.perform(e,t,null,a)),keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.X}),xg=G({name:"copyAsSvg",label:"labels.copyAsSvg",icon:mC,trackEvent:{category:"element"},perform:async(e,t,n,a)=>{if(!a.canvas)return{captureUpdate:B.EVENTUALLY};let{exportedElements:i,exportingFrame:r}=ju(e,t,!0);try{await Au("clipboard-svg",i,t,a.files,{...t,exportingFrame:r,name:a.getName()});let s=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});return{appState:{toast:{message:S("toast.copyToClipboardAsSvg",{exportSelection:s.length?S("toast.selection"):S("toast.canvas"),exportColorScheme:t.exportWithDarkMode?S("buttons.darkMode"):S("buttons.lightMode")})}},captureUpdate:B.EVENTUALLY}}catch(s){return console.error(s),{appState:{errorMessage:s.message},captureUpdate:B.EVENTUALLY}}},predicate:e=>S0&&e.length>0,keywords:["svg","clipboard","copy"]}),vg=G({name:"copyAsPng",label:"labels.copyAsPng",icon:gC,trackEvent:{category:"element"},perform:async(e,t,n,a)=>{if(!a.canvas)return{captureUpdate:B.EVENTUALLY};let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),{exportedElements:r,exportingFrame:s}=ju(e,t,!0);try{return await Au("clipboard",r,t,a.files,{...t,exportingFrame:s,name:a.getName()}),{appState:{...t,toast:{message:S("toast.copyToClipboardAsPng",{exportSelection:i.length?S("toast.selection"):S("toast.canvas"),exportColorScheme:t.exportWithDarkMode?S("buttons.darkMode"):S("buttons.lightMode")})}},captureUpdate:B.EVENTUALLY}}catch(o){return console.error(o),{appState:{...t,errorMessage:o.message},captureUpdate:B.EVENTUALLY}}},predicate:e=>k0&&e.length>0,keyTest:e=>e.code===Te.C&&e.altKey&&e.shiftKey,keywords:["png","clipboard","copy"]}),yg=G({name:"copyText",label:"labels.copyText",trackEvent:{category:"element"},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0});try{Vs(s8(i))}catch{throw new Error(S("errors.copyToSystemClipboardFailed"))}return{captureUpdate:B.EVENTUALLY}},predicate:(e,t,n,a)=>S0&&a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0}).some(q),keywords:["text","clipboard","copy"]}),wg=G({name:"gridMode",icon:wC,keywords:["snap"],label:"labels.toggleGrid",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>e.gridModeEnabled},perform(e,t){return{appState:{...t,gridModeEnabled:!this.checked(t),objectsSnapModeEnabled:!1},captureUpdate:B.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[D.CTRL_OR_CMD]&&e.code===Te.QUOTE}),c1=G({name:"zenMode",label:"buttons.zenMode",icon:xC,paletteName:"Toggle zen mode",viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.zenModeEnabled},perform(e,t){return{appState:{...t,zenModeEnabled:!this.checked(t)},captureUpdate:B.EVENTUALLY}},checked:e=>e.zenModeEnabled,predicate:(e,t,n)=>typeof n.zenModeEnabled>"u",keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Te.Z}),aF=G({name:"objectsSnapMode",label:"buttons.objectsSnapMode",icon:bC,viewMode:!1,trackEvent:{category:"canvas",predicate:e=>!e.objectsSnapModeEnabled},perform(e,t){return{appState:{...t,objectsSnapModeEnabled:!this.checked(t),gridModeEnabled:!1},captureUpdate:B.EVENTUALLY}},checked:e=>e.objectsSnapModeEnabled,predicate:(e,t,n)=>typeof n.objectsSnapModeEnabled>"u",keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Te.S}),u1=G({name:"stats",label:"stats.fullTitle",icon:fC,paletteName:"Toggle stats",viewMode:!0,trackEvent:{category:"menu"},keywords:["edit","attributes","customize"],perform(e,t){return{appState:{...t,stats:{...t.stats,open:!this.checked(t)}},captureUpdate:B.EVENTUALLY}},checked:e=>e.stats.open,keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Te.SLASH}),iF=G({name:"unbindText",label:"labels.unbindText",trackEvent:{category:"element"},predicate:(e,t,n,a)=>a.scene.getSelectedElements(t).some(i=>Hn(i)),perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t),r=a.scene.getNonDeletedElementsMap();return i.forEach(s=>{let o=ge(s,r);if(o){let{width:d,height:c}=nn(o.originalText,Xe(o),o.lineHeight),l=KD(s.id);i8(s.id);let{x:u,y:f}=pu(s,o,r);X(o,{containerId:null,width:d,height:c,text:o.originalText,x:u,y:f}),X(s,{boundElements:s.boundElements?.filter(p=>p.id!==o.id),height:l||s.height})}}),{elements:e,appState:t,captureUpdate:B.IMMEDIATELY}}}),rF=G({name:"bindText",label:"labels.bindText",trackEvent:{category:"element"},predicate:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t);if(i.length===2){let r=q(i[0])||q(i[1]),s;if(wr(i[0])?s=i[0]:wr(i[1])&&(s=i[1]),r&&s&&ge(s,a.scene.getNonDeletedElementsMap())===null)return!0}return!1},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t),r,s;q(i[0])&&wr(i[1])?(r=i[0],s=i[1]):(r=i[1],s=i[0]),X(r,{containerId:s.id,verticalAlign:Mn.MIDDLE,textAlign:ro.CENTER,autoResize:!0}),X(s,{boundElements:(s.boundElements||[]).concat({type:"text",id:r.id})});let o=s.height;return ln(r,s,a.scene.getNonDeletedElementsMap()),yc(s.id,o),{elements:sF(e,s,r),appState:{...t,selectedElementIds:{[s.id]:!0}},captureUpdate:B.IMMEDIATELY}}}),sF=(e,t,n)=>{let a=e.slice(),i=a.findIndex(s=>s.id===n.id);a.splice(i,1);let r=a.findIndex(s=>s.id===t.id);return a.splice(r+1,0,n),Na(a,oe([t,n])),a},lF=(e,t,n)=>{let a=e.slice(),i=a.findIndex(s=>s.id===t.id);a.splice(i,1);let r=a.findIndex(s=>s.id===n.id);return a.splice(r,0,t),Na(a,oe([t,n])),a},oF=G({name:"wrapTextInContainer",label:"labels.createContainerFromText",trackEvent:{category:"element"},predicate:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t),r=i.every(s=>q(s));return i.length>0&&r},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t),r=e.slice(),s={};for(let o of i)if(q(o)){let d=Pa({type:"rectangle",backgroundColor:t.currentItemBackgroundColor,boundElements:[...o.boundElements||[],{id:o.id,type:"text"}],angle:o.angle,fillStyle:t.currentItemFillStyle,strokeColor:t.currentItemStrokeColor,roughness:t.currentItemRoughness,strokeWidth:t.currentItemStrokeWidth,strokeStyle:t.currentItemStrokeStyle,roundness:t.currentItemRoundness==="round"?{type:Xs("rectangle")?St.ADAPTIVE_RADIUS:St.PROPORTIONAL_RADIUS}:null,opacity:100,locked:!1,x:o.x-It,y:o.y-It,width:$r(o.width,"rectangle"),height:$r(o.height,"rectangle"),groupIds:o.groupIds,frameId:o.frameId});if(o.boundElements?.length){let c=o.boundElements.filter(l=>l.type==="arrow").map(l=>l.id);r.filter(l=>c.includes(l.id)).forEach(l=>{let u=l.startBinding,f=l.endBinding;u?.elementId===o.id&&(u={...u,elementId:d.id}),f?.elementId===o.id&&(f={...f,elementId:d.id}),(u||f)&&X(l,{startBinding:u,endBinding:f},!1)})}X(o,{containerId:d.id,verticalAlign:Mn.MIDDLE,boundElements:null,textAlign:ro.CENTER,autoResize:!0},!1),ln(o,d,a.scene.getNonDeletedElementsMap()),r=lF([...r,d],d,o),s[d.id]=!0}return{elements:r,appState:{...t,selectedElementIds:s},captureUpdate:B.IMMEDIATELY}}}),dp=380,dF=42,h1=5,Y4=85,cF=500,f1=!1,Ud=new Map,uF=({element:e,elementsMap:t,setAppState:n,onLinkOpen:a,setToast:i,updateEmbedValidationStatus:r})=>{let s=Vo(),o=Wo(),d=Tt(),c=e.link||"",[l,u]=C.useState(c),f=C.useRef(null),p=s.showHyperlinkPopup==="editor",U=C.useCallback(()=>{if(!f.current)return;let x=vn(f.current.value)||null;if(!e.link&&x&&qe("hyperlink","create"),pn(e)){if(s.activeEmbeddable?.element===e&&n({activeEmbeddable:null}),!x){X(e,{link:null}),r(e,!1);return}if(!Od(x,o.validateEmbeddable))x&&i({message:S("toast.unableToEmbed"),closable:!0}),e.link&&Ud.set(e.id,e.link),X(e,{link:x}),r(e,!1);else{let{width:y,height:w}=e,k=Us(x);k?.error instanceof URIError&&i({message:S("toast.unrecognizedLinkFormat"),closable:!0});let M=k?k.intrinsicSize.w/k.intrinsicSize.h:1,I=Ud.get(e.id)!==e.link;X(e,{...I?{width:k?.type==="video"?y>w?y:w*M:y,height:k?.type==="video"&&y>w?y/M:w}:{},link:x}),r(e,!0),Ud.has(e.id)&&Ud.delete(e.id)}}else X(e,{link:x})},[e,i,o.validateEmbeddable,s.activeEmbeddable,n,r]);C.useLayoutEffect(()=>()=>{U()},[U]),C.useEffect(()=>{p&&f?.current&&!(d.viewport.isMobile||d.isTouchScreen)&&f.current.select()},[p,d.viewport.isMobile,d.isTouchScreen]),C.useEffect(()=>{let x=null,y=w=>{p||(x&&clearTimeout(x),pF(e,t,s,E(w.clientX,w.clientY))&&(x=window.setTimeout(()=>{n({showHyperlinkPopup:!1})},cF)))};return window.addEventListener("pointermove",y,!1),()=>{window.removeEventListener("pointermove",y,!1),x&&clearTimeout(x)}},[s,e,p,n,t]);let m=C.useCallback(()=>{qe("hyperlink","delete"),X(e,{link:null}),n({showHyperlinkPopup:!1})},[n,e]),g=()=>{qe("hyperlink","edit","popup-ui"),n({showHyperlinkPopup:"editor"})},{x:b,y:v}=K4(e,s,t);return s.contextMenu||s.selectedElementsAreBeingDragged||s.resizingElement||s.isRotating||s.openMenu||s.viewModeEnabled?null:h.jsxs("div",{className:"excalidraw-hyperlinkContainer",style:{top:`${v}px`,left:`${b}px`,width:dp,padding:h1},children:[p?h.jsx("input",{className:te("excalidraw-hyperlinkContainer-input"),placeholder:S("labels.link.hint"),ref:f,value:l,onChange:x=>u(x.target.value),autoFocus:!0,onKeyDown:x=>{x.stopPropagation(),x[D.CTRL_OR_CMD]&&x.key===D.K&&x.preventDefault(),(x.key===D.ENTER||x.key===D.ESCAPE)&&(U(),n({showHyperlinkPopup:"info"}))}}):e.link?h.jsx("a",{href:vn(e.link||""),className:"excalidraw-hyperlinkContainer-link",target:l8(e.link)?"_self":"_blank",onClick:x=>{if(e.link&&a){let y=N5("excalidraw-link",x.nativeEvent);a({...e,link:vn(e.link)},y),y.defaultPrevented&&x.preventDefault()}},rel:"noopener noreferrer",children:e.link}):h.jsx("div",{className:"excalidraw-hyperlinkContainer-link",children:S("labels.link.empty")}),h.jsxs("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!p&&h.jsx(Ce,{type:"button",title:S("buttons.edit"),"aria-label":S("buttons.edit"),label:S("buttons.edit"),onClick:g,className:"excalidraw-hyperlinkContainer--edit",icon:oo}),h.jsx(Ce,{type:"button",title:S("labels.linkToElement"),"aria-label":S("labels.linkToElement"),label:S("labels.linkToElement"),onClick:()=>{n({openDialog:{name:"elementLinkSelector",sourceElementId:e.id}})},icon:ub}),c&&!pn(e)&&h.jsx(Ce,{type:"button",title:S("buttons.remove"),"aria-label":S("buttons.remove"),label:S("buttons.remove"),onClick:m,className:"excalidraw-hyperlinkContainer--remove",icon:Rr})]})]})},K4=(e,t,n)=>{let[a,i]=fe(e,n),{x:r,y:s}=Rn({sceneX:a+e.width/2,sceneY:i},t),o=r-t.offsetLeft-dp/2,d=s-t.offsetTop-Y4;return{x:o,y:d}},Eg=(e,t)=>{let n=xe(e,t);return pn(n[0])?"labels.link.editEmbed":n[0]?.link?"labels.link.edit":"labels.link.create"},Wl=null,hF=(e,t,n)=>{Wl&&clearTimeout(Wl),Wl=window.setTimeout(()=>fF(e,t,n),_S)},fF=(e,t,n)=>{if(!e.link)return;let a=Hl();a.classList.add("excalidraw-tooltip--visible"),a.style.maxWidth="20rem",a.textContent=vs(e.link)?S("labels.link.goToElement"):e.link;let[i,r,s,o]=fe(e,n),[d,c,l,u]=h0([i,r,s,o],e.angle,t),f=Rn({sceneX:d,sceneY:c},t);F4(a,{left:f.x,top:f.y,width:l,height:u},"top"),qe("hyperlink","tooltip","link-icon"),f1=!0},Sg=()=>{Wl&&clearTimeout(Wl),f1&&(f1=!1,Hl().classList.remove("excalidraw-tooltip--visible"))},pF=(e,t,n,[a,i])=>{let{x:r,y:s}=Ge({clientX:a,clientY:i},n),o=15/n.zoom.value;if(q1(r,s,e,t))return!1;let[d,c,l]=fe(e,t);if(r>=d&&r<=l&&s>=c-Y4&&s<=c)return!1;let{x:u,y:f}=K4(e,n,t);return!(a>=u-o&&a<=u+dp+h1*2+o&&i>=f-o&&i<=f+o+h1*2+dF)},q4=G({name:"hyperlink",label:(e,t)=>Eg(e,t),icon:Sf,perform:(e,t)=>t.showHyperlinkPopup==="editor"?!1:{elements:e,appState:{...t,showHyperlinkPopup:"editor",openMenu:null},captureUpdate:B.IMMEDIATELY},trackEvent:{category:"hyperlink",action:"click"},keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.K,predicate:(e,t)=>xe(e,t).length===1,PanelComponent:({elements:e,appState:t,updateData:n})=>{let a=xe(e,t);return h.jsx(Ce,{type:"button",icon:Sf,"aria-label":S(Eg(e,t)),title:`${pn(e[0])?S("labels.link.labelEmbed"):S("labels.link.label")} - ${H("CtrlOrCmd+K")}`,onClick:()=>n(null),selected:a.length===1&&!!a[0].link})}}),Ph=e=>e.every(t=>!t.locked),UF=G({name:"toggleElementLock",label:(e,t,n)=>{let a=n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1});return a.length===1&&!de(a[0])?a[0].locked?"labels.elementLock.unlock":"labels.elementLock.lock":Ph(a)?"labels.elementLock.lockAll":"labels.elementLock.unlockAll"},icon:(e,t)=>{let n=xe(t,e);return Ph(n)?X1:tu},trackEvent:{category:"element"},predicate:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t);return i.length>0&&!i.some(r=>r.locked&&r.frameId)},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0});if(!i.length)return!1;let r=Ph(i),s=oe(i);return{elements:e.map(o=>s.has(o.id)?pe(o,{locked:r}):o),appState:{...t,selectedLinearElement:r?null:t.selectedLinearElement},captureUpdate:B.IMMEDIATELY}},keyTest:(e,t,n,a)=>e.key.toLocaleLowerCase()===D.L&&e[D.CTRL_OR_CMD]&&e.shiftKey&&a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}).length>0}),mF=G({name:"unlockAllElements",paletteName:"Unlock all elements",trackEvent:{category:"canvas"},viewMode:!1,icon:tu,predicate:(e,t)=>xe(e,t).length===0&&e.some(n=>n.locked),perform:(e,t)=>{let n=e.filter(a=>a.locked);return{elements:e.map(a=>a.locked?pe(a,{locked:!1}):a),appState:{...t,selectedElementIds:Object.fromEntries(n.map(a=>[a.id,!0]))},captureUpdate:B.IMMEDIATELY}},label:"labels.elementLock.unlockAll"}),gF=()=>{let[e,t]=C.useState(null),n=C.useCallback(a=>t(a),[]);return[e,n]},bF=e=>{let{closeOnClickOutside:t=!0}=e,n=_4({className:"excalidraw-modal-container"}),a=C.useRef(document.body.classList.contains("excalidraw-animations-disabled"));if(!n)return null;let i=r=>{r.key===D.ESCAPE&&(r.nativeEvent.stopImmediatePropagation(),r.stopPropagation(),e.onCloseRequest())};return Kt.createPortal(h.jsxs("div",{className:te("Modal",e.className,{"animations-disabled":a.current}),role:"dialog","aria-modal":"true",onKeyDown:i,"aria-labelledby":e.labelledBy,"data-prevent-outside-click":!0,children:[h.jsx("div",{className:"Modal__background",onClick:t?e.onCloseRequest:void 0}),h.jsx("div",{className:"Modal__content",style:{"--max-width":`${e.maxWidth}px`},tabIndex:0,children:e.children})]}),n)},J4=Bt(new Map),kg=async e=>await bu({elements:e,appState:{exportBackground:!1,viewBackgroundColor:Ee.white},files:null,renderEmbeddables:!1,skipInliningFonts:!0}),xF=(e,t,n)=>{let[a,i]=C.useState();return C.useEffect(()=>{if(t)if(e){let r=n.get(e);r?i(r):(async()=>{let s=await kg(t);s.querySelector(".style-fonts")?.remove(),s&&(n.set(e,s),i(s))})()}else(async()=>{let r=await kg(t);i(r)})()},[e,t,n,i]),a},Q4=()=>{let[e]=gt(J4);return{clearLibraryCache:()=>e.clear(),deleteItemsFromLibraryCache:t=>{t.forEach(n=>e.delete(n))},svgCache:e}},vF=class{constructor(){j(this,"jobs",[]),j(this,"running",!1)}tick(){if(this.running)return;let e=this.jobs.shift();e?(this.running=!0,e.promise.resolve(Xi(e.jobFactory,...e.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(e,...t){let n=R5();return this.jobs.push({jobFactory:e,promise:n,args:t}),this.tick(),n}},yF=["excalidraw.com","raw.githubusercontent.com/excalidraw/excalidraw-libraries"],e9=new Sa,yo=Bt({status:"loaded",isInitialized:!1,libraryItems:[]}),ul=e=>ti(e),wF=(e,t)=>!e.find(n=>n.elements.length!==t.elements.length?!1:n.elements.every((a,i)=>a.id===t.elements[i].id&&a.versionNonce===t.elements[i].versionNonce)),t9=(e,t)=>{let n=[];for(let a of t)wF(e,a)&&n.push(a);return[...n,...e]},n9=(e,t)=>{let n=oe(t),a={deletedItems:new Map,addedItems:new Map};for(let r of e)n.has(r.id)||a.deletedItems.set(r.id,r);let i=oe(e);for(let r of t)i.has(r.id)||a.addedItems.set(r.id,r);return a},EF=class{constructor(e){j(this,"currLibraryItems",[]),j(this,"prevLibraryItems",ul(this.currLibraryItems)),j(this,"app"),j(this,"updateQueue",[]),j(this,"getLastUpdateTask",()=>this.updateQueue[this.updateQueue.length-1]),j(this,"notifyListeners",()=>{if(this.updateQueue.length>0)ia.set(yo,t=>({status:"loading",libraryItems:this.currLibraryItems,isInitialized:t.isInitialized}));else{ia.set(yo,{status:"loaded",libraryItems:this.currLibraryItems,isInitialized:!0});try{let t=this.prevLibraryItems;this.prevLibraryItems=ul(this.currLibraryItems);let n=ul(this.currLibraryItems);this.app.props.onLibraryChange?.(n),e9.trigger(n9(t,n),n)}catch(t){console.error(t)}}}),j(this,"destroy",()=>{this.updateQueue=[],this.currLibraryItems=[],ia.set(J4,new Map)}),j(this,"resetLibrary",()=>this.setLibrary([])),j(this,"getLatestLibrary",()=>new Promise(async t=>{try{let n=await(this.getLastUpdateTask()||this.currLibraryItems);this.updateQueue.length>0?t(this.getLatestLibrary()):t(ul(n))}catch{return t(this.currLibraryItems)}})),j(this,"updateLibrary",async({libraryItems:t,prompt:n=!1,merge:a=!1,openLibraryMenu:i=!1,defaultStatus:r="unpublished"})=>(i&&this.app.setState({openSidebar:{name:sa.name,tab:rc}}),this.setLibrary(()=>new Promise(async(s,o)=>{try{let d=await(typeof t=="function"&&!(t instanceof Blob)?t(this.currLibraryItems):t),c;d instanceof Blob?c=await g7(d,r):c=Oo(d,r),!n||window.confirm(S("alerts.confirmAddLibrary",{numShapes:c.length}))?(n&&this.app.focusContainer(),s(a?t9(this.currLibraryItems,c):c)):o(new iu)}catch(d){o(d)}})))),j(this,"setLibrary",t=>{let n=new Promise(async(a,i)=>{try{await this.getLastUpdateTask(),typeof t=="function"&&(t=t(this.currLibraryItems)),this.currLibraryItems=ul(await t),a(this.currLibraryItems)}catch(r){i(r)}}).catch(a=>{if(a.name==="AbortError")return console.warn("Library update aborted by user"),this.currLibraryItems;throw a}).finally(()=>{this.updateQueue=this.updateQueue.filter(a=>a!==n),this.notifyListeners()});return this.updateQueue.push(n),this.notifyListeners(),n}),this.app=e}},SF=EF,a9=e=>{let t=Math.ceil(Math.sqrt(e.length)),n=[],a=f=>e.slice(f*t,f*t+t).reduce((p,U)=>{let{height:m}=oa(U.elements);return Math.max(p,m)},0),i=f=>{let p=0,U=0,m=0;for(let g of e){if(p%t===0&&(U=0),U===f){let{width:b}=oa(g.elements);m=Math.max(m,b)}p++,U++}return m},r=0,s=0,o=0,d=0,c=0,l=0,u=0;for(let f of e){c&&c%t===0&&(s+=o+50,r=0,l=0,u++),l===0&&(o=a(u)),d=i(l);let{minX:p,minY:U,width:m,height:g}=oa(f.elements),b=(d-m)/2,v=(o-g)/2;n.push(...f.elements.map(x=>({...x,x:x.x+r+b-p,y:x.y+s+v-U}))),r+=d+50,c++,l++}return n},kF=(e,t=yF)=>{if(typeof t=="function"?t(e):t.some(n=>{let a=new URL(`https://${n.replace(/^https?:\/\//,"")}`),{hostname:i,pathname:r}=new URL(e);return new RegExp(`(^|\\.)${a.hostname}$`).test(i)&&new RegExp(`^${a.pathname.replace(/\/+$/,"")}(/+|$)`).test(r)}))return!0;throw new Error(`Invalid or disallowed library URL: "${e}"`)},p1=()=>{let e=new URLSearchParams(window.location.hash.slice(1)).get(mf.addLibrary)||new URLSearchParams(window.location.search).get(Uf.addLibrary),t=e?new URLSearchParams(window.location.hash.slice(1)).get("token"):null;return e?{libraryUrl:e,idToken:t}:null},_l=class U1{constructor(t){j(this,"adapter"),this.adapter=t}static async getLibraryItems(t,n,a=!0){let i=()=>new Promise(async(r,s)=>{try{let o=await t.load({source:n});r(Oo(o?.libraryItems||[],"published"))}catch(o){s(o)}});return a?U1.queue.push(i):i()}getLibraryItems(t){return U1.getLibraryItems(this.adapter,t,!1)}};j(_l,"queue",new vF),j(_l,"run",async(e,t)=>{let n=new _l(e);return _l.queue.push(()=>t(n))});var Vd=_l,Vl=0,Pc=0,Nc=e=>O0(e.map(t=>`${t.id}:${c7(t.elements)}`).sort().join()),Mg=async(e,t)=>{try{return Pc++,await Vd.run(e,async n=>{let a=oe(await n.getLibraryItems("save"));for(let[o]of t.deletedItems)a.delete(o);let i=[];for(let[o,d]of t.addedItems)a.has(o)?a.set(o,d):i.push(d);let r=i.concat(Array.from(a.values())),s=Nc(r);return s!==Vl&&await e.save({libraryItems:r}),Vl=s,r})}finally{Pc--}},MF=e=>{let{excalidrawAPI:t}=e,n=C.useRef(e);n.current=e;let a=C.useRef(!1);C.useEffect(()=>{if(!t)return;a.current=!1;let i=async({libraryUrl:o,idToken:d})=>{let c=new Promise(async(u,f)=>{try{o=decodeURIComponent(o),o=s0(o),kF(o,n.current.validateLibraryUrl);let p=await(await fetch(o)).blob();u(p)}catch(p){f(p)}}),l=d!==t.id;await(l&&document.hidden?new Promise(u=>{window.addEventListener("focus",()=>u(),{once:!0})}):null);try{await t.updateLibrary({libraryItems:c,prompt:l,merge:!0,defaultStatus:"published",openLibraryMenu:!0})}catch(u){throw t.updateScene({appState:{errorMessage:u.message}}),u}finally{if(window.location.hash.includes(mf.addLibrary)){let u=new URLSearchParams(window.location.hash.slice(1));u.delete(mf.addLibrary),window.history.replaceState({},pf,`#${u.toString()}`)}else if(window.location.search.includes(Uf.addLibrary)){let u=new URLSearchParams(window.location.search);u.delete(Uf.addLibrary),window.history.replaceState({},pf,`?${u.toString()}`)}}},r=o=>{o.preventDefault();let d=p1();d&&(o.stopImmediatePropagation(),window.history.replaceState({},"",o.oldURL),i(d))},s=p1();if(s&&i(s),"getInitialLibraryItems"in n.current&&n.current.getInitialLibraryItems&&(console.warn("useHandleLibrar `opts.getInitialLibraryItems` is deprecated. Use `opts.adapter` instead."),Promise.resolve(n.current.getInitialLibraryItems()).then(o=>{t.updateLibrary({libraryItems:o,merge:!0})}).catch(o=>{console.error(`UseHandeLibrary getInitialLibraryItems failed: ${o?.message}`)})),"adapter"in n.current&&n.current.adapter){let o=n.current.adapter,d=n.current.migrationAdapter,c=R5();d?c.resolve(Xi(d.load).then(async l=>{let u=null;try{if(!l)return Vd.getLibraryItems(o,"load");u=Oo(l.libraryItems||[],"published");let f=await Mg(o,n9([],u));try{await d.clear()}catch(p){console.error(`couldn't delete legacy library data: ${p.message}`)}return f}catch(f){return console.error(`couldn't migrate legacy library data: ${f.message}`),u}}).catch(l=>(console.error(`error during library migration: ${l.message}`),Vd.getLibraryItems(o,"load")))):c.resolve(Xi(Vd.getLibraryItems,o,"load")),t.updateLibrary({libraryItems:c.then(l=>{let u=l||[];return Vl=Nc(u),u}),merge:!0}).finally(()=>{a.current=!0})}return window.addEventListener("hashchange",r),()=>{window.removeEventListener("hashchange",r)}},[t]),C.useEffect(()=>{let i=e9.on(async(s,o)=>{let d=a.current,c="adapter"in n.current&&n.current.adapter||null;try{c&&Vl!==Nc(o)&&await Mg(c,s)}catch(l){console.error(`couldn't persist library update: ${l.message}`,s),d&&n.current.excalidrawAPI&&n.current.excalidrawAPI.updateScene({appState:{errorMessage:S("errors.saveLibraryError")}})}}),r=s=>{Pc&&ck(s)};return window.addEventListener("beforeunload",r),()=>{window.removeEventListener("beforeunload",r),i(),Vl=0,Pc=0}},[])},CF=C.forwardRef(({children:e,gap:t,align:n,justifyContent:a,className:i,style:r},s)=>h.jsx("div",{className:te("Stack Stack_horizontal",i),style:{"--gap":t,alignItems:n,justifyContent:a,...r},ref:s,children:e})),IF=C.forwardRef(({children:e,gap:t,align:n,justifyContent:a,className:i,style:r},s)=>h.jsx("div",{className:te("Stack Stack_vertical",i),style:{"--gap":t,justifyItems:n,justifyContent:a,...r},ref:s,children:e})),Pn={Row:CF,Col:IF},_F=({theme:e,id:t,libraryReturnUrl:n})=>{let a=n||window.location.origin+window.location.pathname;return h.jsx("a",{className:"library-menu-browse-button",href:`${be.VITE_APP_LIBRARY_URL}?target=${window.name||"_blank"}&referrer=${a}&useHash=true&token=${t}&theme=${e}&version=${qc.excalidrawLibrary}`,target:"_excalidraw_libraries",children:S("labels.libraries")})},TF=_F,i9=({libraryReturnUrl:e,theme:t,id:n,style:a,children:i,className:r})=>h.jsxs("div",{className:te("library-menu-control-buttons",r),style:a,children:[h.jsx(TF,{id:n,libraryReturnUrl:e,theme:t}),i]}),jF=/({{[\w-]+}})|(<[\w-]+>)|(<\/[\w-]+>)/g,AF=/{{([\w-]+)}}/,DF=/<([\w-]+)>/,LF=/<\/([\w-]+)>/,RF=(e,t)=>{let n=[{name:"",children:[]}];return e.split(jF).filter(Boolean).forEach(a=>{let i=a.match(DF),r=a.match(LF),s=a.match(AF);if(i!==null){let o=i[1];t.hasOwnProperty(o)?n.push({name:o,children:[]}):console.warn(`Trans: missed to pass in prop ${o} for interpolating ${e}`)}else if(r!==null)if(r[1]===n[n.length-1].name){let o=n.pop(),d=Z.createElement(Z.Fragment,{},...o.children),c=t[o.name];typeof c=="function"&&n[n.length-1].children.push(c(d))}else console.warn(`Trans: unexpected end tag ${a} for interpolating ${e}`);else if(s!==null){let o=s[1];t.hasOwnProperty(o)?n[n.length-1].children.push(t[o]):console.warn(`Trans: key ${o} not in props for interpolating ${e}`)}else n[n.length-1].children.push(a)}),n.length!==1&&console.warn(`Trans: stack not empty for interpolating ${e}`),n[0].children},PF=({i18nKey:e,children:t,...n})=>{let{t:a}=Vt();return Z.createElement(Z.Fragment,{},...RF(a(e),n))},Ta=PF,NF=({label:e,onClick:t,className:n,children:a,actionType:i,type:r="button",isLoading:s,...o})=>{let d=i?`Dialog__action-button--${i}`:"";return h.jsxs("button",{className:te("Dialog__action-button",d,n),type:r,"aria-label":e,onClick:t,...o,children:[a&&h.jsx("div",{style:s?{visibility:"hidden"}:{},children:a}),h.jsx("div",{style:s?{visibility:"hidden"}:{},children:e}),s&&h.jsx("div",{style:{position:"absolute",inset:0},children:h.jsx(hi,{})})]})},$s=NF,OF=e=>{let{onConfirm:t,onCancel:n,children:a,confirmText:i=S("buttons.confirm"),cancelText:r=S("buttons.cancel"),className:s="",...o}=e,d=jt(),c=Su(cp),{container:l}=za();return h.jsxs(pa,{onCloseRequest:n,size:"small",...o,className:`confirm-dialog ${s}`,children:[a,h.jsxs("div",{className:"confirm-dialog-buttons",children:[h.jsx($s,{label:r,onClick:()=>{d({openMenu:null}),c(!1),Kt.flushSync(()=>{n()}),l?.focus()}}),h.jsx($s,{label:i,onClick:()=>{d({openMenu:null}),c(!1),Kt.flushSync(()=>{t()}),l?.focus()},actionType:"danger"})]})]})},r9=OF,Mr=class{static has(e){try{return!!window.localStorage.getItem(e)}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),!1}}static get(e){try{let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return console.warn(`localStorage.getItem error: ${t.message}`),null}}};j(Mr,"set",(e,t)=>{try{return window.localStorage.setItem(e,JSON.stringify(t)),!0}catch(n){return console.warn(`localStorage.setItem error: ${n.message}`),!1}}),j(Mr,"delete",e=>{try{window.localStorage.removeItem(e)}catch(t){console.warn(`localStorage.removeItem error: ${t.message}`)}});var $F=async e=>{let t=Math.round(8),n=Math.max(Math.round(128/64),2),a=ik(e,6),i=document.createElement("canvas");i.width=a[0].length*128+(a[0].length+1)*(t*2)-t*2,i.height=a.length*128+(a.length+1)*(t*2)-t*2;let r=i.getContext("2d");r.fillStyle=Ft.white,r.fillRect(0,0,i.width,i.height);for(let[s,o]of e.entries()){let d=await $o({elements:o.elements,files:null,maxWidthOrHeight:128}),{width:c,height:l}=d,u=Math.floor(s/6)*(128+t*2),f=s%6*(128+t*2);r.drawImage(d,f+(128-c)/2+t,u+(128-l)/2+t),r.lineWidth=n,r.strokeStyle=Ft.gray[4],r.strokeRect(f+t/2,u+t/2,128+t,128+t)}return await Gf(new File([await xo(i)],"preview",{type:ae.png}),{outputType:ae.jpg,maxWidthOrHeight:5e3})},FF=({libItem:e,appState:t,index:n,onChange:a,onRemove:i})=>{let r=C.useRef(null),s=C.useRef(null);return C.useEffect(()=>{let o=r.current;o&&(async()=>{let d=await bu({elements:e.elements,appState:{...t,viewBackgroundColor:Ft.white,exportBackground:!0},files:null,skipInliningFonts:!0});o.innerHTML=d.outerHTML})()},[e.elements,t]),h.jsxs("div",{className:"single-library-item",children:[e.status==="published"&&h.jsx("span",{className:"single-library-item-status",children:S("labels.statusPublished")}),h.jsx("div",{ref:r,className:"single-library-item__svg"}),h.jsx(Ce,{"aria-label":S("buttons.remove"),type:"button",icon:Ws,className:"single-library-item--remove",onClick:i.bind(null,e.id),title:S("buttons.remove")}),h.jsxs("div",{style:{display:"flex",margin:"0.8rem 0",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[h.jsxs("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[h.jsxs("div",{style:{padding:"0.5em 0"},children:[h.jsx("span",{style:{fontWeight:500,color:Ft.gray[6]},children:S("publishDialog.itemName")}),h.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),h.jsx("input",{type:"text",ref:s,style:{width:"80%",padding:"0.2rem"},defaultValue:e.name,placeholder:"Item name",onChange:o=>{a(o.target.value,n)}})]}),h.jsx("span",{className:"error",children:e.error})]})]})},zF=({onClose:e,libraryItems:t,appState:n,onSuccess:a,onError:i,updateItemsInStorage:r,onRemove:s})=>{let[o,d]=C.useState({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[c,l]=C.useState(!1);C.useEffect(()=>{let x=Mr.get(Ll.PUBLISH_LIBRARY);x&&d(x)},[]);let[u,f]=C.useState(t.slice());C.useEffect(()=>{f(t.slice())},[t]);let p=x=>{d({...o,[x.target.name]:x.target.value})},U=async x=>{x.preventDefault(),l(!0);let y=[],w=!1;if(u.forEach(T=>{let L="";T.name||(L=S("publishDialog.errors.required"),w=!0),y.push({...T,error:L})}),w){f(y),l(!1);return}let k=await $F(u),M={type:On.excalidrawLibrary,version:qc.excalidrawLibrary,source:j1,libraryItems:u},I=JSON.stringify(M,null,2),A=new Blob([I],{type:"application/json"}),_=new FormData;_.append("excalidrawLib",A),_.append("previewImage",k),_.append("previewImageType",k.type),_.append("title",o.name),_.append("authorName",o.authorName),_.append("githubHandle",o.githubHandle),_.append("name",o.name),_.append("description",o.description),_.append("twitterHandle",o.twitterHandle),_.append("website",o.website),fetch(`${be.VITE_APP_LIBRARY_BACKEND}/submit`,{method:"post",body:_}).then(T=>T.ok?T.json().then(({url:L})=>{Mr.delete(Ll.PUBLISH_LIBRARY),a({url:L,authorName:o.authorName,items:u})}):T.json().catch(()=>{throw new Error(T.statusText||"something went wrong")}).then(L=>{throw new Error(L.message||T.statusText||"something went wrong")}),T=>{console.error(T),i(T),l(!1)}).catch(T=>{console.error(T),i(T),l(!1)})},m=()=>{let x=[];return u.forEach((y,w)=>{x.push(h.jsx("div",{className:"single-library-item-wrapper",children:h.jsx(FF,{libItem:y,appState:n,index:w,onChange:(k,M)=>{let I=u.slice();I[M].name=k,f(I)},onRemove:s})},w))}),h.jsx("div",{className:"selected-library-items",children:x})},g=C.useCallback(()=>{r(u),Mr.set(Ll.PUBLISH_LIBRARY,o),e()},[u,e,r,o]),b=!!t.length,v=t.some(x=>x.status==="published");return h.jsx(pa,{onCloseRequest:g,title:S("publishDialog.title"),className:"publish-library",children:b?h.jsxs("form",{onSubmit:U,children:[h.jsx("div",{className:"publish-library-note",children:h.jsx(Ta,{i18nKey:"publishDialog.noteDescription",link:x=>h.jsx("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:x})})}),h.jsx("span",{className:"publish-library-note",children:h.jsx(Ta,{i18nKey:"publishDialog.noteGuidelines",link:x=>h.jsx("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:x})})}),h.jsx("div",{className:"publish-library-note",children:S("publishDialog.noteItems")}),v&&h.jsx("span",{className:"publish-library-note publish-library-warning",children:S("publishDialog.republishWarning")}),m(),h.jsxs("div",{className:"publish-library__fields",children:[h.jsxs("label",{children:[h.jsxs("div",{children:[h.jsx("span",{children:S("publishDialog.libraryName")}),h.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),h.jsx("input",{type:"text",name:"name",required:!0,value:o.name,onChange:p,placeholder:S("publishDialog.placeholder.libraryName")})]}),h.jsxs("label",{style:{alignItems:"flex-start"},children:[h.jsxs("div",{children:[h.jsx("span",{children:S("publishDialog.libraryDesc")}),h.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),h.jsx("textarea",{name:"description",rows:4,required:!0,value:o.description,onChange:p,placeholder:S("publishDialog.placeholder.libraryDesc")})]}),h.jsxs("label",{children:[h.jsxs("div",{children:[h.jsx("span",{children:S("publishDialog.authorName")}),h.jsx("span",{"aria-hidden":"true",className:"required",children:"*"})]}),h.jsx("input",{type:"text",name:"authorName",required:!0,value:o.authorName,onChange:p,placeholder:S("publishDialog.placeholder.authorName")})]}),h.jsxs("label",{children:[h.jsx("span",{children:S("publishDialog.githubUsername")}),h.jsx("input",{type:"text",name:"githubHandle",value:o.githubHandle,onChange:p,placeholder:S("publishDialog.placeholder.githubHandle")})]}),h.jsxs("label",{children:[h.jsx("span",{children:S("publishDialog.twitterUsername")}),h.jsx("input",{type:"text",name:"twitterHandle",value:o.twitterHandle,onChange:p,placeholder:S("publishDialog.placeholder.twitterHandle")})]}),h.jsxs("label",{children:[h.jsx("span",{children:S("publishDialog.website")}),h.jsx("input",{type:"text",name:"website",pattern:"https?://.+",title:S("publishDialog.errors.website"),value:o.website,onChange:p,placeholder:S("publishDialog.placeholder.website")})]}),h.jsx("span",{className:"publish-library-note",children:h.jsx(Ta,{i18nKey:"publishDialog.noteLicense",link:x=>h.jsx("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:x})})})]}),h.jsxs("div",{className:"publish-library__buttons",children:[h.jsx($s,{label:S("buttons.cancel"),onClick:g,"data-testid":"cancel-clear-canvas-button"}),h.jsx($s,{type:"submit",label:S("buttons.submit"),actionType:"primary",isLoading:c})]})]}):h.jsx("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:S("publishDialog.atleastOneLibItem")})})},BF=zF,s9=({className:e="",children:t,onToggle:n,title:a,...i})=>{let r=Tt(),s=te(`dropdown-menu-button ${e}`,"zen-mode-transition",{"dropdown-menu-button--mobile":r.editor.isMobile}).trim();return h.jsx("button",{"data-prevent-outside-click":!0,className:s,onClick:n,type:"button","data-testid":"dropdown-menu-button",title:a,...i,children:t})},HF=s9;s9.displayName="DropdownMenuTrigger";var l9=()=>h.jsx("div",{style:{height:"1px",backgroundColor:"var(--default-border-color)",margin:".5rem 0"}}),XF=l9;l9.displayName="DropdownMenuSeparator";var o9=({children:e,onClickOutside:t,className:n="",onSelect:a,style:i})=>{let r=Tt(),s=C.useRef(null),o=Cu({onClickOutside:t});np(s,()=>{o.onClickOutside?.()}),C.useEffect(()=>{let c=u=>{u.key===D.ESCAPE&&(u.stopImmediatePropagation(),o.onClickOutside?.())},l={capture:!0};return document.addEventListener("keydown",c,l),()=>{document.removeEventListener("keydown",c,l)}},[o]);let d=te(`dropdown-menu ${n}`,{"dropdown-menu--mobile":r.editor.isMobile}).trim();return h.jsx(L4.Provider,{value:{onSelect:a},children:h.jsx("div",{ref:s,className:d,style:i,"data-testid":"dropdown-menu",children:r.editor.isMobile?h.jsx(Pn.Col,{className:"dropdown-menu-container",children:e}):h.jsx(da,{className:"dropdown-menu-container",padding:2,style:{zIndex:2},children:e})})})};o9.displayName="DropdownMenuContent";var WF=o9,d9=({icon:e,shortcut:t,href:n,children:a,onSelect:i,className:r="",selected:s,rel:o="noreferrer",...d})=>{let c=P4(d.onClick,i);return h.jsx("a",{...d,href:n,target:"_blank",rel:"noreferrer",className:R4(r,s),title:d.title??d["aria-label"],onClick:c,children:h.jsx(N4,{icon:e,shortcut:t,children:a})})},Gd=d9;d9.displayName="DropdownMenuItemLink";var VF=({children:e,className:t="",selected:n,...a})=>h.jsx("div",{...a,className:`dropdown-menu-item-base dropdown-menu-item-custom ${t} ${n?"dropdown-menu-item--selected":""}`.trim(),children:e}),GF=VF,ZF=e=>Z.Children.toArray(e).find(n=>Z.isValidElement(n)&&typeof n.type!="string"&&n?.type.displayName&&n.type.displayName==="DropdownMenuTrigger")||null,YF=e=>Z.Children.toArray(e).find(n=>Z.isValidElement(n)&&typeof n.type!="string"&&n?.type.displayName&&n.type.displayName==="DropdownMenuContent")||null,mi=({children:e,open:t})=>{let n=ZF(e),a=YF(e);return h.jsxs(h.Fragment,{children:[n,t&&a]})};mi.Trigger=HF;mi.Content=WF;mi.Item=Wn;mi.ItemLink=Gd;mi.ItemCustom=GF;mi.Group=o1;mi.Separator=XF;var Je=mi;mi.displayName="DropdownMenu";var KF=(e,t)=>e.filter(n=>t.includes(n.id)),qF=({setAppState:e,selectedItems:t,library:n,onRemoveFromLibrary:a,resetLibrary:i,onSelectItems:r,appState:s,className:o})=>{let[d]=gt(yo),[c,l]=gt(cp),u=()=>{let _=t.length?S("alerts.removeItemsFromsLibrary",{count:t.length}):S("alerts.resetLibrary"),T=t.length?S("confirmDialog.removeItemsFromLib"):S("confirmDialog.resetLibrary");return h.jsx(r9,{onConfirm:()=>{t.length?a():i(),p(!1)},onCancel:()=>{p(!1)},title:T,children:h.jsx("p",{children:_})})},[f,p]=C.useState(!1),U=!!t.length,m=U?d.libraryItems.filter(_=>t.includes(_.id)):d.libraryItems,g=S(U?"buttons.remove":"buttons.resetLibrary"),[b,v]=C.useState(!1),[x,y]=C.useState(null),w=C.useCallback(()=>h.jsxs(pa,{onCloseRequest:()=>y(null),title:S("publishSuccessDialog.title"),className:"publish-library-success",size:"small",children:[h.jsx("p",{children:h.jsx(Ta,{i18nKey:"publishSuccessDialog.content",authorName:x.authorName,link:_=>h.jsx("a",{href:x?.url,target:"_blank",rel:"noopener noreferrer",children:_})})}),h.jsx(Ce,{type:"button",title:S("buttons.close"),"aria-label":S("buttons.close"),label:S("buttons.close"),onClick:()=>y(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]}),[y,x]),k=(_,T)=>{v(!1),y({url:_.url,authorName:_.authorName});let L=T.slice();L.forEach(R=>{t.includes(R.id)&&(R.status="published")}),n.setLibrary(L)},M=async()=>{try{await n.updateLibrary({libraryItems:c0({description:"Excalidraw library files"}),merge:!0,openLibraryMenu:!0})}catch(_){if(_?.name==="AbortError"){console.warn(_);return}e({errorMessage:S("errors.importLibraryError")})}},I=async()=>{let _=U?m:await n.getLatestLibrary();TL(_).catch(D5).catch(T=>{e({errorMessage:T.message})})},A=()=>h.jsxs(Je,{open:c,children:[h.jsx(Je.Trigger,{onToggle:()=>l(!c),children:zk}),h.jsxs(Je.Content,{onClickOutside:()=>l(!1),onSelect:()=>l(!1),className:"library-menu",children:[!U&&h.jsx(Je.Item,{onSelect:M,icon:V1,"data-testid":"lib-dropdown--load",children:S("buttons.load")}),!!m.length&&h.jsx(Je.Item,{onSelect:I,icon:nu,"data-testid":"lib-dropdown--export",children:S("buttons.export")}),!!m.length&&h.jsx(Je.Item,{onSelect:()=>p(!0),icon:Rr,children:g}),U&&h.jsx(Je.Item,{icon:JM,onSelect:()=>v(!0),"data-testid":"lib-dropdown--remove",children:S("buttons.publishLibrary")})]})]});return h.jsxs("div",{className:te("library-menu-dropdown-container",o),children:[A(),t.length>0&&h.jsx("div",{className:"library-actions-counter",children:t.length}),f&&u(),b&&h.jsx(BF,{onClose:()=>v(!1),libraryItems:KF(d.libraryItems,t),appState:s,onSuccess:_=>k(_,d.libraryItems),onError:_=>window.alert(_),updateItemsInStorage:()=>n.setLibrary(d.libraryItems),onRemove:_=>r(t.filter(T=>T!==_))}),x&&w()]})},Cg=({selectedItems:e,onSelectItems:t,className:n})=>{let{library:a}=Ua(),{clearLibraryCache:i,deleteItemsFromLibraryCache:r}=Q4(),s=Gt(),o=jt(),[d]=gt(yo),c=async l=>{let u=l.filter(f=>!e.includes(f.id));a.setLibrary(u).catch(()=>{o({errorMessage:S("alerts.errorRemovingFromLibrary")})}),r(e),t([])};return h.jsx(qF,{appState:s,setAppState:o,selectedItems:e,onSelectItems:t,library:a,onRemoveFromLibrary:()=>c(d.libraryItems),resetLibrary:()=>{a.resetLibrary(),i()},className:n})},JF=C.memo(({id:e,elements:t,isPending:n,onClick:a,selected:i,onToggle:r,onDrag:s,svgCache:o})=>{let d=C.useRef(null),c=xF(e,t,o);C.useEffect(()=>{let U=d.current;if(U)return c&&(U.innerHTML=c.outerHTML),()=>{U.innerHTML=""}},[c]);let[l,u]=C.useState(!1),f=Tt().editor.isMobile,p=n&&h.jsx("div",{className:"library-unit__adder",children:Fk});return h.jsxs("div",{className:te("library-unit",{"library-unit__active":t,"library-unit--hover":t&&l,"library-unit--selected":i,"library-unit--skeleton":!c}),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[h.jsx("div",{className:te("library-unit__dragger",{"library-unit__pulse":!!n}),ref:d,draggable:!!t,onClick:t||n?U=>{e&&U.shiftKey?r(e,U):a(e)}:void 0,onDragStart:U=>{if(!e){U.preventDefault();return}u(!1),s(e,U)}}),p,e&&t&&(l||f||i)&&h.jsx(lp,{checked:i,onChange:(U,m)=>r(e,m),className:"library-unit__checkbox"})]})}),QF=()=>h.jsx("div",{className:"library-unit library-unit--skeleton"});function ez(){return[!1,C.useCallback(e=>e(),[])]}var tz=Z.useTransition||ez,Ig=({children:e})=>h.jsx("div",{className:"library-menu-items-container__grid",children:e}),Nh=C.memo(({items:e,onItemSelectToggle:t,onItemDrag:n,isItemSelected:a,onClick:i,svgCache:r,itemsRenderedPerBatch:s})=>{let[,o]=tz(),[d,c]=C.useState(0);return C.useEffect(()=>{d<e.length&&o(()=>{c(d+s)})},[d,e.length,o,s]),h.jsx(h.Fragment,{children:e.map((l,u)=>u<d?h.jsx(JF,{elements:l?.elements,isPending:!l?.id&&!!l?.elements,onClick:i,svgCache:r,id:l?.id,selected:a(l.id),onToggle:t,onDrag:n},l?.id??u):h.jsx(QF,{},u))})}),nz=Bt(0),az=e=>{let[t,n]=gt(nz);return C.useEffect(()=>{let{current:a}=e;if(!a)return;let i=Mo(()=>{let{scrollTop:r}=a;n(r)},200);return a.addEventListener("scroll",i),()=>{i.cancel(),a.removeEventListener("scroll",i)}},[e,n]),t},iz=17,rz=64;function sz({isLoading:e,libraryItems:t,onAddToLibrary:n,onInsertLibraryItems:a,pendingElements:i,theme:r,id:s,libraryReturnUrl:o,onSelectItems:d,selectedItems:c}){let l=C.useRef(null),u=az(l);C.useEffect(()=>{u>0&&l.current?.scrollTo(0,u)},[]);let{svgCache:f}=Q4(),p=C.useMemo(()=>t.filter(_=>_.status!=="published"),[t]),U=C.useMemo(()=>t.filter(_=>_.status==="published"),[t]),m=!t.length&&!i.length,g=!i.length&&!p.length&&!U.length,[b,v]=C.useState(null),x=C.useCallback((_,T)=>{let L=!c.includes(_),R=[...p,...U];if(L){if(T.shiftKey&&b){let F=R.findIndex(V=>V.id===b),P=R.findIndex(V=>V.id===_);if(F===-1||P===-1){d([...c,_]);return}let $=oe(c),O=R.reduce((V,W,K)=>((K>=F&&K<=P||$.has(W.id))&&V.push(W.id),V),[]);d(O)}else d([...c,_]);v(_)}else v(null),d(c.filter(F=>F!==_))},[b,d,U,c,p]),y=C.useCallback(_=>{let T;return c.includes(_)?T=t.filter(L=>c.includes(L.id)):T=t.filter(L=>L.id===_),T.map(L=>({...L,elements:m8(L.elements,{randomizeSeed:!0})}))},[t,c]),w=C.useCallback((_,T)=>{T.dataTransfer.setData(ae.excalidrawlib,u0(y(_)))},[y]),k=C.useCallback(_=>_?c.includes(_):!1,[c]),M=C.useCallback(()=>{n(i)},[i,n]),I=C.useCallback(_=>{_&&a(y(_))},[y,a]),A=f.size>=t.length?rz:iz;return h.jsxs("div",{className:"library-menu-items-container",style:i.length||p.length||U.length?{justifyContent:"flex-start"}:{borderBottom:0},children:[!g&&h.jsx(Cg,{selectedItems:c,onSelectItems:d,className:"library-menu-dropdown-container--in-heading"}),h.jsxs(Pn.Col,{className:"library-menu-items-container__items",align:"start",gap:1,style:{flex:U.length>0?1:"0 1 auto",marginBottom:0},ref:l,children:[h.jsxs(h.Fragment,{children:[!g&&h.jsx("div",{className:"library-menu-items-container__header",children:S("labels.personalLib")}),e&&h.jsx("div",{style:{position:"absolute",top:"var(--container-padding-y)",right:"var(--container-padding-x)",transform:"translateY(50%)"},children:h.jsx(hi,{})}),!i.length&&!p.length?h.jsxs("div",{className:"library-menu-items__no-items",children:[h.jsx("div",{className:"library-menu-items__no-items__label",children:S("library.noItems")}),h.jsx("div",{className:"library-menu-items__no-items__hint",children:U.length>0?S("library.hint_emptyPrivateLibrary"):S("library.hint_emptyLibrary")})]}):h.jsxs(Ig,{children:[i.length>0&&h.jsx(Nh,{itemsRenderedPerBatch:A,items:[{id:null,elements:i}],onItemSelectToggle:x,onItemDrag:w,onClick:M,isItemSelected:k,svgCache:f}),h.jsx(Nh,{itemsRenderedPerBatch:A,items:p,onItemSelectToggle:x,onItemDrag:w,onClick:I,isItemSelected:k,svgCache:f})]})]}),h.jsxs(h.Fragment,{children:[(U.length>0||i.length>0||p.length>0)&&h.jsx("div",{className:"library-menu-items-container__header library-menu-items-container__header--excal",children:S("labels.excalidrawLib")}),U.length>0?h.jsx(Ig,{children:h.jsx(Nh,{itemsRenderedPerBatch:A,items:U,onItemSelectToggle:x,onItemDrag:w,onClick:I,isItemSelected:k,svgCache:f})}):p.length>0?h.jsx("div",{style:{margin:"1rem 0",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",fontSize:".9rem"},children:S("library.noItems")}):null]}),m&&h.jsx(i9,{style:{padding:"16px 0",width:"100%"},id:s,libraryReturnUrl:o,theme:r,children:h.jsx(Cg,{selectedItems:c,onSelectItems:d})})]})]})}var cp=Bt(!1),_g=({children:e})=>h.jsx("div",{className:"layer-ui__library",children:e}),lz=C.memo(({onInsertLibraryItems:e,pendingElements:t,onAddToLibrary:n,setAppState:a,libraryReturnUrl:i,library:r,id:s,theme:o,selectedItems:d,onSelectItems:c})=>{let[l]=gt(yo),u=C.useCallback(U=>{(async(m,g)=>{qe("element","addToLibrary","ui");for(let v of w5)if(m.some(x=>x.type===v))return a({errorMessage:S(`errors.libraryElementTypeError.${v}`)});let b=[{status:"unpublished",elements:m,id:Xn(),created:Date.now()},...g];n(),r.setLibrary(b).catch(()=>{a({errorMessage:S("alerts.errorAddingToLibrary")})})})(U,l.libraryItems)},[n,r,a,l.libraryItems]),f=C.useMemo(()=>l.libraryItems,[l]);if(l.status==="loading"&&!l.isInitialized)return h.jsx(_g,{children:h.jsx("div",{className:"layer-ui__library-message",children:h.jsxs("div",{children:[h.jsx(hi,{size:"2em"}),h.jsx("span",{children:S("labels.libraryLoadingMessage")})]})})});let p=l.libraryItems.length>0||t.length>0;return h.jsxs(_g,{children:[h.jsx(sz,{isLoading:l.status==="loading",libraryItems:f,onAddToLibrary:u,onInsertLibraryItems:e,pendingElements:t,id:s,libraryReturnUrl:i,theme:o,onSelectItems:c,selectedItems:d}),p&&h.jsx(i9,{className:"library-menu-control-buttons--at-bottom",style:{padding:"16px 12px 0 12px"},id:s,libraryReturnUrl:i,theme:o})]})}),Oh=(e,t)=>({elements:e,pending:xe(e,{selectedElementIds:t},{includeBoundTextElement:!0,includeElementsInFrames:!0}),selectedElementIds:t}),oz=(e,t)=>{let n=Pu(),[a,i]=C.useState(()=>Oh(n,e.selectedElementIds)),r=C.useRef(new Map);return C.useEffect(()=>{for(let s of a.pending)r.current.set(s.id,s.version)},[a.pending]),C.useEffect(()=>{t.state.cursorButton==="up"&&t.state.activeTool.type==="selection"&&i(s=>{if(!Wt(s.selectedElementIds,e.selectedElementIds))return r.current.clear(),Oh(n,e.selectedElementIds);let o=t.scene.getNonDeletedElementsMap();for(let d of Object.keys(e.selectedElementIds)){let c=o.get(d)?.version;if(c&&c!==r.current.get(d))return Oh(n,e.selectedElementIds)}return s})},[t,t.state.cursorButton,t.state.activeTool.type,e.selectedElementIds,n]),a.pending},dz=C.memo(()=>{let e=Ua(),{onInsertElements:t}=e,n=Wo(),a=Gt(),i=jt(),[r,s]=C.useState([]),o=C.useMemo(()=>e.library,[e.library]),d=oz(a,e),c=C.useCallback(u=>{t(a9(u))},[t]),l=C.useCallback(()=>{i({selectedElementIds:{},selectedGroupIds:{},activeEmbeddable:null})},[i]);return h.jsx(lz,{pendingElements:d,onInsertLibraryItems:c,onAddToLibrary:l,setAppState:i,libraryReturnUrl:n.libraryReturnUrl,library:o,id:e.id,theme:a.theme,selectedItems:r,onSelectItems:s})});function cz(e){if(e&&typeof e=="number")return e;switch(e){case"small":return 550;case"wide":return 1024;case"regular":default:return 800}}var pa=e=>{let[t,n]=gF(),[a]=C.useState(document.activeElement),{id:i}=za(),r=Tt().viewport.isMobile;C.useEffect(()=>{if(!t)return;let c=vf(t);setTimeout(()=>{c.length>0&&e.autofocus!==!1&&(c[1]||c[0]).focus()});let l=u=>{if(u.key===D.TAB){let f=vf(t),{activeElement:p}=document,U=f.findIndex(m=>m===p);U===0&&u.shiftKey?(f[f.length-1].focus(),u.preventDefault()):U===f.length-1&&!u.shiftKey&&(f[0].focus(),u.preventDefault())}};return t.addEventListener("keydown",l),()=>t.removeEventListener("keydown",l)},[t,e.autofocus]);let s=jt(),o=Su(cp),d=()=>{s({openMenu:null}),o(!1),a.focus(),e.onCloseRequest()};return h.jsx(bF,{className:te("Dialog",e.className,{"Dialog--fullscreen":r}),labelledBy:"dialog-title",maxWidth:cz(e.size),onCloseRequest:d,closeOnClickOutside:e.closeOnClickOutside,children:h.jsxs(da,{ref:n,children:[e.title&&h.jsx("h2",{id:`${i}-dialog-title`,className:"Dialog__title",children:h.jsx("span",{className:"Dialog__titleContent",children:e.title})}),r&&h.jsx("button",{className:"Dialog__close",onClick:d,title:S("buttons.close"),"aria-label":S("buttons.close"),type:"button",children:Ws}),h.jsx("div",{className:"Dialog__content",children:e.children})]})})},Yi=({type:e="button",onSelect:t,selected:n,children:a,className:i="",...r})=>h.jsx("button",{onClick:Qc(r.onClick,s=>{t()}),type:e,className:te("excalidraw-button",i,{selected:n}),...r,children:a}),up=C.forwardRef(({onChange:e,label:t,fullWidth:n,placeholder:a,readonly:i,selectOnRender:r,onKeyDown:s,isRedacted:o=!1,icon:d,className:c,...l},u)=>{let f=C.useRef(null);C.useImperativeHandle(u,()=>f.current),C.useLayoutEffect(()=>{r&&(f.current?.focus(),f.current?.select())},[r]);let[p,U]=C.useState(!1);return h.jsxs("div",{className:te("ExcTextField",c,{"ExcTextField--fullWidth":n,"ExcTextField--hasIcon":!!d}),onClick:()=>{f.current?.focus()},children:[d,t&&h.jsx("div",{className:"ExcTextField__label",children:t}),h.jsxs("div",{className:te("ExcTextField__input",{"ExcTextField__input--readonly":i}),children:[h.jsx("input",{className:te({"is-redacted":"value"in l&&l.value&&o&&!p}),readOnly:i,value:"value"in l?l.value:void 0,defaultValue:"defaultValue"in l?l.defaultValue:void 0,placeholder:a,ref:f,onChange:m=>e?.(m.target.value),onKeyDown:s}),o&&h.jsx(Yi,{onSelect:()=>U(!p),style:{border:0,userSelect:"none"},children:p?sC:Z1})]})]})}),uz={toggleTheme:[H("Shift+Alt+D")],saveScene:[H("CtrlOrCmd+S")],loadScene:[H("CtrlOrCmd+O")],clearCanvas:[H("CtrlOrCmd+Delete")],imageExport:[H("CtrlOrCmd+Shift+E")],commandPalette:[H("CtrlOrCmd+/"),H("CtrlOrCmd+Shift+P")],cut:[H("CtrlOrCmd+X")],copy:[H("CtrlOrCmd+C")],paste:[H("CtrlOrCmd+V")],copyStyles:[H("CtrlOrCmd+Alt+C")],pasteStyles:[H("CtrlOrCmd+Alt+V")],selectAll:[H("CtrlOrCmd+A")],deleteSelectedElements:[H("Delete")],duplicateSelection:[H("CtrlOrCmd+D"),H(`Alt+${S("helpDialog.drag")}`)],sendBackward:[H("CtrlOrCmd+[")],bringForward:[H("CtrlOrCmd+]")],sendToBack:[H(Aa?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[H(Aa?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[H("Shift+Alt+C")],group:[H("CtrlOrCmd+G")],ungroup:[H("CtrlOrCmd+Shift+G")],gridMode:[H("CtrlOrCmd+'")],zenMode:[H("Alt+Z")],objectsSnapMode:[H("Alt+S")],stats:[H("Alt+/")],addToLibrary:[],flipHorizontal:[H("Shift+H")],flipVertical:[H("Shift+V")],viewMode:[H("Alt+R")],hyperlink:[H("CtrlOrCmd+K")],toggleElementLock:[H("CtrlOrCmd+Shift+L")],resetZoom:[H("CtrlOrCmd+0")],zoomOut:[H("CtrlOrCmd+-")],zoomIn:[H("CtrlOrCmd++")],zoomToFitSelection:[H("Shift+3")],zoomToFit:[H("Shift+1")],zoomToFitSelectionInViewport:[H("Shift+2")],toggleEraserTool:[H("E")],toggleHandTool:[H("H")],setFrameAsActiveTool:[H("F")],saveFileToDisk:[H("CtrlOrCmd+S")],saveToActiveFile:[H("CtrlOrCmd+S")],toggleShortcuts:[H("?")],searchMenu:[H("CtrlOrCmd+F")],wrapSelectionInFrame:[]},en=(e,t=0)=>{let n=uz[e];return n&&n.length>0?n[t]||n[0]:""},hz="\\u0300-\\u036f",fz="\\ufe20-\\ufe2f",pz="\\u20d0-\\u20ff",Uz=hz+fz+pz,mz=`[${Uz}]`,gz=RegExp(mz,"g"),bz=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xz={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"E",æ:"e",Þ:"T",þ:"t",ß:"s",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"I",ij:"i",Œ:"E",œ:"e",ʼn:"n",ſ:"s"},Tg=e=>e.replace(bz,t=>xz[t]||t).replace(gz,""),c9=Z.createContext(null),cn=()=>Z.useContext(c9),vz=m3(),yz=()=>Z.useMemo(()=>({MainMenuTunnel:va(),WelcomeScreenMenuHintTunnel:va(),WelcomeScreenToolbarHintTunnel:va(),WelcomeScreenHelpHintTunnel:va(),WelcomeScreenCenterTunnel:va(),FooterCenterTunnel:va(),DefaultSidebarTriggerTunnel:va(),DefaultSidebarTabTriggersTunnel:va(),OverwriteConfirmDialogTunnel:va(),TTDDialogTriggerTunnel:va(),tunnelsJotai:vz}),[]),u9=(e,t)=>{let n=t[0]?.type||null;for(let a of t)if(a.type!==n){n=null;break}return Tf(e.activeTool.type)&&e.activeTool.type!=="image"&&n!=="image"&&n!=="frame"&&n!=="magicframe"||t.some(a=>Tf(a.type))},h9=(e,t)=>js(e.activeTool.type)||t.some(n=>js(n.type)),f9=({appState:e,elementsMap:t,renderAction:n,app:a})=>{let i=a7(t,e),r=!1;i.length===2&&(Hn(i[0])||Hn(i[1]))&&(r=!0);let s=!!(e.editingTextElement||e.newElement),o=Tt(),d=document.documentElement.getAttribute("dir")==="rtl",c=js(e.activeTool.type)&&!na(e.currentItemBackgroundColor)||i.some(U=>js(U.type)&&!na(U.backgroundColor)),l=i.length===1||r,u=!e.editingLinearElement&&i.length===1&&ue(i[0])&&!Q(i[0]),f=!e.croppingElementId&&i.length===1&&Re(i[0]),p=!r&&In(e,a);return h.jsxs("div",{className:"panelColumn",children:[h.jsx("div",{children:u9(e,i)&&n("changeStrokeColor")}),h9(e,i)&&h.jsx("div",{children:n("changeBackgroundColor")}),c&&n("changeFillStyle"),(S2(e.activeTool.type)||i.some(U=>S2(U.type)))&&n("changeStrokeWidth"),(e.activeTool.type==="freedraw"||i.some(U=>U.type==="freedraw"))&&n("changeStrokeShape"),(k2(e.activeTool.type)||i.some(U=>k2(U.type)))&&h.jsxs(h.Fragment,{children:[n("changeStrokeStyle"),n("changeSloppiness")]}),(jf(e.activeTool.type)||i.some(U=>jf(U.type)))&&h.jsx(h.Fragment,{children:n("changeRoundness")}),(M2(e.activeTool.type)||i.some(U=>M2(U.type)))&&h.jsx(h.Fragment,{children:n("changeArrowType")}),(e.activeTool.type==="text"||i.some(q))&&h.jsxs(h.Fragment,{children:[n("changeFontFamily"),n("changeFontSize"),(e.activeTool.type==="text"||eL(i,t))&&n("changeTextAlign")]}),QD(i,t)&&n("changeVerticalAlign"),(gc(e.activeTool.type)||i.some(U=>gc(U.type)))&&h.jsx(h.Fragment,{children:n("changeArrowhead")}),n("changeOpacity"),h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.layers")}),h.jsxs("div",{className:"buttonList",children:[n("sendToBack"),n("sendBackward"),n("bringForward"),n("bringToFront")]})]}),p&&!r&&h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.align")}),h.jsxs("div",{className:"buttonList",children:[d?h.jsxs(h.Fragment,{children:[n("alignRight"),n("alignHorizontallyCentered"),n("alignLeft")]}):h.jsxs(h.Fragment,{children:[n("alignLeft"),n("alignHorizontallyCentered"),n("alignRight")]}),i.length>2&&n("distributeHorizontally"),h.jsx("div",{style:{flexBasis:"100%",height:0}}),h.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:".5rem",marginTop:"-0.5rem"},children:[n("alignTop"),n("alignVerticallyCentered"),n("alignBottom"),i.length>2&&n("distributeVertically")]})]})]}),!s&&i.length>0&&h.jsxs("fieldset",{children:[h.jsx("legend",{children:S("labels.actions")}),h.jsxs("div",{className:"buttonList",children:[!o.editor.isMobile&&n("duplicateSelection"),!o.editor.isMobile&&n("deleteSelectedElements"),n("group"),n("ungroup"),l&&n("hyperlink"),f&&n("cropEditor"),u&&n("toggleLinearEditor")]})]})]})},p9=({activeTool:e,appState:t,app:n,UIOptions:a})=>{let[i,r]=C.useState(!1),s=e.type==="frame",o=e.type==="laser",d=e.type==="embeddable",{TTDDialogTriggerTunnel:c}=cn();return h.jsxs(h.Fragment,{children:[J1.map(({value:l,icon:u,key:f,numericKey:p,fillable:U},m)=>{if(a.tools?.[l]===!1)return null;let g=S(`toolBar.${l}`),b=f&&Nl(typeof f=="string"?f:f[0]),v=b?`${b} ${S("helpDialog.or")} ${p}`:`${p}`;return h.jsx(Ce,{className:te("Shape",{fillable:U}),type:"radio",icon:u,checked:e.type===l,name:"editor-current-shape",title:`${Nl(g)} — ${v}`,keyBindingLabel:p||b,"aria-label":Nl(g),"aria-keyshortcuts":v,"data-testid":`toolbar-${l}`,onPointerDown:({pointerType:x})=>{!t.penDetected&&x==="pen"&&n.togglePenMode(!0)},onChange:({pointerType:x})=>{t.activeTool.type!==l&&qe("toolbar",l,"ui"),l==="image"?n.setActiveTool({type:l,insertOnCanvasDirectly:x!=="mouse"}):n.setActiveTool({type:l})}},l)}),h.jsx("div",{className:"App-toolbar__divider"}),h.jsxs(Je,{open:i,children:[h.jsx(Je.Trigger,{className:te("App-toolbar__extra-tools-trigger",{"App-toolbar__extra-tools-trigger--selected":s||d||o&&!n.props.isCollaborating}),onToggle:()=>r(!i),title:S("toolBar.extraTools"),children:iC}),h.jsxs(Je.Content,{onClickOutside:()=>r(!1),onSelect:()=>r(!1),className:"App-toolbar__extra-tools-dropdown",children:[h.jsx(Je.Item,{onSelect:()=>n.setActiveTool({type:"frame"}),icon:ib,shortcut:D.F.toLocaleUpperCase(),"data-testid":"toolbar-frame",selected:s,children:S("toolBar.frame")}),h.jsx(Je.Item,{onSelect:()=>n.setActiveTool({type:"embeddable"}),icon:nM,"data-testid":"toolbar-embeddable",selected:d,children:S("toolBar.embeddable")}),h.jsx(Je.Item,{onSelect:()=>n.setActiveTool({type:"laser"}),icon:sb,"data-testid":"toolbar-laser",selected:o,shortcut:D.K.toLocaleUpperCase(),children:S("toolBar.laser")}),h.jsx("div",{style:{margin:"6px 0",fontSize:14,fontWeight:600},children:"Generate"}),n.props.aiEnabled!==!1&&h.jsx(c.Out,{}),h.jsx(Je.Item,{onSelect:()=>n.setOpenDialog({name:"ttd",tab:"mermaid"}),icon:rb,"data-testid":"toolbar-embeddable",children:S("toolBar.mermaidToExcalidraw")}),n.props.aiEnabled!==!1&&n.plugins.diagramToCode&&h.jsx(h.Fragment,{children:h.jsxs(Je.Item,{onSelect:()=>n.onMagicframeToolSelect(),icon:lb,"data-testid":"toolbar-magicframe",children:[S("toolBar.magicframe"),h.jsx(Je.Item.Badge,{children:"AI"})]})})]})]})]})},wz=({renderAction:e,zoom:t})=>h.jsx(Pn.Col,{gap:1,className:Ss.ZOOM_ACTIONS,children:h.jsxs(Pn.Row,{align:"center",children:[e("zoomOut"),e("resetZoom"),e("zoomIn")]})}),Ez=({renderAction:e,className:t})=>h.jsxs("div",{className:`undo-redo-buttons ${t}`,children:[h.jsx("div",{className:"undo-button-container",children:h.jsx(Br,{label:S("buttons.undo"),children:e("undo")})}),h.jsx("div",{className:"redo-button-container",children:h.jsxs(Br,{label:S("buttons.redo"),children:[" ",e("redo")]})})]}),Sz=({actionManager:e,showExitZenModeBtn:t})=>h.jsx("button",{type:"button",className:te("disable-zen-mode",{"disable-zen-mode--visible":t}),onClick:()=>e.executeAction(c1),children:S("buttons.exitZenMode")}),kz=({renderAction:e,className:t})=>h.jsx("div",{className:`finalize-button ${t}`,children:e("finalize",{size:"small"})}),jg=e=>{let t=C.useRef({userFn:e});return t.current.userFn=e,t.current.stableFn||(t.current.stableFn=(...n)=>t.current.userFn(...n)),t.current.stableFn},Lu=Bt(null),Mz=()=>{let[e,t]=gt(Lu),n=En();return e&&e==="clearCanvas"?h.jsx(r9,{onConfirm:()=>{n.executeAction(Xl),t(null)},onCancel:()=>t(null),title:S("clearCanvasDialog.title"),children:h.jsxs("p",{className:"clear-canvas__content",children:[" ",S("alerts.clearReset")]})}):null},U9={};U6(U9,{toggleTheme:()=>Cz});var Cz={...Rc,category:"App",label:"Toggle theme",perform:({actionManager:e})=>{e.executeAction(Rc,"commandPalette")}},m9=G({name:"copyElementLink",label:"labels.copyElementLink",icon:G1,trackEvent:{category:"element"},perform:async(e,t,n,a)=>{let i=xe(e,t);try{if(window.location){let r=T8(i,t);return r?(await Vs(a.props.generateLinkForSelection?a.props.generateLinkForSelection(r.id,r.type):_8(r.id,r.type)),{appState:{toast:{message:S("toast.elementLinkCopied"),closable:!0}},captureUpdate:B.EVENTUALLY}):{appState:t,elements:e,app:a,captureUpdate:B.EVENTUALLY}}}catch(r){console.error(r)}return{appState:t,elements:e,app:a,captureUpdate:B.EVENTUALLY}},predicate:(e,t)=>Mc(xe(e,t))}),Iz=G({name:"linkToElement",label:"labels.linkToElement",icon:ub,perform:(e,t,n,a)=>{let i=xe(e,t);return i.length!==1||!Mc(i)?{elements:e,appState:t,app:a,captureUpdate:B.EVENTUALLY}:{appState:{...t,openDialog:{name:"elementLinkSelector",sourceElementId:xe(e,t)[0].id}},captureUpdate:B.IMMEDIATELY}},predicate:(e,t,n,a)=>{let i=xe(e,t);return t.openDialog?.name!=="elementLinkSelector"&&i.length===1&&Mc(i)},trackEvent:!1}),_z=Bt(null),vt={app:"App",export:"Export",tools:"Tools",editor:"Editor",elements:"Elements",links:"Links"},Tz=e=>{switch(e){case vt.app:return 1;case vt.export:return 2;case vt.editor:return 3;case vt.tools:return 4;case vt.elements:return 5;case vt.links:return 6;default:return 10}},Zd=({shortcut:e,className:t,children:n})=>{let a=e.replace("++","+$").split("+");return h.jsxs("div",{className:te("shortcut",t),children:[a.map((i,r)=>h.jsx("div",{className:"shortcut-wrapper",children:h.jsx("div",{className:"shortcut-key",children:i==="$"?"+":i})},i)),h.jsx("div",{className:"shortcut-desc",children:n})]})},g9=e=>!e.altKey&&e[D.CTRL_OR_CMD]&&(e.shiftKey&&e.key.toLowerCase()===D.P||e.key===D.SLASH);Object.assign(e=>{let t=Gt(),n=jt();return C.useEffect(()=>{let a=i=>{g9(i)&&(i.preventDefault(),i.stopPropagation(),n(r=>{let s=r.openDialog?.name==="commandPalette"?null:{name:"commandPalette"};return s&&qe("command_palette","open","shortcut"),{openDialog:s}}))};return window.addEventListener("keydown",a,{capture:!0}),()=>window.removeEventListener("keydown",a,{capture:!0})},[n]),t.openDialog?.name!=="commandPalette"?null:h.jsx(jz,{...e})},{defaultItems:U9});function jz({customCommandPaletteItems:e}){let t=Ua(),n=Gt(),a=jt(),i=Wo(),r=En(),[s,o]=gt(_z),[d,c]=C.useState(null),l=C.useRef(null),u=Cu({uiAppState:n,customCommandPaletteItems:e,appProps:i});C.useEffect(()=>{let{uiAppState:k,customCommandPaletteItems:M,appProps:I}=u,A=R=>{let F="";return R.label&&(typeof R.label=="function"?F=S(R.label(t.scene.getNonDeletedElements(),k,t)):F=S(R.label)),F},_=R=>typeof R.icon=="function"?R.icon(k,t.scene.getNonDeletedElements()):R.icon,T=[],L=(R,F,P)=>{let $={label:A(R),icon:_(R),category:F,shortcut:en(R.name),keywords:R.keywords,predicate:R.predicate,viewMode:R.viewMode,perform:()=>{r.executeAction(R,"commandPalette")}};return P?P($,R):$};if(k&&t.scene&&r){let R=[r.actions.group,r.actions.ungroup,r.actions.cut,r.actions.copy,r.actions.deleteSelectedElements,r.actions.wrapSelectionInFrame,r.actions.copyStyles,r.actions.pasteStyles,r.actions.bringToFront,r.actions.bringForward,r.actions.sendBackward,r.actions.sendToBack,r.actions.alignTop,r.actions.alignBottom,r.actions.alignLeft,r.actions.alignRight,r.actions.alignVerticallyCentered,r.actions.alignHorizontallyCentered,r.actions.duplicateSelection,r.actions.flipHorizontal,r.actions.flipVertical,r.actions.zoomToFitSelection,r.actions.zoomToFitSelectionInViewport,r.actions.increaseFontSize,r.actions.decreaseFontSize,r.actions.toggleLinearEditor,r.actions.cropEditor,q4,m9,Iz].map(W=>L(W,vt.elements,(K,se)=>({...K,predicate:se.predicate?se.predicate:(le,Ie,Qe,rt)=>xe(le,Ie).length>0}))),F=[r.actions.toggleHandTool,r.actions.setFrameAsActiveTool].map(W=>L(W,vt.tools)),P=[r.actions.undo,r.actions.redo,r.actions.zoomIn,r.actions.zoomOut,r.actions.resetZoom,r.actions.zoomToFit,r.actions.zenMode,r.actions.viewMode,r.actions.gridMode,r.actions.objectsSnapMode,r.actions.toggleShortcuts,r.actions.selectAll,r.actions.toggleElementLock,r.actions.unlockAllElements,r.actions.stats].map(W=>L(W,vt.editor)),$=[r.actions.saveToActiveFile,r.actions.saveFileToDisk,r.actions.copyAsPng,r.actions.copyAsSvg].map(W=>L(W,vt.export));T=[...R,...P,{label:A(Xl),icon:_(Xl),shortcut:en(Xl.name),category:vt.editor,keywords:["delete","destroy"],viewMode:!1,perform:()=>{ia.set(Lu,"clearCanvas")}},{label:S("buttons.exportImage"),category:vt.export,icon:q5,shortcut:en("imageExport"),keywords:["export","image","png","jpeg","svg","clipboard","picture"],perform:()=>{a({openDialog:{name:"imageExport"}})}},...$];let O=[{label:S("toolBar.library"),category:vt.app,icon:H1,viewMode:!1,perform:()=>{k.openSidebar?a({openSidebar:null}):a({openSidebar:{name:sa.name,tab:sa.defaultTab}})}},{label:S("search.title"),category:vt.app,icon:Pr,viewMode:!0,perform:()=>{r.executeAction(b9)}},{label:S("labels.changeStroke"),keywords:["color","outline"],category:vt.elements,icon:fh,viewMode:!1,predicate:(W,K)=>{let se=xe(W,K);return se.length>0&&u9(K,se)},perform:()=>{a(W=>({openMenu:W.openMenu==="shape"?null:"shape",openPopup:"elementStroke"}))}},{label:S("labels.changeBackground"),keywords:["color","fill"],icon:fh,category:vt.elements,viewMode:!1,predicate:(W,K)=>{let se=xe(W,K);return se.length>0&&h9(K,se)},perform:()=>{a(W=>({openMenu:W.openMenu==="shape"?null:"shape",openPopup:"elementBackground"}))}},{label:S("labels.canvasBackground"),keywords:["color"],icon:fh,category:vt.editor,viewMode:!1,perform:()=>{a(W=>({openMenu:W.openMenu==="canvas"?null:"canvas",openPopup:"canvasBackground"}))}},...J1.reduce((W,K)=>{let{value:se,icon:le,key:Ie,numericKey:Qe}=K;if(I.UIOptions.tools?.[se]===!1)return W;let rt=Ie&&Nl(typeof Ie=="string"?Ie:Ie[0])||Qe,at={label:S(`toolBar.${se}`),category:vt.tools,shortcut:rt,icon:le,keywords:["toolbar"],viewMode:!1,perform:({event:ce})=>{se==="image"?t.setActiveTool({type:se,insertOnCanvasDirectly:ce.type==="keydown"}):t.setActiveTool({type:se})}};return W.push(at),W},[]),...F,{label:S("toolBar.lock"),category:vt.tools,icon:k.activeTool.locked?X1:tu,shortcut:D.Q.toLocaleUpperCase(),viewMode:!1,perform:()=>{t.toggleLock()}},{label:`${S("labels.textToDiagram")}...`,category:vt.tools,icon:oC,viewMode:!1,predicate:I.aiEnabled,perform:()=>{a(W=>({...W,openDialog:{name:"ttd",tab:"text-to-diagram"}}))}},{label:`${S("toolBar.mermaidToExcalidraw")}...`,category:vt.tools,icon:rb,viewMode:!1,predicate:I.aiEnabled,perform:()=>{a(W=>({...W,openDialog:{name:"ttd",tab:"mermaid"}}))}}],V=[...T,...O,...M||[]].map(W=>({...W,icon:W.icon||ob,order:W.order??Tz(W.category),haystack:`${Tg(W.label.toLocaleLowerCase())} ${W.keywords?.join(" ")||""}`}));c(V),o(V.find(W=>W.label===s?.label)??null)}},[u,t,r,c,s?.label,o,a]);let[f,p]=C.useState(""),[U,m]=C.useState(null),[g,b]=C.useState({}),v=k=>{a({openDialog:null},k),p("")},x=(k,M)=>{n.openDialog?.name==="commandPalette"&&(M.stopPropagation(),M.preventDefault(),document.body.classList.add("excalidraw-animations-disabled"),v(()=>{k.perform({actionManager:r,event:M}),o(k),requestAnimationFrame(()=>{document.body.classList.remove("excalidraw-animations-disabled")})}))},y=jg(k=>k.viewMode===!1&&n.viewModeEnabled?!1:typeof k.predicate=="function"?k.predicate(t.scene.getNonDeletedElements(),n,i,t):k.predicate===void 0||k.predicate),w=jg(k=>{let M=cr(k.target)||g9(k)||k.key===D.ESCAPE;if(M&&k.key!==D.ARROW_UP&&k.key!==D.ARROW_DOWN&&k.key!==D.ENTER)return;let I=Object.values(g).flat(),A=s&&!f&&y(s);if(k.key===D.ARROW_UP){k.preventDefault();let _=I.findIndex(R=>R.label===U?.label);if(A){if(_===0){m(s);return}if(U===s){let R=I[I.length-1];R&&m(R);return}}let T;_===-1?T=I.length-1:T=_===0?I.length-1:(_-1)%I.length;let L=I[T];L&&m(L);return}if(k.key===D.ARROW_DOWN){k.preventDefault();let _=I.findIndex(R=>R.label===U?.label);if(A){if(!U||_===I.length-1){m(s);return}if(U===s){let R=I[0];R&&m(R);return}}let T=(_+1)%I.length,L=I[T];L&&m(L);return}if(k.key===D.ENTER&&U&&setTimeout(()=>{x(U,k)}),!M){if(k.stopPropagation(),/^[a-zA-Z0-9]$/.test(k.key)){l?.current?.focus();return}k.preventDefault()}});return C.useEffect(()=>(window.addEventListener("keydown",w,{capture:!0}),()=>window.removeEventListener("keydown",w,{capture:!0})),[w]),C.useEffect(()=>{if(!d)return;let k=_=>{let T={};for(let L of _)T[L.category]?T[L.category].push(L):T[L.category]=[L];return T},M=d.filter(y).sort((_,T)=>_.order-T.order),I=!f&&s&&y(s);if(!f){b(k(I?M.filter(_=>_.label!==s?.label):M)),m(I?s:M[0]||null);return}let A=Tg(f.toLocaleLowerCase().replace(/[<>_| -]/g,""));M=EN.filter(A,M,{extract:_=>_.haystack}).sort((_,T)=>T.score-_.score).map(_=>_.original),b(k(M)),m(M[0]??null)},[f,d,y,s]),h.jsxs(pa,{onCloseRequest:()=>v(),closeOnClickOutside:!0,title:!1,size:720,autofocus:!0,className:"command-palette-dialog",children:[h.jsx(up,{value:f,placeholder:S("commandPalette.search.placeholder"),onChange:k=>{p(k)},selectOnRender:!0,ref:l}),!t.device.viewport.isMobile&&h.jsxs("div",{className:"shortcuts-wrapper",children:[h.jsx(Zd,{shortcut:"↑↓",children:S("commandPalette.shortcuts.select")}),h.jsx(Zd,{shortcut:"↵",children:S("commandPalette.shortcuts.confirm")}),h.jsx(Zd,{shortcut:H("Esc"),children:S("commandPalette.shortcuts.close")})]}),h.jsxs("div",{className:"commands",children:[s&&!f&&h.jsxs("div",{className:"command-category",children:[h.jsxs("div",{className:"command-category-title",children:[S("commandPalette.recents"),h.jsx("div",{className:"icon",style:{marginLeft:"6px"},children:dC})]}),h.jsx(Ag,{command:s,isSelected:s.label===U?.label,onClick:k=>x(s,k),disabled:!y(s),onMouseMove:()=>m(s),showShortcut:!t.device.viewport.isMobile,appState:n})]}),Object.keys(g).length>0?Object.keys(g).map((k,M)=>h.jsxs("div",{className:"command-category",children:[h.jsx("div",{className:"command-category-title",children:k}),g[k].map(I=>h.jsx(Ag,{command:I,isSelected:I.label===U?.label,onClick:A=>x(I,A),onMouseMove:()=>m(I),showShortcut:!t.device.viewport.isMobile,appState:n},I.label))]},k)):d?h.jsxs("div",{className:"no-match",children:[h.jsx("div",{className:"icon",children:Pr})," ",S("commandPalette.search.noMatch")]}):null]})]})}var Ag=({command:e,isSelected:t,disabled:n,onMouseMove:a,onClick:i,showShortcut:r,appState:s})=>{let o=()=>{};return h.jsxs("div",{className:te("command-item",{"item-selected":t,"item-disabled":n}),ref:d=>{t&&!n&&d?.scrollIntoView?.({block:"nearest"})},onClick:n?o:i,onMouseMove:n?o:a,title:n?S("commandPalette.itemNotAvailable"):"",children:[h.jsxs("div",{className:"name",children:[e.icon&&h.jsx(_u,{icon:typeof e.icon=="function"?e.icon(s):e.icon}),e.label]}),r&&e.shortcut&&h.jsx(Zd,{shortcut:e.shortcut})]})},Az=G({name:"toggleLinearEditor",category:vt.elements,label:(e,t,n)=>n.scene.getSelectedElements({selectedElementIds:t.selectedElementIds})[0]?.type==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit",keywords:["line"],trackEvent:{category:"element"},predicate:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t);return!!(!t.editingLinearElement&&i.length===1&&ue(i[0])&&!Q(i[0]))},perform(e,t,n,a){let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0],r=t.editingLinearElement?.elementId===i.id?null:new J(i);return{appState:{...t,editingLinearElement:r},captureUpdate:B.IMMEDIATELY}},PanelComponent:({appState:e,updateData:t,app:n})=>{let a=n.scene.getSelectedElements({selectedElementIds:e.selectedElementIds})[0],i=S(a.type==="arrow"?"labels.lineEditor.editArrow":"labels.lineEditor.edit");return h.jsx(Ce,{type:"button",icon:EC,title:i,"aria-label":i,onClick:()=>t(null)})}}),b9=G({name:"searchMenu",icon:Pr,keywords:["search","find"],label:"search.title",viewMode:!0,trackEvent:{category:"search_menu",action:"toggle",predicate:e=>e.gridModeEnabled},perform(e,t,n,a){if(t.openSidebar?.name===sa.name&&t.openSidebar.tab===xs){let i=a.excalidrawContainerValue.container?.querySelector(`.${Ss.SEARCH_MENU_INPUT_WRAPPER} input`);return i?.matches(":focus")?{appState:{...t,openSidebar:null},captureUpdate:B.EVENTUALLY}:(i?.focus(),i?.select(),!1)}return{appState:{...t,openSidebar:{name:sa.name,tab:xs},openDialog:null},captureUpdate:B.EVENTUALLY}},checked:e=>e.gridModeEnabled,predicate:(e,t,n)=>n.gridModeEnabled===void 0,keyTest:e=>e[D.CTRL_OR_CMD]&&e.key===D.F}),Dz=G({name:"cropEditor",label:"helpDialog.cropStart",icon:x2,viewMode:!0,trackEvent:{category:"menu"},keywords:["image","crop"],perform(e,t,n,a){let i=a.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!0})[0];return{appState:{...t,isCropping:!1,croppingElementId:i.id},captureUpdate:B.IMMEDIATELY}},predicate:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t);return!!(!t.croppingElementId&&i.length===1&&Re(i[0]))},PanelComponent:({appState:e,updateData:t,app:n})=>{let a=S("helpDialog.cropStart");return h.jsx(Ce,{type:"button",icon:x2,title:a,"aria-label":a,onClick:()=>t(null)})}}),Oc=class{constructor(e=!0,t=!0){this.isUndoStackEmpty=e,this.isRedoStackEmpty=t}},Dg=class Tl{constructor(){j(this,"onHistoryChangedEmitter",new Sa),j(this,"undoStack",[]),j(this,"redoStack",[])}get isUndoStackEmpty(){return this.undoStack.length===0}get isRedoStackEmpty(){return this.redoStack.length===0}clear(){this.undoStack.length=0,this.redoStack.length=0}record(t,n){let a=Lz.create(n,t);a.isEmpty()||(this.undoStack.push(a.inverse()),a.elementsChange.isEmpty()||(this.redoStack.length=0),this.onHistoryChangedEmitter.trigger(new Oc(this.isUndoStackEmpty,this.isRedoStackEmpty)))}undo(t,n,a){return this.perform(t,n,a,()=>Tl.pop(this.undoStack),i=>Tl.push(this.redoStack,i,t))}redo(t,n,a){return this.perform(t,n,a,()=>Tl.pop(this.redoStack),i=>Tl.push(this.undoStack,i,t))}perform(t,n,a,i,r){try{let s=i();if(s===null)return;let o=t,d=n,c=!1;for(;s;){try{[o,d,c]=s.applyTo(o,d,a)}finally{r(s)}if(c)break;s=i()}return[o,d]}finally{this.onHistoryChangedEmitter.trigger(new Oc(this.isUndoStackEmpty,this.isRedoStackEmpty))}}static pop(t){if(!t.length)return null;let n=t.pop();return n!==void 0?n:null}static push(t,n,a){let i=n.inverse().applyLatestChanges(a);return t.push(i)}},Lz=class Yd{constructor(t,n){this.appStateChange=t,this.elementsChange=n}static create(t,n){return new Yd(t,n)}inverse(){return new Yd(this.appStateChange.inverse(),this.elementsChange.inverse())}applyTo(t,n,a){let[i,r]=this.elementsChange.applyTo(t,a.elements),[s,o]=this.appStateChange.applyTo(n,i);return[i,s,r||o]}applyLatestChanges(t){let n=this.elementsChange.applyLatestChanges(t);return Yd.create(this.appStateChange,n)}isEmpty(){return this.appStateChange.isEmpty()&&this.elementsChange.isEmpty()}},x9=(e,t)=>{let[n,a]=C.useState(t);return C.useEffect(()=>{let i=e.on(r=>{a(r)});return()=>{i()}},[e]),n},v9=(e,t,n)=>{if(!t.multiElement&&!t.resizingElement&&!t.editingTextElement&&!t.newElement&&!t.selectedElementsAreBeingDragged&&!t.selectionElement&&!e.flowChartCreator.isCreatingChart){let a=n();if(!a)return{captureUpdate:B.EVENTUALLY};let[i,r]=a,s=Array.from(i.values());return{appState:r,elements:s,captureUpdate:B.NEVER}}return{captureUpdate:B.EVENTUALLY}},Rz=(e,t)=>({name:"undo",label:"buttons.undo",icon:i2,trackEvent:{category:"history"},viewMode:!1,perform:(n,a,i,r)=>v9(r,a,()=>e.undo(oe(n),a,t.snapshot)),keyTest:n=>n[D.CTRL_OR_CMD]&&If(n,D.Z)&&!n.shiftKey,PanelComponent:({updateData:n,data:a})=>{let{isUndoStackEmpty:i}=x9(e.onHistoryChangedEmitter,new Oc(e.isUndoStackEmpty,e.isRedoStackEmpty));return h.jsx(Ce,{type:"button",icon:i2,"aria-label":S("buttons.undo"),onClick:n,size:a?.size||"medium",disabled:i,"data-testid":"button-undo"})}}),Pz=(e,t)=>({name:"redo",label:"buttons.redo",icon:r2,trackEvent:{category:"history"},viewMode:!1,perform:(n,a,i,r)=>v9(r,a,()=>e.redo(oe(n),a,t.snapshot)),keyTest:n=>n[D.CTRL_OR_CMD]&&n.shiftKey&&If(n,D.Z)||m5&&n.ctrlKey&&!n.shiftKey&&If(n,D.Y),PanelComponent:({updateData:n,data:a})=>{let{isRedoStackEmpty:i}=x9(e.onHistoryChangedEmitter,new Oc(e.isUndoStackEmpty,e.isRedoStackEmpty));return h.jsx(Ce,{type:"button",icon:r2,"aria-label":S("buttons.redo"),onClick:n,size:a?.size||"medium",disabled:i,"data-testid":"button-redo"})}}),$h=(e,t,n,a,i,r)=>{if(e.trackEvent)try{typeof e.trackEvent=="object"&&(!e.trackEvent.predicate||e.trackEvent.predicate(n,a,r))&&qe(e.trackEvent.category,e.trackEvent.action||e.name,`${t} (${i.device.editor.isMobile?"mobile":"desktop"})`)}catch(s){console.error("error while logging action:",s)}},Nz=class{constructor(e,t,n,a){j(this,"actions",{}),j(this,"updater"),j(this,"getAppState"),j(this,"getElementsIncludingDeleted"),j(this,"app"),j(this,"renderAction",(i,r)=>{let s=this.app.props.UIOptions.canvasActions;if(this.actions[i]&&"PanelComponent"in this.actions[i]&&(!(i in s)||s[i])){let o=this.actions[i],d=o.PanelComponent;d.displayName="PanelComponent";let c=this.getElementsIncludingDeleted(),l=this.getAppState(),u=f=>{$h(o,"ui",l,c,this.app,f),this.updater(o.perform(this.getElementsIncludingDeleted(),this.getAppState(),f,this.app))};return h.jsx(d,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:u,appProps:this.app.props,app:this.app,data:r})}return null}),j(this,"isActionEnabled",i=>{let r=this.getElementsIncludingDeleted(),s=this.getAppState();return!i.predicate||i.predicate(r,s,this.app.props,this.app)}),this.updater=i=>{if(jo(i))i.then(r=>e(r));else return e(i)},this.getAppState=t,this.getElementsIncludingDeleted=n,this.app=a}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach(t=>this.registerAction(t))}handleKeyDown(e){let t=this.app.props.UIOptions.canvasActions,n=Object.values(this.actions).sort((o,d)=>(d.keyPriority||0)-(o.keyPriority||0)).filter(o=>(o.name in t?t[o.name]:!0)&&o.keyTest&&o.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted(),this.app));if(n.length!==1)return n.length>1&&console.warn("Canceling as multiple actions match this shortcut",n),!1;let a=n[0];if(this.getAppState().viewModeEnabled&&a.viewMode!==!0)return!1;let i=this.getElementsIncludingDeleted(),r=this.getAppState();return $h(a,"keyboard",r,i,this.app,null),e.preventDefault(),e.stopPropagation(),this.updater(n[0].perform(i,r,null,this.app)),!0}executeAction(e,t="api",n=null){let a=this.getElementsIncludingDeleted(),i=this.getAppState();$h(e,t,i,a,this.app,n),this.updater(e.perform(a,i,n,this.app))}},Lg=e=>{let t=Array.from(e.values());return{x:Pg(t,n=>n.x)/t.length,y:Pg(t,n=>n.y)/t.length}},Rg=([e,t])=>Math.hypot(e.x-t.x,e.y-t.y),Pg=(e,t)=>e.reduce((n,a)=>n+t(a),0),Oz=({children:e,left:t,top:n,onCloseRequest:a,fitInViewport:i=!1,offsetLeft:r=0,offsetTop:s=0,viewportWidth:o=window.innerWidth,viewportHeight:d=window.innerHeight})=>{let c=C.useRef(null);C.useEffect(()=>{let u=c.current;if(!u)return;u.contains(document.activeElement)||u.focus();let f=p=>{if(p.key===D.TAB){let U=vf(u),{activeElement:m}=document,g=U.findIndex(b=>b===m);m===u?(p.shiftKey?U[U.length-1]?.focus():U[0].focus(),p.preventDefault(),p.stopImmediatePropagation()):g===0&&p.shiftKey?(U[U.length-1]?.focus(),p.preventDefault(),p.stopImmediatePropagation()):g===U.length-1&&!p.shiftKey&&(U[0]?.focus(),p.preventDefault(),p.stopImmediatePropagation())}};return u.addEventListener("keydown",f),()=>u.removeEventListener("keydown",f)},[]);let l=C.useRef(null);return C.useLayoutEffect(()=>{if(i&&c.current&&n!=null&&t!=null){let u=c.current,{width:f,height:p}=u.getBoundingClientRect();if(l.current?.top===n&&l.current?.left===t)return;l.current={top:n,left:t},f>=o?(u.style.width=`${o}px`,u.style.left="0px",u.style.overflowX="scroll"):t+f-r>o?u.style.left=`${o-f-10}px`:u.style.left=`${t}px`,p>=d?(u.style.height=`${d-20}px`,u.style.top="10px",u.style.overflowY="scroll"):n+p-s>d?u.style.top=`${d-p}px`:u.style.top=`${n}px`}},[n,t,i,o,d,r,s]),C.useEffect(()=>{if(a){let u=f=>{c.current?.contains(f.target)||Kt.unstable_batchedUpdates(()=>a(f))};return document.addEventListener("pointerdown",u,!1),()=>document.removeEventListener("pointerdown",u,!1)}},[a]),h.jsx("div",{className:"popover",ref:c,tabIndex:-1,children:e})},At="separator",$z=Z.memo(({actionManager:e,items:t,top:n,left:a,onClose:i})=>{let r=Vo(),s=Pu(),o=t.reduce((d,c)=>(c&&(c===At||!c.predicate||c.predicate(s,r,e.app.props,e.app))&&d.push(c),d),[]);return h.jsx(Oz,{onCloseRequest:()=>{i()},top:n,left:a,fitInViewport:!0,offsetLeft:r.offsetLeft,offsetTop:r.offsetTop,viewportWidth:r.width,viewportHeight:r.height,children:h.jsx("ul",{className:"context-menu",onContextMenu:d=>d.preventDefault(),children:o.map((d,c)=>{if(d===At)return!o[c-1]||o[c-1]===At?null:h.jsx("hr",{className:"context-menu-item-separator"},c);let l=d.name,u="";return d.label&&(typeof d.label=="function"?u=S(d.label(s,r,e.app)):u=S(d.label)),h.jsx("li",{"data-testid":l,onClick:()=>{i(()=>{e.executeAction(d,"contextMenu")})},children:h.jsxs("button",{type:"button",className:te("context-menu-item",{dangerous:l==="deleteSelectedElements",checkmark:d.checked?.(r)}),children:[h.jsx("div",{className:"context-menu-item__label",children:u}),h.jsx("kbd",{className:"context-menu-item__shortcut",children:l?en(l):""})]})},c)})})})}),Fz=({children:e,onClose:t})=>{let[n,a]=C.useState(!!e),{container:i}=za(),r=Z.useCallback(()=>{a(!1),t&&t(),i?.focus()},[t,i]);return h.jsx(h.Fragment,{children:n&&h.jsx(pa,{size:"small",onCloseRequest:r,title:S("errorDialog.title"),children:h.jsx("div",{style:{whiteSpace:"pre-wrap"},children:e})})})},y9=function({onChange:e,value:t,choices:n,name:a}){return h.jsx("div",{className:"RadioGroup",children:n.map(i=>h.jsxs("div",{className:te("RadioGroup__choice",{active:i.value===t}),title:i.ariaLabel,children:[h.jsx("input",{name:a,type:"radio",checked:i.value===t,onChange:()=>e(i.value),"aria-label":i.ariaLabel}),i.label]},String(i.value)))})},md=({title:e,name:t,checked:n,onChange:a,disabled:i=!1})=>h.jsx("div",{className:te("Switch",{toggled:n,disabled:i}),children:h.jsx("input",{name:t,id:t,title:e,type:"checkbox",checked:n,disabled:i,onChange:()=>a(!n),onKeyDown:r=>{r.key===" "&&a(!n)}})}),Gl=C.forwardRef(({children:e,icon:t,onClick:n,label:a,variant:i="filled",color:r="primary",size:s="medium",fullWidth:o,className:d,status:c},l)=>{let[u,f]=C.useState(!1),p=async m=>{let g=n?.(m);if(jo(g)){let b=window.setTimeout(()=>{f(!0)},50);try{await g}catch(v){if(v instanceof iu)console.warn(v);else throw v}finally{clearTimeout(b),f(!1)}}},U=u?"loading":c;return r=U==="success"?"success":r,h.jsx("button",{className:te("ExcButton",`ExcButton--color-${r}`,`ExcButton--variant-${i}`,`ExcButton--size-${s}`,`ExcButton--status-${U}`,{"ExcButton--fullWidth":o},d),onClick:p,type:"button","aria-label":a,ref:l,disabled:U==="loading"||U==="success",children:h.jsxs("div",{className:"ExcButton__contents",children:[U==="loading"?h.jsx(hi,{className:"ExcButton__statusIcon"}):U==="success"&&h.jsx("div",{className:"ExcButton__statusIcon",children:tC}),t&&h.jsx("div",{className:"ExcButton__icon","aria-hidden":!0,children:t}),i!=="icon"&&(e??a)]})})}),zz=2e3,Bz=()=>{let[e,t]=C.useState(null),n=C.useRef(0),a=()=>{clearTimeout(n.current),t("success"),n.current=window.setTimeout(()=>{t(null)},zz)},i=C.useCallback(()=>{t(null)},[]);return{copyStatus:e,resetCopyStatus:i,onCopy:a}},Hz="filter"in document.createElement("canvas").getContext("2d"),Xz=()=>h.jsxs("div",{children:[h.jsx("h3",{children:S("canvasError.cannotShowPreview")}),h.jsx("p",{children:h.jsx("span",{children:S("canvasError.canvasTooBig")})}),h.jsxs("em",{children:["(",S("canvasError.canvasTooBigTip"),")"]})]}),Wz=({appStateSnapshot:e,elementsSnapshot:t,files:n,actionManager:a,onExportImage:i,name:r})=>{let s=_t(t,e),[o,d]=C.useState(r),[c,l]=C.useState(s),[u,f]=C.useState(e.exportBackground),[p,U]=C.useState(e.exportWithDarkMode),[m,g]=C.useState(e.exportEmbedScene),[b,v]=C.useState(e.exportScale),x=C.useRef(null),[y,w]=C.useState(null),{onCopy:k,copyStatus:M,resetCopyStatus:I}=Bz();C.useEffect(()=>{I()},[o,u,p,b,m,I]);let{exportedElements:A,exportingFrame:_}=ju(t,e,c);return C.useEffect(()=>{let T=x.current;if(!T)return;let L=T.offsetWidth,R=T.offsetHeight;L&&$o({elements:A,appState:{...e,name:o,exportBackground:u,exportWithDarkMode:p,exportScale:b,exportEmbedScene:m},files:n,exportPadding:Bs,maxWidthOrHeight:Math.max(L,R),exportingFrame:_}).then(F=>(w(null),xo(F).then(()=>{T.replaceChildren(F)}).catch(P=>{throw P.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(S("canvasError.canvasTooBig")):P}))).catch(F=>{console.error(F),w(F)})},[e,n,A,_,o,u,p,b,m]),h.jsxs("div",{className:"ImageExportModal",children:[h.jsx("h3",{children:S("imageExportDialog.header")}),h.jsxs("div",{className:"ImageExportModal__preview",children:[h.jsx("div",{className:"ImageExportModal__preview__canvas",ref:x,children:y&&h.jsx(Xz,{})}),h.jsx("div",{className:"ImageExportModal__preview__filename",children:!Wr&&h.jsx("input",{type:"text",className:"TextInput",value:o,style:{width:"30ch"},onChange:T=>{d(T.target.value),a.executeAction(O$,"ui",T.target.value)}})})]}),h.jsxs("div",{className:"ImageExportModal__settings",children:[h.jsx("h3",{children:S("imageExportDialog.header")}),s&&h.jsx(hl,{label:S("imageExportDialog.label.onlySelected"),name:"exportOnlySelected",children:h.jsx(md,{name:"exportOnlySelected",checked:c,onChange:T=>{l(T)}})}),h.jsx(hl,{label:S("imageExportDialog.label.withBackground"),name:"exportBackgroundSwitch",children:h.jsx(md,{name:"exportBackgroundSwitch",checked:u,onChange:T=>{f(T),a.executeAction(F$,"ui",T)}})}),Hz&&h.jsx(hl,{label:S("imageExportDialog.label.darkMode"),name:"exportDarkModeSwitch",children:h.jsx(md,{name:"exportDarkModeSwitch",checked:p,onChange:T=>{U(T),a.executeAction(z$,"ui",T)}})}),h.jsx(hl,{label:S("imageExportDialog.label.embedScene"),tooltip:S("imageExportDialog.tooltip.embedScene"),name:"exportEmbedSwitch",children:h.jsx(md,{name:"exportEmbedSwitch",checked:m,onChange:T=>{g(T),a.executeAction(B4,"ui",T)}})}),h.jsx(hl,{label:S("imageExportDialog.label.scale"),name:"exportScale",children:h.jsx(y9,{name:"exportScale",value:b,onChange:T=>{v(T),a.executeAction($$,"ui",T)},choices:R1.map(T=>({value:T,label:`${T}×`}))})}),h.jsxs("div",{className:"ImageExportModal__settings__buttons",children:[h.jsx(Gl,{className:"ImageExportModal__settings__buttons__button",label:S("imageExportDialog.title.exportToPng"),onClick:()=>i(lh.png,A,{exportingFrame:_}),icon:b2,children:S("imageExportDialog.button.exportToPng")}),h.jsx(Gl,{className:"ImageExportModal__settings__buttons__button",label:S("imageExportDialog.title.exportToSvg"),onClick:()=>i(lh.svg,A,{exportingFrame:_}),icon:b2,children:S("imageExportDialog.button.exportToSvg")}),(k0||ao)&&h.jsx(Gl,{className:"ImageExportModal__settings__buttons__button",label:S("imageExportDialog.title.copyPngToClipboard"),status:M,onClick:async()=>{await i(lh.clipboard,A,{exportingFrame:_}),k()},icon:G1,children:S("imageExportDialog.button.copyPngToClipboard")})]})]})]})},hl=({label:e,children:t,tooltip:n,name:a})=>h.jsxs("div",{className:"ImageExportModal__settings__setting",title:e,children:[h.jsxs("label",{htmlFor:a,className:"ImageExportModal__settings__setting__label",children:[e,n&&h.jsx(Br,{label:n,long:!0,children:eC})]}),h.jsx("div",{className:"ImageExportModal__settings__setting__content",children:t})]}),Vz=({elements:e,appState:t,files:n,actionManager:a,onExportImage:i,onCloseRequest:r,name:s})=>{let[{appStateSnapshot:o,elementsSnapshot:d}]=C.useState(()=>({appStateSnapshot:ti(t),elementsSnapshot:ti(e)}));return h.jsx(pa,{onCloseRequest:r,size:"wide",title:!1,children:h.jsx(Wz,{elementsSnapshot:d,appStateSnapshot:o,files:n,actionManager:a,onExportImage:i,name:s})})},w9=({children:e,side:t,className:n})=>h.jsx("div",{className:te("FixedSideContainer",`FixedSideContainer_side_${t}`,n),children:e}),ws=100,Es=100,Ng=e=>{switch(e){case D.ARROW_UP:return"up";case D.ARROW_DOWN:return"down";case D.ARROW_RIGHT:return"right";case D.ARROW_LEFT:return"left";default:return"right"}},E9=(e,t,n,a)=>{let i=[...n.values()].reduce((r,s)=>{let o;if(Q(s)&&(o=s[e==="predecessors"?"startBinding":"endBinding"])&&s[e==="predecessors"?"endBinding":"startBinding"]?.elementId===t.id){let d=n.get(o.elementId);if(!d)return r;tn(ua(d),"not an ExcalidrawBindableElement");let c=e==="predecessors"?s.points[s.points.length-1]:[0,0],l=Nb(t,Ma(t),[c[0]+s.x,c[1]+s.y]);r.push({relative:d,heading:l})}return r},[]);switch(a){case"up":return i.filter(r=>mt(r.heading,mn)).map(r=>r.relative);case"down":return i.filter(r=>mt(r.heading,$t)).map(r=>r.relative);case"right":return i.filter(r=>mt(r.heading,pt)).map(r=>r.relative);case"left":return i.filter(r=>mt(r.heading,Un)).map(r=>r.relative)}},m1=(e,t,n)=>E9("successors",e,t,n),g1=(e,t,n)=>E9("predecessors",e,t,n),Gz=(e,t,n)=>{let a=Es+e.width;if(n==="up"||n==="down"){let o=ws+e.height,d=e.x,c=e.x+e.width;if(t.every(l=>l.x+l.width<d||l.x>c))return{x:0,y:o*(n==="up"?-1:1)}}else if(n==="right"||n==="left"){let o=e.y,d=e.y+e.height;if(t.every(c=>c.y+c.height<o||c.y>d))return{x:(Es+e.width)*(n==="left"?-1:1),y:0}}if(n==="up"||n==="down"){let o=ws+e.height,d=(t.length,o),c=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*a:t.length/2*a*-1;return n==="up"?{x:c,y:d*-1}:{x:c,y:d}}let i=ws+e.height,r=(t.length,Es+e.width),s=t.length===0?0:(t.length+1)%2===0?(t.length+1)/2*i:t.length/2*i*-1;return n==="left"?{x:r*-1,y:s}:{x:r,y:s}},Zz=(e,t,n,a)=>{let i=m1(e,t,a),r=g1(e,t,a),s=Gz(e,[...i,...r],a),o=Pa({type:e.type,x:e.x+s.x,y:e.y+s.y,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});tn(eu(o),"not an ExcalidrawFlowchartNodeElement");let d=S9(e,o,t,a,n);return{nextNode:o,bindingArrow:d}},Yz=(e,t,n,a,i)=>{let r=[];for(let s=0;s<i;s++){let o,d;if(a==="left"||a==="right"){let u=ws*(i-1)+i*e.height,f=e.y+e.height/2-u/2,p=Es+e.width;a==="left"&&(p*=-1),o=e.x+p;let U=(ws+e.height)*s;d=f+U}else{let u=Es*(i-1)+i*e.width,f=e.x+e.width/2-u/2,p=ws+e.height;a==="up"&&(p*=-1),d=e.y+p;let U=(Es+e.width)*s;o=f+U}let c=Pa({type:e.type,x:o,y:d,width:e.width,height:e.height,roundness:e.roundness,roughness:e.roughness,backgroundColor:e.backgroundColor,strokeColor:e.strokeColor,strokeWidth:e.strokeWidth,opacity:e.opacity,fillStyle:e.fillStyle,strokeStyle:e.strokeStyle});tn(eu(c),"not an ExcalidrawFlowchartNodeElement");let l=S9(e,c,t,a,n);r.push(c),r.push(l)}return r},S9=(e,t,n,a,i)=>{let r,s;switch(a){case"up":{r=e.x+e.width/2,s=e.y-6;break}case"down":{r=e.x+e.width/2,s=e.y+e.height+6;break}case"right":{r=e.x+e.width+6,s=e.y+e.height/2;break}case"left":{r=e.x-6,s=e.y+e.height/2;break}}let o,d;switch(a){case"up":{o=t.x+t.width/2-r,d=t.y+t.height-s+6;break}case"down":{o=t.x+t.width/2-r,d=t.y-s-6;break}case"right":{o=t.x-r-6,d=t.y-s+t.height/2;break}case"left":{o=t.x+t.width-r+6,d=t.y-s+t.height/2;break}}let c=o0({type:"arrow",x:r,y:s,startArrowhead:null,endArrowhead:i.currentItemEndArrowhead,strokeColor:e.strokeColor,strokeStyle:e.strokeStyle,strokeWidth:e.strokeWidth,opacity:e.opacity,roughness:e.roughness,points:[E(0,0),E(o,d)],elbowed:!0});La(c,e,"start",n),La(c,t,"end",n);let l=new Map;l.set(e.id,e),l.set(t.id,t),l.set(c.id,c),J.movePoints(c,[{index:1,point:c.points[1]}]);let u=b0(c,zn(new Map([...n.entries(),[e.id,e],[t.id,t],[c.id,c]])),{points:c.points});return{...c,...u}},Kz=class{constructor(){j(this,"isExploring",!1),j(this,"sameLevelNodes",[]),j(this,"sameLevelIndex",0),j(this,"direction",null),j(this,"visitedNodes",new Set)}clear(){this.isExploring=!1,this.sameLevelNodes=[],this.sameLevelIndex=0,this.direction=null,this.visitedNodes.clear()}exploreByDirection(e,t,n){if(!ua(e))return null;if(n!==this.direction&&this.clear(),this.visitedNodes.has(e.id)||this.visitedNodes.add(e.id),this.isExploring&&n===this.direction&&this.sameLevelNodes.length>1)return this.sameLevelIndex=(this.sameLevelIndex+1)%this.sameLevelNodes.length,this.sameLevelNodes[this.sameLevelIndex].id;let a=[...m1(e,t,n),...g1(e,t,n)];if(a.length>0)return this.sameLevelIndex=0,this.isExploring=!0,this.sameLevelNodes=a,this.direction=n,this.visitedNodes.add(a[0].id),a[0].id;if(n===this.direction||!this.isExploring){this.isExploring||this.visitedNodes.add(e.id);let i=["up","right","down","left"].filter(r=>r!==n).map(r=>[...m1(e,t,r),...g1(e,t,r)]).flat().filter(r=>!this.visitedNodes.has(r.id));for(let r of i)if(!this.visitedNodes.has(r.id))return this.visitedNodes.add(r.id),this.isExploring=!0,this.direction=n,r.id}return null}},qz=class{constructor(){j(this,"isCreatingChart",!1),j(this,"numberOfNodes",0),j(this,"direction","right"),j(this,"pendingNodes",null)}createNodes(e,t,n,a){if(a!==this.direction){let{nextNode:i,bindingArrow:r}=Zz(e,t,n,a);this.numberOfNodes=1,this.isCreatingChart=!0,this.direction=a,this.pendingNodes=[i,r]}else{this.numberOfNodes+=1;let i=Yz(e,t,n,a,this.numberOfNodes);this.isCreatingChart=!0,this.direction=a,this.pendingNodes=i}if(e.frameId){let i=t.get(e.frameId);tn(i&&F5(i),"not an ExcalidrawFrameElement"),i&&this.pendingNodes.every(r=>Fo([r],i,t)||Gi(r,i,t))&&(this.pendingNodes=this.pendingNodes.map(r=>X(r,{frameId:e.frameId},!1)))}}clear(){this.isCreatingChart=!1,this.pendingNodes=null,this.direction=null,this.numberOfNodes=0}},Jz=(e,t)=>{for(let[,n]of t)if(n.type==="arrow"&&(n.startBinding?.elementId===e.id||n.endBinding?.elementId===e.id))return!0;return!1},Qz=({appState:e,isMobile:t,device:n,app:a})=>{let{activeTool:i,isResizing:r,isRotating:s,lastPointerDownWith:o}=e,d=e.multiElement!==null;if(e.openSidebar?.name===sa.name&&e.openSidebar.tab===xs&&e.searchMatches?.length)return S("hints.dismissSearch");if(e.openSidebar&&!n.editor.canFitSidebar)return null;if(Ea(e))return S("hints.eraserRevert");if(i.type==="arrow"||i.type==="line")return d?S("hints.linearElementMulti"):i.type==="arrow"?S("hints.arrowTool",{arrowShortcut:H("A")}):S("hints.linearElement");if(i.type==="freedraw")return S("hints.freeDraw");if(i.type==="text")return S("hints.text");if(i.type==="embeddable")return S("hints.embeddable");if(e.activeTool.type==="image"&&e.pendingImageElementId)return S("hints.placeImage");let c=a.scene.getSelectedElements(e);if(r&&o==="mouse"&&c.length===1){let l=c[0];return ue(l)&&l.points.length===2?S("hints.lockAngle"):Re(l)?S("hints.resizeImage"):S("hints.resize")}if(s&&o==="mouse")return S("hints.rotate");if(c.length===1&&q(c[0]))return S("hints.text_selected");if(e.editingTextElement)return S("hints.text_editing");if(e.croppingElementId)return S("hints.leaveCropEditor");if(c.length===1&&Re(c[0]))return S("hints.enterCropEditor");if(i.type==="selection"){if(e.selectionElement&&!c.length&&!e.editingTextElement&&!e.editingLinearElement)return S("hints.deepBoxSelect");if(Uo(a)&&e.selectedElementsAreBeingDragged)return S("hints.disableSnapping");if(!c.length&&!t)return S("hints.canvasPanning");if(c.length===1){if(ue(c[0]))return e.editingLinearElement?e.editingLinearElement.selectedPointsIndices?S("hints.lineEditor_pointSelected"):S("hints.lineEditor_nothingSelected"):S("hints.lineEditor_info");if(!e.newElement&&!e.selectedElementsAreBeingDragged&&wr(c[0]))return eu(c[0])?Jz(c[0],a.scene.getNonDeletedElementsMap())?[S("hints.bindTextToElement"),S("hints.createFlowchart")]:[S("hints.bindTextToElement"),S("hints.createFlowchart")]:S("hints.bindTextToElement")}}return null},k9=({appState:e,isMobile:t,device:n,app:a})=>{let i=Qz({appState:e,isMobile:t,device:n,app:a});if(!i)return null;let r=Array.isArray(i)?i.map(s=>H(s).replace(/\. ?$/,"")).join(". "):H(i);return h.jsx("div",{className:"HintViewer",children:h.jsx("span",{children:r})})},eB="medium",Og={CHECKED:X1,UNCHECKED:tu},M9=e=>h.jsxs("label",{className:te("ToolIcon ToolIcon__lock",`ToolIcon_size_${eB}`,{"is-mobile":e.isMobile}),title:`${e.title} — Q`,children:[h.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-lock"}),h.jsx("div",{className:"ToolIcon__icon",children:e.checked?Og.CHECKED:Og.UNCHECKED})]}),wo=({heading:e,children:t,...n})=>{let{id:a}=za(),i=h.jsx("h2",{className:"visually-hidden",id:`${a}-${e}-title`,children:S(`headings.${e}`)});return h.jsx("section",{...n,"aria-labelledby":`${a}-${e}-title`,children:typeof t=="function"?t(i):h.jsxs(h.Fragment,{children:[i,t]})})},ka=4,Ri=6,tB="rgba(0,0,0,0.3)",nB=(e,t,n,a)=>{if(!e.length)return{horizontal:null,vertical:null};let[i,r,s,o]=Ne(e),d=t/a.zoom.value,c=n/a.zoom.value,l=t-d,u=n-c,f={top:parseInt(ld("sat"))||0,bottom:parseInt(ld("sab"))||0,left:parseInt(ld("sal"))||0,right:parseInt(ld("sar"))||0},p=vo().rtl,U=-a.scrollX+l/2+f.left,m=-a.scrollY+u/2+f.top,g=U+d-f.right,b=m+c-f.bottom,v=Math.min(i,U),x=Math.min(r,m),y=Math.max(s,g),w=Math.max(o,b);return{horizontal:U===v&&g===y?null:{x:Math.max(f.left,ka)+(U-v)/(y-v)*t,y:n-Ri-Math.max(ka,f.bottom),width:(g-U)/(y-v)*t-Math.max(ka*2,f.left+f.right),height:Ri},vertical:m===x&&b===w?null:{x:p?Math.max(f.left,ka):t-Ri-Math.max(f.right,ka),y:(m-x)/(w-x)*n+Math.max(f.top,ka),width:Ri,height:(b-m)/(w-x)*n-Math.max(ka*2,f.top+f.bottom)}}},$g=(e,t,n)=>{let[a,i]=[e.horizontal,e.vertical].map(r=>r!=null&&r.x<=t&&t<=r.x+r.width&&r.y<=n&&n<=r.y+r.height);return{isOverEither:a||i,isOverHorizontal:a,isOverVertical:i}},aB="medium",C9=e=>e.penDetected?h.jsxs("label",{className:te("ToolIcon ToolIcon__penMode",`ToolIcon_size_${aB}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[h.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),h.jsx("div",{className:"ToolIcon__icon",children:Jk})]}):null,I9=e=>h.jsx(Ce,{className:te("Shape",{fillable:!1}),type:"radio",icon:ab,name:"editor-current-shape",checked:e.checked,title:`${e.title} — H`,keyBindingLabel:e.isMobile?void 0:D.H.toLocaleUpperCase(),"aria-label":`${e.title} — H`,"aria-keyshortcuts":D.H,"data-testid":"toolbar-hand",onChange:()=>e.onChange?.()}),iB=({appState:e,elements:t,actionManager:n,setAppState:a,onLockToggle:i,onHandToolToggle:r,onPenModeToggle:s,renderTopRightUI:o,renderCustomStats:d,renderSidebars:c,device:l,renderWelcomeScreen:u,UIOptions:f,app:p})=>{let{WelcomeScreenCenterTunnel:U,MainMenuTunnel:m,DefaultSidebarTriggerTunnel:g}=cn(),b=()=>h.jsxs(w9,{side:"top",className:"App-top-bar",children:[u&&h.jsx(U.Out,{}),h.jsx(wo,{heading:"shapes",children:x=>h.jsx(Pn.Col,{gap:4,align:"center",children:h.jsxs(Pn.Row,{gap:1,className:"App-toolbar-container",children:[h.jsxs(da,{padding:1,className:"App-toolbar App-toolbar--mobile",children:[x,h.jsx(Pn.Row,{gap:1,children:h.jsx(p9,{appState:e,activeTool:e.activeTool,UIOptions:f,app:p})})]}),o&&o(!0,e),h.jsxs("div",{className:"mobile-misc-tools-container",children:[!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&h.jsx(g.Out,{}),h.jsx(C9,{checked:e.penMode,onChange:()=>s(null),title:S("toolBar.penMode"),isMobile:!0,penDetected:e.penDetected}),h.jsx(M9,{checked:e.activeTool.locked,onChange:i,title:S("toolBar.lock"),isMobile:!0}),h.jsx(I9,{checked:Ms(e),onChange:()=>r(),title:S("toolBar.hand"),isMobile:!0})]})]})})}),h.jsx(k9,{appState:e,isMobile:!0,device:l,app:p})]}),v=()=>e.viewModeEnabled||e.openDialog?.name==="elementLinkSelector"?h.jsx("div",{className:"App-toolbar-content",children:h.jsx(m.Out,{})}):h.jsxs("div",{className:"App-toolbar-content",children:[h.jsx(m.Out,{}),n.renderAction("toggleEditMenu"),n.renderAction(e.multiElement?"finalize":"duplicateSelection"),n.renderAction("deleteSelectedElements"),h.jsxs("div",{children:[n.renderAction("undo"),n.renderAction("redo")]})]});return h.jsxs(h.Fragment,{children:[c(),!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&b(),h.jsx("div",{className:"App-bottom-bar",style:{marginBottom:Ri+ka*2,marginLeft:Ri+ka*2,marginRight:Ri+ka*2},children:h.jsxs(da,{padding:0,children:[e.openMenu==="shape"&&!e.viewModeEnabled&&e.openDialog?.name!=="elementLinkSelector"&&N0(e,t)?h.jsx(wo,{className:"App-mobile-menu",heading:"selectedShapeActions",children:h.jsx(f9,{appState:e,elementsMap:p.scene.getNonDeletedElementsMap(),renderAction:n.renderAction,app:p})}):null,h.jsxs("footer",{className:"App-toolbar",children:[v(),e.scrolledOutside&&!e.openMenu&&!e.openSidebar&&h.jsx("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{a(x=>({...fo(t,x)}))},children:S("buttons.scrollBackToContent")})]})]})})]})},Fg=e=>{let t=C.useRef(null),[n,a]=C.useState(null);return C.useLayoutEffect(()=>{if(!e.spreadsheet)return;let i=uR(e.chartType,e.spreadsheet,0,0);a(i);let r,s=t.current;return(async()=>(r=await U0(i,{exportBackground:!1,viewBackgroundColor:Ft.white},null,{skipInliningFonts:!0}),r.querySelector(".style-fonts")?.remove(),s.replaceChildren(),s.appendChild(r),e.selected&&s.parentNode.focus()))(),()=>{s.replaceChildren()}},[e.spreadsheet,e.chartType,e.selected]),h.jsx("button",{type:"button",className:"ChartPreview",onClick:()=>{n&&e.onClick(e.chartType,n)},children:h.jsx("div",{ref:t})})},rB=({setAppState:e,appState:t,onClose:n})=>{let{onInsertElements:a}=Ua(),i=Z.useCallback(()=>{n&&n()},[n]),r=(s,o)=>{a(o),qe("paste","chart",s),e({currentChartType:s,pasteDialog:{shown:!1,data:null}})};return h.jsx(pa,{size:"small",onCloseRequest:i,title:S("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:h.jsxs("div",{className:"container",children:[h.jsx(Fg,{chartType:"bar",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="bar",onClick:r}),h.jsx(Fg,{chartType:"line",spreadsheet:t.pasteDialog.data,selected:t.currentChartType==="line",onClick:r})]})})},sB=()=>h.jsxs("div",{className:"HelpDialog__header",children:[h.jsxs("a",{className:"HelpDialog__btn",href:"https://docs.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:[h.jsx("div",{className:"HelpDialog__link-icon",children:a2}),S("helpDialog.documentation")]}),h.jsxs("a",{className:"HelpDialog__btn",href:"https://plus.excalidraw.com/blog",target:"_blank",rel:"noopener noreferrer",children:[h.jsx("div",{className:"HelpDialog__link-icon",children:a2}),S("helpDialog.blog")]}),h.jsxs("a",{className:"HelpDialog__btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:[h.jsx("div",{className:"HelpDialog__link-icon",children:K5}),S("helpDialog.github")]}),h.jsxs("a",{className:"HelpDialog__btn",href:"https://youtube.com/@excalidraw",target:"_blank",rel:"noopener noreferrer",children:[h.jsx("div",{className:"HelpDialog__link-icon",children:yC}),"YouTube"]})]}),lB=e=>h.jsxs(h.Fragment,{children:[h.jsx("h3",{children:e.title}),h.jsx("div",{className:"HelpDialog__islands-container",children:e.children})]}),Fh=e=>h.jsxs("div",{className:`HelpDialog__island ${e.className}`,children:[h.jsx("h4",{className:"HelpDialog__island-title",children:e.caption}),h.jsx("div",{className:"HelpDialog__island-content",children:e.children})]});function*oB(e,t){let n=!0;for(let a of e)n||(yield t),n=!1,yield a}var dB=e=>e.replace(/\b[a-z]\b/,t=>t.toUpperCase()),ee=({label:e,shortcuts:t,isOr:n=!0})=>{let a=t.map(i=>(i.endsWith("++")?[...i.slice(0,-2).split("+"),"+"]:i.split("+")).map(r=>h.jsx(cB,{children:dB(r)},r)));return h.jsxs("div",{className:"HelpDialog__shortcut",children:[h.jsx("div",{children:e}),h.jsx("div",{className:"HelpDialog__key-container",children:[...oB(a,n?S("helpDialog.or"):null)]})]})},cB=e=>h.jsx("kbd",{className:"HelpDialog__key",...e}),uB=({onClose:e})=>{let t=Z.useCallback(()=>{e&&e()},[e]);return h.jsx(h.Fragment,{children:h.jsxs(pa,{onCloseRequest:t,title:S("helpDialog.title"),className:"HelpDialog",children:[h.jsx(sB,{}),h.jsxs(lB,{title:S("helpDialog.shortcuts"),children:[h.jsxs(Fh,{className:"HelpDialog__island--tools",caption:S("helpDialog.tools"),children:[h.jsx(ee,{label:S("toolBar.hand"),shortcuts:[D.H]}),h.jsx(ee,{label:S("toolBar.selection"),shortcuts:[D.V,D[1]]}),h.jsx(ee,{label:S("toolBar.rectangle"),shortcuts:[D.R,D[2]]}),h.jsx(ee,{label:S("toolBar.diamond"),shortcuts:[D.D,D[3]]}),h.jsx(ee,{label:S("toolBar.ellipse"),shortcuts:[D.O,D[4]]}),h.jsx(ee,{label:S("toolBar.arrow"),shortcuts:[D.A,D[5]]}),h.jsx(ee,{label:S("toolBar.line"),shortcuts:[D.L,D[6]]}),h.jsx(ee,{label:S("toolBar.freedraw"),shortcuts:[D.P,D[7]]}),h.jsx(ee,{label:S("toolBar.text"),shortcuts:[D.T,D[8]]}),h.jsx(ee,{label:S("toolBar.image"),shortcuts:[D[9]]}),h.jsx(ee,{label:S("toolBar.eraser"),shortcuts:[D.E,D[0]]}),h.jsx(ee,{label:S("toolBar.frame"),shortcuts:[D.F]}),h.jsx(ee,{label:S("toolBar.laser"),shortcuts:[D.K]}),h.jsx(ee,{label:S("labels.eyeDropper"),shortcuts:[D.I,"Shift+S","Shift+G"]}),h.jsx(ee,{label:S("helpDialog.editLineArrowPoints"),shortcuts:[H("CtrlOrCmd+Enter")]}),h.jsx(ee,{label:S("helpDialog.editText"),shortcuts:[H("Enter")]}),h.jsx(ee,{label:S("helpDialog.textNewLine"),shortcuts:[H("Enter"),H("Shift+Enter")]}),h.jsx(ee,{label:S("helpDialog.textFinish"),shortcuts:[H("Esc"),H("CtrlOrCmd+Enter")]}),h.jsx(ee,{label:S("helpDialog.curvedArrow"),shortcuts:["A",S("helpDialog.click"),S("helpDialog.click"),S("helpDialog.click")],isOr:!1}),h.jsx(ee,{label:S("helpDialog.curvedLine"),shortcuts:["L",S("helpDialog.click"),S("helpDialog.click"),S("helpDialog.click")],isOr:!1}),h.jsx(ee,{label:S("helpDialog.cropStart"),shortcuts:[S("helpDialog.doubleClick"),H("Enter")],isOr:!0}),h.jsx(ee,{label:S("helpDialog.cropFinish"),shortcuts:[H("Enter"),H("Escape")],isOr:!0}),h.jsx(ee,{label:S("toolBar.lock"),shortcuts:[D.Q]}),h.jsx(ee,{label:S("helpDialog.preventBinding"),shortcuts:[H("CtrlOrCmd")]}),h.jsx(ee,{label:S("toolBar.link"),shortcuts:[H("CtrlOrCmd+K")]})]}),h.jsxs(Fh,{className:"HelpDialog__island--view",caption:S("helpDialog.view"),children:[h.jsx(ee,{label:S("buttons.zoomIn"),shortcuts:[H("CtrlOrCmd++")]}),h.jsx(ee,{label:S("buttons.zoomOut"),shortcuts:[H("CtrlOrCmd+-")]}),h.jsx(ee,{label:S("buttons.resetZoom"),shortcuts:[H("CtrlOrCmd+0")]}),h.jsx(ee,{label:S("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),h.jsx(ee,{label:S("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),h.jsx(ee,{label:S("helpDialog.movePageUpDown"),shortcuts:["PgUp/PgDn"]}),h.jsx(ee,{label:S("helpDialog.movePageLeftRight"),shortcuts:["Shift+PgUp/PgDn"]}),h.jsx(ee,{label:S("buttons.zenMode"),shortcuts:[H("Alt+Z")]}),h.jsx(ee,{label:S("buttons.objectsSnapMode"),shortcuts:[H("Alt+S")]}),h.jsx(ee,{label:S("labels.toggleGrid"),shortcuts:[H("CtrlOrCmd+'")]}),h.jsx(ee,{label:S("labels.viewMode"),shortcuts:[H("Alt+R")]}),h.jsx(ee,{label:S("labels.toggleTheme"),shortcuts:[H("Alt+Shift+D")]}),h.jsx(ee,{label:S("stats.fullTitle"),shortcuts:[H("Alt+/")]}),h.jsx(ee,{label:S("search.title"),shortcuts:[en("searchMenu")]}),h.jsx(ee,{label:S("commandPalette.title"),shortcuts:ao?[en("commandPalette")]:[en("commandPalette"),en("commandPalette",1)]})]}),h.jsxs(Fh,{className:"HelpDialog__island--editor",caption:S("helpDialog.editor"),children:[h.jsx(ee,{label:S("helpDialog.createFlowchart"),shortcuts:[H("CtrlOrCmd+Arrow Key")],isOr:!0}),h.jsx(ee,{label:S("helpDialog.navigateFlowchart"),shortcuts:[H("Alt+Arrow Key")],isOr:!0}),h.jsx(ee,{label:S("labels.moveCanvas"),shortcuts:[H(`Space+${S("helpDialog.drag")}`),H(`Wheel+${S("helpDialog.drag")}`)],isOr:!0}),h.jsx(ee,{label:S("buttons.clearReset"),shortcuts:[H("CtrlOrCmd+Delete")]}),h.jsx(ee,{label:S("labels.delete"),shortcuts:[H("Delete")]}),h.jsx(ee,{label:S("labels.cut"),shortcuts:[H("CtrlOrCmd+X")]}),h.jsx(ee,{label:S("labels.copy"),shortcuts:[H("CtrlOrCmd+C")]}),h.jsx(ee,{label:S("labels.paste"),shortcuts:[H("CtrlOrCmd+V")]}),h.jsx(ee,{label:S("labels.pasteAsPlaintext"),shortcuts:[H("CtrlOrCmd+Shift+V")]}),h.jsx(ee,{label:S("labels.selectAll"),shortcuts:[H("CtrlOrCmd+A")]}),h.jsx(ee,{label:S("labels.multiSelect"),shortcuts:[H(`Shift+${S("helpDialog.click")}`)]}),h.jsx(ee,{label:S("helpDialog.deepSelect"),shortcuts:[H(`CtrlOrCmd+${S("helpDialog.click")}`)]}),h.jsx(ee,{label:S("helpDialog.deepBoxSelect"),shortcuts:[H(`CtrlOrCmd+${S("helpDialog.drag")}`)]}),(k0||ao)&&h.jsx(ee,{label:S("labels.copyAsPng"),shortcuts:[H("Shift+Alt+C")]}),h.jsx(ee,{label:S("labels.copyStyles"),shortcuts:[H("CtrlOrCmd+Alt+C")]}),h.jsx(ee,{label:S("labels.pasteStyles"),shortcuts:[H("CtrlOrCmd+Alt+V")]}),h.jsx(ee,{label:S("labels.sendToBack"),shortcuts:[H(Aa?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),h.jsx(ee,{label:S("labels.bringToFront"),shortcuts:[H(Aa?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),h.jsx(ee,{label:S("labels.sendBackward"),shortcuts:[H("CtrlOrCmd+[")]}),h.jsx(ee,{label:S("labels.bringForward"),shortcuts:[H("CtrlOrCmd+]")]}),h.jsx(ee,{label:S("labels.alignTop"),shortcuts:[H("CtrlOrCmd+Shift+Up")]}),h.jsx(ee,{label:S("labels.alignBottom"),shortcuts:[H("CtrlOrCmd+Shift+Down")]}),h.jsx(ee,{label:S("labels.alignLeft"),shortcuts:[H("CtrlOrCmd+Shift+Left")]}),h.jsx(ee,{label:S("labels.alignRight"),shortcuts:[H("CtrlOrCmd+Shift+Right")]}),h.jsx(ee,{label:S("labels.duplicateSelection"),shortcuts:[H("CtrlOrCmd+D"),H(`Alt+${S("helpDialog.drag")}`)]}),h.jsx(ee,{label:S("helpDialog.toggleElementLock"),shortcuts:[H("CtrlOrCmd+Shift+L")]}),h.jsx(ee,{label:S("buttons.undo"),shortcuts:[H("CtrlOrCmd+Z")]}),h.jsx(ee,{label:S("buttons.redo"),shortcuts:m5?[H("CtrlOrCmd+Y"),H("CtrlOrCmd+Shift+Z")]:[H("CtrlOrCmd+Shift+Z")]}),h.jsx(ee,{label:S("labels.group"),shortcuts:[H("CtrlOrCmd+G")]}),h.jsx(ee,{label:S("labels.ungroup"),shortcuts:[H("CtrlOrCmd+Shift+G")]}),h.jsx(ee,{label:S("labels.flipHorizontal"),shortcuts:[H("Shift+H")]}),h.jsx(ee,{label:S("labels.flipVertical"),shortcuts:[H("Shift+V")]}),h.jsx(ee,{label:S("labels.showStroke"),shortcuts:[H("S")]}),h.jsx(ee,{label:S("labels.showBackground"),shortcuts:[H("G")]}),h.jsx(ee,{label:S("labels.showFonts"),shortcuts:[H("Shift+F")]}),h.jsx(ee,{label:S("labels.decreaseFontSize"),shortcuts:[H("CtrlOrCmd+Shift+<")]}),h.jsx(ee,{label:S("labels.increaseFontSize"),shortcuts:[H("CtrlOrCmd+Shift+>")]})]})]})]})})},hB=4,fB=8,pB=({shouldWrap:e,children:t,username:n})=>e?h.jsx(Br,{label:n||"Unknown user",children:t}):h.jsx(h.Fragment,{children:t}),zh=({actionManager:e,collaborator:t,socketId:n,withName:a=!1,shouldWrapWithTooltip:i=!1,isBeingFollowed:r})=>{let s={socketId:n,collaborator:t,withName:a,isBeingFollowed:r},o=e.renderAction("goToCollaborator",s);return h.jsx(pB,{username:t.username,shouldWrap:i,children:o},n)},UB=["avatarUrl","id","socketId","username","isInCall","isSpeaking","isMuted"],_9=Z.memo(({className:e,mobile:t,collaborators:n,userToFollow:a})=>{let i=En(),r=new Map;n.forEach((U,m)=>{let g=U.id||m;r.set(g,{...U,socketId:m})});let s=Array.from(r.values()).filter(U=>U.username?.trim()),[o,d]=Z.useState(""),c=s.filter(U=>U.username?.toLowerCase().includes(o)),l=Z.useRef(null);C.useLayoutEffect(()=>{if(l.current){let U=g=>{let b=Math.max(1,Math.min(8,Math.floor(g/38)));f(b)};if(U(l.current.clientWidth),!ff)return;let m=new ResizeObserver(g=>{for(let b of g){let{width:v}=b.contentRect;U(v)}});return m.observe(l.current),()=>{m.disconnect()}}},[]);let[u,f]=Z.useState(hB),p=s.slice(0,u-1).map(U=>zh({actionManager:i,collaborator:U,socketId:U.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:U.socketId===a}));return t?h.jsx("div",{className:te("UserList UserList_mobile",e),children:s.map(U=>zh({actionManager:i,collaborator:U,socketId:U.socketId,shouldWrapWithTooltip:!0,isBeingFollowed:U.socketId===a}))}):h.jsx("div",{className:"UserList__wrapper",ref:l,children:h.jsxs("div",{className:te("UserList",e),style:{"--max-avatars":u},children:[p,s.length>u-1&&h.jsxs(wu,{children:[h.jsxs(Eu,{className:"UserList__more",children:["+",s.length-u+1]}),h.jsx(q0,{style:{zIndex:2,width:"15rem",textAlign:"left"},align:"end",sideOffset:10,children:h.jsxs(da,{padding:2,children:[s.length>=fB&&h.jsx(j4,{placeholder:S("quickSearch.placeholder"),onChange:d}),h.jsx(A4,{className:"dropdown-menu UserList__collaborators",placeholder:S("userList.empty"),children:c.length>0?[h.jsx("div",{className:"hint",children:S("userList.hint.text")}),c.map(U=>zh({actionManager:i,collaborator:U,socketId:U.socketId,withName:!0,isBeingFollowed:U.socketId===a}))]:[]}),h.jsx(Z3,{width:20,height:10,style:{fill:"var(--popup-bg-color)",filter:"drop-shadow(rgba(0, 0, 0, 0.05) 0px 3px 2px)"}})]})})]})]})})},(e,t)=>{if(e.collaborators.size!==t.collaborators.size||e.mobile!==t.mobile||e.className!==t.className||e.userToFollow!==t.userToFollow)return!1;let n=t.collaborators.keys();for(let[a,i]of e.collaborators){let r=t.collaborators.get(a);if(!r||a!==n.next().value||!Wt(i,r,UB))return!1}return!0}),zg=({children:e,color:t})=>h.jsx("div",{className:"Card",style:{"--card-color":t==="primary"?"var(--color-primary)":Ft[t][7],"--card-color-darker":t==="primary"?"var(--color-primary-darker)":Ft[t][8],"--card-color-darkest":t==="primary"?"var(--color-primary-darkest)":Ft[t][9]},children:e}),mB=({elements:e,appState:t,setAppState:n,files:a,actionManager:i,exportOpts:r,canvas:s,onCloseRequest:o})=>{let{onExportToBackend:d}=r;return h.jsx("div",{className:"ExportDialog ExportDialog--json",children:h.jsxs("div",{className:"ExportDialog-cards",children:[r.saveFileToDisk&&h.jsxs(zg,{color:"lime",children:[h.jsx("div",{className:"Card-icon",children:cM}),h.jsx("h2",{children:S("exportDialog.disk_title")}),h.jsxs("div",{className:"Card-details",children:[S("exportDialog.disk_details"),!Wr&&i.renderAction("changeProjectName")]}),h.jsx(Ce,{className:"Card-button",type:"button",title:S("exportDialog.disk_button"),"aria-label":S("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction(H4,"ui")}})]}),d&&h.jsxs(zg,{color:"pink",children:[h.jsx("div",{className:"Card-icon",children:Sf}),h.jsx("h2",{children:S("exportDialog.link_title")}),h.jsx("div",{className:"Card-details",children:S("exportDialog.link_details")}),h.jsx(Ce,{className:"Card-button",type:"button",title:S("exportDialog.link_button"),"aria-label":S("exportDialog.link_button"),showAriaLabel:!0,onClick:async()=>{try{qe("export","link",`ui (${Uk()})`),await d(e,t,a),o()}catch(c){n({errorMessage:c.message})}}})]}),r.renderCustomUI&&r.renderCustomUI(e,t,a,s)]})})},gB=({elements:e,appState:t,files:n,actionManager:a,exportOpts:i,canvas:r,setAppState:s})=>{let o=Z.useCallback(()=>{s({openDialog:null})},[s]);return h.jsx(h.Fragment,{children:t.openDialog?.name==="jsonExport"&&h.jsx(pa,{onCloseRequest:o,title:S("buttons.export"),children:h.jsx(mB,{elements:e,appState:t,setAppState:s,files:n,actionManager:a,onCloseRequest:o,exportOpts:i,canvas:r})})})},bB=e=>h.jsx("button",{className:"help-icon",onClick:e.onClick,type:"button",title:`${S("helpDialog.title")} — ?`,"aria-label":S("helpDialog.title"),children:W1}),T9=({appState:e,actionManager:t,showExitZenModeBtn:n,renderWelcomeScreen:a})=>{let{FooterCenterTunnel:i,WelcomeScreenHelpHintTunnel:r}=cn(),s=Tt(),o=!e.viewModeEnabled&&e.multiElement&&s.isTouchScreen;return h.jsxs("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[h.jsx("div",{className:te("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled}),children:h.jsx(Pn.Col,{gap:2,children:h.jsxs(wo,{heading:"canvasActions",children:[h.jsx(wz,{renderAction:t.renderAction,zoom:e.zoom}),!e.viewModeEnabled&&h.jsx(Ez,{renderAction:t.renderAction,className:te("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":e.zenModeEnabled})}),o&&h.jsx(kz,{renderAction:t.renderAction,className:te("zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":e.zenModeEnabled})})]})})}),h.jsx(i.Out,{}),h.jsx("div",{className:te("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right":e.zenModeEnabled}),children:h.jsxs("div",{style:{position:"relative"},children:[a&&h.jsx(r.Out,{}),h.jsx(bB,{onClick:()=>t.executeAction(op)})]})}),h.jsx(Sz,{actionManager:t,showExitZenModeBtn:n})]})},xB=T9;T9.displayName="Footer";var j9=Z.createContext({}),A9=({children:e,className:t})=>{let n=Tt(),a=C.useContext(j9),i=!!(n.editor.canFitSidebar&&a.shouldRenderDockButton);return h.jsxs("div",{className:te("sidebar__header",t),"data-testid":"sidebar-header",children:[e,h.jsxs("div",{className:"sidebar__header__buttons",children:[i&&h.jsx(Br,{label:S("labels.sidebarLock"),children:h.jsx(Yi,{onSelect:()=>a.onDock?.(!a.docked),selected:!!a.docked,className:"sidebar__dock","data-testid":"sidebar-dock","aria-label":S("labels.sidebarLock"),children:Bk})}),h.jsx(Yi,{"data-testid":"sidebar-close",className:"sidebar__close",onSelect:a.onCloseRequest,"aria-label":S("buttons.close"),children:Ws})]})]})};A9.displayName="SidebarHeader";var D9=({name:e,tab:t,icon:n,title:a,children:i,onToggle:r,className:s,style:o})=>{let d=jt(),c=Gt();return h.jsxs("label",{title:a,className:"sidebar-trigger__label-element",children:[h.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",onChange:l=>{document.querySelector(".layer-ui__wrapper")?.classList.remove("animate");let u=l.target.checked;d({openSidebar:u?{name:e,tab:t}:null}),r?.(u)},checked:c.openSidebar?.name===e,"aria-label":a,"aria-keyshortcuts":"0"}),h.jsxs("div",{className:te("sidebar-trigger",s),style:o,children:[n&&h.jsx("div",{children:n}),i&&h.jsx("div",{className:"sidebar-trigger__label",children:i})]})]})};D9.displayName="SidebarTrigger";var L9=({children:e,...t})=>h.jsx(u4,{className:"sidebar-triggers",...t,children:e});L9.displayName="SidebarTabTriggers";var R9=({children:e,tab:t,onSelect:n,...a})=>h.jsx(h4,{value:t,asChild:!0,onSelect:n,children:h.jsx("button",{type:"button",className:"excalidraw-button sidebar-tab-trigger",...a,children:e})});R9.displayName="SidebarTabTrigger";var P9=({children:e,...t})=>{let n=Gt(),a=jt();if(!n.openSidebar)return null;let{name:i}=n.openSidebar;return h.jsx(c4,{className:"sidebar-tabs-root",value:n.openSidebar.tab,onValueChange:r=>a(s=>({...s,openSidebar:{...s.openSidebar,name:i,tab:r}})),...t,children:e})};P9.displayName="SidebarTabs";var N9=({tab:e,children:t,...n})=>h.jsx(f4,{...n,value:e,"data-testid":e,children:t});N9.displayName="SidebarTab";var hp=Bt(!1),O9=C.forwardRef(({name:e,children:t,onDock:n,docked:a,className:i,...r},s)=>{be.DEV&&n&&a==null&&console.warn("Sidebar: `docked` must be set when `onDock` is supplied for the sidebar to be user-dockable. To hide this message, either pass `docked` or remove `onDock`");let o=jt(),d=Su(hp);C.useLayoutEffect(()=>(d(!!a),()=>{d(!1)}),[d,a]);let c=C.useRef({});c.current.onCloseRequest=()=>{o({openSidebar:null})},c.current.onDock=p=>n?.(p),c.current=_d(c.current,{docked:a,shouldRenderDockButton:!!n&&a!=null});let l=C.useRef(null);C.useImperativeHandle(s,()=>l.current);let u=Tt(),f=C.useCallback(()=>{document.querySelector(".Dialog")||o({openSidebar:null})},[o]);return np(l,C.useCallback(p=>{p.target.closest(".sidebar-trigger")||(!a||!u.editor.canFitSidebar)&&f()},[f,a,u.editor.canFitSidebar])),C.useEffect(()=>{let p=U=>{U.key===D.ESCAPE&&(!a||!u.editor.canFitSidebar)&&f()};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}},[f,a,u.editor.canFitSidebar]),h.jsx(da,{...r,className:te("sidebar",{"sidebar--docked":a},i),ref:l,children:h.jsx(j9.Provider,{value:c.current,children:t})})});O9.displayName="SidebarInner";var Jn=Object.assign(C.forwardRef((e,t)=>{let n=Gt(),{onStateChange:a}=e,i=C.useRef(n.openSidebar);C.useEffect(()=>{(!n.openSidebar&&i?.current?.name===e.name||n.openSidebar?.name===e.name&&i?.current?.name!==e.name||i.current?.name===e.name)&&n.openSidebar!==i.current&&a?.(n.openSidebar?.name!==e.name?null:n.openSidebar),i.current=n.openSidebar},[n.openSidebar,a,e.name]);let[r,s]=C.useState(!1);return C.useLayoutEffect(()=>(s(!0),()=>s(!1)),[]),r&&n.openSidebar?.name===e.name?C.createElement(O9,{...e,ref:t,key:e.name}):null}),{Header:A9,TabTriggers:L9,TabTrigger:R9,Tabs:P9,Tab:N9,Trigger:D9});Jn.displayName="Sidebar";var $9={};U6($9,{ChangeCanvasBackground:()=>K9,ClearCanvas:()=>Z9,CommandPalette:()=>W9,Export:()=>q9,Help:()=>G9,LiveCollaborationTrigger:()=>Q9,LoadScene:()=>B9,SaveAsImage:()=>X9,SaveToActiveFile:()=>H9,SearchMenu:()=>V9,Socials:()=>J9,ToggleTheme:()=>Y9});var F9=Bt({active:!1});async function vB({title:e,description:t,actionLabel:n,color:a}){return new Promise(i=>{ia.set(F9,{active:!0,onConfirm:()=>i(!0),onClose:()=>i(!1),onReject:()=>i(!1),title:e,description:t,actionLabel:n,color:a})})}var z9=({value:e,shortcut:t,onChange:n,choices:a,children:i,name:r})=>{let s=Tt();return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"dropdown-menu-item-base dropdown-menu-item-bare",children:[h.jsx("label",{className:"dropdown-menu-item__text",htmlFor:r,children:i}),h.jsx(y9,{name:r,value:e,onChange:n,choices:a})]}),t&&!s.editor.isMobile&&h.jsx("div",{className:"dropdown-menu-item__shortcut dropdown-menu-item__shortcut--orphaned",children:t})]})};z9.displayName="DropdownMenuItemContentRadio";var yB=z9,B9=()=>{let{t:e}=Vt(),t=En(),n=Pu();return t.isActionEnabled(d1)?h.jsx(Wn,{icon:V1,onSelect:async()=>{(!n.length||await vB({title:e("overwriteConfirm.modal.loadFromFile.title"),actionLabel:e("overwriteConfirm.modal.loadFromFile.button"),color:"warning",description:h.jsx(Ta,{i18nKey:"overwriteConfirm.modal.loadFromFile.description",bold:a=>h.jsx("strong",{children:a}),br:()=>h.jsx("br",{})})}))&&t.executeAction(d1)},"data-testid":"load-button",shortcut:en("loadScene"),"aria-label":e("buttons.load"),children:e("buttons.load")}):null};B9.displayName="LoadScene";var H9=()=>{let{t:e}=Vt(),t=En();return t.isActionEnabled(pg)?h.jsx(Wn,{shortcut:en("saveScene"),"data-testid":"save-button",onSelect:()=>t.executeAction(pg),icon:lM,"aria-label":`${e("buttons.save")}`,children:`${e("buttons.save")}`}):null};H9.displayName="SaveToActiveFile";var X9=()=>{let e=jt(),{t}=Vt();return h.jsx(Wn,{icon:q5,"data-testid":"image-export-button",onSelect:()=>e({openDialog:{name:"imageExport"}}),shortcut:en("imageExport"),"aria-label":t("buttons.exportImage"),children:t("buttons.exportImage")})};X9.displayName="SaveAsImage";var W9=e=>{let t=jt(),{t:n}=Vt();return h.jsx(Wn,{icon:ob,"data-testid":"command-palette-button",onSelect:()=>{qe("command_palette","open","menu"),t({openDialog:{name:"commandPalette"}})},shortcut:en("commandPalette"),"aria-label":n("commandPalette.title"),className:e?.className,children:n("commandPalette.title")})};W9.displayName="CommandPalette";var V9=e=>{let{t}=Vt(),n=En();return h.jsx(Wn,{icon:Pr,"data-testid":"search-menu-button",onSelect:()=>{n.executeAction(b9)},shortcut:en("searchMenu"),"aria-label":t("search.title"),className:e?.className,children:t("search.title")})};V9.displayName="SearchMenu";var G9=()=>{let{t:e}=Vt(),t=En();return h.jsx(Wn,{"data-testid":"help-menu-item",icon:W1,onSelect:()=>t.executeAction(op),shortcut:"?","aria-label":e("helpDialog.title"),children:e("helpDialog.title")})};G9.displayName="Help";var Z9=()=>{let{t:e}=Vt(),t=Su(Lu);return En().isActionEnabled(Xl)?h.jsx(Wn,{icon:Rr,onSelect:()=>t("clearCanvas"),"data-testid":"clear-canvas-button","aria-label":e("buttons.clearReset"),children:e("buttons.clearReset")}):null};Z9.displayName="ClearCanvas";var Y9=e=>{let{t}=Vt(),n=Gt(),a=En(),i=en("toggleTheme");return a.isActionEnabled(Rc)?e?.allowSystemTheme?h.jsx(yB,{name:"theme",value:e.theme,onChange:r=>e.onSelect(r),choices:[{value:Me.LIGHT,label:Ef,ariaLabel:`${t("buttons.lightMode")} - ${i}`},{value:Me.DARK,label:wf,ariaLabel:`${t("buttons.darkMode")} - ${i}`},{value:"system",label:vC,ariaLabel:t("buttons.systemMode")}],children:t("labels.theme")}):h.jsx(Wn,{onSelect:r=>{if(r.preventDefault(),e?.onSelect)e.onSelect(n.theme===Me.DARK?Me.LIGHT:Me.DARK);else return a.executeAction(Rc)},icon:n.theme===Me.DARK?Ef:wf,"data-testid":"toggle-dark-mode",shortcut:i,"aria-label":n.theme===Me.DARK?t("buttons.lightMode"):t("buttons.darkMode"),children:n.theme===Me.DARK?t("buttons.lightMode"):t("buttons.darkMode")}):null};Y9.displayName="ToggleTheme";var K9=()=>{let{t:e}=Vt(),t=Gt(),n=En(),a=Wo();return t.viewModeEnabled||!a.UIOptions.canvasActions.changeViewBackgroundColor?null:h.jsxs("div",{style:{marginTop:"0.5rem"},children:[h.jsx("div",{"data-testid":"canvas-background-label",style:{fontSize:".75rem",marginBottom:".5rem"},children:e("labels.canvasBackground")}),h.jsx("div",{style:{padding:"0 0.625rem"},children:n.renderAction("changeViewBackgroundColor")})]})};K9.displayName="ChangeCanvasBackground";var q9=()=>{let{t:e}=Vt(),t=jt();return h.jsx(Wn,{icon:nu,onSelect:()=>{t({openDialog:{name:"jsonExport"}})},"data-testid":"json-export-button","aria-label":e("buttons.export"),children:e("buttons.export")})};q9.displayName="Export";var J9=()=>{let{t:e}=Vt();return h.jsxs(h.Fragment,{children:[h.jsx(Gd,{icon:K5,href:"https://github.com/excalidraw/excalidraw","aria-label":"GitHub",children:"GitHub"}),h.jsx(Gd,{icon:rM,href:"https://x.com/excalidraw","aria-label":"X",children:e("labels.followUs")}),h.jsx(Gd,{icon:iM,href:"https://discord.gg/UexuTaE","aria-label":"Discord",children:e("labels.discordChat")})]})};J9.displayName="Socials";var Q9=({onSelect:e,isCollaborating:t})=>{let{t:n}=Vt();return h.jsx(Wn,{"data-testid":"collab-button",icon:eb,className:te({"active-collab":t}),onSelect:e,children:n("labels.liveCollaboration")})};Q9.displayName="LiveCollaborationTrigger";var Ho=(e,t)=>{let n=Bt(0),a=i=>{let{tunnelsJotai:{useAtom:r}}=cn(),[,s]=r(n),o=C.useRef({preferHost:!1,counter:0});return C.useLayoutEffect(()=>{let d=o.current;return s(c=>{let l=c+1;return d.counter=l,l}),()=>{s(c=>{let l=c-1;return d.counter=l,l||(d.preferHost=!1),l})}},[s]),i.__fallback||(o.current.preferHost=!0),!o.current.counter&&i.__fallback&&o.current.preferHost||o.current.counter>1&&i.__fallback?null:h.jsx(t,{...i})};return a.displayName=e,a},wB=Object.assign(Ho("MainMenu",({children:e,onSelect:t})=>{let{MainMenuTunnel:n}=cn(),a=Tt(),i=Gt(),r=jt(),s=a.editor.isMobile?void 0:()=>r({openMenu:null});return h.jsx(n.In,{children:h.jsxs(Je,{open:i.openMenu==="canvas",children:[h.jsx(Je.Trigger,{onToggle:()=>{r({openMenu:i.openMenu==="canvas"?null:"canvas"})},"data-testid":"main-menu-trigger",className:"main-menu-trigger",children:Y5}),h.jsxs(Je.Content,{onClickOutside:s,onSelect:Qc(t,()=>{r({openMenu:null})}),children:[e,a.editor.isMobile&&i.collaborators.size>0&&h.jsxs("fieldset",{className:"UserList-Wrapper",children:[h.jsx("legend",{children:S("labels.collaborators")}),h.jsx(_9,{mobile:!0,collaborators:i.collaborators,userToFollow:i.userToFollow?.socketId||null})]})]})]})})}),{Trigger:Je.Trigger,Item:Je.Item,ItemLink:Je.ItemLink,ItemCustom:Je.ItemCustom,Group:Je.Group,Separator:Je.Separator,DefaultItems:$9}),rn=wB,fp=({title:e,children:t,actionLabel:n,onClick:a})=>h.jsxs("div",{className:"OverwriteConfirm__Actions__Action",children:[h.jsx("h4",{children:e}),h.jsx("div",{className:"OverwriteConfirm__Actions__Action__content",children:t}),h.jsx(Gl,{variant:"outlined",color:"muted",label:n,size:"large",fullWidth:!0,onClick:a})]}),EB=()=>{let{t:e}=Vt(),t=En(),n=jt();return h.jsx(fp,{title:e("overwriteConfirm.action.exportToImage.title"),actionLabel:e("overwriteConfirm.action.exportToImage.button"),onClick:()=>{t.executeAction(B4,"ui",!0),n({openDialog:{name:"imageExport"}})},children:e("overwriteConfirm.action.exportToImage.description")})},SB=()=>{let{t:e}=Vt(),t=En();return h.jsx(fp,{title:e("overwriteConfirm.action.saveToDisk.title"),actionLabel:e("overwriteConfirm.action.saveToDisk.button"),onClick:()=>{t.executeAction(H4,"ui")},children:e("overwriteConfirm.action.saveToDisk.description")})},Bg=Object.assign(({children:e})=>h.jsx("div",{className:"OverwriteConfirm__Actions",children:e}),{ExportToImage:EB,SaveToDisk:SB}),Bh=Object.assign(Ho("OverwriteConfirmDialog",({children:e})=>{let{OverwriteConfirmDialogTunnel:t}=cn(),[n,a]=gt(F9);if(!n.active)return null;let i=()=>{n.onClose(),a(s=>({...s,active:!1}))},r=()=>{n.onConfirm(),a(s=>({...s,active:!1}))};return h.jsx(t.In,{children:h.jsx(pa,{onCloseRequest:i,title:!1,size:916,children:h.jsxs("div",{className:"OverwriteConfirm",children:[h.jsx("h3",{children:n.title}),h.jsxs("div",{className:`OverwriteConfirm__Description OverwriteConfirm__Description--color-${n.color}`,children:[h.jsx("div",{className:"OverwriteConfirm__Description__icon",children:nC}),h.jsx("div",{children:n.description}),h.jsx("div",{className:"OverwriteConfirm__Description__spacer"}),h.jsx(Gl,{color:n.color,size:"large",label:n.actionLabel,onClick:r})]}),h.jsx(Bg,{children:e})]})})})}),{Actions:Bg,Action:fp}),kB=Bt(""),ex=Bt(null),MB=350,CB=()=>{let e=Ua(),t=jt(),n=C.useRef(null),[a,i]=gt(kB),r=a.trim(),[s,o]=C.useState(!1),[d,c]=C.useState({nonce:null,items:[]}),l=C.useRef(null),u=C.useRef(void 0),[f,p]=gt(ex),U=e.scene.getNonDeletedElementsMap();C.useEffect(()=>{s||(r!==l.current||e.scene.getSceneNonce()!==u.current)&&(l.current=null,Hg(r,e,(x,y)=>{c({nonce:Ra(),items:x}),l.current=r,u.current=e.scene.getSceneNonce(),t({searchMatches:x.map(w=>({id:w.textElement.id,focus:!1,matchedLines:w.matchedLines}))})}))},[s,r,U,e,t,p,u]);let m=()=>{d.items.length>0&&p(x=>x===null?0:(x+1)%d.items.length)},g=()=>{d.items.length>0&&p(x=>x===null?0:x-1<0?d.items.length-1:x-1)};C.useEffect(()=>{t(x=>({searchMatches:x.searchMatches.map((y,w)=>w===f?{...y,focus:!0}:{...y,focus:!1})}))},[f,t]),C.useEffect(()=>{if(d.items.length>0&&f!==null){let x=d.items[f];if(x){let y=e.state.zoom.value,w=Cn({text:x.searchQuery,x:x.textElement.x+(x.matchedLines[0]?.offsetX??0),y:x.textElement.y+(x.matchedLines[0]?.offsetY??0),width:x.matchedLines[0]?.width,height:x.matchedLines[0]?.height,fontSize:x.textElement.fontSize,fontFamily:x.textElement.fontFamily}),k=14,M=x.textElement.fontSize,I=M*y<k;if(!Bd([w],e.canvas.width/window.devicePixelRatio,e.canvas.height/window.devicePixelRatio,{offsetLeft:e.state.offsetLeft,offsetTop:e.state.offsetTop,scrollX:e.state.scrollX,scrollY:e.state.scrollY,zoom:e.state.zoom},e.scene.getNonDeletedElementsMap(),e.getEditorUIOffsets())||I){let A;I?M>=k?A={fitToContent:!0}:A={fitToViewport:!0,maxZoom:ja(k/M,1)}:A={fitToContent:!0},e.scrollToContent(w,{animate:!0,duration:300,...A,canvasOffsets:e.getEditorUIOffsets()})}}}},[f,d,e]),C.useEffect(()=>()=>{p(null),l.current=null,u.current=void 0,t({searchMatches:[]}),o(!1)},[t,p]);let b=Cu({goToNextItem:m,goToPreviousItem:g,searchMatches:d});C.useEffect(()=>lt(window,"keydown",y=>{if(y.key===D.ESCAPE&&!e.state.openDialog&&!e.state.openPopup){y.preventDefault(),y.stopPropagation(),t({openSidebar:null});return}y[D.CTRL_OR_CMD]&&y.key===D.F&&(y.preventDefault(),y.stopPropagation(),n.current?.matches(":focus")?t({openSidebar:null}):(e.state.openDialog&&t({openDialog:null}),n.current?.focus(),n.current?.select())),y.target instanceof HTMLElement&&y.target.closest(".layer-ui__search")&&b.searchMatches.items.length&&(y.key===D.ENTER&&(y.stopPropagation(),b.goToNextItem()),y.key===D.ARROW_UP?(y.stopPropagation(),b.goToPreviousItem()):y.key===D.ARROW_DOWN&&(y.stopPropagation(),b.goToNextItem()))},{capture:!0,passive:!1}),[t,b,e]);let v=`${d.items.length} ${d.items.length===1?S("search.singleResult"):S("search.multipleResults")}`;return h.jsxs("div",{className:"layer-ui__search",children:[h.jsx("div",{className:"layer-ui__search-header",children:h.jsx(up,{className:Ss.SEARCH_MENU_INPUT_WRAPPER,value:a,ref:n,placeholder:S("search.placeholder"),icon:Pr,onChange:x=>{i(x),o(!0);let y=x.trim();Hg(y,e,(w,k)=>{c({nonce:Ra(),items:w}),p(k),l.current=y,u.current=e.scene.getSceneNonce(),t({searchMatches:w.map(M=>({id:M.textElement.id,focus:!1,matchedLines:M.matchedLines}))}),o(!1)})},selectOnRender:!0})}),h.jsxs("div",{className:"layer-ui__search-count",children:[d.items.length>0&&h.jsxs(h.Fragment,{children:[f!==null&&f>-1?h.jsxs("div",{children:[f+1," / ",v]}):h.jsx("div",{children:v}),h.jsxs("div",{className:"result-nav",children:[h.jsx(Yi,{onSelect:()=>{m()},className:"result-nav-btn",children:cb}),h.jsx(Yi,{onSelect:()=>{g()},className:"result-nav-btn",children:IC})]})]}),d.items.length===0&&r&&l.current&&h.jsx("div",{style:{margin:"1rem auto"},children:S("search.noMatch")})]}),h.jsx(jB,{matches:d,onItemClick:p,focusIndex:f,searchQuery:r})]})},IB=e=>{let t=[e.preview.moreBefore?"...":"",e.preview.previewText.slice(0,e.preview.indexInSearchQuery),e.preview.previewText.slice(e.preview.indexInSearchQuery,e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.previewText.slice(e.preview.indexInSearchQuery+e.searchQuery.length),e.preview.moreAfter?"...":""];return h.jsx("div",{tabIndex:-1,className:te("layer-ui__result-item",{active:e.highlighted}),onClick:e.onClick,ref:n=>{e.highlighted&&n?.scrollIntoView({behavior:"auto",block:"nearest"})},children:h.jsx("div",{className:"preview-text",children:t.flatMap((n,a)=>h.jsx(C.Fragment,{children:a===2?h.jsx("b",{children:n}):n},a))})})},_B=e=>h.jsx("div",{className:"layer-ui__search-result-container",children:e.matches.items.map((t,n)=>h.jsx(IB,{searchQuery:e.searchQuery,preview:t.preview,highlighted:n===e.focusIndex,onClick:()=>e.onItemClick(n)},t.textElement.id+t.index))}),TB=(e,t)=>e.matches.nonce===t.matches.nonce&&e.focusIndex===t.focusIndex,jB=C.memo(_B,TB),AB=(e,t,n)=>{let a=e.slice(0,t),i=a.split(/\s+/),r=a.endsWith(" "),s=i.length-2-1-(r?0:1),o=i.slice(s<=0?0:s).join(" ")+(r?" ":""),d=20;o=o.length>d?o.slice(-d):o;let c=e.slice(t+n.length),l=c.split(/\s+/),u=!c.startsWith(" "),f=u?6:5,p=(u?"":" ")+l.slice(0,f).join(" ");return{indexInSearchQuery:o.length,previewText:o+n+p,moreBefore:s>0,moreAfter:l.length>f}},DB=(e,t)=>{let n=e.split(`
56
+ `),a=[],i=0;for(let r=0;r<n.length;r++){let s=n[r],o=n[r+1];if(o){let d=t.indexOf(o,i);if(d>s.length+i){let c=d-(s.length+i);for(;c>0;)s+=" ",c--}}a.push(s),i=i+s.length}return a.join(`
57
+ `)},LB=(e,t,n)=>{let a=DB(e.text,e.originalText).split(`
58
+ `),i=[],r=0,s=0;for(let l of a){let u=r,f=u+l.length-1;i.push({line:l,startIndex:u,endIndex:f,lineNumber:s}),r=f+1,s++}let o=n,d=e.originalText.slice(n,n+t.length),c=[];for(let l of i){if(d==="")break;if(o>=l.startIndex&&o<=l.endIndex){let u=l.endIndex+1-o,f=l.line.slice(0,o-l.startIndex),p=d.slice(0,u);d=d.slice(u);let U=nn(f,Xe(e),e.lineHeight);if(f===""&&(U.width=0),e.textAlign!=="left"&&l.line.length>0){let x=nn(l.line,Xe(e),e.lineHeight),y=e.textAlign==="center"?(e.width-x.width)/2:e.width-x.width;U.width+=y}let{width:m,height:g}=nn(p,Xe(e),e.lineHeight),b=U.width,v=l.lineNumber*U.height;c.push({offsetX:b,offsetY:v,width:m,height:g}),o+=u}}return c},RB=e=>e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&"),Hg=MO((e,t,n)=>{if(!e||e===""){n([],null);return}let a=t.scene.getNonDeletedElements().filter(d=>q(d));a.sort((d,c)=>d.y-c.y);let i=[],r=new RegExp(RB(e),"gi");for(let d of a){let c=null,l=d.originalText;for(;(c=r.exec(l))!==null;){let u=AB(l,c.index,e),f=LB(d,e,c.index);f.length>0&&i.push({textElement:d,searchQuery:e,preview:u,index:c.index,matchedLines:f})}}let s=new Set(t.visibleElements.map(d=>d.id)),o=i.findIndex(d=>s.has(d.textElement.id))??null;n(i,o)},MB),tx=Ho("DefaultSidebarTrigger",e=>{let{DefaultSidebarTriggerTunnel:t}=cn();return h.jsx(t.In,{children:h.jsx(Jn.Trigger,{...e,className:"default-sidebar-trigger",name:sa.name})})});tx.displayName="DefaultSidebarTrigger";var nx=({children:e})=>{let{DefaultSidebarTabTriggersTunnel:t}=cn();return h.jsx(t.In,{children:e})};nx.displayName="DefaultTabTriggers";var b1=Object.assign(Ho("DefaultSidebar",({children:e,className:t,onDock:n,docked:a,...i})=>{let r=Gt(),s=jt(),{DefaultSidebarTabTriggersTunnel:o}=cn(),d=r.openSidebar?.tab===xs;return C.createElement(Jn,{...i,name:"default",key:"default",className:te("default-sidebar",t),docked:d||(a??r.defaultSidebarDockedPreference),onDock:d||n===!1||!n&&a!=null?void 0:Qc(n,c=>{s({defaultSidebarDockedPreference:c})})},h.jsxs(Jn.Tabs,{children:[h.jsx(Jn.Header,{children:h.jsxs(Jn.TabTriggers,{children:[h.jsx(Jn.TabTrigger,{tab:xs,children:Pr}),h.jsx(Jn.TabTrigger,{tab:rc,children:H1}),h.jsx(o.Out,{})]})}),h.jsx(Jn.Tab,{tab:rc,children:h.jsx(dz,{})}),h.jsx(Jn.Tab,{tab:xs,children:h.jsx(CB,{})}),e]}))}),{Trigger:tx,TabTriggers:nx}),PB="small",NB=e=>h.jsxs("label",{className:te("ToolIcon ToolIcon__LaserPointer",`ToolIcon_size_${PB}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[h.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title,"data-testid":"toolbar-LaserPointer"}),h.jsx("div",{className:"ToolIcon__icon",children:sb})]}),OB=({canvasRef:e,setError:t})=>{let n=e.current;if(!n)return;let a=n.parentElement;a&&(a.style.background="",t(null),n.replaceChildren())},ax=async({canvasRef:e,mermaidToExcalidrawLib:t,mermaidDefinition:n,setError:a,data:i})=>{let r=e.current,s=r?.parentElement;if(!(!r||!s)){if(!n){OB({canvasRef:e,setError:a});return}try{let o=await t.api,d;try{d=await o.parseMermaidToExcalidraw(n)}catch{d=await o.parseMermaidToExcalidraw(n.replace(/"/g,"'"))}let{elements:c,files:l}=d;a(null),i.current={elements:Bc(c,{regenerateIds:!0}),files:l};let u=await $o({elements:i.current.elements,files:i.current.files,exportPadding:Bs,maxWidthOrHeight:Math.max(s.offsetWidth,s.offsetHeight)*window.devicePixelRatio});try{await xo(u)}catch(f){throw f.name==="CANVAS_POSSIBLY_TOO_BIG"?new Error(S("canvasError.canvasTooBig")):f}s.style.background="var(--default-bg-color)",r.replaceChildren(u)}catch(o){throw s.style.background="var(--default-bg-color)",n&&a(o),o}}},pp=e=>{Mr.set(Ll.MERMAID_TO_EXCALIDRAW,e)},ix=({app:e,data:t,text:n,shouldSaveMermaidDataToStorage:a})=>{let{elements:i,files:r}=t.current;i.length&&(e.addElementsFromPasteOrLibrary({elements:i,files:r,position:"center",fitToContent:!0}),e.setOpenDialog(null),a&&n&&pp(n))},rx=({children:e})=>h.jsx("div",{className:"ttd-dialog-panels",children:e}),$c=({label:e,children:t,panelAction:n,panelActionDisabled:a=!1,onTextSubmitInProgess:i,renderTopRight:r,renderSubmitShortcut:s,renderBottomRight:o})=>h.jsxs("div",{className:"ttd-dialog-panel",children:[h.jsxs("div",{className:"ttd-dialog-panel__header",children:[h.jsx("label",{children:e}),r?.()]}),t,h.jsxs("div",{className:te("ttd-dialog-panel-button-container",{invisible:!n}),style:{display:"flex",alignItems:"center"},children:[h.jsxs(Yi,{className:"ttd-dialog-panel-button",onSelect:n?n.action:()=>{},disabled:a||i,children:[h.jsxs("div",{className:te({invisible:i}),children:[n?.label,n?.icon&&h.jsx("span",{children:n.icon})]}),i&&h.jsx(hi,{})]}),!a&&!i&&s?.(),o?.()]})]}),sx=({input:e,placeholder:t,onChange:n,onKeyboardSubmit:a})=>{let i=C.useRef(null),r=C.useRef(a);return r.current=a,C.useEffect(()=>{if(!r.current)return;let s=i.current;if(s){let o=d=>{d[D.CTRL_OR_CMD]&&d.key===D.ENTER&&(d.preventDefault(),r.current?.())};return s.addEventListener("keydown",o),()=>{s.removeEventListener("keydown",o)}}},[]),h.jsx("textarea",{className:"ttd-dialog-input",onChange:n,value:e,placeholder:t,autoFocus:!0,ref:i})},$B=({error:e})=>h.jsxs("div",{"data-testid":"ttd-dialog-output-error",className:"ttd-dialog-output-error",children:["Error! ",h.jsx("p",{children:e})]}),lx=({error:e,canvasRef:t,loaded:n})=>h.jsxs("div",{className:"ttd-dialog-output-wrapper",children:[e&&h.jsx($B,{error:e.message}),n?h.jsx("div",{ref:t,style:{opacity:e?"0.15":1},className:"ttd-dialog-output-canvas-container"}):h.jsx(hi,{size:"2rem"})]}),ox=()=>h.jsxs("div",{className:"ttd-dialog-submit-shortcut",children:[h.jsx("div",{className:"ttd-dialog-submit-shortcut__key",children:H("CtrlOrCmd")}),h.jsx("div",{className:"ttd-dialog-submit-shortcut__key",children:H("Enter")})]}),FB=`flowchart TD
59
+ A[Christmas] -->|Get money| B(Go shopping)
60
+ B --> C{Let me think}
61
+ C -->|One| D[Laptop]
62
+ C -->|Two| E[iPhone]
63
+ C -->|Three| F[Car]`,Xg=Is(pp,300),zB=({mermaidToExcalidrawLib:e})=>{let[t,n]=C.useState(()=>Mr.get(Ll.MERMAID_TO_EXCALIDRAW)||FB),a=C.useDeferredValue(t.trim()),[i,r]=C.useState(null),s=C.useRef(null),o=C.useRef({elements:[],files:null}),d=Ua();C.useEffect(()=>{ax({canvasRef:s,data:o,mermaidToExcalidrawLib:e,setError:r,mermaidDefinition:a}).catch(l=>{P5()&&console.error("Failed to parse mermaid definition",l)}),Xg(a)},[a,e]),C.useEffect(()=>()=>{Xg.flush()},[]);let c=()=>{ix({app:d,data:o,text:t,shouldSaveMermaidDataToStorage:!0})};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"ttd-dialog-desc",children:h.jsx(Ta,{i18nKey:"mermaid.description",flowchartLink:l=>h.jsx("a",{href:"https://mermaid.js.org/syntax/flowchart.html",children:l}),sequenceLink:l=>h.jsx("a",{href:"https://mermaid.js.org/syntax/sequenceDiagram.html",children:l}),classLink:l=>h.jsx("a",{href:"https://mermaid.js.org/syntax/classDiagram.html",children:l})})}),h.jsxs(rx,{children:[h.jsx($c,{label:S("mermaid.syntax"),children:h.jsx(sx,{input:t,placeholder:"Write Mermaid diagram defintion here...",onChange:l=>n(l.target.value),onKeyboardSubmit:()=>{c()}})}),h.jsx($c,{label:S("mermaid.preview"),panelAction:{action:()=>{c()},label:S("mermaid.button"),icon:Dd},renderSubmitShortcut:()=>h.jsx(ox,{}),children:h.jsx(lx,{canvasRef:s,loaded:e.loaded,error:i})})]})]})},BB=zB,dx=e=>{let t=jt(),n=C.useRef(null),a=C.useRef(0);return h.jsx(c4,{ref:n,className:"ttd-dialog-tabs-root",value:e.tab,onValueChange:i=>{if(!i)return;let r=n.current?.closest(".Modal__content");if(r){let s=r.offsetHeight||0;s>a.current&&(a.current=s,r.style.minHeight=`min(${a.current}px, 100%)`)}e.dialog==="ttd"&&O5(["text-to-diagram","mermaid"],i)&&t({openDialog:{name:e.dialog,tab:i}})},children:e.children})};dx.displayName="TTDDialogTabs";var HB=dx,cx=({children:e,...t})=>h.jsx(u4,{className:"ttd-dialog-triggers",...t,children:e});cx.displayName="TTDDialogTabTriggers";var x1=({children:e,tab:t,onSelect:n,...a})=>h.jsx(h4,{value:t,asChild:!0,onSelect:n,children:h.jsx("button",{type:"button",className:"ttd-dialog-tab-trigger",...a,children:e})});x1.displayName="TTDDialogTabTrigger";var v1=({tab:e,children:t,...n})=>h.jsx(f4,{...n,value:e,children:t});v1.displayName="TTDDialogTab";var Hh=3,as=1e3,XB=Bt(null),WB=Bt(null),ux=e=>{let t=Gt();return t.openDialog?.name!=="ttd"?null:h.jsx(VB,{...e,tab:t.openDialog.tab})},VB=Ho("TTDDialogBase",({tab:e,...t})=>{let n=Ua(),a=jt(),i=C.useRef(null),[r,s]=gt(WB),[o,d]=C.useState(r?.prompt??""),c=o.trim(),l=k=>{d(k.target.value),s(M=>({generatedResponse:M?.generatedResponse??null,prompt:k.target.value}))},[u,f]=C.useState(!1),[p,U]=gt(XB),m=async()=>{if(c.length>as||c.length<Hh||u||p?.rateLimitRemaining===0||"__fallback"in t){c.length<Hh&&w(new Error(`Prompt is too short (min ${Hh} characters)`)),c.length>as&&w(new Error(`Prompt is too long (max ${as} characters)`));return}try{f(!0),qe("ai","generate","ttd");let{generatedResponse:k,error:M,rateLimit:I,rateLimitRemaining:A}=await t.onTextSubmit(c);if(typeof k=="string"&&s(_=>({generatedResponse:k,prompt:_?.prompt??null})),Rl(I)&&Rl(A)&&U({rateLimit:I,rateLimitRemaining:A}),M){w(M);return}if(!k){w(new Error("Generation failed"));return}try{await ax({canvasRef:i,data:x,mermaidToExcalidrawLib:b,setError:w,mermaidDefinition:k}),qe("ai","mermaid parse success","ttd")}catch(_){console.info(`%cTTD mermaid render errror: ${_.message}`,"color: red"),console.info(`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
64
+ TTD mermaid definition render errror: ${_.message}`,"color: yellow"),qe("ai","mermaid parse failed","ttd"),w(new Error("Generated an invalid diagram :(. You may also try a different prompt."))}}catch(k){let M=k.message;(!M||M==="Failed to fetch")&&(M="Request failed"),w(new Error(M))}finally{f(!1)}},g=C.useRef(m);g.current=m;let[b,v]=C.useState({loaded:!1,api:ne(()=>import("./index-Bu97Fipb.js").then(k=>k.b5),__vite__mapDeps([58,2,3]))});C.useEffect(()=>{(async()=>(await b.api,v(k=>({...k,loaded:!0}))))()},[b.api]);let x=C.useRef({elements:[],files:null}),[y,w]=C.useState(null);return h.jsx(pa,{className:"ttd-dialog",onCloseRequest:()=>{n.setOpenDialog(null)},size:1200,title:!1,...t,autofocus:!1,children:h.jsxs(HB,{dialog:"ttd",tab:e,children:["__fallback"in t&&t.__fallback?h.jsx("p",{className:"dialog-mermaid-title",children:S("mermaid.title")}):h.jsxs(cx,{children:[h.jsx(x1,{tab:"text-to-diagram",children:h.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[S("labels.textToDiagram"),h.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"1px 6px",marginLeft:"10px",fontSize:10,borderRadius:"12px",background:"var(--color-promo)",color:"var(--color-surface-lowest)"},children:"AI Beta"})]})}),h.jsx(x1,{tab:"mermaid",children:"Mermaid"})]}),h.jsx(v1,{className:"ttd-dialog-content",tab:"mermaid",children:h.jsx(BB,{mermaidToExcalidrawLib:b})}),!("__fallback"in t)&&h.jsxs(v1,{className:"ttd-dialog-content",tab:"text-to-diagram",children:[h.jsx("div",{className:"ttd-dialog-desc",children:"Currently we use Mermaid as a middle step, so you'll get best results if you describe a diagram, workflow, flow chart, and similar."}),h.jsxs(rx,{children:[h.jsx($c,{label:S("labels.prompt"),panelAction:{action:m,label:"Generate",icon:Dd},onTextSubmitInProgess:u,panelActionDisabled:c.length>as||p?.rateLimitRemaining===0,renderTopRight:()=>p?h.jsxs("div",{className:"ttd-dialog-rate-limit",style:{fontSize:12,marginLeft:"auto",color:p.rateLimitRemaining===0?"var(--color-danger)":void 0},children:[p.rateLimitRemaining," requests left today"]}):null,renderSubmitShortcut:()=>h.jsx(ox,{}),renderBottomRight:()=>{if(typeof r?.generatedResponse=="string")return h.jsxs("div",{className:"excalidraw-link",style:{marginLeft:"auto",fontSize:14},onClick:()=>{typeof r?.generatedResponse=="string"&&(pp(r.generatedResponse),a({openDialog:{name:"ttd",tab:"mermaid"}}))},children:["View as Mermaid",h.jsx(_u,{icon:Dd})]});let k=c.length/as;return k>.8?h.jsxs("div",{style:{marginLeft:"auto",fontSize:12,fontFamily:"monospace",color:k>1?"var(--color-danger)":void 0},children:["Length: ",c.length,"/",as]}):null},children:h.jsx(sx,{onChange:l,input:o,placeholder:"Describe what you want to see...",onKeyboardSubmit:()=>{g.current()}})}),h.jsx($c,{label:"Preview",panelAction:{action:()=>{console.info("Panel action clicked"),ix({app:n,data:x})},label:"Insert",icon:Dd},children:h.jsx(lx,{canvasRef:i,error:y,loaded:b.loaded})})]})]})]})})}),GB=.01,fi=(e,t)=>!(t==="height"&&q(e)||t==="width"&&q(e)||t==="angle"&&de(e)),Jt=(e,t)=>{let n=e+t/2;return n-n%t},Fc=(e,t,n)=>Object.keys(e).map(a=>({original:(n??t).get(a),latest:t.get(a)})).filter(a=>a.original!==void 0&&a.latest!==void 0),Eo=(e,t,n,a,i,r,s,o=!0)=>{let d=a.get(n.id);if(!d)return;let[c,l]=[n.x+n.width/2,n.y+n.height/2],[u,f]=z(E(n.x,n.y),E(c,l),n.angle),p=e-u,U=t-f,[m,g]=z(E(e,t),E(c+p,l+U),-n.angle);X(d,{x:m,y:g},o),y1(d,a,i,r);let b=ge(n,s);if(b){let v=a.get(b.id);v&&X(v,{x:b.x+p,y:b.y+U},o)}},Up=(e,t)=>{let n=Er(t).map(a=>tt(e,a).reduce((i,r)=>(i[r.id]=!0,i),{}));return e.filter(a=>!Ds(a)).forEach(a=>{n.push({[a.id]:!0})}),n},y1=(e,t,n,a,i)=>{ue(e)?xc([e],t,n,a,!0,[],i?.zoom):xn(e,t,i)},ZB=({label:e,icon:t,dragInputCallback:n,value:a,elements:i,editable:r=!0,shouldKeepAspectRatio:s,property:o,scene:d,appState:c,sensitivity:l=1})=>{let u=Ua(),f=C.useRef(null),p=C.useRef(null),[U,m]=C.useState(a.toString()),g=C.useRef(null);g.current||(g.current={originalAppState:ti(c),originalElements:i,lastUpdatedValue:U,updatePending:!1}),C.useEffect(()=>{let x=a.toString();m(x),g.current.lastUpdatedValue=x},[a]);let b=(x,y,w)=>{if(!g.current.updatePending)return!1;g.current.updatePending=!1;let k=Number(x);if(isNaN(k)){m(a.toString());return}let M=Number(k.toFixed(2)),I=Number(a);(isNaN(I)||Math.abs(M-I)>=GB)&&(g.current.lastUpdatedValue=x,n({accumulatedChange:0,instantChange:0,originalElements:y,originalElementsMap:u.scene.getNonDeletedElementsMap(),shouldKeepAspectRatio:s,shouldChangeByStepSize:!1,scene:d,nextValue:M,property:o,originalAppState:w,setInputValue:A=>m(String(A))}),u.syncActionResult({captureUpdate:B.IMMEDIATELY}))},v=C.useRef({});return v.current.handleInputValue=b,C.useEffect(()=>{let x=f.current,y=v.current;return()=>{let w=x?.value;w&&y.handleInputValue?.(w,g.current.originalElements,g.current.originalAppState),window.removeEventListener("pointermove",y.onPointerMove,!1),window.removeEventListener("pointerup",y.onPointerUp,!1)}},[r]),r?h.jsxs("div",{className:te("drag-input-container",!r&&"disabled"),"data-testid":e,children:[h.jsx("div",{className:"drag-input-label",ref:p,onPointerDown:x=>{if(f.current&&r){document.body.classList.add("excalidraw-cursor-resize"),Number(f.current.value);let y=null,w=u.scene.getNonDeletedElements().reduce((L,R)=>(L.set(R.id,Gr(R)),L),new Map),k=i.map(L=>w.get(L.id)),M=ti(c),I=0,A=0,_=L=>{if(y&&w!==null&&k!==null){let R=L.clientX-y.x;R!==0&&(A+=R,Math.abs(A)>=l&&(A=Math.sign(A)*Math.floor(Math.abs(A)/l),I+=A,n({accumulatedChange:I,instantChange:A,originalElements:k,originalElementsMap:w,shouldKeepAspectRatio:s,shouldChangeByStepSize:L.shiftKey,property:o,scene:d,originalAppState:M,setInputValue:F=>m(String(F))}),A=0))}y={x:L.clientX,y:L.clientY}},T=()=>{window.removeEventListener("pointermove",_,!1),u.syncActionResult({captureUpdate:B.IMMEDIATELY}),y=null,I=0,A=0,k=null,w=null,document.body.classList.remove("excalidraw-cursor-resize"),window.removeEventListener("pointerup",T,!1)};v.current.onPointerMove=_,v.current.onPointerUp=T,window.addEventListener("pointermove",_,!1),window.addEventListener("pointerup",T,!1)}},onPointerEnter:()=>{p.current&&(p.current.style.cursor="ew-resize")},children:t?h.jsx(_u,{icon:t}):e}),h.jsx("input",{className:"drag-input",autoComplete:"off",spellCheck:"false",onKeyDown:x=>{if(r){let y=x.target;y instanceof HTMLInputElement&&x.key===D.ENTER&&(b(y.value,i,c),u.focusContainer())}},ref:f,value:U,onChange:x=>{g.current.updatePending=!0,m(x.target.value)},onFocus:x=>{x.target.select(),g.current.originalElements=i,g.current.originalAppState=ti(c)},onBlur:x=>{U?r&&b(x.target.value,g.current.originalElements,g.current.originalAppState):m(a.toString())},disabled:!r})]}):null},gi=ZB,Wg=10,YB=e=>e.type==="image",KB=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldKeepAspectRatio:a,shouldChangeByStepSize:i,nextValue:r,property:s,originalAppState:o,instantChange:d,scene:c})=>{let l=c.getNonDeletedElementsMap(),u=t[0],f=l.get(u.id);if(u&&f){let p=a||YB(u),U=u.width/u.height;if(o.croppingElementId===u.id){let x=l.get(u.id);if(!x||!Re(x)||!x.crop)return;let y=x.crop,w={...y},k=x.scale[0]===-1,M=x.scale[1]===-1,{width:I,height:A}=li(x),_=y.naturalWidth/I,T=y.naturalHeight/A,L=k?y.width+y.x:y.naturalWidth-y.x,R=M?y.height+y.y:y.naturalHeight-y.y,F=Pt*_,P=Pt*T;if(r!==void 0){if(s==="width"){let K=r*_,se=Se(K,F,L);w={...w,width:se,x:k?y.x+y.width-se:y.x}}else if(s==="height"){let K=r*T,se=Se(K,P,R);w={...w,height:se,y:M?y.y+y.height-se:y.y}}X(x,{crop:w,width:w.width/(y.naturalWidth/I),height:w.height/(y.naturalHeight/A)});return}let $=s==="width"?d:0,O=s==="height"?d:0,V=Se(y.width+$,F,L),W=Se(y.height+O,F,R);w={...y,x:k?y.x+y.width-V:y.x,y:M?y.y+y.height-W:y.y,width:V,height:W},X(x,{crop:w,width:w.width/(y.naturalWidth/I),height:w.height/(y.naturalHeight/A)});return}if(r!==void 0){let x=Math.max(s==="width"?r:p?r*U:u.width,An),y=Math.max(s==="height"?r:p?r/U:u.height,An);bo(x,y,f,u,l,n,s==="width"?"e":"s",{shouldMaintainAspectRatio:p});return}let m=s==="width"?e:0,g=s==="height"?e:0,b=Math.max(0,u.width+m);s==="width"&&(i?b=Jt(b,Wg):b=Math.round(b));let v=Math.max(0,u.height+g);s==="height"&&(i?v=Jt(v,Wg):v=Math.round(v)),p&&(s==="width"?v=Math.round(b/U*100)/100:b=Math.round(v*U*100)/100),v=Math.max(An,v),b=Math.max(An,b),bo(b,v,f,u,l,n,s==="width"?"e":"s",{shouldMaintainAspectRatio:p})}},qB=({property:e,element:t,scene:n,appState:a})=>{let i=ja(e==="width"?t.width:t.height,2);if(a.croppingElementId&&a.croppingElementId===t.id&&Re(t)&&t.crop){let{width:r,height:s}=li(t);if(e==="width"){let o=r/t.crop.naturalWidth;i=ja(t.crop.width*o,2)}if(e==="height"){let o=s/t.crop.naturalHeight;i=ja(t.crop.height*o,2)}}return h.jsx(gi,{label:e==="width"?"W":"H",elements:[t],dragInputCallback:KB,value:i,editable:fi(t,e),scene:n,appState:a,property:e})},Vg=qB,JB=15,QB=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:a,scene:i})=>{let r=i.getNonDeletedElementsMap(),s=i.getNonDeletedElements(),o=t[0];if(o&&!Q(o)){let d=r.get(o.id);if(!d)return;if(a!==void 0){let U=vr(a);X(d,{angle:U}),y1(d,r,s,i);let m=ge(d,r);m&&!ve(d)&&X(m,{angle:U});return}let c=Math.round(_o(o.angle)*100)/100,l=Math.round(e),u=(c+l)%360;n&&(u=Jt(u,JB)),u=u<0?u+360:u;let f=vr(u);X(d,{angle:f}),y1(d,r,s,i);let p=ge(d,r);p&&!ve(d)&&X(p,{angle:f})}},eH=({element:e,scene:t,appState:n,property:a})=>h.jsx(gi,{label:"A",icon:nb,value:Math.round(_o(e.angle)%360*100)/100,elements:[e],dragInputCallback:QB,editable:fi(e,"angle"),scene:t,appState:n,property:a}),tH=eH,Gg=4,nH=4,aH=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:a,scene:i})=>{let r=i.getNonDeletedElementsMap(),s=t[0];if(s){let o=r.get(s.id);if(!o||!q(o))return;let d;if(a!==void 0)d=Math.max(Math.round(a),Gg);else if(s.type==="text"){let c=Math.round(s.fontSize),l=Math.round(e);d=Math.max(c+l,Gg),n&&(d=Jt(d,nH))}d&&(X(o,{fontSize:d}),ln(o,i.getContainerElement(o),i.getNonDeletedElementsMap()))}},iH=({element:e,scene:t,appState:n,property:a})=>{let i=q(e)?e:Hn(e)?ge(e,t.getNonDeletedElementsMap()):null;return i?h.jsx(gi,{label:"F",value:Math.round(i.fontSize*10)/10,elements:[i],dragInputCallback:aH,icon:au,appState:n,scene:t,property:a}):null},rH=iH,is=10,sH=(e,t,n,a)=>{let i=a.x-e,r=a.y-t,s=a.width*n,o=a.height*n,d=e+i*n,c=t+r*n;return{width:s,height:o,x:d,y:c,...R0(a,s,o,!1),...q(a)?{fontSize:a.fontSize*n}:{}}},lH=(e,t,n,a,i,r,s,o)=>{let d=sH(e,t,a,r);X(i,d,!1);let c=ge(r,o);if(c){let l=c.fontSize*a;xn(i,s,{newSize:{width:d.width,height:d.height}});let u=s.get(c.id);u&&q(u)&&(X(u,{fontSize:l},!1),Ro(i,s,n==="width"?"e":"s",!0))}},Zg=(e,t,n,a,i,r,s,o,d,c)=>{r==="width"?t=Math.round(e/a*100)/100:e=Math.round(t*a*100)/100;let l=t/n;for(let u=0;u<o.length;u++){let f=o[u],p=s[u];lH(i[0],i[1],r,l,p,f,d,c)}},oH=({accumulatedChange:e,originalElements:t,originalElementsMap:n,originalAppState:a,shouldChangeByStepSize:i,nextValue:r,scene:s,property:o})=>{let d=s.getNonDeletedElementsMap(),c=Up(t,a);if(r!==void 0){for(let f of c){let p=Fc(f,d,n);if(p.length>1){let U=p.map(A=>A.latest),m=p.map(A=>A.original),[g,b,v,x]=Ne(m),y=v-g,w=x-b,k=y/w,M=Math.max(An,o==="width"?Math.max(0,r):y),I=Math.max(An,o==="height"?Math.max(0,r):w);Zg(M,I,w,k,E(g,b),o,U,m,d,n)}else{let[U]=p,m=U?.latest,g=U?.original;if(m&&g&&fi(m,o)){let b=o==="width"?Math.max(0,r):m.width;o==="width"&&(i?b=Jt(b,is):b=Math.round(b));let v=o==="height"?Math.max(0,r):m.height;o==="height"&&(i?v=Jt(v,is):v=Math.round(v)),b=Math.max(An,b),v=Math.max(An,v),bo(b,v,m,g,d,n,o==="width"?"e":"s",{shouldInformMutation:!1})}}}s.triggerUpdate();return}let l=o==="width"?e:0,u=o==="height"?e:0;for(let f of c){let p=Fc(f,d,n);if(p.length>1){let U=p.map(A=>A.latest),m=p.map(A=>A.original),[g,b,v,x]=Ne(m),y=v-g,w=x-b,k=y/w,M=Math.max(0,y+l);o==="width"&&(i?M=Jt(M,is):M=Math.round(M));let I=Math.max(0,w+u);o==="height"&&(i?I=Jt(I,is):I=Math.round(I)),M=Math.max(An,M),I=Math.max(An,I),Zg(M,I,w,k,E(g,b),o,U,m,d,n)}else{let[U]=p,m=U?.latest,g=U?.original;if(m&&g&&fi(m,o)){let b=Math.max(0,g.width+l);o==="width"&&(i?b=Jt(b,is):b=Math.round(b));let v=Math.max(0,g.height+u);o==="height"&&(i?v=Jt(v,is):v=Math.round(v)),b=Math.max(An,b),v=Math.max(An,v),bo(b,v,m,g,d,n,o==="width"?"e":"s",{shouldInformMutation:!1})}}}s.triggerUpdate()},dH=({property:e,elements:t,elementsMap:n,atomicUnits:a,scene:i,appState:r})=>{let s=C.useMemo(()=>a.map(c=>{let l=Fc(c,n);if(l.length>1){let[f,p,U,m]=Ne(l.map(g=>g.latest));return Math.round((e==="width"?U-f:m-p)*100)/100}let[u]=l;return Math.round((e==="width"?u.latest.width:u.latest.height)*100)/100}),[n,a,e]),o=new Set(s).size===1?Math.round(s[0]*100)/100:"Mixed",d=s.length>0;return h.jsx(gi,{label:e==="width"?"W":"H",elements:t,dragInputCallback:oH,value:o,editable:d,appState:r,property:e,scene:i})},Yg=dH,cH=15,uH=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:a,property:i,scene:r})=>{let s=r.getNonDeletedElementsMap(),o=t.map(c=>s.get(c.id)).filter(c=>c&&!Ds(c)&&fi(c,i)),d=t.filter(c=>!Ds(c)&&fi(c,i));if(a!==void 0){let c=vr(a);for(let l of o){if(!l)continue;X(l,{angle:c},!1);let u=ge(l,s);u&&!ve(l)&&X(u,{angle:c},!1)}r.triggerUpdate();return}for(let c=0;c<o.length;c++){let l=o[c];if(!l)continue;let u=d[c],f=Math.round(_o(u.angle)*100)/100,p=Math.round(e),U=(f+p)%360;n&&(U=Jt(U,cH)),U=U<0?U+360:U;let m=vr(U);X(l,{angle:m},!1);let g=ge(l,s);g&&!ve(l)&&X(g,{angle:m},!1)}r.triggerUpdate()},hH=({elements:e,scene:t,appState:n,property:a})=>{let i=e.filter(d=>!Ds(d)&&fi(d,"angle")),r=i.map(d=>Math.round(_o(d.angle)%360*100)/100),s=new Set(r).size===1?r[0]:"Mixed",o=i.some(d=>fi(d,"angle"));return h.jsx(gi,{label:"A",icon:nb,value:s,elements:e,dragInputCallback:uH,editable:o,appState:n,scene:t,property:a})},fH=hH,Kg=4,pH=4,UH=(e,t)=>e.reduce((n,a)=>{if(!a||Ds(a))return n;if(q(a))return n.push(a),n;if(Hn(a)){let i=ge(a,t);if(i)return n.push(i),n}return n},[]),mH=({accumulatedChange:e,originalElements:t,shouldChangeByStepSize:n,nextValue:a,scene:i})=>{let r=i.getNonDeletedElementsMap(),s=t.map(d=>r.get(d.id)),o;if(a){o=Math.max(Math.round(a),Kg);for(let d of s)X(d,{fontSize:o},!1),ln(d,i.getContainerElement(d),r,!1);i.triggerUpdate()}else{let d=t;for(let c=0;c<s.length;c++){let l=s[c],u=d[c],f=Math.round(u.fontSize),p=Math.round(e),U=Math.max(f+p,Kg);n&&(U=Jt(U,pH)),X(l,{fontSize:U},!1),ln(l,i.getContainerElement(l),r,!1)}i.triggerUpdate()}},gH=({elements:e,scene:t,appState:n,property:a,elementsMap:i})=>{let r=UH(e,i);if(!r.length)return null;let s=r.map(c=>Math.round(c.fontSize*10)/10),o=new Set(s).size===1?s[0]:"Mixed",d=s.length>0;return h.jsx(gi,{label:"F",icon:au,elements:r,dragInputCallback:mH,value:o,editable:d,scene:t,property:a,appState:n})},bH=gH,qg=10,xH=({accumulatedChange:e,instantChange:t,originalElements:n,originalElementsMap:a,shouldChangeByStepSize:i,nextValue:r,property:s,scene:o,originalAppState:d})=>{let c=o.getNonDeletedElementsMap(),l=o.getNonDeletedElements(),u=n[0],[f,p]=[u.x+u.width/2,u.y+u.height/2],[U,m]=z(E(u.x,u.y),E(f,p),u.angle);if(d.croppingElementId===u.id){let y=c.get(u.id);if(!y||!Re(y)||!y.crop)return;let w=y.crop,k=w,M=y.scale[0]===-1,I=y.scale[1]===-1,{width:A,height:_}=li(y);if(r!==void 0){if(s==="x"){let R=r*(w.naturalWidth/A);M?k={...w,x:Se(w.naturalWidth-R-w.width,0,w.naturalWidth-w.width)}:k={...w,x:Se(r*(w.naturalWidth/A),0,w.naturalWidth-w.width)}}s==="y"&&(k={...w,y:Se(r*(w.naturalHeight/_),0,w.naturalHeight-w.height)}),X(y,{crop:k});return}let T=(s==="x"?t:0)*(M?-1:1),L=(s==="y"?t:0)*(I?-1:1);k={...w,x:Se(w.x+T,0,w.naturalWidth-w.width),y:Se(w.y+L,0,w.naturalHeight-w.height)},X(y,{crop:k});return}if(r!==void 0){Eo(s==="x"?r:U,s==="y"?r:m,u,c,l,o,a);return}let g=s==="x"?e:0,b=s==="y"?e:0,v=s==="x"?Math.round(i?Jt(u.x+g,qg):U+g):U,x=s==="y"?Math.round(i?Jt(u.y+b,qg):m+b):m;Eo(v,x,u,c,l,o,a)},vH=({property:e,element:t,elementsMap:n,scene:a,appState:i})=>{let[r,s]=z(E(t.x,t.y),E(t.x+t.width/2,t.y+t.height/2),t.angle),o=ja(e==="x"?r:s,2);if(i.croppingElementId===t.id&&Re(t)&&t.crop){let d=PA(t);d&&(o=ja(e==="x"?d.x:d.y,2))}return h.jsx(gi,{label:e==="x"?"X":"Y",elements:[t],dragInputCallback:xH,scene:a,value:o,property:e,appState:i})},Jg=vH,yH=10,wH=(e,t,n,a,i,r,s,o)=>{for(let d=0;d<a.length;d++){let c=i[d],[l,u]=[c.x+c.width/2,c.y+c.height/2],[f,p]=z(E(c.x,c.y),E(l,u),c.angle),U=e==="x"?Math.round(f+t):f,m=e==="y"?Math.round(p+n):p;Eo(U,m,c,r,a,o,s,!1)}},EH=(e,t,n,a,i,r,s)=>{let[o,d,,]=Ne(n),c=e-o,l=t-d;for(let u=0;u<n.length;u++){let f=n[u],p=a.get(f.id);if(p&&(!q(p)||!p.containerId)){let[U,m]=[p.x+p.width/2,p.y+p.height/2],[g,b]=z(E(p.x,p.y),E(U,m),p.angle);Eo(g+c,b+l,f,a,i,s,r,!1)}}},SH=({accumulatedChange:e,originalElements:t,originalElementsMap:n,shouldChangeByStepSize:a,nextValue:i,property:r,scene:s,originalAppState:o})=>{let d=s.getNonDeletedElementsMap(),c=s.getNonDeletedElements();if(i!==void 0){for(let u of Up(t,o)){let f=Fc(u,d,n);if(f.length>1){let[p,U,,]=Ne(f.map(m=>m.latest));EH(r==="x"?i:p,r==="y"?i:U,f.map(m=>m.original),d,c,n,s)}else{let p=f[0]?.original,U=f[0]?.latest;if(p&&U&&fi(U,r)){let[m,g]=[p.x+p.width/2,p.y+p.height/2],[b,v]=z(E(p.x,p.y),E(m,g),p.angle);Eo(r==="x"?i:b,r==="y"?i:v,p,d,c,s,n,!1)}}}s.triggerUpdate();return}let l=a?Jt(e,yH):e;wH(r,r==="x"?l:0,r==="y"?l:0,t,t,d,n,s),s.triggerUpdate()},kH=({property:e,elements:t,elementsMap:n,atomicUnits:a,scene:i,appState:r})=>{let s=C.useMemo(()=>a.map(d=>{let c=Object.keys(d).map(m=>n.get(m)).filter(m=>m!==void 0);if(c.length>1){let[m,g]=Ne(c);return Math.round((e==="x"?m:g)*100)/100}let[l]=c,[u,f]=[l.x+l.width/2,l.y+l.height/2],[p,U]=z(E(l.x,l.y),E(u,f),l.angle);return Math.round((e==="x"?p:U)*100)/100}),[a,n,e]),o=new Set(s).size===1?s[0]:"Mixed";return h.jsx(gi,{label:e==="x"?"X":"Y",elements:t,dragInputCallback:SH,value:o,property:e,scene:i,appState:r})},Qg=kH,e6=5,MH=({property:e,scene:t,appState:n,setAppState:a})=>h.jsx(gi,{label:"Grid step",sensitivity:8,elements:[],dragInputCallback:({nextValue:i,instantChange:r,shouldChangeByStepSize:s,setInputValue:o})=>{a(d=>{let c;return i?c=i:r&&(c=s?Jt(d.gridStep+e6*Math.sign(r),e6):d.gridStep+r),c?(c=qb(c),o(c),{gridStep:c}):(o(d.gridStep),null)})},scene:t,value:n.gridStep,property:e,appState:n}),CH=MH,IH=50,Ru=e=>{let t=Vo(),n=e.app.scene.getSceneNonce()||1,a=e.app.scene.getSelectedElements({selectedElementIds:t.selectedElementIds,includeBoundTextElement:!1}),i=Uo(e.app);return h.jsx(_H,{...e,appState:t,sceneNonce:n,selectedElements:a,gridModeEnabled:i})},et=({children:e,columns:t=1,heading:n,style:a,...i})=>h.jsx("div",{className:te("exc-stats__row",{"exc-stats__row--heading":n}),style:{gridTemplateColumns:`repeat(${t}, 1fr)`,...a},...i,children:e});et.displayName="StatsRow";var zc=({children:e,order:t,style:n,...a})=>h.jsx("div",{className:"exc-stats__rows",style:{order:t,...n},...a,children:e});zc.displayName="StatsRows";Ru.StatsRow=et;Ru.StatsRows=zc;var _H=C.memo(({app:e,onClose:t,renderCustomStats:n,selectedElements:a,appState:i,sceneNonce:r,gridModeEnabled:s})=>{let o=e.scene,d=o.getNonDeletedElements(),c=o.getNonDeletedElementsMap(),l=jt(),u=a.length===1?a[0]:null,f=a.length>1?a:null,p=i.croppingElementId&&Re(u),U=p?li(u):null,[m,g]=C.useState({width:0,height:0}),b=C.useMemo(()=>Mo(y=>{let w=Ne(y);g({width:Math.round(w[2])-Math.round(w[0]),height:Math.round(w[3])-Math.round(w[1])})},IH),[]);C.useEffect(()=>{b(d)},[r,d,b]),C.useEffect(()=>()=>b.cancel(),[b]);let v=C.useMemo(()=>Up(a,i),[a,i]),x=C.useMemo(()=>t7(a),[a]);return h.jsx("div",{className:"exc-stats",children:h.jsxs(da,{padding:3,children:[h.jsxs("div",{className:"title",children:[h.jsx("h2",{children:S("stats.title")}),h.jsx("div",{className:"close",onClick:t,children:Ws})]}),h.jsxs(l1,{label:h.jsx("h3",{children:S("stats.generalStats")}),open:!!(i.stats.panels&us.generalStats),openTrigger:()=>l(y=>({stats:{open:!0,panels:y.stats.panels^us.generalStats}})),children:[h.jsxs(zc,{children:[h.jsx(et,{heading:!0,children:S("stats.scene")}),h.jsxs(et,{columns:2,children:[h.jsx("div",{children:S("stats.shapes")}),h.jsx("div",{children:d.length})]}),h.jsxs(et,{columns:2,children:[h.jsx("div",{children:S("stats.width")}),h.jsx("div",{children:m.width})]}),h.jsxs(et,{columns:2,children:[h.jsx("div",{children:S("stats.height")}),h.jsx("div",{children:m.height})]}),s&&h.jsxs(h.Fragment,{children:[h.jsx(et,{heading:!0,children:"Canvas"}),h.jsx(et,{children:h.jsx(CH,{property:"gridStep",scene:o,appState:i,setAppState:l})})]})]}),n?.(d,i)]}),!x&&a.length>0&&h.jsx("div",{id:"elementStats",style:{marginTop:12},children:h.jsx(l1,{label:h.jsx("h3",{children:S("stats.elementProperties")}),open:!!(i.stats.panels&us.elementProperties),openTrigger:()=>l(y=>({stats:{open:!0,panels:y.stats.panels^us.elementProperties}})),children:h.jsxs(zc,{children:[u&&h.jsxs(h.Fragment,{children:[p&&h.jsx(et,{heading:!0,children:S("labels.unCroppedDimension")}),i.croppingElementId&&Re(u)&&U&&h.jsxs(et,{columns:2,children:[h.jsx("div",{children:S("stats.width")}),h.jsx("div",{children:ja(U.width,2)})]}),i.croppingElementId&&Re(u)&&U&&h.jsxs(et,{columns:2,children:[h.jsx("div",{children:S("stats.height")}),h.jsx("div",{children:ja(U.height,2)})]}),h.jsx(et,{heading:!0,"data-testid":"stats-element-type",children:i.croppingElementId?S("labels.imageCropping"):S(`element.${u.type}`)}),h.jsx(et,{children:h.jsx(Jg,{element:u,property:"x",elementsMap:c,scene:o,appState:i})}),h.jsx(et,{children:h.jsx(Jg,{element:u,property:"y",elementsMap:c,scene:o,appState:i})}),h.jsx(et,{children:h.jsx(Vg,{property:"width",element:u,scene:o,appState:i})}),h.jsx(et,{children:h.jsx(Vg,{property:"height",element:u,scene:o,appState:i})}),!Q(u)&&h.jsx(et,{children:h.jsx(tH,{property:"angle",element:u,scene:o,appState:i})}),h.jsx(et,{children:h.jsx(rH,{property:"fontSize",element:u,scene:o,appState:i})})]}),f&&h.jsxs(h.Fragment,{children:[n8(f)&&h.jsx(et,{heading:!0,children:S("element.group")}),h.jsxs(et,{columns:2,style:{margin:"0.3125rem 0"},children:[h.jsx("div",{children:S("stats.shapes")}),h.jsx("div",{children:a.length})]}),h.jsx(et,{children:h.jsx(Qg,{property:"x",elements:f,elementsMap:c,atomicUnits:v,scene:o,appState:i})}),h.jsx(et,{children:h.jsx(Qg,{property:"y",elements:f,elementsMap:c,atomicUnits:v,scene:o,appState:i})}),h.jsx(et,{children:h.jsx(Yg,{property:"width",elements:f,elementsMap:c,atomicUnits:v,scene:o,appState:i})}),h.jsx(et,{children:h.jsx(Yg,{property:"height",elements:f,elementsMap:c,atomicUnits:v,scene:o,appState:i})}),h.jsx(et,{children:h.jsx(fH,{property:"angle",elements:f,scene:o,appState:i})}),h.jsx(et,{children:h.jsx(bH,{property:"fontSize",elements:f,scene:o,appState:i,elementsMap:c})})]})]})})})]})})},(e,t)=>e.sceneNonce===t.sceneNonce&&e.selectedElements===t.selectedElements&&e.appState.stats.panels===t.appState.stats.panels&&e.gridModeEnabled===t.gridModeEnabled&&e.appState.gridStep===t.appState.gridStep&&e.appState.croppingElementId===t.appState.croppingElementId),TH=({sourceElementId:e,onClose:t,elementsMap:n,appState:a,generateLinkForSelection:i=_8})=>{let r=n.get(e)?.link??null,[s,o]=C.useState(r),[d,c]=C.useState(!1);C.useEffect(()=>{let u=xe(n,a),f=r;if(u.length>0&&i){let p=T8(u,a);p&&(f=vn(i(p.id,p.type)))}o(f)},[n,a,a.selectedElementIds,r,i]);let l=C.useCallback(()=>{if(s&&s!==n.get(e)?.link){let u=n.get(e);u&&X(u,{link:s})}if(!s&&d&&e){let u=n.get(e);u&&X(u,{link:null})}t?.()},[e,s,n,d,t]);return C.useEffect(()=>{let u=f=>{a.openDialog?.name==="elementLinkSelector"&&f.key===D.ENTER&&l(),a.openDialog?.name==="elementLinkSelector"&&f.key===D.ESCAPE&&t?.()};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[a,t,l]),h.jsxs("div",{className:"ElementLinkDialog",children:[h.jsxs("div",{className:"ElementLinkDialog__header",children:[h.jsx("h2",{children:S("elementLink.title")}),h.jsx("p",{children:S("elementLink.desc")})]}),h.jsxs("div",{className:"ElementLinkDialog__input",children:[h.jsx(up,{value:s??"",onChange:u=>{d||c(!0),o(u)},onKeyDown:u=>{u.key===D.ENTER&&l()},className:"ElementLinkDialog__input-field",selectOnRender:!0}),r&&s&&h.jsx(Ce,{type:"button",title:S("buttons.remove"),"aria-label":S("buttons.remove"),label:S("buttons.remove"),onClick:()=>{o(null),c(!0)},className:"ElementLinkDialog__remove",icon:Rr})]}),h.jsxs("div",{className:"ElementLinkDialog__actions",children:[h.jsx($s,{label:S("buttons.cancel"),onClick:()=>{t?.()},style:{marginRight:10}}),h.jsx($s,{label:S("buttons.confirm"),onClick:l,actionType:"primary"})]})]})},jH=TH,AH=({UIOptions:e})=>h.jsxs(rn,{__fallback:!0,children:[h.jsx(rn.DefaultItems.LoadScene,{}),h.jsx(rn.DefaultItems.SaveToActiveFile,{}),e.canvasActions.export&&h.jsx(rn.DefaultItems.Export,{}),e.canvasActions.saveAsImage&&h.jsx(rn.DefaultItems.SaveAsImage,{}),h.jsx(rn.DefaultItems.SearchMenu,{}),h.jsx(rn.DefaultItems.Help,{}),h.jsx(rn.DefaultItems.ClearCanvas,{}),h.jsx(rn.Separator,{}),h.jsx(rn.Group,{title:"Excalidraw links",children:h.jsx(rn.DefaultItems.Socials,{})}),h.jsx(rn.Separator,{}),h.jsx(rn.DefaultItems.ToggleTheme,{}),h.jsx(rn.DefaultItems.ChangeCanvasBackground,{})]}),DH=()=>h.jsxs(Bh,{__fallback:!0,children:[h.jsx(Bh.Actions.SaveToDisk,{}),h.jsx(Bh.Actions.ExportToImage,{})]}),LH=({actionManager:e,appState:t,files:n,setAppState:a,elements:i,canvas:r,onLockToggle:s,onHandToolToggle:o,onPenModeToggle:d,showExitZenModeBtn:c,renderTopRightUI:l,renderCustomStats:u,UIOptions:f,onExportImage:p,renderWelcomeScreen:U,children:m,app:g,isCollaborating:b,generateLinkForSelection:v})=>{let x=Tt(),y=yz(),w=y.tunnelsJotai.Provider,[k,M]=gt(Iu),I=()=>f.canvasActions.export?h.jsx(gB,{elements:i,appState:t,files:n,actionManager:e,exportOpts:f.canvasActions.export,canvas:r,setAppState:a}):null,A=()=>!f.canvasActions.saveAsImage||t.openDialog?.name!=="imageExport"?null:h.jsx(Vz,{elements:i,appState:t,files:n,actionManager:e,onExportImage:p,onCloseRequest:()=>a({openDialog:null}),name:g.getName()}),_=()=>h.jsxs("div",{style:{position:"relative"},children:[h.jsx(y.MainMenuTunnel.Out,{}),U&&h.jsx(y.WelcomeScreenMenuHintTunnel.Out,{})]}),T=()=>h.jsx(wo,{heading:"selectedShapeActions",className:te("selected-shape-actions zen-mode-transition",{"transition-left":t.zenModeEnabled}),children:h.jsx(da,{className:Ss.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:`${t.height-166}px`},children:h.jsx(f9,{appState:t,elementsMap:g.scene.getNonDeletedElementsMap(),renderAction:e.renderAction,app:g})})}),L=()=>{let $=N0(t,i),O=t.stats.open&&!t.zenModeEnabled&&!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector";return h.jsx(w9,{side:"top",children:h.jsxs("div",{className:"App-menu App-menu_top",children:[h.jsxs(Pn.Col,{gap:6,className:te("App-menu_top__left"),children:[_(),$&&T()]}),!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector"&&h.jsx(wo,{heading:"shapes",className:"shapes-section",children:V=>h.jsxs("div",{style:{position:"relative"},children:[U&&h.jsx(y.WelcomeScreenToolbarHintTunnel.Out,{}),h.jsx(Pn.Col,{gap:4,align:"start",children:h.jsxs(Pn.Row,{gap:1,className:te("App-toolbar-container",{"zen-mode":t.zenModeEnabled}),children:[h.jsxs(da,{padding:1,className:te("App-toolbar",{"zen-mode":t.zenModeEnabled}),children:[h.jsx(k9,{appState:t,isMobile:x.editor.isMobile,device:x,app:g}),V,h.jsxs(Pn.Row,{gap:1,children:[h.jsx(C9,{zenModeEnabled:t.zenModeEnabled,checked:t.penMode,onChange:()=>d(null),title:S("toolBar.penMode"),penDetected:t.penDetected}),h.jsx(M9,{checked:t.activeTool.locked,onChange:s,title:S("toolBar.lock")}),h.jsx("div",{className:"App-toolbar__divider"}),h.jsx(I9,{checked:Ms(t),onChange:()=>o(),title:S("toolBar.hand"),isMobile:!0}),h.jsx(p9,{appState:t,activeTool:t.activeTool,UIOptions:f,app:g})]})]}),b&&h.jsx(da,{style:{marginLeft:8,alignSelf:"center",height:"fit-content"},children:h.jsx(NB,{title:S("toolBar.laser"),checked:t.activeTool.type===Lt.laser,onChange:()=>g.setActiveTool({type:Lt.laser}),isMobile:!0})})]})})]})}),h.jsxs("div",{className:te("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":t.zenModeEnabled}),children:[t.collaborators.size>0&&h.jsx(_9,{collaborators:t.collaborators,userToFollow:t.userToFollow?.socketId||null}),l?.(x.editor.isMobile,t),!t.viewModeEnabled&&t.openDialog?.name!=="elementLinkSelector"&&(!F||t.openSidebar?.name!==sa.name)&&h.jsx(y.DefaultSidebarTriggerTunnel.Out,{}),O&&h.jsx(Ru,{app:g,onClose:()=>{e.executeAction(u1)},renderCustomStats:u})]})]})})},R=()=>h.jsx(b1,{__fallback:!0,onDock:$=>{qe("sidebar",`toggleDock (${$?"dock":"undock"})`,`(${x.editor.isMobile?"mobile":"desktop"})`)}}),F=U4(hp),P=h.jsxs(h.Fragment,{children:[m,h.jsx(AH,{UIOptions:f}),h.jsx(b1.Trigger,{__fallback:!0,icon:H1,title:Nl(S("toolBar.library")),onToggle:$=>{$&&qe("sidebar",`${sa.name} (open)`,`button (${x.editor.isMobile?"mobile":"desktop"})`)},tab:sa.defaultTab,children:S("toolBar.library")}),h.jsx(DH,{}),t.openDialog?.name==="ttd"&&h.jsx(ux,{__fallback:!0}),t.isLoading&&h.jsx(b4,{delay:250}),t.errorMessage&&h.jsx(Fz,{onClose:()=>a({errorMessage:null}),children:t.errorMessage}),k&&!x.editor.isMobile&&h.jsx(U$,{colorPickerType:k.colorPickerType,onCancel:()=>{M(null)},onChange:($,O,V,{altKey:W})=>{if(!($!=="elementBackground"&&$!=="elementStroke"))if(V.length){for(let K of V)X(K,{[W&&k.swapPreviewOnAlt?$==="elementBackground"?"strokeColor":"backgroundColor":$==="elementBackground"?"backgroundColor":"strokeColor"]:O},!1),ut.delete(K);ci.getScene(V[0])?.triggerUpdate()}else a($==="elementBackground"?{currentItemBackgroundColor:O}:{currentItemStrokeColor:O})},onSelect:($,O)=>{M(V=>V?.keepOpenOnAlt&&O.altKey?V:null),k?.onSelect?.($,O)}}),t.openDialog?.name==="help"&&h.jsx(uB,{onClose:()=>{a({openDialog:null})}}),h.jsx(Mz,{}),t.openDialog?.name==="elementLinkSelector"&&h.jsx(jH,{sourceElementId:t.openDialog.sourceElementId,onClose:()=>{a({openDialog:null})},elementsMap:g.scene.getNonDeletedElementsMap(),appState:t,generateLinkForSelection:v}),h.jsx(y.OverwriteConfirmDialogTunnel.Out,{}),A(),I(),t.pasteDialog.shown&&h.jsx(rB,{setAppState:a,appState:t,onClose:()=>a({pasteDialog:{shown:!1,data:null}})}),x.editor.isMobile&&h.jsx(iB,{app:g,appState:t,elements:i,actionManager:e,renderJSONExportDialog:I,renderImageExportDialog:A,setAppState:a,onLockToggle:s,onHandToolToggle:o,onPenModeToggle:d,renderTopRightUI:l,renderCustomStats:u,renderSidebars:R,device:x,renderWelcomeScreen:U,UIOptions:f}),!x.editor.isMobile&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"layer-ui__wrapper",style:t.openSidebar&&F&&x.editor.canFitSidebar?{width:"calc(100% - var(--right-sidebar-width))"}:{},children:[U&&h.jsx(y.WelcomeScreenCenterTunnel.Out,{}),L(),h.jsx(xB,{appState:t,actionManager:e,showExitZenModeBtn:c,renderWelcomeScreen:U}),t.scrolledOutside&&h.jsx("button",{type:"button",className:"scroll-back-to-content",onClick:()=>{a($=>({...fo(i,$)}))},children:S("buttons.scrollBackToContent")})]}),R()]})]});return h.jsx(I4.Provider,{value:t,children:h.jsx(w,{children:h.jsx(c9.Provider,{value:y,children:P})})})},t6=e=>{let{suggestedBindings:t,startBoundElement:n,cursorButton:a,scrollX:i,scrollY:r,...s}=e;return s},RH=(e,t)=>{if(e.children!==t.children)return!1;let{canvas:n,appState:a,...i}=e,{canvas:r,appState:s,...o}=t;return Wt(t6(a),t6(s),{selectedElementIds:Wt,selectedGroupIds:Wt})&&Wt(i,o)},PH=Z.memo(LH,RH),NH=5e3,OH=({message:e,onClose:t,closable:n=!1,duration:a=NH,style:i})=>{let r=C.useRef(0),s=a!==1/0,o=C.useCallback(()=>{s&&(r.current=window.setTimeout(()=>t(),a))},[t,a,s]);return C.useEffect(()=>{if(s)return o(),()=>clearTimeout(r.current)},[o,e,a,s]),h.jsxs("div",{className:"Toast",onMouseEnter:s?()=>clearTimeout(r?.current):void 0,onMouseLeave:s?o:void 0,style:i,children:[h.jsx("p",{className:"Toast__message",children:e}),n&&h.jsx(Ce,{icon:Ws,"aria-label":"close",type:"icon",onClick:t,className:"close"})]})},n6=G({name:"viewMode",label:"labels.viewMode",paletteName:"Toggle view mode",icon:Z1,viewMode:!0,trackEvent:{category:"canvas",predicate:e=>!e.viewModeEnabled},perform(e,t){return{appState:{...t,viewModeEnabled:!this.checked(t)},captureUpdate:B.EVENTUALLY}},checked:e=>e.viewModeEnabled,predicate:(e,t,n)=>typeof n.viewModeEnabled>"u",keyTest:e=>!e[D.CTRL_OR_CMD]&&e.altKey&&e.code===Te.R}),hx=(e,t)=>{let n=t.scene.getSelectedElements(e);return n.length===1&&de(n[0])},$H=G({name:"selectAllElementsInFrame",label:"labels.selectAllElementsInFrame",trackEvent:{category:"canvas"},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t).at(0)||null;if(de(i)){let r=$a(Ve(e),i.id).filter(s=>!(s.type==="text"&&s.containerId));return{elements:e,appState:{...t,selectedElementIds:r.reduce((s,o)=>(s[o.id]=!0,s),{})},captureUpdate:B.IMMEDIATELY}}return{elements:e,appState:t,captureUpdate:B.EVENTUALLY}},predicate:(e,t,n,a)=>hx(t,a)}),FH=G({name:"removeAllElementsFromFrame",label:"labels.removeAllElementsFromFrame",trackEvent:{category:"history"},perform:(e,t,n,a)=>{let i=a.scene.getSelectedElements(t).at(0)||null;return de(i)?{elements:J8(e,i),appState:{...t,selectedElementIds:{[i.id]:!0}},captureUpdate:B.IMMEDIATELY}:{elements:e,appState:t,captureUpdate:B.EVENTUALLY}},predicate:(e,t,n,a)=>hx(t,a)});G({name:"updateFrameRendering",label:"labels.updateFrameRendering",viewMode:!0,trackEvent:{category:"canvas"},perform:(e,t)=>({elements:e,appState:{...t,frameRendering:{...t.frameRendering,enabled:!t.frameRendering.enabled}},captureUpdate:B.EVENTUALLY}),checked:e=>e.frameRendering.enabled});G({name:"setFrameAsActiveTool",label:"toolBar.frame",trackEvent:{category:"toolbar"},icon:ib,viewMode:!1,perform:(e,t,n,a)=>{let i=Et(t,{type:"frame"});return wa(a.interactiveCanvas,{...t,activeTool:i}),{elements:e,appState:{...t,activeTool:Et(t,{type:"frame"})},captureUpdate:B.EVENTUALLY}},keyTest:e=>!e[D.CTRL_OR_CMD]&&!e.shiftKey&&!e.altKey&&e.key.toLocaleLowerCase()===D.F});var zH=G({name:"wrapSelectionInFrame",label:"labels.wrapSelectionInFrame",trackEvent:{category:"element"},predicate:(e,t,n,a)=>{let i=xe(e,t);return i.length>0&&!i.some(r=>de(r))},perform:(e,t,n,a)=>{let i=xe(e,t),[r,s,o,d]=Ne(i,a.scene.getNonDeletedElementsMap()),c=16,l=l0({x:r-c,y:s-c,width:o-r+c*2,height:d-s+c*2});if(t.editingGroupId){let u=tt(i,t.editingGroupId);for(let f of u){let p=f.groupIds.indexOf(t.editingGroupId);X(f,{groupIds:f.groupIds.slice(0,p)},!1)}}return{elements:Fl([...a.scene.getElementsIncludingDeleted(),l],i,l,t),appState:{selectedElementIds:{[l.id]:!0}},captureUpdate:B.IMMEDIATELY}}}),BH=()=>h.jsxs("div",{"data-testid":"brave-measure-text-error",children:[h.jsx("p",{children:h.jsx(Ta,{i18nKey:"errors.brave_measure_text_error.line1",bold:e=>h.jsx("span",{style:{fontWeight:600},children:e})})}),h.jsx("p",{children:h.jsx(Ta,{i18nKey:"errors.brave_measure_text_error.line2",bold:e=>h.jsx("span",{style:{fontWeight:600},children:e})})}),h.jsx("p",{children:h.jsx(Ta,{i18nKey:"errors.brave_measure_text_error.line3",link:e=>h.jsx("a",{href:"http://docs.excalidraw.com/docs/@excalidraw/excalidraw/faq#turning-off-aggresive-block-fingerprinting-in-brave-browser",children:e})})}),h.jsx("p",{children:h.jsx(Ta,{i18nKey:"errors.brave_measure_text_error.line4",issueLink:e=>h.jsx("a",{href:"https://github.com/excalidraw/excalidraw/issues/new",children:e}),discordLink:e=>h.jsxs("a",{href:"https://discord.gg/UexuTaE",children:[e,"."]})})})]}),HH=BH,gd={width:100,height:0},Pi=100,XH=(e,t,n)=>{let a=Cn({x:0,y:0,textAlign:ro.CENTER,verticalAlign:Mn.MIDDLE,...t,containerId:e.id,strokeColor:t.strokeColor||e.strokeColor});return Object.assign(e,{boundElements:(e.boundElements||[]).concat({type:"text",id:a.id})}),ln(a,e,n),[e,a]},a6=(e,t,n,a,i)=>{let r,s;if(Object.assign(e,{startBinding:e?.startBinding||null,endBinding:e.endBinding||null}),t){let l=t?.width??Pi,u=t?.height??Pi,f;t.id&&(f=a.getElement(t.id),f||console.error(`No element for start binding with id ${t.id} found`));let p=t.x||e.x-l,U=t.y||e.y-u/2,m=f?f.type:t.type;if(m){if(m==="text"){let g="";f&&f.type==="text"?g=f.text:t.type==="text"&&(g=t.text),g||console.error(`No text found for start binding text element for ${e.id}`),r=Cn({x:p,y:U,type:"text",...f,...t,text:g}),Object.assign(r,{x:t.x||e.x-r.width,y:t.y||e.y-r.height/2})}else switch(m){case"rectangle":case"ellipse":case"diamond":{r=Pa({x:p,y:U,width:l,height:u,...f,...t,type:m});break}default:Dr(e,`Unhandled element start type "${t.type}"`,!0)}La(e,r,"start",i)}}if(n){let l=n?.height??Pi,u=n?.width??Pi,f;n.id&&(f=a.getElement(n.id),f||console.error(`No element for end binding with id ${n.id} found`));let p=n.x||e.x+e.width,U=n.y||e.y-l/2,m=f?f.type:n.type;if(m){if(m==="text"){let g="";f&&f.type==="text"?g=f.text:n.type==="text"&&(g=n.text),g||console.error(`No text found for end binding text element for ${e.id}`),s=Cn({x:p,y:U,type:"text",...f,...n,text:g}),Object.assign(s,{y:n.y||e.y-s.height/2})}else switch(m){case"rectangle":case"ellipse":case"diamond":{s=Pa({x:p,y:U,width:u,height:l,...f,...n,type:m});break}default:Dr(e,`Unhandled element end type "${m}"`,!0)}La(e,s,"end",i)}}if(e.points.length<2)return{linearElement:e,startBoundElement:r,endBoundElement:s};let o=e.points.length-1,d=.5,c=ti(e.points);return e.points[o][0]>e.points[o-1][0]&&(c[0][0]=d,c[o][0]-=d),e.points[o][0]<e.points[o-1][0]&&(c[0][0]=-d,c[o][0]+=d),e.points[o][1]>e.points[o-1][1]&&(c[0][1]=d,c[o][1]-=d),e.points[o][1]<e.points[o-1][1]&&(c[0][1]=-d,c[o][1]+=d),Object.assign(e,{points:c}),{linearElement:e,startBoundElement:r,endBoundElement:s}},WH=class{constructor(){j(this,"excalidrawElements",new Map),j(this,"add",e=>{e&&this.excalidrawElements.set(e.id,e)}),j(this,"getElements",()=>Oa(Array.from(this.excalidrawElements.values()))),j(this,"getElementsMap",()=>zn(oe(this.getElements()))),j(this,"getElement",e=>this.excalidrawElements.get(e))}},Bc=(e,t)=>{if(!e)return[];let n=ti(e),a=new WH,i=new Map,r=new Map;for(let o of n){let d,c=o.id;switch(t?.regenerateIds!==!1&&Object.assign(o,{id:Xn()}),o.type){case"rectangle":case"ellipse":case"diamond":{let l=o?.label?.text&&o.width===void 0?0:o?.width||Pi,u=o?.label?.text&&o.height===void 0?0:o?.height||Pi;d=Pa({...o,width:l,height:u});break}case"line":{let l=o.width||gd.width,u=o.height||gd.height;d=Sr({width:l,height:u,points:[E(0,0),E(l,u)],...o});break}case"arrow":{let l=o.width||gd.width,u=o.height||gd.height;d=o0({width:l,height:u,endArrowhead:"arrow",points:[E(0,0),E(l,u)],...o,type:"arrow"}),Object.assign(d,As(d.points));break}case"text":{let l=o?.fontFamily||qi,u=o?.fontSize||pi,f=o?.lineHeight||Nr(l),p=o.text??"",U=_s(p),m=nn(U,Xe({fontFamily:l,fontSize:u}),f);d=Cn({width:m.width,height:m.height,fontFamily:l,fontSize:u,...o});break}case"image":{d=f8({width:o?.width||Pi,height:o?.height||Pi,...o});break}case"frame":{d=l0({x:0,y:0,...o});break}case"magicframe":{d=Rf({x:0,y:0,...o});break}case"freedraw":case"iframe":case"embeddable":{d=o;break}default:d=o,Dr(o,`Unhandled element type "${o.type}"`,!0)}a.getElement(d.id)?console.error(`Duplicate id found for ${d.id}`):(a.add(d),i.set(d.id,o),c&&r.set(c,d.id))}let s=a.getElementsMap();for(let[o,d]of i){let c=a.getElement(o);switch(d.type){case"rectangle":case"ellipse":case"diamond":case"arrow":{if(d.label?.text){let[l,u]=XH(c,d?.label,s);if(a.add(l),a.add(u),ve(l)){let f=d.type==="arrow"?d?.start:void 0,p=d.type==="arrow"?d?.end:void 0;if(f&&f.id){let b=r.get(f.id);b&&Object.assign(f,{id:b})}if(p&&p.id){let b=r.get(p.id);b&&Object.assign(p,{id:b})}let{linearElement:U,startBoundElement:m,endBoundElement:g}=a6(l,f,p,a,s);l=U,a.add(U),a.add(m),a.add(g)}}else switch(d.type){case"arrow":{let{start:l,end:u}=d;if(l&&l.id){let m=r.get(l.id);Object.assign(l,{id:m})}if(u&&u.id){let m=r.get(u.id);Object.assign(u,{id:m})}let{linearElement:f,startBoundElement:p,endBoundElement:U}=a6(c,l,u,a,s);a.add(f),a.add(p),a.add(U);break}}break}}}for(let[o,d]of i){if(d.type!=="frame"&&d.type!=="magicframe")continue;let c=a.getElement(o);if(!c)throw new Error(`Excalidraw element with id ${o} doesn't exist`);let l=[];d.children.forEach(y=>{let w=r.get(y);if(!w)throw new Error(`Element with ${y} wasn't mapped correctly`);let k=a.getElement(w);if(!k)throw new Error(`Frame element with id ${w} doesn't exist`);Object.assign(k,{frameId:c.id}),k?.boundElements?.forEach(M=>{let I=a.getElement(M.id);if(!I)throw new Error(`Bound element with id ${M.id} doesn't exist`);Object.assign(I,{frameId:c.id}),l.push(I)}),l.push(k)});let[u,f,p,U]=Ne(l),m=10;u=u-m,f=f-m,p=p+m,U=U+m;let g=c?.x||u,b=c?.y||f,v=c?.width||p-u,x=c?.height||U-f;Object.assign(c,{x:g,y:b,width:v,height:x}),P5()&&d.children.length&&(c?.x||c?.y||c?.width||c?.height)&&console.info("User provided frame attributes are being considered, if you find this inaccurate, please remove any of the attributes - x, y, width and height so frame coordinates and dimensions are calculated automatically")}return a.getElements()},ht=e=>t=>{Kt.unstable_batchedUpdates(e,t)},Xh=e=>Jc(t=>{Kt.unstable_batchedUpdates(e,t)}),mp=(()=>{let e;try{let n=C.version.split(".");e=Number(n[0])>17}catch{e=!1}let t=!1;return()=>window.EXCALIDRAW_THROTTLE_RENDER===!0?e?!0:(t||(t=!0,console.warn("Excalidraw: render throttling is disabled on React versions < 18.")),!1):!1})(),VH="#ff6b6b",GH="#ff0000",i6=1,r6=2,ZH=(e,t)=>{if(!t.snapLines.length)return;let n=t.theme===Me.LIGHT||t.zenModeEnabled?VH:GH,a=(t.zenModeEnabled?i6*1.5:i6)/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY);for(let i of t.snapLines)i.type==="pointer"?(e.lineWidth=a,e.strokeStyle=n,KH(i,e,t)):i.type==="gap"?(e.lineWidth=a,e.strokeStyle=n,qH(i.points[0],i.points[1],i.direction,t,e)):i.type==="points"&&(e.lineWidth=a,e.strokeStyle=n,YH(i,e,t));e.restore()},YH=(e,t,n)=>{if(!n.zenModeEnabled){let a=e.points[0],i=e.points[e.points.length-1];Tn(a,i,t)}for(let a of e.points)fx(a,n,t)},KH=(e,t,n)=>{fx(e.points[0],n,t),n.zenModeEnabled||Tn(e.points[0],e.points[1],t)},fx=([e,t],n,a)=>{a.save();let i=(n.zenModeEnabled?r6*1.5:r6)/n.zoom.value;a.beginPath(),a.moveTo(e-i,t-i),a.lineTo(e+i,t+i),a.moveTo(e+i,t-i),a.lineTo(e-i,t+i),a.stroke(),a.restore()},Tn=(e,t,n)=>{n.beginPath(),n.lineTo(e[0],e[1]),n.lineTo(t[0],t[1]),n.stroke()},qH=(e,t,n,a,i)=>{let r=8/a.zoom.value,s=r/2,o=r/4;if(n==="horizontal"){let d=[(e[0]+t[0])/2,e[1]];a.zenModeEnabled||Tn(E(e[0],e[1]-r),E(e[0],e[1]+r),i),Tn(E(d[0]-o,d[1]-s),E(d[0]-o,d[1]+s),i),Tn(E(d[0]+o,d[1]-s),E(d[0]+o,d[1]+s),i),a.zenModeEnabled||(Tn(E(t[0],t[1]-r),E(t[0],t[1]+r),i),Tn(e,t,i))}else{let d=[e[0],(e[1]+t[1])/2];a.zenModeEnabled||Tn(E(e[0]-r,e[1]),E(e[0]+r,e[1]),i),Tn(E(d[0]-s,d[1]-o),E(d[0]+s,d[1]-o),i),Tn(E(d[0]-s,d[1]+o),E(d[0]+s,d[1]+o),i),a.zenModeEnabled||(Tn(E(t[0]-r,t[1]),E(t[0]+r,t[1]),i),Tn(e,t,i))}},JH=(e,t)=>{tn(t.selectedLinearElement,"selectedLinearElement is null");let{segmentMidPointHoveredCoords:n}=t.selectedLinearElement;tn(n,"midPointCoords is null"),e.save(),e.translate(t.scrollX,t.scrollY),px(n,e,t),e.restore()},QH=(e,t,n)=>{let{elementId:a,hoverPointIndex:i}=t.selectedLinearElement;if(t.editingLinearElement?.selectedPointsIndices?.includes(i))return;let r=J.getElement(a,n);if(!r)return;let s=J.getPointAtIndexGlobalCoordinates(r,i,n);e.save(),e.translate(t.scrollX,t.scrollY),px(s,e,t),e.restore()},px=(e,t,n)=>{t.fillStyle="rgba(105, 101, 219, 0.4)",mu(t,e[0],e[1],J.POINT_HANDLE_SIZE/n.zoom.value,!1)},Xo=(e,t,n,a,i,r,s,o,d=!1,c=0)=>{e.save(),e.translate(r,s),e.rotate(o),d&&e.fillRect(t-r,n-s,a,i),c&&e.roundRect?(e.beginPath(),e.roundRect(t-r,n-s,a,i,c),e.stroke(),e.closePath()):e.strokeRect(t-r,n-s,a,i),e.restore()},eX=(e,t,n,a,i,r)=>{e.save(),e.translate(a,i),e.rotate(r),e.beginPath(),e.moveTo(0,n/2),e.lineTo(t/2,0),e.lineTo(0,-n/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()},Wh=(e,t,n,a,i,r=!1)=>{e.strokeStyle="#5e5ad8",e.setLineDash([]),e.fillStyle="rgba(255, 255, 255, 0.9)",i?e.fillStyle="rgba(134, 131, 226, 0.9)":r&&(e.fillStyle="rgba(177, 151, 252, 0.7)"),mu(e,n[0],n[1],a/t.zoom.value,!r)},tX=(e,t,n,a,i,r)=>{e.beginPath(),e.ellipse(a,i,t/2,n/2,r,0,Math.PI*2),e.stroke()},nX=(e,t,n,a)=>{let[i,r,s,o]=fe(t,n),d=s-i,c=o-r;e.strokeStyle="rgba(0,0,0,.05)";let l=a.value<1?a.value:1;e.lineWidth=a0/l;let u=e.lineWidth/2+i0,f=la(Math.min(t.width,t.height),t);switch(t.type){case"rectangle":case"text":case"image":case"iframe":case"embeddable":case"frame":case"magicframe":Xo(e,i-u,r-u,d+u*2,c+u*2,i+d/2,r+c/2,t.angle,void 0,f);break;case"diamond":let p=Math.hypot(d,c),U=u*p/c,m=u*p/d;eX(e,d+U*2,c+m*2,i+d/2,r+c/2,t.angle);break;case"ellipse":tX(e,d+u*2,c+u*2,i+d/2,r+c/2,t.angle);break}},aX=(e,t,n,a)=>{let[i,r,s]=t,o=Lo(s,s.width,s.height,a);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)",(r==="both"?[0,-1]:r==="start"?[0]:[-1]).forEach(d=>{let[c,l]=J.getPointAtIndexGlobalCoordinates(i,d,n);mu(e,c,l,o)})},Ux=(e,t,n)=>{let{angle:a,x1:i,y1:r,x2:s,y2:o,selectionColors:d,cx:c,cy:l,dashed:u,activeEmbeddable:f}=n,p=s-i,U=o-r,m=(n.padding??jr*2)/t.zoom.value,g=8/t.zoom.value,b=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=(f?4:1)/t.zoom.value;let v=d.length;for(let x=0;x<v;++x)e.strokeStyle=d[x],u&&e.setLineDash([g,b+(g+b)*(v-1)]),e.lineDashOffset=(g+b)*x,Xo(e,i-m,r-m,p+m*2,U+m*2,c,l,a);e.restore()},iX=(e,t,n,a)=>{let i=Array.isArray(n)?aX:nX;e.save(),e.translate(t.scrollX,t.scrollY),i(e,n,a,t.zoom),e.restore()},rX=(e,t,n,a)=>{let[i,r,s,o]=fe(n,a),d=s-i,c=o-r;e.strokeStyle="rgb(0,118,255)",e.lineWidth=dt.strokeWidth/t.zoom.value,e.save(),e.translate(t.scrollX,t.scrollY),Xo(e,i,r,d,c,i+d/2,r+c/2,n.angle,!1,dt.radius/t.zoom.value),e.restore()},sX=(e,t,n)=>{let a=n.filter(o=>o.groupIds.length===0),i=n.filter(o=>o.groupIds.length>0),r=o=>{let[d,c,l,u]=Ne(o);return{angle:0,x1:d,x2:l,y1:c,y2:u,selectionColors:["rgb(0,118,255)"],dashed:!1,cx:d+(l-d)/2,cy:c+(u-c)/2,activeEmbeddable:!1}},s=o=>{let d=tt(n,o);return r(d)};Object.entries(t8(i,t)).filter(([o,d])=>d).map(([o,d])=>o).map(o=>s(o)).concat(a.map(o=>r([o]))).forEach(o=>Ux(e,t,o))},Vh=(e,t,n,a)=>{if(!t.selectedLinearElement)return;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;let i=J.getPointsGlobalCoordinates(n,a),{POINT_HANDLE_SIZE:r}=J,s=t.editingLinearElement?r:r/2;if(i.forEach((o,d)=>{if(Q(n)&&d!==0&&d!==i.length-1)return;let c=!!t.editingLinearElement?.selectedPointsIndices?.includes(d);Wh(e,t,o,s,c)}),Q(n)){let o=n.fixedSegments?.map(d=>d.index)||[];i.slice(0,-1).forEach((d,c)=>{J.isSegmentTooShort(n,i[c+1],i[c],c,t.zoom)||Wh(e,t,E((d[0]+i[c+1][0])/2,(d[1]+i[c+1][1])/2),r/2,!1,!o.includes(c+1))})}else J.getEditorMidPoints(n,a,t).filter((o,d,c)=>o!==null&&!(Q(n)&&(d===0||d===c.length-1))).forEach(o=>{(t.editingLinearElement||i.length===2)&&Wh(e,t,o,r/2,!1,!0)});e.restore()},s6=(e,t,n,a,i)=>{Object.keys(a).forEach(r=>{let s=a[r];if(s!==void 0){let[o,d,c,l]=s;e.save(),e.lineWidth=1/n.zoom.value,t.selectionColor&&(e.strokeStyle=t.selectionColor),r==="rotation"?mu(e,o+c/2,d+l/2,c/2):e.roundRect?(e.beginPath(),e.roundRect(o,d,c,l,2/n.zoom.value),e.fill(),e.stroke()):Xo(e,o,d,c,l,o+c/2,d+l/2,i,!0),e.restore()}})},lX=(e,t,n,a,i)=>{let[r,s,,,o,d]=fe(a,i),c=3,l=20,u=c/n.zoom.value,f=u/2,p=o-r+u,U=d-s+u,m=Math.min(l/n.zoom.value,p),g=Math.min(l/n.zoom.value,U);e.save(),e.fillStyle=t.selectionColor,e.strokeStyle=t.selectionColor,e.lineWidth=u,[[[-p,-U],[0,f],[m,f],[f,0],[f,g]],[[p-f,-U],[f,f],[-m+f,f],[0,0],[0,g]],[[-p,U],[0,-f],[m,-f],[f,0],[f,-g]],[[p-f,U],[f,-f],[-m+f,-f],[0,0],[0,-g]]].forEach(b=>{let[[v,x],[y,w],[k,M],[I,A],[_,T]]=b;e.save(),e.translate(o,d),e.rotate(a.angle),e.beginPath(),e.moveTo(v+y,x+w),e.lineTo(v+k,x+M),e.stroke(),e.beginPath(),e.moveTo(v+I,x+A),e.lineTo(v+_,x+T),e.stroke(),e.restore()}),e.restore()},oX=(e,t,n,a)=>{t.save();let i=jr*2/n.zoom.value,r=e.width+i*2,s=e.height+i*2,o=e.x+r/2,d=e.y+s/2,c=-(r/2+i),l=-(s/2+i);t.translate(o+n.scrollX,d+n.scrollY),t.rotate(e.angle),t.lineWidth=1/n.zoom.value,t.strokeStyle=a,t.strokeRect(c,l,r,s),t.restore()},mx=({canvas:e,elementsMap:t,visibleElements:n,selectedElements:a,allElementsMap:i,scale:r,appState:s,renderConfig:o,device:d})=>{if(e===null)return{atLeastOneVisibleElement:!1,elementsMap:t};let[c,l]=f0(e,r),u=p0({canvas:e,scale:r,normalizedWidth:c,normalizedHeight:l});u.save(),u.scale(s.zoom.value,s.zoom.value);let f;if(n.forEach(m=>{s.editingLinearElement?.elementId===m.id&&m&&(f=m)}),f&&Vh(u,s,f,t),s.selectionElement&&!s.isCropping)try{zA(s.selectionElement,u,s,o.selectionColor)}catch(m){console.error(m)}if(s.editingTextElement&&q(s.editingTextElement)){let m=i.get(s.editingTextElement.id);m&&!m.autoResize&&oX(m,u,s,o.selectionColor)}s.isBindingEnabled&&s.suggestedBindings.filter(m=>m!=null).forEach(m=>{iX(u,s,m,t)}),s.frameToHighlight&&rX(u,s,s.frameToHighlight,t),s.elementsToHighlight&&sX(u,s,s.elementsToHighlight);let p=a.some(m=>de(m));if(a.length===1&&s.editingLinearElement?.elementId===a[0].id&&Vh(u,s,a[0],t),Q(a[0])&&s.selectedLinearElement&&s.selectedLinearElement.segmentMidPointHoveredCoords?JH(u,s):s.selectedLinearElement&&s.selectedLinearElement.hoverPointIndex>=0&&!(Q(a[0])&&s.selectedLinearElement.hoverPointIndex>0&&s.selectedLinearElement.hoverPointIndex<a[0].points.length-1)&&QH(u,s,t),!s.multiElement&&!s.editingLinearElement){let m=l7(a,s),g=a.length===1&&ue(a[0]);g&&s.selectedLinearElement?.elementId===a[0].id&&!a[0].locked&&Vh(u,s,a[0],t);let b=o.selectionColor||Ft.black;if(m){let v=oe(a),x=[];for(let w of t.values()){let k=[],M=o.remoteSelectedElementIds.get(w.id);if(g&&Q(w)&&(w.startBinding||w.endBinding)||(v.has(w.id)&&!Qb(s,w)&&k.push(b),M&&k.push(...M.map(I=>Du(I,s.collaborators.get(I))))),k.length){let[I,A,_,T,L,R]=fe(w,t,!0);x.push({angle:w.angle,x1:I,y1:A,x2:_,y2:T,selectionColors:k,dashed:!!M,cx:L,cy:R,activeEmbeddable:s.activeEmbeddable?.element===w&&s.activeEmbeddable.state==="active",padding:w.id===s.croppingElementId||Re(w)?0:void 0})}}let y=w=>{let k=tt(t,w),[M,I,A,_]=Ne(k);x.push({angle:0,x1:M,x2:A,y1:I,y2:_,selectionColors:[Ft.black],dashed:!0,cx:M+(A-M)/2,cy:I+(_-I)/2,activeEmbeddable:!1})};for(let w of Er(s))y(w);s.editingGroupId&&y(s.editingGroupId),x.forEach(w=>Ux(u,s,w))}if(u.save(),u.translate(s.scrollX,s.scrollY),a.length===1){u.fillStyle=Ft.white;let v=s7(a[0],s.zoom,t,"mouse",zl(d));if(!s.viewModeEnabled&&m&&!q(s.editingTextElement)&&!s.croppingElementId&&s6(u,o,s,v,a[0].angle),s.croppingElementId&&!s.isCropping){let x=t.get(s.croppingElementId);x&&Re(x)&&lX(u,o,s,x,t)}}else if(a.length>1&&!s.isRotating){let v=jr*2/s.zoom.value;u.fillStyle=Ft.white;let[x,y,w,k]=Ne(a),M=u.getLineDash();u.setLineDash([2/s.zoom.value]);let I=u.lineWidth;u.lineWidth=1/s.zoom.value,u.strokeStyle=b,Xo(u,x-v,y-v,w-x+v*2,k-y+v*2,(x+w)/2,(y+k)/2,0),u.lineWidth=I,u.setLineDash(M);let A=L0([x,y,w,k,(x+w)/2,(y+k)/2],0,s.zoom,"mouse",p?{...zl(d),rotation:!0}:zl(d));a.some(_=>!_.locked)&&s6(u,o,s,A,0)}u.restore()}s.searchMatches.forEach(({id:m,focus:g,matchedLines:b})=>{let v=t.get(m);if(v&&q(v)){let[x,y,,,w,k]=fe(v,t,!0);u.save(),s.theme===Me.LIGHT?g?u.fillStyle="rgba(255, 124, 0, 0.4)":u.fillStyle="rgba(255, 226, 0, 0.4)":g?u.fillStyle="rgba(229, 82, 0, 0.4)":u.fillStyle="rgba(99, 52, 0, 0.4)",u.translate(s.scrollX,s.scrollY),u.translate(w,k),u.rotate(v.angle),b.forEach(M=>{u.fillRect(x+M.offsetX-w,y+M.offsetY-k,M.width,M.height)}),u.restore()}}),ZH(u,s),u.restore(),Y$({context:u,renderConfig:o,appState:s,normalizedWidth:c,normalizedHeight:l});let U;return o.renderScrollbars&&(U=nB(n,c,l,s),u.save(),u.fillStyle=tB,u.strokeStyle="rgba(255,255,255,0.8)",[U.horizontal,U.vertical].forEach(m=>{m&&W4(u,m.x,m.y,m.width,m.height,Ri/2)}),u.restore()),{scrollBars:U,atLeastOneVisibleElement:n.length>0,elementsMap:t}},gx=Jc(e=>{let t=mx(e);e.callback?.(t)},{trailing:!0}),dX=(e,t)=>{if(t){gx(e);return}let n=mx(e);return e.callback(n),n},cX=e=>{let t=C.useRef(!1);return C.useEffect(()=>{if(!t.current){t.current=!0;return}let n=new Map,a=new Map,i=new Map,r=new Map,s=new Map;e.appState.collaborators.forEach((d,c)=>{if(d.selectedElementIds)for(let l of Object.keys(d.selectedElementIds))i.has(l)||i.set(l,[]),i.get(l).push(c);!d.pointer||d.pointer.renderCursor===!1||(d.username&&r.set(c,d.username),d.userState&&s.set(c,d.userState),a.set(c,Rn({sceneX:d.pointer.x,sceneY:d.pointer.y},e.appState)),n.set(c,d.button))});let o=e.containerRef?.current&&getComputedStyle(e.containerRef.current).getPropertyValue("--color-selection")||"#6965db";dX({canvas:e.canvas,elementsMap:e.elementsMap,visibleElements:e.visibleElements,selectedElements:e.selectedElements,allElementsMap:e.allElementsMap,scale:window.devicePixelRatio,appState:e.appState,renderConfig:{remotePointerViewportCoords:a,remotePointerButton:n,remoteSelectedElementIds:i,remotePointerUsernames:r,remotePointerUserStates:s,selectionColor:o,renderScrollbars:!1},device:e.device,callback:e.renderInteractiveSceneCallback},mp())}),h.jsx("canvas",{className:"excalidraw__canvas interactive",style:{width:e.appState.width,height:e.appState.height,cursor:e.appState.viewModeEnabled?Fe.GRAB:Fe.AUTO},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:e.handleCanvasRef,onContextMenu:e.onContextMenu,onPointerMove:e.onPointerMove,onPointerUp:e.onPointerUp,onPointerCancel:e.onPointerCancel,onTouchMove:e.onTouchMove,onPointerDown:e.onPointerDown,onDoubleClick:e.appState.viewModeEnabled?void 0:e.onDoubleClick,children:S("labels.drawingCanvas")})},l6=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,editingGroupId:e.editingGroupId,editingLinearElement:e.editingLinearElement,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,selectionElement:e.selectionElement,selectedGroupIds:e.selectedGroupIds,selectedLinearElement:e.selectedLinearElement,multiElement:e.multiElement,isBindingEnabled:e.isBindingEnabled,suggestedBindings:e.suggestedBindings,isRotating:e.isRotating,elementsToHighlight:e.elementsToHighlight,collaborators:e.collaborators,activeEmbeddable:e.activeEmbeddable,snapLines:e.snapLines,zenModeEnabled:e.zenModeEnabled,editingTextElement:e.editingTextElement,isCropping:e.isCropping,croppingElementId:e.croppingElementId,searchMatches:e.searchMatches}),uX=(e,t)=>e.selectionNonce!==t.selectionNonce||e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements||e.selectedElements!==t.selectedElements?!1:Wt(l6(e.appState),l6(t.appState)),hX=Z.memo(cX,uX),fX=e=>{let t=C.useRef(null),n=C.useRef(!1);return C.useEffect(()=>{let a=t.current;if(!a)return;let i=e.canvas;n.current||(n.current=!0,a.replaceChildren(i),i.classList.add("excalidraw__canvas","static"));let r=`${e.appState.width}px`,s=`${e.appState.height}px`;i.style.width!==r&&(i.style.width=r),i.style.height!==s&&(i.style.height=s);let o=e.appState.width*e.scale,d=e.appState.height*e.scale;i.width!==o&&(i.width=o),i.height!==d&&(i.height=d),D8({canvas:i,rc:e.rc,scale:e.scale,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,visibleElements:e.visibleElements,appState:e.appState,renderConfig:e.renderConfig},mp())}),h.jsx("div",{className:"excalidraw__canvas-wrapper",ref:t})},o6=e=>({zoom:e.zoom,scrollX:e.scrollX,scrollY:e.scrollY,width:e.width,height:e.height,viewModeEnabled:e.viewModeEnabled,openDialog:e.openDialog,hoveredElementIds:e.hoveredElementIds,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,theme:e.theme,pendingImageElementId:e.pendingImageElementId,shouldCacheIgnoreZoom:e.shouldCacheIgnoreZoom,viewBackgroundColor:e.viewBackgroundColor,exportScale:e.exportScale,selectedElementsAreBeingDragged:e.selectedElementsAreBeingDragged,gridSize:e.gridSize,gridStep:e.gridStep,frameRendering:e.frameRendering,selectedElementIds:e.selectedElementIds,frameToHighlight:e.frameToHighlight,editingGroupId:e.editingGroupId,currentHoveredFontFamily:e.currentHoveredFontFamily,croppingElementId:e.croppingElementId}),pX=(e,t)=>e.sceneNonce!==t.sceneNonce||e.scale!==t.scale||e.elementsMap!==t.elementsMap||e.visibleElements!==t.visibleElements?!1:Wt(o6(e.appState),o6(t.appState))&&Wt(e.renderConfig,t.renderConfig),UX=Z.memo(fX,pX),d6=class{constructor(e){j(this,"scene"),j(this,"getRenderableElements",(()=>{let t=({elementsMap:a,zoom:i,offsetLeft:r,offsetTop:s,scrollX:o,scrollY:d,height:c,width:l})=>{let u=[];for(let f of a.values())_c(f,l,c,{zoom:i,offsetLeft:r,offsetTop:s,scrollX:o,scrollY:d},a)&&u.push(f);return u},n=({elements:a,editingTextElement:i,newElementId:r,pendingImageElementId:s})=>{let o=zn(new Map);for(let d of a)Re(d)&&s===d.id||r!==d.id&&(!i||i.type!=="text"||d.id!==i.id)&&o.set(d.id,d);return o};return mk(({zoom:a,offsetLeft:i,offsetTop:r,scrollX:s,scrollY:o,height:d,width:c,editingTextElement:l,newElementId:u,pendingImageElementId:f,sceneNonce:p})=>{let U=this.scene.getNonDeletedElements(),m=n({elements:U,editingTextElement:l,newElementId:u,pendingImageElementId:f}),g=t({elementsMap:m,zoom:a,offsetLeft:i,offsetTop:r,scrollX:s,scrollY:o,height:d,width:c});return{elementsMap:m,visibleElements:g}})})()),this.scene=e}destroy(){gx.cancel(),A8.cancel(),this.getRenderableElements.clear()}},mX=({trails:e})=>{let t=C.useRef(null);return C.useEffect(()=>{if(t.current)for(let n of e)n.start(t.current);return()=>{for(let n of e)n.stop()}},e),h.jsx("div",{className:"SVGLayer",children:h.jsx("svg",{ref:t})})},gX=5,bX=(e,t,n)=>{let[a,i]=fe(e,n),{x:r,y:s}=Rn({sceneX:a+e.width,sceneY:i},t),o=r-t.offsetLeft+10,d=s-t.offsetTop;return{x:o,y:d}},c6=({children:e,element:t,elementsMap:n})=>{let a=Vo();if(a.contextMenu||a.newElement||a.resizingElement||a.isRotating||a.openMenu||a.viewModeEnabled)return null;let{x:i,y:r}=bX(t,a,n);return h.jsx("div",{className:"excalidraw-canvas-buttons",style:{top:`${r}px`,left:`${i}px`,padding:gX},children:e})},xX="small",Gh=e=>h.jsxs("label",{className:te("ToolIcon ToolIcon__MagicButton",`ToolIcon_size_${xX}`,{"is-mobile":e.isMobile}),title:`${e.title}`,children:[h.jsx("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),h.jsx("div",{className:"ToolIcon__icon",children:e.icon})]}),vX=({height:e,width:t,userToFollow:n,onDisconnect:a})=>h.jsx("div",{className:"follow-mode",style:{width:t,height:e},children:h.jsxs("div",{className:"follow-mode__badge",children:[h.jsxs("div",{className:"follow-mode__badge__label",children:["Following"," ",h.jsx("span",{className:"follow-mode__badge__username",title:n.username,children:n.username})]}),h.jsx("button",{type:"button",onClick:a,className:"follow-mode__disconnect-btn",children:Ws})]})}),yX=vX,wX=class{constructor(){j(this,"targets",new WeakMap),j(this,"rafIds",new WeakMap)}register(e,t){this.targets.set(e,{callback:t,stopped:!0})}start(e){let t=this.targets.get(e);t&&(this.rafIds.has(e)||(this.targets.set(e,{...t,stopped:!1}),this.scheduleFrame(e)))}stop(e){let t=this.targets.get(e);t&&!t.stopped&&this.targets.set(e,{...t,stopped:!0}),this.cancelFrame(e)}constructFrame(e){return t=>{let n=this.targets.get(e);if(!n)return;let a=this.onFrame(n,t);!n.stopped&&!a?this.scheduleFrame(e):this.cancelFrame(e)}}scheduleFrame(e){let t=requestAnimationFrame(this.constructFrame(e));this.rafIds.set(e,t)}cancelFrame(e){if(this.rafIds.has(e)){let t=this.rafIds.get(e);cancelAnimationFrame(t)}this.rafIds.delete(e)}onFrame(e,t){return e.callback(t)??!1}},w1=class{constructor(e,t,n){this.animationFrameHandler=e,this.app=t,this.options=n,j(this,"currentTrail"),j(this,"pastTrails",[]),j(this,"container"),j(this,"trailElement"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.trailElement=document.createElementNS(je,"path")}get hasCurrentTrail(){return!!this.currentTrail}hasLastPoint(e,t){if(this.currentTrail){let n=this.currentTrail.originalPoints.length;return this.currentTrail.originalPoints[n-1][0]===e&&this.currentTrail.originalPoints[n-1][1]===t}return!1}start(e){e&&(this.container=e),this.trailElement.parentNode!==this.container&&this.container&&this.container.appendChild(this.trailElement),this.animationFrameHandler.start(this)}stop(){this.animationFrameHandler.stop(this),this.trailElement.parentNode===this.container&&this.container?.removeChild(this.trailElement)}startPath(e,t){this.currentTrail=new Dc(this.options),this.currentTrail.addPoint([e,t,performance.now()]),this.update()}addPointToPath(e,t){this.currentTrail&&(this.currentTrail.addPoint([e,t,performance.now()]),this.update())}endPath(){this.currentTrail&&(this.currentTrail.close(),this.currentTrail.options.keepHead=!1,this.pastTrails.push(this.currentTrail),this.currentTrail=void 0,this.update())}update(){this.start()}onFrame(){let e=[];for(let n of this.pastTrails)e.push(this.drawTrail(n,this.app.state));if(this.currentTrail){let n=this.drawTrail(this.currentTrail,this.app.state);e.push(n)}this.pastTrails=this.pastTrails.filter(n=>n.getStrokeOutline().length!==0),e.length===0&&this.stop();let t=e.join(" ").trim();this.trailElement.setAttribute("d",t),this.trailElement.setAttribute("fill",(this.options.fill??(()=>"black"))(this))}drawTrail(e,t){let n=e.getStrokeOutline(e.options.size/t.zoom.value).map(([a,i])=>{let r=Rn({sceneX:a,sceneY:i},t);return[r.x,r.y]});return gk(n,!0)}},EX=class{constructor(e,t){this.animationFrameHandler=e,this.app=t,j(this,"localTrail"),j(this,"collabTrails",new Map),j(this,"container"),this.animationFrameHandler.register(this,this.onFrame.bind(this)),this.localTrail=new w1(e,t,{...this.getTrailOptions(),fill:()=>b5})}getTrailOptions(){return{simplify:0,streamline:.4,sizeMapping:e=>{let t=Math.max(0,1-(performance.now()-e.pressure)/1e3),n=(50-Math.min(50,e.totalLength-e.currentIndex))/50;return Math.min(yr(n),yr(t))}}}startPath(e,t){this.localTrail.startPath(e,t)}addPointToPath(e,t){this.localTrail.addPointToPath(e,t)}endPath(){this.localTrail.endPath()}start(e){this.container=e,this.animationFrameHandler.start(this),this.localTrail.start(e)}stop(){this.animationFrameHandler.stop(this),this.localTrail.stop()}onFrame(){this.updateCollabTrails()}updateCollabTrails(){if(!(!this.container||this.app.state.collaborators.size===0)){for(let[e,t]of this.app.state.collaborators.entries()){let n;this.collabTrails.has(e)?n=this.collabTrails.get(e):(n=new w1(this.animationFrameHandler,this.app,{...this.getTrailOptions(),fill:()=>t.pointer?.laserColor||Du(e,t)}),n.start(this.container),this.collabTrails.set(e,n)),t.pointer&&t.pointer.tool==="laser"&&(t.button==="down"&&!n.hasCurrentTrail&&n.startPath(t.pointer.x,t.pointer.y),t.button==="down"&&n.hasCurrentTrail&&!n.hasLastPoint(t.pointer.x,t.pointer.y)&&n.addPointToPath(t.pointer.x,t.pointer.y),t.button==="up"&&n.hasCurrentTrail&&(n.addPointToPath(t.pointer.x,t.pointer.y),n.endPath()))}for(let e of this.collabTrails.keys())this.app.state.collaborators.has(e)||(this.collabTrails.get(e).stop(),this.collabTrails.delete(e))}}},SX=(e,t,n,a,i,r)=>{let{zoom:s}=a,o=180*n/Math.PI,d=e*(s.value-1)/2,c=t*(s.value-1)/2;return e>i&&s.value!==1&&(d=i*(s.value-1)/2),t>r&&s.value!==1&&(c=r*(s.value-1)/2),`translate(${d}px, ${c}px) scale(${s.value}) rotate(${o}deg)`},kX=({id:e,onChange:t,onSubmit:n,getViewportCoords:a,element:i,canvas:r,excalidrawContainer:s,app:o,autoSelect:d=!0})=>{let c=(P,$)=>{if(!$.style.fontFamily||!$.style.fontSize)return!1;let O=$.style.fontFamily.replace(/"/g,"");return Cs({fontFamily:P.fontFamily})!==O||`${P.fontSize}px`!==$.style.fontSize},l=()=>{let P=o.state,$=ci.getScene(i)?.getElement(e);if(!$)return;let{textAlign:O,verticalAlign:V}=$,W=o.scene.getNonDeletedElementsMap();if($&&q($)){let K=$.x,se=$.y,le=zt($,o.scene.getNonDeletedElementsMap()),Ie=$.width,Qe=$.height,rt=$.width,at=$.height;if(le&&$.containerId){if(ve(le)){let bi=J.getBoundTextElementPosition(le,$,W);K=bi.x,se=bi.y}let Zo=c($,u),Ks;if(Zo?Ks=yc(le.id,le.height):(Ks=Rs[le.id],Ks||(Ks=yc(le.id,le.height))),rt=di(le,$),at=Uu(le,$),!ve(le)&&Qe>at){let bi=$r(Qe,le.type);X(le,{height:bi});return}else if(!ve(le)&&le.height>Ks.height&&Qe<at){let bi=$r(Qe,le.type);X(le,{height:bi})}else{let{y:bi}=pu(le,$,W);se=bi}}let[ce,me]=a(K,se),Be=u.selectionStart,ye=u.selectionEnd,Ae=u.value.length;if(Be===ye&&ye!==Ae){let Zo=Ae-ye;u.selectionStart=u.value.length-Zo,u.selectionEnd=u.value.length-Zo}le?Ie+=.5:(rt=(P.width-8-ce)/P.zoom.value,Ie=Math.min(Ie,rt)),Qe*=1.05;let kt=Xe($),tr=(P.height-me)/P.zoom.value;Object.assign(u.style,{font:kt,lineHeight:$.lineHeight,width:`${Ie}px`,height:`${Qe}px`,left:`${ce}px`,top:`${me}px`,transform:SX(Ie,Qe,JD($,le),P,rt,tr),textAlign:O,verticalAlign:V,color:$.strokeColor,opacity:$.opacity/100,filter:"var(--theme-filter)",maxHeight:`${tr}px`}),u.scrollTop=0,ri()&&(u.style.fontFamily=Cs($)),X($,{x:K,y:se})}},u=document.createElement("textarea");u.dir="auto",u.tabIndex=0,u.dataset.type="wysiwyg",u.wrap="off",u.classList.add("excalidraw-wysiwyg");let f="pre",p="normal";(nt(i)||!i.autoResize)&&(f="pre-wrap",p="break-word"),Object.assign(u.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",zIndex:"var(--zIndex-wysiwyg)",wordBreak:p,whiteSpace:f,overflowWrap:"break-word",boxSizing:"content-box"}),u.value=i.originalText,l(),t&&(u.onpaste=async P=>{let $=await X8(P,!0);if(!$.text)return;let O=_s($.text);if(!O)return;let V=zt(i,o.scene.getNonDeletedElementsMap()),W=Xe({fontSize:o.state.currentItemFontSize,fontFamily:o.state.currentItemFontFamily});if(V){let K=ge(V,o.scene.getNonDeletedElementsMap()),se=Vr(`${u.value}${O}`,W,di(V,K)),le=z1(se,W);u.style.width=`${le}px`}},u.oninput=()=>{let P=_s(u.value);if(u.value!==P){let $=u.selectionStart;u.value=P,u.selectionStart=$,u.selectionEnd=$}t(u.value)}),u.onkeydown=P=>{if(!P.shiftKey&&cg.keyTest(P))P.preventDefault(),o.actionManager.executeAction(cg),l();else if(!P.shiftKey&&ug.keyTest(P))P.preventDefault(),o.actionManager.executeAction(ug),l();else if(!P.shiftKey&&hg.keyTest(P))P.preventDefault(),o.actionManager.executeAction(hg),l();else if(lg.keyTest(P))o.actionManager.executeAction(lg);else if(og.keyTest(P))o.actionManager.executeAction(og);else if(P.key===D.ESCAPE)P.preventDefault(),w=!0,k();else if(P.key===D.ENTER&&P[D.CTRL_OR_CMD]){if(P.preventDefault(),P.isComposing||P.keyCode===229)return;w=!0,k()}else if(P.key===D.TAB||P[D.CTRL_OR_CMD]&&(P.code===Te.BRACKET_LEFT||P.code===Te.BRACKET_RIGHT)){if(P.preventDefault(),P.isComposing)return;P.shiftKey||P.code===Te.BRACKET_LEFT?v():b(),u.dispatchEvent(new Event("input"))}};let U=4,m=" ".repeat(U),g=new RegExp(`^ {1,${U}}`),b=()=>{let{selectionStart:P,selectionEnd:$}=u,O=x(),V=u.value;O.forEach(W=>{let K=V.slice(0,W),se=V.slice(W);V=`${K}${m}${se}`}),u.value=V,u.selectionStart=P+U,u.selectionEnd=$+U*O.length},v=()=>{let{selectionStart:P,selectionEnd:$}=u,O=x(),V=[],W=u.value;O.forEach(K=>{let se=W.slice(K,K+U).match(g);if(se){let le=W.slice(0,K),Ie=W.slice(K+se[0].length);W=`${le}${Ie}`,V.push(K)}}),u.value=W,V.length&&(P>V[V.length-1]?u.selectionStart=Math.max(P-U,V[V.length-1]):u.selectionStart=P,u.selectionEnd=Math.max(u.selectionStart,$-U*V.length))},x=()=>{let{selectionStart:P,selectionEnd:$,value:O}=u,V=O.slice(0,P).match(/[^\n]*$/)[0].length;return P=P-V,O.slice(P,$).split(`
65
+ `).reduce((W,K,se,le)=>W.concat(se?W[se-1]+le[se-1].length+1:P),[]).reverse()},y=P=>{P.target instanceof HTMLCanvasElement&&(P.preventDefault(),P.stopPropagation())},w=!1,k=()=>{if(R)return;R=!0,M();let P=ci.getScene(i)?.getElement(i.id);if(!P)return;let $=zt(P,o.scene.getNonDeletedElementsMap());if($){if(u.value.trim()){let O=oi($);!O||O!==i.id?X($,{boundElements:($.boundElements||[]).concat({type:"text",id:i.id})}):ve($)&&zo($)}else X($,{boundElements:$.boundElements?.filter(O=>!q(O))});ln(P,$,o.scene.getNonDeletedElementsMap())}n({viaKeyboard:w,nextOriginalText:u.value})},M=()=>{u.onblur=null,u.oninput=null,u.onkeydown=null,F&&F.disconnect(),window.removeEventListener("resize",l),window.removeEventListener("wheel",y,!0),window.removeEventListener("pointerdown",_),window.removeEventListener("pointerup",I),window.removeEventListener("blur",k),window.removeEventListener("beforeunload",k),T(),L(),u.remove()},I=P=>{window.removeEventListener("pointerup",I);let $=P?.target,O=$ instanceof HTMLElement&&$.classList.contains("properties-trigger");setTimeout(()=>{u.onblur=k,O||u.focus()})},A=()=>{u.onblur=null,window.addEventListener("pointerup",I),window.addEventListener("blur",k)},_=P=>{let $=P?.target;if(P.button===Si.WHEEL){$ instanceof HTMLTextAreaElement&&(P.preventDefault(),o.handleCanvasPanUsingWheelOrSpaceDrag(P)),A();return}let O=$ instanceof HTMLElement&&$.classList.contains("properties-trigger");(P.target instanceof HTMLElement||P.target instanceof SVGElement)&&P.target.closest(`.${Ss.SHAPE_ACTIONS_MENU}, .${Ss.ZOOM_ACTIONS}`)&&!cr(P.target)||O?A():P.target instanceof HTMLCanvasElement&&!ri()&&requestAnimationFrame(()=>{k()})},T=o.scene.onUpdate(()=>{l(),document.activeElement?.closest(".properties-content")||u.focus()}),L=o.onScrollChangeEmitter.on(()=>{l()}),R=!1;d&&u.select(),I();let F=null;r&&"ResizeObserver"in window?(F=new window.ResizeObserver(()=>{l()}),F.observe(r)):window.addEventListener("resize",l),u.onpointerdown=P=>P.stopPropagation(),requestAnimationFrame(()=>{window.addEventListener("pointerdown",_,{capture:!0})}),window.addEventListener("beforeunload",k),s?.querySelector(".excalidraw-textEditorContainer").appendChild(u)},MX=G({name:"autoResize",label:"labels.autoResize",icon:null,trackEvent:{category:"element"},predicate:(e,t,n,a)=>{let i=xe(e,t);return i.length===1&&q(i[0])&&!i[0].autoResize},perform:(e,t,n,a)=>{let i=xe(e,t);return{appState:t,elements:e.map(r=>{if(r.id===i[0].id&&q(r)){let s=nn(r.originalText,Xe(r),r.lineHeight);return pe(r,{autoResize:!0,width:s.width,height:s.height,text:r.originalText})}return r}),captureUpdate:B.IMMEDIATELY}}}),CX=e=>{let t=["flowchart","graph","sequenceDiagram","classDiagram","stateDiagram","stateDiagram-v2","erDiagram","journey","gantt","pie","quadrantChart","requirementDiagram","gitGraph","C4Context","mindmap","timeline","zenuml","sankey","xychart","block"];return new RegExp(`^(?:%%{.*?}%%[\\s\\n]*)?\\b(?:${t.map(n=>`\\s*${n}(-beta)?`).join("|")})\\b`).test(e.trim())},bx=({canvas:e,rc:t,newElement:n,elementsMap:a,allElementsMap:i,scale:r,appState:s,renderConfig:o})=>{if(e){let[d,c]=f0(e,r),l=p0({canvas:e,scale:r,normalizedWidth:d,normalizedHeight:c});l.save(),l.scale(s.zoom.value,s.zoom.value),n&&n.type!=="selection"?dr(n,a,i,t,l,o,s):l.clearRect(0,0,d,c)}},IX=Jc(e=>{bx(e)},{trailing:!0}),_X=(e,t)=>{if(t){IX(e);return}bx(e)},TX=e=>{let t=C.useRef(null);return C.useEffect(()=>{t.current&&_X({canvas:t.current,scale:e.scale,newElement:e.appState.newElement,elementsMap:e.elementsMap,allElementsMap:e.allElementsMap,rc:e.rc,renderConfig:e.renderConfig,appState:e.appState},mp())}),h.jsx("canvas",{className:"excalidraw__canvas",style:{width:e.appState.width,height:e.appState.height},width:e.appState.width*e.scale,height:e.appState.height*e.scale,ref:t})},jX=TX,xx=Z.createContext(null),vx=Z.createContext(null),yx={viewport:{isMobile:!1,isLandscape:!1},editor:{isMobile:!1,canFitSidebar:!1},isTouchScreen:!1},gp=Z.createContext(yx);gp.displayName="DeviceContext";var bp=Z.createContext({container:null,id:null});bp.displayName="ExcalidrawContainerContext";var xp=Z.createContext([]);xp.displayName="ExcalidrawElementsContext";var vp=Z.createContext({...Da(),width:0,height:0,offsetLeft:0,offsetTop:0});vp.displayName="ExcalidrawAppStateContext";var yp=Z.createContext(()=>{console.warn("Uninitialized ExcalidrawSetAppStateContext context!")});yp.displayName="ExcalidrawSetAppStateContext";var wp=Z.createContext(null);wp.displayName="ExcalidrawActionManagerContext";var Ua=()=>C.useContext(xx),Wo=()=>C.useContext(vx),Tt=()=>C.useContext(gp),za=()=>C.useContext(bp),Pu=()=>C.useContext(xp),Vo=()=>C.useContext(vp),jt=()=>C.useContext(yp),En=()=>C.useContext(wp),fl=!1,Zh=0,ir=!1,pl=!1,Yh=!1,Kh={horizontal:null,vertical:null},wi=0,Ul=!1,qh=new Map,bd=!1,u6=0,h6=!1,ml=null,De={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},AX=class wx extends Z.Component{constructor(t){super(t),j(this,"canvas"),j(this,"interactiveCanvas",null),j(this,"rc"),j(this,"unmounted",!1),j(this,"actionManager"),j(this,"device",yx),j(this,"excalidrawContainerRef",Z.createRef()),j(this,"scene"),j(this,"fonts"),j(this,"renderer"),j(this,"visibleElements"),j(this,"resizeObserver"),j(this,"nearestScrollableContainer"),j(this,"library"),j(this,"libraryItemsFromStorage"),j(this,"id"),j(this,"store"),j(this,"history"),j(this,"excalidrawContainerValue"),j(this,"files",{}),j(this,"imageCache",new Map),j(this,"iFrameRefs",new Map),j(this,"embedsValidationStatus",new Map),j(this,"initializedEmbeds",new Set),j(this,"elementsPendingErasure",new Set),j(this,"flowChartCreator",new qz),j(this,"flowChartNavigator",new Kz),j(this,"hitLinkElement"),j(this,"lastPointerDownEvent",null),j(this,"lastPointerUpEvent",null),j(this,"lastPointerMoveEvent",null),j(this,"lastPointerMoveCoords",null),j(this,"lastViewportPosition",{x:0,y:0}),j(this,"animationFrameHandler",new wX),j(this,"laserTrails",new EX(this.animationFrameHandler,this)),j(this,"eraserTrail",new w1(this.animationFrameHandler,this,{streamline:.2,size:5,keepHead:!0,sizeMapping:l=>{let u=Math.max(0,1-(performance.now()-l.pressure)/200),f=(10-Math.min(10,l.totalLength-l.currentIndex))/10;return Math.min(yr(f),yr(u))},fill:()=>this.state.theme===Me.LIGHT?"rgba(0, 0, 0, 0.2)":"rgba(255, 255, 255, 0.2)"})),j(this,"onChangeEmitter",new Sa),j(this,"onPointerDownEmitter",new Sa),j(this,"onPointerUpEmitter",new Sa),j(this,"onUserFollowEmitter",new Sa),j(this,"onScrollChangeEmitter",new Sa),j(this,"missingPointerEventCleanupEmitter",new Sa),j(this,"onRemoveEventListenersEmitter",new Sa),j(this,"getEffectiveGridSize",()=>Uo(this)?this.state.gridSize:null),j(this,"updateEmbedValidationStatus",(l,u)=>{this.embedsValidationStatus.set(l.id,u),ut.delete(l)}),j(this,"updateEmbeddables",()=>{let l=new Set,u=!1;this.scene.getNonDeletedElements().filter(f=>{if(pn(f)){if(l.add(f.id),!this.embedsValidationStatus.has(f.id)){u=!0;let p=Od(f.link,this.props.validateEmbeddable);this.updateEmbedValidationStatus(f,p)}}else Ii(f)&&l.add(f.id);return!1}),u&&this.scene.triggerUpdate(),this.iFrameRefs.forEach((f,p)=>{l.has(p)||this.iFrameRefs.delete(p)})}),j(this,"getFrameNameDOMId",l=>`${this.id}-frame-name-${l.id}`),j(this,"frameNameBoundsCache",{get:l=>{let u=this.frameNameBoundsCache._cache.get(l.id);if(!u||u.zoom!==this.state.zoom.value||u.versionNonce!==l.versionNonce){let f=document.getElementById(this.getFrameNameDOMId(l));if(f){let p=f.getBoundingClientRect(),U=Ge({clientX:p.x,clientY:p.y},this.state),m=Ge({clientX:p.right,clientY:p.bottom},this.state);return u={x:U.x,y:U.y,width:m.x-U.x,height:m.y-U.y,angle:0,zoom:this.state.zoom.value,versionNonce:l.versionNonce},this.frameNameBoundsCache._cache.set(l.id,u),u}return null}return u},_cache:new Map}),j(this,"resetEditingFrame",l=>{l&&X(l,{name:l.name?.trim()||null}),this.setState({editingFrame:null})}),j(this,"renderFrameNames",()=>{if(!this.state.frameRendering.enabled||!this.state.frameRendering.name)return this.state.editingFrame&&this.resetEditingFrame(null),null;let l=this.state.theme===Me.DARK;return this.scene.getNonDeletedFramesLikes().map(u=>{if(!_c(u,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap()))return this.state.editingFrame===u.id&&this.resetEditingFrame(u),null;let{x:f,y:p}=Rn({sceneX:u.x,sceneY:u.y},this.state),U=6,m,g=e7(u);if(u.id===this.state.editingFrame){let b=g;m=h.jsx("input",{autoFocus:!0,value:b,onChange:v=>{X(u,{name:v.target.value})},onFocus:v=>v.target.select(),onBlur:()=>this.resetEditingFrame(u),onKeyDown:v=>{(v.key===D.ESCAPE||v.key===D.ENTER)&&this.resetEditingFrame(u)},style:{background:this.state.viewBackgroundColor,filter:l?L1:"none",zIndex:2,border:"none",display:"block",padding:`${U}px`,borderRadius:4,boxShadow:"inset 0 0 0 1px var(--color-primary)",fontFamily:"Assistant",fontSize:"14px",transform:`translate(-${U}px, ${U}px)`,color:"var(--color-gray-80)",overflow:"hidden",maxWidth:`${document.body.clientWidth-f-U}px`},size:b.length+1||1,dir:"auto",autoComplete:"off",autoCapitalize:"off",autoCorrect:"off"})}else m=g;return h.jsx("div",{id:this.getFrameNameDOMId(u),style:{position:"absolute",bottom:`${this.state.height+dt.nameOffsetY-p+this.state.offsetTop}px`,left:`${f-this.state.offsetLeft}px`,zIndex:2,fontSize:dt.nameFontSize,color:l?dt.nameColorDarkTheme:dt.nameColorLightTheme,lineHeight:dt.nameLineHeight,width:"max-content",maxWidth:`${u.width}px`,overflow:u.id===this.state.editingFrame?"visible":"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",cursor:Fe.MOVE,pointerEvents:this.state.viewModeEnabled?Qr.disabled:Qr.enabled},onPointerDown:b=>this.handleCanvasPointerDown(b),onWheel:b=>this.handleWheel(b),onContextMenu:this.handleCanvasContextMenu,onDoubleClick:()=>{this.setState({editingFrame:u.id})},children:m},u.id)})}),j(this,"focusContainer",()=>{this.excalidrawContainerRef.current?.focus()}),j(this,"getSceneElementsIncludingDeleted",()=>this.scene.getElementsIncludingDeleted()),j(this,"getSceneElements",()=>this.scene.getNonDeletedElements()),j(this,"onInsertElements",l=>{this.addElementsFromPasteOrLibrary({elements:l,position:"center",files:null})}),j(this,"onExportImage",async(l,u,f)=>{qe("export",l,"ui");let p=await Au(l,u,this.state,this.files,{exportBackground:this.state.exportBackground,name:this.getName(),viewBackgroundColor:this.state.viewBackgroundColor,exportingFrame:f.exportingFrame}).catch(D5).catch(U=>{console.error(U),this.setState({errorMessage:U.message})});this.state.exportEmbedScene&&p&&$0(p)&&this.setState({fileHandle:p})}),j(this,"magicGenerations",new Map),j(this,"updateMagicGeneration",({frameElement:l,data:u})=>{u.status==="pending"?X(l,{customData:{generationData:void 0}},!1):X(l,{customData:{generationData:u}},!1),this.magicGenerations.set(l.id,u),this.triggerRender()}),j(this,"plugins",{}),j(this,"onMagicframeToolSelect",()=>{let l=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds});if(l.length===0)this.setActiveTool({type:Lt.magicframe}),qe("ai","tool-select (empty-selection)","d2c");else{let u=l.length===1&&jd(l[0])&&l[0];if(!u&&l.some(p=>de(p)||p.frameId)){this.setActiveTool({type:Lt.magicframe});return}qe("ai","tool-select (existing selection)","d2c");let f;if(u)f=u;else{let[p,U,m,g]=Ne(l),b=50;f=Rf({...dt,x:p-b,y:U-b,width:m-p+b*2,height:g-U+b*2,opacity:100,locked:!1}),this.scene.insertElement(f);for(let v of l)X(v,{frameId:f.id});this.setState({selectedElementIds:{[f.id]:!0}})}this.onMagicFrameGenerate(f,"upstream")}}),j(this,"openEyeDropper",({type:l})=>{ia.set(Iu,{swapPreviewOnAlt:!0,colorPickerType:l==="stroke"?"elementStroke":"elementBackground",onSelect:(u,f)=>{let p=l==="background"&&f.altKey||l==="stroke"&&!f.altKey;!this.scene.getSelectedElements(this.state).length||this.state.activeTool.type!=="selection"?p?this.syncActionResult({appState:{...this.state,currentItemStrokeColor:u},captureUpdate:B.IMMEDIATELY}):this.syncActionResult({appState:{...this.state,currentItemBackgroundColor:u},captureUpdate:B.IMMEDIATELY}):this.updateScene({elements:this.scene.getElementsIncludingDeleted().map(U=>this.state.selectedElementIds[U.id]?pe(U,{[p?"strokeColor":"backgroundColor"]:u}):U),captureUpdate:B.IMMEDIATELY})},keepOpenOnAlt:!1})}),j(this,"dismissLinearEditor",()=>{setTimeout(()=>{this.setState({editingLinearElement:null})})}),j(this,"syncActionResult",ht(l=>{if(this.unmounted||l===!1)return;l.captureUpdate===B.NEVER?this.store.shouldUpdateSnapshot():l.captureUpdate===B.IMMEDIATELY&&this.store.shouldCaptureIncrement();let u=!1,f=null;if(l.elements&&(this.scene.replaceAllElements(l.elements),u=!0),l.files&&(this.addMissingFiles(l.files,l.replaceFiles),this.addNewImagesToImageCache()),l.appState||f||this.state.contextMenu){let p=l?.appState?.viewModeEnabled||!1,U=l?.appState?.zenModeEnabled||!1,m=l?.appState?.theme||this.props.theme||Me.LIGHT,g=l?.appState?.name??this.state.name,b=l?.appState?.errorMessage??this.state.errorMessage;typeof this.props.viewModeEnabled<"u"&&(p=this.props.viewModeEnabled),typeof this.props.zenModeEnabled<"u"&&(U=this.props.zenModeEnabled),f=l.appState?.editingTextElement||null,l.elements&&f&&l.elements.forEach(v=>{f?.id===v.id&&f!==v&&Wf(v)&&q(v)&&(f=v)}),f?.isDeleted&&(f=null),this.setState(v=>{let x=l.appState||{};return{...v,...x,contextMenu:null,editingTextElement:f,viewModeEnabled:p,zenModeEnabled:U,theme:m,name:g,errorMessage:b}}),u=!0}!u&&l.captureUpdate!==B.EVENTUALLY&&this.scene.triggerUpdate()})),j(this,"onBlur",ht(()=>{ir=!1,this.setState({isBindingEnabled:!0})})),j(this,"onUnload",()=>{this.onBlur()}),j(this,"disableEvent",l=>{l.preventDefault()}),j(this,"resetHistory",()=>{this.history.clear()}),j(this,"resetStore",()=>{this.store.clear()}),j(this,"resetScene",ht(l=>{this.scene.replaceAllElements([]),this.setState(u=>({...Da(),isLoading:l?.resetLoadingState?!1:u.isLoading,theme:this.state.theme})),this.resetStore(),this.resetHistory()})),j(this,"initializeScene",async()=>{"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(async f=>{if(!f.files.length)return;let p=f.files[0],U=await p.getFile();this.loadFileToCanvas(new File([U],U.name||"",{type:U.type}),p)}),this.props.theme&&this.setState({theme:this.props.theme}),this.state.isLoading||this.setState({isLoading:!0});let l=null;try{typeof this.props.initialData=="function"?l=await this.props.initialData()||null:l=await this.props.initialData||null,l?.libraryItems&&this.library.updateLibrary({libraryItems:l.libraryItems,merge:!0}).catch(f=>{console.error(f)})}catch(f){console.error(f),l={appState:{errorMessage:f.message||"Encountered an error during importing or restoring scene data"}}}let u=No(l,null,null,{repairBindings:!0});u.appState={...u.appState,theme:this.props.theme||u.appState.theme,openSidebar:u.appState?.openSidebar||this.state.openSidebar,activeTool:u.appState.activeTool.type==="image"?{...u.appState.activeTool,type:"selection"}:u.appState.activeTool,isLoading:!1,toast:this.state.toast},l?.scrollToContent&&(u.appState={...u.appState,...fo(u.elements,{...u.appState,width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})}),this.resetStore(),this.resetHistory(),this.syncActionResult({...u,captureUpdate:B.NEVER}),this.clearImageShapeCache(),this.fonts.loadSceneFonts().then(f=>{this.fonts.onLoaded(f)}),vs(window.location.href)&&this.scrollToContent(window.location.href,{animate:!1})}),j(this,"isMobileBreakpoint",(l,u)=>l<TS||u<AS&&l<jS),j(this,"refreshViewportBreakpoints",()=>{if(!this.excalidrawContainerRef.current)return;let{clientWidth:l,clientHeight:u}=document.body,f=this.device.viewport,p=_d(f,{isLandscape:l>u,isMobile:this.isMobileBreakpoint(l,u)});return f!==p?(this.device={...this.device,viewport:p},!0):!1}),j(this,"refreshEditorBreakpoints",()=>{let l=this.excalidrawContainerRef.current;if(!l)return;let{width:u,height:f}=l.getBoundingClientRect(),p=this.props.UIOptions.dockedSidebarBreakpoint!=null?this.props.UIOptions.dockedSidebarBreakpoint:DS,U=this.device.editor,m=_d(U,{isMobile:this.isMobileBreakpoint(u,f),canFitSidebar:u>p});return U!==m?(this.device={...this.device,editor:m},!0):!1}),j(this,"onResize",ht(()=>{this.scene.getElementsIncludingDeleted().forEach(l=>ut.delete(l)),this.refreshViewportBreakpoints(),this.updateDOMRect(),ff||this.refreshEditorBreakpoints(),this.setState({})})),j(this,"onFullscreenChange",()=>{!document.fullscreenElement&&this.state.activeEmbeddable?.state==="active"&&this.setState({activeEmbeddable:null})}),j(this,"renderInteractiveSceneCallback",({atLeastOneVisibleElement:l,scrollBars:u,elementsMap:f})=>{u&&(Kh=u);let p=this.state.editingTextElement?!1:!l&&f.size>0;this.state.scrolledOutside!==p&&this.setState({scrolledOutside:p}),this.scheduleImageRefresh()}),j(this,"onScroll",Is(()=>{let{offsetTop:l,offsetLeft:u}=this.getCanvasOffsets();this.setState(f=>f.offsetLeft===u&&f.offsetTop===l?null:{offsetTop:l,offsetLeft:u})},IS)),j(this,"onCut",ht(l=>{!this.excalidrawContainerRef.current?.contains(document.activeElement)||cr(l.target)||(this.actionManager.executeAction(bg,"keyboard",l),l.preventDefault(),l.stopPropagation())})),j(this,"onCopy",ht(l=>{!this.excalidrawContainerRef.current?.contains(document.activeElement)||cr(l.target)||(this.actionManager.executeAction(Wd,"keyboard",l),l.preventDefault(),l.stopPropagation())})),j(this,"onTouchStart",l=>{if(g5&&l.preventDefault(),!fl){fl=!0,clearTimeout(Zh),Zh=window.setTimeout(wx.resetTapTwice,MS);return}if(fl&&l.touches.length===1){let u=l.touches[0];this.handleCanvasDoubleClick({clientX:u.clientX,clientY:u.clientY}),fl=!1,clearTimeout(Zh)}l.touches.length===2&&this.setState({selectedElementIds:Le({},this.state),activeEmbeddable:null})}),j(this,"onTouchEnd",l=>{this.resetContextMenuTimer(),l.touches.length>0?this.setState({previousSelectedElementIds:{},selectedElementIds:Le(this.state.previousSelectedElementIds,this.state)}):De.pointers.clear()}),j(this,"pasteFromClipboard",ht(async l=>{let u=!!bd,f=document.activeElement,p=this.excalidrawContainerRef.current?.contains(f);if(l&&!p)return;let U=document.elementFromPoint(this.lastViewportPosition.x,this.lastViewportPosition.y);if(l&&(!(U instanceof HTMLCanvasElement)||cr(f)))return;let{x:m,y:g}=Ge({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),b=l?.clipboardData?.files[0],v=await X8(l,u);if(!b&&!u){if(v.mixedContent)return this.addElementsFromMixedContentPaste(v.mixedContent,{isPlainPaste:u,sceneX:m,sceneY:g});if(v.text){let x=v.text.trim();x.startsWith("<svg")&&x.endsWith("</svg>")&&(b=Cm(x))}}if(kr(b)&&!v.spreadsheet){if(!this.isToolSupported("image")){this.setState({errorMessage:S("errors.imageToolNotSupported")});return}let x=this.createImageElement({sceneX:m,sceneY:g});this.insertImageElement(x,b),this.initializeImageDimensions(x),this.setState({selectedElementIds:Le({[x.id]:!0},this.state)});return}if(this.props.onPaste)try{if(await this.props.onPaste(v,l)===!1)return}catch(x){console.error(x)}if(v.errorMessage)this.setState({errorMessage:v.errorMessage});else if(v.spreadsheet&&!u)this.setState({pasteDialog:{data:v.spreadsheet,shown:!0}});else if(v.elements){let x=v.programmaticAPI?Bc(v.elements):v.elements;this.addElementsFromPasteOrLibrary({elements:x,files:v.files||null,position:"cursor",retainSeed:u})}else if(v.text){if(v.text&&CX(v.text)){let w=await ne(()=>import("./index-Bu97Fipb.js").then(k=>k.b5),__vite__mapDeps([58,2,3]));try{let{elements:k,files:M}=await w.parseMermaidToExcalidraw(v.text),I=Bc(k,{regenerateIds:!0});this.addElementsFromPasteOrLibrary({elements:I,files:M,position:"cursor"});return}catch(k){console.warn(`parsing pasted text as mermaid definition failed: ${k.message}`)}}let x=$5(v.text).split(/\n+/).map(w=>w.trim()).filter(Boolean),y=x.map(w=>kL(w)).filter(w=>Od(w,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(w)||Us(w)?.type==="video"));if(!bd&&y.length>0&&y.length===x.length){let w=[];for(let k of y){let M=w[w.length-1],I=this.insertEmbeddableElement({sceneX:M?M.x+M.width+20:m,sceneY:g,link:vn(k)});I&&w.push(I)}w.length&&this.setState({selectedElementIds:Object.fromEntries(w.map(k=>[k.id,!0]))});return}this.addTextFromPaste(v.text,u)}this.setActiveTool({type:"selection"}),l?.preventDefault()})),j(this,"addElementsFromPasteOrLibrary",l=>{let u=gu(l.elements,null,void 0),[f,p,U,m]=Ne(u),g=qt(f,U)/2,b=qt(p,m)/2,v=typeof l.position=="object"?l.position.clientX:l.position==="cursor"?this.lastViewportPosition.x:this.state.width/2+this.state.offsetLeft,x=typeof l.position=="object"?l.position.clientY:l.position==="cursor"?this.lastViewportPosition.y:this.state.height/2+this.state.offsetTop,{x:y,y:w}=Ge({clientX:v,clientY:x},this.state),k=y-g,M=w-b,[I,A]=Ct(k,M,this.getEffectiveGridSize()),_=m8(u.map(P=>pe(P,{x:P.x+I-f,y:P.y+A-p})),{randomizeSeed:!l.retainSeed}),T=this.scene.getElementsIncludingDeleted(),L=[...T,..._];L=this.props.onDuplicate?.(L,T)||L,Na(L,oe(_));let R=this.getTopLayerFrameAtSceneCoords({x:y,y:w});if(R){let P=_R(_,R);Fl(L,P,R,this.state)}this.scene.replaceAllElements(L),_.forEach(P=>{if(q(P)&&nt(P)){let $=zt(P,this.scene.getElementsMapIncludingDeleted());ln(P,$,this.scene.getElementsMapIncludingDeleted())}}),US&&ni.loadElementsFonts(_).then(P=>{this.fonts.onLoaded(P)}),l.files&&this.addMissingFiles(l.files),this.store.shouldCaptureIncrement();let F=j0(_);this.setState({...this.state,openSidebar:this.state.openSidebar&&this.device.editor.canFitSidebar&&ia.get(hp)?this.state.openSidebar:null,...sn({editingGroupId:null,selectedElementIds:F.reduce((P,$)=>(nt($)||(P[$.id]=!0),P),{})},this.scene.getNonDeletedElements(),this.state,this)},()=>{l.files&&this.addNewImagesToImageCache()}),this.setActiveTool({type:"selection"}),l.fitToContent&&this.scrollToContent(_,{fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()})}),j(this,"setAppState",(l,u)=>{this.setState(l,u)}),j(this,"removePointer",l=>{wi&&this.resetContextMenuTimer(),De.pointers.delete(l.pointerId)}),j(this,"toggleLock",(l="ui")=>{this.state.activeTool.locked||qe("toolbar","toggleLock",`${l} (${this.device.editor.isMobile?"mobile":"desktop"})`),this.setState(u=>({activeTool:{...u.activeTool,...Et(this.state,u.activeTool.locked?{type:"selection"}:u.activeTool),locked:!u.activeTool.locked}}))}),j(this,"updateFrameRendering",l=>{this.setState(u=>{let f=typeof l=="function"?l(u.frameRendering):l;return{frameRendering:{enabled:f?.enabled??u.frameRendering.enabled,clip:f?.clip??u.frameRendering.clip,name:f?.name??u.frameRendering.name,outline:f?.outline??u.frameRendering.outline}}})}),j(this,"togglePenMode",l=>{this.setState(u=>({penMode:l??!u.penMode,penDetected:!0}))}),j(this,"onHandToolToggle",()=>{this.actionManager.executeAction(L$)}),j(this,"zoomCanvas",l=>{this.setState({...xr({viewportX:this.state.width/2+this.state.offsetLeft,viewportY:this.state.height/2+this.state.offsetTop,nextZoom:ei(l)},this.state)})}),j(this,"cancelInProgressAnimation",null),j(this,"scrollToContent",(l=this.scene.getNonDeletedElements(),u)=>{if(typeof l=="string"){let g;if(vs(l)?g=AL(l):g=l,g){let b=this.scene.getElementsFromId(g);b?.length?this.scrollToContent(b,{fitToContent:u?.fitToContent??!0,animate:u?.animate??!0}):vs(l)&&this.setState({toast:{message:S("elementLink.notFound"),duration:3e3,closable:!0}})}return}this.cancelInProgressAnimation?.();let f=Array.isArray(l)?l:[l],p=this.state.zoom,U=this.state.scrollX,m=this.state.scrollY;if(u?.fitToContent||u?.fitToViewport){let{appState:g}=Tu({canvasOffsets:u.canvasOffsets,targetElements:f,appState:this.state,fitToViewport:!!u?.fitToViewport,viewportZoomFactor:u?.viewportZoomFactor,minZoom:u?.minZoom,maxZoom:u?.maxZoom});p=g.zoom,U=g.scrollX,m=g.scrollY}else{let g=fo(f,this.state);U=g.scrollX,m=g.scrollY}if(u?.animate){let g=this.state.scrollX,b=this.state.scrollY,v=this.state.zoom.value,x=ak({fromValues:{scrollX:g,scrollY:b,zoom:v},toValues:{scrollX:U,scrollY:m,zoom:p.value},interpolateValue:(y,w,k,M)=>{if(M==="zoom")return y*Math.pow(w/y,yr(k))},onStep:({scrollX:y,scrollY:w,zoom:k})=>{this.setState({scrollX:y,scrollY:w,zoom:{value:k}})},onStart:()=>{this.setState({shouldCacheIgnoreZoom:!0})},onEnd:()=>{this.setState({shouldCacheIgnoreZoom:!1})},onCancel:()=>{this.setState({shouldCacheIgnoreZoom:!1})},duration:u?.duration??500});this.cancelInProgressAnimation=()=>{x(),this.cancelInProgressAnimation=null}}else this.setState({scrollX:U,scrollY:m,zoom:p})}),j(this,"maybeUnfollowRemoteUser",()=>{this.state.userToFollow&&this.setState({userToFollow:null})}),j(this,"translateCanvas",l=>{this.cancelInProgressAnimation?.(),this.maybeUnfollowRemoteUser(),this.setState(l)}),j(this,"setToast",l=>{this.setState({toast:l})}),j(this,"restoreFileFromShare",async()=>{try{let l=await caches.open("web-share-target"),u=await l.match("shared-file");if(u){let f=await u.blob(),p=new File([f],f.name||"",{type:f.type});this.loadFileToCanvas(p,null),await l.delete("shared-file"),window.history.replaceState(null,pf,window.location.pathname)}}catch(l){this.setState({errorMessage:l.message})}}),j(this,"addFiles",ht(l=>{let{addedFiles:u}=this.addMissingFiles(l);this.clearImageShapeCache(u),this.scene.triggerUpdate(),this.addNewImagesToImageCache()})),j(this,"addMissingFiles",(l,u=!1)=>{let f=u?{}:{...this.files},p={},U=Array.isArray(l)?l:Object.values(l);for(let m of U)if(!f[m.id]&&(p[m.id]=m,f[m.id]=m,m.mimeType===ae.svg))try{let g=tP(Q2(aP(m.dataURL)),ae.svg);m.dataURL!==g&&(m.version=(m.version??1)+1,m.dataURL=g)}catch(g){console.error(g)}return this.files=f,{addedFiles:p}}),j(this,"updateScene",ht(l=>{let u=Oa(l.elements??[]);if(l.captureUpdate&&l.captureUpdate!==B.EVENTUALLY){let f=this.store.snapshot.appState,p=this.store.snapshot.elements,U=l.appState?Object.assign({},f,l.appState):f,m=l.elements?this.store.filterUncomittedElements(this.scene.getElementsMapIncludingDeleted(),oe(u)):p;l.captureUpdate===B.IMMEDIATELY?this.store.captureIncrement(m,U):l.captureUpdate===B.NEVER&&this.store.updateSnapshot(m,U)}l.appState&&this.setState(l.appState),l.elements&&this.scene.replaceAllElements(u),l.collaborators&&this.setState({collaborators:l.collaborators})})),j(this,"triggerRender",l=>{l===!0?this.scene.triggerUpdate():this.setState({})}),j(this,"toggleSidebar",({name:l,tab:u,force:f})=>{let p;f===void 0?p=this.state.openSidebar?.name===l&&this.state.openSidebar?.tab===u?null:l:p=f?l:null;let U=p?{name:p}:null;return U&&u&&(U.tab=u),this.setState({openSidebar:U}),!!p}),j(this,"updateCurrentCursorPosition",ht(l=>{this.lastViewportPosition.x=l.clientX,this.lastViewportPosition.y=l.clientY})),j(this,"getEditorUIOffsets",()=>{let l=this.excalidrawContainerRef?.current?.querySelector(".App-toolbar")?.getBoundingClientRect()?.bottom??0,u=this.excalidrawContainerRef?.current?.querySelector(".sidebar")?.getBoundingClientRect(),f=this.excalidrawContainerRef?.current?.querySelector(".App-menu__left")?.getBoundingClientRect(),p=16;return vo().rtl?{top:l+p,right:Math.max(this.state.width-(f?.left??this.state.width),0)+p,bottom:p,left:Math.max(u?.right??0,0)+p}:{top:l+p,right:Math.max(this.state.width-(u?.left??this.state.width)+p,0),bottom:p,left:Math.max(f?.right??0,0)+p}}),j(this,"onKeyDown",ht(l=>{if("Proxy"in window&&(!l.shiftKey&&/^[A-Z]$/.test(l.key)||l.shiftKey&&/^[a-z]$/.test(l.key))&&(l=new Proxy(l,{get(U,m){let g=U[m];return typeof g=="function"?g.bind(U):m==="key"?l.shiftKey?U.key.toUpperCase():U.key.toLowerCase():g}})),!xf(l.target)){if((l.key===D.ESCAPE||l.key===D.ENTER)&&this.state.croppingElementId){this.finishImageCropping();return}let U=xe(this.scene.getNonDeletedElementsMap(),this.state);if(U.length===1&&Re(U[0])&&l.key===D.ENTER){this.startImageCropping(U[0]);return}if(l.key===D.ESCAPE&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.clear(),this.triggerRender(!0);return}let m=wl(l.key);if(l[D.CTRL_OR_CMD]&&m&&!l.shiftKey){l.preventDefault();let g=xe(this.scene.getNonDeletedElementsMap(),this.state);g.length===1&&eu(g[0])&&this.flowChartCreator.createNodes(g[0],this.scene.getNonDeletedElementsMap(),this.state,Ng(l.key)),this.flowChartCreator.pendingNodes?.length&&!Bd(this.flowChartCreator.pendingNodes,this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(this.flowChartCreator.pendingNodes,{animate:!0,duration:300,fitToContent:!0,canvasOffsets:this.getEditorUIOffsets()});return}if(l.altKey){let g=xe(this.scene.getNonDeletedElementsMap(),this.state);if(g.length===1&&m){l.preventDefault();let b=this.flowChartNavigator.exploreByDirection(g[0],this.scene.getNonDeletedElementsMap(),Ng(l.key));if(b){this.setState(x=>({selectedElementIds:Le({[b]:!0},x)}));let v=this.scene.getNonDeletedElementsMap().get(b);v&&!Bd([v],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())&&this.scrollToContent(v,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})}return}}}if(l[D.CTRL_OR_CMD]&&l.key===D.P&&!l.shiftKey&&!l.altKey){this.setToast({message:S("commandPalette.shortcutHint",{shortcut:en("commandPalette")})}),l.preventDefault();return}if(l[D.CTRL_OR_CMD]&&l.key.toLowerCase()===D.V&&(bd=l.shiftKey,clearTimeout(u6),u6=window.setTimeout(()=>{bd=!1},100)),l[D.CTRL_OR_CMD]&&cr(l.target)&&(l.code===Te.MINUS||l.code===Te.EQUAL)){l.preventDefault();return}if(cr(l.target)&&l.key!==D.ESCAPE||wl(l.key)&&xf(l.target))return;if(l.key===D.QUESTION_MARK){this.setState({openDialog:{name:"help"}});return}else if(l.key.toLowerCase()===D.E&&l.shiftKey&&l[D.CTRL_OR_CMD]){l.preventDefault(),this.setState({openDialog:{name:"imageExport"}});return}if(l.key===D.PAGE_UP||l.key===D.PAGE_DOWN){let U=(l.shiftKey?this.state.width:this.state.height)/this.state.zoom.value;l.key===D.PAGE_DOWN&&(U=-U),l.shiftKey?this.translateCanvas(m=>({scrollX:m.scrollX+U})):this.translateCanvas(m=>({scrollY:m.scrollY+U}))}if(this.state.openDialog?.name==="elementLinkSelector"||this.actionManager.handleKeyDown(l)||this.state.viewModeEnabled)return;if(l[D.CTRL_OR_CMD]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),wl(l.key)){let U=this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}),m=U.find(Q),g=new Set;U.filter(Q).filter(y=>{let w=y.startBinding&&!U.some(M=>M.id===y.startBinding?.elementId),k=y.endBinding&&!U.some(M=>M.id===y.endBinding?.elementId);return w||k}).forEach(y=>g.add(y.id)),U=U.filter(y=>!g.has(y.id));let b=this.getEffectiveGridSize()&&(l.shiftKey?BU:this.getEffectiveGridSize())||(l.shiftKey?bS:BU),v=0,x=0;l.key===D.ARROW_LEFT?v=-b:l.key===D.ARROW_RIGHT?v=b:l.key===D.ARROW_UP?x=-b:l.key===D.ARROW_DOWN&&(x=b),U.forEach(y=>{X(y,{x:y.x+v,y:y.y+x},!1),xn(y,this.scene.getNonDeletedElementsMap(),{simultaneouslyUpdated:U})}),this.setState({suggestedBindings:xh(U.filter(y=>y.id!==m?.id||b!==0),this.scene.getNonDeletedElementsMap(),this.state.zoom)}),this.scene.triggerUpdate(),l.preventDefault()}else if(l.key===D.ENTER){let U=this.scene.getSelectedElements(this.state);if(U.length===1){let m=U[0];if(l[D.CTRL_OR_CMD])ue(m)&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==U[0].id)&&(this.store.shouldCaptureIncrement(),Q(m)||this.setState({editingLinearElement:new J(m)}));else if(q(m)||nL(m)){let g;q(m)||(g=m);let b=vh(m,this.state,this.scene.getNonDeletedElementsMap()),v=b.x,x=b.y;this.startTextEditing({sceneX:v,sceneY:x,container:g}),l.preventDefault();return}else de(m)&&this.setState({editingFrame:m.id})}}else if(!l.ctrlKey&&!l.altKey&&!l.metaKey&&!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged){let U=IA(l.key);U?(this.state.activeTool.type!==U&&qe("toolbar",U,`keyboard (${this.device.editor.isMobile?"mobile":"desktop"})`),U==="arrow"&&this.state.activeTool.type==="arrow"&&this.setState(m=>({currentItemArrowType:m.currentItemArrowType===Ot.sharp?Ot.round:m.currentItemArrowType===Ot.round?Ot.elbow:Ot.sharp})),this.setActiveTool({type:U}),l.stopPropagation()):l.key===D.Q&&(this.toggleLock("keyboard"),l.stopPropagation())}if(l.key===D.SPACE&&De.pointers.size===0&&(ir=!0,He(this.interactiveCanvas,Fe.GRAB),l.preventDefault()),(l.key===D.G||l.key===D.S)&&!l.altKey&&!l[D.CTRL_OR_CMD]){let U=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!U.length)return;l.key===D.G&&(js(this.state.activeTool.type)||U.some(m=>js(m.type)))&&(this.setState({openPopup:"elementBackground"}),l.stopPropagation()),l.key===D.S&&(this.setState({openPopup:"elementStroke"}),l.stopPropagation())}if(!l[D.CTRL_OR_CMD]&&l.shiftKey&&l.key.toLowerCase()===D.F){let U=this.scene.getSelectedElements(this.state);if(this.state.activeTool.type==="selection"&&!U.length)return;(this.state.activeTool.type==="text"||U.find(m=>q(m)||ge(m,this.scene.getNonDeletedElementsMap())))&&(l.preventDefault(),this.setState({openPopup:"fontFamily"}))}if(l.key===D.K&&!l.altKey&&!l[D.CTRL_OR_CMD]){this.state.activeTool.type==="laser"?this.setActiveTool({type:"selection"}):this.setActiveTool({type:"laser"});return}l[D.CTRL_OR_CMD]&&(l.key===D.BACKSPACE||l.key===D.DELETE)&&ia.set(Lu,"clearCanvas");let u=l.key.toLocaleLowerCase(),f=u===D.S&&l.shiftKey,p=l.key===D.I||u===D.G&&l.shiftKey;(f||p)&&this.openEyeDropper({type:f?"stroke":"background"})})),j(this,"onKeyUp",ht(l=>{if(l.key===D.SPACE&&(this.state.viewModeEnabled||this.state.openDialog?.name==="elementLinkSelector"?He(this.interactiveCanvas,Fe.GRAB):this.state.activeTool.type==="selection"?Kn(this.interactiveCanvas):(wa(this.interactiveCanvas,this.state),this.setState({selectedElementIds:Le({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})),ir=!1),!l[D.CTRL_OR_CMD]&&!this.state.isBindingEnabled&&this.setState({isBindingEnabled:!0}),wl(l.key)&&(xc(this.scene.getSelectedElements(this.state).filter(ue),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,gr(this.state),this.state.selectedLinearElement?.selectedPointsIndices??[],this.state.zoom),this.setState({suggestedBindings:[]})),l.altKey||this.flowChartNavigator.isExploring&&(this.flowChartNavigator.clear(),this.syncActionResult({captureUpdate:B.IMMEDIATELY})),!l[D.CTRL_OR_CMD]&&this.flowChartCreator.isCreatingChart){this.flowChartCreator.pendingNodes?.length&&this.scene.insertElements(this.flowChartCreator.pendingNodes);let u=this.flowChartCreator.pendingNodes?.[0];u&&(this.setState(f=>({selectedElementIds:Le({[u.id]:!0},f)})),Bd([u],this.canvas.width/window.devicePixelRatio,this.canvas.height/window.devicePixelRatio,{offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,zoom:this.state.zoom},this.scene.getNonDeletedElementsMap(),this.getEditorUIOffsets())||this.scrollToContent(u,{animate:!0,duration:300,canvasOffsets:this.getEditorUIOffsets()})),this.flowChartCreator.clear(),this.syncActionResult({captureUpdate:B.IMMEDIATELY})}})),j(this,"isToolSupported",l=>this.props.UIOptions.tools?.[l]!==!1),j(this,"setActiveTool",l=>{if(!this.isToolSupported(l.type)){console.warn(`"${l.type}" tool is disabled via "UIOptions.canvasActions.tools.${l.type}"`);return}let u=Et(this.state,l);u.type==="hand"?He(this.interactiveCanvas,Fe.GRAB):ir||wa(this.interactiveCanvas,{...this.state,activeTool:u}),tk(document.activeElement)&&this.focusContainer(),O1(u.type)||this.setState({suggestedBindings:[]}),u.type==="image"&&this.onImageAction({insertOnCanvasDirectly:(l.type==="image"&&l.insertOnCanvasDirectly)??!1}),this.setState(f=>{let p={snapLines:f.snapLines.length?[]:f.snapLines,originSnapOffset:null,activeEmbeddable:null};return u.type==="freedraw"&&this.store.shouldCaptureIncrement(),u.type!=="selection"?{...f,activeTool:u,selectedElementIds:Le({},f),selectedGroupIds:Le({},f),editingGroupId:null,multiElement:null,...p}:{...f,activeTool:u,...p}})}),j(this,"setOpenDialog",l=>{this.setState({openDialog:l})}),j(this,"setCursor",l=>{He(this.interactiveCanvas,l)}),j(this,"resetCursor",()=>{Kn(this.interactiveCanvas)}),j(this,"isTouchScreenMultiTouchGesture",()=>De.pointers.size>=2),j(this,"getName",()=>this.state.name||this.props.name||`${S("labels.untitled")}-${KU()}`),j(this,"onGestureStart",ht(l=>{l.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({selectedElementIds:Le({},this.state),activeEmbeddable:null}),De.initialScale=this.state.zoom.value})),j(this,"onGestureChange",ht(l=>{if(l.preventDefault(),this.isTouchScreenMultiTouchGesture())return;let u=De.initialScale;u&&this.setState(f=>({...xr({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:ei(u*l.scale)},f)}))})),j(this,"onGestureEnd",ht(l=>{l.preventDefault(),this.isTouchScreenMultiTouchGesture()&&this.setState({previousSelectedElementIds:{},selectedElementIds:Le(this.state.previousSelectedElementIds,this.state)}),De.initialScale=null})),j(this,"startTextEditing",({sceneX:l,sceneY:u,insertAtParentCenter:f=!0,container:p,autoEdit:U=!0})=>{let m=!1,g=f&&this.getTextWysiwygSnappedToCenterPosition(l,u,this.state,p);p&&g&&(ge(p,this.scene.getNonDeletedElementsMap())||(m=!0));let b=null,v=this.scene.getSelectedElements(this.state);v.length===1?q(v[0])?b=v[0]:p?b=ge(v[0],this.scene.getNonDeletedElementsMap()):b=this.getTextElementAtPosition(l,u):b=this.getTextElementAtPosition(l,u);let x=b?.fontFamily||this.state.currentItemFontFamily,y=b?.lineHeight||Nr(x),w=this.state.currentItemFontSize;if(!b&&m&&p&&!ve(p)){let I=W5(Xe({fontSize:w,fontFamily:x}),y),A=V5(w,y),_=Math.max(p.height,A),T=Math.max(p.width,I);X(p,{height:_,width:T}),l=p.x+T/2,u=p.y+_/2,g&&(g=this.getTextWysiwygSnappedToCenterPosition(l,u,this.state,p))}let k=this.getTopLayerFrameAtSceneCoords({x:l,y:u}),M=b||Cn({x:g?g.elementCenterX:l,y:g?g.elementCenterY:u,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:"",fontSize:w,fontFamily:x,textAlign:g?"center":this.state.currentItemTextAlign,verticalAlign:g?Mn.MIDDLE:nc,containerId:m?p?.id:void 0,groupIds:p?.groupIds??[],lineHeight:y,angle:p?.angle??0,frameId:k?k.id:null});if(!b&&m&&p&&X(p,{boundElements:(p.boundElements||[]).concat({type:"text",id:M.id})}),this.setState({editingTextElement:M}),!b)if(p&&m){let I=this.scene.getElementIndex(p.id);this.scene.insertElementAtIndex(M,I+1)}else this.scene.insertElement(M);U||b||p?this.handleTextWysiwyg(M,{isExistingElement:!!b}):this.setState({newElement:M,multiElement:null})}),j(this,"startImageCropping",l=>{this.store.shouldCaptureIncrement(),this.setState({croppingElementId:l.id})}),j(this,"finishImageCropping",()=>{this.state.croppingElementId&&(this.store.shouldCaptureIncrement(),this.setState({croppingElementId:null}))}),j(this,"handleCanvasDoubleClick",l=>{if(this.state.multiElement||this.state.activeTool.type!=="selection")return;let u=this.scene.getSelectedElements(this.state),{x:f,y:p}=Ge(l,this.state);if(u.length===1&&ue(u[0])){if(l[D.CTRL_OR_CMD]&&(!this.state.editingLinearElement||this.state.editingLinearElement.elementId!==u[0].id)&&!Q(u[0])){this.store.shouldCaptureIncrement(),this.setState({editingLinearElement:new J(u[0])});return}else if(this.state.selectedLinearElement&&Q(u[0])){let U=J.getSegmentMidpointHitCoords(this.state.selectedLinearElement,{x:f,y:p},this.state,this.scene.getNonDeletedElementsMap()),m=U?J.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,U,this.scene.getNonDeletedElementsMap()):-1;if(m&&m>-1){this.store.shouldCaptureIncrement(),J.deleteFixedSegment(u[0],m);let g=J.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:f,y:p},this.state,this.scene.getNonDeletedElementsMap()),b=g?J.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,g,this.scene.getNonDeletedElementsMap()):null;this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:{...this.state.selectedLinearElement.pointerDownState,segmentMidpoint:{index:b,value:U,added:!1}},segmentMidPointHoveredCoords:g}});return}}}if(u.length===1&&Re(u[0])){this.startImageCropping(u[0]);return}if(Kn(this.interactiveCanvas),Er(this.state).length>0){let U=this.getElementAtPosition(f,p),m=U&&LD(U,this.state.selectedGroupIds);if(m){this.store.shouldCaptureIncrement(),this.setState(g=>({...g,...sn({editingGroupId:m,selectedElementIds:{[U.id]:!0}},this.scene.getNonDeletedElements(),g,this)}));return}}if(Kn(this.interactiveCanvas),!l[D.CTRL_OR_CMD]&&!this.state.viewModeEnabled){let U=this.getElementAtPosition(f,p);if(Ln(U)){this.setState({activeEmbeddable:{element:U,state:"active"}});return}let m=this.getTextBindableContainerAtPosition(f,p);if(m&&(Hn(m)||!na(m.backgroundColor)||ls({x:f,y:p,element:m,shape:Ka(m,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()}))){let g=vh(m,this.state,this.scene.getNonDeletedElementsMap());f=g.x,p=g.y}this.startTextEditing({sceneX:f,sceneY:p,insertAtParentCenter:!l.altKey,container:m})}}),j(this,"getElementLinkAtPosition",(l,u)=>{let f=this.scene.getNonDeletedElements(),p=-1;for(let U=f.length-1;U>=0;U--){let m=f[U];if(u&&m.id===u.id&&(p=U),m.link&&U>=p&&yh(m,this.scene.getNonDeletedElementsMap(),this.state,E(l.x,l.y),this.device.editor.isMobile))return m}}),j(this,"redirectToLink",(l,u)=>{let f=Pe(E(this.lastPointerDownEvent.clientX,this.lastPointerDownEvent.clientY),E(this.lastPointerUpEvent.clientX,this.lastPointerUpEvent.clientY));if(!this.hitLinkElement||f>or)return;let p=Ge(this.lastPointerDownEvent,this.state),U=this.scene.getNonDeletedElementsMap(),m=yh(this.hitLinkElement,U,this.state,E(p.x,p.y),this.device.editor.isMobile),g=Ge(this.lastPointerUpEvent,this.state),b=yh(this.hitLinkElement,U,this.state,E(g.x,g.y),this.device.editor.isMobile);if(m&&b){Sg();let v=this.hitLinkElement.link;if(v){v=vn(v);let x;if(this.props.onLinkOpen&&(x=N5("excalidraw-link",l.nativeEvent),this.props.onLinkOpen({...this.hitLinkElement,link:v},x)),!x?.defaultPrevented){let y=l8(v)?"_self":"_blank",w=window.open(void 0,y);w&&(w.opener=null,w.location=v)}}}}),j(this,"getTopLayerFrameAtSceneCoords",l=>{let u=this.scene.getNonDeletedElementsMap(),f=this.scene.getNonDeletedFramesLikes().filter(p=>Um(l,p,u));return f.length?f[f.length-1]:null}),j(this,"handleCanvasPointerMove",l=>{this.savePointer(l.clientX,l.clientY,this.state.cursorButton),this.lastPointerMoveEvent=l.nativeEvent,De.pointers.has(l.pointerId)&&De.pointers.set(l.pointerId,{x:l.clientX,y:l.clientY});let u=De.initialScale;if(De.pointers.size===2&&De.lastCenter&&u&&De.initialDistance){let x=Lg(De.pointers),y=x.x-De.lastCenter.x,w=x.y-De.lastCenter.y;De.lastCenter=x;let k=Rg(Array.from(De.pointers.values())),M=this.state.activeTool.type==="freedraw"&&this.state.penMode?1:k/De.initialDistance,I=M?ei(u*M):this.state.zoom.value;this.setState(A=>{let _=xr({viewportX:x.x,viewportY:x.y,nextZoom:I},A);this.translateCanvas({zoom:_.zoom,scrollX:_.scrollX+2*(y/I),scrollY:_.scrollY+2*(w/I),shouldCacheIgnoreZoom:!0})}),this.resetShouldCacheIgnoreZoomDebounced()}else De.lastCenter=De.initialDistance=De.initialScale=null;if(ir||pl||Yh||Ms(this.state))return;let f=$g(Kh,l.clientX-this.state.offsetLeft,l.clientY-this.state.offsetTop).isOverEither;!this.state.newElement&&!this.state.selectionElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.multiElement&&(f?Kn(this.interactiveCanvas):wa(this.interactiveCanvas,this.state));let p=Ge(l,this.state),{x:U,y:m}=p;if(!this.state.newElement&&ZD(this.state.activeTool.type)){let{originOffset:x,snapLines:y}=GD(this.scene.getNonDeletedElements(),this,{x:U,y:m},l,this.scene.getNonDeletedElementsMap());this.setState(w=>{let k=rl(w.snapLines,y),M=w.originSnapOffset?rl(w.originSnapOffset,x):x;return w.snapLines===k&&w.originSnapOffset===M?null:{snapLines:k,originSnapOffset:M}})}else!this.state.newElement&&!this.state.selectedElementsAreBeingDragged&&!this.state.selectionElement&&this.setState(x=>x.snapLines.length?{snapLines:[]}:null);if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){let x=J.handlePointerMove(l,U,m,this,this.scene.getNonDeletedElementsMap());x&&x!==this.state.editingLinearElement&&Kt.flushSync(()=>{this.setState({editingLinearElement:x})}),x?.lastUncommittedPoint!=null?this.maybeSuggestBindingAtCursor(p,x.elbowed):Kt.flushSync(()=>{this.setState({suggestedBindings:[]})})}if(z5(this.state.activeTool.type)){let{newElement:x}=this.state;_a(x,!1)?this.maybeSuggestBindingsForLinearElementAtCoords(x,[p],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(p,!1)}if(this.state.multiElement){let{multiElement:x}=this.state,{x:y,y:w}=x,{points:k,lastCommittedPoint:M}=x,I=k[k.length-1];if(wa(this.interactiveCanvas,this.state),I===M)Pe(E(U-y,m-w),I)>=Id?X(x,{points:[...k,E(U-y,m-w)]},!1):He(this.interactiveCanvas,Fe.POINTER);else if(k.length>2&&M&&Pe(E(U-y,m-w),M)<Id)He(this.interactiveCanvas,Fe.POINTER),X(x,{points:k.slice(0,-1)},!1);else{let[A,_]=Ct(U,m,l[D.CTRL_OR_CMD]||Q(x)?null:this.getEffectiveGridSize()),[T,L]=x?.lastCommittedPoint??[0,0],R=A-y-T,F=_-w-L;Ol(l)&&({width:R,height:F}=Hf(T+y,L+w,A,_)),si(k,this.state.zoom.value)&&He(this.interactiveCanvas,Fe.POINTER),X(x,{points:[...k.slice(0,-1),E(T+R,L+F)]},!1,{isDragging:!0}),this.triggerRender(!1)}return}if(l.buttons||this.state.activeTool.type!=="selection"&&this.state.activeTool.type!=="text"&&this.state.activeTool.type!=="eraser")return;let g=this.scene.getNonDeletedElements(),b=this.scene.getSelectedElements(this.state);if(b.length===1&&!f&&!this.state.editingLinearElement){if(this.state.selectedLinearElement&&this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,U,m),(!this.state.selectedLinearElement||this.state.selectedLinearElement.hoverPointIndex===-1)&&this.state.openDialog?.name!=="elementLinkSelector"&&!(b.length===1&&Q(b[0]))){let x=wm(g,this.state,U,m,this.state.zoom,l.pointerType,this.scene.getNonDeletedElementsMap(),this.device);if(x&&x.transformHandleType){He(this.interactiveCanvas,Sm(x));return}}}else if(b.length>1&&!f&&this.state.openDialog?.name!=="elementLinkSelector"){let x=Em(Ne(b),U,m,this.state.zoom,l.pointerType,this.device);if(x){He(this.interactiveCanvas,Sm({transformHandleType:x}));return}}let v=this.getElementAtPosition(p.x,p.y);this.hitLinkElement=this.getElementLinkAtPosition(p,v),!Ea(this.state)&&(this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?(He(this.interactiveCanvas,Fe.POINTER),hF(this.hitLinkElement,this.state,this.scene.getNonDeletedElementsMap())):(Sg(),v&&(v.link||pn(v))&&this.state.selectedElementIds[v.id]&&!this.state.contextMenu&&!this.state.showHyperlinkPopup?this.setState({showHyperlinkPopup:"info"}):this.state.activeTool.type==="text"?He(this.interactiveCanvas,q(v)?Fe.TEXT:Fe.CROSSHAIR):this.state.viewModeEnabled?He(this.interactiveCanvas,Fe.GRAB):this.state.openDialog?.name==="elementLinkSelector"?He(this.interactiveCanvas,Fe.AUTO):f?He(this.interactiveCanvas,Fe.AUTO):this.state.selectedLinearElement?this.handleHoverSelectedLinearElement(this.state.selectedLinearElement,U,m):l[D.CTRL_OR_CMD]?He(this.interactiveCanvas,Fe.AUTO):(v||this.isHittingCommonBoundingBoxOfSelectedElements(p,b))&&!v?.locked&&(v&&Ln(v)&&this.isIframeLikeElementCenter(v,l,U,m)?(He(this.interactiveCanvas,Fe.POINTER),this.setState({activeEmbeddable:{element:v,state:"hover"}})):(!v||!Q(v))&&(He(this.interactiveCanvas,Fe.MOVE),this.state.activeEmbeddable?.state==="hover"&&this.setState({activeEmbeddable:null})))),this.state.openDialog?.name==="elementLinkSelector"&&v?this.setState(x=>({hoveredElementIds:rl(x.hoveredElementIds,sn({editingGroupId:x.editingGroupId,selectedElementIds:{[v.id]:!0}},this.scene.getNonDeletedElements(),x,this).selectedElementIds)})):this.state.openDialog?.name==="elementLinkSelector"&&!v&&this.setState(x=>({hoveredElementIds:rl(x.hoveredElementIds,{})})))}),j(this,"handleEraser",(l,u,f)=>{this.eraserTrail.addPointToPath(f.x,f.y);let p=!1,U=new Set,m=this.scene.getNonDeletedElements(),g=w=>{for(let k of w){if(k.locked)return;if(l.altKey?this.elementsPendingErasure.delete(k.id)&&(p=!0):this.elementsPendingErasure.has(k.id)||(p=!0,this.elementsPendingErasure.add(k.id)),p&&k.groupIds?.length){let M=k.groupIds.at(-1);if(!U.has(M)){U.add(M);let I=tt(m,M);for(let A of I)l.altKey?this.elementsPendingErasure.delete(A.id):this.elementsPendingErasure.add(A.id)}}}},b=Pe(E(u.lastCoords.x,u.lastCoords.y),E(f.x,f.y)),v=this.getElementHitThreshold(),x={...u.lastCoords},y=0;for(;y<=b;){let w=this.getElementsAtPosition(x.x,x.y);if(g(w),y===b)break;y=Math.min(y+v,b);let k=y/b,M=(1-k)*x.x+k*f.x,I=(1-k)*x.y+k*f.y;x.x=M,x.y=I}if(u.lastCoords.x=f.x,u.lastCoords.y=f.y,p){for(let w of this.scene.getNonDeletedElements())nt(w)&&(this.elementsPendingErasure.has(w.id)||this.elementsPendingErasure.has(w.containerId))&&(l.altKey?(this.elementsPendingErasure.delete(w.id),this.elementsPendingErasure.delete(w.containerId)):(this.elementsPendingErasure.add(w.id),this.elementsPendingErasure.add(w.containerId)));this.elementsPendingErasure=new Set(this.elementsPendingErasure),this.triggerRender()}}),j(this,"handleTouchMove",l=>{Ul=!0}),j(this,"handleCanvasPointerDown",l=>{let u=l.target;if(u.setPointerCapture&&u.setPointerCapture(l.pointerId),this.maybeCleanupAfterMissingPointerUp(l.nativeEvent),this.maybeUnfollowRemoteUser(),this.state.searchMatches&&(this.setState(v=>({searchMatches:v.searchMatches.map(x=>({...x,focus:!1}))})),ia.set(ex,null)),this.state.contextMenu&&this.setState({contextMenu:null}),this.state.snapLines&&this.setAppState({snapLines:[]}),this.updateGestureOnPointerDown(l),l.pointerType==="touch"&&this.state.newElement&&this.state.newElement.type==="freedraw"){let v=this.state.newElement;this.updateScene({...v.points.length<10?{elements:this.scene.getElementsIncludingDeleted().filter(x=>x.id!==v.id)}:{},appState:{newElement:null,editingTextElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:Le(Object.keys(this.state.selectedElementIds).filter(x=>x!==v.id).reduce((x,y)=>(x[y]=this.state.selectedElementIds[y],x),{}),this.state)},captureUpdate:this.state.openDialog?.name==="elementLinkSelector"?B.EVENTUALLY:B.NEVER});return}let f=document.getSelection();if(f?.anchorNode&&f.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(l),!this.state.penDetected&&l.pointerType==="pen"&&this.setState(v=>({penMode:!0,penDetected:!0})),!this.device.isTouchScreen&&["pen","touch"].includes(l.pointerType)&&(this.device=_d(this.device,{isTouchScreen:!0})),pl||(this.lastPointerDownEvent=l,this.handleCanvasPanUsingWheelOrSpaceDrag(l)))return;if(this.setState({lastPointerDownWith:l.pointerType,cursorButton:"down"}),this.savePointer(l.clientX,l.clientY,"down"),l.button===Si.ERASER&&this.state.activeTool.type!==Lt.eraser){this.setState({activeTool:Et(this.state,{type:Lt.eraser,lastActiveToolBeforeEraser:this.state.activeTool})},()=>{this.handleCanvasPointerDown(l);let v=()=>{x(),y?.(),Ea(this.state)&&this.setState({activeTool:Et(this.state,{...this.state.activeTool.lastActiveTool||{type:Lt.selection},lastActiveToolBeforeEraser:null})})},x=lt(window,"pointerup",v,{once:!0}),y;requestAnimationFrame(()=>{y=this.missingPointerEventCleanupEmitter.once(v)})});return}if(l.button!==Si.MAIN&&l.button!==Si.TOUCH&&l.button!==Si.ERASER||De.pointers.size>1)return;let p=this.initialPointerDownState(l);if(this.setState({selectedElementsAreBeingDragged:!1}),this.handleDraggingScrollBar(l,p)||(this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(l),this.handleSelectionOnPointerDown(l,p))||!(!this.state.penMode||l.pointerType!=="touch"||this.state.activeTool.type==="selection"||this.state.activeTool.type==="text"||this.state.activeTool.type==="image"))return;if(this.state.activeTool.type==="text")this.handleTextOnPointerDown(l,p);else if(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")this.handleLinearElementOnPointerDown(l,this.state.activeTool.type,p);else if(this.state.activeTool.type==="image"){He(this.interactiveCanvas,Fe.CROSSHAIR);let v=this.state.pendingImageElementId&&this.scene.getElement(this.state.pendingImageElementId);if(!v)return;this.setState({newElement:v,pendingImageElementId:null,multiElement:null});let{x,y}=Ge(l,this.state),w=this.getTopLayerFrameAtSceneCoords({x,y});X(v,{x,y,frameId:w?w.id:null})}else this.state.activeTool.type==="freedraw"?this.handleFreeDrawElementOnPointerDown(l,this.state.activeTool.type,p):this.state.activeTool.type==="custom"?wa(this.interactiveCanvas,this.state):this.state.activeTool.type===Lt.frame||this.state.activeTool.type===Lt.magicframe?this.createFrameElementOnPointerDown(p,this.state.activeTool.type):this.state.activeTool.type==="laser"?this.laserTrails.startPath(p.lastCoords.x,p.lastCoords.y):this.state.activeTool.type!=="eraser"&&this.state.activeTool.type!=="hand"&&this.createGenericElementOnPointerDown(this.state.activeTool.type,p);this.props?.onPointerDown?.(this.state.activeTool,p),this.onPointerDownEmitter.trigger(this.state.activeTool,p,l),this.state.activeTool.type==="eraser"&&this.eraserTrail.startPath(p.lastCoords.x,p.lastCoords.y);let U=this.onPointerMoveFromPointerDownHandler(p),m=this.onPointerUpFromPointerDownHandler(p),g=this.onKeyDownFromPointerDownHandler(p),b=this.onKeyUpFromPointerDownHandler(p);this.missingPointerEventCleanupEmitter.once(v=>m(v||l.nativeEvent)),(!this.state.viewModeEnabled||this.state.activeTool.type==="laser")&&(window.addEventListener("pointermove",U),window.addEventListener("pointerup",m),window.addEventListener("keydown",g),window.addEventListener("keyup",b),p.eventListeners.onMove=U,p.eventListeners.onUp=m,p.eventListeners.onKeyUp=b,p.eventListeners.onKeyDown=g)}),j(this,"handleCanvasPointerUp",l=>{this.removePointer(l),this.lastPointerUpEvent=l;let u=Ge({clientX:l.clientX,clientY:l.clientY},this.state),f=l.timeStamp-(this.lastPointerDownEvent?.timeStamp??0);if(this.device.editor.isMobile&&f<300){let p=this.getElementAtPosition(u.x,u.y);if(Ln(p)&&this.isIframeLikeElementCenter(p,l,u.x,u.y)){this.handleEmbeddableCenterClick(p);return}}if(this.device.isTouchScreen){let p=this.getElementAtPosition(u.x,u.y);this.hitLinkElement=this.getElementLinkAtPosition(u,p)}this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]?f<300&&Ln(this.hitLinkElement)&&!I8(this.hitLinkElement,this.scene.getNonDeletedElementsMap(),this.state,E(u.x,u.y))?this.handleEmbeddableCenterClick(this.hitLinkElement):this.redirectToLink(l,this.device.isTouchScreen):this.state.viewModeEnabled&&this.setState({activeEmbeddable:null,selectedElementIds:{}})}),j(this,"maybeOpenContextMenuAfterPointerDownOnTouchDevices",l=>{l.pointerType==="touch"&&(Ul=!1,wi?Ul=!0:wi=window.setTimeout(()=>{wi=0,Ul||this.handleCanvasContextMenu(l)},CS))}),j(this,"resetContextMenuTimer",()=>{clearTimeout(wi),wi=0,Ul=!1}),j(this,"maybeCleanupAfterMissingPointerUp",l=>{ml?.(),this.missingPointerEventCleanupEmitter.trigger(l).clear()}),j(this,"handleCanvasPanUsingWheelOrSpaceDrag",l=>{if(!(De.pointers.size<=1&&(l.button===Si.WHEEL||l.button===Si.MAIN&&ir||Ms(this.state)||this.state.viewModeEnabled)))return!1;pl=!0,this.focusContainer(),this.state.editingTextElement||l.preventDefault();let u=!1,f=typeof window===void 0?!1:/Linux/.test(window.navigator.platform);He(this.interactiveCanvas,Fe.GRABBING);let{clientX:p,clientY:U}=l,m=Xh(b=>{let v=p-b.clientX,x=U-b.clientY;if(p=b.clientX,U=b.clientY,f&&!u&&(Math.abs(v)>1||Math.abs(x)>1)){u=!0;let y=k=>{document.body.removeEventListener("paste",y),k.stopPropagation()},w=()=>{setTimeout(()=>{document.body.removeEventListener("paste",y),window.removeEventListener("pointerup",w)},100)};document.body.addEventListener("paste",y),window.addEventListener("pointerup",w)}this.translateCanvas({scrollX:this.state.scrollX-v/this.state.zoom.value,scrollY:this.state.scrollY-x/this.state.zoom.value})}),g=ht(ml=()=>{ml=null,pl=!1,ir||(this.state.viewModeEnabled?He(this.interactiveCanvas,Fe.GRAB):wa(this.interactiveCanvas,this.state)),this.setState({cursorButton:"up"}),this.savePointer(l.clientX,l.clientY,"up"),window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",g),window.removeEventListener("blur",g),m.flush()});return window.addEventListener("blur",g),window.addEventListener("pointermove",m,{passive:!0}),window.addEventListener("pointerup",g),!0}),j(this,"clearSelectionIfNotUsingSelection",()=>{this.state.activeTool.type!=="selection"&&this.setState({selectedElementIds:Le({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}),j(this,"handleSelectionOnPointerDown",(l,u)=>{if(this.state.activeTool.type==="selection"){let f=this.scene.getNonDeletedElements(),p=this.scene.getNonDeletedElementsMap(),U=this.scene.getSelectedElements(this.state);if(U.length===1&&!this.state.editingLinearElement&&!Q(U[0])&&!(this.state.selectedLinearElement&&this.state.selectedLinearElement.hoverPointIndex!==-1)){let m=wm(f,this.state,u.origin.x,u.origin.y,this.state.zoom,l.pointerType,this.scene.getNonDeletedElementsMap(),this.device);m!=null&&(m.transformHandleType==="rotation"?(this.setState({resizingElement:m.element}),u.resize.handleType=m.transformHandleType):(this.state.croppingElementId||this.setState({resizingElement:m.element}),u.resize.handleType=m.transformHandleType))}else U.length>1&&(u.resize.handleType=Em(Ne(U),u.origin.x,u.origin.y,this.state.zoom,l.pointerType,this.device));if(u.resize.handleType)u.resize.isResizing=!0,u.resize.offset=ta(zR(u.resize.handleType,U,p,u.origin.x,u.origin.y)),U.length===1&&ue(U[0])&&U[0].points.length===2&&(u.resize.arrowDirection=BR(u.resize.handleType,U[0]));else{if(this.state.selectedLinearElement){let b=this.state.editingLinearElement||this.state.selectedLinearElement,v=J.handlePointerDown(l,this,this.store,u.origin,b,this.scene);if(v.hitElement&&(u.hit.element=v.hitElement),v.linearElementEditor&&(this.setState({selectedLinearElement:v.linearElementEditor}),this.state.editingLinearElement&&this.setState({editingLinearElement:v.linearElementEditor})),v.didAddPoint)return!0}if(u.hit.element=u.hit.element??this.getElementAtPosition(u.origin.x,u.origin.y),this.hitLinkElement=this.getElementLinkAtPosition(u.origin,u.hit.element),this.hitLinkElement)return!0;if(this.state.croppingElementId&&u.hit.element?.id!==this.state.croppingElementId&&this.finishImageCropping(),u.hit.element&&this.getElementLinkAtPosition({x:u.origin.x,y:u.origin.y},u.hit.element))return!1;u.hit.allHitElements=this.getElementsAtPosition(u.origin.x,u.origin.y);let m=u.hit.element,g=u.hit.allHitElements.some(b=>this.isASelectedElement(b));if((m===null||!g)&&!l.shiftKey&&!u.hit.hasHitCommonBoundingBoxOfSelectedElements&&this.clearSelection(m),this.state.editingLinearElement)this.setState({selectedElementIds:Le({[this.state.editingLinearElement.elementId]:!0},this.state)});else if(m!=null){if(l[D.CTRL_OR_CMD])return this.state.selectedElementIds[m.id]||(u.hit.wasAddedToSelection=!0),this.setState(b=>({...DD(b,m),previousSelectedElementIds:this.state.selectedElementIds})),!1;this.state.selectedElementIds[m.id]||(this.state.editingGroupId&&!po(m,this.state.editingGroupId)&&this.setState({selectedElementIds:Le({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),!g&&!u.hit.hasHitCommonBoundingBoxOfSelectedElements&&(this.setState(b=>{let v={...b.selectedElementIds,[m.id]:!0},x=[];if(Object.keys(b.selectedElementIds).forEach(y=>{let w=this.scene.getElement(y);w&&x.push(w)}),de(m))$a(x,m.id).forEach(y=>{delete v[y.id]});else if(m.frameId)v[m.frameId]&&delete v[m.id];else{let y=m.groupIds,w=new Set(y.flatMap(k=>tt(this.scene.getNonDeletedElements(),k)).filter(k=>de(k)).map(k=>k.id));w.size>0&&x.forEach(k=>{k.frameId&&w.has(k.frameId)&&(delete v[k.id],k.groupIds.flatMap(M=>tt(this.scene.getNonDeletedElements(),M)).forEach(M=>{delete v[M.id]}))})}return b.openDialog?.name==="elementLinkSelector"&&(m.groupIds.some(y=>b.selectedGroupIds[y])||(v={[m.id]:!0})),{...sn({editingGroupId:b.editingGroupId,selectedElementIds:v},this.scene.getNonDeletedElements(),b,this),showHyperlinkPopup:m.link||pn(m)?"info":!1}}),u.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1}),j(this,"handleTextOnPointerDown",(l,u)=>{if(this.state.editingTextElement)return;let f=u.origin.x,p=u.origin.y,U=this.getElementAtPosition(f,p,{includeBoundTextElement:!0}),m=this.getTextBindableContainerAtPosition(f,p);Hn(U)&&(m=U,f=U.x+U.width/2,p=U.y+U.height/2),this.startTextEditing({sceneX:f,sceneY:p,insertAtParentCenter:!l.altKey,container:m,autoEdit:!1}),Kn(this.interactiveCanvas),this.state.activeTool.locked||this.setState({activeTool:Et(this.state,{type:"selection"})})}),j(this,"handleFreeDrawElementOnPointerDown",(l,u,f)=>{let[p,U]=Ct(f.origin.x,f.origin.y,null),m=this.getTopLayerFrameAtSceneCoords({x:p,y:U}),g=l.pressure===.5,b=uL({type:u,x:p,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:null,simulatePressure:g,locked:!1,frameId:m?m.id:null,points:[E(0,0)],pressures:g?[]:[l.pressure]});this.scene.insertElement(b),this.setState(x=>{let y={...x.selectedElementIds};return delete y[b.id],{selectedElementIds:Le(y,x)}});let v=aa(f.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom);this.setState({newElement:b,startBoundElement:v,suggestedBindings:[]})}),j(this,"insertIframeElement",({sceneX:l,sceneY:u,width:f,height:p})=>{let[U,m]=Ct(l,u,this.lastPointerDownEvent?.[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g=oL({type:"iframe",x:U,y:m,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("iframe"),opacity:this.state.currentItemOpacity,locked:!1,width:f,height:p});return this.scene.insertElement(g),g}),j(this,"insertEmbeddableElement",({sceneX:l,sceneY:u,link:f})=>{let[p,U]=Ct(l,u,this.lastPointerDownEvent?.[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m=Us(f);if(!m)return;m.error instanceof URIError&&this.setToast({message:S("toast.unrecognizedLinkFormat"),closable:!0});let g=B2({type:"embeddable",x:p,y:U,strokeColor:"transparent",backgroundColor:"transparent",fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:this.getCurrentItemRoundness("embeddable"),opacity:this.state.currentItemOpacity,locked:!1,width:m.intrinsicSize.w,height:m.intrinsicSize.h,link:f});return this.scene.insertElement(g),g}),j(this,"createImageElement",({sceneX:l,sceneY:u,addToFrameUnderCursor:f=!0})=>{let[p,U]=Ct(l,u,this.lastPointerDownEvent?.[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m=f?this.getTopLayerFrameAtSceneCoords({x:p,y:U}):null;return f8({type:"image",x:p,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,roundness:null,opacity:this.state.currentItemOpacity,locked:!1,frameId:m?m.id:null})}),j(this,"handleLinearElementOnPointerDown",(l,u,f)=>{if(this.state.multiElement){let{multiElement:p}=this.state;if(p.type==="line"&&si(p.points,this.state.zoom.value)){X(p,{lastCommittedPoint:p.points[p.points.length-1]}),this.actionManager.executeAction(Zn);return}if(Q(p)&&p.points.length>1){X(p,{lastCommittedPoint:p.points[p.points.length-1]}),this.actionManager.executeAction(Zn);return}let{x:U,y:m,lastCommittedPoint:g}=p;if(p.points.length>1&&g&&Pe(E(f.origin.x-U,f.origin.y-m),g)<Id){this.actionManager.executeAction(Zn);return}this.setState(b=>({selectedElementIds:Le({...b.selectedElementIds,[p.id]:!0},b)})),X(p,{lastCommittedPoint:p.points[p.points.length-1]}),He(this.interactiveCanvas,Fe.POINTER)}else{let[p,U]=Ct(f.origin.x,f.origin.y,l[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),m=this.getTopLayerFrameAtSceneCoords({x:p,y:U}),{currentItemStartArrowhead:g,currentItemEndArrowhead:b}=this.state,[v,x]=u==="arrow"?[g,b]:[null,null],y=u==="arrow"?o0({type:u,x:p,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemArrowType===Ot.round?{type:St.PROPORTIONAL_RADIUS}:null,startArrowhead:v,endArrowhead:x,locked:!1,frameId:m?m.id:null,elbowed:this.state.currentItemArrowType===Ot.elbow,fixedSegments:this.state.currentItemArrowType===Ot.elbow?[]:null}):Sr({type:u,x:p,y:U,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.state.currentItemRoundness==="round"?{type:St.PROPORTIONAL_RADIUS}:null,locked:!1,frameId:m?m.id:null});this.setState(k=>{let M={...k.selectedElementIds};return delete M[y.id],{selectedElementIds:Le(M,k)}}),X(y,{points:[...y.points,E(0,0)]});let w=aa(f.origin,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,Q(y),Q(y));this.scene.insertElement(y),this.setState({newElement:y,startBoundElement:w,suggestedBindings:[]})}}),j(this,"createGenericElementOnPointerDown",(l,u)=>{let[f,p]=Ct(u.origin.x,u.origin.y,this.lastPointerDownEvent?.[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),U=this.getTopLayerFrameAtSceneCoords({x:f,y:p}),m={x:f,y:p,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,roundness:this.getCurrentItemRoundness(l),locked:!1,frameId:U?U.id:null},g;l==="embeddable"?g=B2({type:"embeddable",...m}):g=Pa({type:l,...m}),g.type==="selection"?this.setState({selectionElement:g}):(this.scene.insertElement(g),this.setState({multiElement:null,newElement:g}))}),j(this,"createFrameElementOnPointerDown",(l,u)=>{let[f,p]=Ct(l.origin.x,l.origin.y,this.lastPointerDownEvent?.[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),U={x:f,y:p,opacity:this.state.currentItemOpacity,locked:!1,...dt},m=u===Lt.magicframe?Rf(U):l0(U);this.scene.insertElement(m),this.setState({multiElement:null,newElement:m})}),j(this,"restoreReadyToEraseElements",()=>{this.elementsPendingErasure=new Set,this.triggerRender()}),j(this,"eraseElements",()=>{let l=!1,u=this.scene.getElementsIncludingDeleted().map(f=>this.elementsPendingErasure.has(f.id)||f.frameId&&this.elementsPendingErasure.has(f.frameId)||nt(f)&&this.elementsPendingErasure.has(f.containerId)?(l=!0,pe(f,{isDeleted:!0})):f);this.elementsPendingErasure=new Set,l&&(this.store.shouldCaptureIncrement(),this.scene.replaceAllElements(u))}),j(this,"initializeImage",async({imageFile:l,imageElement:u,showCursorImagePreview:f=!1})=>{if(!kr(l))throw new Error(S("errors.unsupportedFileType"));let p=l.type;if(He(this.interactiveCanvas,"wait"),p===ae.svg)try{l=Cm(Q2(await l.text()),l.name)}catch(b){throw console.warn(b),new Error(S("errors.svgImageInsertError"))}let U=await(this.props.generateIdForFile?.(l)||eP(l));if(!U)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(S("errors.imageInsertError"));if(!this.files[U]?.dataURL){try{l=await Gf(l,{maxWidthOrHeight:LS})}catch(b){console.error("Error trying to resizing image file on insertion",b)}if(l.size>XU)throw new Error(S("errors.fileTooBig",{maxSize:`${Math.trunc(XU/1024/1024)}MB`}))}if(f){let b=this.files[U]?.dataURL,v=b&&nP(b);this.setImagePreviewCursor(v||l)}let m=this.files[U]?.dataURL||await Vf(l),g=X(u,{fileId:U},!1);return new Promise(async(b,v)=>{try{this.addMissingFiles([{mimeType:p,id:U,dataURL:m,created:Date.now(),lastRetrieved:Date.now()}]);let x=this.imageCache.get(U);x||(this.addNewImagesToImageCache(),await this.updateImageCache([g])),x?.image instanceof Promise&&await x.image,this.state.pendingImageElementId!==g.id&&this.state.newElement?.id!==g.id&&this.initializeImageDimensions(g,!0),b(g)}catch(x){console.error(x),v(new Error(S("errors.imageInsertError")))}finally{f||Kn(this.interactiveCanvas)}})}),j(this,"insertImageElement",async(l,u,f)=>{if(!this.isToolSupported("image")){this.setState({errorMessage:S("errors.imageToolNotSupported")});return}this.scene.insertElement(l);try{return await this.initializeImage({imageFile:u,imageElement:l,showCursorImagePreview:f})}catch(p){return X(l,{isDeleted:!0}),this.actionManager.executeAction(Zn),this.setState({errorMessage:p.message||S("errors.imageInsertError")}),null}}),j(this,"setImagePreviewCursor",async l=>{let u;try{u=await Gf(l,{maxWidthOrHeight:96})}catch(p){throw p.cause==="UNSUPPORTED"?new Error(S("errors.unsupportedFileType")):p}let f=await Vf(u);if(l.type===ae.svg){let p=await E8(f),U=Math.min(p.height,96),m=U*(p.width/p.height);m>96&&(m=96,U=m*(p.height/p.width));let g=document.createElement("canvas");g.height=U,g.width=m,g.getContext("2d").drawImage(p,0,0,m,U),f=g.toDataURL(ae.svg)}this.state.pendingImageElementId&&He(this.interactiveCanvas,`url(${f}) 4 4, auto`)}),j(this,"onImageAction",async({insertOnCanvasDirectly:l})=>{try{let u=this.state.width/2+this.state.offsetLeft,f=this.state.height/2+this.state.offsetTop,{x:p,y:U}=Ge({clientX:u,clientY:f},this.state),m=await c0({description:"Image",extensions:Object.keys(ks)}),g=this.createImageElement({sceneX:p,sceneY:U,addToFrameUnderCursor:!1});l?(this.insertImageElement(g,m),this.initializeImageDimensions(g),this.setState({selectedElementIds:Le({[g.id]:!0},this.state)},()=>{this.actionManager.executeAction(Zn)})):this.setState({pendingImageElementId:g.id},()=>{this.insertImageElement(g,m,!0)})}catch(u){u.name!=="AbortError"?console.error(u):console.warn(u),this.setState({pendingImageElementId:null,newElement:null,activeTool:Et(this.state,{type:"selection"})},()=>{this.actionManager.executeAction(Zn)})}}),j(this,"initializeImageDimensions",(l,u=!1)=>{let f=Dn(l)&&this.imageCache.get(l.fileId)?.image;if(!f||f instanceof Promise){if(l.width<or/this.state.zoom.value&&l.height<or/this.state.zoom.value){let p=100/this.state.zoom.value;X(l,{x:l.x-p/2,y:l.y-p/2,width:p,height:p})}return}if(u||l.width<or/this.state.zoom.value&&l.height<or/this.state.zoom.value){let p=Math.max(this.state.height-120,160),U=Math.min(p,Math.floor(this.state.height*.5)/this.state.zoom.value),m=Math.min(f.naturalHeight,U),g=m*(f.naturalWidth/f.naturalHeight),b=l.x+l.width/2-g/2,v=l.y+l.height/2-m/2;X(l,{x:b,y:v,width:g,height:m,crop:null})}}),j(this,"updateImageCache",async(l,u=this.files)=>{let{updatedFiles:f,erroredFiles:p}=await S8({imageCache:this.imageCache,fileIds:l.map(U=>U.fileId),files:u});if(f.size||p.size)for(let U of l)f.has(U.fileId)&&ut.delete(U);return p.size&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().map(U=>Dn(U)&&p.has(U.fileId)?pe(U,{status:"error"}):U)),{updatedFiles:f,erroredFiles:p}}),j(this,"addNewImagesToImageCache",async(l=k8(this.scene.getNonDeletedElements()),u=this.files)=>{let f=l.filter(p=>!p.isDeleted&&!this.imageCache.has(p.fileId));if(f.length){let{updatedFiles:p}=await this.updateImageCache(f,u);p.size&&this.scene.triggerUpdate()}}),j(this,"scheduleImageRefresh",Mo(()=>{this.addNewImagesToImageCache()},kS)),j(this,"updateBindingEnabledOnPointerMove",l=>{let u=oD(l);this.state.isBindingEnabled!==u&&this.setState({isBindingEnabled:u})}),j(this,"maybeSuggestBindingAtCursor",(l,u)=>{let f=aa(l,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,!1,u);this.setState({suggestedBindings:f!=null?[f]:[]})}),j(this,"maybeSuggestBindingsForLinearElementAtCoords",(l,u,f)=>{if(!u.length)return;let p=u.reduce((U,m)=>{let g=aa(m,this.scene.getNonDeletedElements(),this.scene.getNonDeletedElementsMap(),this.state.zoom,Q(l),Q(l));return g!=null&&!Wb(l,f?.id,g)&&U.push(g),U},[]);this.setState({suggestedBindings:p})}),j(this,"handleInteractiveCanvasRef",l=>{l!==null?(this.interactiveCanvas=l,this.interactiveCanvas.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.interactiveCanvas.addEventListener("touchend",this.onTouchEnd)):(this.interactiveCanvas?.removeEventListener("touchstart",this.onTouchStart),this.interactiveCanvas?.removeEventListener("touchend",this.onTouchEnd))}),j(this,"handleAppOnDrop",async l=>{let{file:u,fileHandle:f}=await rP(l),{x:p,y:U}=Ge(l,this.state);try{if(kr(u)&&this.isToolSupported("image")){if(u?.type===ae.png||u?.type===ae.svg)try{let b=await z0(u,this.state,this.scene.getElementsIncludingDeleted(),f);this.syncActionResult({...b,appState:{...b.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:B.IMMEDIATELY});return}catch(b){if(b.name!=="EncodingError")throw new Error(S("alerts.couldNotLoadInvalidFile"))}let g=this.createImageElement({sceneX:p,sceneY:U});this.insertImageElement(g,u),this.initializeImageDimensions(g),this.setState({selectedElementIds:Le({[g.id]:!0},this.state)});return}}catch(g){return this.setState({isLoading:!1,errorMessage:g.message})}let m=l.dataTransfer.getData(ae.excalidrawlib);if(m&&typeof m=="string"){try{let g=m7(m);this.addElementsFromPasteOrLibrary({elements:a9(g),position:l,files:null})}catch(g){this.setState({errorMessage:g.message})}return}if(u&&await this.loadFileToCanvas(u,f),l.dataTransfer?.types?.includes("text/plain")){let g=l.dataTransfer?.getData("text");if(g&&Od(g,this.props.validateEmbeddable)&&(/^(http|https):\/\/[^\s/$.?#].[^\s]*$/.test(g)||Us(g)?.type==="video")){let b=this.insertEmbeddableElement({sceneX:p,sceneY:U,link:vn(g)});b&&this.setState({selectedElementIds:{[b.id]:!0}})}}}),j(this,"loadFileToCanvas",async(l,u)=>{l=await B0(l);try{let f=this.scene.getElementsIncludingDeleted(),p;try{p=await F0(l,this.state,f,u)}catch(U){let m=U instanceof mr;if(m&&U.code==="IMAGE_NOT_CONTAINS_SCENE_DATA"&&!this.isToolSupported("image")){this.setState({isLoading:!1,errorMessage:S("errors.imageToolNotSupported")});return}let g=S(m?"alerts.cannotRestoreFromImage":"alerts.couldNotLoadInvalidFile");this.setState({isLoading:!1,errorMessage:g})}if(!p)return;p.type===ae.excalidraw?(Oa(f.concat(p.data.elements)),this.store.updateSnapshot(oe(f),this.state),this.setState({isLoading:!0}),this.syncActionResult({...p.data,appState:{...p.data.appState||this.state,isLoading:!1},replaceFiles:!0,captureUpdate:B.IMMEDIATELY})):p.type===ae.excalidrawlib&&await this.library.updateLibrary({libraryItems:l,merge:!0,openLibraryMenu:!0}).catch(U=>{console.error(U),this.setState({errorMessage:S("errors.importLibraryError")})})}catch(f){this.setState({isLoading:!1,errorMessage:f.message})}}),j(this,"handleCanvasContextMenu",l=>{if(l.preventDefault(),("pointerType"in l.nativeEvent&&l.nativeEvent.pointerType==="touch"||"pointerType"in l.nativeEvent&&l.nativeEvent.pointerType==="pen"&&l.button!==Si.SECONDARY)&&this.state.activeTool.type!=="selection")return;let{x:u,y:f}=Ge(l,this.state),p=this.getElementAtPosition(u,f,{preferSelected:!0,includeLockedElements:!0}),U=this.scene.getSelectedElements(this.state),m=this.isHittingCommonBoundingBoxOfSelectedElements({x:u,y:f},U),g=p||m?"element":"canvas",b=this.excalidrawContainerRef.current,{top:v,left:x}=b.getBoundingClientRect(),y=l.clientX-x,w=l.clientY-v;qe("contextMenu","openContextMenu",g),this.setState({...p&&!this.state.selectedElementIds[p.id]?{...this.state,...sn({editingGroupId:this.state.editingGroupId,selectedElementIds:{[p.id]:!0}},this.scene.getNonDeletedElements(),this.state,this),selectedLinearElement:ue(p)?new J(p):null}:this.state,showHyperlinkPopup:!1},()=>{this.setState({contextMenu:{top:w,left:y,items:this.getContextMenuItems(g)}})})}),j(this,"maybeDragNewGenericElement",(l,u,f=!0)=>{let p=this.state.selectionElement,U=l.lastCoords;if(p&&this.state.activeTool.type!=="eraser"){Mm({newElement:p,elementType:this.state.activeTool.type,originX:l.origin.x,originY:l.origin.y,x:U.x,y:U.y,width:qt(l.origin.x,U.x),height:qt(l.origin.y,U.y),shouldMaintainAspectRatio:sl(u),shouldResizeFromCenter:gh(u),zoom:this.state.zoom.value,informMutation:f});return}let m=this.state.newElement;if(!m)return;let[g,b]=Ct(U.x,U.y,u[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=Dn(m)&&this.imageCache.get(m.fileId)?.image,x=v&&!(v instanceof Promise)?v.width/v.height:null;this.maybeCacheReferenceSnapPoints(u,[m]);let{snapOffset:y,snapLines:w}=VD(m,this,u,{x:l.originInGrid.x+(this.state.originSnapOffset?.x??0),y:l.originInGrid.y+(this.state.originSnapOffset?.y??0)},{x:g-l.originInGrid.x,y:b-l.originInGrid.y},this.scene.getNonDeletedElementsMap());g+=y.x,b+=y.y,this.setState({snapLines:w}),Mm({newElement:m,elementType:this.state.activeTool.type,originX:l.originInGrid.x,originY:l.originInGrid.y,x:g,y:b,width:qt(l.originInGrid.x,g),height:qt(l.originInGrid.y,b),shouldMaintainAspectRatio:Re(m)?!sl(u):sl(u),shouldResizeFromCenter:gh(u),zoom:this.state.zoom.value,widthAspectRatio:x,originOffset:this.state.originSnapOffset,informMutation:f}),this.setState({newElement:m}),(this.state.activeTool.type===Lt.frame||this.state.activeTool.type===Lt.magicframe)&&this.setState({elementsToHighlight:Fd(this.scene.getNonDeletedElements(),m,this.state,this.scene.getNonDeletedElementsMap())})}),j(this,"maybeHandleCrop",(l,u)=>{if(!this.state.croppingElementId)return!1;let f=l.resize.handleType,p=l.lastCoords,[U,m]=Ct(p.x-l.resize.offset.x,p.y-l.resize.offset.y,u[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),g=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(f&&g&&Re(g)){let b=l.originalElements.get(g.id),v=Dn(g)&&this.imageCache.get(g.fileId)?.image;if(b&&Re(b)&&v&&!(v instanceof Promise)){let[x,y]=Ct(p.x,p.y,u[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),w={x:x-l.originInGrid.x,y:y-l.originInGrid.y};this.maybeCacheReferenceSnapPoints(u,[g]);let{snapOffset:k,snapLines:M}=F2([g],[b],this,u,w,f);X(g,AA(g,f,v.naturalWidth,v.naturalHeight,U+k.x,m+k.y,u.shiftKey?b.width/b.height:void 0)),xn(g,this.scene.getNonDeletedElementsMap(),{newSize:{width:g.width,height:g.height}}),this.setState({isCropping:f&&f!=="rotation",snapLines:M})}return!0}return!1}),j(this,"maybeHandleResize",(l,u)=>{let f=this.scene.getSelectedElements(this.state),p=f.filter(x=>de(x)),U=l.resize.handleType;if(p.length>0&&U==="rotation"||f.length===1&&Q(f[0])||this.state.croppingElementId)return!1;this.setState({isResizing:U&&U!=="rotation",isRotating:U==="rotation",activeEmbeddable:null});let m=l.lastCoords,[g,b]=Ct(m.x-l.resize.offset.x,m.y-l.resize.offset.y,u[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),v=new Map;if(p.forEach(x=>{$a(this.scene.getNonDeletedElements(),x.id).forEach(y=>{v.set(x.id+y.id,{x:y.x-x.x,y:y.y-x.y})})}),!this.state.selectedElementsAreBeingDragged){let[x,y]=Ct(m.x,m.y,u[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),w={x:x-l.originInGrid.x,y:y-l.originInGrid.y},k=[...l.originalElements.values()];this.maybeCacheReferenceSnapPoints(u,f);let{snapOffset:M,snapLines:I}=F2(f,xe(k,this.state),this,u,w,U);g+=M.x,b+=M.y,this.setState({snapLines:I})}if(NR(l.originalElements,U,f,this.scene.getElementsMapIncludingDeleted(),this.scene,Ol(u),gh(u),f.some(x=>Re(x))?!sl(u):sl(u),g,b,l.resize.center.x,l.resize.center.y)){let x=xh(f,this.scene.getNonDeletedElementsMap(),this.state.zoom),y=new Set;return p.forEach(w=>{Fd(this.scene.getNonDeletedElements(),w,this.state,this.scene.getNonDeletedElementsMap()).forEach(k=>y.add(k))}),this.setState({elementsToHighlight:[...y],suggestedBindings:x}),!0}return!1}),j(this,"getContextMenuItems",l=>{let u=[];return u.push(vg,xg),l==="canvas"?this.state.viewModeEnabled?[...u,wg,c1,n6,u1]:[gg,At,vg,xg,yg,At,KO,mF,At,wg,aF,c1,n6,u1]:(u.push(yg),this.state.viewModeEnabled?[Wd,...u]:[At,bg,Wd,gg,At,$H,FH,zH,At,Dz,At,...u,At,B$,H$,At,W$,MX,iF,rF,oF,V$,At,K$,At,VO,GO,ZO,YO,At,eF,tF,At,Az,At,q4,m9,At,e$,UF,At,x4])}),j(this,"handleWheel",ht(l=>{if(!(l.target instanceof HTMLCanvasElement||l.target instanceof HTMLTextAreaElement||l.target instanceof HTMLIFrameElement)){l[D.CTRL_OR_CMD]&&l.preventDefault();return}if(l.preventDefault(),pl)return;let{deltaX:u,deltaY:f}=l;if(l.metaKey||l.ctrlKey){let p=Math.sign(f),U=Kc*100,m=Math.abs(f),g=f;m>U&&(g=U*p);let b=this.state.zoom.value-g/100;b+=Math.log10(Math.max(1,this.state.zoom.value))*-p*Math.min(1,m/20),this.translateCanvas(v=>({...xr({viewportX:this.lastViewportPosition.x,viewportY:this.lastViewportPosition.y,nextZoom:ei(b)},v),shouldCacheIgnoreZoom:!0})),this.resetShouldCacheIgnoreZoomDebounced();return}if(l.shiftKey){this.translateCanvas(({zoom:p,scrollX:U})=>({scrollX:U-(f||u)/p.value}));return}this.translateCanvas(({zoom:p,scrollX:U,scrollY:m})=>({scrollX:U-u/p.value,scrollY:m-f/p.value}))})),j(this,"savePointer",(l,u,f)=>{if(!l||!u)return;let{x:p,y:U}=Ge({clientX:l,clientY:u},this.state),m={x:p,y:U,tool:this.state.activeTool.type==="laser"?"laser":"pointer"};this.props.onPointerUpdate?.({pointer:m,button:f,pointersMap:De.pointers})}),j(this,"resetShouldCacheIgnoreZoomDebounced",Is(()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})},300)),j(this,"updateDOMRect",l=>{if(this.excalidrawContainerRef?.current){let u=this.excalidrawContainerRef.current,{width:f,height:p,left:U,top:m}=u.getBoundingClientRect(),{width:g,height:b,offsetTop:v,offsetLeft:x}=this.state;if(f===g&&p===b&&U===x&&m===v){l&&l();return}this.setState({width:f,height:p,offsetLeft:U,offsetTop:m},()=>{l&&l()})}}),j(this,"refresh",()=>{this.setState({...this.getCanvasOffsets()})});let n=Da(),{excalidrawAPI:a,viewModeEnabled:i=!1,zenModeEnabled:r=!1,gridModeEnabled:s=!1,objectsSnapModeEnabled:o=!1,theme:d=n.theme,name:c=`${S("labels.untitled")}-${KU()}`}=t;if(this.state={...n,theme:d,isLoading:!0,...this.getCanvasOffsets(),viewModeEnabled:i,zenModeEnabled:r,objectsSnapModeEnabled:o,gridModeEnabled:s??n.gridModeEnabled,name:c,width:window.innerWidth,height:window.innerHeight},this.id=C1(),this.library=new SF(this),this.actionManager=new Nz(this.syncActionResult,()=>this.state,()=>this.scene.getElementsIncludingDeleted(),this),this.scene=new ci,this.canvas=document.createElement("canvas"),this.rc=Ki.canvas(this.canvas),this.renderer=new d6(this.scene),this.visibleElements=[],this.store=new mL,this.history=new Dg,a){let l={updateScene:this.updateScene,updateLibrary:this.library.updateLibrary,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,getName:this.getName,registerAction:u=>{this.actionManager.registerAction(u)},refresh:this.refresh,setToast:this.setToast,id:this.id,setActiveTool:this.setActiveTool,setCursor:this.setCursor,resetCursor:this.resetCursor,updateFrameRendering:this.updateFrameRendering,toggleSidebar:this.toggleSidebar,onChange:u=>this.onChangeEmitter.on(u),onPointerDown:u=>this.onPointerDownEmitter.on(u),onPointerUp:u=>this.onPointerUpEmitter.on(u),onScrollChange:u=>this.onScrollChangeEmitter.on(u),onUserFollow:u=>this.onUserFollowEmitter.on(u)};typeof a=="function"?a(l):console.error("excalidrawAPI should be a function!")}this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.fonts=new ni(this.scene),this.history=new Dg,this.actionManager.registerAll(Lf),this.actionManager.registerAction(Rz(this.history,this.store)),this.actionManager.registerAction(Pz(this.history,this.store))}onWindowMessage(t){if(t.origin!=="https://player.vimeo.com"&&t.origin!=="https://www.youtube.com")return;let n=null;try{n=JSON.parse(t.data)}catch{}if(n)switch(t.origin){case"https://player.vimeo.com":if(n.method==="paused"){let a=null,i=document.body.querySelectorAll("iframe.excalidraw__embeddable");if(!i)break;for(let r of i)r.contentWindow===t.source&&(a=r.contentWindow);a?.postMessage(JSON.stringify({method:n.value?"play":"pause",value:!0}),"*")}break;case"https://www.youtube.com":if(n.event==="infoDelivery"&&n.info&&n.id&&typeof n.info.playerState=="number"){let a=n.id,i=n.info.playerState;Object.values(ad).includes(i)&&qh.set(a,i)}break}}cacheEmbeddableRef(t,n){n&&this.iFrameRefs.set(t.id,n)}getHTMLIFrameElement(t){return this.iFrameRefs.get(t.id)}handleEmbeddableCenterClick(t){if(this.state.activeEmbeddable?.element===t&&this.state.activeEmbeddable?.state==="active"||(setTimeout(()=>{this.setState({activeEmbeddable:{element:t,state:"active"},selectedElementIds:{[t.id]:!0},newElement:null,selectionElement:null})},100),Ii(t)))return;let n=this.getHTMLIFrameElement(t);if(n?.contentWindow){if(n.src.includes("youtube")){let a=qh.get(t.id);switch(a||(qh.set(t.id,ad.UNSTARTED),n.contentWindow.postMessage(JSON.stringify({event:"listening",id:t.id}),"*")),a){case ad.PLAYING:case ad.BUFFERING:n.contentWindow?.postMessage(JSON.stringify({event:"command",func:"pauseVideo",args:""}),"*");break;default:n.contentWindow?.postMessage(JSON.stringify({event:"command",func:"playVideo",args:""}),"*")}}n.src.includes("player.vimeo.com")&&n.contentWindow.postMessage(JSON.stringify({method:"paused"}),"*")}}isIframeLikeElementCenter(t,n,a,i){return t&&!n.altKey&&!n.shiftKey&&!n.metaKey&&!n.ctrlKey&&(this.state.activeEmbeddable?.element!==t||this.state.activeEmbeddable?.state==="hover"||!this.state.activeEmbeddable)&&a>=t.x+t.width/3&&a<=t.x+2*t.width/3&&i>=t.y+t.height/3&&i<=t.y+2*t.height/3}renderEmbeddables(){let t=this.state.zoom.value,n=this.state.width,a=this.state.height,i=this.scene.getNonDeletedElements().filter(r=>pn(r)&&this.embedsValidationStatus.get(r.id)===!0||Ii(r));return h.jsx(h.Fragment,{children:i.map(r=>{let{x:s,y:o}=Rn({sceneX:r.x,sceneY:r.y},this.state),d=_c(r,n,a,this.state,this.scene.getNonDeletedElementsMap()),c=this.initializedEmbeds.has(r.id);if(d&&!c&&this.initializedEmbeds.add(r.id),!(d||c))return null;let l;if(Ii(r)){l=null;let p=(r.customData?.generationData??this.magicGenerations.get(r.id))||{status:"error",message:"No generation data",code:"ERR_NO_GENERATION_DATA"};if(p.status==="done"){let U=p.html;l={intrinsicSize:{w:r.width,h:r.height},type:"document",srcdoc:()=>U}}else if(p.status==="pending")l={intrinsicSize:{w:r.width,h:r.height},type:"document",srcdoc:()=>$l(`
66
+ <style>
67
+ html, body {
68
+ width: 100%;
69
+ height: 100%;
70
+ color: ${this.state.theme===Me.DARK?"white":"black"};
71
+ }
72
+ body {
73
+ display: flex;
74
+ align-items: center;
75
+ justify-content: center;
76
+ flex-direction: column;
77
+ gap: 1rem;
78
+ }
79
+
80
+ .Spinner {
81
+ display: flex;
82
+ align-items: center;
83
+ justify-content: center;
84
+ margin-left: auto;
85
+ margin-right: auto;
86
+ }
87
+
88
+ .Spinner svg {
89
+ animation: rotate 1.6s linear infinite;
90
+ transform-origin: center center;
91
+ width: 40px;
92
+ height: 40px;
93
+ }
94
+
95
+ .Spinner circle {
96
+ stroke: currentColor;
97
+ animation: dash 1.6s linear 0s infinite;
98
+ stroke-linecap: round;
99
+ }
100
+
101
+ @keyframes rotate {
102
+ 100% {
103
+ transform: rotate(360deg);
104
+ }
105
+ }
106
+
107
+ @keyframes dash {
108
+ 0% {
109
+ stroke-dasharray: 1, 300;
110
+ stroke-dashoffset: 0;
111
+ }
112
+ 50% {
113
+ stroke-dasharray: 150, 300;
114
+ stroke-dashoffset: -200;
115
+ }
116
+ 100% {
117
+ stroke-dasharray: 1, 300;
118
+ stroke-dashoffset: -280;
119
+ }
120
+ }
121
+ </style>
122
+ <div class="Spinner">
123
+ <svg
124
+ viewBox="0 0 100 100"
125
+ >
126
+ <circle
127
+ cx="50"
128
+ cy="50"
129
+ r="46"
130
+ stroke-width="8"
131
+ fill="none"
132
+ stroke-miter-limit="10"
133
+ />
134
+ </svg>
135
+ </div>
136
+ <div>Generating...</div>
137
+ `)};else{let U;p.code==="ERR_GENERATION_INTERRUPTED"?U="Generation was interrupted...":U=p.message||"Generation failed",l={intrinsicSize:{w:r.width,h:r.height},type:"document",srcdoc:()=>$l(`
138
+ <style>
139
+ html, body {
140
+ height: 100%;
141
+ }
142
+ body {
143
+ display: flex;
144
+ flex-direction: column;
145
+ align-items: center;
146
+ justify-content: center;
147
+ color: ${Ee.red[3]};
148
+ }
149
+ h1, h3 {
150
+ margin-top: 0;
151
+ margin-bottom: 0.5rem;
152
+ }
153
+ </style>
154
+ <h1>Error!</h1>
155
+ <h3>${U}</h3>
156
+ `)}}}else l=Us(s0(r.link||""));let u=this.state.activeEmbeddable?.element===r&&this.state.activeEmbeddable?.state==="active",f=this.state.activeEmbeddable?.element===r&&this.state.activeEmbeddable?.state==="hover";return h.jsx("div",{className:te("excalidraw__embeddable-container",{"is-hovered":f}),style:{transform:d?`translate(${s-this.state.offsetLeft}px, ${o-this.state.offsetTop}px) scale(${t})`:"none",display:d?"block":"none",opacity:Ab(r,yn(r,this.scene.getNonDeletedElementsMap()),this.elementsPendingErasure,null,this.state.openDialog?.name==="elementLinkSelector"?S5:1),"--embeddable-radius":`${la(Math.min(r.width,r.height),r)}px`},children:h.jsxs("div",{className:"excalidraw__embeddable-container__inner",style:{width:d?`${r.width}px`:0,height:d?`${r.height}px`:0,transform:d?`rotate(${r.angle}rad)`:"none",pointerEvents:u?Qr.enabled:Qr.disabled},children:[f&&h.jsx("div",{className:"excalidraw__embeddable-hint",children:S("buttons.embeddableInteractionButton")}),h.jsx("div",{className:"excalidraw__embeddable__outer",style:{padding:`${r.strokeWidth}px`},children:(pn(r)?this.props.renderEmbeddable?.(r,this.state):null)??h.jsx("iframe",{ref:p=>this.cacheEmbeddableRef(r,p),className:"excalidraw__embeddable",srcDoc:l?.type==="document"?l.srcdoc(this.state.theme):void 0,src:l?.type!=="document"?l?.link??"":void 0,scrolling:"no",referrerPolicy:"no-referrer-when-downgrade",title:"Excalidraw Embedded Content",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sandbox:`${l?.sandbox?.allowSameOrigin?"allow-same-origin":""} allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-downloads`})})]})},r.id)})})}toggleOverscrollBehavior(t){document.documentElement.style.overscrollBehaviorX=t.type==="pointerenter"?"none":"auto"}render(){let t=this.scene.getSelectedElements(this.state),{renderTopRightUI:n,renderCustomStats:a}=this.props,i=this.scene.getSceneNonce(),{elementsMap:r,visibleElements:s}=this.renderer.getRenderableElements({sceneNonce:i,zoom:this.state.zoom,offsetLeft:this.state.offsetLeft,offsetTop:this.state.offsetTop,scrollX:this.state.scrollX,scrollY:this.state.scrollY,height:this.state.height,width:this.state.width,editingTextElement:this.state.editingTextElement,newElementId:this.state.newElement?.id,pendingImageElementId:this.state.pendingImageElementId});this.visibleElements=s;let o=this.scene.getNonDeletedElementsMap(),d="setPointerCapture"in HTMLElement.prototype?!1:this.state.selectionElement||this.state.newElement||this.state.selectedElementsAreBeingDragged||this.state.resizingElement||this.state.activeTool.type==="laser"&&this.state.cursorButton==="down",c=t[0];return h.jsx("div",{className:te("excalidraw excalidraw-container",{"excalidraw--view-mode":this.state.viewModeEnabled||this.state.openDialog?.name==="elementLinkSelector","excalidraw--mobile":this.device.editor.isMobile}),style:{"--ui-pointerEvents":d?Qr.disabled:Qr.enabled,"--right-sidebar-width":"302px"},ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,onPointerEnter:this.toggleOverscrollBehavior,onPointerLeave:this.toggleOverscrollBehavior,children:h.jsx(xx.Provider,{value:this,children:h.jsx(vx.Provider,{value:this.props,children:h.jsx(bp.Provider,{value:this.excalidrawContainerValue,children:h.jsx(gp.Provider,{value:this.device,children:h.jsx(yp.Provider,{value:this.setAppState,children:h.jsx(vp.Provider,{value:this.state,children:h.jsxs(xp.Provider,{value:this.scene.getNonDeletedElements(),children:[h.jsxs(wp.Provider,{value:this.actionManager,children:[h.jsx(PH,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getNonDeletedElements(),onLockToggle:this.toggleLock,onPenModeToggle:this.togglePenMode,onHandToolToggle:this.onHandToolToggle,langCode:vo().code,renderTopRightUI:n,renderCustomStats:a,showExitZenModeBtn:typeof this.props?.zenModeEnabled>"u"&&this.state.zenModeEnabled,UIOptions:this.props.UIOptions,onExportImage:this.onExportImage,renderWelcomeScreen:!this.state.isLoading&&this.state.showWelcomeScreen&&this.state.activeTool.type==="selection"&&!this.state.zenModeEnabled&&!this.scene.getElementsIncludingDeleted().length,app:this,isCollaborating:this.props.isCollaborating,generateLinkForSelection:this.props.generateLinkForSelection,children:this.props.children}),h.jsx("div",{className:"excalidraw-textEditorContainer"}),h.jsx("div",{className:"excalidraw-contextMenuContainer"}),h.jsx("div",{className:"excalidraw-eye-dropper-container"}),h.jsx(mX,{trails:[this.laserTrails,this.eraserTrail]}),t.length===1&&this.state.openDialog?.name!=="elementLinkSelector"&&this.state.showHyperlinkPopup&&h.jsx(uF,{element:c,elementsMap:o,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen,setToast:this.setToast,updateEmbedValidationStatus:this.updateEmbedValidationStatus},c.id),this.props.aiEnabled!==!1&&t.length===1&&jd(c)&&h.jsx(c6,{element:c,elementsMap:r,children:h.jsx(Gh,{title:S("labels.convertToCode"),icon:lb,checked:!1,onChange:()=>this.onMagicFrameGenerate(c,"button")})}),t.length===1&&Ii(c)&&c.customData?.generationData?.status==="done"&&h.jsxs(c6,{element:c,elementsMap:r,children:[h.jsx(Gh,{title:S("labels.copySource"),icon:G1,checked:!1,onChange:()=>this.onIframeSrcCopy(c)}),h.jsx(Gh,{title:"Enter fullscreen",icon:rC,checked:!1,onChange:()=>{let l=this.getHTMLIFrameElement(c);if(l)try{l.requestFullscreen(),this.setState({activeEmbeddable:{element:c,state:"active"},selectedElementIds:{[c.id]:!0},newElement:null,selectionElement:null})}catch(u){console.warn(u),this.setState({errorMessage:"Couldn't enter fullscreen"})}}})]}),this.state.toast!==null&&h.jsx(OH,{message:this.state.toast.message,onClose:()=>this.setToast(null),duration:this.state.toast.duration,closable:this.state.toast.closable}),this.state.contextMenu&&h.jsx($z,{items:this.state.contextMenu.items,top:this.state.contextMenu.top,left:this.state.contextMenu.left,actionManager:this.actionManager,onClose:l=>{this.setState({contextMenu:null},()=>{this.focusContainer(),l?.()})}}),h.jsx(UX,{canvas:this.canvas,rc:this.rc,elementsMap:r,allElementsMap:o,visibleElements:s,sceneNonce:i,selectionNonce:this.state.selectionElement?.versionNonce,scale:window.devicePixelRatio,appState:this.state,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:Uo(this),canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:this.flowChartCreator.pendingNodes}}),this.state.newElement&&h.jsx(jX,{appState:this.state,scale:window.devicePixelRatio,rc:this.rc,elementsMap:r,allElementsMap:o,renderConfig:{imageCache:this.imageCache,isExporting:!1,renderGrid:!1,canvasBackgroundColor:this.state.viewBackgroundColor,embedsValidationStatus:this.embedsValidationStatus,elementsPendingErasure:this.elementsPendingErasure,pendingFlowchartNodes:null}}),h.jsx(hX,{containerRef:this.excalidrawContainerRef,canvas:this.interactiveCanvas,elementsMap:r,visibleElements:s,allElementsMap:o,selectedElements:t,sceneNonce:i,selectionNonce:this.state.selectionElement?.versionNonce,scale:window.devicePixelRatio,appState:this.state,device:this.device,renderInteractiveSceneCallback:this.renderInteractiveSceneCallback,handleCanvasRef:this.handleInteractiveCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick}),this.state.userToFollow&&h.jsx(yX,{width:this.state.width,height:this.state.height,userToFollow:this.state.userToFollow,onDisconnect:this.maybeUnfollowRemoteUser}),this.renderFrameNames()]}),this.renderEmbeddables()]})})})})})})})})}setPlugins(t){Object.assign(this.plugins,t)}async onMagicFrameGenerate(t,n){let a=this.plugins.diagramToCode?.generate;if(!a){this.setState({errorMessage:"No diagram to code plugin found"});return}let i=T0(this.scene.getNonDeletedElements(),t).filter(s=>!jd(s));if(!i.length){n==="button"?(this.setState({errorMessage:"Cannot generate from an empty frame"}),qe("ai","generate (no-children)","d2c")):this.setActiveTool({type:"magicframe"});return}let r=this.insertIframeElement({sceneX:t.x+t.width+30,sceneY:t.y,width:t.width,height:t.height});if(r){this.updateMagicGeneration({frameElement:r,data:{status:"pending"}}),this.setState({selectedElementIds:{[r.id]:!0}}),qe("ai","generate (start)","d2c");try{let{html:s}=await a({frame:t,children:i});if(qe("ai","generate (success)","d2c"),!s.trim()){this.updateMagicGeneration({frameElement:r,data:{status:"error",code:"ERR_OAI",message:"Nothing genereated :("}});return}let o=s.includes("<!DOCTYPE html>")&&s.includes("</html>")?s.slice(s.indexOf("<!DOCTYPE html>"),s.indexOf("</html>")+7):s;this.updateMagicGeneration({frameElement:r,data:{status:"done",html:o}})}catch(s){qe("ai","generate (failed)","d2c"),this.updateMagicGeneration({frameElement:r,data:{status:"error",code:"ERR_OAI",message:s.message||"Unknown error during generation"}})}}}onIframeSrcCopy(t){t.customData?.generationData?.status==="done"&&(Vs(t.customData.generationData.html),this.setToast({message:"copied to clipboard",closable:!1,duration:1500}))}clearImageShapeCache(t){let n=t??this.files;this.scene.getNonDeletedElements().forEach(a=>{Dn(a)&&n[a.fileId]&&(this.imageCache.delete(a.fileId),ut.delete(a))})}async componentDidMount(){this.unmounted=!1,this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,(be.MODE===bn.TEST||be.DEV)&&(this.setState.bind(this),Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:(...t)=>this.setState(...t)},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history},store:{configurable:!0,value:this.store},fonts:{configurable:!0,value:this.fonts}})),this.store.onStoreIncrementEmitter.on(t=>{this.history.record(t.elementsChange,t.appStateChange)}),this.scene.onUpdate(this.triggerRender),this.addEventListeners(),this.props.autoFocus&&this.excalidrawContainerRef.current&&this.focusContainer(),ri()||(this.refreshViewportBreakpoints(),this.refreshEditorBreakpoints()),ff&&this.excalidrawContainerRef.current&&(this.resizeObserver=new ResizeObserver(()=>{this.refreshEditorBreakpoints(),this.updateDOMRect()}),this.resizeObserver?.observe(this.excalidrawContainerRef.current)),new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene),mS()&&!Ek()&&this.setState({errorMessage:h.jsx(HH,{})})}componentWillUnmount(){window.launchQueue?.setConsumer(()=>{}),this.renderer.destroy(),this.scene.destroy(),this.scene=new ci,this.fonts=new ni(this.scene),this.renderer=new d6(this.scene),this.files={},this.imageCache.clear(),this.resizeObserver?.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.library.destroy(),this.laserTrails.stop(),this.eraserTrail.stop(),this.onChangeEmitter.clear(),this.store.onStoreIncrementEmitter.clear(),ut.destroy(),Ga.destroy(),clearTimeout(wi),_t.clearCache(),sn.clearCache(),wi=0,document.documentElement.style.overscrollBehaviorX=""}removeEventListeners(){this.onRemoveEventListenersEmitter.trigger()}addEventListeners(){this.removeEventListeners(),this.props.handleKeyboardGlobally&&this.onRemoveEventListenersEmitter.once(lt(document,"keydown",this.onKeyDown,!1)),this.onRemoveEventListenersEmitter.once(lt(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),lt(window,"message",this.onWindowMessage,!1),lt(document,"pointerup",this.removePointer,{passive:!1}),lt(document,"copy",this.onCopy,{passive:!1}),lt(document,"keyup",this.onKeyUp,{passive:!0}),lt(document,"pointermove",this.updateCurrentCursorPosition,{passive:!1}),lt(document.fonts,"loadingdone",t=>{let n=t.fontfaces;this.fonts.onLoaded(n)},{passive:!1}),lt(document,"gesturestart",this.onGestureStart,!1),lt(document,"gesturechange",this.onGestureChange,!1),lt(document,"gestureend",this.onGestureEnd,!1),lt(window,"focus",()=>{this.maybeCleanupAfterMissingPointerUp(null),this.triggerRender(!0)},{passive:!1})),!this.state.viewModeEnabled&&(this.onRemoveEventListenersEmitter.once(lt(document,"fullscreenchange",this.onFullscreenChange,{passive:!1}),lt(document,"paste",this.pasteFromClipboard,{passive:!1}),lt(document,"cut",this.onCut,{passive:!1}),lt(window,"resize",this.onResize,!1),lt(window,"unload",this.onUnload,!1),lt(window,"blur",this.onBlur,!1),lt(this.excalidrawContainerRef.current,"wheel",this.handleWheel,{passive:!1}),lt(this.excalidrawContainerRef.current,"dragover",this.disableEvent,!1),lt(this.excalidrawContainerRef.current,"drop",this.disableEvent,!1)),this.props.detectScroll&&this.onRemoveEventListenersEmitter.once(lt(ok(this.excalidrawContainerRef.current),"scroll",this.onScroll,{passive:!1})))}componentDidUpdate(t,n){this.updateEmbeddables();let a=this.scene.getElementsIncludingDeleted(),i=this.scene.getElementsMapIncludingDeleted(),r=this.scene.getNonDeletedElementsMap();!this.state.showWelcomeScreen&&!a.length&&this.setState({showWelcomeScreen:!0}),t.UIOptions.dockedSidebarBreakpoint!==this.props.UIOptions.dockedSidebarBreakpoint&&this.refreshEditorBreakpoints(),n.userToFollow&&!this.state.collaborators.has(n.userToFollow.socketId)&&this.maybeUnfollowRemoteUser(),(n.zoom.value!==this.state.zoom.value||n.scrollX!==this.state.scrollX||n.scrollY!==this.state.scrollY)&&(this.props?.onScrollChange?.(this.state.scrollX,this.state.scrollY,this.state.zoom),this.onScrollChangeEmitter.trigger(this.state.scrollX,this.state.scrollY,this.state.zoom)),n.userToFollow!==this.state.userToFollow&&(n.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:n.userToFollow,action:"UNFOLLOW"}),this.state.userToFollow&&this.onUserFollowEmitter.trigger({userToFollow:this.state.userToFollow,action:"FOLLOW"})),Object.keys(this.state.selectedElementIds).length&&Ea(this.state)&&this.setState({activeTool:Et(this.state,{type:"selection"})}),this.state.activeTool.type==="eraser"&&n.theme!==this.state.theme&&c8(this.interactiveCanvas,this.state.theme),n.activeTool.type==="selection"&&this.state.activeTool.type!=="selection"&&this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),t.langCode!==this.props.langCode&&this.updateLanguage(),Ea(n)&&!Ea(this.state)&&this.eraserTrail.endPath(),t.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),n.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),(n.openDialog?.name==="elementLinkSelector"||this.state.openDialog?.name==="elementLinkSelector")&&n.openDialog?.name!==this.state.openDialog?.name&&(this.deselectElements(),this.setState({hoveredElementIds:{}})),t.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),t.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),this.excalidrawContainerRef.current?.classList.toggle("theme--dark",this.state.theme===Me.DARK),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout(()=>{this.state.editingLinearElement&&this.actionManager.executeAction(Zn)}),this.state.editingTextElement?.isDeleted&&this.setState({editingTextElement:null}),this.state.selectedLinearElement&&!this.state.selectedElementIds[this.state.selectedLinearElement.elementId]&&this.setState({selectedLinearElement:null});let{multiElement:s}=n;n.activeTool!==this.state.activeTool&&s!=null&&gr(this.state)&&_a(s,!1)&&Af(s,this.state,ta(J.getPointAtIndexGlobalCoordinates(s,-1,r)),this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.store.commit(i,this.state),this.state.isLoading||(this.props.onChange?.(a,this.state,this.files),this.onChangeEmitter.trigger(a,this.state,this.files))}static resetTapTwice(){fl=!1}async addElementsFromMixedContentPaste(t,{isPlainPaste:n,sceneX:a,sceneY:i}){if(!n&&t.some(r=>r.type==="imageUrl")&&this.isToolSupported("image")){let r=t.filter(u=>u.type==="imageUrl").map(u=>u.value),s=await Promise.all(r.map(async u=>{try{return{file:await iP(u)}}catch(f){let p=f.message;return f.cause==="FETCH_ERROR"?p=S("errors.failedToFetchImage"):f.cause==="UNSUPPORTED"&&(p=S("errors.unsupportedFileType")),{errorMessage:p}}})),o=i,d=!1,c={};for(let u of s)if(u.file){let f=this.createImageElement({sceneX:a,sceneY:o}),p=await this.insertImageElement(f,u.file);p&&(d||(d=!0,o-=p.height/2),X(p,{y:o},!1),o=f.y+f.height+25,c[f.id]=!0)}this.setState({selectedElementIds:Le(c,this.state)});let l=s.find(u=>!!u.errorMessage);l&&l.errorMessage&&this.setState({errorMessage:l.errorMessage})}else{let r=t.filter(s=>s.type==="text");r.length&&this.addTextFromPaste(r.map(s=>s.value).join(`
157
+
158
+ `),n)}}addTextFromPaste(t,n=!1){let{x:a,y:i}=Ge({clientX:this.lastViewportPosition.x,clientY:this.lastViewportPosition.y},this.state),r={x:a,y:i,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roundness:null,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,text:t,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:Io,verticalAlign:nc,locked:!1},s=Xe({fontSize:r.fontSize,fontFamily:r.fontFamily}),o=Nr(r.fontFamily),[d,,c]=Bb(this.state),l=Math.max(Math.min((c-d)*.5,800),200),u=10,f=i,p=n?[t]:t.split(`
159
+ `),U=p.reduce((m,g,b)=>{let v=_s(g).trim();if(v.length){let x=this.getTopLayerFrameAtSceneCoords({x:a,y:f}),y=nn(v,s,o),w=y.width>l,k=w?Vr(v,s,l):v;y=w?nn(k,s,o):y;let M=a-y.width/2,I=f-y.height/2,A=Cn({...r,x:M,y:I,text:k,originalText:v,lineHeight:o,autoResize:!w,frameId:x?x.id:null});m.push(A),f+=A.height+u}else p[b-1]?.trim()&&(f+=Ao(r.fontSize,o)+u);return m},[]);U.length!==0&&(this.scene.insertElements(U),this.setState({selectedElementIds:Le(Object.fromEntries(U.map(m=>[m.id,!0])),this.state)}),!n&&U.length>1&&h6===!1&&!this.device.editor.isMobile&&(this.setToast({message:S("toast.pasteAsSingleElement",{shortcut:H("CtrlOrCmd+Shift+V")}),duration:5e3}),h6=!0),this.store.shouldCaptureIncrement())}handleTextWysiwyg(t,{isExistingElement:n=!1}){let a=this.scene.getElementsMapIncludingDeleted(),i=(r,s)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map(o=>o.id===t.id&&q(o)?pe(o,{originalText:r,isDeleted:s??o.isDeleted,...h8(o,zt(o,a),a,r)}):o)])};kX({id:t.id,canvas:this.canvas,getViewportCoords:(r,s)=>{let{x:o,y:d}=Rn({sceneX:r,sceneY:s},this.state);return[o-this.state.offsetLeft,d-this.state.offsetTop]},onChange:ht(r=>{i(r,!1),Wf(t)&&xn(t,this.scene.getNonDeletedElementsMap())}),onSubmit:ht(({viaKeyboard:r,nextOriginalText:s})=>{let o=!s.trim();if(i(s,o),!o&&r){let d=t.containerId?t.containerId:t.id;Kt.flushSync(()=>{this.setState(c=>({selectedElementIds:Le({...c.selectedElementIds,[d]:!0},c)}))})}o&&Yb(this.scene.getNonDeletedElements(),[t]),(!o||n)&&this.store.shouldCaptureIncrement(),Kt.flushSync(()=>{this.setState({newElement:null,editingTextElement:null})}),this.state.activeTool.locked&&wa(this.interactiveCanvas,this.state),this.focusContainer()}),element:t,excalidrawContainer:this.excalidrawContainerRef.current,app:this,autoSelect:!this.device.isTouchScreen}),this.deselectElements(),i(t.originalText,!1)}deselectElements(){this.setState({selectedElementIds:Le({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null})}getTextElementAtPosition(t,n){let a=this.getElementAtPosition(t,n,{includeBoundTextElement:!0});return a&&q(a)&&!a.isDeleted?a:null}getElementAtPosition(t,n,a){let i=this.getElementsAtPosition(t,n,a?.includeBoundTextElement,a?.includeLockedElements);if(i.length>1){if(a?.preferSelected){for(let s=i.length-1;s>-1;s--)if(this.state.selectedElementIds[i[s].id])return i[s]}let r=i[i.length-1];return ls({x:t,y:n,element:r,shape:Ka(r,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()/2,frameNameBound:de(r)?this.frameNameBoundsCache.get(r):null})?r:i[i.length-2]}return i.length===1?i[0]:null}getElementsAtPosition(t,n,a=!1,i=!1){let r=[],s=this.scene.getNonDeletedElementsMap();return(a&&i?this.scene.getNonDeletedElements():this.scene.getNonDeletedElements().filter(o=>(i||!o.locked)&&(a||!(q(o)&&o.containerId)))).filter(o=>this.hitElement(t,n,o)).filter(o=>{let d=yn(o,s);return d&&this.state.frameRendering.enabled&&this.state.frameRendering.clip?Um({x:t,y:n},d,s):!0}).filter(o=>Ii(o)?(r.push(o),!1):!0).concat(r)}getElementHitThreshold(){return yS/this.state.zoom.value}hitElement(t,n,a,i=!0){if(i&&this.state.selectedElementIds[a.id]&&l7([a],this.state)){let r=oA(a,this.scene.getNonDeletedElementsMap(),Re(a)?0:this.getElementHitThreshold());if(mc(E(t,n),r))return!0}return Eb(t,n,kb(a,this.scene.getNonDeletedElementsMap()))?!0:ls({x:t,y:n,element:a,shape:Ka(a,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:de(a)?this.frameNameBoundsCache.get(a):null})}getTextBindableContainerAtPosition(t,n){let a=this.scene.getNonDeletedElements(),i=this.scene.getSelectedElements(this.state);if(i.length===1)return wr(i[0],!1)?i[0]:null;let r=null;for(let s=a.length-1;s>=0;--s){if(a[s].isDeleted)continue;let[o,d,c,l]=fe(a[s],this.scene.getNonDeletedElementsMap());if(ve(a[s])&&ls({x:t,y:n,element:a[s],shape:Ka(a[s],this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold()})){r=a[s];break}else if(o<t&&t<c&&d<n&&n<l){r=a[s];break}}return wr(r,!1)?r:null}handleHoverSelectedLinearElement(t,n,a){let i=this.scene.getNonDeletedElementsMap(),r=J.getElement(t.elementId,i);if(r)if(this.state.selectedLinearElement){let s=-1,o=null;ls({x:n,y:a,element:r,shape:Ka(r,this.scene.getNonDeletedElementsMap())})?(s=J.getPointIndexUnderCursor(r,i,this.state.zoom,n,a),o=J.getSegmentMidpointHitCoords(t,{x:n,y:a},this.state,this.scene.getNonDeletedElementsMap()),(Q(r)?s===0||s===r.points.length-1:s>=0)||o?He(this.interactiveCanvas,Fe.POINTER):this.hitElement(n,a,r)&&He(this.interactiveCanvas,Fe.MOVE)):this.hitElement(n,a,r)&&(!Q(r)||!(r.startBinding||r.endBinding))&&He(this.interactiveCanvas,Fe.MOVE),this.state.selectedLinearElement.hoverPointIndex!==s&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,hoverPointIndex:s}}),J.arePointsEqual(this.state.selectedLinearElement.segmentMidPointHoveredCoords,o)||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:o}})}else He(this.interactiveCanvas,Fe.AUTO)}updateGestureOnPointerDown(t){De.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY}),De.pointers.size===2&&(De.lastCenter=Lg(De.pointers),De.initialScale=this.state.zoom.value,De.initialDistance=Rg(Array.from(De.pointers.values())))}initialPointerDownState(t){let n=Ge(t,this.state),a=this.scene.getSelectedElements(this.state),[i,r,s,o]=Ne(a),d=a.findIndex(Q)===0;return{origin:n,withCmdOrCtrl:t[D.CTRL_OR_CMD],originInGrid:ta(Ct(n.x,n.y,t[D.CTRL_OR_CMD]||d?null:this.getEffectiveGridSize())),scrollbars:$g(Kh,t.clientX-this.state.offsetLeft,t.clientY-this.state.offsetTop),lastCoords:{...n},originalElements:this.scene.getNonDeletedElements().reduce((c,l)=>(c.set(l.id,Gr(l)),c),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(s+i)/2,y:(o+r)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(n,a)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(t,n){if(!(n.scrollbars.isOverEither&&!this.state.multiElement))return!1;Yh=!0,n.lastCoords.x=t.clientX,n.lastCoords.y=t.clientY;let a=Xh(r=>{r.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(r,n)}),i=ht(()=>{ml=null,Yh=!1,wa(this.interactiveCanvas,this.state),this.setState({cursorButton:"up"}),this.savePointer(t.clientX,t.clientY,"up"),window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",i),a.flush()});return ml=i,window.addEventListener("pointermove",a),window.addEventListener("pointerup",i),!0}isASelectedElement(t){return t!=null&&this.state.selectedElementIds[t.id]}isHittingCommonBoundingBoxOfSelectedElements(t,n){if(n.length<2)return!1;let a=this.getElementHitThreshold(),[i,r,s,o]=Ne(n);return t.x>i-a&&t.x<s+a&&t.y>r-a&&t.y<o+a}getCurrentItemRoundness(t){return this.state.currentItemRoundness==="round"?{type:Xs(t)?St.ADAPTIVE_RADIUS:St.PROPORTIONAL_RADIUS}:null}maybeCacheReferenceSnapPoints(t,n,a=!1){Wi({event:t,app:this,selectedElements:n})&&(a||!Ga.getReferenceSnapPoints())&&Ga.setReferenceSnapPoints(BD(this.scene.getNonDeletedElements(),n,this.state,this.scene.getNonDeletedElementsMap()))}maybeCacheVisibleGaps(t,n,a=!1){Wi({event:t,app:this,selectedElements:n})&&(a||!Ga.getVisibleGaps())&&Ga.setVisibleGaps(zD(this.scene.getNonDeletedElements(),n,this.state,this.scene.getNonDeletedElementsMap()))}onKeyDownFromPointerDownHandler(t){return ht(n=>{this.maybeHandleResize(t,n)||this.maybeDragNewGenericElement(t,n)})}onKeyUpFromPointerDownHandler(t){return ht(n=>{n.key===D.ALT&&n.preventDefault(),!this.maybeHandleResize(t,n)&&this.maybeDragNewGenericElement(t,n)})}onPointerMoveFromPointerDownHandler(t){return Xh(n=>{if(this.state.openDialog?.name==="elementLinkSelector")return;let a=Ge(n,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.elbowed&&this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index){let[l,u]=Ct(a.x,a.y,n[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),f=this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index;if(f<0){let U=J.getSegmentMidpointHitCoords({...this.state.selectedLinearElement,segmentMidPointHoveredCoords:null},{x:l,y:u},this.state,this.scene.getNonDeletedElementsMap());f=U?J.getSegmentMidPointIndex(this.state.selectedLinearElement,this.state,U,this.scene.getNonDeletedElementsMap()):-1}let p=J.moveFixedSegment(this.state.selectedLinearElement,f,l,u,this.scene.getNonDeletedElementsMap());Kt.flushSync(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,segmentMidPointHoveredCoords:p.segmentMidPointHoveredCoords,pointerDownState:p.pointerDownState}})});return}let i=this.lastPointerMoveCoords??t.origin;if(this.lastPointerMoveCoords=a,t.drag.offset===null&&(t.drag.offset=ta(YR(this.scene.getSelectedElements(this.state),t.origin.x,t.origin.y))),!(n.target instanceof HTMLElement)||this.handlePointerMoveOverScrollbars(n,t))return;if(Ea(this.state)){this.handleEraser(n,t,a);return}this.state.activeTool.type==="laser"&&this.laserTrails.addPointToPath(a.x,a.y);let[r,s]=Ct(a.x,a.y,n[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize());if(!t.drag.hasOccurred&&(this.state.activeTool.type==="arrow"||this.state.activeTool.type==="line")&&Pe(E(a.x,a.y),E(t.origin.x,t.origin.y))<or)return;if(t.resize.isResizing&&(t.lastCoords.x=a.x,t.lastCoords.y=a.y,this.maybeHandleCrop(t,n)||this.maybeHandleResize(t,n)))return!0;let o=this.scene.getNonDeletedElementsMap();if(this.state.selectedLinearElement){let l=this.state.editingLinearElement||this.state.selectedLinearElement;if(J.shouldAddMidpoint(this.state.selectedLinearElement,a,this.state,o)){let u=J.addMidpoint(this.state.selectedLinearElement,a,this,!n[D.CTRL_OR_CMD],o);if(!u)return;Kt.flushSync(()=>{this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...this.state.selectedLinearElement,pointerDownState:u.pointerDownState,selectedPointsIndices:u.selectedPointsIndices}}),this.state.editingLinearElement&&this.setState({editingLinearElement:{...this.state.editingLinearElement,pointerDownState:u.pointerDownState,selectedPointsIndices:u.selectedPointsIndices}})});return}else if(l.pointerDownState.segmentMidpoint.value!==null&&!l.pointerDownState.segmentMidpoint.added)return;if(J.handlePointDragging(n,this,a.x,a.y,(u,f)=>{this.maybeSuggestBindingsForLinearElementAtCoords(u,f)},l,this.scene)){t.lastCoords.x=a.x,t.lastCoords.y=a.y,t.drag.hasOccurred=!0,this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging&&this.setState({editingLinearElement:{...this.state.editingLinearElement,isDragging:!0}}),this.state.selectedLinearElement.isDragging||this.setState({selectedLinearElement:{...this.state.selectedLinearElement,isDragging:!0}});return}}let d=t.hit.allHitElements.some(l=>this.isASelectedElement(l)),c=this.state.editingLinearElement&&n.shiftKey&&this.state.editingLinearElement.elementId===t.hit.element?.id;if((d||t.hit.hasHitCommonBoundingBoxOfSelectedElements)&&!c){let l=this.scene.getSelectedElements(this.state);if(l.every(U=>U.locked))return;let u=l.find(U=>de(U)),f=this.getTopLayerFrameAtSceneCoords(a),p=f&&!u?f:null;if(this.state.frameToHighlight!==p&&Kt.flushSync(()=>{this.setState({frameToHighlight:p})}),t.drag.hasOccurred=!0,l.length>0&&!t.withCmdOrCtrl&&!this.state.editingTextElement&&this.state.activeEmbeddable?.state!=="active"){let U={x:a.x-t.origin.x,y:a.y-t.origin.y},m=[...t.originalElements.values()],g=n.shiftKey;if(g){let x=Math.abs(U.x),y=Math.abs(U.y),w=g&&x<y,k=g&&x>y;w&&(U.x=0),k&&(U.y=0)}if(this.state.croppingElementId){let x=this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);if(x&&Re(x)&&x.crop!==null&&t.hit.element===x){let y=x.crop,w=Dn(x)&&this.imageCache.get(x.fileId)?.image;if(w&&!(w instanceof Promise)){let k=Ut(Ht(a.x-i.x,a.y-i.y),Math.max(this.state.zoom.value,2)),[M,I,A,_,T,L]=fe(x,o),R=ie(z(E(M,I),E(T,L),x.angle)),F=ie(z(E(A,I),E(T,L),x.angle)),P=ie(z(E(M,_),E(T,L),x.angle)),$=Qt(oc(F,R)),O=Qt(oc(P,R)),V=Ht(VU(k,$),VU(k,O)),W={...y,x:Se(y.x-V[0]*Math.sign(x.scale[0]),0,w.naturalWidth-y.width),y:Se(y.y-V[1]*Math.sign(x.scale[1]),0,w.naturalHeight-y.height)};X(x,{crop:W});return}}}this.maybeCacheVisibleGaps(n,l),this.maybeCacheReferenceSnapPoints(n,l);let{snapOffset:b,snapLines:v}=HD(m,U,this,n,this.scene.getNonDeletedElementsMap());if(this.setState({snapLines:v}),this.state.editingFrame||GR(t,l,U,this.scene,b,n[D.CTRL_OR_CMD]?null:this.getEffectiveGridSize()),this.setState({selectedElementsAreBeingDragged:!0,selectionElement:null}),(l.length!==1||!Q(l[0]))&&this.setState({suggestedBindings:xh(l,this.scene.getNonDeletedElementsMap(),this.state.zoom)}),n.altKey&&!t.hit.hasBeenDuplicated){t.hit.hasBeenDuplicated=!0;let x=[],y=[],w=new Map,k=new Map,M=t.hit.element,I=new Set(this.scene.getSelectedElements({selectedElementIds:this.state.selectedElementIds,includeBoundTextElement:!0,includeElementsInFrames:!0}).map(T=>T.id)),A=this.scene.getElementsIncludingDeleted();for(let T of A){let L=I.has(T.id)||T.id===M?.id&&t.hit.wasAddedToSelection;if(Math.abs(T.x)>1e7||Math.abs(T.x)>1e7||Math.abs(T.width)>1e7||Math.abs(T.height)>1e7){console.error("Alt+dragging element in scene with invalid dimensions",T.x,T.y,T.width,T.height,L);return}if(L){let R=U8(this.state.editingGroupId,w,T);if(Math.abs(R.x)>1e7||Math.abs(R.x)>1e7||Math.abs(R.width)>1e7||Math.abs(R.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",R.x,R.y,R.width,R.height);return}let F=t.originalElements.get(T.id);if(Math.abs(F.x)>1e7||Math.abs(F.x)>1e7||Math.abs(F.width)>1e7||Math.abs(F.height)>1e7){console.error("Alt+dragging duplicated element with invalid dimensions",F.x,F.y,F.width,F.height);return}X(R,{x:F.x,y:F.y}),t.originalElements.set(R.id,R),x.push(R),y.push(T),k.set(T.id,R.id)}else x.push(T)}let _=[...x,...y];_=this.props.onDuplicate?.(_,A)||_,Na(_,oe(y)),r8(x,y,k),Zb(_,y,k,"duplicatesServeAsOld"),K8(_,y,k),this.scene.replaceAllElements(_),this.maybeCacheVisibleGaps(n,l,!0),this.maybeCacheReferenceSnapPoints(n,l,!0)}return}}if(this.state.selectionElement)t.lastCoords.x=a.x,t.lastCoords.y=a.y,this.maybeDragNewGenericElement(t,n);else{let l=this.state.newElement;if(!l)return;if(l.type==="freedraw"){let u=l.points,f=a.x-l.x,p=a.y-l.y,U=u.length>0&&u[u.length-1];if(!(U&&U[0]===f&&U[1]===p)){let m=l.simulatePressure?l.pressures:[...l.pressures,n.pressure];X(l,{points:[...u,E(f,p)],pressures:m},!1),this.setState({newElement:l})}}else if(ue(l)){t.drag.hasOccurred=!0;let u=l.points,f=r-l.x,p=s-l.y;Ol(n)&&u.length===2&&({width:f,height:p}=Hf(l.x,l.y,a.x,a.y)),u.length===1?X(l,{points:[...u,E(f,p)]},!1):(u.length===2||u.length>1&&Q(l))&&X(l,{points:[...u.slice(0,-1),E(f,p)]},!1,{isDragging:!0}),this.setState({newElement:l}),_a(l,!1)&&this.maybeSuggestBindingsForLinearElementAtCoords(l,[a],this.state.startBoundElement)}else t.lastCoords.x=a.x,t.lastCoords.y=a.y,this.maybeDragNewGenericElement(t,n,!1)}if(this.state.activeTool.type==="selection"){t.boxSelection.hasOccurred=!0;let l=this.scene.getNonDeletedElements();if(this.state.editingLinearElement)J.handleBoxSelection(n,this.state,this.setState.bind(this),this.scene.getNonDeletedElementsMap());else{let u=!0;!n.shiftKey&&_t(l,this.state)&&(t.withCmdOrCtrl&&t.hit.element?this.setState(p=>sn({...p,selectedElementIds:{[t.hit.element.id]:!0}},this.scene.getNonDeletedElements(),p,this)):u=!1);let f=this.state.selectionElement?A0(l,this.state.selectionElement,this.scene.getNonDeletedElementsMap(),!1):[];this.setState(p=>{let U={...u&&p.selectedElementIds,...f.reduce((m,g)=>(m[g.id]=!0,m),{})};return t.hit.element&&(f.length?delete U[t.hit.element.id]:U[t.hit.element.id]=!0),p=u?p:{...p,selectedGroupIds:{},editingGroupId:null},{...sn({editingGroupId:p.editingGroupId,selectedElementIds:U},this.scene.getNonDeletedElements(),p,this),selectedLinearElement:f.length===1&&ue(f[0])?new J(f[0]):null,showHyperlinkPopup:f.length===1&&(f[0].link||pn(f[0]))?"info":!1}})}}})}handlePointerMoveOverScrollbars(t,n){if(n.scrollbars.isOverHorizontal){let a=t.clientX,i=a-n.lastCoords.x;return this.translateCanvas({scrollX:this.state.scrollX-i/this.state.zoom.value}),n.lastCoords.x=a,!0}if(n.scrollbars.isOverVertical){let a=t.clientY,i=a-n.lastCoords.y;return this.translateCanvas({scrollY:this.state.scrollY-i/this.state.zoom.value}),n.lastCoords.y=a,!0}return!1}onPointerUpFromPointerDownHandler(t){return ht(n=>{this.removePointer(n),t.eventListeners.onMove&&t.eventListeners.onMove.flush();let{newElement:a,resizingElement:i,croppingElementId:r,multiElement:s,activeTool:o,isResizing:d,isRotating:c,isCropping:l}=this.state;this.setState(m=>({isResizing:!1,isRotating:!1,isCropping:!1,resizingElement:null,selectionElement:null,frameToHighlight:null,elementsToHighlight:null,cursorButton:"up",snapLines:rl(m.snapLines,[]),originSnapOffset:null})),this.lastPointerMoveCoords=null,Ga.setReferenceSnapPoints(null),Ga.setVisibleGaps(null),this.savePointer(n.clientX,n.clientY,"up"),this.setState({selectedElementsAreBeingDragged:!1});let u=this.scene.getNonDeletedElementsMap();if(t.drag.hasOccurred&&t.hit?.element?.id){let m=u.get(t.hit.element.id);ua(m)&&m.boundElements?.filter(g=>g.type==="arrow").map(g=>u.get(g.id)).filter(g=>Q(g)).forEach(g=>{g&&X(g,{},!0)})}if(this.state.editingLinearElement)if(!t.boxSelection.hasOccurred&&t.hit?.element?.id!==this.state.editingLinearElement.elementId)this.actionManager.executeAction(Zn);else{let m=J.handlePointerUp(n,this.state.editingLinearElement,this.state,this.scene);m!==this.state.editingLinearElement&&this.setState({editingLinearElement:m,suggestedBindings:[]})}else if(this.state.selectedLinearElement){if(this.state.selectedLinearElement.elbowed){let m=J.getElement(this.state.selectedLinearElement.elementId,this.scene.getNonDeletedElementsMap());m&&X(m,{},!0)}if(t.hit?.element?.id!==this.state.selectedLinearElement.elementId)this.scene.getSelectedElements(this.state).length>1&&this.setState({selectedLinearElement:null});else{let m=J.handlePointerUp(n,this.state.selectedLinearElement,this.state,this.scene),{startBindingElement:g,endBindingElement:b}=m,v=this.scene.getElement(m.elementId);_a(v)&&ou(v,g,b,u,this.scene),m!==this.state.selectedLinearElement&&this.setState({selectedLinearElement:{...m,selectedPointsIndices:null},suggestedBindings:[]})}}if(this.missingPointerEventCleanupEmitter.clear(),window.removeEventListener("pointermove",t.eventListeners.onMove),window.removeEventListener("pointerup",t.eventListeners.onUp),window.removeEventListener("keydown",t.eventListeners.onKeyDown),window.removeEventListener("keyup",t.eventListeners.onKeyUp),this.state.pendingImageElementId&&this.setState({pendingImageElementId:null}),this.props?.onPointerUp?.(o,t),this.onPointerUpEmitter.trigger(this.state.activeTool,t,n),a?.type==="freedraw"){let m=Ge(n,this.state),g=a.points,b=m.x-a.x,v=m.y-a.y;b===g[0][0]&&v===g[0][1]&&(v+=1e-4,b+=1e-4);let x=a.simulatePressure?[]:[...a.pressures,n.pressure];X(a,{points:[...g,E(b,v)],pressures:x,lastCommittedPoint:E(b,v)}),this.actionManager.executeAction(Zn);return}if(Re(a)){let m=a;try{this.initializeImageDimensions(m),this.setState({selectedElementIds:Le({[m.id]:!0},this.state)},()=>{this.actionManager.executeAction(Zn)})}catch(g){console.error(g),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter(b=>b.id!==m.id)),this.actionManager.executeAction(Zn)}return}if(ue(a)){a.points.length>1&&this.store.shouldCaptureIncrement();let m=Ge(n,this.state);!t.drag.hasOccurred&&a&&!s?(X(a,{points:[...a.points,E(m.x-a.x,m.y-a.y)]}),this.setState({multiElement:a,newElement:a})):t.drag.hasOccurred&&!s&&(gr(this.state)&&_a(a,!1)&&Af(a,this.state,m,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements()),this.setState({suggestedBindings:[],startBoundElement:null}),o.locked?this.setState(g=>({newElement:null})):(Kn(this.interactiveCanvas),this.setState(g=>({newElement:null,activeTool:Et(this.state,{type:"selection"}),selectedElementIds:Le({...g.selectedElementIds,[a.id]:!0},g),selectedLinearElement:new J(a)}))),this.scene.triggerUpdate());return}if(q(a)){let m=$1(Xe({fontSize:a.fontSize,fontFamily:a.fontFamily}),a.lineHeight);a.width<m&&X(a,{autoResize:!0}),this.resetCursor(),this.handleTextWysiwyg(a,{isExistingElement:!0})}if(o.type!=="selection"&&a&&Fr(a)){this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(m=>m.id!==a.id),appState:{newElement:null},captureUpdate:B.NEVER});return}if(de(a)){let m=CR(this.scene.getElementsIncludingDeleted(),a,this.scene.getNonDeletedElementsMap());this.scene.replaceAllElements(Fl(this.scene.getElementsMapIncludingDeleted(),m,a,this.state))}if(a&&(X(a,i7(a)),this.scene.triggerUpdate()),t.drag.hasOccurred){let m=Ge(n,this.state);if(this.state.selectedLinearElement&&this.state.selectedLinearElement.isDragging){let g=this.scene.getElement(this.state.selectedLinearElement.elementId);if(g?.frameId){let b=yn(g,u);b&&g&&(Gi(g,b,this.scene.getNonDeletedElementsMap())||(X(g,{groupIds:[]}),xu([g],this.scene.getNonDeletedElementsMap()),this.scene.triggerUpdate()))}}else{let g=this.getTopLayerFrameAtSceneCoords(m),b=this.scene.getSelectedElements(this.state),v=this.scene.getElementsMapIncludingDeleted(),x=y=>{if(y.length>0){for(let w of y){let k=w.groupIds.indexOf(this.state.editingGroupId);X(w,{groupIds:w.groupIds.slice(0,k)},!1)}v.forEach(w=>{w.groupIds.length&&tt(v,w.groupIds[w.groupIds.length-1]).length<2&&X(w,{groupIds:[]},!1)}),this.setState({editingGroupId:null})}};if(g&&!this.state.selectedElementIds[g.id]){let y=b.filter(w=>w.frameId!==g.id&&Ic(w,v,this.state));this.state.editingGroupId&&x(y),v=Fl(v,y,g,this.state)}else if(!g&&this.state.editingGroupId){let y=b.filter(w=>w.frameId&&!Ic(w,v,this.state));x(y)}v=Ns(v,this.state,this),this.scene.replaceAllElements(v)}}if(i&&this.store.shouldCaptureIncrement(),i&&Fr(i)&&this.updateScene({elements:this.scene.getElementsIncludingDeleted().filter(m=>m.id!==i.id),captureUpdate:B.NEVER}),t.resize.isResizing){let m=Ns(this.scene.getElementsIncludingDeleted(),this.state,this),g=this.scene.getSelectedElements(this.state).filter(b=>de(b));for(let b of g)m=Q8(m,Fd(this.scene.getElementsIncludingDeleted(),b,this.state,u),b,this);this.scene.replaceAllElements(m)}let f=t.hit.element;this.state.selectedLinearElement?.elementId!==f?.id&&ue(f)&&this.scene.getSelectedElements(this.state).length===1&&this.setState({selectedLinearElement:new J(f)}),(!r||r&&(!f&&!l||f&&f.id!==r))&&this.finishImageCropping();let p=this.lastPointerDownEvent,U=this.lastPointerUpEvent||this.lastPointerMoveEvent;if(Ea(this.state)&&p&&U){if(this.eraserTrail.endPath(),Pe(E(p.clientX,p.clientY),E(U.clientX,U.clientY))===0){let m=Ge({clientX:U.clientX,clientY:U.clientY},this.state);this.getElementsAtPosition(m.x,m.y).forEach(g=>this.elementsPendingErasure.add(g.id))}this.eraseElements();return}else this.elementsPendingErasure.size&&this.restoreReadyToEraseElements();if(f&&!t.drag.hasOccurred&&!t.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!t.boxSelection.hasOccurred)&&(n.shiftKey&&!this.state.editingLinearElement?this.state.selectedElementIds[f.id]?Qb(this.state,f)?this.setState(m=>{let g={...m.selectedElementIds};for(let b of f.groupIds.flatMap(v=>tt(this.scene.getNonDeletedElements(),v)))delete g[b.id];return{selectedGroupIds:{...m.selectedElementIds,...f.groupIds.map(b=>({[b]:!1})).reduce((b,v)=>({...b,...v}),{})},selectedElementIds:Le(g,m)}}):this.state.selectedLinearElement?.isDragging||this.setState(m=>{let g={...m.selectedElementIds};delete g[f.id];let b=xe(this.scene.getNonDeletedElements(),{selectedElementIds:g});return{...sn({editingGroupId:m.editingGroupId,selectedElementIds:g},this.scene.getNonDeletedElements(),m,this),selectedLinearElement:b.length===1&&ue(b[0])?new J(b[0]):m.selectedLinearElement}}):f.frameId&&this.state.selectedElementIds[f.frameId]?this.setState(m=>{let g={...m.selectedElementIds,[f.id]:!0};return delete g[f.frameId],(this.scene.getElement(f.frameId)?.groupIds??[]).flatMap(b=>tt(this.scene.getNonDeletedElements(),b)).forEach(b=>{delete g[b.id]}),{...sn({editingGroupId:m.editingGroupId,selectedElementIds:g},this.scene.getNonDeletedElements(),m,this),showHyperlinkPopup:f.link||pn(f)?"info":!1}}):this.setState(m=>({selectedElementIds:Le({...m.selectedElementIds,[f.id]:!0},m)})):this.setState(m=>({...sn({editingGroupId:m.editingGroupId,selectedElementIds:{[f.id]:!0}},this.scene.getNonDeletedElements(),m,this),selectedLinearElement:ue(f)&&m.selectedLinearElement?.elementId!==f.id?new J(f):m.selectedLinearElement}))),!(f&&Q(f))&&!t.drag.hasOccurred&&!this.state.isResizing&&(f&&wA({x:t.origin.x,y:t.origin.y,element:f,shape:Ka(f,this.scene.getNonDeletedElementsMap()),threshold:this.getElementHitThreshold(),frameNameBound:de(f)?this.frameNameBoundsCache.get(f):null},u)||!f&&t.hit.hasHitCommonBoundingBoxOfSelectedElements)){this.state.editingLinearElement?this.setState({editingLinearElement:null}):this.setState({selectedElementIds:Le({},this.state),selectedGroupIds:{},editingGroupId:null,activeEmbeddable:null}),He(this.interactiveCanvas,Fe.AUTO);return}if(!o.locked&&o.type!=="freedraw"&&a&&this.setState(m=>({selectedElementIds:Le({...m.selectedElementIds,[a.id]:!0},m),showHyperlinkPopup:pn(a)&&!a.link?"editor":m.showHyperlinkPopup})),(o.type!=="selection"||_t(this.scene.getNonDeletedElements(),this.state)||!Wt(this.state.previousSelectedElementIds,this.state.selectedElementIds))&&this.store.shouldCaptureIncrement(),t.drag.hasOccurred||d||c||l){let m=this.scene.getSelectedElements(this.state).filter(ue);xc(m,this.scene.getNonDeletedElementsMap(),this.scene.getNonDeletedElements(),this.scene,gr(this.state),this.state.selectedLinearElement?.selectedPointsIndices??[],this.state.zoom)}if(o.type==="laser"){this.laserTrails.endPath();return}!o.locked&&o.type!=="freedraw"?(Kn(this.interactiveCanvas),this.setState({newElement:null,suggestedBindings:[],activeTool:Et(this.state,{type:"selection"})})):this.setState({newElement:null,suggestedBindings:[]}),f&&this.lastPointerUpEvent&&this.lastPointerDownEvent&&this.lastPointerUpEvent.timeStamp-this.lastPointerDownEvent.timeStamp<300&&De.pointers.size<=1&&Ln(f)&&this.isIframeLikeElementCenter(f,this.lastPointerUpEvent,t.origin.x,t.origin.y)&&this.handleEmbeddableCenterClick(f)})}clearSelection(t){this.setState(n=>({selectedElementIds:Le({},n),activeEmbeddable:null,selectedGroupIds:{},editingGroupId:n.editingGroupId&&t!=null&&po(t,n.editingGroupId)?n.editingGroupId:null})),this.setState({selectedElementIds:Le({},this.state),activeEmbeddable:null,previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(t,n,a,i){if(i){let r=i.x+i.width/2,s=i.y+i.height/2,o=vh(i,a,this.scene.getNonDeletedElementsMap());if(o&&(r=o.x,s=o.y),Math.hypot(t-r,n-s)<xS){let{x:d,y:c}=Rn({sceneX:r,sceneY:s},a);return{viewportX:d,viewportY:c,elementCenterX:r,elementCenterY:s}}}}getCanvasOffsets(){if(this.excalidrawContainerRef?.current){let t=this.excalidrawContainerRef.current,{left:n,top:a}=t.getBoundingClientRect();return{offsetLeft:n,offsetTop:a}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){let t=ku.find(n=>n.code===this.props.langCode)||Zr;await m4(t),this.setAppState({})}},DX=()=>{(be.MODE===bn.TEST||be.DEV)&&(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){return this.app?.scene.getElementsIncludingDeleted()},set(e){return this.app?.scene.replaceAllElements(Oa(e))}},scene:{configurable:!0,get(){return this.app?.scene}}}))};DX();var LX=AX,RX=()=>{Array.prototype.at||Object.defineProperty(Array.prototype,"at",{value:function(e){if(e=Math.trunc(e)||0,e<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]},writable:!0,enumerable:!1,configurable:!0}),Element.prototype.replaceChildren||(Element.prototype.replaceChildren=function(...e){this.innerHTML="",this.append(...e)})},PX=RX,Ex=({children:e})=>{let{FooterCenterTunnel:t}=cn(),n=Gt();return h.jsx(t.In,{children:h.jsx("div",{className:te("footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":n.zenModeEnabled}),children:e})})},NX=Ex;Ex.displayName="FooterCenter";var OX=()=>h.jsx("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"ExcalidrawLogo-icon",children:h.jsx("path",{d:"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z",fill:"currentColor"})}),$X=()=>h.jsxs("svg",{viewBox:"0 0 450 55",xmlns:"http://www.w3.org/2000/svg",fill:"none",className:"ExcalidrawLogo-text",children:[h.jsx("path",{d:"M429.27 96.74c2.47-1.39 4.78-3.02 6.83-4.95 1.43-1.35 2.73-2.86 3.81-4.51-.66.9-1.4 1.77-2.23 2.59-2.91 2.84-5.72 5.09-8.42 6.87h.01ZM343.6 69.36c.33 3.13.58 6.27.79 9.4.09 1.37.18 2.75.25 4.12-.12-4.46-.27-8.93-.5-13.39-.11-2.08-.24-4.16-.4-6.24-.06 1.79-.11 3.85-.13 6.11h-.01ZM378.47 98.34c.01-.37.07-1.13.01-6.51-.11 1.9-.22 3.81-.31 5.71-.07 1.42-.22 2.91-.16 4.35.39.03.78.07 1.17.1-.92-.85-.76-2.01-.72-3.66l.01.01ZM344.09 86.12c-.09-2.41-.22-4.83-.39-7.24v12.21c.15-.05.32-.09.47-.14.05-1.61-.03-3.23-.09-4.83h.01ZM440.69 66.79c-.22-.34-.45-.67-.69-.99-3.71-4.87-9.91-7.14-15.65-8.55-1.05-.26-2.12-.49-3.18-.71 2.29.59 4.48 1.26 6.64 2.02 7.19 2.54 10.57 5.41 12.88 8.23ZM305.09 72.46l1.2 3.6c.84 2.53 1.67 5.06 2.46 7.61.24.78.5 1.57.73 2.36.22-.04.44-.08.67-.12a776.9 776.9 0 0 1-5.01-13.57c-.02.04-.03.09-.05.13v-.01ZM345.49 90.25v.31c1.48-.42 3.05-.83 4.66-1.2-1.56.25-3.12.52-4.66.89ZM371.02 90.22c0-.57-.04-1.14-.11-1.71-.06-.02-.12-.04-.19-.05-.21-.05-.43-.08-.65-.11.42.16.74.88.95 1.87ZM398.93 54.23c-.13 0-.27-.01-.4-.02l.03.4c.11-.15.23-.27.37-.38ZM401.57 62.28v-.15c-1.22-.24-2.86-.61-3.23-1.25-.09-.15-.18-.51-.27-.98-.09.37-.2.73-.33 1.09 1.24.56 2.52.98 3.83 1.29ZM421.73 88.68c-2.97 1.65-6.28 3.12-9.69 3.68v.18c4.72-.14 11.63-3.85 16.33-8.38-2.04 1.75-4.33 3.24-6.63 4.53l-.01-.01ZM411.28 80.92c-.05-1.2-.09-2.4-.15-3.6-.21 5.66-.46 11.38-.47 14.51.24-.02.48-.04.71-.07.15-3.61.05-7.23-.09-10.83v-.01Z",transform:"translate(-144.023 -51.76)"}),h.jsx("path",{d:"M425.38 67.41c-3.5-1.45-7.19-2.57-14.06-3.62.09 1.97.06 4.88-.03 8.12.03.04.06.09.06.15.19 1.36.28 2.73.37 4.1.25 3.77.39 7.55.41 11.33 0 1.38-.01 2.76-.07 4.13 1.4-.25 2.78-.65 4.12-1.15 4.07-1.5 7.94-3.78 11.28-6.54 2.33-1.92 5.13-4.49 5.88-7.58.63-3.53-2.45-6.68-7.97-8.96l.01.02ZM411.35 92.53v-.06l-.34.03c.11.01.22.03.34.03ZM314.26 64.06c-.23-.59-.47-1.17-.7-1.75.57 1.62 1.11 3.25 1.6 4.9l.15.54 2.35 6.05c.32.82.66 1.64.98 2.46-1.38-4.1-2.83-8.17-4.39-12.2h.01ZM156.82 103.07c-.18.13-.38.23-.58.33 1.32-.03 2.66-.2 3.93-.34.86-.09 1.72-.22 2.58-.33-2.12.1-4.12.17-5.94.34h.01ZM210.14 68.88s.03.04.05.07c.18-.31.39-.64.58-.96-.21.3-.42.6-.64.89h.01ZM201.65 82.8c-.5.77-1.02 1.56-1.49 2.37 1.11-1.55 2.21-3.1 3.2-4.59-.23.23-.49.51-.75.79-.32.47-.65.95-.96 1.43ZM194.03 98.66c-.33-.4-.65-.84-1.05-1.17-.24-.2-.07-.49.17-.56-.23-.26-.42-.5-.63-.75 1.51-2.55 3.93-5.87 6.4-9.28-.17-.08-.29-.28-.2-.49.04-.09.09-.17.13-.26-1.21 1.78-2.42 3.55-3.61 5.33-.87 1.31-1.74 2.64-2.54 4-.29.5-.63 1.04-.87 1.61.81.65 1.63 1.27 2.47 1.88-.09-.11-.18-.21-.27-.32v.01ZM307.79 82.93c-1-3.17-2.05-6.32-3.1-9.48-1.62 4.08-3.69 9.17-6.16 15.19 3.32-1.04 6.77-1.87 10.27-2.5-.32-1.08-.67-2.15-1.01-3.21ZM149.5 80.7c.05-1.71.04-3.43 0-5.14-.1 2.26-.16 4.51-.22 6.77-.02.73-.03 1.46-.04 2.19.14-1.27.2-2.55.24-3.82h.02ZM228.98 98.3c.39 1.25.91 3.03.94 3.91.06-.03.12-.07.17-.1.08-1.29-.55-2.65-1.11-3.81ZM307.72 53.36c.81.5 1.53 1.04 2.07 1.49-.38-.8-.78-1.58-1.21-2.35-.17.03-.34.06-.51.11-.43.12-.86.26-1.29.41.35-.01.53.1.94.34ZM283.69 96.14c3.91-7.25 6.89-13.35 8.88-18.15l1.1-2.66c-1.27 2.64-2.56 5.27-3.83 7.9-1.53 3.15-3.06 6.31-4.58 9.47-.87 1.81-1.76 3.62-2.54 5.47.04.02.07.04.11.07.05.05.1.09.15.14.05-.73.27-1.48.71-2.24ZM289.92 103.23s-.04.01-.05.03c0-.02.04-.03.05-.04.05-.05.11-.1.16-.15l.21-.21c-.55 0-1.5-.27-2.55-.72.4.26.8.51 1.22.74.24.13.48.26.73.37.05.02.1.03.14.05a.27.27 0 0 1 .08-.07h.01ZM269.23 68.49c-.39-.19-.82-.48-1.33-.87-3.06-1.56-6.31-2.78-9.36-2.35-3.5.49-5.7 1.11-7.74 2.44 5.71-2.6 12.82-2.07 18.44.79l-.01-.01ZM177.87 53.69l1.06.03c-.96-.22-2-.25-2.89-.3-4.95-.26-9.99.33-14.86 1.19-2.44.43-4.88.95-7.28 1.59 9.09-1.76 15.69-2.77 23.97-2.51ZM219.85 55.51c-.18.12-.36.27-.56.45-.45.53-.86 1.11-1.26 1.66-1.91 2.61-3.71 5.31-5.57 7.95l-.12.18 8.05-10.11c-.18-.05-.36-.1-.55-.13h.01ZM510.71 54.1c.12-.15.29-.3.53-.45.69-.4 3.72-.63 5.87-.74-.36-.02-.73-.04-1.09-.05-1.84-.03-3.67.09-5.49.35.05.3.12.59.18.88v.01ZM510.76 86.02c1.37-3.07 2.49-6.27 3.57-9.46.55-1.64 1.12-3.3 1.6-4.97-1.59 4.01-3.67 9.14-6.2 15.3.24-.08.5-.14.74-.22.1-.22.19-.44.29-.65ZM566.95 75.76c.11-.02.23.03.31.11-.05-.13-.09-.26-.14-.39-.05.09-.11.18-.17.28ZM511.33 86.41c3.08-.89 6.24-1.62 9.46-2.14-1.51-3.98-2.98-7.96-4.39-11.87-.05.15-.09.31-.14.46-1.02 3.32-2.15 6.61-3.39 9.85-.48 1.25-.98 2.49-1.53 3.7h-.01ZM578.24 74.45c.11-.44.23-.87.35-1.31-.31.7-.64 1.39-.97 2.08.09.21.19.4.28.61.12-.46.23-.92.35-1.38h-.01ZM520.62 53.11c-.09 0-.18-.01-.28-.02.38.34.29 1.08.93 2.53l6.65 17.15c2.2 5.68 4.69 11.36 7.41 16.87l1.06 2.17c-2.95-7.05-5.92-14.08-8.87-21.13-1.58-3.79-3.16-7.59-4.7-11.4-.78-1.92-1.73-3.89-2.25-5.91-.03-.1 0-.19.04-.26h.01ZM578.78 77.87c1.45-5.77 3.07-10.43 3.58-13.36.05-.34.16-.88.31-1.55-.67 1.79-1.37 3.56-2.08 5.33-.12.43-.23.86-.35 1.29-.65 2.43-1.29 4.86-1.9 7.3.14.33.29.65.43 1l.01-.01ZM545.3 94.66c.02-.44.03-.83.05-1.12.02-1.01.05-2.02.11-3.02.03-6.66-.46-14.33-1.46-22.8-.13-.42-.27-1.24-.56-2.89 0-.02 0-.04-.01-.06.62 6.61.95 13.25 1.32 19.87.17 3.08.33 6.16.52 9.23.02.25.03.52.04.78l-.01.01ZM580.77 102.81c.13.2.27.38.37.49.27-.11.53-.22.8-.32-.43.09-.82.05-1.17-.16v-.01ZM530.48 104.07h.33c-.36-.13-.71-.32-1.04-.56.14.24.3.47.45.7.06-.08.14-.13.26-.13v-.01ZM542.63 58.82c.06.23.11.47.15.71.14-.33.36-.62.7-.86-.28.05-.57.11-.85.15ZM583.81 57.87c.15-.7.29-1.41.42-2.11-.14.45-.28.9-.42 1.34-.46 1.44-.89 2.89-1.31 4.34.44-1.19.88-2.37 1.31-3.57ZM523.62 91.48c-4.66 1.17-9.05 2.89-14.02 5.27 4.65-1.84 9.48-3.29 14.28-4.63-.09-.22-.17-.41-.26-.64ZM460.64 78.3c-.04-2.9-.11-5.81-.28-8.71-.1-1.68-.17-3.43-.5-5.09-.07.02-.14.03-.2.05.3 6.54.45 12.17.51 17.12.17-.07.34-.14.51-.2 0-1.06-.01-2.11-.03-3.17h-.01ZM470.63 63.24c-3.38-.26-6.81.32-10.1 1.1.41 2.01.47 4.14.57 6.18.18 3.55.25 7.11.27 10.67 3.31-1.38 6.5-3.12 9.3-5.35 1.96-1.56 3.86-3.41 5.02-5.66.73-1.41 1.19-3.22.26-4.65-1.09-1.7-3.46-2.14-5.32-2.29ZM460.29 63.68c1-.24 2.01-.46 3.04-.65-1.15.16-2.37.38-3.71.69v.13c.07-.02.15-.04.22-.05.11-.13.3-.18.45-.11v-.01ZM457.24 100.96c.43-.03.86-.07 1.29-.11.14-.49.27-.99.38-1.49-.44.7-1 1.23-1.67 1.6ZM482.88 104.98c-.18.23-.36.38-.55.47.14.09.27.19.4.28a70.76 70.76 0 0 0 4.37-4.63c.76-.89 1.52-1.81 2.19-2.77-.3-.27-.61-.53-.92-.79-.07 1.94-4.62 6.32-5.49 7.45v-.01Z",transform:"translate(-144.023 -51.76)"}),h.jsx("path",{d:"M474.36 63.31c-.4-.16-.84-.27-1.29-.37 1.56.42 3.08 1.22 3.76 2.74.62 1.4.32 2.95-.28 4.32.7-1.22.94-2.34.74-3.47-.24-1.33-1.19-2.54-2.93-3.21v-.01ZM477.34 89.18c-1.2-.81-2.4-1.62-3.6-2.42-.14.1-.26.19-.4.29 1.4.67 2.73 1.39 4 2.13ZM465.88 93.85c.37.25.74.5 1.1.75.46.32.92.65 1.38.97-1.57-1.2-2.01-1.61-2.49-1.72h.01ZM574.92 90.06c-2.28-5.21-4.93-11.13-5.67-12.26-.1-.15-1.57-3.01-1.63-3.08 0 0-.01.02-.02.02.4 1.37 1.09 2.69 1.65 3.99 2.14 4.95 4.36 9.86 6.67 14.73.6 1.26 1.21 2.52 1.83 3.78-.75-2.01-1.64-4.45-2.83-7.18ZM448.73 65.29c.1.2.22.38.34.57.22-.02.43-.06.65-.08v-.08c-.14-.05-.25 0-.99-.41ZM460.16 94.81c-.02.31-.06.59-.1.89-.03 1.71-.33 3.43-.79 5.07.15-.02.3-.03.45-.05.01-.04.02-.08.03-.11.09-.34.15-.69.2-1.03.17-1.07.25-2.16.33-3.24.05-.69.08-1.39.12-2.08-.27.1-.27.26-.24.57v-.02Z",transform:"translate(-144.023 -51.76)"}),h.jsx("path",{d:"m328.67 98.12-3.22-6.58c-1.29-2.63-2.53-5.29-3.72-7.97-.25-.85-.52-1.69-.79-2.53-.81-2.57-1.67-5.12-2.55-7.67-1.92-5.53-3.9-11.08-6.32-16.41-.72-1.58-1.46-3.44-2.63-4.79-.03-.17-.16-.29-.34-.36a.282.282 0 0 0-.23-.04c-.06-.01-.12 0-.18.01-.74.06-1.5.38-2.19.61-2.22.77-4.4 1.64-6.63 2.38-.03-.08-.06-.16-.09-.25-.15-.42-.82-.24-.67.19.03.09.07.19.1.28l-.18.06c-.36.11-.28.6 0 .68.18 1.18.63 2.36.98 3.49.03.09.06.17.08.26-.08.23-.17.46-.24.64-.37.98-.79 1.94-1.21 2.9-1.27 2.89-2.62 5.75-3.98 8.6-3.18 6.67-6.44 13.31-9.64 19.97-1.08 2.25-2.2 4.5-3.15 6.81-.13.32.24.5.5.37 1.34 1.33 2.84 2.5 4.4 3.57.65.44 1.31.87 2.01 1.24.4.22.86.48 1.33.5.24.01.35-.19.33-.37.11-.1.21-.21.28-.28.41-.41.81-.84 1.2-1.26.85-.92 1.69-1.87 2.5-2.84 6.31-2.34 12.6-4.31 18.71-5.84 2.14 5.3 3.43 8.43 3.97 9.58.55 1.05 1.15 1.88 1.82 2.52 1.32.56 6.96-.03 9.23-1.96.87-1.28 1.19-2.67.93-4.15-.09-.5-.22-.95-.4-1.33l-.01-.03Zm-20.09-45.61c.43.77.83 1.56 1.21 2.35-.54-.45-1.27-.99-2.07-1.49-.42-.24-.6-.35-.94-.34.43-.15.85-.29 1.29-.41.17-.05.34-.08.51-.11Zm-25.86 45.66c.78-1.85 1.67-3.66 2.54-5.47 1.51-3.16 3.05-6.31 4.58-9.47 1.28-2.63 2.56-5.26 3.83-7.9l-1.1 2.66c-1.99 4.79-4.97 10.9-8.88 18.15-.43.76-.66 1.51-.71 2.24-.05-.05-.1-.09-.15-.14a.259.259 0 0 0-.11-.07Zm6.24 4.71c-.42-.23-.82-.48-1.22-.74 1.05.45 2 .72 2.55.72l-.21.21c-.05.05-.11.1-.16.15-.01.01-.04.03-.05.04 0-.02.03-.02.05-.03a.27.27 0 0 0-.08.07c-.05-.02-.1-.03-.14-.05-.25-.1-.49-.24-.73-.37h-.01Zm15.73-29.43c1.05 3.15 2.1 6.31 3.1 9.48.34 1.06.69 2.13 1.01 3.21-3.5.63-6.95 1.46-10.27 2.5 2.48-6.03 4.54-11.11 6.16-15.19Zm4.79 12.57c-.23-.79-.49-1.58-.73-2.36-.79-2.54-1.63-5.08-2.46-7.61l-1.2-3.6c.02-.04.04-.09.05-.13 1.6 4.45 3.28 9 5.01 13.57l-.67.12v.01Zm5.83-18.27-.15-.54c-.49-1.64-1.03-3.28-1.6-4.9.23.58.47 1.17.7 1.75 1.56 4.03 3.01 8.1 4.39 12.2-.33-.82-.67-1.64-.98-2.46l-2.35-6.05h-.01ZM390.43 79.37c-.13-10.43-.22-17.5-.24-19.97-.24-1.6.21-2.88-.65-3.65-.14-.13-.32-.23-.52-.32h.03c.45 0 .45-.69 0-.7-1.75-.03-3.5-.04-5.25-.14-1.38-.08-2.76-.21-4.15-.31-.07 0-.12.01-.17.04-.21-.07-.47.03-.45.31l.03.45c-.11.14-.19.3-.22.5-.21 1.26-.32 13.67-.36 23.59-.32 5.79-.67 11.57-.97 17.36-.09 1.73-.29 3.54-.21 5.3-.39.02-.38.64.04.69v.12c.05.44.74.45.7 0v-.06c1.1.09 2.2.21 3.3.3 1.14.19 2.44.2 3.29.17 1.73-.05 2.92-.05 3.8-.37.45-.05.9-.11 1.35-.17.44-.06.25-.73-.19-.67h-.01c.24-.32.45-.72.62-1.25.66-1.84.41-6.36.34-11.33l-.13-9.9.02.01Zm-12.26 18.17c.09-1.91.2-3.81.31-5.71.06 5.38 0 6.14-.01 6.51-.05 1.65-.21 2.81.72 3.66-.39-.04-.78-.07-1.17-.1-.06-1.44.09-2.93.16-4.35l-.01-.01ZM588.97 53.85c-2.06-.25-3.17-.51-3.76-.6a.3.3 0 0 1 .04-.08c.22-.39-.39-.75-.6-.35-.56 1.02-.9 2.19-1.26 3.29-.61 1.88-1.17 3.78-1.72 5.68-.63 2.19-1.24 4.39-1.83 6.59-.81 2.03-1.67 4.05-2.61 6.03-1.7-3.64-3.11-6.04-4.03-7.57-2.26-3.74-2.85-5.48-3.57-6.08l.31-.09c.43-.12.25-.8-.19-.67-1.06.3-2.12.6-3.17.95-.93.32-1.85.69-2.76 1.07-.13.05-.19.16-.22.27-.04.02-.08.05-.11.07-.04-.06-.07-.12-.11-.18a.354.354 0 0 0-.48-.12c-.16.09-.22.32-.13.48l.33.54c0 .09.02.18.06.28.51 1.16.78 1.38.72 1.47-2.42 3.44-5.41 7.86-6.2 9.1-1.27 1.97-2.01 3.14-2.45 3.84l-.91-6.56-.43-4.1c-.19-1.85-.37-3.23-.53-4.13-.19-1.1-.3-2.15-.45-3.16-.2-1.36-.29-2.06-.47-2.42h.04c.45.02.45-.68 0-.7-3.43-.16-6.81.94-10.17 1.48-.24-.22-.73-.04-.58.32.24.59.33 1.25.43 1.87.17 1.06.29 2.13.4 3.2.32 3.09.53 6.2.74 9.3.44 6.75.77 13.51 1.17 20.26.11 1.95.13 3.96.46 5.89.05.3.37.31.55.14.74 1.71 2.87 1.27 6.13 1.27 1.34 0 2.39.04 2.99-.11.02.32.48.53.63.18 3.61-8.26 7.41-16.46 12.05-24.2.03-.05.04-.1.05-.15.3.73.64 1.45.94 2.16.97 2.26 1.97 4.52 2.98 6.76 2.26 5.03 4.54 10.07 7.09 14.96.47.9.94 1.79 1.47 2.65.2.32.4.67.66.96-.18.25 0 .68.34.54.91-.38 1.82-.75 2.76-1.07 1.04-.35 2.11-.65 3.17-.95.39-.11.28-.66-.07-.68.62-.4.95-.96.87-1.91-.3-3.34.72-7.47.86-8.52l2.14-11.43c1.75-10.74 3.13-17.51 3.23-20.86.02-.49.08-2.84.13-3.24.17-1.25.48-1-4.96-1.65l.03-.02Zm-46.19 5.67c-.04-.24-.09-.48-.15-.71l.85-.15c-.34.24-.56.53-.7.86Zm1.95 25.12c-.36-6.63-.7-13.26-1.32-19.87 0 .02 0 .04.01.06.29 1.65.44 2.47.56 2.89 1 8.46 1.5 16.14 1.46 22.8-.06.99-.1 2-.11 3.02-.01.29-.03.68-.05 1.12-.01-.26-.03-.53-.04-.78-.19-3.08-.35-6.16-.52-9.23l.01-.01Zm36.4 18.66c-.11-.11-.24-.29-.37-.49.35.21.74.26 1.17.16-.27.11-.53.22-.8.32v.01Zm-.89-33.72c.12-.43.23-.86.35-1.29.71-1.77 1.41-3.55 2.08-5.33-.15.68-.26 1.22-.31 1.55-.5 2.94-2.13 7.59-3.58 13.36-.15-.35-.29-.66-.43-1 .61-2.44 1.25-4.87 1.9-7.3l-.01.01Zm3.56-12.48c.14-.44.28-.89.42-1.34-.13.7-.27 1.41-.42 2.11-.43 1.19-.86 2.38-1.31 3.57.42-1.45.85-2.9 1.31-4.34Zm-5.22 16.05c-.11.44-.23.87-.35 1.31-.12.46-.23.92-.35 1.38-.1-.22-.19-.4-.28-.61.34-.69.66-1.38.97-2.08h.01Zm-11.64 2.62c.06-.1.12-.19.17-.28.05.13.09.26.14.39a.398.398 0 0 0-.31-.11Zm2.3 2.98c-.56-1.3-1.25-2.63-1.65-3.99 0 0 .01-.02.02-.02.06.08 1.52 2.93 1.63 3.08.73 1.13 3.38 7.04 5.67 12.26 1.2 2.73 2.08 5.17 2.83 7.18-.62-1.25-1.23-2.51-1.83-3.78-2.31-4.87-4.53-9.78-6.67-14.73ZM275.92 87.03c-1.06-2.18-1.13-3.45-2.44-2.93-1.52.57-2.94 1.3-4.5 2.1-1.4.72-2.68 1.44-3.92 2.12.01-.25-.24-.5-.51-.34-4.8 2.93-12.41 4.7-17.28 1.31-1.98-1.77-3.32-4.15-3.97-5.78-.29-.95-.49-1.94-.63-2.93-.14-3.34 1.58-6.53 3.9-9.12.8-.79 1.68-1.51 2.66-2.12 3.7-2.3 8.22-3.07 12.51-2.51 2.71.35 5.32 1.24 7.71 2.55.39.22.75-.39.35-.6-.18-.1-.37-.18-.55-.27.56.27 1.03.33 1.51.19l-.48.39c-.15.11-.23.3-.13.48.09.15.33.24.48.13 1.3-.97 2.46-2.09 3.45-3.37.37-.29.64-.6.65-.97v-.02c.08-.33-.03-.7-.21-1.08-.31-.87-.98-2.01-2.19-3.26-2.43-2.52-3.79-3.45-5.68-4.26-1.14-.49-3.12-1.06-4.42-1.23-3.28-.42-10.64-1.21-18.18 4.11-7.74 5.46-11.94 12.3-12.23 20.61-.08 2.06.04 3.98.34 5.71.74 4.18 2.57 8 5.44 11.34 4.26 4.99 9.76 7.52 16.34 7.52 4.85 0 9.69-1.77 14.89-4.62.23-.12.45-.23.68-.35 2.19-1.1 4.37-2.23 6.46-3.5.49-.3 1.03-.61 1.5-.98 1.47-.87 1.11-1.12.49-2.95-.39-1.14-.76-2.7-2.06-5.36l.02-.01Zm-17.38-21.76c3.05-.42 6.31.79 9.36 2.35.51.39.94.68 1.33.87-5.61-2.86-12.72-3.39-18.44-.79 2.05-1.33 4.24-1.95 7.74-2.44l.01.01ZM443.67 72.67c-.4-2.2-1.15-4.33-2.37-6.22-1.49-2.32-3.58-4.19-5.91-5.64-6.17-3.81-13.75-5.11-20.83-6.01-3.23-.41-6.47-.69-9.72-.92l-1.39-.12c-.85-.07-1.52-.1-2.05-.1-1.08-.06-2.17-.12-3.25-.17-.08 0-.14.02-.19.05-.1.05-.18.14-.16.3.27 2.55-.01 5.12-.92 7.52-.15.38.4.56.62.28 1.32.59 2.68 1.05 4.08 1.37 0 2.78-.14 7.58-.33 12.91 0 0 0 .02-.01.03-.61 3.66-.79 7.42-1 11.12-.23 4.01-.43 8.03-.44 12.05 0 .64 0 1.28.03 1.93.02.31 0 .68.15.96.06.11.14.16.24.17-.2.17-.21.54.11.59 3.83.67 7.78.71 11.68.25 2.3-.19 4.87-.65 7.65-1.56 1.85-.54 3.67-1.18 5.43-1.91 7.2-3.02 14.31-8.07 17.35-15.53.76-1.86 1.17-3.8 1.31-5.75.3-1.93.28-3.82-.09-5.58l.01-.02Zm-19.32-15.42c5.74 1.41 11.94 3.68 15.65 8.55.25.32.47.65.69.99-2.3-2.82-5.68-5.69-12.88-8.23-2.16-.76-4.35-1.43-6.64-2.02 1.06.21 2.13.45 3.18.71Zm-25.82-3.04c.13 0 .27.01.4.02-.14.1-.26.23-.37.38 0-.13-.02-.26-.03-.4Zm34.82 22.17c-.75 3.09-3.55 5.66-5.88 7.58-3.35 2.76-7.21 5.03-11.28 6.54-1.33.49-2.71.9-4.12 1.15.06-1.38.08-2.76.07-4.13-.02-3.78-.16-7.56-.41-11.33-.09-1.37-.18-2.74-.37-4.1 0-.06-.03-.11-.06-.15.09-3.25.12-6.16.03-8.12 6.86 1.05 10.56 2.17 14.06 3.62 5.52 2.28 8.59 5.44 7.97 8.96l-.01-.02Zm-22 16.15c-.12 0-.23-.02-.34-.03l.34-.03v.06Zm-.69-.7c0-3.13.26-8.84.47-14.51.06 1.2.11 2.41.15 3.6.15 3.6.25 7.23.09 10.83-.24.03-.48.05-.71.07v.01Zm-12.33-30.94c.37.63 2.01 1.01 3.23 1.25v.15c-1.31-.31-2.59-.73-3.83-1.29.12-.36.23-.72.33-1.09.08.48.18.84.27.98Zm13.7 31.65v-.18c3.41-.56 6.71-2.02 9.69-3.68 2.31-1.28 4.59-2.78 6.63-4.53-4.69 4.53-11.61 8.24-16.33 8.38l.01.01Zm24.07-.75c-2.05 1.93-4.37 3.56-6.83 4.95 2.7-1.78 5.52-4.03 8.42-6.87.82-.82 1.56-1.69 2.23-2.59-1.08 1.65-2.38 3.16-3.81 4.51h-.01ZM187.16 92.14c-.79-2.47-2.1-7.12-3.1-6.87-.19-.01-2.09.77-4.08 1.54-3.06 1.18-5.91 2.13-10.09 2.82-2.74.42-5.87 1.01-10.61 1.06.04-3.34.05-6.01.05-7.99 7.97-.65 12.33-2.11 16.37-3.55 1.11-.39 2.69-1.01 2.63-1.8-.08-.35-.55-1.39-1.17-2.61-.47-1.16-.98-2.31-1.61-3.38-.42-.71-1.04-1.69-1.86-2.06-.11-.08-.22-.13-.29-.12-.02 0-.04 0-.07.01-.19-.04-.39-.05-.6-.01-.17.03-.24.15-.25.28-.04.02-.09.04-.14.05-4.33 1.48-8.85 2.33-13.24 3.61a499.1 499.1 0 0 0-.31-8.19c4.51-.99 8.88-1.38 13.11-1.82 3.68-.38 6.28.12 7.47.34.59.11.9.16 1.16.18h.1c-.1.37.44.66.62.28.02-.04.03-.08.05-.13.15.2.53.22.62-.1.17-.58.19-1.21.21-1.81v-.36c.03-.15.05-.3.07-.45.52-2.47.33-5.09-.64-7.44-.11-.27-.44-.28-.6-.14-.08-.21-.15-.42-.24-.62-.19-.41-.79-.05-.6.35.03.07.05.15.09.22-.98-.42-2.15-.54-3.17-.63-2.17-.19-4.37-.14-6.54 0-5.7.35-11.4 1.3-16.91 2.79-2.08.56-4.13 1.22-6.14 2-4.54 1.05-3.79 1.51-2.17 6.07.18.51.46 1.68.54 1.94.82 2.47 1.08 2.13 3.1 2.13s0 .05 0 .08h.52c-.48 2.66-.51 5.45-.62 8.13-.15 3.48-.22 6.96-.28 10.45 0 .41-.01.82-.02 1.23-.16.29-.33.57-.51.85-.05.38-.09.77-.14 1.18-.42 3.52-.59 6.48-.52 8.8v.34c.02.47.05.76.06.87.16 1.57-.26 3.47 1.35 3.79 1.61.32 3.5.55 4.85.55.11 0 .22-.02.33-.02 1.79.24 3.67.05 5.45-.12 2.85-.28 5.69-.7 8.51-1.19 3.03-.53 6.05-1.14 9.04-1.86 2.4-.58 4.82-1.19 7.13-2.06.51-.19 1.73-.57 2.46-1.14 1.81-.68 2.18-1 1.57-2.67-.23-.62-.48-1.49-.91-2.78l-.03-.02Zm-11.12-38.71c.89.05 1.93.08 2.89.3-.33 0-.68-.02-1.06-.03-8.28-.26-14.88.75-23.97 2.51 2.41-.64 4.85-1.16 7.28-1.59 4.87-.86 9.91-1.45 14.86-1.19Zm-26.53 22.13c.03 1.71.04 3.43 0 5.14-.04 1.27-.11 2.55-.24 3.82 0-.73.02-1.46.04-2.19.05-2.26.12-4.51.22-6.77h-.02Zm6.73 27.85c.2-.1.4-.21.58-.33 1.82-.17 3.82-.24 5.94-.34-.86.11-1.72.24-2.58.33-1.27.14-2.61.31-3.93.34h-.01ZM534.48 85.44c-3.52-8.38-7.07-16.75-10.5-25.17-.63-1.54-1.25-3.09-1.86-4.65-.31-.8-.65-1.6-.87-2.43-.04-.17-.17-.24-.31-.25.1-.2 0-.51-.29-.53-1.59-.08-3.18-.22-4.78-.25-1.96-.03-3.91.13-5.84.42-.31.05-.31.38-.13.56-.03.06-.05.14-.04.22.23 1.54.63 3.06 1.16 4.53.13.35.27.7.41 1.06l-2.68 6.18c-.11.03-.2.09-.25.22-.67 1.9-1.52 3.73-2.34 5.56a536.85 536.85 0 0 1-3.9 8.45c-2.64 5.64-5.34 11.25-7.91 16.93-.44.97-.88 1.94-1.29 2.93-.2.48-.47 1-.55 1.52v.05c-.02.12.02.26.16.34 1.19.73 2.41 1.41 3.66 2.05 1.2.62 2.45 1.25 3.76 1.61.43.12.62-.55.19-.67-1.13-.31-2.2-.83-3.24-1.36 1.09.36 2.1.69 2.75.93 2.82 1.01 2.38 1.1 4.3-3.75 2.1-1.09 4.34-1.96 6.53-2.79 4.35-1.64 8.8-3.03 13.27-4.29.82 2.01 1.77 3.97 2.72 5.92.35.83.62 1.45.79 1.82.22.42.45.8.69 1.15.17.33.33.67.5 1 .42.8.84 1.63 1.4 2.35.23.29.6 0 .55-.31 1.53-.02 3.06-.07 4.58-.27.92-.12 1.82-.32 2.71-.54 1.39-.27 3.85-1.11 3.74-1.42-.67-1.96-1.55-3.87-2.34-5.78-1.57-3.78-3.16-7.56-4.75-11.33v-.01Zm-11.65-26.16c1.54 3.81 3.12 7.6 4.7 11.4 2.94 7.05 5.91 14.09 8.87 21.13l-1.06-2.17c-2.71-5.51-5.2-11.19-7.41-16.87l-6.65-17.15c-.65-1.45-.55-2.19-.93-2.53.09 0 .18.01.28.02a.29.29 0 0 0-.04.26c.52 2.02 1.47 3.98 2.25 5.91h-.01Zm-6.58 13.58c.05-.15.09-.31.14-.46 1.41 3.92 2.88 7.9 4.39 11.87-3.22.52-6.38 1.25-9.46 2.14.55-1.22 1.05-2.46 1.53-3.7 1.24-3.24 2.37-6.53 3.39-9.85h.01Zm-.23-20c.36 0 .73.03 1.09.05-2.15.1-5.18.33-5.87.74-.24.15-.41.3-.53.45-.06-.29-.13-.58-.18-.88 1.82-.26 3.65-.39 5.49-.35v-.01Zm-.09 18.72c-.49 1.67-1.05 3.33-1.6 4.97-1.07 3.19-2.19 6.38-3.57 9.46-.09.21-.19.43-.29.65-.25.07-.5.14-.74.22 2.53-6.16 4.61-11.29 6.2-15.3Zm-6.34 25.16c4.97-2.38 9.37-4.1 14.02-5.27l.26.64c-4.8 1.35-9.63 2.8-14.28 4.63Zm20.17 6.76c.33.23.68.42 1.04.56h-.33c-.12 0-.21.06-.26.13-.15-.23-.31-.45-.45-.7v.01ZM226.57 91.75c-3.55-4.74-6.68-9.11-9.31-12.99 9.2-15.25 10.05-17.81 10.35-18.38.17-.34 1.09-2.27.64-2.53-1.13-.65-1.03-.65-2.97-1.71-1.19-.65-3.04-1.61-4.53-2.12-1.71-.59-1.24-.36-3 2.77-.06.1-.11.2-.17.3-.75 1.02-1.48 2.05-2.2 3.09-1.88 2.71-3.73 5.45-5.69 8.1-3.68-4.91-6.88-8.76-9.51-11.43-.15-.15-.3-.29-.46-.42-1.27-1.28-7.24 3.53-7.93 5.58-.09.09-.19.16-.28.25-.27.26.03.64.33.58.19.65.5 1.29.94 1.91 3.85 5.06 7.19 9.76 9.94 14-1.23 2.61-3.06 5-4.67 7.38l-2.28 3.33c-.5.66-.93 1.23-1.29 1.69-.67.93-2.09 2.61-2.3 3.87-.51.85-1.16 1.84-1.29 2.83-.06.44.61.63.67.19.01-.08.04-.15.06-.22 1.36 1.08 2.76 2.11 4.19 3.11 1.3.91 2.62 1.85 4.04 2.56.21.1.4 0 .48-.17.24.07.48.14.72.2.44.1.62-.57.19-.67-2.02-.48-3.77-1.57-5.23-3.02-.47-.46-.9-.96-1.32-1.46 1.74 1.35 4.2 2.89 5.89 4.14 1.39 1.03 2.85-2.27 4.22-4.2 1.86-2.64 3.96-5.86 5.52-8.29l10.39 14.51c.67.81 1.14 1.21 1.57 1.36-.05.24.12.51.41.4 1.53-.58 3.05-1.19 4.54-1.87 1.52-.69 3.06-1.45 4.36-2.5a.28.28 0 0 0 .12-.23c1.66-1.1.81-1.74-1.41-4.91-1.13-1.58-1.71-2.36-3.7-5.01l-.03-.02Zm2.41 6.54c.56 1.15 1.19 2.52 1.11 3.81-.06.04-.12.07-.17.1-.03-.88-.55-2.66-.94-3.91Zm-16.51-32.73c1.86-2.65 3.65-5.35 5.57-7.95.4-.55.81-1.13 1.26-1.66.19-.18.38-.33.56-.45.18.03.36.08.55.13l-8.05 10.11.12-.18h-.01ZM192.7 95.48c.79-1.37 1.66-2.69 2.54-4 1.19-1.79 2.4-3.56 3.61-5.33-.04.09-.09.17-.13.26-.1.22.03.41.2.49-2.47 3.42-4.89 6.73-6.4 9.28.21.24.4.48.63.75-.24.07-.4.36-.17.56.4.33.72.77 1.05 1.17.09.11.18.21.27.32-.84-.61-1.66-1.24-2.47-1.88.24-.57.58-1.11.87-1.61v-.01Zm7.46-10.32c.47-.81.98-1.59 1.49-2.37.31-.48.64-.95.96-1.43.26-.29.52-.56.75-.79-.99 1.48-2.09 3.03-3.2 4.59Zm10.03-16.22s-.03-.05-.05-.07c.22-.29.43-.59.64-.89-.2.32-.4.65-.58.96h-.01ZM371.54 87.96c-.01-.08-.01-.16-.03-.23-.06-.38-.58-.29-.66.03-.3-.05-.6-.08-.81-.11-1.14-.15-2.29-.19-3.44-.2 1.04-.09 2.09-.18 3.14-.23.45-.02.45-.72 0-.7-6.57.35-13.14 1.23-19.65 2.11-1.53.21-3.05.42-4.57.68-.01 0-.02.01-.04.01-.04-3.33-.13-6.66-.24-9.99-.19-5.7-.4-11.41-.88-17.1-.13-1.51-.23-3.07-.49-4.58 0-.25 0-.48-.02-.68-.06-1.19-.04-2.61-.68-2.78-.16-.07-.72-.16-1.5-.24.22-.17.16-.62-.2-.63-1.19-.04-2.39.09-3.57.23-1.2.14-2.41.32-3.59.6-.16-.1-.41-.06-.5.12-.06.02-.13.03-.19.05-.35.1-.29.55-.03.66-.26.6-.19 2.27-.21 3-.02.66-.66 33.73-.9 40.3-.03.65.06 1.12.04 1.45-.16 3.05.87 4.96 6.34 3.93 1.09-.08 2.75-.77 5.36-1.43 4.13-1.04 5.78-1.52 6.2-1.65 6.43-1.69 6.78-1.97 11.72-2.43.55-.05 4.8-.38 6.03-.3.64.04 1.19.07 1.65.1.09 0 .16-.03.24-.05.1.27.56.33.66-.02.39-1.32.61-2.71.78-4.08.2-1.61.29-3.24.15-4.86.24.03.52-.23.38-.53-.09-.2-.27-.33-.49-.43v-.02Zm-.63.56c.07.57.11 1.14.11 1.71-.21-.99-.53-1.71-.95-1.87.22.03.44.06.65.11.06.01.12.04.19.05Zm-25.41 1.73c1.54-.36 3.1-.64 4.66-.89-1.61.37-3.18.77-4.66 1.2v-.31Zm-.86-7.37c-.07-1.37-.16-2.75-.25-4.12-.21-3.13-.45-6.27-.79-9.4.02-2.25.08-4.31.13-6.11.16 2.08.29 4.16.4 6.24.23 4.46.38 8.93.5 13.39h.01Zm-.94-4c.16 2.41.29 4.83.39 7.24.06 1.6.14 3.22.09 4.83-.15.05-.32.09-.47.14V78.88h-.01ZM483.72 92.83c-3.05-2.28-6.22-4.4-9.38-6.51 8.86-6.49 13.49-12.95 13.73-19.23.04-.76 0-1.5-.13-2.2-.67-3.82-3.5-6.68-8.39-8.48.13.04.27.08.4.13 3.92 1.39 7.74 4.23 8.5 8.56.34 1.95-.05 3.96-.98 5.69-.21.4.39.75.6.35 1.86-3.46 1.46-7.55-.97-10.63-3.53-4.47-9.76-5.88-15.16-6.16-2.32-.12-4.64-.04-6.95.19-6 .32-12.71 1.68-17.63 3.21-.37.11-.67.23-.92.35-.2-.17-.62.02-.57.37v.03c-.64.68-.18 1.64.48 3.21.38.91.67 1.89 1.15 2.58.32.76.68 1.51 1.13 2.19.14.21.38.19.53.07.19-.02.38-.05.57-.08v1.57c-.06.06-.1.13-.11.23-.27 4.18-.34 8.38-.48 12.57l-.3 9.03c-.24 3.91-.44 6.77-.46 7.26-.05.88-.11 1.95.07 2.81-.01.22-.02.43-.04.65 0 .11-.02.23-.03.35 0 .05-.03.27-.01.16-.05.4.5.59.64.28.05.04.12.08.2.08 1.75.13 3.5.28 5.25.3 1.69.02 3.38-.12 5.06-.32.08.23.36.39.55.15.06-.08.11-.17.16-.26.18-.09.24-.32.18-.48.05-.2.1-.4.13-.6.16-.86.25-1.74.33-2.62.11-1.17.17-2.34.23-3.51.15-.01.32-.03.52-.04.36-.03 1.73-.15 2.06-.15.39 0 .7-.02.95-.04 1.76 1.11 3.45 2.35 5.14 3.55 2.83 2.01 5.64 4.04 8.47 6.04 1.42 1 2.85 2 4.29 2.97.1.06.19.07.27.04.08 0 .17-.02.25-.1 1.61-1.56 3.15-3.18 4.6-4.88.75-.88 1.49-1.78 2.15-2.73.01.01.03.02.04.03.34.3.83-.2.49-.49-2.16-1.9-4.34-3.76-6.64-5.48l.03-.01Zm-6.38-3.65a55.72 55.72 0 0 0-4-2.13c.14-.1.26-.19.4-.29 1.2.81 2.4 1.61 3.6 2.42Zm-20.1 11.78c.67-.37 1.23-.91 1.67-1.6-.11.5-.24 1-.38 1.49-.43.04-.86.08-1.29.11Zm2.38-37.24c1.34-.31 2.56-.52 3.71-.69-1.03.19-2.04.41-3.04.65-.14-.07-.34-.02-.45.11-.07.02-.15.04-.22.05v-.13.01Zm.04.84c.07-.02.14-.03.2-.05.34 1.66.41 3.41.5 5.09.17 2.9.24 5.81.28 8.71l.03 3.17c-.17.07-.34.14-.51.2-.06-4.96-.21-10.58-.51-17.12h.01Zm16.04 5.62c-1.16 2.25-3.06 4.1-5.02 5.66-2.8 2.23-5.99 3.97-9.3 5.35-.01-3.56-.09-7.12-.27-10.67-.1-2.04-.16-4.16-.57-6.18 3.3-.78 6.72-1.36 10.1-1.1 1.85.14 4.23.59 5.32 2.29.92 1.43.46 3.24-.26 4.65Zm.85-.18c.6-1.37.9-2.92.28-4.32-.67-1.52-2.2-2.32-3.76-2.74.46.1.89.21 1.29.37 1.74.67 2.69 1.88 2.93 3.21.2 1.13-.05 2.25-.74 3.47V70Zm-27.47-4.14c-.12-.19-.23-.38-.34-.57.74.42.85.36.99.41v.08c-.22.03-.43.06-.65.08Zm11.21 30.46c-.08 1.08-.16 2.17-.33 3.24-.05.35-.11.69-.2 1.03 0 .04-.02.07-.03.11-.15.02-.3.04-.45.05.45-1.64.76-3.36.79-5.07.03-.29.08-.57.1-.89-.03-.31-.03-.47.24-.57-.04.69-.07 1.39-.12 2.08v.02Zm5.6-2.47c.48.11.92.52 2.49 1.72-.46-.32-.92-.65-1.38-.97-.37-.25-.73-.5-1.1-.75h-.01Zm21.23 7.24a70.76 70.76 0 0 1-4.37 4.63c-.14-.09-.27-.19-.4-.28.19-.09.37-.24.55-.47.87-1.14 5.43-5.51 5.49-7.45.31.26.62.53.92.79-.67.97-1.42 1.88-2.19 2.77v.01Z",fill:"currentColor",transform:"translate(-144.023 -51.76)"})]}),FX=({style:e,size:t="small",withText:n})=>h.jsxs("div",{className:`ExcalidrawLogo is-${t}`,style:e,children:[h.jsx(OX,{}),n&&h.jsx($X,{})]}),Ep=({icon:e,shortcut:t,children:n})=>{let a=Tt();return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"welcome-screen-menu-item__icon",children:e}),h.jsx("div",{className:"welcome-screen-menu-item__text",children:n}),t&&!a.editor.isMobile&&h.jsx("div",{className:"welcome-screen-menu-item__shortcut",children:t})]})};Ep.displayName="WelcomeScreenMenuItemContent";var Go=({onSelect:e,children:t,icon:n,shortcut:a,className:i="",...r})=>h.jsx("button",{...r,type:"button",className:`welcome-screen-menu-item ${i}`,onClick:e,children:h.jsx(Ep,{icon:n,shortcut:a,children:t})});Go.displayName="WelcomeScreenMenuItem";var Sx=({children:e,href:t,icon:n,shortcut:a,className:i="",...r})=>h.jsx("a",{...r,className:`welcome-screen-menu-item ${i}`,href:t,target:"_blank",rel:"noreferrer",children:h.jsx(Ep,{icon:n,shortcut:a,children:e})});Sx.displayName="WelcomeScreenMenuItemLink";var ma=({children:e})=>{let{WelcomeScreenCenterTunnel:t}=cn();return h.jsx(t.In,{children:h.jsx("div",{className:"welcome-screen-center",children:e||h.jsxs(h.Fragment,{children:[h.jsx(Sp,{}),h.jsx(kp,{children:S("welcomeScreen.defaults.center_heading")}),h.jsxs(Mp,{children:[h.jsx(Ip,{}),h.jsx(Cp,{})]})]})})})};ma.displayName="Center";var Sp=({children:e})=>h.jsx("div",{className:"welcome-screen-center__logo excalifont welcome-screen-decor",children:e||h.jsx(FX,{withText:!0})});Sp.displayName="Logo";var kp=({children:e})=>h.jsx("div",{className:"welcome-screen-center__heading welcome-screen-decor excalifont",children:e});kp.displayName="Heading";var Mp=({children:e})=>h.jsx("div",{className:"welcome-screen-menu",children:e});Mp.displayName="Menu";var Cp=()=>{let e=En();return h.jsx(Go,{onSelect:()=>e.executeAction(op),shortcut:"?",icon:W1,children:S("helpDialog.title")})};Cp.displayName="MenuItemHelp";var Ip=()=>{let e=Gt(),t=En();return e.viewModeEnabled?null:h.jsx(Go,{onSelect:()=>t.executeAction(d1),shortcut:en("loadScene"),icon:V1,children:S("buttons.load")})};Ip.displayName="MenuItemLoadScene";var kx=({onSelect:e})=>{let{t}=Vt();return h.jsx(Go,{shortcut:null,onSelect:e,icon:eb,children:t("labels.liveCollaboration")})};kx.displayName="MenuItemLiveCollaborationTrigger";ma.Logo=Sp;ma.Heading=kp;ma.Menu=Mp;ma.MenuItem=Go;ma.MenuItemLink=Sx;ma.MenuItemHelp=Cp;ma.MenuItemLoadScene=Ip;ma.MenuItemLiveCollaborationTrigger=kx;var _p=({children:e})=>{let{WelcomeScreenMenuHintTunnel:t}=cn();return h.jsx(t.In,{children:h.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--menu",children:[Hk,h.jsx("div",{className:"welcome-screen-decor-hint__label",children:e||S("welcomeScreen.defaults.menuHint")})]})})};_p.displayName="MenuHint";var Tp=({children:e})=>{let{WelcomeScreenToolbarHintTunnel:t}=cn();return h.jsx(t.In,{children:h.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--toolbar",children:[h.jsx("div",{className:"welcome-screen-decor-hint__label",children:e||S("welcomeScreen.defaults.toolbarHint")}),Wk]})})};Tp.displayName="ToolbarHint";var jp=({children:e})=>{let{WelcomeScreenHelpHintTunnel:t}=cn();return h.jsx(t.In,{children:h.jsxs("div",{className:"excalifont welcome-screen-decor welcome-screen-decor-hint welcome-screen-decor-hint--help",children:[h.jsx("div",{children:e||S("welcomeScreen.defaults.helpHint")}),Xk]})})};jp.displayName="HelpHint";var Nu=e=>h.jsx(h.Fragment,{children:e.children||h.jsxs(h.Fragment,{children:[h.jsx(ma,{}),h.jsx(_p,{}),h.jsx(Tp,{}),h.jsx(jp,{})]})});Nu.displayName="WelcomeScreen";Nu.Center=ma;Nu.Hints={MenuHint:_p,ToolbarHint:Tp,HelpHint:jp};var zX=Nu,Mx=({isCollaborating:e,onSelect:t,...n})=>{let a=Gt(),i=a.width<830;return h.jsxs(Yi,{...n,className:te("collab-button",{active:e}),type:"button",onSelect:t,style:{position:"relative",width:i?void 0:"auto"},title:S("labels.liveCollaboration"),children:[i?fM:S("labels.share"),a.collaborators.size>0&&h.jsx("div",{className:"CollabButton-collaborators",children:a.collaborators.size})]})},BX=Mx;Mx.displayName="LiveCollaborationTrigger";var HX=(e,t,n)=>!!(t&&(t.id===e.editingTextElement?.id||t.id===e.resizingElement?.id||t.id===e.newElement?.id||t.version>n.version||t.version===n.version&&t.versionNonce<n.versionNonce)),XX=Mo((e,t,n)=>{if(be.DEV||be.MODE===bn.TEST||window?.DEBUG_FRACTIONAL_INDICES){let a=Oa(e.map(i=>({...i})));d0(a,{shouldThrow:be.DEV||be.MODE===bn.TEST,includeBoundTextValidation:!0,reconciliationContext:{localElements:t,remoteElements:n}})}},1e3*60,{leading:!0,trailing:!1}),WX=(e,t,n)=>{let a=oe(e),i=[],r=new Set;for(let o of t)if(!r.has(o.id)){let d=a.get(o.id),c=HX(n,d,o);d&&c?(i.push(d),r.add(d.id)):(i.push(o),r.add(o.id))}for(let o of e)r.has(o.id)||(i.push(o),r.add(o.id));let s=g8(i);return XX(s,e,t),Oa(s),s},Cx=({children:e,icon:t})=>{let{TTDDialogTriggerTunnel:n}=cn(),a=jt();return h.jsx(n.In,{children:h.jsxs(Je.Item,{onSelect:()=>{qe("ai","dialog open","ttd"),a({openDialog:{name:"ttd",tab:"text-to-diagram"}})},icon:t??lC,children:[e??S("labels.textToDiagram"),h.jsx(Je.Item.Badge,{children:"AI"})]})})};Cx.displayName="TTDDialogTrigger";var VX=e=>{let t=Ua();return C.useLayoutEffect(()=>{t.setPlugins({diagramToCode:{generate:e.generate}})},[t,e.generate]),null};PX();var GX=e=>{let{onChange:t,initialData:n,excalidrawAPI:a,isCollaborating:i=!1,onPointerUpdate:r,renderTopRightUI:s,langCode:o=Zr.code,viewModeEnabled:d,zenModeEnabled:c,gridModeEnabled:l,libraryReturnUrl:u,theme:f,name:p,renderCustomStats:U,onPaste:m,detectScroll:g=!0,handleKeyboardGlobally:b=!1,onLibraryChange:v,autoFocus:x=!1,generateIdForFile:y,onLinkOpen:w,generateLinkForSelection:k,onPointerDown:M,onPointerUp:I,onScrollChange:A,onDuplicate:_,children:T,validateEmbeddable:L,renderEmbeddable:R,aiEnabled:F,showDeprecatedFonts:P}=e,$=e.UIOptions?.canvasActions,O={...e.UIOptions,canvasActions:{...HU.canvasActions,...$},tools:{image:e.UIOptions?.tools?.image??!0}};return $?.export&&(O.canvasActions.export.saveFileToDisk=$.export?.saveFileToDisk??HU.canvasActions.export.saveFileToDisk),O.canvasActions.toggleTheme===null&&typeof f>"u"&&(O.canvasActions.toggleTheme=!0),C.useEffect(()=>{(async()=>await ne(()=>import("./roundRect-mAH3dD0p.js"),[]))();let V=W=>{typeof W.scale=="number"&&W.scale!==1&&W.preventDefault()};return document.addEventListener("touchmove",V,{passive:!1}),()=>{document.removeEventListener("touchmove",V)}},[]),h.jsx(DO,{store:ia,children:h.jsx(NO,{langCode:o,theme:f,children:h.jsx(LX,{onChange:t,initialData:n,excalidrawAPI:a,isCollaborating:i,onPointerUpdate:r,renderTopRightUI:s,langCode:o,viewModeEnabled:d,zenModeEnabled:c,gridModeEnabled:l,libraryReturnUrl:u,theme:f,name:p,renderCustomStats:U,UIOptions:O,onPaste:m,detectScroll:g,handleKeyboardGlobally:b,onLibraryChange:v,autoFocus:x,generateIdForFile:y,onLinkOpen:w,generateLinkForSelection:k,onPointerDown:M,onPointerUp:I,onScrollChange:A,onDuplicate:_,validateEmbeddable:L,renderEmbeddable:R,aiEnabled:F!==!1,showDeprecatedFonts:P,children:T})})})},ZX=(e,t)=>{if(e.children!==t.children)return!1;let{initialData:n,UIOptions:a={},...i}=e,{initialData:r,UIOptions:s={},...o}=t,d=Object.keys(a),c=Object.keys(s);return d.length!==c.length?!1:d.every(l=>l==="canvasActions"?Object.keys(a.canvasActions).every(u=>u==="export"&&a?.canvasActions?.export&&s?.canvasActions?.export?a.canvasActions.export.saveFileToDisk===s.canvasActions.export.saveFileToDisk:a?.canvasActions?.[u]===s?.canvasActions?.[u]):a[l]===s[l])&&Wt(i,o)},Ix=Z.memo(GX,ZX);Ix.displayName="Excalidraw";const rW=Object.freeze(Object.defineProperty({__proto__:null,Button:Yi,CaptureUpdateAction:B,DEFAULT_LASER_COLOR:b5,DefaultSidebar:b1,DiagramToCodePlugin:VX,Excalidraw:Ix,FONT_FAMILY:it,Footer:NX,LiveCollaborationTrigger:BX,MIME_TYPES:ae,MainMenu:rn,ROUNDNESS:St,Sidebar:Jn,Stats:Ru,THEME:Me,TTDDialog:ux,TTDDialogTrigger:Cx,UserIdleState:k5,WelcomeScreen:zX,bumpVersion:zo,convertToExcalidrawElements:Bc,defaultLang:Zr,elementPartiallyOverlapsWithOrContainsBBox:Z8,elementsOverlappingBBox:Y8,exportToBlob:V8,exportToCanvas:$o,exportToClipboard:vR,exportToSvg:bu,getCommonBounds:Ne,getDataURL:Vf,getFreeDrawSvgPath:Q1,getLibraryItemsHash:Nc,getNonDeletedElements:Ve,getSceneVersion:KR,getTextFromElements:s8,getVisibleSceneBounds:Bb,hashElementsVersion:c7,hashString:O0,isElementInsideBBox:Ff,isElementLink:vs,isInvisiblySmallElement:Fr,isLinearElement:ue,languages:ku,loadFromBlob:z0,loadLibraryFromBlob:g7,loadSceneOrLibraryFromBlob:F0,mergeLibraryItems:t9,mutateElement:X,newElementWith:pe,normalizeLink:vn,parseLibraryTokensFromUrl:p1,reconcileElements:WX,restore:No,restoreAppState:O8,restoreElements:gu,restoreLibraryItems:Oo,sceneCoordsToViewportCoords:Rn,serializeAsJSON:Po,serializeLibraryAsJSON:u0,setCustomTextMetricsProvider:kk,useDevice:Tt,useHandleLibrary:MF,useI18n:Vt,viewportCoordsToSceneCoords:Ge,zoomToFitBounds:z4},Symbol.toStringTag,{value:"Module"})),_x=Object.freeze(Object.defineProperty({__proto__:null,decodePngMetadata:lP,encodePngMetadata:k7,getTEXtChunk:S7},Symbol.toStringTag,{value:"Module"})),YX=Object.freeze(Object.defineProperty({__proto__:null,alerts:j7,buttons:T7,canvasError:N7,clearCanvasDialog:X7,colorPicker:e3,colors:J7,commandPalette:s3,confirmDialog:G7,default:H0,element:L7,elementLink:C7,encrypted:Y7,errorDialog:z7,errorSplash:O7,errors:A7,exportDialog:B7,fontList:i3,headings:R7,helpDialog:H7,hints:P7,imageExportDialog:Z7,labels:M7,library:I7,mermaid:n3,overwriteConfirm:t3,publishDialog:W7,publishSuccessDialog:V7,quickSearch:a3,roomDialog:F7,search:_7,shareDialog:$7,stats:K7,toast:q7,toolBar:D7,userList:r3,welcomeScreen:Q7},Symbol.toStringTag,{value:"Module"})),KX=Object.freeze(Object.defineProperty({__proto__:null,default:d3,en:l3,kaa:o3},Symbol.toStringTag,{value:"Module"}));export{eS as d,JX as f,rW as i};