@techzyapp/ui-library 1.0.43 → 1.0.45

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 (625) hide show
  1. package/README.md +15 -14
  2. package/dist/{Accordion-B4vdZXIu.cjs → Accordion-CFyeLfPT.cjs} +2 -2
  3. package/dist/{Accordion-B4vdZXIu.cjs.map → Accordion-CFyeLfPT.cjs.map} +1 -1
  4. package/dist/{Accordion-DhFZ25KV.js → Accordion-DOrTQJB9.js} +2 -2
  5. package/dist/{Accordion-DhFZ25KV.js.map → Accordion-DOrTQJB9.js.map} +1 -1
  6. package/dist/{AdminRoot-BLHvXCvL.js → AdminRoot-BZ1v5vN9.js} +8 -8
  7. package/dist/{AdminRoot-BLHvXCvL.js.map → AdminRoot-BZ1v5vN9.js.map} +1 -1
  8. package/dist/{AdminRoot-D_g_TW30.cjs → AdminRoot-DJ4-UMAB.cjs} +2 -2
  9. package/dist/{AdminRoot-D_g_TW30.cjs.map → AdminRoot-DJ4-UMAB.cjs.map} +1 -1
  10. package/dist/Alert-BU7GlQna.js +70 -0
  11. package/dist/{Alert-D5E1PLkV.js.map → Alert-BU7GlQna.js.map} +1 -1
  12. package/dist/Alert-CVQOjuEq.cjs +2 -0
  13. package/dist/{Alert-B4XZDk16.cjs.map → Alert-CVQOjuEq.cjs.map} +1 -1
  14. package/dist/{AuthLayout-q8pbCGdt.js → AuthLayout-BI1wLuDl.js} +2 -2
  15. package/dist/{AuthLayout-q8pbCGdt.js.map → AuthLayout-BI1wLuDl.js.map} +1 -1
  16. package/dist/{AuthLayout-exuNQicH.cjs → AuthLayout-Bzlsvicf.cjs} +2 -2
  17. package/dist/{AuthLayout-exuNQicH.cjs.map → AuthLayout-Bzlsvicf.cjs.map} +1 -1
  18. package/dist/{Avatar-l48Ice6t.cjs → Avatar-BBqX1732.cjs} +2 -2
  19. package/dist/{Avatar-l48Ice6t.cjs.map → Avatar-BBqX1732.cjs.map} +1 -1
  20. package/dist/{Avatar-ClcmN0ba.js → Avatar-CaYyv5wk.js} +2 -2
  21. package/dist/{Avatar-ClcmN0ba.js.map → Avatar-CaYyv5wk.js.map} +1 -1
  22. package/dist/{AvatarGroup-l-KV3wdl.js → AvatarGroup-6fhm-van.js} +2 -2
  23. package/dist/{AvatarGroup-l-KV3wdl.js.map → AvatarGroup-6fhm-van.js.map} +1 -1
  24. package/dist/{AvatarGroup-CuvFX4di.cjs → AvatarGroup-DrkzAt1-.cjs} +2 -2
  25. package/dist/{AvatarGroup-CuvFX4di.cjs.map → AvatarGroup-DrkzAt1-.cjs.map} +1 -1
  26. package/dist/Breadcrumbs-BMz_YVPa.js +34 -0
  27. package/dist/{Breadcrumbs-M31xyok8.js.map → Breadcrumbs-BMz_YVPa.js.map} +1 -1
  28. package/dist/Breadcrumbs-BbC0o4JE.cjs +2 -0
  29. package/dist/{Breadcrumbs-DSUxcp6u.cjs.map → Breadcrumbs-BbC0o4JE.cjs.map} +1 -1
  30. package/dist/Button-C415LPw_.js +72 -0
  31. package/dist/{Button-CtADzomU.js.map → Button-C415LPw_.js.map} +1 -1
  32. package/dist/Button-mBZOvgyZ.cjs +2 -0
  33. package/dist/{Button-Q_5uA-zc.cjs.map → Button-mBZOvgyZ.cjs.map} +1 -1
  34. package/dist/{Calendar-CHLCv2s9.js → Calendar-B0f6h9-A.js} +5 -5
  35. package/dist/{Calendar-CHLCv2s9.js.map → Calendar-B0f6h9-A.js.map} +1 -1
  36. package/dist/{Calendar-BbbtMsZs.cjs → Calendar-hO051hfk.cjs} +2 -2
  37. package/dist/{Calendar-BbbtMsZs.cjs.map → Calendar-hO051hfk.cjs.map} +1 -1
  38. package/dist/{Card-CntRsQfm.cjs → Card-BdNr5row.cjs} +2 -2
  39. package/dist/{Card-CntRsQfm.cjs.map → Card-BdNr5row.cjs.map} +1 -1
  40. package/dist/{Card-Br9IB0yM.js → Card-ssUNaOF_.js} +4 -4
  41. package/dist/{Card-Br9IB0yM.js.map → Card-ssUNaOF_.js.map} +1 -1
  42. package/dist/Chip-BpJN4rzY.cjs +2 -0
  43. package/dist/{Chip-CrBizrvG.cjs.map → Chip-BpJN4rzY.cjs.map} +1 -1
  44. package/dist/Chip-C0x-6g2h.js +92 -0
  45. package/dist/{Chip-DYZ5w7VM.js.map → Chip-C0x-6g2h.js.map} +1 -1
  46. package/dist/ChoiceCardGroup-Cj_YFj6C.cjs +2 -0
  47. package/dist/{ChoiceCardGroup-C7Eengyd.cjs.map → ChoiceCardGroup-Cj_YFj6C.cjs.map} +1 -1
  48. package/dist/ChoiceCardGroup-D37XREKV.js +180 -0
  49. package/dist/{ChoiceCardGroup-q0yN-TeQ.js.map → ChoiceCardGroup-D37XREKV.js.map} +1 -1
  50. package/dist/CodeBlock-DKnWINdV.js +96 -0
  51. package/dist/{CodeBlock-B6Eqc4HR.js.map → CodeBlock-DKnWINdV.js.map} +1 -1
  52. package/dist/CodeBlock-DTrzN95i.cjs +2 -0
  53. package/dist/{CodeBlock-DW4uaZXM.cjs.map → CodeBlock-DTrzN95i.cjs.map} +1 -1
  54. package/dist/{ColorPicker-GsKIqJu8.js → ColorPicker-Bidev2DJ.js} +3 -3
  55. package/dist/{ColorPicker-GsKIqJu8.js.map → ColorPicker-Bidev2DJ.js.map} +1 -1
  56. package/dist/{ColorPicker-nhWd_nOW.cjs → ColorPicker-Doaegll4.cjs} +2 -2
  57. package/dist/{ColorPicker-nhWd_nOW.cjs.map → ColorPicker-Doaegll4.cjs.map} +1 -1
  58. package/dist/{ColorPickerPanel-BeAu83S6.cjs → ColorPickerPanel-048Fj7wv.cjs} +2 -2
  59. package/dist/{ColorPickerPanel-BeAu83S6.cjs.map → ColorPickerPanel-048Fj7wv.cjs.map} +1 -1
  60. package/dist/{ColorPickerPanel-BEcZePcT.js → ColorPickerPanel-DThSuUoz.js} +3 -3
  61. package/dist/{ColorPickerPanel-BEcZePcT.js.map → ColorPickerPanel-DThSuUoz.js.map} +1 -1
  62. package/dist/{ColorRamp-C-zRPhHj.cjs → ColorRamp-CGw4D9bf.cjs} +2 -2
  63. package/dist/{ColorRamp-C-zRPhHj.cjs.map → ColorRamp-CGw4D9bf.cjs.map} +1 -1
  64. package/dist/{ColorRamp-CeNgd8wF.js → ColorRamp-Reb0q69d.js} +2 -2
  65. package/dist/{ColorRamp-CeNgd8wF.js.map → ColorRamp-Reb0q69d.js.map} +1 -1
  66. package/dist/{ConfigProvider-Ci9Q2HLF.cjs → ConfigProvider-DBU6rOIA.cjs} +2 -2
  67. package/dist/{ConfigProvider-Ci9Q2HLF.cjs.map → ConfigProvider-DBU6rOIA.cjs.map} +1 -1
  68. package/dist/{ConfigProvider-Dqfu7UBU.js → ConfigProvider-DVDGtCUc.js} +2 -2
  69. package/dist/{ConfigProvider-Dqfu7UBU.js.map → ConfigProvider-DVDGtCUc.js.map} +1 -1
  70. package/dist/{CopyButton-Chr7SP5i.cjs → CopyButton-Cnab62vt.cjs} +2 -2
  71. package/dist/{CopyButton-Chr7SP5i.cjs.map → CopyButton-Cnab62vt.cjs.map} +1 -1
  72. package/dist/{CopyButton-Bidt2Vgp.js → CopyButton-Dm8-V4ku.js} +4 -4
  73. package/dist/{CopyButton-Bidt2Vgp.js.map → CopyButton-Dm8-V4ku.js.map} +1 -1
  74. package/dist/DashedButton-BX8hfY1x.cjs +2 -0
  75. package/dist/{DashedButton-Dw7xHgIp.cjs.map → DashedButton-BX8hfY1x.cjs.map} +1 -1
  76. package/dist/DashedButton-wcmXTYBw.js +58 -0
  77. package/dist/{DashedButton-csz6Jt_K.js.map → DashedButton-wcmXTYBw.js.map} +1 -1
  78. package/dist/{DatePicker-D7ZMOhWn.js → DatePicker-C4MTCmDn.js} +6 -6
  79. package/dist/{DatePicker-D7ZMOhWn.js.map → DatePicker-C4MTCmDn.js.map} +1 -1
  80. package/dist/{DatePicker-4rb34nPR.cjs → DatePicker-CaGeW_-j.cjs} +2 -2
  81. package/dist/{DatePicker-4rb34nPR.cjs.map → DatePicker-CaGeW_-j.cjs.map} +1 -1
  82. package/dist/DatePicker.module-BaQyKOUM.cjs +2 -0
  83. package/dist/{DatePicker.module-BDtTsg8M.cjs.map → DatePicker.module-BaQyKOUM.cjs.map} +1 -1
  84. package/dist/DatePicker.module-DoywSvLu.js +138 -0
  85. package/dist/{DatePicker.module-CMMQyEhG.js.map → DatePicker.module-DoywSvLu.js.map} +1 -1
  86. package/dist/{DateTimePicker-gDxM2CGy.js → DateTimePicker-B0CjHKPV.js} +9 -9
  87. package/dist/{DateTimePicker-gDxM2CGy.js.map → DateTimePicker-B0CjHKPV.js.map} +1 -1
  88. package/dist/{DateTimePicker-CVFzKzyA.cjs → DateTimePicker-DXKaAYey.cjs} +2 -2
  89. package/dist/{DateTimePicker-CVFzKzyA.cjs.map → DateTimePicker-DXKaAYey.cjs.map} +1 -1
  90. package/dist/DescriptionList-BSDwobDc.cjs +2 -0
  91. package/dist/{DescriptionList-BBvfABps.cjs.map → DescriptionList-BSDwobDc.cjs.map} +1 -1
  92. package/dist/{DescriptionList-Die3lRBW.js → DescriptionList-BkUS5egS.js} +69 -69
  93. package/dist/{DescriptionList-Die3lRBW.js.map → DescriptionList-BkUS5egS.js.map} +1 -1
  94. package/dist/Dropdown-C_y9_dVn.cjs +2 -0
  95. package/dist/Dropdown-C_y9_dVn.cjs.map +1 -0
  96. package/dist/Dropdown-D-D_Z1Jo.js +154 -0
  97. package/dist/Dropdown-D-D_Z1Jo.js.map +1 -0
  98. package/dist/{EmptyState-D5EKQjX1.cjs → EmptyState-CkkFHKrh.cjs} +2 -2
  99. package/dist/{EmptyState-D5EKQjX1.cjs.map → EmptyState-CkkFHKrh.cjs.map} +1 -1
  100. package/dist/{EmptyState-DRgER10x.js → EmptyState-DXoaPC7o.js} +3 -3
  101. package/dist/{EmptyState-DRgER10x.js.map → EmptyState-DXoaPC7o.js.map} +1 -1
  102. package/dist/{ErrorBoundary-CLfE2NjU.js → ErrorBoundary-CSP_Ctg6.js} +3 -3
  103. package/dist/{ErrorBoundary-CLfE2NjU.js.map → ErrorBoundary-CSP_Ctg6.js.map} +1 -1
  104. package/dist/{ErrorBoundary-DVcGWZd8.cjs → ErrorBoundary-tZjKtO28.cjs} +2 -2
  105. package/dist/{ErrorBoundary-DVcGWZd8.cjs.map → ErrorBoundary-tZjKtO28.cjs.map} +1 -1
  106. package/dist/{ErrorState-DJDQbHZY.cjs → ErrorState-JH4JdrTI.cjs} +2 -2
  107. package/dist/{ErrorState-DJDQbHZY.cjs.map → ErrorState-JH4JdrTI.cjs.map} +1 -1
  108. package/dist/{ErrorState-Dqw0AvmB.js → ErrorState-WYsly5-i.js} +8 -8
  109. package/dist/{ErrorState-Dqw0AvmB.js.map → ErrorState-WYsly5-i.js.map} +1 -1
  110. package/dist/FileCard-BIfPqeek.cjs +2 -0
  111. package/dist/{FileCard-BqMproT9.cjs.map → FileCard-BIfPqeek.cjs.map} +1 -1
  112. package/dist/{FileCard-kVnjcSlk.js → FileCard-D4TB3qGG.js} +33 -33
  113. package/dist/{FileCard-kVnjcSlk.js.map → FileCard-D4TB3qGG.js.map} +1 -1
  114. package/dist/FileUploader-DPVF76Ha.js +701 -0
  115. package/dist/FileUploader-DPVF76Ha.js.map +1 -0
  116. package/dist/FileUploader-YE_DfTNC.cjs +2 -0
  117. package/dist/FileUploader-YE_DfTNC.cjs.map +1 -0
  118. package/dist/{Flag-B1ZvZVXi.cjs → Flag-B6OhgwZr.cjs} +2 -2
  119. package/dist/{Flag-B1ZvZVXi.cjs.map → Flag-B6OhgwZr.cjs.map} +1 -1
  120. package/dist/{Flag-BEIqYQZg.js → Flag-Q3vI7cgt.js} +2 -2
  121. package/dist/{Flag-BEIqYQZg.js.map → Flag-Q3vI7cgt.js.map} +1 -1
  122. package/dist/{FullscreenToggle-BuQonKW8.js → FullscreenToggle-CxwGPLdd.js} +4 -4
  123. package/dist/{FullscreenToggle-BuQonKW8.js.map → FullscreenToggle-CxwGPLdd.js.map} +1 -1
  124. package/dist/{FullscreenToggle-CWlOXLss.cjs → FullscreenToggle-ipX55Nj4.cjs} +2 -2
  125. package/dist/{FullscreenToggle-CWlOXLss.cjs.map → FullscreenToggle-ipX55Nj4.cjs.map} +1 -1
  126. package/dist/Icon-B7DJn8Tw.js +5418 -0
  127. package/dist/Icon-B7DJn8Tw.js.map +1 -0
  128. package/dist/Icon-CBg21lKA.cjs +2 -0
  129. package/dist/Icon-CBg21lKA.cjs.map +1 -0
  130. package/dist/IconButton-U_sr2Ahy.cjs +2 -0
  131. package/dist/{IconButton-CiDPeKM4.cjs.map → IconButton-U_sr2Ahy.cjs.map} +1 -1
  132. package/dist/IconButton-re6xITGO.js +68 -0
  133. package/dist/{IconButton-BoURJOUD.js.map → IconButton-re6xITGO.js.map} +1 -1
  134. package/dist/ImageEditor-1n50vo_v.cjs +64 -0
  135. package/dist/ImageEditor-1n50vo_v.cjs.map +1 -0
  136. package/dist/ImageEditor-BwrG1fk7.js +2729 -0
  137. package/dist/ImageEditor-BwrG1fk7.js.map +1 -0
  138. package/dist/Link-BZjolIAF.js +48 -0
  139. package/dist/{Link-BQlvsu9V.js.map → Link-BZjolIAF.js.map} +1 -1
  140. package/dist/Link-CtttVM6w.cjs +2 -0
  141. package/dist/{Link-GZT51mKx.cjs.map → Link-CtttVM6w.cjs.map} +1 -1
  142. package/dist/{List-CKoNx21F.cjs → List-CLUXeaXS.cjs} +2 -2
  143. package/dist/{List-CKoNx21F.cjs.map → List-CLUXeaXS.cjs.map} +1 -1
  144. package/dist/{List-2Y3ktTcF.js → List-DS91CZUt.js} +2 -2
  145. package/dist/{List-2Y3ktTcF.js.map → List-DS91CZUt.js.map} +1 -1
  146. package/dist/ListItem-CguNjf-u.cjs +2 -0
  147. package/dist/{ListItem-DkCYXucd.cjs.map → ListItem-CguNjf-u.cjs.map} +1 -1
  148. package/dist/ListItem-Ezmdk7q-.js +76 -0
  149. package/dist/{ListItem-2Lr5_NRY.js.map → ListItem-Ezmdk7q-.js.map} +1 -1
  150. package/dist/{Loader-CnTuddK7.js → Loader-7v1QBvHY.js} +2 -2
  151. package/dist/{Loader-CnTuddK7.js.map → Loader-7v1QBvHY.js.map} +1 -1
  152. package/dist/{Loader-CAmRn8Oj.cjs → Loader-BE3SQr7W.cjs} +2 -2
  153. package/dist/{Loader-CAmRn8Oj.cjs.map → Loader-BE3SQr7W.cjs.map} +1 -1
  154. package/dist/{LocationPicker-Cns3fkYI.js → LocationPicker-BvKtZFq0.js} +8 -8
  155. package/dist/{LocationPicker-Cns3fkYI.js.map → LocationPicker-BvKtZFq0.js.map} +1 -1
  156. package/dist/{LocationPicker-BwQ6ULMF.cjs → LocationPicker-CVJ4jVn2.cjs} +2 -2
  157. package/dist/{LocationPicker-BwQ6ULMF.cjs.map → LocationPicker-CVJ4jVn2.cjs.map} +1 -1
  158. package/dist/Modal-CxODxl81.cjs +2 -0
  159. package/dist/Modal-CxODxl81.cjs.map +1 -0
  160. package/dist/Modal-DpoiMMM3.js +154 -0
  161. package/dist/Modal-DpoiMMM3.js.map +1 -0
  162. package/dist/MultiSelect-2GouMRTl.cjs +2 -0
  163. package/dist/{MultiSelect-DJ6tRseY.cjs.map → MultiSelect-2GouMRTl.cjs.map} +1 -1
  164. package/dist/MultiSelect-B7KwEhL5.js +219 -0
  165. package/dist/{MultiSelect-svEVZNbp.js.map → MultiSelect-B7KwEhL5.js.map} +1 -1
  166. package/dist/{NumberField-9ekoB1wS.js → NumberField-ThojS4K3.js} +4 -4
  167. package/dist/{NumberField-9ekoB1wS.js.map → NumberField-ThojS4K3.js.map} +1 -1
  168. package/dist/{NumberField-sokUuuBR.cjs → NumberField-o2z2QNK1.cjs} +2 -2
  169. package/dist/{NumberField-sokUuuBR.cjs.map → NumberField-o2z2QNK1.cjs.map} +1 -1
  170. package/dist/OtpField-BhZq44vV.cjs +2 -0
  171. package/dist/{OtpField-DlkGju72.cjs.map → OtpField-BhZq44vV.cjs.map} +1 -1
  172. package/dist/{OtpField-DA7zJwy9.js → OtpField-C3MlMZ2F.js} +61 -61
  173. package/dist/{OtpField-DA7zJwy9.js.map → OtpField-C3MlMZ2F.js.map} +1 -1
  174. package/dist/Overlay-CywFQfjm.cjs +2 -0
  175. package/dist/Overlay-CywFQfjm.cjs.map +1 -0
  176. package/dist/Overlay-DiL0ZARH.js +60 -0
  177. package/dist/Overlay-DiL0ZARH.js.map +1 -0
  178. package/dist/{PageError-vD8Dpfns.js → PageError-63Gk6fVC.js} +5 -5
  179. package/dist/{PageError-vD8Dpfns.js.map → PageError-63Gk6fVC.js.map} +1 -1
  180. package/dist/{PageError-DUN5PzDF.cjs → PageError-CCKWbrc5.cjs} +2 -2
  181. package/dist/{PageError-DUN5PzDF.cjs.map → PageError-CCKWbrc5.cjs.map} +1 -1
  182. package/dist/{PageLayout-CdObvxt7.js → PageLayout-BekkDBtT.js} +5 -5
  183. package/dist/{PageLayout-CdObvxt7.js.map → PageLayout-BekkDBtT.js.map} +1 -1
  184. package/dist/{PageLayout-BesuKuX6.cjs → PageLayout-CDPUYu6A.cjs} +2 -2
  185. package/dist/{PageLayout-BesuKuX6.cjs.map → PageLayout-CDPUYu6A.cjs.map} +1 -1
  186. package/dist/{PageNotFound-Cc5eZ6w3.js → PageNotFound-BD3zX3cd.js} +5 -5
  187. package/dist/{PageNotFound-Cc5eZ6w3.js.map → PageNotFound-BD3zX3cd.js.map} +1 -1
  188. package/dist/{PageNotFound-CfOAhmJ-.cjs → PageNotFound-CTR6htwa.cjs} +2 -2
  189. package/dist/{PageNotFound-CfOAhmJ-.cjs.map → PageNotFound-CTR6htwa.cjs.map} +1 -1
  190. package/dist/Pagination-BJvLUjQ0.cjs +2 -0
  191. package/dist/{Pagination-CAD9_Nr_.cjs.map → Pagination-BJvLUjQ0.cjs.map} +1 -1
  192. package/dist/Pagination-qKjISBJ9.js +139 -0
  193. package/dist/{Pagination-CX0S1RrF.js.map → Pagination-qKjISBJ9.js.map} +1 -1
  194. package/dist/{PaletteField-CpiEkXcB.cjs → PaletteField-CDS9CJW9.cjs} +2 -2
  195. package/dist/{PaletteField-CpiEkXcB.cjs.map → PaletteField-CDS9CJW9.cjs.map} +1 -1
  196. package/dist/{PaletteField-CVIwl2nV.js → PaletteField-y8KpR4Ap.js} +3 -3
  197. package/dist/{PaletteField-CVIwl2nV.js.map → PaletteField-y8KpR4Ap.js.map} +1 -1
  198. package/dist/PhoneField-Df3J6Hhg.cjs +2 -0
  199. package/dist/{PhoneField-Dlnnv4DU.cjs.map → PhoneField-Df3J6Hhg.cjs.map} +1 -1
  200. package/dist/{PhoneField-xHLTU-o5.js → PhoneField-OjsuevPx.js} +106 -106
  201. package/dist/{PhoneField-xHLTU-o5.js.map → PhoneField-OjsuevPx.js.map} +1 -1
  202. package/dist/{Popconfirm-Chlm_M5T.cjs → Popconfirm-BKzJ_EZy.cjs} +2 -2
  203. package/dist/{Popconfirm-Chlm_M5T.cjs.map → Popconfirm-BKzJ_EZy.cjs.map} +1 -1
  204. package/dist/{Popconfirm-DIlygJY8.js → Popconfirm-aCyniPnH.js} +4 -4
  205. package/dist/{Popconfirm-DIlygJY8.js.map → Popconfirm-aCyniPnH.js.map} +1 -1
  206. package/dist/{Progress-DqvKmyQW.cjs → Progress-DWOoLd8u.cjs} +2 -2
  207. package/dist/{Progress-DqvKmyQW.cjs.map → Progress-DWOoLd8u.cjs.map} +1 -1
  208. package/dist/{Progress-BAEhawtj.js → Progress-DzxbkcaD.js} +2 -2
  209. package/dist/{Progress-BAEhawtj.js.map → Progress-DzxbkcaD.js.map} +1 -1
  210. package/dist/{QrCode-Dqsk49vX.cjs → QrCode-C8uAPiHq.cjs} +2 -2
  211. package/dist/{QrCode-Dqsk49vX.cjs.map → QrCode-C8uAPiHq.cjs.map} +1 -1
  212. package/dist/{QrCode-D7BTYcW2.js → QrCode-DaJYqBc1.js} +2 -2
  213. package/dist/{QrCode-D7BTYcW2.js.map → QrCode-DaJYqBc1.js.map} +1 -1
  214. package/dist/{RemoveDialog-DZ-EqIfS.cjs → RemoveDialog-BnOtR6-q.cjs} +2 -2
  215. package/dist/{RemoveDialog-DZ-EqIfS.cjs.map → RemoveDialog-BnOtR6-q.cjs.map} +1 -1
  216. package/dist/{RemoveDialog-CQIm9GTH.js → RemoveDialog-MhEU5Zl3.js} +6 -6
  217. package/dist/{RemoveDialog-CQIm9GTH.js.map → RemoveDialog-MhEU5Zl3.js.map} +1 -1
  218. package/dist/RichTextEditor-Cnrnvv1f.cjs +2 -0
  219. package/dist/RichTextEditor-Cnrnvv1f.cjs.map +1 -0
  220. package/dist/RichTextEditor-zkoxujnO.js +1148 -0
  221. package/dist/RichTextEditor-zkoxujnO.js.map +1 -0
  222. package/dist/{RootLayout-Cl98ghy1.js → RootLayout-C4r9i5Go.js} +21 -21
  223. package/dist/{RootLayout-Cl98ghy1.js.map → RootLayout-C4r9i5Go.js.map} +1 -1
  224. package/dist/{RootLayout-s_Q_kSoS.cjs → RootLayout-Z9PuRfsa.cjs} +2 -2
  225. package/dist/{RootLayout-s_Q_kSoS.cjs.map → RootLayout-Z9PuRfsa.cjs.map} +1 -1
  226. package/dist/Select-CylqFHce.cjs +2 -0
  227. package/dist/{Select-BrjXCXtl.cjs.map → Select-CylqFHce.cjs.map} +1 -1
  228. package/dist/{Select-CG8UJL9R.js → Select-jT94L1vq.js} +47 -47
  229. package/dist/{Select-CG8UJL9R.js.map → Select-jT94L1vq.js.map} +1 -1
  230. package/dist/{Sidebar-CbPr34jd.js → Sidebar-B1O2RsbR.js} +59 -59
  231. package/dist/{Sidebar-CbPr34jd.js.map → Sidebar-B1O2RsbR.js.map} +1 -1
  232. package/dist/Sidebar-Bcm0fgVm.cjs +2 -0
  233. package/dist/{Sidebar-DLlqHvQJ.cjs.map → Sidebar-Bcm0fgVm.cjs.map} +1 -1
  234. package/dist/{Slider-DTnui01g.cjs → Slider-CV7ug0WF.cjs} +2 -2
  235. package/dist/{Slider-DTnui01g.cjs.map → Slider-CV7ug0WF.cjs.map} +1 -1
  236. package/dist/{Slider-B5iG-HSw.js → Slider-DC-ugZwT.js} +2 -2
  237. package/dist/{Slider-B5iG-HSw.js.map → Slider-DC-ugZwT.js.map} +1 -1
  238. package/dist/{SpeedDial-Be3SHkzw.js → SpeedDial-C6yiMUe8.js} +3 -3
  239. package/dist/{SpeedDial-Be3SHkzw.js.map → SpeedDial-C6yiMUe8.js.map} +1 -1
  240. package/dist/{SpeedDial-i5kxikmt.cjs → SpeedDial-DOgm2DDX.cjs} +2 -2
  241. package/dist/{SpeedDial-i5kxikmt.cjs.map → SpeedDial-DOgm2DDX.cjs.map} +1 -1
  242. package/dist/Stepper-BZdYGpBN.js +168 -0
  243. package/dist/{Stepper-BDQt-oVG.js.map → Stepper-BZdYGpBN.js.map} +1 -1
  244. package/dist/Stepper-DqM86TGV.cjs +2 -0
  245. package/dist/{Stepper-e8qBsKYW.cjs.map → Stepper-DqM86TGV.cjs.map} +1 -1
  246. package/dist/{SwatchPicker-0gnOvv7U.cjs → SwatchPicker-DCjE0T80.cjs} +2 -2
  247. package/dist/{SwatchPicker-0gnOvv7U.cjs.map → SwatchPicker-DCjE0T80.cjs.map} +1 -1
  248. package/dist/{SwatchPicker-BZHRELA-.js → SwatchPicker-DS4WY2eM.js} +2 -2
  249. package/dist/{SwatchPicker-BZHRELA-.js.map → SwatchPicker-DS4WY2eM.js.map} +1 -1
  250. package/dist/Table-BgaCwRDQ.cjs +2 -0
  251. package/dist/Table-BgaCwRDQ.cjs.map +1 -0
  252. package/dist/{Table-ChdM_vyi.js → Table-FZlVWoYi.js} +346 -346
  253. package/dist/Table-FZlVWoYi.js.map +1 -0
  254. package/dist/Tabs-BqQPkorY.js +193 -0
  255. package/dist/{Tabs-BxZrgozI.js.map → Tabs-BqQPkorY.js.map} +1 -1
  256. package/dist/Tabs-kGeyFhJ6.cjs +2 -0
  257. package/dist/{Tabs-C4kB1yfG.cjs.map → Tabs-kGeyFhJ6.cjs.map} +1 -1
  258. package/dist/{TagsField-Bg5BcQU-.cjs → TagsField-B_sjp48X.cjs} +2 -2
  259. package/dist/{TagsField-Bg5BcQU-.cjs.map → TagsField-B_sjp48X.cjs.map} +1 -1
  260. package/dist/{TagsField-DWlIt7XO.js → TagsField-ByTx9JXK.js} +5 -5
  261. package/dist/{TagsField-DWlIt7XO.js.map → TagsField-ByTx9JXK.js.map} +1 -1
  262. package/dist/{TextField-B-xqoDZR.cjs → TextField-CBYJIfau.cjs} +2 -2
  263. package/dist/{TextField-B-xqoDZR.cjs.map → TextField-CBYJIfau.cjs.map} +1 -1
  264. package/dist/{TextField-Dwx5GPxz.js → TextField-CyKIx-d-.js} +4 -4
  265. package/dist/{TextField-Dwx5GPxz.js.map → TextField-CyKIx-d-.js.map} +1 -1
  266. package/dist/{ThemeToggle-DFgv1bsh.cjs → ThemeToggle-D2dIqiBa.cjs} +2 -2
  267. package/dist/{ThemeToggle-DFgv1bsh.cjs.map → ThemeToggle-D2dIqiBa.cjs.map} +1 -1
  268. package/dist/{ThemeToggle-CK2USfgx.js → ThemeToggle-Dg6IishB.js} +4 -4
  269. package/dist/{ThemeToggle-CK2USfgx.js.map → ThemeToggle-Dg6IishB.js.map} +1 -1
  270. package/dist/TimeColumns-Cx8J5qzW.js +147 -0
  271. package/dist/{TimeColumns-BWcuu3l7.js.map → TimeColumns-Cx8J5qzW.js.map} +1 -1
  272. package/dist/TimeColumns-DVmK_T_P.cjs +2 -0
  273. package/dist/{TimeColumns-B8KTj-tc.cjs.map → TimeColumns-DVmK_T_P.cjs.map} +1 -1
  274. package/dist/{TimePicker-DjL15hz1.cjs → TimePicker-0nZOPRKp.cjs} +2 -2
  275. package/dist/{TimePicker-DjL15hz1.cjs.map → TimePicker-0nZOPRKp.cjs.map} +1 -1
  276. package/dist/{TimePicker-YMVHevpZ.js → TimePicker-sAhtvqQ4.js} +7 -7
  277. package/dist/{TimePicker-YMVHevpZ.js.map → TimePicker-sAhtvqQ4.js.map} +1 -1
  278. package/dist/Timeline-DOojNvLG.cjs +2 -0
  279. package/dist/Timeline-DOojNvLG.cjs.map +1 -0
  280. package/dist/Timeline-Dg03dwTN.js +87 -0
  281. package/dist/Timeline-Dg03dwTN.js.map +1 -0
  282. package/dist/{Toaster-pHN2pxrU.js → Toaster-BOW9rzLq.js} +3 -3
  283. package/dist/{Toaster-pHN2pxrU.js.map → Toaster-BOW9rzLq.js.map} +1 -1
  284. package/dist/{Toaster-9hZ5MuW7.cjs → Toaster-DYGo92ke.cjs} +2 -2
  285. package/dist/{Toaster-9hZ5MuW7.cjs.map → Toaster-DYGo92ke.cjs.map} +1 -1
  286. package/dist/ToggleButtonGroup-CGNRLxjg.cjs +2 -0
  287. package/dist/{ToggleButtonGroup-Ci_DFvdt.cjs.map → ToggleButtonGroup-CGNRLxjg.cjs.map} +1 -1
  288. package/dist/{ToggleButtonGroup-Mdskkjdh.js → ToggleButtonGroup-K6ZcrTZT.js} +37 -37
  289. package/dist/{ToggleButtonGroup-Mdskkjdh.js.map → ToggleButtonGroup-K6ZcrTZT.js.map} +1 -1
  290. package/dist/{TranslatedFields-SvS37hab.cjs → TranslatedFields-C_DuLotV.cjs} +2 -2
  291. package/dist/{TranslatedFields-SvS37hab.cjs.map → TranslatedFields-C_DuLotV.cjs.map} +1 -1
  292. package/dist/{TranslatedFields-BpWU5ZcG.js → TranslatedFields-CcE0td9p.js} +5 -5
  293. package/dist/{TranslatedFields-BpWU5ZcG.js.map → TranslatedFields-CcE0td9p.js.map} +1 -1
  294. package/dist/{UserCard-VPaexedS.cjs → UserCard-DLVptkLr.cjs} +2 -2
  295. package/dist/{UserCard-VPaexedS.cjs.map → UserCard-DLVptkLr.cjs.map} +1 -1
  296. package/dist/{UserCard-cmZrMvwL.js → UserCard-DeONbaKj.js} +5 -5
  297. package/dist/{UserCard-cmZrMvwL.js.map → UserCard-DeONbaKj.js.map} +1 -1
  298. package/dist/chunks/icons/{25-knEB8mSp.js → 25-BMMPtr_E.js} +4 -5
  299. package/dist/chunks/icons/{25-Dho_3EHD.cjs → 25-uATZNfXE.cjs} +1 -1
  300. package/dist/chunks/icons/{2b-CQJdcF1h.js → 2b-Brkug4c-.js} +10 -11
  301. package/dist/chunks/icons/{2b-C2_97u16.cjs → 2b-CIVRGp1R.cjs} +1 -1
  302. package/dist/chunks/icons/57-BLoIUlhF.js +27 -0
  303. package/dist/chunks/icons/57-D4zLdDZ1.cjs +1 -0
  304. package/dist/chunks/icons/{75-DqLkMUyj.cjs → 75-C2eJ2Tvr.cjs} +1 -1
  305. package/dist/chunks/icons/{75-D5RQw6IJ.js → 75-D16WojvG.js} +6 -7
  306. package/dist/chunks/icons/{7c-DpnA_JOJ.js → 7c-0j5Sno5_.js} +6 -7
  307. package/dist/chunks/icons/{7c-DEaFwltT.cjs → 7c-LUfAyp72.cjs} +1 -1
  308. package/dist/chunks/icons/8a-BJ_LOjmW.js +26 -0
  309. package/dist/chunks/icons/8a-CYkhOibI.cjs +1 -0
  310. package/dist/chunks/icons/97-Bx7FkkGJ.js +12 -0
  311. package/dist/chunks/icons/97-D7pUHrOX.cjs +1 -0
  312. package/dist/chunks/icons/{b7-BtHkI92Y.js → b7-DmmkevXf.js} +17 -18
  313. package/dist/chunks/icons/{b7-B-dB5jrV.cjs → b7-rI1GpsxW.cjs} +1 -1
  314. package/dist/chunks/icons/b8-De0yKEKv.js +28 -0
  315. package/dist/chunks/icons/b8-eR814BVJ.cjs +1 -0
  316. package/dist/chunks/icons/{b9-Bw942fE3.js → b9-CJO6ZdSw.js} +10 -11
  317. package/dist/chunks/icons/{b9-Be-J4RIp.cjs → b9-DZdWz9qg.cjs} +1 -1
  318. package/dist/chunks/icons/d5-BAPeb6B0.cjs +1 -0
  319. package/dist/chunks/icons/d5-BJJanOLe.js +21 -0
  320. package/dist/chunks/icons/d8--vRkIVal.js +19 -0
  321. package/dist/chunks/icons/d8-BfMys92X.cjs +1 -0
  322. package/dist/chunks/icons/dd-CARhkHmU.js +21 -0
  323. package/dist/chunks/icons/dd-D61yllMP.cjs +1 -0
  324. package/dist/components/Accordion/index.cjs +1 -1
  325. package/dist/components/Accordion/index.js +1 -1
  326. package/dist/components/Alert/index.cjs +1 -1
  327. package/dist/components/Alert/index.js +1 -1
  328. package/dist/components/AuthLayout/index.cjs +1 -1
  329. package/dist/components/AuthLayout/index.js +1 -1
  330. package/dist/components/Avatar/index.cjs +1 -1
  331. package/dist/components/Avatar/index.js +2 -2
  332. package/dist/components/Breadcrumbs/index.cjs +1 -1
  333. package/dist/components/Breadcrumbs/index.js +1 -1
  334. package/dist/components/Button/index.cjs +1 -1
  335. package/dist/components/Button/index.js +1 -1
  336. package/dist/components/Card/index.cjs +1 -1
  337. package/dist/components/Card/index.js +1 -1
  338. package/dist/components/Chip/index.cjs +1 -1
  339. package/dist/components/Chip/index.js +1 -1
  340. package/dist/components/ChoiceCard/index.cjs +1 -1
  341. package/dist/components/ChoiceCard/index.js +1 -1
  342. package/dist/components/CodeBlock/index.cjs +1 -1
  343. package/dist/components/CodeBlock/index.js +1 -1
  344. package/dist/components/ColorPicker/index.cjs +1 -1
  345. package/dist/components/ColorPicker/index.js +1 -1
  346. package/dist/components/ColorRamp/index.cjs +1 -1
  347. package/dist/components/ColorRamp/index.js +1 -1
  348. package/dist/components/CopyButton/index.cjs +1 -1
  349. package/dist/components/CopyButton/index.js +1 -1
  350. package/dist/components/DashedButton/index.cjs +1 -1
  351. package/dist/components/DashedButton/index.js +1 -1
  352. package/dist/components/DatePicker/index.cjs +1 -1
  353. package/dist/components/DatePicker/index.js +1 -1
  354. package/dist/components/DateTimePicker/index.cjs +1 -1
  355. package/dist/components/DateTimePicker/index.js +1 -1
  356. package/dist/components/DescriptionList/index.cjs +1 -1
  357. package/dist/components/DescriptionList/index.js +1 -1
  358. package/dist/components/Dropdown/index.cjs +1 -1
  359. package/dist/components/Dropdown/index.js +1 -1
  360. package/dist/components/EmptyState/index.cjs +1 -1
  361. package/dist/components/EmptyState/index.js +1 -1
  362. package/dist/components/ErrorState/index.cjs +1 -1
  363. package/dist/components/ErrorState/index.js +2 -2
  364. package/dist/components/FileCard/index.cjs +1 -1
  365. package/dist/components/FileCard/index.js +1 -1
  366. package/dist/components/FileUploader/FileUploader.d.cts +33 -5
  367. package/dist/components/FileUploader/FileUploader.d.ts +33 -5
  368. package/dist/components/FileUploader/FileUploaderEditDialog.d.cts +8 -18
  369. package/dist/components/FileUploader/FileUploaderEditDialog.d.ts +8 -18
  370. package/dist/components/FileUploader/index.cjs +1 -1
  371. package/dist/components/FileUploader/index.js +1 -1
  372. package/dist/components/Flag/index.cjs +1 -1
  373. package/dist/components/Flag/index.js +1 -1
  374. package/dist/components/FullscreenToggle/index.cjs +1 -1
  375. package/dist/components/FullscreenToggle/index.js +1 -1
  376. package/dist/components/Icon/index.cjs +1 -1
  377. package/dist/components/Icon/index.js +1 -1
  378. package/dist/components/IconButton/index.cjs +1 -1
  379. package/dist/components/IconButton/index.js +1 -1
  380. package/dist/components/ImageEditor/CropShapeMenu.d.cts +17 -0
  381. package/dist/components/ImageEditor/CropShapeMenu.d.ts +17 -0
  382. package/dist/components/ImageEditor/EditorStage.d.cts +27 -0
  383. package/dist/components/ImageEditor/EditorStage.d.ts +27 -0
  384. package/dist/components/ImageEditor/FilterStrip.d.cts +14 -0
  385. package/dist/components/ImageEditor/FilterStrip.d.ts +14 -0
  386. package/dist/components/ImageEditor/ImageEditor.d.cts +30 -0
  387. package/dist/components/ImageEditor/ImageEditor.d.ts +30 -0
  388. package/dist/components/ImageEditor/ResizePanel.d.cts +19 -0
  389. package/dist/components/ImageEditor/ResizePanel.d.ts +19 -0
  390. package/dist/components/ImageEditor/RulerSlider.d.cts +37 -0
  391. package/dist/components/ImageEditor/RulerSlider.d.ts +37 -0
  392. package/dist/components/ImageEditor/core/affine.d.cts +11 -0
  393. package/dist/components/ImageEditor/core/affine.d.ts +11 -0
  394. package/dist/components/ImageEditor/core/editor.d.cts +69 -0
  395. package/dist/components/ImageEditor/core/editor.d.ts +69 -0
  396. package/dist/components/ImageEditor/core/geometry.d.cts +112 -0
  397. package/dist/components/ImageEditor/core/geometry.d.ts +112 -0
  398. package/dist/components/ImageEditor/core/load.d.cts +26 -0
  399. package/dist/components/ImageEditor/core/load.d.ts +26 -0
  400. package/dist/components/ImageEditor/core/matrix.d.cts +55 -0
  401. package/dist/components/ImageEditor/core/matrix.d.ts +55 -0
  402. package/dist/components/ImageEditor/core/pixels.d.cts +24 -0
  403. package/dist/components/ImageEditor/core/pixels.d.ts +24 -0
  404. package/dist/components/ImageEditor/core/redact.d.cts +37 -0
  405. package/dist/components/ImageEditor/core/redact.d.ts +37 -0
  406. package/dist/components/ImageEditor/core/render.d.cts +19 -0
  407. package/dist/components/ImageEditor/core/render.d.ts +19 -0
  408. package/dist/components/ImageEditor/core/scene.d.cts +47 -0
  409. package/dist/components/ImageEditor/core/scene.d.ts +47 -0
  410. package/dist/components/ImageEditor/core/spring.d.cts +17 -0
  411. package/dist/components/ImageEditor/core/spring.d.ts +17 -0
  412. package/dist/components/ImageEditor/core/types.d.cts +104 -0
  413. package/dist/components/ImageEditor/core/types.d.ts +104 -0
  414. package/dist/components/ImageEditor/core/webgl.d.cts +55 -0
  415. package/dist/components/ImageEditor/core/webgl.d.ts +55 -0
  416. package/dist/components/ImageEditor/index.cjs +2 -0
  417. package/dist/components/ImageEditor/index.cjs.map +1 -0
  418. package/dist/components/ImageEditor/index.d.cts +6 -0
  419. package/dist/components/ImageEditor/index.d.ts +6 -0
  420. package/dist/components/ImageEditor/index.js +9 -0
  421. package/dist/components/ImageEditor/index.js.map +1 -0
  422. package/dist/components/Link/index.cjs +1 -1
  423. package/dist/components/Link/index.js +1 -1
  424. package/dist/components/List/index.cjs +1 -1
  425. package/dist/components/List/index.js +2 -2
  426. package/dist/components/Loader/index.cjs +1 -1
  427. package/dist/components/Loader/index.js +1 -1
  428. package/dist/components/LocationPicker/index.cjs +1 -1
  429. package/dist/components/LocationPicker/index.js +1 -1
  430. package/dist/components/Modal/index.cjs +1 -1
  431. package/dist/components/Modal/index.js +1 -1
  432. package/dist/components/MultiSelect/index.cjs +1 -1
  433. package/dist/components/MultiSelect/index.js +1 -1
  434. package/dist/components/NumberField/index.cjs +1 -1
  435. package/dist/components/NumberField/index.js +1 -1
  436. package/dist/components/OtpField/index.cjs +1 -1
  437. package/dist/components/OtpField/index.js +1 -1
  438. package/dist/components/PageError/index.cjs +1 -1
  439. package/dist/components/PageError/index.js +1 -1
  440. package/dist/components/PageLayout/index.cjs +1 -1
  441. package/dist/components/PageLayout/index.js +1 -1
  442. package/dist/components/PageNotFound/index.cjs +1 -1
  443. package/dist/components/PageNotFound/index.js +1 -1
  444. package/dist/components/Pagination/index.cjs +1 -1
  445. package/dist/components/Pagination/index.js +1 -1
  446. package/dist/components/PaletteField/index.cjs +1 -1
  447. package/dist/components/PaletteField/index.js +1 -1
  448. package/dist/components/PhoneField/index.cjs +1 -1
  449. package/dist/components/PhoneField/index.js +1 -1
  450. package/dist/components/Popconfirm/index.cjs +1 -1
  451. package/dist/components/Popconfirm/index.js +1 -1
  452. package/dist/components/Progress/index.cjs +1 -1
  453. package/dist/components/Progress/index.js +1 -1
  454. package/dist/components/QrCode/index.cjs +1 -1
  455. package/dist/components/QrCode/index.js +1 -1
  456. package/dist/components/RemoveDialog/index.cjs +1 -1
  457. package/dist/components/RemoveDialog/index.js +1 -1
  458. package/dist/components/RichTextEditor/RichTextEditor.d.cts +3 -2
  459. package/dist/components/RichTextEditor/RichTextEditor.d.ts +3 -2
  460. package/dist/components/RichTextEditor/index.cjs +1 -1
  461. package/dist/components/RichTextEditor/index.js +1 -1
  462. package/dist/components/RichTextEditor/nodes/ImageNode.d.cts +22 -7
  463. package/dist/components/RichTextEditor/nodes/ImageNode.d.ts +22 -7
  464. package/dist/components/RichTextEditor/nodes/VideoNode.d.cts +4 -4
  465. package/dist/components/RichTextEditor/nodes/VideoNode.d.ts +4 -4
  466. package/dist/components/RootLayout/index.cjs +1 -1
  467. package/dist/components/RootLayout/index.js +1 -1
  468. package/dist/components/Select/index.cjs +1 -1
  469. package/dist/components/Select/index.js +1 -1
  470. package/dist/components/Sidebar/index.cjs +1 -1
  471. package/dist/components/Sidebar/index.js +1 -1
  472. package/dist/components/Slider/index.cjs +1 -1
  473. package/dist/components/Slider/index.js +1 -1
  474. package/dist/components/SpeedDial/index.cjs +1 -1
  475. package/dist/components/SpeedDial/index.js +1 -1
  476. package/dist/components/Stepper/index.cjs +1 -1
  477. package/dist/components/Stepper/index.js +1 -1
  478. package/dist/components/SwatchPicker/index.cjs +1 -1
  479. package/dist/components/SwatchPicker/index.js +1 -1
  480. package/dist/components/Table/index.cjs +1 -1
  481. package/dist/components/Table/index.js +1 -1
  482. package/dist/components/Tabs/index.cjs +1 -1
  483. package/dist/components/Tabs/index.js +1 -1
  484. package/dist/components/TagsField/index.cjs +1 -1
  485. package/dist/components/TagsField/index.js +1 -1
  486. package/dist/components/TextField/index.cjs +1 -1
  487. package/dist/components/TextField/index.js +1 -1
  488. package/dist/components/ThemeToggle/index.cjs +1 -1
  489. package/dist/components/ThemeToggle/index.js +1 -1
  490. package/dist/components/TimePicker/index.cjs +1 -1
  491. package/dist/components/TimePicker/index.js +1 -1
  492. package/dist/components/Timeline/Timeline.d.cts +16 -4
  493. package/dist/components/Timeline/Timeline.d.ts +16 -4
  494. package/dist/components/Timeline/TimelineItem.d.cts +12 -6
  495. package/dist/components/Timeline/TimelineItem.d.ts +12 -6
  496. package/dist/components/Timeline/index.cjs +1 -1
  497. package/dist/components/Timeline/index.d.cts +1 -1
  498. package/dist/components/Timeline/index.d.ts +1 -1
  499. package/dist/components/Timeline/index.js +1 -1
  500. package/dist/components/Timeline/timelineContext.d.cts +3 -2
  501. package/dist/components/Timeline/timelineContext.d.ts +3 -2
  502. package/dist/components/Toast/index.cjs +1 -1
  503. package/dist/components/Toast/index.js +1 -1
  504. package/dist/components/ToggleButton/index.cjs +1 -1
  505. package/dist/components/ToggleButton/index.js +1 -1
  506. package/dist/components/TranslatedFields/index.cjs +1 -1
  507. package/dist/components/TranslatedFields/index.js +1 -1
  508. package/dist/components/UserCard/index.cjs +1 -1
  509. package/dist/components/UserCard/index.js +1 -1
  510. package/dist/components/index.d.cts +1 -0
  511. package/dist/components/index.d.ts +1 -0
  512. package/dist/entries/app.cjs +1 -1
  513. package/dist/entries/app.js +1 -1
  514. package/dist/entries/components.cjs +1 -1
  515. package/dist/entries/components.js +164 -159
  516. package/dist/entries/components.js.map +1 -1
  517. package/dist/entries/i18n.cjs +1 -1
  518. package/dist/entries/i18n.js +2 -2
  519. package/dist/entries/icons.cjs +1 -1
  520. package/dist/entries/icons.js +1 -1
  521. package/dist/entries/theme.cjs +1 -1
  522. package/dist/entries/theme.js +1 -1
  523. package/dist/i18n/messages.d.cts +66 -4
  524. package/dist/i18n/messages.d.ts +66 -4
  525. package/dist/icons/names.d.cts +3 -3
  526. package/dist/icons/names.d.ts +3 -3
  527. package/dist/index.cjs +1 -1
  528. package/dist/index.css +1 -1
  529. package/dist/index.js +161 -156
  530. package/dist/index.js.map +1 -1
  531. package/dist/{messages-BiRLMy1E.js → messages-DeQuvGln.js} +139 -47
  532. package/dist/messages-DeQuvGln.js.map +1 -0
  533. package/dist/{messages-C_fRRCg6.cjs → messages-dL9MkVze.cjs} +9 -9
  534. package/dist/messages-dL9MkVze.cjs.map +1 -0
  535. package/dist/{useHomeTo-DdmOGy09.js → useHomeTo-BL3e8Sc6.js} +2 -2
  536. package/dist/{useHomeTo-DdmOGy09.js.map → useHomeTo-BL3e8Sc6.js.map} +1 -1
  537. package/dist/{useHomeTo-HCkVzGTu.cjs → useHomeTo-W1PDW5CU.cjs} +2 -2
  538. package/dist/{useHomeTo-HCkVzGTu.cjs.map → useHomeTo-W1PDW5CU.cjs.map} +1 -1
  539. package/dist/{useOptionMenu-EiyIkC3E.js → useOptionMenu-BkKiZ6Ax.js} +6 -6
  540. package/dist/{useOptionMenu-EiyIkC3E.js.map → useOptionMenu-BkKiZ6Ax.js.map} +1 -1
  541. package/dist/{useOptionMenu-BqCj10_a.cjs → useOptionMenu-CVl7VHXl.cjs} +2 -2
  542. package/dist/{useOptionMenu-BqCj10_a.cjs.map → useOptionMenu-CVl7VHXl.cjs.map} +1 -1
  543. package/package.json +1 -6
  544. package/dist/Alert-B4XZDk16.cjs +0 -2
  545. package/dist/Alert-D5E1PLkV.js +0 -70
  546. package/dist/Breadcrumbs-DSUxcp6u.cjs +0 -2
  547. package/dist/Breadcrumbs-M31xyok8.js +0 -34
  548. package/dist/Button-CtADzomU.js +0 -72
  549. package/dist/Button-Q_5uA-zc.cjs +0 -2
  550. package/dist/Chip-CrBizrvG.cjs +0 -2
  551. package/dist/Chip-DYZ5w7VM.js +0 -92
  552. package/dist/ChoiceCardGroup-C7Eengyd.cjs +0 -2
  553. package/dist/ChoiceCardGroup-q0yN-TeQ.js +0 -180
  554. package/dist/CodeBlock-B6Eqc4HR.js +0 -96
  555. package/dist/CodeBlock-DW4uaZXM.cjs +0 -2
  556. package/dist/DashedButton-Dw7xHgIp.cjs +0 -2
  557. package/dist/DashedButton-csz6Jt_K.js +0 -58
  558. package/dist/DatePicker.module-BDtTsg8M.cjs +0 -2
  559. package/dist/DatePicker.module-CMMQyEhG.js +0 -138
  560. package/dist/DescriptionList-BBvfABps.cjs +0 -2
  561. package/dist/Dropdown-CMjURWYd.cjs +0 -2
  562. package/dist/Dropdown-CMjURWYd.cjs.map +0 -1
  563. package/dist/Dropdown-CnDBlB02.js +0 -146
  564. package/dist/Dropdown-CnDBlB02.js.map +0 -1
  565. package/dist/FileCard-BqMproT9.cjs +0 -2
  566. package/dist/FileUploader-BimFH5d8.cjs +0 -2
  567. package/dist/FileUploader-BimFH5d8.cjs.map +0 -1
  568. package/dist/FileUploader-LJIMh5_b.js +0 -707
  569. package/dist/FileUploader-LJIMh5_b.js.map +0 -1
  570. package/dist/Icon-B6lz-V0A.cjs +0 -2
  571. package/dist/Icon-B6lz-V0A.cjs.map +0 -1
  572. package/dist/Icon-D5TxgfCc.js +0 -5404
  573. package/dist/Icon-D5TxgfCc.js.map +0 -1
  574. package/dist/IconButton-BoURJOUD.js +0 -68
  575. package/dist/IconButton-CiDPeKM4.cjs +0 -2
  576. package/dist/Link-BQlvsu9V.js +0 -48
  577. package/dist/Link-GZT51mKx.cjs +0 -2
  578. package/dist/ListItem-2Lr5_NRY.js +0 -76
  579. package/dist/ListItem-DkCYXucd.cjs +0 -2
  580. package/dist/Modal-CYcVOzID.js +0 -206
  581. package/dist/Modal-CYcVOzID.js.map +0 -1
  582. package/dist/Modal-DwY3jGHE.cjs +0 -2
  583. package/dist/Modal-DwY3jGHE.cjs.map +0 -1
  584. package/dist/MultiSelect-DJ6tRseY.cjs +0 -2
  585. package/dist/MultiSelect-svEVZNbp.js +0 -219
  586. package/dist/OtpField-DlkGju72.cjs +0 -2
  587. package/dist/Pagination-CAD9_Nr_.cjs +0 -2
  588. package/dist/Pagination-CX0S1RrF.js +0 -139
  589. package/dist/PhoneField-Dlnnv4DU.cjs +0 -2
  590. package/dist/RichTextEditor-Ba1G_qXu.cjs +0 -2
  591. package/dist/RichTextEditor-Ba1G_qXu.cjs.map +0 -1
  592. package/dist/RichTextEditor-CJcbxQ6H.js +0 -916
  593. package/dist/RichTextEditor-CJcbxQ6H.js.map +0 -1
  594. package/dist/Select-BrjXCXtl.cjs +0 -2
  595. package/dist/Sidebar-DLlqHvQJ.cjs +0 -2
  596. package/dist/Stepper-BDQt-oVG.js +0 -168
  597. package/dist/Stepper-e8qBsKYW.cjs +0 -2
  598. package/dist/Table-C14fRX1U.cjs +0 -2
  599. package/dist/Table-C14fRX1U.cjs.map +0 -1
  600. package/dist/Table-ChdM_vyi.js.map +0 -1
  601. package/dist/Tabs-BxZrgozI.js +0 -193
  602. package/dist/Tabs-C4kB1yfG.cjs +0 -2
  603. package/dist/TimeColumns-B8KTj-tc.cjs +0 -2
  604. package/dist/TimeColumns-BWcuu3l7.js +0 -147
  605. package/dist/Timeline-Cb1krSlo.js +0 -70
  606. package/dist/Timeline-Cb1krSlo.js.map +0 -1
  607. package/dist/Timeline-CmluHBIT.cjs +0 -2
  608. package/dist/Timeline-CmluHBIT.cjs.map +0 -1
  609. package/dist/ToggleButtonGroup-Ci_DFvdt.cjs +0 -2
  610. package/dist/chunks/icons/57-Bxh2lSz-.cjs +0 -1
  611. package/dist/chunks/icons/57-CkmrDM9A.js +0 -28
  612. package/dist/chunks/icons/8a-CThAqelS.js +0 -27
  613. package/dist/chunks/icons/8a-DRBAtpxY.cjs +0 -1
  614. package/dist/chunks/icons/97-J9NBhX2o.js +0 -14
  615. package/dist/chunks/icons/97-r2YXIQ_T.cjs +0 -1
  616. package/dist/chunks/icons/b8-CyIivk3C.cjs +0 -1
  617. package/dist/chunks/icons/b8-DcK0w8WM.js +0 -29
  618. package/dist/chunks/icons/d5-3fWtNlXW.js +0 -20
  619. package/dist/chunks/icons/d5-CoG_Hfw9.cjs +0 -1
  620. package/dist/chunks/icons/d8-DsebfeMy.cjs +0 -1
  621. package/dist/chunks/icons/d8-DtOvDDrr.js +0 -20
  622. package/dist/chunks/icons/dd-BXVES9Ib.js +0 -22
  623. package/dist/chunks/icons/dd-beaqCKss.cjs +0 -1
  624. package/dist/messages-BiRLMy1E.js.map +0 -1
  625. package/dist/messages-C_fRRCg6.cjs.map +0 -1
@@ -0,0 +1,2729 @@
1
+ import { jsxs as X, jsx as v, Fragment as ue } from "react/jsx-runtime";
2
+ import { forwardRef as Ke, useRef as F, useState as Q, useEffect as j, useLayoutEffect as de, useMemo as mn, useImperativeHandle as fn, useSyncExternalStore as pn, useCallback as gn } from "react";
3
+ import { clsx as W } from "clsx";
4
+ import { B as ye } from "./Button-C415LPw_.js";
5
+ import { b as et } from "./Icon-B7DJn8Tw.js";
6
+ import { I as kt } from "./IconButton-re6xITGO.js";
7
+ import { L as _n } from "./Loader-7v1QBvHY.js";
8
+ import { O as wn } from "./Overlay-DiL0ZARH.js";
9
+ import { g as vn, a as oe } from "./ConfigProvider-DVDGtCUc.js";
10
+ import { D as bn } from "./Dropdown-D-D_Z1Jo.js";
11
+ import { L as De } from "./ListItem-Ezmdk7q-.js";
12
+ const Ae = [
13
+ 1,
14
+ 0,
15
+ 0,
16
+ 0,
17
+ 0,
18
+ 0,
19
+ 1,
20
+ 0,
21
+ 0,
22
+ 0,
23
+ 0,
24
+ 0,
25
+ 1,
26
+ 0,
27
+ 0,
28
+ 0,
29
+ 0,
30
+ 0,
31
+ 1,
32
+ 0
33
+ ], me = 0.2126, fe = 0.7152, pe = 0.0722;
34
+ function xn(t, e) {
35
+ const n = new Array(20);
36
+ for (let i = 0; i < 4; i++)
37
+ for (let o = 0; o < 5; o++) {
38
+ let r = 0;
39
+ for (let a = 0; a < 4; a++) r += t[i * 5 + a] * e[a * 5 + o];
40
+ o === 4 && (r += t[i * 5 + 4]), n[i * 5 + o] = r;
41
+ }
42
+ return n;
43
+ }
44
+ function ot(...t) {
45
+ return t.reduce((e, n) => xn(n, e), Ae);
46
+ }
47
+ function Mn(t) {
48
+ return !t || t.every((e, n) => Math.abs(e - Ae[n]) < 1e-6);
49
+ }
50
+ const He = (t) => [
51
+ 1,
52
+ 0,
53
+ 0,
54
+ 0,
55
+ t,
56
+ 0,
57
+ 1,
58
+ 0,
59
+ 0,
60
+ t,
61
+ 0,
62
+ 0,
63
+ 1,
64
+ 0,
65
+ t,
66
+ 0,
67
+ 0,
68
+ 0,
69
+ 1,
70
+ 0
71
+ ], bt = (t) => {
72
+ const e = 0.5 * (1 - t);
73
+ return [t, 0, 0, 0, e, 0, t, 0, 0, e, 0, 0, t, 0, e, 0, 0, 0, 1, 0];
74
+ }, Rt = (t) => {
75
+ const e = 1 - t;
76
+ return [
77
+ me * e + t,
78
+ fe * e,
79
+ pe * e,
80
+ 0,
81
+ 0,
82
+ me * e,
83
+ fe * e + t,
84
+ pe * e,
85
+ 0,
86
+ 0,
87
+ me * e,
88
+ fe * e,
89
+ pe * e + t,
90
+ 0,
91
+ 0,
92
+ 0,
93
+ 0,
94
+ 0,
95
+ 1,
96
+ 0
97
+ ];
98
+ }, Ct = (t, e, n, i = 0, o = 0, r = 0) => [
99
+ t,
100
+ 0,
101
+ 0,
102
+ 0,
103
+ i,
104
+ 0,
105
+ e,
106
+ 0,
107
+ 0,
108
+ o,
109
+ 0,
110
+ 0,
111
+ n,
112
+ 0,
113
+ r,
114
+ 0,
115
+ 0,
116
+ 0,
117
+ 1,
118
+ 0
119
+ ], ge = (t, e) => {
120
+ const n = e - t;
121
+ return [n, 0, 0, 0, t, 0, n, 0, 0, t, 0, 0, n, 0, t, 0, 0, 0, 1, 0];
122
+ }, Ue = [
123
+ 0.393,
124
+ 0.769,
125
+ 0.189,
126
+ 0,
127
+ 0,
128
+ 0.349,
129
+ 0.686,
130
+ 0.168,
131
+ 0,
132
+ 0,
133
+ 0.272,
134
+ 0.534,
135
+ 0.131,
136
+ 0,
137
+ 0,
138
+ 0,
139
+ 0,
140
+ 0,
141
+ 1,
142
+ 0
143
+ ], Ee = [
144
+ ["default"],
145
+ ["chrome", "fade", "cold", "warm", "pastel"],
146
+ ["mono", "noir", "stark", "wash"],
147
+ ["sepia", "rust", "blues", "color"]
148
+ ], Ft = Rt(0), Re = {
149
+ default: null,
150
+ // more contrast + saturation
151
+ chrome: ot(Rt(1.3), bt(1.15)),
152
+ // lifted blacks, softer whites, desaturated
153
+ fade: ot(Rt(0.7), ge(0.12, 0.92)),
154
+ // a blue shift
155
+ cold: ot(Ct(0.9, 0.98, 1.12, 0, 0.01, 0.03), bt(1.04)),
156
+ // a red / yellow shift
157
+ warm: ot(Ct(1.1, 1.03, 0.86, 0.03, 0.01, 0), bt(1.04)),
158
+ // brightened + desaturated
159
+ pastel: ot(Rt(0.6), ge(0.16, 1)),
160
+ // luminance grayscale
161
+ mono: Ft,
162
+ // high-contrast grayscale
163
+ noir: ot(Ft, bt(1.45), He(-0.04)),
164
+ // very high-contrast grayscale
165
+ stark: ot(Ft, bt(2.1)),
166
+ // low-contrast, bright grayscale
167
+ wash: ot(Ft, ge(0.22, 0.98)),
168
+ sepia: Ue,
169
+ // a warm, strong sepia
170
+ rust: ot(Ue, Ct(1.12, 0.9, 0.7), bt(1.12)),
171
+ // blue-tinted monochrome
172
+ blues: ot(Ft, Ct(0.72, 0.88, 1.08, 0, 0.02, 0.08)),
173
+ // boosted, vivid color
174
+ color: ot(Rt(1.65), bt(1.06))
175
+ }, yn = [
176
+ "brightness",
177
+ "contrast",
178
+ "saturation",
179
+ "exposure",
180
+ "temperature",
181
+ "gamma",
182
+ "clarity",
183
+ "vignette"
184
+ ], Qe = {
185
+ brightness: 0,
186
+ contrast: 0,
187
+ saturation: 0,
188
+ exposure: 0,
189
+ temperature: 0,
190
+ gamma: 0,
191
+ clarity: 0,
192
+ vignette: 0
193
+ }, ut = {
194
+ /** additive: −0.25…+0.25 */
195
+ brightness: (t) => t / 100 * 0.25,
196
+ /** multiply around the midpoint: 0.5…1.5 */
197
+ contrast: (t) => 1 + t / 100 * 0.5,
198
+ /** 0 (grayscale)…2 */
199
+ saturation: (t) => 1 + t / 100,
200
+ /** multiply: 0.5…1.5 */
201
+ exposure: (t) => 1 + t / 100 * 0.5,
202
+ /** −1…1, shifts R and B in opposite directions */
203
+ temperature: (t) => t / 100,
204
+ /** exponent 0.5…1.5 (applied as x^(1/γ), so positive brightens the midtones) */
205
+ gamma: (t) => 1 + t / 100 * 0.5,
206
+ /** −1…1 local-contrast amount (negative softens) */
207
+ clarity: (t) => t / 100,
208
+ /** −1…1 (positive darkens the edges, negative lightens them) */
209
+ vignette: (t) => t / 100
210
+ };
211
+ function En(t) {
212
+ const e = ut.temperature(t.temperature);
213
+ return ot(
214
+ Ct(
215
+ ut.exposure(t.exposure),
216
+ ut.exposure(t.exposure),
217
+ ut.exposure(t.exposure)
218
+ ),
219
+ He(ut.brightness(t.brightness)),
220
+ bt(ut.contrast(t.contrast)),
221
+ Rt(ut.saturation(t.saturation)),
222
+ Ct(1 + 0.12 * e, 1 + 0.02 * e, 1 - 0.12 * e)
223
+ );
224
+ }
225
+ function kn(t, e) {
226
+ return ot(t ?? Ae, En(e));
227
+ }
228
+ const re = Math.PI / 2, Ze = 1e-6, ae = ([t, e], n) => {
229
+ const i = Math.cos(n), o = Math.sin(n);
230
+ return [t * i - e * o, t * o + e * i];
231
+ };
232
+ function Je(t, e, n) {
233
+ const i = Math.abs(Math.cos(n)), o = Math.abs(Math.sin(n));
234
+ return [t / 2 * i + e / 2 * o, t / 2 * o + e / 2 * i];
235
+ }
236
+ const $t = (t) => [
237
+ t.x + t.width / 2,
238
+ t.y + t.height / 2
239
+ ];
240
+ function se(t, e, n, i) {
241
+ const [o, r] = Je(t, e, n);
242
+ return Math.max(2 * o / i.width, 2 * r / i.height);
243
+ }
244
+ function jt(t, e) {
245
+ const [n, i] = $t(t.crop), [o, r] = ae([n - e.width / 2, i - e.height / 2], -t.rotation);
246
+ return [o / t.scale, r / t.scale];
247
+ }
248
+ function Wt([t, e], n, i, o, r, a) {
249
+ const [s, _] = Je(n, i, o), c = Math.max(0, a.width / 2 - s / r), M = Math.max(0, a.height / 2 - _ / r);
250
+ return [Math.min(c, Math.max(-c, t)), Math.min(M, Math.max(-M, e))];
251
+ }
252
+ function Kt(t, e, n, i, o, r) {
253
+ const [a, s] = ae([t[0] * o, t[1] * o], i), _ = r.width / 2 + a, c = r.height / 2 + s;
254
+ return { x: _ - e / 2, y: c - n / 2, width: e, height: n };
255
+ }
256
+ function Tn(t, e, n, i) {
257
+ const o = [
258
+ [t.x, t.y],
259
+ [t.x + t.width, t.y],
260
+ [t.x, t.y + t.height],
261
+ [t.x + t.width, t.y + t.height]
262
+ ], r = 1e-6 * Math.max(i.width, i.height);
263
+ return o.every(([a, s]) => {
264
+ const [_, c] = ae([a - i.width / 2, s - i.height / 2], -e);
265
+ return Math.abs(_ / n) <= i.width / 2 + r / n && Math.abs(c / n) <= i.height / 2 + r / n;
266
+ });
267
+ }
268
+ function In(t, e) {
269
+ const { width: n, height: i } = t.crop, o = Math.max(t.scale, se(n, i, t.rotation, e)), r = Wt(jt({ ...t, scale: o }, e), n, i, t.rotation, o, e);
270
+ return { ...t, scale: o, crop: Kt(r, n, i, t.rotation, o, e) };
271
+ }
272
+ function qt(t) {
273
+ return {
274
+ width: Math.max(1, Math.round(t.crop.width / t.scale)),
275
+ height: Math.max(1, Math.round(t.crop.height / t.scale))
276
+ };
277
+ }
278
+ function Lt(t) {
279
+ const e = qt(t);
280
+ return t.resize ? {
281
+ width: Math.max(1, Math.min(e.width, Math.round(t.resize.width))),
282
+ height: Math.max(1, Math.min(e.height, Math.round(t.resize.height)))
283
+ } : e;
284
+ }
285
+ function Yt(t) {
286
+ const { crop: e } = t, n = t.resize;
287
+ if (!n) return e;
288
+ const i = n.width / n.height, o = e.width / e.height;
289
+ if (Math.abs(o - i) < 1e-9 * Math.max(o, i)) return e;
290
+ if (o > i) {
291
+ const a = e.height * i;
292
+ return { ...e, x: e.x + (e.width - a) / 2, width: a };
293
+ }
294
+ const r = e.width / i;
295
+ return { ...e, y: e.y + (e.height - r) / 2, height: r };
296
+ }
297
+ function Sn(t, e) {
298
+ if (!e) return { ...t, resize: null };
299
+ const n = qt(t), i = Math.max(1, Math.min(n.width, Math.round(e.width))), o = Math.max(1, Math.min(n.height, Math.round(e.height))), r = Math.round(i * n.height / n.width) === o || Math.round(o * n.width / n.height) === i;
300
+ let a = t;
301
+ if (!r) {
302
+ const c = Yt({ ...t, resize: { width: i, height: o } });
303
+ a = { ...t, crop: c, cropRatio: null };
304
+ }
305
+ const s = qt(a), _ = i >= s.width && o >= s.height ? null : { width: Math.min(i, s.width), height: Math.min(o, s.height) };
306
+ return { ...a, resize: _ };
307
+ }
308
+ function An(t, e) {
309
+ const n = e.resize;
310
+ if (!n) return n;
311
+ const i = qt(t), o = qt(e);
312
+ if (i.width === o.width && i.height === o.height) return n;
313
+ const r = Math.max(
314
+ 1,
315
+ Math.min(o.width, Math.round(n.width * o.width / i.width))
316
+ ), a = Math.max(
317
+ 1,
318
+ Math.min(o.height, Math.round(n.height * o.height / i.height))
319
+ );
320
+ return r === o.width && a === o.height ? null : { width: r, height: a };
321
+ }
322
+ function Rn(t, e) {
323
+ let n = t.width, i = t.height;
324
+ return e && e > 0 && (n / i > e ? n = i * e : i = n / e), { x: (t.width - n) / 2, y: (t.height - i) / 2, width: n, height: i };
325
+ }
326
+ function Cn(t, e) {
327
+ return {
328
+ crop: Rn(t, e),
329
+ cropRatio: e && e > 0 ? e : null,
330
+ resize: null,
331
+ rotation: 0,
332
+ flipX: !1,
333
+ flipY: !1,
334
+ scale: 1,
335
+ filter: null,
336
+ colorMatrix: null,
337
+ finetune: { ...Qe },
338
+ redact: { effect: "blur", amount: 0 }
339
+ };
340
+ }
341
+ function _e(t, e) {
342
+ const n = (Math.round(t / re) % 4 + 4) % 4, i = e ?? n * re;
343
+ let o = t - i;
344
+ return o = Math.atan2(Math.sin(o), Math.cos(o)), { quarter: ke(i), fine: o };
345
+ }
346
+ const ke = (t) => {
347
+ const e = t % (2 * Math.PI), n = e < 0 ? e + 2 * Math.PI : e;
348
+ return Math.abs(n - 2 * Math.PI) < Ze ? 0 : n;
349
+ };
350
+ function Fe(t, e, n) {
351
+ const { width: i, height: o } = t.crop, r = jt(t, n), a = Math.max(t.scale, se(i, o, e, n)), s = Wt(r, i, o, e, a, n);
352
+ return { ...t, rotation: e, scale: a, crop: Kt(s, i, o, e, a, n) };
353
+ }
354
+ function Ln(t, e) {
355
+ const [n, i] = $t(t.crop), o = e.width / 2, r = e.height / 2, [a, s] = ae([n - o, i - r], -re), _ = t.crop.height, c = t.crop.width;
356
+ return {
357
+ ...t,
358
+ rotation: t.rotation - re,
359
+ crop: { x: o + a - _ / 2, y: r + s - c / 2, width: _, height: c },
360
+ cropRatio: t.cropRatio ? 1 / t.cropRatio : t.cropRatio
361
+ };
362
+ }
363
+ function Nn(t, e) {
364
+ return {
365
+ ...t,
366
+ rotation: -t.rotation,
367
+ flipX: !t.flipX,
368
+ crop: { ...t.crop, x: e.width - t.crop.x - t.crop.width }
369
+ };
370
+ }
371
+ function Bt(t, e) {
372
+ return t.scale / se(t.crop.width, t.crop.height, t.rotation, e);
373
+ }
374
+ const Vt = 5;
375
+ function Gt(t, e, n) {
376
+ const { width: i, height: o } = t.crop, r = jt(t, n), a = se(i, o, t.rotation, n) * Math.min(Vt, Math.max(1, e)), s = Wt(r, i, o, t.rotation, a, n);
377
+ return { ...t, scale: a, crop: Kt(s, i, o, t.rotation, a, n) };
378
+ }
379
+ function qn(t, e, n, i) {
380
+ const { width: o, height: r } = t.crop, a = { ...t, crop: { ...t.crop, x: t.crop.x + e, y: t.crop.y + n } }, s = Wt(jt(a, i), o, r, t.rotation, t.scale, i);
381
+ return { ...t, crop: Kt(s, o, r, t.rotation, t.scale, i) };
382
+ }
383
+ function Pn(t, e, n) {
384
+ if (!e || e <= 0) return { ...t, cropRatio: null };
385
+ const i = Math.abs(Math.cos(t.rotation)), o = Math.abs(Math.sin(t.rotation)), r = Math.min(
386
+ n.width * t.scale / (e * i + o),
387
+ n.height * t.scale / (e * o + i)
388
+ ), a = r * e, s = Wt(jt(t, n), a, r, t.rotation, t.scale, n);
389
+ return {
390
+ ...t,
391
+ cropRatio: e,
392
+ crop: Kt(s, a, r, t.rotation, t.scale, n)
393
+ };
394
+ }
395
+ function zn(t, e, n, i, o, { aspectRatio: r, minSize: a }) {
396
+ const s = t.crop;
397
+ let _ = s.x, c = s.y, M = s.x + s.width, m = s.y + s.height;
398
+ const k = e.includes("n"), f = e.includes("s"), I = e.includes("w"), S = e.includes("e");
399
+ if (k && (c = Math.min(c + i, m - a)), f && (m = Math.max(m + i, c + a)), I && (_ = Math.min(_ + n, M - a)), S && (M = Math.max(M + n, _ + a)), r && r > 0) {
400
+ let b = M - _, N = m - c;
401
+ if ((k || f) && (I || S))
402
+ b / N > r ? N = b / r : b = N * r, I ? _ = M - b : M = _ + b, k ? c = m - N : m = c + N;
403
+ else if (k || f) {
404
+ b = N * r;
405
+ const G = s.x + s.width / 2;
406
+ _ = G - b / 2, M = G + b / 2;
407
+ } else {
408
+ N = b / r;
409
+ const G = s.y + s.height / 2;
410
+ c = G - N / 2, m = G + N / 2;
411
+ }
412
+ }
413
+ const y = { x: _, y: c, width: M - _, height: m - c }, x = (b) => Tn(b, t.rotation, t.scale, o);
414
+ if (x(y)) return { ...t, crop: y };
415
+ if (!(!(r && r > 0) && (k || f) && (I || S))) return { ...t, crop: Ot(s, y, x) };
416
+ const A = (b) => ({ ...b, x: _, width: M - _ }), u = (b) => ({ ...b, y: c, height: m - c }), R = Ot(Ot(s, A(s), x), u, x), d = Ot(Ot(s, u(s), x), A, x), E = (b) => Math.abs(b.x - y.x) + Math.abs(b.y - y.y) + Math.abs(b.width - y.width) + Math.abs(b.height - y.height);
417
+ return { ...t, crop: E(R) <= E(d) ? R : d };
418
+ }
419
+ function Ot(t, e, n) {
420
+ const i = typeof e == "function" ? e(t) : e;
421
+ if (n(i)) return i;
422
+ let o = 0, r = 1;
423
+ for (let a = 0; a < 24; a++) {
424
+ const s = (o + r) / 2;
425
+ n(Oe(t, i, s)) ? o = s : r = s;
426
+ }
427
+ return Oe(t, i, o);
428
+ }
429
+ const Oe = (t, e, n) => ({
430
+ x: t.x + (e.x - t.x) * n,
431
+ y: t.y + (e.y - t.y) * n,
432
+ width: t.width + (e.width - t.width) * n,
433
+ height: t.height + (e.height - t.height) * n
434
+ });
435
+ function Xe(t, e) {
436
+ const n = {
437
+ ...t.crop,
438
+ width: Math.max(1, t.crop.width),
439
+ height: Math.max(1, t.crop.height)
440
+ };
441
+ return In({ ...t, crop: n, scale: Math.max(Ze, t.scale || 1) }, e);
442
+ }
443
+ const tn = 0.85, Dn = (t, e, n) => {
444
+ const i = Math.min(1, Math.max(0, (n - t) / (e - t)));
445
+ return i * i * (3 - 2 * i);
446
+ }, Un = (t, e) => Dn(0.3, 1, Math.hypot(t, e) / Math.SQRT2);
447
+ function Ce(t, e, n, i, o, r) {
448
+ const a = i.matrix, s = 1 / i.gamma, _ = Math.abs(i.gamma - 1) > 1e-4, c = Math.abs(i.clarity) > 1e-4 && !!o, M = Math.abs(i.vignette) > 1e-4 && !!r;
449
+ for (let m = 0; m < n; m++)
450
+ for (let k = 0; k < e; k++) {
451
+ const f = (m * e + k) * 4, I = t[f + 3] / 255;
452
+ if (I === 0) continue;
453
+ const S = t[f] / 255, y = t[f + 1] / 255, x = t[f + 2] / 255;
454
+ let l = a[0] * S + a[1] * y + a[2] * x + a[3] * I + a[4], A = a[5] * S + a[6] * y + a[7] * x + a[8] * I + a[9], u = a[10] * S + a[11] * y + a[12] * x + a[13] * I + a[14];
455
+ if (c) {
456
+ const R = o[f] / 255, d = o[f + 1] / 255, E = o[f + 2] / 255, b = o[f + 3] / 255, N = a[0] * R + a[1] * d + a[2] * E + a[3] * b + a[4], $ = a[5] * R + a[6] * d + a[7] * E + a[8] * b + a[9], G = a[10] * R + a[11] * d + a[12] * E + a[13] * b + a[14];
457
+ l += i.clarity * (l - N), A += i.clarity * (A - $), u += i.clarity * (u - G);
458
+ }
459
+ if (_ && (l = Math.pow(Math.max(0, l), s), A = Math.pow(Math.max(0, A), s), u = Math.pow(Math.max(0, u), s)), M) {
460
+ const R = k + 0.5, d = m + 0.5, E = r[0] * R + r[1] * d + r[2], b = r[3] * R + r[4] * d + r[5], N = Un(E, b) * tn * Math.abs(i.vignette);
461
+ i.vignette > 0 ? (l *= 1 - N, A *= 1 - N, u *= 1 - N) : (l += (1 - l) * N, A += (1 - A) * N, u += (1 - u) * N);
462
+ }
463
+ t[f] = l * 255, t[f + 1] = A * 255, t[f + 2] = u * 255;
464
+ }
465
+ }
466
+ function Le(t, e, n, i) {
467
+ const o = Math.max(1, Math.round(i)), r = new Uint8ClampedArray(t), a = new Uint8ClampedArray(t.length);
468
+ for (let _ = 0; _ < 3; _++)
469
+ s(r, a, e, n, o, !0), s(a, r, e, n, o, !1);
470
+ return r;
471
+ function s(_, c, M, m, k, f) {
472
+ const I = f ? m : M, S = f ? M : m, y = f ? 4 : M * 4, x = k * 2 + 1;
473
+ for (let l = 0; l < I; l++) {
474
+ const A = f ? l * M * 4 : l * 4;
475
+ for (let u = 0; u < 4; u++) {
476
+ let R = 0;
477
+ for (let d = -k; d <= k; d++) {
478
+ const E = Math.min(S - 1, Math.max(0, d));
479
+ R += _[A + E * y + u];
480
+ }
481
+ for (let d = 0; d < S; d++) {
482
+ c[A + d * y + u] = R / x;
483
+ const E = Math.max(0, d - k), b = Math.min(S - 1, d + k + 1);
484
+ R += _[A + b * y + u] - _[A + E * y + u];
485
+ }
486
+ }
487
+ }
488
+ }
489
+ }
490
+ const Ne = 0.012, en = (t, e) => {
491
+ const n = document.createElement("canvas");
492
+ return n.width = Math.max(1, Math.round(t)), n.height = Math.max(1, Math.round(e)), n;
493
+ };
494
+ async function Be(t) {
495
+ if (typeof createImageBitmap == "function")
496
+ try {
497
+ return await createImageBitmap(t, { imageOrientation: "from-image" });
498
+ } catch {
499
+ }
500
+ const e = URL.createObjectURL(t);
501
+ try {
502
+ return await nn(e, !1);
503
+ } finally {
504
+ URL.revokeObjectURL(e);
505
+ }
506
+ }
507
+ function nn(t, e) {
508
+ return new Promise((n, i) => {
509
+ const o = new Image();
510
+ e && (o.crossOrigin = "anonymous"), o.decoding = "async", o.onload = () => n(o), o.onerror = () => i(new Error(`Could not load image: ${t.slice(0, 80)}`)), o.src = t;
511
+ });
512
+ }
513
+ const Fn = (t) => t instanceof HTMLImageElement ? { width: t.naturalWidth, height: t.naturalHeight } : { width: t.width, height: t.height };
514
+ async function On(t) {
515
+ let e, n = "";
516
+ if (typeof t == "string")
517
+ try {
518
+ const r = await fetch(t);
519
+ if (!r.ok) throw new Error(String(r.status));
520
+ const a = await r.blob();
521
+ n = a.type, e = await Be(a);
522
+ } catch {
523
+ e = await nn(t, !t.startsWith("data:") && !t.startsWith("blob:"));
524
+ const r = /^data:([^;,]+)/.exec(t) ?? /\.(png|jpe?g|webp|gif|avif)(?:[?#]|$)/i.exec(t);
525
+ r && (n = r[1].includes("/") ? r[1] : `image/${r[1].toLowerCase().replace("jpg", "jpeg")}`);
526
+ }
527
+ else
528
+ n = t.type, e = await Be(t);
529
+ const { width: i, height: o } = Fn(e);
530
+ if (!i || !o) throw new Error("The image has no size");
531
+ return { image: e, width: i, height: o, type: n };
532
+ }
533
+ function ne(t, e, n, i) {
534
+ const o = Math.min(1, i / Math.max(e, n));
535
+ if (o >= 1) return { canvas: t, width: e, height: n };
536
+ const r = en(e * o, n * o), a = r.getContext("2d");
537
+ return a && (a.imageSmoothingQuality = "high", a.drawImage(t, 0, 0, r.width, r.height)), { canvas: r, width: r.width, height: r.height };
538
+ }
539
+ function rn(t, e, n, i, o = 384) {
540
+ const r = Math.min(1, o / Math.max(e, n)), a = en(e * r, n * r), s = a.getContext("2d", { willReadFrequently: !0 });
541
+ if (!s) return a;
542
+ s.drawImage(t, 0, 0, a.width, a.height);
543
+ try {
544
+ const _ = s.getImageData(0, 0, a.width, a.height);
545
+ _.data.set(Le(_.data, a.width, a.height, Math.max(1, i * r))), s.putImageData(_, 0, 0);
546
+ } catch {
547
+ }
548
+ return a;
549
+ }
550
+ function Xn(t, e) {
551
+ return t || (["image/jpeg", "image/png", "image/webp"].includes(e) ? e : "image/png");
552
+ }
553
+ const Bn = [1, 0, 0, 0, 1, 0], st = (t, e) => [1, 0, t, 0, 1, e], nt = (t, e = t) => [t, 0, 0, 0, e, 0], on = (t) => {
554
+ const e = Math.cos(t), n = Math.sin(t);
555
+ return [e, -n, 0, n, e, 0];
556
+ };
557
+ function Yn(t, e) {
558
+ return [
559
+ t[0] * e[0] + t[1] * e[3],
560
+ t[0] * e[1] + t[1] * e[4],
561
+ t[0] * e[2] + t[1] * e[5] + t[2],
562
+ t[3] * e[0] + t[4] * e[3],
563
+ t[3] * e[1] + t[4] * e[4],
564
+ t[3] * e[2] + t[4] * e[5] + t[5]
565
+ ];
566
+ }
567
+ const at = (...t) => t.reduce((e, n) => Yn(n, e), Bn);
568
+ function Nt([t, e, n, i, o, r]) {
569
+ const a = t * o - e * i, s = Math.abs(a) < 1e-12 ? 1e12 : 1 / a;
570
+ return [o * s, -e * s, (e * r - n * o) * s, -i * s, t * s, (n * i - t * r) * s];
571
+ }
572
+ const ie = ([t, e, n, i, o, r], a, s) => [
573
+ t * a + e * s + n,
574
+ i * a + o * s + r
575
+ ], Vn = { blur: 0.015, pixelate: 0.05 };
576
+ function Te(t, e) {
577
+ var o, r;
578
+ const n = ((o = t.redact) == null ? void 0 : o.effect) ?? "blur";
579
+ return Math.max(0, Math.min(100, ((r = t.redact) == null ? void 0 : r.amount) ?? 0)) / 100 * (Vn[n] ?? 0) * Math.max(e.width, e.height);
580
+ }
581
+ function an(t, e) {
582
+ const n = Math.max(1e-6, e);
583
+ return {
584
+ cols: Math.max(1, Math.round(t.width / n)),
585
+ rows: Math.max(1, Math.round(t.height / n))
586
+ };
587
+ }
588
+ const Gn = 4, ce = (t, e) => {
589
+ const n = document.createElement("canvas");
590
+ return n.width = Math.max(1, Math.round(t)), n.height = Math.max(1, Math.round(e)), n;
591
+ };
592
+ function sn(t, e, n, i, o) {
593
+ const r = Math.min(1, Gn / Math.max(1, i), o / Math.max(e, n)), a = ce(e * r, n * r), s = a.getContext("2d", { willReadFrequently: !0 });
594
+ if (!s) return a;
595
+ s.imageSmoothingQuality = "high", s.drawImage(t, 0, 0, a.width, a.height);
596
+ try {
597
+ const _ = s.getImageData(0, 0, a.width, a.height);
598
+ _.data.set(Le(_.data, a.width, a.height, Math.max(1, i * r))), s.putImageData(_, 0, 0);
599
+ } catch {
600
+ }
601
+ return a;
602
+ }
603
+ function $n(t, e, n, i) {
604
+ const o = ce(e, n), r = o.getContext("2d");
605
+ return r && (r.imageSmoothingQuality = "high", r.drawImage(sn(t, e, n, i, 1024), 0, 0, e, n)), o;
606
+ }
607
+ function cn(t, e, n) {
608
+ const i = ce(e, n), o = i.getContext("2d"), r = t.getContext("2d");
609
+ !o || !r || (o.imageSmoothingQuality = "high", o.drawImage(t, 0, 0, i.width, i.height), r.save(), r.setTransform(1, 0, 0, 1, 0, 0), r.globalCompositeOperation = "copy", r.imageSmoothingEnabled = !1, r.drawImage(i, 0, 0, t.width, t.height), r.restore());
610
+ }
611
+ function jn(t, e, n, i) {
612
+ const o = ce(e, n), r = o.getContext("2d");
613
+ return r && (r.drawImage(t, 0, 0, e, n), cn(
614
+ o,
615
+ Math.max(1, Math.round(e / Math.max(2, i))),
616
+ Math.max(1, Math.round(n / Math.max(2, i)))
617
+ )), o;
618
+ }
619
+ const ln = (t) => t.area ? [t.area.x + t.area.width / 2, t.area.y + t.area.height / 2] : [t.width / 2, t.height / 2];
620
+ function qe(t, e) {
621
+ const n = e.width / 2, i = e.height / 2;
622
+ return at(
623
+ st(-n, -i),
624
+ nt(t.flipX ? -1 : 1, t.flipY ? -1 : 1),
625
+ on(t.rotation),
626
+ nt(t.scale),
627
+ st(n, i)
628
+ );
629
+ }
630
+ function hn(t, e) {
631
+ const n = Math.abs(t.flip) < 0.02 ? 0.02 * Math.sign(t.flip || 1) : t.flip, [i, o] = ln(e);
632
+ return at(
633
+ st(-t.center[0], -t.center[1]),
634
+ on(t.rotation),
635
+ nt(t.scale * n, t.scale),
636
+ st(i, o)
637
+ );
638
+ }
639
+ function Wn(t) {
640
+ const [e, n] = $t(t);
641
+ return at(st(-e, -n), nt(2 / t.width, 2 / t.height));
642
+ }
643
+ function Kn(t, e, n, i) {
644
+ const o = at(nt(1 / i.dpr), Nt(hn(n, i))), r = at(
645
+ o,
646
+ Nt(qe(t, e)),
647
+ nt(1 / e.width, 1 / e.height)
648
+ );
649
+ return { toUV: r, toBlurUV: r, toCrop: at(o, Wn(t.crop)) };
650
+ }
651
+ function Ye(t, e, n) {
652
+ const i = Math.max(1, e.width - n * 2), o = Math.max(1, e.height - n * 2);
653
+ return {
654
+ center: $t(t),
655
+ scale: Math.min(i / t.width, o / t.height),
656
+ rotation: 0,
657
+ flip: 1
658
+ };
659
+ }
660
+ const Hn = `
661
+ attribute vec2 a_pos;
662
+ void main() { gl_Position = vec4(a_pos, 0.0, 1.0); }
663
+ `, Qn = `
664
+ #ifdef GL_FRAGMENT_PRECISION_HIGH
665
+ precision highp float;
666
+ #else
667
+ precision mediump float;
668
+ #endif
669
+ uniform sampler2D u_image;
670
+ uniform sampler2D u_blur;
671
+ uniform vec2 u_size;
672
+ uniform vec3 u_uvX; uniform vec3 u_uvY;
673
+ uniform vec3 u_blurX; uniform vec3 u_blurY;
674
+ uniform vec3 u_cropX; uniform vec3 u_cropY;
675
+ uniform bool u_clip;
676
+ uniform float u_dim;
677
+ uniform vec3 u_dimColor;
678
+ uniform mat4 u_cm; uniform vec4 u_co;
679
+ uniform float u_gamma; uniform float u_clarity; uniform float u_vignette;
680
+ uniform vec2 u_pixel; uniform vec3 u_cuvX; uniform vec3 u_cuvY;
681
+
682
+ vec3 grade(vec4 c) { return (u_cm * c + u_co).rgb; }
683
+
684
+ void main() {
685
+ vec3 px = vec3(gl_FragCoord.x, u_size.y - gl_FragCoord.y, 1.0);
686
+ vec2 cn = vec2(dot(u_cropX, px), dot(u_cropY, px));
687
+ // the pixel's own place in the crop (before a pixelation snaps cn to its block) — for the clip
688
+ bool outsideCrop = abs(cn.x) > 1.0 || abs(cn.y) > 1.0;
689
+ vec2 uv = vec2(dot(u_uvX, px), dot(u_uvY, px));
690
+ vec2 buv = vec2(dot(u_blurX, px), dot(u_blurY, px));
691
+ if (u_pixel.x > 0.0) {
692
+ // the center of this pixel's block (whole blocks across the crop; the edge pixel stays in the last)
693
+ vec2 cell = 2.0 / u_pixel;
694
+ vec2 idx = floor((cn + 1.0) / cell);
695
+ if (abs(cn.x) <= 1.0) idx.x = min(idx.x, u_pixel.x - 1.0);
696
+ if (abs(cn.y) <= 1.0) idx.y = min(idx.y, u_pixel.y - 1.0);
697
+ cn = (idx + 0.5) * cell - 1.0;
698
+ vec3 q = vec3(cn, 1.0);
699
+ uv = vec2(dot(u_cuvX, q), dot(u_cuvY, q));
700
+ buv = uv;
701
+ }
702
+ // sample BEFORE any early return: a texture read in a branch only some pixels of a 2×2 quad take has no
703
+ // defined derivatives, so at the image's edge the GPU picked a far too coarse mip level — a blurred
704
+ // copy of the content showed through as a faint line along a transparent image's sides
705
+ vec4 c = texture2D(u_image, uv);
706
+ vec4 bl = texture2D(u_blur, buv);
707
+ if ((u_clip && outsideCrop) || uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0 || c.a <= 0.0) {
708
+ gl_FragColor = vec4(0.0);
709
+ return;
710
+ }
711
+ vec3 rgb = grade(c);
712
+ if (u_clarity != 0.0) rgb += u_clarity * (rgb - grade(bl));
713
+ if (u_gamma != 1.0) rgb = pow(max(rgb, 0.0), vec3(1.0 / u_gamma));
714
+ if (u_vignette != 0.0) {
715
+ float f = smoothstep(0.3, 1.0, length(cn) / 1.41421356) * ${tn.toFixed(2)} * abs(u_vignette);
716
+ rgb = u_vignette > 0.0 ? rgb * (1.0 - f) : rgb + (1.0 - rgb) * f;
717
+ }
718
+ rgb = clamp(rgb, 0.0, 1.0);
719
+ if (outsideCrop) rgb = mix(u_dimColor, rgb, u_dim);
720
+ gl_FragColor = vec4(rgb * c.a, c.a);
721
+ }
722
+ `;
723
+ class le {
724
+ constructor(e, n) {
725
+ this.loc = {}, this.canvas = e, this.gl = n, this.maxTextureSize = n.getParameter(n.MAX_TEXTURE_SIZE), this.program = this.link(), n.useProgram(this.program);
726
+ const i = n.createBuffer();
727
+ n.bindBuffer(n.ARRAY_BUFFER, i), n.bufferData(n.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), n.STATIC_DRAW);
728
+ const o = n.getAttribLocation(this.program, "a_pos");
729
+ n.enableVertexAttribArray(o), n.vertexAttribPointer(o, 2, n.FLOAT, !1, 0, 0);
730
+ for (const r of [
731
+ "u_image",
732
+ "u_blur",
733
+ "u_size",
734
+ "u_uvX",
735
+ "u_uvY",
736
+ "u_blurX",
737
+ "u_blurY",
738
+ "u_cropX",
739
+ "u_cropY",
740
+ "u_clip",
741
+ "u_dim",
742
+ "u_dimColor",
743
+ "u_cm",
744
+ "u_co",
745
+ "u_gamma",
746
+ "u_clarity",
747
+ "u_vignette",
748
+ "u_pixel",
749
+ "u_cuvX",
750
+ "u_cuvY"
751
+ ])
752
+ this.loc[r] = n.getUniformLocation(this.program, r);
753
+ this.image = this.texture(), this.blur = this.texture(), n.uniform1i(this.loc.u_image, 0), n.uniform1i(this.loc.u_blur, 1);
754
+ }
755
+ /** Create a renderer on `canvas`, or `null` when WebGL is unavailable. */
756
+ static create(e) {
757
+ try {
758
+ const n = {
759
+ premultipliedAlpha: !0,
760
+ alpha: !0,
761
+ antialias: !1,
762
+ preserveDrawingBuffer: !0
763
+ }, i = e.getContext("webgl2", n) ?? e.getContext("webgl", n);
764
+ return i ? new le(e, i) : null;
765
+ } catch {
766
+ return null;
767
+ }
768
+ }
769
+ link() {
770
+ const e = this.gl, n = (o, r) => {
771
+ const a = e.createShader(o);
772
+ if (e.shaderSource(a, r), e.compileShader(a), !e.getShaderParameter(a, e.COMPILE_STATUS))
773
+ throw new Error(e.getShaderInfoLog(a) ?? "shader compile failed");
774
+ return a;
775
+ }, i = e.createProgram();
776
+ if (e.attachShader(i, n(e.VERTEX_SHADER, Hn)), e.attachShader(i, n(e.FRAGMENT_SHADER, Qn)), e.linkProgram(i), !e.getProgramParameter(i, e.LINK_STATUS))
777
+ throw new Error(e.getProgramInfoLog(i) ?? "program link failed");
778
+ return i;
779
+ }
780
+ texture() {
781
+ const e = this.gl, n = e.createTexture();
782
+ return e.bindTexture(e.TEXTURE_2D, n), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), n;
783
+ }
784
+ upload(e, n, i, o) {
785
+ const r = this.gl;
786
+ r.activeTexture(r.TEXTURE0 + e), r.bindTexture(r.TEXTURE_2D, n), r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, r.RGBA, r.UNSIGNED_BYTE, i);
787
+ const a = typeof WebGL2RenderingContext < "u" && r instanceof WebGL2RenderingContext;
788
+ o && a ? (r.generateMipmap(r.TEXTURE_2D), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_LINEAR)) : r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR);
789
+ }
790
+ /** Upload the image (and its blurred copy for clarity). */
791
+ setImage(e, n, i = !0) {
792
+ this.upload(0, this.image, e, i), this.upload(1, this.blur, n, !1);
793
+ }
794
+ /**
795
+ * Swap just the image texture (e.g. for a coarser copy) — the blurred copy stays. `mipmap: false` for
796
+ * a pixelation's texture: its blocks sample one point each, and mip levels would seam their borders.
797
+ */
798
+ setSource(e, n = !0) {
799
+ this.upload(0, this.image, e, n);
800
+ }
801
+ /** Draw one frame at the canvas's current pixel size. */
802
+ render(e) {
803
+ const n = this.gl, { width: i, height: o } = this.canvas;
804
+ n.viewport(0, 0, i, o), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT), n.uniform2f(this.loc.u_size, i, o);
805
+ const r = (f, I, S) => {
806
+ n.uniform3f(this.loc[I], f[0], f[1], f[2]), n.uniform3f(this.loc[S], f[3], f[4], f[5]);
807
+ };
808
+ r(e.toUV, "u_uvX", "u_uvY"), r(e.toBlurUV, "u_blurX", "u_blurY"), r(e.toCrop, "u_cropX", "u_cropY"), n.uniform1i(this.loc.u_clip, e.clip ? 1 : 0), n.uniform1f(this.loc.u_dim, e.dim ?? 1);
809
+ const [a, s, _] = e.dimColor ?? [0, 0, 0];
810
+ n.uniform3f(this.loc.u_dimColor, a, s, _);
811
+ const c = e.matrix, M = new Float32Array(16);
812
+ for (let f = 0; f < 4; f++)
813
+ for (let I = 0; I < 4; I++) M[I * 4 + f] = c[f * 5 + I];
814
+ n.uniformMatrix4fv(this.loc.u_cm, !1, M), n.uniform4f(this.loc.u_co, c[4], c[9], c[14], c[19]), n.uniform1f(this.loc.u_gamma, e.gamma), n.uniform1f(this.loc.u_clarity, e.clarity), n.uniform1f(this.loc.u_vignette, e.vignette);
815
+ const [m, k] = e.pixel ?? [0, 0];
816
+ n.uniform2f(this.loc.u_pixel, m, k), e.pixel && e.cropToUV && r(e.cropToUV, "u_cuvX", "u_cuvY"), n.drawArrays(n.TRIANGLE_STRIP, 0, 4);
817
+ }
818
+ /**
819
+ * Release the GPU resources. `loseContext` also drops the context itself (a throwaway export canvas —
820
+ * browsers cap live contexts); a canvas that will be drawn on again keeps it.
821
+ */
822
+ dispose(e = !0) {
823
+ var i;
824
+ const n = this.gl;
825
+ n.deleteTexture(this.image), n.deleteTexture(this.blur), n.deleteProgram(this.program), e && ((i = n.getExtension("WEBGL_lose_context")) == null || i.loseContext());
826
+ }
827
+ }
828
+ function Pe(t, e = t.colorMatrix) {
829
+ const n = t.finetune;
830
+ return {
831
+ matrix: kn(e, n),
832
+ gamma: ut.gamma(n.gamma),
833
+ clarity: ut.clarity(n.clarity),
834
+ vignette: ut.vignette(n.vignette)
835
+ };
836
+ }
837
+ const un = (t) => !Mn(t.matrix) || t.gamma !== 1 || t.clarity !== 0 || t.vignette !== 0, ze = (t, e) => {
838
+ const n = document.createElement("canvas");
839
+ return n.width = Math.max(1, Math.round(t)), n.height = Math.max(1, Math.round(e)), n;
840
+ };
841
+ function Zn(t, e, n, i, o, r) {
842
+ const a = t.getContext("2d", { willReadFrequently: !0 });
843
+ if (!a) return;
844
+ const { width: s, height: _ } = t;
845
+ a.setTransform(1, 0, 0, 1, 0, 0), a.clearRect(0, 0, s, _);
846
+ const c = (m, k, f, I) => {
847
+ const S = at(nt(1 / f.width, 1 / f.height), Nt(I));
848
+ if (m.save(), r.clip) {
849
+ const y = Nt(r.toCrop);
850
+ m.beginPath(), [
851
+ [-1, -1],
852
+ [1, -1],
853
+ [1, 1],
854
+ [-1, 1]
855
+ ].forEach(([x, l], A) => {
856
+ const [u, R] = ie(y, x, l);
857
+ A === 0 ? m.moveTo(u, R) : m.lineTo(u, R);
858
+ }), m.closePath(), m.clip();
859
+ }
860
+ m.setTransform(S[0], S[3], S[1], S[4], S[2], S[5]), m.imageSmoothingQuality = "high", m.drawImage(k, 0, 0, f.width, f.height), m.restore();
861
+ };
862
+ if (c(a, e, n, r.toUV), un(r) && M(), r.dim != null && r.dim < 1) {
863
+ const m = Nt(r.toCrop);
864
+ a.save(), a.globalCompositeOperation = "source-atop", a.beginPath(), a.rect(0, 0, s, _), [
865
+ [-1, -1],
866
+ [1, -1],
867
+ [1, 1],
868
+ [-1, 1]
869
+ ].forEach(([S, y], x) => {
870
+ const [l, A] = ie(m, S, y);
871
+ x === 0 ? a.moveTo(l, A) : a.lineTo(l, A);
872
+ }), a.closePath();
873
+ const [k, f, I] = (r.dimColor ?? [0, 0, 0]).map((S) => Math.round(S * 255));
874
+ a.fillStyle = `rgba(${k}, ${f}, ${I}, ${1 - r.dim})`, a.fill("evenodd"), a.restore();
875
+ }
876
+ function M() {
877
+ if (a)
878
+ try {
879
+ const m = a.getImageData(0, 0, s, _);
880
+ let k = null;
881
+ if (r.clarity !== 0) {
882
+ const I = ze(s, _).getContext("2d", { willReadFrequently: !0 });
883
+ I && (c(I, i, o, r.toBlurUV), k = I.getImageData(0, 0, s, _).data);
884
+ }
885
+ Ce(m.data, s, _, r, k, r.toCrop), a.putImageData(m, 0, 0);
886
+ } catch {
887
+ }
888
+ }
889
+ }
890
+ const Jn = 16384, tr = 16384 * 16384, er = (t, e, n) => new Promise((i, o) => {
891
+ try {
892
+ t.toBlob(
893
+ (r) => r ? i(r) : o(new Error("Encoding failed")),
894
+ e,
895
+ n
896
+ );
897
+ } catch (r) {
898
+ o(r);
899
+ }
900
+ });
901
+ async function nr(t, e, n, i, o) {
902
+ var x;
903
+ const r = Lt(n), a = Yt(n), s = Math.min(
904
+ 1,
905
+ Jn / Math.max(r.width, r.height),
906
+ Math.sqrt(tr / (r.width * r.height))
907
+ ), _ = Math.max(1, Math.round(r.width * s)), c = Math.max(1, Math.round(r.height * s)), M = ze(_, c), m = M.getContext("2d");
908
+ if (!m) throw new Error("Canvas 2D is unavailable");
909
+ const k = at(
910
+ qe(n, e),
911
+ st(-a.x, -a.y),
912
+ nt(_ / a.width, c / a.height)
913
+ );
914
+ i === "image/jpeg" && (m.fillStyle = "#fff", m.fillRect(0, 0, _, c)), m.setTransform(k[0], k[3], k[1], k[4], k[2], k[5]), m.imageSmoothingEnabled = !0, m.imageSmoothingQuality = "high";
915
+ const f = Te(n, e), I = (x = n.redact) == null ? void 0 : x.effect, S = f > 0 && I === "blur" ? $n(t, e.width, e.height, f) : t;
916
+ m.drawImage(S, 0, 0, e.width, e.height), m.setTransform(1, 0, 0, 1, 0, 0);
917
+ const y = Pe(n);
918
+ if (un(y)) {
919
+ const l = Ne * Math.max(e.width, e.height) * (_ / a.width) * n.scale, A = rn(M, _, c, l);
920
+ rr(M, A, y);
921
+ }
922
+ if (f > 0 && I === "pixelate") {
923
+ const { cols: l, rows: A } = an(a, f * n.scale);
924
+ cn(M, l, A);
925
+ }
926
+ return er(M, i, o);
927
+ }
928
+ function rr(t, e, n) {
929
+ const { width: i, height: o } = t, r = t.getContext("2d", { willReadFrequently: !0 }), a = document.createElement("canvas"), s = le.create(a), _ = s ? Math.min(2048, s.maxTextureSize) : 1024, c = ze(_, _), M = c.getContext("2d", { willReadFrequently: !0 });
930
+ try {
931
+ for (let m = 0; m < o; m += _)
932
+ for (let k = 0; k < i; k += _) {
933
+ const f = Math.min(_, i - k), I = Math.min(_, o - m), S = at(st(k, m), nt(2 / i, 2 / o), st(-1, -1)), y = at(st(k, m), nt(1 / i, 1 / o));
934
+ if (s)
935
+ c.width = f, c.height = I, M.clearRect(0, 0, f, I), M.drawImage(t, k, m, f, I, 0, 0, f, I), a.width = f, a.height = I, s.setImage(c, e, !1), s.render({ ...n, toUV: nt(1 / f, 1 / I), toBlurUV: y, toCrop: S, clip: !1 }), r.clearRect(k, m, f, I), r.drawImage(a, k, m);
936
+ else {
937
+ const x = r.getImageData(k, m, f, I);
938
+ let l = null;
939
+ n.clarity !== 0 && (c.width = f, c.height = I, M.drawImage(
940
+ e,
941
+ k / i * e.width,
942
+ m / o * e.height,
943
+ f / i * e.width,
944
+ I / o * e.height,
945
+ 0,
946
+ 0,
947
+ f,
948
+ I
949
+ ), l = M.getImageData(0, 0, f, I).data), Ce(x.data, f, I, n, l, S), r.putImageData(x, k, m);
950
+ }
951
+ }
952
+ } finally {
953
+ s == null || s.dispose();
954
+ }
955
+ }
956
+ const ir = 50, we = (t, e) => JSON.stringify(t) === JSON.stringify(e), or = (t, e) => t === e || !!t && !!e && t.width === e.width && t.height === e.height, _t = (t) => JSON.parse(JSON.stringify(t));
957
+ class dn {
958
+ constructor() {
959
+ this.snapshot = {
960
+ status: "idle",
961
+ error: null,
962
+ state: null,
963
+ ui: { util: "crop", cropTab: "rotation", finetuneTab: "brightness", resizeLocked: !0 },
964
+ size: null,
965
+ canUndo: !1,
966
+ canRedo: !1,
967
+ canRevert: !1
968
+ }, this.storeListeners = /* @__PURE__ */ new Set(), this.events = /* @__PURE__ */ new Map(), this.history = [], this.index = -1, this.initial = null, this.loaded = null, this.options = null, this.openToken = 0, this.subscribe = (e) => (this.storeListeners.add(e), () => {
969
+ this.storeListeners.delete(e);
970
+ }), this.getSnapshot = () => this.snapshot;
971
+ }
972
+ patch(e) {
973
+ const n = e.state !== void 0 ? e.state : this.snapshot.state;
974
+ this.snapshot = {
975
+ ...this.snapshot,
976
+ ...e,
977
+ canUndo: this.index > 0,
978
+ canRedo: this.index < this.history.length - 1,
979
+ canRevert: !!n && !!this.initial && !we(n, this.initial)
980
+ }, this.storeListeners.forEach((i) => i());
981
+ }
982
+ on(e, n) {
983
+ let i = this.events.get(e);
984
+ return i || this.events.set(e, i = /* @__PURE__ */ new Set()), i.add(n), () => {
985
+ i.delete(n);
986
+ };
987
+ }
988
+ emit(e, n) {
989
+ var i;
990
+ (i = this.events.get(e)) == null || i.forEach((o) => o(n));
991
+ }
992
+ // ── lifecycle ────────────────────────────────────────────────────────────────────────────────
993
+ /** The loaded image (full resolution) — for renderers. */
994
+ get image() {
995
+ return this.loaded;
996
+ }
997
+ /** The `open()` options. */
998
+ get openOptions() {
999
+ return this.options;
1000
+ }
1001
+ async open(e) {
1002
+ const n = ++this.openToken;
1003
+ this.options = e, this.history = [], this.index = -1, this.initial = null, this.loaded = null, this.patch({
1004
+ status: "loading",
1005
+ error: null,
1006
+ state: null,
1007
+ size: null,
1008
+ ui: { ...this.snapshot.ui, util: e.util ?? "crop" }
1009
+ });
1010
+ try {
1011
+ const i = await On(e.src);
1012
+ if (n !== this.openToken) return;
1013
+ this.loaded = i;
1014
+ const o = { width: i.width, height: i.height }, r = Cn(o, e.cropAspectRatio), a = e.initialState ?? {}, s = {
1015
+ ...r,
1016
+ ...a,
1017
+ crop: { ...r.crop, ...a.crop },
1018
+ finetune: { ...Qe, ...a.finetune },
1019
+ redact: { ...r.redact, ...a.redact }
1020
+ };
1021
+ s.filter && s.filter !== "default" && !s.colorMatrix && (s.colorMatrix = Re[s.filter] ?? null);
1022
+ const _ = Xe(s, o);
1023
+ this.initial = Xe(r, o), this.history = [_t(_)], this.index = 0, this.patch({ status: "ready", state: _, size: o }), this.emit("load", { size: o });
1024
+ } catch (i) {
1025
+ if (n !== this.openToken) return;
1026
+ throw this.patch({ status: "error", error: i }), i;
1027
+ }
1028
+ }
1029
+ close() {
1030
+ var n;
1031
+ this.openToken++;
1032
+ const e = (n = this.loaded) == null ? void 0 : n.image;
1033
+ e && "close" in e && typeof e.close == "function" && e.close(), this.loaded = null, this.emit("close");
1034
+ }
1035
+ // ── state ────────────────────────────────────────────────────────────────────────────────────
1036
+ getState() {
1037
+ if (!this.snapshot.state) throw new Error("No image is open");
1038
+ return _t(this.snapshot.state);
1039
+ }
1040
+ /** Replace part of the state and commit it (one undo step). */
1041
+ setState(e) {
1042
+ this.preview(e), this.commit();
1043
+ }
1044
+ /** Apply a live (uncommitted) change — e.g. while dragging. Call `commit()` when the interaction ends. */
1045
+ preview(e) {
1046
+ const n = this.snapshot.state, i = this.snapshot.size;
1047
+ if (!n || !i) return;
1048
+ const o = { ...n, ...e }, r = this.index >= 0 ? this.history[this.index] : n;
1049
+ "resize" in e && !or(e.resize ?? null, r.resize) || (o.resize = An(r, { ...o, resize: r.resize })), this.patch({ state: o });
1050
+ }
1051
+ /** Push the current state onto the history (if it changed) and emit `update`. */
1052
+ commit() {
1053
+ const e = this.snapshot.state;
1054
+ e && (this.index >= 0 && we(e, this.history[this.index]) || (this.history = this.history.slice(0, this.index + 1), this.history.push(_t(e)), this.history.length > ir && this.history.shift(), this.index = this.history.length - 1, this.patch({}), this.emit("update", _t(e))));
1055
+ }
1056
+ undo() {
1057
+ this.index <= 0 || (this.index--, this.patch({ state: _t(this.history[this.index]) }), this.emit("undo", this.getState()), this.emit("update", this.getState()));
1058
+ }
1059
+ redo() {
1060
+ this.index >= this.history.length - 1 || (this.index++, this.patch({ state: _t(this.history[this.index]) }), this.emit("redo", this.getState()), this.emit("update", this.getState()));
1061
+ }
1062
+ /**
1063
+ * Back to the original image — every edit dropped, including the ones an `initialState` re-opened with.
1064
+ * It's one history step, so Undo brings the edits back.
1065
+ */
1066
+ revert() {
1067
+ const e = this.snapshot.state;
1068
+ !this.initial || !e || we(e, this.initial) || (this.patch({ state: _t(this.initial) }), this.commit(), this.emit("revert", this.getState()));
1069
+ }
1070
+ setUi(e) {
1071
+ e.util && e.util !== this.snapshot.ui.util && this.commit(), this.patch({ ui: { ...this.snapshot.ui, ...e } });
1072
+ }
1073
+ /** Render the current state at full resolution. */
1074
+ async process() {
1075
+ var a, s;
1076
+ const e = this.loaded, n = this.snapshot.state;
1077
+ if (!e || !n) throw new Error("No image is open");
1078
+ const i = Xn((a = this.options) == null ? void 0 : a.outputType, e.type), r = { dest: await nr(
1079
+ e.image,
1080
+ { width: e.width, height: e.height },
1081
+ n,
1082
+ i,
1083
+ ((s = this.options) == null ? void 0 : s.outputQuality) ?? 0.92
1084
+ ), imageState: _t(n) };
1085
+ return this.emit("process", r), r;
1086
+ }
1087
+ }
1088
+ const _o = () => new dn(), ar = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1089
+ function Ve(t, e, n, { stiffness: i = 240, damping: o = 30 } = {}, r) {
1090
+ if (ar() || typeof requestAnimationFrame != "function") {
1091
+ n(e), r == null || r();
1092
+ const S = (() => {
1093
+ });
1094
+ return S.retarget = (y) => n(y), S;
1095
+ }
1096
+ const a = [...e], s = [...t], _ = t.map(() => 0), c = t.map((S, y) => Math.max(1e-5, Math.abs(a[y] - S) * 1e-3));
1097
+ let M = performance.now(), m = 0, k = !1;
1098
+ const f = (S) => {
1099
+ if (k) return;
1100
+ let y = Math.min(0.064, (S - M) / 1e3);
1101
+ for (M = S; y > 0; ) {
1102
+ const l = Math.min(y, 0.008333333333333333);
1103
+ for (let A = 0; A < s.length; A++) {
1104
+ const u = -i * (s[A] - a[A]) - o * _[A];
1105
+ _[A] += u * l, s[A] += _[A] * l;
1106
+ }
1107
+ y -= l;
1108
+ }
1109
+ if (s.every(
1110
+ (l, A) => Math.abs(l - a[A]) < c[A] && Math.abs(_[A]) < c[A] * 10
1111
+ )) {
1112
+ n(a), r == null || r();
1113
+ return;
1114
+ }
1115
+ n([...s]), m = requestAnimationFrame(f);
1116
+ };
1117
+ m = requestAnimationFrame(f);
1118
+ const I = (() => {
1119
+ k = !0, cancelAnimationFrame(m);
1120
+ });
1121
+ return I.retarget = (S) => {
1122
+ for (let y = 0; y < a.length; y++)
1123
+ a[y] = S[y], c[y] = Math.max(c[y], 1e-5);
1124
+ }, I;
1125
+ }
1126
+ const sr = "_overlay_1kmqm_6", cr = "_editor_1kmqm_11", lr = "_header_1kmqm_61", hr = "_headerStart_1kmqm_70", ur = "_headerCenter_1kmqm_74", dr = "_headerEnd_1kmqm_79", mr = "_group_1kmqm_84", fr = "_zoomLabel_1kmqm_97", pr = "_done_1kmqm_105", gr = "_closeIcon_1kmqm_116", _r = "_groupDivider_1kmqm_120", wr = "_zoomReadout_1kmqm_140", vr = "_main_1kmqm_155", br = "_nav_1kmqm_166", xr = "_stage_1kmqm_167", Mr = "_toolbar_1kmqm_168", yr = "_canvasArea_1kmqm_169", Er = "_footer_1kmqm_170", kr = "_footerInner_1kmqm_171", Tr = "_navList_1kmqm_176", Ir = "_toolbarRow_1kmqm_177", Sr = "_tool_1kmqm_168", Ar = "_toolActive_1kmqm_224", Rr = "_shapeSlot_1kmqm_270", Cr = "_shapePreview_1kmqm_277", Lr = "_shapeCustom_1kmqm_283", Nr = "_shapeOrientation_1kmqm_288", qr = "_orientButton_1kmqm_297", Pr = "_orientActive_1kmqm_320", zr = "_viewport_1kmqm_337", Dr = "_viewportCrop_1kmqm_346", Ur = "_viewportPannable_1kmqm_349", Fr = "_canvas_1kmqm_169", Or = "_scene_1kmqm_362", Xr = "_cropBox_1kmqm_369", Br = "_grid_1kmqm_381", Yr = "_cropInteracting_1kmqm_410", Vr = "_sizeBadge_1kmqm_420", Gr = "_sizeBadgeActive_1kmqm_446", $r = "_sizeTimes_1kmqm_449", jr = "_sizeUnit_1kmqm_450", Wr = "_handle_1kmqm_460", Kr = "_handle_nw_1kmqm_464", Hr = "_handle_ne_1kmqm_465", Qr = "_handle_sw_1kmqm_466", Zr = "_handle_se_1kmqm_467", Jr = "_handle_n_1kmqm_464", ti = "_handle_s_1kmqm_466", ei = "_handle_w_1kmqm_530", ni = "_handle_e_1kmqm_531", ri = "_status_1kmqm_546", ii = "_toastError_1kmqm_557", oi = "_tabs_1kmqm_590", ai = "_tab_1kmqm_590", si = "_tabActive_1kmqm_625", ci = "_tabDot_1kmqm_636", li = "_resizePanel_1kmqm_647", hi = "_resizeFields_1kmqm_653", ui = "_dimField_1kmqm_659", di = "_dimLabel_1kmqm_677", mi = "_dimLabelShort_1kmqm_681", fi = "_dimInput_1kmqm_684", pi = "_dimUnit_1kmqm_700", gi = "_lockButton_1kmqm_705", _i = "_lockActive_1kmqm_722", wi = "_strip_1kmqm_734", vi = "_fadeStart_1kmqm_749", bi = "_fadeEnd_1kmqm_753", xi = "_stripGroup_1kmqm_773", Mi = "_filterTile_1kmqm_778", yi = "_filterThumb_1kmqm_792", Ei = "_filterActive_1kmqm_823", ki = "_filterLabel_1kmqm_833", Ti = "_fadeIn_1kmqm_838", Ii = "_toolbarIconOnPhone_1kmqm_880", Si = "_toolbarLabel_1kmqm_892", Ai = "_dimLabelFull_1kmqm_901", Ri = "_toolLabel_1kmqm_937", w = {
1127
+ overlay: sr,
1128
+ editor: cr,
1129
+ header: lr,
1130
+ headerStart: hr,
1131
+ headerCenter: ur,
1132
+ headerEnd: dr,
1133
+ group: mr,
1134
+ zoomLabel: fr,
1135
+ done: pr,
1136
+ closeIcon: gr,
1137
+ groupDivider: _r,
1138
+ zoomReadout: wr,
1139
+ main: vr,
1140
+ nav: br,
1141
+ stage: xr,
1142
+ toolbar: Mr,
1143
+ canvasArea: yr,
1144
+ footer: Er,
1145
+ footerInner: kr,
1146
+ navList: Tr,
1147
+ toolbarRow: Ir,
1148
+ tool: Sr,
1149
+ toolActive: Ar,
1150
+ shapeSlot: Rr,
1151
+ shapePreview: Cr,
1152
+ shapeCustom: Lr,
1153
+ shapeOrientation: Nr,
1154
+ orientButton: qr,
1155
+ orientActive: Pr,
1156
+ viewport: zr,
1157
+ viewportCrop: Dr,
1158
+ viewportPannable: Ur,
1159
+ canvas: Fr,
1160
+ scene: Or,
1161
+ cropBox: Xr,
1162
+ grid: Br,
1163
+ cropInteracting: Yr,
1164
+ sizeBadge: Vr,
1165
+ "tz-ie-fade": "_tz-ie-fade_1kmqm_1",
1166
+ sizeBadgeActive: Gr,
1167
+ sizeTimes: $r,
1168
+ sizeUnit: jr,
1169
+ handle: Wr,
1170
+ handle_nw: Kr,
1171
+ handle_ne: Hr,
1172
+ handle_sw: Qr,
1173
+ handle_se: Zr,
1174
+ handle_n: Jr,
1175
+ handle_s: ti,
1176
+ handle_w: ei,
1177
+ handle_e: ni,
1178
+ status: ri,
1179
+ toastError: ii,
1180
+ tabs: oi,
1181
+ tab: ai,
1182
+ tabActive: si,
1183
+ tabDot: ci,
1184
+ resizePanel: li,
1185
+ resizeFields: hi,
1186
+ dimField: ui,
1187
+ dimLabel: di,
1188
+ dimLabelShort: mi,
1189
+ dimInput: fi,
1190
+ dimUnit: pi,
1191
+ lockButton: gi,
1192
+ lockActive: _i,
1193
+ strip: wi,
1194
+ fadeStart: vi,
1195
+ fadeEnd: bi,
1196
+ stripGroup: xi,
1197
+ filterTile: Mi,
1198
+ filterThumb: yi,
1199
+ filterActive: Ei,
1200
+ filterLabel: ki,
1201
+ fadeIn: Ti,
1202
+ toolbarIconOnPhone: Ii,
1203
+ toolbarLabel: Si,
1204
+ dimLabelFull: Ai,
1205
+ toolLabel: Ri
1206
+ }, Ci = 24, Li = 12, Ge = 4096, Ni = 320, qi = 768, $e = 0.35;
1207
+ function Pi(t) {
1208
+ const e = t ? getComputedStyle(t).getPropertyValue("--tz-color-background-rgb") : "", [n, i, o] = e.split(",").map((r) => Number(r.trim()) / 255);
1209
+ return [n, i, o].every((r) => Number.isFinite(r)) ? [n, i, o] : [0, 0, 0];
1210
+ }
1211
+ const zi = 40, Di = ["nw", "ne", "sw", "se", "n", "s", "w", "e"], Xt = (t) => [t.center[0], t.center[1], Math.log(t.scale), t.rotation, t.flip], Ui = (t) => ({
1212
+ center: [t[0], t[1]],
1213
+ scale: Math.exp(t[2]),
1214
+ rotation: t[3],
1215
+ flip: t[4]
1216
+ }), Fi = Ke(function({ core: e, snapshot: n, cropAspectRatio: i, viewZoom: o, onViewZoom: r, onZoomReport: a, areaRef: s }, _) {
1217
+ const { state: c, size: M, ui: m } = n, k = vn(), f = m.util, I = F(null), S = F(null), [y, x] = Q(null), [l, A] = Q(null), u = F(null);
1218
+ u.current = l;
1219
+ const [R, d] = Q([0, 0]), [E, b] = Q(!1), [N, $] = Q(0), G = F(!1), K = F(null), Y = F(null), ct = F(null), Z = F(/* @__PURE__ */ new Map()), dt = F(void 0);
1220
+ j(() => {
1221
+ const g = I.current;
1222
+ if (!g) return;
1223
+ const p = () => {
1224
+ var U;
1225
+ const z = g.getBoundingClientRect(), B = (U = s == null ? void 0 : s.current) == null ? void 0 : U.getBoundingClientRect();
1226
+ x({
1227
+ width: z.width,
1228
+ height: z.height,
1229
+ dpr: window.devicePixelRatio || 1,
1230
+ // horizontally the area is mirrored to the wider side, so the crop sits in the middle of the
1231
+ // screen (not of the space right of the tool menu); vertically it's the space between the bars
1232
+ area: B ? Oi(z, B) : void 0
1233
+ });
1234
+ };
1235
+ if (p(), L.current = p, typeof ResizeObserver > "u") return;
1236
+ const P = new ResizeObserver(p);
1237
+ return P.observe(g), s != null && s.current && P.observe(s.current), () => P.disconnect();
1238
+ }, [s]);
1239
+ const L = F(null);
1240
+ de(() => {
1241
+ var g;
1242
+ (g = L.current) == null || g.call(L);
1243
+ }, [f, n.status]);
1244
+ const q = n.status === "ready" ? e.image : null, [C, V] = Q(null);
1245
+ j(() => {
1246
+ const g = S.current;
1247
+ if (!q || !g) return;
1248
+ const p = le.create(g), P = Math.min(Ge, (p == null ? void 0 : p.maxTextureSize) ?? Ge), z = ne(q.image, q.width, q.height, P), B = Ne * Math.max(q.width, q.height) * (z.width / q.width), U = rn(z.canvas, z.width, z.height, B);
1249
+ return p == null || p.setImage(z.canvas, U), V({ gl: p, tex: z, blur: U }), () => {
1250
+ p == null || p.dispose(!1), V(null);
1251
+ };
1252
+ }, [q]);
1253
+ const H = c && M ? Lt(c).width * c.scale / Yt(c).width : 1, mt = M ? Math.max(1, Math.round(M.width * H)) : 0, lt = (c == null ? void 0 : c.redact.effect) ?? "blur", xt = (c == null ? void 0 : c.redact.amount) ?? 0, [J, rt] = Q(null);
1254
+ j(() => {
1255
+ if (!C || !M) {
1256
+ rt(null);
1257
+ return;
1258
+ }
1259
+ const g = requestAnimationFrame(() => {
1260
+ let p = { ...C.tex, mipmap: !0, pixelate: !1 };
1261
+ mt < p.width && (p = {
1262
+ ...ne(
1263
+ p.canvas,
1264
+ p.width,
1265
+ p.height,
1266
+ Math.max(1, Math.round(Math.max(M.width, M.height) * H))
1267
+ ),
1268
+ mipmap: !0,
1269
+ pixelate: !1
1270
+ });
1271
+ const P = Te({ redact: { effect: lt, amount: xt } }, M);
1272
+ if (P <= 0) return rt(p);
1273
+ const z = P * (p.width / M.width);
1274
+ if (lt === "blur") {
1275
+ const U = sn(p.canvas, p.width, p.height, z, qi);
1276
+ return rt({
1277
+ canvas: U,
1278
+ width: U.width,
1279
+ height: U.height,
1280
+ mipmap: !0,
1281
+ pixelate: !1
1282
+ });
1283
+ }
1284
+ if (!C.gl) {
1285
+ const U = jn(p.canvas, p.width, p.height, z);
1286
+ return rt({
1287
+ canvas: U,
1288
+ width: U.width,
1289
+ height: U.height,
1290
+ mipmap: !1,
1291
+ pixelate: !1
1292
+ });
1293
+ }
1294
+ const B = ne(
1295
+ p.canvas,
1296
+ p.width,
1297
+ p.height,
1298
+ Math.max(p.width, p.height) / Math.max(1, z)
1299
+ );
1300
+ rt({ ...B, mipmap: !1, pixelate: !0 });
1301
+ });
1302
+ return () => cancelAnimationFrame(g);
1303
+ }, [C, mt, lt, xt]), de(() => {
1304
+ C != null && C.gl && J && C.gl.setSource(J.canvas, J.mipmap);
1305
+ }, [C, J]);
1306
+ const tt = mn(() => {
1307
+ if (!c || !y) return null;
1308
+ const g = y.area ?? y;
1309
+ if (f === "crop") {
1310
+ const Dt = Ye(c.crop, g, Math.min(Ci, g.width * 0.06)), Et = M ? Bt(c, M) / c.scale : 1 / c.scale, Ut = Ni / Math.max(c.crop.width, c.crop.height);
1311
+ return { ...Dt, scale: Math.min(Dt.scale, Math.max(Et, Ut)) };
1312
+ }
1313
+ const p = Yt(c), P = Ye(p, g, Li), z = { ...P, scale: Math.min(P.scale, Lt(c).width / p.width) };
1314
+ if (o == null) return z;
1315
+ const B = o / c.scale, U = Math.max(0, p.width / 2 - g.width / 2 / B), it = Math.max(0, p.height / 2 - g.height / 2 / B), ht = Math.max(-U, Math.min(U, R[0])), yt = Math.max(-it, Math.min(it, R[1]));
1316
+ return { ...z, scale: B, center: [z.center[0] + ht, z.center[1] + yt] };
1317
+ }, [c, y, f, o, R, N]), Ht = F(f), It = F(!1), Mt = F({
1318
+ stage: y,
1319
+ state: c
1320
+ }), Pt = (g, p) => {
1321
+ var P;
1322
+ (P = Y.current) == null || P.call(Y), It.current = !0, Y.current = Ve(
1323
+ Xt(g),
1324
+ Xt(p),
1325
+ (z) => A(Ui(z)),
1326
+ void 0,
1327
+ () => {
1328
+ It.current = !1;
1329
+ }
1330
+ );
1331
+ }, [ft, he] = Q(f === "crop" ? $e : 0), Qt = F(ft);
1332
+ Qt.current = ft, j(() => {
1333
+ const g = f === "crop" ? $e : 0;
1334
+ return Ve([Qt.current], [g], ([p]) => he(Math.max(0, p)));
1335
+ }, [f]), de(() => {
1336
+ var it, ht, yt, Dt;
1337
+ if (!tt) return;
1338
+ Ht.current !== f && (Ht.current = f, u.current && !K.current && (K.current = "jump"));
1339
+ const g = y !== Mt.current.stage && c === Mt.current.state, p = (it = Mt.current.state) == null ? void 0 : it.resize, P = f === "resize" && (((ht = c == null ? void 0 : c.resize) == null ? void 0 : ht.width) !== (p == null ? void 0 : p.width) || ((yt = c == null ? void 0 : c.resize) == null ? void 0 : yt.height) !== (p == null ? void 0 : p.height)), z = Mt.current.target, B = !!z && Xt(z).every((Et, Ut) => Math.abs(Et - Xt(tt)[Ut]) < 1e-9);
1340
+ Mt.current = { stage: y, state: c, target: tt };
1341
+ const U = K.current;
1342
+ if (U) {
1343
+ K.current = null;
1344
+ const Et = u.current ?? tt, Ut = U === "rotate" ? { center: tt.center, scale: Et.scale, rotation: Math.PI / 2, flip: 1 } : U === "flip" ? { center: tt.center, scale: Et.scale, rotation: 0, flip: -1 } : Et;
1345
+ Pt(Ut, tt);
1346
+ return;
1347
+ }
1348
+ if ((g || P || B) && It.current && Y.current) {
1349
+ Y.current.retarget(Xt(tt));
1350
+ return;
1351
+ }
1352
+ if (P && u.current && !G.current) {
1353
+ Pt(u.current, tt);
1354
+ return;
1355
+ }
1356
+ G.current || ((Dt = Y.current) == null || Dt.call(Y), Y.current = null, It.current = !1, A(tt));
1357
+ }, [tt]), j(() => () => {
1358
+ var g;
1359
+ return (g = Y.current) == null ? void 0 : g.call(Y);
1360
+ }, []), j(() => {
1361
+ l && c && a(l.scale * c.scale);
1362
+ }, [l, c, a]), j(() => {
1363
+ const g = S.current;
1364
+ if (!g || !y) return;
1365
+ const p = Math.max(1, Math.round(y.width * y.dpr)), P = Math.max(1, Math.round(y.height * y.dpr));
1366
+ g.width !== p && (g.width = p), g.height !== P && (g.height = P);
1367
+ }, [y]), j(() => {
1368
+ if (!C || !J || !c || !M || !l || !y) return;
1369
+ const g = f === "crop" ? c : { ...c, crop: Yt(c) }, p = Kn(g, M, l, y), P = J.pixelate ? Te(c, M) : 0, z = P > 0 ? {
1370
+ pixel: ((U) => [U.cols, U.rows])(
1371
+ an(g.crop, P * c.scale)
1372
+ ),
1373
+ cropToUV: at(Nt(p.toCrop), p.toUV)
1374
+ } : null, B = requestAnimationFrame(() => {
1375
+ const U = {
1376
+ ...Pe(c),
1377
+ ...p,
1378
+ ...z,
1379
+ // the image around the crop: dimmed in the Crop view, gone (faded into the background) in the
1380
+ // others — `surround` springs between the two on a tool switch
1381
+ clip: ft <= 1e-3,
1382
+ dim: ft,
1383
+ dimColor: Pi(I.current)
1384
+ };
1385
+ C.gl ? C.gl.render(U) : S.current && Zn(S.current, J.canvas, J, C.blur, C.blur, U);
1386
+ });
1387
+ return () => cancelAnimationFrame(B);
1388
+ }, [C, J, c, M, l, y, ft, k, f]), fn(_, () => ({
1389
+ transition(g) {
1390
+ K.current = g;
1391
+ }
1392
+ }));
1393
+ const pt = (l == null ? void 0 : l.scale) ?? 1, Zt = F(r);
1394
+ Zt.current = r;
1395
+ const zt = () => {
1396
+ const [g, p] = [...Z.current.values()];
1397
+ return g && p ? Math.hypot(g.x - p.x, g.y - p.y) : 0;
1398
+ }, gt = (g) => {
1399
+ var P, z;
1400
+ if (!c || !M || g.pointerType === "mouse" && g.button !== 0 || g.target.closest("button")) return;
1401
+ if (g.currentTarget.setPointerCapture(g.pointerId), Z.current.set(g.pointerId, { x: g.clientX, y: g.clientY }), (P = Y.current) == null || P.call(Y), Z.current.size === 2) {
1402
+ ct.current = {
1403
+ kind: "pinch",
1404
+ dist: zt(),
1405
+ base: c,
1406
+ zoom: Bt(c, M),
1407
+ viewZoom: ((l == null ? void 0 : l.scale) ?? 1) * c.scale
1408
+ };
1409
+ return;
1410
+ }
1411
+ const p = (z = g.target.closest("[data-handle]")) == null ? void 0 : z.dataset.handle;
1412
+ f === "crop" ? (ct.current = p ? { kind: "resize", id: g.pointerId, x: g.clientX, y: g.clientY, base: c, handle: p } : { kind: "pan", id: g.pointerId, x: g.clientX, y: g.clientY, base: c }, p && (G.current = !0), b(!0)) : o != null && (ct.current = { kind: "viewPan", id: g.pointerId, x: g.clientX, y: g.clientY, pan: R });
1413
+ }, St = (g) => {
1414
+ if (!Z.current.has(g.pointerId) || !M) return;
1415
+ Z.current.set(g.pointerId, { x: g.clientX, y: g.clientY });
1416
+ const p = ct.current;
1417
+ if (!p) return;
1418
+ if (p.kind === "pinch") {
1419
+ const B = zt() / Math.max(1, p.dist);
1420
+ f === "crop" ? e.preview(Gt(p.base, Math.min(Vt, p.zoom * B), M)) : r(ve(p.viewZoom * B));
1421
+ return;
1422
+ }
1423
+ if (p.id !== g.pointerId) return;
1424
+ const P = (g.clientX - p.x) / pt, z = (g.clientY - p.y) / pt;
1425
+ if (p.kind === "pan") e.preview(qn(p.base, -P, -z, M));
1426
+ else if (p.kind === "resize") {
1427
+ const B = p.base.crop, it = i || p.base.cropRatio || g.shiftKey ? B.width / B.height : null;
1428
+ e.preview(
1429
+ zn(p.base, p.handle, P, z, M, {
1430
+ aspectRatio: it,
1431
+ minSize: Math.max(p.base.scale, zi / pt)
1432
+ })
1433
+ );
1434
+ } else p.kind === "viewPan" && d([p.pan[0] - P, p.pan[1] - z]);
1435
+ }, Jt = (g) => {
1436
+ if (!Z.current.has(g.pointerId)) return;
1437
+ Z.current.delete(g.pointerId);
1438
+ const p = ct.current;
1439
+ if (p) {
1440
+ if (p.kind === "pinch") {
1441
+ Z.current.size === 0 && (ct.current = null, f === "crop" && e.commit());
1442
+ return;
1443
+ }
1444
+ p.id === g.pointerId && (ct.current = null, b(!1), p.kind === "resize" ? (G.current = !1, K.current = "jump", e.commit(), $((P) => P + 1)) : p.kind === "pan" && e.commit());
1445
+ }
1446
+ }, h = (g) => {
1447
+ if (!c || !M) return;
1448
+ const p = g.ctrlKey || g.metaKey;
1449
+ if (!(p && T.current)) {
1450
+ if (f === "crop") {
1451
+ const P = Math.exp(-g.deltaY * (p ? 0.01 : 2e-3));
1452
+ e.preview(Gt(c, Math.min(Vt, Bt(c, M) * P), M)), clearTimeout(dt.current), dt.current = setTimeout(() => e.commit(), 250);
1453
+ return;
1454
+ }
1455
+ if (p) {
1456
+ const P = ((l == null ? void 0 : l.scale) ?? 1) * c.scale;
1457
+ r(ve(P * Math.exp(-g.deltaY * 0.01)));
1458
+ } else o != null && d(([P, z]) => [P + g.deltaX / pt, z + g.deltaY / pt]);
1459
+ }
1460
+ };
1461
+ j(() => () => clearTimeout(dt.current), []);
1462
+ const T = F(null), D = F({ state: c, size: M, util: f, view: l });
1463
+ D.current = { state: c, size: M, util: f, view: l }, j(() => {
1464
+ const g = I.current;
1465
+ if (!g) return;
1466
+ const p = (B) => {
1467
+ const { state: U, size: it, view: ht } = D.current;
1468
+ B.preventDefault(), !(!U || !it || Z.current.size > 0) && (T.current = { base: U, zoom: Bt(U, it), viewZoom: ((ht == null ? void 0 : ht.scale) ?? 1) * U.scale });
1469
+ }, P = (B) => {
1470
+ const U = T.current, { size: it, util: ht } = D.current;
1471
+ if (!U || !it) return;
1472
+ B.preventDefault();
1473
+ const yt = B.scale || 1;
1474
+ ht === "crop" ? e.preview(Gt(U.base, Math.min(Vt, U.zoom * yt), it)) : Zt.current(ve(U.viewZoom * yt));
1475
+ }, z = (B) => {
1476
+ T.current && (B.preventDefault(), T.current = null, D.current.util === "crop" && e.commit());
1477
+ };
1478
+ return g.addEventListener("gesturestart", p), g.addEventListener("gesturechange", P), g.addEventListener("gestureend", z), () => {
1479
+ g.removeEventListener("gesturestart", p), g.removeEventListener("gesturechange", P), g.removeEventListener("gestureend", z);
1480
+ };
1481
+ }, [e]);
1482
+ let O = null;
1483
+ if (f === "crop" && c && y && l) {
1484
+ const g = hn({ ...l, rotation: 0, flip: 1 }, y), [p, P] = ie(g, c.crop.x, c.crop.y), [z, B] = ie(
1485
+ g,
1486
+ c.crop.x + c.crop.width,
1487
+ c.crop.y + c.crop.height
1488
+ );
1489
+ O = { left: p, top: P, width: z - p, height: B - P };
1490
+ }
1491
+ const At = l && y ? {
1492
+ transform: `scaleX(${l.flip}) rotate(${l.rotation}rad)`,
1493
+ transformOrigin: ln(y).map((g) => `${g}px`).join(" ")
1494
+ } : void 0;
1495
+ return /* @__PURE__ */ X(
1496
+ "div",
1497
+ {
1498
+ ref: I,
1499
+ className: W(
1500
+ w.viewport,
1501
+ f === "crop" ? w.viewportCrop : o != null && w.viewportPannable
1502
+ ),
1503
+ "data-part": "viewport",
1504
+ onPointerDown: gt,
1505
+ onPointerMove: St,
1506
+ onPointerUp: Jt,
1507
+ onPointerCancel: Jt,
1508
+ onWheel: h,
1509
+ children: [
1510
+ /* @__PURE__ */ v("canvas", { ref: S, className: w.canvas, "data-part": "canvas" }),
1511
+ O && /* @__PURE__ */ v("div", { className: W(w.scene, w.fadeIn), style: At, children: /* @__PURE__ */ X(
1512
+ "div",
1513
+ {
1514
+ className: W(w.cropBox, E && w.cropInteracting),
1515
+ style: O,
1516
+ "data-part": "crop",
1517
+ children: [
1518
+ /* @__PURE__ */ v("span", { className: w.grid, "aria-hidden": "true" }),
1519
+ Di.map((g) => /* @__PURE__ */ v(
1520
+ "span",
1521
+ {
1522
+ className: W(w.handle, w[`handle_${g}`]),
1523
+ "data-handle": g,
1524
+ "aria-hidden": "true"
1525
+ },
1526
+ g
1527
+ ))
1528
+ ]
1529
+ }
1530
+ ) }),
1531
+ O && c && l && l.rotation === 0 && l.flip === 1 && /* @__PURE__ */ X(
1532
+ "div",
1533
+ {
1534
+ className: W(w.sizeBadge, E && w.sizeBadgeActive),
1535
+ style: {
1536
+ left: O.left + O.width / 2,
1537
+ top: O.top + O.height
1538
+ },
1539
+ "data-part": "size",
1540
+ children: [
1541
+ Lt(c).width,
1542
+ /* @__PURE__ */ v("span", { className: w.sizeTimes, children: "×" }),
1543
+ Lt(c).height,
1544
+ /* @__PURE__ */ v("span", { className: w.sizeUnit, children: "px" })
1545
+ ]
1546
+ }
1547
+ )
1548
+ ]
1549
+ }
1550
+ );
1551
+ });
1552
+ function Oi(t, e) {
1553
+ const n = Math.max(0, e.left - t.left, t.right - e.right);
1554
+ return {
1555
+ x: n,
1556
+ y: e.top - t.top,
1557
+ width: Math.max(1, t.width - n * 2),
1558
+ height: e.height
1559
+ };
1560
+ }
1561
+ const Ie = 0.02, Se = 8, ve = (t) => Math.min(Se, Math.max(Ie, t)), Xi = [
1562
+ { label: "1:1", ratio: 1 },
1563
+ { label: "2:1", ratio: 2 },
1564
+ { label: "3:2", ratio: 3 / 2 },
1565
+ { label: "4:3", ratio: 4 / 3 },
1566
+ { label: "5:4", ratio: 5 / 4 },
1567
+ { label: "16:10", ratio: 16 / 10 },
1568
+ { label: "16:9", ratio: 16 / 9 }
1569
+ ], te = (t, e) => Math.abs(t - e) < 1e-3, Bi = (t) => t.split(":").reverse().join(":");
1570
+ function je({ ratio: t }) {
1571
+ const n = t == null || t >= 1 ? 16 : Math.max(6, 16 * t), i = t == null || t <= 1 ? 16 : Math.max(6, 16 / t);
1572
+ return /* @__PURE__ */ v("span", { className: w.shapeSlot, children: /* @__PURE__ */ v(
1573
+ "span",
1574
+ {
1575
+ className: W(w.shapePreview, t == null && w.shapeCustom),
1576
+ style: { width: n, height: i }
1577
+ }
1578
+ ) });
1579
+ }
1580
+ function Yi({ ratio: t, options: e, onChange: n }) {
1581
+ const i = oe(), [o, r] = Q(!1), [a, s] = Q(!1), _ = t != null && !te(t, 1) ? t < 1 : a, c = (m) => {
1582
+ n(m), r(!1);
1583
+ }, M = (m) => {
1584
+ s(m), t != null && !te(t, 1) && t < 1 !== m && n(1 / t);
1585
+ };
1586
+ return /* @__PURE__ */ X(
1587
+ bn,
1588
+ {
1589
+ open: o,
1590
+ onOpenChange: r,
1591
+ closeOnSelect: !1,
1592
+ placement: "bottom-start",
1593
+ size: "sm",
1594
+ trigger: /* @__PURE__ */ v(
1595
+ ye,
1596
+ {
1597
+ variant: "text",
1598
+ color: "primary",
1599
+ size: "sm",
1600
+ startIcon: /* @__PURE__ */ v(et, { name: "MaximizeFormat" }),
1601
+ title: i("imageEditor.cropShape"),
1602
+ "aria-label": i("imageEditor.cropShape"),
1603
+ className: w.toolbarIconOnPhone,
1604
+ children: /* @__PURE__ */ v("span", { className: w.toolbarLabel, children: i("imageEditor.cropShape") })
1605
+ }
1606
+ ),
1607
+ children: [
1608
+ /* @__PURE__ */ v(
1609
+ "div",
1610
+ {
1611
+ className: w.shapeOrientation,
1612
+ role: "group",
1613
+ "aria-label": i("imageEditor.orientation"),
1614
+ children: [!1, !0].map((m) => /* @__PURE__ */ v(
1615
+ "button",
1616
+ {
1617
+ type: "button",
1618
+ className: W(w.orientButton, _ === m && w.orientActive),
1619
+ "aria-pressed": _ === m,
1620
+ "aria-label": i(m ? "imageEditor.portrait" : "imageEditor.landscape"),
1621
+ title: i(m ? "imageEditor.portrait" : "imageEditor.landscape"),
1622
+ onClick: () => M(m),
1623
+ children: /* @__PURE__ */ v(et, { name: m ? "Mobile" : "Monitor", size: "sm" })
1624
+ },
1625
+ String(m)
1626
+ ))
1627
+ }
1628
+ ),
1629
+ /* @__PURE__ */ v(
1630
+ De,
1631
+ {
1632
+ icon: /* @__PURE__ */ v(je, { ratio: null }),
1633
+ clickable: !0,
1634
+ selected: t == null,
1635
+ onClick: () => c(null),
1636
+ children: i("imageEditor.custom")
1637
+ }
1638
+ ),
1639
+ e.map((m) => {
1640
+ const k = _ ? 1 / m.ratio : m.ratio;
1641
+ return /* @__PURE__ */ v(
1642
+ De,
1643
+ {
1644
+ icon: /* @__PURE__ */ v(je, { ratio: k }),
1645
+ clickable: !0,
1646
+ selected: t != null && te(t, k),
1647
+ onClick: () => c(k),
1648
+ children: _ && !te(m.ratio, 1) ? Bi(m.label) : m.label
1649
+ },
1650
+ m.label
1651
+ );
1652
+ })
1653
+ ]
1654
+ }
1655
+ );
1656
+ }
1657
+ const Vi = 52;
1658
+ function Gi(t, e, n) {
1659
+ const i = Math.min(2, typeof window < "u" && window.devicePixelRatio || 1), o = Math.round(Vi * i), r = document.createElement("canvas");
1660
+ r.width = r.height = o;
1661
+ const a = r.getContext("2d", { willReadFrequently: !0 });
1662
+ if (!a) return null;
1663
+ const { crop: s } = n, _ = o / Math.min(s.width, s.height), [c, M] = $t(s), m = at(
1664
+ qe(n, e),
1665
+ st(-c, -M),
1666
+ nt(_),
1667
+ st(o / 2, o / 2)
1668
+ );
1669
+ a.setTransform(m[0], m[3], m[1], m[4], m[2], m[5]), a.imageSmoothingQuality = "high", a.drawImage(t, 0, 0, e.width, e.height), a.setTransform(1, 0, 0, 1, 0, 0);
1670
+ let k;
1671
+ try {
1672
+ k = a.getImageData(0, 0, o, o);
1673
+ } catch {
1674
+ return null;
1675
+ }
1676
+ const f = Ne * Math.max(e.width, e.height) * n.scale * _, I = n.finetune.clarity ? Le(k.data, o, o, f) : null, S = at(
1677
+ st(-o / 2, -o / 2),
1678
+ nt(1 / _),
1679
+ nt(2 / s.width, 2 / s.height)
1680
+ ), y = {};
1681
+ for (const x of Ee.flat()) {
1682
+ const l = new ImageData(new Uint8ClampedArray(k.data), o, o);
1683
+ Ce(l.data, o, o, Pe(n, Re[x]), I, S), a.putImageData(l, 0, 0), y[x] = r.toDataURL();
1684
+ }
1685
+ return y;
1686
+ }
1687
+ function $i({ image: t, size: e, state: n, onSelect: i }) {
1688
+ var R;
1689
+ const o = oe(), r = F(null), [a, s] = Q({}), [_, c] = Q({ start: !1, end: !1 }), M = n.filter ?? "default", m = F(null);
1690
+ ((R = m.current) == null ? void 0 : R.image) !== t && (m.current = { image: t, source: ne(t, e.width, e.height, 512).canvas });
1691
+ const k = JSON.stringify([
1692
+ n.crop,
1693
+ n.rotation,
1694
+ n.flipX,
1695
+ n.flipY,
1696
+ n.scale,
1697
+ n.finetune
1698
+ ]);
1699
+ j(() => {
1700
+ const d = setTimeout(() => {
1701
+ var N;
1702
+ const E = (N = m.current) == null ? void 0 : N.source;
1703
+ if (!E) return;
1704
+ const b = Gi(E, e, n);
1705
+ b && s(b);
1706
+ }, 120);
1707
+ return () => clearTimeout(d);
1708
+ }, [k, t]);
1709
+ const f = () => {
1710
+ const d = r.current;
1711
+ d && c({
1712
+ start: d.scrollLeft > 2,
1713
+ end: d.scrollLeft + d.clientWidth < d.scrollWidth - 2
1714
+ });
1715
+ };
1716
+ j(() => {
1717
+ f();
1718
+ const d = r.current;
1719
+ if (!d || typeof ResizeObserver > "u") return;
1720
+ const E = new ResizeObserver(f);
1721
+ return E.observe(d), () => E.disconnect();
1722
+ }, []), j(() => {
1723
+ var d, E, b;
1724
+ (b = (E = (d = r.current) == null ? void 0 : d.querySelector(`[data-filter="${M}"]`)) == null ? void 0 : E.scrollIntoView) == null || b.call(E, { block: "nearest", inline: "nearest", behavior: "smooth" });
1725
+ }, [M]), j(() => {
1726
+ const d = r.current;
1727
+ if (!d) return;
1728
+ const E = (b) => {
1729
+ Math.abs(b.deltaY) <= Math.abs(b.deltaX) || (b.preventDefault(), d.scrollLeft += b.deltaY);
1730
+ };
1731
+ return d.addEventListener("wheel", E, { passive: !1 }), () => d.removeEventListener("wheel", E);
1732
+ }, []);
1733
+ const I = F(
1734
+ null
1735
+ ), S = F(0), y = (d) => {
1736
+ if (d.pointerType !== "mouse" || d.button !== 0) return;
1737
+ cancelAnimationFrame(S.current);
1738
+ const E = r.current;
1739
+ I.current = { x: d.clientX, left: E.scrollLeft, v: 0, t: performance.now(), moved: !1 };
1740
+ }, x = (d) => {
1741
+ const E = I.current;
1742
+ if (!E) return;
1743
+ const b = r.current, N = d.clientX - E.x;
1744
+ if (Math.abs(N) > 4 && !E.moved && (E.moved = !0, b.setPointerCapture(d.pointerId)), !E.moved) return;
1745
+ const $ = performance.now(), G = E.left - N;
1746
+ E.v = (b.scrollLeft - G) / Math.max(1, $ - E.t), E.t = $, b.scrollLeft = G;
1747
+ }, l = () => {
1748
+ const d = I.current;
1749
+ if (I.current = null, !(d != null && d.moved)) return;
1750
+ const E = r.current;
1751
+ let b = -d.v, N = performance.now();
1752
+ const $ = (K) => {
1753
+ const Y = K - N;
1754
+ N = K, E.scrollLeft += b * Y, b *= Math.pow(0.995, Y), Math.abs(b) > 0.02 && (S.current = requestAnimationFrame($));
1755
+ };
1756
+ S.current = requestAnimationFrame($);
1757
+ const G = (K) => {
1758
+ K.stopPropagation(), K.preventDefault();
1759
+ };
1760
+ E.addEventListener("click", G, { capture: !0, once: !0 }), setTimeout(() => E.removeEventListener("click", G, { capture: !0 }), 0);
1761
+ };
1762
+ j(() => () => cancelAnimationFrame(S.current), []);
1763
+ const A = Ee.flat(), u = (d) => {
1764
+ var N, $;
1765
+ if (d.key !== "ArrowLeft" && d.key !== "ArrowRight") return;
1766
+ const E = A.indexOf(d.target.dataset.filter);
1767
+ if (E === -1) return;
1768
+ d.preventDefault();
1769
+ const b = A[Math.min(A.length - 1, Math.max(0, E + (d.key === "ArrowRight" ? 1 : -1)))];
1770
+ ($ = (N = r.current) == null ? void 0 : N.querySelector(`[data-filter="${b}"]`)) == null || $.focus();
1771
+ };
1772
+ return /* @__PURE__ */ v(
1773
+ "div",
1774
+ {
1775
+ ref: r,
1776
+ className: W(w.strip, _.start && w.fadeStart, _.end && w.fadeEnd),
1777
+ "data-part": "filters",
1778
+ role: "group",
1779
+ "aria-label": o("imageEditor.filters"),
1780
+ onScroll: f,
1781
+ onPointerDown: y,
1782
+ onPointerMove: x,
1783
+ onPointerUp: l,
1784
+ onPointerCancel: l,
1785
+ onKeyDown: u,
1786
+ children: Ee.map((d, E) => /* @__PURE__ */ v("div", { className: w.stripGroup, children: d.map((b) => /* @__PURE__ */ X(
1787
+ "button",
1788
+ {
1789
+ type: "button",
1790
+ className: W(w.filterTile, b === M && w.filterActive),
1791
+ "data-filter": b,
1792
+ "aria-pressed": b === M,
1793
+ onClick: () => i(b),
1794
+ children: [
1795
+ /* @__PURE__ */ v("span", { className: w.filterThumb, children: a[b] && /* @__PURE__ */ v("img", { src: a[b], alt: "", draggable: !1 }) }),
1796
+ /* @__PURE__ */ v("span", { className: w.filterLabel, children: o(`imageEditor.filter.${b}`) })
1797
+ ]
1798
+ },
1799
+ b
1800
+ )) }, E))
1801
+ }
1802
+ );
1803
+ }
1804
+ const ji = [1, 0.75, 0.5, 0.25], wt = (t, e) => Math.max(1, Math.min(e, Math.round(t)));
1805
+ function Wi({
1806
+ max: t,
1807
+ value: e,
1808
+ locked: n,
1809
+ onLockedChange: i,
1810
+ onInput: o,
1811
+ onChange: r
1812
+ }) {
1813
+ const a = oe(), s = e, [_, c] = Q({ w: String(s.width), h: String(s.height) });
1814
+ j(() => {
1815
+ c({ w: String(s.width), h: String(s.height) });
1816
+ }, [s.width, s.height]);
1817
+ const m = Math.round(s.width * t.height / t.width) === s.height || Math.round(s.height * t.width / t.height) === s.width ? t.width / t.height : s.width / s.height, k = F(null), f = k.current ?? m, I = (u, R) => {
1818
+ const d = Number(R);
1819
+ if (!R || !Number.isFinite(d) || d <= 0) return null;
1820
+ if (u === "w") {
1821
+ let N = wt(d, t.width);
1822
+ if (!n) return { width: N, height: s.height };
1823
+ const $ = wt(N / f, t.height);
1824
+ return $ < N / f - 0.5 && (N = wt($ * f, t.width)), { width: N, height: $ };
1825
+ }
1826
+ let E = wt(d, t.height);
1827
+ if (!n) return { width: s.width, height: E };
1828
+ const b = wt(E * f, t.width);
1829
+ return b < E * f - 0.5 && (E = wt(b / f, t.height)), { width: b, height: E };
1830
+ }, S = (u) => u.width === t.width && u.height === t.height ? null : u, y = (u, R) => {
1831
+ const d = R.replace(/[^\d]/g, ""), E = I(u, d);
1832
+ c(
1833
+ (b) => E ? {
1834
+ w: u === "w" ? d : String(E.width),
1835
+ h: u === "h" ? d : String(E.height)
1836
+ } : { ...b, [u]: d }
1837
+ ), E && o(S(E));
1838
+ }, x = () => {
1839
+ const u = Number(_.w), R = Number(_.h);
1840
+ let d = s;
1841
+ u > 0 && R > 0 && (d = n ? I("w", _.w) ?? s : { width: wt(u, t.width), height: wt(R, t.height) }), c({ w: String(d.width), h: String(d.height) }), r(S(d));
1842
+ }, l = (u, R) => {
1843
+ if (u.key === "Enter") {
1844
+ u.preventDefault(), x();
1845
+ return;
1846
+ }
1847
+ if (u.key !== "ArrowUp" && u.key !== "ArrowDown") return;
1848
+ u.preventDefault();
1849
+ const d = (u.shiftKey ? 10 : 1) * (u.key === "ArrowUp" ? 1 : -1), E = R === "w" ? s.width : s.height, b = I(R, String(E + d));
1850
+ b && (c({ w: String(b.width), h: String(b.height) }), r(S(b)));
1851
+ }, A = (u) => s.width === Math.max(1, Math.round(t.width * u)) && s.height === Math.max(1, Math.round(t.height * u));
1852
+ return /* @__PURE__ */ X("div", { className: w.resizePanel, "data-part": "resize", children: [
1853
+ /* @__PURE__ */ X("div", { className: w.resizeFields, children: [
1854
+ /* @__PURE__ */ X("label", { className: w.dimField, children: [
1855
+ /* @__PURE__ */ X("span", { className: w.dimLabel, children: [
1856
+ /* @__PURE__ */ v("span", { className: w.dimLabelFull, children: a("imageEditor.width") }),
1857
+ /* @__PURE__ */ v("span", { className: w.dimLabelShort, "aria-hidden": "true", children: a("imageEditor.width").charAt(0) })
1858
+ ] }),
1859
+ /* @__PURE__ */ v(
1860
+ "input",
1861
+ {
1862
+ className: w.dimInput,
1863
+ inputMode: "numeric",
1864
+ value: _.w,
1865
+ "aria-label": a("imageEditor.width"),
1866
+ onChange: (u) => y("w", u.target.value),
1867
+ onBlur: () => {
1868
+ x(), k.current = null;
1869
+ },
1870
+ onKeyDown: (u) => l(u, "w"),
1871
+ onFocus: (u) => {
1872
+ k.current = m, u.target.select();
1873
+ }
1874
+ }
1875
+ ),
1876
+ /* @__PURE__ */ v("span", { className: w.dimUnit, children: "px" })
1877
+ ] }),
1878
+ /* @__PURE__ */ v(
1879
+ "button",
1880
+ {
1881
+ type: "button",
1882
+ className: W(w.lockButton, n && w.lockActive),
1883
+ "aria-pressed": n,
1884
+ "aria-label": a("imageEditor.lockRatio"),
1885
+ title: a("imageEditor.lockRatio"),
1886
+ onClick: () => i(!n),
1887
+ children: /* @__PURE__ */ v(et, { name: n ? "Unlock" : "LockSlash", size: "sm" })
1888
+ }
1889
+ ),
1890
+ /* @__PURE__ */ X("label", { className: w.dimField, children: [
1891
+ /* @__PURE__ */ X("span", { className: w.dimLabel, children: [
1892
+ /* @__PURE__ */ v("span", { className: w.dimLabelFull, children: a("imageEditor.height") }),
1893
+ /* @__PURE__ */ v("span", { className: w.dimLabelShort, "aria-hidden": "true", children: a("imageEditor.height").charAt(0) })
1894
+ ] }),
1895
+ /* @__PURE__ */ v(
1896
+ "input",
1897
+ {
1898
+ className: w.dimInput,
1899
+ inputMode: "numeric",
1900
+ value: _.h,
1901
+ "aria-label": a("imageEditor.height"),
1902
+ onChange: (u) => y("h", u.target.value),
1903
+ onBlur: () => {
1904
+ x(), k.current = null;
1905
+ },
1906
+ onKeyDown: (u) => l(u, "h"),
1907
+ onFocus: (u) => {
1908
+ k.current = m, u.target.select();
1909
+ }
1910
+ }
1911
+ ),
1912
+ /* @__PURE__ */ v("span", { className: w.dimUnit, children: "px" })
1913
+ ] })
1914
+ ] }),
1915
+ /* @__PURE__ */ v(
1916
+ "div",
1917
+ {
1918
+ className: w.tabs,
1919
+ role: "group",
1920
+ "aria-label": a("imageEditor.resize"),
1921
+ "data-part": "tabs",
1922
+ children: ji.map((u) => /* @__PURE__ */ v(
1923
+ "button",
1924
+ {
1925
+ type: "button",
1926
+ "aria-pressed": A(u),
1927
+ className: W(w.tab, A(u) && w.tabActive),
1928
+ onClick: () => r(
1929
+ S({
1930
+ width: Math.max(1, Math.round(t.width * u)),
1931
+ height: Math.max(1, Math.round(t.height * u))
1932
+ })
1933
+ ),
1934
+ children: u === 1 ? a("imageEditor.original") : `${Math.round(u * 100)}%`
1935
+ },
1936
+ u
1937
+ ))
1938
+ }
1939
+ )
1940
+ ] });
1941
+ }
1942
+ const Ki = "_ruler_j6c34_4", Hi = "_viewport_j6c34_21", Qi = "_value_j6c34_26", Zi = "_track_j6c34_50", Ji = "_tick_j6c34_57", to = "_major_j6c34_66", eo = "_origin_j6c34_73", no = "_indicator_j6c34_78", vt = {
1943
+ ruler: Ki,
1944
+ viewport: Hi,
1945
+ value: Qi,
1946
+ track: Zi,
1947
+ tick: Ji,
1948
+ major: to,
1949
+ origin: eo,
1950
+ indicator: no
1951
+ }, be = 9;
1952
+ function ee({
1953
+ min: t,
1954
+ max: e,
1955
+ value: n,
1956
+ step: i = 1,
1957
+ keyStep: o = 1,
1958
+ snapPoints: r = [0],
1959
+ snapThreshold: a = (e - t) * 0.02,
1960
+ tickStep: s = (e - t) / 20,
1961
+ majorEvery: _ = 5,
1962
+ resetValue: c = 0,
1963
+ format: M = (S) => String(Math.round(S)),
1964
+ onInput: m,
1965
+ onChange: k,
1966
+ "aria-label": f,
1967
+ className: I
1968
+ }) {
1969
+ const S = be / s, y = F(null), x = F(0), l = F(void 0), A = F(n);
1970
+ A.current = n;
1971
+ const u = F(!1), R = F(k);
1972
+ R.current = k;
1973
+ const d = (L) => {
1974
+ u.current = !1, k(L);
1975
+ };
1976
+ j(
1977
+ () => () => {
1978
+ cancelAnimationFrame(x.current), clearTimeout(l.current), u.current && (u.current = !1, R.current(A.current));
1979
+ },
1980
+ []
1981
+ );
1982
+ const E = (L, q = !0) => {
1983
+ let C = Math.min(e, Math.max(t, L));
1984
+ if (C = Math.round(C / i) * i, q) {
1985
+ for (const V of r)
1986
+ if (Math.abs(C - V) <= a) {
1987
+ C = V;
1988
+ break;
1989
+ }
1990
+ }
1991
+ return Number(C.toFixed(6));
1992
+ }, b = (L) => {
1993
+ L !== A.current && (A.current = L, u.current = !0, m(L));
1994
+ }, N = (L) => {
1995
+ L.button === 0 && (cancelAnimationFrame(x.current), L.currentTarget.setPointerCapture(L.pointerId), y.current = {
1996
+ id: L.pointerId,
1997
+ startX: L.clientX,
1998
+ startValue: n,
1999
+ lastX: L.clientX,
2000
+ lastT: performance.now(),
2001
+ velocity: 0,
2002
+ moved: !1
2003
+ });
2004
+ }, $ = (L) => {
2005
+ const q = y.current;
2006
+ if (!q || q.id !== L.pointerId) return;
2007
+ const C = performance.now(), V = Math.max(1, C - q.lastT);
2008
+ q.velocity = 0.7 * (-(L.clientX - q.lastX) / S / V) + 0.3 * q.velocity, q.lastX = L.clientX, q.lastT = C, Math.abs(L.clientX - q.startX) > 2 && (q.moved = !0), b(E(q.startValue - (L.clientX - q.startX) / S));
2009
+ }, G = (L) => {
2010
+ const q = y.current;
2011
+ if (!q || q.id !== L.pointerId) return;
2012
+ y.current = null;
2013
+ let C = A.current;
2014
+ const V = (e - t) / 1500;
2015
+ let H = performance.now() - q.lastT < 80 ? Math.max(-V, Math.min(V, q.velocity)) : 0;
2016
+ if (!q.moved || Math.abs(H) < V / 20) return d(E(C));
2017
+ let mt = performance.now();
2018
+ const lt = (xt) => {
2019
+ const J = Math.min(32, Math.max(0, xt - mt));
2020
+ mt = xt, C += H * J, H *= Math.pow(0.99, J);
2021
+ const rt = E(C, Math.abs(H) < V / 6);
2022
+ if (b(rt), Math.abs(H) < V / 40 || rt <= t || rt >= e) return d(rt);
2023
+ x.current = requestAnimationFrame(lt);
2024
+ };
2025
+ x.current = requestAnimationFrame(lt);
2026
+ }, K = (L) => {
2027
+ const q = Math.abs(L.deltaX) > Math.abs(L.deltaY) ? L.deltaX : L.deltaY;
2028
+ if (!q) return;
2029
+ const C = E(A.current + q / S / 2);
2030
+ b(C), clearTimeout(l.current), l.current = setTimeout(() => d(A.current), 220);
2031
+ }, Y = (L) => {
2032
+ const q = L.shiftKey ? 10 : 1;
2033
+ let C = null;
2034
+ const V = A.current;
2035
+ if (L.key === "ArrowRight" || L.key === "ArrowUp" ? C = V + o * q : L.key === "ArrowLeft" || L.key === "ArrowDown" ? C = V - o * q : L.key === "Home" ? C = t : L.key === "End" && (C = e), C == null) return;
2036
+ L.preventDefault();
2037
+ const H = E(C, !1);
2038
+ b(H), d(H);
2039
+ }, ct = () => {
2040
+ cancelAnimationFrame(x.current);
2041
+ const L = E(c, !1);
2042
+ b(L), d(L);
2043
+ }, Z = Math.floor((e - t) / s), dt = M(n);
2044
+ return /* @__PURE__ */ X(
2045
+ "div",
2046
+ {
2047
+ role: "slider",
2048
+ tabIndex: 0,
2049
+ "aria-label": f,
2050
+ "aria-valuemin": t,
2051
+ "aria-valuemax": e,
2052
+ "aria-valuenow": n,
2053
+ "aria-valuetext": dt,
2054
+ "aria-orientation": "horizontal",
2055
+ className: W(vt.ruler, I),
2056
+ "data-part": "ruler",
2057
+ onPointerDown: N,
2058
+ onPointerMove: $,
2059
+ onPointerUp: G,
2060
+ onPointerCancel: G,
2061
+ onWheel: K,
2062
+ onKeyDown: Y,
2063
+ onDoubleClick: ct,
2064
+ children: [
2065
+ /* @__PURE__ */ v("span", { className: vt.value, "aria-hidden": "true", children: dt }),
2066
+ /* @__PURE__ */ X("span", { className: vt.viewport, "aria-hidden": "true", children: [
2067
+ /* @__PURE__ */ v(
2068
+ "span",
2069
+ {
2070
+ className: vt.track,
2071
+ style: {
2072
+ width: Z * be,
2073
+ transform: `translateX(${-(n - t) * S}px)`
2074
+ },
2075
+ children: Array.from({ length: Z + 1 }, (L, q) => {
2076
+ const C = t + q * s;
2077
+ return /* @__PURE__ */ v(
2078
+ "span",
2079
+ {
2080
+ className: W(
2081
+ vt.tick,
2082
+ q % _ === 0 && vt.major,
2083
+ Math.abs(C - c) < 1e-9 && vt.origin
2084
+ ),
2085
+ style: { left: q * be }
2086
+ },
2087
+ q
2088
+ );
2089
+ })
2090
+ }
2091
+ ),
2092
+ /* @__PURE__ */ v("span", { className: vt.indicator })
2093
+ ] })
2094
+ ]
2095
+ }
2096
+ );
2097
+ }
2098
+ const Tt = [
2099
+ { id: "crop", icon: "Crop" },
2100
+ { id: "filter", icon: "Colorfilter" },
2101
+ { id: "finetune", icon: "Brush" },
2102
+ { id: "redact", icon: "Blur" },
2103
+ { id: "resize", icon: "Maximize3" }
2104
+ ], ro = ["blur", "pixelate"], We = [0.05, 0.1, 0.15, 0.2, 0.25, 0.33, 0.5, 0.67, 0.75, 1, 1.5, 2, 3, 4, 6, 8], io = 'a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), input:not(:disabled):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])', xe = Math.PI / 180, wo = Ke(function({
2105
+ open: e,
2106
+ src: n,
2107
+ initialState: i,
2108
+ util: o = "crop",
2109
+ cropAspectRatio: r,
2110
+ cropRatioOptions: a,
2111
+ outputType: s,
2112
+ outputQuality: _,
2113
+ onLoad: c,
2114
+ onUpdate: M,
2115
+ onProcess: m,
2116
+ onClose: k,
2117
+ className: f,
2118
+ onKeyDown: I,
2119
+ ...S
2120
+ }, y) {
2121
+ const x = oe(), [l] = Q(() => new dn()), A = pn(l.subscribe, l.getSnapshot, l.getSnapshot), { state: u, size: R, ui: d, status: E } = A, b = F(null), N = F(null), $ = F(null), [G, K] = Q(null), [Y, ct] = Q(1), [Z, dt] = Q(!1), [L, q] = Q(!1), C = F(0), V = F(null), H = F(null), mt = F(null);
2122
+ d.util !== "resize" || !u ? H.current = null : (!H.current || u !== mt.current && u !== H.current) && (H.current = u);
2123
+ const lt = F({ onLoad: c, onUpdate: M });
2124
+ lt.current = { onLoad: c, onUpdate: M }, j(() => {
2125
+ const h = [
2126
+ l.on(
2127
+ "load",
2128
+ (T) => {
2129
+ var D, O;
2130
+ return (O = (D = lt.current).onLoad) == null ? void 0 : O.call(D, T.size);
2131
+ }
2132
+ ),
2133
+ l.on("update", (T) => {
2134
+ var D, O;
2135
+ return (O = (D = lt.current).onUpdate) == null ? void 0 : O.call(D, T);
2136
+ }),
2137
+ // a rotation drag's base is stale once history moves under it
2138
+ ...["undo", "redo", "revert"].map(
2139
+ (T) => l.on(T, () => {
2140
+ V.current = null;
2141
+ })
2142
+ )
2143
+ ];
2144
+ return () => h.forEach((T) => T());
2145
+ }, [l]), j(() => {
2146
+ if (!(!e || !n))
2147
+ return K(null), q(!1), l.open({ src: n, initialState: i, util: o, cropAspectRatio: r, outputType: s, outputQuality: _ }).then(() => {
2148
+ const h = l.getSnapshot().state;
2149
+ h && (C.current = _e(h.rotation).quarter);
2150
+ }).catch(() => {
2151
+ }), () => l.close();
2152
+ }, [e, n, l]), j(() => {
2153
+ if (!e) return;
2154
+ const h = (O) => {
2155
+ (O.ctrlKey || O.metaKey) && O.preventDefault();
2156
+ }, T = (O) => O.preventDefault(), D = ["gesturestart", "gesturechange", "gestureend"];
2157
+ return window.addEventListener("wheel", h, { passive: !1 }), D.forEach((O) => document.addEventListener(O, T)), () => {
2158
+ window.removeEventListener("wheel", h), D.forEach((O) => document.removeEventListener(O, T));
2159
+ };
2160
+ }, [e]), j(() => {
2161
+ if (!e) return;
2162
+ const h = document.activeElement, T = requestAnimationFrame(() => {
2163
+ var D;
2164
+ return (D = N.current) == null ? void 0 : D.focus();
2165
+ });
2166
+ return () => {
2167
+ var D;
2168
+ cancelAnimationFrame(T), (D = h == null ? void 0 : h.focus) == null || D.call(h);
2169
+ };
2170
+ }, [e]);
2171
+ const xt = (h) => {
2172
+ N.current = h, typeof y == "function" ? y(h) : y && (y.current = h);
2173
+ }, J = () => {
2174
+ const h = l.getSnapshot().state;
2175
+ h && (C.current = _e(h.rotation).quarter);
2176
+ }, rt = () => {
2177
+ var h;
2178
+ (h = b.current) == null || h.transition("jump"), l.undo(), J();
2179
+ }, tt = () => {
2180
+ var h;
2181
+ (h = b.current) == null || h.transition("jump"), l.redo(), J();
2182
+ }, Ht = () => {
2183
+ var h;
2184
+ (h = b.current) == null || h.transition("jump"), l.revert(), J();
2185
+ }, It = () => {
2186
+ var h;
2187
+ !u || !R || ((h = b.current) == null || h.transition("rotate"), C.current = ke(C.current - Math.PI / 2), l.setState(Ln(u, R)));
2188
+ }, Mt = () => {
2189
+ var h;
2190
+ !u || !R || ((h = b.current) == null || h.transition("flip"), C.current = ke(-C.current), l.setState(Nn(u, R)));
2191
+ }, Pt = gn(() => k(), [k]), ft = () => {
2192
+ Z || Pt();
2193
+ }, he = async () => {
2194
+ if (!(!u || Z)) {
2195
+ dt(!0), q(!1);
2196
+ try {
2197
+ const h = await l.process();
2198
+ m == null || m(h), Pt();
2199
+ } catch {
2200
+ q(!0);
2201
+ } finally {
2202
+ dt(!1);
2203
+ }
2204
+ }
2205
+ }, Qt = (h) => {
2206
+ if (I == null || I(h), h.defaultPrevented) return;
2207
+ const T = h.metaKey || h.ctrlKey;
2208
+ if (T && h.key.toLowerCase() === "z") {
2209
+ h.preventDefault(), h.shiftKey ? tt() : rt();
2210
+ return;
2211
+ }
2212
+ if (T && h.key.toLowerCase() === "y") {
2213
+ h.preventDefault(), tt();
2214
+ return;
2215
+ }
2216
+ if (h.key !== "Tab" || !N.current) return;
2217
+ const D = [...N.current.querySelectorAll(io)].filter(
2218
+ (g) => g.offsetParent !== null
2219
+ );
2220
+ if (D.length === 0) return;
2221
+ const O = D[0], At = D[D.length - 1];
2222
+ h.shiftKey && (document.activeElement === O || document.activeElement === N.current) ? (h.preventDefault(), At.focus()) : !h.shiftKey && document.activeElement === At && (h.preventDefault(), O.focus());
2223
+ }, pt = (h) => {
2224
+ const T = Y, D = h > 0 ? We.find((O) => O > T * 1.01) ?? Se : [...We].reverse().find((O) => O < T * 0.99) ?? Ie;
2225
+ K(D);
2226
+ }, Zt = u ? _e(u.rotation, C.current).fine / xe : 0, zt = (h) => {
2227
+ const T = H.current ?? l.getSnapshot().state;
2228
+ T && (l.preview(Sn(T, h)), mt.current = l.getSnapshot().state);
2229
+ };
2230
+ let gt = null;
2231
+ if (u && R) {
2232
+ if (d.util === "crop")
2233
+ gt = /* @__PURE__ */ X(ue, { children: [
2234
+ d.cropTab === "rotation" ? /* @__PURE__ */ v(
2235
+ ee,
2236
+ {
2237
+ "aria-label": x("imageEditor.rotation"),
2238
+ min: -45,
2239
+ max: 45,
2240
+ step: 0.1,
2241
+ tickStep: 1,
2242
+ majorEvery: 5,
2243
+ snapThreshold: 0.6,
2244
+ value: Number(Zt.toFixed(1)),
2245
+ format: (h) => `${Number(h.toFixed(1))}°`,
2246
+ onInput: (h) => {
2247
+ const T = l.getSnapshot().state;
2248
+ T && (V.current ?? (V.current = T), l.preview(Fe(V.current, C.current + h * xe, R)));
2249
+ },
2250
+ onChange: (h) => {
2251
+ const T = V.current ?? l.getSnapshot().state;
2252
+ V.current = null, T && (l.preview(Fe(T, C.current + h * xe, R)), l.commit());
2253
+ }
2254
+ },
2255
+ "rotation"
2256
+ ) : /* @__PURE__ */ v(
2257
+ ee,
2258
+ {
2259
+ "aria-label": x("imageEditor.scale"),
2260
+ min: 100,
2261
+ max: Vt * 100,
2262
+ step: 1,
2263
+ tickStep: 10,
2264
+ majorEvery: 5,
2265
+ snapPoints: [100],
2266
+ snapThreshold: 4,
2267
+ resetValue: 100,
2268
+ value: Math.round(Bt(u, R) * 100),
2269
+ format: (h) => `${Math.round(h)}%`,
2270
+ onInput: (h) => {
2271
+ const T = l.getSnapshot().state;
2272
+ T && l.preview(Gt(T, h / 100, R));
2273
+ },
2274
+ onChange: (h) => {
2275
+ const T = l.getSnapshot().state;
2276
+ T && (l.preview(Gt(T, h / 100, R)), l.commit());
2277
+ }
2278
+ },
2279
+ "scale"
2280
+ ),
2281
+ /* @__PURE__ */ v(
2282
+ Me,
2283
+ {
2284
+ label: x("imageEditor.crop"),
2285
+ value: d.cropTab,
2286
+ options: [
2287
+ { id: "rotation", label: x("imageEditor.rotation") },
2288
+ { id: "scale", label: x("imageEditor.scale") }
2289
+ ],
2290
+ onChange: (h) => l.setUi({ cropTab: h })
2291
+ }
2292
+ )
2293
+ ] });
2294
+ else if (d.util === "filter" && l.image)
2295
+ gt = /* @__PURE__ */ v(
2296
+ $i,
2297
+ {
2298
+ image: l.image.image,
2299
+ size: R,
2300
+ state: u,
2301
+ onSelect: (h) => l.setState({
2302
+ filter: h === "default" ? null : h,
2303
+ colorMatrix: Re[h]
2304
+ })
2305
+ }
2306
+ );
2307
+ else if (d.util === "resize")
2308
+ gt = /* @__PURE__ */ v(
2309
+ Wi,
2310
+ {
2311
+ max: qt(H.current ?? u),
2312
+ value: Lt(u),
2313
+ locked: d.resizeLocked,
2314
+ onLockedChange: (h) => l.setUi({ resizeLocked: h }),
2315
+ onInput: zt,
2316
+ onChange: (h) => {
2317
+ zt(h), l.commit();
2318
+ }
2319
+ }
2320
+ );
2321
+ else if (d.util === "redact") {
2322
+ const h = u.redact;
2323
+ gt = /* @__PURE__ */ X(ue, { children: [
2324
+ /* @__PURE__ */ v(
2325
+ ee,
2326
+ {
2327
+ "aria-label": x(`imageEditor.redact.${h.effect}`),
2328
+ min: 0,
2329
+ max: 100,
2330
+ step: 1,
2331
+ tickStep: 2.5,
2332
+ majorEvery: 4,
2333
+ snapThreshold: 0,
2334
+ value: h.amount,
2335
+ format: (T) => String(Math.round(T)),
2336
+ onInput: (T) => l.preview({ redact: { ...h, amount: T } }),
2337
+ onChange: (T) => {
2338
+ l.preview({ redact: { ...h, amount: T } }), l.commit();
2339
+ }
2340
+ },
2341
+ h.effect
2342
+ ),
2343
+ /* @__PURE__ */ v(
2344
+ Me,
2345
+ {
2346
+ label: x("imageEditor.redact"),
2347
+ value: h.effect,
2348
+ options: ro.map((T) => ({
2349
+ id: T,
2350
+ label: x(`imageEditor.redact.${T}`)
2351
+ })),
2352
+ onChange: (T) => l.setState({ redact: { ...h, effect: T } })
2353
+ }
2354
+ )
2355
+ ] });
2356
+ } else if (d.util === "finetune") {
2357
+ const h = d.finetuneTab;
2358
+ gt = /* @__PURE__ */ X(ue, { children: [
2359
+ /* @__PURE__ */ v(
2360
+ ee,
2361
+ {
2362
+ "aria-label": x(`imageEditor.finetune.${h}`),
2363
+ min: -100,
2364
+ max: 100,
2365
+ step: 1,
2366
+ tickStep: 5,
2367
+ majorEvery: 4,
2368
+ snapThreshold: 3,
2369
+ value: u.finetune[h],
2370
+ format: (T) => String(Math.round(T)),
2371
+ onInput: (T) => {
2372
+ const D = l.getSnapshot().state;
2373
+ D && l.preview({ finetune: { ...D.finetune, [h]: T } });
2374
+ },
2375
+ onChange: (T) => {
2376
+ const D = l.getSnapshot().state;
2377
+ D && (l.preview({ finetune: { ...D.finetune, [h]: T } }), l.commit());
2378
+ }
2379
+ },
2380
+ h
2381
+ ),
2382
+ /* @__PURE__ */ v(
2383
+ Me,
2384
+ {
2385
+ label: x("imageEditor.finetune"),
2386
+ value: h,
2387
+ options: yn.map((T) => ({
2388
+ id: T,
2389
+ label: x(`imageEditor.finetune.${T}`),
2390
+ dot: u.finetune[T] !== 0
2391
+ })),
2392
+ onChange: (T) => l.setUi({ finetuneTab: T })
2393
+ }
2394
+ )
2395
+ ] });
2396
+ }
2397
+ }
2398
+ const St = E === "ready" && !!u, Jt = St && d.util !== "crop";
2399
+ return /* @__PURE__ */ v(
2400
+ wn,
2401
+ {
2402
+ open: e,
2403
+ onClose: ft,
2404
+ closeOnBackdrop: !1,
2405
+ dim: 0,
2406
+ className: w.overlay,
2407
+ children: /* @__PURE__ */ X(
2408
+ "div",
2409
+ {
2410
+ ref: xt,
2411
+ role: "dialog",
2412
+ "aria-modal": "true",
2413
+ "aria-label": x("imageEditor.title"),
2414
+ tabIndex: -1,
2415
+ className: W(w.editor, f),
2416
+ "data-part": "editor",
2417
+ onKeyDown: Qt,
2418
+ ...S,
2419
+ children: [
2420
+ /* @__PURE__ */ v(
2421
+ Fi,
2422
+ {
2423
+ ref: b,
2424
+ core: l,
2425
+ snapshot: A,
2426
+ cropAspectRatio: r,
2427
+ viewZoom: d.util === "crop" ? null : G,
2428
+ onViewZoom: K,
2429
+ onZoomReport: ct,
2430
+ areaRef: $
2431
+ }
2432
+ ),
2433
+ /* @__PURE__ */ X("header", { className: w.header, "data-part": "header", children: [
2434
+ /* @__PURE__ */ v("div", { className: w.headerStart, children: /* @__PURE__ */ X("div", { className: w.group, children: [
2435
+ /* @__PURE__ */ v(
2436
+ kt,
2437
+ {
2438
+ variant: "text",
2439
+ color: "primary",
2440
+ size: "sm",
2441
+ "aria-label": x("imageEditor.close"),
2442
+ title: x("imageEditor.close"),
2443
+ onClick: ft,
2444
+ children: /* @__PURE__ */ v(et, { name: "Close", className: w.closeIcon })
2445
+ }
2446
+ ),
2447
+ /* @__PURE__ */ v("span", { className: w.groupDivider, "aria-hidden": "true" }),
2448
+ /* @__PURE__ */ v(
2449
+ kt,
2450
+ {
2451
+ variant: "text",
2452
+ color: "primary",
2453
+ size: "sm",
2454
+ "aria-label": x("imageEditor.revert"),
2455
+ title: x("imageEditor.revert"),
2456
+ disabled: !A.canRevert,
2457
+ onClick: Ht,
2458
+ children: /* @__PURE__ */ v(et, { name: "ReverseTimeArrow" })
2459
+ }
2460
+ )
2461
+ ] }) }),
2462
+ /* @__PURE__ */ X("div", { className: w.headerCenter, children: [
2463
+ /* @__PURE__ */ X("div", { className: w.group, children: [
2464
+ /* @__PURE__ */ v(
2465
+ kt,
2466
+ {
2467
+ variant: "text",
2468
+ color: "primary",
2469
+ size: "sm",
2470
+ "aria-label": x("imageEditor.undo"),
2471
+ title: x("imageEditor.undo"),
2472
+ disabled: !A.canUndo,
2473
+ onClick: rt,
2474
+ children: /* @__PURE__ */ v(et, { name: "UndoArrow" })
2475
+ }
2476
+ ),
2477
+ /* @__PURE__ */ v("span", { className: w.groupDivider, "aria-hidden": "true" }),
2478
+ /* @__PURE__ */ v(
2479
+ kt,
2480
+ {
2481
+ variant: "text",
2482
+ color: "primary",
2483
+ size: "sm",
2484
+ "aria-label": x("imageEditor.redo"),
2485
+ title: x("imageEditor.redo"),
2486
+ disabled: !A.canRedo,
2487
+ onClick: tt,
2488
+ children: /* @__PURE__ */ v(et, { name: "RedoArrow" })
2489
+ }
2490
+ )
2491
+ ] }),
2492
+ St && d.util === "crop" && /* @__PURE__ */ v("div", { className: W(w.group, w.fadeIn), children: /* @__PURE__ */ X(
2493
+ "span",
2494
+ {
2495
+ className: W(w.zoomLabel, w.zoomReadout),
2496
+ role: "status",
2497
+ "aria-label": x("imageEditor.zoom"),
2498
+ children: [
2499
+ Math.round(Y * 100),
2500
+ "%"
2501
+ ]
2502
+ }
2503
+ ) }),
2504
+ Jt && /* @__PURE__ */ X("div", { className: W(w.group, w.fadeIn), children: [
2505
+ /* @__PURE__ */ v(
2506
+ kt,
2507
+ {
2508
+ variant: "text",
2509
+ color: "primary",
2510
+ size: "sm",
2511
+ "aria-label": x("imageEditor.zoomOut"),
2512
+ title: x("imageEditor.zoomOut"),
2513
+ disabled: Y <= Ie * 1.01,
2514
+ onClick: () => pt(-1),
2515
+ children: /* @__PURE__ */ v(et, { name: "Minus" })
2516
+ }
2517
+ ),
2518
+ /* @__PURE__ */ v("span", { className: w.groupDivider, "aria-hidden": "true" }),
2519
+ /* @__PURE__ */ X(
2520
+ "button",
2521
+ {
2522
+ type: "button",
2523
+ className: w.zoomLabel,
2524
+ "aria-label": x("imageEditor.zoom"),
2525
+ title: x("imageEditor.zoomFit"),
2526
+ onClick: () => K(null),
2527
+ children: [
2528
+ Math.round(Y * 100),
2529
+ "%"
2530
+ ]
2531
+ }
2532
+ ),
2533
+ /* @__PURE__ */ v("span", { className: w.groupDivider, "aria-hidden": "true" }),
2534
+ /* @__PURE__ */ v(
2535
+ kt,
2536
+ {
2537
+ variant: "text",
2538
+ color: "primary",
2539
+ size: "sm",
2540
+ "aria-label": x("imageEditor.zoomIn"),
2541
+ title: x("imageEditor.zoomIn"),
2542
+ disabled: Y >= Se * 0.99,
2543
+ onClick: () => pt(1),
2544
+ children: /* @__PURE__ */ v(et, { name: "Add" })
2545
+ }
2546
+ )
2547
+ ] })
2548
+ ] }),
2549
+ /* @__PURE__ */ v("div", { className: w.headerEnd, children: /* @__PURE__ */ v(
2550
+ kt,
2551
+ {
2552
+ variant: "contained",
2553
+ color: "accent",
2554
+ size: "sm",
2555
+ loading: Z,
2556
+ disabled: !St,
2557
+ "aria-label": x("imageEditor.done"),
2558
+ title: x("imageEditor.done"),
2559
+ onClick: he,
2560
+ className: w.done,
2561
+ children: /* @__PURE__ */ v(et, { name: "CheckMarkTick" })
2562
+ }
2563
+ ) })
2564
+ ] }),
2565
+ /* @__PURE__ */ X("div", { className: w.main, "data-part": "main", children: [
2566
+ /* @__PURE__ */ v("nav", { className: w.nav, "data-part": "nav", children: /* @__PURE__ */ v(
2567
+ "div",
2568
+ {
2569
+ role: "tablist",
2570
+ "aria-label": x("imageEditor.tools"),
2571
+ "aria-orientation": "vertical",
2572
+ className: w.navList,
2573
+ onKeyDown: (h) => {
2574
+ var O;
2575
+ const T = Tt.findIndex((At) => At.id === d.util), D = h.key === "ArrowDown" || h.key === "ArrowRight" ? Tt[(T + 1) % Tt.length] : h.key === "ArrowUp" || h.key === "ArrowLeft" ? Tt[(T + Tt.length - 1) % Tt.length] : null;
2576
+ D && (h.preventDefault(), l.setUi({ util: D.id }), (O = h.currentTarget.querySelector(`[data-util="${D.id}"]`)) == null || O.focus());
2577
+ },
2578
+ children: Tt.map((h) => {
2579
+ const T = d.util === h.id;
2580
+ return /* @__PURE__ */ X(
2581
+ "button",
2582
+ {
2583
+ type: "button",
2584
+ role: "tab",
2585
+ id: `tz-ie-tab-${h.id}`,
2586
+ "aria-selected": T,
2587
+ "aria-controls": "tz-ie-panel",
2588
+ tabIndex: T ? 0 : -1,
2589
+ title: x(`imageEditor.${h.id}`),
2590
+ className: W(w.tool, T && w.toolActive),
2591
+ "data-util": h.id,
2592
+ onClick: () => l.setUi({ util: h.id }),
2593
+ children: [
2594
+ /* @__PURE__ */ v(et, { name: h.icon, size: "sm" }),
2595
+ /* @__PURE__ */ v("span", { className: w.toolLabel, children: x(`imageEditor.${h.id}`) })
2596
+ ]
2597
+ },
2598
+ h.id
2599
+ );
2600
+ })
2601
+ }
2602
+ ) }),
2603
+ /* @__PURE__ */ X(
2604
+ "section",
2605
+ {
2606
+ className: w.stage,
2607
+ id: "tz-ie-panel",
2608
+ role: "tabpanel",
2609
+ "aria-labelledby": `tz-ie-tab-${d.util}`,
2610
+ "data-part": "stage",
2611
+ "data-util": d.util,
2612
+ children: [
2613
+ /* @__PURE__ */ v("div", { className: w.toolbar, "data-part": "toolbar", children: St && d.util === "crop" && /* @__PURE__ */ X("div", { className: W(w.toolbarRow, w.fadeIn), children: [
2614
+ /* @__PURE__ */ v(
2615
+ ye,
2616
+ {
2617
+ variant: "text",
2618
+ color: "primary",
2619
+ size: "sm",
2620
+ startIcon: /* @__PURE__ */ v(et, { name: "RotateLeft" }),
2621
+ title: x("imageEditor.rotateLeft"),
2622
+ "aria-label": x("imageEditor.rotateLeft"),
2623
+ onClick: It,
2624
+ className: w.toolbarIconOnPhone,
2625
+ children: /* @__PURE__ */ v("span", { className: w.toolbarLabel, children: x("imageEditor.rotateLeft") })
2626
+ }
2627
+ ),
2628
+ /* @__PURE__ */ v(
2629
+ ye,
2630
+ {
2631
+ variant: "text",
2632
+ color: "primary",
2633
+ size: "sm",
2634
+ startIcon: /* @__PURE__ */ v(et, { name: "FlipHorizontal" }),
2635
+ title: x("imageEditor.flipHorizontal"),
2636
+ "aria-label": x("imageEditor.flipHorizontal"),
2637
+ onClick: Mt,
2638
+ className: w.toolbarIconOnPhone,
2639
+ children: /* @__PURE__ */ v("span", { className: w.toolbarLabel, children: x("imageEditor.flipHorizontal") })
2640
+ }
2641
+ ),
2642
+ !r && u && /* @__PURE__ */ v(
2643
+ Yi,
2644
+ {
2645
+ ratio: u.cropRatio,
2646
+ options: a ?? Xi,
2647
+ onChange: (h) => {
2648
+ var D;
2649
+ const T = l.getSnapshot().state;
2650
+ !T || !R || ((D = b.current) == null || D.transition("jump"), l.setState(Pn(T, h, R)));
2651
+ }
2652
+ }
2653
+ )
2654
+ ] }, "crop-toolbar") }),
2655
+ /* @__PURE__ */ X("div", { ref: $, className: w.canvasArea, "data-part": "area", children: [
2656
+ E === "loading" && /* @__PURE__ */ X("div", { className: w.status, role: "status", children: [
2657
+ /* @__PURE__ */ v(_n, { size: "lg" }),
2658
+ /* @__PURE__ */ v("span", { children: x("imageEditor.loading") })
2659
+ ] }),
2660
+ E === "error" && /* @__PURE__ */ X("div", { className: w.status, role: "alert", children: [
2661
+ /* @__PURE__ */ v(et, { name: "Gallery", size: "lg" }),
2662
+ /* @__PURE__ */ v("span", { children: x("imageEditor.loadError") })
2663
+ ] }),
2664
+ L && /* @__PURE__ */ v("div", { className: w.toastError, role: "alert", children: x("imageEditor.processError") })
2665
+ ] }),
2666
+ /* @__PURE__ */ v("div", { className: w.footer, "data-part": "footer", children: /* @__PURE__ */ v("div", { className: W(w.footerInner, w.fadeIn), children: gt }, d.util) })
2667
+ ]
2668
+ }
2669
+ )
2670
+ ] })
2671
+ ]
2672
+ }
2673
+ )
2674
+ }
2675
+ );
2676
+ });
2677
+ function Me({
2678
+ label: t,
2679
+ value: e,
2680
+ options: n,
2681
+ onChange: i
2682
+ }) {
2683
+ const o = F(null);
2684
+ return j(() => {
2685
+ var r, a, s;
2686
+ (s = (a = (r = o.current) == null ? void 0 : r.querySelector(`[data-tab="${e}"]`)) == null ? void 0 : a.scrollIntoView) == null || s.call(a, { block: "nearest", inline: "nearest", behavior: "smooth" });
2687
+ }, [e]), /* @__PURE__ */ v(
2688
+ "div",
2689
+ {
2690
+ ref: o,
2691
+ role: "tablist",
2692
+ "aria-label": t,
2693
+ className: w.tabs,
2694
+ "data-part": "tabs",
2695
+ onKeyDown: (r) => {
2696
+ var c;
2697
+ const a = n.findIndex((M) => M.id === e), s = r.key === "ArrowRight" ? 1 : r.key === "ArrowLeft" ? -1 : 0;
2698
+ if (!s) return;
2699
+ r.preventDefault();
2700
+ const _ = n[(a + s + n.length) % n.length];
2701
+ i(_.id), (c = r.currentTarget.querySelector(`[data-tab="${_.id}"]`)) == null || c.focus();
2702
+ },
2703
+ children: n.map((r) => /* @__PURE__ */ X(
2704
+ "button",
2705
+ {
2706
+ type: "button",
2707
+ role: "tab",
2708
+ "aria-selected": r.id === e,
2709
+ tabIndex: r.id === e ? 0 : -1,
2710
+ className: W(w.tab, r.id === e && w.tabActive),
2711
+ "data-tab": r.id,
2712
+ onClick: () => i(r.id),
2713
+ children: [
2714
+ r.label,
2715
+ r.dot && /* @__PURE__ */ v("span", { className: w.tabDot, "aria-hidden": "true" })
2716
+ ]
2717
+ },
2718
+ r.id
2719
+ ))
2720
+ }
2721
+ );
2722
+ }
2723
+ export {
2724
+ Re as F,
2725
+ wo as I,
2726
+ dn as a,
2727
+ _o as c
2728
+ };
2729
+ //# sourceMappingURL=ImageEditor-BwrG1fk7.js.map