reactjs-tiptap-editor 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/lib/{ActionMenuButton-LnZiD_hs.cjs → ActionMenuButton-D5CqiauP.cjs} +1 -1
  2. package/lib/{ActionMenuButton-X9t23Kr1.js → ActionMenuButton-DJQVpcjj.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +8 -8
  5. package/lib/Attachment.d.ts +8 -8
  6. package/lib/Attachment.js +1 -1
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +8 -8
  9. package/lib/Blockquote.d.ts +8 -8
  10. package/lib/Blockquote.js +1 -1
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +8 -8
  13. package/lib/Bold.d.ts +8 -8
  14. package/lib/Bold.js +1 -1
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +8 -8
  17. package/lib/BulletList.d.ts +8 -8
  18. package/lib/BulletList.js +1 -1
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +8 -8
  21. package/lib/Clear.d.ts +8 -8
  22. package/lib/Clear.js +1 -1
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +8 -8
  25. package/lib/Code.d.ts +8 -8
  26. package/lib/Code.js +1 -1
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +8 -8
  29. package/lib/CodeBlock.d.ts +8 -8
  30. package/lib/CodeBlock.js +1 -1
  31. package/lib/Color.cjs +1 -1
  32. package/lib/Color.d.cts +8 -8
  33. package/lib/Color.d.ts +8 -8
  34. package/lib/Color.js +1 -1
  35. package/lib/Document.d.cts +8 -8
  36. package/lib/Document.d.ts +8 -8
  37. package/lib/{Drawer-CqizRDVf.js → Drawer-82lBASmO.js} +1 -1
  38. package/lib/{Drawer-BbWFl6BS.cjs → Drawer-DLV1rOAE.cjs} +1 -1
  39. package/lib/Drawer.cjs +1 -1
  40. package/lib/Drawer.d.cts +8 -8
  41. package/lib/Drawer.d.ts +8 -8
  42. package/lib/Drawer.js +2 -2
  43. package/lib/Emoji.cjs +1 -1
  44. package/lib/Emoji.d.cts +8 -8
  45. package/lib/Emoji.d.ts +8 -8
  46. package/lib/Emoji.js +1 -1
  47. package/lib/{Excalidraw-7uXZDsmD.cjs → Excalidraw-BuGGHrVK.cjs} +1 -1
  48. package/lib/{Excalidraw-XwpYLfpI.js → Excalidraw-CsD-4eCA.js} +1 -1
  49. package/lib/Excalidraw.cjs +1 -1
  50. package/lib/Excalidraw.d.cts +8 -8
  51. package/lib/Excalidraw.d.ts +8 -8
  52. package/lib/Excalidraw.js +1 -1
  53. package/lib/ExportPdf.cjs +1 -1
  54. package/lib/ExportPdf.d.cts +8 -8
  55. package/lib/ExportPdf.d.ts +8 -8
  56. package/lib/ExportPdf.js +1 -1
  57. package/lib/ExportWord.cjs +1 -1
  58. package/lib/ExportWord.d.cts +8 -8
  59. package/lib/ExportWord.d.ts +8 -8
  60. package/lib/ExportWord.js +1 -1
  61. package/lib/FontFamily.cjs +1 -1
  62. package/lib/FontFamily.d.cts +8 -8
  63. package/lib/FontFamily.d.ts +8 -8
  64. package/lib/FontFamily.js +2 -2
  65. package/lib/FontSize.cjs +1 -1
  66. package/lib/FontSize.d.cts +8 -8
  67. package/lib/FontSize.d.ts +8 -8
  68. package/lib/FontSize.js +2 -2
  69. package/lib/FormatPainter.cjs +1 -1
  70. package/lib/FormatPainter.d.cts +8 -8
  71. package/lib/FormatPainter.d.ts +8 -8
  72. package/lib/FormatPainter.js +1 -1
  73. package/lib/Heading.cjs +1 -1
  74. package/lib/Heading.d.cts +8 -8
  75. package/lib/Heading.d.ts +8 -8
  76. package/lib/Heading.js +2 -2
  77. package/lib/Highlight.cjs +1 -1
  78. package/lib/Highlight.d.cts +8 -8
  79. package/lib/Highlight.d.ts +8 -8
  80. package/lib/Highlight.js +1 -1
  81. package/lib/History.cjs +1 -1
  82. package/lib/History.d.cts +8 -8
  83. package/lib/History.d.ts +8 -8
  84. package/lib/History.js +1 -1
  85. package/lib/HorizontalRule.cjs +1 -1
  86. package/lib/HorizontalRule.d.cts +8 -8
  87. package/lib/HorizontalRule.d.ts +8 -8
  88. package/lib/HorizontalRule.js +1 -1
  89. package/lib/Iframe.cjs +1 -1
  90. package/lib/Iframe.d.cts +8 -8
  91. package/lib/Iframe.d.ts +8 -8
  92. package/lib/Iframe.js +1 -1
  93. package/lib/Image.cjs +1 -1
  94. package/lib/Image.d.cts +8 -8
  95. package/lib/Image.d.ts +8 -8
  96. package/lib/Image.js +1 -1
  97. package/lib/ImageGif.cjs +1 -1
  98. package/lib/ImageGif.d.cts +8 -8
  99. package/lib/ImageGif.d.ts +8 -8
  100. package/lib/ImageGif.js +1 -1
  101. package/lib/ImportWord.cjs +1 -1
  102. package/lib/ImportWord.d.cts +8 -8
  103. package/lib/ImportWord.d.ts +8 -8
  104. package/lib/ImportWord.js +1 -1
  105. package/lib/Indent.cjs +1 -1
  106. package/lib/Indent.d.cts +8 -8
  107. package/lib/Indent.d.ts +8 -8
  108. package/lib/Indent.js +1 -1
  109. package/lib/Italic.cjs +1 -1
  110. package/lib/Italic.d.cts +8 -8
  111. package/lib/Italic.d.ts +8 -8
  112. package/lib/Italic.js +1 -1
  113. package/lib/Katex.cjs +1 -1
  114. package/lib/Katex.d.cts +8 -8
  115. package/lib/Katex.d.ts +8 -8
  116. package/lib/Katex.js +2 -2
  117. package/lib/LineHeight.cjs +1 -1
  118. package/lib/LineHeight.d.cts +8 -8
  119. package/lib/LineHeight.d.ts +8 -8
  120. package/lib/LineHeight.js +1 -1
  121. package/lib/Link.cjs +1 -1
  122. package/lib/Link.d.cts +8 -8
  123. package/lib/Link.d.ts +8 -8
  124. package/lib/Link.js +1 -1
  125. package/lib/ListItem.d.cts +8 -8
  126. package/lib/ListItem.d.ts +8 -8
  127. package/lib/Mention.d.cts +8 -8
  128. package/lib/Mention.d.ts +8 -8
  129. package/lib/Mermaid.cjs +1 -1
  130. package/lib/Mermaid.d.cts +8 -8
  131. package/lib/Mermaid.d.ts +8 -8
  132. package/lib/Mermaid.js +2 -2
  133. package/lib/MoreMark.cjs +1 -1
  134. package/lib/MoreMark.d.cts +8 -8
  135. package/lib/MoreMark.d.ts +8 -8
  136. package/lib/MoreMark.js +1 -1
  137. package/lib/MultiColumn.cjs +1 -1
  138. package/lib/MultiColumn.d.cts +8 -8
  139. package/lib/MultiColumn.d.ts +8 -8
  140. package/lib/MultiColumn.js +1 -1
  141. package/lib/OrderedList.cjs +1 -1
  142. package/lib/OrderedList.d.cts +8 -8
  143. package/lib/OrderedList.d.ts +8 -8
  144. package/lib/OrderedList.js +1 -1
  145. package/lib/{RichTextEditor-BhzFkRcp.js → RichTextEditor-BwuyWeH3.js} +437 -425
  146. package/lib/{RichTextEditor-BulGh0GP.cjs → RichTextEditor-NfX6yV6A.cjs} +4 -4
  147. package/lib/SearchAndReplace.cjs +1 -1
  148. package/lib/SearchAndReplace.d.cts +8 -8
  149. package/lib/SearchAndReplace.d.ts +8 -8
  150. package/lib/SearchAndReplace.js +1 -1
  151. package/lib/Selection.d.cts +8 -8
  152. package/lib/Selection.d.ts +8 -8
  153. package/lib/SlashCommand.cjs +1 -1
  154. package/lib/SlashCommand.d.cts +8 -8
  155. package/lib/SlashCommand.d.ts +8 -8
  156. package/lib/SlashCommand.js +1 -1
  157. package/lib/Strike.cjs +1 -1
  158. package/lib/Strike.d.cts +8 -8
  159. package/lib/Strike.d.ts +8 -8
  160. package/lib/Strike.js +1 -1
  161. package/lib/SubAndSuperScript.cjs +1 -1
  162. package/lib/SubAndSuperScript.d.cts +8 -8
  163. package/lib/SubAndSuperScript.d.ts +8 -8
  164. package/lib/SubAndSuperScript.js +1 -1
  165. package/lib/Table.cjs +1 -1
  166. package/lib/Table.d.cts +8 -8
  167. package/lib/Table.d.ts +8 -8
  168. package/lib/Table.js +1 -1
  169. package/lib/TableOfContent.cjs +1 -1
  170. package/lib/TableOfContent.d.cts +8 -8
  171. package/lib/TableOfContent.d.ts +8 -8
  172. package/lib/TableOfContent.js +1 -1
  173. package/lib/TaskList.cjs +1 -1
  174. package/lib/TaskList.d.cts +8 -8
  175. package/lib/TaskList.d.ts +8 -8
  176. package/lib/TaskList.js +1 -1
  177. package/lib/TextAlign.cjs +1 -1
  178. package/lib/TextAlign.d.cts +8 -8
  179. package/lib/TextAlign.d.ts +8 -8
  180. package/lib/TextAlign.js +1 -1
  181. package/lib/TextBubble.cjs +1 -1
  182. package/lib/TextBubble.d.cts +8 -8
  183. package/lib/TextBubble.d.ts +8 -8
  184. package/lib/TextBubble.js +1 -1
  185. package/lib/TextDirection.cjs +1 -1
  186. package/lib/TextDirection.d.cts +8 -8
  187. package/lib/TextDirection.d.ts +8 -8
  188. package/lib/TextDirection.js +1 -1
  189. package/lib/TextUnderline.cjs +1 -1
  190. package/lib/TextUnderline.d.cts +8 -8
  191. package/lib/TextUnderline.d.ts +8 -8
  192. package/lib/TextUnderline.js +1 -1
  193. package/lib/TrailingNode.d.cts +8 -8
  194. package/lib/TrailingNode.d.ts +8 -8
  195. package/lib/{Twitter-CzT2PGy6.js → Twitter-Bstfoi9X.js} +1 -1
  196. package/lib/{Twitter-R32iSHHD.cjs → Twitter-D41ISCsH.cjs} +1 -1
  197. package/lib/Twitter.cjs +1 -1
  198. package/lib/Twitter.d.cts +8 -8
  199. package/lib/Twitter.d.ts +8 -8
  200. package/lib/Twitter.js +1 -1
  201. package/lib/Video.cjs +1 -1
  202. package/lib/Video.d.cts +15 -8
  203. package/lib/Video.d.ts +15 -8
  204. package/lib/Video.js +1 -1
  205. package/lib/bubble-extra.cjs +1 -1
  206. package/lib/bubble-extra.d.cts +8 -8
  207. package/lib/bubble-extra.d.ts +8 -8
  208. package/lib/bubble-extra.js +5 -5
  209. package/lib/index.cjs +1 -1
  210. package/lib/index.d.cts +8 -8
  211. package/lib/index.d.ts +8 -8
  212. package/lib/index.js +2 -2
  213. package/lib/locale-bundle.d.cts +8 -8
  214. package/lib/locale-bundle.d.ts +8 -8
  215. package/lib/{textarea-BIWEJWC6.js → textarea-CfH4-Iyy.js} +1 -1
  216. package/lib/{textarea-BMlBzzR0.cjs → textarea-ZGJkH6ji.cjs} +1 -1
  217. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- "use strict";var vu=Object.defineProperty;var yu=(e,t,r)=>t in e?vu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var rr=(e,t,r)=>yu(e,typeof t!="symbol"?t+"":t,r);const a=require("react/jsx-runtime"),b=require("react"),le=require("./dom-dataset-CAXnsjYE.cjs"),gc=require("@radix-ui/react-slot"),B=require("./index-LbrE7K9i.cjs"),bu=require("@radix-ui/react-separator"),wu=require("@radix-ui/react-toast"),O=require("lucide-react"),Su=require("@radix-ui/react-tooltip"),ju=require("@radix-ui/react-toggle"),nr=require("@radix-ui/react-icons"),Au=require("@radix-ui/react-popover"),Cu=require("@radix-ui/react-label"),Iu=require("@radix-ui/react-dialog"),H=require("./index-COecBbaE.cjs"),Tu=require("re-resizable"),Pu=require("react-image-crop"),Ou=require("@radix-ui/react-tabs"),Ru=require("@radix-ui/react-checkbox"),xc=require("tippy.js"),Eu=require("react-colorful"),Mu=require("@radix-ui/react-switch"),Nu=require("@radix-ui/react-dropdown-menu");function Ie(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ee=Ie(b),vc=Ie(bu),Ae=Ie(wu),Gt=Ie(Su),yc=Ie(ju),kt=Ie(Au),bc=Ie(Cu),Ce=Ie(Iu),ct=Ie(Ou),Mi=Ie(Ru),Ni=Ie(Mu),ce=Ie(Nu);var wc=typeof global=="object"&&global&&global.Object===Object&&global,_u=typeof self=="object"&&self&&self.Object===Object&&self,ke=wc||_u||Function("return this")(),_e=ke.Symbol,Sc=Object.prototype,$u=Sc.hasOwnProperty,ku=Sc.toString,Rt=_e?_e.toStringTag:void 0;function Lu(e){var t=$u.call(e,Rt),r=e[Rt];try{e[Rt]=void 0;var n=!0}catch{}var i=ku.call(e);return n&&(t?e[Rt]=r:delete e[Rt]),i}var Du=Object.prototype,Bu=Du.toString;function qu(e){return Bu.call(e)}var zu="[object Null]",Fu="[object Undefined]",Fo=_e?_e.toStringTag:void 0;function it(e){return e==null?e===void 0?Fu:zu:Fo&&Fo in Object(e)?Lu(e):qu(e)}function Ue(e){return e!=null&&typeof e=="object"}var Hu="[object Symbol]";function xr(e){return typeof e=="symbol"||Ue(e)&&it(e)==Hu}function jc(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var $e=Array.isArray,Ho=_e?_e.prototype:void 0,Uo=Ho?Ho.toString:void 0;function hr(e){if(typeof e=="string")return e;if($e(e))return jc(e,hr)+"";if(xr(e))return Uo?Uo.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Uu=/\s/;function Gu(e){for(var t=e.length;t--&&Uu.test(e.charAt(t)););return t}var Wu=/^\s+/;function Vu(e){return e&&e.slice(0,Gu(e)+1).replace(Wu,"")}function rt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Go=NaN,Xu=/^[-+]0x[0-9a-f]+$/i,Yu=/^0b[01]+$/i,Ku=/^0o[0-7]+$/i,Zu=parseInt;function xt(e){if(typeof e=="number")return e;if(xr(e))return Go;if(rt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=rt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Vu(e);var r=Yu.test(e);return r||Ku.test(e)?Zu(e.slice(2),r?2:8):Xu.test(e)?Go:+e}var Ju=1/0,Qu=17976931348623157e292;function ed(e){if(!e)return e===0?e:0;if(e=xt(e),e===Ju||e===-1/0){var t=e<0?-1:1;return t*Qu}return e===e?e:0}function td(e){var t=ed(e),r=t%1;return t===t?r?t-r:t:0}function Yi(e){return e}var rd="[object AsyncFunction]",nd="[object Function]",id="[object GeneratorFunction]",od="[object Proxy]";function Ac(e){if(!rt(e))return!1;var t=it(e);return t==nd||t==id||t==rd||t==od}var Dr=ke["__core-js_shared__"],Wo=function(){var e=/[^.]+$/.exec(Dr&&Dr.keys&&Dr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ad(e){return!!Wo&&Wo in e}var sd=Function.prototype,cd=sd.toString;function lt(e){if(e!=null){try{return cd.call(e)}catch{}try{return e+""}catch{}}return""}var ld=/[\\^$.*+?()[\]{}|]/g,ud=/^\[object .+?Constructor\]$/,dd=Function.prototype,fd=Object.prototype,hd=dd.toString,pd=fd.hasOwnProperty,md=RegExp("^"+hd.call(pd).replace(ld,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gd(e){if(!rt(e)||ad(e))return!1;var t=Ac(e)?md:ud;return t.test(lt(e))}function xd(e,t){return e==null?void 0:e[t]}function ut(e,t){var r=xd(e,t);return gd(r)?r:void 0}var _i=ut(ke,"WeakMap");function vd(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var yd=800,bd=16,wd=Date.now;function Sd(e){var t=0,r=0;return function(){var n=wd(),i=bd-(n-r);if(r=n,i>0){if(++t>=yd)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function jd(e){return function(){return e}}var Vo=function(){try{var e=ut(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ad=Vo?function(e,t){return Vo(e,"toString",{configurable:!0,enumerable:!1,value:jd(t),writable:!0})}:Yi,Cd=Sd(Ad);function Id(e,t,r,n){for(var i=e.length,o=r+-1;++o<i;)if(t(e[o],o,e))return o;return-1}function Td(e){return e!==e}function Pd(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function Od(e,t,r){return t===t?Pd(e,t,r):Id(e,Td,r)}function Rd(e,t){var r=e==null?0:e.length;return!!r&&Od(e,t,0)>-1}var Ed=9007199254740991,Md=/^(?:0|[1-9]\d*)$/;function Cc(e,t){var r=typeof e;return t=t??Ed,!!t&&(r=="number"||r!="symbol"&&Md.test(e))&&e>-1&&e%1==0&&e<t}function Ic(e,t){return e===t||e!==e&&t!==t}var Xo=Math.max;function Nd(e,t,r){return t=Xo(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=Xo(n.length-t,0),s=Array(o);++i<o;)s[i]=n[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=n[i];return c[t]=r(s),vd(e,this,c)}}function _d(e,t){return Cd(Nd(e,t,Yi),e+"")}var $d=9007199254740991;function Ki(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$d}function Tc(e){return e!=null&&Ki(e.length)&&!Ac(e)}var kd=Object.prototype;function Ld(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||kd;return e===r}function Dd(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Bd="[object Arguments]";function Yo(e){return Ue(e)&&it(e)==Bd}var Pc=Object.prototype,qd=Pc.hasOwnProperty,zd=Pc.propertyIsEnumerable,Zi=Yo(function(){return arguments}())?Yo:function(e){return Ue(e)&&qd.call(e,"callee")&&!zd.call(e,"callee")};function Fd(){return!1}var Oc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ko=Oc&&typeof module=="object"&&module&&!module.nodeType&&module,Hd=Ko&&Ko.exports===Oc,Zo=Hd?ke.Buffer:void 0,Ud=Zo?Zo.isBuffer:void 0,$i=Ud||Fd,Gd="[object Arguments]",Wd="[object Array]",Vd="[object Boolean]",Xd="[object Date]",Yd="[object Error]",Kd="[object Function]",Zd="[object Map]",Jd="[object Number]",Qd="[object Object]",ef="[object RegExp]",tf="[object Set]",rf="[object String]",nf="[object WeakMap]",of="[object ArrayBuffer]",af="[object DataView]",sf="[object Float32Array]",cf="[object Float64Array]",lf="[object Int8Array]",uf="[object Int16Array]",df="[object Int32Array]",ff="[object Uint8Array]",hf="[object Uint8ClampedArray]",pf="[object Uint16Array]",mf="[object Uint32Array]",se={};se[sf]=se[cf]=se[lf]=se[uf]=se[df]=se[ff]=se[hf]=se[pf]=se[mf]=!0;se[Gd]=se[Wd]=se[of]=se[Vd]=se[af]=se[Xd]=se[Yd]=se[Kd]=se[Zd]=se[Jd]=se[Qd]=se[ef]=se[tf]=se[rf]=se[nf]=!1;function gf(e){return Ue(e)&&Ki(e.length)&&!!se[it(e)]}function Ji(e){return function(t){return e(t)}}var Rc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_t=Rc&&typeof module=="object"&&module&&!module.nodeType&&module,xf=_t&&_t.exports===Rc,Br=xf&&wc.process,pr=function(){try{var e=_t&&_t.require&&_t.require("util").types;return e||Br&&Br.binding&&Br.binding("util")}catch{}}(),Jo=pr&&pr.isTypedArray,Ec=Jo?Ji(Jo):gf,vf=Object.prototype,yf=vf.hasOwnProperty;function bf(e,t){var r=$e(e),n=!r&&Zi(e),i=!r&&!n&&$i(e),o=!r&&!n&&!i&&Ec(e),s=r||n||i||o,c=s?Dd(e.length,String):[],l=c.length;for(var u in e)yf.call(e,u)&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Cc(u,l)))&&c.push(u);return c}function wf(e,t){return function(r){return e(t(r))}}var Sf=wf(Object.keys,Object),jf=Object.prototype,Af=jf.hasOwnProperty;function Cf(e){if(!Ld(e))return Sf(e);var t=[];for(var r in Object(e))Af.call(e,r)&&r!="constructor"&&t.push(r);return t}function Mc(e){return Tc(e)?bf(e):Cf(e)}var If=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tf=/^\w*$/;function Qi(e,t){if($e(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||xr(e)?!0:Tf.test(e)||!If.test(e)||t!=null&&e in Object(t)}var Lt=ut(Object,"create");function Pf(){this.__data__=Lt?Lt(null):{},this.size=0}function Of(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Rf="__lodash_hash_undefined__",Ef=Object.prototype,Mf=Ef.hasOwnProperty;function Nf(e){var t=this.__data__;if(Lt){var r=t[e];return r===Rf?void 0:r}return Mf.call(t,e)?t[e]:void 0}var _f=Object.prototype,$f=_f.hasOwnProperty;function kf(e){var t=this.__data__;return Lt?t[e]!==void 0:$f.call(t,e)}var Lf="__lodash_hash_undefined__";function Df(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Lt&&t===void 0?Lf:t,this}function st(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}st.prototype.clear=Pf;st.prototype.delete=Of;st.prototype.get=Nf;st.prototype.has=kf;st.prototype.set=Df;function Bf(){this.__data__=[],this.size=0}function vr(e,t){for(var r=e.length;r--;)if(Ic(e[r][0],t))return r;return-1}var qf=Array.prototype,zf=qf.splice;function Ff(e){var t=this.__data__,r=vr(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():zf.call(t,r,1),--this.size,!0}function Hf(e){var t=this.__data__,r=vr(t,e);return r<0?void 0:t[r][1]}function Uf(e){return vr(this.__data__,e)>-1}function Gf(e,t){var r=this.__data__,n=vr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Ge(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ge.prototype.clear=Bf;Ge.prototype.delete=Ff;Ge.prototype.get=Hf;Ge.prototype.has=Uf;Ge.prototype.set=Gf;var Dt=ut(ke,"Map");function Wf(){this.size=0,this.__data__={hash:new st,map:new(Dt||Ge),string:new st}}function Vf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function yr(e,t){var r=e.__data__;return Vf(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Xf(e){var t=yr(this,e).delete(e);return this.size-=t?1:0,t}function Yf(e){return yr(this,e).get(e)}function Kf(e){return yr(this,e).has(e)}function Zf(e,t){var r=yr(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function We(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}We.prototype.clear=Wf;We.prototype.delete=Xf;We.prototype.get=Yf;We.prototype.has=Kf;We.prototype.set=Zf;var Jf="Expected a function";function eo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Jf);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(eo.Cache||We),r}eo.Cache=We;var Qf=500;function eh(e){var t=eo(e,function(n){return r.size===Qf&&r.clear(),n}),r=t.cache;return t}var th=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rh=/\\(\\)?/g,nh=eh(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(th,function(r,n,i,o){t.push(i?o.replace(rh,"$1"):n||r)}),t});function ki(e){return e==null?"":hr(e)}function Nc(e,t){return $e(e)?e:Qi(e,t)?[e]:nh(ki(e))}function br(e){if(typeof e=="string"||xr(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function _c(e,t){t=Nc(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[br(t[r++])];return r&&r==n?e:void 0}function ih(e,t,r){var n=e==null?void 0:_c(e,t);return n===void 0?r:n}function $c(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Qo=_e?_e.isConcatSpreadable:void 0;function oh(e){return $e(e)||Zi(e)||!!(Qo&&e&&e[Qo])}function ah(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=oh),i||(i=[]);++o<s;){var c=e[o];r(c)&&$c(i,c)}return i}function sh(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}function ch(e,t,r){var n=e.length;return r=r===void 0?n:r,r>=n?e:sh(e,t,r)}var lh="\\ud800-\\udfff",uh="\\u0300-\\u036f",dh="\\ufe20-\\ufe2f",fh="\\u20d0-\\u20ff",hh=uh+dh+fh,ph="\\ufe0e\\ufe0f",mh="\\u200d",gh=RegExp("["+mh+lh+hh+ph+"]");function to(e){return gh.test(e)}function xh(e){return e.split("")}var kc="\\ud800-\\udfff",vh="\\u0300-\\u036f",yh="\\ufe20-\\ufe2f",bh="\\u20d0-\\u20ff",wh=vh+yh+bh,Sh="\\ufe0e\\ufe0f",jh="["+kc+"]",Li="["+wh+"]",Di="\\ud83c[\\udffb-\\udfff]",Ah="(?:"+Li+"|"+Di+")",Lc="[^"+kc+"]",Dc="(?:\\ud83c[\\udde6-\\uddff]){2}",Bc="[\\ud800-\\udbff][\\udc00-\\udfff]",Ch="\\u200d",qc=Ah+"?",zc="["+Sh+"]?",Ih="(?:"+Ch+"(?:"+[Lc,Dc,Bc].join("|")+")"+zc+qc+")*",Th=zc+qc+Ih,Ph="(?:"+[Lc+Li+"?",Li,Dc,Bc,jh].join("|")+")",Oh=RegExp(Di+"(?="+Di+")|"+Ph+Th,"g");function Rh(e){return e.match(Oh)||[]}function Eh(e){return to(e)?Rh(e):xh(e)}function Mh(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}function Fc(e,t,r){return r===void 0&&(r=t,t=void 0),r!==void 0&&(r=xt(r),r=r===r?r:0),t!==void 0&&(t=xt(t),t=t===t?t:0),Mh(xt(e),t,r)}function Nh(){this.__data__=new Ge,this.size=0}function _h(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function $h(e){return this.__data__.get(e)}function kh(e){return this.__data__.has(e)}var Lh=200;function Dh(e,t){var r=this.__data__;if(r instanceof Ge){var n=r.__data__;if(!Dt||n.length<Lh-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new We(n)}return r.set(e,t),this.size=r.size,this}function Fe(e){var t=this.__data__=new Ge(e);this.size=t.size}Fe.prototype.clear=Nh;Fe.prototype.delete=_h;Fe.prototype.get=$h;Fe.prototype.has=kh;Fe.prototype.set=Dh;function Bh(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function qh(){return[]}var zh=Object.prototype,Fh=zh.propertyIsEnumerable,ea=Object.getOwnPropertySymbols,Hh=ea?function(e){return e==null?[]:(e=Object(e),Bh(ea(e),function(t){return Fh.call(e,t)}))}:qh;function Uh(e,t,r){var n=t(e);return $e(e)?n:$c(n,r(e))}function ta(e){return Uh(e,Mc,Hh)}var Bi=ut(ke,"DataView"),qi=ut(ke,"Promise"),zi=ut(ke,"Set"),ra="[object Map]",Gh="[object Object]",na="[object Promise]",ia="[object Set]",oa="[object WeakMap]",aa="[object DataView]",Wh=lt(Bi),Vh=lt(Dt),Xh=lt(qi),Yh=lt(zi),Kh=lt(_i),tt=it;(Bi&&tt(new Bi(new ArrayBuffer(1)))!=aa||Dt&&tt(new Dt)!=ra||qi&&tt(qi.resolve())!=na||zi&&tt(new zi)!=ia||_i&&tt(new _i)!=oa)&&(tt=function(e){var t=it(e),r=t==Gh?e.constructor:void 0,n=r?lt(r):"";if(n)switch(n){case Wh:return aa;case Vh:return ra;case Xh:return na;case Yh:return ia;case Kh:return oa}return t});var sa=ke.Uint8Array,Zh="__lodash_hash_undefined__";function Jh(e){return this.__data__.set(e,Zh),this}function Qh(e){return this.__data__.has(e)}function Bt(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new We;++t<r;)this.add(e[t])}Bt.prototype.add=Bt.prototype.push=Jh;Bt.prototype.has=Qh;function ep(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function Hc(e,t){return e.has(t)}var tp=1,rp=2;function Uc(e,t,r,n,i,o){var s=r&tp,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=o.get(e),f=o.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,p=r&rp?new Bt:void 0;for(o.set(e,t),o.set(t,e);++d<c;){var m=e[d],g=t[d];if(n)var y=s?n(g,m,d,t,e,o):n(m,g,d,e,t,o);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!ep(t,function(S,j){if(!Hc(p,j)&&(m===S||i(m,S,r,n,o)))return p.push(j)})){h=!1;break}}else if(!(m===g||i(m,g,r,n,o))){h=!1;break}}return o.delete(e),o.delete(t),h}function np(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function ip(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var op=1,ap=2,sp="[object Boolean]",cp="[object Date]",lp="[object Error]",up="[object Map]",dp="[object Number]",fp="[object RegExp]",hp="[object Set]",pp="[object String]",mp="[object Symbol]",gp="[object ArrayBuffer]",xp="[object DataView]",ca=_e?_e.prototype:void 0,qr=ca?ca.valueOf:void 0;function vp(e,t,r,n,i,o,s){switch(r){case xp:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case gp:return!(e.byteLength!=t.byteLength||!o(new sa(e),new sa(t)));case sp:case cp:case dp:return Ic(+e,+t);case lp:return e.name==t.name&&e.message==t.message;case fp:case pp:return e==t+"";case up:var c=np;case hp:var l=n&op;if(c||(c=ip),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;n|=ap,s.set(e,t);var f=Uc(c(e),c(t),n,i,o,s);return s.delete(e),f;case mp:if(qr)return qr.call(e)==qr.call(t)}return!1}var yp=1,bp=Object.prototype,wp=bp.hasOwnProperty;function Sp(e,t,r,n,i,o){var s=r&yp,c=ta(e),l=c.length,u=ta(t),f=u.length;if(l!=f&&!s)return!1;for(var d=l;d--;){var h=c[d];if(!(s?h in t:wp.call(t,h)))return!1}var p=o.get(e),m=o.get(t);if(p&&m)return p==t&&m==e;var g=!0;o.set(e,t),o.set(t,e);for(var y=s;++d<l;){h=c[d];var S=e[h],j=t[h];if(n)var w=s?n(j,S,h,t,e,o):n(S,j,h,e,t,o);if(!(w===void 0?S===j||i(S,j,r,n,o):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var A=e.constructor,R=t.constructor;A!=R&&"constructor"in e&&"constructor"in t&&!(typeof A=="function"&&A instanceof A&&typeof R=="function"&&R instanceof R)&&(g=!1)}return o.delete(e),o.delete(t),g}var jp=1,la="[object Arguments]",ua="[object Array]",ir="[object Object]",Ap=Object.prototype,da=Ap.hasOwnProperty;function Cp(e,t,r,n,i,o){var s=$e(e),c=$e(t),l=s?ua:tt(e),u=c?ua:tt(t);l=l==la?ir:l,u=u==la?ir:u;var f=l==ir,d=u==ir,h=l==u;if(h&&$i(e)){if(!$i(t))return!1;s=!0,f=!1}if(h&&!f)return o||(o=new Fe),s||Ec(e)?Uc(e,t,r,n,i,o):vp(e,t,l,r,n,i,o);if(!(r&jp)){var p=f&&da.call(e,"__wrapped__"),m=d&&da.call(t,"__wrapped__");if(p||m){var g=p?e.value():e,y=m?t.value():t;return o||(o=new Fe),i(g,y,r,n,o)}}return h?(o||(o=new Fe),Sp(e,t,r,n,i,o)):!1}function ro(e,t,r,n,i){return e===t?!0:e==null||t==null||!Ue(e)&&!Ue(t)?e!==e&&t!==t:Cp(e,t,r,n,ro,i)}var Ip=1,Tp=2;function Pp(e,t,r,n){var i=r.length,o=i;if(e==null)return!o;for(e=Object(e);i--;){var s=r[i];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=r[i];var c=s[0],l=e[c],u=s[1];if(s[2]){if(l===void 0&&!(c in e))return!1}else{var f=new Fe,d;if(!(d===void 0?ro(u,l,Ip|Tp,n,f):d))return!1}}return!0}function Gc(e){return e===e&&!rt(e)}function Op(e){for(var t=Mc(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Gc(i)]}return t}function Wc(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function Rp(e){var t=Op(e);return t.length==1&&t[0][2]?Wc(t[0][0],t[0][1]):function(r){return r===e||Pp(r,e,t)}}function Ep(e,t){return e!=null&&t in Object(e)}function Mp(e,t,r){t=Nc(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var s=br(t[n]);if(!(o=e!=null&&r(e,s)))break;e=e[s]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&Ki(i)&&Cc(s,i)&&($e(e)||Zi(e)))}function Np(e,t){return e!=null&&Mp(e,t,Ep)}var _p=1,$p=2;function kp(e,t){return Qi(e)&&Gc(t)?Wc(br(e),t):function(r){var n=ih(r,e);return n===void 0&&n===t?Np(r,e):ro(t,n,_p|$p)}}function Vc(e){return function(t){return t==null?void 0:t[e]}}function Lp(e){return function(t){return _c(t,e)}}function Dp(e){return Qi(e)?Vc(br(e)):Lp(e)}function Bp(e){return typeof e=="function"?e:e==null?Yi:typeof e=="object"?$e(e)?kp(e[0],e[1]):Rp(e):Dp(e)}var zr=function(){return ke.Date.now()},qp="Expected a function",zp=Math.max,Fp=Math.min;function Wt(e,t,r){var n,i,o,s,c,l,u=0,f=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(qp);t=xt(t)||0,rt(r)&&(f=!!r.leading,d="maxWait"in r,o=d?zp(xt(r.maxWait)||0,t):o,h="trailing"in r?!!r.trailing:h);function p(M){var N=n,T=i;return n=i=void 0,u=M,s=e.apply(T,N),s}function m(M){return u=M,c=setTimeout(S,t),f?p(M):s}function g(M){var N=M-l,T=M-u,C=t-N;return d?Fp(C,o-T):C}function y(M){var N=M-l,T=M-u;return l===void 0||N>=t||N<0||d&&T>=o}function S(){var M=zr();if(y(M))return j(M);c=setTimeout(S,g(M))}function j(M){return c=void 0,h&&n?p(M):(n=i=void 0,s)}function w(){c!==void 0&&clearTimeout(c),u=0,n=l=i=c=void 0}function A(){return c===void 0?s:j(zr())}function R(){var M=zr(),N=y(M);if(n=arguments,i=this,l=M,N){if(c===void 0)return m(l);if(d)return clearTimeout(c),c=setTimeout(S,t),p(l)}return c===void 0&&(c=setTimeout(S,t)),s}return R.cancel=w,R.flush=A,R}function Fr(e){return Ue(e)&&Tc(e)}var Hp=200;function Up(e,t,r,n){var i=-1,o=Rd,s=!0,c=e.length,l=[],u=t.length;if(!c)return l;r&&(t=jc(t,Ji(r))),t.length>=Hp&&(o=Hc,s=!1,t=new Bt(t));e:for(;++i<c;){var f=e[i],d=r==null?f:r(f);if(f=f!==0?f:0,s&&d===d){for(var h=u;h--;)if(t[h]===d)continue e;l.push(f)}else o(t,d,n)||l.push(f)}return l}function Gp(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Wp=_d(function(e,t){var r=Gp(t);return Fr(r)&&(r=void 0),Fr(e)?Up(e,ah(t,1,Fr),Bp(r)):[]}),Vp="[object Number]";function mr(e){return typeof e=="number"||Ue(e)&&it(e)==Vp}var Xp="[object RegExp]";function Yp(e){return Ue(e)&&it(e)==Xp}var fa=pr&&pr.isRegExp,Kp=fa?Ji(fa):Yp,Zp=Vc("length"),Xc="\\ud800-\\udfff",Jp="\\u0300-\\u036f",Qp="\\ufe20-\\ufe2f",em="\\u20d0-\\u20ff",tm=Jp+Qp+em,rm="\\ufe0e\\ufe0f",nm="["+Xc+"]",Fi="["+tm+"]",Hi="\\ud83c[\\udffb-\\udfff]",im="(?:"+Fi+"|"+Hi+")",Yc="[^"+Xc+"]",Kc="(?:\\ud83c[\\udde6-\\uddff]){2}",Zc="[\\ud800-\\udbff][\\udc00-\\udfff]",om="\\u200d",Jc=im+"?",Qc="["+rm+"]?",am="(?:"+om+"(?:"+[Yc,Kc,Zc].join("|")+")"+Qc+Jc+")*",sm=Qc+Jc+am,cm="(?:"+[Yc+Fi+"?",Fi,Kc,Zc,nm].join("|")+")",ha=RegExp(Hi+"(?="+Hi+")|"+cm+sm,"g");function lm(e){for(var t=ha.lastIndex=0;ha.test(e);)++t;return t}function um(e){return to(e)?lm(e):Zp(e)}var dm="Expected a function";function bt(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(dm);return rt(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Wt(e,t,{leading:n,maxWait:t,trailing:i})}var fm=30,hm="...",pm=/\w*$/;function mm(e,t){var r=fm,n=hm;if(rt(t)){var i="separator"in t?t.separator:i;r="length"in t?td(t.length):r,n="omission"in t?hr(t.omission):n}e=ki(e);var o=e.length;if(to(e)){var s=Eh(e);o=s.length}if(r>=o)return e;var c=r-um(n);if(c<1)return n;var l=s?ch(s,0,c).join(""):e.slice(0,c);if(i===void 0)return l+n;if(s&&(c+=l.length-c),Kp(i)){if(e.slice(c).search(i)){var u,f=l;for(i.global||(i=RegExp(i.source,ki(pm.exec(i))+"g")),i.lastIndex=0;u=i.exec(f);)var d=u.index;l=l.slice(0,d===void 0?c:d)}}else if(e.indexOf(hr(i),c)!=c){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+n}const no="-",gm=e=>{const t=vm(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{const c=s.split(no);return c[0]===""&&c.length!==1&&c.shift(),el(c,t)||xm(s)},getConflictingClassGroupIds:(s,c)=>{const l=r[s]||[];return c&&n[s]?[...l,...n[s]]:l}}},el=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?el(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(no);return(s=t.validators.find(({validator:c})=>c(o)))==null?void 0:s.classGroupId},pa=/^\[(.+)\]$/,xm=e=>{if(pa.test(e)){const t=pa.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},vm=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return bm(Object.entries(e.classGroups),r).forEach(([o,s])=>{Ui(s,n,o,t)}),n},Ui=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:ma(t,i);o.classGroupId=r;return}if(typeof i=="function"){if(ym(i)){Ui(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([o,s])=>{Ui(s,ma(t,o),r,n)})})},ma=(e,t)=>{let r=e;return t.split(no).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},ym=e=>e.isThemeGetter,bm=(e,t)=>t?e.map(([r,n])=>{const i=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,c])=>[t+s,c])):o);return[r,i]}):e,wm=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(o,s)=>{r.set(o,s),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let s=r.get(o);if(s!==void 0)return s;if((s=n.get(o))!==void 0)return i(o,s),s},set(o,s){r.has(o)?r.set(o,s):i(o,s)}}},tl="!",Sm=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],o=t.length,s=c=>{const l=[];let u=0,f=0,d;for(let y=0;y<c.length;y++){let S=c[y];if(u===0){if(S===i&&(n||c.slice(y,y+o)===t)){l.push(c.slice(f,y)),f=y+o;continue}if(S==="/"){d=y;continue}}S==="["?u++:S==="]"&&u--}const h=l.length===0?c:c.substring(f),p=h.startsWith(tl),m=p?h.substring(1):h,g=d&&d>f?d-f:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return r?c=>r({className:c,parseClassName:s}):s},jm=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Am=e=>({cache:wm(e.cacheSize),parseClassName:Sm(e),...gm(e)}),Cm=/\s+/,Im=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(Cm);let c="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:f,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=r(u);let m=!!p,g=n(m?h.substring(0,p):h);if(!g){if(!m){c=u+(c.length>0?" "+c:c);continue}if(g=n(h),!g){c=u+(c.length>0?" "+c:c);continue}m=!1}const y=jm(f).join(":"),S=d?y+tl:y,j=S+g;if(o.includes(j))continue;o.push(j);const w=i(g,m);for(let A=0;A<w.length;++A){const R=w[A];o.push(S+R)}c=u+(c.length>0?" "+c:c)}return c};function Tm(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=rl(t))&&(n&&(n+=" "),n+=r);return n}const rl=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=rl(e[n]))&&(r&&(r+=" "),r+=t);return r};function Pm(e,...t){let r,n,i,o=s;function s(l){const u=t.reduce((f,d)=>d(f),e());return r=Am(u),n=r.cache.get,i=r.cache.set,o=c,c(l)}function c(l){const u=n(l);if(u)return u;const f=Im(l,r);return i(l,f),f}return function(){return o(Tm.apply(null,arguments))}}const ae=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},nl=/^\[(?:([a-z-]+):)?(.+)\]$/i,Om=/^\d+\/\d+$/,Rm=new Set(["px","full","screen"]),Em=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Nm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,_m=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$m=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ze=e=>vt(e)||Rm.has(e)||Om.test(e),Qe=e=>St(e,"length",Hm),vt=e=>!!e&&!Number.isNaN(Number(e)),Hr=e=>St(e,"number",vt),Et=e=>!!e&&Number.isInteger(Number(e)),km=e=>e.endsWith("%")&&vt(e.slice(0,-1)),W=e=>nl.test(e),et=e=>Em.test(e),Lm=new Set(["length","size","percentage"]),Dm=e=>St(e,Lm,il),Bm=e=>St(e,"position",il),qm=new Set(["image","url"]),zm=e=>St(e,qm,Gm),Fm=e=>St(e,"",Um),Mt=()=>!0,St=(e,t,r)=>{const n=nl.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},Hm=e=>Mm.test(e)&&!Nm.test(e),il=()=>!1,Um=e=>_m.test(e),Gm=e=>$m.test(e),Wm=()=>{const e=ae("colors"),t=ae("spacing"),r=ae("blur"),n=ae("brightness"),i=ae("borderColor"),o=ae("borderRadius"),s=ae("borderSpacing"),c=ae("borderWidth"),l=ae("contrast"),u=ae("grayscale"),f=ae("hueRotate"),d=ae("invert"),h=ae("gap"),p=ae("gradientColorStops"),m=ae("gradientColorStopPositions"),g=ae("inset"),y=ae("margin"),S=ae("opacity"),j=ae("padding"),w=ae("saturate"),A=ae("scale"),R=ae("sepia"),M=ae("skew"),N=ae("space"),T=ae("translate"),C=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",W,t],E=()=>[W,t],L=()=>["",ze,Qe],k=()=>["auto",vt,W],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",W],xe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],fe=()=>[vt,W];return{cacheSize:500,separator:":",theme:{colors:[Mt],spacing:[ze,Qe],blur:["none","",et,W],brightness:fe(),borderColor:[e],borderRadius:["none","","full",et,W],borderSpacing:E(),borderWidth:L(),contrast:fe(),grayscale:Q(),hueRotate:fe(),invert:Q(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[km,Qe],inset:P(),margin:P(),opacity:fe(),padding:E(),saturate:fe(),scale:fe(),sepia:Q(),skew:fe(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",W]}],container:["container"],columns:[{columns:[et]}],"break-after":[{"break-after":xe()}],"break-before":[{"break-before":xe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Y(),W]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Et,W]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",W]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",Et,W]}],"grid-cols":[{"grid-cols":[Mt]}],"col-start-end":[{col:["auto",{span:["full",Et,W]},W]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[Mt]}],"row-start-end":[{row:["auto",{span:[Et,W]},W]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",W]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",W]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[j]}],px:[{px:[j]}],py:[{py:[j]}],ps:[{ps:[j]}],pe:[{pe:[j]}],pt:[{pt:[j]}],pr:[{pr:[j]}],pb:[{pb:[j]}],pl:[{pl:[j]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",W,t]}],"min-w":[{"min-w":[W,t,"min","max","fit"]}],"max-w":[{"max-w":[W,t,"none","full","min","max","fit","prose",{screen:[et]},et]}],h:[{h:[W,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[W,t,"auto","min","max","fit"]}],"font-size":[{text:["base",et,Qe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hr]}],"font-family":[{font:[Mt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",W]}],"line-clamp":[{"line-clamp":["none",vt,Hr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ze,W]}],"list-image":[{"list-image":["none",W]}],"list-style-type":[{list:["none","disc","decimal",W]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ze,Qe]}],"underline-offset":[{"underline-offset":["auto",ze,W]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),Bm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Dm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zm]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:re()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[ze,W]}],"outline-w":[{outline:[ze,Qe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[ze,Qe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",et,Fm]}],"shadow-color":[{shadow:[Mt]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...ue(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ue()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",et,W]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[R]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[R]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",W]}],duration:[{duration:fe()}],ease:[{ease:["linear","in","out","in-out",W]}],delay:[{delay:fe()}],animate:[{animate:["none","spin","ping","pulse","bounce",W]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[Et,W]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",W]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",W]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",W]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ze,Qe,Hr]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Vm=Pm(Wm);function Z(...e){return Vm(le.clsx(e))}let Ur;function Gr(){return Ur===void 0&&(Ur=navigator.platform.includes("Mac")),Ur}function ol(e){return`${e}`.toLowerCase()==="mod"?Gr()?"⌘":"Ctrl":`${e}`.toLowerCase()==="alt"?Gr()?"⌥":"Alt":`${e}`.toLowerCase()==="shift"?Gr()?"⇧":"Shift":e}function al(e){return e.map(ol).join(" ")}const F=b.forwardRef((e,t)=>{const{icon:r=void 0,tooltip:n=void 0,disabled:i=!1,customClass:o="",loading:s=void 0,shortcutKeys:c=void 0,tooltipOptions:l={},action:u=void 0,isActive:f=void 0,children:d,asChild:h=!1,upload:p=!1,...m}=e,g=ao[r],y=h?gc.Slot:yo;return a.jsxs(bo,{children:[a.jsx(wo,{asChild:!0,children:a.jsxs(y,{"data-state":f!=null&&f()?"on":"off",onClick:u,ref:t,size:"sm",className:Z("richtext-w-[32px] richtext-h-[32px]",o),disabled:i,...m,children:[g&&a.jsx(g,{className:"richtext-size-4"}),d]})}),n&&a.jsx(Cr,{...l,children:a.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[a.jsx("div",{children:n}),!!(c!=null&&c.length)&&a.jsx("span",{children:al(c)})]})})]})});function Xm(e){const t=["size-small","size-medium","size-large"],r=["SizeS","SizeM","SizeL"];return t.map((n,i)=>({type:`image-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.${n.replace("-",".")}.tooltip`),icon:r[i],action:()=>e.commands.updateImage({width:B.IMAGE_SIZE[n]}),isActive:()=>e.isActive("image",{width:B.IMAGE_SIZE[n]})}}))}function Ym(e){const t=["size-small","size-medium","size-large"],r=["SizeS","SizeM","SizeL"];return t.map((n,i)=>({type:`image-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.${n.replace("-",".")}.tooltip`),icon:r[i],action:()=>e.commands.updateImageGif({width:B.IMAGE_SIZE[n]}),isActive:()=>e.isActive("image",{width:B.IMAGE_SIZE[n]})}}))}function Km(e){const t=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(n=>({type:`image-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=e.commands)==null?void 0:i.setAlignImage)==null?void 0:o.call(i,n)},isActive:()=>e.isActive({align:n})||!1,disabled:!1}}))}function Zm(e){const t=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(n=>({type:`image-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=e.commands)==null?void 0:i.setAlignImageGif)==null?void 0:o.call(i,n)},isActive:()=>e.isActive({align:n})||!1,disabled:!1}}))}function Jm(e){const t=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(n=>({type:`image-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=e.commands)==null?void 0:i.setAlignImageMermaid)==null?void 0:o.call(i,n)},isActive:()=>e.isActive({align:n})||!1,disabled:!1}}))}function Qm(e){const t=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(n=>({type:`image-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=e.commands)==null?void 0:i.setAlignImageDrawer)==null?void 0:o.call(i,n)},isActive:()=>e.isActive({align:n})||!1,disabled:!1}}))}function eg(e){const t=["size-small","size-medium","size-large"],r=["SizeS","SizeM","SizeL"];return t.map((n,i)=>({type:`video-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.${n.replace("-",".")}.tooltip`),icon:r[i],action:()=>e.commands.updateVideo({width:B.VIDEO_SIZE[n]}),isActive:()=>e.isActive("video",{width:B.VIDEO_SIZE[n]})}}))}function tg(e){return[{type:"flipX",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.tooltip.flipX"),icon:"FlipX",action:()=>{const t=e.getAttributes("image"),{flipX:r}=t;e.chain().focus(void 0,{scrollIntoView:!1}).updateImage({flipX:!r}).run()}}},{type:"flipY",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.tooltip.flipY"),icon:"FlipY",action:()=>{const t=e.getAttributes("image"),{flipY:r}=t;e.chain().focus(void 0,{scrollIntoView:!1}).updateImage({flipY:!r}).run()}}},...Xm(e),...Km(e),{type:"remove",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;H.deleteSelection(t,r)}}}]}function rg(e){return[...Ym(e),...Zm(e),{type:"remove",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;H.deleteSelection(t,r)}}}]}function ng(e){return[...Jm(e),{type:"edit",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.edit"),icon:"Pencil",action:()=>!0}},{type:"remove",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;H.deleteSelection(t,r)}}}]}function ig(e){return[...Qm(e),{type:"edit",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.edit"),icon:"Pencil",action:()=>(console.log("AAA"),!0)}},{type:"remove",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;H.deleteSelection(t,r)}}}]}function og(e){return[...eg(e),{type:"remove",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;H.deleteSelection(t,r)}}}]}function ag(e,t){return B.BUBBLE_TEXT_LIST.reduce((r,n)=>{if(n==="divider"&&r.length>0)return[...r,{type:"divider",component:void 0,componentProps:{}}];const i=e.extensionManager.extensions.find(o=>o.name===n);return i?[...r,i.configure().options.button({editor:e,t,extension:i})]:r},[])}function io(e,t,r){const n=[],i=e.node(0);r=typeof r=="number"&&r>=0?r:e.sameParent(t)?Math.max(0,e.sharedDepth(t.pos)-1):e.sharedDepth(t.pos);const o=new H.NodeRange(e,t,r),s=o.depth===0?0:i.resolve(o.start).posAtIndex(0);return o.parent.forEach((c,l)=>{const u=s+l,f=u+c.nodeSize;if(u<o.start||u>=o.end)return;const d=new H.SelectionRange(i.resolve(u),i.resolve(f));n.push(d)}),n}class oo{constructor(t,r){rr(this,"anchor");rr(this,"head");this.anchor=t,this.head=r}map(t){return new oo(t.map(this.anchor),t.map(this.head))}resolve(t){const r=t.resolve(this.anchor),n=t.resolve(this.head);return new Ne(r,n)}}class Ne extends H.Selection{constructor(r,n,i,o=1){const{doc:s}=r,c=r===n,l=r.pos===s.content.size&&n.pos===s.content.size,u=c&&!l?s.resolve(n.pos+(o>0?1:-1)):n,f=c&&l?s.resolve(r.pos-(o>0?1:-1)):r,d=io(f.min(u),f.max(u),i);super(u.pos>=r.pos?d[0].$from:d[d.length-1].$to,u.pos>=r.pos?d[d.length-1].$to:d[0].$from,d);rr(this,"depth");this.depth=i}get $to(){return this.ranges[this.ranges.length-1].$to}eq(r){return r instanceof Ne&&r.$from.pos===this.$from.pos&&r.$to.pos===this.$to.pos}map(r,n){const i=r.resolve(n.map(this.anchor)),o=r.resolve(n.map(this.head));return new Ne(i,o)}toJSON(){return{type:"nodeRange",anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){const{doc:r}=this.$from;if(this.isForwards&&this.ranges.length>1){const o=this.ranges.slice(0,-1),s=o[0].$from,c=o[o.length-1].$to;return new Ne(s,c,this.depth)}const n=this.ranges[0],i=r.resolve(Math.max(0,n.$from.pos-1));return new Ne(this.$anchor,i,this.depth)}extendForwards(){const{doc:r}=this.$from;if(this.isBackwards&&this.ranges.length>1){const o=this.ranges.slice(1),s=o[0].$from,c=o[o.length-1].$to;return new Ne(c,s,this.depth)}const n=this.ranges[this.ranges.length-1],i=r.resolve(Math.min(r.content.size,n.$to.pos+1));return new Ne(this.$anchor,i,this.depth)}static fromJSON(r,n){return new Ne(r.resolve(n.anchor),r.resolve(n.head))}static create(r,n,i,o,s=1){return new this(r.resolve(n),r.resolve(i),o,s)}getBookmark(){return new oo(this.anchor,this.head)}}function sg(e){const t=e.cloneNode(!0),r=[e,...Array.from(e.getElementsByTagName("*"))],n=[t,...Array.from(t.getElementsByTagName("*"))];return r.forEach((i,o)=>{n[o].style.cssText=function(s){let c="";const l=getComputedStyle(s);for(let u=0;u<l.length;u+=1)c+=`${l[u]}:${l.getPropertyValue(l[u])};`;return c}(i)}),t}function or(e,t){return window.getComputedStyle(e)[t]}function cg(e=0,t=0,r=0){return Math.min(Math.max(e,t),r)}function ga(e){e.parentNode!==null&&e.parentNode!==void 0&&e.parentNode.removeChild(e)}function sl(e){const{x:t,y:r,direction:n,editor:i}=e;let o=null,s=null,c=null,l=t;for(;s===null&&l<window.innerWidth&&l>0;){const u=document.elementsFromPoint(l,r),f=u.findIndex(h=>h.classList.contains("ProseMirror")),d=u.slice(0,f);if(d.length>0){const h=d[0];if(o=h,c=i.view.posAtDOM(h,0),c>=0){s=i.state.doc.nodeAt(Math.max(c-1,0)),(s===null||s.isText)&&(s=i.state.doc.nodeAt(Math.max(c-1,0))),s||(s=i.state.doc.nodeAt(Math.max(c,0)));break}}n==="left"?l-=1:l+=1}return{resultElement:o,resultNode:s,pos:c!==null?c:null}}function lg(e,t){const{doc:r}=t.view.state,n=sl({editor:t,x:e.clientX,y:e.clientY,direction:"right"});if(!n.resultNode||n.pos===null)return[];const i=e.clientX,o=function(f,d,h){const p=Number.parseInt(or(f.dom,"paddingLeft"),10),m=Number.parseInt(or(f.dom,"paddingRight"),10),g=Number.parseInt(or(f.dom,"borderLeftWidth"),10),y=Number.parseInt(or(f.dom,"borderLeftWidth"),10),S=f.dom.getBoundingClientRect();return{left:cg(d,S.left+p+g,S.right-m-y),top:h}}(t.view,i,e.clientY),s=t.view.posAtCoords(o);if(!s)return[];const{pos:c}=s;if(!r.resolve(c).parent)return[];const l=r.resolve(n.pos),u=r.resolve(n.pos+1);return io(l,u,0)}function xa(e,t){const r=e.resolve(t),{depth:n}=r;return n===0?t:r.pos-r.parentOffset-1}function va(e,t){const r=e.nodeAt(t),n=e.resolve(t);let{depth:i}=n,o=r;for(;i>0;){const s=n.node(i);i-=1,i===0&&(o=s)}return o}function ya(e,t){let r=t;for(;r&&r.parentNode&&r.parentNode!==e.dom;)r=r.parentNode;return r}const cl=new H.PluginKey("dragHandle");function ug({pluginKey:e=cl,element:t,editor:r,tippyOptions:n,onNodeChange:i}){const o=document.createElement("div");let s=null,c=!1,l=null,u=-1;return t.addEventListener("dragstart",f=>{const{view:d}=r;if(!f.dataTransfer)return;const{empty:h,$from:p,$to:m}=d.state.selection,g=lg(f,r),y=io(p,m,0),S=y.some(C=>g.find($=>$.$from===C.$from&&$.$to===C.$to)),j=h||!S?g:y;if(j.length===0)return;const{tr:w}=d.state,A=document.createElement("div"),R=j[0].$from.pos,M=j[j.length-1].$to.pos,N=Ne.create(d.state.doc,R,M),T=N.content();j.forEach(C=>{const $=sg(d.nodeDOM(C.$from.pos));A.append($)}),A.style.position="absolute",A.style.top="-10000px",document.body.append(A),f.dataTransfer.clearData(),f.dataTransfer.setDragImage(A,0,0),d.dragging={slice:T,move:!0},w.setSelection(N),d.dispatch(w),document.addEventListener("drop",()=>ga(A),{once:!0}),setTimeout(()=>{t&&(t.style.pointerEvents="none")},0)}),t.addEventListener("dragend",()=>{t&&(t.style.pointerEvents="auto")}),new H.Plugin({key:typeof e=="string"?new H.PluginKey(e):e,state:{init:()=>({locked:!1}),apply(f,d){const h=f.getMeta("lockDragHandle"),p=f.getMeta("hideDragHandle");if(h!==void 0&&(c=h),p&&s)return s.hide(),c=!1,l=null,u=-1,i==null||i({editor:r,node:null,pos:-1}),d;if(f.docChanged&&u!==-1&&t&&s){const m=f.mapping.map(u);m!==u&&(u=m)}return d}},view:f=>{return d(),h(r.view.dom),s=xc(f.dom,{...p(),...n}),{update(A,R){if(!m(t,s)||(t.draggable=!c,!g(A,R)))return;const M=y(A);M&&S(A,M)},destroy(){w()}};function d(){t.draggable=!0,t.style.pointerEvents="auto"}function h(A){var R;(R=A.parentElement)==null||R.appendChild(o),o.appendChild(t),Object.assign(o.style,{pointerEvents:"none",position:"absolute",top:"0",left:"0"})}function p(){return{getReferenceClientRect:null,interactive:!0,trigger:"manual",placement:"left-start",hideOnClick:!1,duration:100,zIndex:10,appendTo:o,content:t,popperOptions:{modifiers:[{name:"flip",enabled:!1},{name:"preventOverflow",options:{rootBoundary:"document",mainAxis:!1}}]}}}function m(A,R){return A&&R}function g(A,R){return!A.state.doc.eq(R.doc)&&u!==-1}function y(A){let R=A.nodeDOM(u);return R=ya(A,R),R===A.dom||(R==null?void 0:R.nodeType)!==1?null:R}function S(A,R){const M=A.posAtDOM(R,0),N=va(r.state.doc,M);if(N===l)return;const T=xa(r.state.doc,M);l=N,u=T,i==null||i({editor:r,node:l,pos:u}),j(R)}function j(A){s.setProps({getReferenceClientRect:()=>A.getBoundingClientRect()}),s.show()}function w(){s==null||s.destroy(),t&&ga(o)}},props:{handleDOMEvents:{mouseleave:(f,d)=>{if(c||!h(d))return!1;return p(),m(),!1;function h(g){return g.target&&!o.contains(g.relatedTarget)}function p(){s==null||s.hide()}function m(){l=null,u=-1,i==null||i({editor:r,node:null,pos:-1})}},mousemove:Wt((f,d)=>{if(!t||!s||c)return!1;const h=sl({x:d.clientX,y:d.clientY,direction:"right",editor:r});if(!h.resultElement||h.resultElement===f.dom)return!1;const p=ya(f,h.resultElement);if(p===f.dom||(p==null?void 0:p.nodeType)!==1)return!1;const m=f.posAtDOM(p,0),g=va(r.state.doc,m);if(g===l)return!1;const y=xa(r.state.doc,m);return l=g,u=y,i==null||i({editor:r,node:l,pos:u}),s.setProps({getReferenceClientRect:()=>p.getBoundingClientRect()}),s.show(),!1},100)}}})}var gr=(e=>(e[e.max=7]="max",e[e.min=0]="min",e[e.more=1]="more",e[e.less=-1]="less",e))(gr||{});function dg(e,t,r){return e<t?t:e>r?r:e}function fg(e,t,r,n){const{doc:i,selection:o}=e;if(!i||!o||!(o instanceof H.TextSelection||o instanceof H.AllSelection))return e;const{from:s,to:c}=o;return i.nodesBetween(s,c,(l,u)=>{const f=l.type;return r.includes(f.name)?(e=Gi(e,u,t),!1):!H.isList(l.type.name,n.extensionManager.extensions)}),e}function Gi(e,t,r){if(!e.doc)return e;const n=e.doc.nodeAt(t);if(!n)return e;const s=dg((n.attrs.indent||0)+r,0,7);if(s===n.attrs.indent)return e;const c={...n.attrs,indent:s};return e.setNodeMarkup(t,n.type,c,n.marks)}function hg({delta:e,types:t}){return({state:r,dispatch:n,editor:i})=>{const{selection:o}=r;let{tr:s}=r;return s=s.setSelection(o),s=fg(s,e,t,i),s.docChanged?(n&&n(s),!0):!1}}function pg(e){var T,C,$;const{pluginKey:t=cl}=e,{t:r}=B.useLocale(),[n,i]=b.useState(null),[o,s]=b.useState(-1),c=b.useRef(null),l=b.useRef(null),[u,f]=b.useState(!1),d=e.editor.extensionManager.extensions.some(P=>P.name==="textAlign"),h=e.editor.extensionManager.extensions.some(P=>P.name==="indent"),p=e.editor.extensionManager.extensions.some(P=>P.name==="clear");b.useEffect(()=>{c.current&&!e.editor.isDestroyed&&(l.current=ug({editor:e.editor,element:c.current,pluginKey:"ContentItemMenu",tippyOptions:{offset:[-2,16],zIndex:99,moveTransition:"transform 0.15s ease-out"},onNodeChange:R}),e.editor.registerPlugin(l.current))},[e.editor,c]);function m(){const P=e.editor.chain();P.setNodeSelection(o).unsetAllMarks(),(n==null?void 0:n.type.name)!=="paragraph"&&P.setParagraph(),P.run()}function g(){e.editor.chain().focus().setNodeSelection(o).run(),document.execCommand("copy")}function y(){e.editor.commands.setNodeSelection(o);const{$anchor:P}=e.editor.state.selection,E=P.node(1)||e.editor.state.selection.node;e.editor.chain().setMeta("hideDragHandle",!0).insertContentAt(o+((n==null?void 0:n.nodeSize)||0),E.toJSON()).run()}function S(P){e.editor.commands.setTextAlign(P)}function j(){const P=Gi(e.editor.state.tr,o,1);P.setMeta("hideDragHandle",!0),e.editor.view.dispatch&&e.editor.view.dispatch(P)}function w(){const P=Gi(e.editor.state.tr,o,-1);e.editor.view.dispatch&&e.editor.view.dispatch(P)}function A(){e.editor.chain().setMeta("hideDragHandle",!0).setNodeSelection(o).deleteSelection().run()}function R(P){P.node&&i(P.node),s(P.pos)}function M(){var P;if(o!==-1){const E=(n==null?void 0:n.nodeSize)||0,L=o+E,k=(n==null?void 0:n.type.name)==="paragraph"&&((P=n==null?void 0:n.content)==null?void 0:P.size)===0,Y=k?o+2:L+2;e.editor.chain().command(({dispatch:re,tr:ue,state:ne})=>re?(k?ue.insertText("/",o,o+1):ue.insert(L,ne.schema.nodes.paragraph.create(null,[ne.schema.text("/")])),re(ue)):!0).focus(Y).run()}}b.useEffect(()=>(u?e.editor.commands.setMeta("lockDragHandle",!0):e.editor.commands.setMeta("lockDragHandle",!1),()=>{e.editor.commands.setMeta("lockDragHandle",!1)}),[u]),b.useEffect(()=>()=>{l.current&&(e.editor.unregisterPlugin(t),l.current=null)},[]),b.useEffect(()=>{var P;(P=e.editor)!=null&&P.isDestroyed&&l.current&&(e.editor.unregisterPlugin(t),l.current=null)},[(T=e.editor)==null?void 0:T.isDestroyed]);const N=P=>{e!=null&&e.disabled||f(P)};return a.jsx("div",{ref:c,className:`drag-handle richtext-duration-200 richtext-ease-in-out [transition-property:top,_left] ${e==null?void 0:e.className}`,style:{opacity:e!=null&&e.disabled?0:1},children:a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-0.5 richtext-duration-200 richtext-ease-in-out [transition-property:top,_left]",children:[a.jsx(ge,{className:"!richtext-size-7 richtext-cursor-grab",disabled:e==null?void 0:e.disabled,onClick:M,size:"icon",type:"button",variant:"ghost",children:a.jsx(me,{className:"richtext-text-lg richtext-text-neutral-600 dark:richtext-text-neutral-200",name:"Plus"})}),a.jsxs(Sl,{onOpenChange:N,open:u,children:[a.jsxs("div",{className:"richtext-relative richtext-flex richtext-flex-col",children:[a.jsxs(bo,{children:[a.jsx(wo,{asChild:!0,disabled:e==null?void 0:e.disabled,children:a.jsx(ge,{className:"richtext-relative richtext-z-[1] !richtext-size-7 richtext-cursor-grab",disabled:e==null?void 0:e.disabled,size:"icon",type:"button",variant:"ghost",onMouseUp:P=>{P.preventDefault(),!(e!=null&&e.disabled)&&f(!0)},children:a.jsx(me,{className:"richtext-text-sm richtext-text-neutral-600 dark:richtext-text-neutral-200",name:"Grip"})})}),a.jsx(Cr,{children:r("editor.draghandle.tooltip")})]}),a.jsx(jl,{className:"richtext-absolute richtext-left-0 richtext-top-0 richtext-z-0 richtext-size-[28px]"})]}),a.jsxs(mo,{align:"start",className:"richtext-w-48",side:"bottom",sideOffset:0,children:[a.jsxs(Me,{className:"richtext-flex richtext-gap-3 richtext-bg-opacity-10 hover:richtext-bg-red-400 hover:richtext-bg-opacity-20 focus:richtext-bg-red-400 focus:richtext-bg-opacity-30 focus:richtext-text-red-500 dark:hover:richtext-bg-opacity-20 dark:hover:richtext-text-red-500",onClick:A,children:[a.jsx(me,{name:"Trash2"}),a.jsx("span",{children:r("editor.remove")})]}),p?a.jsxs(Me,{className:"richtext-flex richtext-gap-3",onClick:m,children:[a.jsx(me,{name:"PaintRoller"}),a.jsx("span",{children:r("editor.clear.tooltip")})]}):null,a.jsxs(Me,{className:"richtext-flex richtext-gap-3",onClick:g,children:[a.jsx(me,{name:"Clipboard"}),a.jsx("span",{children:r("editor.copyToClipboard")})]}),a.jsxs(Me,{className:"richtext-flex richtext-gap-3",onClick:y,children:[a.jsx(me,{name:"Copy"}),a.jsx("span",{children:r("editor.copy")})]}),d||h?a.jsx(go,{}):null,d?a.jsxs(Aa,{children:[a.jsxs(Wi,{className:"richtext-flex richtext-gap-3",children:[a.jsx(me,{name:"AlignCenter"}),a.jsx("span",{children:r("editor.textalign.tooltip")})]}),a.jsx(ja,{children:a.jsxs(Vi,{children:[a.jsxs(Me,{className:"richtext-flex richtext-gap-3",onClick:()=>S("left"),children:[a.jsx(me,{name:"AlignLeft"}),a.jsx("span",{children:r("editor.textalign.left.tooltip")})]}),a.jsxs(Me,{className:"richtext-flex richtext-gap-3",onClick:()=>S("center"),children:[a.jsx(me,{name:"AlignCenter"}),a.jsx("span",{children:r("editor.textalign.center.tooltip")})]}),a.jsxs(Me,{className:"richtext-flex richtext-gap-3",onClick:()=>S("right"),children:[a.jsx(me,{name:"AlignRight"}),a.jsx("span",{children:r("editor.textalign.right.tooltip")})]})]})})]}):null,h?a.jsxs(Aa,{children:[a.jsxs(Wi,{className:"richtext-flex richtext-gap-3",children:[a.jsx(me,{name:"IndentIncrease"}),a.jsx("span",{children:r("editor.indent")})]}),a.jsx(ja,{children:a.jsxs(Vi,{children:[a.jsxs(Me,{className:"richtext-flex richtext-gap-3",disabled:((C=n==null?void 0:n.attrs)==null?void 0:C.indent)>=gr.max,onClick:j,children:[a.jsx(me,{name:"IndentIncrease"}),a.jsx("span",{children:r("editor.indent.tooltip")})]}),a.jsxs(Me,{className:"richtext-flex richtext-gap-3",disabled:(($=n==null?void 0:n.attrs)==null?void 0:$.indent)<=gr.min,onClick:w,children:[a.jsx(me,{name:"IndentDecrease"}),a.jsx("span",{children:r("editor.outdent.tooltip")})]})]})})]}):null]})]})]})})}const mg={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function gg({item:e,disabled:t,editor:r}){var i;const n=e.component;return n?a.jsx(n,{...e.componentProps,disabled:t||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:r}):a.jsx(a.Fragment,{})}function xg(e){const{t,lang:r}=B.useLocale(),n=({editor:o})=>{const{selection:s}=o.view.state,{$from:c,to:l}=s;return c.pos===l?!1:s instanceof H.TextSelection},i=b.useMemo(()=>e.disabled||!(e!=null&&e.editor)?[]:ag(e.editor,t),[e.disabled,e.editor,r,t]);return a.jsx(le.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:n,tippyOptions:mg,children:i!=null&&i.length?a.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:a.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-gap-[4px] richtext-whitespace-nowrap",children:i==null?void 0:i.map((o,s)=>(o==null?void 0:o.type)==="divider"?a.jsx(Ee,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"},`bubbleMenu-divider-${s}`):a.jsx(gg,{disabled:e.disabled,editor:e.editor,item:o},`bubbleMenu-text-${s}`))})}):a.jsx(a.Fragment,{})})}function vg(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H3V5h18z"})})}function yg(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 15h15m0 4H6m9-8h6m0-4h-6M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"})})}function bg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5.5 3c1.404 0 2.107 0 2.611.38c.219.164.406.375.552.62C9 4.568 9 5.358 9 6.938v10.125c0 1.58 0 2.37-.337 2.937a2.1 2.1 0 0 1-.552.621c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C2 19.432 2 18.642 2 17.062V6.938c0-1.58 0-2.37.337-2.938a2.1 2.1 0 0 1 .552-.62C3.393 3 4.096 3 5.5 3M20 11.938v5.124c0 1.58 0 2.37-.337 2.938a2.1 2.1 0 0 1-.552.62c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C13 19.433 13 18.642 13 17.063V6.938c0-1.58 0-2.37.337-2.938M22 9l-6-6m6 0l-6 6",color:"currentColor"})})}function wg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M21 18.5c0 1.404 0 2.107-.38 2.611a2.1 2.1 0 0 1-.62.552c-.567.337-1.358.337-2.937.337H6.938c-1.58 0-2.37 0-2.938-.337a2.1 2.1 0 0 1-.62-.552C3 20.607 3 19.904 3 18.5s0-2.107.38-2.611c.163-.218.374-.406.62-.552C4.567 15 5.357 15 6.938 15h10.125c1.58 0 2.37 0 2.937.337c.246.146.457.334.62.552c.38.504.38 1.207.38 2.611M12.063 4H6.937C5.358 4 4.568 4 4 4.337a2.1 2.1 0 0 0-.62.552C3 5.393 3 6.096 3 7.5s0 2.107.38 2.611c.163.218.374.406.62.552C4.567 11 5.357 11 6.938 11h10.125c1.58 0 2.37 0 2.937-.337M21 8l-6-6m6 0l-6 6",color:"currentColor"})})}function Sg(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function me(e){const t=ao[e.name];return t?a.jsx(t,{onClick:e==null?void 0:e.onClick,className:`richtext-w-4 richtext-h-4 ${(e==null?void 0:e.className)||""}`}):null}function jg(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M21 22H3v-2h18zm0-18H3V2h18zm-11 9.7h4l-2-5.4zM11.2 6h1.7l4.7 12h-2l-.9-2.6H9.4L8.5 18h-2z"})})}function ll(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:a.jsx("path",{fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:4,d:"M36 19L24 31L12 19z"})})}function Ag(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M9 7v10h6v-2h-4V7z"})})}function Cg(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M9 7c-1.1 0-2 .9-2 2v8h2V9h2v7h2V9h2v8h2V9a2 2 0 0 0-2-2z"})})}function Ig(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M11 7c-1.1 0-2 .9-2 2v2a2 2 0 0 0 2 2h2v2H9v2h4c1.11 0 2-.89 2-2v-2a2 2 0 0 0-2-2h-2V9h4V7z"})})}function Tg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m-9 8h4m-2-2v4"})})}function Pg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m9 8h4m-2-2v4"})})}function Og(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 21v-4m0-4V9m0-4V3m-2 18h4M8 5v4h11l2-2l-2-2zm6 8v4H6l-2-2l2-2z"})})}function Rg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"currentColor",d:"M23.943 19.806a.2.2 0 0 0-.168-.034c-1.26-1.855-2.873-3.61-4.419-5.315l-.252-.284c-.001-.073-.067-.12-.134-.15l-.084-.084c-.05-.1-.169-.167-.286-.1c-.47.234-.907.585-1.327.919c-.554.434-1.109.87-1.63 1.354a5 5 0 0 0-.588.618c-.084.117-.017.217.084.267c-.37.368-.74.736-1.109 1.12a.2.2 0 0 0-.05.134c0 .05.033.1.067.117l.655.502v.016c.924.92 2.554 2.173 4.285 3.527c.251.201.52.402.773.602c.117.134.234.285.335.418c.05.066.169.084.236.033c.033.034.084.067.118.1a.24.24 0 0 0 .1.034a.15.15 0 0 0 .135-.066a.24.24 0 0 0 .033-.1c.017 0 .017.016.034.016a.2.2 0 0 0 .134-.05l3.058-3.327c.12-.116.014-.267 0-.267m-7.628-.134l-1.546-1.17l-.15-.1c-.035-.017-.068-.05-.102-.067l-.117-.1c.66-.66 1.33-1.308 2-1.956c-.488.484-1.463 1.906-1.261 2.373c.002 0 .018.042.067.084zm4.1 3.126l-1.277-.97a27 27 0 0 0-1.58-1.504c.69.518 1.277.97 1.361 1.053c.673.585.638.485 1.093.87l.554.4c-.074.103-.151.148-.151.151m.336.25l-.034-.016a1 1 0 0 0 .152-.117zM.588 3.476c.033.217.084.435.117.636c.201 1.103.403 2.106.772 2.858l.152.568c.05.217.134.485.219.552a67 67 0 0 0 3.578 2.942a.18.18 0 0 0 .219 0s0 .016.016.016a.15.15 0 0 0 .118.05a.2.2 0 0 0 .134-.05c1.798-1.989 3.142-3.627 4.1-4.998c.068-.066.084-.167.084-.25c.067-.067.118-.151.185-.201c.067-.067.067-.184 0-.235l-.017-.016c0-.033-.017-.084-.05-.1c-.42-.401-.722-.685-1.042-.986a94 94 0 0 1-2.352-2.273c-.017-.017-.034-.034-.067-.034c-.336-.117-1.025-.234-1.882-.385c-1.277-.216-3.008-.517-4.57-.986c0 0-.101 0-.118.017l-.05.05C.05.714.022.707 0 .718c.017.1.017.167.05.284c0 .033.068.301.068.334zm7.19 4.78l-.033.034a.036.036 0 0 1 .033-.034M6.553 2.238c.101.1.521.502.622.585c-.437-.2-1.529-.702-2.034-.869c.505.1 1.194.201 1.412.284M.79 1.403c.252.434.454 1.939.655 3.41c-.118-.469-.201-.936-.302-1.372C.992 2.673.84 1.988.638 1.386c.124 0 .152.021.152.017m-.286-.369c0-.016 0-.033-.017-.033c.085 0 .135.017.202.05c0 .006-.145-.017-.185-.017m23.17-.217c.017-.066-.336-.367-.219-.384c.253-.017.253-.401 0-.401c-.335.017-.688.1-1.008.15c-.587.117-1.192.234-1.78.367a80 80 0 0 0-3.949.937c-.403.117-.857.2-1.243.401c-.135.067-.118.2-.05.284c-.034.017-.051.017-.085.034c-.117.017-.218.034-.335.05c-.102.017-.152.1-.135.2c0 .017.017.05.017.067c-.706.936-1.496 1.923-2.353 2.976c-.84.969-1.73 1.989-2.62 3.042c-2.84 3.31-6.05 7.07-9.594 10.38a.16.16 0 0 0 0 .234c.016.016.033.033.05.033c-.05.05-.101.085-.152.134q-.05.05-.05.1a.4.4 0 0 0-.067.084c-.067.067-.067.184.017.234c.067.066.185.066.235-.017c.017-.017.017-.033.033-.033a.265.265 0 0 1 .37 0c.202.217.404.435.588.618l-.42-.35c-.067-.067-.184-.05-.234.016c-.068.066-.051.184.016.234l4.469 3.727c.034.034.067.034.118.034a.15.15 0 0 0 .117-.05l.101-.1c.017.016.05.016.067.016c.05 0 .084-.016.118-.05c6.049-6.05 10.922-10.614 16.5-14.693c.05-.033.067-.1.067-.15c.067 0 .118-.05.15-.117c1.026-3.125 1.228-5.9 1.295-7.27c0-.059.016-.038.016-.068c.017-.033.017-.05.017-.05a.98.98 0 0 0-.067-.619m-10.82 4.915c.268-.301.537-.619.806-.903c-1.73 2.273-4.603 5.767-8.67 9.929c2.773-3.059 5.562-6.218 7.864-9.026M5.14 23.466c-.016-.017-.016-.017 0-.017zm2.504-2.156c.135-.15.27-.284.42-.434c0 0 0 .016.017.016c-.224.198-.433.418-.437.418m.69-.668c.099-.1.14-.173.284-.318c.992-1.02 2.017-2.04 3.059-3.076l.016-.016c.252-.2.555-.418.824-.619a228 228 0 0 0-4.184 4.029M14.852 3.91c-.554.719-1.176 1.671-1.697 2.423c-1.646 2.374-6.94 8.174-7.057 8.274a1190 1190 0 0 1-4.839 4.597l-.1.1c-.085-.1-.085-.25.016-.334C8.652 11.966 13.19 6.133 15.021 3.576c-.05.116-.084.216-.168.334zm2.906 3.427c-.671-.386-.99-.987-.806-1.572l.05-.2a.8.8 0 0 1 .085-.167a1.9 1.9 0 0 1 .756-.703c.016 0 .033 0 .05-.016c-.017-.034-.017-.084-.017-.134c.017-.1.085-.167.202-.167c.202 0 .824.184 1.059.384c.067.05.134.117.202.184c.084.1.218.268.285.401c.034.017.067.184.118.268c.033.134.067.284.05.418c-.017.016 0 .116-.017.116a1.6 1.6 0 0 1-.218.619c-.03.03.006.012-.05.067a1.2 1.2 0 0 1-.32.334a1.49 1.49 0 0 1-1.26.234a2 2 0 0 0-.169-.066m4.37 1.403c0 .017-.017.05 0 .067c-.034 0-.05.017-.085.034a110 110 0 0 0-3.915 3.025c1.11-.986 2.218-1.989 3.378-2.975c.336-.301.571-.686.638-1.12l.168-1.003v-.033c.085-.201.404-.118.353.1c-.004-.001-.173.795-.537 1.905"})})}function ul(){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",children:[a.jsx("path",{fill:"currentColor",d:"M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"}),a.jsx("path",{fill:"currentColor",d:"M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"})]})}function dl(){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:"icon",viewBox:"0 0 1024 1024",children:[a.jsx("path",{fill:"currentColor",d:"M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"}),a.jsx("path",{fill:"currentColor",d:"m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"})]})}function Eg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentColor",children:[a.jsx("path",{d:"M14.86 22h-4.312c-3.291 0-4.937 0-6.08-.798a4.2 4.2 0 0 1-.863-.805c-.855-1.066-.855-2.6-.855-5.67v-2.545c0-2.963 0-4.445.473-5.628c.761-1.903 2.37-3.403 4.41-4.113C8.9 2 10.49 2 13.667 2c1.816 0 2.723 0 3.448.252c1.166.406 2.085 1.263 2.52 2.35c.27.676.27 1.523.27 3.216V10"}),a.jsx("path",{d:"M2.75 12c0-1.84 1.506-3.333 3.364-3.333c.672 0 1.464.116 2.117-.057a1.67 1.67 0 0 0 1.19-1.179c.174-.647.057-1.432.057-2.098C9.478 3.493 10.984 2 12.84 2m.002 16h2.523m-4.949-4.15c-.126-.8-.281-.801-1.61-.85h-1.01c-.557 0-1.009.448-1.009 1v3c0 .552.452 1 1.01 1h1.816c.39 0 .803-.313.803-.7v-1.1c0-.11-.113-.304-.224-.304H9.068M12.842 13h1.261m0 0h1.262m-1.262 0v4.875M21.251 13h-2.523c-.557 0-1.009.448-1.009 1v1.5m0 0V18m0-2.5h2.523"})]})})}function Mg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:a.jsx("path",{fill:"currentColor",d:"M6.5 3a.75.75 0 0 1 .697.471l3 7.5a.75.75 0 0 1-1.393.557L7.992 9.5H5.008l-.811 2.028a.75.75 0 0 1-1.393-.556l3-7.5A.75.75 0 0 1 6.5 3m0 2.77L5.608 8h1.784zm8.28-1.55a.75.75 0 1 0-1.06 1.06l.72.72h-3.69a.75.75 0 0 0 0 1.5h3.69l-.72.72a.75.75 0 0 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06zm0 7.5a.75.75 0 1 0-1.06 1.06l.72.72H3.75a.75.75 0 0 0 0 1.5h10.69l-.72.72a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06z"})})}function Ng(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",children:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"4",children:[a.jsx("circle",{cx:"10",cy:"24",r:"4"}),a.jsx("circle",{cx:"38",cy:"10",r:"4"}),a.jsx("circle",{cx:"38",cy:"24",r:"4"}),a.jsx("circle",{cx:"38",cy:"38",r:"4"}),a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M34 38H22V10h12M14 24h20"})]})})}function _g(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:a.jsx("path",{fill:"currentColor",d:"M13.5 3a.75.75 0 0 0-.697.471l-3 7.5a.75.75 0 0 0 1.393.557l.812-2.028h2.984l.811 2.028a.75.75 0 0 0 1.393-.556l-3-7.5A.75.75 0 0 0 13.5 3m0 2.77L14.392 8h-1.784zM5.22 4.22a.75.75 0 0 1 1.06 1.06L5.56 6h3.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 0 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06zm0 7.5a.75.75 0 0 1 1.06 1.06l-.72.72h10.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06z"})})}function $g(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548",color:"currentColor"})})}function kg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}const ao={Bold:O.Bold,LoaderCircle:O.LoaderCircle,Italic:O.Italic,Underline:O.Underline,Quote:O.Quote,TextQuote:yg,Strikethrough:O.Strikethrough,Minus:O.Minus,Eraser:O.Eraser,PaintRoller:O.PaintRoller,Redo2:O.Redo2,Undo2:O.Undo2,AlignCenter:nr.TextAlignCenterIcon,AlignJustify:nr.TextAlignJustifyIcon,AlignLeft:nr.TextAlignLeftIcon,AlignRight:nr.TextAlignRightIcon,ChevronDown:O.ChevronDown,Subscript:O.Subscript,Superscript:O.Superscript,Code:O.Code,Code2:O.CodeXml,Type:O.Type,IndentIncrease:O.IndentIncrease,IndentDecrease:O.IndentDecrease,List:O.List,ListOrdered:O.ListOrdered,ListTodo:O.ListTodo,Link:O.Link,ImageUp:O.ImageUp,Video:O.Video,Maximize:O.Maximize,Minimize:O.Minimize,Table:O.Table,Sparkles:O.Sparkles,Pencil:O.Pencil,Unlink:O.Unlink,BetweenHorizonalEnd:O.BetweenHorizonalEnd,BetweenHorizonalStart:O.BetweenHorizonalStart,BetweenVerticalStart:O.BetweenVerticalStart,BetweenVerticalEnd:O.BetweenVerticalEnd,TableCellsMerge:O.TableCellsMerge,TableCellsSplit:O.TableCellsSplit,Trash2:O.Trash2,Trash:O.Trash,Replace:O.Replace,ChevronsUpDown:O.ChevronsUpDown,LineHeight:jg,Word:Sg,Heading1:O.Heading1,Heading2:O.Heading2,Heading3:O.Heading3,Heading4:O.Heading4,Heading5:O.Heading5,Heading6:O.Heading6,Columns2:O.Columns2,Columns3:O.Columns3,Columns4:O.Columns4,Plus:O.Plus,Grip:O.GripVertical,Copy:O.Copy,Clipboard:O.Clipboard,PanelLeft:O.PanelLeft,PanelRight:O.PanelRight,Columns:O.Columns2,Iframe:O.Frame,MenuDown:ll,SizeS:Ig,SizeM:Cg,SizeL:Ag,AspectRatio:vg,Emoji:O.SmilePlus,DeleteColumn:bg,DeleteRow:wg,SearchAndReplace:O.Replace,EmojiIcon:O.SmilePlusIcon,KatexIcon:O.Sigma,ExportPdf:ul,ExportWord:dl,ImportWord:kg,ColumnAddLeft:Tg,ColumnAddRight:Pg,BookMarked:O.BookMarked,Excalidraw:Rg,ZoomIn:O.ZoomIn,ZoomOut:O.ZoomOut,Settings:O.Settings,Eye:O.Eye,TextDirection:Og,LeftToRight:Mg,RightToLeft:_g,Attachment:O.Paperclip,GifIcon:Eg,ChevronUp:O.ChevronUp,Crop:O.CropIcon,Mermaid:Ng,Twitter:$g,FlipX:O.FlipVertical,FlipY:O.FlipHorizontal,PencilRuler:O.PencilRuler,WrapText:O.WrapText};function Lg({fill:e}){return a.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("g",{id:"icon/填充色",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",children:a.jsxs("g",{id:"icon/背景颜色",children:[a.jsx("g",{id:"编组",fill:"currentColor",children:a.jsxs("g",{transform:"translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)",id:"矩形",children:[a.jsx("path",{d:"M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z",fillRule:"nonzero"}),a.jsx("path",{d:"M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z",fillRule:"evenodd"}),a.jsx("path",{d:"M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z",fillRule:"nonzero"})]})}),a.jsx("path",{d:"M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z",id:"矩形",fill:e||"#FBDE28"})]})})})}function fl(e){const[t,r]=b.useState(void 0);function n(s){var c;(c=e.action)==null||c.call(e,s)}function i(){var s;(s=e.action)==null||s.call(e,t)}const o=b.useCallback(Wt(s=>{r(s)},350),[]);return a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-h-[32px]",children:[a.jsx(F,{tooltip:e==null?void 0:e.tooltip,disabled:e==null?void 0:e.disabled,action:i,tooltipOptions:e==null?void 0:e.tooltipOptions,shortcutKeys:e==null?void 0:e.shortcutKeys,children:a.jsx("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-text-sm",children:a.jsx(Lg,{fill:t})})}),a.jsx(lu,{selectedColor:t,setSelectedColor:o,onChange:n,highlight:!0,disabled:e==null?void 0:e.disabled,children:a.jsx(ge,{variant:"ghost",size:"icon",className:"!richtext-w-3 !richtext-h-[32px]",disabled:e==null?void 0:e.disabled,children:a.jsx(me,{className:"!richtext-w-3 !richtext-h-3 richtext-text-zinc-500",name:"MenuDown"})})})]})}function Dg({editor:e,disabled:t,actions:r}){var y,S,j,w,A,R,M,N,T,C,$,P,E,L,k,Y,re,ue;const n=({editor:ne})=>H.isActive(ne.view.state,"table"),{t:i}=B.useLocale();function o(){e.chain().focus().addColumnBefore().run()}function s(){e.chain().focus().addColumnAfter().run()}function c(){e.chain().focus().deleteColumn().run()}function l(){e.chain().focus().addRowBefore().run()}function u(){e.chain().focus().addRowAfter().run()}function f(){e.chain().focus().deleteRow().run()}function d(){e.chain().focus().mergeCells().run()}function h(){e==null||e.chain().focus().splitCell().run()}function p(){e.chain().focus().deleteTable().run()}function m(ne){e.chain().focus().setTableCellBackground(ne).run()}const g=()=>{var Pe;const{view:ne,state:{selection:{from:Q}}}=e,xe=ne.domAtPos(Q).node;if(!xe)return new DOMRect(-1e3,-1e3,0,0);const fe=(Pe=xe==null?void 0:xe.closest)==null?void 0:Pe.call(xe,".tableWrapper");return fe?fe.getBoundingClientRect():new DOMRect(-1e3,-1e3,0,0)};return a.jsx(le.BubbleMenu,{editor:e,pluginKey:"table",shouldShow:n,updateDelay:0,tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},maxWidth:"auto",getReferenceClientRect:g,plugins:[xc.sticky],sticky:"popper"},children:t?a.jsx(a.Fragment,{}):a.jsxs("div",{className:"richtext-flex richtext-size-full richtext-min-w-32 richtext-flex-row richtext-items-center richtext-gap-0.5 richtext-rounded-lg !richtext-border richtext-border-border richtext-bg-background richtext-p-2 richtext-leading-none richtext-shadow-sm",children:[a.jsx(F,{action:o,disabled:!((S=(y=e==null?void 0:e.can())==null?void 0:y.addColumnBefore)!=null&&S.call(y)),icon:"BetweenHorizonalEnd",tooltip:i("editor.table.menu.insertColumnBefore"),"tooltip-options":{sideOffset:15}}),a.jsx(F,{action:s,disabled:!((w=(j=e==null?void 0:e.can())==null?void 0:j.addColumnAfter)!=null&&w.call(j)),icon:"BetweenHorizonalStart",tooltip:i("editor.table.menu.insertColumnAfter"),"tooltip-options":{sideOffset:15}}),a.jsx(F,{action:c,disabled:!((R=e==null?void 0:(A=e.can()).deleteColumn)!=null&&R.call(A)),icon:"DeleteColumn",tooltip:i("editor.table.menu.deleteColumn"),"tooltip-options":{sideOffset:15}}),a.jsx(Ee,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}),a.jsx(F,{action:l,disabled:!((N=e==null?void 0:(M=e.can()).addRowBefore)!=null&&N.call(M)),icon:"BetweenVerticalEnd",tooltip:i("editor.table.menu.insertRowAbove"),"tooltip-options":{sideOffset:15}}),a.jsx(F,{action:u,disabled:!((C=(T=e==null?void 0:e.can())==null?void 0:T.addRowAfter)!=null&&C.call(T)),icon:"BetweenVerticalStart",tooltip:i("editor.table.menu.insertRowBelow"),"tooltip-options":{sideOffset:15}}),a.jsx(F,{action:f,disabled:!((P=($=e==null?void 0:e.can())==null?void 0:$.deleteRow)!=null&&P.call($)),icon:"DeleteRow",tooltip:i("editor.table.menu.deleteRow"),"tooltip-options":{sideOffset:15}}),a.jsx(Ee,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}),a.jsx(F,{action:d,disabled:!((L=(E=e==null?void 0:e.can())==null?void 0:E.mergeCells)!=null&&L.call(E)),icon:"TableCellsMerge",tooltip:i("editor.table.menu.mergeCells"),"tooltip-options":{sideOffset:15}}),a.jsx(F,{action:h,disabled:!((Y=(k=e==null?void 0:e.can())==null?void 0:k.splitCell)!=null&&Y.call(k)),icon:"TableCellsSplit",tooltip:i("editor.table.menu.splitCells"),"tooltip-options":{sideOffset:15}}),a.jsx(Ee,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}),a.jsx(fl,{action:m,editor:e,tooltip:i("editor.table.menu.setCellsBgColor"),tooltipOptions:{sideOffset:15}}),a.jsx(F,{action:p,disabled:!((ue=(re=e==null?void 0:e.can())==null?void 0:re.deleteTable)!=null&&ue.call(re)),icon:"Trash2",tooltip:i("editor.table.menu.deleteTable"),"tooltip-options":{sideOffset:15}}),r&&r.map((ne,Q)=>a.jsx(F,{...ne},Q))]})})}function hl(e){const{t}=B.useLocale(),[r,n]=b.useState({text:"",link:""}),[i,o]=b.useState(!1);b.useEffect(()=>{var c;if(e!=null&&e.editor){const{href:l,target:u}=(c=e.editor)==null?void 0:c.getAttributes("link"),{from:f,to:d}=e.editor.state.selection,h=e.editor.state.doc.textBetween(f,d," ");n({link:l,text:h}),o(u==="_blank")}},[e==null?void 0:e.editor]);function s(c){c.preventDefault(),c.stopPropagation(),e==null||e.onSetLink(r.link,r.text,i)}return a.jsx("div",{className:"border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:a.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:s,children:[a.jsx(He,{className:"mb-[6px]",children:t("editor.link.dialog.text")}),a.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:a.jsx(je,{className:"richtext-w-80",onChange:c=>n({...r,text:c.target.value}),placeholder:"Text",required:!0,type:"text",value:r.text})})}),a.jsx(He,{className:"mb-[6px]",children:t("editor.link.dialog.link")}),a.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsxs("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:[a.jsx(je,{className:"richtext-pl-10",onChange:c=>n({...r,link:c.target.value}),required:!0,type:"url",value:r.link}),a.jsx("span",{className:"richtext-absolute richtext-inset-y-0 richtext-start-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2",children:a.jsx(me,{className:"richtext-size-5 richtext-text-muted-foreground",name:"Link"})})]})}),a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-space-x-2",children:[a.jsx(He,{children:t("editor.link.dialog.openInNewTab")}),a.jsx(xo,{checked:i,onCheckedChange:c=>{o(c)}})]}),a.jsx(ge,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:t("editor.link.dialog.button.apply")})]})})}function Bg(e){const{t}=B.useLocale();return a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black richtext-border-neutral-200 dark:richtext-border-neutral-800",children:[a.jsx("a",{href:e==null?void 0:e.link,target:"_blank",rel:"noopener noreferrer",className:"richtext-text-sm richtext-underline richtext-break-all",children:mm(e==null?void 0:e.link,{length:50,omission:"…"})}),(e==null?void 0:e.link)&&a.jsx(Ee,{orientation:"vertical",className:"!richtext-h-4"}),a.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[a.jsx(F,{icon:"Pencil",tooltip:t("editor.link.edit.tooltip"),action:()=>{e==null||e.onEdit()},tooltipOptions:{sideOffset:15}}),a.jsx(F,{icon:"Unlink",tooltip:t("editor.link.unlink.tooltip"),action:()=>{e==null||e.onClear()},tooltipOptions:{sideOffset:15}})]})]})}function qg({editor:e,disabled:t}){const[r,n]=b.useState(!1),i=b.useMemo(()=>{const{href:l}=e.getAttributes("link");return l},[e]),o=b.useCallback(({editor:l})=>l.isActive("link"),[]),s=(l,u,f)=>{e.chain().extendMarkRange("link").insertContent({type:"text",text:u,marks:[{type:"link",attrs:{href:l,target:f?"_blank":""}}]}).setLink({href:l}).focus().run(),n(!1)},c=b.useCallback(()=>{e.chain().extendMarkRange("link").unsetLink().focus().run(),n(!1)},[e]);return a.jsx(a.Fragment,{children:a.jsx(le.BubbleMenu,{editor:e,shouldShow:o,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{n(!1)}},children:t?a.jsx(a.Fragment,{}):a.jsx(a.Fragment,{children:r?a.jsx(hl,{onSetLink:s,editor:e}):a.jsx(Bg,{editor:e,onClear:c,onEdit:()=>{n(!0)},link:i})})})})}const zg=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,so=H.Node.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",H.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[H.nodeInputRule({find:zg,type:this.type,getAttributes:e=>{const[,,t,r,n]=e;return{src:r,alt:t,title:n}}})]}}),Vt=Ce.Root,Xt=Ce.Trigger,Fg=Ce.Portal,pl=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ce.Overlay,{ref:r,className:Z("richtext-fixed richtext-inset-0 richtext-z-50 richtext-bg-black/80 richtext- data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0",e),...t}));pl.displayName=Ce.Overlay.displayName;const jt=ee.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Fg,{children:[a.jsx(pl,{}),a.jsxs(Ce.Content,{ref:n,className:Z("richtext-dialog-content richtext-fixed richtext-left-[50%] richtext-top-[50%] richtext-z-50 richtext-grid richtext-w-full richtext-max-w-lg richtext-translate-x-[-50%] richtext-translate-y-[-50%] richtext-gap-4 richtext-border richtext-bg-background richtext-p-6 richtext-shadow-lg richtext-duration-200 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[state=closed]:richtext-slide-out-to-left-1/2 data-[state=closed]:richtext-slide-out-to-top-[48%] data-[state=open]:richtext-slide-in-from-left-1/2 data-[state=open]:richtext-slide-in-from-top-[48%] sm:richtext-rounded-lg",e),...r,children:[t,a.jsxs(Ce.Close,{className:"richtext-absolute richtext-right-4 richtext-top-4 richtext-rounded-sm richtext-opacity-70 richtext-ring-offset-background richtext-transition-opacity hover:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none data-[state=open]:richtext-bg-accent data-[state=open]:richtext-text-muted-foreground",children:[a.jsx(O.X,{className:"richtext-h-4 richtext-w-4"}),a.jsx("span",{className:"richtext-sr-only",children:"Close"})]})]})]}));jt.displayName=Ce.Content.displayName;function ml({className:e,...t}){return a.jsx("div",{className:Z("richtext-flex richtext-flex-col richtext-space-y-1.5 richtext-text-center sm:richtext-text-left",e),...t})}ml.displayName="DialogHeader";function wr({className:e,...t}){return a.jsx("div",{className:Z("richtext-flex richtext-flex-col-reverse sm:richtext-flex-row sm:richtext-justify-end sm:richtext-space-x-2",e),...t})}wr.displayName="DialogFooter";const At=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ce.Title,{ref:r,className:Z("richtext-text-lg richtext-font-semibold richtext-leading-none richtext-tracking-tight",e),...t}));At.displayName=Ce.Title.displayName;const Hg=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ce.Description,{ref:r,className:Z("richtext-text-sm richtext-text-muted-foreground",e),...t}));Hg.displayName=Ce.Description.displayName;const ba=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,wa=le.clsx,Sr=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return wa(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(u=>{const f=r==null?void 0:r[u],d=o==null?void 0:o[u];if(f===null)return null;const h=ba(f)||ba(d);return i[u][h]}),c=r&&Object.entries(r).reduce((u,f)=>{let[d,h]=f;return h===void 0||(u[d]=h),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:d,className:h,...p}=f;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...o,...c}[g]):{...o,...c}[g]===y})?[...u,d,h]:u},[]);return wa(e,s,l,r==null?void 0:r.class,r==null?void 0:r.className)},Ug=Sr("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50",{variants:{variant:{default:"!richtext-bg-primary !richtext-text-primary-foreground hover:!richtext-bg-primary/90",destructive:"richtext-bg-destructive richtext-text-destructive-foreground hover:richtext-bg-destructive/90",outline:"richtext-border richtext-border-input richtext-bg-background hover:richtext-bg-accent hover:richtext-text-accent-foreground",secondary:"richtext-bg-secondary richtext-text-secondary-foreground hover:richtext-bg-secondary/80",ghost:"hover:richtext-bg-accent hover:richtext-text-accent-foreground",link:"richtext-text-primary richtext-underline-offset-4 hover:richtext-underline"},size:{default:"richtext-h-10 richtext-px-4 richtext-py-2",sm:"richtext-h-9 richtext-rounded-md richtext-px-3",lg:"richtext-h-11 richtext-rounded-md richtext-px-8",icon:"richtext-h-10 richtext-w-10"}},defaultVariants:{variant:"default",size:"default"}}),ge=ee.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...i},o)=>{const s=n?gc.Slot:"button";return a.jsx(s,{className:Z(Ug({variant:t,size:r,className:e})),ref:o,...i})});ge.displayName="Button";function Gg(e){return e.replace(/^.*\/|\..+$/g,"")}function Wg(e){return e.split(".").pop()}function Vg(e){return e<1024?`${e} Byte`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function Xg(e){return e?e==="application/pdf"?"pdf":e.startsWith("application/")&&[".document","word"].some(t=>e.includes(t))?"word":e.startsWith("application/")&&["presentation"].some(t=>e.includes(t))?"excel":e.startsWith("application/")&&["sheet"].some(t=>e.includes(t))?"ppt":e.startsWith("image")?"image":e.startsWith("audio")?"audio":e.startsWith("video")?"video":"file":"file"}function Yg(e){return new Promise(t=>{const r=new FileReader;r.addEventListener("load",()=>{t({alt:e.name,src:r.result})},!1),r.readAsDataURL(e)})}function gl(e,t){const r=e.split(","),n=r[0].match(/:(.*?);/)[1],i=atob(r[r.length-1]);let o=i.length;const s=new Uint8Array(o);for(;o--;)s[o]=i.charCodeAt(o);return new File([s],t,{type:n})}function Kg({editor:e,imageInline:t,onClose:r}){const{t:n}=B.useLocale(),[i,o]=b.useState(!1),s=b.useRef(null),[c,l]=b.useState(),[u,f]=b.useState(""),d=b.useRef(null),[h,p]=b.useState({src:"",file:null});function m(w){if(s.current&&w.width&&w.height){const A=g(s.current,w);f(A)}}function g(w,A){const R=document.createElement("canvas"),M=w.naturalWidth/w.width,N=w.naturalHeight/w.height;R.width=A.width*M,R.height=A.height*N;const T=R.getContext("2d");return T&&(T.imageSmoothingEnabled=!1,T.drawImage(w,A.x*M,A.y*N,A.width*M,A.height*N,0,0,A.width*M,A.height*N)),R.toDataURL("image/png",1)}async function y(){var w,A;try{const R=gl(u,((w=h==null?void 0:h.file)==null?void 0:w.name)||"image.png"),M=(A=e.extensionManager.extensions.find(T=>T.name===wt.name))==null?void 0:A.options;let N="";M.upload?N=await M.upload(R):N=URL.createObjectURL(R),e.chain().focus().setImageInline({src:N,inline:t}).run(),o(!1),p({src:"",file:null}),r()}catch(R){console.log("Error cropping image",R)}}function S(w){var A;w.preventDefault(),(A=d.current)==null||A.click()}const j=async w=>{var N;const A=(N=w==null?void 0:w.target)==null?void 0:N.files;if(!e||e.isDestroyed||A.length===0)return;const R=A[0],M=await Yg(R);o(!0),p({src:M.src,file:R})};return a.jsxs(a.Fragment,{children:[a.jsx(ge,{className:"richtext-mt-1 richtext-w-full",onClick:S,size:"sm",children:n("editor.image.dialog.tab.uploadCrop")}),a.jsxs(Vt,{open:i,children:[a.jsx(Xt,{}),a.jsxs(jt,{children:[a.jsx(At,{children:n("editor.image.dialog.tab.uploadCrop")}),a.jsx("div",{children:h.src&&a.jsx(Pu,{className:"richtext-w-full",crop:c,onChange:w=>l(w),onComplete:w=>m(w),children:a.jsx("img",{alt:"Crop me",ref:s,src:h.src})})}),a.jsxs(wr,{children:[a.jsxs(ge,{onClick:()=>{o(!1),p({src:"",file:null})},children:[n("editor.imageUpload.cancel"),a.jsx(me,{className:"richtext-ml-[4px]",name:"Trash2"})]}),a.jsxs(ge,{className:"richtext-w-fit",onClick:y,children:[n("editor.imageUpload.crop"),a.jsx(me,{className:"richtext-ml-[4px]",name:"Crop"})]})]})]})]}),a.jsx("input",{accept:"image/*",multiple:!0,onChange:j,ref:d,type:"file",style:{display:"none"}})]})}function jr(e){function t(){const o=b.useRef(e),s=b.useCallback(()=>o.current,[]),c=b.useRef(new Set),l=b.useCallback(f=>{o.current={...o.current,...f},c.current.forEach(d=>d())},[]),u=b.useCallback(f=>(c.current.add(f),()=>c.current.delete(f)),[]);return{get:s,set:l,subscribe:u}}const r=b.createContext(null);function n({children:o}){return a.jsx(r.Provider,{value:t(),children:o})}function i(o){const s=b.useContext(r);if(!s)throw new Error("Store not found");return[b.useSyncExternalStore(s.subscribe,()=>o(s.get()),()=>o(e)),s.set]}return{Provider:n,useStore:i}}jr({value:!1});jr({value:!1});const{Provider:Zg,useStore:xl}=jr({value:!1}),{Provider:Jg,useStore:vl}=jr({value:"light"});B.d("0");function qt(e,t){return window.addEventListener(e,t),()=>{window.removeEventListener(e,t)}}function Ar(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}const nt={UPLOAD_IMAGE:e=>`UPLOAD_IMAGE-${e}`,UPLOAD_VIDEO:e=>`UPLOAD_VIDEO-${e}`,EDIT:e=>`EDIT-${e}`,UPDATE_THEME:e=>`UPDATE_THEME-${e}`,SEARCH_REPLCE:"SEARCH_REPLACE"},yl={setOpen:(e,t)=>{Ar(nt.UPLOAD_IMAGE(e),t)}};function Qg(e){var m;const{t}=B.useLocale(),[r,n]=b.useState(!1),i=g=>{n(g.detail)},[o,s]=b.useState(""),c=b.useRef(null),[l,u]=b.useState(((m=e.editor.extensionManager.extensions.find(g=>g.name===wt.name))==null?void 0:m.options.defaultInline)||!1),f=b.useMemo(()=>{var y;return(y=e.editor.extensionManager.extensions.find(S=>S.name===wt.name))==null?void 0:y.options},[e.editor]);b.useEffect(()=>{const g=qt(nt.UPLOAD_IMAGE(e.editor.id),i);return()=>{g()}},[]);async function d(g){var w;const y=(w=g==null?void 0:g.target)==null?void 0:w.files;if(!e.editor||e.editor.isDestroyed||y.length===0)return;const S=y[0];let j="";f.upload?j=await f.upload(S):j=URL.createObjectURL(S),e.editor.chain().focus().setImageInline({src:j,inline:l}).run(),n(!1),u(!1)}function h(g){g.preventDefault(),g.stopPropagation(),e.editor.chain().focus().setImageInline({src:o,inline:l}).run(),n(!1),u(!1),s("")}function p(g){var y;g.preventDefault(),(y=c.current)==null||y.click()}return a.jsxs(Vt,{onOpenChange:n,open:r,children:[a.jsx(Xt,{asChild:!0,children:a.jsx(F,{action:()=>n(!0),icon:e.icon,tooltip:e.tooltip})}),a.jsxs(jt,{children:[a.jsx(At,{children:t("editor.image.dialog.title")}),a.jsxs(Il,{activationMode:"manual",defaultValue:f.resourceImage==="both"||f.resourceImage==="upload"?"upload":"link",children:[a.jsxs(vo,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[f.resourceImage==="both"||f.resourceImage==="upload"?a.jsx(Ft,{value:"upload",children:t("editor.image.dialog.tab.upload")}):a.jsx(a.Fragment,{}),f.resourceImage==="both"||f.resourceImage==="link"?a.jsx(Ft,{value:"link",children:t("editor.image.dialog.tab.url")}):a.jsx(a.Fragment,{})]}),a.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[a.jsx(Nl,{checked:l,onCheckedChange:g=>{u(g)}}),a.jsx(He,{children:t("editor.link.dialog.inline")})]}),a.jsxs(Ht,{value:"upload",children:[a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[a.jsx(ge,{className:"richtext-mt-1 richtext-w-full",onClick:p,size:"sm",children:t("editor.image.dialog.tab.upload")}),a.jsx(Kg,{editor:e.editor,imageInline:l,onClose:()=>yl.setOpen(e.editor.id,!1)})]}),a.jsx("input",{accept:"image/*",multiple:!0,onChange:d,ref:c,type:"file",style:{display:"none"}})]}),a.jsx(Ht,{value:"link",children:a.jsx("form",{onSubmit:h,children:a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[a.jsx(je,{autoFocus:!0,onChange:g=>s(g.target.value),placeholder:t("editor.image.dialog.placeholder"),required:!0,type:"url",value:o}),a.jsx(ge,{type:"submit",children:t("editor.image.dialog.button.apply")})]})})})]})]})]})}const ar={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function ex(e){var N,T;const[t,r]=b.useState({width:B.IMAGE_MAX_SIZE,height:B.IMAGE_MAX_SIZE}),[n,i]=b.useState({width:0,height:0}),[o]=b.useState([ar.TOP_LEFT,ar.TOP_RIGHT,ar.BOTTOM_LEFT,ar.BOTTOM_RIGHT]),[s,c]=b.useState(!1),[l,u]=b.useState({x:0,y:0,w:0,h:0,dir:""}),{align:f,inline:d}=(N=e==null?void 0:e.node)==null?void 0:N.attrs,h=b.useMemo(()=>{var Q;const{src:C,alt:$,width:P,height:E,flipX:L,flipY:k}=(Q=e==null?void 0:e.node)==null?void 0:Q.attrs,Y=mr(P)?`${P}px`:P,re=mr(E)?`${E}px`:E,ue=[];L&&ue.push("rotateX(180deg)"),k&&ue.push("rotateY(180deg)");const ne=ue.join(" ");return{src:C||void 0,alt:$||void 0,style:{width:Y||void 0,height:re||void 0,transform:ne||"none"}}},[(T=e==null?void 0:e.node)==null?void 0:T.attrs]),p=b.useMemo(()=>{const{style:{width:C}}=h;return{width:C==="100%"?C:void 0}},[h]);function m(C){i({width:C.target.width,height:C.target.height})}function g(){const{editor:C,getPos:$}=e;C.commands.setNodeSelection($())}const y=b.useCallback(bt(()=>{const{editor:C}=e,{width:$}=getComputedStyle(C.view.dom);r(P=>({...P,width:Number.parseInt($,10)}))},B.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function S(C,$){C.preventDefault(),C.stopPropagation();const P=n.width,E=n.height,L=P/E;let k=Number(e.node.attrs.width),Y=Number(e.node.attrs.height);const re=t.width;k&&!Y?(k=k>re?re:k,Y=Math.round(k/L)):Y&&!k?(k=Math.round(Y*L),k=k>re?re:k):!k&&!Y?(k=P>re?re:P,Y=Math.round(k/L)):k=k>re?re:k,c(!0),u({x:C.clientX,y:C.clientY,w:k,h:Y,dir:$})}const j=b.useCallback(bt(C=>{if(C.preventDefault(),C.stopPropagation(),!s)return;const{x:$,w:P,dir:E}=l,L=(C.clientX-$)*(/l/.test(E)?-1:1),k=Fc(P+L,B.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:k,height:null})},B.IMAGE_THROTTLE_WAIT_TIME),[s,l,t,e.updateAttributes]),w=b.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s&&(u({x:0,y:0,w:0,h:0,dir:""}),c(!1),g())},[s,g]),A=b.useCallback(()=>{document==null||document.addEventListener("mousemove",j,!0),document==null||document.addEventListener("mouseup",w,!0)},[j,w]),R=b.useCallback(()=>{document==null||document.removeEventListener("mousemove",j,!0),document==null||document.removeEventListener("mouseup",w,!0)},[j,w]);b.useEffect(()=>(s?A():R(),()=>{R()}),[s,A,R]);const M=b.useMemo(()=>new ResizeObserver(()=>y()),[y]);return b.useEffect(()=>(M.observe(e.editor.view.dom),()=>{M.disconnect()}),[e.editor.view.dom,M]),a.jsx(le.NodeViewWrapper,{as:d?"span":"div",className:"image-view",style:{...p,textAlign:f,display:d?"inline":"block"},children:a.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:p,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,children:[a.jsx("img",{alt:h.alt,className:"image-view__body__image block",height:"auto",onClick:g,onLoad:m,src:h.src,style:h.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&a.jsx("div",{className:"image-resizer",children:o==null?void 0:o.map(C=>a.jsx("span",{className:`image-resizer__handler image-resizer__handler--${C}`,onMouseDown:$=>S($,C)},`image-dir-${C}`))})]})})}const yt=new H.PluginKey("upload-image");function tx(){return new H.Plugin({key:yt,state:{init(){return H.DecorationSet.empty},apply(e,t){t=t.map(e.mapping,e.doc);const r=e.getMeta(yt);if(r!=null&&r.add)for(const{id:n,pos:i,src:o}of r.add){const s=rx(o),c=H.Decoration.widget(i,s,{id:n});t=t.add(e.doc,[c])}else if(r!=null&&r.remove)for(const n of r.remove)t=t.remove(t.find(void 0,void 0,i=>i.id===n));return t}},props:{decorations(e){return this.getState(e)}}})}function rx(e){const t=document.createElement("div"),r=document.createElement("img");return r.setAttribute("class","opacity-50"),r.src=e,r.addEventListener("load",()=>{t.setAttribute("class","img-placeholder")}),t.append(r),t}function nx(e,t){var i;const n=yt.getState(e).find(void 0,void 0,o=>o.id===t);return n.length>0?(i=n[0])==null?void 0:i.from:null}function ix({validateFn:e,onUpload:t,postUpload:r,defaultInline:n=!1}){return(i,o,s)=>{for(const c of i){if(e&&!e(c))continue;const l=Date.now().toString(),u=o.state.tr;u.selection.empty||u.deleteSelection();const f=URL.createObjectURL(c);u.setMeta(yt,{add:[{id:l,pos:s,src:f}]}),o.dispatch(u),t(c).then(async d=>{var j;r&&typeof d=="string"&&(d=await r(d));const{schema:h}=o.state;let p=nx(o.state,l);if(p===null)return;const m=typeof d=="object"?f:d,g=(j=h.nodes.image)==null?void 0:j.create({src:m,inline:n});if(!g)return;const{doc:y}=o.state;p>y.content.size&&(p=y.content.size-1);const S=o.state.tr.replaceWith(p,p,g).setMeta(yt,{remove:[l]});o.dispatch(S)},()=>{const d=o.state.tr.delete(s,s).setMeta(yt,{remove:[l]});o.dispatch(d)})}}}function ox(e,t,r){var i;const n=[...((i=t.clipboardData)==null?void 0:i.files)||[]];if(n.length>0){t.preventDefault();const o=e.state.selection.from;return r(n,e,o+1),!0}return!1}function ax(e,t,r,n){var o;const i=[...((o=t.dataTransfer)==null?void 0:o.files)||[]];if(!r&&i.length>0){t.preventDefault();const s=e.posAtCoords({left:t.clientX,top:t.clientY});if(s)return n(i,e,s.pos+1),!0}return!1}const sx={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5,resourceImage:"both",defaultInline:!1},wt=so.extend({group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){var e;return{...sx,...(e=this.parent)==null?void 0:e.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:t,extension:r,t:n})=>{var i,o;return{component:Qg,componentProps:{action:()=>!0,upload:r.options.upload,disabled:!((o=(i=t.can()).setImage)!=null&&o.call(i,{})),icon:"ImageUp",tooltip:n("editor.image.tooltip"),editor:t}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),flipX:{default:!1},flipY:{default:!1},width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||null;return r?Number.parseInt(r,10):null},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})},inline:{default:!1,parseHTML:t=>!!t.getAttribute("inline"),renderHTML:t=>({inline:t.inline})}}},addNodeView(){return le.ReactNodeViewRenderer(ex)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageInline:t=>({commands:r})=>r.insertContent({type:this.name,attrs:{...t,inline:t.inline??this.options.defaultInline}}),updateImage:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImage:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{flipX:t,flipY:r,align:n,inline:i}=e,o=t||r?`transform: rotateX(${t?"180":"0"}deg) rotateY(${r?"180":"0"}deg);`:"",s=n?`text-align: ${n};`:"";return[i?"span":"div",{style:s,class:"image"},["img",H.mergeAttributes({height:"auto",style:o},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"span.image img",getAttrs:e=>{var o;const t=e==null?void 0:e.parentElement,r=e==null?void 0:e.getAttribute("width"),n=(e==null?void 0:e.getAttribute("flipx"))||!1,i=(e==null?void 0:e.getAttribute("flipy"))||!1;return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),caption:e==null?void 0:e.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(e==null?void 0:e.getAttribute("align"))||((o=t==null?void 0:t.style)==null?void 0:o.textAlign)||null,inline:(e==null?void 0:e.getAttribute("inline"))||!1,flipX:n==="true",flipY:i==="true"}}},{tag:"div[class=image]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width"),n=(t==null?void 0:t.getAttribute("flipx"))||!1,i=(t==null?void 0:t.getAttribute("flipy"))||!1;return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),caption:t==null?void 0:t.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null,inline:(t==null?void 0:t.getAttribute("inline"))||!1,flipX:n==="true",flipY:i==="true"}}}]},addProseMirrorPlugins(){const t=ix({validateFn:r=>!(!this.options.acceptMimes.includes(r.type)||r.size>this.options.maxSize),onUpload:this.options.upload,defaultInline:this.options.defaultInline});return[new H.Plugin({props:{handlePaste:(r,n)=>!n.clipboardData||[...n.clipboardData.files||[]].some(o=>o.type==="text/html")?!1:ox(r,n,t),handleDrop:(r,n,i,o)=>(!(n instanceof DragEvent)||!n.dataTransfer||ax(r,n,o,t),!1)}}),tx()]}});function cx({selectImage:e,giphyApiKey:t,children:r}){const[n,i]=b.useState([]),[o]=b.useState(15),s=b.useRef(null),c=(u,f="search")=>{if(!t)return;const h=`${f==="search"?`https://api.giphy.com/v1/gifs/search?q=${u}`:`https://api.giphy.com/v1/gifs/trending?q=${u}`}&limit=${o}&api_key=${t}`;fetch(h).then(p=>p.json()).then(p=>{i(p.data)}).catch(p=>{console.log(p)})};b.useEffect(()=>{c("","trend")},[]);const l=b.useCallback(Wt(u=>{if(!u.target.value){c("","trend");return}c(u.target.value)},350),[]);return a.jsxs(Yt,{modal:!0,children:[a.jsx(Kt,{asChild:!0,children:r}),a.jsx(Ct,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:t?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"richtext-mb-[10px] richtext-w-full",children:a.jsx(je,{onChange:l,placeholder:"Search GIF",ref:s,type:"text"})}),a.jsx("div",{className:"richtext-max-h-[280px] richtext-overflow-y-auto",children:a.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1 ",children:n!=null&&n.length?n==null?void 0:n.map(u=>a.jsx("img",{alt:"giphy",className:"richtext-cursor-pointer richtext-text-center",height:u.images.fixed_width_downsampled.height,onClick:()=>e(u),src:u.images.fixed_width_downsampled.url,width:u.images.fixed_width_downsampled.width},`giphy-${u.id}`)):a.jsx("p",{children:"No GIFs found"})})})]}):a.jsx("div",{children:a.jsx("p",{children:"Missing Giphy API Key"})})})]})}function lx({editor:e,icon:t,giphyApiKey:r,...n}){const i=o=>{const{url:s}=o.images.original;e.chain().focus().setImageGif({src:s}).run()};return a.jsx(cx,{giphyApiKey:r,selectImage:i,children:a.jsx(F,{icon:t,tooltip:n==null?void 0:n.tooltip})})}const sr={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function ux(e){var M,N;const[t,r]=b.useState({width:B.IMAGE_MAX_SIZE,height:B.IMAGE_MAX_SIZE}),[n,i]=b.useState({width:0,height:0}),[o]=b.useState([sr.TOP_LEFT,sr.TOP_RIGHT,sr.BOTTOM_LEFT,sr.BOTTOM_RIGHT]),[s,c]=b.useState(!1),[l,u]=b.useState({x:0,y:0,w:0,h:0,dir:""}),{align:f}=(M=e==null?void 0:e.node)==null?void 0:M.attrs,d=b.useMemo(()=>{var k;const{src:T,alt:C,width:$,height:P}=(k=e==null?void 0:e.node)==null?void 0:k.attrs,E=mr($)?`${$}px`:$,L=mr(P)?`${P}px`:P;return{src:T||void 0,alt:C||void 0,style:{width:E||void 0,height:L||void 0}}},[(N=e==null?void 0:e.node)==null?void 0:N.attrs]),h=b.useMemo(()=>{const{style:{width:T}}=d;return{width:T==="100%"?T:void 0}},[d]);function p(T){i({width:T.target.width,height:T.target.height})}function m(){const{editor:T,getPos:C}=e;T.commands.setNodeSelection(C())}const g=b.useCallback(bt(()=>{const{editor:T}=e,{width:C}=getComputedStyle(T.view.dom);r($=>({...$,width:Number.parseInt(C,10)}))},B.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function y(T,C){T.preventDefault(),T.stopPropagation();const $=n.width,P=n.height,E=$/P;let L=Number(e.node.attrs.width),k=Number(e.node.attrs.height);const Y=t.width;L&&!k?(L=L>Y?Y:L,k=Math.round(L/E)):k&&!L?(L=Math.round(k*E),L=L>Y?Y:L):!L&&!k?(L=$>Y?Y:$,k=Math.round(L/E)):L=L>Y?Y:L,c(!0),u({x:T.clientX,y:T.clientY,w:L,h:k,dir:C})}const S=b.useCallback(bt(T=>{if(T.preventDefault(),T.stopPropagation(),!s)return;const{x:C,w:$,dir:P}=l,E=(T.clientX-C)*(/l/.test(P)?-1:1),L=Fc($+E,B.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:L,height:null})},B.IMAGE_THROTTLE_WAIT_TIME),[s,l,t,e.updateAttributes]),j=b.useCallback(T=>{T.preventDefault(),T.stopPropagation(),s&&(u({x:0,y:0,w:0,h:0,dir:""}),c(!1),m())},[s,m]),w=b.useCallback(()=>{document==null||document.addEventListener("mousemove",S,!0),document==null||document.addEventListener("mouseup",j,!0)},[S,j]),A=b.useCallback(()=>{document==null||document.removeEventListener("mousemove",S,!0),document==null||document.removeEventListener("mouseup",j,!0)},[S,j]);b.useEffect(()=>(s?w():A(),()=>{A()}),[s,w,A]);const R=b.useMemo(()=>new ResizeObserver(()=>g()),[g]);return b.useEffect(()=>(R.observe(e.editor.view.dom),()=>{R.disconnect()}),[e.editor.view.dom,R]),a.jsx(le.NodeViewWrapper,{className:"image-view",style:{...h,width:"100%",textAlign:f},children:a.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:h,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,children:[a.jsx("img",{alt:d.alt,className:"image-view__body__image block",height:"auto",onClick:m,onLoad:p,src:d.src,style:d.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&a.jsx("div",{className:"image-resizer",children:o==null?void 0:o.map(T=>a.jsx("span",{className:`image-resizer__handler image-resizer__handler--${T}`,onMouseDown:C=>y(C,T)},`image-dir-${T}`))})]})})}const co=so.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",GIPHY_API_KEY:"",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:r,t:n})=>{var o;const i=((o=r==null?void 0:r.options)==null?void 0:o.GIPHY_API_KEY)||"";return{component:lx,componentProps:{editor:t,action:()=>{},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:n("editor.imageGif.tooltip"),giphyApiKey:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return le.ReactNodeViewRenderer(ux)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:r})=>r.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",H.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});function dx(e){return/\.(?:mp4|webm|ogg|mov)$/i.test(e)}function fx(e){const{t}=B.useLocale(),[r,n]=b.useState(""),i=b.useRef(null),[o,s]=b.useState(""),[c,l]=b.useState(!1),u=m=>{l(m.detail)};b.useEffect(()=>{const m=qt(nt.UPLOAD_VIDEO(e.editor.id),u);return()=>{m()}},[]);const f=b.useMemo(()=>{var g;return(g=e.editor.extensionManager.extensions.find(y=>y.name===lo.name))==null?void 0:g.options},[e.editor]);async function d(m){var j;const g=(j=m==null?void 0:m.target)==null?void 0:j.files;if(!e.editor||e.editor.isDestroyed||g.length===0)return;const y=g[0];let S="";f.upload?S=await f.upload(y):S=URL.createObjectURL(y),e.editor.chain().focus().setVideo({src:S,width:"100%"}).run(),l(!1)}function h(m){m.preventDefault(),m.stopPropagation(),r&&(e.editor.chain().focus().setVideo({src:r,width:"100%"}).run(),l(!1))}function p(m){var g;m.preventDefault(),(g=i.current)==null||g.click()}return a.jsxs(Vt,{onOpenChange:l,open:c,children:[a.jsx(Xt,{asChild:!0,children:a.jsx(F,{action:()=>l(!0),icon:e.icon,tooltip:e.tooltip})}),a.jsxs(jt,{children:[a.jsx(At,{children:t("editor.video.dialog.title")}),a.jsxs(Il,{activationMode:"manual",defaultValue:(f==null?void 0:f.resourceVideo)==="both"||(f==null?void 0:f.resourceVideo)==="upload"?"upload":"link",children:[a.jsxs(vo,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((f==null?void 0:f.resourceVideo)==="both"||(f==null?void 0:f.resourceVideo)==="upload")&&a.jsx(Ft,{value:"upload",children:t("editor.video.dialog.tab.upload")}),((f==null?void 0:f.resourceVideo)==="both"||(f==null?void 0:f.resourceVideo)==="link")&&a.jsx(Ft,{value:"link",children:t("editor.video.dialog.link")})]}),a.jsxs(Ht,{value:"upload",children:[a.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:a.jsx(ge,{className:"richtext-mt-1 richtext-w-full",onClick:p,size:"sm",children:t("editor.video.dialog.tab.upload")})}),a.jsx("input",{accept:"video/*",multiple:!0,onChange:d,ref:i,type:"file",style:{display:"none"}})]}),a.jsxs(Ht,{value:"link",children:[a.jsx("form",{onSubmit:h,children:a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[a.jsx(je,{autoFocus:!0,placeholder:t("editor.video.dialog.placeholder"),required:!0,type:"url",value:r,onChange:m=>{const g=m.target.value;if(!dx(g)){s("Invalid video URL"),n("");return}s(""),n(g)}}),a.jsx(ge,{type:"submit",children:t("editor.video.dialog.button.apply")})]})}),o&&a.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:o})]})]})]})]})}function hx(e,t,r){return e<t?t:e>r?r:e}const px=e=>typeof e=="number",mx=e=>typeof e=="string",gx=e=>typeof e=="function";function xx(e,t="px"){if(!e)return e;const r=px(e)?String(e):e,n=Number.parseFloat(r),i=r.match(/[%a-z]+$/i),o=i?i[0]:t;return Number.isNaN(n)?e:n+o}function bl(e,t){if(!e)return!1;const{extensions:r=[]}=(e==null?void 0:e.extensionManager)??{};return!!r.find(i=>i.name===t)}function vx(e){return e.map(t=>mx(t)?{value:t,name:t}:t)}function yx(e){return e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/"),e=e.replace("https://vimeo.com/","https://player.vimeo.com/video/"),/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const lo=H.Node.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:B.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper",style:"display: flex;justify-content: center;"},button:({editor:e,t})=>{var r,n;return{component:fx,componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((n=(r=e.can()).setVideo)!=null&&n.call(r,{})),icon:"Video",tooltip:t("editor.video.tooltip"),editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?yx(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:xx(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%"}=e??{},r={...e,width:"100%",height:"100%"},n=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,i=`flex: 1;padding-bottom: ${9/16*100}%;`,c=["div",{style:n},["div",{style:i}],["iframe",r]];return["div",{...this.options.HTMLAttributes,"data-video":""},c]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}}),uo={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function fo({item:e,disabled:t,editor:r}){var i;const n=e.component;return n?a.jsx(b.Fragment,{children:e.type==="divider"?a.jsx(Ee,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):a.jsx(n,{...e.componentProps,disabled:t||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:r})}):a.jsx(a.Fragment,{})}function bx(e){return e.type.name===wt.name}function wx(e){return e.type.name===co.name}function Sx(e){return e.type.name===lo.name}function jx(e){const{lang:t}=B.useLocale(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:s,to:c}=o;let l=!1;return i.view.state.doc.nodesBetween(s.pos,c,u=>{if(bx(u))return l=!0,!1}),l},n=b.useMemo(()=>e.disabled?[]:tg(e.editor),[e.disabled,e.editor,t]);return a.jsx(a.Fragment,{children:a.jsx(le.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:r,tippyOptions:uo,children:n!=null&&n.length?a.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:a.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:n==null?void 0:n.map((i,o)=>a.jsx(fo,{disabled:e.disabled,editor:e.editor,item:i},`bubbleMenu-image-${o}`))})}):a.jsx(a.Fragment,{})})})}function Ax(e){const{lang:t}=B.useLocale(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:s,to:c}=o;let l=!1;return i.view.state.doc.nodesBetween(s.pos,c,u=>{if(wx(u))return l=!0,!1}),l},n=b.useMemo(()=>e.disabled?[]:rg(e.editor),[e.disabled,e.editor,t]);return a.jsx(a.Fragment,{children:a.jsx(le.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:r,tippyOptions:uo,children:n!=null&&n.length?a.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:a.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:n==null?void 0:n.map((i,o)=>a.jsx(fo,{disabled:e.disabled,editor:e.editor,item:i},`bubbleMenu-image-gif-${o}`))})}):a.jsx(a.Fragment,{})})})}function Cx(e){const{lang:t}=B.useLocale(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:s,to:c}=o;let l=!1;return i.view.state.doc.nodesBetween(s.pos,c,u=>{if(Sx(u))return l=!0,!1}),l},n=b.useMemo(()=>e.disabled?[]:og(e.editor),[e.editor,e.disabled,t]);return a.jsx(a.Fragment,{children:a.jsx(le.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:r,tippyOptions:uo,children:n!=null&&n.length?a.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:a.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:n==null?void 0:n.map((i,o)=>a.jsx(fo,{disabled:e.disabled,editor:e.editor,item:i},`bubbleMenu-video-${o}`))})}):a.jsx(a.Fragment,{})})})}function Ix(e,t,r=null){return r?e.createChecked({index:t},r):e.createAndFill({index:t})}function Tx(e){if(e.cached.columnsNodeTypes)return e.cached.columnsNodeTypes;const t={columns:e.nodes.columns,column:e.nodes.column};return e.cached.columnsNodeTypes=t,t}function Px(e,t,r=null){const n=Tx(e),i=[];for(let o=0;o<t;o+=1){const s=Ix(n.column,o,r);s&&i.push(s)}return n.columns.createChecked({cols:t},i)}function Wr({state:e,dispatch:t,type:r}){const n=H.findParentNode(o=>o.type.name===zt.name)(e.selection),i=H.findParentNode(o=>o.type.name===ho.name)(e.selection);if(t&&n&&i){const o=n.node,s=i.node.attrs.index,c=o.toJSON();let l=s;r==="delete"?(l=s-1,c.content.splice(s,1)):(l=r==="addBefore"?s:s+1,c.content.splice(l,0,{type:"column",attrs:{index:s},content:[{type:"paragraph"}]})),c.attrs.cols=c.content.length,c.content.forEach((h,p)=>{h.attrs.index=p});const u=H.Node$1.fromJSON(e.schema,c);let f=n.pos;u.content.forEach((h,p,m)=>{m<l&&(f+=h.nodeSize)});const d=e.tr.setTime(Date.now());d.replaceWith(n.pos,n.pos+n.node.nodeSize,u).setSelection(H.TextSelection.near(d.doc.resolve(f))),t(d)}return!0}function Sa({state:e,dispatch:t,type:r}){const n=H.findParentNode(o=>o.type.name===zt.name)(e.selection),i=H.findParentNode(o=>o.type.name===ho.name)(e.selection);if(t&&n&&i){const o=n.node,s=i.node.attrs.index;let c=0;r==="before"?c=(s-1+o.attrs.cols)%o.attrs.cols:c=(s+1)%o.attrs.cols;let l=n.pos;o.content.forEach((f,d,h)=>{h<c&&(l+=f.nodeSize)});const u=e.tr.setTime(Date.now());return u.setSelection(H.TextSelection.near(u.doc.resolve(l))),t(u),!0}return!1}const ho=H.Node.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:e=>e.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:e}){return["div",H.mergeAttributes(this.options.HTMLAttributes,e),0]}}),Ox=H.Extension.create({name:"columnActionButton",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r})=>({component:F,componentProps:{action:()=>{t.chain().focus().insertColumns({cols:2}).run()},icon:"Columns",tooltip:r("editor.columns.tooltip")}})}}}),wl=200,zt=H.Node.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:wl,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:e=>e.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:e}){return["div",H.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:r,editor:n})=>{const i=Px(n.schema,e&&e.cols||3);if(r){const o=t.selection.anchor+1;t.replaceSelectionWith(i).scrollIntoView().setSelection(H.TextSelection.near(t.doc.resolve(o)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>Wr({dispatch:e,state:t,type:"addBefore"}),addColAfter:()=>({dispatch:e,state:t})=>Wr({dispatch:e,state:t,type:"addAfter"}),deleteCol:()=>({dispatch:e,state:t})=>Wr({dispatch:e,state:t,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>Sa({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>Sa({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}});function po(e,t){const{state:r}=t,n=r.selection.$anchor;let i=!1;if(n.depth)for(let o=n.depth;o>0;o--)n.node(o).type.name===e&&(t.dispatchTransaction&&t.dispatchTransaction(r.tr.delete(n.before(o),n.after(o)).scrollIntoView()),i=!0);else{const o=r.selection.node;o&&o.type.name===e&&(t.chain().deleteSelection().run(),i=!0)}if(!i){const o=n.pos;if(o){const s=r.tr.doc.nodeAt(o);s&&s.type.name===e&&(t.dispatchTransaction&&t.dispatchTransaction(r.tr.delete(o,o+s.nodeSize)),i=!0)}}return i}function Rx({editor:e}){const{t}=B.useLocale(),r=b.useCallback(()=>e.isActive(zt.name),[e]),n=b.useCallback(()=>po(zt.name,e),[e]),i=b.useCallback(()=>e.chain().focus().addColBefore().run(),[e]),o=b.useCallback(()=>e.chain().focus().addColAfter().run(),[e]),s=b.useCallback(()=>e.chain().focus().deleteCol().run(),[e]);return a.jsx(le.BubbleMenu,{editor:e,pluginKey:"columns-bubble-menu",shouldShow:r,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:a.jsxs("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:[a.jsx(F,{action:i,icon:"ColumnAddLeft",tooltip:t("editor.table.menu.insertColumnBefore")}),a.jsx(F,{action:o,icon:"ColumnAddRight",tooltip:t("editor.table.menu.insertColumnAfter")}),a.jsx(F,{action:s,icon:"DeleteColumn",tooltip:t("editor.table.menu.deleteColumn")}),a.jsx(F,{action:n,icon:"Trash2",tooltip:t("editor.table.menu.delete_column")})]})})}const Sl=ce.Root,jl=ce.Trigger,ja=ce.Portal,Aa=ce.Sub,Wi=ee.forwardRef(({className:e,inset:t,children:r,...n},i)=>a.jsxs(ce.SubTrigger,{ref:i,className:Z("richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none focus:richtext-bg-accent data-[state=open]:richtext-bg-accent",t&&"richtext-pl-8",e),...n,children:[r,a.jsx(O.ChevronRight,{className:"richtext-ml-auto richtext-h-4 richtext-w-4"})]}));Wi.displayName=ce.SubTrigger.displayName;const Vi=ee.forwardRef(({className:e,...t},r)=>a.jsx(ce.SubContent,{ref:r,className:Z("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-lg data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...t}));Vi.displayName=ce.SubContent.displayName;const mo=ee.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(ce.Portal,{children:a.jsx(ce.Content,{ref:n,sideOffset:t,className:Z("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...r})}));mo.displayName=ce.Content.displayName;const Me=ee.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(ce.Item,{ref:n,className:Z("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",t&&"richtext-pl-8",e),...r}));Me.displayName=ce.Item.displayName;const Al=ee.forwardRef(({className:e,children:t,checked:r,...n},i)=>a.jsxs(ce.CheckboxItem,{ref:i,className:Z("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),checked:r,...n,children:[a.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:a.jsx(ce.ItemIndicator,{children:a.jsx(O.Check,{className:"richtext-h-4 richtext-w-4"})})}),t]}));Al.displayName=ce.CheckboxItem.displayName;const Ex=ee.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(ce.RadioItem,{ref:n,className:Z("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),...r,children:[a.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:a.jsx(ce.ItemIndicator,{children:a.jsx(O.Circle,{className:"richtext-h-2 richtext-w-2 richtext-fill-current"})})}),t]}));Ex.displayName=ce.RadioItem.displayName;const Mx=ee.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(ce.Label,{ref:n,className:Z("richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-font-semibold",t&&"richtext-pl-8",e),...r}));Mx.displayName=ce.Label.displayName;const go=ee.forwardRef(({className:e,...t},r)=>a.jsx(ce.Separator,{ref:r,className:Z("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",e),...t}));go.displayName=ce.Separator.displayName;function Cl({className:e,...t}){return a.jsx("span",{className:Z("richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",e),...t})}Cl.displayName="DropdownMenuShortcut";const je=ee.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:Z("richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",e),ref:n,...r}));je.displayName="Input";const Nx=Sr("richtext-text-sm richtext-font-medium richtext-leading-none peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"),He=ee.forwardRef(({className:e,...t},r)=>a.jsx(bc.Root,{ref:r,className:Z(Nx(),e),...t}));He.displayName=bc.Root.displayName;const Yt=kt.Root,Kt=kt.Trigger,Ct=ee.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},i)=>a.jsx(kt.Portal,{children:a.jsx(kt.Content,{ref:i,align:t,sideOffset:r,className:Z("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...n})}));Ct.displayName=kt.Content.displayName;const Ee=ee.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},i)=>a.jsx(vc.Root,{ref:i,decorative:r,orientation:t,className:Z("richtext-shrink-0 richtext-bg-border",t==="horizontal"?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",e),...n}));Ee.displayName=vc.Root.displayName;const xo=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ni.Root,{className:Z("richtext-peer richtext-inline-flex richtext-h-6 richtext-w-11 richtext-shrink-0 richtext-cursor-pointer richtext-items-center richtext-rounded-full richtext-border-2 richtext-border-transparent richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 focus-visible:richtext-ring-offset-background disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 data-[state=checked]:richtext-bg-primary data-[state=unchecked]:richtext-bg-input",e),...t,ref:r,children:a.jsx(Ni.Thumb,{className:Z("richtext-pointer-events-none richtext-block richtext-h-5 richtext-w-5 richtext-rounded-full richtext-bg-background richtext-shadow-lg richtext-ring-0 richtext-transition-transform data-[state=checked]:richtext-translate-x-5 data-[state=unchecked]:richtext-translate-x-0")})}));xo.displayName=Ni.Root.displayName;const Il=ct.Root,vo=ee.forwardRef(({className:e,...t},r)=>a.jsx(ct.List,{ref:r,className:Z("richtext-inline-flex richtext-h-10 richtext-items-center richtext-justify-center richtext-rounded-md richtext-bg-muted richtext-p-1 richtext-text-muted-foreground",e),...t}));vo.displayName=ct.List.displayName;const Ft=ee.forwardRef(({className:e,...t},r)=>a.jsx(ct.Trigger,{ref:r,className:Z("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-sm richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-all focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=active]:richtext-bg-background data-[state=active]:richtext-text-foreground data-[state=active]:richtext-shadow-sm",e),...t}));Ft.displayName=ct.Trigger.displayName;const Ht=ee.forwardRef(({className:e,...t},r)=>a.jsx(ct.Content,{ref:r,className:Z("richtext-mt-2 richtext-ring-offset-background focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2",e),...t}));Ht.displayName=ct.Content.displayName;const _x=Ae.Provider,Tl=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ae.Viewport,{ref:r,className:Z("richtext-fixed richtext-top-0 richtext-z-[100] richtext-flex richtext-max-h-screen richtext-w-full richtext-flex-col-reverse richtext-p-4 sm:richtext-bottom-0 sm:richtext-right-0 sm:richtext-top-auto sm:richtext-flex-col md:richtext-max-w-[420px]",e),...t}));Tl.displayName=Ae.Viewport.displayName;const $x=Sr("richtext-group richtext-pointer-events-auto richtext-relative richtext-flex richtext-w-full richtext-items-center richtext-justify-between richtext-space-x-4 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-p-6 richtext-pr-8 richtext-shadow-lg richtext-transition-all data-[swipe=cancel]:richtext-translate-x-0 data-[swipe=end]:richtext-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:richtext-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:richtext-transition-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[swipe=end]:richtext-animate-out data-[state=closed]:richtext-fade-out-80 data-[state=closed]:richtext-slide-out-to-right-full data-[state=open]:richtext-slide-in-from-top-full data-[state=open]:sm:richtext-slide-in-from-bottom-full",{variants:{variant:{default:"richtext-border richtext-bg-background richtext-text-foreground",destructive:"richtext-destructive richtext-group richtext-border-destructive richtext-bg-destructive richtext-text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Pl=ee.forwardRef(({className:e,variant:t,...r},n)=>a.jsx(Ae.Root,{ref:n,className:Z($x({variant:t}),e),...r}));Pl.displayName=Ae.Root.displayName;const kx=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ae.Action,{ref:r,className:Z("richtext-inline-flex richtext-h-8 richtext-shrink-0 richtext-items-center richtext-justify-center richtext-rounded-md !richtext-border richtext-bg-transparent richtext-px-3 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-secondary focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 group-[.destructive]:richtext-border-muted/40 group-[.destructive]:hover:richtext-border-destructive/30 group-[.destructive]:hover:richtext-bg-destructive group-[.destructive]:hover:richtext-text-destructive-foreground group-[.destructive]:focus:richtext-ring-destructive",e),...t}));kx.displayName=Ae.Action.displayName;const Ol=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ae.Close,{ref:r,className:Z("richtext-absolute richtext-right-2 richtext-top-2 richtext-rounded-md richtext-p-1 richtext-text-foreground/50 richtext-opacity-0 richtext-transition-opacity hover:richtext-text-foreground focus:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 group-hover:richtext-opacity-100 group-[.destructive]:richtext-text-red-300 group-[.destructive]:hover:richtext-text-red-50 group-[.destructive]:focus:richtext-ring-red-400 group-[.destructive]:focus:richtext-ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(O.X,{className:"richtext-h-4 richtext-w-4"})}));Ol.displayName=Ae.Close.displayName;const Rl=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ae.Title,{ref:r,className:Z("richtext-text-sm richtext-font-semibold",e),...t}));Rl.displayName=Ae.Title.displayName;const El=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ae.Description,{ref:r,className:Z("richtext-text-sm richtext-opacity-90",e),...t}));El.displayName=Ae.Description.displayName;const Lx=Sr("richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",{variants:{variant:{default:"richtext-bg-transparent",outline:"richtext-border richtext-border-input richtext-bg-transparent hover:richtext-bg-accent hover:richtext-text-accent-foreground"},size:{default:"richtext-h-10 richtext-px-3",sm:"richtext-h-9 richtext-px-2",lg:"richtext-h-11 richtext-px-5"}},defaultVariants:{variant:"default",size:"default"}}),yo=ee.forwardRef(({className:e,variant:t,size:r,...n},i)=>a.jsx(yc.Root,{ref:i,className:Z(Lx({variant:t,size:r,className:e})),...n}));yo.displayName=yc.Root.displayName;const Dx=Gt.Provider,bo=Gt.Root,wo=Gt.Trigger,Cr=ee.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(Gt.Content,{ref:n,sideOffset:t,className:Z("richtext-z-50 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-text-popover-foreground richtext-shadow-md richtext-animate-in richtext-fade-in-0 richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...r}));Cr.displayName=Gt.Content.displayName;const Bx=1,qx=1e6;let Vr=0;function zx(){return Vr=(Vr+1)%Number.MAX_SAFE_INTEGER,Vr.toString()}const Xr=new Map;function Ca(e){if(Xr.has(e))return;const t=setTimeout(()=>{Xr.delete(e),$t({type:"REMOVE_TOAST",toastId:e})},qx);Xr.set(e,t)}function Fx(e,t){switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Bx)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Ca(r):e.toasts.forEach(n=>{Ca(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}}const dr=[];let fr={toasts:[]};function $t(e){fr=Fx(fr,e),dr.forEach(t=>{t(fr)})}function Hx({...e}){const t=zx(),r=i=>$t({type:"UPDATE_TOAST",toast:{...i,id:t}}),n=()=>$t({type:"DISMISS_TOAST",toastId:t});return $t({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||n()}}}),{id:t,dismiss:n,update:r}}function Ml(){const[e,t]=ee.useState(fr);return ee.useEffect(()=>(dr.push(t),()=>{const r=dr.indexOf(t);r>-1&&dr.splice(r,1)}),[e]),{...e,toast:Hx,dismiss:r=>$t({type:"DISMISS_TOAST",toastId:r})}}const Nl=ee.forwardRef(({className:e,...t},r)=>a.jsx(Mi.Root,{ref:r,className:Z("!richtext-peer !richtext-h-4 !richtext-w-4 !richtext-p-0 !richtext-shrink-0 !richtext-rounded-sm !richtext-border !richtext-border-primary !richtext-ring-offset-background focus-visible:!richtext-outline-none focus-visible:!richtext-ring-2 focus-visible:!richtext-ring-ring focus-visible:!richtext-ring-offset-2 disabled:!richtext-cursor-not-allowed disabled:!richtext-opacity-50 data-[state=checked]:!richtext-bg-primary data-[state=checked]:!richtext-text-primary-foreground",e),...t,children:a.jsx(Mi.Indicator,{className:Z("!richtext-flex !richtext-p-0 !richtext-items-center !richtext-justify-center !richtext-text-current"),children:a.jsx(O.Check,{className:"!richtext-h-4 !richtext-w-4"})})}));Nl.displayName=Mi.Root.displayName;const Ux={padding:"0 12px 12px"},_l=({width:e,maxWidth:t,height:r,onOk:n,children:i})=>{const{t:o}=B.useLocale(),[s,c]=b.useState({width:"",height:"",maxWidth:""});b.useEffect(()=>{c({width:e,height:r,maxWidth:t})},[r,t,e]);function l(u){u.preventDefault(),u.stopPropagation(),n(s)}return a.jsxs(Yt,{modal:!0,children:[a.jsx(Kt,{asChild:!0,children:i}),a.jsx(Ct,{children:a.jsx("div",{style:Ux,children:a.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:l,children:[a.jsx(He,{className:"mb-[6px]",children:"Width"}),a.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:a.jsx(je,{type:"number",value:s.width,required:!0,onChange:u=>c({...s,width:u.target.value})})})}),a.jsx(He,{className:"mb-[6px]",children:"Max Width"}),a.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:a.jsx(je,{type:"number",value:s.maxWidth,required:!0,onChange:u=>c({...s,maxWidth:u.target.value})})})}),a.jsx(He,{className:"mb-[6px]",children:"Height"}),a.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:a.jsx(je,{type:"number",value:s.height,required:!0,onChange:u=>c({...s,height:u.target.value})})})}),a.jsx(ge,{type:"submit",className:"richtext-self-end richtext-mt-2",children:o("editor.link.dialog.button.apply")})]})})})]})},It={youtube:{example:"https://www.youtube.com/watch?v=I4sMhHbHYXM",src:"https://www.youtube.com/embed/I4sMhHbHYXM",srcPrefix:"https://www.youtube.com/embed",linkRule:[/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\s/]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[&?]v=)|youtu\.be\/)([\w-]{11})/]},youku:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html?spm=a2h0c.8166622.PhoneSokuUgc_4.dtitle",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"https://player.youku.com/embed",linkRule:[String.raw`v.youku.com\/v_show\/id_\w+\=*`],idRule:String.raw`id_\w+\=*`},bilibili:{example:"https://www.bilibili.com/video/BV1EJ411u7DN",src:"https://player.bilibili.com/player.html?bvid=BV1EJ411u7DN",srcPrefix:"https://player.bilibili.com/player.html?bvid",linkRule:[String.raw`www.bilibili.com\/video\/\w+`]},qqvideo:{example:"https://v.qq.com/x/cover/mzc0020006aw1mn/u0033nvzb5v.html",src:"https://v.qq.com/txp/iframe/player.html?vid=u0033nvzb5v",srcPrefix:"https://v.qq.com/txp/iframe/player.html?vid",linkRule:[String.raw`v.qq.com\/x\/cover\/\w+\/\w+`]},amap:{example:"https://ditu.amap.com/",src:"https://www.amap.com/place/B000A45467",srcPrefix:"",linkRule:[String.raw`\.amap\.com`]},baidu_map:{example:"https://j.map.baidu.com/15/fo",src:"https://j.map.baidu.com/15/fo",srcPrefix:"",linkRule:[String.raw`map\.baidu\.com`]},modao:{example:"https://free.modao.cc/app/2cd26580a6717a147454df7470e7ec464093cba3/embed/v2#screen=sk71k6d1dfxulzx",src:"https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",srcPrefix:"",linkRule:[String.raw`https:\/\/\w+.modao.cc\/app\/\w+\/embed\/v2`],tips:"Modao > More > Share > Embed > COPY"},lanhu:{example:"https://lanhuapp.com/link/#/invite?sid=evP7L",src:"https://lanhuapp.com/url/evP7L",srcPrefix:"",linkRule:[String.raw`https:\/\/lanhuapp.com\/url\/\w+`],tips:"Lanhu > Project > Share > Copy Link"},figma:{example:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",src:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",srcPrefix:"https://www.figma.com/embed?embed_host=share&url",linkRule:[String.raw`https:\/\/www.figma.com\/file\/\w+`]},canva:{example:"https://www.canva.cn/design/DAD61-t29UI/view",src:"https://www.canva.cn/design/DAD61-t29UI/view",srcPrefix:"",linkRule:[String.raw`https:\/\/www.canva.cn\/design\/.+\/view`]},processon:{example:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",src:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",srcPrefix:"",linkRule:[String.raw`https:\/\/www.processon.com\/embed\/\w+`]},codepen:{example:"https://codepen.io/mekery/embed/YzyrKOJ",src:"https://codepen.io/mekery/embed/YzyrKOJ",srcPrefix:"",linkRule:[String.raw`https:\/\/codepen.io\/.+\/embed\/\w+`]},jinshuju:{example:"https://jinshuju.net/f/q9YvVf",src:"https://jinshuju.net/f/q9YvVf",srcPrefix:"",linkRule:[String.raw`https:\/\/jinshuju.net\/f\/\w+`]},iframe:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"",linkRule:[".+"]},googlemaps:{example:"https://goo.gl/maps/8Ys8b4K1ZJY2",src:"https://www.google.com/maps/embed?pb=https://goo.gl/maps/8Ys8b4K1ZJY2",srcPrefix:"",linkRule:[String.raw`https:\/\/goo.gl\/maps\/\w+`]}};function Gx(e){const t=It.youtube,r=e.matchedUrl;e.validLink=!0;const n=r.split("="),i=n.length;if(i>0){const o=n[i-1];e.src=`${t.srcPrefix}/${o}`,e.validId=!0}return e}function Wx(e){const t=It.youku,r=e.matchedUrl,n=t.idRule,i=new RegExp(n),o=r.match(i);if(o&&o.length>0){const s=o[0].slice(3);e.validId=!0,e.src=`${t.srcPrefix}/${s}`}else e.validId=!1;return e}function Vx(e){const t=It.bilibili,n=e.matchedUrl.split("/"),i=n.length;if(i>0){const o=n[i-1];e.src=`${t.srcPrefix}=${o}`,e.validId=!0}return e}function Xx(e){const t=It.qqvideo,n=e.matchedUrl.split("/"),i=n.length;if(i>0){const o=n[i-1];e.src=`${t.srcPrefix}=${o}`,e.validId=!0}return e}function Yx(e,t){return t.src=e,t.validId=!0,t}function Kx(e,t){return t.src=e,t.validId=!0,t}function Zx(e,t){return t.src=e,t.validId=!0,t.originalLink=e,t}function Jx(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function Qx(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function ev(e){const t=It.figma;return e.src=`${t.srcPrefix}=${encodeURIComponent(e.matchedUrl)}`,e.validId=!0,e.originalLink=e.matchedUrl,e}function tv(e,t){return t.src=`${t.matchedUrl}?embed`,t.validId=!0,t.originalLink=e,t}function rv(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function nv(e){return e.src=`${e.matchedUrl}`,e.validId=!0,e.originalLink=e.src,e}function iv(e,t){return t.src=`${t.matchedUrl}?background=white&banner=show&embedded=true`,t.validId=!0,t.originalLink=e,t}function ov(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function av(e,t,r){if(e==="googlemaps")return r.validLink=!0,r.matchedUrl=t,r;const i=It[e].linkRule;for(const o of i){const s=new RegExp(o),c=t.match(s);if(c&&c.length>0)return r.validLink=!0,r.matchedUrl=e==="youtube"?c[1]:c[0],r}return r}function sv(e){var r,n;let t="iframe";return((r=e.includes)!=null&&r.call(e,"youtube")||(n=e.includes)!=null&&n.call(e,"youtu.be"))&&(t="youtube"),e.includes("youku")&&(t="youku"),e.includes("bilibili")&&(t="bilibili"),e.includes("qq")&&(t="qqvideo"),e.includes("amap")&&(t="amap"),e.includes("map.baidu")&&(t="baidu_map"),(e.includes("google.com/maps")||e.includes("maps.app.goo.gl"))&&(t="googlemaps"),e.includes("modao")&&(t="modao"),e.includes("lanhuapp")&&(t="lanhu"),e.includes("figma")&&(t="figma"),e.includes("canva")&&(t="canva"),e.includes("processon")&&(t="processon"),e.includes("codepen")&&(t="codepen"),e.includes("jinshuju")&&(t="jinshuju"),e.includes("iframe")&&(t="iframe"),t}function $l(e){let t={validLink:!1,validId:!1,matchedUrl:"",originalLink:e,src:""};const r=sv(e);if(t=av(r,e,t),!t.validLink)return t;switch(r){case"youtube":return Gx(t);case"youku":return Wx(t);case"bilibili":return Vx(t);case"qqvideo":return Xx(t);case"amap":return Yx(e,t);case"baidu_map":return Kx(e,t);case"googlemaps":return Zx(e,t);case"modao":return Jx(t);case"lanhu":return Qx(t);case"figma":return ev(t);case"canva":return tv(e,t);case"processon":return rv(e,t);case"codepen":return nv(t);case"jinshuju":return iv(e,t);case"iframe":return ov(e,t);default:return e}}function kl(){const[e]=xl(t=>t.value);return e}const cv={setDisable:(e,t)=>{Ar(nt.EDIT(e),t)}},lv="_wrap_5y04w_1",uv="_innerWrap_5y04w_15",Ia={wrap:lv,innerWrap:uv};function dv({editor:e,node:t,updateAttributes:r}){const n=kl(),{src:i,width:o,height:s}=t.attrs,[c,l]=b.useState("");function u(){if(!c)return;const d=$l(c);e.chain().updateAttributes(at.name,{src:(d==null?void 0:d.src)||c}).setNodeSelection(e.state.selection.from).focus().run()}const f=b.useCallback(d=>{r({width:d.width,height:d.height})},[r]);return a.jsxs(le.NodeViewWrapper,{children:[!i&&a.jsxs("div",{className:"richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-[#ccc] richtext-p-[10px]",children:[a.jsx(je,{autoFocus:!0,className:"richtext-flex-1",onInput:d=>l(d.target.value),placeholder:"Enter link",type:"url",value:c}),a.jsx(ge,{className:"richtext-w-[60px]",onClick:u,children:"OK"})]}),i&&a.jsx(Tu.Resizable,{size:{width:Number.parseInt(o),height:Number.parseInt(s)},onResizeStop:(d,h,p,m)=>{f({width:Number.parseInt(o)+m.width,height:Number.parseInt(s)+m.height})},children:a.jsx("div",{className:le.clsx(Ia.wrap,"render-wrapper"),children:a.jsx("div",{className:Ia.innerWrap,style:{pointerEvents:n?"none":"auto"},children:a.jsx("iframe",{className:"richtext-my-[12px] ",src:i})})})})]})}const at=H.Node.create({name:"iframe",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"iframe"},button:({editor:t,extension:r,t:n})=>({component:F,componentProps:{action:i=>t.commands.setIframe(i),upload:r.options.upload,disabled:!t.can().setIframe({}),icon:"Iframe",tooltip:n("editor.iframe.tooltip")}})}},addAttributes(){return{width:{default:600,parseHTML:le.getDatasetAttribute("width")},height:{default:300,parseHTML:le.getDatasetAttribute("height")},src:{default:null,parseHTML:le.getDatasetAttribute("src")},defaultShowPicker:{default:!1},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:e}){return["iframe",H.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setIframe:e=>({tr:t,commands:r,chain:n})=>{var o,s,c;if(((c=(s=(o=t.selection)==null?void 0:o.node)==null?void 0:s.type)==null?void 0:c.name)==this.name)return r.updateAttributes(this.name,e);const i=e||{url:""};return n().insertContent({type:this.name,attrs:i}).run()}}},addInputRules(){return[H.nodeInputRule({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]},addNodeView(){return le.ReactNodeViewRenderer(dv)}});var Ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ll(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Dl(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Yr,Ta;function Bl(){if(Ta)return Yr;Ta=1;var e=Object.prototype.toString;return Yr=function(r){var n=e.call(r),i=n==="[object Arguments]";return i||(i=n!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&e.call(r.callee)==="[object Function]"),i},Yr}var Kr,Pa;function fv(){if(Pa)return Kr;Pa=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Bl(),i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),s=i.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(h){var p=h.constructor;return p&&p.prototype===h},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>"u")return!1;for(var h in window)try{if(!u["$"+h]&&t.call(window,h)&&window[h]!==null&&typeof window[h]=="object")try{l(window[h])}catch{return!0}}catch{return!0}return!1}(),d=function(h){if(typeof window>"u"||!f)return l(h);try{return l(h)}catch{return!1}};e=function(p){var m=p!==null&&typeof p=="object",g=r.call(p)==="[object Function]",y=n(p),S=m&&r.call(p)==="[object String]",j=[];if(!m&&!g&&!y)throw new TypeError("Object.keys called on a non-object");var w=s&&g;if(S&&p.length>0&&!t.call(p,0))for(var A=0;A<p.length;++A)j.push(String(A));if(y&&p.length>0)for(var R=0;R<p.length;++R)j.push(String(R));else for(var M in p)!(w&&M==="prototype")&&t.call(p,M)&&j.push(String(M));if(o)for(var N=d(p),T=0;T<c.length;++T)!(N&&c[T]==="constructor")&&t.call(p,c[T])&&j.push(c[T]);return j}}return Kr=e,Kr}var Zr,Oa;function So(){if(Oa)return Zr;Oa=1;var e=Array.prototype.slice,t=Bl(),r=Object.keys,n=r?function(s){return r(s)}:fv(),i=Object.keys;return n.shim=function(){if(Object.keys){var s=function(){var c=Object.keys(arguments);return c&&c.length===arguments.length}(1,2);s||(Object.keys=function(l){return t(l)?i(e.call(l)):i(l)})}else Object.keys=n;return Object.keys||n},Zr=n,Zr}var Jr,Ra;function Ir(){if(Ra)return Jr;Ra=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Jr=e,Jr}var Qr,Ea;function jo(){return Ea||(Ea=1,Qr=SyntaxError),Qr}var en,Ma;function Te(){return Ma||(Ma=1,en=TypeError),en}var tn,Na;function hv(){return Na||(Na=1,tn=Object.getOwnPropertyDescriptor),tn}var rn,_a;function dt(){if(_a)return rn;_a=1;var e=hv();if(e)try{e([],"length")}catch{e=null}return rn=e,rn}var nn,$a;function Ao(){if($a)return nn;$a=1;var e=Ir(),t=jo(),r=Te(),n=dt();return nn=function(o,s,c){if(!o||typeof o!="object"&&typeof o!="function")throw new r("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,h=!!n&&n(o,s);if(e)e(o,s,{configurable:f===null&&h?h.configurable:!f,enumerable:l===null&&h?h.enumerable:!l,value:c,writable:u===null&&h?h.writable:!u});else if(d||!l&&!u&&!f)o[s]=c;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},nn}var on,ka;function Co(){if(ka)return on;ka=1;var e=Ir(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},on=t,on}var an,La;function ft(){if(La)return an;La=1;var e=So(),t=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",r=Object.prototype.toString,n=Array.prototype.concat,i=Ao(),o=function(u){return typeof u=="function"&&r.call(u)==="[object Function]"},s=Co()(),c=function(u,f,d,h){if(f in u){if(h===!0){if(u[f]===d)return}else if(!o(h)||!h())return}s?i(u,f,d,!0):i(u,f,d)},l=function(u,f){var d=arguments.length>2?arguments[2]:{},h=e(f);t&&(h=n.call(h,Object.getOwnPropertySymbols(f)));for(var p=0;p<h.length;p+=1)c(u,h[p],f[h[p]],d[h[p]])};return l.supportsDescriptors=!!s,an=l,an}var sn={exports:{}},cn,Da;function Io(){return Da||(Da=1,cn=Object),cn}var ln,Ba;function ql(){return Ba||(Ba=1,ln=Error),ln}var un,qa;function pv(){return qa||(qa=1,un=EvalError),un}var dn,za;function mv(){return za||(za=1,dn=RangeError),dn}var fn,Fa;function gv(){return Fa||(Fa=1,fn=ReferenceError),fn}var hn,Ha;function xv(){return Ha||(Ha=1,hn=URIError),hn}var pn,Ua;function vv(){return Ua||(Ua=1,pn=Math.abs),pn}var mn,Ga;function yv(){return Ga||(Ga=1,mn=Math.floor),mn}var gn,Wa;function bv(){return Wa||(Wa=1,gn=Math.max),gn}var xn,Va;function wv(){return Va||(Va=1,xn=Math.min),xn}var vn,Xa;function Sv(){return Xa||(Xa=1,vn=Math.pow),vn}var yn,Ya;function jv(){return Ya||(Ya=1,yn=Math.round),yn}var bn,Ka;function Av(){return Ka||(Ka=1,bn=Number.isNaN||function(t){return t!==t}),bn}var wn,Za;function Cv(){if(Za)return wn;Za=1;var e=Av();return wn=function(r){return e(r)||r===0?r:r<0?-1:1},wn}var Sn,Ja;function Tr(){return Ja||(Ja=1,Sn=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(t,r);if(c.value!==i||c.enumerable!==!0)return!1}return!0}),Sn}var jn,Qa;function To(){if(Qa)return jn;Qa=1;var e=typeof Symbol<"u"&&Symbol,t=Tr();return jn=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},jn}var An,es;function zl(){return es||(es=1,An=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),An}var Cn,ts;function Fl(){if(ts)return Cn;ts=1;var e=Io();return Cn=e.getPrototypeOf||null,Cn}var In,rs;function Iv(){if(rs)return In;rs=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(l,u){for(var f=[],d=0;d<l.length;d+=1)f[d]=l[d];for(var h=0;h<u.length;h+=1)f[h+l.length]=u[h];return f},o=function(l,u){for(var f=[],d=u,h=0;d<l.length;d+=1,h+=1)f[h]=l[d];return f},s=function(c,l){for(var u="",f=0;f<c.length;f+=1)u+=c[f],f+1<c.length&&(u+=l);return u};return In=function(l){var u=this;if(typeof u!="function"||t.apply(u)!==n)throw new TypeError(e+u);for(var f=o(arguments,1),d,h=function(){if(this instanceof d){var S=u.apply(this,i(f,arguments));return Object(S)===S?S:this}return u.apply(l,i(f,arguments))},p=r(0,u.length-f.length),m=[],g=0;g<p;g++)m[g]="$"+g;if(d=Function("binder","return function ("+s(m,",")+"){ return binder.apply(this,arguments); }")(h),u.prototype){var y=function(){};y.prototype=u.prototype,d.prototype=new y,y.prototype=null}return d},In}var Tn,ns;function Zt(){if(ns)return Tn;ns=1;var e=Iv();return Tn=Function.prototype.bind||e,Tn}var Pn,is;function Po(){return is||(is=1,Pn=Function.prototype.call),Pn}var On,os;function Oo(){return os||(os=1,On=Function.prototype.apply),On}var Rn,as;function Tv(){return as||(as=1,Rn=typeof Reflect<"u"&&Reflect&&Reflect.apply),Rn}var En,ss;function Hl(){if(ss)return En;ss=1;var e=Zt(),t=Oo(),r=Po(),n=Tv();return En=n||e.call(r,t),En}var Mn,cs;function Ro(){if(cs)return Mn;cs=1;var e=Zt(),t=Te(),r=Po(),n=Hl();return Mn=function(o){if(o.length<1||typeof o[0]!="function")throw new t("a function is required");return n(e,r,o)},Mn}var Nn,ls;function Pv(){if(ls)return Nn;ls=1;var e=Ro(),t=dt(),r;try{r=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var n=!!r&&t&&t(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return Nn=n&&typeof n.get=="function"?e([n.get]):typeof o=="function"?function(c){return o(c==null?c:i(c))}:!1,Nn}var _n,us;function Ul(){if(us)return _n;us=1;var e=zl(),t=Fl(),r=Pv();return _n=e?function(i){return e(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:r?function(i){return r(i)}:null,_n}var $n,ds;function Eo(){if(ds)return $n;ds=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=Zt();return $n=r.call(e,t),$n}var kn,fs;function Ve(){if(fs)return kn;fs=1;var e,t=Io(),r=ql(),n=pv(),i=mv(),o=gv(),s=jo(),c=Te(),l=xv(),u=vv(),f=yv(),d=bv(),h=wv(),p=Sv(),m=jv(),g=Cv(),y=Function,S=function(J){try{return y('"use strict"; return ('+J+").constructor;")()}catch{}},j=dt(),w=Ir(),A=function(){throw new c},R=j?function(){try{return arguments.callee,A}catch{try{return j(arguments,"callee").get}catch{return A}}}():A,M=To()(),N=Ul(),T=Fl(),C=zl(),$=Oo(),P=Po(),E={},L=typeof Uint8Array>"u"||!N?e:N(Uint8Array),k={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":M&&N?N([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":E,"%AsyncGenerator%":E,"%AsyncGeneratorFunction%":E,"%AsyncIteratorPrototype%":E,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":E,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&N?N(N([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!N?e:N(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":j,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!N?e:N(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&N?N(""[Symbol.iterator]()):e,"%Symbol%":M?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":R,"%TypedArray%":L,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":$,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":T,"%Math.abs%":u,"%Math.floor%":f,"%Math.max%":d,"%Math.min%":h,"%Math.pow%":p,"%Math.round%":m,"%Math.sign%":g,"%Reflect.getPrototypeOf%":C};if(N)try{null.error}catch(J){var Y=N(N(J));k["%Error.prototype%"]=Y}var re=function J(q){var z;if(q==="%AsyncFunction%")z=S("async function () {}");else if(q==="%GeneratorFunction%")z=S("function* () {}");else if(q==="%AsyncGeneratorFunction%")z=S("async function* () {}");else if(q==="%AsyncGenerator%"){var D=J("%AsyncGeneratorFunction%");D&&(z=D.prototype)}else if(q==="%AsyncIteratorPrototype%"){var V=J("%AsyncGenerator%");V&&N&&(z=N(V.prototype))}return k[q]=z,z},ue={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ne=Zt(),Q=Eo(),xe=ne.call(P,Array.prototype.concat),fe=ne.call($,Array.prototype.splice),Xe=ne.call(P,String.prototype.replace),Pe=ne.call(P,String.prototype.slice),I=ne.call(P,RegExp.prototype.exec),_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,U=function(q){var z=Pe(q,0,1),D=Pe(q,-1);if(z==="%"&&D!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(D==="%"&&z!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var V=[];return Xe(q,_,function(de,he,pe,ve){V[V.length]=pe?Xe(ve,G,"$1"):he||de}),V},K=function(q,z){var D=q,V;if(Q(ue,D)&&(V=ue[D],D="%"+V[0]+"%"),Q(k,D)){var de=k[D];if(de===E&&(de=re(D)),typeof de>"u"&&!z)throw new c("intrinsic "+q+" exists, but is not available. Please file an issue!");return{alias:V,name:D,value:de}}throw new s("intrinsic "+q+" does not exist!")};return kn=function(q,z){if(typeof q!="string"||q.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof z!="boolean")throw new c('"allowMissing" argument must be a boolean');if(I(/^%?[^%]*%?$/,q)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var D=U(q),V=D.length>0?D[0]:"",de=K("%"+V+"%",z),he=de.name,pe=de.value,ve=!1,be=de.alias;be&&(V=be[0],fe(D,xe([0,1],be)));for(var Le=1,Oe=!0;Le<D.length;Le+=1){var we=D[Le],De=Pe(we,0,1),Be=Pe(we,-1);if((De==='"'||De==="'"||De==="`"||Be==='"'||Be==="'"||Be==="`")&&De!==Be)throw new s("property names with quotes must have matching quotes");if((we==="constructor"||!Oe)&&(ve=!0),V+="."+we,he="%"+V+"%",Q(k,he))pe=k[he];else if(pe!=null){if(!(we in pe)){if(!z)throw new c("base intrinsic for "+q+" exists, but the property is not available.");return}if(j&&Le+1>=D.length){var qe=j(pe,we);Oe=!!qe,Oe&&"get"in qe&&!("originalValue"in qe.get)?pe=qe.get:pe=pe[we]}else Oe=Q(pe,we),pe=pe[we];Oe&&!ve&&(k[he]=pe)}}return pe},kn}var Ln,hs;function Ov(){if(hs)return Ln;hs=1;var e=Ve(),t=Ao(),r=Co()(),n=dt(),i=Te(),o=e("%Math.floor%");return Ln=function(c,l){if(typeof c!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new i("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],f=!0,d=!0;if("length"in c&&n){var h=n(c,"length");h&&!h.configurable&&(f=!1),h&&!h.writable&&(d=!1)}return(f||d||!u)&&(r?t(c,"length",l,!0,!0):t(c,"length",l)),c},Ln}var Dn,ps;function Rv(){if(ps)return Dn;ps=1;var e=Zt(),t=Oo(),r=Hl();return Dn=function(){return r(e,t,arguments)},Dn}var ms;function Tt(){return ms||(ms=1,function(e){var t=Ov(),r=Ir(),n=Ro(),i=Rv();e.exports=function(s){var c=n(arguments),l=s.length-(arguments.length-1);return t(c,1+(l>0?l:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i}(sn)),sn.exports}var Bn,gs;function ye(){if(gs)return Bn;gs=1;var e=Ve(),t=Ro(),r=t([e("%String.prototype.indexOf%")]);return Bn=function(i,o){var s=e(i,!!o);return typeof s=="function"&&r(i,".prototype.")>-1?t([s]):s},Bn}var qn,xs;function Gl(){if(xs)return qn;xs=1;var e=So(),t=Tr()(),r=ye(),n=Io(),i=r("Array.prototype.push"),o=r("Object.prototype.propertyIsEnumerable"),s=t?n.getOwnPropertySymbols:null;return qn=function(l,u){if(l==null)throw new TypeError("target must be an object");var f=n(l);if(arguments.length===1)return f;for(var d=1;d<arguments.length;++d){var h=n(arguments[d]),p=e(h),m=t&&(n.getOwnPropertySymbols||s);if(m)for(var g=m(h),y=0;y<g.length;++y){var S=g[y];o(h,S)&&i(p,S)}for(var j=0;j<p.length;++j){var w=p[j];if(o(h,w)){var A=h[w];f[w]=A}}}return f},qn}var zn,vs;function Wl(){if(vs)return zn;vs=1;var e=Gl(),t=function(){if(!Object.assign)return!1;for(var n="abcdefghijklmnopqrst",i=n.split(""),o={},s=0;s<i.length;++s)o[i[s]]=i[s];var c=Object.assign({},o),l="";for(var u in c)l+=u;return n!==l},r=function(){if(!Object.assign||!Object.preventExtensions)return!1;var n=Object.preventExtensions({1:2});try{Object.assign(n,"xy")}catch{return n[1]==="y"}return!1};return zn=function(){return!Object.assign||t()||r()?e:Object.assign},zn}var Fn,ys;function Ev(){if(ys)return Fn;ys=1;var e=ft(),t=Wl();return Fn=function(){var n=t();return e(Object,{assign:n},{assign:function(){return Object.assign!==n}}),n},Fn}var Hn,bs;function Mv(){if(bs)return Hn;bs=1;var e=ft(),t=Tt(),r=Gl(),n=Wl(),i=Ev(),o=t.apply(n()),s=function(l,u){return o(Object,arguments)};return e(s,{getPolyfill:n,implementation:r,shim:i}),Hn=s,Hn}var Un,ws;function Vl(){if(ws)return Un;ws=1;var e=Ve(),t=Tt(),r=t(e("String.prototype.indexOf"));return Un=function(i,o){var s=e(i,!!o);return typeof s=="function"&&r(i,".prototype.")>-1?t(s):s},Un}var Gn,Ss;function Nv(){if(Ss)return Gn;Ss=1;var e=function(){return typeof(function(){}).name=="string"},t=Object.getOwnPropertyDescriptor;if(t)try{t([],"length")}catch{t=null}e.functionsHaveConfigurableNames=function(){if(!e()||!t)return!1;var i=t(function(){},"name");return!!i&&!!i.configurable};var r=Function.prototype.bind;return e.boundFunctionsHaveNames=function(){return e()&&typeof r=="function"&&(function(){}).bind().name!==""},Gn=e,Gn}var Wn,js;function _v(){if(js)return Wn;js=1;var e=Ao(),t=Co()(),r=Nv().functionsHaveConfigurableNames(),n=Te();return Wn=function(o,s){if(typeof o!="function")throw new n("`fn` is not a function");var c=arguments.length>2&&!!arguments[2];return(!c||r)&&(t?e(o,"name",s,!0,!0):e(o,"name",s)),o},Wn}var Vn,As;function Xl(){if(As)return Vn;As=1;var e=_v(),t=Te(),r=Object;return Vn=e(function(){if(this==null||this!==r(this))throw new t("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),Vn}var Xn,Cs;function Yl(){if(Cs)return Xn;Cs=1;var e=Xl(),t=ft().supportsDescriptors,r=Object.getOwnPropertyDescriptor;return Xn=function(){if(t&&/a/mig.flags==="gim"){var i=r(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var o="",s={};if(Object.defineProperty(s,"hasIndices",{get:function(){o+="d"}}),Object.defineProperty(s,"sticky",{get:function(){o+="y"}}),i.get.call(s),o==="dy")return i.get}}return e},Xn}var Yn,Is;function $v(){if(Is)return Yn;Is=1;var e=ft().supportsDescriptors,t=Yl(),r=dt(),n=Object.defineProperty,i=ql(),o=Ul(),s=/a/;return Yn=function(){if(!e||!o)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var l=t(),u=o(s),f=r(u,"flags");return(!f||f.get!==l)&&n(u,"flags",{configurable:!0,enumerable:!1,get:l}),l},Yn}var Kn,Ts;function kv(){if(Ts)return Kn;Ts=1;var e=ft(),t=Tt(),r=Xl(),n=Yl(),i=$v(),o=t(n());return e(o,{getPolyfill:n,implementation:r,shim:i}),Kn=o,Kn}var Nt={exports:{}},Zn,Ps;function ht(){if(Ps)return Zn;Ps=1;var e=Tr();return Zn=function(){return e()&&!!Symbol.toStringTag},Zn}var Jn,Os;function Kl(){if(Os)return Jn;Os=1;var e=ht()(),t=ye(),r=t("Object.prototype.toString"),n=function(c){return e&&c&&typeof c=="object"&&Symbol.toStringTag in c?!1:r(c)==="[object Arguments]"},i=function(c){return n(c)?!0:c!==null&&typeof c=="object"&&"length"in c&&typeof c.length=="number"&&c.length>=0&&r(c)!=="[object Array]"&&"callee"in c&&r(c.callee)==="[object Function]"},o=function(){return n(arguments)}();return n.isLegacyArguments=i,Jn=o?n:i,Jn}const Lv={},Dv=Object.freeze(Object.defineProperty({__proto__:null,default:Lv},Symbol.toStringTag,{value:"Module"})),Bv=Dl(Dv);var Qn,Rs;function Pr(){if(Rs)return Qn;Rs=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=i&&o&&typeof o.get=="function"?o.get:null,c=i&&Set.prototype.forEach,l=typeof WeakMap=="function"&&WeakMap.prototype,u=l?WeakMap.prototype.has:null,f=typeof WeakSet=="function"&&WeakSet.prototype,d=f?WeakSet.prototype.has:null,h=typeof WeakRef=="function"&&WeakRef.prototype,p=h?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,g=Object.prototype.toString,y=Function.prototype.toString,S=String.prototype.match,j=String.prototype.slice,w=String.prototype.replace,A=String.prototype.toUpperCase,R=String.prototype.toLowerCase,M=RegExp.prototype.test,N=Array.prototype.concat,T=Array.prototype.join,C=Array.prototype.slice,$=Math.floor,P=typeof BigInt=="function"?BigInt.prototype.valueOf:null,E=Object.getOwnPropertySymbols,L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,k=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Y=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===k||!0)?Symbol.toStringTag:null,re=Object.prototype.propertyIsEnumerable,ue=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(x){return x.__proto__}:null);function ne(x,v){if(x===1/0||x===-1/0||x!==x||x&&x>-1e3&&x<1e3||M.call(/e/,v))return v;var te=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof x=="number"){var ie=x<0?-$(-x):$(x);if(ie!==x){var oe=String(ie),X=j.call(v,oe.length+1);return w.call(oe,te,"$&_")+"."+w.call(w.call(X,/([0-9]{3})/g,"$&_"),/_$/,"")}}return w.call(v,te,"$&_")}var Q=Bv,xe=Q.custom,fe=de(xe)?xe:null,Xe={__proto__:null,double:'"',single:"'"},Pe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Qn=function x(v,te,ie,oe){var X=te||{};if(ve(X,"quoteStyle")&&!ve(Xe,X.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ve(X,"maxStringLength")&&(typeof X.maxStringLength=="number"?X.maxStringLength<0&&X.maxStringLength!==1/0:X.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Ze=ve(X,"customInspect")?X.customInspect:!0;if(typeof Ze!="boolean"&&Ze!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ve(X,"indent")&&X.indent!==null&&X.indent!==" "&&!(parseInt(X.indent,10)===X.indent&&X.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ve(X,"numericSeparator")&&typeof X.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var ot=X.numericSeparator;if(typeof v>"u")return"undefined";if(v===null)return"null";if(typeof v=="boolean")return v?"true":"false";if(typeof v=="string")return pt(v,X);if(typeof v=="number"){if(v===0)return 1/0/v>0?"0":"-0";var Se=String(v);return ot?ne(v,Se):Se}if(typeof v=="bigint"){var Je=String(v)+"n";return ot?ne(v,Je):Je}var Er=typeof X.depth>"u"?5:X.depth;if(typeof ie>"u"&&(ie=0),ie>=Er&&Er>0&&typeof v=="object")return U(v)?"[Array]":"[Object]";var mt=mu(X,ie);if(typeof oe>"u")oe=[];else if(Oe(oe,v)>=0)return"[Circular]";function Re(gt,tr,xu){if(tr&&(oe=C.call(oe),oe.push(tr)),xu){var zo={depth:X.depth};return ve(X,"quoteStyle")&&(zo.quoteStyle=X.quoteStyle),x(gt,zo,ie+1,oe)}return x(gt,X,ie+1,oe)}if(typeof v=="function"&&!J(v)){var _o=Le(v),$o=Qt(v,Re);return"[Function"+(_o?": "+_o:" (anonymous)")+"]"+($o.length>0?" { "+T.call($o,", ")+" }":"")}if(de(v)){var ko=k?w.call(String(v),/^(Symbol\(.*\))_[^)]*$/,"$1"):L.call(v);return typeof v=="object"&&!k?Ke(ko):ko}if(Ye(v)){for(var Ot="<"+R.call(String(v.nodeName)),Mr=v.attributes||[],er=0;er<Mr.length;er++)Ot+=" "+Mr[er].name+"="+I(_(Mr[er].value),"double",X);return Ot+=">",v.childNodes&&v.childNodes.length&&(Ot+="..."),Ot+="</"+R.call(String(v.nodeName))+">",Ot}if(U(v)){if(v.length===0)return"[]";var Nr=Qt(v,Re);return mt&&!pu(Nr)?"["+Rr(Nr,mt)+"]":"[ "+T.call(Nr,", ")+" ]"}if(q(v)){var _r=Qt(v,Re);return!("cause"in Error.prototype)&&"cause"in v&&!re.call(v,"cause")?"{ ["+String(v)+"] "+T.call(N.call("[cause]: "+Re(v.cause),_r),", ")+" }":_r.length===0?"["+String(v)+"]":"{ ["+String(v)+"] "+T.call(_r,", ")+" }"}if(typeof v=="object"&&Ze){if(fe&&typeof v[fe]=="function"&&Q)return Q(v,{depth:Er-ie});if(Ze!=="symbol"&&typeof v.inspect=="function")return v.inspect()}if(we(v)){var Lo=[];return n&&n.call(v,function(gt,tr){Lo.push(Re(tr,v,!0)+" => "+Re(gt,v))}),No("Map",r.call(v),Lo,mt)}if(qe(v)){var Do=[];return c&&c.call(v,function(gt){Do.push(Re(gt,v))}),No("Set",s.call(v),Do,mt)}if(De(v))return Or("WeakMap");if(Jt(v))return Or("WeakSet");if(Be(v))return Or("WeakRef");if(D(v))return Ke(Re(Number(v)));if(he(v))return Ke(Re(P.call(v)));if(V(v))return Ke(m.call(v));if(z(v))return Ke(Re(String(v)));if(typeof window<"u"&&v===window)return"{ [object Window] }";if(typeof globalThis<"u"&&v===globalThis||typeof Ut<"u"&&v===Ut)return"{ [object globalThis] }";if(!K(v)&&!J(v)){var $r=Qt(v,Re),Bo=ue?ue(v)===Object.prototype:v instanceof Object||v.constructor===Object,kr=v instanceof Object?"":"null prototype",qo=!Bo&&Y&&Object(v)===v&&Y in v?j.call(be(v),8,-1):kr?"Object":"",gu=Bo||typeof v.constructor!="function"?"":v.constructor.name?v.constructor.name+" ":"",Lr=gu+(qo||kr?"["+T.call(N.call([],qo||[],kr||[]),": ")+"] ":"");return $r.length===0?Lr+"{}":mt?Lr+"{"+Rr($r,mt)+"}":Lr+"{ "+T.call($r,", ")+" }"}return String(v)};function I(x,v,te){var ie=te.quoteStyle||v,oe=Xe[ie];return oe+x+oe}function _(x){return w.call(String(x),/"/g,"&quot;")}function G(x){return!Y||!(typeof x=="object"&&(Y in x||typeof x[Y]<"u"))}function U(x){return be(x)==="[object Array]"&&G(x)}function K(x){return be(x)==="[object Date]"&&G(x)}function J(x){return be(x)==="[object RegExp]"&&G(x)}function q(x){return be(x)==="[object Error]"&&G(x)}function z(x){return be(x)==="[object String]"&&G(x)}function D(x){return be(x)==="[object Number]"&&G(x)}function V(x){return be(x)==="[object Boolean]"&&G(x)}function de(x){if(k)return x&&typeof x=="object"&&x instanceof Symbol;if(typeof x=="symbol")return!0;if(!x||typeof x!="object"||!L)return!1;try{return L.call(x),!0}catch{}return!1}function he(x){if(!x||typeof x!="object"||!P)return!1;try{return P.call(x),!0}catch{}return!1}var pe=Object.prototype.hasOwnProperty||function(x){return x in this};function ve(x,v){return pe.call(x,v)}function be(x){return g.call(x)}function Le(x){if(x.name)return x.name;var v=S.call(y.call(x),/^function\s*([\w$]+)/);return v?v[1]:null}function Oe(x,v){if(x.indexOf)return x.indexOf(v);for(var te=0,ie=x.length;te<ie;te++)if(x[te]===v)return te;return-1}function we(x){if(!r||!x||typeof x!="object")return!1;try{r.call(x);try{s.call(x)}catch{return!0}return x instanceof Map}catch{}return!1}function De(x){if(!u||!x||typeof x!="object")return!1;try{u.call(x,u);try{d.call(x,d)}catch{return!0}return x instanceof WeakMap}catch{}return!1}function Be(x){if(!p||!x||typeof x!="object")return!1;try{return p.call(x),!0}catch{}return!1}function qe(x){if(!s||!x||typeof x!="object")return!1;try{s.call(x);try{r.call(x)}catch{return!0}return x instanceof Set}catch{}return!1}function Jt(x){if(!d||!x||typeof x!="object")return!1;try{d.call(x,d);try{u.call(x,u)}catch{return!0}return x instanceof WeakSet}catch{}return!1}function Ye(x){return!x||typeof x!="object"?!1:typeof HTMLElement<"u"&&x instanceof HTMLElement?!0:typeof x.nodeName=="string"&&typeof x.getAttribute=="function"}function pt(x,v){if(x.length>v.maxStringLength){var te=x.length-v.maxStringLength,ie="... "+te+" more character"+(te>1?"s":"");return pt(j.call(x,0,v.maxStringLength),v)+ie}var oe=Pe[v.quoteStyle||"single"];oe.lastIndex=0;var X=w.call(w.call(x,oe,"\\$1"),/[\x00-\x1f]/g,Pt);return I(X,"single",v)}function Pt(x){var v=x.charCodeAt(0),te={8:"b",9:"t",10:"n",12:"f",13:"r"}[v];return te?"\\"+te:"\\x"+(v<16?"0":"")+A.call(v.toString(16))}function Ke(x){return"Object("+x+")"}function Or(x){return x+" { ? }"}function No(x,v,te,ie){var oe=ie?Rr(te,ie):T.call(te,", ");return x+" ("+v+") {"+oe+"}"}function pu(x){for(var v=0;v<x.length;v++)if(Oe(x[v],`
2
- `)>=0)return!1;return!0}function mu(x,v){var te;if(x.indent===" ")te=" ";else if(typeof x.indent=="number"&&x.indent>0)te=T.call(Array(x.indent+1)," ");else return null;return{base:te,prev:T.call(Array(v+1),te)}}function Rr(x,v){if(x.length===0)return"";var te=`
1
+ "use strict";var vu=Object.defineProperty;var yu=(e,t,r)=>t in e?vu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var rr=(e,t,r)=>yu(e,typeof t!="symbol"?t+"":t,r);const a=require("react/jsx-runtime"),b=require("react"),le=require("./dom-dataset-CAXnsjYE.cjs"),gc=require("@radix-ui/react-slot"),B=require("./index-LbrE7K9i.cjs"),bu=require("@radix-ui/react-separator"),wu=require("@radix-ui/react-toast"),R=require("lucide-react"),Su=require("@radix-ui/react-tooltip"),ju=require("@radix-ui/react-toggle"),nr=require("@radix-ui/react-icons"),Au=require("@radix-ui/react-popover"),Cu=require("@radix-ui/react-label"),Iu=require("@radix-ui/react-dialog"),H=require("./index-COecBbaE.cjs"),Tu=require("re-resizable"),Pu=require("react-image-crop"),Ru=require("@radix-ui/react-tabs"),Ou=require("@radix-ui/react-checkbox"),xc=require("tippy.js"),Eu=require("react-colorful"),Mu=require("@radix-ui/react-switch"),Nu=require("@radix-ui/react-dropdown-menu");function Ie(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ee=Ie(b),vc=Ie(bu),Ae=Ie(wu),Gt=Ie(Su),yc=Ie(ju),kt=Ie(Au),bc=Ie(Cu),Ce=Ie(Iu),ct=Ie(Ru),Mi=Ie(Ou),Ni=Ie(Mu),ce=Ie(Nu);var wc=typeof global=="object"&&global&&global.Object===Object&&global,_u=typeof self=="object"&&self&&self.Object===Object&&self,ke=wc||_u||Function("return this")(),_e=ke.Symbol,Sc=Object.prototype,$u=Sc.hasOwnProperty,ku=Sc.toString,Ot=_e?_e.toStringTag:void 0;function Lu(e){var t=$u.call(e,Ot),r=e[Ot];try{e[Ot]=void 0;var n=!0}catch{}var i=ku.call(e);return n&&(t?e[Ot]=r:delete e[Ot]),i}var Du=Object.prototype,Bu=Du.toString;function qu(e){return Bu.call(e)}var zu="[object Null]",Fu="[object Undefined]",Fo=_e?_e.toStringTag:void 0;function it(e){return e==null?e===void 0?Fu:zu:Fo&&Fo in Object(e)?Lu(e):qu(e)}function Ue(e){return e!=null&&typeof e=="object"}var Hu="[object Symbol]";function xr(e){return typeof e=="symbol"||Ue(e)&&it(e)==Hu}function jc(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var $e=Array.isArray,Ho=_e?_e.prototype:void 0,Uo=Ho?Ho.toString:void 0;function hr(e){if(typeof e=="string")return e;if($e(e))return jc(e,hr)+"";if(xr(e))return Uo?Uo.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Uu=/\s/;function Gu(e){for(var t=e.length;t--&&Uu.test(e.charAt(t)););return t}var Wu=/^\s+/;function Vu(e){return e&&e.slice(0,Gu(e)+1).replace(Wu,"")}function rt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Go=NaN,Xu=/^[-+]0x[0-9a-f]+$/i,Yu=/^0b[01]+$/i,Ku=/^0o[0-7]+$/i,Zu=parseInt;function xt(e){if(typeof e=="number")return e;if(xr(e))return Go;if(rt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=rt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Vu(e);var r=Yu.test(e);return r||Ku.test(e)?Zu(e.slice(2),r?2:8):Xu.test(e)?Go:+e}var Ju=1/0,Qu=17976931348623157e292;function ed(e){if(!e)return e===0?e:0;if(e=xt(e),e===Ju||e===-1/0){var t=e<0?-1:1;return t*Qu}return e===e?e:0}function td(e){var t=ed(e),r=t%1;return t===t?r?t-r:t:0}function Yi(e){return e}var rd="[object AsyncFunction]",nd="[object Function]",id="[object GeneratorFunction]",od="[object Proxy]";function Ac(e){if(!rt(e))return!1;var t=it(e);return t==nd||t==id||t==rd||t==od}var Dr=ke["__core-js_shared__"],Wo=function(){var e=/[^.]+$/.exec(Dr&&Dr.keys&&Dr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ad(e){return!!Wo&&Wo in e}var sd=Function.prototype,cd=sd.toString;function lt(e){if(e!=null){try{return cd.call(e)}catch{}try{return e+""}catch{}}return""}var ld=/[\\^$.*+?()[\]{}|]/g,ud=/^\[object .+?Constructor\]$/,dd=Function.prototype,fd=Object.prototype,hd=dd.toString,pd=fd.hasOwnProperty,md=RegExp("^"+hd.call(pd).replace(ld,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gd(e){if(!rt(e)||ad(e))return!1;var t=Ac(e)?md:ud;return t.test(lt(e))}function xd(e,t){return e==null?void 0:e[t]}function ut(e,t){var r=xd(e,t);return gd(r)?r:void 0}var _i=ut(ke,"WeakMap");function vd(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var yd=800,bd=16,wd=Date.now;function Sd(e){var t=0,r=0;return function(){var n=wd(),i=bd-(n-r);if(r=n,i>0){if(++t>=yd)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function jd(e){return function(){return e}}var Vo=function(){try{var e=ut(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ad=Vo?function(e,t){return Vo(e,"toString",{configurable:!0,enumerable:!1,value:jd(t),writable:!0})}:Yi,Cd=Sd(Ad);function Id(e,t,r,n){for(var i=e.length,o=r+-1;++o<i;)if(t(e[o],o,e))return o;return-1}function Td(e){return e!==e}function Pd(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function Rd(e,t,r){return t===t?Pd(e,t,r):Id(e,Td,r)}function Od(e,t){var r=e==null?0:e.length;return!!r&&Rd(e,t,0)>-1}var Ed=9007199254740991,Md=/^(?:0|[1-9]\d*)$/;function Cc(e,t){var r=typeof e;return t=t??Ed,!!t&&(r=="number"||r!="symbol"&&Md.test(e))&&e>-1&&e%1==0&&e<t}function Ic(e,t){return e===t||e!==e&&t!==t}var Xo=Math.max;function Nd(e,t,r){return t=Xo(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=Xo(n.length-t,0),s=Array(o);++i<o;)s[i]=n[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=n[i];return c[t]=r(s),vd(e,this,c)}}function _d(e,t){return Cd(Nd(e,t,Yi),e+"")}var $d=9007199254740991;function Ki(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$d}function Tc(e){return e!=null&&Ki(e.length)&&!Ac(e)}var kd=Object.prototype;function Ld(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||kd;return e===r}function Dd(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Bd="[object Arguments]";function Yo(e){return Ue(e)&&it(e)==Bd}var Pc=Object.prototype,qd=Pc.hasOwnProperty,zd=Pc.propertyIsEnumerable,Zi=Yo(function(){return arguments}())?Yo:function(e){return Ue(e)&&qd.call(e,"callee")&&!zd.call(e,"callee")};function Fd(){return!1}var Rc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ko=Rc&&typeof module=="object"&&module&&!module.nodeType&&module,Hd=Ko&&Ko.exports===Rc,Zo=Hd?ke.Buffer:void 0,Ud=Zo?Zo.isBuffer:void 0,$i=Ud||Fd,Gd="[object Arguments]",Wd="[object Array]",Vd="[object Boolean]",Xd="[object Date]",Yd="[object Error]",Kd="[object Function]",Zd="[object Map]",Jd="[object Number]",Qd="[object Object]",ef="[object RegExp]",tf="[object Set]",rf="[object String]",nf="[object WeakMap]",of="[object ArrayBuffer]",af="[object DataView]",sf="[object Float32Array]",cf="[object Float64Array]",lf="[object Int8Array]",uf="[object Int16Array]",df="[object Int32Array]",ff="[object Uint8Array]",hf="[object Uint8ClampedArray]",pf="[object Uint16Array]",mf="[object Uint32Array]",se={};se[sf]=se[cf]=se[lf]=se[uf]=se[df]=se[ff]=se[hf]=se[pf]=se[mf]=!0;se[Gd]=se[Wd]=se[of]=se[Vd]=se[af]=se[Xd]=se[Yd]=se[Kd]=se[Zd]=se[Jd]=se[Qd]=se[ef]=se[tf]=se[rf]=se[nf]=!1;function gf(e){return Ue(e)&&Ki(e.length)&&!!se[it(e)]}function Ji(e){return function(t){return e(t)}}var Oc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_t=Oc&&typeof module=="object"&&module&&!module.nodeType&&module,xf=_t&&_t.exports===Oc,Br=xf&&wc.process,pr=function(){try{var e=_t&&_t.require&&_t.require("util").types;return e||Br&&Br.binding&&Br.binding("util")}catch{}}(),Jo=pr&&pr.isTypedArray,Ec=Jo?Ji(Jo):gf,vf=Object.prototype,yf=vf.hasOwnProperty;function bf(e,t){var r=$e(e),n=!r&&Zi(e),i=!r&&!n&&$i(e),o=!r&&!n&&!i&&Ec(e),s=r||n||i||o,c=s?Dd(e.length,String):[],l=c.length;for(var u in e)yf.call(e,u)&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Cc(u,l)))&&c.push(u);return c}function wf(e,t){return function(r){return e(t(r))}}var Sf=wf(Object.keys,Object),jf=Object.prototype,Af=jf.hasOwnProperty;function Cf(e){if(!Ld(e))return Sf(e);var t=[];for(var r in Object(e))Af.call(e,r)&&r!="constructor"&&t.push(r);return t}function Mc(e){return Tc(e)?bf(e):Cf(e)}var If=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tf=/^\w*$/;function Qi(e,t){if($e(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||xr(e)?!0:Tf.test(e)||!If.test(e)||t!=null&&e in Object(t)}var Lt=ut(Object,"create");function Pf(){this.__data__=Lt?Lt(null):{},this.size=0}function Rf(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Of="__lodash_hash_undefined__",Ef=Object.prototype,Mf=Ef.hasOwnProperty;function Nf(e){var t=this.__data__;if(Lt){var r=t[e];return r===Of?void 0:r}return Mf.call(t,e)?t[e]:void 0}var _f=Object.prototype,$f=_f.hasOwnProperty;function kf(e){var t=this.__data__;return Lt?t[e]!==void 0:$f.call(t,e)}var Lf="__lodash_hash_undefined__";function Df(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Lt&&t===void 0?Lf:t,this}function st(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}st.prototype.clear=Pf;st.prototype.delete=Rf;st.prototype.get=Nf;st.prototype.has=kf;st.prototype.set=Df;function Bf(){this.__data__=[],this.size=0}function vr(e,t){for(var r=e.length;r--;)if(Ic(e[r][0],t))return r;return-1}var qf=Array.prototype,zf=qf.splice;function Ff(e){var t=this.__data__,r=vr(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():zf.call(t,r,1),--this.size,!0}function Hf(e){var t=this.__data__,r=vr(t,e);return r<0?void 0:t[r][1]}function Uf(e){return vr(this.__data__,e)>-1}function Gf(e,t){var r=this.__data__,n=vr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Ge(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ge.prototype.clear=Bf;Ge.prototype.delete=Ff;Ge.prototype.get=Hf;Ge.prototype.has=Uf;Ge.prototype.set=Gf;var Dt=ut(ke,"Map");function Wf(){this.size=0,this.__data__={hash:new st,map:new(Dt||Ge),string:new st}}function Vf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function yr(e,t){var r=e.__data__;return Vf(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Xf(e){var t=yr(this,e).delete(e);return this.size-=t?1:0,t}function Yf(e){return yr(this,e).get(e)}function Kf(e){return yr(this,e).has(e)}function Zf(e,t){var r=yr(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function We(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}We.prototype.clear=Wf;We.prototype.delete=Xf;We.prototype.get=Yf;We.prototype.has=Kf;We.prototype.set=Zf;var Jf="Expected a function";function eo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Jf);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(eo.Cache||We),r}eo.Cache=We;var Qf=500;function eh(e){var t=eo(e,function(n){return r.size===Qf&&r.clear(),n}),r=t.cache;return t}var th=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rh=/\\(\\)?/g,nh=eh(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(th,function(r,n,i,o){t.push(i?o.replace(rh,"$1"):n||r)}),t});function ki(e){return e==null?"":hr(e)}function Nc(e,t){return $e(e)?e:Qi(e,t)?[e]:nh(ki(e))}function br(e){if(typeof e=="string"||xr(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function _c(e,t){t=Nc(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[br(t[r++])];return r&&r==n?e:void 0}function ih(e,t,r){var n=e==null?void 0:_c(e,t);return n===void 0?r:n}function $c(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Qo=_e?_e.isConcatSpreadable:void 0;function oh(e){return $e(e)||Zi(e)||!!(Qo&&e&&e[Qo])}function ah(e,t,r,n,i){var o=-1,s=e.length;for(r||(r=oh),i||(i=[]);++o<s;){var c=e[o];r(c)&&$c(i,c)}return i}function sh(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}function ch(e,t,r){var n=e.length;return r=r===void 0?n:r,r>=n?e:sh(e,t,r)}var lh="\\ud800-\\udfff",uh="\\u0300-\\u036f",dh="\\ufe20-\\ufe2f",fh="\\u20d0-\\u20ff",hh=uh+dh+fh,ph="\\ufe0e\\ufe0f",mh="\\u200d",gh=RegExp("["+mh+lh+hh+ph+"]");function to(e){return gh.test(e)}function xh(e){return e.split("")}var kc="\\ud800-\\udfff",vh="\\u0300-\\u036f",yh="\\ufe20-\\ufe2f",bh="\\u20d0-\\u20ff",wh=vh+yh+bh,Sh="\\ufe0e\\ufe0f",jh="["+kc+"]",Li="["+wh+"]",Di="\\ud83c[\\udffb-\\udfff]",Ah="(?:"+Li+"|"+Di+")",Lc="[^"+kc+"]",Dc="(?:\\ud83c[\\udde6-\\uddff]){2}",Bc="[\\ud800-\\udbff][\\udc00-\\udfff]",Ch="\\u200d",qc=Ah+"?",zc="["+Sh+"]?",Ih="(?:"+Ch+"(?:"+[Lc,Dc,Bc].join("|")+")"+zc+qc+")*",Th=zc+qc+Ih,Ph="(?:"+[Lc+Li+"?",Li,Dc,Bc,jh].join("|")+")",Rh=RegExp(Di+"(?="+Di+")|"+Ph+Th,"g");function Oh(e){return e.match(Rh)||[]}function Eh(e){return to(e)?Oh(e):xh(e)}function Mh(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}function Fc(e,t,r){return r===void 0&&(r=t,t=void 0),r!==void 0&&(r=xt(r),r=r===r?r:0),t!==void 0&&(t=xt(t),t=t===t?t:0),Mh(xt(e),t,r)}function Nh(){this.__data__=new Ge,this.size=0}function _h(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function $h(e){return this.__data__.get(e)}function kh(e){return this.__data__.has(e)}var Lh=200;function Dh(e,t){var r=this.__data__;if(r instanceof Ge){var n=r.__data__;if(!Dt||n.length<Lh-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new We(n)}return r.set(e,t),this.size=r.size,this}function Fe(e){var t=this.__data__=new Ge(e);this.size=t.size}Fe.prototype.clear=Nh;Fe.prototype.delete=_h;Fe.prototype.get=$h;Fe.prototype.has=kh;Fe.prototype.set=Dh;function Bh(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function qh(){return[]}var zh=Object.prototype,Fh=zh.propertyIsEnumerable,ea=Object.getOwnPropertySymbols,Hh=ea?function(e){return e==null?[]:(e=Object(e),Bh(ea(e),function(t){return Fh.call(e,t)}))}:qh;function Uh(e,t,r){var n=t(e);return $e(e)?n:$c(n,r(e))}function ta(e){return Uh(e,Mc,Hh)}var Bi=ut(ke,"DataView"),qi=ut(ke,"Promise"),zi=ut(ke,"Set"),ra="[object Map]",Gh="[object Object]",na="[object Promise]",ia="[object Set]",oa="[object WeakMap]",aa="[object DataView]",Wh=lt(Bi),Vh=lt(Dt),Xh=lt(qi),Yh=lt(zi),Kh=lt(_i),tt=it;(Bi&&tt(new Bi(new ArrayBuffer(1)))!=aa||Dt&&tt(new Dt)!=ra||qi&&tt(qi.resolve())!=na||zi&&tt(new zi)!=ia||_i&&tt(new _i)!=oa)&&(tt=function(e){var t=it(e),r=t==Gh?e.constructor:void 0,n=r?lt(r):"";if(n)switch(n){case Wh:return aa;case Vh:return ra;case Xh:return na;case Yh:return ia;case Kh:return oa}return t});var sa=ke.Uint8Array,Zh="__lodash_hash_undefined__";function Jh(e){return this.__data__.set(e,Zh),this}function Qh(e){return this.__data__.has(e)}function Bt(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new We;++t<r;)this.add(e[t])}Bt.prototype.add=Bt.prototype.push=Jh;Bt.prototype.has=Qh;function ep(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function Hc(e,t){return e.has(t)}var tp=1,rp=2;function Uc(e,t,r,n,i,o){var s=r&tp,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=o.get(e),f=o.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,p=r&rp?new Bt:void 0;for(o.set(e,t),o.set(t,e);++d<c;){var m=e[d],g=t[d];if(n)var y=s?n(g,m,d,t,e,o):n(m,g,d,e,t,o);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!ep(t,function(S,j){if(!Hc(p,j)&&(m===S||i(m,S,r,n,o)))return p.push(j)})){h=!1;break}}else if(!(m===g||i(m,g,r,n,o))){h=!1;break}}return o.delete(e),o.delete(t),h}function np(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function ip(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var op=1,ap=2,sp="[object Boolean]",cp="[object Date]",lp="[object Error]",up="[object Map]",dp="[object Number]",fp="[object RegExp]",hp="[object Set]",pp="[object String]",mp="[object Symbol]",gp="[object ArrayBuffer]",xp="[object DataView]",ca=_e?_e.prototype:void 0,qr=ca?ca.valueOf:void 0;function vp(e,t,r,n,i,o,s){switch(r){case xp:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case gp:return!(e.byteLength!=t.byteLength||!o(new sa(e),new sa(t)));case sp:case cp:case dp:return Ic(+e,+t);case lp:return e.name==t.name&&e.message==t.message;case fp:case pp:return e==t+"";case up:var c=np;case hp:var l=n&op;if(c||(c=ip),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;n|=ap,s.set(e,t);var f=Uc(c(e),c(t),n,i,o,s);return s.delete(e),f;case mp:if(qr)return qr.call(e)==qr.call(t)}return!1}var yp=1,bp=Object.prototype,wp=bp.hasOwnProperty;function Sp(e,t,r,n,i,o){var s=r&yp,c=ta(e),l=c.length,u=ta(t),f=u.length;if(l!=f&&!s)return!1;for(var d=l;d--;){var h=c[d];if(!(s?h in t:wp.call(t,h)))return!1}var p=o.get(e),m=o.get(t);if(p&&m)return p==t&&m==e;var g=!0;o.set(e,t),o.set(t,e);for(var y=s;++d<l;){h=c[d];var S=e[h],j=t[h];if(n)var w=s?n(j,S,h,t,e,o):n(S,j,h,e,t,o);if(!(w===void 0?S===j||i(S,j,r,n,o):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var A=e.constructor,O=t.constructor;A!=O&&"constructor"in e&&"constructor"in t&&!(typeof A=="function"&&A instanceof A&&typeof O=="function"&&O instanceof O)&&(g=!1)}return o.delete(e),o.delete(t),g}var jp=1,la="[object Arguments]",ua="[object Array]",ir="[object Object]",Ap=Object.prototype,da=Ap.hasOwnProperty;function Cp(e,t,r,n,i,o){var s=$e(e),c=$e(t),l=s?ua:tt(e),u=c?ua:tt(t);l=l==la?ir:l,u=u==la?ir:u;var f=l==ir,d=u==ir,h=l==u;if(h&&$i(e)){if(!$i(t))return!1;s=!0,f=!1}if(h&&!f)return o||(o=new Fe),s||Ec(e)?Uc(e,t,r,n,i,o):vp(e,t,l,r,n,i,o);if(!(r&jp)){var p=f&&da.call(e,"__wrapped__"),m=d&&da.call(t,"__wrapped__");if(p||m){var g=p?e.value():e,y=m?t.value():t;return o||(o=new Fe),i(g,y,r,n,o)}}return h?(o||(o=new Fe),Sp(e,t,r,n,i,o)):!1}function ro(e,t,r,n,i){return e===t?!0:e==null||t==null||!Ue(e)&&!Ue(t)?e!==e&&t!==t:Cp(e,t,r,n,ro,i)}var Ip=1,Tp=2;function Pp(e,t,r,n){var i=r.length,o=i;if(e==null)return!o;for(e=Object(e);i--;){var s=r[i];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=r[i];var c=s[0],l=e[c],u=s[1];if(s[2]){if(l===void 0&&!(c in e))return!1}else{var f=new Fe,d;if(!(d===void 0?ro(u,l,Ip|Tp,n,f):d))return!1}}return!0}function Gc(e){return e===e&&!rt(e)}function Rp(e){for(var t=Mc(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Gc(i)]}return t}function Wc(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function Op(e){var t=Rp(e);return t.length==1&&t[0][2]?Wc(t[0][0],t[0][1]):function(r){return r===e||Pp(r,e,t)}}function Ep(e,t){return e!=null&&t in Object(e)}function Mp(e,t,r){t=Nc(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var s=br(t[n]);if(!(o=e!=null&&r(e,s)))break;e=e[s]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&Ki(i)&&Cc(s,i)&&($e(e)||Zi(e)))}function Np(e,t){return e!=null&&Mp(e,t,Ep)}var _p=1,$p=2;function kp(e,t){return Qi(e)&&Gc(t)?Wc(br(e),t):function(r){var n=ih(r,e);return n===void 0&&n===t?Np(r,e):ro(t,n,_p|$p)}}function Vc(e){return function(t){return t==null?void 0:t[e]}}function Lp(e){return function(t){return _c(t,e)}}function Dp(e){return Qi(e)?Vc(br(e)):Lp(e)}function Bp(e){return typeof e=="function"?e:e==null?Yi:typeof e=="object"?$e(e)?kp(e[0],e[1]):Op(e):Dp(e)}var zr=function(){return ke.Date.now()},qp="Expected a function",zp=Math.max,Fp=Math.min;function Wt(e,t,r){var n,i,o,s,c,l,u=0,f=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(qp);t=xt(t)||0,rt(r)&&(f=!!r.leading,d="maxWait"in r,o=d?zp(xt(r.maxWait)||0,t):o,h="trailing"in r?!!r.trailing:h);function p(M){var N=n,T=i;return n=i=void 0,u=M,s=e.apply(T,N),s}function m(M){return u=M,c=setTimeout(S,t),f?p(M):s}function g(M){var N=M-l,T=M-u,C=t-N;return d?Fp(C,o-T):C}function y(M){var N=M-l,T=M-u;return l===void 0||N>=t||N<0||d&&T>=o}function S(){var M=zr();if(y(M))return j(M);c=setTimeout(S,g(M))}function j(M){return c=void 0,h&&n?p(M):(n=i=void 0,s)}function w(){c!==void 0&&clearTimeout(c),u=0,n=l=i=c=void 0}function A(){return c===void 0?s:j(zr())}function O(){var M=zr(),N=y(M);if(n=arguments,i=this,l=M,N){if(c===void 0)return m(l);if(d)return clearTimeout(c),c=setTimeout(S,t),p(l)}return c===void 0&&(c=setTimeout(S,t)),s}return O.cancel=w,O.flush=A,O}function Fr(e){return Ue(e)&&Tc(e)}var Hp=200;function Up(e,t,r,n){var i=-1,o=Od,s=!0,c=e.length,l=[],u=t.length;if(!c)return l;r&&(t=jc(t,Ji(r))),t.length>=Hp&&(o=Hc,s=!1,t=new Bt(t));e:for(;++i<c;){var f=e[i],d=r==null?f:r(f);if(f=f!==0?f:0,s&&d===d){for(var h=u;h--;)if(t[h]===d)continue e;l.push(f)}else o(t,d,n)||l.push(f)}return l}function Gp(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Wp=_d(function(e,t){var r=Gp(t);return Fr(r)&&(r=void 0),Fr(e)?Up(e,ah(t,1,Fr),Bp(r)):[]}),Vp="[object Number]";function mr(e){return typeof e=="number"||Ue(e)&&it(e)==Vp}var Xp="[object RegExp]";function Yp(e){return Ue(e)&&it(e)==Xp}var fa=pr&&pr.isRegExp,Kp=fa?Ji(fa):Yp,Zp=Vc("length"),Xc="\\ud800-\\udfff",Jp="\\u0300-\\u036f",Qp="\\ufe20-\\ufe2f",em="\\u20d0-\\u20ff",tm=Jp+Qp+em,rm="\\ufe0e\\ufe0f",nm="["+Xc+"]",Fi="["+tm+"]",Hi="\\ud83c[\\udffb-\\udfff]",im="(?:"+Fi+"|"+Hi+")",Yc="[^"+Xc+"]",Kc="(?:\\ud83c[\\udde6-\\uddff]){2}",Zc="[\\ud800-\\udbff][\\udc00-\\udfff]",om="\\u200d",Jc=im+"?",Qc="["+rm+"]?",am="(?:"+om+"(?:"+[Yc,Kc,Zc].join("|")+")"+Qc+Jc+")*",sm=Qc+Jc+am,cm="(?:"+[Yc+Fi+"?",Fi,Kc,Zc,nm].join("|")+")",ha=RegExp(Hi+"(?="+Hi+")|"+cm+sm,"g");function lm(e){for(var t=ha.lastIndex=0;ha.test(e);)++t;return t}function um(e){return to(e)?lm(e):Zp(e)}var dm="Expected a function";function bt(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(dm);return rt(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Wt(e,t,{leading:n,maxWait:t,trailing:i})}var fm=30,hm="...",pm=/\w*$/;function mm(e,t){var r=fm,n=hm;if(rt(t)){var i="separator"in t?t.separator:i;r="length"in t?td(t.length):r,n="omission"in t?hr(t.omission):n}e=ki(e);var o=e.length;if(to(e)){var s=Eh(e);o=s.length}if(r>=o)return e;var c=r-um(n);if(c<1)return n;var l=s?ch(s,0,c).join(""):e.slice(0,c);if(i===void 0)return l+n;if(s&&(c+=l.length-c),Kp(i)){if(e.slice(c).search(i)){var u,f=l;for(i.global||(i=RegExp(i.source,ki(pm.exec(i))+"g")),i.lastIndex=0;u=i.exec(f);)var d=u.index;l=l.slice(0,d===void 0?c:d)}}else if(e.indexOf(hr(i),c)!=c){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+n}const no="-",gm=e=>{const t=vm(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{const c=s.split(no);return c[0]===""&&c.length!==1&&c.shift(),el(c,t)||xm(s)},getConflictingClassGroupIds:(s,c)=>{const l=r[s]||[];return c&&n[s]?[...l,...n[s]]:l}}},el=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?el(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(no);return(s=t.validators.find(({validator:c})=>c(o)))==null?void 0:s.classGroupId},pa=/^\[(.+)\]$/,xm=e=>{if(pa.test(e)){const t=pa.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},vm=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return bm(Object.entries(e.classGroups),r).forEach(([o,s])=>{Ui(s,n,o,t)}),n},Ui=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:ma(t,i);o.classGroupId=r;return}if(typeof i=="function"){if(ym(i)){Ui(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([o,s])=>{Ui(s,ma(t,o),r,n)})})},ma=(e,t)=>{let r=e;return t.split(no).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},ym=e=>e.isThemeGetter,bm=(e,t)=>t?e.map(([r,n])=>{const i=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,c])=>[t+s,c])):o);return[r,i]}):e,wm=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(o,s)=>{r.set(o,s),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let s=r.get(o);if(s!==void 0)return s;if((s=n.get(o))!==void 0)return i(o,s),s},set(o,s){r.has(o)?r.set(o,s):i(o,s)}}},tl="!",Sm=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],o=t.length,s=c=>{const l=[];let u=0,f=0,d;for(let y=0;y<c.length;y++){let S=c[y];if(u===0){if(S===i&&(n||c.slice(y,y+o)===t)){l.push(c.slice(f,y)),f=y+o;continue}if(S==="/"){d=y;continue}}S==="["?u++:S==="]"&&u--}const h=l.length===0?c:c.substring(f),p=h.startsWith(tl),m=p?h.substring(1):h,g=d&&d>f?d-f:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return r?c=>r({className:c,parseClassName:s}):s},jm=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Am=e=>({cache:wm(e.cacheSize),parseClassName:Sm(e),...gm(e)}),Cm=/\s+/,Im=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(Cm);let c="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:f,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=r(u);let m=!!p,g=n(m?h.substring(0,p):h);if(!g){if(!m){c=u+(c.length>0?" "+c:c);continue}if(g=n(h),!g){c=u+(c.length>0?" "+c:c);continue}m=!1}const y=jm(f).join(":"),S=d?y+tl:y,j=S+g;if(o.includes(j))continue;o.push(j);const w=i(g,m);for(let A=0;A<w.length;++A){const O=w[A];o.push(S+O)}c=u+(c.length>0?" "+c:c)}return c};function Tm(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=rl(t))&&(n&&(n+=" "),n+=r);return n}const rl=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=rl(e[n]))&&(r&&(r+=" "),r+=t);return r};function Pm(e,...t){let r,n,i,o=s;function s(l){const u=t.reduce((f,d)=>d(f),e());return r=Am(u),n=r.cache.get,i=r.cache.set,o=c,c(l)}function c(l){const u=n(l);if(u)return u;const f=Im(l,r);return i(l,f),f}return function(){return o(Tm.apply(null,arguments))}}const ae=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},nl=/^\[(?:([a-z-]+):)?(.+)\]$/i,Rm=/^\d+\/\d+$/,Om=new Set(["px","full","screen"]),Em=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Nm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,_m=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$m=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ze=e=>vt(e)||Om.has(e)||Rm.test(e),Qe=e=>St(e,"length",Hm),vt=e=>!!e&&!Number.isNaN(Number(e)),Hr=e=>St(e,"number",vt),Et=e=>!!e&&Number.isInteger(Number(e)),km=e=>e.endsWith("%")&&vt(e.slice(0,-1)),W=e=>nl.test(e),et=e=>Em.test(e),Lm=new Set(["length","size","percentage"]),Dm=e=>St(e,Lm,il),Bm=e=>St(e,"position",il),qm=new Set(["image","url"]),zm=e=>St(e,qm,Gm),Fm=e=>St(e,"",Um),Mt=()=>!0,St=(e,t,r)=>{const n=nl.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},Hm=e=>Mm.test(e)&&!Nm.test(e),il=()=>!1,Um=e=>_m.test(e),Gm=e=>$m.test(e),Wm=()=>{const e=ae("colors"),t=ae("spacing"),r=ae("blur"),n=ae("brightness"),i=ae("borderColor"),o=ae("borderRadius"),s=ae("borderSpacing"),c=ae("borderWidth"),l=ae("contrast"),u=ae("grayscale"),f=ae("hueRotate"),d=ae("invert"),h=ae("gap"),p=ae("gradientColorStops"),m=ae("gradientColorStopPositions"),g=ae("inset"),y=ae("margin"),S=ae("opacity"),j=ae("padding"),w=ae("saturate"),A=ae("scale"),O=ae("sepia"),M=ae("skew"),N=ae("space"),T=ae("translate"),C=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",W,t],E=()=>[W,t],L=()=>["",ze,Qe],k=()=>["auto",vt,W],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",W],xe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],fe=()=>[vt,W];return{cacheSize:500,separator:":",theme:{colors:[Mt],spacing:[ze,Qe],blur:["none","",et,W],brightness:fe(),borderColor:[e],borderRadius:["none","","full",et,W],borderSpacing:E(),borderWidth:L(),contrast:fe(),grayscale:Q(),hueRotate:fe(),invert:Q(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[km,Qe],inset:P(),margin:P(),opacity:fe(),padding:E(),saturate:fe(),scale:fe(),sepia:Q(),skew:fe(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",W]}],container:["container"],columns:[{columns:[et]}],"break-after":[{"break-after":xe()}],"break-before":[{"break-before":xe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Y(),W]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Et,W]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",W]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",Et,W]}],"grid-cols":[{"grid-cols":[Mt]}],"col-start-end":[{col:["auto",{span:["full",Et,W]},W]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[Mt]}],"row-start-end":[{row:["auto",{span:[Et,W]},W]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",W]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",W]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[j]}],px:[{px:[j]}],py:[{py:[j]}],ps:[{ps:[j]}],pe:[{pe:[j]}],pt:[{pt:[j]}],pr:[{pr:[j]}],pb:[{pb:[j]}],pl:[{pl:[j]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",W,t]}],"min-w":[{"min-w":[W,t,"min","max","fit"]}],"max-w":[{"max-w":[W,t,"none","full","min","max","fit","prose",{screen:[et]},et]}],h:[{h:[W,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[W,t,"auto","min","max","fit"]}],"font-size":[{text:["base",et,Qe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hr]}],"font-family":[{font:[Mt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",W]}],"line-clamp":[{"line-clamp":["none",vt,Hr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ze,W]}],"list-image":[{"list-image":["none",W]}],"list-style-type":[{list:["none","disc","decimal",W]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ze,Qe]}],"underline-offset":[{"underline-offset":["auto",ze,W]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),Bm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Dm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zm]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:re()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[ze,W]}],"outline-w":[{outline:[ze,Qe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[ze,Qe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",et,Fm]}],"shadow-color":[{shadow:[Mt]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...ue(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ue()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",et,W]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",W]}],duration:[{duration:fe()}],ease:[{ease:["linear","in","out","in-out",W]}],delay:[{delay:fe()}],animate:[{animate:["none","spin","ping","pulse","bounce",W]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[Et,W]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",W]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",W]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",W]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ze,Qe,Hr]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Vm=Pm(Wm);function Z(...e){return Vm(le.clsx(e))}let Ur;function Gr(){return Ur===void 0&&(Ur=navigator.platform.includes("Mac")),Ur}function ol(e){return`${e}`.toLowerCase()==="mod"?Gr()?"⌘":"Ctrl":`${e}`.toLowerCase()==="alt"?Gr()?"⌥":"Alt":`${e}`.toLowerCase()==="shift"?Gr()?"⇧":"Shift":e}function al(e){return e.map(ol).join(" ")}const F=b.forwardRef((e,t)=>{const{icon:r=void 0,tooltip:n=void 0,disabled:i=!1,customClass:o="",loading:s=void 0,shortcutKeys:c=void 0,tooltipOptions:l={},action:u=void 0,isActive:f=void 0,children:d,asChild:h=!1,upload:p=!1,...m}=e,g=ao[r],y=h?gc.Slot:yo;return a.jsxs(bo,{children:[a.jsx(wo,{asChild:!0,children:a.jsxs(y,{"data-state":f!=null&&f()?"on":"off",onClick:u,ref:t,size:"sm",className:Z("richtext-w-[32px] richtext-h-[32px]",o),disabled:i,...m,children:[g&&a.jsx(g,{className:"richtext-size-4"}),d]})}),n&&a.jsx(Cr,{...l,children:a.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[a.jsx("div",{children:n}),!!(c!=null&&c.length)&&a.jsx("span",{children:al(c)})]})})]})});function Xm(e){const t=["size-small","size-medium","size-large"],r=["SizeS","SizeM","SizeL"];return t.map((n,i)=>({type:`image-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.${n.replace("-",".")}.tooltip`),icon:r[i],action:()=>e.commands.updateImage({width:B.IMAGE_SIZE[n]}),isActive:()=>e.isActive("image",{width:B.IMAGE_SIZE[n]})}}))}function Ym(e){const t=["size-small","size-medium","size-large"],r=["SizeS","SizeM","SizeL"];return t.map((n,i)=>({type:`image-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.${n.replace("-",".")}.tooltip`),icon:r[i],action:()=>e.commands.updateImageGif({width:B.IMAGE_SIZE[n]}),isActive:()=>e.isActive("image",{width:B.IMAGE_SIZE[n]})}}))}function Km(e){const t=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(n=>({type:`image-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=e.commands)==null?void 0:i.setAlignImage)==null?void 0:o.call(i,n)},isActive:()=>e.isActive({align:n})||!1,disabled:!1}}))}function Zm(e){const t=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(n=>({type:`image-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=e.commands)==null?void 0:i.setAlignImageGif)==null?void 0:o.call(i,n)},isActive:()=>e.isActive({align:n})||!1,disabled:!1}}))}function Jm(e){const t=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(n=>({type:`image-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=e.commands)==null?void 0:i.setAlignImageMermaid)==null?void 0:o.call(i,n)},isActive:()=>e.isActive({align:n})||!1,disabled:!1}}))}function Qm(e){const t=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(n=>({type:`image-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=e.commands)==null?void 0:i.setAlignImageDrawer)==null?void 0:o.call(i,n)},isActive:()=>e.isActive({align:n})||!1,disabled:!1}}))}function eg(e){const t=["size-small","size-medium","size-large"],r=["SizeS","SizeM","SizeL"];return t.map((n,i)=>({type:`video-${n}`,component:F,componentProps:{tooltip:B.localeActions.t(`editor.${n.replace("-",".")}.tooltip`),icon:r[i],action:()=>e.commands.updateVideo({width:B.VIDEO_SIZE[n]}),isActive:()=>e.isActive("video",{width:B.VIDEO_SIZE[n]})}}))}function tg(e){return[{type:"flipX",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.tooltip.flipX"),icon:"FlipX",action:()=>{const t=e.getAttributes("image"),{flipX:r}=t;e.chain().focus(void 0,{scrollIntoView:!1}).updateImage({flipX:!r}).run()}}},{type:"flipY",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.tooltip.flipY"),icon:"FlipY",action:()=>{const t=e.getAttributes("image"),{flipY:r}=t;e.chain().focus(void 0,{scrollIntoView:!1}).updateImage({flipY:!r}).run()}}},...Xm(e),...Km(e),{type:"remove",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;H.deleteSelection(t,r)}}}]}function rg(e){return[...Ym(e),...Zm(e),{type:"remove",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;H.deleteSelection(t,r)}}}]}function ng(e){return[...Jm(e),{type:"edit",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.edit"),icon:"Pencil",action:()=>!0}},{type:"remove",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;H.deleteSelection(t,r)}}}]}function ig(e){return[...Qm(e),{type:"edit",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.edit"),icon:"Pencil",action:()=>(console.log("AAA"),!0)}},{type:"remove",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;H.deleteSelection(t,r)}}}]}function og(e){return[...eg(e),{type:"remove",component:F,componentProps:{editor:e,tooltip:B.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;H.deleteSelection(t,r)}}}]}function ag(e,t){return B.BUBBLE_TEXT_LIST.reduce((r,n)=>{if(n==="divider"&&r.length>0)return[...r,{type:"divider",component:void 0,componentProps:{}}];const i=e.extensionManager.extensions.find(o=>o.name===n);return i?[...r,i.configure().options.button({editor:e,t,extension:i})]:r},[])}function io(e,t,r){const n=[],i=e.node(0);r=typeof r=="number"&&r>=0?r:e.sameParent(t)?Math.max(0,e.sharedDepth(t.pos)-1):e.sharedDepth(t.pos);const o=new H.NodeRange(e,t,r),s=o.depth===0?0:i.resolve(o.start).posAtIndex(0);return o.parent.forEach((c,l)=>{const u=s+l,f=u+c.nodeSize;if(u<o.start||u>=o.end)return;const d=new H.SelectionRange(i.resolve(u),i.resolve(f));n.push(d)}),n}class oo{constructor(t,r){rr(this,"anchor");rr(this,"head");this.anchor=t,this.head=r}map(t){return new oo(t.map(this.anchor),t.map(this.head))}resolve(t){const r=t.resolve(this.anchor),n=t.resolve(this.head);return new Ne(r,n)}}class Ne extends H.Selection{constructor(r,n,i,o=1){const{doc:s}=r,c=r===n,l=r.pos===s.content.size&&n.pos===s.content.size,u=c&&!l?s.resolve(n.pos+(o>0?1:-1)):n,f=c&&l?s.resolve(r.pos-(o>0?1:-1)):r,d=io(f.min(u),f.max(u),i);super(u.pos>=r.pos?d[0].$from:d[d.length-1].$to,u.pos>=r.pos?d[d.length-1].$to:d[0].$from,d);rr(this,"depth");this.depth=i}get $to(){return this.ranges[this.ranges.length-1].$to}eq(r){return r instanceof Ne&&r.$from.pos===this.$from.pos&&r.$to.pos===this.$to.pos}map(r,n){const i=r.resolve(n.map(this.anchor)),o=r.resolve(n.map(this.head));return new Ne(i,o)}toJSON(){return{type:"nodeRange",anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){const{doc:r}=this.$from;if(this.isForwards&&this.ranges.length>1){const o=this.ranges.slice(0,-1),s=o[0].$from,c=o[o.length-1].$to;return new Ne(s,c,this.depth)}const n=this.ranges[0],i=r.resolve(Math.max(0,n.$from.pos-1));return new Ne(this.$anchor,i,this.depth)}extendForwards(){const{doc:r}=this.$from;if(this.isBackwards&&this.ranges.length>1){const o=this.ranges.slice(1),s=o[0].$from,c=o[o.length-1].$to;return new Ne(c,s,this.depth)}const n=this.ranges[this.ranges.length-1],i=r.resolve(Math.min(r.content.size,n.$to.pos+1));return new Ne(this.$anchor,i,this.depth)}static fromJSON(r,n){return new Ne(r.resolve(n.anchor),r.resolve(n.head))}static create(r,n,i,o,s=1){return new this(r.resolve(n),r.resolve(i),o,s)}getBookmark(){return new oo(this.anchor,this.head)}}function sg(e){const t=e.cloneNode(!0),r=[e,...Array.from(e.getElementsByTagName("*"))],n=[t,...Array.from(t.getElementsByTagName("*"))];return r.forEach((i,o)=>{n[o].style.cssText=function(s){let c="";const l=getComputedStyle(s);for(let u=0;u<l.length;u+=1)c+=`${l[u]}:${l.getPropertyValue(l[u])};`;return c}(i)}),t}function or(e,t){return window.getComputedStyle(e)[t]}function cg(e=0,t=0,r=0){return Math.min(Math.max(e,t),r)}function ga(e){e.parentNode!==null&&e.parentNode!==void 0&&e.parentNode.removeChild(e)}function sl(e){const{x:t,y:r,direction:n,editor:i}=e;let o=null,s=null,c=null,l=t;for(;s===null&&l<window.innerWidth&&l>0;){const u=document.elementsFromPoint(l,r),f=u.findIndex(h=>h.classList.contains("ProseMirror")),d=u.slice(0,f);if(d.length>0){const h=d[0];if(o=h,c=i.view.posAtDOM(h,0),c>=0){s=i.state.doc.nodeAt(Math.max(c-1,0)),(s===null||s.isText)&&(s=i.state.doc.nodeAt(Math.max(c-1,0))),s||(s=i.state.doc.nodeAt(Math.max(c,0)));break}}n==="left"?l-=1:l+=1}return{resultElement:o,resultNode:s,pos:c!==null?c:null}}function lg(e,t){const{doc:r}=t.view.state,n=sl({editor:t,x:e.clientX,y:e.clientY,direction:"right"});if(!n.resultNode||n.pos===null)return[];const i=e.clientX,o=function(f,d,h){const p=Number.parseInt(or(f.dom,"paddingLeft"),10),m=Number.parseInt(or(f.dom,"paddingRight"),10),g=Number.parseInt(or(f.dom,"borderLeftWidth"),10),y=Number.parseInt(or(f.dom,"borderLeftWidth"),10),S=f.dom.getBoundingClientRect();return{left:cg(d,S.left+p+g,S.right-m-y),top:h}}(t.view,i,e.clientY),s=t.view.posAtCoords(o);if(!s)return[];const{pos:c}=s;if(!r.resolve(c).parent)return[];const l=r.resolve(n.pos),u=r.resolve(n.pos+1);return io(l,u,0)}function xa(e,t){const r=e.resolve(t),{depth:n}=r;return n===0?t:r.pos-r.parentOffset-1}function va(e,t){const r=e.nodeAt(t),n=e.resolve(t);let{depth:i}=n,o=r;for(;i>0;){const s=n.node(i);i-=1,i===0&&(o=s)}return o}function ya(e,t){let r=t;for(;r&&r.parentNode&&r.parentNode!==e.dom;)r=r.parentNode;return r}const cl=new H.PluginKey("dragHandle");function ug({pluginKey:e=cl,element:t,editor:r,tippyOptions:n,onNodeChange:i}){const o=document.createElement("div");let s=null,c=!1,l=null,u=-1;return t.addEventListener("dragstart",f=>{const{view:d}=r;if(!f.dataTransfer)return;const{empty:h,$from:p,$to:m}=d.state.selection,g=lg(f,r),y=io(p,m,0),S=y.some(C=>g.find($=>$.$from===C.$from&&$.$to===C.$to)),j=h||!S?g:y;if(j.length===0)return;const{tr:w}=d.state,A=document.createElement("div"),O=j[0].$from.pos,M=j[j.length-1].$to.pos,N=Ne.create(d.state.doc,O,M),T=N.content();j.forEach(C=>{const $=sg(d.nodeDOM(C.$from.pos));A.append($)}),A.style.position="absolute",A.style.top="-10000px",document.body.append(A),f.dataTransfer.clearData(),f.dataTransfer.setDragImage(A,0,0),d.dragging={slice:T,move:!0},w.setSelection(N),d.dispatch(w),document.addEventListener("drop",()=>ga(A),{once:!0}),setTimeout(()=>{t&&(t.style.pointerEvents="none")},0)}),t.addEventListener("dragend",()=>{t&&(t.style.pointerEvents="auto")}),new H.Plugin({key:typeof e=="string"?new H.PluginKey(e):e,state:{init:()=>({locked:!1}),apply(f,d){const h=f.getMeta("lockDragHandle"),p=f.getMeta("hideDragHandle");if(h!==void 0&&(c=h),p&&s)return s.hide(),c=!1,l=null,u=-1,i==null||i({editor:r,node:null,pos:-1}),d;if(f.docChanged&&u!==-1&&t&&s){const m=f.mapping.map(u);m!==u&&(u=m)}return d}},view:f=>{return d(),h(r.view.dom),s=xc(f.dom,{...p(),...n}),{update(A,O){if(!m(t,s)||(t.draggable=!c,!g(A,O)))return;const M=y(A);M&&S(A,M)},destroy(){w()}};function d(){t.draggable=!0,t.style.pointerEvents="auto"}function h(A){var O;(O=A.parentElement)==null||O.appendChild(o),o.appendChild(t),Object.assign(o.style,{pointerEvents:"none",position:"absolute",top:"0",left:"0"})}function p(){return{getReferenceClientRect:null,interactive:!0,trigger:"manual",placement:"left-start",hideOnClick:!1,duration:100,zIndex:10,appendTo:o,content:t,popperOptions:{modifiers:[{name:"flip",enabled:!1},{name:"preventOverflow",options:{rootBoundary:"document",mainAxis:!1}}]}}}function m(A,O){return A&&O}function g(A,O){return!A.state.doc.eq(O.doc)&&u!==-1}function y(A){let O=A.nodeDOM(u);return O=ya(A,O),O===A.dom||(O==null?void 0:O.nodeType)!==1?null:O}function S(A,O){const M=A.posAtDOM(O,0),N=va(r.state.doc,M);if(N===l)return;const T=xa(r.state.doc,M);l=N,u=T,i==null||i({editor:r,node:l,pos:u}),j(O)}function j(A){s.setProps({getReferenceClientRect:()=>A.getBoundingClientRect()}),s.show()}function w(){s==null||s.destroy(),t&&ga(o)}},props:{handleDOMEvents:{mouseleave:(f,d)=>{if(c||!h(d))return!1;return p(),m(),!1;function h(g){return g.target&&!o.contains(g.relatedTarget)}function p(){s==null||s.hide()}function m(){l=null,u=-1,i==null||i({editor:r,node:null,pos:-1})}},mousemove:Wt((f,d)=>{if(!t||!s||c)return!1;const h=sl({x:d.clientX,y:d.clientY,direction:"right",editor:r});if(!h.resultElement||h.resultElement===f.dom)return!1;const p=ya(f,h.resultElement);if(p===f.dom||(p==null?void 0:p.nodeType)!==1)return!1;const m=f.posAtDOM(p,0),g=va(r.state.doc,m);if(g===l)return!1;const y=xa(r.state.doc,m);return l=g,u=y,i==null||i({editor:r,node:l,pos:u}),s.setProps({getReferenceClientRect:()=>p.getBoundingClientRect()}),s.show(),!1},100)}}})}var gr=(e=>(e[e.max=7]="max",e[e.min=0]="min",e[e.more=1]="more",e[e.less=-1]="less",e))(gr||{});function dg(e,t,r){return e<t?t:e>r?r:e}function fg(e,t,r,n){const{doc:i,selection:o}=e;if(!i||!o||!(o instanceof H.TextSelection||o instanceof H.AllSelection))return e;const{from:s,to:c}=o;return i.nodesBetween(s,c,(l,u)=>{const f=l.type;return r.includes(f.name)?(e=Gi(e,u,t),!1):!H.isList(l.type.name,n.extensionManager.extensions)}),e}function Gi(e,t,r){if(!e.doc)return e;const n=e.doc.nodeAt(t);if(!n)return e;const s=dg((n.attrs.indent||0)+r,0,7);if(s===n.attrs.indent)return e;const c={...n.attrs,indent:s};return e.setNodeMarkup(t,n.type,c,n.marks)}function hg({delta:e,types:t}){return({state:r,dispatch:n,editor:i})=>{const{selection:o}=r;let{tr:s}=r;return s=s.setSelection(o),s=fg(s,e,t,i),s.docChanged?(n&&n(s),!0):!1}}function pg(e){var T,C,$;const{pluginKey:t=cl}=e,{t:r}=B.useLocale(),[n,i]=b.useState(null),[o,s]=b.useState(-1),c=b.useRef(null),l=b.useRef(null),[u,f]=b.useState(!1),d=e.editor.extensionManager.extensions.some(P=>P.name==="textAlign"),h=e.editor.extensionManager.extensions.some(P=>P.name==="indent"),p=e.editor.extensionManager.extensions.some(P=>P.name==="clear");b.useEffect(()=>{c.current&&!e.editor.isDestroyed&&(l.current=ug({editor:e.editor,element:c.current,pluginKey:"ContentItemMenu",tippyOptions:{offset:[-2,16],zIndex:99,moveTransition:"transform 0.15s ease-out"},onNodeChange:O}),e.editor.registerPlugin(l.current))},[e.editor,c]);function m(){const P=e.editor.chain();P.setNodeSelection(o).unsetAllMarks(),(n==null?void 0:n.type.name)!=="paragraph"&&P.setParagraph(),P.run()}function g(){e.editor.chain().focus().setNodeSelection(o).run(),document.execCommand("copy")}function y(){e.editor.commands.setNodeSelection(o);const{$anchor:P}=e.editor.state.selection,E=P.node(1)||e.editor.state.selection.node;e.editor.chain().setMeta("hideDragHandle",!0).insertContentAt(o+((n==null?void 0:n.nodeSize)||0),E.toJSON()).run()}function S(P){e.editor.commands.setTextAlign(P)}function j(){const P=Gi(e.editor.state.tr,o,1);P.setMeta("hideDragHandle",!0),e.editor.view.dispatch&&e.editor.view.dispatch(P)}function w(){const P=Gi(e.editor.state.tr,o,-1);e.editor.view.dispatch&&e.editor.view.dispatch(P)}function A(){e.editor.chain().setMeta("hideDragHandle",!0).setNodeSelection(o).deleteSelection().run()}function O(P){P.node&&i(P.node),s(P.pos)}function M(){var P;if(o!==-1){const E=(n==null?void 0:n.nodeSize)||0,L=o+E,k=(n==null?void 0:n.type.name)==="paragraph"&&((P=n==null?void 0:n.content)==null?void 0:P.size)===0,Y=k?o+2:L+2;e.editor.chain().command(({dispatch:re,tr:ue,state:ne})=>re?(k?ue.insertText("/",o,o+1):ue.insert(L,ne.schema.nodes.paragraph.create(null,[ne.schema.text("/")])),re(ue)):!0).focus(Y).run()}}b.useEffect(()=>(u?e.editor.commands.setMeta("lockDragHandle",!0):e.editor.commands.setMeta("lockDragHandle",!1),()=>{e.editor.commands.setMeta("lockDragHandle",!1)}),[u]),b.useEffect(()=>()=>{l.current&&(e.editor.unregisterPlugin(t),l.current=null)},[]),b.useEffect(()=>{var P;(P=e.editor)!=null&&P.isDestroyed&&l.current&&(e.editor.unregisterPlugin(t),l.current=null)},[(T=e.editor)==null?void 0:T.isDestroyed]);const N=P=>{e!=null&&e.disabled||f(P)};return a.jsx("div",{ref:c,className:`drag-handle richtext-duration-200 richtext-ease-in-out [transition-property:top,_left] ${e==null?void 0:e.className}`,style:{opacity:e!=null&&e.disabled?0:1},children:a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-0.5 richtext-duration-200 richtext-ease-in-out [transition-property:top,_left]",children:[a.jsx(ge,{className:"!richtext-size-7 richtext-cursor-grab",disabled:e==null?void 0:e.disabled,onClick:M,size:"icon",type:"button",variant:"ghost",children:a.jsx(me,{className:"richtext-text-lg richtext-text-neutral-600 dark:richtext-text-neutral-200",name:"Plus"})}),a.jsxs(Sl,{onOpenChange:N,open:u,children:[a.jsxs("div",{className:"richtext-relative richtext-flex richtext-flex-col",children:[a.jsxs(bo,{children:[a.jsx(wo,{asChild:!0,disabled:e==null?void 0:e.disabled,children:a.jsx(ge,{className:"richtext-relative richtext-z-[1] !richtext-size-7 richtext-cursor-grab",disabled:e==null?void 0:e.disabled,size:"icon",type:"button",variant:"ghost",onMouseUp:P=>{P.preventDefault(),!(e!=null&&e.disabled)&&f(!0)},children:a.jsx(me,{className:"richtext-text-sm richtext-text-neutral-600 dark:richtext-text-neutral-200",name:"Grip"})})}),a.jsx(Cr,{children:r("editor.draghandle.tooltip")})]}),a.jsx(jl,{className:"richtext-absolute richtext-left-0 richtext-top-0 richtext-z-0 richtext-size-[28px]"})]}),a.jsxs(mo,{align:"start",className:"richtext-w-48",side:"bottom",sideOffset:0,children:[a.jsxs(Me,{className:"richtext-flex richtext-gap-3 richtext-bg-opacity-10 hover:richtext-bg-red-400 hover:richtext-bg-opacity-20 focus:richtext-bg-red-400 focus:richtext-bg-opacity-30 focus:richtext-text-red-500 dark:hover:richtext-bg-opacity-20 dark:hover:richtext-text-red-500",onClick:A,children:[a.jsx(me,{name:"Trash2"}),a.jsx("span",{children:r("editor.remove")})]}),p?a.jsxs(Me,{className:"richtext-flex richtext-gap-3",onClick:m,children:[a.jsx(me,{name:"PaintRoller"}),a.jsx("span",{children:r("editor.clear.tooltip")})]}):null,a.jsxs(Me,{className:"richtext-flex richtext-gap-3",onClick:g,children:[a.jsx(me,{name:"Clipboard"}),a.jsx("span",{children:r("editor.copyToClipboard")})]}),a.jsxs(Me,{className:"richtext-flex richtext-gap-3",onClick:y,children:[a.jsx(me,{name:"Copy"}),a.jsx("span",{children:r("editor.copy")})]}),d||h?a.jsx(go,{}):null,d?a.jsxs(Aa,{children:[a.jsxs(Wi,{className:"richtext-flex richtext-gap-3",children:[a.jsx(me,{name:"AlignCenter"}),a.jsx("span",{children:r("editor.textalign.tooltip")})]}),a.jsx(ja,{children:a.jsxs(Vi,{children:[a.jsxs(Me,{className:"richtext-flex richtext-gap-3",onClick:()=>S("left"),children:[a.jsx(me,{name:"AlignLeft"}),a.jsx("span",{children:r("editor.textalign.left.tooltip")})]}),a.jsxs(Me,{className:"richtext-flex richtext-gap-3",onClick:()=>S("center"),children:[a.jsx(me,{name:"AlignCenter"}),a.jsx("span",{children:r("editor.textalign.center.tooltip")})]}),a.jsxs(Me,{className:"richtext-flex richtext-gap-3",onClick:()=>S("right"),children:[a.jsx(me,{name:"AlignRight"}),a.jsx("span",{children:r("editor.textalign.right.tooltip")})]})]})})]}):null,h?a.jsxs(Aa,{children:[a.jsxs(Wi,{className:"richtext-flex richtext-gap-3",children:[a.jsx(me,{name:"IndentIncrease"}),a.jsx("span",{children:r("editor.indent")})]}),a.jsx(ja,{children:a.jsxs(Vi,{children:[a.jsxs(Me,{className:"richtext-flex richtext-gap-3",disabled:((C=n==null?void 0:n.attrs)==null?void 0:C.indent)>=gr.max,onClick:j,children:[a.jsx(me,{name:"IndentIncrease"}),a.jsx("span",{children:r("editor.indent.tooltip")})]}),a.jsxs(Me,{className:"richtext-flex richtext-gap-3",disabled:(($=n==null?void 0:n.attrs)==null?void 0:$.indent)<=gr.min,onClick:w,children:[a.jsx(me,{name:"IndentDecrease"}),a.jsx("span",{children:r("editor.outdent.tooltip")})]})]})})]}):null]})]})]})})}const mg={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function gg({item:e,disabled:t,editor:r}){var i;const n=e.component;return n?a.jsx(n,{...e.componentProps,disabled:t||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:r}):a.jsx(a.Fragment,{})}function xg(e){const{t,lang:r}=B.useLocale(),n=({editor:o})=>{const{selection:s}=o.view.state,{$from:c,to:l}=s;return c.pos===l?!1:s instanceof H.TextSelection},i=b.useMemo(()=>e.disabled||!(e!=null&&e.editor)?[]:ag(e.editor,t),[e.disabled,e.editor,r,t]);return a.jsx(le.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:n,tippyOptions:mg,children:i!=null&&i.length?a.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:a.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-gap-[4px] richtext-whitespace-nowrap",children:i==null?void 0:i.map((o,s)=>(o==null?void 0:o.type)==="divider"?a.jsx(Ee,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"},`bubbleMenu-divider-${s}`):a.jsx(gg,{disabled:e.disabled,editor:e.editor,item:o},`bubbleMenu-text-${s}`))})}):a.jsx(a.Fragment,{})})}function vg(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H3V5h18z"})})}function yg(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 15h15m0 4H6m9-8h6m0-4h-6M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"})})}function bg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5.5 3c1.404 0 2.107 0 2.611.38c.219.164.406.375.552.62C9 4.568 9 5.358 9 6.938v10.125c0 1.58 0 2.37-.337 2.937a2.1 2.1 0 0 1-.552.621c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C2 19.432 2 18.642 2 17.062V6.938c0-1.58 0-2.37.337-2.938a2.1 2.1 0 0 1 .552-.62C3.393 3 4.096 3 5.5 3M20 11.938v5.124c0 1.58 0 2.37-.337 2.938a2.1 2.1 0 0 1-.552.62c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C13 19.433 13 18.642 13 17.063V6.938c0-1.58 0-2.37.337-2.938M22 9l-6-6m6 0l-6 6",color:"currentColor"})})}function wg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M21 18.5c0 1.404 0 2.107-.38 2.611a2.1 2.1 0 0 1-.62.552c-.567.337-1.358.337-2.937.337H6.938c-1.58 0-2.37 0-2.938-.337a2.1 2.1 0 0 1-.62-.552C3 20.607 3 19.904 3 18.5s0-2.107.38-2.611c.163-.218.374-.406.62-.552C4.567 15 5.357 15 6.938 15h10.125c1.58 0 2.37 0 2.937.337c.246.146.457.334.62.552c.38.504.38 1.207.38 2.611M12.063 4H6.937C5.358 4 4.568 4 4 4.337a2.1 2.1 0 0 0-.62.552C3 5.393 3 6.096 3 7.5s0 2.107.38 2.611c.163.218.374.406.62.552C4.567 11 5.357 11 6.938 11h10.125c1.58 0 2.37 0 2.937-.337M21 8l-6-6m6 0l-6 6",color:"currentColor"})})}function Sg(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function me(e){const t=ao[e.name];return t?a.jsx(t,{onClick:e==null?void 0:e.onClick,className:`richtext-w-4 richtext-h-4 ${(e==null?void 0:e.className)||""}`}):null}function jg(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M21 22H3v-2h18zm0-18H3V2h18zm-11 9.7h4l-2-5.4zM11.2 6h1.7l4.7 12h-2l-.9-2.6H9.4L8.5 18h-2z"})})}function ll(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:a.jsx("path",{fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:4,d:"M36 19L24 31L12 19z"})})}function Ag(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M9 7v10h6v-2h-4V7z"})})}function Cg(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M9 7c-1.1 0-2 .9-2 2v8h2V9h2v7h2V9h2v8h2V9a2 2 0 0 0-2-2z"})})}function Ig(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M11 7c-1.1 0-2 .9-2 2v2a2 2 0 0 0 2 2h2v2H9v2h4c1.11 0 2-.89 2-2v-2a2 2 0 0 0-2-2h-2V9h4V7z"})})}function Tg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m-9 8h4m-2-2v4"})})}function Pg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m9 8h4m-2-2v4"})})}function Rg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 21v-4m0-4V9m0-4V3m-2 18h4M8 5v4h11l2-2l-2-2zm6 8v4H6l-2-2l2-2z"})})}function Og(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"currentColor",d:"M23.943 19.806a.2.2 0 0 0-.168-.034c-1.26-1.855-2.873-3.61-4.419-5.315l-.252-.284c-.001-.073-.067-.12-.134-.15l-.084-.084c-.05-.1-.169-.167-.286-.1c-.47.234-.907.585-1.327.919c-.554.434-1.109.87-1.63 1.354a5 5 0 0 0-.588.618c-.084.117-.017.217.084.267c-.37.368-.74.736-1.109 1.12a.2.2 0 0 0-.05.134c0 .05.033.1.067.117l.655.502v.016c.924.92 2.554 2.173 4.285 3.527c.251.201.52.402.773.602c.117.134.234.285.335.418c.05.066.169.084.236.033c.033.034.084.067.118.1a.24.24 0 0 0 .1.034a.15.15 0 0 0 .135-.066a.24.24 0 0 0 .033-.1c.017 0 .017.016.034.016a.2.2 0 0 0 .134-.05l3.058-3.327c.12-.116.014-.267 0-.267m-7.628-.134l-1.546-1.17l-.15-.1c-.035-.017-.068-.05-.102-.067l-.117-.1c.66-.66 1.33-1.308 2-1.956c-.488.484-1.463 1.906-1.261 2.373c.002 0 .018.042.067.084zm4.1 3.126l-1.277-.97a27 27 0 0 0-1.58-1.504c.69.518 1.277.97 1.361 1.053c.673.585.638.485 1.093.87l.554.4c-.074.103-.151.148-.151.151m.336.25l-.034-.016a1 1 0 0 0 .152-.117zM.588 3.476c.033.217.084.435.117.636c.201 1.103.403 2.106.772 2.858l.152.568c.05.217.134.485.219.552a67 67 0 0 0 3.578 2.942a.18.18 0 0 0 .219 0s0 .016.016.016a.15.15 0 0 0 .118.05a.2.2 0 0 0 .134-.05c1.798-1.989 3.142-3.627 4.1-4.998c.068-.066.084-.167.084-.25c.067-.067.118-.151.185-.201c.067-.067.067-.184 0-.235l-.017-.016c0-.033-.017-.084-.05-.1c-.42-.401-.722-.685-1.042-.986a94 94 0 0 1-2.352-2.273c-.017-.017-.034-.034-.067-.034c-.336-.117-1.025-.234-1.882-.385c-1.277-.216-3.008-.517-4.57-.986c0 0-.101 0-.118.017l-.05.05C.05.714.022.707 0 .718c.017.1.017.167.05.284c0 .033.068.301.068.334zm7.19 4.78l-.033.034a.036.036 0 0 1 .033-.034M6.553 2.238c.101.1.521.502.622.585c-.437-.2-1.529-.702-2.034-.869c.505.1 1.194.201 1.412.284M.79 1.403c.252.434.454 1.939.655 3.41c-.118-.469-.201-.936-.302-1.372C.992 2.673.84 1.988.638 1.386c.124 0 .152.021.152.017m-.286-.369c0-.016 0-.033-.017-.033c.085 0 .135.017.202.05c0 .006-.145-.017-.185-.017m23.17-.217c.017-.066-.336-.367-.219-.384c.253-.017.253-.401 0-.401c-.335.017-.688.1-1.008.15c-.587.117-1.192.234-1.78.367a80 80 0 0 0-3.949.937c-.403.117-.857.2-1.243.401c-.135.067-.118.2-.05.284c-.034.017-.051.017-.085.034c-.117.017-.218.034-.335.05c-.102.017-.152.1-.135.2c0 .017.017.05.017.067c-.706.936-1.496 1.923-2.353 2.976c-.84.969-1.73 1.989-2.62 3.042c-2.84 3.31-6.05 7.07-9.594 10.38a.16.16 0 0 0 0 .234c.016.016.033.033.05.033c-.05.05-.101.085-.152.134q-.05.05-.05.1a.4.4 0 0 0-.067.084c-.067.067-.067.184.017.234c.067.066.185.066.235-.017c.017-.017.017-.033.033-.033a.265.265 0 0 1 .37 0c.202.217.404.435.588.618l-.42-.35c-.067-.067-.184-.05-.234.016c-.068.066-.051.184.016.234l4.469 3.727c.034.034.067.034.118.034a.15.15 0 0 0 .117-.05l.101-.1c.017.016.05.016.067.016c.05 0 .084-.016.118-.05c6.049-6.05 10.922-10.614 16.5-14.693c.05-.033.067-.1.067-.15c.067 0 .118-.05.15-.117c1.026-3.125 1.228-5.9 1.295-7.27c0-.059.016-.038.016-.068c.017-.033.017-.05.017-.05a.98.98 0 0 0-.067-.619m-10.82 4.915c.268-.301.537-.619.806-.903c-1.73 2.273-4.603 5.767-8.67 9.929c2.773-3.059 5.562-6.218 7.864-9.026M5.14 23.466c-.016-.017-.016-.017 0-.017zm2.504-2.156c.135-.15.27-.284.42-.434c0 0 0 .016.017.016c-.224.198-.433.418-.437.418m.69-.668c.099-.1.14-.173.284-.318c.992-1.02 2.017-2.04 3.059-3.076l.016-.016c.252-.2.555-.418.824-.619a228 228 0 0 0-4.184 4.029M14.852 3.91c-.554.719-1.176 1.671-1.697 2.423c-1.646 2.374-6.94 8.174-7.057 8.274a1190 1190 0 0 1-4.839 4.597l-.1.1c-.085-.1-.085-.25.016-.334C8.652 11.966 13.19 6.133 15.021 3.576c-.05.116-.084.216-.168.334zm2.906 3.427c-.671-.386-.99-.987-.806-1.572l.05-.2a.8.8 0 0 1 .085-.167a1.9 1.9 0 0 1 .756-.703c.016 0 .033 0 .05-.016c-.017-.034-.017-.084-.017-.134c.017-.1.085-.167.202-.167c.202 0 .824.184 1.059.384c.067.05.134.117.202.184c.084.1.218.268.285.401c.034.017.067.184.118.268c.033.134.067.284.05.418c-.017.016 0 .116-.017.116a1.6 1.6 0 0 1-.218.619c-.03.03.006.012-.05.067a1.2 1.2 0 0 1-.32.334a1.49 1.49 0 0 1-1.26.234a2 2 0 0 0-.169-.066m4.37 1.403c0 .017-.017.05 0 .067c-.034 0-.05.017-.085.034a110 110 0 0 0-3.915 3.025c1.11-.986 2.218-1.989 3.378-2.975c.336-.301.571-.686.638-1.12l.168-1.003v-.033c.085-.201.404-.118.353.1c-.004-.001-.173.795-.537 1.905"})})}function ul(){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",children:[a.jsx("path",{fill:"currentColor",d:"M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"}),a.jsx("path",{fill:"currentColor",d:"M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"})]})}function dl(){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:"icon",viewBox:"0 0 1024 1024",children:[a.jsx("path",{fill:"currentColor",d:"M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"}),a.jsx("path",{fill:"currentColor",d:"m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"})]})}function Eg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentColor",children:[a.jsx("path",{d:"M14.86 22h-4.312c-3.291 0-4.937 0-6.08-.798a4.2 4.2 0 0 1-.863-.805c-.855-1.066-.855-2.6-.855-5.67v-2.545c0-2.963 0-4.445.473-5.628c.761-1.903 2.37-3.403 4.41-4.113C8.9 2 10.49 2 13.667 2c1.816 0 2.723 0 3.448.252c1.166.406 2.085 1.263 2.52 2.35c.27.676.27 1.523.27 3.216V10"}),a.jsx("path",{d:"M2.75 12c0-1.84 1.506-3.333 3.364-3.333c.672 0 1.464.116 2.117-.057a1.67 1.67 0 0 0 1.19-1.179c.174-.647.057-1.432.057-2.098C9.478 3.493 10.984 2 12.84 2m.002 16h2.523m-4.949-4.15c-.126-.8-.281-.801-1.61-.85h-1.01c-.557 0-1.009.448-1.009 1v3c0 .552.452 1 1.01 1h1.816c.39 0 .803-.313.803-.7v-1.1c0-.11-.113-.304-.224-.304H9.068M12.842 13h1.261m0 0h1.262m-1.262 0v4.875M21.251 13h-2.523c-.557 0-1.009.448-1.009 1v1.5m0 0V18m0-2.5h2.523"})]})})}function Mg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:a.jsx("path",{fill:"currentColor",d:"M6.5 3a.75.75 0 0 1 .697.471l3 7.5a.75.75 0 0 1-1.393.557L7.992 9.5H5.008l-.811 2.028a.75.75 0 0 1-1.393-.556l3-7.5A.75.75 0 0 1 6.5 3m0 2.77L5.608 8h1.784zm8.28-1.55a.75.75 0 1 0-1.06 1.06l.72.72h-3.69a.75.75 0 0 0 0 1.5h3.69l-.72.72a.75.75 0 0 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06zm0 7.5a.75.75 0 1 0-1.06 1.06l.72.72H3.75a.75.75 0 0 0 0 1.5h10.69l-.72.72a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06z"})})}function Ng(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",children:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"4",children:[a.jsx("circle",{cx:"10",cy:"24",r:"4"}),a.jsx("circle",{cx:"38",cy:"10",r:"4"}),a.jsx("circle",{cx:"38",cy:"24",r:"4"}),a.jsx("circle",{cx:"38",cy:"38",r:"4"}),a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M34 38H22V10h12M14 24h20"})]})})}function _g(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:a.jsx("path",{fill:"currentColor",d:"M13.5 3a.75.75 0 0 0-.697.471l-3 7.5a.75.75 0 0 0 1.393.557l.812-2.028h2.984l.811 2.028a.75.75 0 0 0 1.393-.556l-3-7.5A.75.75 0 0 0 13.5 3m0 2.77L14.392 8h-1.784zM5.22 4.22a.75.75 0 0 1 1.06 1.06L5.56 6h3.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 0 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06zm0 7.5a.75.75 0 0 1 1.06 1.06l-.72.72h10.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06z"})})}function $g(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548",color:"currentColor"})})}function kg(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}const ao={Bold:R.Bold,LoaderCircle:R.LoaderCircle,Italic:R.Italic,Underline:R.Underline,Quote:R.Quote,TextQuote:yg,Strikethrough:R.Strikethrough,Minus:R.Minus,Eraser:R.Eraser,PaintRoller:R.PaintRoller,Redo2:R.Redo2,Undo2:R.Undo2,AlignCenter:nr.TextAlignCenterIcon,AlignJustify:nr.TextAlignJustifyIcon,AlignLeft:nr.TextAlignLeftIcon,AlignRight:nr.TextAlignRightIcon,ChevronDown:R.ChevronDown,Subscript:R.Subscript,Superscript:R.Superscript,Code:R.Code,Code2:R.CodeXml,Type:R.Type,IndentIncrease:R.IndentIncrease,IndentDecrease:R.IndentDecrease,List:R.List,ListOrdered:R.ListOrdered,ListTodo:R.ListTodo,Link:R.Link,ImageUp:R.ImageUp,Video:R.Video,Maximize:R.Maximize,Minimize:R.Minimize,Table:R.Table,Sparkles:R.Sparkles,Pencil:R.Pencil,Unlink:R.Unlink,BetweenHorizonalEnd:R.BetweenHorizonalEnd,BetweenHorizonalStart:R.BetweenHorizonalStart,BetweenVerticalStart:R.BetweenVerticalStart,BetweenVerticalEnd:R.BetweenVerticalEnd,TableCellsMerge:R.TableCellsMerge,TableCellsSplit:R.TableCellsSplit,Trash2:R.Trash2,Trash:R.Trash,Replace:R.Replace,ChevronsUpDown:R.ChevronsUpDown,LineHeight:jg,Word:Sg,Heading1:R.Heading1,Heading2:R.Heading2,Heading3:R.Heading3,Heading4:R.Heading4,Heading5:R.Heading5,Heading6:R.Heading6,Columns2:R.Columns2,Columns3:R.Columns3,Columns4:R.Columns4,Plus:R.Plus,Grip:R.GripVertical,Copy:R.Copy,Clipboard:R.Clipboard,PanelLeft:R.PanelLeft,PanelRight:R.PanelRight,Columns:R.Columns2,Iframe:R.Frame,MenuDown:ll,SizeS:Ig,SizeM:Cg,SizeL:Ag,AspectRatio:vg,Emoji:R.SmilePlus,DeleteColumn:bg,DeleteRow:wg,SearchAndReplace:R.Replace,EmojiIcon:R.SmilePlusIcon,KatexIcon:R.Sigma,ExportPdf:ul,ExportWord:dl,ImportWord:kg,ColumnAddLeft:Tg,ColumnAddRight:Pg,BookMarked:R.BookMarked,Excalidraw:Og,ZoomIn:R.ZoomIn,ZoomOut:R.ZoomOut,Settings:R.Settings,Eye:R.Eye,TextDirection:Rg,LeftToRight:Mg,RightToLeft:_g,Attachment:R.Paperclip,GifIcon:Eg,ChevronUp:R.ChevronUp,Crop:R.CropIcon,Mermaid:Ng,Twitter:$g,FlipX:R.FlipVertical,FlipY:R.FlipHorizontal,PencilRuler:R.PencilRuler,WrapText:R.WrapText};function Lg({fill:e}){return a.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("g",{id:"icon/填充色",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",children:a.jsxs("g",{id:"icon/背景颜色",children:[a.jsx("g",{id:"编组",fill:"currentColor",children:a.jsxs("g",{transform:"translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)",id:"矩形",children:[a.jsx("path",{d:"M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z",fillRule:"nonzero"}),a.jsx("path",{d:"M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z",fillRule:"evenodd"}),a.jsx("path",{d:"M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z",fillRule:"nonzero"})]})}),a.jsx("path",{d:"M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z",id:"矩形",fill:e||"#FBDE28"})]})})})}function fl(e){const[t,r]=b.useState(void 0);function n(s){var c;(c=e.action)==null||c.call(e,s)}function i(){var s;(s=e.action)==null||s.call(e,t)}const o=b.useCallback(Wt(s=>{r(s)},350),[]);return a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-h-[32px]",children:[a.jsx(F,{tooltip:e==null?void 0:e.tooltip,disabled:e==null?void 0:e.disabled,action:i,tooltipOptions:e==null?void 0:e.tooltipOptions,shortcutKeys:e==null?void 0:e.shortcutKeys,children:a.jsx("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-text-sm",children:a.jsx(Lg,{fill:t})})}),a.jsx(lu,{selectedColor:t,setSelectedColor:o,onChange:n,highlight:!0,disabled:e==null?void 0:e.disabled,children:a.jsx(ge,{variant:"ghost",size:"icon",className:"!richtext-w-3 !richtext-h-[32px]",disabled:e==null?void 0:e.disabled,children:a.jsx(me,{className:"!richtext-w-3 !richtext-h-3 richtext-text-zinc-500",name:"MenuDown"})})})]})}function Dg({editor:e,disabled:t,actions:r}){var y,S,j,w,A,O,M,N,T,C,$,P,E,L,k,Y,re,ue;const n=({editor:ne})=>H.isActive(ne.view.state,"table"),{t:i}=B.useLocale();function o(){e.chain().focus().addColumnBefore().run()}function s(){e.chain().focus().addColumnAfter().run()}function c(){e.chain().focus().deleteColumn().run()}function l(){e.chain().focus().addRowBefore().run()}function u(){e.chain().focus().addRowAfter().run()}function f(){e.chain().focus().deleteRow().run()}function d(){e.chain().focus().mergeCells().run()}function h(){e==null||e.chain().focus().splitCell().run()}function p(){e.chain().focus().deleteTable().run()}function m(ne){e.chain().focus().setTableCellBackground(ne).run()}const g=()=>{var Pe;const{view:ne,state:{selection:{from:Q}}}=e,xe=ne.domAtPos(Q).node;if(!xe)return new DOMRect(-1e3,-1e3,0,0);const fe=(Pe=xe==null?void 0:xe.closest)==null?void 0:Pe.call(xe,".tableWrapper");return fe?fe.getBoundingClientRect():new DOMRect(-1e3,-1e3,0,0)};return a.jsx(le.BubbleMenu,{editor:e,pluginKey:"table",shouldShow:n,updateDelay:0,tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},maxWidth:"auto",getReferenceClientRect:g,plugins:[xc.sticky],sticky:"popper"},children:t?a.jsx(a.Fragment,{}):a.jsxs("div",{className:"richtext-flex richtext-size-full richtext-min-w-32 richtext-flex-row richtext-items-center richtext-gap-0.5 richtext-rounded-lg !richtext-border richtext-border-border richtext-bg-background richtext-p-2 richtext-leading-none richtext-shadow-sm",children:[a.jsx(F,{action:o,disabled:!((S=(y=e==null?void 0:e.can())==null?void 0:y.addColumnBefore)!=null&&S.call(y)),icon:"BetweenHorizonalEnd",tooltip:i("editor.table.menu.insertColumnBefore"),"tooltip-options":{sideOffset:15}}),a.jsx(F,{action:s,disabled:!((w=(j=e==null?void 0:e.can())==null?void 0:j.addColumnAfter)!=null&&w.call(j)),icon:"BetweenHorizonalStart",tooltip:i("editor.table.menu.insertColumnAfter"),"tooltip-options":{sideOffset:15}}),a.jsx(F,{action:c,disabled:!((O=e==null?void 0:(A=e.can()).deleteColumn)!=null&&O.call(A)),icon:"DeleteColumn",tooltip:i("editor.table.menu.deleteColumn"),"tooltip-options":{sideOffset:15}}),a.jsx(Ee,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}),a.jsx(F,{action:l,disabled:!((N=e==null?void 0:(M=e.can()).addRowBefore)!=null&&N.call(M)),icon:"BetweenVerticalEnd",tooltip:i("editor.table.menu.insertRowAbove"),"tooltip-options":{sideOffset:15}}),a.jsx(F,{action:u,disabled:!((C=(T=e==null?void 0:e.can())==null?void 0:T.addRowAfter)!=null&&C.call(T)),icon:"BetweenVerticalStart",tooltip:i("editor.table.menu.insertRowBelow"),"tooltip-options":{sideOffset:15}}),a.jsx(F,{action:f,disabled:!((P=($=e==null?void 0:e.can())==null?void 0:$.deleteRow)!=null&&P.call($)),icon:"DeleteRow",tooltip:i("editor.table.menu.deleteRow"),"tooltip-options":{sideOffset:15}}),a.jsx(Ee,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}),a.jsx(F,{action:d,disabled:!((L=(E=e==null?void 0:e.can())==null?void 0:E.mergeCells)!=null&&L.call(E)),icon:"TableCellsMerge",tooltip:i("editor.table.menu.mergeCells"),"tooltip-options":{sideOffset:15}}),a.jsx(F,{action:h,disabled:!((Y=(k=e==null?void 0:e.can())==null?void 0:k.splitCell)!=null&&Y.call(k)),icon:"TableCellsSplit",tooltip:i("editor.table.menu.splitCells"),"tooltip-options":{sideOffset:15}}),a.jsx(Ee,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}),a.jsx(fl,{action:m,editor:e,tooltip:i("editor.table.menu.setCellsBgColor"),tooltipOptions:{sideOffset:15}}),a.jsx(F,{action:p,disabled:!((ue=(re=e==null?void 0:e.can())==null?void 0:re.deleteTable)!=null&&ue.call(re)),icon:"Trash2",tooltip:i("editor.table.menu.deleteTable"),"tooltip-options":{sideOffset:15}}),r&&r.map((ne,Q)=>a.jsx(F,{...ne},Q))]})})}function hl(e){const{t}=B.useLocale(),[r,n]=b.useState({text:"",link:""}),[i,o]=b.useState(!1);b.useEffect(()=>{var c;if(e!=null&&e.editor){const{href:l,target:u}=(c=e.editor)==null?void 0:c.getAttributes("link"),{from:f,to:d}=e.editor.state.selection,h=e.editor.state.doc.textBetween(f,d," ");n({link:l||"",text:h}),o(u==="_blank")}},[e==null?void 0:e.editor]);function s(c){c.preventDefault(),c.stopPropagation(),e==null||e.onSetLink(r.link,r.text,i)}return a.jsx("div",{className:"border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:a.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:s,children:[a.jsx(He,{className:"mb-[6px]",children:t("editor.link.dialog.text")}),a.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:a.jsx(je,{className:"richtext-w-80",onChange:c=>n({...r,text:c.target.value}),placeholder:"Text",required:!0,type:"text",value:r.text})})}),a.jsx(He,{className:"mb-[6px]",children:t("editor.link.dialog.link")}),a.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsxs("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:[a.jsx(je,{className:"richtext-pl-10",onChange:c=>n({...r,link:c.target.value}),required:!0,type:"url",value:r.link}),a.jsx("span",{className:"richtext-absolute richtext-inset-y-0 richtext-start-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2",children:a.jsx(me,{className:"richtext-size-5 richtext-text-muted-foreground",name:"Link"})})]})}),a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-space-x-2",children:[a.jsx(He,{children:t("editor.link.dialog.openInNewTab")}),a.jsx(xo,{checked:i,onCheckedChange:c=>{o(c)}})]}),a.jsx(ge,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:t("editor.link.dialog.button.apply")})]})})}function Bg(e){const{t}=B.useLocale();return a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black richtext-border-neutral-200 dark:richtext-border-neutral-800",children:[a.jsx("a",{href:e==null?void 0:e.link,target:"_blank",rel:"noopener noreferrer",className:"richtext-text-sm richtext-underline richtext-break-all",children:mm(e==null?void 0:e.link,{length:50,omission:"…"})}),(e==null?void 0:e.link)&&a.jsx(Ee,{orientation:"vertical",className:"!richtext-h-4"}),a.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[a.jsx(F,{icon:"Pencil",tooltip:t("editor.link.edit.tooltip"),action:()=>{e==null||e.onEdit()},tooltipOptions:{sideOffset:15}}),a.jsx(F,{icon:"Unlink",tooltip:t("editor.link.unlink.tooltip"),action:()=>{e==null||e.onClear()},tooltipOptions:{sideOffset:15}})]})]})}function qg({editor:e,disabled:t}){const[r,n]=b.useState(!1),i=b.useMemo(()=>{const{href:l}=e.getAttributes("link");return l},[e]),o=b.useCallback(({editor:l})=>l.isActive("link"),[]),s=(l,u,f)=>{e.chain().extendMarkRange("link").insertContent({type:"text",text:u,marks:[{type:"link",attrs:{href:l,target:f?"_blank":""}}]}).setLink({href:l}).focus().run(),n(!1)},c=b.useCallback(()=>{e.chain().extendMarkRange("link").unsetLink().focus().run(),n(!1)},[e]);return a.jsx(a.Fragment,{children:a.jsx(le.BubbleMenu,{editor:e,shouldShow:o,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{n(!1)}},children:t?a.jsx(a.Fragment,{}):a.jsx(a.Fragment,{children:r?a.jsx(hl,{onSetLink:s,editor:e}):a.jsx(Bg,{editor:e,onClear:c,onEdit:()=>{n(!0)},link:i})})})})}const zg=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,so=H.Node.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",H.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[H.nodeInputRule({find:zg,type:this.type,getAttributes:e=>{const[,,t,r,n]=e;return{src:r,alt:t,title:n}}})]}}),Vt=Ce.Root,Xt=Ce.Trigger,Fg=Ce.Portal,pl=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ce.Overlay,{ref:r,className:Z("richtext-fixed richtext-inset-0 richtext-z-50 richtext-bg-black/80 richtext- data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0",e),...t}));pl.displayName=Ce.Overlay.displayName;const jt=ee.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Fg,{children:[a.jsx(pl,{}),a.jsxs(Ce.Content,{ref:n,className:Z("richtext-dialog-content richtext-fixed richtext-left-[50%] richtext-top-[50%] richtext-z-50 richtext-grid richtext-w-full richtext-max-w-lg richtext-translate-x-[-50%] richtext-translate-y-[-50%] richtext-gap-4 richtext-border richtext-bg-background richtext-p-6 richtext-shadow-lg richtext-duration-200 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[state=closed]:richtext-slide-out-to-left-1/2 data-[state=closed]:richtext-slide-out-to-top-[48%] data-[state=open]:richtext-slide-in-from-left-1/2 data-[state=open]:richtext-slide-in-from-top-[48%] sm:richtext-rounded-lg",e),...r,children:[t,a.jsxs(Ce.Close,{className:"richtext-absolute richtext-right-4 richtext-top-4 richtext-rounded-sm richtext-opacity-70 richtext-ring-offset-background richtext-transition-opacity hover:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none data-[state=open]:richtext-bg-accent data-[state=open]:richtext-text-muted-foreground",children:[a.jsx(R.X,{className:"richtext-h-4 richtext-w-4"}),a.jsx("span",{className:"richtext-sr-only",children:"Close"})]})]})]}));jt.displayName=Ce.Content.displayName;function ml({className:e,...t}){return a.jsx("div",{className:Z("richtext-flex richtext-flex-col richtext-space-y-1.5 richtext-text-center sm:richtext-text-left",e),...t})}ml.displayName="DialogHeader";function wr({className:e,...t}){return a.jsx("div",{className:Z("richtext-flex richtext-flex-col-reverse sm:richtext-flex-row sm:richtext-justify-end sm:richtext-space-x-2",e),...t})}wr.displayName="DialogFooter";const At=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ce.Title,{ref:r,className:Z("richtext-text-lg richtext-font-semibold richtext-leading-none richtext-tracking-tight",e),...t}));At.displayName=Ce.Title.displayName;const Hg=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ce.Description,{ref:r,className:Z("richtext-text-sm richtext-text-muted-foreground",e),...t}));Hg.displayName=Ce.Description.displayName;const ba=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,wa=le.clsx,Sr=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return wa(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(u=>{const f=r==null?void 0:r[u],d=o==null?void 0:o[u];if(f===null)return null;const h=ba(f)||ba(d);return i[u][h]}),c=r&&Object.entries(r).reduce((u,f)=>{let[d,h]=f;return h===void 0||(u[d]=h),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:d,className:h,...p}=f;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...o,...c}[g]):{...o,...c}[g]===y})?[...u,d,h]:u},[]);return wa(e,s,l,r==null?void 0:r.class,r==null?void 0:r.className)},Ug=Sr("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50",{variants:{variant:{default:"!richtext-bg-primary !richtext-text-primary-foreground hover:!richtext-bg-primary/90",destructive:"richtext-bg-destructive richtext-text-destructive-foreground hover:richtext-bg-destructive/90",outline:"richtext-border richtext-border-input richtext-bg-background hover:richtext-bg-accent hover:richtext-text-accent-foreground",secondary:"richtext-bg-secondary richtext-text-secondary-foreground hover:richtext-bg-secondary/80",ghost:"hover:richtext-bg-accent hover:richtext-text-accent-foreground",link:"richtext-text-primary richtext-underline-offset-4 hover:richtext-underline"},size:{default:"richtext-h-10 richtext-px-4 richtext-py-2",sm:"richtext-h-9 richtext-rounded-md richtext-px-3",lg:"richtext-h-11 richtext-rounded-md richtext-px-8",icon:"richtext-h-10 richtext-w-10"}},defaultVariants:{variant:"default",size:"default"}}),ge=ee.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...i},o)=>{const s=n?gc.Slot:"button";return a.jsx(s,{className:Z(Ug({variant:t,size:r,className:e})),ref:o,...i})});ge.displayName="Button";function Gg(e){return e.replace(/^.*\/|\..+$/g,"")}function Wg(e){return e.split(".").pop()}function Vg(e){return e<1024?`${e} Byte`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function Xg(e){return e?e==="application/pdf"?"pdf":e.startsWith("application/")&&[".document","word"].some(t=>e.includes(t))?"word":e.startsWith("application/")&&["presentation"].some(t=>e.includes(t))?"excel":e.startsWith("application/")&&["sheet"].some(t=>e.includes(t))?"ppt":e.startsWith("image")?"image":e.startsWith("audio")?"audio":e.startsWith("video")?"video":"file":"file"}function Yg(e){return new Promise(t=>{const r=new FileReader;r.addEventListener("load",()=>{t({alt:e.name,src:r.result})},!1),r.readAsDataURL(e)})}function gl(e,t){const r=e.split(","),n=r[0].match(/:(.*?);/)[1],i=atob(r[r.length-1]);let o=i.length;const s=new Uint8Array(o);for(;o--;)s[o]=i.charCodeAt(o);return new File([s],t,{type:n})}function Kg({editor:e,imageInline:t,onClose:r}){const{t:n}=B.useLocale(),[i,o]=b.useState(!1),s=b.useRef(null),[c,l]=b.useState(),[u,f]=b.useState(""),d=b.useRef(null),[h,p]=b.useState({src:"",file:null});function m(w){if(s.current&&w.width&&w.height){const A=g(s.current,w);f(A)}}function g(w,A){const O=document.createElement("canvas"),M=w.naturalWidth/w.width,N=w.naturalHeight/w.height;O.width=A.width*M,O.height=A.height*N;const T=O.getContext("2d");return T&&(T.imageSmoothingEnabled=!1,T.drawImage(w,A.x*M,A.y*N,A.width*M,A.height*N,0,0,A.width*M,A.height*N)),O.toDataURL("image/png",1)}async function y(){var w,A;try{const O=gl(u,((w=h==null?void 0:h.file)==null?void 0:w.name)||"image.png"),M=(A=e.extensionManager.extensions.find(T=>T.name===wt.name))==null?void 0:A.options;let N="";M.upload?N=await M.upload(O):N=URL.createObjectURL(O),e.chain().focus().setImageInline({src:N,inline:t}).run(),o(!1),p({src:"",file:null}),r()}catch(O){console.log("Error cropping image",O)}}function S(w){var A;w.preventDefault(),(A=d.current)==null||A.click()}const j=async w=>{var N;const A=(N=w==null?void 0:w.target)==null?void 0:N.files;if(!e||e.isDestroyed||A.length===0)return;const O=A[0],M=await Yg(O);o(!0),p({src:M.src,file:O})};return a.jsxs(a.Fragment,{children:[a.jsx(ge,{className:"richtext-mt-1 richtext-w-full",onClick:S,size:"sm",children:n("editor.image.dialog.tab.uploadCrop")}),a.jsxs(Vt,{open:i,children:[a.jsx(Xt,{}),a.jsxs(jt,{children:[a.jsx(At,{children:n("editor.image.dialog.tab.uploadCrop")}),a.jsx("div",{children:h.src&&a.jsx(Pu,{className:"richtext-w-full",crop:c,onChange:w=>l(w),onComplete:w=>m(w),children:a.jsx("img",{alt:"Crop me",ref:s,src:h.src})})}),a.jsxs(wr,{children:[a.jsxs(ge,{onClick:()=>{o(!1),p({src:"",file:null})},children:[n("editor.imageUpload.cancel"),a.jsx(me,{className:"richtext-ml-[4px]",name:"Trash2"})]}),a.jsxs(ge,{className:"richtext-w-fit",onClick:y,children:[n("editor.imageUpload.crop"),a.jsx(me,{className:"richtext-ml-[4px]",name:"Crop"})]})]})]})]}),a.jsx("input",{accept:"image/*",multiple:!0,onChange:j,ref:d,type:"file",style:{display:"none"}})]})}function jr(e){function t(){const o=b.useRef(e),s=b.useCallback(()=>o.current,[]),c=b.useRef(new Set),l=b.useCallback(f=>{o.current={...o.current,...f},c.current.forEach(d=>d())},[]),u=b.useCallback(f=>(c.current.add(f),()=>c.current.delete(f)),[]);return{get:s,set:l,subscribe:u}}const r=b.createContext(null);function n({children:o}){return a.jsx(r.Provider,{value:t(),children:o})}function i(o){const s=b.useContext(r);if(!s)throw new Error("Store not found");return[b.useSyncExternalStore(s.subscribe,()=>o(s.get()),()=>o(e)),s.set]}return{Provider:n,useStore:i}}jr({value:!1});jr({value:!1});const{Provider:Zg,useStore:xl}=jr({value:!1}),{Provider:Jg,useStore:vl}=jr({value:"light"});B.d("0");function qt(e,t){return window.addEventListener(e,t),()=>{window.removeEventListener(e,t)}}function Ar(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}const nt={UPLOAD_IMAGE:e=>`UPLOAD_IMAGE-${e}`,UPLOAD_VIDEO:e=>`UPLOAD_VIDEO-${e}`,EDIT:e=>`EDIT-${e}`,UPDATE_THEME:e=>`UPDATE_THEME-${e}`,SEARCH_REPLCE:"SEARCH_REPLACE"},yl={setOpen:(e,t)=>{Ar(nt.UPLOAD_IMAGE(e),t)}};function Qg(e){var m;const{t}=B.useLocale(),[r,n]=b.useState(!1),i=g=>{n(g.detail)},[o,s]=b.useState(""),c=b.useRef(null),[l,u]=b.useState(((m=e.editor.extensionManager.extensions.find(g=>g.name===wt.name))==null?void 0:m.options.defaultInline)||!1),f=b.useMemo(()=>{var y;return(y=e.editor.extensionManager.extensions.find(S=>S.name===wt.name))==null?void 0:y.options},[e.editor]);b.useEffect(()=>{const g=qt(nt.UPLOAD_IMAGE(e.editor.id),i);return()=>{g()}},[]);async function d(g){var w;const y=(w=g==null?void 0:g.target)==null?void 0:w.files;if(!e.editor||e.editor.isDestroyed||y.length===0)return;const S=y[0];let j="";f.upload?j=await f.upload(S):j=URL.createObjectURL(S),e.editor.chain().focus().setImageInline({src:j,inline:l}).run(),n(!1),u(!1)}function h(g){g.preventDefault(),g.stopPropagation(),e.editor.chain().focus().setImageInline({src:o,inline:l}).run(),n(!1),u(!1),s("")}function p(g){var y;g.preventDefault(),(y=c.current)==null||y.click()}return a.jsxs(Vt,{onOpenChange:n,open:r,children:[a.jsx(Xt,{asChild:!0,children:a.jsx(F,{action:()=>n(!0),icon:e.icon,tooltip:e.tooltip})}),a.jsxs(jt,{children:[a.jsx(At,{children:t("editor.image.dialog.title")}),a.jsxs(Il,{activationMode:"manual",defaultValue:f.resourceImage==="both"||f.resourceImage==="upload"?"upload":"link",children:[a.jsxs(vo,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[f.resourceImage==="both"||f.resourceImage==="upload"?a.jsx(Ft,{value:"upload",children:t("editor.image.dialog.tab.upload")}):a.jsx(a.Fragment,{}),f.resourceImage==="both"||f.resourceImage==="link"?a.jsx(Ft,{value:"link",children:t("editor.image.dialog.tab.url")}):a.jsx(a.Fragment,{})]}),a.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[a.jsx(Nl,{checked:l,onCheckedChange:g=>{u(g)}}),a.jsx(He,{children:t("editor.link.dialog.inline")})]}),a.jsxs(Ht,{value:"upload",children:[a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[a.jsx(ge,{className:"richtext-mt-1 richtext-w-full",onClick:p,size:"sm",children:t("editor.image.dialog.tab.upload")}),a.jsx(Kg,{editor:e.editor,imageInline:l,onClose:()=>yl.setOpen(e.editor.id,!1)})]}),a.jsx("input",{accept:"image/*",multiple:!0,onChange:d,ref:c,type:"file",style:{display:"none"}})]}),a.jsx(Ht,{value:"link",children:a.jsx("form",{onSubmit:h,children:a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[a.jsx(je,{autoFocus:!0,onChange:g=>s(g.target.value),placeholder:t("editor.image.dialog.placeholder"),required:!0,type:"url",value:o}),a.jsx(ge,{type:"submit",children:t("editor.image.dialog.button.apply")})]})})})]})]})]})}const ar={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function ex(e){var N,T;const[t,r]=b.useState({width:B.IMAGE_MAX_SIZE,height:B.IMAGE_MAX_SIZE}),[n,i]=b.useState({width:0,height:0}),[o]=b.useState([ar.TOP_LEFT,ar.TOP_RIGHT,ar.BOTTOM_LEFT,ar.BOTTOM_RIGHT]),[s,c]=b.useState(!1),[l,u]=b.useState({x:0,y:0,w:0,h:0,dir:""}),{align:f,inline:d}=(N=e==null?void 0:e.node)==null?void 0:N.attrs,h=b.useMemo(()=>{var Q;const{src:C,alt:$,width:P,height:E,flipX:L,flipY:k}=(Q=e==null?void 0:e.node)==null?void 0:Q.attrs,Y=mr(P)?`${P}px`:P,re=mr(E)?`${E}px`:E,ue=[];L&&ue.push("rotateX(180deg)"),k&&ue.push("rotateY(180deg)");const ne=ue.join(" ");return{src:C||void 0,alt:$||void 0,style:{width:Y||void 0,height:re||void 0,transform:ne||"none"}}},[(T=e==null?void 0:e.node)==null?void 0:T.attrs]),p=b.useMemo(()=>{const{style:{width:C}}=h;return{width:C==="100%"?C:void 0}},[h]);function m(C){i({width:C.target.width,height:C.target.height})}function g(){const{editor:C,getPos:$}=e;C.commands.setNodeSelection($())}const y=b.useCallback(bt(()=>{const{editor:C}=e,{width:$}=getComputedStyle(C.view.dom);r(P=>({...P,width:Number.parseInt($,10)}))},B.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function S(C,$){C.preventDefault(),C.stopPropagation();const P=n.width,E=n.height,L=P/E;let k=Number(e.node.attrs.width),Y=Number(e.node.attrs.height);const re=t.width;k&&!Y?(k=k>re?re:k,Y=Math.round(k/L)):Y&&!k?(k=Math.round(Y*L),k=k>re?re:k):!k&&!Y?(k=P>re?re:P,Y=Math.round(k/L)):k=k>re?re:k,c(!0),u({x:C.clientX,y:C.clientY,w:k,h:Y,dir:$})}const j=b.useCallback(bt(C=>{if(C.preventDefault(),C.stopPropagation(),!s)return;const{x:$,w:P,dir:E}=l,L=(C.clientX-$)*(/l/.test(E)?-1:1),k=Fc(P+L,B.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:k,height:null})},B.IMAGE_THROTTLE_WAIT_TIME),[s,l,t,e.updateAttributes]),w=b.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s&&(u({x:0,y:0,w:0,h:0,dir:""}),c(!1),g())},[s,g]),A=b.useCallback(()=>{document==null||document.addEventListener("mousemove",j,!0),document==null||document.addEventListener("mouseup",w,!0)},[j,w]),O=b.useCallback(()=>{document==null||document.removeEventListener("mousemove",j,!0),document==null||document.removeEventListener("mouseup",w,!0)},[j,w]);b.useEffect(()=>(s?A():O(),()=>{O()}),[s,A,O]);const M=b.useMemo(()=>new ResizeObserver(()=>y()),[y]);return b.useEffect(()=>(M.observe(e.editor.view.dom),()=>{M.disconnect()}),[e.editor.view.dom,M]),a.jsx(le.NodeViewWrapper,{as:d?"span":"div",className:"image-view",style:{...p,textAlign:f,display:d?"inline":"block"},children:a.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:p,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,children:[a.jsx("img",{alt:h.alt,className:"image-view__body__image block",height:"auto",onClick:g,onLoad:m,src:h.src,style:h.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&a.jsx("div",{className:"image-resizer",children:o==null?void 0:o.map(C=>a.jsx("span",{className:`image-resizer__handler image-resizer__handler--${C}`,onMouseDown:$=>S($,C)},`image-dir-${C}`))})]})})}const yt=new H.PluginKey("upload-image");function tx(){return new H.Plugin({key:yt,state:{init(){return H.DecorationSet.empty},apply(e,t){t=t.map(e.mapping,e.doc);const r=e.getMeta(yt);if(r!=null&&r.add)for(const{id:n,pos:i,src:o}of r.add){const s=rx(o),c=H.Decoration.widget(i,s,{id:n});t=t.add(e.doc,[c])}else if(r!=null&&r.remove)for(const n of r.remove)t=t.remove(t.find(void 0,void 0,i=>i.id===n));return t}},props:{decorations(e){return this.getState(e)}}})}function rx(e){const t=document.createElement("div"),r=document.createElement("img");return r.setAttribute("class","opacity-50"),r.src=e,r.addEventListener("load",()=>{t.setAttribute("class","img-placeholder")}),t.append(r),t}function nx(e,t){var i;const n=yt.getState(e).find(void 0,void 0,o=>o.id===t);return n.length>0?(i=n[0])==null?void 0:i.from:null}function ix({validateFn:e,onUpload:t,postUpload:r,defaultInline:n=!1}){return(i,o,s)=>{for(const c of i){if(e&&!e(c))continue;const l=Date.now().toString(),u=o.state.tr;u.selection.empty||u.deleteSelection();const f=URL.createObjectURL(c);u.setMeta(yt,{add:[{id:l,pos:s,src:f}]}),o.dispatch(u),t(c).then(async d=>{var j;r&&typeof d=="string"&&(d=await r(d));const{schema:h}=o.state;let p=nx(o.state,l);if(p===null)return;const m=typeof d=="object"?f:d,g=(j=h.nodes.image)==null?void 0:j.create({src:m,inline:n});if(!g)return;const{doc:y}=o.state;p>y.content.size&&(p=y.content.size-1);const S=o.state.tr.replaceWith(p,p,g).setMeta(yt,{remove:[l]});o.dispatch(S)},()=>{const d=o.state.tr.delete(s,s).setMeta(yt,{remove:[l]});o.dispatch(d)})}}}function ox(e,t,r){var i;const n=[...((i=t.clipboardData)==null?void 0:i.files)||[]];if(n.length>0){t.preventDefault();const o=e.state.selection.from;return r(n,e,o+1),!0}return!1}function ax(e,t,r,n){var o;const i=[...((o=t.dataTransfer)==null?void 0:o.files)||[]];if(!r&&i.length>0){t.preventDefault();const s=e.posAtCoords({left:t.clientX,top:t.clientY});if(s)return n(i,e,s.pos+1),!0}return!1}const sx={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5,resourceImage:"both",defaultInline:!1},wt=so.extend({group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){var e;return{...sx,...(e=this.parent)==null?void 0:e.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:t,extension:r,t:n})=>{var i,o;return{component:Qg,componentProps:{action:()=>!0,upload:r.options.upload,disabled:!((o=(i=t.can()).setImage)!=null&&o.call(i,{})),icon:"ImageUp",tooltip:n("editor.image.tooltip"),editor:t}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),flipX:{default:!1},flipY:{default:!1},width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||null;return r?Number.parseInt(r,10):null},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})},inline:{default:!1,parseHTML:t=>!!t.getAttribute("inline"),renderHTML:t=>({inline:t.inline})}}},addNodeView(){return le.ReactNodeViewRenderer(ex)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageInline:t=>({commands:r})=>r.insertContent({type:this.name,attrs:{...t,inline:t.inline??this.options.defaultInline}}),updateImage:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImage:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{flipX:t,flipY:r,align:n,inline:i}=e,o=t||r?`transform: rotateX(${t?"180":"0"}deg) rotateY(${r?"180":"0"}deg);`:"",s=n?`text-align: ${n};`:"";return[i?"span":"div",{style:s,class:"image"},["img",H.mergeAttributes({height:"auto",style:o},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"span.image img",getAttrs:e=>{var o;const t=e==null?void 0:e.parentElement,r=e==null?void 0:e.getAttribute("width"),n=(e==null?void 0:e.getAttribute("flipx"))||!1,i=(e==null?void 0:e.getAttribute("flipy"))||!1;return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),caption:e==null?void 0:e.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(e==null?void 0:e.getAttribute("align"))||((o=t==null?void 0:t.style)==null?void 0:o.textAlign)||null,inline:(e==null?void 0:e.getAttribute("inline"))||!1,flipX:n==="true",flipY:i==="true"}}},{tag:"div[class=image]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width"),n=(t==null?void 0:t.getAttribute("flipx"))||!1,i=(t==null?void 0:t.getAttribute("flipy"))||!1;return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),caption:t==null?void 0:t.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null,inline:(t==null?void 0:t.getAttribute("inline"))||!1,flipX:n==="true",flipY:i==="true"}}}]},addProseMirrorPlugins(){const t=ix({validateFn:r=>!(!this.options.acceptMimes.includes(r.type)||r.size>this.options.maxSize),onUpload:this.options.upload,defaultInline:this.options.defaultInline});return[new H.Plugin({props:{handlePaste:(r,n)=>!n.clipboardData||[...n.clipboardData.files||[]].some(o=>o.type==="text/html")?!1:ox(r,n,t),handleDrop:(r,n,i,o)=>(!(n instanceof DragEvent)||!n.dataTransfer||ax(r,n,o,t),!1)}}),tx()]}});function cx({selectImage:e,giphyApiKey:t,children:r}){const[n,i]=b.useState([]),[o]=b.useState(15),s=b.useRef(null),c=(u,f="search")=>{if(!t)return;const h=`${f==="search"?`https://api.giphy.com/v1/gifs/search?q=${u}`:`https://api.giphy.com/v1/gifs/trending?q=${u}`}&limit=${o}&api_key=${t}`;fetch(h).then(p=>p.json()).then(p=>{i(p.data)}).catch(p=>{console.log(p)})};b.useEffect(()=>{c("","trend")},[]);const l=b.useCallback(Wt(u=>{if(!u.target.value){c("","trend");return}c(u.target.value)},350),[]);return a.jsxs(Yt,{modal:!0,children:[a.jsx(Kt,{asChild:!0,children:r}),a.jsx(Ct,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:t?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"richtext-mb-[10px] richtext-w-full",children:a.jsx(je,{onChange:l,placeholder:"Search GIF",ref:s,type:"text"})}),a.jsx("div",{className:"richtext-max-h-[280px] richtext-overflow-y-auto",children:a.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1 ",children:n!=null&&n.length?n==null?void 0:n.map(u=>a.jsx("img",{alt:"giphy",className:"richtext-cursor-pointer richtext-text-center",height:u.images.fixed_width_downsampled.height,onClick:()=>e(u),src:u.images.fixed_width_downsampled.url,width:u.images.fixed_width_downsampled.width},`giphy-${u.id}`)):a.jsx("p",{children:"No GIFs found"})})})]}):a.jsx("div",{children:a.jsx("p",{children:"Missing Giphy API Key"})})})]})}function lx({editor:e,icon:t,giphyApiKey:r,...n}){const i=o=>{const{url:s}=o.images.original;e.chain().focus().setImageGif({src:s}).run()};return a.jsx(cx,{giphyApiKey:r,selectImage:i,children:a.jsx(F,{icon:t,tooltip:n==null?void 0:n.tooltip})})}const sr={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function ux(e){var M,N;const[t,r]=b.useState({width:B.IMAGE_MAX_SIZE,height:B.IMAGE_MAX_SIZE}),[n,i]=b.useState({width:0,height:0}),[o]=b.useState([sr.TOP_LEFT,sr.TOP_RIGHT,sr.BOTTOM_LEFT,sr.BOTTOM_RIGHT]),[s,c]=b.useState(!1),[l,u]=b.useState({x:0,y:0,w:0,h:0,dir:""}),{align:f}=(M=e==null?void 0:e.node)==null?void 0:M.attrs,d=b.useMemo(()=>{var k;const{src:T,alt:C,width:$,height:P}=(k=e==null?void 0:e.node)==null?void 0:k.attrs,E=mr($)?`${$}px`:$,L=mr(P)?`${P}px`:P;return{src:T||void 0,alt:C||void 0,style:{width:E||void 0,height:L||void 0}}},[(N=e==null?void 0:e.node)==null?void 0:N.attrs]),h=b.useMemo(()=>{const{style:{width:T}}=d;return{width:T==="100%"?T:void 0}},[d]);function p(T){i({width:T.target.width,height:T.target.height})}function m(){const{editor:T,getPos:C}=e;T.commands.setNodeSelection(C())}const g=b.useCallback(bt(()=>{const{editor:T}=e,{width:C}=getComputedStyle(T.view.dom);r($=>({...$,width:Number.parseInt(C,10)}))},B.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function y(T,C){T.preventDefault(),T.stopPropagation();const $=n.width,P=n.height,E=$/P;let L=Number(e.node.attrs.width),k=Number(e.node.attrs.height);const Y=t.width;L&&!k?(L=L>Y?Y:L,k=Math.round(L/E)):k&&!L?(L=Math.round(k*E),L=L>Y?Y:L):!L&&!k?(L=$>Y?Y:$,k=Math.round(L/E)):L=L>Y?Y:L,c(!0),u({x:T.clientX,y:T.clientY,w:L,h:k,dir:C})}const S=b.useCallback(bt(T=>{if(T.preventDefault(),T.stopPropagation(),!s)return;const{x:C,w:$,dir:P}=l,E=(T.clientX-C)*(/l/.test(P)?-1:1),L=Fc($+E,B.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:L,height:null})},B.IMAGE_THROTTLE_WAIT_TIME),[s,l,t,e.updateAttributes]),j=b.useCallback(T=>{T.preventDefault(),T.stopPropagation(),s&&(u({x:0,y:0,w:0,h:0,dir:""}),c(!1),m())},[s,m]),w=b.useCallback(()=>{document==null||document.addEventListener("mousemove",S,!0),document==null||document.addEventListener("mouseup",j,!0)},[S,j]),A=b.useCallback(()=>{document==null||document.removeEventListener("mousemove",S,!0),document==null||document.removeEventListener("mouseup",j,!0)},[S,j]);b.useEffect(()=>(s?w():A(),()=>{A()}),[s,w,A]);const O=b.useMemo(()=>new ResizeObserver(()=>g()),[g]);return b.useEffect(()=>(O.observe(e.editor.view.dom),()=>{O.disconnect()}),[e.editor.view.dom,O]),a.jsx(le.NodeViewWrapper,{className:"image-view",style:{...h,width:"100%",textAlign:f},children:a.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:h,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,children:[a.jsx("img",{alt:d.alt,className:"image-view__body__image block",height:"auto",onClick:m,onLoad:p,src:d.src,style:d.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&a.jsx("div",{className:"image-resizer",children:o==null?void 0:o.map(T=>a.jsx("span",{className:`image-resizer__handler image-resizer__handler--${T}`,onMouseDown:C=>y(C,T)},`image-dir-${T}`))})]})})}const co=so.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",GIPHY_API_KEY:"",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:r,t:n})=>{var o;const i=((o=r==null?void 0:r.options)==null?void 0:o.GIPHY_API_KEY)||"";return{component:lx,componentProps:{editor:t,action:()=>{},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:n("editor.imageGif.tooltip"),giphyApiKey:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return le.ReactNodeViewRenderer(ux)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:r})=>r.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",H.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});function dx(e,t){let r;try{r=new URL(e)}catch{return!1}return!(t!=null&&t.length)||t.length===1&&t[0]==="."?!0:t.some(n=>{if(n.includes("*")){const i=n.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(r.hostname)}return r.hostname.includes(n)})}function fx(e){const{t}=B.useLocale(),[r,n]=b.useState(""),i=b.useRef(null),[o,s]=b.useState(""),[c,l]=b.useState(!1),u=m=>{l(m.detail)};b.useEffect(()=>{const m=qt(nt.UPLOAD_VIDEO(e.editor.id),u);return()=>{m()}},[]);const f=b.useMemo(()=>{var g;return(g=e.editor.extensionManager.extensions.find(y=>y.name===lo.name))==null?void 0:g.options},[e.editor]);async function d(m){var j;const g=(j=m==null?void 0:m.target)==null?void 0:j.files;if(!e.editor||e.editor.isDestroyed||g.length===0)return;const y=g[0];let S="";f.upload?S=await f.upload(y):S=URL.createObjectURL(y),e.editor.chain().focus().setVideo({src:S,width:"100%"}).run(),l(!1)}function h(m){m.preventDefault(),m.stopPropagation(),r&&(e.editor.chain().focus().setVideo({src:r,width:"100%"}).run(),l(!1))}function p(m){var g;m.preventDefault(),(g=i.current)==null||g.click()}return a.jsxs(Vt,{onOpenChange:l,open:c,children:[a.jsx(Xt,{asChild:!0,children:a.jsx(F,{action:()=>l(!0),icon:e.icon,tooltip:e.tooltip})}),a.jsxs(jt,{children:[a.jsx(At,{children:t("editor.video.dialog.title")}),a.jsxs(Il,{activationMode:"manual",defaultValue:(f==null?void 0:f.resourceVideo)==="both"||(f==null?void 0:f.resourceVideo)==="upload"?"upload":"link",children:[a.jsxs(vo,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((f==null?void 0:f.resourceVideo)==="both"||(f==null?void 0:f.resourceVideo)==="upload")&&a.jsx(Ft,{value:"upload",children:t("editor.video.dialog.tab.upload")}),((f==null?void 0:f.resourceVideo)==="both"||(f==null?void 0:f.resourceVideo)==="link")&&a.jsx(Ft,{value:"link",children:t("editor.video.dialog.link")})]}),a.jsxs(Ht,{value:"upload",children:[a.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:a.jsx(ge,{className:"richtext-mt-1 richtext-w-full",onClick:p,size:"sm",children:t("editor.video.dialog.tab.upload")})}),a.jsx("input",{accept:"video/*",multiple:!0,onChange:d,ref:i,type:"file",style:{display:"none"}})]}),a.jsxs(Ht,{value:"link",children:[a.jsx("form",{onSubmit:h,children:a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[a.jsx(je,{autoFocus:!0,placeholder:t("editor.video.dialog.placeholder"),required:!0,type:"url",value:r,onChange:m=>{n(m.target.value)},onBlur:m=>{const g=m.target.value,y=f.videoProviders||["."];g&&!dx(g,y)?s("Invalid video URL"):s("")}}),a.jsx(ge,{type:"submit",children:t("editor.video.dialog.button.apply")})]})}),o&&a.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:o})]})]})]})]})}function hx(e,t,r){return e<t?t:e>r?r:e}const px=e=>typeof e=="number",mx=e=>typeof e=="string",gx=e=>typeof e=="function";function xx(e,t="px"){if(!e)return e;const r=px(e)?String(e):e,n=Number.parseFloat(r),i=r.match(/[%a-z]+$/i),o=i?i[0]:t;return Number.isNaN(n)?e:n+o}function bl(e,t){if(!e)return!1;const{extensions:r=[]}=(e==null?void 0:e.extensionManager)??{};return!!r.find(i=>i.name===t)}function vx(e){return e.map(t=>mx(t)?{value:t,name:t}:t)}function yx(e){return e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/"),e=e.replace("https://vimeo.com/","https://player.vimeo.com/video/"),/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const lo=H.Node.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:B.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper",style:"display: flex;justify-content: center;"},button:({editor:e,t})=>{var r,n;return{component:fx,componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((n=(r=e.can()).setVideo)!=null&&n.call(r,{})),icon:"Video",tooltip:t("editor.video.tooltip"),videoProviders:["."],editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?yx(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:xx(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%"}=e??{},r={...e,width:"100%",height:"100%"},n=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,i=`flex: 1;padding-bottom: ${9/16*100}%;`,c=["div",{style:n},["div",{style:i}],["iframe",r]];return["div",{...this.options.HTMLAttributes,"data-video":""},c]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}}),uo={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function fo({item:e,disabled:t,editor:r}){var i;const n=e.component;return n?a.jsx(b.Fragment,{children:e.type==="divider"?a.jsx(Ee,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):a.jsx(n,{...e.componentProps,disabled:t||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:r})}):a.jsx(a.Fragment,{})}function bx(e){return e.type.name===wt.name}function wx(e){return e.type.name===co.name}function Sx(e){return e.type.name===lo.name}function jx(e){const{lang:t}=B.useLocale(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:s,to:c}=o;let l=!1;return i.view.state.doc.nodesBetween(s.pos,c,u=>{if(bx(u))return l=!0,!1}),l},n=b.useMemo(()=>e.disabled?[]:tg(e.editor),[e.disabled,e.editor,t]);return a.jsx(a.Fragment,{children:a.jsx(le.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:r,tippyOptions:uo,children:n!=null&&n.length?a.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:a.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:n==null?void 0:n.map((i,o)=>a.jsx(fo,{disabled:e.disabled,editor:e.editor,item:i},`bubbleMenu-image-${o}`))})}):a.jsx(a.Fragment,{})})})}function Ax(e){const{lang:t}=B.useLocale(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:s,to:c}=o;let l=!1;return i.view.state.doc.nodesBetween(s.pos,c,u=>{if(wx(u))return l=!0,!1}),l},n=b.useMemo(()=>e.disabled?[]:rg(e.editor),[e.disabled,e.editor,t]);return a.jsx(a.Fragment,{children:a.jsx(le.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:r,tippyOptions:uo,children:n!=null&&n.length?a.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:a.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:n==null?void 0:n.map((i,o)=>a.jsx(fo,{disabled:e.disabled,editor:e.editor,item:i},`bubbleMenu-image-gif-${o}`))})}):a.jsx(a.Fragment,{})})})}function Cx(e){const{lang:t}=B.useLocale(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:s,to:c}=o;let l=!1;return i.view.state.doc.nodesBetween(s.pos,c,u=>{if(Sx(u))return l=!0,!1}),l},n=b.useMemo(()=>e.disabled?[]:og(e.editor),[e.editor,e.disabled,t]);return a.jsx(a.Fragment,{children:a.jsx(le.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:r,tippyOptions:uo,children:n!=null&&n.length?a.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:a.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:n==null?void 0:n.map((i,o)=>a.jsx(fo,{disabled:e.disabled,editor:e.editor,item:i},`bubbleMenu-video-${o}`))})}):a.jsx(a.Fragment,{})})})}function Ix(e,t,r=null){return r?e.createChecked({index:t},r):e.createAndFill({index:t})}function Tx(e){if(e.cached.columnsNodeTypes)return e.cached.columnsNodeTypes;const t={columns:e.nodes.columns,column:e.nodes.column};return e.cached.columnsNodeTypes=t,t}function Px(e,t,r=null){const n=Tx(e),i=[];for(let o=0;o<t;o+=1){const s=Ix(n.column,o,r);s&&i.push(s)}return n.columns.createChecked({cols:t},i)}function Wr({state:e,dispatch:t,type:r}){const n=H.findParentNode(o=>o.type.name===zt.name)(e.selection),i=H.findParentNode(o=>o.type.name===ho.name)(e.selection);if(t&&n&&i){const o=n.node,s=i.node.attrs.index,c=o.toJSON();let l=s;r==="delete"?(l=s-1,c.content.splice(s,1)):(l=r==="addBefore"?s:s+1,c.content.splice(l,0,{type:"column",attrs:{index:s},content:[{type:"paragraph"}]})),c.attrs.cols=c.content.length,c.content.forEach((h,p)=>{h.attrs.index=p});const u=H.Node$1.fromJSON(e.schema,c);let f=n.pos;u.content.forEach((h,p,m)=>{m<l&&(f+=h.nodeSize)});const d=e.tr.setTime(Date.now());d.replaceWith(n.pos,n.pos+n.node.nodeSize,u).setSelection(H.TextSelection.near(d.doc.resolve(f))),t(d)}return!0}function Sa({state:e,dispatch:t,type:r}){const n=H.findParentNode(o=>o.type.name===zt.name)(e.selection),i=H.findParentNode(o=>o.type.name===ho.name)(e.selection);if(t&&n&&i){const o=n.node,s=i.node.attrs.index;let c=0;r==="before"?c=(s-1+o.attrs.cols)%o.attrs.cols:c=(s+1)%o.attrs.cols;let l=n.pos;o.content.forEach((f,d,h)=>{h<c&&(l+=f.nodeSize)});const u=e.tr.setTime(Date.now());return u.setSelection(H.TextSelection.near(u.doc.resolve(l))),t(u),!0}return!1}const ho=H.Node.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:e=>e.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:e}){return["div",H.mergeAttributes(this.options.HTMLAttributes,e),0]}}),Rx=H.Extension.create({name:"columnActionButton",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r})=>({component:F,componentProps:{action:()=>{t.chain().focus().insertColumns({cols:2}).run()},icon:"Columns",tooltip:r("editor.columns.tooltip")}})}}}),wl=200,zt=H.Node.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:wl,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:e=>e.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:e}){return["div",H.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:r,editor:n})=>{const i=Px(n.schema,e&&e.cols||3);if(r){const o=t.selection.anchor+1;t.replaceSelectionWith(i).scrollIntoView().setSelection(H.TextSelection.near(t.doc.resolve(o)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>Wr({dispatch:e,state:t,type:"addBefore"}),addColAfter:()=>({dispatch:e,state:t})=>Wr({dispatch:e,state:t,type:"addAfter"}),deleteCol:()=>({dispatch:e,state:t})=>Wr({dispatch:e,state:t,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>Sa({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>Sa({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}});function po(e,t){const{state:r}=t,n=r.selection.$anchor;let i=!1;if(n.depth)for(let o=n.depth;o>0;o--)n.node(o).type.name===e&&(t.dispatchTransaction&&t.dispatchTransaction(r.tr.delete(n.before(o),n.after(o)).scrollIntoView()),i=!0);else{const o=r.selection.node;o&&o.type.name===e&&(t.chain().deleteSelection().run(),i=!0)}if(!i){const o=n.pos;if(o){const s=r.tr.doc.nodeAt(o);s&&s.type.name===e&&(t.dispatchTransaction&&t.dispatchTransaction(r.tr.delete(o,o+s.nodeSize)),i=!0)}}return i}function Ox({editor:e}){const{t}=B.useLocale(),r=b.useCallback(()=>e.isActive(zt.name),[e]),n=b.useCallback(()=>po(zt.name,e),[e]),i=b.useCallback(()=>e.chain().focus().addColBefore().run(),[e]),o=b.useCallback(()=>e.chain().focus().addColAfter().run(),[e]),s=b.useCallback(()=>e.chain().focus().deleteCol().run(),[e]);return a.jsx(le.BubbleMenu,{editor:e,pluginKey:"columns-bubble-menu",shouldShow:r,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:a.jsxs("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:[a.jsx(F,{action:i,icon:"ColumnAddLeft",tooltip:t("editor.table.menu.insertColumnBefore")}),a.jsx(F,{action:o,icon:"ColumnAddRight",tooltip:t("editor.table.menu.insertColumnAfter")}),a.jsx(F,{action:s,icon:"DeleteColumn",tooltip:t("editor.table.menu.deleteColumn")}),a.jsx(F,{action:n,icon:"Trash2",tooltip:t("editor.table.menu.delete_column")})]})})}const Sl=ce.Root,jl=ce.Trigger,ja=ce.Portal,Aa=ce.Sub,Wi=ee.forwardRef(({className:e,inset:t,children:r,...n},i)=>a.jsxs(ce.SubTrigger,{ref:i,className:Z("richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none focus:richtext-bg-accent data-[state=open]:richtext-bg-accent",t&&"richtext-pl-8",e),...n,children:[r,a.jsx(R.ChevronRight,{className:"richtext-ml-auto richtext-h-4 richtext-w-4"})]}));Wi.displayName=ce.SubTrigger.displayName;const Vi=ee.forwardRef(({className:e,...t},r)=>a.jsx(ce.SubContent,{ref:r,className:Z("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-lg data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...t}));Vi.displayName=ce.SubContent.displayName;const mo=ee.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(ce.Portal,{children:a.jsx(ce.Content,{ref:n,sideOffset:t,className:Z("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...r})}));mo.displayName=ce.Content.displayName;const Me=ee.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(ce.Item,{ref:n,className:Z("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",t&&"richtext-pl-8",e),...r}));Me.displayName=ce.Item.displayName;const Al=ee.forwardRef(({className:e,children:t,checked:r,...n},i)=>a.jsxs(ce.CheckboxItem,{ref:i,className:Z("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),checked:r,...n,children:[a.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:a.jsx(ce.ItemIndicator,{children:a.jsx(R.Check,{className:"richtext-h-4 richtext-w-4"})})}),t]}));Al.displayName=ce.CheckboxItem.displayName;const Ex=ee.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(ce.RadioItem,{ref:n,className:Z("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),...r,children:[a.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:a.jsx(ce.ItemIndicator,{children:a.jsx(R.Circle,{className:"richtext-h-2 richtext-w-2 richtext-fill-current"})})}),t]}));Ex.displayName=ce.RadioItem.displayName;const Mx=ee.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(ce.Label,{ref:n,className:Z("richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-font-semibold",t&&"richtext-pl-8",e),...r}));Mx.displayName=ce.Label.displayName;const go=ee.forwardRef(({className:e,...t},r)=>a.jsx(ce.Separator,{ref:r,className:Z("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",e),...t}));go.displayName=ce.Separator.displayName;function Cl({className:e,...t}){return a.jsx("span",{className:Z("richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",e),...t})}Cl.displayName="DropdownMenuShortcut";const je=ee.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:Z("richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",e),ref:n,...r}));je.displayName="Input";const Nx=Sr("richtext-text-sm richtext-font-medium richtext-leading-none peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"),He=ee.forwardRef(({className:e,...t},r)=>a.jsx(bc.Root,{ref:r,className:Z(Nx(),e),...t}));He.displayName=bc.Root.displayName;const Yt=kt.Root,Kt=kt.Trigger,Ct=ee.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},i)=>a.jsx(kt.Portal,{children:a.jsx(kt.Content,{ref:i,align:t,sideOffset:r,className:Z("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...n})}));Ct.displayName=kt.Content.displayName;const Ee=ee.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},i)=>a.jsx(vc.Root,{ref:i,decorative:r,orientation:t,className:Z("richtext-shrink-0 richtext-bg-border",t==="horizontal"?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",e),...n}));Ee.displayName=vc.Root.displayName;const xo=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ni.Root,{className:Z("richtext-peer richtext-inline-flex richtext-h-6 richtext-w-11 richtext-shrink-0 richtext-cursor-pointer richtext-items-center richtext-rounded-full richtext-border-2 richtext-border-transparent richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 focus-visible:richtext-ring-offset-background disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 data-[state=checked]:richtext-bg-primary data-[state=unchecked]:richtext-bg-input",e),...t,ref:r,children:a.jsx(Ni.Thumb,{className:Z("richtext-pointer-events-none richtext-block richtext-h-5 richtext-w-5 richtext-rounded-full richtext-bg-background richtext-shadow-lg richtext-ring-0 richtext-transition-transform data-[state=checked]:richtext-translate-x-5 data-[state=unchecked]:richtext-translate-x-0")})}));xo.displayName=Ni.Root.displayName;const Il=ct.Root,vo=ee.forwardRef(({className:e,...t},r)=>a.jsx(ct.List,{ref:r,className:Z("richtext-inline-flex richtext-h-10 richtext-items-center richtext-justify-center richtext-rounded-md richtext-bg-muted richtext-p-1 richtext-text-muted-foreground",e),...t}));vo.displayName=ct.List.displayName;const Ft=ee.forwardRef(({className:e,...t},r)=>a.jsx(ct.Trigger,{ref:r,className:Z("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-sm richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-all focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=active]:richtext-bg-background data-[state=active]:richtext-text-foreground data-[state=active]:richtext-shadow-sm",e),...t}));Ft.displayName=ct.Trigger.displayName;const Ht=ee.forwardRef(({className:e,...t},r)=>a.jsx(ct.Content,{ref:r,className:Z("richtext-mt-2 richtext-ring-offset-background focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2",e),...t}));Ht.displayName=ct.Content.displayName;const _x=Ae.Provider,Tl=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ae.Viewport,{ref:r,className:Z("richtext-fixed richtext-top-0 richtext-z-[100] richtext-flex richtext-max-h-screen richtext-w-full richtext-flex-col-reverse richtext-p-4 sm:richtext-bottom-0 sm:richtext-right-0 sm:richtext-top-auto sm:richtext-flex-col md:richtext-max-w-[420px]",e),...t}));Tl.displayName=Ae.Viewport.displayName;const $x=Sr("richtext-group richtext-pointer-events-auto richtext-relative richtext-flex richtext-w-full richtext-items-center richtext-justify-between richtext-space-x-4 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-p-6 richtext-pr-8 richtext-shadow-lg richtext-transition-all data-[swipe=cancel]:richtext-translate-x-0 data-[swipe=end]:richtext-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:richtext-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:richtext-transition-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[swipe=end]:richtext-animate-out data-[state=closed]:richtext-fade-out-80 data-[state=closed]:richtext-slide-out-to-right-full data-[state=open]:richtext-slide-in-from-top-full data-[state=open]:sm:richtext-slide-in-from-bottom-full",{variants:{variant:{default:"richtext-border richtext-bg-background richtext-text-foreground",destructive:"richtext-destructive richtext-group richtext-border-destructive richtext-bg-destructive richtext-text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Pl=ee.forwardRef(({className:e,variant:t,...r},n)=>a.jsx(Ae.Root,{ref:n,className:Z($x({variant:t}),e),...r}));Pl.displayName=Ae.Root.displayName;const kx=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ae.Action,{ref:r,className:Z("richtext-inline-flex richtext-h-8 richtext-shrink-0 richtext-items-center richtext-justify-center richtext-rounded-md !richtext-border richtext-bg-transparent richtext-px-3 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-secondary focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 group-[.destructive]:richtext-border-muted/40 group-[.destructive]:hover:richtext-border-destructive/30 group-[.destructive]:hover:richtext-bg-destructive group-[.destructive]:hover:richtext-text-destructive-foreground group-[.destructive]:focus:richtext-ring-destructive",e),...t}));kx.displayName=Ae.Action.displayName;const Rl=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ae.Close,{ref:r,className:Z("richtext-absolute richtext-right-2 richtext-top-2 richtext-rounded-md richtext-p-1 richtext-text-foreground/50 richtext-opacity-0 richtext-transition-opacity hover:richtext-text-foreground focus:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 group-hover:richtext-opacity-100 group-[.destructive]:richtext-text-red-300 group-[.destructive]:hover:richtext-text-red-50 group-[.destructive]:focus:richtext-ring-red-400 group-[.destructive]:focus:richtext-ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(R.X,{className:"richtext-h-4 richtext-w-4"})}));Rl.displayName=Ae.Close.displayName;const Ol=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ae.Title,{ref:r,className:Z("richtext-text-sm richtext-font-semibold",e),...t}));Ol.displayName=Ae.Title.displayName;const El=ee.forwardRef(({className:e,...t},r)=>a.jsx(Ae.Description,{ref:r,className:Z("richtext-text-sm richtext-opacity-90",e),...t}));El.displayName=Ae.Description.displayName;const Lx=Sr("richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",{variants:{variant:{default:"richtext-bg-transparent",outline:"richtext-border richtext-border-input richtext-bg-transparent hover:richtext-bg-accent hover:richtext-text-accent-foreground"},size:{default:"richtext-h-10 richtext-px-3",sm:"richtext-h-9 richtext-px-2",lg:"richtext-h-11 richtext-px-5"}},defaultVariants:{variant:"default",size:"default"}}),yo=ee.forwardRef(({className:e,variant:t,size:r,...n},i)=>a.jsx(yc.Root,{ref:i,className:Z(Lx({variant:t,size:r,className:e})),...n}));yo.displayName=yc.Root.displayName;const Dx=Gt.Provider,bo=Gt.Root,wo=Gt.Trigger,Cr=ee.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(Gt.Content,{ref:n,sideOffset:t,className:Z("richtext-z-50 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-text-popover-foreground richtext-shadow-md richtext-animate-in richtext-fade-in-0 richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...r}));Cr.displayName=Gt.Content.displayName;const Bx=1,qx=1e6;let Vr=0;function zx(){return Vr=(Vr+1)%Number.MAX_SAFE_INTEGER,Vr.toString()}const Xr=new Map;function Ca(e){if(Xr.has(e))return;const t=setTimeout(()=>{Xr.delete(e),$t({type:"REMOVE_TOAST",toastId:e})},qx);Xr.set(e,t)}function Fx(e,t){switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Bx)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Ca(r):e.toasts.forEach(n=>{Ca(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}}const dr=[];let fr={toasts:[]};function $t(e){fr=Fx(fr,e),dr.forEach(t=>{t(fr)})}function Hx({...e}){const t=zx(),r=i=>$t({type:"UPDATE_TOAST",toast:{...i,id:t}}),n=()=>$t({type:"DISMISS_TOAST",toastId:t});return $t({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||n()}}}),{id:t,dismiss:n,update:r}}function Ml(){const[e,t]=ee.useState(fr);return ee.useEffect(()=>(dr.push(t),()=>{const r=dr.indexOf(t);r>-1&&dr.splice(r,1)}),[e]),{...e,toast:Hx,dismiss:r=>$t({type:"DISMISS_TOAST",toastId:r})}}const Nl=ee.forwardRef(({className:e,...t},r)=>a.jsx(Mi.Root,{ref:r,className:Z("!richtext-peer !richtext-h-4 !richtext-w-4 !richtext-p-0 !richtext-shrink-0 !richtext-rounded-sm !richtext-border !richtext-border-primary !richtext-ring-offset-background focus-visible:!richtext-outline-none focus-visible:!richtext-ring-2 focus-visible:!richtext-ring-ring focus-visible:!richtext-ring-offset-2 disabled:!richtext-cursor-not-allowed disabled:!richtext-opacity-50 data-[state=checked]:!richtext-bg-primary data-[state=checked]:!richtext-text-primary-foreground",e),...t,children:a.jsx(Mi.Indicator,{className:Z("!richtext-flex !richtext-p-0 !richtext-items-center !richtext-justify-center !richtext-text-current"),children:a.jsx(R.Check,{className:"!richtext-h-4 !richtext-w-4"})})}));Nl.displayName=Mi.Root.displayName;const Ux={padding:"0 12px 12px"},_l=({width:e,maxWidth:t,height:r,onOk:n,children:i})=>{const{t:o}=B.useLocale(),[s,c]=b.useState({width:"",height:"",maxWidth:""});b.useEffect(()=>{c({width:e,height:r,maxWidth:t})},[r,t,e]);function l(u){u.preventDefault(),u.stopPropagation(),n(s)}return a.jsxs(Yt,{modal:!0,children:[a.jsx(Kt,{asChild:!0,children:i}),a.jsx(Ct,{children:a.jsx("div",{style:Ux,children:a.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:l,children:[a.jsx(He,{className:"mb-[6px]",children:"Width"}),a.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:a.jsx(je,{type:"number",value:s.width,required:!0,onChange:u=>c({...s,width:u.target.value})})})}),a.jsx(He,{className:"mb-[6px]",children:"Max Width"}),a.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:a.jsx(je,{type:"number",value:s.maxWidth,required:!0,onChange:u=>c({...s,maxWidth:u.target.value})})})}),a.jsx(He,{className:"mb-[6px]",children:"Height"}),a.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:a.jsx(je,{type:"number",value:s.height,required:!0,onChange:u=>c({...s,height:u.target.value})})})}),a.jsx(ge,{type:"submit",className:"richtext-self-end richtext-mt-2",children:o("editor.link.dialog.button.apply")})]})})})]})},It={youtube:{example:"https://www.youtube.com/watch?v=I4sMhHbHYXM",src:"https://www.youtube.com/embed/I4sMhHbHYXM",srcPrefix:"https://www.youtube.com/embed",linkRule:[/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\s/]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[&?]v=)|youtu\.be\/)([\w-]{11})/]},youku:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html?spm=a2h0c.8166622.PhoneSokuUgc_4.dtitle",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"https://player.youku.com/embed",linkRule:[String.raw`v.youku.com\/v_show\/id_\w+\=*`],idRule:String.raw`id_\w+\=*`},bilibili:{example:"https://www.bilibili.com/video/BV1EJ411u7DN",src:"https://player.bilibili.com/player.html?bvid=BV1EJ411u7DN",srcPrefix:"https://player.bilibili.com/player.html?bvid",linkRule:[String.raw`www.bilibili.com\/video\/\w+`]},qqvideo:{example:"https://v.qq.com/x/cover/mzc0020006aw1mn/u0033nvzb5v.html",src:"https://v.qq.com/txp/iframe/player.html?vid=u0033nvzb5v",srcPrefix:"https://v.qq.com/txp/iframe/player.html?vid",linkRule:[String.raw`v.qq.com\/x\/cover\/\w+\/\w+`]},amap:{example:"https://ditu.amap.com/",src:"https://www.amap.com/place/B000A45467",srcPrefix:"",linkRule:[String.raw`\.amap\.com`]},baidu_map:{example:"https://j.map.baidu.com/15/fo",src:"https://j.map.baidu.com/15/fo",srcPrefix:"",linkRule:[String.raw`map\.baidu\.com`]},modao:{example:"https://free.modao.cc/app/2cd26580a6717a147454df7470e7ec464093cba3/embed/v2#screen=sk71k6d1dfxulzx",src:"https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",srcPrefix:"",linkRule:[String.raw`https:\/\/\w+.modao.cc\/app\/\w+\/embed\/v2`],tips:"Modao > More > Share > Embed > COPY"},lanhu:{example:"https://lanhuapp.com/link/#/invite?sid=evP7L",src:"https://lanhuapp.com/url/evP7L",srcPrefix:"",linkRule:[String.raw`https:\/\/lanhuapp.com\/url\/\w+`],tips:"Lanhu > Project > Share > Copy Link"},figma:{example:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",src:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",srcPrefix:"https://www.figma.com/embed?embed_host=share&url",linkRule:[String.raw`https:\/\/www.figma.com\/file\/\w+`]},canva:{example:"https://www.canva.cn/design/DAD61-t29UI/view",src:"https://www.canva.cn/design/DAD61-t29UI/view",srcPrefix:"",linkRule:[String.raw`https:\/\/www.canva.cn\/design\/.+\/view`]},processon:{example:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",src:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",srcPrefix:"",linkRule:[String.raw`https:\/\/www.processon.com\/embed\/\w+`]},codepen:{example:"https://codepen.io/mekery/embed/YzyrKOJ",src:"https://codepen.io/mekery/embed/YzyrKOJ",srcPrefix:"",linkRule:[String.raw`https:\/\/codepen.io\/.+\/embed\/\w+`]},jinshuju:{example:"https://jinshuju.net/f/q9YvVf",src:"https://jinshuju.net/f/q9YvVf",srcPrefix:"",linkRule:[String.raw`https:\/\/jinshuju.net\/f\/\w+`]},iframe:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"",linkRule:[".+"]},googlemaps:{example:"https://goo.gl/maps/8Ys8b4K1ZJY2",src:"https://www.google.com/maps/embed?pb=https://goo.gl/maps/8Ys8b4K1ZJY2",srcPrefix:"",linkRule:[String.raw`https:\/\/goo.gl\/maps\/\w+`]}};function Gx(e){const t=It.youtube,r=e.matchedUrl;e.validLink=!0;const n=r.split("="),i=n.length;if(i>0){const o=n[i-1];e.src=`${t.srcPrefix}/${o}`,e.validId=!0}return e}function Wx(e){const t=It.youku,r=e.matchedUrl,n=t.idRule,i=new RegExp(n),o=r.match(i);if(o&&o.length>0){const s=o[0].slice(3);e.validId=!0,e.src=`${t.srcPrefix}/${s}`}else e.validId=!1;return e}function Vx(e){const t=It.bilibili,n=e.matchedUrl.split("/"),i=n.length;if(i>0){const o=n[i-1];e.src=`${t.srcPrefix}=${o}`,e.validId=!0}return e}function Xx(e){const t=It.qqvideo,n=e.matchedUrl.split("/"),i=n.length;if(i>0){const o=n[i-1];e.src=`${t.srcPrefix}=${o}`,e.validId=!0}return e}function Yx(e,t){return t.src=e,t.validId=!0,t}function Kx(e,t){return t.src=e,t.validId=!0,t}function Zx(e,t){return t.src=e,t.validId=!0,t.originalLink=e,t}function Jx(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function Qx(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function ev(e){const t=It.figma;return e.src=`${t.srcPrefix}=${encodeURIComponent(e.matchedUrl)}`,e.validId=!0,e.originalLink=e.matchedUrl,e}function tv(e,t){return t.src=`${t.matchedUrl}?embed`,t.validId=!0,t.originalLink=e,t}function rv(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function nv(e){return e.src=`${e.matchedUrl}`,e.validId=!0,e.originalLink=e.src,e}function iv(e,t){return t.src=`${t.matchedUrl}?background=white&banner=show&embedded=true`,t.validId=!0,t.originalLink=e,t}function ov(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function av(e,t,r){if(e==="googlemaps")return r.validLink=!0,r.matchedUrl=t,r;const i=It[e].linkRule;for(const o of i){const s=new RegExp(o),c=t.match(s);if(c&&c.length>0)return r.validLink=!0,r.matchedUrl=e==="youtube"?c[1]:c[0],r}return r}function sv(e){var r,n;let t="iframe";return((r=e.includes)!=null&&r.call(e,"youtube")||(n=e.includes)!=null&&n.call(e,"youtu.be"))&&(t="youtube"),e.includes("youku")&&(t="youku"),e.includes("bilibili")&&(t="bilibili"),e.includes("qq")&&(t="qqvideo"),e.includes("amap")&&(t="amap"),e.includes("map.baidu")&&(t="baidu_map"),(e.includes("google.com/maps")||e.includes("maps.app.goo.gl"))&&(t="googlemaps"),e.includes("modao")&&(t="modao"),e.includes("lanhuapp")&&(t="lanhu"),e.includes("figma")&&(t="figma"),e.includes("canva")&&(t="canva"),e.includes("processon")&&(t="processon"),e.includes("codepen")&&(t="codepen"),e.includes("jinshuju")&&(t="jinshuju"),e.includes("iframe")&&(t="iframe"),t}function $l(e){let t={validLink:!1,validId:!1,matchedUrl:"",originalLink:e,src:""};const r=sv(e);if(t=av(r,e,t),!t.validLink)return t;switch(r){case"youtube":return Gx(t);case"youku":return Wx(t);case"bilibili":return Vx(t);case"qqvideo":return Xx(t);case"amap":return Yx(e,t);case"baidu_map":return Kx(e,t);case"googlemaps":return Zx(e,t);case"modao":return Jx(t);case"lanhu":return Qx(t);case"figma":return ev(t);case"canva":return tv(e,t);case"processon":return rv(e,t);case"codepen":return nv(t);case"jinshuju":return iv(e,t);case"iframe":return ov(e,t);default:return e}}function kl(){const[e]=xl(t=>t.value);return e}const cv={setDisable:(e,t)=>{Ar(nt.EDIT(e),t)}},lv="_wrap_5y04w_1",uv="_innerWrap_5y04w_15",Ia={wrap:lv,innerWrap:uv};function dv({editor:e,node:t,updateAttributes:r}){const n=kl(),{src:i,width:o,height:s}=t.attrs,[c,l]=b.useState("");function u(){if(!c)return;const d=$l(c);e.chain().updateAttributes(at.name,{src:(d==null?void 0:d.src)||c}).setNodeSelection(e.state.selection.from).focus().run()}const f=b.useCallback(d=>{r({width:d.width,height:d.height})},[r]);return a.jsxs(le.NodeViewWrapper,{children:[!i&&a.jsxs("div",{className:"richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-[#ccc] richtext-p-[10px]",children:[a.jsx(je,{autoFocus:!0,className:"richtext-flex-1",onInput:d=>l(d.target.value),placeholder:"Enter link",type:"url",value:c}),a.jsx(ge,{className:"richtext-w-[60px]",onClick:u,children:"OK"})]}),i&&a.jsx(Tu.Resizable,{size:{width:Number.parseInt(o),height:Number.parseInt(s)},onResizeStop:(d,h,p,m)=>{f({width:Number.parseInt(o)+m.width,height:Number.parseInt(s)+m.height})},children:a.jsx("div",{className:le.clsx(Ia.wrap,"render-wrapper"),children:a.jsx("div",{className:Ia.innerWrap,style:{pointerEvents:n?"none":"auto"},children:a.jsx("iframe",{className:"richtext-my-[12px] ",src:i})})})})]})}const at=H.Node.create({name:"iframe",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"iframe"},button:({editor:t,extension:r,t:n})=>({component:F,componentProps:{action:i=>t.commands.setIframe(i),upload:r.options.upload,disabled:!t.can().setIframe({}),icon:"Iframe",tooltip:n("editor.iframe.tooltip")}})}},addAttributes(){return{width:{default:600,parseHTML:le.getDatasetAttribute("width")},height:{default:300,parseHTML:le.getDatasetAttribute("height")},src:{default:null,parseHTML:le.getDatasetAttribute("src")},defaultShowPicker:{default:!1},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:e}){return["iframe",H.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setIframe:e=>({tr:t,commands:r,chain:n})=>{var o,s,c;if(((c=(s=(o=t.selection)==null?void 0:o.node)==null?void 0:s.type)==null?void 0:c.name)==this.name)return r.updateAttributes(this.name,e);const i=e||{url:""};return n().insertContent({type:this.name,attrs:i}).run()}}},addInputRules(){return[H.nodeInputRule({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]},addNodeView(){return le.ReactNodeViewRenderer(dv)}});var Ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ll(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Dl(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Yr,Ta;function Bl(){if(Ta)return Yr;Ta=1;var e=Object.prototype.toString;return Yr=function(r){var n=e.call(r),i=n==="[object Arguments]";return i||(i=n!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&e.call(r.callee)==="[object Function]"),i},Yr}var Kr,Pa;function fv(){if(Pa)return Kr;Pa=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Bl(),i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),s=i.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(h){var p=h.constructor;return p&&p.prototype===h},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>"u")return!1;for(var h in window)try{if(!u["$"+h]&&t.call(window,h)&&window[h]!==null&&typeof window[h]=="object")try{l(window[h])}catch{return!0}}catch{return!0}return!1}(),d=function(h){if(typeof window>"u"||!f)return l(h);try{return l(h)}catch{return!1}};e=function(p){var m=p!==null&&typeof p=="object",g=r.call(p)==="[object Function]",y=n(p),S=m&&r.call(p)==="[object String]",j=[];if(!m&&!g&&!y)throw new TypeError("Object.keys called on a non-object");var w=s&&g;if(S&&p.length>0&&!t.call(p,0))for(var A=0;A<p.length;++A)j.push(String(A));if(y&&p.length>0)for(var O=0;O<p.length;++O)j.push(String(O));else for(var M in p)!(w&&M==="prototype")&&t.call(p,M)&&j.push(String(M));if(o)for(var N=d(p),T=0;T<c.length;++T)!(N&&c[T]==="constructor")&&t.call(p,c[T])&&j.push(c[T]);return j}}return Kr=e,Kr}var Zr,Ra;function So(){if(Ra)return Zr;Ra=1;var e=Array.prototype.slice,t=Bl(),r=Object.keys,n=r?function(s){return r(s)}:fv(),i=Object.keys;return n.shim=function(){if(Object.keys){var s=function(){var c=Object.keys(arguments);return c&&c.length===arguments.length}(1,2);s||(Object.keys=function(l){return t(l)?i(e.call(l)):i(l)})}else Object.keys=n;return Object.keys||n},Zr=n,Zr}var Jr,Oa;function Ir(){if(Oa)return Jr;Oa=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Jr=e,Jr}var Qr,Ea;function jo(){return Ea||(Ea=1,Qr=SyntaxError),Qr}var en,Ma;function Te(){return Ma||(Ma=1,en=TypeError),en}var tn,Na;function hv(){return Na||(Na=1,tn=Object.getOwnPropertyDescriptor),tn}var rn,_a;function dt(){if(_a)return rn;_a=1;var e=hv();if(e)try{e([],"length")}catch{e=null}return rn=e,rn}var nn,$a;function Ao(){if($a)return nn;$a=1;var e=Ir(),t=jo(),r=Te(),n=dt();return nn=function(o,s,c){if(!o||typeof o!="object"&&typeof o!="function")throw new r("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,h=!!n&&n(o,s);if(e)e(o,s,{configurable:f===null&&h?h.configurable:!f,enumerable:l===null&&h?h.enumerable:!l,value:c,writable:u===null&&h?h.writable:!u});else if(d||!l&&!u&&!f)o[s]=c;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},nn}var on,ka;function Co(){if(ka)return on;ka=1;var e=Ir(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},on=t,on}var an,La;function ft(){if(La)return an;La=1;var e=So(),t=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",r=Object.prototype.toString,n=Array.prototype.concat,i=Ao(),o=function(u){return typeof u=="function"&&r.call(u)==="[object Function]"},s=Co()(),c=function(u,f,d,h){if(f in u){if(h===!0){if(u[f]===d)return}else if(!o(h)||!h())return}s?i(u,f,d,!0):i(u,f,d)},l=function(u,f){var d=arguments.length>2?arguments[2]:{},h=e(f);t&&(h=n.call(h,Object.getOwnPropertySymbols(f)));for(var p=0;p<h.length;p+=1)c(u,h[p],f[h[p]],d[h[p]])};return l.supportsDescriptors=!!s,an=l,an}var sn={exports:{}},cn,Da;function Io(){return Da||(Da=1,cn=Object),cn}var ln,Ba;function ql(){return Ba||(Ba=1,ln=Error),ln}var un,qa;function pv(){return qa||(qa=1,un=EvalError),un}var dn,za;function mv(){return za||(za=1,dn=RangeError),dn}var fn,Fa;function gv(){return Fa||(Fa=1,fn=ReferenceError),fn}var hn,Ha;function xv(){return Ha||(Ha=1,hn=URIError),hn}var pn,Ua;function vv(){return Ua||(Ua=1,pn=Math.abs),pn}var mn,Ga;function yv(){return Ga||(Ga=1,mn=Math.floor),mn}var gn,Wa;function bv(){return Wa||(Wa=1,gn=Math.max),gn}var xn,Va;function wv(){return Va||(Va=1,xn=Math.min),xn}var vn,Xa;function Sv(){return Xa||(Xa=1,vn=Math.pow),vn}var yn,Ya;function jv(){return Ya||(Ya=1,yn=Math.round),yn}var bn,Ka;function Av(){return Ka||(Ka=1,bn=Number.isNaN||function(t){return t!==t}),bn}var wn,Za;function Cv(){if(Za)return wn;Za=1;var e=Av();return wn=function(r){return e(r)||r===0?r:r<0?-1:1},wn}var Sn,Ja;function Tr(){return Ja||(Ja=1,Sn=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(t,r);if(c.value!==i||c.enumerable!==!0)return!1}return!0}),Sn}var jn,Qa;function To(){if(Qa)return jn;Qa=1;var e=typeof Symbol<"u"&&Symbol,t=Tr();return jn=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},jn}var An,es;function zl(){return es||(es=1,An=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),An}var Cn,ts;function Fl(){if(ts)return Cn;ts=1;var e=Io();return Cn=e.getPrototypeOf||null,Cn}var In,rs;function Iv(){if(rs)return In;rs=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(l,u){for(var f=[],d=0;d<l.length;d+=1)f[d]=l[d];for(var h=0;h<u.length;h+=1)f[h+l.length]=u[h];return f},o=function(l,u){for(var f=[],d=u,h=0;d<l.length;d+=1,h+=1)f[h]=l[d];return f},s=function(c,l){for(var u="",f=0;f<c.length;f+=1)u+=c[f],f+1<c.length&&(u+=l);return u};return In=function(l){var u=this;if(typeof u!="function"||t.apply(u)!==n)throw new TypeError(e+u);for(var f=o(arguments,1),d,h=function(){if(this instanceof d){var S=u.apply(this,i(f,arguments));return Object(S)===S?S:this}return u.apply(l,i(f,arguments))},p=r(0,u.length-f.length),m=[],g=0;g<p;g++)m[g]="$"+g;if(d=Function("binder","return function ("+s(m,",")+"){ return binder.apply(this,arguments); }")(h),u.prototype){var y=function(){};y.prototype=u.prototype,d.prototype=new y,y.prototype=null}return d},In}var Tn,ns;function Zt(){if(ns)return Tn;ns=1;var e=Iv();return Tn=Function.prototype.bind||e,Tn}var Pn,is;function Po(){return is||(is=1,Pn=Function.prototype.call),Pn}var Rn,os;function Ro(){return os||(os=1,Rn=Function.prototype.apply),Rn}var On,as;function Tv(){return as||(as=1,On=typeof Reflect<"u"&&Reflect&&Reflect.apply),On}var En,ss;function Hl(){if(ss)return En;ss=1;var e=Zt(),t=Ro(),r=Po(),n=Tv();return En=n||e.call(r,t),En}var Mn,cs;function Oo(){if(cs)return Mn;cs=1;var e=Zt(),t=Te(),r=Po(),n=Hl();return Mn=function(o){if(o.length<1||typeof o[0]!="function")throw new t("a function is required");return n(e,r,o)},Mn}var Nn,ls;function Pv(){if(ls)return Nn;ls=1;var e=Oo(),t=dt(),r;try{r=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var n=!!r&&t&&t(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return Nn=n&&typeof n.get=="function"?e([n.get]):typeof o=="function"?function(c){return o(c==null?c:i(c))}:!1,Nn}var _n,us;function Ul(){if(us)return _n;us=1;var e=zl(),t=Fl(),r=Pv();return _n=e?function(i){return e(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:r?function(i){return r(i)}:null,_n}var $n,ds;function Eo(){if(ds)return $n;ds=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=Zt();return $n=r.call(e,t),$n}var kn,fs;function Ve(){if(fs)return kn;fs=1;var e,t=Io(),r=ql(),n=pv(),i=mv(),o=gv(),s=jo(),c=Te(),l=xv(),u=vv(),f=yv(),d=bv(),h=wv(),p=Sv(),m=jv(),g=Cv(),y=Function,S=function(J){try{return y('"use strict"; return ('+J+").constructor;")()}catch{}},j=dt(),w=Ir(),A=function(){throw new c},O=j?function(){try{return arguments.callee,A}catch{try{return j(arguments,"callee").get}catch{return A}}}():A,M=To()(),N=Ul(),T=Fl(),C=zl(),$=Ro(),P=Po(),E={},L=typeof Uint8Array>"u"||!N?e:N(Uint8Array),k={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":M&&N?N([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":E,"%AsyncGenerator%":E,"%AsyncGeneratorFunction%":E,"%AsyncIteratorPrototype%":E,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":E,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&N?N(N([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!N?e:N(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":j,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!N?e:N(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&N?N(""[Symbol.iterator]()):e,"%Symbol%":M?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":O,"%TypedArray%":L,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":$,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":T,"%Math.abs%":u,"%Math.floor%":f,"%Math.max%":d,"%Math.min%":h,"%Math.pow%":p,"%Math.round%":m,"%Math.sign%":g,"%Reflect.getPrototypeOf%":C};if(N)try{null.error}catch(J){var Y=N(N(J));k["%Error.prototype%"]=Y}var re=function J(q){var z;if(q==="%AsyncFunction%")z=S("async function () {}");else if(q==="%GeneratorFunction%")z=S("function* () {}");else if(q==="%AsyncGeneratorFunction%")z=S("async function* () {}");else if(q==="%AsyncGenerator%"){var D=J("%AsyncGeneratorFunction%");D&&(z=D.prototype)}else if(q==="%AsyncIteratorPrototype%"){var V=J("%AsyncGenerator%");V&&N&&(z=N(V.prototype))}return k[q]=z,z},ue={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ne=Zt(),Q=Eo(),xe=ne.call(P,Array.prototype.concat),fe=ne.call($,Array.prototype.splice),Xe=ne.call(P,String.prototype.replace),Pe=ne.call(P,String.prototype.slice),I=ne.call(P,RegExp.prototype.exec),_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,U=function(q){var z=Pe(q,0,1),D=Pe(q,-1);if(z==="%"&&D!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(D==="%"&&z!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var V=[];return Xe(q,_,function(de,he,pe,ve){V[V.length]=pe?Xe(ve,G,"$1"):he||de}),V},K=function(q,z){var D=q,V;if(Q(ue,D)&&(V=ue[D],D="%"+V[0]+"%"),Q(k,D)){var de=k[D];if(de===E&&(de=re(D)),typeof de>"u"&&!z)throw new c("intrinsic "+q+" exists, but is not available. Please file an issue!");return{alias:V,name:D,value:de}}throw new s("intrinsic "+q+" does not exist!")};return kn=function(q,z){if(typeof q!="string"||q.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof z!="boolean")throw new c('"allowMissing" argument must be a boolean');if(I(/^%?[^%]*%?$/,q)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var D=U(q),V=D.length>0?D[0]:"",de=K("%"+V+"%",z),he=de.name,pe=de.value,ve=!1,be=de.alias;be&&(V=be[0],fe(D,xe([0,1],be)));for(var Le=1,Re=!0;Le<D.length;Le+=1){var we=D[Le],De=Pe(we,0,1),Be=Pe(we,-1);if((De==='"'||De==="'"||De==="`"||Be==='"'||Be==="'"||Be==="`")&&De!==Be)throw new s("property names with quotes must have matching quotes");if((we==="constructor"||!Re)&&(ve=!0),V+="."+we,he="%"+V+"%",Q(k,he))pe=k[he];else if(pe!=null){if(!(we in pe)){if(!z)throw new c("base intrinsic for "+q+" exists, but the property is not available.");return}if(j&&Le+1>=D.length){var qe=j(pe,we);Re=!!qe,Re&&"get"in qe&&!("originalValue"in qe.get)?pe=qe.get:pe=pe[we]}else Re=Q(pe,we),pe=pe[we];Re&&!ve&&(k[he]=pe)}}return pe},kn}var Ln,hs;function Rv(){if(hs)return Ln;hs=1;var e=Ve(),t=Ao(),r=Co()(),n=dt(),i=Te(),o=e("%Math.floor%");return Ln=function(c,l){if(typeof c!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new i("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],f=!0,d=!0;if("length"in c&&n){var h=n(c,"length");h&&!h.configurable&&(f=!1),h&&!h.writable&&(d=!1)}return(f||d||!u)&&(r?t(c,"length",l,!0,!0):t(c,"length",l)),c},Ln}var Dn,ps;function Ov(){if(ps)return Dn;ps=1;var e=Zt(),t=Ro(),r=Hl();return Dn=function(){return r(e,t,arguments)},Dn}var ms;function Tt(){return ms||(ms=1,function(e){var t=Rv(),r=Ir(),n=Oo(),i=Ov();e.exports=function(s){var c=n(arguments),l=s.length-(arguments.length-1);return t(c,1+(l>0?l:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i}(sn)),sn.exports}var Bn,gs;function ye(){if(gs)return Bn;gs=1;var e=Ve(),t=Oo(),r=t([e("%String.prototype.indexOf%")]);return Bn=function(i,o){var s=e(i,!!o);return typeof s=="function"&&r(i,".prototype.")>-1?t([s]):s},Bn}var qn,xs;function Gl(){if(xs)return qn;xs=1;var e=So(),t=Tr()(),r=ye(),n=Io(),i=r("Array.prototype.push"),o=r("Object.prototype.propertyIsEnumerable"),s=t?n.getOwnPropertySymbols:null;return qn=function(l,u){if(l==null)throw new TypeError("target must be an object");var f=n(l);if(arguments.length===1)return f;for(var d=1;d<arguments.length;++d){var h=n(arguments[d]),p=e(h),m=t&&(n.getOwnPropertySymbols||s);if(m)for(var g=m(h),y=0;y<g.length;++y){var S=g[y];o(h,S)&&i(p,S)}for(var j=0;j<p.length;++j){var w=p[j];if(o(h,w)){var A=h[w];f[w]=A}}}return f},qn}var zn,vs;function Wl(){if(vs)return zn;vs=1;var e=Gl(),t=function(){if(!Object.assign)return!1;for(var n="abcdefghijklmnopqrst",i=n.split(""),o={},s=0;s<i.length;++s)o[i[s]]=i[s];var c=Object.assign({},o),l="";for(var u in c)l+=u;return n!==l},r=function(){if(!Object.assign||!Object.preventExtensions)return!1;var n=Object.preventExtensions({1:2});try{Object.assign(n,"xy")}catch{return n[1]==="y"}return!1};return zn=function(){return!Object.assign||t()||r()?e:Object.assign},zn}var Fn,ys;function Ev(){if(ys)return Fn;ys=1;var e=ft(),t=Wl();return Fn=function(){var n=t();return e(Object,{assign:n},{assign:function(){return Object.assign!==n}}),n},Fn}var Hn,bs;function Mv(){if(bs)return Hn;bs=1;var e=ft(),t=Tt(),r=Gl(),n=Wl(),i=Ev(),o=t.apply(n()),s=function(l,u){return o(Object,arguments)};return e(s,{getPolyfill:n,implementation:r,shim:i}),Hn=s,Hn}var Un,ws;function Vl(){if(ws)return Un;ws=1;var e=Ve(),t=Tt(),r=t(e("String.prototype.indexOf"));return Un=function(i,o){var s=e(i,!!o);return typeof s=="function"&&r(i,".prototype.")>-1?t(s):s},Un}var Gn,Ss;function Nv(){if(Ss)return Gn;Ss=1;var e=function(){return typeof(function(){}).name=="string"},t=Object.getOwnPropertyDescriptor;if(t)try{t([],"length")}catch{t=null}e.functionsHaveConfigurableNames=function(){if(!e()||!t)return!1;var i=t(function(){},"name");return!!i&&!!i.configurable};var r=Function.prototype.bind;return e.boundFunctionsHaveNames=function(){return e()&&typeof r=="function"&&(function(){}).bind().name!==""},Gn=e,Gn}var Wn,js;function _v(){if(js)return Wn;js=1;var e=Ao(),t=Co()(),r=Nv().functionsHaveConfigurableNames(),n=Te();return Wn=function(o,s){if(typeof o!="function")throw new n("`fn` is not a function");var c=arguments.length>2&&!!arguments[2];return(!c||r)&&(t?e(o,"name",s,!0,!0):e(o,"name",s)),o},Wn}var Vn,As;function Xl(){if(As)return Vn;As=1;var e=_v(),t=Te(),r=Object;return Vn=e(function(){if(this==null||this!==r(this))throw new t("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),Vn}var Xn,Cs;function Yl(){if(Cs)return Xn;Cs=1;var e=Xl(),t=ft().supportsDescriptors,r=Object.getOwnPropertyDescriptor;return Xn=function(){if(t&&/a/mig.flags==="gim"){var i=r(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var o="",s={};if(Object.defineProperty(s,"hasIndices",{get:function(){o+="d"}}),Object.defineProperty(s,"sticky",{get:function(){o+="y"}}),i.get.call(s),o==="dy")return i.get}}return e},Xn}var Yn,Is;function $v(){if(Is)return Yn;Is=1;var e=ft().supportsDescriptors,t=Yl(),r=dt(),n=Object.defineProperty,i=ql(),o=Ul(),s=/a/;return Yn=function(){if(!e||!o)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var l=t(),u=o(s),f=r(u,"flags");return(!f||f.get!==l)&&n(u,"flags",{configurable:!0,enumerable:!1,get:l}),l},Yn}var Kn,Ts;function kv(){if(Ts)return Kn;Ts=1;var e=ft(),t=Tt(),r=Xl(),n=Yl(),i=$v(),o=t(n());return e(o,{getPolyfill:n,implementation:r,shim:i}),Kn=o,Kn}var Nt={exports:{}},Zn,Ps;function ht(){if(Ps)return Zn;Ps=1;var e=Tr();return Zn=function(){return e()&&!!Symbol.toStringTag},Zn}var Jn,Rs;function Kl(){if(Rs)return Jn;Rs=1;var e=ht()(),t=ye(),r=t("Object.prototype.toString"),n=function(c){return e&&c&&typeof c=="object"&&Symbol.toStringTag in c?!1:r(c)==="[object Arguments]"},i=function(c){return n(c)?!0:c!==null&&typeof c=="object"&&"length"in c&&typeof c.length=="number"&&c.length>=0&&r(c)!=="[object Array]"&&"callee"in c&&r(c.callee)==="[object Function]"},o=function(){return n(arguments)}();return n.isLegacyArguments=i,Jn=o?n:i,Jn}const Lv={},Dv=Object.freeze(Object.defineProperty({__proto__:null,default:Lv},Symbol.toStringTag,{value:"Module"})),Bv=Dl(Dv);var Qn,Os;function Pr(){if(Os)return Qn;Os=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=i&&o&&typeof o.get=="function"?o.get:null,c=i&&Set.prototype.forEach,l=typeof WeakMap=="function"&&WeakMap.prototype,u=l?WeakMap.prototype.has:null,f=typeof WeakSet=="function"&&WeakSet.prototype,d=f?WeakSet.prototype.has:null,h=typeof WeakRef=="function"&&WeakRef.prototype,p=h?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,g=Object.prototype.toString,y=Function.prototype.toString,S=String.prototype.match,j=String.prototype.slice,w=String.prototype.replace,A=String.prototype.toUpperCase,O=String.prototype.toLowerCase,M=RegExp.prototype.test,N=Array.prototype.concat,T=Array.prototype.join,C=Array.prototype.slice,$=Math.floor,P=typeof BigInt=="function"?BigInt.prototype.valueOf:null,E=Object.getOwnPropertySymbols,L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,k=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Y=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===k||!0)?Symbol.toStringTag:null,re=Object.prototype.propertyIsEnumerable,ue=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(x){return x.__proto__}:null);function ne(x,v){if(x===1/0||x===-1/0||x!==x||x&&x>-1e3&&x<1e3||M.call(/e/,v))return v;var te=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof x=="number"){var ie=x<0?-$(-x):$(x);if(ie!==x){var oe=String(ie),X=j.call(v,oe.length+1);return w.call(oe,te,"$&_")+"."+w.call(w.call(X,/([0-9]{3})/g,"$&_"),/_$/,"")}}return w.call(v,te,"$&_")}var Q=Bv,xe=Q.custom,fe=de(xe)?xe:null,Xe={__proto__:null,double:'"',single:"'"},Pe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Qn=function x(v,te,ie,oe){var X=te||{};if(ve(X,"quoteStyle")&&!ve(Xe,X.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ve(X,"maxStringLength")&&(typeof X.maxStringLength=="number"?X.maxStringLength<0&&X.maxStringLength!==1/0:X.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Ze=ve(X,"customInspect")?X.customInspect:!0;if(typeof Ze!="boolean"&&Ze!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ve(X,"indent")&&X.indent!==null&&X.indent!==" "&&!(parseInt(X.indent,10)===X.indent&&X.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ve(X,"numericSeparator")&&typeof X.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var ot=X.numericSeparator;if(typeof v>"u")return"undefined";if(v===null)return"null";if(typeof v=="boolean")return v?"true":"false";if(typeof v=="string")return pt(v,X);if(typeof v=="number"){if(v===0)return 1/0/v>0?"0":"-0";var Se=String(v);return ot?ne(v,Se):Se}if(typeof v=="bigint"){var Je=String(v)+"n";return ot?ne(v,Je):Je}var Er=typeof X.depth>"u"?5:X.depth;if(typeof ie>"u"&&(ie=0),ie>=Er&&Er>0&&typeof v=="object")return U(v)?"[Array]":"[Object]";var mt=mu(X,ie);if(typeof oe>"u")oe=[];else if(Re(oe,v)>=0)return"[Circular]";function Oe(gt,tr,xu){if(tr&&(oe=C.call(oe),oe.push(tr)),xu){var zo={depth:X.depth};return ve(X,"quoteStyle")&&(zo.quoteStyle=X.quoteStyle),x(gt,zo,ie+1,oe)}return x(gt,X,ie+1,oe)}if(typeof v=="function"&&!J(v)){var _o=Le(v),$o=Qt(v,Oe);return"[Function"+(_o?": "+_o:" (anonymous)")+"]"+($o.length>0?" { "+T.call($o,", ")+" }":"")}if(de(v)){var ko=k?w.call(String(v),/^(Symbol\(.*\))_[^)]*$/,"$1"):L.call(v);return typeof v=="object"&&!k?Ke(ko):ko}if(Ye(v)){for(var Rt="<"+O.call(String(v.nodeName)),Mr=v.attributes||[],er=0;er<Mr.length;er++)Rt+=" "+Mr[er].name+"="+I(_(Mr[er].value),"double",X);return Rt+=">",v.childNodes&&v.childNodes.length&&(Rt+="..."),Rt+="</"+O.call(String(v.nodeName))+">",Rt}if(U(v)){if(v.length===0)return"[]";var Nr=Qt(v,Oe);return mt&&!pu(Nr)?"["+Or(Nr,mt)+"]":"[ "+T.call(Nr,", ")+" ]"}if(q(v)){var _r=Qt(v,Oe);return!("cause"in Error.prototype)&&"cause"in v&&!re.call(v,"cause")?"{ ["+String(v)+"] "+T.call(N.call("[cause]: "+Oe(v.cause),_r),", ")+" }":_r.length===0?"["+String(v)+"]":"{ ["+String(v)+"] "+T.call(_r,", ")+" }"}if(typeof v=="object"&&Ze){if(fe&&typeof v[fe]=="function"&&Q)return Q(v,{depth:Er-ie});if(Ze!=="symbol"&&typeof v.inspect=="function")return v.inspect()}if(we(v)){var Lo=[];return n&&n.call(v,function(gt,tr){Lo.push(Oe(tr,v,!0)+" => "+Oe(gt,v))}),No("Map",r.call(v),Lo,mt)}if(qe(v)){var Do=[];return c&&c.call(v,function(gt){Do.push(Oe(gt,v))}),No("Set",s.call(v),Do,mt)}if(De(v))return Rr("WeakMap");if(Jt(v))return Rr("WeakSet");if(Be(v))return Rr("WeakRef");if(D(v))return Ke(Oe(Number(v)));if(he(v))return Ke(Oe(P.call(v)));if(V(v))return Ke(m.call(v));if(z(v))return Ke(Oe(String(v)));if(typeof window<"u"&&v===window)return"{ [object Window] }";if(typeof globalThis<"u"&&v===globalThis||typeof Ut<"u"&&v===Ut)return"{ [object globalThis] }";if(!K(v)&&!J(v)){var $r=Qt(v,Oe),Bo=ue?ue(v)===Object.prototype:v instanceof Object||v.constructor===Object,kr=v instanceof Object?"":"null prototype",qo=!Bo&&Y&&Object(v)===v&&Y in v?j.call(be(v),8,-1):kr?"Object":"",gu=Bo||typeof v.constructor!="function"?"":v.constructor.name?v.constructor.name+" ":"",Lr=gu+(qo||kr?"["+T.call(N.call([],qo||[],kr||[]),": ")+"] ":"");return $r.length===0?Lr+"{}":mt?Lr+"{"+Or($r,mt)+"}":Lr+"{ "+T.call($r,", ")+" }"}return String(v)};function I(x,v,te){var ie=te.quoteStyle||v,oe=Xe[ie];return oe+x+oe}function _(x){return w.call(String(x),/"/g,"&quot;")}function G(x){return!Y||!(typeof x=="object"&&(Y in x||typeof x[Y]<"u"))}function U(x){return be(x)==="[object Array]"&&G(x)}function K(x){return be(x)==="[object Date]"&&G(x)}function J(x){return be(x)==="[object RegExp]"&&G(x)}function q(x){return be(x)==="[object Error]"&&G(x)}function z(x){return be(x)==="[object String]"&&G(x)}function D(x){return be(x)==="[object Number]"&&G(x)}function V(x){return be(x)==="[object Boolean]"&&G(x)}function de(x){if(k)return x&&typeof x=="object"&&x instanceof Symbol;if(typeof x=="symbol")return!0;if(!x||typeof x!="object"||!L)return!1;try{return L.call(x),!0}catch{}return!1}function he(x){if(!x||typeof x!="object"||!P)return!1;try{return P.call(x),!0}catch{}return!1}var pe=Object.prototype.hasOwnProperty||function(x){return x in this};function ve(x,v){return pe.call(x,v)}function be(x){return g.call(x)}function Le(x){if(x.name)return x.name;var v=S.call(y.call(x),/^function\s*([\w$]+)/);return v?v[1]:null}function Re(x,v){if(x.indexOf)return x.indexOf(v);for(var te=0,ie=x.length;te<ie;te++)if(x[te]===v)return te;return-1}function we(x){if(!r||!x||typeof x!="object")return!1;try{r.call(x);try{s.call(x)}catch{return!0}return x instanceof Map}catch{}return!1}function De(x){if(!u||!x||typeof x!="object")return!1;try{u.call(x,u);try{d.call(x,d)}catch{return!0}return x instanceof WeakMap}catch{}return!1}function Be(x){if(!p||!x||typeof x!="object")return!1;try{return p.call(x),!0}catch{}return!1}function qe(x){if(!s||!x||typeof x!="object")return!1;try{s.call(x);try{r.call(x)}catch{return!0}return x instanceof Set}catch{}return!1}function Jt(x){if(!d||!x||typeof x!="object")return!1;try{d.call(x,d);try{u.call(x,u)}catch{return!0}return x instanceof WeakSet}catch{}return!1}function Ye(x){return!x||typeof x!="object"?!1:typeof HTMLElement<"u"&&x instanceof HTMLElement?!0:typeof x.nodeName=="string"&&typeof x.getAttribute=="function"}function pt(x,v){if(x.length>v.maxStringLength){var te=x.length-v.maxStringLength,ie="... "+te+" more character"+(te>1?"s":"");return pt(j.call(x,0,v.maxStringLength),v)+ie}var oe=Pe[v.quoteStyle||"single"];oe.lastIndex=0;var X=w.call(w.call(x,oe,"\\$1"),/[\x00-\x1f]/g,Pt);return I(X,"single",v)}function Pt(x){var v=x.charCodeAt(0),te={8:"b",9:"t",10:"n",12:"f",13:"r"}[v];return te?"\\"+te:"\\x"+(v<16?"0":"")+A.call(v.toString(16))}function Ke(x){return"Object("+x+")"}function Rr(x){return x+" { ? }"}function No(x,v,te,ie){var oe=ie?Or(te,ie):T.call(te,", ");return x+" ("+v+") {"+oe+"}"}function pu(x){for(var v=0;v<x.length;v++)if(Re(x[v],`
2
+ `)>=0)return!1;return!0}function mu(x,v){var te;if(x.indent===" ")te=" ";else if(typeof x.indent=="number"&&x.indent>0)te=T.call(Array(x.indent+1)," ");else return null;return{base:te,prev:T.call(Array(v+1),te)}}function Or(x,v){if(x.length===0)return"";var te=`
3
3
  `+v.prev+v.base;return te+T.call(x,","+te)+`
4
- `+v.prev}function Qt(x,v){var te=U(x),ie=[];if(te){ie.length=x.length;for(var oe=0;oe<x.length;oe++)ie[oe]=ve(x,oe)?v(x[oe],x):""}var X=typeof E=="function"?E(x):[],Ze;if(k){Ze={};for(var ot=0;ot<X.length;ot++)Ze["$"+X[ot]]=X[ot]}for(var Se in x)ve(x,Se)&&(te&&String(Number(Se))===Se&&Se<x.length||k&&Ze["$"+Se]instanceof Symbol||(M.call(/[^\w$]/,Se)?ie.push(v(Se,x)+": "+v(x[Se],x)):ie.push(Se+": "+v(x[Se],x))));if(typeof E=="function")for(var Je=0;Je<X.length;Je++)re.call(x,X[Je])&&ie.push("["+v(X[Je])+"]: "+v(x[X[Je]],x));return ie}return Qn}var ei,Es;function qv(){if(Es)return ei;Es=1;var e=Pr(),t=Te(),r=function(c,l,u){for(var f=c,d;(d=f.next)!=null;f=d)if(d.key===l)return f.next=d.next,u||(d.next=c.next,c.next=d),d},n=function(c,l){if(c){var u=r(c,l);return u&&u.value}},i=function(c,l,u){var f=r(c,l);f?f.value=u:c.next={key:l,next:c.next,value:u}},o=function(c,l){return c?!!r(c,l):!1},s=function(c,l){if(c)return r(c,l,!0)};return ei=function(){var l,u={assert:function(f){if(!u.has(f))throw new t("Side channel does not contain "+e(f))},delete:function(f){var d=l&&l.next,h=s(l,f);return h&&d&&d===h&&(l=void 0),!!h},get:function(f){return n(l,f)},has:function(f){return o(l,f)},set:function(f,d){l||(l={next:void 0}),i(l,f,d)}};return u},ei}var ti,Ms;function Zl(){if(Ms)return ti;Ms=1;var e=Ve(),t=ye(),r=Pr(),n=Te(),i=e("%Map%",!0),o=t("Map.prototype.get",!0),s=t("Map.prototype.set",!0),c=t("Map.prototype.has",!0),l=t("Map.prototype.delete",!0),u=t("Map.prototype.size",!0);return ti=!!i&&function(){var d,h={assert:function(p){if(!h.has(p))throw new n("Side channel does not contain "+r(p))},delete:function(p){if(d){var m=l(d,p);return u(d)===0&&(d=void 0),m}return!1},get:function(p){if(d)return o(d,p)},has:function(p){return d?c(d,p):!1},set:function(p,m){d||(d=new i),s(d,p,m)}};return h},ti}var ri,Ns;function zv(){if(Ns)return ri;Ns=1;var e=Ve(),t=ye(),r=Pr(),n=Zl(),i=Te(),o=e("%WeakMap%",!0),s=t("WeakMap.prototype.get",!0),c=t("WeakMap.prototype.set",!0),l=t("WeakMap.prototype.has",!0),u=t("WeakMap.prototype.delete",!0);return ri=o?function(){var d,h,p={assert:function(m){if(!p.has(m))throw new i("Side channel does not contain "+r(m))},delete:function(m){if(o&&m&&(typeof m=="object"||typeof m=="function")){if(d)return u(d,m)}else if(n&&h)return h.delete(m);return!1},get:function(m){return o&&m&&(typeof m=="object"||typeof m=="function")&&d?s(d,m):h&&h.get(m)},has:function(m){return o&&m&&(typeof m=="object"||typeof m=="function")&&d?l(d,m):!!h&&h.has(m)},set:function(m,g){o&&m&&(typeof m=="object"||typeof m=="function")?(d||(d=new o),c(d,m,g)):n&&(h||(h=n()),h.set(m,g))}};return p}:n,ri}var ni,_s;function Jl(){if(_s)return ni;_s=1;var e=Te(),t=Pr(),r=qv(),n=Zl(),i=zv(),o=i||n||r;return ni=function(){var c,l={assert:function(u){if(!l.has(u))throw new e("Side channel does not contain "+t(u))},delete:function(u){return!!c&&c.delete(u)},get:function(u){return c&&c.get(u)},has:function(u){return!!c&&c.has(u)},set:function(u,f){c||(c=o()),c.set(u,f)}};return l},ni}var ii,$s;function Fv(){if($s)return ii;$s=1;var e=Eo(),t=Jl()(),r=Te(),n={assert:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");if(t.assert(i),!n.has(i,o))throw new r("`"+o+"` is not present on `O`")},get:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");var s=t.get(i);return s&&s["$"+o]},has:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");var s=t.get(i);return!!s&&e(s,"$"+o)},set:function(i,o,s){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");var c=t.get(i);c||(c={},t.set(i,c)),c["$"+o]=s}};return Object.freeze&&Object.freeze(n),ii=n,ii}var oi,ks;function Hv(){if(ks)return oi;ks=1;var e=Fv(),t=jo(),r=typeof StopIteration=="object"?StopIteration:null;return oi=function(i){if(!r)throw new t("this environment lacks StopIteration");e.set(i,"[[Done]]",!1);var o={next:function(){var c=e.get(this,"[[Iterator]]"),l=!!e.get(c,"[[Done]]");try{return{done:l,value:l?void 0:c.next()}}catch(u){if(e.set(c,"[[Done]]",!0),u!==r)throw u;return{done:!0,value:void 0}}}};return e.set(o,"[[Iterator]]",i),o},oi}var ai,Ls;function Ql(){if(Ls)return ai;Ls=1;var e={}.toString;return ai=Array.isArray||function(t){return e.call(t)=="[object Array]"},ai}var si,Ds;function eu(){if(Ds)return si;Ds=1;var e=ye(),t=e("String.prototype.valueOf"),r=function(c){try{return t(c),!0}catch{return!1}},n=e("Object.prototype.toString"),i="[object String]",o=ht()();return si=function(c){return typeof c=="string"?!0:!c||typeof c!="object"?!1:o?r(c):n(c)===i},si}var ci,Bs;function tu(){if(Bs)return ci;Bs=1;var e=typeof Map=="function"&&Map.prototype?Map:null,t=typeof Set=="function"&&Set.prototype?Set:null,r;e||(r=function(s){return!1});var n=e?Map.prototype.has:null,i=t?Set.prototype.has:null;return!r&&!n&&(r=function(s){return!1}),ci=r||function(s){if(!s||typeof s!="object")return!1;try{if(n.call(s),i)try{i.call(s)}catch{return!0}return s instanceof e}catch{}return!1},ci}var li,qs;function ru(){if(qs)return li;qs=1;var e=typeof Map=="function"&&Map.prototype?Map:null,t=typeof Set=="function"&&Set.prototype?Set:null,r;t||(r=function(s){return!1});var n=e?Map.prototype.has:null,i=t?Set.prototype.has:null;return!r&&!i&&(r=function(s){return!1}),li=r||function(s){if(!s||typeof s!="object")return!1;try{if(i.call(s),n)try{n.call(s)}catch{return!0}return s instanceof t}catch{}return!1},li}var zs;function Uv(){if(zs)return Nt.exports;zs=1;var e=Kl(),t=Hv();if(To()()||Tr()()){var r=Symbol.iterator;Nt.exports=function(C){if(C!=null&&typeof C[r]<"u")return C[r]();if(e(C))return Array.prototype[r].call(C)}}else{var n=Ql(),i=eu(),o=Ve(),s=o("%Map%",!0),c=o("%Set%",!0),l=Vl(),u=l("Array.prototype.push"),f=l("String.prototype.charCodeAt"),d=l("String.prototype.slice"),h=function(C,$){var P=C.length;if($+1>=P)return $+1;var E=f(C,$);if(E<55296||E>56319)return $+1;var L=f(C,$+1);return L<56320||L>57343?$+1:$+2},p=function(C){var $=0;return{next:function(){var E=$>=C.length,L;return E||(L=C[$],$+=1),{done:E,value:L}}}},m=function(C,$){if(n(C)||e(C))return p(C);if(i(C)){var P=0;return{next:function(){var L=h(C,P),k=d(C,P,L);return P=L,{done:L>C.length,value:k}}}}if($&&typeof C["_es6-shim iterator_"]<"u")return C["_es6-shim iterator_"]()};if(!s&&!c)Nt.exports=function(C){if(C!=null)return m(C,!0)};else{var g=tu(),y=ru(),S=l("Map.prototype.forEach",!0),j=l("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var w=l("Map.prototype.iterator",!0),A=l("Set.prototype.iterator",!0);var R=l("Map.prototype.@@iterator",!0)||l("Map.prototype._es6-shim iterator_",!0),M=l("Set.prototype.@@iterator",!0)||l("Set.prototype._es6-shim iterator_",!0),N=function(C){if(g(C)){if(w)return t(w(C));if(R)return R(C);if(S){var $=[];return S(C,function(E,L){u($,[L,E])}),p($)}}if(y(C)){if(A)return t(A(C));if(M)return M(C);if(j){var P=[];return j(C,function(E){u(P,E)}),p(P)}}};Nt.exports=function(C){return N(C)||m(C)}}}return Nt.exports}var ui,Fs;function nu(){if(Fs)return ui;Fs=1;var e=function(t){return t!==t};return ui=function(r,n){return r===0&&n===0?1/r===1/n:!!(r===n||e(r)&&e(n))},ui}var di,Hs;function iu(){if(Hs)return di;Hs=1;var e=nu();return di=function(){return typeof Object.is=="function"?Object.is:e},di}var fi,Us;function Gv(){if(Us)return fi;Us=1;var e=iu(),t=ft();return fi=function(){var n=e();return t(Object,{is:n},{is:function(){return Object.is!==n}}),n},fi}var hi,Gs;function Wv(){if(Gs)return hi;Gs=1;var e=ft(),t=Tt(),r=nu(),n=iu(),i=Gv(),o=t(n(),Object);return e(o,{getPolyfill:n,implementation:r,shim:i}),hi=o,hi}var pi,Ws;function ou(){if(Ws)return pi;Ws=1;var e=Tt(),t=ye(),r=Ve(),n=r("%ArrayBuffer%",!0),i=t("ArrayBuffer.prototype.byteLength",!0),o=t("Object.prototype.toString"),s=!!n&&!i&&new n(0).slice,c=!!s&&e(s);return pi=i||c?function(u){if(!u||typeof u!="object")return!1;try{return i?i(u):c(u,0),!0}catch{return!1}}:n?function(u){return o(u)==="[object ArrayBuffer]"}:function(u){return!1},pi}var mi,Vs;function Vv(){if(Vs)return mi;Vs=1;var e=ye(),t=e("Date.prototype.getDay"),r=function(c){try{return t(c),!0}catch{return!1}},n=e("Object.prototype.toString"),i="[object Date]",o=ht()();return mi=function(c){return typeof c!="object"||c===null?!1:o?r(c):n(c)===i},mi}var gi,Xs;function au(){if(Xs)return gi;Xs=1;var e=ye(),t=ht()(),r=Eo(),n=dt(),i;if(t){var o=e("RegExp.prototype.exec"),s={},c=function(){throw s},l={toString:c,valueOf:c};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=c),i=function(h){if(!h||typeof h!="object")return!1;var p=n(h,"lastIndex"),m=p&&r(p,"value");if(!m)return!1;try{o(h,l)}catch(g){return g===s}}}else{var u=e("Object.prototype.toString"),f="[object RegExp]";i=function(h){return!h||typeof h!="object"&&typeof h!="function"?!1:u(h)===f}}return gi=i,gi}var xi,Ys;function Xv(){if(Ys)return xi;Ys=1;var e=ye(),t=e("SharedArrayBuffer.prototype.byteLength",!0);return xi=t?function(n){if(!n||typeof n!="object")return!1;try{return t(n),!0}catch{return!1}}:function(n){return!1},xi}var vi,Ks;function Yv(){if(Ks)return vi;Ks=1;var e=ye(),t=e("Number.prototype.toString"),r=function(c){try{return t(c),!0}catch{return!1}},n=e("Object.prototype.toString"),i="[object Number]",o=ht()();return vi=function(c){return typeof c=="number"?!0:!c||typeof c!="object"?!1:o?r(c):n(c)===i},vi}var yi,Zs;function Kv(){if(Zs)return yi;Zs=1;var e=ye(),t=e("Boolean.prototype.toString"),r=e("Object.prototype.toString"),n=function(c){try{return t(c),!0}catch{return!1}},i="[object Boolean]",o=ht()();return yi=function(c){return typeof c=="boolean"?!0:c===null||typeof c!="object"?!1:o?n(c):r(c)===i},yi}var cr={exports:{}},bi,Js;function Zv(){if(Js)return bi;Js=1;var e=ye(),t=au(),r=e("RegExp.prototype.exec"),n=Te();return bi=function(o){if(!t(o))throw new n("`regex` must be a RegExp");return function(c){return r(o,c)!==null}},bi}var Qs;function Jv(){if(Qs)return cr.exports;Qs=1;var e=ye(),t=e("Object.prototype.toString"),r=To()(),n=Zv();if(r){var i=e("Symbol.prototype.toString"),o=n(/^Symbol\(.*\)$/),s=function(l){return typeof l.valueOf()!="symbol"?!1:o(i(l))};cr.exports=function(l){if(typeof l=="symbol")return!0;if(!l||typeof l!="object"||t(l)!=="[object Symbol]")return!1;try{return s(l)}catch{return!1}}}else cr.exports=function(l){return!1};return cr.exports}var lr={exports:{}},wi,ec;function Qv(){if(ec)return wi;ec=1;var e=typeof BigInt<"u"&&BigInt;return wi=function(){return typeof e=="function"&&typeof BigInt=="function"&&typeof e(42)=="bigint"&&typeof BigInt(42)=="bigint"},wi}var tc;function ey(){if(tc)return lr.exports;tc=1;var e=Qv()();if(e){var t=BigInt.prototype.valueOf,r=function(i){try{return t.call(i),!0}catch{}return!1};lr.exports=function(i){return i===null||typeof i>"u"||typeof i=="boolean"||typeof i=="string"||typeof i=="number"||typeof i=="symbol"||typeof i=="function"?!1:typeof i=="bigint"?!0:r(i)}}else lr.exports=function(i){return!1};return lr.exports}var Si,rc;function ty(){if(rc)return Si;rc=1;var e=eu(),t=Yv(),r=Kv(),n=Jv(),i=ey();return Si=function(s){if(s==null||typeof s!="object"&&typeof s!="function")return null;if(e(s))return"String";if(t(s))return"Number";if(r(s))return"Boolean";if(n(s))return"Symbol";if(i(s))return"BigInt"},Si}var ji,nc;function ry(){if(nc)return ji;nc=1;var e=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,t=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,r;e||(r=function(s){return!1});var n=e?e.prototype.has:null,i=t?t.prototype.has:null;return!r&&!n&&(r=function(s){return!1}),ji=r||function(s){if(!s||typeof s!="object")return!1;try{if(n.call(s,n),i)try{i.call(s,i)}catch{return!0}return s instanceof e}catch{}return!1},ji}var ur={exports:{}},ic;function ny(){if(ic)return ur.exports;ic=1;var e=Ve(),t=ye(),r=e("%WeakSet%",!0),n=t("WeakSet.prototype.has",!0);if(n){var i=t("WeakMap.prototype.has",!0);ur.exports=function(s){if(!s||typeof s!="object")return!1;try{if(n(s,n),i)try{i(s,i)}catch{return!0}return s instanceof r}catch{}return!1}}else ur.exports=function(s){return!1};return ur.exports}var Ai,oc;function iy(){if(oc)return Ai;oc=1;var e=tu(),t=ru(),r=ry(),n=ny();return Ai=function(o){if(o&&typeof o=="object"){if(e(o))return"Map";if(t(o))return"Set";if(r(o))return"WeakMap";if(n(o))return"WeakSet"}return!1},Ai}var Ci,ac;function oy(){if(ac)return Ci;ac=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(j){j!==n&&(t=null)}else t=null;var i=/^\s*class\b/,o=function(w){try{var A=e.call(w);return i.test(A)}catch{return!1}},s=function(w){try{return o(w)?!1:(e.call(w),!0)}catch{return!1}},c=Object.prototype.toString,l="[object Object]",u="[object Function]",f="[object GeneratorFunction]",d="[object HTMLAllCollection]",h="[object HTML document.all class]",p="[object HTMLCollection]",m=typeof Symbol=="function"&&!!Symbol.toStringTag,g=!(0 in[,]),y=function(){return!1};if(typeof document=="object"){var S=document.all;c.call(S)===c.call(document.all)&&(y=function(w){if((g||!w)&&(typeof w>"u"||typeof w=="object"))try{var A=c.call(w);return(A===d||A===h||A===p||A===l)&&w("")==null}catch{}return!1})}return Ci=t?function(w){if(y(w))return!0;if(!w||typeof w!="function"&&typeof w!="object")return!1;try{t(w,null,r)}catch(A){if(A!==n)return!1}return!o(w)&&s(w)}:function(w){if(y(w))return!0;if(!w||typeof w!="function"&&typeof w!="object")return!1;if(m)return s(w);if(o(w))return!1;var A=c.call(w);return A!==u&&A!==f&&!/^\[object HTML/.test(A)?!1:s(w)},Ci}var Ii,sc;function ay(){if(sc)return Ii;sc=1;var e=oy(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(l,u,f){for(var d=0,h=l.length;d<h;d++)r.call(l,d)&&(f==null?u(l[d],d,l):u.call(f,l[d],d,l))},i=function(l,u,f){for(var d=0,h=l.length;d<h;d++)f==null?u(l.charAt(d),d,l):u.call(f,l.charAt(d),d,l)},o=function(l,u,f){for(var d in l)r.call(l,d)&&(f==null?u(l[d],d,l):u.call(f,l[d],d,l))};function s(c){return t.call(c)==="[object Array]"}return Ii=function(l,u,f){if(!e(u))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=f),s(l)?n(l,u,d):typeof l=="string"?i(l,u,d):o(l,u,d)},Ii}var Ti,cc;function sy(){return cc||(cc=1,Ti=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Ti}var Pi,lc;function cy(){if(lc)return Pi;lc=1;var e=sy(),t=typeof globalThis>"u"?Ut:globalThis;return Pi=function(){for(var n=[],i=0;i<e.length;i++)typeof t[e[i]]=="function"&&(n[n.length]=e[i]);return n},Pi}var Oi,uc;function ly(){if(uc)return Oi;uc=1;var e=ay(),t=cy(),r=Tt(),n=ye(),i=dt(),o=n("Object.prototype.toString"),s=ht()(),c=typeof globalThis>"u"?Ut:globalThis,l=t(),u=n("String.prototype.slice"),f=Object.getPrototypeOf,d=n("Array.prototype.indexOf",!0)||function(y,S){for(var j=0;j<y.length;j+=1)if(y[j]===S)return j;return-1},h={__proto__:null};s&&i&&f?e(l,function(g){var y=new c[g];if(Symbol.toStringTag in y){var S=f(y),j=i(S,Symbol.toStringTag);if(!j){var w=f(S);j=i(w,Symbol.toStringTag)}h["$"+g]=r(j.get)}}):e(l,function(g){var y=new c[g],S=y.slice||y.set;S&&(h["$"+g]=r(S))});var p=function(y){var S=!1;return e(h,function(j,w){if(!S)try{"$"+j(y)===w&&(S=u(w,1))}catch{}}),S},m=function(y){var S=!1;return e(h,function(j,w){if(!S)try{j(y),S=u(w,1)}catch{}}),S};return Oi=function(y){if(!y||typeof y!="object")return!1;if(!s){var S=u(o(y),8,-1);return d(l,S)>-1?S:S!=="Object"?!1:m(y)}return i?p(y):null},Oi}var Ri,dc;function uy(){if(dc)return Ri;dc=1;var e=ye(),t=e("ArrayBuffer.prototype.byteLength",!0),r=ou();return Ri=function(i){return r(i)?t?t(i):i.byteLength:NaN},Ri}var Ei,fc;function dy(){if(fc)return Ei;fc=1;var e=Mv(),t=Vl(),r=kv(),n=Ve(),i=Uv(),o=Jl(),s=Wv(),c=Kl(),l=Ql(),u=ou(),f=Vv(),d=au(),h=Xv(),p=So(),m=ty(),g=iy(),y=ly(),S=uy(),j=t("SharedArrayBuffer.prototype.byteLength",!0),w=t("Date.prototype.getTime"),A=Object.getPrototypeOf,R=t("Object.prototype.toString"),M=n("%Set%",!0),N=t("Map.prototype.has",!0),T=t("Map.prototype.get",!0),C=t("Map.prototype.size",!0),$=t("Set.prototype.add",!0),P=t("Set.prototype.delete",!0),E=t("Set.prototype.has",!0),L=t("Set.prototype.size",!0);function k(I,_,G,U){for(var K=i(I),J;(J=K.next())&&!J.done;)if(Q(_,J.value,G,U))return P(I,J.value),!0;return!1}function Y(I){if(typeof I>"u")return null;if(typeof I!="object")return typeof I=="symbol"?!1:typeof I=="string"||typeof I=="number"?+I==+I:!0}function re(I,_,G,U,K,J){var q=Y(G);if(q!=null)return q;var z=T(_,q),D=e({},K,{strict:!1});return typeof z>"u"&&!N(_,q)||!Q(U,z,D,J)?!1:!N(I,q)&&Q(U,z,D,J)}function ue(I,_,G){var U=Y(G);return U??(E(_,U)&&!E(I,U))}function ne(I,_,G,U,K,J){for(var q=i(I),z,D;(z=q.next())&&!z.done;)if(D=z.value,Q(G,D,K,J)&&Q(U,T(_,D),K,J))return P(I,D),!0;return!1}function Q(I,_,G,U){var K=G||{};if(K.strict?s(I,_):I===_)return!0;var J=m(I),q=m(_);if(J!==q)return!1;if(!I||!_||typeof I!="object"&&typeof _!="object")return K.strict?s(I,_):I==_;var z=U.has(I),D=U.has(_),V;if(z&&D){if(U.get(I)===U.get(_))return!0}else V={};return z||U.set(I,V),D||U.set(_,V),Pe(I,_,K,U)}function xe(I){return!I||typeof I!="object"||typeof I.length!="number"||typeof I.copy!="function"||typeof I.slice!="function"||I.length>0&&typeof I[0]!="number"?!1:!!(I.constructor&&I.constructor.isBuffer&&I.constructor.isBuffer(I))}function fe(I,_,G,U){if(L(I)!==L(_))return!1;for(var K=i(I),J=i(_),q,z,D;(q=K.next())&&!q.done;)if(q.value&&typeof q.value=="object")D||(D=new M),$(D,q.value);else if(!E(_,q.value)){if(G.strict||!ue(I,_,q.value))return!1;D||(D=new M),$(D,q.value)}if(D){for(;(z=J.next())&&!z.done;)if(z.value&&typeof z.value=="object"){if(!k(D,z.value,G.strict,U))return!1}else if(!G.strict&&!E(I,z.value)&&!k(D,z.value,G.strict,U))return!1;return L(D)===0}return!0}function Xe(I,_,G,U){if(C(I)!==C(_))return!1;for(var K=i(I),J=i(_),q,z,D,V,de,he;(q=K.next())&&!q.done;)if(V=q.value[0],de=q.value[1],V&&typeof V=="object")D||(D=new M),$(D,V);else if(he=T(_,V),typeof he>"u"&&!N(_,V)||!Q(de,he,G,U)){if(G.strict||!re(I,_,V,de,G,U))return!1;D||(D=new M),$(D,V)}if(D){for(;(z=J.next())&&!z.done;)if(V=z.value[0],he=z.value[1],V&&typeof V=="object"){if(!ne(D,I,V,he,G,U))return!1}else if(!G.strict&&(!I.has(V)||!Q(T(I,V),he,G,U))&&!ne(D,I,V,he,e({},G,{strict:!1}),U))return!1;return L(D)===0}return!0}function Pe(I,_,G,U){var K,J;if(typeof I!=typeof _||I==null||_==null||R(I)!==R(_)||c(I)!==c(_))return!1;var q=l(I),z=l(_);if(q!==z)return!1;var D=I instanceof Error,V=_ instanceof Error;if(D!==V||(D||V)&&(I.name!==_.name||I.message!==_.message))return!1;var de=d(I),he=d(_);if(de!==he||(de||he)&&(I.source!==_.source||r(I)!==r(_)))return!1;var pe=f(I),ve=f(_);if(pe!==ve||(pe||ve)&&w(I)!==w(_)||G.strict&&A&&A(I)!==A(_))return!1;var be=y(I),Le=y(_);if(be!==Le)return!1;if(be||Le){if(I.length!==_.length)return!1;for(K=0;K<I.length;K++)if(I[K]!==_[K])return!1;return!0}var Oe=xe(I),we=xe(_);if(Oe!==we)return!1;if(Oe||we){if(I.length!==_.length)return!1;for(K=0;K<I.length;K++)if(I[K]!==_[K])return!1;return!0}var De=u(I),Be=u(_);if(De!==Be)return!1;if(De||Be)return S(I)!==S(_)?!1:typeof Uint8Array=="function"&&Q(new Uint8Array(I),new Uint8Array(_),G,U);var qe=h(I),Jt=h(_);if(qe!==Jt)return!1;if(qe||Jt)return j(I)!==j(_)?!1:typeof Uint8Array=="function"&&Q(new Uint8Array(I),new Uint8Array(_),G,U);if(typeof I!=typeof _)return!1;var Ye=p(I),pt=p(_);if(Ye.length!==pt.length)return!1;for(Ye.sort(),pt.sort(),K=Ye.length-1;K>=0;K--)if(Ye[K]!=pt[K])return!1;for(K=Ye.length-1;K>=0;K--)if(J=Ye[K],!Q(I[J],_[J],G,U))return!1;var Pt=g(I),Ke=g(_);return Pt!==Ke?!1:Pt==="Set"||Ke==="Set"?fe(I,_,G,U):Pt==="Map"?Xe(I,_,G,U):!0}return Ei=function(_,G,U){return Q(_,G,U,o())},Ei}var fy=dy();const su=Ll(fy);function hy(e){return e}function cu(e,t,r,n){const i=hy,[o,s]=b.useState(i(r)),c=b.useRef(o);return b.useEffect(()=>{const l=()=>{const u={...r,...e.getAttributes(t)};Object.keys(u).forEach(d=>{(u[d]===null||u[d]===void 0)&&(u[d]=r?r[d]:null)});const f=i(u);su(c.current,f)||(s(f),c.current=f)};return e.on("selectionUpdate",l),e.on("transaction",l),()=>{e.off("selectionUpdate",l),e.off("transaction",l)}},[e,r,t,i]),o}function py({editor:e}){const{t}=B.useLocale(),{width:r,height:n,src:i}=cu(e,at.name,{width:0,height:0,src:"",defaultShowPicker:!1}),[o,s]=b.useState(!1),[c,l]=b.useState(""),u=b.useCallback(()=>{s(!1)},[s]);b.useEffect(()=>{o&&l(i)},[o,i]);const f=b.useCallback(()=>{const y=$l(c);e.chain().updateAttributes(at.name,{src:(y==null?void 0:y.src)||c}).setNodeSelection(e.state.selection.from).focus().run(),s(!1)},[e,c,s]),d=b.useCallback(()=>{window.open(i,"_blank")},[i]),h=b.useCallback(()=>{s(!0)},[s]),p=b.useCallback(y=>{e.chain().updateAttributes(at.name,y).setNodeSelection(e.state.selection.from).focus().run()},[e]),m=b.useCallback(()=>e.isActive(at.name)&&!i,[e,i]),g=b.useCallback(()=>po(at.name,e),[e]);return a.jsxs(a.Fragment,{children:[a.jsx(le.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"iframe-bubble-menu",shouldShow:m,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:a.jsxs("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:[a.jsx(F,{action:d,icon:"Eye",tooltip:"Visit Link"}),a.jsx(F,{action:h,icon:"Pencil",tooltip:"Open Edit Link"}),a.jsx(_l,{height:n,onOk:p,width:r,children:a.jsx(F,{icon:"Settings",tooltip:t("editor.settings")})}),a.jsx(F,{action:g,icon:"Trash2",tooltip:t("editor.delete")})]})}),a.jsxs(Vt,{onOpenChange:s,open:o,children:[a.jsx(Xt,{}),a.jsxs(jt,{children:[a.jsx(ml,{children:a.jsx(At,{children:"Edit Link Iframe"})}),a.jsx(je,{autoFocus:!0,onInput:y=>l(y.target.value),placeholder:"Enter link",type:"url",value:c}),a.jsxs(wr,{children:[a.jsx(ge,{onClick:u,children:"Cancel"}),a.jsx(ge,{onClick:f,children:"OK"})]})]})]})]})}function my({editor:e,disabled:t,bubbleMenu:r}){const n=e.extensionManager.extensions.map(o=>o.name),i=()=>{var o,s,c,l,u,f,d,h,p,m;return[n.includes("columns")&&!((o=r==null?void 0:r.columnConfig)!=null&&o.hidden)?a.jsx(Rx,{editor:e},"columns"):null,n.includes("table")&&!((s=r==null?void 0:r.tableConfig)!=null&&s.hidden)?a.jsx(Dg,{actions:(c=r==null?void 0:r.tableConfig)==null?void 0:c.actions,editor:e},"table"):null,n.includes("link")&&!((l=r==null?void 0:r.linkConfig)!=null&&l.hidden)?a.jsx(qg,{disabled:t,editor:e},"link"):null,n.includes(wt.name)&&!((u=r==null?void 0:r.imageConfig)!=null&&u.hidden)?a.jsx(jx,{disabled:t,editor:e},"image"):null,n.includes(co.name)&&!((f=r==null?void 0:r.imageGifConfig)!=null&&f.hidden)?a.jsx(Ax,{disabled:t,editor:e},"imageGif"):null,n.includes("video")&&!((d=r==null?void 0:r.videoConfig)!=null&&d.hidden)?a.jsx(Cx,{disabled:t,editor:e},"video"):null,n.includes("iframe")&&!((h=r==null?void 0:r.iframeConfig)!=null&&h.hidden)?a.jsx(py,{disabled:t,editor:e},"iframe"):null,(p=r==null?void 0:r.floatingMenuConfig)!=null&&p.hidden?null:a.jsx(pg,{disabled:t,editor:e},"content"),(m=r==null?void 0:r.textConfig)!=null&&m.hidden?null:a.jsx(xg,{disabled:t,editor:e},"text")]};return r!=null&&r.render?r.render({editor:e,disabled:t||!1,extensionsNames:n,bubbleMenu:r},i()):i().filter(Boolean)}function hc(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"currentColor",d:"M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5L5.27 5.27L4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6c1.52 0 2.9-.57 3.96-1.5l2.63 2.63l1.27-1.27z"})})}function lu(e){const{t}=B.useLocale(),{highlight:r=!1,disabled:n=!1,selectedColor:i,setSelectedColor:o,onChange:s,colors:c=B.COLORS_LIST}=e,l=b.useMemo(()=>{const p=c,m=[];for(let g=0;g<p.length;g+=10)m.push(p.slice(g,g+10));return m},[c]),[u,f]=b.useState([]),d=p=>{const m=[...u],g=m.indexOf(p);g!==-1&&m.splice(g,1),m.unshift(p),m.length>10&&m.pop(),f(m)};function h(p){if(p===void 0){o==null||o(p),s==null||s(p);return}/^#([\da-f]{3}){1,2}$/i.test(p)&&(o==null||o(p),s==null||s(p),d(p))}return a.jsxs(Yt,{modal:!0,children:[a.jsx(Kt,{asChild:!0,className:"!richtext-p-0",disabled:n,children:e==null?void 0:e.children}),a.jsx(Ct,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:a.jsxs("div",{className:"richtext-flex richtext-flex-col",children:[r?a.jsxs("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>h(void 0),children:[a.jsx(hc,{}),a.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:t("editor.nofill")})]}):a.jsxs("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>{h(void 0)},children:[a.jsx(hc,{}),a.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:t("editor.default")})]}),l.map((p,m)=>a.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:p.map((g,y)=>a.jsx("span",{className:"richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>h(g),children:a.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:g},children:g===i?a.jsx("svg",{className:"richtext-absolute -richtext-top-px richtext-left-px richtext-block richtext-size-3",viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)"},children:a.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})}):a.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:a.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-${y}`))},m)),a.jsxs("div",{children:[a.jsx("div",{className:"richtext-my-1 richtext-text-sm",children:t("editor.recent")}),a.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:u==null?void 0:u.map((p,m)=>a.jsx("span",{className:"richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>h(p),children:a.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:p},children:a.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:a.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-recent-${m}`))})]}),a.jsx(gy,{setColor:h})]})})]})}function gy({setColor:e}){const[t,r]=b.useState("#000000"),[n,i]=b.useState(!1),{t:o}=B.useLocale();return b.useEffect(()=>()=>{i(!1)},[]),a.jsxs(Yt,{open:n,children:[a.jsx(Kt,{asChild:!0,children:a.jsxs("div",{className:"richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",onClick:s=>{s.preventDefault(),i(!0)},children:[o("editor.color.more"),"..."]})}),a.jsxs(Ct,{children:[a.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-justify-center",children:[a.jsx(Eu.HexColorPicker,{color:t,onChange:r}),a.jsx(je,{className:"richtext-mt-[8px] richtext-w-full",type:"text",value:t.slice(1),onChange:s=>{s.preventDefault(),r(`#${s.target.value}`)}})]}),a.jsx(Ee,{className:"richtext-my-[10px]"}),a.jsx(ge,{className:"richtext-w-full",onClick:s=>{s.preventDefault(),e(t),i(!1)},children:a.jsx(O.Plus,{size:16})})]})]})}function xy({editor:e,disabled:t,toolbar:r}){const{t:n,lang:i}=B.useLocale(),o=b.useMemo(()=>{const u=[...e.extensionManager.extensions].sort((d,h)=>{const p=d.options.sort??-1,m=h.options.sort??-1;return p-m});let f=[];for(const d of u){const{button:h,divider:p=!1,spacer:m=!1,toolbar:g=!0}=d.options;if(!h||!gx(h)||!g)continue;const y=h({editor:e,extension:d,t:n});if(Array.isArray(y)){const S=y.map((j,w)=>({button:j,divider:w===y.length-1?p:!1,spacer:w===0?m:!1,type:d.type,name:d.name}));f=[...f,...S];continue}f.push({button:y,divider:p,spacer:m,type:d.type,name:d.name})}return f},[e,n,i]),s=l=>a.jsx("div",{className:"richtext-px-1 richtext-py-2 !richtext-border-b",style:{pointerEvents:t?"none":"auto",opacity:t?.5:1},children:a.jsx("div",{className:"richtext-relative richtext-flex richtext-flex-wrap richtext-h-auto richtext-gap-y-1 richtext-gap-x-1",children:l})}),c=o.map((l,u)=>{var d,h;const f=l.button.component;return a.jsxs("div",{className:"richtext-flex richtext-items-center",children:[(l==null?void 0:l.spacer)&&a.jsx(Ee,{orientation:"vertical",className:"!richtext-h-[16px] !richtext-mx-[10px]"}),a.jsx(f,{...l.button.componentProps,disabled:t||((h=(d=l==null?void 0:l.button)==null?void 0:d.componentProps)==null?void 0:h.disabled)}),(l==null?void 0:l.divider)&&a.jsx(Ee,{orientation:"vertical",className:"!richtext-h-auto !richtext-mx-2"})]},`toolbar-item-${u}`)});return r&&(r!=null&&r.render)?r.render({editor:e,disabled:t||!1},o,c,s):s(c)}function vy({editor:e,extensions:t}){const{t:r}=B.useLocale(),n=b.useMemo(()=>{var i,o,s;return(s=(o=(i=t==null?void 0:t.find(c=>c.name==="base-kit"))==null?void 0:i.options)==null?void 0:o.characterCount)==null?void 0:s.limit},[t]);return n?a.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t",children:a.jsx("div",{className:"richtext-flex richtext-flex-col",children:a.jsx("div",{className:"richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm",children:a.jsxs("span",{children:[e.storage.characterCount.characters(),"/",n," ",r("editor.characters")]})})})}):a.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t",children:a.jsx("div",{className:"richtext-flex richtext-flex-col",children:a.jsx("div",{className:"richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm",children:a.jsxs("span",{children:[e.storage.characterCount.characters()," ",r("editor.characters")]})})})})}function yy(){const{toasts:e}=Ml();return a.jsxs(_x,{children:[e.map(({id:t,title:r,description:n,action:i,...o})=>a.jsxs(Pl,{...o,children:[a.jsxs("div",{className:"richtext-grid richtext-gap-1",children:[r&&a.jsx(Rl,{children:r}),n&&a.jsx(El,{children:n})]}),i,a.jsx(Ol,{})]},t)),a.jsx(Tl,{})]})}const by=`
4
+ `+v.prev}function Qt(x,v){var te=U(x),ie=[];if(te){ie.length=x.length;for(var oe=0;oe<x.length;oe++)ie[oe]=ve(x,oe)?v(x[oe],x):""}var X=typeof E=="function"?E(x):[],Ze;if(k){Ze={};for(var ot=0;ot<X.length;ot++)Ze["$"+X[ot]]=X[ot]}for(var Se in x)ve(x,Se)&&(te&&String(Number(Se))===Se&&Se<x.length||k&&Ze["$"+Se]instanceof Symbol||(M.call(/[^\w$]/,Se)?ie.push(v(Se,x)+": "+v(x[Se],x)):ie.push(Se+": "+v(x[Se],x))));if(typeof E=="function")for(var Je=0;Je<X.length;Je++)re.call(x,X[Je])&&ie.push("["+v(X[Je])+"]: "+v(x[X[Je]],x));return ie}return Qn}var ei,Es;function qv(){if(Es)return ei;Es=1;var e=Pr(),t=Te(),r=function(c,l,u){for(var f=c,d;(d=f.next)!=null;f=d)if(d.key===l)return f.next=d.next,u||(d.next=c.next,c.next=d),d},n=function(c,l){if(c){var u=r(c,l);return u&&u.value}},i=function(c,l,u){var f=r(c,l);f?f.value=u:c.next={key:l,next:c.next,value:u}},o=function(c,l){return c?!!r(c,l):!1},s=function(c,l){if(c)return r(c,l,!0)};return ei=function(){var l,u={assert:function(f){if(!u.has(f))throw new t("Side channel does not contain "+e(f))},delete:function(f){var d=l&&l.next,h=s(l,f);return h&&d&&d===h&&(l=void 0),!!h},get:function(f){return n(l,f)},has:function(f){return o(l,f)},set:function(f,d){l||(l={next:void 0}),i(l,f,d)}};return u},ei}var ti,Ms;function Zl(){if(Ms)return ti;Ms=1;var e=Ve(),t=ye(),r=Pr(),n=Te(),i=e("%Map%",!0),o=t("Map.prototype.get",!0),s=t("Map.prototype.set",!0),c=t("Map.prototype.has",!0),l=t("Map.prototype.delete",!0),u=t("Map.prototype.size",!0);return ti=!!i&&function(){var d,h={assert:function(p){if(!h.has(p))throw new n("Side channel does not contain "+r(p))},delete:function(p){if(d){var m=l(d,p);return u(d)===0&&(d=void 0),m}return!1},get:function(p){if(d)return o(d,p)},has:function(p){return d?c(d,p):!1},set:function(p,m){d||(d=new i),s(d,p,m)}};return h},ti}var ri,Ns;function zv(){if(Ns)return ri;Ns=1;var e=Ve(),t=ye(),r=Pr(),n=Zl(),i=Te(),o=e("%WeakMap%",!0),s=t("WeakMap.prototype.get",!0),c=t("WeakMap.prototype.set",!0),l=t("WeakMap.prototype.has",!0),u=t("WeakMap.prototype.delete",!0);return ri=o?function(){var d,h,p={assert:function(m){if(!p.has(m))throw new i("Side channel does not contain "+r(m))},delete:function(m){if(o&&m&&(typeof m=="object"||typeof m=="function")){if(d)return u(d,m)}else if(n&&h)return h.delete(m);return!1},get:function(m){return o&&m&&(typeof m=="object"||typeof m=="function")&&d?s(d,m):h&&h.get(m)},has:function(m){return o&&m&&(typeof m=="object"||typeof m=="function")&&d?l(d,m):!!h&&h.has(m)},set:function(m,g){o&&m&&(typeof m=="object"||typeof m=="function")?(d||(d=new o),c(d,m,g)):n&&(h||(h=n()),h.set(m,g))}};return p}:n,ri}var ni,_s;function Jl(){if(_s)return ni;_s=1;var e=Te(),t=Pr(),r=qv(),n=Zl(),i=zv(),o=i||n||r;return ni=function(){var c,l={assert:function(u){if(!l.has(u))throw new e("Side channel does not contain "+t(u))},delete:function(u){return!!c&&c.delete(u)},get:function(u){return c&&c.get(u)},has:function(u){return!!c&&c.has(u)},set:function(u,f){c||(c=o()),c.set(u,f)}};return l},ni}var ii,$s;function Fv(){if($s)return ii;$s=1;var e=Eo(),t=Jl()(),r=Te(),n={assert:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");if(t.assert(i),!n.has(i,o))throw new r("`"+o+"` is not present on `O`")},get:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");var s=t.get(i);return s&&s["$"+o]},has:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");var s=t.get(i);return!!s&&e(s,"$"+o)},set:function(i,o,s){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");var c=t.get(i);c||(c={},t.set(i,c)),c["$"+o]=s}};return Object.freeze&&Object.freeze(n),ii=n,ii}var oi,ks;function Hv(){if(ks)return oi;ks=1;var e=Fv(),t=jo(),r=typeof StopIteration=="object"?StopIteration:null;return oi=function(i){if(!r)throw new t("this environment lacks StopIteration");e.set(i,"[[Done]]",!1);var o={next:function(){var c=e.get(this,"[[Iterator]]"),l=!!e.get(c,"[[Done]]");try{return{done:l,value:l?void 0:c.next()}}catch(u){if(e.set(c,"[[Done]]",!0),u!==r)throw u;return{done:!0,value:void 0}}}};return e.set(o,"[[Iterator]]",i),o},oi}var ai,Ls;function Ql(){if(Ls)return ai;Ls=1;var e={}.toString;return ai=Array.isArray||function(t){return e.call(t)=="[object Array]"},ai}var si,Ds;function eu(){if(Ds)return si;Ds=1;var e=ye(),t=e("String.prototype.valueOf"),r=function(c){try{return t(c),!0}catch{return!1}},n=e("Object.prototype.toString"),i="[object String]",o=ht()();return si=function(c){return typeof c=="string"?!0:!c||typeof c!="object"?!1:o?r(c):n(c)===i},si}var ci,Bs;function tu(){if(Bs)return ci;Bs=1;var e=typeof Map=="function"&&Map.prototype?Map:null,t=typeof Set=="function"&&Set.prototype?Set:null,r;e||(r=function(s){return!1});var n=e?Map.prototype.has:null,i=t?Set.prototype.has:null;return!r&&!n&&(r=function(s){return!1}),ci=r||function(s){if(!s||typeof s!="object")return!1;try{if(n.call(s),i)try{i.call(s)}catch{return!0}return s instanceof e}catch{}return!1},ci}var li,qs;function ru(){if(qs)return li;qs=1;var e=typeof Map=="function"&&Map.prototype?Map:null,t=typeof Set=="function"&&Set.prototype?Set:null,r;t||(r=function(s){return!1});var n=e?Map.prototype.has:null,i=t?Set.prototype.has:null;return!r&&!i&&(r=function(s){return!1}),li=r||function(s){if(!s||typeof s!="object")return!1;try{if(i.call(s),n)try{n.call(s)}catch{return!0}return s instanceof t}catch{}return!1},li}var zs;function Uv(){if(zs)return Nt.exports;zs=1;var e=Kl(),t=Hv();if(To()()||Tr()()){var r=Symbol.iterator;Nt.exports=function(C){if(C!=null&&typeof C[r]<"u")return C[r]();if(e(C))return Array.prototype[r].call(C)}}else{var n=Ql(),i=eu(),o=Ve(),s=o("%Map%",!0),c=o("%Set%",!0),l=Vl(),u=l("Array.prototype.push"),f=l("String.prototype.charCodeAt"),d=l("String.prototype.slice"),h=function(C,$){var P=C.length;if($+1>=P)return $+1;var E=f(C,$);if(E<55296||E>56319)return $+1;var L=f(C,$+1);return L<56320||L>57343?$+1:$+2},p=function(C){var $=0;return{next:function(){var E=$>=C.length,L;return E||(L=C[$],$+=1),{done:E,value:L}}}},m=function(C,$){if(n(C)||e(C))return p(C);if(i(C)){var P=0;return{next:function(){var L=h(C,P),k=d(C,P,L);return P=L,{done:L>C.length,value:k}}}}if($&&typeof C["_es6-shim iterator_"]<"u")return C["_es6-shim iterator_"]()};if(!s&&!c)Nt.exports=function(C){if(C!=null)return m(C,!0)};else{var g=tu(),y=ru(),S=l("Map.prototype.forEach",!0),j=l("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var w=l("Map.prototype.iterator",!0),A=l("Set.prototype.iterator",!0);var O=l("Map.prototype.@@iterator",!0)||l("Map.prototype._es6-shim iterator_",!0),M=l("Set.prototype.@@iterator",!0)||l("Set.prototype._es6-shim iterator_",!0),N=function(C){if(g(C)){if(w)return t(w(C));if(O)return O(C);if(S){var $=[];return S(C,function(E,L){u($,[L,E])}),p($)}}if(y(C)){if(A)return t(A(C));if(M)return M(C);if(j){var P=[];return j(C,function(E){u(P,E)}),p(P)}}};Nt.exports=function(C){return N(C)||m(C)}}}return Nt.exports}var ui,Fs;function nu(){if(Fs)return ui;Fs=1;var e=function(t){return t!==t};return ui=function(r,n){return r===0&&n===0?1/r===1/n:!!(r===n||e(r)&&e(n))},ui}var di,Hs;function iu(){if(Hs)return di;Hs=1;var e=nu();return di=function(){return typeof Object.is=="function"?Object.is:e},di}var fi,Us;function Gv(){if(Us)return fi;Us=1;var e=iu(),t=ft();return fi=function(){var n=e();return t(Object,{is:n},{is:function(){return Object.is!==n}}),n},fi}var hi,Gs;function Wv(){if(Gs)return hi;Gs=1;var e=ft(),t=Tt(),r=nu(),n=iu(),i=Gv(),o=t(n(),Object);return e(o,{getPolyfill:n,implementation:r,shim:i}),hi=o,hi}var pi,Ws;function ou(){if(Ws)return pi;Ws=1;var e=Tt(),t=ye(),r=Ve(),n=r("%ArrayBuffer%",!0),i=t("ArrayBuffer.prototype.byteLength",!0),o=t("Object.prototype.toString"),s=!!n&&!i&&new n(0).slice,c=!!s&&e(s);return pi=i||c?function(u){if(!u||typeof u!="object")return!1;try{return i?i(u):c(u,0),!0}catch{return!1}}:n?function(u){return o(u)==="[object ArrayBuffer]"}:function(u){return!1},pi}var mi,Vs;function Vv(){if(Vs)return mi;Vs=1;var e=ye(),t=e("Date.prototype.getDay"),r=function(c){try{return t(c),!0}catch{return!1}},n=e("Object.prototype.toString"),i="[object Date]",o=ht()();return mi=function(c){return typeof c!="object"||c===null?!1:o?r(c):n(c)===i},mi}var gi,Xs;function au(){if(Xs)return gi;Xs=1;var e=ye(),t=ht()(),r=Eo(),n=dt(),i;if(t){var o=e("RegExp.prototype.exec"),s={},c=function(){throw s},l={toString:c,valueOf:c};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=c),i=function(h){if(!h||typeof h!="object")return!1;var p=n(h,"lastIndex"),m=p&&r(p,"value");if(!m)return!1;try{o(h,l)}catch(g){return g===s}}}else{var u=e("Object.prototype.toString"),f="[object RegExp]";i=function(h){return!h||typeof h!="object"&&typeof h!="function"?!1:u(h)===f}}return gi=i,gi}var xi,Ys;function Xv(){if(Ys)return xi;Ys=1;var e=ye(),t=e("SharedArrayBuffer.prototype.byteLength",!0);return xi=t?function(n){if(!n||typeof n!="object")return!1;try{return t(n),!0}catch{return!1}}:function(n){return!1},xi}var vi,Ks;function Yv(){if(Ks)return vi;Ks=1;var e=ye(),t=e("Number.prototype.toString"),r=function(c){try{return t(c),!0}catch{return!1}},n=e("Object.prototype.toString"),i="[object Number]",o=ht()();return vi=function(c){return typeof c=="number"?!0:!c||typeof c!="object"?!1:o?r(c):n(c)===i},vi}var yi,Zs;function Kv(){if(Zs)return yi;Zs=1;var e=ye(),t=e("Boolean.prototype.toString"),r=e("Object.prototype.toString"),n=function(c){try{return t(c),!0}catch{return!1}},i="[object Boolean]",o=ht()();return yi=function(c){return typeof c=="boolean"?!0:c===null||typeof c!="object"?!1:o?n(c):r(c)===i},yi}var cr={exports:{}},bi,Js;function Zv(){if(Js)return bi;Js=1;var e=ye(),t=au(),r=e("RegExp.prototype.exec"),n=Te();return bi=function(o){if(!t(o))throw new n("`regex` must be a RegExp");return function(c){return r(o,c)!==null}},bi}var Qs;function Jv(){if(Qs)return cr.exports;Qs=1;var e=ye(),t=e("Object.prototype.toString"),r=To()(),n=Zv();if(r){var i=e("Symbol.prototype.toString"),o=n(/^Symbol\(.*\)$/),s=function(l){return typeof l.valueOf()!="symbol"?!1:o(i(l))};cr.exports=function(l){if(typeof l=="symbol")return!0;if(!l||typeof l!="object"||t(l)!=="[object Symbol]")return!1;try{return s(l)}catch{return!1}}}else cr.exports=function(l){return!1};return cr.exports}var lr={exports:{}},wi,ec;function Qv(){if(ec)return wi;ec=1;var e=typeof BigInt<"u"&&BigInt;return wi=function(){return typeof e=="function"&&typeof BigInt=="function"&&typeof e(42)=="bigint"&&typeof BigInt(42)=="bigint"},wi}var tc;function ey(){if(tc)return lr.exports;tc=1;var e=Qv()();if(e){var t=BigInt.prototype.valueOf,r=function(i){try{return t.call(i),!0}catch{}return!1};lr.exports=function(i){return i===null||typeof i>"u"||typeof i=="boolean"||typeof i=="string"||typeof i=="number"||typeof i=="symbol"||typeof i=="function"?!1:typeof i=="bigint"?!0:r(i)}}else lr.exports=function(i){return!1};return lr.exports}var Si,rc;function ty(){if(rc)return Si;rc=1;var e=eu(),t=Yv(),r=Kv(),n=Jv(),i=ey();return Si=function(s){if(s==null||typeof s!="object"&&typeof s!="function")return null;if(e(s))return"String";if(t(s))return"Number";if(r(s))return"Boolean";if(n(s))return"Symbol";if(i(s))return"BigInt"},Si}var ji,nc;function ry(){if(nc)return ji;nc=1;var e=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,t=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,r;e||(r=function(s){return!1});var n=e?e.prototype.has:null,i=t?t.prototype.has:null;return!r&&!n&&(r=function(s){return!1}),ji=r||function(s){if(!s||typeof s!="object")return!1;try{if(n.call(s,n),i)try{i.call(s,i)}catch{return!0}return s instanceof e}catch{}return!1},ji}var ur={exports:{}},ic;function ny(){if(ic)return ur.exports;ic=1;var e=Ve(),t=ye(),r=e("%WeakSet%",!0),n=t("WeakSet.prototype.has",!0);if(n){var i=t("WeakMap.prototype.has",!0);ur.exports=function(s){if(!s||typeof s!="object")return!1;try{if(n(s,n),i)try{i(s,i)}catch{return!0}return s instanceof r}catch{}return!1}}else ur.exports=function(s){return!1};return ur.exports}var Ai,oc;function iy(){if(oc)return Ai;oc=1;var e=tu(),t=ru(),r=ry(),n=ny();return Ai=function(o){if(o&&typeof o=="object"){if(e(o))return"Map";if(t(o))return"Set";if(r(o))return"WeakMap";if(n(o))return"WeakSet"}return!1},Ai}var Ci,ac;function oy(){if(ac)return Ci;ac=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(j){j!==n&&(t=null)}else t=null;var i=/^\s*class\b/,o=function(w){try{var A=e.call(w);return i.test(A)}catch{return!1}},s=function(w){try{return o(w)?!1:(e.call(w),!0)}catch{return!1}},c=Object.prototype.toString,l="[object Object]",u="[object Function]",f="[object GeneratorFunction]",d="[object HTMLAllCollection]",h="[object HTML document.all class]",p="[object HTMLCollection]",m=typeof Symbol=="function"&&!!Symbol.toStringTag,g=!(0 in[,]),y=function(){return!1};if(typeof document=="object"){var S=document.all;c.call(S)===c.call(document.all)&&(y=function(w){if((g||!w)&&(typeof w>"u"||typeof w=="object"))try{var A=c.call(w);return(A===d||A===h||A===p||A===l)&&w("")==null}catch{}return!1})}return Ci=t?function(w){if(y(w))return!0;if(!w||typeof w!="function"&&typeof w!="object")return!1;try{t(w,null,r)}catch(A){if(A!==n)return!1}return!o(w)&&s(w)}:function(w){if(y(w))return!0;if(!w||typeof w!="function"&&typeof w!="object")return!1;if(m)return s(w);if(o(w))return!1;var A=c.call(w);return A!==u&&A!==f&&!/^\[object HTML/.test(A)?!1:s(w)},Ci}var Ii,sc;function ay(){if(sc)return Ii;sc=1;var e=oy(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(l,u,f){for(var d=0,h=l.length;d<h;d++)r.call(l,d)&&(f==null?u(l[d],d,l):u.call(f,l[d],d,l))},i=function(l,u,f){for(var d=0,h=l.length;d<h;d++)f==null?u(l.charAt(d),d,l):u.call(f,l.charAt(d),d,l)},o=function(l,u,f){for(var d in l)r.call(l,d)&&(f==null?u(l[d],d,l):u.call(f,l[d],d,l))};function s(c){return t.call(c)==="[object Array]"}return Ii=function(l,u,f){if(!e(u))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=f),s(l)?n(l,u,d):typeof l=="string"?i(l,u,d):o(l,u,d)},Ii}var Ti,cc;function sy(){return cc||(cc=1,Ti=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Ti}var Pi,lc;function cy(){if(lc)return Pi;lc=1;var e=sy(),t=typeof globalThis>"u"?Ut:globalThis;return Pi=function(){for(var n=[],i=0;i<e.length;i++)typeof t[e[i]]=="function"&&(n[n.length]=e[i]);return n},Pi}var Ri,uc;function ly(){if(uc)return Ri;uc=1;var e=ay(),t=cy(),r=Tt(),n=ye(),i=dt(),o=n("Object.prototype.toString"),s=ht()(),c=typeof globalThis>"u"?Ut:globalThis,l=t(),u=n("String.prototype.slice"),f=Object.getPrototypeOf,d=n("Array.prototype.indexOf",!0)||function(y,S){for(var j=0;j<y.length;j+=1)if(y[j]===S)return j;return-1},h={__proto__:null};s&&i&&f?e(l,function(g){var y=new c[g];if(Symbol.toStringTag in y){var S=f(y),j=i(S,Symbol.toStringTag);if(!j){var w=f(S);j=i(w,Symbol.toStringTag)}h["$"+g]=r(j.get)}}):e(l,function(g){var y=new c[g],S=y.slice||y.set;S&&(h["$"+g]=r(S))});var p=function(y){var S=!1;return e(h,function(j,w){if(!S)try{"$"+j(y)===w&&(S=u(w,1))}catch{}}),S},m=function(y){var S=!1;return e(h,function(j,w){if(!S)try{j(y),S=u(w,1)}catch{}}),S};return Ri=function(y){if(!y||typeof y!="object")return!1;if(!s){var S=u(o(y),8,-1);return d(l,S)>-1?S:S!=="Object"?!1:m(y)}return i?p(y):null},Ri}var Oi,dc;function uy(){if(dc)return Oi;dc=1;var e=ye(),t=e("ArrayBuffer.prototype.byteLength",!0),r=ou();return Oi=function(i){return r(i)?t?t(i):i.byteLength:NaN},Oi}var Ei,fc;function dy(){if(fc)return Ei;fc=1;var e=Mv(),t=Vl(),r=kv(),n=Ve(),i=Uv(),o=Jl(),s=Wv(),c=Kl(),l=Ql(),u=ou(),f=Vv(),d=au(),h=Xv(),p=So(),m=ty(),g=iy(),y=ly(),S=uy(),j=t("SharedArrayBuffer.prototype.byteLength",!0),w=t("Date.prototype.getTime"),A=Object.getPrototypeOf,O=t("Object.prototype.toString"),M=n("%Set%",!0),N=t("Map.prototype.has",!0),T=t("Map.prototype.get",!0),C=t("Map.prototype.size",!0),$=t("Set.prototype.add",!0),P=t("Set.prototype.delete",!0),E=t("Set.prototype.has",!0),L=t("Set.prototype.size",!0);function k(I,_,G,U){for(var K=i(I),J;(J=K.next())&&!J.done;)if(Q(_,J.value,G,U))return P(I,J.value),!0;return!1}function Y(I){if(typeof I>"u")return null;if(typeof I!="object")return typeof I=="symbol"?!1:typeof I=="string"||typeof I=="number"?+I==+I:!0}function re(I,_,G,U,K,J){var q=Y(G);if(q!=null)return q;var z=T(_,q),D=e({},K,{strict:!1});return typeof z>"u"&&!N(_,q)||!Q(U,z,D,J)?!1:!N(I,q)&&Q(U,z,D,J)}function ue(I,_,G){var U=Y(G);return U??(E(_,U)&&!E(I,U))}function ne(I,_,G,U,K,J){for(var q=i(I),z,D;(z=q.next())&&!z.done;)if(D=z.value,Q(G,D,K,J)&&Q(U,T(_,D),K,J))return P(I,D),!0;return!1}function Q(I,_,G,U){var K=G||{};if(K.strict?s(I,_):I===_)return!0;var J=m(I),q=m(_);if(J!==q)return!1;if(!I||!_||typeof I!="object"&&typeof _!="object")return K.strict?s(I,_):I==_;var z=U.has(I),D=U.has(_),V;if(z&&D){if(U.get(I)===U.get(_))return!0}else V={};return z||U.set(I,V),D||U.set(_,V),Pe(I,_,K,U)}function xe(I){return!I||typeof I!="object"||typeof I.length!="number"||typeof I.copy!="function"||typeof I.slice!="function"||I.length>0&&typeof I[0]!="number"?!1:!!(I.constructor&&I.constructor.isBuffer&&I.constructor.isBuffer(I))}function fe(I,_,G,U){if(L(I)!==L(_))return!1;for(var K=i(I),J=i(_),q,z,D;(q=K.next())&&!q.done;)if(q.value&&typeof q.value=="object")D||(D=new M),$(D,q.value);else if(!E(_,q.value)){if(G.strict||!ue(I,_,q.value))return!1;D||(D=new M),$(D,q.value)}if(D){for(;(z=J.next())&&!z.done;)if(z.value&&typeof z.value=="object"){if(!k(D,z.value,G.strict,U))return!1}else if(!G.strict&&!E(I,z.value)&&!k(D,z.value,G.strict,U))return!1;return L(D)===0}return!0}function Xe(I,_,G,U){if(C(I)!==C(_))return!1;for(var K=i(I),J=i(_),q,z,D,V,de,he;(q=K.next())&&!q.done;)if(V=q.value[0],de=q.value[1],V&&typeof V=="object")D||(D=new M),$(D,V);else if(he=T(_,V),typeof he>"u"&&!N(_,V)||!Q(de,he,G,U)){if(G.strict||!re(I,_,V,de,G,U))return!1;D||(D=new M),$(D,V)}if(D){for(;(z=J.next())&&!z.done;)if(V=z.value[0],he=z.value[1],V&&typeof V=="object"){if(!ne(D,I,V,he,G,U))return!1}else if(!G.strict&&(!I.has(V)||!Q(T(I,V),he,G,U))&&!ne(D,I,V,he,e({},G,{strict:!1}),U))return!1;return L(D)===0}return!0}function Pe(I,_,G,U){var K,J;if(typeof I!=typeof _||I==null||_==null||O(I)!==O(_)||c(I)!==c(_))return!1;var q=l(I),z=l(_);if(q!==z)return!1;var D=I instanceof Error,V=_ instanceof Error;if(D!==V||(D||V)&&(I.name!==_.name||I.message!==_.message))return!1;var de=d(I),he=d(_);if(de!==he||(de||he)&&(I.source!==_.source||r(I)!==r(_)))return!1;var pe=f(I),ve=f(_);if(pe!==ve||(pe||ve)&&w(I)!==w(_)||G.strict&&A&&A(I)!==A(_))return!1;var be=y(I),Le=y(_);if(be!==Le)return!1;if(be||Le){if(I.length!==_.length)return!1;for(K=0;K<I.length;K++)if(I[K]!==_[K])return!1;return!0}var Re=xe(I),we=xe(_);if(Re!==we)return!1;if(Re||we){if(I.length!==_.length)return!1;for(K=0;K<I.length;K++)if(I[K]!==_[K])return!1;return!0}var De=u(I),Be=u(_);if(De!==Be)return!1;if(De||Be)return S(I)!==S(_)?!1:typeof Uint8Array=="function"&&Q(new Uint8Array(I),new Uint8Array(_),G,U);var qe=h(I),Jt=h(_);if(qe!==Jt)return!1;if(qe||Jt)return j(I)!==j(_)?!1:typeof Uint8Array=="function"&&Q(new Uint8Array(I),new Uint8Array(_),G,U);if(typeof I!=typeof _)return!1;var Ye=p(I),pt=p(_);if(Ye.length!==pt.length)return!1;for(Ye.sort(),pt.sort(),K=Ye.length-1;K>=0;K--)if(Ye[K]!=pt[K])return!1;for(K=Ye.length-1;K>=0;K--)if(J=Ye[K],!Q(I[J],_[J],G,U))return!1;var Pt=g(I),Ke=g(_);return Pt!==Ke?!1:Pt==="Set"||Ke==="Set"?fe(I,_,G,U):Pt==="Map"?Xe(I,_,G,U):!0}return Ei=function(_,G,U){return Q(_,G,U,o())},Ei}var fy=dy();const su=Ll(fy);function hy(e){return e}function cu(e,t,r,n){const i=hy,[o,s]=b.useState(i(r)),c=b.useRef(o);return b.useEffect(()=>{const l=()=>{const u={...r,...e.getAttributes(t)};Object.keys(u).forEach(d=>{(u[d]===null||u[d]===void 0)&&(u[d]=r?r[d]:null)});const f=i(u);su(c.current,f)||(s(f),c.current=f)};return e.on("selectionUpdate",l),e.on("transaction",l),()=>{e.off("selectionUpdate",l),e.off("transaction",l)}},[e,r,t,i]),o}function py({editor:e}){const{t}=B.useLocale(),{width:r,height:n,src:i}=cu(e,at.name,{width:0,height:0,src:"",defaultShowPicker:!1}),[o,s]=b.useState(!1),[c,l]=b.useState(""),u=b.useCallback(()=>{s(!1)},[s]);b.useEffect(()=>{o&&l(i)},[o,i]);const f=b.useCallback(()=>{const y=$l(c);e.chain().updateAttributes(at.name,{src:(y==null?void 0:y.src)||c}).setNodeSelection(e.state.selection.from).focus().run(),s(!1)},[e,c,s]),d=b.useCallback(()=>{window.open(i,"_blank")},[i]),h=b.useCallback(()=>{s(!0)},[s]),p=b.useCallback(y=>{e.chain().updateAttributes(at.name,y).setNodeSelection(e.state.selection.from).focus().run()},[e]),m=b.useCallback(()=>e.isActive(at.name)&&!i,[e,i]),g=b.useCallback(()=>po(at.name,e),[e]);return a.jsxs(a.Fragment,{children:[a.jsx(le.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"iframe-bubble-menu",shouldShow:m,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:a.jsxs("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:[a.jsx(F,{action:d,icon:"Eye",tooltip:"Visit Link"}),a.jsx(F,{action:h,icon:"Pencil",tooltip:"Open Edit Link"}),a.jsx(_l,{height:n,onOk:p,width:r,children:a.jsx(F,{icon:"Settings",tooltip:t("editor.settings")})}),a.jsx(F,{action:g,icon:"Trash2",tooltip:t("editor.delete")})]})}),a.jsxs(Vt,{onOpenChange:s,open:o,children:[a.jsx(Xt,{}),a.jsxs(jt,{children:[a.jsx(ml,{children:a.jsx(At,{children:"Edit Link Iframe"})}),a.jsx(je,{autoFocus:!0,onInput:y=>l(y.target.value),placeholder:"Enter link",type:"url",value:c}),a.jsxs(wr,{children:[a.jsx(ge,{onClick:u,children:"Cancel"}),a.jsx(ge,{onClick:f,children:"OK"})]})]})]})]})}function my({editor:e,disabled:t,bubbleMenu:r}){const n=e.extensionManager.extensions.map(o=>o.name),i=()=>{var o,s,c,l,u,f,d,h,p,m;return[n.includes("columns")&&!((o=r==null?void 0:r.columnConfig)!=null&&o.hidden)?a.jsx(Ox,{editor:e},"columns"):null,n.includes("table")&&!((s=r==null?void 0:r.tableConfig)!=null&&s.hidden)?a.jsx(Dg,{actions:(c=r==null?void 0:r.tableConfig)==null?void 0:c.actions,editor:e},"table"):null,n.includes("link")&&!((l=r==null?void 0:r.linkConfig)!=null&&l.hidden)?a.jsx(qg,{disabled:t,editor:e},"link"):null,n.includes(wt.name)&&!((u=r==null?void 0:r.imageConfig)!=null&&u.hidden)?a.jsx(jx,{disabled:t,editor:e},"image"):null,n.includes(co.name)&&!((f=r==null?void 0:r.imageGifConfig)!=null&&f.hidden)?a.jsx(Ax,{disabled:t,editor:e},"imageGif"):null,n.includes("video")&&!((d=r==null?void 0:r.videoConfig)!=null&&d.hidden)?a.jsx(Cx,{disabled:t,editor:e},"video"):null,n.includes("iframe")&&!((h=r==null?void 0:r.iframeConfig)!=null&&h.hidden)?a.jsx(py,{disabled:t,editor:e},"iframe"):null,(p=r==null?void 0:r.floatingMenuConfig)!=null&&p.hidden?null:a.jsx(pg,{disabled:t,editor:e},"content"),(m=r==null?void 0:r.textConfig)!=null&&m.hidden?null:a.jsx(xg,{disabled:t,editor:e},"text")]};return r!=null&&r.render?r.render({editor:e,disabled:t||!1,extensionsNames:n,bubbleMenu:r},i()):i().filter(Boolean)}function hc(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"currentColor",d:"M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5L5.27 5.27L4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6c1.52 0 2.9-.57 3.96-1.5l2.63 2.63l1.27-1.27z"})})}function lu(e){const{t}=B.useLocale(),{highlight:r=!1,disabled:n=!1,selectedColor:i,setSelectedColor:o,onChange:s,colors:c=B.COLORS_LIST}=e,l=b.useMemo(()=>{const p=c,m=[];for(let g=0;g<p.length;g+=10)m.push(p.slice(g,g+10));return m},[c]),[u,f]=b.useState([]),d=p=>{const m=[...u],g=m.indexOf(p);g!==-1&&m.splice(g,1),m.unshift(p),m.length>10&&m.pop(),f(m)};function h(p){if(p===void 0){o==null||o(p),s==null||s(p);return}/^#([\da-f]{3}){1,2}$/i.test(p)&&(o==null||o(p),s==null||s(p),d(p))}return a.jsxs(Yt,{modal:!0,children:[a.jsx(Kt,{asChild:!0,className:"!richtext-p-0",disabled:n,children:e==null?void 0:e.children}),a.jsx(Ct,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:a.jsxs("div",{className:"richtext-flex richtext-flex-col",children:[r?a.jsxs("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>h(void 0),children:[a.jsx(hc,{}),a.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:t("editor.nofill")})]}):a.jsxs("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>{h(void 0)},children:[a.jsx(hc,{}),a.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:t("editor.default")})]}),l.map((p,m)=>a.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:p.map((g,y)=>a.jsx("span",{className:"richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>h(g),children:a.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:g},children:g===i?a.jsx("svg",{className:"richtext-absolute -richtext-top-px richtext-left-px richtext-block richtext-size-3",viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)"},children:a.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})}):a.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:a.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-${y}`))},m)),a.jsxs("div",{children:[a.jsx("div",{className:"richtext-my-1 richtext-text-sm",children:t("editor.recent")}),a.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:u==null?void 0:u.map((p,m)=>a.jsx("span",{className:"richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>h(p),children:a.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:p},children:a.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:a.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-recent-${m}`))})]}),a.jsx(gy,{setColor:h})]})})]})}function gy({setColor:e}){const[t,r]=b.useState("#000000"),[n,i]=b.useState(!1),{t:o}=B.useLocale();return b.useEffect(()=>()=>{i(!1)},[]),a.jsxs(Yt,{open:n,children:[a.jsx(Kt,{asChild:!0,children:a.jsxs("div",{className:"richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",onClick:s=>{s.preventDefault(),i(!0)},children:[o("editor.color.more"),"..."]})}),a.jsxs(Ct,{children:[a.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-justify-center",children:[a.jsx(Eu.HexColorPicker,{color:t,onChange:r}),a.jsx(je,{className:"richtext-mt-[8px] richtext-w-full",type:"text",value:t.slice(1),onChange:s=>{s.preventDefault(),r(`#${s.target.value}`)}})]}),a.jsx(Ee,{className:"richtext-my-[10px]"}),a.jsx(ge,{className:"richtext-w-full",onClick:s=>{s.preventDefault(),e(t),i(!1)},children:a.jsx(R.Plus,{size:16})})]})]})}function xy({editor:e,disabled:t,toolbar:r}){const{t:n,lang:i}=B.useLocale(),o=b.useMemo(()=>{const u=[...e.extensionManager.extensions].sort((d,h)=>{const p=d.options.sort??-1,m=h.options.sort??-1;return p-m});let f=[];for(const d of u){const{button:h,divider:p=!1,spacer:m=!1,toolbar:g=!0}=d.options;if(!h||!gx(h)||!g)continue;const y=h({editor:e,extension:d,t:n});if(Array.isArray(y)){const S=y.map((j,w)=>({button:j,divider:w===y.length-1?p:!1,spacer:w===0?m:!1,type:d.type,name:d.name}));f=[...f,...S];continue}f.push({button:y,divider:p,spacer:m,type:d.type,name:d.name})}return f},[e,n,i]),s=l=>a.jsx("div",{className:"richtext-px-1 richtext-py-2 !richtext-border-b",style:{pointerEvents:t?"none":"auto",opacity:t?.5:1},children:a.jsx("div",{className:"richtext-relative richtext-flex richtext-flex-wrap richtext-h-auto richtext-gap-y-1 richtext-gap-x-1",children:l})}),c=o.map((l,u)=>{var d,h;const f=l.button.component;return a.jsxs("div",{className:"richtext-flex richtext-items-center",children:[(l==null?void 0:l.spacer)&&a.jsx(Ee,{orientation:"vertical",className:"!richtext-h-[16px] !richtext-mx-[10px]"}),a.jsx(f,{...l.button.componentProps,disabled:t||((h=(d=l==null?void 0:l.button)==null?void 0:d.componentProps)==null?void 0:h.disabled)}),(l==null?void 0:l.divider)&&a.jsx(Ee,{orientation:"vertical",className:"!richtext-h-auto !richtext-mx-2"})]},`toolbar-item-${u}`)});return r&&(r!=null&&r.render)?r.render({editor:e,disabled:t||!1},o,c,s):s(c)}function vy({editor:e,extensions:t}){const{t:r}=B.useLocale(),n=b.useMemo(()=>{var i,o,s;return(s=(o=(i=t==null?void 0:t.find(c=>c.name==="base-kit"))==null?void 0:i.options)==null?void 0:o.characterCount)==null?void 0:s.limit},[t]);return n?a.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t",children:a.jsx("div",{className:"richtext-flex richtext-flex-col",children:a.jsx("div",{className:"richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm",children:a.jsxs("span",{children:[e.storage.characterCount.characters(),"/",n," ",r("editor.characters")]})})})}):a.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t",children:a.jsx("div",{className:"richtext-flex richtext-flex-col",children:a.jsx("div",{className:"richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm",children:a.jsxs("span",{children:[e.storage.characterCount.characters()," ",r("editor.characters")]})})})})}function yy(){const{toasts:e}=Ml();return a.jsxs(_x,{children:[e.map(({id:t,title:r,description:n,action:i,...o})=>a.jsxs(Pl,{...o,children:[a.jsxs("div",{className:"richtext-grid richtext-gap-1",children:[r&&a.jsx(Ol,{children:r}),n&&a.jsx(El,{children:n})]}),i,a.jsx(Rl,{})]},t)),a.jsx(Tl,{})]})}const by=`
5
5
  .reactjs-tiptap-editor,
6
6
  .richtext-dialog-content {
7
7
  button,
@@ -134,4 +134,4 @@ div[data-tippy-root] {
134
134
  color: inherit;
135
135
  }
136
136
  }
137
- `,wy=b.memo(({children:e,id:t})=>{const[,r]=xl(s=>s.value),[,n]=vl(s=>s.value),i=s=>{r({value:s.detail})},o=s=>{n({value:s.detail})};return b.useEffect(()=>{const s=qt(nt.EDIT(t),i),c=qt(nt.UPDATE_THEME(t),o);return()=>{s(),c()}},[]),a.jsx(a.Fragment,{children:e})});function Sy({children:e,id:t}){return a.jsx(Zg,{children:a.jsx(Jg,{children:a.jsx(wy,{id:t,children:e})})})}function jy(){const[e]=vl(t=>t.value);return e}const Ay={setTheme:(e,t)=>{Ar(nt.UPDATE_THEME(e),t)}},pc="data-rc-order",mc="data-rc-priority",Cy="rc-util-key",Xi=new Map;function Iy(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let r=t;for(;r;){if(r===e)return!0;r=r.parentNode}return!1}function uu({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:Cy}function Mo(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function Ty(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function du(e){return[...(Xi.get(e)||e).children].filter(t=>t.tagName==="STYLE")}function fu(e,t={}){const{csp:r,prepend:n,priority:i=0}=t,o=Ty(n),s=o==="prependQueue",c=document.createElement("style");c.setAttribute(pc,o),s&&i&&c.setAttribute(mc,`${i}`),r!=null&&r.nonce&&(c.nonce=r==null?void 0:r.nonce),c.innerHTML=e;const l=Mo(t),{firstChild:u}=l;if(n){if(s){const f=du(l).filter(d=>{if(!["prepend","prependQueue"].includes(d.getAttribute(pc)))return!1;const h=Number(d.getAttribute(mc)||0);return i>=h});if(f.length>0)return l.insertBefore(c,f.at(-1).nextSibling),c}u.before(c)}else l.append(c);return c}function hu(e,t={}){const r=Mo(t);return du(r).find(n=>n.getAttribute(uu(t))===e)}function Py(e,t={}){const r=hu(e,t);r&&r.remove()}function Oy(e,t){const r=Xi.get(e);if(!r||!Iy(document,r)){const n=fu("",t),{parentNode:i}=n;Xi.set(e,i),n.remove()}}function Ry(e,t,r={}){var s,c,l;const n=Mo(r);Oy(n,r);const i=hu(t,r);if(i)return(s=r.csp)!=null&&s.nonce&&i.nonce!==((c=r.csp)==null?void 0:c.nonce)&&(i.nonce=(l=r.csp)==null?void 0:l.nonce),i.innerHTML!==e&&(i.innerHTML=e),i;const o=fu(e,r);return o.setAttribute(uu(r),t),o}function Ey(e,t){const{content:r,extensions:n,useEditorOptions:i={}}=e,o=b.useId(),s=b.useMemo(()=>{const d=Wp(n,n,"name");return[...n.map(p=>{const m=n.find(g=>g.name===p.name);return m?p.configure(m.options):p}),...d].map((p,m)=>p.configure({sort:m}))},[n]),c=bt(d=>{var p;const h=u(d,e.output);(p=e==null?void 0:e.onChangeContent)==null||p.call(e,h)},B.EDITOR_UPDATE_WATCH_THROTTLE_WAIT_TIME),l=le.useEditor({extensions:s,content:r,onUpdate:({editor:d})=>{c&&c(d)},...i});b.useImperativeHandle(t,()=>({editor:l})),b.useEffect(()=>{document.documentElement.classList.toggle("dark",e.dark),Ay.setTheme(o,e.dark?"dark":"light")},[e.dark]),b.useEffect(()=>{l==null||l.setEditable(!(e!=null&&e.disabled)),cv.setDisable(o,!(e!=null&&e.disabled))},[l,e==null?void 0:e.disabled]),b.useEffect(()=>((e==null?void 0:e.resetCSS)!==!1&&Ry(by,"react-tiptap-reset"),()=>{Py("react-tiptap-reset")}),[e==null?void 0:e.resetCSS]);function u(d,h){return e!=null&&e.removeDefaultWrapper?h==="html"?d.isEmpty?"":d.getHTML():h==="json"?d.isEmpty?{}:d.getJSON():h==="text"?d.isEmpty?"":d.getText():"":h==="html"?d.getHTML():h==="json"?d.getJSON():h==="text"?d.getText():""}b.useLayoutEffect(()=>{l&&(l.id=o)},[o,l]),b.useEffect(()=>()=>{var d;(d=l==null?void 0:l.destroy)==null||d.call(l)},[]);const f=bl(l,"characterCount");return l?a.jsxs("div",{className:"reactjs-tiptap-editor",children:[a.jsx(Sy,{id:o,children:a.jsx(Dx,{delayDuration:0,disableHoverableContent:!0,children:a.jsx("div",{className:"richtext-overflow-hidden richtext-rounded-[0.5rem] richtext-bg-background richtext-shadow richtext-outline richtext-outline-1",children:a.jsxs("div",{className:"richtext-flex richtext-max-h-full richtext-w-full richtext-flex-col",children:[!(e!=null&&e.hideToolbar)&&a.jsx(xy,{disabled:!!(e!=null&&e.disabled),editor:l,toolbar:e.toolbar}),a.jsx(le.EditorContent,{className:`richtext-relative ${(e==null?void 0:e.contentClass)||""}`,editor:l}),f&&a.jsx(vy,{editor:l,extensions:n}),!(e!=null&&e.hideBubble)&&a.jsx(my,{bubbleMenu:e==null?void 0:e.bubbleMenu,disabled:e==null?void 0:e.disabled,editor:l})]})})})}),a.jsx(yy,{})]}):a.jsx(a.Fragment,{})}const My=b.forwardRef(Ey);exports.ActionButton=F;exports.Button=ge;exports.ColorPicker=lu;exports.Column=ho;exports.ColumnActionButton=Ox;exports.Dialog=Vt;exports.DialogContent=jt;exports.DialogFooter=wr;exports.DialogTitle=At;exports.DialogTrigger=Xt;exports.DropdownMenu=Sl;exports.DropdownMenuCheckboxItem=Al;exports.DropdownMenuContent=mo;exports.DropdownMenuSeparator=go;exports.DropdownMenuShortcut=Cl;exports.DropdownMenuTrigger=jl;exports.EVENTS=nt;exports.EXTENSION_PRIORITY_HIGHEST=wl;exports.ExportPdf=ul;exports.ExportWord=dl;exports.HighlightActionButton=fl;exports.IconComponent=me;exports.Iframe=at;exports.Image=so;exports.Image$1=wt;exports.ImageGif=co;exports.IndentProps=gr;exports.Input=je;exports.Label=He;exports.LinkEditBlock=hl;exports.MenuDown=ll;exports.MultiColumn=zt;exports.Popover=Yt;exports.PopoverContent=Ct;exports.PopoverTrigger=Kt;exports.RichTextEditor=My;exports.Separator=Ee;exports.SizeSetter=_l;exports.Switch=xo;exports.Toggle=yo;exports.Tooltip=bo;exports.TooltipContent=Cr;exports.TooltipTrigger=wo;exports.Video=lo;exports.actionDialogImage=yl;exports.clamp=hx;exports.cn=Z;exports.commonjsGlobal=Ut;exports.createIndentCommand=hg;exports.dataURLtoFile=gl;exports.debounce=Wt;exports.deepEqual=su;exports.deleteNode=po;exports.dispatchEvent=Ar;exports.ensureNameValueOptions=vx;exports.extractFileExtension=Wg;exports.extractFilename=Gg;exports.getAugmentedNamespace=Dl;exports.getBubbleDrawer=ig;exports.getBubbleMermaid=ng;exports.getDefaultExportFromCjs=Ll;exports.getShortcutKey=ol;exports.getShortcutKeys=al;exports.hasExtension=bl;exports.icons=ao;exports.listenEvent=qt;exports.normalizeFileSize=Vg;exports.normalizeFileType=Xg;exports.throttle=bt;exports.useAttributes=cu;exports.useEditableEditor=kl;exports.useTheme=jy;exports.useToast=Ml;
137
+ `,wy=b.memo(({children:e,id:t})=>{const[,r]=xl(s=>s.value),[,n]=vl(s=>s.value),i=s=>{r({value:s.detail})},o=s=>{n({value:s.detail})};return b.useEffect(()=>{const s=qt(nt.EDIT(t),i),c=qt(nt.UPDATE_THEME(t),o);return()=>{s(),c()}},[]),a.jsx(a.Fragment,{children:e})});function Sy({children:e,id:t}){return a.jsx(Zg,{children:a.jsx(Jg,{children:a.jsx(wy,{id:t,children:e})})})}function jy(){const[e]=vl(t=>t.value);return e}const Ay={setTheme:(e,t)=>{Ar(nt.UPDATE_THEME(e),t)}},pc="data-rc-order",mc="data-rc-priority",Cy="rc-util-key",Xi=new Map;function Iy(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let r=t;for(;r;){if(r===e)return!0;r=r.parentNode}return!1}function uu({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:Cy}function Mo(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function Ty(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function du(e){return[...(Xi.get(e)||e).children].filter(t=>t.tagName==="STYLE")}function fu(e,t={}){const{csp:r,prepend:n,priority:i=0}=t,o=Ty(n),s=o==="prependQueue",c=document.createElement("style");c.setAttribute(pc,o),s&&i&&c.setAttribute(mc,`${i}`),r!=null&&r.nonce&&(c.nonce=r==null?void 0:r.nonce),c.innerHTML=e;const l=Mo(t),{firstChild:u}=l;if(n){if(s){const f=du(l).filter(d=>{if(!["prepend","prependQueue"].includes(d.getAttribute(pc)))return!1;const h=Number(d.getAttribute(mc)||0);return i>=h});if(f.length>0)return l.insertBefore(c,f.at(-1).nextSibling),c}u.before(c)}else l.append(c);return c}function hu(e,t={}){const r=Mo(t);return du(r).find(n=>n.getAttribute(uu(t))===e)}function Py(e,t={}){const r=hu(e,t);r&&r.remove()}function Ry(e,t){const r=Xi.get(e);if(!r||!Iy(document,r)){const n=fu("",t),{parentNode:i}=n;Xi.set(e,i),n.remove()}}function Oy(e,t,r={}){var s,c,l;const n=Mo(r);Ry(n,r);const i=hu(t,r);if(i)return(s=r.csp)!=null&&s.nonce&&i.nonce!==((c=r.csp)==null?void 0:c.nonce)&&(i.nonce=(l=r.csp)==null?void 0:l.nonce),i.innerHTML!==e&&(i.innerHTML=e),i;const o=fu(e,r);return o.setAttribute(uu(r),t),o}function Ey(e,t){const{content:r,extensions:n,useEditorOptions:i={}}=e,o=b.useId(),s=b.useMemo(()=>{const d=Wp(n,n,"name");return[...n.map(p=>{const m=n.find(g=>g.name===p.name);return m?p.configure(m.options):p}),...d].map((p,m)=>p.configure({sort:m}))},[n]),c=bt(d=>{var p;const h=u(d,e.output);(p=e==null?void 0:e.onChangeContent)==null||p.call(e,h)},B.EDITOR_UPDATE_WATCH_THROTTLE_WAIT_TIME),l=le.useEditor({extensions:s,content:r,onUpdate:({editor:d})=>{c&&c(d)},...i});b.useImperativeHandle(t,()=>({editor:l})),b.useEffect(()=>{document.documentElement.classList.toggle("dark",e.dark),Ay.setTheme(o,e.dark?"dark":"light")},[e.dark]),b.useEffect(()=>{l==null||l.setEditable(!(e!=null&&e.disabled)),cv.setDisable(o,!(e!=null&&e.disabled))},[l,e==null?void 0:e.disabled]),b.useEffect(()=>((e==null?void 0:e.resetCSS)!==!1&&Oy(by,"react-tiptap-reset"),()=>{Py("react-tiptap-reset")}),[e==null?void 0:e.resetCSS]);function u(d,h){return e!=null&&e.removeDefaultWrapper?h==="html"?d.isEmpty?"":d.getHTML():h==="json"?d.isEmpty?{}:d.getJSON():h==="text"?d.isEmpty?"":d.getText():"":h==="html"?d.getHTML():h==="json"?d.getJSON():h==="text"?d.getText():""}b.useLayoutEffect(()=>{l&&(l.id=o)},[o,l]),b.useEffect(()=>()=>{var d;(d=l==null?void 0:l.destroy)==null||d.call(l)},[]);const f=bl(l,"characterCount");return l?a.jsxs("div",{className:"reactjs-tiptap-editor",children:[a.jsx(Sy,{id:o,children:a.jsx(Dx,{delayDuration:0,disableHoverableContent:!0,children:a.jsx("div",{className:"richtext-overflow-hidden richtext-rounded-[0.5rem] richtext-bg-background richtext-shadow richtext-outline richtext-outline-1",children:a.jsxs("div",{className:"richtext-flex richtext-max-h-full richtext-w-full richtext-flex-col",children:[!(e!=null&&e.hideToolbar)&&a.jsx(xy,{disabled:!!(e!=null&&e.disabled),editor:l,toolbar:e.toolbar}),a.jsx(le.EditorContent,{className:`richtext-relative ${(e==null?void 0:e.contentClass)||""}`,editor:l}),f&&a.jsx(vy,{editor:l,extensions:n}),!(e!=null&&e.hideBubble)&&a.jsx(my,{bubbleMenu:e==null?void 0:e.bubbleMenu,disabled:e==null?void 0:e.disabled,editor:l})]})})})}),a.jsx(yy,{})]}):a.jsx(a.Fragment,{})}const My=b.forwardRef(Ey);exports.ActionButton=F;exports.Button=ge;exports.ColorPicker=lu;exports.Column=ho;exports.ColumnActionButton=Rx;exports.Dialog=Vt;exports.DialogContent=jt;exports.DialogFooter=wr;exports.DialogTitle=At;exports.DialogTrigger=Xt;exports.DropdownMenu=Sl;exports.DropdownMenuCheckboxItem=Al;exports.DropdownMenuContent=mo;exports.DropdownMenuSeparator=go;exports.DropdownMenuShortcut=Cl;exports.DropdownMenuTrigger=jl;exports.EVENTS=nt;exports.EXTENSION_PRIORITY_HIGHEST=wl;exports.ExportPdf=ul;exports.ExportWord=dl;exports.HighlightActionButton=fl;exports.IconComponent=me;exports.Iframe=at;exports.Image=so;exports.Image$1=wt;exports.ImageGif=co;exports.IndentProps=gr;exports.Input=je;exports.Label=He;exports.LinkEditBlock=hl;exports.MenuDown=ll;exports.MultiColumn=zt;exports.Popover=Yt;exports.PopoverContent=Ct;exports.PopoverTrigger=Kt;exports.RichTextEditor=My;exports.Separator=Ee;exports.SizeSetter=_l;exports.Switch=xo;exports.Toggle=yo;exports.Tooltip=bo;exports.TooltipContent=Cr;exports.TooltipTrigger=wo;exports.Video=lo;exports.actionDialogImage=yl;exports.clamp=hx;exports.cn=Z;exports.commonjsGlobal=Ut;exports.createIndentCommand=hg;exports.dataURLtoFile=gl;exports.debounce=Wt;exports.deepEqual=su;exports.deleteNode=po;exports.dispatchEvent=Ar;exports.ensureNameValueOptions=vx;exports.extractFileExtension=Wg;exports.extractFilename=Gg;exports.getAugmentedNamespace=Dl;exports.getBubbleDrawer=ig;exports.getBubbleMermaid=ng;exports.getDefaultExportFromCjs=Ll;exports.getShortcutKey=ol;exports.getShortcutKeys=al;exports.hasExtension=bl;exports.icons=ao;exports.listenEvent=qt;exports.normalizeFileSize=Vg;exports.normalizeFileType=Xg;exports.throttle=bt;exports.useAttributes=cu;exports.useEditableEditor=kl;exports.useTheme=jy;exports.useToast=Ml;