cognova 0.2.26 → 0.2.27

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 (170) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{C4Ii8cYC.js → 2Eo3qwxj.js} +1 -1
  3. package/.output/public/_nuxt/{lfg-J79K.js → 2ixlK8td.js} +1 -1
  4. package/.output/public/_nuxt/{D57E8FC4.js → 2nDmPuey.js} +1 -1
  5. package/.output/public/_nuxt/{rVZcJ6Pz.js → 6f0CtDWh.js} +1 -1
  6. package/.output/public/_nuxt/{46eRQaVv.js → 7VIfpS3K.js} +1 -1
  7. package/.output/public/_nuxt/{BD07a6OS.js → 8T7bItPs.js} +3 -3
  8. package/.output/public/_nuxt/{Dc_VwXJs.js → B2ejvp4F.js} +1 -1
  9. package/.output/public/_nuxt/{bHsFNLQP.js → B3EVQLy0.js} +1 -1
  10. package/.output/public/_nuxt/{D_1GDAlv.js → B3WWnSJo.js} +1 -1
  11. package/.output/public/_nuxt/{CtNN2F57.js → B6kGLfxE.js} +1 -1
  12. package/.output/public/_nuxt/{BHAaeL5L.js → B8E4nRtc.js} +1 -1
  13. package/.output/public/_nuxt/{CIDjuJ7I.js → BF1GoXYw.js} +1 -1
  14. package/.output/public/_nuxt/{DEmzTuCa.js → BFhzL-L6.js} +1 -1
  15. package/.output/public/_nuxt/{CruI_TS3.js → BH_Lonko.js} +1 -1
  16. package/.output/public/_nuxt/{DEBOaUgW.js → BIRrab0B.js} +1 -1
  17. package/.output/public/_nuxt/{swgNRlWy.js → BIRvCR2S.js} +1 -1
  18. package/.output/public/_nuxt/{B8fLdQfp.js → BISpLSKY.js} +1 -1
  19. package/.output/public/_nuxt/{qI8JV5dU.js → BIhmDjJ8.js} +1 -1
  20. package/.output/public/_nuxt/BMsNdiuj.js +1 -0
  21. package/.output/public/_nuxt/{Bxs6RCfp.js → BP60VAOa.js} +1 -1
  22. package/.output/public/_nuxt/{D4wS6gzr.js → BRHBOpyl.js} +1 -1
  23. package/.output/public/_nuxt/{FGRiZ9J1.js → BSHWLnRg.js} +1 -1
  24. package/.output/public/_nuxt/BUa1DKMp.js +1 -0
  25. package/.output/public/_nuxt/{CIMG8oEU.js → BWgA6Icb.js} +1 -1
  26. package/.output/public/_nuxt/{Cwdn7ZtG.js → BY7b-3vi.js} +1 -1
  27. package/.output/public/_nuxt/{VRRYjCaC.js → BYRCVlFB.js} +1 -1
  28. package/.output/public/_nuxt/{C1wI_STa.js → B_IIr5Dj.js} +2 -2
  29. package/.output/public/_nuxt/{DFPu4h4a.js → BcGMY6mI.js} +1 -1
  30. package/.output/public/_nuxt/{CZvTOsiz.js → Bes0SO2V.js} +1 -1
  31. package/.output/public/_nuxt/{DmGbOc_e.js → Bf_52ujb.js} +1 -1
  32. package/.output/public/_nuxt/BgQoNHMg.js +1 -0
  33. package/.output/public/_nuxt/{BVkPh7-9.js → BiDXeTfW.js} +1 -1
  34. package/.output/public/_nuxt/{iTZxBLAr.js → BiIuqBpS.js} +3 -3
  35. package/.output/public/_nuxt/{9vdFTPZC.js → BiQQLbjx.js} +1 -1
  36. package/.output/public/_nuxt/{FmfogFAR.js → BivpMuR_.js} +1 -1
  37. package/.output/public/_nuxt/{CZQeFnOf.js → Bl7M4LXt.js} +1 -1
  38. package/.output/public/_nuxt/{zvDhkxQS.js → Bo6WXrLP.js} +1 -1
  39. package/.output/public/_nuxt/{rY0W1r76.js → BpN402qF.js} +2 -2
  40. package/.output/public/_nuxt/{DM9s28TO.js → BpyMs36w.js} +1 -1
  41. package/.output/public/_nuxt/{Brmj91Ns.js → Bq9rkJSd.js} +1 -1
  42. package/.output/public/_nuxt/{C3dJrgZH.js → BqSmw12h.js} +1 -1
  43. package/.output/public/_nuxt/{Dkpxacka.js → BrN_ntKk.js} +1 -1
  44. package/.output/public/_nuxt/{ChIzYvpz.js → Bx3A9QLd.js} +1 -1
  45. package/.output/public/_nuxt/{D5AjrkGO.js → Bzkzi9GX.js} +1 -1
  46. package/.output/public/_nuxt/{CCmSsj4q.js → C1pt3HyX.js} +1 -1
  47. package/.output/public/_nuxt/{B0_Iu2zi.js → C4XDZQVz.js} +1 -1
  48. package/.output/public/_nuxt/{BZjMzGZM.js → C4zN4OGX.js} +1 -1
  49. package/.output/public/_nuxt/{w3RSHXA6.js → C5IBUVPW.js} +1 -1
  50. package/.output/public/_nuxt/{wSCSxjgr.js → C6IV65Gy.js} +1 -1
  51. package/.output/public/_nuxt/{3AgfIirx.js → C6M-e7pT.js} +1 -1
  52. package/.output/public/_nuxt/{B1ea1Zc2.js → CAANELnI.js} +1 -1
  53. package/.output/public/_nuxt/{C7Wu2u5C.js → CAaAX5yO.js} +1 -1
  54. package/.output/public/_nuxt/{BGV4_re9.js → CAdrgifl.js} +1 -1
  55. package/.output/public/_nuxt/{BTImkTzA.js → CDX3o-x3.js} +1 -1
  56. package/.output/public/_nuxt/{CD6r4z4e.js → CJAiAVnY.js} +1 -1
  57. package/.output/public/_nuxt/{CjkXqgrT.js → CJa5E6Hb.js} +1 -1
  58. package/.output/public/_nuxt/{BHcVB9Fo.js → CKcctj3r.js} +1 -1
  59. package/.output/public/_nuxt/{Co86ycpI.js → CLk-ZoD9.js} +1 -1
  60. package/.output/public/_nuxt/{P3qGksT8.js → CSQciH0m.js} +1 -1
  61. package/.output/public/_nuxt/{BqyI8nU4.js → CSZw5eEq.js} +1 -1
  62. package/.output/public/_nuxt/{CrHLmWKE.js → CSu09NYz.js} +1 -1
  63. package/.output/public/_nuxt/{CZ5B974o.js → CSwU6kaw.js} +1 -1
  64. package/.output/public/_nuxt/{v-LIF5tR.js → CU58Jr3-.js} +1 -1
  65. package/.output/public/_nuxt/{DIMnGgEU.js → CXWZZrP6.js} +1 -1
  66. package/.output/public/_nuxt/{CGgHmnnS.js → CZT64TBr.js} +3 -3
  67. package/.output/public/_nuxt/{CLmiWiqr.js → CZZl10o-.js} +1 -1
  68. package/.output/public/_nuxt/{BwLYFg9w.js → CbLDrSEX.js} +1 -1
  69. package/.output/public/_nuxt/{DfAWgXhg.js → CfTBjUgE.js} +1 -1
  70. package/.output/public/_nuxt/{6k0gxaWW.js → CfiM4f33.js} +1 -1
  71. package/.output/public/_nuxt/{3hFj0Mf_.js → Cj2M_iYP.js} +1 -1
  72. package/.output/public/_nuxt/{BigIAhcT.js → CjPpmwck.js} +1 -1
  73. package/.output/public/_nuxt/{n5X4vNX9.js → CjhuD2Kg.js} +2 -2
  74. package/.output/public/_nuxt/{UQIfAAmf.js → CnLzT6v5.js} +1 -1
  75. package/.output/public/_nuxt/{DwEfItxe.js → CnViW7-O.js} +1 -1
  76. package/.output/public/_nuxt/{NNQizITf.js → Ctt1B8Lg.js} +1 -1
  77. package/.output/public/_nuxt/{m9zGH_2s.js → CuzrMna6.js} +1 -1
  78. package/.output/public/_nuxt/{B02JOKtW.js → Cv0TenvS.js} +1 -1
  79. package/.output/public/_nuxt/{BhtKu4xV.js → CzSXUP4q.js} +1 -1
  80. package/.output/public/_nuxt/{Dfi2mj_-.js → CzYLEcMN.js} +1 -1
  81. package/.output/public/_nuxt/{Cj3gDP-y.js → D-ysM-Cd.js} +1 -1
  82. package/.output/public/_nuxt/{CD_jDSWh.js → D2A5WweU.js} +1 -1
  83. package/.output/public/_nuxt/{Ehiy7Wkv.js → D5dMt776.js} +1 -1
  84. package/.output/public/_nuxt/{lA6pb86B.js → D5ut0FcJ.js} +1 -1
  85. package/.output/public/_nuxt/{CPb6IrVT.js → D7PJ9LEZ.js} +1 -1
  86. package/.output/public/_nuxt/{DmHn_Ae8.js → DA0qOQ-H.js} +1 -1
  87. package/.output/public/_nuxt/{BW0bq0Nu.js → DCKH9QC5.js} +1 -1
  88. package/.output/public/_nuxt/{DMCE1Up6.js → DCj0VKbE.js} +1 -1
  89. package/.output/public/_nuxt/{pFPRVtL-.js → DD864DXc.js} +1 -1
  90. package/.output/public/_nuxt/{CjVBL0o-.js → DEZB2UVM.js} +1 -1
  91. package/.output/public/_nuxt/{B27NM422.js → DGMjiZpH.js} +1 -1
  92. package/.output/public/_nuxt/{BMTKvzsm.js → DH9moCuc.js} +1 -1
  93. package/.output/public/_nuxt/{DuH9QzIG.js → DHmoYAOF.js} +1 -1
  94. package/.output/public/_nuxt/{QmdcFt0E.js → DKFnR3f3.js} +1 -1
  95. package/.output/public/_nuxt/{81-iumfM.js → DM2gKi5N.js} +1 -1
  96. package/.output/public/_nuxt/{d85YwuyC.js → DMar0qcv.js} +1 -1
  97. package/.output/public/_nuxt/{7msxmF5v.js → DNNOQPuJ.js} +1 -1
  98. package/.output/public/_nuxt/{CbLvLXmb.js → DSNEk90K.js} +1 -1
  99. package/.output/public/_nuxt/{B38X0n2w.js → DTb_yOmO.js} +1 -1
  100. package/.output/public/_nuxt/{QNqSZCYh.js → DWJ2tQkX.js} +1 -1
  101. package/.output/public/_nuxt/{uCsI7fpg.js → DbARsMbj.js} +1 -1
  102. package/.output/public/_nuxt/{Irw5CrIe.js → DbpzXcer.js} +1 -1
  103. package/.output/public/_nuxt/{6DKJrPTD.js → DcC8s2L0.js} +1 -1
  104. package/.output/public/_nuxt/{CxNJcty6.js → DcU1vVta.js} +1 -1
  105. package/.output/public/_nuxt/{BTs0cu3F.js → De4iE8YV.js} +1 -1
  106. package/.output/public/_nuxt/{B3TXSB_R.js → De94RhMH.js} +1 -1
  107. package/.output/public/_nuxt/{B8na0pik.js → DfIQdSBL.js} +1 -1
  108. package/.output/public/_nuxt/{pJF5jz72.js → DfLpZE5I.js} +1 -1
  109. package/.output/public/_nuxt/{DOs_ozN6.js → DhGDBmGP.js} +1 -1
  110. package/.output/public/_nuxt/{mLs_Q7_U.js → Dhf7T8TT.js} +1 -1
  111. package/.output/public/_nuxt/{CVTUqEcr.js → DjY2CmhB.js} +1 -1
  112. package/.output/public/_nuxt/{DfP6jcEM.js → Dj__3Bye.js} +1 -1
  113. package/.output/public/_nuxt/{iVfmia7K.js → DlOqPmYc.js} +1 -1
  114. package/.output/public/_nuxt/{Dbv2gAYq.js → Dm4dqn9Q.js} +1 -1
  115. package/.output/public/_nuxt/{BW-7wimi.js → Dn0NJtvh.js} +1 -1
  116. package/.output/public/_nuxt/{CDKJK4wW.js → DuDOxoNd.js} +1 -1
  117. package/.output/public/_nuxt/{CcJ0pNID.js → DwIL_HsX.js} +1 -1
  118. package/.output/public/_nuxt/DwbYPACo.js +1 -0
  119. package/.output/public/_nuxt/{Cfce_cVw.js → Dzjd35Uu.js} +1 -1
  120. package/.output/public/_nuxt/{BGa5KqPj.js → FOQllft2.js} +1 -1
  121. package/.output/public/_nuxt/{DoGLYOlq.js → FZ4DGVUC.js} +1 -1
  122. package/.output/public/_nuxt/{ByXbV9Xa.js → IwZpKn7a.js} +1 -1
  123. package/.output/public/_nuxt/{By5L5Smf.js → J00SROjJ.js} +1 -1
  124. package/.output/public/_nuxt/{1_nO5SO6.js → KEgU3jLl.js} +1 -1
  125. package/.output/public/_nuxt/{eB60bVen.js → KtLDewau.js} +1 -1
  126. package/.output/public/_nuxt/{IIvTjJqa.js → LFbgE4QY.js} +1 -1
  127. package/.output/public/_nuxt/{BtVAOj3K.js → MwLHW_S3.js} +1 -1
  128. package/.output/public/_nuxt/{Bn175bDC.js → SbeB_1mT.js} +1 -1
  129. package/.output/public/_nuxt/{Bk_mzzQ3.js → T9m6PG7Q.js} +1 -1
  130. package/.output/public/_nuxt/{DLfV22bF.js → UPUPLBes.js} +1 -1
  131. package/.output/public/_nuxt/{BaHB7JKe.js → UmRz2svG.js} +1 -1
  132. package/.output/public/_nuxt/{DB0uzc_1.js → UvHHDzTl.js} +1 -1
  133. package/.output/public/_nuxt/{C-tfM08H.js → YJeqx4Ll.js} +1 -1
  134. package/.output/public/_nuxt/{CSyssKl8.js → _fMejg0f.js} +1 -1
  135. package/.output/public/_nuxt/{DOTIy97K.js → aIIZqPga.js} +1 -1
  136. package/.output/public/_nuxt/{DXAD_aZW.js → awkGRsuS.js} +1 -1
  137. package/.output/public/_nuxt/builds/latest.json +1 -1
  138. package/.output/public/_nuxt/builds/meta/61420747-850d-4496-817a-d86f57e0fb7d.json +1 -0
  139. package/.output/public/_nuxt/{AMPsjNHJ.js → dGa7RyJ8.js} +1 -1
  140. package/.output/public/_nuxt/{gTGPvkTX.js → eTB2hbQs.js} +1 -1
  141. package/.output/public/_nuxt/{n_Arasow.js → iGKcFJAp.js} +1 -1
  142. package/.output/public/_nuxt/{D45gWhSU.js → k5H4Okf8.js} +1 -1
  143. package/.output/public/_nuxt/{DN5cHXGS.js → kbSxj5Sa.js} +1 -1
  144. package/.output/public/_nuxt/{CBJQYyqD.js → l0zNTVMN.js} +1 -1
  145. package/.output/public/_nuxt/{C_hl3kCw.js → lheR7PB2.js} +1 -1
  146. package/.output/public/_nuxt/{BVcLiEDk.js → p1xXbtMk.js} +1 -1
  147. package/.output/public/_nuxt/{B5oEzB-M.js → qBDqAV_3.js} +1 -1
  148. package/.output/public/_nuxt/{CJLlvuDm.js → qEwYRBS3.js} +1 -1
  149. package/.output/public/_nuxt/{RIAd5Wd1.js → tHI-osWJ.js} +1 -1
  150. package/.output/public/_nuxt/{DoSrePUc.js → tIRQIyWk.js} +1 -1
  151. package/.output/public/_nuxt/{D5IKvGig.js → uP6kBJyw.js} +1 -1
  152. package/.output/public/_nuxt/{By6urPVf.js → yyeTZy_R.js} +1 -1
  153. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  154. package/.output/server/chunks/build/styles.mjs +2 -2
  155. package/.output/server/chunks/nitro/nitro.mjs +900 -891
  156. package/.output/server/chunks/routes/{terminal.mjs → _ws/terminal.mjs} +39 -28
  157. package/.output/server/chunks/routes/_ws/terminal.mjs.map +1 -0
  158. package/.output/server/chunks/routes/notifications.mjs +1 -1
  159. package/.output/server/package.json +1 -1
  160. package/app/composables/useTerminal.ts +1 -1
  161. package/package.json +1 -1
  162. package/server/routes/_ws/terminal.ts +111 -0
  163. package/server/utils/pty-manager.ts +12 -3
  164. package/.output/public/_nuxt/CNB4wNeh.js +0 -1
  165. package/.output/public/_nuxt/CnB-ybCZ.js +0 -1
  166. package/.output/public/_nuxt/DAjV9Cip.js +0 -1
  167. package/.output/public/_nuxt/Suor9Vto.js +0 -1
  168. package/.output/public/_nuxt/builds/meta/d37c41da-8cec-4479-a3ac-3097aa4fb2e0.json +0 -1
  169. package/.output/server/chunks/routes/terminal.mjs.map +0 -1
  170. package/server/routes/terminal.ts +0 -98
@@ -1 +1 @@
1
- import{a7 as Ye,d as D,aQ as ce,aR as Ve,aS as Le,e as P,h as j,a9 as Ee,a4 as pe,c as _,o,w as b,r as C,aa as W,a as e,M as R,al as ae,am as ve,m as E,f as Pe,ac as ye,aF as Xe,X as Me,F as Ze,Z as V,ao as de,bF as Qe,aY as Je,a6 as et,u as be,C as le,B as ue,bB as tt,P as Z,a$ as at,aG as _e,aA as Ke,aH as ke,bg as lt,bV as it,bo as rt,T as nt,a5 as ot,b6 as st,aq as ut,W as dt,aB as ct,aC as pt,aD as ne,aZ as Oe,aN as ft,ax as gt,ay as mt,ap as $e,b8 as vt,aO as yt,$ as O,_ as me,az as De,af as oe,ab as Be,a1 as se,bW as ht,bX as Re,aP as bt}from"./CGgHmnnS.js";import{u as _t}from"./Cj3gDP-y.js";import{u as St}from"./CNB4wNeh.js";import{a as xt,b as qt,P as Ct,c as It}from"./DIMnGgEU.js";import{a as wt,u as Tt,F as Bt}from"./B02JOKtW.js";import{u as zt}from"./DEmzTuCa.js";import{u as We}from"./6k0gxaWW.js";import{f as Fe}from"./CZQeFnOf.js";import{u as Ae}from"./Suor9Vto.js";function Ne(i,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY){return Math.min(a,Math.max(s,i))}const Pt=[" ","Enter","ArrowUp","ArrowDown"],kt=[" ","Enter"],U=10;function he(i,s,a){return i===void 0?!1:Array.isArray(i)?i.some(t=>ze(t,s,a)):ze(i,s,a)}function ze(i,s,a){return i===void 0||s===void 0?!1:typeof i=="string"?i===s:typeof a=="function"?a(i,s):typeof a=="string"?i?.[a]===s?.[a]:Ye(i,s)}function At(i){return i==null||i===""||Array.isArray(i)&&i.length===0}const Lt={key:0,value:""},[Q,He]=ce("SelectRoot");var Et=D({inheritAttrs:!1,__name:"SelectRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:open"],setup(i,{emit:s}){const a=i,t=s,{required:n,disabled:u,multiple:m,dir:S}=Ve(a),v=Le(a,"modelValue",t,{defaultValue:a.defaultValue??(m.value?[]:void 0),passive:a.modelValue===void 0,deep:!0}),y=Le(a,"open",t,{defaultValue:a.defaultOpen,passive:a.open===void 0}),B=P(),w=P(),x=P({x:0,y:0}),I=j(()=>m.value&&Array.isArray(v.value)?v.value?.length===0:Ee(v.value));pe({isProvider:!0});const c=_t(S),$=St(B),A=P(new Set),G=j(()=>Array.from(A.value).map(r=>r.value).join(";"));function M(r){if(m.value){const h=Array.isArray(v.value)?[...v.value]:[],d=h.findIndex(f=>ze(f,r,a.by));d===-1?h.push(r):h.splice(d,1),v.value=[...h]}else v.value=r}function k(r){return Array.from(A.value).find(h=>he(r,h.value,a.by))}return He({triggerElement:B,onTriggerChange:r=>{B.value=r},valueElement:w,onValueElementChange:r=>{w.value=r},contentId:"",modelValue:v,onValueChange:M,by:a.by,open:y,multiple:m,required:n,onOpenChange:r=>{y.value=r},dir:c,triggerPointerDownPosRef:x,disabled:u,isEmptyModelValue:I,optionsSet:A,onOptionAdd:r=>{const h=k(r.value);h&&A.value.delete(h),A.value.add(r)},onOptionRemove:r=>{const h=k(r.value);h&&A.value.delete(h)}}),(r,h)=>(o(),_(e(xt),null,{default:b(()=>[C(r.$slots,"default",{modelValue:e(v),open:e(y)}),e($)?(o(),_(Dt,{key:G.value,"aria-hidden":"true",tabindex:"-1",multiple:e(m),required:e(n),name:r.name,autocomplete:r.autocomplete,disabled:e(u),value:e(v)},{default:b(()=>[e(Ee)(e(v))?(o(),R("option",Lt)):W("v-if",!0),(o(!0),R(ae,null,ve(Array.from(A.value),d=>(o(),R("option",E({key:d.value??""},{ref_for:!0},d),null,16))),128))]),_:1},8,["multiple","required","name","autocomplete","disabled","value"])):W("v-if",!0)]),_:3}))}}),Ot=Et,$t=D({__name:"BubbleSelect",props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(i){const s=i,a=P(),t=Q();Pe(()=>s.value,(u,m)=>{const S=window.HTMLSelectElement.prototype,y=Object.getOwnPropertyDescriptor(S,"value").set;if(u!==m&&y&&a.value){const B=new Event("change",{bubbles:!0});y.call(a.value,u),a.value.dispatchEvent(B)}});function n(u){t.onValueChange(u.target.value)}return(u,m)=>(o(),_(e(Xe),{"as-child":""},{default:b(()=>[ye("select",E({ref_key:"selectElement",ref:a},s,{onInput:n}),[C(u.$slots,"default")],16)]),_:3}))}}),Dt=$t,Rt=D({__name:"SelectPopperPosition",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:U},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(i){const a=Me(i);return(t,n)=>(o(),_(e(qt),E(e(a),{style:{boxSizing:"border-box","--reka-select-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-select-content-available-width":"var(--reka-popper-available-width)","--reka-select-content-available-height":"var(--reka-popper-available-height)","--reka-select-trigger-width":"var(--reka-popper-anchor-width)","--reka-select-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:b(()=>[C(t.$slots,"default")]),_:3},16))}}),Ft=Rt;const je={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[Se,Ge]=ce("SelectContent");var Nt=D({__name:"SelectContentImpl",props:{position:{type:String,required:!1,default:"item-aligned"},bodyLock:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(i,{emit:s}){const a=i,t=s,n=Q();zt(),wt(a.bodyLock);const{CollectionSlot:u,getItems:m}=pe(),S=P();Tt(S);const{search:v,handleTypeaheadSearch:y}=We(),B=P(),w=P(),x=P(),I=P(!1),c=P(!1),$=P(!1);function A(){w.value&&S.value&&Fe([w.value,S.value])}Pe(I,()=>{A()});const{onOpenChange:G,triggerPointerDownPosRef:M}=n;Ze(d=>{if(!S.value)return;let f={x:0,y:0};const q=z=>{f={x:Math.abs(Math.round(z.pageX)-(M.value?.x??0)),y:Math.abs(Math.round(z.pageY)-(M.value?.y??0))}},T=z=>{z.pointerType!=="touch"&&(f.x<=10&&f.y<=10?z.preventDefault():S.value?.contains(z.target)||G(!1),document.removeEventListener("pointermove",q),M.value=null)};M.value!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",T,{capture:!0,once:!0})),d(()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",T,{capture:!0})})});function k(d){const f=d.ctrlKey||d.altKey||d.metaKey;if(d.key==="Tab"&&d.preventDefault(),!f&&d.key.length===1&&y(d.key,m()),["ArrowUp","ArrowDown","Home","End"].includes(d.key)){let T=[...m().map(z=>z.ref)];if(["ArrowUp","End"].includes(d.key)&&(T=T.slice().reverse()),["ArrowUp","ArrowDown"].includes(d.key)){const z=d.target,X=T.indexOf(z);T=T.slice(X+1)}setTimeout(()=>Fe(T)),d.preventDefault()}}const r=j(()=>a.position==="popper"?a:{}),h=Me(r.value);return Ge({content:S,viewport:B,onViewportChange:d=>{B.value=d},itemRefCallback:(d,f,q)=>{const T=!c.value&&!q,z=he(n.modelValue.value,f,n.by);if(n.multiple.value){if($.value)return;(z||T)&&(w.value=d,z&&($.value=!0))}else(z||T)&&(w.value=d);T&&(c.value=!0)},selectedItem:w,selectedItemText:x,onItemLeave:()=>{S.value?.focus()},itemTextRefCallback:(d,f,q)=>{const T=!c.value&&!q;(he(n.modelValue.value,f,n.by)||T)&&(x.value=d)},focusSelectedItem:A,position:a.position,isPositioned:I,searchRef:v}),(d,f)=>(o(),_(e(u),null,{default:b(()=>[V(e(Bt),{"as-child":"",onMountAutoFocus:f[6]||(f[6]=de(()=>{},["prevent"])),onUnmountAutoFocus:f[7]||(f[7]=q=>{t("closeAutoFocus",q),!q.defaultPrevented&&(e(n).triggerElement.value?.focus({preventScroll:!0}),q.preventDefault())})},{default:b(()=>[V(e(Qe),{"as-child":"","disable-outside-pointer-events":"",onFocusOutside:f[2]||(f[2]=de(()=>{},["prevent"])),onDismiss:f[3]||(f[3]=q=>e(n).onOpenChange(!1)),onEscapeKeyDown:f[4]||(f[4]=q=>t("escapeKeyDown",q)),onPointerDownOutside:f[5]||(f[5]=q=>t("pointerDownOutside",q))},{default:b(()=>[(o(),_(Je(d.position==="popper"?Ft:Wt),E({...d.$attrs,...e(h)},{id:e(n).contentId,ref:q=>{const T=e(et)(q);T?.hasAttribute("data-reka-popper-content-wrapper")?S.value=T.firstElementChild:S.value=T},role:"listbox","data-state":e(n).open.value?"open":"closed",dir:e(n).dir.value,style:{display:"flex",flexDirection:"column",outline:"none"},onContextmenu:f[0]||(f[0]=de(()=>{},["prevent"])),onPlaced:f[1]||(f[1]=q=>I.value=!0),onKeydown:k}),{default:b(()=>[C(d.$slots,"default")]),_:3},16,["id","data-state","dir","onKeydown"]))]),_:3})]),_:3})]),_:3}))}}),Vt=Nt;const[Ta,Mt]=ce("SelectItemAlignedPosition");var Kt=D({inheritAttrs:!1,__name:"SelectItemAlignedPosition",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["placed"],setup(i,{emit:s}){const a=i,t=s,{getItems:n}=pe(),u=Q(),m=Se(),S=P(!1),v=P(!0),y=P(),{forwardRef:B,currentElement:w}=be(),{viewport:x,selectedItem:I,selectedItemText:c,focusSelectedItem:$}=m;function A(){if(u.triggerElement.value&&u.valueElement.value&&y.value&&w.value&&x?.value&&I?.value&&c?.value){const k=u.triggerElement.value.getBoundingClientRect(),r=w.value.getBoundingClientRect(),h=u.valueElement.value.getBoundingClientRect(),d=c.value.getBoundingClientRect();if(u.dir.value!=="rtl"){const K=d.left-r.left,l=h.left-K,N=k.left-l,Y=k.width+N,Ie=Math.max(Y,r.width),we=window.innerWidth-U,Te=Ne(l,U,Math.max(U,we-Ie));y.value.style.minWidth=`${Y}px`,y.value.style.left=`${Te}px`}else{const K=r.right-d.right,l=window.innerWidth-h.right-K,N=window.innerWidth-k.right-l,Y=k.width+N,Ie=Math.max(Y,r.width),we=window.innerWidth-U,Te=Ne(l,U,Math.max(U,we-Ie));y.value.style.minWidth=`${Y}px`,y.value.style.right=`${Te}px`}const f=n().map(K=>K.ref),q=window.innerHeight-U*2,T=x.value.scrollHeight,z=window.getComputedStyle(w.value),X=Number.parseInt(z.borderTopWidth,10),fe=Number.parseInt(z.paddingTop,10),p=Number.parseInt(z.borderBottomWidth,10),ge=Number.parseInt(z.paddingBottom,10),ie=X+fe+T+ge+p,xe=Math.min(I.value.offsetHeight*5,ie),ee=window.getComputedStyle(x.value),qe=Number.parseInt(ee.paddingTop,10),Ce=Number.parseInt(ee.paddingBottom,10),te=k.top+k.height/2-U,L=q-te,g=I.value.offsetHeight/2,H=I.value.offsetTop+g,F=X+fe+H,re=ie-F;if(F<=te){const K=I.value===f[f.length-1];y.value.style.bottom="0px";const l=w.value.clientHeight-x.value.offsetTop-x.value.offsetHeight,N=Math.max(L,g+(K?Ce:0)+l+p),Y=F+N;y.value.style.height=`${Y}px`}else{const K=I.value===f[0];y.value.style.top="0px";const N=Math.max(te,X+x.value.offsetTop+(K?qe:0)+g)+re;y.value.style.height=`${N}px`,x.value.scrollTop=F-te+x.value.offsetTop}y.value.style.margin=`${U}px 0`,y.value.style.minHeight=`${xe}px`,y.value.style.maxHeight=`${q}px`,t("placed"),requestAnimationFrame(()=>S.value=!0)}}const G=P("");le(async()=>{await ue(),A(),w.value&&(G.value=window.getComputedStyle(w.value).zIndex)});function M(k){k&&v.value===!0&&(A(),$?.(),v.value=!1)}return tt(u.triggerElement,()=>{A()}),Mt({contentWrapper:y,shouldExpandOnScrollRef:S,onScrollButtonChange:M}),(k,r)=>(o(),R("div",{ref_key:"contentWrapperElement",ref:y,style:at({display:"flex",flexDirection:"column",position:"fixed",zIndex:G.value})},[V(e(Z),E({ref:e(B),style:{boxSizing:"border-box",maxHeight:"100%"}},{...k.$attrs,...a}),{default:b(()=>[C(k.$slots,"default")]),_:3},16)],4))}}),Wt=Kt,Ht=D({__name:"SelectArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(i){const s=i,a=Q(),t=Se(je);return(n,u)=>e(a).open.value&&e(t).position==="popper"?(o(),_(e(Ct),_e(E({key:0},s)),{default:b(()=>[C(n.$slots,"default")]),_:3},16)):W("v-if",!0)}}),jt=Ht,Gt=D({inheritAttrs:!1,__name:"SelectProvider",props:{context:{type:Object,required:!0}},setup(i){return He(i.context),Ge(je),(a,t)=>C(a.$slots,"default")}}),Ut=Gt;const Yt={key:1};var Xt=D({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(i,{emit:s}){const a=i,n=Ke(a,s),u=Q(),m=P();le(()=>{m.value=new DocumentFragment});const S=P(),v=j(()=>a.forceMount||u.open.value),y=P(v.value);return Pe(v,()=>{setTimeout(()=>y.value=v.value)}),(B,w)=>v.value||y.value||S.value?.present?(o(),_(e(lt),{key:0,ref_key:"presenceRef",ref:S,present:v.value},{default:b(()=>[V(Vt,_e(ke({...e(n),...B.$attrs})),{default:b(()=>[C(B.$slots,"default")]),_:3},16)]),_:3},8,["present"])):m.value?(o(),R("div",Yt,[(o(),_(it,{to:m.value},[V(Ut,{context:e(u)},{default:b(()=>[C(B.$slots,"default")]),_:3},8,["context"])],8,["to"]))])):W("v-if",!0)}}),Zt=Xt;const[Qt,Jt]=ce("SelectGroup");var ea=D({__name:"SelectGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(i){const s=i,a=Ae(void 0,"reka-select-group");return Jt({id:a}),(t,n)=>(o(),_(e(Z),E({role:"group"},s,{"aria-labelledby":e(a)}),{default:b(()=>[C(t.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),ta=ea;const[Ue,aa]=ce("SelectItem");var la=D({__name:"SelectItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(i,{emit:s}){const a=i,t=s,{disabled:n}=Ve(a),u=Q(),m=Se(),{forwardRef:S,currentElement:v}=be(),{CollectionItem:y}=pe(),B=j(()=>he(u.modelValue?.value,a.value,u.by)),w=P(!1),x=P(a.textValue??""),I=Ae(void 0,"reka-select-item-text"),c="select.select";async function $(r){if(r.defaultPrevented)return;const h={originalEvent:r,value:a.value};rt(c,A,h)}async function A(r){await ue(),t("select",r),!r.defaultPrevented&&(n.value||(u.onValueChange(a.value),u.multiple.value||u.onOpenChange(!1)))}async function G(r){await ue(),!r.defaultPrevented&&(n.value?m.onItemLeave?.():r.currentTarget?.focus({preventScroll:!0}))}async function M(r){await ue(),!r.defaultPrevented&&r.currentTarget===nt()&&m.onItemLeave?.()}async function k(r){await ue(),!(r.defaultPrevented||m.searchRef?.value!==""&&r.key===" ")&&(kt.includes(r.key)&&$(r),r.key===" "&&r.preventDefault())}if(a.value==="")throw new Error("A <SelectItem /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return le(()=>{v.value&&m.itemRefCallback(v.value,a.value,a.disabled)}),aa({value:a.value,disabled:n,textId:I,isSelected:B,onItemTextChange:r=>{x.value=((x.value||r?.textContent)??"").trim()}}),(r,h)=>(o(),_(e(y),{value:{textValue:x.value}},{default:b(()=>[V(e(Z),{ref:e(S),role:"option","aria-labelledby":e(I),"data-highlighted":w.value?"":void 0,"aria-selected":B.value,"data-state":B.value?"checked":"unchecked","aria-disabled":e(n)||void 0,"data-disabled":e(n)?"":void 0,tabindex:e(n)?void 0:-1,as:r.as,"as-child":r.asChild,onFocus:h[0]||(h[0]=d=>w.value=!0),onBlur:h[1]||(h[1]=d=>w.value=!1),onPointerup:$,onPointerdown:h[2]||(h[2]=d=>{d.currentTarget.focus({preventScroll:!0})}),onTouchend:h[3]||(h[3]=de(()=>{},["prevent","stop"])),onPointermove:G,onPointerleave:M,onKeydown:k},{default:b(()=>[C(r.$slots,"default")]),_:3},8,["aria-labelledby","data-highlighted","aria-selected","data-state","aria-disabled","data-disabled","tabindex","as","as-child"])]),_:3},8,["value"]))}}),ia=la,ra=D({__name:"SelectItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(i){const s=i,a=Ue();return(t,n)=>e(a).isSelected.value?(o(),_(e(Z),E({key:0,"aria-hidden":"true"},s),{default:b(()=>[C(t.$slots,"default")]),_:3},16)):W("v-if",!0)}}),na=ra,oa=D({inheritAttrs:!1,__name:"SelectItemText",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(i){const s=i,a=Q(),t=Se(),n=Ue(),{forwardRef:u,currentElement:m}=be(),S=j(()=>({value:n.value,disabled:n.disabled.value,textContent:m.value?.textContent??n.value?.toString()??""}));return le(()=>{m.value&&(n.onItemTextChange(m.value),t.itemTextRefCallback(m.value,n.value,n.disabled.value),a.onOptionAdd(S.value))}),ot(()=>{a.onOptionRemove(S.value)}),(v,y)=>(o(),_(e(Z),E({id:e(n).textId,ref:e(u)},{...s,...v.$attrs}),{default:b(()=>[C(v.$slots,"default")]),_:3},16,["id"]))}}),sa=oa,ua=D({__name:"SelectLabel",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(i){const s=i,a=Qt({id:""});return(t,n)=>(o(),_(e(Z),E(s,{id:e(a).id}),{default:b(()=>[C(t.$slots,"default")]),_:3},16,["id"]))}}),da=ua,ca=D({__name:"SelectPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(i){const s=i;return(a,t)=>(o(),_(e(st),_e(ke(s)),{default:b(()=>[C(a.$slots,"default")]),_:3},16))}}),pa=ca,fa=D({__name:"SelectSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(i){const s=i;return(a,t)=>(o(),_(e(Z),E({"aria-hidden":"true"},s),{default:b(()=>[C(a.$slots,"default")]),_:3},16))}}),ga=fa,ma=D({__name:"SelectTrigger",props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(i){const s=i,a=Q(),{forwardRef:t,currentElement:n}=be(),u=j(()=>a.disabled?.value||s.disabled);a.contentId||=Ae(void 0,"reka-select-content"),le(()=>{a.onTriggerChange(n.value)});const{getItems:m}=pe(),{search:S,handleTypeaheadSearch:v,resetTypeahead:y}=We();function B(){u.value||(a.onOpenChange(!0),y())}function w(x){B(),a.triggerPointerDownPosRef.value={x:Math.round(x.pageX),y:Math.round(x.pageY)}}return(x,I)=>(o(),_(e(It),{"as-child":"",reference:x.reference},{default:b(()=>[V(e(Z),{ref:e(t),role:"combobox",type:x.as==="button"?"button":void 0,"aria-controls":e(a).contentId,"aria-expanded":e(a).open.value||!1,"aria-required":e(a).required?.value,"aria-autocomplete":"none",disabled:u.value,dir:e(a)?.dir.value,"data-state":e(a)?.open.value?"open":"closed","data-disabled":u.value?"":void 0,"data-placeholder":e(At)(e(a).modelValue?.value)?"":void 0,"as-child":x.asChild,as:x.as,onClick:I[0]||(I[0]=c=>{c?.currentTarget?.focus()}),onPointerdown:I[1]||(I[1]=c=>{if(c.pointerType==="touch")return c.preventDefault();const $=c.target;$.hasPointerCapture(c.pointerId)&&$.releasePointerCapture(c.pointerId),c.button===0&&c.ctrlKey===!1&&(w(c),c.preventDefault())}),onPointerup:I[2]||(I[2]=de(c=>{c.pointerType==="touch"&&w(c)},["prevent"])),onKeydown:I[3]||(I[3]=c=>{const $=e(S)!=="";!(c.ctrlKey||c.altKey||c.metaKey)&&c.key.length===1&&$&&c.key===" "||(e(v)(c.key,e(m)()),e(Pt).includes(c.key)&&(B(),c.preventDefault()))})},{default:b(()=>[C(x.$slots,"default")]),_:3},8,["type","aria-controls","aria-expanded","aria-required","disabled","dir","data-state","data-disabled","data-placeholder","as-child","as"])]),_:3},8,["reference"]))}}),va=ma;const ya={slots:{base:["relative group rounded-md inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute inset-y-0 start-0 flex items-center",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute inset-y-0 end-0 flex items-center",trailingIcon:"shrink-0 text-dimmed",value:"truncate pointer-events-none",placeholder:"truncate text-dimmed",arrow:"fill-default",content:"max-h-60 w-(--reka-select-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-select-content-transform-origin) pointer-events-auto flex flex-col",viewport:"relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1",group:"p-1 isolate",empty:"text-center text-muted",label:"font-semibold text-highlighted",separator:"-mx-1 my-1 h-px bg-border",item:["group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50","transition-colors before:transition-colors"],itemLeadingIcon:["shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default","transition-colors"],itemLeadingAvatar:"shrink-0",itemLeadingAvatarSize:"",itemLeadingChip:"shrink-0",itemLeadingChipSize:"",itemTrailing:"ms-auto inline-flex gap-1.5 items-center",itemTrailingIcon:"shrink-0",itemWrapper:"flex-1 flex flex-col min-w-0",itemLabel:"truncate",itemDescription:"truncate text-muted"},variants:{fieldGroup:{horizontal:"not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",vertical:"not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"},size:{xs:{base:"px-2 py-1 text-xs gap-1",leading:"ps-2",trailing:"pe-2",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4",label:"p-1 text-[10px]/3 gap-1",item:"p-1 text-xs gap-1",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailingIcon:"size-4",empty:"p-1 text-xs"},sm:{base:"px-2.5 py-1.5 text-xs gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4",label:"p-1.5 text-[10px]/3 gap-1.5",item:"p-1.5 text-xs gap-1.5",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailingIcon:"size-4",empty:"p-1.5 text-xs"},md:{base:"px-2.5 py-1.5 text-sm gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5",label:"p-1.5 text-xs gap-1.5",item:"p-1.5 text-sm gap-1.5",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailingIcon:"size-5",empty:"p-1.5 text-sm"},lg:{base:"px-3 py-2 text-sm gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5",label:"p-2 text-xs gap-2",item:"p-2 text-sm gap-2",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailingIcon:"size-5",empty:"p-2 text-sm"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6",label:"p-2 text-sm gap-2",item:"p-2 text-base gap-2",itemLeadingIcon:"size-6",itemLeadingAvatarSize:"xs",itemLeadingChip:"size-6",itemLeadingChipSize:"lg",itemTrailingIcon:"size-6",empty:"p-2 text-base"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-success"},{color:"info",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-info"},{color:"warning",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-warning"},{color:"error",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-error"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-inverted"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},Ba=Object.assign({inheritAttrs:!1},{__name:"USelect",props:{id:{type:String,required:!1},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},valueKey:{type:null,required:!1,default:"value"},labelKey:{type:null,required:!1,default:"label"},descriptionKey:{type:null,required:!1,default:"description"},items:{type:null,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:Object,required:!1},multiple:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},class:{type:null,required:!1},ui:{type:null,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["update:open","change","blur","focus","update:modelValue"],setup(i,{expose:s,emit:a}){const t=i,n=a,u=ut(),m=dt(),S=Ke(ct(t,"open","defaultOpen","disabled","autocomplete","required","multiple"),n),v=pt(ne(()=>t.portal)),y=ne(()=>Oe(t.content,{side:"bottom",sideOffset:8,collisionPadding:8,position:"popper"})),B=ne(()=>t.arrow),{emitFormChange:w,emitFormInput:x,emitFormBlur:I,emitFormFocus:c,size:$,color:A,id:G,name:M,highlight:k,disabled:r,ariaAttrs:h}=ft(t),{orientation:d,size:f}=gt(t),{isLeading:q,isTrailing:T,leadingIconName:z,trailingIconName:X}=mt(ne(()=>Oe(t,{trailingIcon:m.ui.icons.chevronDown}))),fe=j(()=>f.value||$.value),p=j(()=>$e({extend:$e(ya),...m.ui?.select||{}})({color:A.value,variant:t.variant,size:fe?.value,loading:t.loading,highlight:k.value,leading:q.value||!!t.avatar||!!u.leading,trailing:T.value||!!u.trailing,fieldGroup:d.value})),ge=j(()=>t.items?.length?vt(t.items)?t.items:[t.items]:[]),ie=j(()=>ge.value.flatMap(g=>g));function xe(g){if(t.multiple&&Array.isArray(g)){const H=g.map(F=>Re(ie.value,F,{labelKey:t.labelKey,valueKey:t.valueKey})).filter(F=>F!=null&&F!=="");return H.length>0?H.join(", "):void 0}return Re(ie.value,g,{labelKey:t.labelKey,valueKey:t.valueKey})}const ee=yt("triggerRef");function qe(){t.autofocus&&ee.value?.$el?.focus({focusVisible:!0})}le(()=>{setTimeout(()=>{qe()},t.autofocusDelay)});function Ce(g){t.modelModifiers?.trim&&(g=g?.trim()??null),t.modelModifiers?.number&&(g=bt(g)),t.modelModifiers?.nullable&&(g??=null),t.modelModifiers?.optional&&(g??=void 0);const H=new Event("change",{target:{value:g}});n("change",H),w(),x()}function te(g){if(g){const H=new FocusEvent("focus");n("focus",H),c()}else{const H=new FocusEvent("blur");n("blur",H),I()}}function L(g){return typeof g=="object"&&g!==null}return s({triggerRef:ne(()=>ee.value?.$el)}),(g,H)=>(o(),_(e(Ot),E({name:e(M)},e(S),{autocomplete:i.autocomplete,disabled:e(r),"default-value":i.defaultValue,"model-value":i.modelValue,"onUpdate:modelValue":Ce,"onUpdate:open":te}),{default:b(({modelValue:F,open:re})=>[V(e(va),E({id:e(G),ref_key:"triggerRef",ref:ee,"data-slot":"base",class:p.value.base({class:[t.ui?.base,t.class]})},{...g.$attrs,...e(h)}),{default:b(()=>[e(q)||i.avatar||u.leading?(o(),R("span",{key:0,"data-slot":"leading",class:O(p.value.leading({class:t.ui?.leading}))},[C(g.$slots,"leading",{modelValue:F,open:re,ui:p.value},()=>[e(q)&&e(z)?(o(),_(me,{key:0,name:e(z),"data-slot":"leadingIcon",class:O(p.value.leadingIcon({class:t.ui?.leadingIcon}))},null,8,["name","class"])):i.avatar?(o(),_(De,E({key:1,size:t.ui?.itemLeadingAvatarSize||p.value.itemLeadingAvatarSize()},i.avatar,{"data-slot":"itemLeadingAvatar",class:p.value.itemLeadingAvatar({class:t.ui?.itemLeadingAvatar})}),null,16,["size","class"])):W("",!0)])],2)):W("",!0),C(g.$slots,"default",{modelValue:F,open:re,ui:p.value},()=>[(o(!0),R(ae,null,ve([xe(F)],J=>(o(),R(ae,{key:J},[J!=null?(o(),R("span",{key:0,"data-slot":"value",class:O(p.value.value({class:t.ui?.value}))},oe(J),3)):(o(),R("span",{key:1,"data-slot":"placeholder",class:O(p.value.placeholder({class:t.ui?.placeholder}))},oe(i.placeholder??" "),3))],64))),128))]),e(T)||u.trailing?(o(),R("span",{key:1,"data-slot":"trailing",class:O(p.value.trailing({class:t.ui?.trailing}))},[C(g.$slots,"trailing",{modelValue:F,open:re,ui:p.value},()=>[e(X)?(o(),_(me,{key:0,name:e(X),"data-slot":"trailingIcon",class:O(p.value.trailingIcon({class:t.ui?.trailingIcon}))},null,8,["name","class"])):W("",!0)])],2)):W("",!0)]),_:2},1040,["id","class"]),V(e(pa),_e(ke(e(v))),{default:b(()=>[V(e(Zt),E({"data-slot":"content",class:p.value.content({class:t.ui?.content})},y.value),{default:b(()=>[C(g.$slots,"content-top"),ye("div",{role:"presentation","data-slot":"viewport",class:O(p.value.viewport({class:t.ui?.viewport}))},[(o(!0),R(ae,null,ve(ge.value,(J,K)=>(o(),_(e(ta),{key:`group-${K}`,"data-slot":"group",class:O(p.value.group({class:t.ui?.group}))},{default:b(()=>[(o(!0),R(ae,null,ve(J,(l,N)=>(o(),R(ae,{key:`group-${K}-${N}`},[L(l)&&l.type==="label"?(o(),_(e(da),{key:0,"data-slot":"label",class:O(p.value.label({class:[t.ui?.label,l.ui?.label,l.class]}))},{default:b(()=>[Be(oe(e(se)(l,t.labelKey)),1)]),_:2},1032,["class"])):L(l)&&l.type==="separator"?(o(),_(e(ga),{key:1,"data-slot":"separator",class:O(p.value.separator({class:[t.ui?.separator,l.ui?.separator,l.class]}))},null,8,["class"])):(o(),_(e(ia),{key:2,"data-slot":"item",class:O(p.value.item({class:[t.ui?.item,L(l)&&l.ui?.item,L(l)&&l.class]})),disabled:L(l)&&l.disabled,value:L(l)?e(se)(l,t.valueKey):l,onSelect:Y=>L(l)&&l.onSelect?.(Y)},{default:b(()=>[C(g.$slots,"item",{item:l,index:N,ui:p.value},()=>[C(g.$slots,"item-leading",{item:l,index:N,ui:p.value},()=>[L(l)&&l.icon?(o(),_(me,{key:0,name:l.icon,"data-slot":"itemLeadingIcon",class:O(p.value.itemLeadingIcon({class:[t.ui?.itemLeadingIcon,l.ui?.itemLeadingIcon]}))},null,8,["name","class"])):L(l)&&l.avatar?(o(),_(De,E({key:1,size:l.ui?.itemLeadingAvatarSize||t.ui?.itemLeadingAvatarSize||p.value.itemLeadingAvatarSize()},{ref_for:!0},l.avatar,{"data-slot":"itemLeadingAvatar",class:p.value.itemLeadingAvatar({class:[t.ui?.itemLeadingAvatar,l.ui?.itemLeadingAvatar]})}),null,16,["size","class"])):L(l)&&l.chip?(o(),_(ht,E({key:2,size:l.ui?.itemLeadingChipSize||t.ui?.itemLeadingChipSize||p.value.itemLeadingChipSize(),inset:"",standalone:""},{ref_for:!0},l.chip,{"data-slot":"itemLeadingChip",class:p.value.itemLeadingChip({class:[t.ui?.itemLeadingChip,l.ui?.itemLeadingChip]})}),null,16,["size","class"])):W("",!0)]),ye("span",{"data-slot":"itemWrapper",class:O(p.value.itemWrapper({class:[t.ui?.itemWrapper,L(l)&&l.ui?.itemWrapper]}))},[V(e(sa),{"data-slot":"itemLabel",class:O(p.value.itemLabel({class:[t.ui?.itemLabel,L(l)&&l.ui?.itemLabel]}))},{default:b(()=>[C(g.$slots,"item-label",{item:l,index:N},()=>[Be(oe(L(l)?e(se)(l,t.labelKey):l),1)])]),_:2},1032,["class"]),L(l)&&(e(se)(l,t.descriptionKey)||u["item-description"])?(o(),R("span",{key:0,"data-slot":"itemDescription",class:O(p.value.itemDescription({class:[t.ui?.itemDescription,L(l)&&l.ui?.itemDescription]}))},[C(g.$slots,"item-description",{item:l,index:N},()=>[Be(oe(e(se)(l,t.descriptionKey)),1)])],2)):W("",!0)],2),ye("span",{"data-slot":"itemTrailing",class:O(p.value.itemTrailing({class:[t.ui?.itemTrailing,L(l)&&l.ui?.itemTrailing]}))},[C(g.$slots,"item-trailing",{item:l,index:N,ui:p.value}),V(e(na),{"as-child":""},{default:b(()=>[V(me,{name:i.selectedIcon||e(m).ui.icons.check,"data-slot":"itemTrailingIcon",class:O(p.value.itemTrailingIcon({class:[t.ui?.itemTrailingIcon,L(l)&&l.ui?.itemTrailingIcon]}))},null,8,["name","class"])]),_:2},1024)],2)])]),_:2},1032,["class","disabled","value","onSelect"]))],64))),128))]),_:2},1032,["class"]))),128))],2),C(g.$slots,"content-bottom"),i.arrow?(o(),_(e(jt),E({key:0},B.value,{"data-slot":"arrow",class:p.value.arrow({class:t.ui?.arrow})}),null,16,["class"])):W("",!0)]),_:3},16,["class"])]),_:3},16)]),_:3},16,["name","autocomplete","disabled","default-value","model-value"]))}});export{Ba as _};
1
+ import{a7 as Ye,d as D,aQ as ce,aR as Ve,aS as Le,e as P,h as j,a9 as Ee,a4 as pe,c as _,o,w as b,r as C,aa as W,a as e,M as R,al as ae,am as ve,m as E,f as Pe,ac as ye,aF as Xe,X as Me,F as Ze,Z as V,ao as de,bF as Qe,aY as Je,a6 as et,u as be,C as le,B as ue,bB as tt,P as Z,a$ as at,aG as _e,aA as Ke,aH as ke,bg as lt,bV as it,bo as rt,T as nt,a5 as ot,b6 as st,aq as ut,W as dt,aB as ct,aC as pt,aD as ne,aZ as Oe,aN as ft,ax as gt,ay as mt,ap as $e,b8 as vt,aO as yt,$ as O,_ as me,az as De,af as oe,ab as Be,a1 as se,bW as ht,bX as Re,aP as bt}from"./CZT64TBr.js";import{u as _t}from"./D-ysM-Cd.js";import{u as St}from"./BUa1DKMp.js";import{a as xt,b as qt,P as Ct,c as It}from"./CXWZZrP6.js";import{a as wt,u as Tt,F as Bt}from"./Cv0TenvS.js";import{u as zt}from"./BFhzL-L6.js";import{u as We}from"./CfiM4f33.js";import{f as Fe}from"./Bl7M4LXt.js";import{u as Ae}from"./DwbYPACo.js";function Ne(i,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY){return Math.min(a,Math.max(s,i))}const Pt=[" ","Enter","ArrowUp","ArrowDown"],kt=[" ","Enter"],U=10;function he(i,s,a){return i===void 0?!1:Array.isArray(i)?i.some(t=>ze(t,s,a)):ze(i,s,a)}function ze(i,s,a){return i===void 0||s===void 0?!1:typeof i=="string"?i===s:typeof a=="function"?a(i,s):typeof a=="string"?i?.[a]===s?.[a]:Ye(i,s)}function At(i){return i==null||i===""||Array.isArray(i)&&i.length===0}const Lt={key:0,value:""},[Q,He]=ce("SelectRoot");var Et=D({inheritAttrs:!1,__name:"SelectRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:open"],setup(i,{emit:s}){const a=i,t=s,{required:n,disabled:u,multiple:m,dir:S}=Ve(a),v=Le(a,"modelValue",t,{defaultValue:a.defaultValue??(m.value?[]:void 0),passive:a.modelValue===void 0,deep:!0}),y=Le(a,"open",t,{defaultValue:a.defaultOpen,passive:a.open===void 0}),B=P(),w=P(),x=P({x:0,y:0}),I=j(()=>m.value&&Array.isArray(v.value)?v.value?.length===0:Ee(v.value));pe({isProvider:!0});const c=_t(S),$=St(B),A=P(new Set),G=j(()=>Array.from(A.value).map(r=>r.value).join(";"));function M(r){if(m.value){const h=Array.isArray(v.value)?[...v.value]:[],d=h.findIndex(f=>ze(f,r,a.by));d===-1?h.push(r):h.splice(d,1),v.value=[...h]}else v.value=r}function k(r){return Array.from(A.value).find(h=>he(r,h.value,a.by))}return He({triggerElement:B,onTriggerChange:r=>{B.value=r},valueElement:w,onValueElementChange:r=>{w.value=r},contentId:"",modelValue:v,onValueChange:M,by:a.by,open:y,multiple:m,required:n,onOpenChange:r=>{y.value=r},dir:c,triggerPointerDownPosRef:x,disabled:u,isEmptyModelValue:I,optionsSet:A,onOptionAdd:r=>{const h=k(r.value);h&&A.value.delete(h),A.value.add(r)},onOptionRemove:r=>{const h=k(r.value);h&&A.value.delete(h)}}),(r,h)=>(o(),_(e(xt),null,{default:b(()=>[C(r.$slots,"default",{modelValue:e(v),open:e(y)}),e($)?(o(),_(Dt,{key:G.value,"aria-hidden":"true",tabindex:"-1",multiple:e(m),required:e(n),name:r.name,autocomplete:r.autocomplete,disabled:e(u),value:e(v)},{default:b(()=>[e(Ee)(e(v))?(o(),R("option",Lt)):W("v-if",!0),(o(!0),R(ae,null,ve(Array.from(A.value),d=>(o(),R("option",E({key:d.value??""},{ref_for:!0},d),null,16))),128))]),_:1},8,["multiple","required","name","autocomplete","disabled","value"])):W("v-if",!0)]),_:3}))}}),Ot=Et,$t=D({__name:"BubbleSelect",props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(i){const s=i,a=P(),t=Q();Pe(()=>s.value,(u,m)=>{const S=window.HTMLSelectElement.prototype,y=Object.getOwnPropertyDescriptor(S,"value").set;if(u!==m&&y&&a.value){const B=new Event("change",{bubbles:!0});y.call(a.value,u),a.value.dispatchEvent(B)}});function n(u){t.onValueChange(u.target.value)}return(u,m)=>(o(),_(e(Xe),{"as-child":""},{default:b(()=>[ye("select",E({ref_key:"selectElement",ref:a},s,{onInput:n}),[C(u.$slots,"default")],16)]),_:3}))}}),Dt=$t,Rt=D({__name:"SelectPopperPosition",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:U},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(i){const a=Me(i);return(t,n)=>(o(),_(e(qt),E(e(a),{style:{boxSizing:"border-box","--reka-select-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-select-content-available-width":"var(--reka-popper-available-width)","--reka-select-content-available-height":"var(--reka-popper-available-height)","--reka-select-trigger-width":"var(--reka-popper-anchor-width)","--reka-select-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:b(()=>[C(t.$slots,"default")]),_:3},16))}}),Ft=Rt;const je={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[Se,Ge]=ce("SelectContent");var Nt=D({__name:"SelectContentImpl",props:{position:{type:String,required:!1,default:"item-aligned"},bodyLock:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:"start"},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(i,{emit:s}){const a=i,t=s,n=Q();zt(),wt(a.bodyLock);const{CollectionSlot:u,getItems:m}=pe(),S=P();Tt(S);const{search:v,handleTypeaheadSearch:y}=We(),B=P(),w=P(),x=P(),I=P(!1),c=P(!1),$=P(!1);function A(){w.value&&S.value&&Fe([w.value,S.value])}Pe(I,()=>{A()});const{onOpenChange:G,triggerPointerDownPosRef:M}=n;Ze(d=>{if(!S.value)return;let f={x:0,y:0};const q=z=>{f={x:Math.abs(Math.round(z.pageX)-(M.value?.x??0)),y:Math.abs(Math.round(z.pageY)-(M.value?.y??0))}},T=z=>{z.pointerType!=="touch"&&(f.x<=10&&f.y<=10?z.preventDefault():S.value?.contains(z.target)||G(!1),document.removeEventListener("pointermove",q),M.value=null)};M.value!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",T,{capture:!0,once:!0})),d(()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",T,{capture:!0})})});function k(d){const f=d.ctrlKey||d.altKey||d.metaKey;if(d.key==="Tab"&&d.preventDefault(),!f&&d.key.length===1&&y(d.key,m()),["ArrowUp","ArrowDown","Home","End"].includes(d.key)){let T=[...m().map(z=>z.ref)];if(["ArrowUp","End"].includes(d.key)&&(T=T.slice().reverse()),["ArrowUp","ArrowDown"].includes(d.key)){const z=d.target,X=T.indexOf(z);T=T.slice(X+1)}setTimeout(()=>Fe(T)),d.preventDefault()}}const r=j(()=>a.position==="popper"?a:{}),h=Me(r.value);return Ge({content:S,viewport:B,onViewportChange:d=>{B.value=d},itemRefCallback:(d,f,q)=>{const T=!c.value&&!q,z=he(n.modelValue.value,f,n.by);if(n.multiple.value){if($.value)return;(z||T)&&(w.value=d,z&&($.value=!0))}else(z||T)&&(w.value=d);T&&(c.value=!0)},selectedItem:w,selectedItemText:x,onItemLeave:()=>{S.value?.focus()},itemTextRefCallback:(d,f,q)=>{const T=!c.value&&!q;(he(n.modelValue.value,f,n.by)||T)&&(x.value=d)},focusSelectedItem:A,position:a.position,isPositioned:I,searchRef:v}),(d,f)=>(o(),_(e(u),null,{default:b(()=>[V(e(Bt),{"as-child":"",onMountAutoFocus:f[6]||(f[6]=de(()=>{},["prevent"])),onUnmountAutoFocus:f[7]||(f[7]=q=>{t("closeAutoFocus",q),!q.defaultPrevented&&(e(n).triggerElement.value?.focus({preventScroll:!0}),q.preventDefault())})},{default:b(()=>[V(e(Qe),{"as-child":"","disable-outside-pointer-events":"",onFocusOutside:f[2]||(f[2]=de(()=>{},["prevent"])),onDismiss:f[3]||(f[3]=q=>e(n).onOpenChange(!1)),onEscapeKeyDown:f[4]||(f[4]=q=>t("escapeKeyDown",q)),onPointerDownOutside:f[5]||(f[5]=q=>t("pointerDownOutside",q))},{default:b(()=>[(o(),_(Je(d.position==="popper"?Ft:Wt),E({...d.$attrs,...e(h)},{id:e(n).contentId,ref:q=>{const T=e(et)(q);T?.hasAttribute("data-reka-popper-content-wrapper")?S.value=T.firstElementChild:S.value=T},role:"listbox","data-state":e(n).open.value?"open":"closed",dir:e(n).dir.value,style:{display:"flex",flexDirection:"column",outline:"none"},onContextmenu:f[0]||(f[0]=de(()=>{},["prevent"])),onPlaced:f[1]||(f[1]=q=>I.value=!0),onKeydown:k}),{default:b(()=>[C(d.$slots,"default")]),_:3},16,["id","data-state","dir","onKeydown"]))]),_:3})]),_:3})]),_:3}))}}),Vt=Nt;const[Ta,Mt]=ce("SelectItemAlignedPosition");var Kt=D({inheritAttrs:!1,__name:"SelectItemAlignedPosition",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["placed"],setup(i,{emit:s}){const a=i,t=s,{getItems:n}=pe(),u=Q(),m=Se(),S=P(!1),v=P(!0),y=P(),{forwardRef:B,currentElement:w}=be(),{viewport:x,selectedItem:I,selectedItemText:c,focusSelectedItem:$}=m;function A(){if(u.triggerElement.value&&u.valueElement.value&&y.value&&w.value&&x?.value&&I?.value&&c?.value){const k=u.triggerElement.value.getBoundingClientRect(),r=w.value.getBoundingClientRect(),h=u.valueElement.value.getBoundingClientRect(),d=c.value.getBoundingClientRect();if(u.dir.value!=="rtl"){const K=d.left-r.left,l=h.left-K,N=k.left-l,Y=k.width+N,Ie=Math.max(Y,r.width),we=window.innerWidth-U,Te=Ne(l,U,Math.max(U,we-Ie));y.value.style.minWidth=`${Y}px`,y.value.style.left=`${Te}px`}else{const K=r.right-d.right,l=window.innerWidth-h.right-K,N=window.innerWidth-k.right-l,Y=k.width+N,Ie=Math.max(Y,r.width),we=window.innerWidth-U,Te=Ne(l,U,Math.max(U,we-Ie));y.value.style.minWidth=`${Y}px`,y.value.style.right=`${Te}px`}const f=n().map(K=>K.ref),q=window.innerHeight-U*2,T=x.value.scrollHeight,z=window.getComputedStyle(w.value),X=Number.parseInt(z.borderTopWidth,10),fe=Number.parseInt(z.paddingTop,10),p=Number.parseInt(z.borderBottomWidth,10),ge=Number.parseInt(z.paddingBottom,10),ie=X+fe+T+ge+p,xe=Math.min(I.value.offsetHeight*5,ie),ee=window.getComputedStyle(x.value),qe=Number.parseInt(ee.paddingTop,10),Ce=Number.parseInt(ee.paddingBottom,10),te=k.top+k.height/2-U,L=q-te,g=I.value.offsetHeight/2,H=I.value.offsetTop+g,F=X+fe+H,re=ie-F;if(F<=te){const K=I.value===f[f.length-1];y.value.style.bottom="0px";const l=w.value.clientHeight-x.value.offsetTop-x.value.offsetHeight,N=Math.max(L,g+(K?Ce:0)+l+p),Y=F+N;y.value.style.height=`${Y}px`}else{const K=I.value===f[0];y.value.style.top="0px";const N=Math.max(te,X+x.value.offsetTop+(K?qe:0)+g)+re;y.value.style.height=`${N}px`,x.value.scrollTop=F-te+x.value.offsetTop}y.value.style.margin=`${U}px 0`,y.value.style.minHeight=`${xe}px`,y.value.style.maxHeight=`${q}px`,t("placed"),requestAnimationFrame(()=>S.value=!0)}}const G=P("");le(async()=>{await ue(),A(),w.value&&(G.value=window.getComputedStyle(w.value).zIndex)});function M(k){k&&v.value===!0&&(A(),$?.(),v.value=!1)}return tt(u.triggerElement,()=>{A()}),Mt({contentWrapper:y,shouldExpandOnScrollRef:S,onScrollButtonChange:M}),(k,r)=>(o(),R("div",{ref_key:"contentWrapperElement",ref:y,style:at({display:"flex",flexDirection:"column",position:"fixed",zIndex:G.value})},[V(e(Z),E({ref:e(B),style:{boxSizing:"border-box",maxHeight:"100%"}},{...k.$attrs,...a}),{default:b(()=>[C(k.$slots,"default")]),_:3},16)],4))}}),Wt=Kt,Ht=D({__name:"SelectArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(i){const s=i,a=Q(),t=Se(je);return(n,u)=>e(a).open.value&&e(t).position==="popper"?(o(),_(e(Ct),_e(E({key:0},s)),{default:b(()=>[C(n.$slots,"default")]),_:3},16)):W("v-if",!0)}}),jt=Ht,Gt=D({inheritAttrs:!1,__name:"SelectProvider",props:{context:{type:Object,required:!0}},setup(i){return He(i.context),Ge(je),(a,t)=>C(a.$slots,"default")}}),Ut=Gt;const Yt={key:1};var Xt=D({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(i,{emit:s}){const a=i,n=Ke(a,s),u=Q(),m=P();le(()=>{m.value=new DocumentFragment});const S=P(),v=j(()=>a.forceMount||u.open.value),y=P(v.value);return Pe(v,()=>{setTimeout(()=>y.value=v.value)}),(B,w)=>v.value||y.value||S.value?.present?(o(),_(e(lt),{key:0,ref_key:"presenceRef",ref:S,present:v.value},{default:b(()=>[V(Vt,_e(ke({...e(n),...B.$attrs})),{default:b(()=>[C(B.$slots,"default")]),_:3},16)]),_:3},8,["present"])):m.value?(o(),R("div",Yt,[(o(),_(it,{to:m.value},[V(Ut,{context:e(u)},{default:b(()=>[C(B.$slots,"default")]),_:3},8,["context"])],8,["to"]))])):W("v-if",!0)}}),Zt=Xt;const[Qt,Jt]=ce("SelectGroup");var ea=D({__name:"SelectGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(i){const s=i,a=Ae(void 0,"reka-select-group");return Jt({id:a}),(t,n)=>(o(),_(e(Z),E({role:"group"},s,{"aria-labelledby":e(a)}),{default:b(()=>[C(t.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),ta=ea;const[Ue,aa]=ce("SelectItem");var la=D({__name:"SelectItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(i,{emit:s}){const a=i,t=s,{disabled:n}=Ve(a),u=Q(),m=Se(),{forwardRef:S,currentElement:v}=be(),{CollectionItem:y}=pe(),B=j(()=>he(u.modelValue?.value,a.value,u.by)),w=P(!1),x=P(a.textValue??""),I=Ae(void 0,"reka-select-item-text"),c="select.select";async function $(r){if(r.defaultPrevented)return;const h={originalEvent:r,value:a.value};rt(c,A,h)}async function A(r){await ue(),t("select",r),!r.defaultPrevented&&(n.value||(u.onValueChange(a.value),u.multiple.value||u.onOpenChange(!1)))}async function G(r){await ue(),!r.defaultPrevented&&(n.value?m.onItemLeave?.():r.currentTarget?.focus({preventScroll:!0}))}async function M(r){await ue(),!r.defaultPrevented&&r.currentTarget===nt()&&m.onItemLeave?.()}async function k(r){await ue(),!(r.defaultPrevented||m.searchRef?.value!==""&&r.key===" ")&&(kt.includes(r.key)&&$(r),r.key===" "&&r.preventDefault())}if(a.value==="")throw new Error("A <SelectItem /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return le(()=>{v.value&&m.itemRefCallback(v.value,a.value,a.disabled)}),aa({value:a.value,disabled:n,textId:I,isSelected:B,onItemTextChange:r=>{x.value=((x.value||r?.textContent)??"").trim()}}),(r,h)=>(o(),_(e(y),{value:{textValue:x.value}},{default:b(()=>[V(e(Z),{ref:e(S),role:"option","aria-labelledby":e(I),"data-highlighted":w.value?"":void 0,"aria-selected":B.value,"data-state":B.value?"checked":"unchecked","aria-disabled":e(n)||void 0,"data-disabled":e(n)?"":void 0,tabindex:e(n)?void 0:-1,as:r.as,"as-child":r.asChild,onFocus:h[0]||(h[0]=d=>w.value=!0),onBlur:h[1]||(h[1]=d=>w.value=!1),onPointerup:$,onPointerdown:h[2]||(h[2]=d=>{d.currentTarget.focus({preventScroll:!0})}),onTouchend:h[3]||(h[3]=de(()=>{},["prevent","stop"])),onPointermove:G,onPointerleave:M,onKeydown:k},{default:b(()=>[C(r.$slots,"default")]),_:3},8,["aria-labelledby","data-highlighted","aria-selected","data-state","aria-disabled","data-disabled","tabindex","as","as-child"])]),_:3},8,["value"]))}}),ia=la,ra=D({__name:"SelectItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(i){const s=i,a=Ue();return(t,n)=>e(a).isSelected.value?(o(),_(e(Z),E({key:0,"aria-hidden":"true"},s),{default:b(()=>[C(t.$slots,"default")]),_:3},16)):W("v-if",!0)}}),na=ra,oa=D({inheritAttrs:!1,__name:"SelectItemText",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(i){const s=i,a=Q(),t=Se(),n=Ue(),{forwardRef:u,currentElement:m}=be(),S=j(()=>({value:n.value,disabled:n.disabled.value,textContent:m.value?.textContent??n.value?.toString()??""}));return le(()=>{m.value&&(n.onItemTextChange(m.value),t.itemTextRefCallback(m.value,n.value,n.disabled.value),a.onOptionAdd(S.value))}),ot(()=>{a.onOptionRemove(S.value)}),(v,y)=>(o(),_(e(Z),E({id:e(n).textId,ref:e(u)},{...s,...v.$attrs}),{default:b(()=>[C(v.$slots,"default")]),_:3},16,["id"]))}}),sa=oa,ua=D({__name:"SelectLabel",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(i){const s=i,a=Qt({id:""});return(t,n)=>(o(),_(e(Z),E(s,{id:e(a).id}),{default:b(()=>[C(t.$slots,"default")]),_:3},16,["id"]))}}),da=ua,ca=D({__name:"SelectPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(i){const s=i;return(a,t)=>(o(),_(e(st),_e(ke(s)),{default:b(()=>[C(a.$slots,"default")]),_:3},16))}}),pa=ca,fa=D({__name:"SelectSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(i){const s=i;return(a,t)=>(o(),_(e(Z),E({"aria-hidden":"true"},s),{default:b(()=>[C(a.$slots,"default")]),_:3},16))}}),ga=fa,ma=D({__name:"SelectTrigger",props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(i){const s=i,a=Q(),{forwardRef:t,currentElement:n}=be(),u=j(()=>a.disabled?.value||s.disabled);a.contentId||=Ae(void 0,"reka-select-content"),le(()=>{a.onTriggerChange(n.value)});const{getItems:m}=pe(),{search:S,handleTypeaheadSearch:v,resetTypeahead:y}=We();function B(){u.value||(a.onOpenChange(!0),y())}function w(x){B(),a.triggerPointerDownPosRef.value={x:Math.round(x.pageX),y:Math.round(x.pageY)}}return(x,I)=>(o(),_(e(It),{"as-child":"",reference:x.reference},{default:b(()=>[V(e(Z),{ref:e(t),role:"combobox",type:x.as==="button"?"button":void 0,"aria-controls":e(a).contentId,"aria-expanded":e(a).open.value||!1,"aria-required":e(a).required?.value,"aria-autocomplete":"none",disabled:u.value,dir:e(a)?.dir.value,"data-state":e(a)?.open.value?"open":"closed","data-disabled":u.value?"":void 0,"data-placeholder":e(At)(e(a).modelValue?.value)?"":void 0,"as-child":x.asChild,as:x.as,onClick:I[0]||(I[0]=c=>{c?.currentTarget?.focus()}),onPointerdown:I[1]||(I[1]=c=>{if(c.pointerType==="touch")return c.preventDefault();const $=c.target;$.hasPointerCapture(c.pointerId)&&$.releasePointerCapture(c.pointerId),c.button===0&&c.ctrlKey===!1&&(w(c),c.preventDefault())}),onPointerup:I[2]||(I[2]=de(c=>{c.pointerType==="touch"&&w(c)},["prevent"])),onKeydown:I[3]||(I[3]=c=>{const $=e(S)!=="";!(c.ctrlKey||c.altKey||c.metaKey)&&c.key.length===1&&$&&c.key===" "||(e(v)(c.key,e(m)()),e(Pt).includes(c.key)&&(B(),c.preventDefault()))})},{default:b(()=>[C(x.$slots,"default")]),_:3},8,["type","aria-controls","aria-expanded","aria-required","disabled","dir","data-state","data-disabled","data-placeholder","as-child","as"])]),_:3},8,["reference"]))}}),va=ma;const ya={slots:{base:["relative group rounded-md inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute inset-y-0 start-0 flex items-center",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute inset-y-0 end-0 flex items-center",trailingIcon:"shrink-0 text-dimmed",value:"truncate pointer-events-none",placeholder:"truncate text-dimmed",arrow:"fill-default",content:"max-h-60 w-(--reka-select-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-select-content-transform-origin) pointer-events-auto flex flex-col",viewport:"relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1",group:"p-1 isolate",empty:"text-center text-muted",label:"font-semibold text-highlighted",separator:"-mx-1 my-1 h-px bg-border",item:["group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50","transition-colors before:transition-colors"],itemLeadingIcon:["shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default","transition-colors"],itemLeadingAvatar:"shrink-0",itemLeadingAvatarSize:"",itemLeadingChip:"shrink-0",itemLeadingChipSize:"",itemTrailing:"ms-auto inline-flex gap-1.5 items-center",itemTrailingIcon:"shrink-0",itemWrapper:"flex-1 flex flex-col min-w-0",itemLabel:"truncate",itemDescription:"truncate text-muted"},variants:{fieldGroup:{horizontal:"not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",vertical:"not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"},size:{xs:{base:"px-2 py-1 text-xs gap-1",leading:"ps-2",trailing:"pe-2",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4",label:"p-1 text-[10px]/3 gap-1",item:"p-1 text-xs gap-1",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailingIcon:"size-4",empty:"p-1 text-xs"},sm:{base:"px-2.5 py-1.5 text-xs gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4",label:"p-1.5 text-[10px]/3 gap-1.5",item:"p-1.5 text-xs gap-1.5",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailingIcon:"size-4",empty:"p-1.5 text-xs"},md:{base:"px-2.5 py-1.5 text-sm gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5",label:"p-1.5 text-xs gap-1.5",item:"p-1.5 text-sm gap-1.5",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailingIcon:"size-5",empty:"p-1.5 text-sm"},lg:{base:"px-3 py-2 text-sm gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5",label:"p-2 text-xs gap-2",item:"p-2 text-sm gap-2",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailingIcon:"size-5",empty:"p-2 text-sm"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6",label:"p-2 text-sm gap-2",item:"p-2 text-base gap-2",itemLeadingIcon:"size-6",itemLeadingAvatarSize:"xs",itemLeadingChip:"size-6",itemLeadingChipSize:"lg",itemTrailingIcon:"size-6",empty:"p-2 text-base"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-success"},{color:"info",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-info"},{color:"warning",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-warning"},{color:"error",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-error"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"focus:ring-2 focus:ring-inset focus:ring-inverted"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},Ba=Object.assign({inheritAttrs:!1},{__name:"USelect",props:{id:{type:String,required:!1},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},valueKey:{type:null,required:!1,default:"value"},labelKey:{type:null,required:!1,default:"label"},descriptionKey:{type:null,required:!1,default:"description"},items:{type:null,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:Object,required:!1},multiple:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},class:{type:null,required:!1},ui:{type:null,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["update:open","change","blur","focus","update:modelValue"],setup(i,{expose:s,emit:a}){const t=i,n=a,u=ut(),m=dt(),S=Ke(ct(t,"open","defaultOpen","disabled","autocomplete","required","multiple"),n),v=pt(ne(()=>t.portal)),y=ne(()=>Oe(t.content,{side:"bottom",sideOffset:8,collisionPadding:8,position:"popper"})),B=ne(()=>t.arrow),{emitFormChange:w,emitFormInput:x,emitFormBlur:I,emitFormFocus:c,size:$,color:A,id:G,name:M,highlight:k,disabled:r,ariaAttrs:h}=ft(t),{orientation:d,size:f}=gt(t),{isLeading:q,isTrailing:T,leadingIconName:z,trailingIconName:X}=mt(ne(()=>Oe(t,{trailingIcon:m.ui.icons.chevronDown}))),fe=j(()=>f.value||$.value),p=j(()=>$e({extend:$e(ya),...m.ui?.select||{}})({color:A.value,variant:t.variant,size:fe?.value,loading:t.loading,highlight:k.value,leading:q.value||!!t.avatar||!!u.leading,trailing:T.value||!!u.trailing,fieldGroup:d.value})),ge=j(()=>t.items?.length?vt(t.items)?t.items:[t.items]:[]),ie=j(()=>ge.value.flatMap(g=>g));function xe(g){if(t.multiple&&Array.isArray(g)){const H=g.map(F=>Re(ie.value,F,{labelKey:t.labelKey,valueKey:t.valueKey})).filter(F=>F!=null&&F!=="");return H.length>0?H.join(", "):void 0}return Re(ie.value,g,{labelKey:t.labelKey,valueKey:t.valueKey})}const ee=yt("triggerRef");function qe(){t.autofocus&&ee.value?.$el?.focus({focusVisible:!0})}le(()=>{setTimeout(()=>{qe()},t.autofocusDelay)});function Ce(g){t.modelModifiers?.trim&&(g=g?.trim()??null),t.modelModifiers?.number&&(g=bt(g)),t.modelModifiers?.nullable&&(g??=null),t.modelModifiers?.optional&&(g??=void 0);const H=new Event("change",{target:{value:g}});n("change",H),w(),x()}function te(g){if(g){const H=new FocusEvent("focus");n("focus",H),c()}else{const H=new FocusEvent("blur");n("blur",H),I()}}function L(g){return typeof g=="object"&&g!==null}return s({triggerRef:ne(()=>ee.value?.$el)}),(g,H)=>(o(),_(e(Ot),E({name:e(M)},e(S),{autocomplete:i.autocomplete,disabled:e(r),"default-value":i.defaultValue,"model-value":i.modelValue,"onUpdate:modelValue":Ce,"onUpdate:open":te}),{default:b(({modelValue:F,open:re})=>[V(e(va),E({id:e(G),ref_key:"triggerRef",ref:ee,"data-slot":"base",class:p.value.base({class:[t.ui?.base,t.class]})},{...g.$attrs,...e(h)}),{default:b(()=>[e(q)||i.avatar||u.leading?(o(),R("span",{key:0,"data-slot":"leading",class:O(p.value.leading({class:t.ui?.leading}))},[C(g.$slots,"leading",{modelValue:F,open:re,ui:p.value},()=>[e(q)&&e(z)?(o(),_(me,{key:0,name:e(z),"data-slot":"leadingIcon",class:O(p.value.leadingIcon({class:t.ui?.leadingIcon}))},null,8,["name","class"])):i.avatar?(o(),_(De,E({key:1,size:t.ui?.itemLeadingAvatarSize||p.value.itemLeadingAvatarSize()},i.avatar,{"data-slot":"itemLeadingAvatar",class:p.value.itemLeadingAvatar({class:t.ui?.itemLeadingAvatar})}),null,16,["size","class"])):W("",!0)])],2)):W("",!0),C(g.$slots,"default",{modelValue:F,open:re,ui:p.value},()=>[(o(!0),R(ae,null,ve([xe(F)],J=>(o(),R(ae,{key:J},[J!=null?(o(),R("span",{key:0,"data-slot":"value",class:O(p.value.value({class:t.ui?.value}))},oe(J),3)):(o(),R("span",{key:1,"data-slot":"placeholder",class:O(p.value.placeholder({class:t.ui?.placeholder}))},oe(i.placeholder??" "),3))],64))),128))]),e(T)||u.trailing?(o(),R("span",{key:1,"data-slot":"trailing",class:O(p.value.trailing({class:t.ui?.trailing}))},[C(g.$slots,"trailing",{modelValue:F,open:re,ui:p.value},()=>[e(X)?(o(),_(me,{key:0,name:e(X),"data-slot":"trailingIcon",class:O(p.value.trailingIcon({class:t.ui?.trailingIcon}))},null,8,["name","class"])):W("",!0)])],2)):W("",!0)]),_:2},1040,["id","class"]),V(e(pa),_e(ke(e(v))),{default:b(()=>[V(e(Zt),E({"data-slot":"content",class:p.value.content({class:t.ui?.content})},y.value),{default:b(()=>[C(g.$slots,"content-top"),ye("div",{role:"presentation","data-slot":"viewport",class:O(p.value.viewport({class:t.ui?.viewport}))},[(o(!0),R(ae,null,ve(ge.value,(J,K)=>(o(),_(e(ta),{key:`group-${K}`,"data-slot":"group",class:O(p.value.group({class:t.ui?.group}))},{default:b(()=>[(o(!0),R(ae,null,ve(J,(l,N)=>(o(),R(ae,{key:`group-${K}-${N}`},[L(l)&&l.type==="label"?(o(),_(e(da),{key:0,"data-slot":"label",class:O(p.value.label({class:[t.ui?.label,l.ui?.label,l.class]}))},{default:b(()=>[Be(oe(e(se)(l,t.labelKey)),1)]),_:2},1032,["class"])):L(l)&&l.type==="separator"?(o(),_(e(ga),{key:1,"data-slot":"separator",class:O(p.value.separator({class:[t.ui?.separator,l.ui?.separator,l.class]}))},null,8,["class"])):(o(),_(e(ia),{key:2,"data-slot":"item",class:O(p.value.item({class:[t.ui?.item,L(l)&&l.ui?.item,L(l)&&l.class]})),disabled:L(l)&&l.disabled,value:L(l)?e(se)(l,t.valueKey):l,onSelect:Y=>L(l)&&l.onSelect?.(Y)},{default:b(()=>[C(g.$slots,"item",{item:l,index:N,ui:p.value},()=>[C(g.$slots,"item-leading",{item:l,index:N,ui:p.value},()=>[L(l)&&l.icon?(o(),_(me,{key:0,name:l.icon,"data-slot":"itemLeadingIcon",class:O(p.value.itemLeadingIcon({class:[t.ui?.itemLeadingIcon,l.ui?.itemLeadingIcon]}))},null,8,["name","class"])):L(l)&&l.avatar?(o(),_(De,E({key:1,size:l.ui?.itemLeadingAvatarSize||t.ui?.itemLeadingAvatarSize||p.value.itemLeadingAvatarSize()},{ref_for:!0},l.avatar,{"data-slot":"itemLeadingAvatar",class:p.value.itemLeadingAvatar({class:[t.ui?.itemLeadingAvatar,l.ui?.itemLeadingAvatar]})}),null,16,["size","class"])):L(l)&&l.chip?(o(),_(ht,E({key:2,size:l.ui?.itemLeadingChipSize||t.ui?.itemLeadingChipSize||p.value.itemLeadingChipSize(),inset:"",standalone:""},{ref_for:!0},l.chip,{"data-slot":"itemLeadingChip",class:p.value.itemLeadingChip({class:[t.ui?.itemLeadingChip,l.ui?.itemLeadingChip]})}),null,16,["size","class"])):W("",!0)]),ye("span",{"data-slot":"itemWrapper",class:O(p.value.itemWrapper({class:[t.ui?.itemWrapper,L(l)&&l.ui?.itemWrapper]}))},[V(e(sa),{"data-slot":"itemLabel",class:O(p.value.itemLabel({class:[t.ui?.itemLabel,L(l)&&l.ui?.itemLabel]}))},{default:b(()=>[C(g.$slots,"item-label",{item:l,index:N},()=>[Be(oe(L(l)?e(se)(l,t.labelKey):l),1)])]),_:2},1032,["class"]),L(l)&&(e(se)(l,t.descriptionKey)||u["item-description"])?(o(),R("span",{key:0,"data-slot":"itemDescription",class:O(p.value.itemDescription({class:[t.ui?.itemDescription,L(l)&&l.ui?.itemDescription]}))},[C(g.$slots,"item-description",{item:l,index:N},()=>[Be(oe(e(se)(l,t.descriptionKey)),1)])],2)):W("",!0)],2),ye("span",{"data-slot":"itemTrailing",class:O(p.value.itemTrailing({class:[t.ui?.itemTrailing,L(l)&&l.ui?.itemTrailing]}))},[C(g.$slots,"item-trailing",{item:l,index:N,ui:p.value}),V(e(na),{"as-child":""},{default:b(()=>[V(me,{name:i.selectedIcon||e(m).ui.icons.check,"data-slot":"itemTrailingIcon",class:O(p.value.itemTrailingIcon({class:[t.ui?.itemTrailingIcon,L(l)&&l.ui?.itemTrailingIcon]}))},null,8,["name","class"])]),_:2},1024)],2)])]),_:2},1032,["class","disabled","value","onSelect"]))],64))),128))]),_:2},1032,["class"]))),128))],2),C(g.$slots,"content-bottom"),i.arrow?(o(),_(e(jt),E({key:0},B.value,{"data-slot":"arrow",class:p.value.arrow({class:t.ui?.arrow})}),null,16,["class"])):W("",!0)]),_:3},16,["class"])]),_:3},16)]),_:3},16,["name","autocomplete","disabled","default-value","model-value"]))}});export{Ba as _};
@@ -1 +1 @@
1
- import{aq as k,W as w,h as v,ap as b,ar as q,e as z,S as P,f as V,R as g,as as j,c as B,o,w as x,ac as I,$ as l,M as p,aa as h,Z as C,a as n,r as d,ab as f,af as m,P as N,at as W,au as D,av as F}from"./CGgHmnnS.js";import{L as K}from"./CPb6IrVT.js";const E={slots:{root:"",wrapper:"",labelWrapper:"flex content-center items-center justify-between gap-1",label:"block font-medium text-default",container:"relative",description:"text-muted",error:"mt-2 text-error",hint:"text-muted",help:"mt-2 text-muted"},variants:{size:{xs:{root:"text-xs"},sm:{root:"text-xs"},md:{root:"text-sm"},lg:{root:"text-sm"},xl:{root:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},orientation:{vertical:{container:"mt-1"},horizontal:{root:"flex justify-between place-items-baseline gap-2"}}},defaultVariants:{size:"md",orientation:"vertical"}},O=["id"],L=["id"],A=["id"],M=["id"],Z={__name:"UFormField",props:{as:{type:null,required:!1},name:{type:String,required:!1},errorPattern:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},help:{type:String,required:!1},error:{type:[Boolean,String],required:!1,default:void 0},hint:{type:String,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},eagerValidation:{type:Boolean,required:!1},validateOnInputDelay:{type:Number,required:!1},orientation:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1}},setup(t){const e=t,i=k(),$=w(),a=v(()=>b({extend:b(E),...$.ui?.formField||{}})({size:e.size,required:e.required,orientation:e.orientation})),S=q(W,null),s=v(()=>e.error||S?.value?.find(r=>r.name===e.name||e.errorPattern&&r.name?.match(e.errorPattern))?.message),u=z(P()),c=u.value,y=q(D,void 0);return V(u,()=>{y&&e.name&&(y.value[e.name]={id:u.value,pattern:e.errorPattern})},{immediate:!0}),g(F,u),g(j,v(()=>({error:s.value,name:e.name,size:e.size,eagerValidation:e.eagerValidation,validateOnInputDelay:e.validateOnInputDelay,errorPattern:e.errorPattern,hint:e.hint,description:e.description,help:e.help,ariaId:c}))),(r,R)=>(o(),B(n(N),{as:t.as,"data-orientation":t.orientation,"data-slot":"root",class:l(a.value.root({class:[e.ui?.root,e.class]}))},{default:x(()=>[I("div",{"data-slot":"wrapper",class:l(a.value.wrapper({class:e.ui?.wrapper}))},[t.label||i.label?(o(),p("div",{key:0,"data-slot":"labelWrapper",class:l(a.value.labelWrapper({class:e.ui?.labelWrapper}))},[C(n(K),{for:u.value,"data-slot":"label",class:l(a.value.label({class:e.ui?.label}))},{default:x(()=>[d(r.$slots,"label",{label:t.label},()=>[f(m(t.label),1)])]),_:3},8,["for","class"]),t.hint||i.hint?(o(),p("span",{key:0,id:`${n(c)}-hint`,"data-slot":"hint",class:l(a.value.hint({class:e.ui?.hint}))},[d(r.$slots,"hint",{hint:t.hint},()=>[f(m(t.hint),1)])],10,O)):h("",!0)],2)):h("",!0),t.description||i.description?(o(),p("p",{key:1,id:`${n(c)}-description`,"data-slot":"description",class:l(a.value.description({class:e.ui?.description}))},[d(r.$slots,"description",{description:t.description},()=>[f(m(t.description),1)])],10,L)):h("",!0)],2),I("div",{class:l([(t.label||!!i.label||t.description||!!i.description)&&a.value.container({class:e.ui?.container})])},[d(r.$slots,"default",{error:s.value}),e.error!==!1&&(typeof s.value=="string"&&s.value||i.error)?(o(),p("div",{key:0,id:`${n(c)}-error`,"data-slot":"error",class:l(a.value.error({class:e.ui?.error}))},[d(r.$slots,"error",{error:s.value},()=>[f(m(s.value),1)])],10,A)):t.help||i.help?(o(),p("div",{key:1,id:`${n(c)}-help`,"data-slot":"help",class:l(a.value.help({class:e.ui?.help}))},[d(r.$slots,"help",{help:t.help},()=>[f(m(t.help),1)])],10,M)):h("",!0)],2)]),_:3},8,["as","data-orientation","class"]))}};export{Z as _};
1
+ import{aq as k,W as w,h as v,ap as b,ar as q,e as z,S as P,f as V,R as g,as as j,c as B,o,w as x,ac as I,$ as l,M as p,aa as h,Z as C,a as n,r as d,ab as f,af as m,P as N,at as W,au as D,av as F}from"./CZT64TBr.js";import{L as K}from"./D7PJ9LEZ.js";const E={slots:{root:"",wrapper:"",labelWrapper:"flex content-center items-center justify-between gap-1",label:"block font-medium text-default",container:"relative",description:"text-muted",error:"mt-2 text-error",hint:"text-muted",help:"mt-2 text-muted"},variants:{size:{xs:{root:"text-xs"},sm:{root:"text-xs"},md:{root:"text-sm"},lg:{root:"text-sm"},xl:{root:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},orientation:{vertical:{container:"mt-1"},horizontal:{root:"flex justify-between place-items-baseline gap-2"}}},defaultVariants:{size:"md",orientation:"vertical"}},O=["id"],L=["id"],A=["id"],M=["id"],Z={__name:"UFormField",props:{as:{type:null,required:!1},name:{type:String,required:!1},errorPattern:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},help:{type:String,required:!1},error:{type:[Boolean,String],required:!1,default:void 0},hint:{type:String,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},eagerValidation:{type:Boolean,required:!1},validateOnInputDelay:{type:Number,required:!1},orientation:{type:null,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1}},setup(t){const e=t,i=k(),$=w(),a=v(()=>b({extend:b(E),...$.ui?.formField||{}})({size:e.size,required:e.required,orientation:e.orientation})),S=q(W,null),s=v(()=>e.error||S?.value?.find(r=>r.name===e.name||e.errorPattern&&r.name?.match(e.errorPattern))?.message),u=z(P()),c=u.value,y=q(D,void 0);return V(u,()=>{y&&e.name&&(y.value[e.name]={id:u.value,pattern:e.errorPattern})},{immediate:!0}),g(F,u),g(j,v(()=>({error:s.value,name:e.name,size:e.size,eagerValidation:e.eagerValidation,validateOnInputDelay:e.validateOnInputDelay,errorPattern:e.errorPattern,hint:e.hint,description:e.description,help:e.help,ariaId:c}))),(r,R)=>(o(),B(n(N),{as:t.as,"data-orientation":t.orientation,"data-slot":"root",class:l(a.value.root({class:[e.ui?.root,e.class]}))},{default:x(()=>[I("div",{"data-slot":"wrapper",class:l(a.value.wrapper({class:e.ui?.wrapper}))},[t.label||i.label?(o(),p("div",{key:0,"data-slot":"labelWrapper",class:l(a.value.labelWrapper({class:e.ui?.labelWrapper}))},[C(n(K),{for:u.value,"data-slot":"label",class:l(a.value.label({class:e.ui?.label}))},{default:x(()=>[d(r.$slots,"label",{label:t.label},()=>[f(m(t.label),1)])]),_:3},8,["for","class"]),t.hint||i.hint?(o(),p("span",{key:0,id:`${n(c)}-hint`,"data-slot":"hint",class:l(a.value.hint({class:e.ui?.hint}))},[d(r.$slots,"hint",{hint:t.hint},()=>[f(m(t.hint),1)])],10,O)):h("",!0)],2)):h("",!0),t.description||i.description?(o(),p("p",{key:1,id:`${n(c)}-description`,"data-slot":"description",class:l(a.value.description({class:e.ui?.description}))},[d(r.$slots,"description",{description:t.description},()=>[f(m(t.description),1)])],10,L)):h("",!0)],2),I("div",{class:l([(t.label||!!i.label||t.description||!!i.description)&&a.value.container({class:e.ui?.container})])},[d(r.$slots,"default",{error:s.value}),e.error!==!1&&(typeof s.value=="string"&&s.value||i.error)?(o(),p("div",{key:0,id:`${n(c)}-error`,"data-slot":"error",class:l(a.value.error({class:e.ui?.error}))},[d(r.$slots,"error",{error:s.value},()=>[f(m(s.value),1)])],10,A)):t.help||i.help?(o(),p("div",{key:1,id:`${n(c)}-help`,"data-slot":"help",class:l(a.value.help({class:e.ui?.help}))},[d(r.$slots,"help",{help:t.help},()=>[f(m(t.help),1)])],10,M)):h("",!0)],2)]),_:3},8,["as","data-orientation","class"]))}};export{Z as _};
@@ -1,4 +1,4 @@
1
- import{d as Hi,e as Fi,C as Vi,b7 as hs,L as ji,B as Pa,W as La,ar as Jd,h as he,X as za,Y as $a,aZ as We,ap as xr,b8 as Kn,c as st,o as ve,w as jt,Z as ur,a as ze,P as ii,$ as kn,M as dr,al as hr,am as Jo,ac as Gd,aa as Ba,r as _a,m as nt,a0 as Jn,bS as Xd,ba as Yd,s as Qd,F as Zd,c2 as eh,b5 as th,g as nh,c3 as rh,f as sh,R as ih}from"./CGgHmnnS.js";import{S as oh}from"./BtVAOj3K.js";import{f as Ha,s as Fa,o as Va,d as ja,e as qa,g as Ua,h as Wa,i as Ka,j as Ja}from"./DIMnGgEU.js";import{_ as lh}from"./BGa5KqPj.js";import{_ as Go}from"./D_1GDAlv.js";import{k as ah,b as ch}from"./Vcq4gwWv.js";function ie(n){this.content=n}ie.prototype={constructor:ie,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new ie(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new ie(t)},addToStart:function(n,e){return new ie([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ie(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new ie(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=ie.from(n),n.size?new ie(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ie.from(n),n.size?new ie(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ie.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};ie.from=function(n){if(n instanceof ie)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ie(e)};function Ga(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Ga(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Xa(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Xa(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class w{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new w(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new w(r,s)}cutByIndex(e,t){return e==t?w.empty:e==0&&t==this.content.length?this:new w(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new w(s,i)}addToStart(e){return new w([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new w(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Ga(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Xa(this,e,t,r)}findIndex(e){if(e==0)return Gn(0,e);if(e==this.size)return Gn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Gn(t+1,i):Gn(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return w.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new w(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return w.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new w(t||e,r)}static from(e){if(!e)return w.empty;if(e instanceof w)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new w([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}w.empty=new w([],0);const Is={index:0,offset:0};function Gn(n,e){return Is.index=n,Is.offset=e,Is}function wr(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!wr(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!wr(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let _=class oi{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&wr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return oi.none;if(e instanceof oi)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};_.none=[];class vr extends Error{}class M{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Qa(this.content,e+this.openStart,t);return r&&new M(r,this.openStart,this.openEnd)}removeBetween(e,t){return new M(Ya(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return M.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new M(w.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new M(e,r,s)}}M.empty=new M(w.empty,0,0);function Ya(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Ya(i.content,e-s-1,t-s-1)))}function Qa(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=Qa(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function uh(n,e,t){if(t.openStart>n.depth)throw new vr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new vr("Inconsistent open depths");return Za(n,e,t,0)}function Za(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Za(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return Mt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=dh(t,n);return Mt(i,tc(n,o,l,e,r))}else return Mt(i,Sr(n,e,r))}function ec(n,e){if(!e.type.compatibleContent(n.type))throw new vr("Cannot join "+e.type.name+" onto "+n.type.name)}function li(n,e,t){let r=n.node(t);return ec(r,e.node(t)),r}function Tt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function bn(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Tt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)Tt(s.child(l),r);e&&e.depth==t&&e.textOffset&&Tt(e.nodeBefore,r)}function Mt(n,e){return n.type.checkContent(e),n.copy(e)}function tc(n,e,t,r,s){let i=n.depth>s&&li(n,e,s+1),o=r.depth>s&&li(t,r,s+1),l=[];return bn(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(ec(i,o),Tt(Mt(i,tc(n,e,t,r,s+1)),l)):(i&&Tt(Mt(i,Sr(n,e,s+1)),l),bn(e,t,s,l),o&&Tt(Mt(o,Sr(t,r,s+1)),l)),bn(r,null,s,l),new w(l)}function Sr(n,e,t){let r=[];if(bn(null,n,t,r),n.depth>t){let s=li(n,e,t+1);Tt(Mt(s,Sr(n,e,t+1)),r)}return bn(e,null,t,r),new w(r)}function dh(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(w.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class Nn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return _.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Cr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new Nn(t,r,i)}static resolveCached(e,t){let r=Xo.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else Xo.set(e,r=new hh);let s=r.elts[r.i]=Nn.resolve(e,t);return r.i=(r.i+1)%fh,s}}class hh{constructor(){this.elts=[],this.i=0}}const fh=12,Xo=new WeakMap;class Cr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ph=Object.create(null);class Me{constructor(e,t,r,s=_.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||w.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&wr(this.attrs,t||e.defaultAttrs||ph)&&_.sameSet(this.marks,r||_.none)}copy(e=null){return e==this.content?this:new Me(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Me(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return M.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new M(c,s.depth-o,i.depth-o)}replace(e,t,r){return uh(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return Nn.resolveCached(this,e)}resolveNoCache(e){return Nn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),nc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=w.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=_.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!_.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=w.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Me.prototype.text=void 0;class Tr extends Me{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):nc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Tr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Tr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function nc(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Nt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new mh(e,t);if(r.next==null)return Nt.empty;let s=rc(r);r.next&&r.err("Unexpected trailing text");let i=vh(wh(s));return Sh(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return w.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let h=i(d,l.concat(u));if(h)return h}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
1
+ import{d as Hi,e as Fi,C as Vi,b7 as hs,L as ji,B as Pa,W as La,ar as Jd,h as he,X as za,Y as $a,aZ as We,ap as xr,b8 as Kn,c as st,o as ve,w as jt,Z as ur,a as ze,P as ii,$ as kn,M as dr,al as hr,am as Jo,ac as Gd,aa as Ba,r as _a,m as nt,a0 as Jn,bS as Xd,ba as Yd,s as Qd,F as Zd,c2 as eh,b5 as th,g as nh,c3 as rh,f as sh,R as ih}from"./CZT64TBr.js";import{S as oh}from"./MwLHW_S3.js";import{f as Ha,s as Fa,o as Va,d as ja,e as qa,g as Ua,h as Wa,i as Ka,j as Ja}from"./CXWZZrP6.js";import{_ as lh}from"./FOQllft2.js";import{_ as Go}from"./B3WWnSJo.js";import{k as ah,b as ch}from"./Vcq4gwWv.js";function ie(n){this.content=n}ie.prototype={constructor:ie,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new ie(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new ie(t)},addToStart:function(n,e){return new ie([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ie(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new ie(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=ie.from(n),n.size?new ie(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ie.from(n),n.size?new ie(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ie.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};ie.from=function(n){if(n instanceof ie)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ie(e)};function Ga(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Ga(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Xa(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Xa(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class w{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new w(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new w(r,s)}cutByIndex(e,t){return e==t?w.empty:e==0&&t==this.content.length?this:new w(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new w(s,i)}addToStart(e){return new w([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new w(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Ga(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Xa(this,e,t,r)}findIndex(e){if(e==0)return Gn(0,e);if(e==this.size)return Gn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Gn(t+1,i):Gn(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return w.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new w(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return w.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new w(t||e,r)}static from(e){if(!e)return w.empty;if(e instanceof w)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new w([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}w.empty=new w([],0);const Is={index:0,offset:0};function Gn(n,e){return Is.index=n,Is.offset=e,Is}function wr(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!wr(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!wr(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let _=class oi{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&wr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return oi.none;if(e instanceof oi)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};_.none=[];class vr extends Error{}class M{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Qa(this.content,e+this.openStart,t);return r&&new M(r,this.openStart,this.openEnd)}removeBetween(e,t){return new M(Ya(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return M.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new M(w.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new M(e,r,s)}}M.empty=new M(w.empty,0,0);function Ya(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Ya(i.content,e-s-1,t-s-1)))}function Qa(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=Qa(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function uh(n,e,t){if(t.openStart>n.depth)throw new vr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new vr("Inconsistent open depths");return Za(n,e,t,0)}function Za(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Za(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return Mt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=dh(t,n);return Mt(i,tc(n,o,l,e,r))}else return Mt(i,Sr(n,e,r))}function ec(n,e){if(!e.type.compatibleContent(n.type))throw new vr("Cannot join "+e.type.name+" onto "+n.type.name)}function li(n,e,t){let r=n.node(t);return ec(r,e.node(t)),r}function Tt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function bn(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Tt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)Tt(s.child(l),r);e&&e.depth==t&&e.textOffset&&Tt(e.nodeBefore,r)}function Mt(n,e){return n.type.checkContent(e),n.copy(e)}function tc(n,e,t,r,s){let i=n.depth>s&&li(n,e,s+1),o=r.depth>s&&li(t,r,s+1),l=[];return bn(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(ec(i,o),Tt(Mt(i,tc(n,e,t,r,s+1)),l)):(i&&Tt(Mt(i,Sr(n,e,s+1)),l),bn(e,t,s,l),o&&Tt(Mt(o,Sr(t,r,s+1)),l)),bn(r,null,s,l),new w(l)}function Sr(n,e,t){let r=[];if(bn(null,n,t,r),n.depth>t){let s=li(n,e,t+1);Tt(Mt(s,Sr(n,e,t+1)),r)}return bn(e,null,t,r),new w(r)}function dh(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(w.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class Nn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return _.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Cr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new Nn(t,r,i)}static resolveCached(e,t){let r=Xo.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else Xo.set(e,r=new hh);let s=r.elts[r.i]=Nn.resolve(e,t);return r.i=(r.i+1)%fh,s}}class hh{constructor(){this.elts=[],this.i=0}}const fh=12,Xo=new WeakMap;class Cr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ph=Object.create(null);class Me{constructor(e,t,r,s=_.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||w.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&wr(this.attrs,t||e.defaultAttrs||ph)&&_.sameSet(this.marks,r||_.none)}copy(e=null){return e==this.content?this:new Me(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Me(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return M.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new M(c,s.depth-o,i.depth-o)}replace(e,t,r){return uh(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return Nn.resolveCached(this,e)}resolveNoCache(e){return Nn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),nc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=w.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=_.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!_.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=w.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Me.prototype.text=void 0;class Tr extends Me{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):nc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Tr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Tr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function nc(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Nt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new mh(e,t);if(r.next==null)return Nt.empty;let s=rc(r);r.next&&r.err("Unexpected trailing text");let i=vh(wh(s));return Sh(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return w.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let h=i(d,l.concat(u));if(h)return h}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
2
2
  `)}}Nt.empty=new Nt(!0);class mh{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function rc(n){let e=[];do e.push(gh(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function gh(n){let e=[];do e.push(yh(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function yh(n){let e=xh(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=kh(n,e);else break;return e}function Yo(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function kh(n,e){let t=Yo(n),r=t;return n.eat(",")&&(n.next!="}"?r=Yo(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function bh(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function xh(n){if(n.eat("(")){let e=rc(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=bh(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function wh(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function sc(n,e){return e-n}function Qo(n,e){let t=[];return r(e),t.sort(sc);function r(s){let i=n[s];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&t.indexOf(a)==-1&&r(a)}}}function vh(n){let e=Object.create(null);return t(Qo(n,0));function t(r){let s=[];r.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);Qo(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Nt(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(sc);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function Sh(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ic(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function oc(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let i=n[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function lc(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let i=n[s];i.validate&&i.validate(e[s])}}function ac(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new Th(n,r,e[r]);return t}let Zo=class cc{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ac(e,r.attrs),this.defaultAttrs=ic(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Nt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:oc(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Me(this,this.computeAttrs(e),w.from(t),_.setFrom(r))}createChecked(e=null,t,r){return t=w.from(t),this.checkContent(t),new Me(this,this.computeAttrs(e),t,_.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=w.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(w.empty,!0);return i?new Me(this,e,t.append(i),_.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){lc(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:_.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new cc(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Ch(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class Th{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Ch(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class fs{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=ac(e,s.attrs),this.excluded=null;let i=ic(this.attrs);this.instance=i?new _(this,i):null}create(e=null){return!e&&this.instance?this.instance:new _(this,oc(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new fs(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){lc(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class uc{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=ie.from(e.nodes),t.marks=ie.from(e.marks||{}),this.nodes=Zo.compile(this.spec.nodes,this),this.marks=fs.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=Nt.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?el(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:el(this,o.split(" "))}this.nodeFromJSON=s=>Me.fromJSON(this,s),this.markFromJSON=s=>_.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Zo){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new Tr(r,r.defaultAttrs,e,_.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function el(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],i=n.marks[s],o=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Mh(n){return n.tag!=null}function Eh(n){return n.style!=null}class Qe{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(Mh(s))this.tags.push(s);else if(Eh(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new nl(this,t,!1);return r.addAll(e,_.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new nl(this,t,!0);return r.addAll(e,_.none,t.from,t.to),M.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(Nh(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,t,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<i)break}t.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=rl(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=rl(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Qe(e,Qe.schemaRules(e)))}}const dc={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Ah={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},hc={ol:!0,ul:!0},Rn=1,ai=2,xn=4;function tl(n,e,t){return e!=null?(e?Rn:0)|(e==="full"?ai:0):n&&n.whitespace=="pre"?Rn|ai:t&~xn}class Xn{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=_.none,this.match=i||(o&xn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(w.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Rn)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=w.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(w.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!dc.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class nl{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=tl(null,t.preserveWhitespace,0)|(r?xn:0);s?i=new Xn(s.type,s.attrs,_.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new Xn(null,null,_.none,!0,null,o):i=new Xn(e.schema.topNodeType,null,_.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&ai?"full":this.localPreserveWS||(s.options&Rn)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;hc.hasOwnProperty(o)&&this.parser.normalizeLists&&Oh(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Ah.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(dc.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=_.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):sl(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,s){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,s)),i}enterInner(e,t,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=tl(e,i,o.options);o.options&xn&&o.content.length==0&&(l|=xn);let a=_.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):sl(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Xn(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=Rn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function Oh(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&hc.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Nh(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function rl(n){let e={};for(let t in n)e[t]=n[t];return e}function sl(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class zt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Ds(t).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=fr(Ds(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&fr(Ds(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return fr(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new zt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=il(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return il(e.marks)}}function il(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Ds(n){return n.document||window.document}const ol=new WeakMap;function Rh(n){let e=ol.get(n);return e===void 0&&ol.set(n,e=Ih(n)),e}function Ih(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function fr(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=Rh(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let h=d.indexOf(" ");h>0?a.setAttributeNS(d.slice(0,h),d.slice(h+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=fr(n,h,t,r);if(a.appendChild(f),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const fc=65535,pc=Math.pow(2,16);function Dh(n,e){return n+e*pc}function ll(n){return n&fc}function Ph(n){return(n-(n&fc))/pc}const mc=1,gc=2,pr=4,yc=8;class ci{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&yc)>0}get deletedBefore(){return(this.delInfo&(mc|pr))>0}get deletedAfter(){return(this.delInfo&(gc|pr))>0}get deletedAcross(){return(this.delInfo&pr)>0}}class be{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&be.empty)return be.empty}recover(e){let t=0,r=ll(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+Ph(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let h=c?e==a?-1:e==d?1:t:t,f=a+s+(h<0?0:u);if(r)return f;let p=e==(t<0?a:d)?null:Dh(l/3,e-a),g=e==a?gc:e==d?mc:pr;return(t<0?e!=a:e!=d)&&(g|=yc),new ci(f,g,p)}s+=u-c}return r?e+s:new ci(e+s,0,null)}touches(e,t){let r=0,s=ll(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new be(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?be.empty:new be(e<0?[0,-e,0]:[0,0,e])}}be.empty=new be([]);class In{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new In(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new In;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new ci(e,s,null)}}const Ps=Object.create(null);class ue{getMap(){return be.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ps[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Ps)throw new RangeError("Duplicate use of step JSON ID "+e);return Ps[e]=t,t.prototype.jsonID=e,t}}class X{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new X(e,null)}static fail(e){return new X(null,e)}static fromReplace(e,t,r,s){try{return X.ok(e.replace(t,r,s))}catch(i){if(i instanceof vr)return X.fail(i.message);throw i}}}function qi(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(qi(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return w.fromArray(r)}class dt extends ue{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new M(qi(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return X.fromReplace(e,this.from,this.to,i)}invert(){return new Re(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new dt(t.pos,r.pos,this.mark)}merge(e){return e instanceof dt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new dt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new dt(t.from,t.to,e.markFromJSON(t.mark))}}ue.jsonID("addMark",dt);class Re extends ue{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new M(qi(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return X.fromReplace(e,this.from,this.to,r)}invert(){return new dt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Re(t.pos,r.pos,this.mark)}merge(e){return e instanceof Re&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Re(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Re(t.from,t.to,e.markFromJSON(t.mark))}}ue.jsonID("removeMark",Re);class ht extends ue{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return X.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return X.fromReplace(e,this.pos,this.pos+1,new M(w.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new ht(this.pos,t.marks[s]);return new ht(this.pos,this.mark)}}return new Rt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ht(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ht(t.pos,e.markFromJSON(t.mark))}}ue.jsonID("addNodeMark",ht);class Rt extends ue{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return X.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return X.fromReplace(e,this.pos,this.pos+1,new M(w.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new ht(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Rt(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Rt(t.pos,e.markFromJSON(t.mark))}}ue.jsonID("removeNodeMark",Rt);class te extends ue{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&ui(e,this.from,this.to)?X.fail("Structure replace would overwrite content"):X.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new be([this.from,this.to-this.from,this.slice.size])}invert(e){return new te(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new te(t.pos,Math.max(t.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof te)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?M.empty:new M(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new te(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?M.empty:new M(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new te(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new te(t.from,t.to,M.fromJSON(e,t.slice),!!t.structure)}}ue.jsonID("replace",te);class re extends ue{constructor(e,t,r,s,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(ui(e,this.from,this.gapFrom)||ui(e,this.gapTo,this.to)))return X.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return X.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?X.fromReplace(e,this.from,this.to,r):X.fail("Content does not fit in gap")}getMap(){return new be([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new re(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||i>r.pos?null:new re(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new re(t.from,t.to,t.gapFrom,t.gapTo,M.fromJSON(e,t.slice),t.insert,!!t.structure)}}ue.jsonID("replaceAround",re);function ui(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function Lh(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let h=Math.max(c,e),f=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(o&&o.to==h&&o.mark.eq(d[g])?o.to=f:s.push(o=new Re(h,f,d[g])));l&&l.to==h?l.to=f:i.push(l=new dt(h,f,r))}}),s.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function zh(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof fs){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],h;for(let f=0;f<s.length;f++){let p=s[f];p.step==i-1&&d.eq(s[f].style)&&(h=p)}h?(h.to=c,h.step=i):s.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>n.step(new Re(o.from,o.to,o.style)))}function Ui(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new te(l,u,M.empty));else{r=d;for(let h=0;h<c.marks.length;h++)t.allowsMarkType(c.marks[h].type)||n.step(new Re(l,u,c.marks[h]));if(s&&c.isText&&t.whitespace!="pre"){let h,f=/\r?\n|\r/g,p;for(;h=f.exec(c.text);)p||(p=new M(w.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new te(l+h.index,l+h.index+h[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(w.empty,!0);n.replace(l,l,new M(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function $h(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function sn(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(r<n.depth&&o.canReplace(l,a,t))return r;if(r==0||o.type.spec.isolating||!$h(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function Bh(n,e,t){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=w.empty,d=0;for(let p=i,g=!1;p>t;p--)g||r.index(p)>0?(g=!0,u=w.from(r.node(p).copy(u)),d++):a--;let h=w.empty,f=0;for(let p=i,g=!1;p>t;p--)g||s.after(p+1)<s.end(p)?(g=!0,h=w.from(s.node(p).copy(h)),f++):c++;n.step(new re(a,c,o,l,new M(u.append(h),d,f),u.size-d,!0))}function Wi(n,e,t=null,r=n){let s=_h(n,e),i=s&&Hh(r,e);return i?s.map(al).concat({type:e,attrs:t}).concat(i.map(al)):null}function al(n){return{type:n,attrs:null}}function _h(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return t.canReplaceWith(r,s,o)?i:null}function Hh(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function Fh(n,e,t){let r=w.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=w.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new re(s,i,s,i,new M(r,0,0),t.length,!0))}function Vh(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&jh(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!p?c=!1:!f&&p&&(c=!0)}c===!1&&bc(n,o,l,i),Ui(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),h=u.map(l+o.nodeSize,1);return n.step(new re(d,h,d+1,h-1,new M(w.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&kc(n,o,l,i),!1}})}function kc(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function bc(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(`
@@ -1 +1 @@
1
- import{b4 as D,e as T,aK as b,f as j,y as A,b5 as R,B as I,a7 as x}from"./CGgHmnnS.js";function f(e){if(typeof e!="object")return e;var o,t,i=Object.prototype.toString.call(e);if(i==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){t=new e.constructor;for(o in e)e.hasOwnProperty(o)&&t[o]!==e[o]&&(t[o]=f(e[o]))}else{t={};for(o in e)o==="__proto__"?Object.defineProperty(t,o,{value:f(e[o]),configurable:!0,enumerable:!0,writable:!0}):t[o]=f(e[o])}return t}if(i==="[object Array]"){for(o=e.length,t=Array(o);o--;)t[o]=f(e[o]);return t}return i==="[object Set]"?(t=new Set,e.forEach(function(a){t.add(f(a))}),t):i==="[object Map]"?(t=new Map,e.forEach(function(a,r){t.set(f(r),f(a))}),t):i==="[object Date]"?new Date(+e):i==="[object RegExp]"?(t=new RegExp(e.source,e.flags),t.lastIndex=e.lastIndex,t):i==="[object DataView]"?new e.constructor(f(e.buffer)):i==="[object ArrayBuffer]"?e.slice(0):i.slice(-6)==="Array]"?new e.constructor(e):e}function N(e,o){if(typeof e!="string")throw new TypeError("argument str must be a string");const t={},i=o||{},a=i.decode||P;let r=0;for(;r<e.length;){const n=e.indexOf("=",r);if(n===-1)break;let c=e.indexOf(";",r);if(c===-1)c=e.length;else if(c<n){r=e.lastIndexOf(";",n-1)+1;continue}const s=e.slice(r,n).trim();if(i?.filter&&!i?.filter(s)){r=c+1;continue}if(t[s]===void 0){let u=e.slice(n+1,c).trim();u.codePointAt(0)===34&&(u=u.slice(1,-1)),t[s]=L(u,a)}r=c+1}return t}function P(e){return e.includes("%")?decodeURIComponent(e):e}function L(e,o){try{return o(e)}catch{return e}}const m=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function S(e,o,t){const i=t||{},a=i.encode||encodeURIComponent;if(typeof a!="function")throw new TypeError("option encode is invalid");if(!m.test(e))throw new TypeError("argument name is invalid");const r=a(o);if(r&&!m.test(r))throw new TypeError("argument val is invalid");let n=e+"="+r;if(i.maxAge!==void 0&&i.maxAge!==null){const c=i.maxAge-0;if(Number.isNaN(c)||!Number.isFinite(c))throw new TypeError("option maxAge is invalid");n+="; Max-Age="+Math.floor(c)}if(i.domain){if(!m.test(i.domain))throw new TypeError("option domain is invalid");n+="; Domain="+i.domain}if(i.path){if(!m.test(i.path))throw new TypeError("option path is invalid");n+="; Path="+i.path}if(i.expires){if(!M(i.expires)||Number.isNaN(i.expires.valueOf()))throw new TypeError("option expires is invalid");n+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(n+="; HttpOnly"),i.secure&&(n+="; Secure"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():i.priority){case"low":{n+="; Priority=Low";break}case"medium":{n+="; Priority=Medium";break}case"high":{n+="; Priority=High";break}default:throw new TypeError("option priority is invalid")}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:{n+="; SameSite=Strict";break}case"lax":{n+="; SameSite=Lax";break}case"strict":{n+="; SameSite=Strict";break}case"none":{n+="; SameSite=None";break}default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(n+="; Partitioned"),n}function M(e){return Object.prototype.toString.call(e)==="[object Date]"||e instanceof Date}const U={path:"/",watch:!0,decode:e=>D(decodeURIComponent(e)),encode:e=>encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))},y=globalThis.cookieStore;function V(e,o){const t={...U,...o};t.filter??=u=>u===e;const i=E(t)||{};let a;t.maxAge!==void 0?a=t.maxAge*1e3:t.expires&&(a=t.expires.getTime()-Date.now());const r=a!==void 0&&a<=0,n=r||i[e]===void 0||i[e]===null,c=f(r?void 0:i[e]??t.default?.()),s=a&&!r?F(c,a,t.watch&&t.watch!=="shallow"):T(c);{let u=null;try{!y&&typeof BroadcastChannel<"u"&&(u=new BroadcastChannel(`nuxt:cookies:${e}`))}catch{}const d=(l=!1)=>{!l&&(t.readonly||x(s.value,i[e]))||(B(e,s.value,t),i[e]=f(s.value),u?.postMessage({value:t.encode(s.value)}))},p=l=>{const h=l.refresh?E(t)?.[e]:t.decode(l.value);w=!0,s.value=h,i[e]=f(h),I(()=>{w=!1})};let w=!1;const v=!!A();if(v&&b(()=>{w=!0,d(),u?.close()}),y){const l=h=>{const k=h.changed.find(g=>g.name===e),O=h.deleted.find(g=>g.name===e);k&&p({value:k.value}),O&&p({value:null})};y.addEventListener("change",l),v&&b(()=>y.removeEventListener("change",l))}else u&&(u.onmessage=({data:l})=>p(l));t.watch&&j(s,()=>{w||d()},{deep:t.watch!=="shallow"}),n&&d(n)}return s}function E(e={}){return N(document.cookie,e)}function _(e,o,t={}){return o==null?S(e,o,{...t,maxAge:-1}):S(e,o,t)}function B(e,o,t={}){document.cookie=_(e,o,t)}const C=2147483647;function F(e,o,t){let i,a,r=0;const n=t?T(e):{value:e};return A()&&b(()=>{a?.(),clearTimeout(i)}),R((c,s)=>{t&&(a=j(n,s));function u(){r=0,clearTimeout(i);const d=o-r,p=d<C?d:C;i=setTimeout(()=>{if(r+=p,r<o)return u();n.value=void 0,s()},p)}return{get(){return c(),n.value},set(d){u(),n.value=d,s()}}})}export{V as u};
1
+ import{b4 as D,e as T,aK as b,f as j,y as A,b5 as R,B as I,a7 as x}from"./CZT64TBr.js";function f(e){if(typeof e!="object")return e;var o,t,i=Object.prototype.toString.call(e);if(i==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){t=new e.constructor;for(o in e)e.hasOwnProperty(o)&&t[o]!==e[o]&&(t[o]=f(e[o]))}else{t={};for(o in e)o==="__proto__"?Object.defineProperty(t,o,{value:f(e[o]),configurable:!0,enumerable:!0,writable:!0}):t[o]=f(e[o])}return t}if(i==="[object Array]"){for(o=e.length,t=Array(o);o--;)t[o]=f(e[o]);return t}return i==="[object Set]"?(t=new Set,e.forEach(function(a){t.add(f(a))}),t):i==="[object Map]"?(t=new Map,e.forEach(function(a,r){t.set(f(r),f(a))}),t):i==="[object Date]"?new Date(+e):i==="[object RegExp]"?(t=new RegExp(e.source,e.flags),t.lastIndex=e.lastIndex,t):i==="[object DataView]"?new e.constructor(f(e.buffer)):i==="[object ArrayBuffer]"?e.slice(0):i.slice(-6)==="Array]"?new e.constructor(e):e}function N(e,o){if(typeof e!="string")throw new TypeError("argument str must be a string");const t={},i=o||{},a=i.decode||P;let r=0;for(;r<e.length;){const n=e.indexOf("=",r);if(n===-1)break;let c=e.indexOf(";",r);if(c===-1)c=e.length;else if(c<n){r=e.lastIndexOf(";",n-1)+1;continue}const s=e.slice(r,n).trim();if(i?.filter&&!i?.filter(s)){r=c+1;continue}if(t[s]===void 0){let u=e.slice(n+1,c).trim();u.codePointAt(0)===34&&(u=u.slice(1,-1)),t[s]=L(u,a)}r=c+1}return t}function P(e){return e.includes("%")?decodeURIComponent(e):e}function L(e,o){try{return o(e)}catch{return e}}const m=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function S(e,o,t){const i=t||{},a=i.encode||encodeURIComponent;if(typeof a!="function")throw new TypeError("option encode is invalid");if(!m.test(e))throw new TypeError("argument name is invalid");const r=a(o);if(r&&!m.test(r))throw new TypeError("argument val is invalid");let n=e+"="+r;if(i.maxAge!==void 0&&i.maxAge!==null){const c=i.maxAge-0;if(Number.isNaN(c)||!Number.isFinite(c))throw new TypeError("option maxAge is invalid");n+="; Max-Age="+Math.floor(c)}if(i.domain){if(!m.test(i.domain))throw new TypeError("option domain is invalid");n+="; Domain="+i.domain}if(i.path){if(!m.test(i.path))throw new TypeError("option path is invalid");n+="; Path="+i.path}if(i.expires){if(!M(i.expires)||Number.isNaN(i.expires.valueOf()))throw new TypeError("option expires is invalid");n+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(n+="; HttpOnly"),i.secure&&(n+="; Secure"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():i.priority){case"low":{n+="; Priority=Low";break}case"medium":{n+="; Priority=Medium";break}case"high":{n+="; Priority=High";break}default:throw new TypeError("option priority is invalid")}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:{n+="; SameSite=Strict";break}case"lax":{n+="; SameSite=Lax";break}case"strict":{n+="; SameSite=Strict";break}case"none":{n+="; SameSite=None";break}default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(n+="; Partitioned"),n}function M(e){return Object.prototype.toString.call(e)==="[object Date]"||e instanceof Date}const U={path:"/",watch:!0,decode:e=>D(decodeURIComponent(e)),encode:e=>encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))},y=globalThis.cookieStore;function V(e,o){const t={...U,...o};t.filter??=u=>u===e;const i=E(t)||{};let a;t.maxAge!==void 0?a=t.maxAge*1e3:t.expires&&(a=t.expires.getTime()-Date.now());const r=a!==void 0&&a<=0,n=r||i[e]===void 0||i[e]===null,c=f(r?void 0:i[e]??t.default?.()),s=a&&!r?F(c,a,t.watch&&t.watch!=="shallow"):T(c);{let u=null;try{!y&&typeof BroadcastChannel<"u"&&(u=new BroadcastChannel(`nuxt:cookies:${e}`))}catch{}const d=(l=!1)=>{!l&&(t.readonly||x(s.value,i[e]))||(B(e,s.value,t),i[e]=f(s.value),u?.postMessage({value:t.encode(s.value)}))},p=l=>{const h=l.refresh?E(t)?.[e]:t.decode(l.value);w=!0,s.value=h,i[e]=f(h),I(()=>{w=!1})};let w=!1;const v=!!A();if(v&&b(()=>{w=!0,d(),u?.close()}),y){const l=h=>{const k=h.changed.find(g=>g.name===e),O=h.deleted.find(g=>g.name===e);k&&p({value:k.value}),O&&p({value:null})};y.addEventListener("change",l),v&&b(()=>y.removeEventListener("change",l))}else u&&(u.onmessage=({data:l})=>p(l));t.watch&&j(s,()=>{w||d()},{deep:t.watch!=="shallow"}),n&&d(n)}return s}function E(e={}){return N(document.cookie,e)}function _(e,o,t={}){return o==null?S(e,o,{...t,maxAge:-1}):S(e,o,t)}function B(e,o,t={}){document.cookie=_(e,o,t)}const C=2147483647;function F(e,o,t){let i,a,r=0;const n=t?T(e):{value:e};return A()&&b(()=>{a?.(),clearTimeout(i)}),R((c,s)=>{t&&(a=j(n,s));function u(){r=0,clearTimeout(i);const d=o-r,p=d<C?d:C;i=setTimeout(()=>{if(r+=p,r<o)return u();n.value=void 0,s()},p)}return{get(){return c(),n.value},set(d){u(),n.value=d,s()}}})}export{V as u};