reactjs-tiptap-editor 1.0.11 → 1.0.13

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 (226) hide show
  1. package/lib/ActionMenuButton-DNj0f_A4.cjs +1 -0
  2. package/lib/{ActionMenuButton-DTXFBdGX.js → ActionMenuButton-l5rSmAO_.js} +18 -14
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +24 -21
  5. package/lib/Blockquote.cjs +2 -2
  6. package/lib/Blockquote.js +7 -5
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +11 -9
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +14 -12
  11. package/lib/Callout.cjs +1 -0
  12. package/lib/Callout.js +230 -0
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +3 -3
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +11 -9
  17. package/lib/CodeBlock.cjs +39 -39
  18. package/lib/CodeBlock.js +840 -945
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +10 -8
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +20 -18
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +7 -5
  25. package/lib/{Drawer-D0yQ0wR7.js → Drawer-Cbi_MURj.js} +10 -9
  26. package/lib/Drawer-DKU32YW_.cjs +1 -0
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +3 -3
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +11 -9
  31. package/lib/{Excalidraw-CO4IRHmG.js → Excalidraw-CWrVL5hs.js} +28 -27
  32. package/lib/Excalidraw-Kb-TRcWY.cjs +1 -0
  33. package/lib/Excalidraw.cjs +1 -1
  34. package/lib/Excalidraw.js +2 -2
  35. package/lib/ExportPdf.cjs +2 -2
  36. package/lib/ExportPdf.js +7 -5
  37. package/lib/ExportWord.cjs +1 -1
  38. package/lib/ExportWord.js +7 -5
  39. package/lib/FontFamily.cjs +1 -1
  40. package/lib/FontFamily.js +9 -8
  41. package/lib/FontSize.cjs +1 -1
  42. package/lib/FontSize.js +13 -12
  43. package/lib/Heading.cjs +1 -1
  44. package/lib/Heading.js +20 -19
  45. package/lib/Highlight.cjs +1 -1
  46. package/lib/Highlight.js +9 -7
  47. package/lib/History.cjs +1 -1
  48. package/lib/History.js +11 -8
  49. package/lib/HorizontalRule.cjs +1 -1
  50. package/lib/HorizontalRule.js +7 -5
  51. package/lib/Icon-Ctva8VeB.js +12 -0
  52. package/lib/Icon-yqCglrdK.cjs +1 -0
  53. package/lib/Iframe-BczF8Hex.cjs +1 -0
  54. package/lib/{Iframe-BEO28NPs.js → Iframe-C942bNjs.js} +42 -40
  55. package/lib/Iframe.cjs +1 -1
  56. package/lib/Iframe.js +2 -2
  57. package/lib/Image.cjs +1 -1
  58. package/lib/Image.js +25 -23
  59. package/lib/ImageGif.cjs +1 -1
  60. package/lib/ImageGif.js +50 -48
  61. package/lib/ImportWord.cjs +31 -31
  62. package/lib/ImportWord.js +8 -6
  63. package/lib/{Indent-CXurBbOr.js → Indent-C_O5WdyR.js} +26 -24
  64. package/lib/Indent-CkEC7x36.cjs +1 -0
  65. package/lib/Indent.cjs +1 -1
  66. package/lib/Indent.js +2 -2
  67. package/lib/Italic.cjs +1 -1
  68. package/lib/Italic.js +12 -10
  69. package/lib/{Katex-Bvj469K1.js → Katex-D3PEWimM.js} +12 -10
  70. package/lib/Katex-DW_HjgNM.cjs +4 -0
  71. package/lib/Katex.cjs +1 -1
  72. package/lib/Katex.js +2 -2
  73. package/lib/LineHeight.cjs +1 -1
  74. package/lib/LineHeight.js +10 -8
  75. package/lib/Link.cjs +1 -1
  76. package/lib/Link.js +2 -2
  77. package/lib/{LinkEditBlock-8ePAZ-G1.cjs → LinkEditBlock-DL1e2ILk.cjs} +1 -1
  78. package/lib/{LinkEditBlock-DjXUEubR.js → LinkEditBlock-h5054QDo.js} +22 -20
  79. package/lib/Mention.cjs +1 -1
  80. package/lib/Mention.js +3 -3
  81. package/lib/Mermaid.cjs +2 -2
  82. package/lib/Mermaid.js +8 -8
  83. package/lib/MoreMark.cjs +1 -1
  84. package/lib/MoreMark.js +25 -22
  85. package/lib/OrderedList.cjs +1 -1
  86. package/lib/OrderedList.js +10 -8
  87. package/lib/SearchAndReplace.cjs +1 -1
  88. package/lib/SearchAndReplace.js +43 -41
  89. package/lib/SlashCommand.cjs +1 -1
  90. package/lib/SlashCommand.js +6 -6
  91. package/lib/SlashCommandNodeView-BqrmHCpu.cjs +1 -0
  92. package/lib/{SlashCommandNodeView-CcqL8ymb.js → SlashCommandNodeView-DXUqkx82.js} +75 -66
  93. package/lib/Strike.cjs +1 -1
  94. package/lib/Strike.js +7 -5
  95. package/lib/{Table-9Y0Cg8Ab.js → Table-DdrY4jcM.js} +10 -8
  96. package/lib/Table-kY0nbqJo.cjs +9 -0
  97. package/lib/Table.cjs +1 -1
  98. package/lib/Table.js +1 -1
  99. package/lib/TaskList.cjs +1 -1
  100. package/lib/TaskList.js +15 -13
  101. package/lib/TextAlign.cjs +1 -1
  102. package/lib/TextAlign.js +20 -17
  103. package/lib/TextDirection.cjs +1 -1
  104. package/lib/TextDirection.js +20 -17
  105. package/lib/TextUnderline.cjs +1 -1
  106. package/lib/TextUnderline.js +7 -5
  107. package/lib/{Twitter-DWwd0vHR.js → Twitter-B-JQ3ZJ1.js} +51 -49
  108. package/lib/Twitter-DjZcVa3l.cjs +1 -0
  109. package/lib/Twitter.cjs +1 -1
  110. package/lib/Twitter.js +2 -2
  111. package/lib/Video.cjs +1 -1
  112. package/lib/Video.js +13 -11
  113. package/lib/bubble.cjs +4 -4
  114. package/lib/bubble.js +2084 -1949
  115. package/lib/button-BS3n6_Aq.cjs +1 -0
  116. package/lib/{button-RnHbJfd-.js → button-Uv01FNnd.js} +9 -8
  117. package/lib/{checkbox-CTEN0q4y.cjs → checkbox-C8ByRi7-.cjs} +1 -1
  118. package/lib/{checkbox-CLSoR1Qj.js → checkbox-DEFNwGwb.js} +1 -1
  119. package/lib/{index-sVScpCFG.js → clsx-BWSGDJNJ.js} +224 -224
  120. package/lib/{index-BBNITgNi.cjs → clsx-CXbNJWDD.cjs} +13 -13
  121. package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -0
  122. package/lib/components/Bubble/index.d.ts +1 -0
  123. package/lib/components/ui/index.d.ts +1 -0
  124. package/lib/{dialog-CMC9hsCo.cjs → dialog-Bt5zwGYB.cjs} +1 -1
  125. package/lib/{dialog-D_HCtKvc.js → dialog-DwTMZSt6.js} +1 -1
  126. package/lib/{dropdown-menu-66q7Ofc5.js → dropdown-menu-BetI14G6.js} +1 -1
  127. package/lib/{dropdown-menu-DKSAS-w_.cjs → dropdown-menu-Bo68IEOT.cjs} +1 -1
  128. package/lib/events.constant-Dq21NPdV.cjs +1 -0
  129. package/lib/events.constant-do95b767.js +21 -0
  130. package/lib/extensions/Callout/Callout.d.ts +18 -0
  131. package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -0
  132. package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -0
  133. package/lib/extensions/Callout/index.d.ts +1 -0
  134. package/lib/{index-CApXPpjF.cjs → index-BCzvbrf5.cjs} +1 -1
  135. package/lib/{index-9A6-kVBM.js → index-BDKHXe7R.js} +1 -1
  136. package/lib/{index-DmPwbBqm.js → index-CHKWG6E8.js} +1 -1
  137. package/lib/index-CcoWj0mF.js +426 -0
  138. package/lib/index-CjhjjJsN.cjs +1 -0
  139. package/lib/index-Cs6cp0Y6.cjs +1 -0
  140. package/lib/index-D3RLYf-J.cjs +1 -0
  141. package/lib/{index-C3zg3DPB.js → index-DF5ZPtWM.js} +371 -1177
  142. package/lib/{index-DRHrDScg.js → index-DJbmnBzK.js} +1 -1
  143. package/lib/index-Doks9cbR.cjs +1 -0
  144. package/lib/{index-0OnGZkVF.js → index-Dujzr6bY.js} +179 -317
  145. package/lib/index-VhKd73hZ.cjs +1 -0
  146. package/lib/{index-DKt5wfAc.js → index-mR8PNv5P.js} +1 -1
  147. package/lib/{index--nUS7Y66.cjs → index-neeeY2o7.cjs} +3 -3
  148. package/lib/index.cjs +9 -2
  149. package/lib/index.js +142 -26
  150. package/lib/{input-CvyMYMZG.js → input-DUBdJD3L.js} +5 -5
  151. package/lib/{input-D555880-.cjs → input-Dt_BA_9B.cjs} +1 -1
  152. package/lib/{isNumber-Bv1Qhmw8.cjs → isNumber-BTYSVlKo.cjs} +1 -1
  153. package/lib/{isNumber-DF0fU3ob.js → isNumber-CIgubz2e.js} +1 -1
  154. package/lib/label-JNOksCA-.cjs +1 -0
  155. package/lib/label-topD46-u.js +19 -0
  156. package/lib/locale-bundle.cjs +1 -1
  157. package/lib/locale-bundle.js +6 -7
  158. package/lib/locales/en.d.ts +16 -0
  159. package/lib/locales/fi.d.ts +16 -0
  160. package/lib/locales/hu.d.ts +16 -0
  161. package/lib/locales/index.d.ts +99 -4316
  162. package/lib/locales/pt-br.d.ts +16 -0
  163. package/lib/locales/vi.d.ts +16 -0
  164. package/lib/locales/zh-cn.d.ts +16 -0
  165. package/lib/{popover-B7ec5-u2.js → popover-LfNBhRyz.js} +1 -1
  166. package/lib/{popover-BSzR_R01.cjs → popover-mL-2sX5r.cjs} +1 -1
  167. package/lib/react-BEoMZB61.cjs +1 -0
  168. package/lib/react-c9FSfB30.js +27 -0
  169. package/lib/select-CwGYPsPq.cjs +1 -0
  170. package/lib/select-DctYuHLH.js +117 -0
  171. package/lib/separator-Ddfrhn4D.js +329 -0
  172. package/lib/separator-NoH_SLRW.cjs +1 -0
  173. package/lib/store/EditorEditableReactive.d.ts +1 -0
  174. package/lib/store/ThemeColorReactive.d.ts +1 -0
  175. package/lib/store/commandList.d.ts +1 -1
  176. package/lib/store/store.d.ts +6 -7
  177. package/lib/store-CkjKIgjQ.cjs +1 -0
  178. package/lib/store-DNpS8vXA.js +10 -0
  179. package/lib/style.css +1 -1
  180. package/lib/{tabs-CWr9HYaM.js → tabs-BT3AeqQQ.js} +1 -1
  181. package/lib/{tabs-BTwiZkWd.cjs → tabs-DRSwUeKP.cjs} +1 -1
  182. package/lib/{textarea-Yetl_PZi.cjs → textarea-BDO6XQoF.cjs} +1 -1
  183. package/lib/{textarea-BdeLXbp8.js → textarea-DZzMEDfZ.js} +1 -1
  184. package/lib/theme/theme.d.ts +5 -0
  185. package/lib/theme.cjs +1 -1
  186. package/lib/theme.js +37 -8
  187. package/lib/{throttle-DsowOft0.js → throttle-IERhwcLa.js} +1 -1
  188. package/lib/throttle-gTTvqDTW.cjs +1 -0
  189. package/lib/toggle-BQHMh_Q-.cjs +1 -0
  190. package/lib/toggle-DKHg5sLm.js +99 -0
  191. package/lib/tooltip-BYtGp6FM.cjs +1 -0
  192. package/lib/tooltip-DNKq7zgN.js +24 -0
  193. package/lib/{updatePosition-Bbd8ETMv.js → updatePosition-Bie75EFq.js} +2 -2
  194. package/lib/updatePosition-Cjuj2E26.cjs +1 -0
  195. package/lib/useButtonProps-DBJkNDS2.cjs +1 -0
  196. package/lib/{useButtonProps-cMoicZgd.js → useButtonProps-DVP4s_ER.js} +48 -36
  197. package/lib/utils/customEvents/events.constant.d.ts +0 -5
  198. package/package.json +3 -3
  199. package/lib/ActionMenuButton-BLlse5KO.cjs +0 -1
  200. package/lib/Drawer-kv6BU_6O.cjs +0 -1
  201. package/lib/Excalidraw-B82ThkJA.cjs +0 -1
  202. package/lib/Icon-DRuJhcHK.js +0 -10
  203. package/lib/Icon-DXePECFW.cjs +0 -1
  204. package/lib/Iframe-03dn9wcM.cjs +0 -1
  205. package/lib/Indent-Cqjdn3Jt.cjs +0 -1
  206. package/lib/Katex-DdWTV5NJ.cjs +0 -4
  207. package/lib/SlashCommandNodeView-Bl_gwZJB.cjs +0 -1
  208. package/lib/Table-DBGjezZK.cjs +0 -9
  209. package/lib/Twitter-Cnvt7GBg.cjs +0 -1
  210. package/lib/button-BW5bDPz_.cjs +0 -1
  211. package/lib/events.constant-DQYeJpu5.cjs +0 -1
  212. package/lib/events.constant-wrlJ_7JZ.js +0 -26
  213. package/lib/index-BZ6DfR2r.cjs +0 -1
  214. package/lib/index-C838s-or.cjs +0 -8
  215. package/lib/index-Cv9Z6dyV.cjs +0 -1
  216. package/lib/index-FSRjMsxW.cjs +0 -1
  217. package/lib/label-DsOYPjAo.js +0 -18
  218. package/lib/label-E6jF3Xud.cjs +0 -1
  219. package/lib/separator-JaTTqb3J.js +0 -241
  220. package/lib/separator-PGnA-6Hr.cjs +0 -1
  221. package/lib/store/ProviderUniqueId.d.ts +0 -6
  222. package/lib/store-Cf7tFiiI.js +0 -10
  223. package/lib/store-oDk-lTPM.cjs +0 -1
  224. package/lib/throttle-BM3Bmbf_.cjs +0 -1
  225. package/lib/updatePosition-M2IyqkI1.cjs +0 -1
  226. package/lib/useButtonProps-DfnJiJLV.cjs +0 -1
@@ -1,4 +0,0 @@
1
- "use strict";const Fr=require("./index-BBNITgNi.cjs"),Y=require("react/jsx-runtime"),ur=require("react"),Za=require("katex"),Ro=require("./index-C838s-or.cjs"),Cr=require("./dialog-CMC9hsCo.cjs"),ln=require("./textarea-Yetl_PZi.cjs"),ae=require("./useButtonProps-DfnJiJLV.cjs"),Br=require("./_commonjsHelpers-BTDuMlIz.cjs"),$o=require("./index-FSRjMsxW.cjs"),cn=require("./label-E6jF3Xud.cjs"),xo=require("./button-BW5bDPz_.cjs");var oe,pn;function ro(){if(pn)return oe;pn=1;var r=Object.prototype.toString;return oe=function(n){var o=r.call(n),t=o==="[object Arguments]";return t||(t=o!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&r.call(n.callee)==="[object Function]"),t},oe}var ie,yn;function Eo(){if(yn)return ie;yn=1;var r;if(!Object.keys){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=ro(),t=Object.prototype.propertyIsEnumerable,f=!t.call({toString:null},"toString"),i=t.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(y){var h=y.constructor;return h&&h.prototype===y},c={$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},v=(function(){if(typeof window>"u")return!1;for(var y in window)try{if(!c["$"+y]&&e.call(window,y)&&window[y]!==null&&typeof window[y]=="object")try{u(window[y])}catch{return!0}}catch{return!0}return!1})(),p=function(y){if(typeof window>"u"||!v)return u(y);try{return u(y)}catch{return!1}};r=function(h){var S=h!==null&&typeof h=="object",R=n.call(h)==="[object Function]",q=o(h),w=S&&n.call(h)==="[object String]",O=[];if(!S&&!R&&!q)throw new TypeError("Object.keys called on a non-object");var m=i&&R;if(w&&h.length>0&&!e.call(h,0))for(var j=0;j<h.length;++j)O.push(String(j));if(q&&h.length>0)for(var Q=0;Q<h.length;++Q)O.push(String(Q));else for(var H in h)!(m&&H==="prototype")&&e.call(h,H)&&O.push(String(H));if(f)for(var F=p(h),D=0;D<a.length;++D)!(F&&a[D]==="constructor")&&e.call(h,a[D])&&O.push(a[D]);return O}}return ie=r,ie}var ue,vn;function Lt(){if(vn)return ue;vn=1;var r=Array.prototype.slice,e=ro(),n=Object.keys,o=n?function(i){return n(i)}:Eo(),t=Object.keys;return o.shim=function(){if(Object.keys){var i=(function(){var a=Object.keys(arguments);return a&&a.length===arguments.length})(1,2);i||(Object.keys=function(u){return e(u)?t(r.call(u)):t(u)})}else Object.keys=o;return Object.keys||o},ue=o,ue}var fe,gn;function zr(){if(gn)return fe;gn=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return fe=r,fe}var se,hn;function Ut(){return hn||(hn=1,se=SyntaxError),se}var le,dn;function nr(){return dn||(dn=1,le=TypeError),le}var ce,mn;function Bo(){return mn||(mn=1,ce=Object.getOwnPropertyDescriptor),ce}var pe,Sn;function qr(){if(Sn)return pe;Sn=1;var r=Bo();if(r)try{r([],"length")}catch{r=null}return pe=r,pe}var ye,bn;function Ht(){if(bn)return ye;bn=1;var r=zr(),e=Ut(),n=nr(),o=qr();return ye=function(f,i,a){if(!f||typeof f!="object"&&typeof f!="function")throw new n("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,v=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,y=!!o&&o(f,i);if(r)r(f,i,{configurable:v===null&&y?y.configurable:!v,enumerable:u===null&&y?y.enumerable:!u,value:a,writable:c===null&&y?y.writable:!c});else if(p||!u&&!c&&!v)f[i]=a;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ye}var ve,An;function Gt(){if(An)return ve;An=1;var r=zr(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},ve=e,ve}var ge,On;function wr(){if(On)return ge;On=1;var r=Lt(),e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",n=Object.prototype.toString,o=Array.prototype.concat,t=Ht(),f=function(c){return typeof c=="function"&&n.call(c)==="[object Function]"},i=Gt()(),a=function(c,v,p,y){if(v in c){if(y===!0){if(c[v]===p)return}else if(!f(y)||!y())return}i?t(c,v,p,!0):t(c,v,p)},u=function(c,v){var p=arguments.length>2?arguments[2]:{},y=r(v);e&&(y=o.call(y,Object.getOwnPropertySymbols(v)));for(var h=0;h<y.length;h+=1)a(c,y[h],v[y[h]],p[y[h]])};return u.supportsDescriptors=!!i,ge=u,ge}var he={exports:{}},de,qn;function zt(){return qn||(qn=1,de=Object),de}var me,wn;function eo(){return wn||(wn=1,me=Error),me}var Se,In;function jo(){return In||(In=1,Se=EvalError),Se}var be,Pn;function To(){return Pn||(Pn=1,be=RangeError),be}var Ae,Rn;function Mo(){return Rn||(Rn=1,Ae=ReferenceError),Ae}var Oe,$n;function Co(){return $n||($n=1,Oe=URIError),Oe}var qe,xn;function Do(){return xn||(xn=1,qe=Math.abs),qe}var we,En;function Fo(){return En||(En=1,we=Math.floor),we}var Ie,Bn;function _o(){return Bn||(Bn=1,Ie=Math.max),Ie}var Pe,jn;function No(){return jn||(jn=1,Pe=Math.min),Pe}var Re,Tn;function Wo(){return Tn||(Tn=1,Re=Math.pow),Re}var $e,Mn;function ko(){return Mn||(Mn=1,$e=Math.round),$e}var xe,Cn;function Lo(){return Cn||(Cn=1,xe=Number.isNaN||function(e){return e!==e}),xe}var Ee,Dn;function Uo(){if(Dn)return Ee;Dn=1;var r=Lo();return Ee=function(n){return r(n)||n===0?n:n<0?-1:1},Ee}var Be,Fn;function Vr(){return Fn||(Fn=1,Be=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),o=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var t=42;e[n]=t;for(var f in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,n);if(a.value!==t||a.enumerable!==!0)return!1}return!0}),Be}var je,_n;function Vt(){if(_n)return je;_n=1;var r=typeof Symbol<"u"&&Symbol,e=Vr();return je=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},je}var Te,Nn;function to(){return Nn||(Nn=1,Te=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Te}var Me,Wn;function no(){if(Wn)return Me;Wn=1;var r=zt();return Me=r.getPrototypeOf||null,Me}var Ce,kn;function Ho(){if(kn)return Ce;kn=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,o="[object Function]",t=function(u,c){for(var v=[],p=0;p<u.length;p+=1)v[p]=u[p];for(var y=0;y<c.length;y+=1)v[y+u.length]=c[y];return v},f=function(u,c){for(var v=[],p=c,y=0;p<u.length;p+=1,y+=1)v[y]=u[p];return v},i=function(a,u){for(var c="",v=0;v<a.length;v+=1)c+=a[v],v+1<a.length&&(c+=u);return c};return Ce=function(u){var c=this;if(typeof c!="function"||e.apply(c)!==o)throw new TypeError(r+c);for(var v=f(arguments,1),p,y=function(){if(this instanceof p){var w=c.apply(this,t(v,arguments));return Object(w)===w?w:this}return c.apply(u,t(v,arguments))},h=n(0,c.length-v.length),S=[],R=0;R<h;R++)S[R]="$"+R;if(p=Function("binder","return function ("+i(S,",")+"){ return binder.apply(this,arguments); }")(y),c.prototype){var q=function(){};q.prototype=c.prototype,p.prototype=new q,q.prototype=null}return p},Ce}var De,Ln;function _r(){if(Ln)return De;Ln=1;var r=Ho();return De=Function.prototype.bind||r,De}var Fe,Un;function Kt(){return Un||(Un=1,Fe=Function.prototype.call),Fe}var _e,Hn;function Jt(){return Hn||(Hn=1,_e=Function.prototype.apply),_e}var Ne,Gn;function Go(){return Gn||(Gn=1,Ne=typeof Reflect<"u"&&Reflect&&Reflect.apply),Ne}var We,zn;function ao(){if(zn)return We;zn=1;var r=_r(),e=Jt(),n=Kt(),o=Go();return We=o||r.call(n,e),We}var ke,Vn;function Yt(){if(Vn)return ke;Vn=1;var r=_r(),e=nr(),n=Kt(),o=ao();return ke=function(f){if(f.length<1||typeof f[0]!="function")throw new e("a function is required");return o(r,n,f)},ke}var Le,Kn;function zo(){if(Kn)return Le;Kn=1;var r=Yt(),e=qr(),n;try{n=[].__proto__===Array.prototype}catch(i){if(!i||typeof i!="object"||!("code"in i)||i.code!=="ERR_PROTO_ACCESS")throw i}var o=!!n&&e&&e(Object.prototype,"__proto__"),t=Object,f=t.getPrototypeOf;return Le=o&&typeof o.get=="function"?r([o.get]):typeof f=="function"?function(a){return f(a==null?a:t(a))}:!1,Le}var Ue,Jn;function Xt(){if(Jn)return Ue;Jn=1;var r=to(),e=no(),n=zo();return Ue=r?function(t){return r(t)}:e?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return e(t)}:n?function(t){return n(t)}:null,Ue}var He,Yn;function Qt(){if(Yn)return He;Yn=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=_r();return He=n.call(r,e),He}var Ge,Xn;function yr(){if(Xn)return Ge;Xn=1;var r,e=zt(),n=eo(),o=jo(),t=To(),f=Mo(),i=Ut(),a=nr(),u=Co(),c=Do(),v=Fo(),p=_o(),y=No(),h=Wo(),S=ko(),R=Uo(),q=Function,w=function(M){try{return q('"use strict"; return ('+M+").constructor;")()}catch{}},O=qr(),m=zr(),j=function(){throw new a},Q=O?(function(){try{return arguments.callee,j}catch{try{return O(arguments,"callee").get}catch{return j}}})():j,H=Vt()(),F=Xt(),D=no(),I=to(),_=Jt(),L=Kt(),N={},U=typeof Uint8Array>"u"||!F?r:F(Uint8Array),V={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":H&&F?F([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":q,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":H&&F?F(F([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!H||!F?r:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":O,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":t,"%ReferenceError%":f,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!H||!F?r:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":H&&F?F(""[Symbol.iterator]()):r,"%Symbol%":H?Symbol:r,"%SyntaxError%":i,"%ThrowTypeError%":Q,"%TypedArray%":U,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":_,"%Object.defineProperty%":m,"%Object.getPrototypeOf%":D,"%Math.abs%":c,"%Math.floor%":v,"%Math.max%":p,"%Math.min%":y,"%Math.pow%":h,"%Math.round%":S,"%Math.sign%":R,"%Reflect.getPrototypeOf%":I};if(F)try{null.error}catch(M){var fr=F(F(M));V["%Error.prototype%"]=fr}var Pr=function M(A){var P;if(A==="%AsyncFunction%")P=w("async function () {}");else if(A==="%GeneratorFunction%")P=w("function* () {}");else if(A==="%AsyncGeneratorFunction%")P=w("async function* () {}");else if(A==="%AsyncGenerator%"){var b=M("%AsyncGeneratorFunction%");b&&(P=b.prototype)}else if(A==="%AsyncIteratorPrototype%"){var E=M("%AsyncGenerator%");E&&F&&(P=F(E.prototype))}return V[A]=P,P},Sr={__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"]},ar=_r(),G=Qt(),br=ar.call(L,Array.prototype.concat),Rr=ar.call(_,Array.prototype.splice),Ar=ar.call(L,String.prototype.replace),vr=ar.call(L,String.prototype.slice),g=ar.call(L,RegExp.prototype.exec),d=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,x=/\\(\\)?/g,$=function(A){var P=vr(A,0,1),b=vr(A,-1);if(P==="%"&&b!=="%")throw new i("invalid intrinsic syntax, expected closing `%`");if(b==="%"&&P!=="%")throw new i("invalid intrinsic syntax, expected opening `%`");var E=[];return Ar(A,d,function(z,K,J,X){E[E.length]=J?Ar(X,x,"$1"):K||z}),E},T=function(A,P){var b=A,E;if(G(Sr,b)&&(E=Sr[b],b="%"+E[0]+"%"),G(V,b)){var z=V[b];if(z===N&&(z=Pr(b)),typeof z>"u"&&!P)throw new a("intrinsic "+A+" exists, but is not available. Please file an issue!");return{alias:E,name:b,value:z}}throw new i("intrinsic "+A+" does not exist!")};return Ge=function(A,P){if(typeof A!="string"||A.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof P!="boolean")throw new a('"allowMissing" argument must be a boolean');if(g(/^%?[^%]*%?$/,A)===null)throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var b=$(A),E=b.length>0?b[0]:"",z=T("%"+E+"%",P),K=z.name,J=z.value,X=!1,rr=z.alias;rr&&(E=rr[0],Rr(b,br([0,1],rr)));for(var sr=1,or=!0;sr<b.length;sr+=1){var er=b[sr],lr=vr(er,0,1),cr=vr(er,-1);if((lr==='"'||lr==="'"||lr==="`"||cr==='"'||cr==="'"||cr==="`")&&lr!==cr)throw new i("property names with quotes must have matching quotes");if((er==="constructor"||!or)&&(X=!0),E+="."+er,K="%"+E+"%",G(V,K))J=V[K];else if(J!=null){if(!(er in J)){if(!P)throw new a("base intrinsic for "+A+" exists, but the property is not available.");return}if(O&&sr+1>=b.length){var pr=O(J,er);or=!!pr,or&&"get"in pr&&!("originalValue"in pr.get)?J=pr.get:J=J[er]}else or=G(J,er),J=J[er];or&&!X&&(V[K]=J)}}return J},Ge}var ze,Qn;function Vo(){if(Qn)return ze;Qn=1;var r=yr(),e=Ht(),n=Gt()(),o=qr(),t=nr(),f=r("%Math.floor%");return ze=function(a,u){if(typeof a!="function")throw new t("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||f(u)!==u)throw new t("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],v=!0,p=!0;if("length"in a&&o){var y=o(a,"length");y&&!y.configurable&&(v=!1),y&&!y.writable&&(p=!1)}return(v||p||!c)&&(n?e(a,"length",u,!0,!0):e(a,"length",u)),a},ze}var Ve,Zn;function Ko(){if(Zn)return Ve;Zn=1;var r=_r(),e=Jt(),n=ao();return Ve=function(){return n(r,e,arguments)},Ve}var ra;function jr(){return ra||(ra=1,(function(r){var e=Vo(),n=zr(),o=Yt(),t=Ko();r.exports=function(i){var a=o(arguments),u=i.length-(arguments.length-1);return e(a,1+(u>0?u:0),!0)},n?n(r.exports,"apply",{value:t}):r.exports.apply=t})(he)),he.exports}var Ke,ea;function Z(){if(ea)return Ke;ea=1;var r=yr(),e=Yt(),n=e([r("%String.prototype.indexOf%")]);return Ke=function(t,f){var i=r(t,!!f);return typeof i=="function"&&n(t,".prototype.")>-1?e([i]):i},Ke}var Je,ta;function oo(){if(ta)return Je;ta=1;var r=Lt(),e=Vr()(),n=Z(),o=zt(),t=n("Array.prototype.push"),f=n("Object.prototype.propertyIsEnumerable"),i=e?o.getOwnPropertySymbols:null;return Je=function(u,c){if(u==null)throw new TypeError("target must be an object");var v=o(u);if(arguments.length===1)return v;for(var p=1;p<arguments.length;++p){var y=o(arguments[p]),h=r(y),S=e&&(o.getOwnPropertySymbols||i);if(S)for(var R=S(y),q=0;q<R.length;++q){var w=R[q];f(y,w)&&t(h,w)}for(var O=0;O<h.length;++O){var m=h[O];if(f(y,m)){var j=y[m];v[m]=j}}}return v},Je}var Ye,na;function io(){if(na)return Ye;na=1;var r=oo(),e=function(){if(!Object.assign)return!1;for(var o="abcdefghijklmnopqrst",t=o.split(""),f={},i=0;i<t.length;++i)f[t[i]]=t[i];var a=Object.assign({},f),u="";for(var c in a)u+=c;return o!==u},n=function(){if(!Object.assign||!Object.preventExtensions)return!1;var o=Object.preventExtensions({1:2});try{Object.assign(o,"xy")}catch{return o[1]==="y"}return!1};return Ye=function(){return!Object.assign||e()||n()?r:Object.assign},Ye}var Xe,aa;function Jo(){if(aa)return Xe;aa=1;var r=wr(),e=io();return Xe=function(){var o=e();return r(Object,{assign:o},{assign:function(){return Object.assign!==o}}),o},Xe}var Qe,oa;function Yo(){if(oa)return Qe;oa=1;var r=wr(),e=jr(),n=oo(),o=io(),t=Jo(),f=e.apply(o()),i=function(u,c){return f(Object,arguments)};return r(i,{getPolyfill:o,implementation:n,shim:t}),Qe=i,Qe}var Ze,ia;function uo(){if(ia)return Ze;ia=1;var r=yr(),e=jr(),n=e(r("String.prototype.indexOf"));return Ze=function(t,f){var i=r(t,!!f);return typeof i=="function"&&n(t,".prototype.")>-1?e(i):i},Ze}var rt,ua;function Xo(){if(ua)return rt;ua=1;var r=function(){return typeof(function(){}).name=="string"},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch{e=null}r.functionsHaveConfigurableNames=function(){if(!r()||!e)return!1;var t=e(function(){},"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;return r.boundFunctionsHaveNames=function(){return r()&&typeof n=="function"&&(function(){}).bind().name!==""},rt=r,rt}var et,fa;function Qo(){if(fa)return et;fa=1;var r=Ht(),e=Gt()(),n=Xo().functionsHaveConfigurableNames(),o=nr();return et=function(f,i){if(typeof f!="function")throw new o("`fn` is not a function");var a=arguments.length>2&&!!arguments[2];return(!a||n)&&(e?r(f,"name",i,!0,!0):r(f,"name",i)),f},et}var tt,sa;function fo(){if(sa)return tt;sa=1;var r=Qo(),e=nr(),n=Object;return tt=r(function(){if(this==null||this!==n(this))throw new e("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0),tt}var nt,la;function so(){if(la)return nt;la=1;var r=fo(),e=wr().supportsDescriptors,n=Object.getOwnPropertyDescriptor;return nt=function(){if(e&&/a/mig.flags==="gim"){var t=n(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var f="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){f+="d"}}),Object.defineProperty(i,"sticky",{get:function(){f+="y"}}),t.get.call(i),f==="dy")return t.get}}return r},nt}var at,ca;function Zo(){if(ca)return at;ca=1;var r=wr().supportsDescriptors,e=so(),n=qr(),o=Object.defineProperty,t=eo(),f=Xt(),i=/a/;return at=function(){if(!r||!f)throw new t("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var u=e(),c=f(i),v=n(c,"flags");return(!v||v.get!==u)&&o(c,"flags",{configurable:!0,enumerable:!1,get:u}),u},at}var ot,pa;function ri(){if(pa)return ot;pa=1;var r=wr(),e=jr(),n=fo(),o=so(),t=Zo(),f=e(o());return r(f,{getPolyfill:o,implementation:n,shim:t}),ot=f,ot}var Dr={exports:{}},it,ya;function Ir(){if(ya)return it;ya=1;var r=Vr();return it=function(){return r()&&!!Symbol.toStringTag},it}var ut,va;function lo(){if(va)return ut;va=1;var r=Ir()(),e=Z(),n=e("Object.prototype.toString"),o=function(a){return r&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:n(a)==="[object Arguments]"},t=function(a){return o(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&n(a)!=="[object Array]"&&"callee"in a&&n(a.callee)==="[object Function]"},f=(function(){return o(arguments)})();return o.isLegacyArguments=t,ut=f?o:t,ut}const ei={},ti=Object.freeze(Object.defineProperty({__proto__:null,default:ei},Symbol.toStringTag,{value:"Module"})),ni=Br.getAugmentedNamespace(ti);var ft,ga;function Kr(){if(ga)return ft;ga=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=r&&e&&typeof e.get=="function"?e.get:null,o=r&&Map.prototype.forEach,t=typeof Set=="function"&&Set.prototype,f=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,i=t&&f&&typeof f.get=="function"?f.get:null,a=t&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,c=u?WeakMap.prototype.has:null,v=typeof WeakSet=="function"&&WeakSet.prototype,p=v?WeakSet.prototype.has:null,y=typeof WeakRef=="function"&&WeakRef.prototype,h=y?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,R=Object.prototype.toString,q=Function.prototype.toString,w=String.prototype.match,O=String.prototype.slice,m=String.prototype.replace,j=String.prototype.toUpperCase,Q=String.prototype.toLowerCase,H=RegExp.prototype.test,F=Array.prototype.concat,D=Array.prototype.join,I=Array.prototype.slice,_=Math.floor,L=typeof BigInt=="function"?BigInt.prototype.valueOf:null,N=Object.getOwnPropertySymbols,U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,V=typeof Symbol=="function"&&typeof Symbol.iterator=="object",fr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===V||!0)?Symbol.toStringTag:null,Pr=Object.prototype.propertyIsEnumerable,Sr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(s){return s.__proto__}:null);function ar(s,l){if(s===1/0||s===-1/0||s!==s||s&&s>-1e3&&s<1e3||H.call(/e/,l))return l;var C=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof s=="number"){var W=s<0?-_(-s):_(s);if(W!==s){var k=String(W),B=O.call(l,k.length+1);return m.call(k,C,"$&_")+"."+m.call(m.call(B,/([0-9]{3})/g,"$&_"),/_$/,"")}}return m.call(l,C,"$&_")}var G=ni,br=G.custom,Rr=z(br)?br:null,Ar={__proto__:null,double:'"',single:"'"},vr={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ft=function s(l,C,W,k){var B=C||{};if(X(B,"quoteStyle")&&!X(Ar,B.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(X(B,"maxStringLength")&&(typeof B.maxStringLength=="number"?B.maxStringLength<0&&B.maxStringLength!==1/0:B.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var dr=X(B,"customInspect")?B.customInspect:!0;if(typeof dr!="boolean"&&dr!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(X(B,"indent")&&B.indent!==null&&B.indent!==" "&&!(parseInt(B.indent,10)===B.indent&&B.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(X(B,"numericSeparator")&&typeof B.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Or=B.numericSeparator;if(typeof l>"u")return"undefined";if(l===null)return"null";if(typeof l=="boolean")return l?"true":"false";if(typeof l=="string")return $r(l,B);if(typeof l=="number"){if(l===0)return 1/0/l>0?"0":"-0";var tr=String(l);return Or?ar(l,tr):tr}if(typeof l=="bigint"){var mr=String(l)+"n";return Or?ar(l,mr):mr}var Xr=typeof B.depth>"u"?5:B.depth;if(typeof W>"u"&&(W=0),W>=Xr&&Xr>0&&typeof l=="object")return $(l)?"[Array]":"[Object]";var xr=wo(B,W);if(typeof k>"u")k=[];else if(or(k,l)>=0)return"[Circular]";function ir(Er,Lr,Po){if(Lr&&(k=I.call(k),k.push(Lr)),Po){var sn={depth:B.depth};return X(B,"quoteStyle")&&(sn.quoteStyle=B.quoteStyle),s(Er,sn,W+1,k)}return s(Er,B,W+1,k)}if(typeof l=="function"&&!M(l)){var en=sr(l),tn=Wr(l,ir);return"[Function"+(en?": "+en:" (anonymous)")+"]"+(tn.length>0?" { "+D.call(tn,", ")+" }":"")}if(z(l)){var nn=V?m.call(String(l),/^(Symbol\(.*\))_[^)]*$/,"$1"):U.call(l);return typeof l=="object"&&!V?hr(nn):nn}if(gr(l)){for(var Mr="<"+Q.call(String(l.nodeName)),Qr=l.attributes||[],kr=0;kr<Qr.length;kr++)Mr+=" "+Qr[kr].name+"="+g(d(Qr[kr].value),"double",B);return Mr+=">",l.childNodes&&l.childNodes.length&&(Mr+="..."),Mr+="</"+Q.call(String(l.nodeName))+">",Mr}if($(l)){if(l.length===0)return"[]";var Zr=Wr(l,ir);return xr&&!qo(Zr)?"["+Yr(Zr,xr)+"]":"[ "+D.call(Zr,", ")+" ]"}if(A(l)){var re=Wr(l,ir);return!("cause"in Error.prototype)&&"cause"in l&&!Pr.call(l,"cause")?"{ ["+String(l)+"] "+D.call(F.call("[cause]: "+ir(l.cause),re),", ")+" }":re.length===0?"["+String(l)+"]":"{ ["+String(l)+"] "+D.call(re,", ")+" }"}if(typeof l=="object"&&dr){if(Rr&&typeof l[Rr]=="function"&&G)return G(l,{depth:Xr-W});if(dr!=="symbol"&&typeof l.inspect=="function")return l.inspect()}if(er(l)){var an=[];return o&&o.call(l,function(Er,Lr){an.push(ir(Lr,l,!0)+" => "+ir(Er,l))}),rn("Map",n.call(l),an,xr)}if(pr(l)){var on=[];return a&&a.call(l,function(Er){on.push(ir(Er,l))}),rn("Set",i.call(l),on,xr)}if(lr(l))return Jr("WeakMap");if(Nr(l))return Jr("WeakSet");if(cr(l))return Jr("WeakRef");if(b(l))return hr(ir(Number(l)));if(K(l))return hr(ir(L.call(l)));if(E(l))return hr(S.call(l));if(P(l))return hr(ir(String(l)));if(typeof window<"u"&&l===window)return"{ [object Window] }";if(typeof globalThis<"u"&&l===globalThis||typeof Br.commonjsGlobal<"u"&&l===Br.commonjsGlobal)return"{ [object globalThis] }";if(!T(l)&&!M(l)){var ee=Wr(l,ir),un=Sr?Sr(l)===Object.prototype:l instanceof Object||l.constructor===Object,te=l instanceof Object?"":"null prototype",fn=!un&&fr&&Object(l)===l&&fr in l?O.call(rr(l),8,-1):te?"Object":"",Io=un||typeof l.constructor!="function"?"":l.constructor.name?l.constructor.name+" ":"",ne=Io+(fn||te?"["+D.call(F.call([],fn||[],te||[]),": ")+"] ":"");return ee.length===0?ne+"{}":xr?ne+"{"+Yr(ee,xr)+"}":ne+"{ "+D.call(ee,", ")+" }"}return String(l)};function g(s,l,C){var W=C.quoteStyle||l,k=Ar[W];return k+s+k}function d(s){return m.call(String(s),/"/g,"&quot;")}function x(s){return!fr||!(typeof s=="object"&&(fr in s||typeof s[fr]<"u"))}function $(s){return rr(s)==="[object Array]"&&x(s)}function T(s){return rr(s)==="[object Date]"&&x(s)}function M(s){return rr(s)==="[object RegExp]"&&x(s)}function A(s){return rr(s)==="[object Error]"&&x(s)}function P(s){return rr(s)==="[object String]"&&x(s)}function b(s){return rr(s)==="[object Number]"&&x(s)}function E(s){return rr(s)==="[object Boolean]"&&x(s)}function z(s){if(V)return s&&typeof s=="object"&&s instanceof Symbol;if(typeof s=="symbol")return!0;if(!s||typeof s!="object"||!U)return!1;try{return U.call(s),!0}catch{}return!1}function K(s){if(!s||typeof s!="object"||!L)return!1;try{return L.call(s),!0}catch{}return!1}var J=Object.prototype.hasOwnProperty||function(s){return s in this};function X(s,l){return J.call(s,l)}function rr(s){return R.call(s)}function sr(s){if(s.name)return s.name;var l=w.call(q.call(s),/^function\s*([\w$]+)/);return l?l[1]:null}function or(s,l){if(s.indexOf)return s.indexOf(l);for(var C=0,W=s.length;C<W;C++)if(s[C]===l)return C;return-1}function er(s){if(!n||!s||typeof s!="object")return!1;try{n.call(s);try{i.call(s)}catch{return!0}return s instanceof Map}catch{}return!1}function lr(s){if(!c||!s||typeof s!="object")return!1;try{c.call(s,c);try{p.call(s,p)}catch{return!0}return s instanceof WeakMap}catch{}return!1}function cr(s){if(!h||!s||typeof s!="object")return!1;try{return h.call(s),!0}catch{}return!1}function pr(s){if(!i||!s||typeof s!="object")return!1;try{i.call(s);try{n.call(s)}catch{return!0}return s instanceof Set}catch{}return!1}function Nr(s){if(!p||!s||typeof s!="object")return!1;try{p.call(s,p);try{c.call(s,c)}catch{return!0}return s instanceof WeakSet}catch{}return!1}function gr(s){return!s||typeof s!="object"?!1:typeof HTMLElement<"u"&&s instanceof HTMLElement?!0:typeof s.nodeName=="string"&&typeof s.getAttribute=="function"}function $r(s,l){if(s.length>l.maxStringLength){var C=s.length-l.maxStringLength,W="... "+C+" more character"+(C>1?"s":"");return $r(O.call(s,0,l.maxStringLength),l)+W}var k=vr[l.quoteStyle||"single"];k.lastIndex=0;var B=m.call(m.call(s,k,"\\$1"),/[\x00-\x1f]/g,Tr);return g(B,"single",l)}function Tr(s){var l=s.charCodeAt(0),C={8:"b",9:"t",10:"n",12:"f",13:"r"}[l];return C?"\\"+C:"\\x"+(l<16?"0":"")+j.call(l.toString(16))}function hr(s){return"Object("+s+")"}function Jr(s){return s+" { ? }"}function rn(s,l,C,W){var k=W?Yr(C,W):D.call(C,", ");return s+" ("+l+") {"+k+"}"}function qo(s){for(var l=0;l<s.length;l++)if(or(s[l],`
2
- `)>=0)return!1;return!0}function wo(s,l){var C;if(s.indent===" ")C=" ";else if(typeof s.indent=="number"&&s.indent>0)C=D.call(Array(s.indent+1)," ");else return null;return{base:C,prev:D.call(Array(l+1),C)}}function Yr(s,l){if(s.length===0)return"";var C=`
3
- `+l.prev+l.base;return C+D.call(s,","+C)+`
4
- `+l.prev}function Wr(s,l){var C=$(s),W=[];if(C){W.length=s.length;for(var k=0;k<s.length;k++)W[k]=X(s,k)?l(s[k],s):""}var B=typeof N=="function"?N(s):[],dr;if(V){dr={};for(var Or=0;Or<B.length;Or++)dr["$"+B[Or]]=B[Or]}for(var tr in s)X(s,tr)&&(C&&String(Number(tr))===tr&&tr<s.length||V&&dr["$"+tr]instanceof Symbol||(H.call(/[^\w$]/,tr)?W.push(l(tr,s)+": "+l(s[tr],s)):W.push(tr+": "+l(s[tr],s))));if(typeof N=="function")for(var mr=0;mr<B.length;mr++)Pr.call(s,B[mr])&&W.push("["+l(B[mr])+"]: "+l(s[B[mr]],s));return W}return ft}var st,ha;function ai(){if(ha)return st;ha=1;var r=Kr(),e=nr(),n=function(a,u,c){for(var v=a,p;(p=v.next)!=null;v=p)if(p.key===u)return v.next=p.next,c||(p.next=a.next,a.next=p),p},o=function(a,u){if(a){var c=n(a,u);return c&&c.value}},t=function(a,u,c){var v=n(a,u);v?v.value=c:a.next={key:u,next:a.next,value:c}},f=function(a,u){return a?!!n(a,u):!1},i=function(a,u){if(a)return n(a,u,!0)};return st=function(){var u,c={assert:function(v){if(!c.has(v))throw new e("Side channel does not contain "+r(v))},delete:function(v){var p=u&&u.next,y=i(u,v);return y&&p&&p===y&&(u=void 0),!!y},get:function(v){return o(u,v)},has:function(v){return f(u,v)},set:function(v,p){u||(u={next:void 0}),t(u,v,p)}};return c},st}var lt,da;function co(){if(da)return lt;da=1;var r=yr(),e=Z(),n=Kr(),o=nr(),t=r("%Map%",!0),f=e("Map.prototype.get",!0),i=e("Map.prototype.set",!0),a=e("Map.prototype.has",!0),u=e("Map.prototype.delete",!0),c=e("Map.prototype.size",!0);return lt=!!t&&function(){var p,y={assert:function(h){if(!y.has(h))throw new o("Side channel does not contain "+n(h))},delete:function(h){if(p){var S=u(p,h);return c(p)===0&&(p=void 0),S}return!1},get:function(h){if(p)return f(p,h)},has:function(h){return p?a(p,h):!1},set:function(h,S){p||(p=new t),i(p,h,S)}};return y},lt}var ct,ma;function oi(){if(ma)return ct;ma=1;var r=yr(),e=Z(),n=Kr(),o=co(),t=nr(),f=r("%WeakMap%",!0),i=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),u=e("WeakMap.prototype.has",!0),c=e("WeakMap.prototype.delete",!0);return ct=f?function(){var p,y,h={assert:function(S){if(!h.has(S))throw new t("Side channel does not contain "+n(S))},delete:function(S){if(f&&S&&(typeof S=="object"||typeof S=="function")){if(p)return c(p,S)}else if(o&&y)return y.delete(S);return!1},get:function(S){return f&&S&&(typeof S=="object"||typeof S=="function")&&p?i(p,S):y&&y.get(S)},has:function(S){return f&&S&&(typeof S=="object"||typeof S=="function")&&p?u(p,S):!!y&&y.has(S)},set:function(S,R){f&&S&&(typeof S=="object"||typeof S=="function")?(p||(p=new f),a(p,S,R)):o&&(y||(y=o()),y.set(S,R))}};return h}:o,ct}var pt,Sa;function po(){if(Sa)return pt;Sa=1;var r=nr(),e=Kr(),n=ai(),o=co(),t=oi(),f=t||o||n;return pt=function(){var a,u={assert:function(c){if(!u.has(c))throw new r("Side channel does not contain "+e(c))},delete:function(c){return!!a&&a.delete(c)},get:function(c){return a&&a.get(c)},has:function(c){return!!a&&a.has(c)},set:function(c,v){a||(a=f()),a.set(c,v)}};return u},pt}var yt,ba;function ii(){if(ba)return yt;ba=1;var r=Qt(),e=po()(),n=nr(),o={assert:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");if(e.assert(t),!o.has(t,f))throw new n("`"+f+"` is not present on `O`")},get:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var i=e.get(t);return i&&i["$"+f]},has:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var i=e.get(t);return!!i&&r(i,"$"+f)},set:function(t,f,i){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var a=e.get(t);a||(a={},e.set(t,a)),a["$"+f]=i}};return Object.freeze&&Object.freeze(o),yt=o,yt}var vt,Aa;function ui(){if(Aa)return vt;Aa=1;var r=ii(),e=Ut(),n=typeof StopIteration=="object"?StopIteration:null;return vt=function(t){if(!n)throw new e("this environment lacks StopIteration");r.set(t,"[[Done]]",!1);var f={next:function(){var a=r.get(this,"[[Iterator]]"),u=!!r.get(a,"[[Done]]");try{return{done:u,value:u?void 0:a.next()}}catch(c){if(r.set(a,"[[Done]]",!0),c!==n)throw c;return{done:!0,value:void 0}}}};return r.set(f,"[[Iterator]]",t),f},vt}var gt,Oa;function yo(){if(Oa)return gt;Oa=1;var r={}.toString;return gt=Array.isArray||function(e){return r.call(e)=="[object Array]"},gt}var ht,qa;function vo(){if(qa)return ht;qa=1;var r=Z(),e=r("String.prototype.valueOf"),n=function(a){try{return e(a),!0}catch{return!1}},o=r("Object.prototype.toString"),t="[object String]",f=Ir()();return ht=function(a){return typeof a=="string"?!0:!a||typeof a!="object"?!1:f?n(a):o(a)===t},ht}var dt,wa;function go(){if(wa)return dt;wa=1;var r=typeof Map=="function"&&Map.prototype?Map:null,e=typeof Set=="function"&&Set.prototype?Set:null,n;r||(n=function(i){return!1});var o=r?Map.prototype.has:null,t=e?Set.prototype.has:null;return!n&&!o&&(n=function(i){return!1}),dt=n||function(i){if(!i||typeof i!="object")return!1;try{if(o.call(i),t)try{t.call(i)}catch{return!0}return i instanceof r}catch{}return!1},dt}var mt,Ia;function ho(){if(Ia)return mt;Ia=1;var r=typeof Map=="function"&&Map.prototype?Map:null,e=typeof Set=="function"&&Set.prototype?Set:null,n;e||(n=function(i){return!1});var o=r?Map.prototype.has:null,t=e?Set.prototype.has:null;return!n&&!t&&(n=function(i){return!1}),mt=n||function(i){if(!i||typeof i!="object")return!1;try{if(t.call(i),o)try{o.call(i)}catch{return!0}return i instanceof e}catch{}return!1},mt}var Pa;function fi(){if(Pa)return Dr.exports;Pa=1;var r=lo(),e=ui();if(Vt()()||Vr()()){var n=Symbol.iterator;Dr.exports=function(I){if(I!=null&&typeof I[n]<"u")return I[n]();if(r(I))return Array.prototype[n].call(I)}}else{var o=yo(),t=vo(),f=yr(),i=f("%Map%",!0),a=f("%Set%",!0),u=uo(),c=u("Array.prototype.push"),v=u("String.prototype.charCodeAt"),p=u("String.prototype.slice"),y=function(I,_){var L=I.length;if(_+1>=L)return _+1;var N=v(I,_);if(N<55296||N>56319)return _+1;var U=v(I,_+1);return U<56320||U>57343?_+1:_+2},h=function(I){var _=0;return{next:function(){var N=_>=I.length,U;return N||(U=I[_],_+=1),{done:N,value:U}}}},S=function(I,_){if(o(I)||r(I))return h(I);if(t(I)){var L=0;return{next:function(){var U=y(I,L),V=p(I,L,U);return L=U,{done:U>I.length,value:V}}}}if(_&&typeof I["_es6-shim iterator_"]<"u")return I["_es6-shim iterator_"]()};if(!i&&!a)Dr.exports=function(I){if(I!=null)return S(I,!0)};else{var R=go(),q=ho(),w=u("Map.prototype.forEach",!0),O=u("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var m=u("Map.prototype.iterator",!0),j=u("Set.prototype.iterator",!0);var Q=u("Map.prototype.@@iterator",!0)||u("Map.prototype._es6-shim iterator_",!0),H=u("Set.prototype.@@iterator",!0)||u("Set.prototype._es6-shim iterator_",!0),F=function(I){if(R(I)){if(m)return e(m(I));if(Q)return Q(I);if(w){var _=[];return w(I,function(N,U){c(_,[U,N])}),h(_)}}if(q(I)){if(j)return e(j(I));if(H)return H(I);if(O){var L=[];return O(I,function(N){c(L,N)}),h(L)}}};Dr.exports=function(I){return F(I)||S(I)}}}return Dr.exports}var St,Ra;function mo(){if(Ra)return St;Ra=1;var r=function(e){return e!==e};return St=function(n,o){return n===0&&o===0?1/n===1/o:!!(n===o||r(n)&&r(o))},St}var bt,$a;function So(){if($a)return bt;$a=1;var r=mo();return bt=function(){return typeof Object.is=="function"?Object.is:r},bt}var At,xa;function si(){if(xa)return At;xa=1;var r=So(),e=wr();return At=function(){var o=r();return e(Object,{is:o},{is:function(){return Object.is!==o}}),o},At}var Ot,Ea;function li(){if(Ea)return Ot;Ea=1;var r=wr(),e=jr(),n=mo(),o=So(),t=si(),f=e(o(),Object);return r(f,{getPolyfill:o,implementation:n,shim:t}),Ot=f,Ot}var qt,Ba;function bo(){if(Ba)return qt;Ba=1;var r=jr(),e=Z(),n=yr(),o=n("%ArrayBuffer%",!0),t=e("ArrayBuffer.prototype.byteLength",!0),f=e("Object.prototype.toString"),i=!!o&&!t&&new o(0).slice,a=!!i&&r(i);return qt=t||a?function(c){if(!c||typeof c!="object")return!1;try{return t?t(c):a(c,0),!0}catch{return!1}}:o?function(c){return f(c)==="[object ArrayBuffer]"}:function(c){return!1},qt}var wt,ja;function ci(){if(ja)return wt;ja=1;var r=Z(),e=r("Date.prototype.getDay"),n=function(a){try{return e(a),!0}catch{return!1}},o=r("Object.prototype.toString"),t="[object Date]",f=Ir()();return wt=function(a){return typeof a!="object"||a===null?!1:f?n(a):o(a)===t},wt}var It,Ta;function Ao(){if(Ta)return It;Ta=1;var r=Z(),e=Ir()(),n=Qt(),o=qr(),t;if(e){var f=r("RegExp.prototype.exec"),i={},a=function(){throw i},u={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(u[Symbol.toPrimitive]=a),t=function(y){if(!y||typeof y!="object")return!1;var h=o(y,"lastIndex"),S=h&&n(h,"value");if(!S)return!1;try{f(y,u)}catch(R){return R===i}}}else{var c=r("Object.prototype.toString"),v="[object RegExp]";t=function(y){return!y||typeof y!="object"&&typeof y!="function"?!1:c(y)===v}}return It=t,It}var Pt,Ma;function pi(){if(Ma)return Pt;Ma=1;var r=Z(),e=r("SharedArrayBuffer.prototype.byteLength",!0);return Pt=e?function(o){if(!o||typeof o!="object")return!1;try{return e(o),!0}catch{return!1}}:function(o){return!1},Pt}var Rt,Ca;function yi(){if(Ca)return Rt;Ca=1;var r=Z(),e=r("Number.prototype.toString"),n=function(a){try{return e(a),!0}catch{return!1}},o=r("Object.prototype.toString"),t="[object Number]",f=Ir()();return Rt=function(a){return typeof a=="number"?!0:!a||typeof a!="object"?!1:f?n(a):o(a)===t},Rt}var $t,Da;function vi(){if(Da)return $t;Da=1;var r=Z(),e=r("Boolean.prototype.toString"),n=r("Object.prototype.toString"),o=function(a){try{return e(a),!0}catch{return!1}},t="[object Boolean]",f=Ir()();return $t=function(a){return typeof a=="boolean"?!0:a===null||typeof a!="object"?!1:f?o(a):n(a)===t},$t}var Ur={exports:{}},xt,Fa;function gi(){if(Fa)return xt;Fa=1;var r=Z(),e=Ao(),n=r("RegExp.prototype.exec"),o=nr();return xt=function(f){if(!e(f))throw new o("`regex` must be a RegExp");return function(a){return n(f,a)!==null}},xt}var _a;function hi(){if(_a)return Ur.exports;_a=1;var r=Z(),e=r("Object.prototype.toString"),n=Vt()(),o=gi();if(n){var t=r("Symbol.prototype.toString"),f=o(/^Symbol\(.*\)$/),i=function(u){return typeof u.valueOf()!="symbol"?!1:f(t(u))};Ur.exports=function(u){if(typeof u=="symbol")return!0;if(!u||typeof u!="object"||e(u)!=="[object Symbol]")return!1;try{return i(u)}catch{return!1}}}else Ur.exports=function(u){return!1};return Ur.exports}var Hr={exports:{}},Et,Na;function di(){if(Na)return Et;Na=1;var r=typeof BigInt<"u"&&BigInt;return Et=function(){return typeof r=="function"&&typeof BigInt=="function"&&typeof r(42)=="bigint"&&typeof BigInt(42)=="bigint"},Et}var Wa;function mi(){if(Wa)return Hr.exports;Wa=1;var r=di()();if(r){var e=BigInt.prototype.valueOf,n=function(t){try{return e.call(t),!0}catch{}return!1};Hr.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:n(t)}}else Hr.exports=function(t){return!1};return Hr.exports}var Bt,ka;function Si(){if(ka)return Bt;ka=1;var r=vo(),e=yi(),n=vi(),o=hi(),t=mi();return Bt=function(i){if(i==null||typeof i!="object"&&typeof i!="function")return null;if(r(i))return"String";if(e(i))return"Number";if(n(i))return"Boolean";if(o(i))return"Symbol";if(t(i))return"BigInt"},Bt}var jt,La;function bi(){if(La)return jt;La=1;var r=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,e=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,n;r||(n=function(i){return!1});var o=r?r.prototype.has:null,t=e?e.prototype.has:null;return!n&&!o&&(n=function(i){return!1}),jt=n||function(i){if(!i||typeof i!="object")return!1;try{if(o.call(i,o),t)try{t.call(i,t)}catch{return!0}return i instanceof r}catch{}return!1},jt}var Gr={exports:{}},Ua;function Ai(){if(Ua)return Gr.exports;Ua=1;var r=yr(),e=Z(),n=r("%WeakSet%",!0),o=e("WeakSet.prototype.has",!0);if(o){var t=e("WeakMap.prototype.has",!0);Gr.exports=function(i){if(!i||typeof i!="object")return!1;try{if(o(i,o),t)try{t(i,t)}catch{return!0}return i instanceof n}catch{}return!1}}else Gr.exports=function(i){return!1};return Gr.exports}var Tt,Ha;function Oi(){if(Ha)return Tt;Ha=1;var r=go(),e=ho(),n=bi(),o=Ai();return Tt=function(f){if(f&&typeof f=="object"){if(r(f))return"Map";if(e(f))return"Set";if(n(f))return"WeakMap";if(o(f))return"WeakSet"}return!1},Tt}var Mt,Ga;function qi(){if(Ga)return Mt;Ga=1;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,o;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw o}}),o={},e(function(){throw 42},null,n)}catch(O){O!==o&&(e=null)}else e=null;var t=/^\s*class\b/,f=function(m){try{var j=r.call(m);return t.test(j)}catch{return!1}},i=function(m){try{return f(m)?!1:(r.call(m),!0)}catch{return!1}},a=Object.prototype.toString,u="[object Object]",c="[object Function]",v="[object GeneratorFunction]",p="[object HTMLAllCollection]",y="[object HTML document.all class]",h="[object HTMLCollection]",S=typeof Symbol=="function"&&!!Symbol.toStringTag,R=!(0 in[,]),q=function(){return!1};if(typeof document=="object"){var w=document.all;a.call(w)===a.call(document.all)&&(q=function(m){if((R||!m)&&(typeof m>"u"||typeof m=="object"))try{var j=a.call(m);return(j===p||j===y||j===h||j===u)&&m("")==null}catch{}return!1})}return Mt=e?function(m){if(q(m))return!0;if(!m||typeof m!="function"&&typeof m!="object")return!1;try{e(m,null,n)}catch(j){if(j!==o)return!1}return!f(m)&&i(m)}:function(m){if(q(m))return!0;if(!m||typeof m!="function"&&typeof m!="object")return!1;if(S)return i(m);if(f(m))return!1;var j=a.call(m);return j!==c&&j!==v&&!/^\[object HTML/.test(j)?!1:i(m)},Mt}var Ct,za;function wi(){if(za)return Ct;za=1;var r=qi(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=function(u,c,v){for(var p=0,y=u.length;p<y;p++)n.call(u,p)&&(v==null?c(u[p],p,u):c.call(v,u[p],p,u))},t=function(u,c,v){for(var p=0,y=u.length;p<y;p++)v==null?c(u.charAt(p),p,u):c.call(v,u.charAt(p),p,u)},f=function(u,c,v){for(var p in u)n.call(u,p)&&(v==null?c(u[p],p,u):c.call(v,u[p],p,u))};function i(a){return e.call(a)==="[object Array]"}return Ct=function(u,c,v){if(!r(c))throw new TypeError("iterator must be a function");var p;arguments.length>=3&&(p=v),i(u)?o(u,c,p):typeof u=="string"?t(u,c,p):f(u,c,p)},Ct}var Dt,Va;function Ii(){return Va||(Va=1,Dt=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Dt}var Ft,Ka;function Pi(){if(Ka)return Ft;Ka=1;var r=Ii(),e=typeof globalThis>"u"?Br.commonjsGlobal:globalThis;return Ft=function(){for(var o=[],t=0;t<r.length;t++)typeof e[r[t]]=="function"&&(o[o.length]=r[t]);return o},Ft}var _t,Ja;function Ri(){if(Ja)return _t;Ja=1;var r=wi(),e=Pi(),n=jr(),o=Z(),t=qr(),f=Xt(),i=o("Object.prototype.toString"),a=Ir()(),u=typeof globalThis>"u"?Br.commonjsGlobal:globalThis,c=e(),v=o("String.prototype.slice"),p=o("Array.prototype.indexOf",!0)||function(q,w){for(var O=0;O<q.length;O+=1)if(q[O]===w)return O;return-1},y={__proto__:null};a&&t&&f?r(c,function(R){var q=new u[R];if(Symbol.toStringTag in q&&f){var w=f(q),O=t(w,Symbol.toStringTag);if(!O&&w){var m=f(w);O=t(m,Symbol.toStringTag)}y["$"+R]=n(O.get)}}):r(c,function(R){var q=new u[R],w=q.slice||q.set;w&&(y["$"+R]=n(w))});var h=function(q){var w=!1;return r(y,function(O,m){if(!w)try{"$"+O(q)===m&&(w=v(m,1))}catch{}}),w},S=function(q){var w=!1;return r(y,function(O,m){if(!w)try{O(q),w=v(m,1)}catch{}}),w};return _t=function(q){if(!q||typeof q!="object")return!1;if(!a){var w=v(i(q),8,-1);return p(c,w)>-1?w:w!=="Object"?!1:S(q)}return t?h(q):null},_t}var Nt,Ya;function $i(){if(Ya)return Nt;Ya=1;var r=Z(),e=r("ArrayBuffer.prototype.byteLength",!0),n=bo();return Nt=function(t){return n(t)?e?e(t):t.byteLength:NaN},Nt}var Wt,Xa;function xi(){if(Xa)return Wt;Xa=1;var r=Yo(),e=uo(),n=ri(),o=yr(),t=fi(),f=po(),i=li(),a=lo(),u=yo(),c=bo(),v=ci(),p=Ao(),y=pi(),h=Lt(),S=Si(),R=Oi(),q=Ri(),w=$i(),O=e("SharedArrayBuffer.prototype.byteLength",!0),m=e("Date.prototype.getTime"),j=Object.getPrototypeOf,Q=e("Object.prototype.toString"),H=o("%Set%",!0),F=e("Map.prototype.has",!0),D=e("Map.prototype.get",!0),I=e("Map.prototype.size",!0),_=e("Set.prototype.add",!0),L=e("Set.prototype.delete",!0),N=e("Set.prototype.has",!0),U=e("Set.prototype.size",!0);function V(g,d,x,$){for(var T=t(g),M;(M=T.next())&&!M.done;)if(G(d,M.value,x,$))return L(g,M.value),!0;return!1}function fr(g){if(typeof g>"u")return null;if(typeof g!="object")return typeof g=="symbol"?!1:typeof g=="string"||typeof g=="number"?+g==+g:!0}function Pr(g,d,x,$,T,M){var A=fr(x);if(A!=null)return A;var P=D(d,A),b=r({},T,{strict:!1});return typeof P>"u"&&!F(d,A)||!G($,P,b,M)?!1:!F(g,A)&&G($,P,b,M)}function Sr(g,d,x){var $=fr(x);return $??(N(d,$)&&!N(g,$))}function ar(g,d,x,$,T,M){for(var A=t(g),P,b;(P=A.next())&&!P.done;)if(b=P.value,G(x,b,T,M)&&G($,D(d,b),T,M))return L(g,b),!0;return!1}function G(g,d,x,$){var T=x||{};if(T.strict?i(g,d):g===d)return!0;var M=S(g),A=S(d);if(M!==A)return!1;if(!g||!d||typeof g!="object"&&typeof d!="object")return T.strict?i(g,d):g==d;var P=$.has(g),b=$.has(d),E;if(P&&b){if($.get(g)===$.get(d))return!0}else E={};return P||$.set(g,E),b||$.set(d,E),vr(g,d,T,$)}function br(g){return!g||typeof g!="object"||typeof g.length!="number"||typeof g.copy!="function"||typeof g.slice!="function"||g.length>0&&typeof g[0]!="number"?!1:!!(g.constructor&&g.constructor.isBuffer&&g.constructor.isBuffer(g))}function Rr(g,d,x,$){if(U(g)!==U(d))return!1;for(var T=t(g),M=t(d),A,P,b;(A=T.next())&&!A.done;)if(A.value&&typeof A.value=="object")b||(b=new H),_(b,A.value);else if(!N(d,A.value)){if(x.strict||!Sr(g,d,A.value))return!1;b||(b=new H),_(b,A.value)}if(b){for(;(P=M.next())&&!P.done;)if(P.value&&typeof P.value=="object"){if(!V(b,P.value,x.strict,$))return!1}else if(!x.strict&&!N(g,P.value)&&!V(b,P.value,x.strict,$))return!1;return U(b)===0}return!0}function Ar(g,d,x,$){if(I(g)!==I(d))return!1;for(var T=t(g),M=t(d),A,P,b,E,z,K;(A=T.next())&&!A.done;)if(E=A.value[0],z=A.value[1],E&&typeof E=="object")b||(b=new H),_(b,E);else if(K=D(d,E),typeof K>"u"&&!F(d,E)||!G(z,K,x,$)){if(x.strict||!Pr(g,d,E,z,x,$))return!1;b||(b=new H),_(b,E)}if(b){for(;(P=M.next())&&!P.done;)if(E=P.value[0],K=P.value[1],E&&typeof E=="object"){if(!ar(b,g,E,K,x,$))return!1}else if(!x.strict&&(!g.has(E)||!G(D(g,E),K,x,$))&&!ar(b,g,E,K,r({},x,{strict:!1}),$))return!1;return U(b)===0}return!0}function vr(g,d,x,$){var T,M;if(typeof g!=typeof d||g==null||d==null||Q(g)!==Q(d)||a(g)!==a(d))return!1;var A=u(g),P=u(d);if(A!==P)return!1;var b=g instanceof Error,E=d instanceof Error;if(b!==E||(b||E)&&(g.name!==d.name||g.message!==d.message))return!1;var z=p(g),K=p(d);if(z!==K||(z||K)&&(g.source!==d.source||n(g)!==n(d)))return!1;var J=v(g),X=v(d);if(J!==X||(J||X)&&m(g)!==m(d)||x.strict&&j&&j(g)!==j(d))return!1;var rr=q(g),sr=q(d);if(rr!==sr)return!1;if(rr||sr){if(g.length!==d.length)return!1;for(T=0;T<g.length;T++)if(g[T]!==d[T])return!1;return!0}var or=br(g),er=br(d);if(or!==er)return!1;if(or||er){if(g.length!==d.length)return!1;for(T=0;T<g.length;T++)if(g[T]!==d[T])return!1;return!0}var lr=c(g),cr=c(d);if(lr!==cr)return!1;if(lr||cr)return w(g)!==w(d)?!1:typeof Uint8Array=="function"&&G(new Uint8Array(g),new Uint8Array(d),x,$);var pr=y(g),Nr=y(d);if(pr!==Nr)return!1;if(pr||Nr)return O(g)!==O(d)?!1:typeof Uint8Array=="function"&&G(new Uint8Array(g),new Uint8Array(d),x,$);if(typeof g!=typeof d)return!1;var gr=h(g),$r=h(d);if(gr.length!==$r.length)return!1;for(gr.sort(),$r.sort(),T=gr.length-1;T>=0;T--)if(gr[T]!=$r[T])return!1;for(T=gr.length-1;T>=0;T--)if(M=gr[T],!G(g[M],d[M],x,$))return!1;var Tr=R(g),hr=R(d);return Tr!==hr?!1:Tr==="Set"||hr==="Set"?Rr(g,d,x,$):Tr==="Map"?Ar(g,d,x,$):!0}return Wt=function(d,x,$){return G(d,x,$,f())},Wt}var Ei=xi();const Bi=Br.getDefaultExportFromCjs(Ei);function ji(r){return r}function Oo(r,e,n,o){const t=ji,[f,i]=ur.useState(t(n)),a=ur.useRef(f);return ur.useEffect(()=>{const u=()=>{const c={...n,...r.getAttributes(e)};Object.keys(c).forEach(p=>{(c[p]===null||c[p]===void 0)&&(c[p]=n?n[p]:null)});const v=t(c);Bi(a.current,v)||(i(v),a.current=v)};return r.on("selectionUpdate",u),r.on("transaction",u),()=>{r.off("selectionUpdate",u),r.off("transaction",u)}},[r,n,e,t]),f}function Zt(r,e={}){if(typeof r=="object")return r;try{return JSON.parse(r)}catch{return e}}function Ti({node:r}){const{text:e,macros:n}=r.attrs,o=ur.useMemo(()=>{try{return Za.renderToString(decodeURIComponent(e||""),{macros:Zt(decodeURIComponent(n||""))})}catch{return e}},[e,n]),t=ur.useMemo(()=>e.trim()?Y.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:o}}):Y.jsx("span",{contentEditable:!1,children:"Not enter a formula"}),[e,o]);return Y.jsx(Fr.NodeViewWrapper,{as:"span",style:{display:"inline-block"},children:t})}function Mi(){const{t:r}=$o.useLocale(),[e,n]=ur.useState(!1),o=ae.useButtonProps(kt.name),{icon:t=void 0,tooltip:f=void 0,tooltipOptions:i={},isActive:a=void 0}=(o==null?void 0:o.componentProps)??{},{editorDisabled:u}=ae.useToggleActive(a),c=ae.useEditorInstance(),v=Oo(c,kt.name,{text:"",macros:""}),{text:p,macros:y}=v,[h,S]=ur.useState(decodeURIComponent(p||"")),[R,q]=ur.useState(decodeURIComponent(y||"")),w=ur.useCallback(()=>{c.chain().focus().setKatex({text:encodeURIComponent(h),macros:encodeURIComponent(R)}).run(),S(""),q(""),n(!1)},[c,h,R]),O=ur.useMemo(()=>{try{return Za.renderToString(h,{macros:Zt(R)})}catch{return h}},[R,h]),m=ur.useMemo(()=>`${h}`.trim()?O:null,[h,O]);return Y.jsxs(Cr.Dialog,{onOpenChange:n,open:e,children:[Y.jsx(Cr.DialogTrigger,{asChild:!0,disabled:u,children:Y.jsx(Ro.ActionButton,{disabled:u,icon:t,tooltip:f,tooltipOptions:i,action:()=>{u||n(!0)}})}),Y.jsxs(Cr.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[Y.jsx(Cr.DialogTitle,{children:r("editor.formula.dialog.text")}),Y.jsx("div",{style:{height:"100%",border:"1px solid hsl(var(--border))"},children:Y.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[Y.jsxs("div",{className:"richtext-flex-1",children:[Y.jsx(cn.Label,{className:"mb-[6px]",children:"Expression"}),Y.jsx(ln.Textarea,{autoFocus:!0,className:"richtext-mb-[10px]",onChange:j=>S(j.target.value),placeholder:"Text",required:!0,rows:10,value:h,style:{color:"hsl(var(--foreground))"}}),Y.jsx(cn.Label,{className:"mb-[6px]",children:"Macros"}),Y.jsx(ln.Textarea,{className:"richtext-flex-1",placeholder:"Macros",rows:10,value:R,onChange:j=>{q(j.target.value)},style:{color:"hsl(var(--foreground))"}})]}),Y.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:m||""},style:{height:"100%",borderWidth:1,minHeight:500,background:"#fff"}})]})}),Y.jsx(Cr.DialogFooter,{children:Y.jsx(xo.Button,{onClick:w,type:"button",children:"Save changes"})})]})]})}function Qa(r){return e=>e.getAttribute(r)}const kt=Fr.Node3.create({name:"katex",group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){return{HTMLAttributes:{class:"katex"},button:({t:r})=>({componentProps:{action:()=>!0,isActive:()=>!1,disabled:!1,icon:"KatexIcon",tooltip:r("editor.katex.tooltip")}})}},addAttributes(){return{text:{default:"",parseHTML:Qa("text")},macros:{default:"",parseHTML:Qa("macros")}}},parseHTML(){return[{tag:"span.katex"}]},renderHTML({HTMLAttributes:r}){return["span",Fr.mergeAttributes(this.options&&this.options.HTMLAttributes||{},r)]},addCommands(){return{setKatex:r=>({commands:e})=>e.insertContent({type:this.name,attrs:r})}},addInputRules(){return[Fr.nodeInputRule({find:/^\$katex\$$/,type:this.type})]},addNodeView(){return Fr.ReactNodeViewRenderer(Ti)}});exports.Katex=kt;exports.RichTextKatex=Mi;exports.safeJSONParse=Zt;exports.useAttributes=Oo;
@@ -1 +0,0 @@
1
- "use strict";const d=require("react/jsx-runtime"),m=require("react"),q=require("./index-C838s-or.cjs"),f=require("./index-FSRjMsxW.cjs"),y=require("./store-oDk-lTPM.cjs"),w=require("./events.constant-DQYeJpu5.cjs"),S=require("./label-E6jF3Xud.cjs"),E=require("./Icon-DXePECFW.cjs"),j={setOpen:(i,s)=>{w.dispatchEvent(w.EVENTS.UPLOAD_VIDEO(i),s)}};function D({t:i}){const s=[{name:"format",title:i("editor.slash.format"),commands:[]},{name:"insert",title:i("editor.slash.insert"),commands:[]}];return f.HEADINGS.forEach(e=>{s[0].commands.push({name:`heading${e}`,label:i(e==="Paragraph"?"editor.paragraph.tooltip":`editor.heading.h${e}.tooltip`),aliases:[`h${e}`,"bt",`bt${e}`],iconName:`Heading${e}`,isActive:t=>e==="Paragraph"?!1:t.isActive("heading",{level:e})||!1,action:({editor:t,range:l})=>{const a=f.HEADINGS.find(u=>t.isActive("heading",{level:u}));if(e==="Paragraph"){a!==void 0&&a!=="Paragraph"?(t.commands.toggleHeading({level:a}),t.chain().focus().deleteRange(l).run(),console.log("AAA")):t.chain().focus().deleteRange(l).run();return}if(e){t.chain().focus().deleteRange(l).setHeading({level:e}).run();return}t.chain().focus().deleteRange(l).run()}})}),s[0].commands.push({name:"bulletList",label:i("editor.bulletlist.tooltip"),aliases:["ul","yxlb"],iconName:"List",isActive:e=>e.isActive("bulletList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleBulletList().run()}}),s[0].commands.push({name:"orderedlist",label:i("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",isActive:e=>e.isActive("orderedList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleOrderedList().run()}}),s[0].commands.push({name:"taskList",label:i("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],isActive:e=>e.isActive("taskList"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).toggleTaskList().run()}}),s[0].commands.push({name:"blockquote",label:i("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",isActive:e=>e.isActive("blockquote"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setBlockquote().run()}}),s[0].commands.push({name:"codeBlock",label:i("editor.codeblock.tooltip"),iconName:"Code2",description:"Code block with syntax highlighting",shouldBeHidden:e=>e.isActive("columns"),isActive:e=>e.isActive("codeBlock"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setCodeBlock().run()}}),s[1].commands.push({name:"image",label:i("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).run(),y.actionDialogImage.setOpen(e.id,!0)}}),s[1].commands.push({name:"video",label:i("editor.video.tooltip"),iconName:"Video",description:"Insert a video",aliases:["video","sp","shipin"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).run(),j.setOpen(e.id,!0)}}),s[1].commands.push({name:"table",label:i("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}}),s[1].commands.push({name:"horizontalRule",label:i("editor.horizontalrule.tooltip"),iconName:"Minus",description:"Insert a horizontal divider",aliases:["hr","fgx","fg"],action:({editor:e,range:t})=>{e.chain().focus().deleteRange(t).setHorizontalRule().run()}}),s[1].commands.push({name:"columns",label:i("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",action:({editor:e})=>{e.chain().focus().insertColumns({cols:2}).run()}}),s}function C(i,s){return i.map(l=>({...l,commands:l.commands.filter(a=>{const u=a.label.toLowerCase().trim(),h=s.toLowerCase().trim();if(a.aliases){const b=a.aliases.map(x=>x.toLowerCase().trim()),r=u.match(h),g=b.some(x=>x.match(h));return r||g}return u.match(h)})})).filter(l=>l.commands.length>0)}const B=f.d([]);function N(){const[i,s]=f.x(B);return[i,s]}function $(i,s){const[e]=N(),[t,l]=m.useState(0),[a,u]=m.useState(0),h=m.useRef(null),{t:b}=f.useLocale(),r=C(e,i.query),g=m.useRef([]);m.useImperativeHandle(s,()=>({onKeyDown:x})),m.useEffect(()=>{if(!h.current)return;const o=a*1e3+t,n=g.current[o];n&&n.scrollIntoView({behavior:"smooth",block:"nearest"})},[t,a]);function x({event:o}){return o.key==="ArrowUp"?(A(),!0):o.key==="ArrowDown"?(L(),!0):o.key==="Enter"?(R(),!0):!1}function A(){var c;if(r.length===0)return!1;let o=t-1,n=a;o<0&&(n=a-1,o=((c=r[n])==null?void 0:c.commands.length)-1||0),n<0&&(n=r.length-1,o=r[n].commands.length-1),l(o),u(n)}function L(){if(r.length===0)return!1;const o=r[a].commands;let n=t+1,c=a;o.length-1<n&&(n=0,c=a+1),r.length-1<c&&(c=0),l(n),u(c)}function R(){if(r.length===0||a===-1||t===-1)return!1;v(a,t)}function v(o,n){const c=r[o].commands[n];i==null||i.command(c)}function I(o,n){v(o,n)}function k(o,n,c){g.current[o*1e3+n]=c}return d.jsx("div",{className:"richtext-max-h-[min(80vh,24rem)] richtext-flex-wrap richtext-overflow-y-auto richtext-overflow-x-hidden richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none","data-richtext-portal":!0,ref:h,children:r!=null&&r.length?d.jsx("div",{className:"richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5",children:r==null?void 0:r.map((o,n)=>d.jsxs(m.Fragment,{children:[d.jsx(S.Label,{className:"richtext-mx-[4px] richtext-mb-[4px] richtext-mt-[8px] !richtext-text-[0.65rem] richtext-uppercase ",children:o.title}),o.commands.map((c,p)=>d.jsxs("button",{onClick:()=>I(n,p),ref:H=>k(n,p,H),className:q.cn("richtext-flex richtext-items-center richtext-gap-3 richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-text-foreground richtext-text-left richtext-w-full richtext-rounded-sm !richtext-outline-none !richtext-border-none richtext-transition-colors !richtext-bg-transparent hover:!richtext-bg-accent ",{"bg-item-active":a===n&&t===p}),children:[c.iconUrl&&d.jsx("img",{alt:"",className:"richtext-size-6",src:c.iconUrl}),c.iconName&&d.jsx(E.IconComponent,{className:"!richtext-mr-1 !richtext-text-lg",name:c.iconName}),c.label]},`command-${p}`))]},`slash-${o.title}`))}):d.jsx("div",{className:"richtext-p-3",children:d.jsx("span",{className:"richtext-text-xs richtext-text-foreground",children:b("editor.slash.empty")})})})}const G=m.forwardRef($);exports.SlashCommandNodeView=G;exports.renderCommandListDefault=D;exports.useFilterCommandList=C;exports.useSignalCommandList=N;
@@ -1,9 +0,0 @@
1
- "use strict";const g=require("./index-BBNITgNi.cjs"),_e=require("@tiptap/pm/state"),D=require("./index--nUS7Y66.cjs"),A=require("react/jsx-runtime"),Ie=require("./index-C838s-or.cjs"),W=require("react"),v=require("./index-FSRjMsxW.cjs"),X=require("./popover-BSzR_R01.cjs"),Z=require("./useButtonProps-DfnJiJLV.cjs");let J,Y;if(typeof WeakMap<"u"){let t=new WeakMap;J=e=>t.get(e),Y=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;J=o=>{for(let l=0;l<t.length;l+=2)if(t[l]==o)return t[l+1]},Y=(o,l)=>(n==10&&(n=0),t[n++]=o,t[n++]=l)}var y=class{constructor(t,e,n,o){this.width=t,this.height=e,this.map=n,this.problems=o}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const o=e%this.width,l=e/this.width|0;let r=o+1,s=l+1;for(let i=1;r<this.width&&this.map[e+i]==n;i++)r++;for(let i=1;s<this.height&&this.map[e+this.width*i]==n;i++)s++;return{left:o,top:l,right:r,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:o,right:l,top:r,bottom:s}=this.findCell(t);return e=="horiz"?(n<0?o==0:l==this.width)?null:this.map[r*this.width+(n<0?o-1:l)]:(n<0?r==0:s==this.height)?null:this.map[o+this.width*(n<0?r-1:s)]}rectBetween(t,e){const{left:n,right:o,top:l,bottom:r}=this.findCell(t),{left:s,right:i,top:c,bottom:a}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(l,c),right:Math.max(o,i),bottom:Math.max(r,a)}}cellsInRect(t){const e=[],n={};for(let o=t.top;o<t.bottom;o++)for(let l=t.left;l<t.right;l++){const r=o*this.width+l,s=this.map[r];n[s]||(n[s]=!0,!(l==t.left&&l&&this.map[r-1]==s||o==t.top&&o&&this.map[r-this.width]==s)&&e.push(s))}return e}positionAt(t,e,n){for(let o=0,l=0;;o++){const r=l+n.child(o).nodeSize;if(o==t){let s=e+t*this.width;const i=(t+1)*this.width;for(;s<i&&this.map[s]<l;)s++;return s==i?r-1:this.map[s]}l=r}}static get(t){return J(t)||Y(t,Be(t))}};function Be(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=$e(t),n=t.childCount,o=[];let l=0,r=null;const s=[];for(let a=0,d=e*n;a<d;a++)o[a]=0;for(let a=0,d=0;a<n;a++){const u=t.child(a);d++;for(let p=0;;p++){for(;l<o.length&&o[l]!=0;)l++;if(p==u.childCount)break;const m=u.child(p),{colspan:b,rowspan:w,colwidth:x}=m.attrs;for(let R=0;R<w;R++){if(R+a>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:d,n:w-R});break}const L=l+R*e;for(let M=0;M<b;M++){o[L+M]==0?o[L+M]=d:(r||(r=[])).push({type:"collision",row:a,pos:d,n:b-M});const $=x&&x[M];if($){const I=(L+M)%e*2,q=s[I];q==null||q!=$&&s[I+1]==1?(s[I]=$,s[I+1]=1):q==$&&s[I+1]++}}}l+=b,d+=m.nodeSize}const f=(a+1)*e;let h=0;for(;l<f;)o[l++]==0&&h++;h&&(r||(r=[])).push({type:"missing",row:a,n:h}),d++}(e===0||n===0)&&(r||(r=[])).push({type:"zero_sized"});const i=new y(e,n,o,r);let c=!1;for(let a=0;!c&&a<s.length;a+=2)s[a]!=null&&s[a+1]<n&&(c=!0);return c&&We(i,s,t),i}function $e(t){let e=-1,n=!1;for(let o=0;o<t.childCount;o++){const l=t.child(o);let r=0;if(n)for(let s=0;s<o;s++){const i=t.child(s);for(let c=0;c<i.childCount;c++){const a=i.child(c);s+a.attrs.rowspan>o&&(r+=a.attrs.colspan)}}for(let s=0;s<l.childCount;s++){const i=l.child(s);r+=i.attrs.colspan,i.attrs.rowspan>1&&(n=!0)}e==-1?e=r:e!=r&&(e=Math.max(e,r))}return e}function We(t,e,n){t.problems||(t.problems=[]);const o={};for(let l=0;l<t.map.length;l++){const r=t.map[l];if(o[r])continue;o[r]=!0;const s=n.nodeAt(r);if(!s)throw new RangeError(`No cell with offset ${r} found`);let i=null;const c=s.attrs;for(let a=0;a<c.colspan;a++){const d=e[(l+a)%t.width*2];d!=null&&(!c.colwidth||c.colwidth[a]!=d)&&((i||(i=Fe(c)))[a]=d)}i&&t.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:i})}}function Fe(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function S(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const o=t.nodes[n],l=o.spec.tableRole;l&&(e[l]=o)}}return e}const z=new g.PluginKey("selectingCells");function _(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Pe(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function E(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function K(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=_(e.$head)||je(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function je(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const o=e.type.spec.tableRole;if(o=="cell"||o=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const o=e.type.spec.tableRole;if(o=="cell"||o=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Q(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function Oe(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function oe(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Se(t,e,n){const o=t.node(-1),l=y.get(o),r=t.start(-1),s=l.nextCell(t.pos-r,e,n);return s==null?null:t.node(0).resolve(r+s)}function H(t,e,n=1){const o={...t,colspan:t.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(e,n),o.colwidth.some(l=>l>0)||(o.colwidth=null)),o}function xe(t,e,n=1){const o={...t,colspan:t.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let l=0;l<n;l++)o.colwidth.splice(e,0,0)}return o}function Ge(t,e,n){const o=S(e.type.schema).header_cell;for(let l=0;l<t.height;l++)if(e.nodeAt(t.map[n+l*t.width]).type!=o)return!1;return!0}var C=class k extends g.Selection{constructor(e,n=e){const o=e.node(-1),l=y.get(o),r=e.start(-1),s=l.rectBetween(e.pos-r,n.pos-r),i=e.node(0),c=l.cellsInRect(s).filter(d=>d!=n.pos-r);c.unshift(n.pos-r);const a=c.map(d=>{const u=o.nodeAt(d);if(!u)throw new RangeError(`No cell with offset ${d} found`);const f=r+d+1;return new g.SelectionRange(i.resolve(f),i.resolve(f+u.content.size))});super(a[0].$from,a[0].$to,a),this.$anchorCell=e,this.$headCell=n}map(e,n){const o=e.resolve(n.map(this.$anchorCell.pos)),l=e.resolve(n.map(this.$headCell.pos));if(Q(o)&&Q(l)&&oe(o,l)){const r=this.$anchorCell.node(-1)!=o.node(-1);return r&&this.isRowSelection()?k.rowSelection(o,l):r&&this.isColSelection()?k.colSelection(o,l):new k(o,l)}return g.TextSelection.between(o,l)}content(){const e=this.$anchorCell.node(-1),n=y.get(e),o=this.$anchorCell.start(-1),l=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),r={},s=[];for(let c=l.top;c<l.bottom;c++){const a=[];for(let d=c*n.width+l.left,u=l.left;u<l.right;u++,d++){const f=n.map[d];if(r[f])continue;r[f]=!0;const h=n.findCell(f);let p=e.nodeAt(f);if(!p)throw new RangeError(`No cell with offset ${f} found`);const m=l.left-h.left,b=h.right-l.right;if(m>0||b>0){let w=p.attrs;if(m>0&&(w=H(w,0,m)),b>0&&(w=H(w,w.colspan-b,b)),h.left<l.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(h.top<l.top||h.bottom>l.bottom){const w={...p.attrs,rowspan:Math.min(h.bottom,l.bottom)-Math.max(h.top,l.top)};h.top<l.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}a.push(p)}s.push(e.child(c).copy(g.Fragment.from(a)))}const i=this.isColSelection()&&this.isRowSelection()?e:s;return new g.Slice(g.Fragment.from(i),1,1)}replace(e,n=g.Slice.empty){const o=e.steps.length,l=this.ranges;for(let s=0;s<l.length;s++){const{$from:i,$to:c}=l[s],a=e.mapping.slice(o);e.replace(a.map(i.pos),a.map(c.pos),s?g.Slice.empty:n)}const r=g.Selection.findFrom(e.doc.resolve(e.mapping.slice(o).map(this.to)),-1);r&&e.setSelection(r)}replaceWith(e,n){this.replace(e,new g.Slice(g.Fragment.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),o=y.get(n),l=this.$anchorCell.start(-1),r=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l));for(let s=0;s<r.length;s++)e(n.nodeAt(r[s]),l+r[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const o=e+this.$anchorCell.nodeAfter.attrs.rowspan,l=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,l)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const o=e.node(-1),l=y.get(o),r=e.start(-1),s=l.findCell(e.pos-r),i=l.findCell(n.pos-r),c=e.node(0);return s.top<=i.top?(s.top>0&&(e=c.resolve(r+l.map[s.left])),i.bottom<l.height&&(n=c.resolve(r+l.map[l.width*(l.height-1)+i.right-1]))):(i.top>0&&(n=c.resolve(r+l.map[i.left])),s.bottom<l.height&&(e=c.resolve(r+l.map[l.width*(l.height-1)+s.right-1]))),new k(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=y.get(e),o=this.$anchorCell.start(-1),l=n.colCount(this.$anchorCell.pos-o),r=n.colCount(this.$headCell.pos-o);if(Math.min(l,r)>0)return!1;const s=l+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,i)==n.width}eq(e){return e instanceof k&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const o=e.node(-1),l=y.get(o),r=e.start(-1),s=l.findCell(e.pos-r),i=l.findCell(n.pos-r),c=e.node(0);return s.left<=i.left?(s.left>0&&(e=c.resolve(r+l.map[s.top*l.width])),i.right<l.width&&(n=c.resolve(r+l.map[l.width*(i.top+1)-1]))):(i.left>0&&(n=c.resolve(r+l.map[i.top*l.width])),s.right<l.width&&(e=c.resolve(r+l.map[l.width*(s.top+1)-1]))),new k(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new k(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,o=n){return new k(e.resolve(n),e.resolve(o))}getBookmark(){return new Ve(this.$anchorCell.pos,this.$headCell.pos)}};C.prototype.visible=!1;g.Selection.jsonID("cell",C);var Ve=class Ae{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ae(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),o=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&oe(n,o)?new C(n,o):g.Selection.near(o,1)}};function Ke(t){if(!(t.selection instanceof C))return null;const e=[];return t.selection.forEachCell((n,o)=>{e.push(D.Decoration.node(o,o+n.nodeSize,{class:"selectedCell"}))}),D.DecorationSet.create(t.doc,e)}function qe({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,o=e.pos,l=t.depth;for(;l>=0&&!(t.after(l+1)<t.end(l));l--,n++);for(let r=e.depth;r>=0&&!(e.before(r+1)>e.start(r));r--,o--);return n==o&&/row|table/.test(t.node(l).type.spec.tableRole)}function Xe({$from:t,$to:e}){let n,o;for(let l=t.depth;l>0;l--){const r=t.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){n=r;break}}for(let l=e.depth;l>0;l--){const r=e.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){o=r;break}}return n!==o&&e.parentOffset===0}function Ze(t,e,n){const o=(e||t).selection,l=(e||t).doc;let r,s;if(o instanceof g.NodeSelection&&(s=o.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")r=C.create(l,o.from);else if(s=="row"){const i=l.resolve(o.from+1);r=C.rowSelection(i,i)}else if(!n){const i=y.get(o.node),c=o.from+1,a=c+i.map[i.width*i.height-1];r=C.create(l,c+1,a)}}else o instanceof g.TextSelection&&qe(o)?r=g.TextSelection.create(l,o.from):o instanceof g.TextSelection&&Xe(o)&&(r=g.TextSelection.create(l,o.$from.start(),o.$from.end()));return r&&(e||(e=t.tr)).setSelection(r),e}const Ue=new g.PluginKey("fix-tables");function Te(t,e,n,o){const l=t.childCount,r=e.childCount;e:for(let s=0,i=0;s<r;s++){const c=e.child(s);for(let a=i,d=Math.min(l,s+3);a<d;a++)if(t.child(a)==c){i=a+1,n+=c.nodeSize;continue e}o(c,n),i<l&&t.child(i).sameMarkup(c)?Te(t.child(i),c,n+1,o):c.nodesBetween(0,c.content.size,o,n+1),n+=c.nodeSize}}function Re(t,e){let n;const o=(l,r)=>{l.type.spec.tableRole=="table"&&(n=Je(t,l,r,n))};return e?e.doc!=t.doc&&Te(e.doc,t.doc,0,o):t.doc.descendants(o),n}function Je(t,e,n,o){const l=y.get(e);if(!l.problems)return o;o||(o=t.tr);const r=[];for(let c=0;c<l.height;c++)r.push(0);for(let c=0;c<l.problems.length;c++){const a=l.problems[c];if(a.type=="collision"){const d=e.nodeAt(a.pos);if(!d)continue;const u=d.attrs;for(let f=0;f<u.rowspan;f++)r[a.row+f]+=a.n;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,H(u,u.colspan-a.n,a.n))}else if(a.type=="missing")r[a.row]+=a.n;else if(a.type=="overlong_rowspan"){const d=e.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-a.n})}else if(a.type=="colwidth mismatch"){const d=e.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,colwidth:a.colwidth})}else if(a.type=="zero_sized"){const d=o.mapping.map(n);o.delete(d,d+e.nodeSize)}}let s,i;for(let c=0;c<r.length;c++)r[c]&&(s==null&&(s=c),i=c);for(let c=0,a=n+1;c<l.height;c++){const d=e.child(c),u=a+d.nodeSize,f=r[c];if(f>0){let h="cell";d.firstChild&&(h=d.firstChild.type.spec.tableRole);const p=[];for(let b=0;b<f;b++){const w=S(t.schema)[h].createAndFill();w&&p.push(w)}const m=(c==0||s==c-1)&&i==c?a+1:u-1;o.insert(o.mapping.map(m),p)}a=u}return o.setMeta(Ue,{fixTables:!0})}function N(t){const e=t.selection,n=K(t),o=n.node(-1),l=n.start(-1),r=y.get(o);return{...e instanceof C?r.rectBetween(e.$anchorCell.pos-l,e.$headCell.pos-l):r.findCell(n.pos-l),tableStart:l,map:r,table:o}}function ve(t,{map:e,tableStart:n,table:o},l){let r=l>0?-1:0;Ge(e,o,l+r)&&(r=l==0||l==e.width?null:0);for(let s=0;s<e.height;s++){const i=s*e.width+l;if(l>0&&l<e.width&&e.map[i-1]==e.map[i]){const c=e.map[i],a=o.nodeAt(c);t.setNodeMarkup(t.mapping.map(n+c),null,xe(a.attrs,l-e.colCount(c))),s+=a.attrs.rowspan-1}else{const c=r==null?S(o.type.schema).cell:o.nodeAt(e.map[i+r]).type,a=e.positionAt(s,l,o);t.insert(t.mapping.map(n+a),c.createAndFill())}}return t}function Ye(t,e){if(!E(t))return!1;if(e){const n=N(t);e(ve(t.tr,n,n.left))}return!0}function Qe(t,e){if(!E(t))return!1;if(e){const n=N(t);e(ve(t.tr,n,n.right))}return!0}function et(t,{map:e,table:n,tableStart:o},l){const r=t.mapping.maps.length;for(let s=0;s<e.height;){const i=s*e.width+l,c=e.map[i],a=n.nodeAt(c),d=a.attrs;if(l>0&&e.map[i-1]==c||l<e.width-1&&e.map[i+1]==c)t.setNodeMarkup(t.mapping.slice(r).map(o+c),null,H(d,l-e.colCount(c)));else{const u=t.mapping.slice(r).map(o+c);t.delete(u,u+a.nodeSize)}s+=d.rowspan}}function tt(t,e){if(!E(t))return!1;if(e){const n=N(t),o=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let l=n.right-1;et(o,n,l),l!=n.left;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=y.get(r)}e(o)}return!0}function nt(t,e,n){var o;const l=S(e.type.schema).header_cell;for(let r=0;r<t.width;r++)if(((o=e.nodeAt(t.map[r+n*t.width]))===null||o===void 0?void 0:o.type)!=l)return!1;return!0}function Me(t,{map:e,tableStart:n,table:o},l){let r=n;for(let a=0;a<l;a++)r+=o.child(a).nodeSize;const s=[];let i=l>0?-1:0;nt(e,o,l+i)&&(i=l==0||l==e.height?null:0);for(let a=0,d=e.width*l;a<e.width;a++,d++)if(l>0&&l<e.height&&e.map[d]==e.map[d-e.width]){const u=e.map[d],f=o.nodeAt(u).attrs;t.setNodeMarkup(n+u,null,{...f,rowspan:f.rowspan+1}),a+=f.colspan-1}else{var c;const u=i==null?S(o.type.schema).cell:(c=o.nodeAt(e.map[d+i*e.width]))===null||c===void 0?void 0:c.type,f=u==null?void 0:u.createAndFill();f&&s.push(f)}return t.insert(r,S(o.type.schema).row.create(null,s)),t}function ot(t,e){if(!E(t))return!1;if(e){const n=N(t);e(Me(t.tr,n,n.top))}return!0}function lt(t,e){if(!E(t))return!1;if(e){const n=N(t);e(Me(t.tr,n,n.bottom))}return!0}function rt(t,{map:e,table:n,tableStart:o},l){let r=0;for(let a=0;a<l;a++)r+=n.child(a).nodeSize;const s=r+n.child(l).nodeSize,i=t.mapping.maps.length;t.delete(r+o,s+o);const c=new Set;for(let a=0,d=l*e.width;a<e.width;a++,d++){const u=e.map[d];if(!c.has(u)){if(c.add(u),l>0&&u==e.map[d-e.width]){const f=n.nodeAt(u).attrs;t.setNodeMarkup(t.mapping.slice(i).map(u+o),null,{...f,rowspan:f.rowspan-1}),a+=f.colspan-1}else if(l<e.height&&u==e.map[d+e.width]){const f=n.nodeAt(u),h=f.attrs,p=f.type.create({...h,rowspan:f.attrs.rowspan-1},f.content),m=e.positionAt(l+1,a,n);t.insert(t.mapping.slice(i).map(o+m),p),a+=h.colspan-1}}}}function st(t,e){if(!E(t))return!1;if(e){const n=N(t),o=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let l=n.bottom-1;rt(o,n,l),l!=n.top;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=y.get(n.table)}e(o)}return!0}function le(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function it({width:t,height:e,map:n},o){let l=o.top*t+o.left,r=l,s=(o.bottom-1)*t+o.left,i=l+(o.right-o.left-1);for(let c=o.top;c<o.bottom;c++){if(o.left>0&&n[r]==n[r-1]||o.right<t&&n[i]==n[i+1])return!0;r+=t,i+=t}for(let c=o.left;c<o.right;c++){if(o.top>0&&n[l]==n[l-t]||o.bottom<e&&n[s]==n[s+t])return!0;l++,s++}return!1}function re(t,e){const n=t.selection;if(!(n instanceof C)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=N(t),{map:l}=o;if(it(l,o))return!1;if(e){const r=t.tr,s={};let i=g.Fragment.empty,c,a;for(let d=o.top;d<o.bottom;d++)for(let u=o.left;u<o.right;u++){const f=l.map[d*l.width+u],h=o.table.nodeAt(f);if(!(s[f]||!h))if(s[f]=!0,c==null)c=f,a=h;else{le(h)||(i=i.append(h.content));const p=r.mapping.map(f+o.tableStart);r.delete(p,p+h.nodeSize)}}if(c==null||a==null)return!0;if(r.setNodeMarkup(c+o.tableStart,null,{...xe(a.attrs,a.attrs.colspan,o.right-o.left-a.attrs.colspan),rowspan:o.bottom-o.top}),i.size>0){const d=c+1+a.content.size,u=le(a)?c+1:d;r.replaceWith(u+o.tableStart,d+o.tableStart,i)}r.setSelection(new C(r.doc.resolve(c+o.tableStart))),e(r)}return!0}function se(t,e){const n=S(t.schema);return ct(({node:o})=>n[o.type.spec.tableRole])(t,e)}function ct(t){return(e,n)=>{const o=e.selection;let l,r;if(o instanceof C){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;l=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{var s;if(l=Pe(o.$from),!l)return!1;r=(s=_(o.$from))===null||s===void 0?void 0:s.pos}if(l==null||r==null||l.attrs.colspan==1&&l.attrs.rowspan==1)return!1;if(n){let i=l.attrs;const c=[],a=i.colwidth;i.rowspan>1&&(i={...i,rowspan:1}),i.colspan>1&&(i={...i,colspan:1});const d=N(e),u=e.tr;for(let h=0;h<d.right-d.left;h++)c.push(a?{...i,colwidth:a&&a[h]?[a[h]]:null}:i);let f;for(let h=d.top;h<d.bottom;h++){let p=d.map.positionAt(h,d.left,d.table);h==d.top&&(p+=l.nodeSize);for(let m=d.left,b=0;m<d.right;m++,b++)m==d.left&&h==d.top||u.insert(f=u.mapping.map(p+d.tableStart,1),t({node:l,row:h,col:m}).createAndFill(c[b]))}u.setNodeMarkup(r,t({node:l,row:d.top,col:d.left}),c[0]),o instanceof C&&u.setSelection(new C(u.doc.resolve(o.$anchorCell.pos),f?u.doc.resolve(f):void 0)),n(u)}return!0}}function at(t,e){return function(n,o){if(!E(n))return!1;const l=K(n);if(l.nodeAfter.attrs[t]===e)return!1;if(o){const r=n.tr;n.selection instanceof C?n.selection.forEachCell((s,i)=>{s.attrs[t]!==e&&r.setNodeMarkup(i,null,{...s.attrs,[t]:e})}):r.setNodeMarkup(l.pos,null,{...l.nodeAfter.attrs,[t]:e}),o(r)}return!0}}function dt(t){return function(e,n){if(!E(e))return!1;if(n){const o=S(e.schema),l=N(e),r=e.tr,s=l.map.cellsInRect(t=="column"?{left:l.left,top:0,right:l.right,bottom:l.map.height}:t=="row"?{left:0,top:l.top,right:l.map.width,bottom:l.bottom}:l),i=s.map(c=>l.table.nodeAt(c));for(let c=0;c<s.length;c++)i[c].type==o.header_cell&&r.setNodeMarkup(l.tableStart+s[c],o.cell,i[c].attrs);if(r.steps.length===0)for(let c=0;c<s.length;c++)r.setNodeMarkup(l.tableStart+s[c],o.header_cell,i[c].attrs);n(r)}return!0}}function ie(t,e,n){const o=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let l=0;l<o.length;l++){const r=e.table.nodeAt(o[l]);if(r&&r.type!==n.header_cell)return!1}return!0}function B(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?dt(t):function(n,o){if(!E(n))return!1;if(o){const l=S(n.schema),r=N(n),s=n.tr,i=ie("row",r,l),c=ie("column",r,l),a=(t==="column"?i:t==="row"&&c)?1:0,d=t=="column"?{left:0,top:a,right:1,bottom:r.map.height}:t=="row"?{left:a,top:0,right:r.map.width,bottom:1}:r,u=t=="column"?c?l.cell:l.header_cell:t=="row"?i?l.cell:l.header_cell:l.cell;r.map.cellsInRect(d).forEach(f=>{const h=f+r.tableStart,p=s.doc.nodeAt(h);p&&s.setNodeMarkup(h,u,p.attrs)}),o(s)}return!0}}B("row",{useDeprecatedLogic:!0});B("column",{useDeprecatedLogic:!0});const ut=B("cell",{useDeprecatedLogic:!0});function ft(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let o=t.index(-1)-1,l=t.before();o>=0;o--){const r=t.node(-1).child(o),s=r.lastChild;if(s)return l-1-s.nodeSize;l-=r.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let o=t.indexAfter(-1),l=t.after();o<n.childCount;o++){const r=n.child(o);if(r.childCount)return l+1;l+=r.nodeSize}}return null}function ce(t){return function(e,n){if(!E(e))return!1;const o=ft(K(e),t);if(o==null)return!1;if(n){const l=e.doc.resolve(o);n(e.tr.setSelection(g.TextSelection.between(l,Oe(l))).scrollIntoView())}return!0}}function ht(t,e){const n=t.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function F(t,e){const n=t.selection;if(!(n instanceof C))return!1;if(e){const o=t.tr,l=S(t.schema).cell.createAndFill().content;n.forEachCell((r,s)=>{r.content.eq(l)||o.replace(o.mapping.map(s+1),o.mapping.map(s+r.nodeSize-1),new g.Slice(l,0,0))}),o.docChanged&&e(o)}return!0}function pt(t){if(t.size===0)return null;let{content:e,openStart:n,openEnd:o}=t;for(;e.childCount==1&&(n>0&&o>0||e.child(0).type.spec.tableRole=="table");)n--,o--,e=e.child(0).content;const l=e.child(0),r=l.type.spec.tableRole,s=l.type.schema,i=[];if(r=="row")for(let c=0;c<e.childCount;c++){let a=e.child(c).content;const d=c?0:Math.max(0,n-1),u=c<e.childCount-1?0:Math.max(0,o-1);(d||u)&&(a=ee(S(s).row,new g.Slice(a,d,u)).content),i.push(a)}else if(r=="cell"||r=="header_cell")i.push(n||o?ee(S(s).row,new g.Slice(e,n,o)).content:e);else return null;return mt(s,i)}function mt(t,e){const n=[];for(let l=0;l<e.length;l++){const r=e[l];for(let s=r.childCount-1;s>=0;s--){const{rowspan:i,colspan:c}=r.child(s).attrs;for(let a=l;a<l+i;a++)n[a]=(n[a]||0)+c}}let o=0;for(let l=0;l<n.length;l++)o=Math.max(o,n[l]);for(let l=0;l<n.length;l++)if(l>=e.length&&e.push(g.Fragment.empty),n[l]<o){const r=S(t).cell.createAndFill(),s=[];for(let i=n[l];i<o;i++)s.push(r);e[l]=e[l].append(g.Fragment.from(s))}return{height:e.length,width:o,rows:e}}function ee(t,e){const n=t.createAndFill();return new g.Transform(n).replace(0,n.content.size,e).doc}function gt({width:t,height:e,rows:n},o,l){if(t!=o){const r=[],s=[];for(let i=0;i<n.length;i++){const c=n[i],a=[];for(let d=r[i]||0,u=0;d<o;u++){let f=c.child(u%c.childCount);d+f.attrs.colspan>o&&(f=f.type.createChecked(H(f.attrs,f.attrs.colspan,d+f.attrs.colspan-o),f.content)),a.push(f),d+=f.attrs.colspan;for(let h=1;h<f.attrs.rowspan;h++)r[i+h]=(r[i+h]||0)+f.attrs.colspan}s.push(g.Fragment.from(a))}n=s,t=o}if(e!=l){const r=[];for(let s=0,i=0;s<l;s++,i++){const c=[],a=n[i%e];for(let d=0;d<a.childCount;d++){let u=a.child(d);s+u.attrs.rowspan>l&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,l-u.attrs.rowspan)},u.content)),c.push(u)}r.push(g.Fragment.from(c))}n=r,e=l}return{width:t,height:e,rows:n}}function bt(t,e,n,o,l,r,s){const i=t.doc.type.schema,c=S(i);let a,d;if(l>e.width)for(let u=0,f=0;u<e.height;u++){const h=n.child(u);f+=h.nodeSize;const p=[];let m;h.lastChild==null||h.lastChild.type==c.cell?m=a||(a=c.cell.createAndFill()):m=d||(d=c.header_cell.createAndFill());for(let b=e.width;b<l;b++)p.push(m);t.insert(t.mapping.slice(s).map(f-1+o),p)}if(r>e.height){const u=[];for(let p=0,m=(e.height-1)*e.width;p<Math.max(e.width,l);p++){const b=p>=e.width?!1:n.nodeAt(e.map[m+p]).type==c.header_cell;u.push(b?d||(d=c.header_cell.createAndFill()):a||(a=c.cell.createAndFill()))}const f=c.row.create(null,g.Fragment.from(u)),h=[];for(let p=e.height;p<r;p++)h.push(f);t.insert(t.mapping.slice(s).map(o+n.nodeSize-2),h)}return!!(a||d)}function ae(t,e,n,o,l,r,s,i){if(s==0||s==e.height)return!1;let c=!1;for(let a=l;a<r;a++){const d=s*e.width+a,u=e.map[d];if(e.map[d-e.width]==u){c=!0;const f=n.nodeAt(u),{top:h,left:p}=e.findCell(u);t.setNodeMarkup(t.mapping.slice(i).map(u+o),null,{...f.attrs,rowspan:s-h}),t.insert(t.mapping.slice(i).map(e.positionAt(s,p,n)),f.type.createAndFill({...f.attrs,rowspan:h+f.attrs.rowspan-s})),a+=f.attrs.colspan-1}}return c}function de(t,e,n,o,l,r,s,i){if(s==0||s==e.width)return!1;let c=!1;for(let a=l;a<r;a++){const d=a*e.width+s,u=e.map[d];if(e.map[d-1]==u){c=!0;const f=n.nodeAt(u),h=e.colCount(u),p=t.mapping.slice(i).map(u+o);t.setNodeMarkup(p,null,H(f.attrs,s-h,f.attrs.colspan-(s-h))),t.insert(p+f.nodeSize,f.type.createAndFill(H(f.attrs,0,s-h))),a+=f.attrs.rowspan-1}}return c}function ue(t,e,n,o,l){let r=n?t.doc.nodeAt(n-1):t.doc;if(!r)throw new Error("No table found");let s=y.get(r);const{top:i,left:c}=o,a=c+l.width,d=i+l.height,u=t.tr;let f=0;function h(){if(r=n?u.doc.nodeAt(n-1):u.doc,!r)throw new Error("No table found");s=y.get(r),f=u.mapping.maps.length}bt(u,s,r,n,a,d,f)&&h(),ae(u,s,r,n,c,a,i,f)&&h(),ae(u,s,r,n,c,a,d,f)&&h(),de(u,s,r,n,i,d,c,f)&&h(),de(u,s,r,n,i,d,a,f)&&h();for(let p=i;p<d;p++){const m=s.positionAt(p,c,r),b=s.positionAt(p,a,r);u.replace(u.mapping.slice(f).map(m+n),u.mapping.slice(f).map(b+n),new g.Slice(l.rows[p-i],0,0))}h(),u.setSelection(new C(u.doc.resolve(n+s.positionAt(i,c,r)),u.doc.resolve(n+s.positionAt(d-1,a-1,r)))),e(u)}const wt=D.keydownHandler({ArrowLeft:P("horiz",-1),ArrowRight:P("horiz",1),ArrowUp:P("vert",-1),ArrowDown:P("vert",1),"Shift-ArrowLeft":j("horiz",-1),"Shift-ArrowRight":j("horiz",1),"Shift-ArrowUp":j("vert",-1),"Shift-ArrowDown":j("vert",1),Backspace:F,"Mod-Backspace":F,Delete:F,"Mod-Delete":F});function G(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function P(t,e){return(n,o,l)=>{if(!l)return!1;const r=n.selection;if(r instanceof C)return G(n,o,g.Selection.near(r.$headCell,e));if(t!="horiz"&&!r.empty)return!1;const s=Ee(l,t,e);if(s==null)return!1;if(t=="horiz")return G(n,o,g.Selection.near(n.doc.resolve(r.head+e),e));{const i=n.doc.resolve(s),c=Se(i,t,e);let a;return c?a=g.Selection.near(c,1):e<0?a=g.Selection.near(n.doc.resolve(i.before(-1)),-1):a=g.Selection.near(n.doc.resolve(i.after(-1)),1),G(n,o,a)}}}function j(t,e){return(n,o,l)=>{if(!l)return!1;const r=n.selection;let s;if(r instanceof C)s=r;else{const c=Ee(l,t,e);if(c==null)return!1;s=new C(n.doc.resolve(c))}const i=Se(s.$headCell,t,e);return i?G(n,o,new C(s.$anchorCell,i)):!1}}function Ct(t,e){const n=t.state.doc,o=_(n.resolve(e));return o?(t.dispatch(t.state.tr.setSelection(new C(o))),!0):!1}function yt(t,e,n){if(!E(t.state))return!1;let o=pt(n);const l=t.state.selection;if(l instanceof C){o||(o={width:1,height:1,rows:[g.Fragment.from(ee(S(t.state.schema).cell,n))]});const r=l.$anchorCell.node(-1),s=l.$anchorCell.start(-1),i=y.get(r).rectBetween(l.$anchorCell.pos-s,l.$headCell.pos-s);return o=gt(o,i.right-i.left,i.bottom-i.top),ue(t.state,t.dispatch,s,i,o),!0}else if(o){const r=K(t.state),s=r.start(-1);return ue(t.state,t.dispatch,s,y.get(r.node(-1)).findCell(r.pos-s),o),!0}else return!1}function St(t,e){var n;if(e.ctrlKey||e.metaKey)return;const o=fe(t,e.target);let l;if(e.shiftKey&&t.state.selection instanceof C)r(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&o&&(l=_(t.state.selection.$anchor))!=null&&((n=U(t,e))===null||n===void 0?void 0:n.pos)!=l.pos)r(l,e),e.preventDefault();else if(!o)return;function r(c,a){let d=U(t,a);const u=z.getState(t.state)==null;if(!d||!oe(c,d))if(u)d=c;else return;const f=new C(c,d);if(u||!t.state.selection.eq(f)){const h=t.state.tr.setSelection(f);u&&h.setMeta(z,c.pos),t.dispatch(h)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",i),z.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(z,-1))}function i(c){const a=c,d=z.getState(t.state);let u;if(d!=null)u=t.state.doc.resolve(d);else if(fe(t,a.target)!=o&&(u=U(t,e),!u))return s();u&&r(u,a)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",i)}function Ee(t,e,n){if(!(t.state.selection instanceof g.TextSelection))return null;const{$head:o}=t.state.selection;for(let l=o.depth-1;l>=0;l--){const r=o.node(l);if((n<0?o.index(l):o.indexAfter(l))!=(n<0?0:r.childCount))return null;if(r.type.spec.tableRole=="cell"||r.type.spec.tableRole=="header_cell"){const s=o.before(l),i=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(i)?s:null}}return null}function fe(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function U(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return null;const o=n.inside>=0?n.inside:n.pos;return _(t.state.doc.resolve(o))}var xt=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),te(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,te(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function te(t,e,n,o,l,r){let s=0,i=!0,c=e.firstChild;const a=t.firstChild;if(a){for(let u=0,f=0;u<a.childCount;u++){const{colspan:h,colwidth:p}=a.child(u).attrs;for(let m=0;m<h;m++,f++){const b=l==f?r:p&&p[m],w=b?b+"px":"";if(s+=b||o,b||(i=!1),c)c.style.width!=w&&(c.style.width=w),c=c.nextSibling;else{const x=document.createElement("col");x.style.width=w,e.appendChild(x)}}}for(;c;){var d;const u=c.nextSibling;(d=c.parentNode)===null||d===void 0||d.removeChild(c),c=u}i?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const T=new g.PluginKey("tableColumnResizing");function At({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:o=xt,lastColumnResizable:l=!0}={}){const r=new g.Plugin({key:T,state:{init(s,i){var c;const a=(c=r.spec)===null||c===void 0||(c=c.props)===null||c===void 0?void 0:c.nodeViews,d=S(i.schema).table.name;return o&&a&&(a[d]=(u,f)=>new o(u,n,f)),new Tt(-1,!1)},apply(s,i){return i.apply(s)}},props:{attributes:s=>{const i=T.getState(s);return i&&i.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,i)=>{Rt(s,i,t,l)},mouseleave:s=>{vt(s)},mousedown:(s,i)=>{Mt(s,i,e,n)}},decorations:s=>{const i=T.getState(s);if(i&&i.activeHandle>-1)return zt(s,i.activeHandle)},nodeViews:{}}});return r}var Tt=class V{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,o=e.getMeta(T);if(o&&o.setHandle!=null)return new V(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new V(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&e.docChanged){let l=e.mapping.map(n.activeHandle,-1);return Q(e.doc.resolve(l))||(l=-1),new V(l,n.dragging)}return n}};function Rt(t,e,n,o){if(!t.editable)return;const l=T.getState(t.state);if(l&&!l.dragging){const r=Nt(e.target);let s=-1;if(r){const{left:i,right:c}=r.getBoundingClientRect();e.clientX-i<=n?s=he(t,e,"left",n):c-e.clientX<=n&&(s=he(t,e,"right",n))}if(s!=l.activeHandle){if(!o&&s!==-1){const i=t.state.doc.resolve(s),c=i.node(-1),a=y.get(c),d=i.start(-1);if(a.colCount(i.pos-d)+i.nodeAfter.attrs.colspan-1==a.width-1)return}Ne(t,s)}}}function vt(t){if(!t.editable)return;const e=T.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Ne(t,-1)}function Mt(t,e,n,o){var l;if(!t.editable)return!1;const r=(l=t.dom.ownerDocument.defaultView)!==null&&l!==void 0?l:window,s=T.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const i=t.state.doc.nodeAt(s.activeHandle),c=Et(t,s.activeHandle,i.attrs);t.dispatch(t.state.tr.setMeta(T,{setDragging:{startX:e.clientX,startWidth:c}}));function a(u){r.removeEventListener("mouseup",a),r.removeEventListener("mousemove",d);const f=T.getState(t.state);f!=null&&f.dragging&&(kt(t,f.activeHandle,pe(f.dragging,u,n)),t.dispatch(t.state.tr.setMeta(T,{setDragging:null})))}function d(u){if(!u.which)return a(u);const f=T.getState(t.state);if(f&&f.dragging){const h=pe(f.dragging,u,n);me(t,f.activeHandle,h,o)}}return me(t,s.activeHandle,c,o),r.addEventListener("mouseup",a),r.addEventListener("mousemove",d),e.preventDefault(),!0}function Et(t,e,{colspan:n,colwidth:o}){const l=o&&o[o.length-1];if(l)return l;const r=t.domAtPos(e);let s=r.node.childNodes[r.offset].offsetWidth,i=n;if(o)for(let c=0;c<n;c++)o[c]&&(s-=o[c],i--);return s/i}function Nt(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function he(t,e,n,o){const l=n=="right"?-o:o,r=t.posAtCoords({left:e.clientX+l,top:e.clientY});if(!r)return-1;const{pos:s}=r,i=_(t.state.doc.resolve(s));if(!i)return-1;if(n=="right")return i.pos;const c=y.get(i.node(-1)),a=i.start(-1),d=c.map.indexOf(i.pos-a);return d%c.width==0?-1:a+c.map[d-1]}function pe(t,e,n){const o=e.clientX-t.startX;return Math.max(n,t.startWidth+o)}function Ne(t,e){t.dispatch(t.state.tr.setMeta(T,{setHandle:e}))}function kt(t,e,n){const o=t.state.doc.resolve(e),l=o.node(-1),r=y.get(l),s=o.start(-1),i=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,c=t.state.tr;for(let a=0;a<r.height;a++){const d=a*r.width+i;if(a&&r.map[d]==r.map[d-r.width])continue;const u=r.map[d],f=l.nodeAt(u).attrs,h=f.colspan==1?0:i-r.colCount(u);if(f.colwidth&&f.colwidth[h]==n)continue;const p=f.colwidth?f.colwidth.slice():Lt(f.colspan);p[h]=n,c.setNodeMarkup(s+u,null,{...f,colwidth:p})}c.docChanged&&t.dispatch(c)}function me(t,e,n,o){const l=t.state.doc.resolve(e),r=l.node(-1),s=l.start(-1),i=y.get(r).colCount(l.pos-s)+l.nodeAfter.attrs.colspan-1;let c=t.domAtPos(l.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&te(r,c.firstChild,c,o,i,n)}function Lt(t){return Array(t).fill(0)}function zt(t,e){const n=[],o=t.doc.resolve(e),l=o.node(-1);if(!l)return D.DecorationSet.empty;const r=y.get(l),s=o.start(-1),i=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let a=0;a<r.height;a++){const d=i+a*r.width;if((i==r.width-1||r.map[d]!=r.map[d+1])&&(a==0||r.map[d]!=r.map[d-r.width])){var c;const u=r.map[d],f=s+u+l.nodeAt(u).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",!((c=T.getState(t))===null||c===void 0)&&c.dragging&&n.push(D.Decoration.node(s+u,s+u+l.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(D.Decoration.widget(f,h))}}return D.DecorationSet.create(t.doc,n)}function Dt({allowTableNodeSelection:t=!1}={}){return new g.Plugin({key:z,state:{init(){return null},apply(e,n){const o=e.getMeta(z);if(o!=null)return o==-1?null:o;if(n==null||!e.docChanged)return n;const{deleted:l,pos:r}=e.mapping.mapResult(n);return l?null:r}},props:{decorations:Ke,handleDOMEvents:{mousedown:St},createSelectionBetween(e){return z.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Ct,handleKeyDown:wt,handlePaste:yt},appendTransaction(e,n,o){return Ze(o,Re(o,n),t)}})}var ke=g.Node3.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{var e,n;const o=t.getAttribute("colwidth"),l=o?o.split(",").map(r=>parseInt(r,10)):null;if(!l){const r=(e=t.closest("table"))==null?void 0:e.querySelectorAll("colgroup > col"),s=Array.from(((n=t.parentElement)==null?void 0:n.children)||[]).indexOf(t);if(s&&s>-1&&r&&r[s]){const i=r[s].getAttribute("width");return i?[parseInt(i,10)]:null}}return l}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",g.mergeAttributes(this.options.HTMLAttributes,t),0]}}),Le=g.Node3.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(o=>parseInt(o,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",g.mergeAttributes(this.options.HTMLAttributes,t),0]}}),ze=g.Node3.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",g.mergeAttributes(this.options.HTMLAttributes,t),0]}});function ne(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function ge(t,e,n,o,l,r){var s;let i=0,c=!0,a=e.firstChild;const d=t.firstChild;if(d!==null)for(let f=0,h=0;f<d.childCount;f+=1){const{colspan:p,colwidth:m}=d.child(f).attrs;for(let b=0;b<p;b+=1,h+=1){const w=l===h?r:m&&m[b],x=w?`${w}px`:"";if(i+=w||o,w||(c=!1),a){if(a.style.width!==x){const[R,L]=ne(o,w);a.style.setProperty(R,L)}a=a.nextSibling}else{const R=document.createElement("col"),[L,M]=ne(o,w);R.style.setProperty(L,M),e.appendChild(R)}}}for(;a;){const f=a.nextSibling;(s=a.parentNode)==null||s.removeChild(a),a=f}const u=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);c&&!u?(n.style.width=`${i}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${i}px`)}var Ht=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ge(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,ge(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),o=this.contentDOM.contains(e);return!!(n&&!o&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function _t(t,e,n,o){let l=0,r=!0;const s=[],i=t.firstChild;if(!i)return{};for(let u=0,f=0;u<i.childCount;u+=1){const{colspan:h,colwidth:p}=i.child(u).attrs;for(let m=0;m<h;m+=1,f+=1){const b=n===f?o:p&&p[m];l+=b||e,b||(r=!1);const[w,x]=ne(e,b);s.push(["col",{style:`${w}: ${x}`}])}}const c=r?`${l}px`:"",a=r?"":`${l}px`;return{colgroup:["colgroup",{},...s],tableWidth:c,tableMinWidth:a}}function be(t,e){return t.createAndFill()}function It(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const o=t.nodes[n];o.spec.tableRole&&(e[o.spec.tableRole]=o)}),t.cached.tableNodeTypes=e,e}function Bt(t,e,n,o,l){const r=It(t),s=[],i=[];for(let a=0;a<n;a+=1){const d=be(r.cell);if(d&&i.push(d),o){const u=be(r.header_cell);u&&s.push(u)}}const c=[];for(let a=0;a<e;a+=1)c.push(r.row.createChecked(null,o&&a===0?s:i));return r.table.createChecked(null,c)}function $t(t){return t instanceof C}var O=({editor:t})=>{const{selection:e}=t.state;if(!$t(e))return!1;let n=0;const o=g.findParentNodeClosestToPos(e.ranges[0].$from,r=>r.type.name==="table");return o==null||o.node.descendants(r=>{if(r.type.name==="table")return!1;["tableCell","tableHeader"].includes(r.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},Wt="";function Ft(t){return(t||"").replace(/\s+/g," ").trim()}function Pt(t,e,n={}){var o;const l=(o=n.cellLineSeparator)!=null?o:Wt;if(!t||!t.content||t.content.length===0)return"";const r=[];t.content.forEach(p=>{const m=[];p.content&&p.content.forEach(b=>{let w="";b.content&&Array.isArray(b.content)&&b.content.length>1?w=b.content.map(M=>e.renderChildren(M)).join(l):w=b.content?e.renderChildren(b.content):"";const x=Ft(w),R=b.type==="tableHeader";m.push({text:x,isHeader:R})}),r.push(m)});const s=r.reduce((p,m)=>Math.max(p,m.length),0);if(s===0)return"";const i=new Array(s).fill(0);r.forEach(p=>{var m;for(let b=0;b<s;b+=1){const x=(((m=p[b])==null?void 0:m.text)||"").length;x>i[b]&&(i[b]=x),i[b]<3&&(i[b]=3)}});const c=(p,m)=>p+" ".repeat(Math.max(0,m-p.length)),a=r[0],d=a.some(p=>p.isHeader);let u=`
2
- `;const f=new Array(s).fill(0).map((p,m)=>d&&a[m]&&a[m].text||"");return u+=`| ${f.map((p,m)=>c(p,i[m])).join(" | ")} |
3
- `,u+=`| ${i.map(p=>"-".repeat(Math.max(3,p))).join(" | ")} |
4
- `,(d?r.slice(1):r).forEach(p=>{u+=`| ${new Array(s).fill(0).map((m,b)=>c(p[b]&&p[b].text||"",i[b])).join(" | ")} |
5
- `}),u}var jt=Pt,De=g.Node3.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:Ht,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:o,tableMinWidth:l}=_t(t,this.options.cellMinWidth),r=e.style;function s(){return r||(o?`width: ${o}`:`min-width: ${l}`)}const i=["table",g.mergeAttributes(this.options.HTMLAttributes,e,{style:s()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},i]:i},parseMarkdown:(t,e)=>{const n=[];if(t.header){const o=[];t.header.forEach(l=>{o.push(e.createNode("tableHeader",{},[{type:"paragraph",content:e.parseInline(l.tokens)}]))}),n.push(e.createNode("tableRow",{},o))}return t.rows&&t.rows.forEach(o=>{const l=[];o.forEach(r=>{l.push(e.createNode("tableCell",{},[{type:"paragraph",content:e.parseInline(r.tokens)}]))}),n.push(e.createNode("tableRow",{},l))}),e.createNode("table",void 0,n)},renderMarkdown:(t,e)=>jt(t,e),addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:o,dispatch:l,editor:r})=>{const s=Bt(r.schema,t,e,n);if(l){const i=o.selection.from+1;o.replaceSelectionWith(s).scrollIntoView().setSelection(_e.TextSelection.near(o.doc.resolve(i)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Ye(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Qe(t,e),deleteColumn:()=>({state:t,dispatch:e})=>tt(t,e),addRowBefore:()=>({state:t,dispatch:e})=>ot(t,e),addRowAfter:()=>({state:t,dispatch:e})=>lt(t,e),deleteRow:()=>({state:t,dispatch:e})=>st(t,e),deleteTable:()=>({state:t,dispatch:e})=>ht(t,e),mergeCells:()=>({state:t,dispatch:e})=>re(t,e),splitCell:()=>({state:t,dispatch:e})=>se(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>B("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>B("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>ut(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>re(t,e)?!0:se(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:o})=>at(t,e)(n,o),goToNextCell:()=>({state:t,dispatch:e})=>ce(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>ce(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Re(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const o=C.create(e.doc,t.anchorCell,t.headCell);e.setSelection(o)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:O,"Mod-Backspace":O,Delete:O,"Mod-Delete":O}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[At({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Dt({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:g.callOrReturn(g.getExtensionField(t,"tableRole",e))}}});g.Extension.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(De.configure(this.options.table)),this.options.tableCell!==!1&&t.push(ke.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(Le.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(ze.configure(this.options.tableRow)),t}});function Ot(t,e,n){if(!t.doc)return t;const o=t.doc.nodeAt(e);if(!o||n===o.attrs.backgroundColor)return t;const l={...o.attrs,backgroundColor:n};return t.setNodeMarkup(e,o.type,l,o.marks)}function Gt(t,e,n){const{doc:o,selection:l}=t;return!o||!l||!(l instanceof C)||l.forEachCell((r,s)=>{t=Ot(t,s,n)}),t}function we(t,e){return({tr:n,state:o,dispatch:l})=>{const{selection:r}=o;return n=n.setSelection(r),n=Gt(n,e,t),n.docChanged?(l==null||l(n),!0):!1}}const Vt=g.Extension.create({name:"tableCellBackground",addOptions(){return{types:["tableCell"],HTMLAttributes:{}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{parseHTML:t=>t.style.backgroundColor||"",renderHTML:t=>!t.backgroundColor||t.backgroundColor===""?{}:{style:`background-color: ${t.backgroundColor}`}}}}]},addCommands(){return{setTableCellBackground:t=>we(t,this.options),unsetTableCellBackground:()=>we("",this.options)}}}),Kt=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,qt=/CrOS/,Xt=/android|ipad|playbook|silk/i;function Ce(t={}){let e=t.ua||typeof navigator<"u"&&navigator.userAgent;return e&&typeof e=="object"&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string"?!1:!!(Kt.test(e)&&!qt.test(e)||t.tablet&&Xt.test(e)||t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.includes("Macintosh")&&e.includes("Safari"))}const ye=t=>Array.from({length:t}).map((e,n)=>n+1);function Zt(t){var f;const[e,n]=W.useState(!1),[o,l]=W.useState(!0),[r,s]=W.useState({rows:Ce()?v.TABLE_MAX_GRID_SIZE:v.TABLE_INIT_GRID_SIZE,cols:Ce()?v.TABLE_MAX_GRID_SIZE:v.TABLE_INIT_GRID_SIZE}),[i,c]=W.useState({rows:v.TABLE_DEFAULT_SELECTED_GRID_SIZE,cols:v.TABLE_DEFAULT_SELECTED_GRID_SIZE});function a(h,p){h===r.rows&&s(m=>({...m,rows:Math.min(h+1,v.TABLE_MAX_GRID_SIZE)})),p===r.cols&&s(m=>({...m,cols:Math.min(p+1,v.TABLE_MAX_GRID_SIZE)})),c({rows:h,cols:p})}function d(h,p){t==null||t.createTable({rows:h,cols:p,withHeaderRow:o}),u(),n(!1)}function u(){l(!1),s({rows:v.TABLE_INIT_GRID_SIZE,cols:v.TABLE_INIT_GRID_SIZE}),c({rows:v.TABLE_DEFAULT_SELECTED_GRID_SIZE,cols:v.TABLE_DEFAULT_SELECTED_GRID_SIZE})}return A.jsxs(X.Popover,{modal:!0,onOpenChange:n,open:e,children:[A.jsx(X.PopoverTrigger,{asChild:!0,"data-state":t!=null&&t.dataState?"on":"off",children:t==null?void 0:t.children}),A.jsx(X.PopoverContent,{align:"start",className:"richtext-w-full !richtext-p-2",side:"bottom",children:A.jsxs("div",{className:"table-grid-size-editor richtext-p-0",children:[A.jsx("div",{className:"richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1",children:(f=ye(r==null?void 0:r.rows))==null?void 0:f.map(h=>{var p;return A.jsx("div",{className:"richtext-flex richtext-gap-1",children:(p=ye(r==null?void 0:r.cols))==null?void 0:p.map(m=>A.jsx("div",{onMouseDown:()=>d(h,m),onMouseOver:()=>a(h,m),className:`richtext-cursor-pointer richtext-border-border ${m<=i.cols&&h<=i.rows&&"tableCellActive !richtext-bg-foreground"}`,children:A.jsx("div",{className:"richtext-box-border richtext-size-4 richtext-rounded-[2px] !richtext-border richtext-border-solid !richtext-border-border richtext-p-1"})},`richtext-table-col-${m}`))},`richtext-table-row-${h}`)})}),A.jsxs("div",{className:"richtext-mt-2 richtext-text-center richtext-text-sm richtext-text-foreground",children:[i.rows,"x",i.cols]})]})})]})}function Ut(){const t=Z.useEditorInstance(),e=Z.useButtonProps(He.name),{icon:n=void 0,tooltip:o=void 0,action:l=void 0,isActive:r=void 0,color:s}=(e==null?void 0:e.componentProps)??{},{dataState:i,disabled:c}=Z.useToggleActive(r);if(!e)return A.jsx(A.Fragment,{});function a(d){t.chain().focus().insertTable({...d,withHeaderRow:!1}).run()}return A.jsx(Zt,{createTable:a,dataState:i,children:A.jsx(Ie.ActionButton,{action:l,color:s,dataState:i,icon:n,isActive:r,tooltip:o,disabled:c})})}const He=De.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{style:`
6
- border: 1px solid #000;
7
- border-collapse: collapse;
8
- width: 100%;
9
- `},resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:e,t:n})=>({componentProps:{isActive:()=>e.isActive("table"),icon:"Table",tooltip:n("editor.table.tooltip")}})}},addExtensions(){return[ze.configure(this.options.tableRow),Le.configure(this.options.tableHeader),ke.configure(this.options.tableCell),Vt.configure(this.options.tableCellBackground)]}});exports.CellSelection=C;exports.RichTextTable=Ut;exports.Table=He;
@@ -1 +0,0 @@
1
- "use strict";const S=require("./index-BBNITgNi.cjs"),t=require("react/jsx-runtime"),h=require("react"),qt=require("./index-C838s-or.cjs"),$t=require("./index-FSRjMsxW.cjs"),Dt=require("./label-E6jF3Xud.cjs"),At=require("./input-D555880-.cjs"),Mt=require("./button-BW5bDPz_.cjs"),je=require("./useButtonProps-DfnJiJLV.cjs"),we=require("./popover-BSzR_R01.cjs"),Vt=require("./Icon-DXePECFW.cjs"),Wt="_verified_lvyh0_1",We={verified:Wt},Bt=()=>t.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:We.verified,children:t.jsx("g",{children:t.jsx("path",{d:"M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"})})}),Pt=()=>t.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:t.jsxs("g",{children:[t.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-a",x1:"4.411",x2:"18.083",y1:"2.495",y2:"21.508",children:[t.jsx("stop",{offset:"0",stopColor:"#f4e72a"}),t.jsx("stop",{offset:".539",stopColor:"#cd8105"}),t.jsx("stop",{offset:".68",stopColor:"#cb7b00"}),t.jsx("stop",{offset:"1",stopColor:"#f4ec26"}),t.jsx("stop",{offset:"1",stopColor:"#f4e72a"})]}),t.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-b",x1:"5.355",x2:"16.361",y1:"3.395",y2:"19.133",children:[t.jsx("stop",{offset:"0",stopColor:"#f9e87f"}),t.jsx("stop",{offset:".406",stopColor:"#e2b719"}),t.jsx("stop",{offset:".989",stopColor:"#e2b719"})]}),t.jsxs("g",{clipRule:"evenodd",fillRule:"evenodd",children:[t.jsx("path",{d:"M13.324 3.848L11 1.6 8.676 3.848l-3.201-.453-.559 3.184L2.06 8.095 3.48 11l-1.42 2.904 2.856 1.516.559 3.184 3.201-.452L11 20.4l2.324-2.248 3.201.452.559-3.184 2.856-1.516L18.52 11l1.42-2.905-2.856-1.516-.559-3.184zm-7.09 7.575l3.428 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-a)"}),t.jsx("path",{d:"M13.101 4.533L11 2.5 8.899 4.533l-2.895-.41-.505 2.88-2.583 1.37L4.2 11l-1.284 2.627 2.583 1.37.505 2.88 2.895-.41L11 19.5l2.101-2.033 2.895.41.505-2.88 2.583-1.37L17.8 11l1.284-2.627-2.583-1.37-.505-2.88zm-6.868 6.89l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-b)"}),t.jsx("path",{d:"M6.233 11.423l3.429 3.428 5.65-6.17.038-.033-.005 1.398-5.683 6.206-3.429-3.429-.003-1.405.005.003z",fill:"#d18800"})]})]})}),Ft=()=>t.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:t.jsx("g",{children:t.jsx("path",{clipRule:"evenodd",d:"M12.05 2.056c-.568-.608-1.532-.608-2.1 0l-1.393 1.49c-.284.303-.685.47-1.1.455L5.42 3.932c-.832-.028-1.514.654-1.486 1.486l.069 2.039c.014.415-.152.816-.456 1.1l-1.49 1.392c-.608.568-.608 1.533 0 2.101l1.49 1.393c.304.284.47.684.456 1.1l-.07 2.038c-.027.832.655 1.514 1.487 1.486l2.038-.069c.415-.014.816.152 1.1.455l1.392 1.49c.569.609 1.533.609 2.102 0l1.393-1.49c.283-.303.684-.47 1.099-.455l2.038.069c.832.028 1.515-.654 1.486-1.486L18 14.542c-.015-.415.152-.815.455-1.099l1.49-1.393c.608-.568.608-1.533 0-2.101l-1.49-1.393c-.303-.283-.47-.684-.455-1.1l.068-2.038c.029-.832-.654-1.514-1.486-1.486l-2.038.07c-.415.013-.816-.153-1.1-.456zm-5.817 9.367l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fillRule:"evenodd"})})}),Ut="_root_98iqw_1",zt="_article_98iqw_21",et={root:Ut,article:zt},Be=({className:e,children:n})=>t.jsx("div",{className:S.clsx("react-tweet-theme",et.root,e),children:t.jsx("article",{className:et.article,children:n})}),ht=e=>t.jsx("img",{...e}),Ht="_verifiedOld_lcna5_1",Gt="_verifiedBlue_lcna5_4",Xt="_verifiedGovernment_lcna5_7",ye={verifiedOld:Ht,verifiedBlue:Gt,verifiedGovernment:Xt},_t=({user:e,className:n})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=t.jsx(Bt,{}),o=ye.verifiedBlue;if(r)switch(e.is_blue_verified||(o=ye.verifiedOld),e.verified_type){case"Government":s=t.jsx(Ft,{}),o=ye.verifiedGovernment;break;case"Business":s=t.jsx(Pt,{}),o=null;break}return r?t.jsx("div",{className:S.clsx(n,o),children:s}):null},Kt="_label_36ucz_1",Qt={label:Kt},mt=({user:e,className:n})=>{var r;const s=e.highlighted_label;if(!s)return null;const o=(r=s.badge)==null?void 0:r.url;return o?t.jsx("div",{className:S.clsx(Qt.label,n),children:t.jsx("img",{src:o,alt:s.description})}):null},Jt="_header_nqq4j_1",Yt="_avatar_nqq4j_11",Zt="_avatarOverflow_nqq4j_16",en="_avatarSquare_nqq4j_23",tn="_avatarShadow_nqq4j_26",nn="_author_nqq4j_37",rn="_authorLink_nqq4j_44",sn="_authorVerified_nqq4j_53",on="_authorLinkText_nqq4j_56",an="_authorMeta_nqq4j_63",cn="_authorFollow_nqq4j_66",ln="_username_nqq4j_69",dn="_follow_nqq4j_74",un="_separator_nqq4j_82",fn="_brand_nqq4j_86",hn="_twitterIcon_nqq4j_90",T={header:Jt,avatar:Yt,avatarOverflow:Zt,avatarSquare:en,avatarShadow:tn,author:nn,authorLink:rn,authorVerified:sn,authorLinkText:on,authorMeta:an,authorFollow:cn,username:ln,follow:dn,separator:un,brand:fn,twitterIcon:hn},_n=({tweet:e,components:n})=>{var r;const s=(r=n==null?void 0:n.AvatarImg)!=null?r:ht,{user:o}=e;return t.jsxs("div",{className:T.header,children:[t.jsxs("a",{href:e.url,className:T.avatar,target:"_blank",rel:"noopener noreferrer",children:[t.jsx("div",{className:S.clsx(T.avatarOverflow,o.profile_image_shape==="Square"&&T.avatarSquare),children:t.jsx(s,{src:o.profile_image_url_https,alt:o.name,width:48,height:48})}),t.jsx("div",{className:T.avatarOverflow,children:t.jsx("div",{className:T.avatarShadow})})]}),t.jsxs("div",{className:T.author,children:[t.jsxs("a",{href:e.url,className:T.authorLink,target:"_blank",rel:"noopener noreferrer",children:[t.jsx("div",{className:T.authorLinkText,children:t.jsx("span",{title:o.name,children:o.name})}),t.jsx(_t,{user:o,className:T.authorVerified}),t.jsx(mt,{user:o})]}),t.jsxs("div",{className:T.authorMeta,children:[t.jsx("a",{href:e.url,className:T.username,target:"_blank",rel:"noopener noreferrer",children:t.jsxs("span",{title:`@${o.screen_name}`,children:["@",o.screen_name]})}),t.jsxs("div",{className:T.authorFollow,children:[t.jsx("span",{className:T.separator,children:"·"}),t.jsx("a",{href:o.follow_url,className:T.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),t.jsx("a",{href:e.url,className:T.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:T.twitterIcon,children:t.jsx("g",{children:t.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})})]})},mn="_root_1ec15_1",pn={root:mn},xn=({tweet:e})=>t.jsxs("a",{href:e.in_reply_to_url,className:pn.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),vn="_root_eihfa_1",gn={root:vn},pt=({href:e,children:n})=>t.jsx("a",{href:e,className:gn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:n}),jn="_root_1xq52_1",wn={root:jn},yn=({tweet:e})=>t.jsxs("p",{className:wn.root,lang:e.lang,dir:"auto",children:[e.entities.map((n,r)=>{switch(n.type){case"hashtag":case"mention":case"url":case"symbol":return t.jsx(pt,{href:n.href,children:n.text},r);case"media":return;default:return t.jsx("span",{dangerouslySetInnerHTML:{__html:n.text}},r)}}),e.note_tweet?t.jsx(bn,{tweet:e}):null]});function bn({tweet:e}){return t.jsxs(pt,{href:e.url,children:[t.jsx("span",{children:" "}),"Show more"]})}const Tn={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Nn=new Intl.DateTimeFormat("en-US",Tn),Rn=e=>{const n={};for(const r of e)n[r.type]=r.value;return n},Sn=e=>{const n=Rn(Nn.formatToParts(e)),r=`${n.hour}:${n.minute} ${n.dayPeriod}`,s=`${n.month} ${n.day}, ${n.year}`;return`${r} · ${s}`},tt=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,xt=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,In=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,kn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,En=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,Cn=e=>`https://x.com/hashtag/${e.text}`,On=e=>`https://x.com/search?q=%24${e.text}`,Ln=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,vt=(e,n)=>{const r=new URL(e.media_url_https),s=r.pathname.split(".").pop();return s?(r.pathname=r.pathname.replace(`.${s}`,""),r.searchParams.set("format",s),r.searchParams.set("name",n),r.toString()):e.media_url_https},qn=e=>{const{variants:n}=e.video_info;return n.filter(s=>s.content_type==="video/mp4").sort((s,o)=>{var a,i;return((a=o.bitrate)!=null?a:0)-((i=s.bitrate)!=null?i:0)})},$n=e=>{const n=qn(e);return n.length>1?n[1]:n[0]},Ce=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function nt(e){const n=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return ce(r,"hashtag",e.entities.hashtags),ce(r,"mention",e.entities.user_mentions),ce(r,"url",e.entities.urls),ce(r,"symbol",e.entities.symbols),e.entities.media&&ce(r,"media",e.entities.media),Dn(e,r),r.map(s=>{const o=n.slice(s.indices[0],s.indices[1]).join("");switch(s.type){case"hashtag":return Object.assign(s,{href:Cn(s),text:o});case"mention":return Object.assign(s,{href:xt(s.screen_name),text:o});case"url":case"media":return Object.assign(s,{href:s.expanded_url,text:s.display_url});case"symbol":return Object.assign(s,{href:On(s),text:o});default:return Object.assign(s,{text:o})}})}function ce(e,n,r){for(const s of r)for(const[o,a]of e.entries()){if(a.indices[0]>s.indices[0]||a.indices[1]<s.indices[1])continue;const i=[{...s,type:n}];a.indices[0]<s.indices[0]&&i.unshift({indices:[a.indices[0],s.indices[0]],type:"text"}),a.indices[1]>s.indices[1]&&i.push({indices:[s.indices[1],a.indices[1]],type:"text"}),e.splice(o,1,...i);break}}function Dn(e,n){e.entities.media&&e.entities.media[0].indices[0]<e.display_text_range[1]&&(e.display_text_range[1]=e.entities.media[0].indices[0]);const r=n.at(-1);r&&r.indices[1]>e.display_text_range[1]&&(r.indices[1]=e.display_text_range[1])}const An=e=>({...e,url:tt(e),user:{...e.user,url:xt(e),follow_url:En(e)},like_url:In(e),reply_url:kn(e),in_reply_to_url:e.in_reply_to_screen_name?Ln(e):void 0,entities:nt(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:tt(e.quoted_tweet),entities:nt(e.quoted_tweet)}:void 0}),Mn="_root_g9tkv_1",Vn="_rounded_g9tkv_6",Wn="_mediaWrapper_g9tkv_10",Bn="_grid2Columns_g9tkv_17",Pn="_grid3_g9tkv_20",Fn="_grid2x2_g9tkv_23",Un="_mediaContainer_g9tkv_26",zn="_mediaLink_g9tkv_34",Hn="_skeleton_g9tkv_38",Gn="_image_g9tkv_43",C={root:Mn,rounded:Vn,mediaWrapper:Wn,grid2Columns:Bn,grid3:Pn,grid2x2:Fn,mediaContainer:Un,mediaLink:zn,skeleton:Hn,image:Gn},Xn="_anchor_fp31d_1",Kn="_videoButton_fp31d_17",Qn="_videoButtonIcon_fp31d_35",Jn="_watchOnTwitter_fp31d_44",Yn="_viewReplies_fp31d_60",se={anchor:Xn,videoButton:Kn,videoButtonIcon:Qn,watchOnTwitter:Jn,viewReplies:Yn},Zn=({tweet:e,media:n})=>{const[r,s]=h.useState(!0),[o,a]=h.useState(!1),[i,c]=h.useState(!1),f=$n(n);let d=0;return t.jsxs(t.Fragment,{children:[t.jsx("video",{className:C.image,poster:vt(n,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{d&&window.clearTimeout(d),o||a(!0),i&&c(!1)},onPause:()=>{d&&window.clearTimeout(d),d=window.setTimeout(()=>{o&&a(!1),d=0},100)},onEnded:()=>{c(!0)},children:t.jsx("source",{src:f.url,type:f.content_type})}),r&&t.jsx("button",{type:"button",className:se.videoButton,"aria-label":"View video on X",onClick:v=>{const m=v.currentTarget.previousSibling;v.preventDefault(),s(!1),m.load(),m.play().then(()=>{a(!0),m.focus()}).catch(w=>{console.error("Error playing video:",w),s(!0),a(!1)})},children:t.jsx("svg",{viewBox:"0 0 24 24",className:se.videoButtonIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!o&&!i&&t.jsx("div",{className:se.watchOnTwitter,children:t.jsx("a",{href:e.url,className:se.anchor,target:"_blank",rel:"noopener noreferrer",children:r?"Watch on X":"Continue watching on X"})}),i&&t.jsx("a",{href:e.url,className:S.clsx(se.anchor,se.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},er=e=>t.jsx("img",{...e}),rt=(e,n)=>{let r=56.25;return n===1&&(r=100/e.original_info.width*e.original_info.height),n===2&&(r=r*2),{width:e.type==="photo"?void 0:"unset",paddingBottom:`${r}%`}},gt=({tweet:e,components:n,quoted:r})=>{var s,o,a;const i=(a=(s=e.mediaDetails)==null?void 0:s.length)!=null?a:0;var c;const f=(c=n==null?void 0:n.MediaImg)!=null?c:er;return t.jsx("div",{className:S.clsx(C.root,!r&&C.rounded),children:t.jsx("div",{className:S.clsx(C.mediaWrapper,i>1&&C.grid2Columns,i===3&&C.grid3,i>4&&C.grid2x2),children:(o=e.mediaDetails)==null?void 0:o.map(d=>t.jsx(h.Fragment,{children:d.type==="photo"?t.jsxs("a",{href:e.url,className:S.clsx(C.mediaContainer,C.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[t.jsx("div",{className:C.skeleton,style:rt(d,i)}),t.jsx(f,{src:vt(d,"small"),alt:d.ext_alt_text||"Image",className:C.image,draggable:!0})]},d.media_url_https):t.jsxs("div",{className:C.mediaContainer,children:[t.jsx("div",{className:C.skeleton,style:rt(d,i)}),t.jsx(Zn,{tweet:e,media:d})]},d.media_url_https)},d.media_url_https))})})},tr="_root_i24yn_1",nr={root:tr},rr=({tweet:e})=>{const n=new Date(e.created_at),r=Sn(n);return t.jsx("a",{className:nr.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:t.jsx("time",{dateTime:n.toISOString(),children:r})})},sr="_info_19qcj_1",or="_infoLink_19qcj_10",ir="_infoIcon_19qcj_30",be={info:sr,infoLink:or,infoIcon:ir},ar=({tweet:e})=>t.jsxs("div",{className:be.info,children:[t.jsx(rr,{tweet:e}),t.jsx("a",{className:be.infoLink,href:"https://help.x.com/en/x-for-websites-ads-info-and-privacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Twitter for Websites, Ads Information and Privacy",children:t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:be.infoIcon,children:t.jsx("g",{children:t.jsx("path",{d:"M13.5 8.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 7 12 7s1.5.67 1.5 1.5zM13 17v-5h-2v5h2zm-1 5.25c5.66 0 10.25-4.59 10.25-10.25S17.66 1.75 12 1.75 1.75 6.34 1.75 12 6.34 22.25 12 22.25zM20.25 12c0 4.56-3.69 8.25-8.25 8.25S3.75 16.56 3.75 12 7.44 3.75 12 3.75s8.25 3.69 8.25 8.25z"})})})})]}),cr="_actions_n2anf_1",lr="_like_n2anf_13",dr="_reply_n2anf_14",ur="_copy_n2anf_15",fr="_likeIconWrapper_n2anf_27",hr="_likeCount_n2anf_30",_r="_replyIconWrapper_n2anf_35",mr="_copyIconWrapper_n2anf_36",pr="_likeIcon_n2anf_27",xr="_replyIcon_n2anf_35",vr="_copyIcon_n2anf_36",gr="_replyText_n2anf_56",jr="_copyText_n2anf_57",k={actions:cr,like:lr,reply:dr,copy:ur,likeIconWrapper:fr,likeCount:hr,replyIconWrapper:_r,copyIconWrapper:mr,likeIcon:pr,replyIcon:xr,copyIcon:vr,replyText:gr,copyText:jr},wr=({tweet:e})=>{const[n,r]=h.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return h.useEffect(()=>{if(n){const o=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(o)}},[n]),t.jsxs("button",{type:"button",className:k.copy,"aria-label":"Copy link",onClick:s,children:[t.jsx("div",{className:k.copyIconWrapper,children:n?t.jsx("svg",{viewBox:"0 0 24 24",className:k.copyIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):t.jsx("svg",{viewBox:"0 0 24 24",className:k.copyIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),t.jsx("span",{className:k.copyText,children:n?"Copied!":"Copy link"})]})},yr=({tweet:e})=>{const n=Ce(e.favorite_count);return t.jsxs("div",{className:k.actions,children:[t.jsxs("a",{className:k.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${n} likes`,children:[t.jsx("div",{className:k.likeIconWrapper,children:t.jsx("svg",{viewBox:"0 0 24 24",className:k.likeIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M20.884 13.19c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})})}),t.jsx("span",{className:k.likeCount,children:n})]}),t.jsxs("a",{className:k.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[t.jsx("div",{className:k.replyIconWrapper,children:t.jsx("svg",{viewBox:"0 0 24 24",className:k.replyIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01z"})})})}),t.jsx("span",{className:k.replyText,children:"Reply"})]}),t.jsx(wr,{tweet:e})]})},br="_replies_1cutb_1",Tr="_link_1cutb_4",Nr="_text_1cutb_23",Te={replies:br,link:Tr,text:Nr},Rr=({tweet:e})=>t.jsx("div",{className:Te.replies,children:t.jsx("a",{className:Te.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:t.jsx("span",{className:Te.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${Ce(e.conversation_count)} reply`:`Read ${Ce(e.conversation_count)} replies`})})}),Sr="_root_q5799_1",Ir="_article_q5799_16",st={root:Sr,article:Ir},kr=({tweet:e,children:n})=>t.jsx("div",{className:st.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:t.jsx("article",{className:st.article,children:n})}),Er="_header_f00ab_1",Cr="_avatar_f00ab_11",Or="_avatarOverflow_f00ab_16",Lr="_avatarSquare_f00ab_23",qr="_author_f00ab_27",$r="_authorText_f00ab_33",Dr="_username_f00ab_40",K={header:Er,avatar:Cr,avatarOverflow:Or,avatarSquare:Lr,author:qr,authorText:$r,username:Dr},Ar=({tweet:e,components:n})=>{const{user:r}=e;var s;const o=(s=n==null?void 0:n.AvatarImg)!=null?s:ht;return t.jsxs("div",{className:K.header,children:[t.jsx("a",{href:e.url,className:K.avatar,target:"_blank",rel:"noopener noreferrer",children:t.jsx("div",{className:S.clsx(K.avatarOverflow,r.profile_image_shape==="Square"&&K.avatarSquare),children:t.jsx(o,{src:r.profile_image_url_https,alt:r.name,width:20,height:20})})}),t.jsxs("div",{className:K.author,children:[t.jsx("div",{className:K.authorText,children:t.jsx("span",{title:r.name,children:r.name})}),t.jsx(_t,{user:r}),t.jsx(mt,{user:r}),t.jsx("div",{className:K.username,children:t.jsxs("span",{title:`@${r.screen_name}`,children:["@",r.screen_name]})})]})]})},Mr="_root_175ot_1",Vr={root:Mr},Wr=({tweet:e})=>t.jsx("p",{className:Vr.root,lang:e.lang,dir:"auto",children:e.entities.map((n,r)=>t.jsx("span",{dangerouslySetInnerHTML:{__html:n.text}},r))}),Br=({tweet:e,components:n})=>{var r;return t.jsxs(kr,{tweet:e,children:[t.jsx(Ar,{tweet:e,components:n}),t.jsx(Wr,{tweet:e}),(r=e.mediaDetails)!=null&&r.length?t.jsx(gt,{quoted:!0,tweet:e}):null]})},Pr=({tweet:e,components:n})=>{var r;const s=h.useMemo(()=>An(e),[e]);return t.jsxs(Be,{children:[t.jsx(_n,{tweet:s,components:n}),s.in_reply_to_status_id_str&&t.jsx(xn,{tweet:s}),t.jsx(yn,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?t.jsx(gt,{tweet:s,components:n}):null,s.quoted_tweet&&t.jsx(Br,{tweet:s.quoted_tweet,components:n}),t.jsx(ar,{tweet:s}),t.jsx(yr,{tweet:s}),t.jsx(Rr,{tweet:s})]})},Fr="_root_16yxa_1",Ur={root:Fr},zr=e=>t.jsx(Be,{children:t.jsxs("div",{className:Ur.root,children:[t.jsx("h3",{children:"Tweet not found"}),t.jsx("p",{children:"The embedded tweet could not be found…"})]})}),Hr="_skeleton_oi7hr_1",Gr={skeleton:Hr},_e=({style:e})=>t.jsx("span",{className:Gr.skeleton,style:e}),Xr="_root_17qqv_1",Kr={root:Xr},Qr=()=>t.jsxs(Be,{className:Kr.root,children:[t.jsx(_e,{style:{height:"3rem",marginBottom:"0.75rem"}}),t.jsx(_e,{style:{height:"6rem",margin:"0.5rem 0"}}),t.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),t.jsx(_e,{style:{height:"2rem"}}),t.jsx(_e,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]}),jt=0,wt=1,yt=2,ot=3;var it=Object.prototype.hasOwnProperty;function Oe(e,n){var r,s;if(e===n)return!0;if(e&&n&&(r=e.constructor)===n.constructor){if(r===Date)return e.getTime()===n.getTime();if(r===RegExp)return e.toString()===n.toString();if(r===Array){if((s=e.length)===n.length)for(;s--&&Oe(e[s],n[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(it.call(e,r)&&++s&&!it.call(n,r)||!(r in n)||!Oe(e[r],n[r]))return!1;return Object.keys(n).length===s}}return e!==e&&n!==n}const F=new WeakMap,U=()=>{},R=U(),Le=Object,u=e=>e===R,W=e=>typeof e=="function",z=(e,n)=>({...e,...n}),bt=e=>W(e.then),Ne={},me={},Pe="undefined",le=typeof window!=Pe,qe=typeof document!=Pe,Jr=le&&"Deno"in window,Yr=()=>le&&typeof window.requestAnimationFrame!=Pe,Tt=(e,n)=>{const r=F.get(e);return[()=>!u(n)&&e.get(n)||Ne,s=>{if(!u(n)){const o=e.get(n);n in me||(me[n]=o),r[5](n,z(o,s),o||Ne)}},r[6],()=>!u(n)&&n in me?me[n]:!u(n)&&e.get(n)||Ne]};let $e=!0;const Zr=()=>$e,[De,Ae]=le&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[U,U],es=()=>{const e=qe&&document.visibilityState;return u(e)||e!=="hidden"},ts=e=>(qe&&document.addEventListener("visibilitychange",e),De("focus",e),()=>{qe&&document.removeEventListener("visibilitychange",e),Ae("focus",e)}),ns=e=>{const n=()=>{$e=!0,e()},r=()=>{$e=!1};return De("online",n),De("offline",r),()=>{Ae("online",n),Ae("offline",r)}},rs={isOnline:Zr,isVisible:es},ss={initFocus:ts,initReconnect:ns},at=!h.useId,oe=!le||Jr,os=e=>Yr()?window.requestAnimationFrame(e):setTimeout(e,1),Re=oe?h.useEffect:h.useLayoutEffect,Se=typeof navigator<"u"&&navigator.connection,ct=!oe&&Se&&(["slow-2g","2g"].includes(Se.effectiveType)||Se.saveData),pe=new WeakMap,is=e=>Le.prototype.toString.call(e),Ie=(e,n)=>e===`[object ${n}]`;let as=0;const Me=e=>{const n=typeof e,r=is(e),s=Ie(r,"Date"),o=Ie(r,"RegExp"),a=Ie(r,"Object");let i,c;if(Le(e)===e&&!s&&!o){if(i=pe.get(e),i)return i;if(i=++as+"~",pe.set(e,i),Array.isArray(e)){for(i="@",c=0;c<e.length;c++)i+=Me(e[c])+",";pe.set(e,i)}if(a){i="#";const f=Le.keys(e).sort();for(;!u(c=f.pop());)u(e[c])||(i+=c+":"+Me(e[c])+",");pe.set(e,i)}}else i=s?e.toJSON():n=="symbol"?e.toString():n=="string"?JSON.stringify(e):""+e;return i},Fe=e=>{if(W(e))try{e=e()}catch{e=""}const n=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Me(e):"",[e,n]};let cs=0;const Ve=()=>++cs;async function Nt(...e){const[n,r,s,o]=e,a=z({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let i=a.populateCache;const c=a.rollbackOnError;let f=a.optimisticData;const d=w=>typeof c=="function"?c(w):c!==!1,v=a.throwOnError;if(W(r)){const w=r,N=[],E=n.keys();for(const L of E)!/^\$(inf|sub)\$/.test(L)&&w(n.get(L)._k)&&N.push(L);return Promise.all(N.map(m))}return m(r);async function m(w){const[N]=Fe(w);if(!N)return;const[E,L]=Tt(n,N),[D,ie,l,de]=F.get(n),Q=()=>{const q=D[N];return(W(a.revalidate)?a.revalidate(E().data,w):a.revalidate!==!1)&&(delete l[N],delete de[N],q&&q[0])?q[0](yt).then(()=>E().data):E().data};if(e.length<3)return Q();let y=s,A,M=!1;const J=Ve();ie[N]=[J,0];const p=!u(f),Y=E(),V=Y.data,Z=Y._c,H=u(Z)?V:Z;if(p&&(f=W(f)?f(H,V):f,L({data:f,_c:H})),W(y))try{y=y(H)}catch(q){A=q,M=!0}if(y&&bt(y))if(y=await y.catch(q=>{A=q,M=!0}),J!==ie[N][0]){if(M)throw A;return y}else M&&p&&d(A)&&(i=!0,L({data:H,_c:R}));if(i&&!M)if(W(i)){const q=i(y,H);L({data:q,error:R,_c:R})}else L({data:y,error:R,_c:R});if(ie[N][1]=Ve(),Promise.resolve(Q()).then(()=>{L({_c:R})}),M){if(v)throw A;return}return y}}const lt=(e,n)=>{for(const r in e)e[r][0]&&e[r][0](n)},ls=(e,n)=>{if(!F.has(e)){const r=z(ss,n),s=Object.create(null),o=Nt.bind(R,e);let a=U;const i=Object.create(null),c=(v,m)=>{const w=i[v]||[];return i[v]=w,w.push(m),()=>w.splice(w.indexOf(m),1)},f=(v,m,w)=>{e.set(v,m);const N=i[v];if(N)for(const E of N)E(m,w)},d=()=>{if(!F.has(e)&&(F.set(e,[s,Object.create(null),Object.create(null),Object.create(null),o,f,c]),!oe)){const v=r.initFocus(setTimeout.bind(R,lt.bind(R,s,jt))),m=r.initReconnect(setTimeout.bind(R,lt.bind(R,s,wt)));a=()=>{v&&v(),m&&m(),F.delete(e)}}};return d(),[e,o,d,a]}return[e,F.get(e)[4]]},ds=(e,n,r,s,o)=>{const a=r.errorRetryCount,i=o.retryCount,c=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;!u(a)&&i>a||setTimeout(s,c,o)},us=Oe,[Rt,fs]=ls(new Map),hs=z({onLoadingSlow:U,onSuccess:U,onError:U,onErrorRetry:ds,onDiscarded:U,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ct?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:ct?5e3:3e3,compare:us,isPaused:()=>!1,cache:Rt,mutate:fs,fallback:{}},rs),_s=(e,n)=>{const r=z(e,n);if(n){const{use:s,fallback:o}=e,{use:a,fallback:i}=n;s&&a&&(r.use=s.concat(a)),o&&i&&(r.fallback=z(o,i))}return r},ms=h.createContext({}),ps="$inf$",St=le&&window.__SWR_DEVTOOLS_USE__,xs=St?window.__SWR_DEVTOOLS_USE__:[],vs=()=>{St&&(window.__SWR_DEVTOOLS_REACT__=h)},gs=e=>W(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],js=()=>{const e=h.useContext(ms);return h.useMemo(()=>z(hs,e),[e])},ws=e=>(n,r,s)=>e(n,r&&((...a)=>{const[i]=Fe(n),[,,,c]=F.get(Rt);if(i.startsWith(ps))return r(...a);const f=c[i];return u(f)?r(...a):(delete c[i],f)}),s),ys=xs.concat(ws),bs=e=>function(...r){const s=js(),[o,a,i]=gs(r),c=_s(s,i);let f=e;const{use:d}=c,v=(d||[]).concat(ys);for(let m=v.length;m--;)f=v[m](f);return f(o,a||c.fetcher||null,c)},Ts=(e,n,r)=>{const s=n[e]||(n[e]=[]);return s.push(r),()=>{const o=s.indexOf(r);o>=0&&(s[o]=s[s.length-1],s.pop())}};vs();const ke=h.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(n=>{e.status="fulfilled",e.value=n},n=>{e.status="rejected",e.reason=n}),e}}),Ee={dedupe:!0},dt=Promise.resolve(R),Ns=(e,n,r)=>{const{cache:s,compare:o,suspense:a,fallbackData:i,revalidateOnMount:c,revalidateIfStale:f,refreshInterval:d,refreshWhenHidden:v,refreshWhenOffline:m,keepPreviousData:w,strictServerPrefetchWarning:N}=r,[E,L,D,ie]=F.get(s),[l,de]=Fe(e),Q=h.useRef(!1),y=h.useRef(!1),A=h.useRef(l),M=h.useRef(n),J=h.useRef(r),p=()=>J.current,Y=()=>p().isVisible()&&p().isOnline(),[V,Z,H,q]=Tt(s,l),ee=h.useRef({}).current,ue=u(i)?u(r.fallback)?R:r.fallback[l]:i,ze=(_,x)=>{for(const j in ee){const g=j;if(g==="data"){if(!o(_[g],x[g])&&(!u(_[g])||!o(he,x[g])))return!1}else if(x[g]!==_[g])return!1}return!0},He=h.useMemo(()=>{const _=!l||!n?!1:u(c)?p().isPaused()||a?!1:f!==!1:c,x=I=>{const B=z(I);return delete B._k,_?{isValidating:!0,isLoading:!0,...B}:B},j=V(),g=q(),$=x(j),re=j===g?$:x(g);let b=$;return[()=>{const I=x(V());return ze(I,b)?(b.data=I.data,b.isLoading=I.isLoading,b.isValidating=I.isValidating,b.error=I.error,b):(b=I,I)},()=>re]},[s,l]),te=S.shimExports.useSyncExternalStore(h.useCallback(_=>H(l,(x,j)=>{ze(j,x)||_()}),[s,l]),He[0],He[1]),Ge=!Q.current,kt=E[l]&&E[l].length>0,ne=te.data,G=u(ne)?ue&&bt(ue)?ke(ue):ue:ne,fe=te.error,xe=h.useRef(G),he=w?u(ne)?u(xe.current)?G:xe.current:ne:G,X=l&&u(G),Et=!oe&&S.shimExports.useSyncExternalStore(()=>U,()=>!1,()=>!0);N&&Et&&!a&&X&&console.warn(`Missing pre-initiated data for serialized key "${l}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Xe=kt&&!u(fe)?!1:Ge&&!u(c)?c:p().isPaused()?!1:a?u(G)?!1:f:u(G)||f,Ke=!!(l&&n&&Ge&&Xe),Ct=u(te.isValidating)?Ke:te.isValidating,Ot=u(te.isLoading)?Ke:te.isLoading,ae=h.useCallback(async _=>{const x=M.current;if(!l||!x||y.current||p().isPaused())return!1;let j,g,$=!0;const re=_||{},b=!D[l]||!re.dedupe,I=()=>at?!y.current&&l===A.current&&Q.current:l===A.current,B={isValidating:!1,isLoading:!1},Je=()=>{Z(B)},Ye=()=>{const O=D[l];O&&O[1]===g&&delete D[l]},Ze={isValidating:!0};u(V().data)&&(Ze.isLoading=!0);try{if(b&&(Z(Ze),r.loadingTimeout&&u(V().data)&&setTimeout(()=>{$&&I()&&p().onLoadingSlow(l,r)},r.loadingTimeout),D[l]=[x(de),Ve()]),[j,g]=D[l],j=await j,b&&setTimeout(Ye,r.dedupingInterval),!D[l]||D[l][1]!==g)return b&&I()&&p().onDiscarded(l),!1;B.error=R;const O=L[l];if(!u(O)&&(g<=O[0]||g<=O[1]||O[1]===0))return Je(),b&&I()&&p().onDiscarded(l),!1;const P=V().data;B.data=o(P,j)?P:j,b&&I()&&p().onSuccess(j,l,r)}catch(O){Ye();const P=p(),{shouldRetryOnError:ve}=P;P.isPaused()||(B.error=O,b&&I()&&(P.onError(O,l,P),(ve===!0||W(ve)&&ve(O))&&(!p().revalidateOnFocus||!p().revalidateOnReconnect||Y())&&P.onErrorRetry(O,l,P,Lt=>{const ge=E[l];ge&&ge[0]&&ge[0](ot,Lt)},{retryCount:(re.retryCount||0)+1,dedupe:!0})))}return $=!1,Je(),!0},[l,s]),Qe=h.useCallback((..._)=>Nt(s,A.current,..._),[]);if(Re(()=>{M.current=n,J.current=r,u(ne)||(xe.current=ne)}),Re(()=>{if(!l)return;const _=ae.bind(R,Ee);let x=0;p().revalidateOnFocus&&(x=Date.now()+p().focusThrottleInterval);const g=Ts(l,E,($,re={})=>{if($==jt){const b=Date.now();p().revalidateOnFocus&&b>x&&Y()&&(x=b+p().focusThrottleInterval,_())}else if($==wt)p().revalidateOnReconnect&&Y()&&_();else{if($==yt)return ae();if($==ot)return ae(re)}});return y.current=!1,A.current=l,Q.current=!0,Z({_k:de}),Xe&&(D[l]||(u(G)||oe?_():os(_))),()=>{y.current=!0,g()}},[l]),Re(()=>{let _;function x(){const g=W(d)?d(V().data):d;g&&_!==-1&&(_=setTimeout(j,g))}function j(){!V().error&&(v||p().isVisible())&&(m||p().isOnline())?ae(Ee).then(x):x()}return x(),()=>{_&&(clearTimeout(_),_=-1)}},[d,v,m,l]),h.useDebugValue(he),a){if(!at&&oe&&X)throw new Error("Fallback data is required when using Suspense in SSR.");X&&(M.current=n,J.current=r,y.current=!1);const _=ie[l],x=!u(_)&&X?Qe(_):dt;if(ke(x),!u(fe)&&X)throw fe;const j=X?ae(Ee):dt;!u(he)&&X&&(j.status="fulfilled",j.value=!0),ke(j)}return{mutate:Qe,get data(){return ee.data=!0,he},get error(){return ee.error=!0,fe},get isValidating(){return ee.isValidating=!0,Ct},get isLoading(){return ee.isLoading=!0,Ot}}},ut=bs(Ns);class Rs extends Error{constructor({message:n,status:r,data:s}){super(n),this.name="TwitterApiError",this.status=r,this.data=s}}const Ss=ut.default||ut,Is="https://react-tweet.vercel.app";async function ks([e,n]){const r=await fetch(e,n),s=await r.json();if(r.ok)return s.data||null;throw new Rs({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const Es=(e,n,r)=>{const{isLoading:s,data:o,error:a}=Ss(()=>n||e?[n||e&&`${Is}/api/tweet/${e}`,r]:null,ks,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||o===void 0&&!a),data:o,error:a}},Cs=({id:e,apiUrl:n,fallback:r=t.jsx(Qr,{}),components:s,fetchOptions:o,onError:a})=>{const{data:i,error:c,isLoading:f}=Es(e,n,o);if(f)return r;if(c||!i){const d=(s==null?void 0:s.TweetNotFound)||zr;return t.jsx(d,{error:a?a(c):c})}return t.jsx(Pr,{tweet:i,components:s})};function Os({node:e}){var s;const n=((s=e==null?void 0:e.attrs)==null?void 0:s.src)||"",r=n==null?void 0:n.split("/").pop();return r?t.jsx(S.NodeViewWrapper,{children:t.jsx("div",{"data-twitter":"",children:t.jsx(Cs,{id:r})})}):null}function It(e){const{t:n}=$t.useLocale(),[r,s]=h.useState("");h.useEffect(()=>{var a;if(e!=null&&e.editor){const{src:i}=(a=e.editor)==null?void 0:a.getAttributes(Ue.name);i&&s(i)}},[e==null?void 0:e.editor]);function o(a){a.preventDefault(),a.stopPropagation(),e==null||e.onSetLink(r)}return t.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:o,children:[t.jsx(Dt.Label,{className:"mb-[6px]",children:n("editor.link.dialog.text")}),t.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:t.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:t.jsx(At.Input,{className:"richtext-w-80",onChange:a=>s(a.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),t.jsx(Mt.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:n("editor.link.dialog.button.apply")})]})}function Ls(){const[e,n]=h.useState(!1),r=je.useEditorInstance(),s=je.useButtonProps(Ue.name),{icon:o=void 0,tooltip:a=void 0,tooltipOptions:i={},action:c=void 0,isActive:f=void 0}=(s==null?void 0:s.componentProps)??{},{editorDisabled:d}=je.useToggleActive(f);function v(m){d||c&&(c(m),n(!1))}return t.jsxs(we.Popover,{modal:!0,onOpenChange:n,open:e,children:[t.jsx(we.PopoverTrigger,{asChild:!0,children:t.jsx(qt.ActionButton,{disabled:d,isActive:f,tooltip:a,tooltipOptions:i,children:t.jsx(Vt.IconComponent,{name:o})})}),t.jsx(we.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:t.jsx(It,{editor:r,onSetLink:v})})]})}const qs=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,$s=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function ft(e){return e.match($s)}const Ue=S.Node3.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t:n})=>({componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:n("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return S.ReactNodeViewRenderer(Os,{attrs:this.options.HTMLAttributes})},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{src:{default:null}}},parseHTML(){return[{tag:"div[data-twitter]"}]},addCommands(){return{setTweet:e=>({commands:n})=>ft(e.src)?n.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:n})=>ft(e.src)?n.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[S.nodePasteRule({find:qs,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",S.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=It;exports.RichTextTwitter=Ls;exports.Twitter=Ue;
@@ -1 +0,0 @@
1
- "use strict";const h=require("react/jsx-runtime"),a=require("react"),u=require("@radix-ui/react-slot"),c=require("./index-C838s-or.cjs");function d(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const f=d(a),l=c.cva("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-1 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-size-10"}},defaultVariants:{variant:"default",size:"default"}}),n=f.forwardRef(({className:t,variant:r,size:e,asChild:i=!1,...o},s)=>{const x=i?u.Slot:"button";return h.jsx(x,{className:c.cn(l({variant:r,size:e,className:t})),ref:s,...o})});n.displayName="Button";exports.Button=n;
@@ -1 +0,0 @@
1
- "use strict";function n(E,A){return window.addEventListener(E,A),()=>{window.removeEventListener(E,A)}}function t(E,A){window.dispatchEvent(new CustomEvent(E,{detail:A}))}const G={UPLOAD_IMAGE:E=>`UPLOAD_IMAGE-${E}`,UPLOAD_VIDEO:E=>`UPLOAD_VIDEO-${E}`,CHANGE_THEME:"CHANGE_THEME",CHANGE_COLOR:"CHANGE_COLOR",CHANGE_BORDER_RADIUS:"CHANGE_BORDER_RADIUS",MODIFY_LANGUAGE:"MODIFY_LANGUAGE",CHANGE_LANGUAGE:"CHANGE_LANGUAGE"};exports.EVENTS=G;exports.dispatchEvent=t;exports.listenEvent=n;
@@ -1,26 +0,0 @@
1
- function n(E, A) {
2
- return window.addEventListener(E, A), () => {
3
- window.removeEventListener(E, A);
4
- };
5
- }
6
- function G(E, A) {
7
- window.dispatchEvent(
8
- new CustomEvent(E, {
9
- detail: A
10
- })
11
- );
12
- }
13
- const t = {
14
- UPLOAD_IMAGE: (E) => `UPLOAD_IMAGE-${E}`,
15
- UPLOAD_VIDEO: (E) => `UPLOAD_VIDEO-${E}`,
16
- CHANGE_THEME: "CHANGE_THEME",
17
- CHANGE_COLOR: "CHANGE_COLOR",
18
- CHANGE_BORDER_RADIUS: "CHANGE_BORDER_RADIUS",
19
- MODIFY_LANGUAGE: "MODIFY_LANGUAGE",
20
- CHANGE_LANGUAGE: "CHANGE_LANGUAGE"
21
- };
22
- export {
23
- t as E,
24
- G as d,
25
- n as l
26
- };
@@ -1 +0,0 @@
1
- "use strict";const i=require("./index-BBNITgNi.cjs");var c=20,u=(t,e=0)=>{const r=[];return!t.children.length||e>c||Array.from(t.children).forEach(o=>{o.tagName==="SPAN"?r.push(o):o.children.length&&r.push(...u(o,e+1))}),r},f=t=>{if(!t.children.length)return;const e=u(t);e&&e.forEach(r=>{var o,n;const s=r.getAttribute("style"),l=(n=(o=r.parentElement)==null?void 0:o.closest("span"))==null?void 0:n.getAttribute("style");r.setAttribute("style",`${l};${s}`)})},m=i.Mark.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&f(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",i.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(r,o)=>{if(r.isTextblock)return!0;r.marks.filter(n=>n.type===this.type).some(n=>Object.values(n.attrs).some(s=>!!s))||t.removeMark(o,o+r.nodeSize,this.type)}),!0}}}}),g=i.Extension.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;const r=t.getAttribute("style");if(r){const o=r.split(";").map(n=>n.trim()).filter(Boolean);for(let n=o.length-1;n>=0;n-=1){const s=o[n].split(":");if(s.length>=2){const l=s[0].trim().toLowerCase(),a=s.slice(1).join(":").trim();if(l==="background-color")return a.replace(/['"]+/g,"")}}}return(e=t.style.backgroundColor)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),y=i.Extension.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;const r=t.getAttribute("style");if(r){const o=r.split(";").map(n=>n.trim()).filter(Boolean);for(let n=o.length-1;n>=0;n-=1){const s=o[n].split(":");if(s.length>=2){const l=s[0].trim().toLowerCase(),a=s.slice(1).join(":").trim();if(l==="color")return a.replace(/['"]+/g,"")}}}return(e=t.style.color)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),p=i.Extension.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),h=i.Extension.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize,renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),d=i.Extension.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight,renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});i.Extension.create({name:"textStyleKit",addExtensions(){const t=[];return this.options.backgroundColor!==!1&&t.push(g.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(y.configure(this.options.color)),this.options.fontFamily!==!1&&t.push(p.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(h.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(d.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(m.configure(this.options.textStyle)),t}});exports.Color=y;exports.FontFamily=p;exports.LineHeight=d;