@phtngyn/cms 0.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +90 -0
  3. package/dist/studio/assets/ActivityEntryRow-D--fRvWI.js +1 -0
  4. package/dist/studio/assets/ActivityView-D-XBBUHb.js +1 -0
  5. package/dist/studio/assets/CreateDocumentDialog-CH8UH1QM.js +1 -0
  6. package/dist/studio/assets/DocumentsView-CxRpmAxt.js +34 -0
  7. package/dist/studio/assets/DropdownMenu-BSb1l7fr.js +1 -0
  8. package/dist/studio/assets/Input-DVao38h7.js +3 -0
  9. package/dist/studio/assets/MediaView-BHrPIjxB.js +1 -0
  10. package/dist/studio/assets/Modal-VNrXGa5C.js +1 -0
  11. package/dist/studio/assets/OverviewView-DfP6-mLZ.js +1 -0
  12. package/dist/studio/assets/Select-BJZIs9sY.js +1 -0
  13. package/dist/studio/assets/SettingsView-CerHe-ua.js +1 -0
  14. package/dist/studio/assets/Skeleton-CWJNi3nS.js +1 -0
  15. package/dist/studio/assets/StudioPageHeader-DP9HDAF2.js +1 -0
  16. package/dist/studio/assets/UsersView-cP3REkH2.js +1 -0
  17. package/dist/studio/assets/collaboration-BLnCzfvV.js +4 -0
  18. package/dist/studio/assets/context-dY4fNbn3.js +1 -0
  19. package/dist/studio/assets/editor-CE07wW83.js +137 -0
  20. package/dist/studio/assets/gateway-BAyQgCse.js +10 -0
  21. package/dist/studio/assets/index-CjoaPLhZ.js +28 -0
  22. package/dist/studio/assets/index-s2rPqCmP.css +2 -0
  23. package/dist/studio/assets/render-BkxbK2St.js +83 -0
  24. package/dist/studio/assets/rolldown-runtime-DK3Fl9T5.js +1 -0
  25. package/dist/studio/assets/useMediaLibrary-D7qR7aBf.js +1 -0
  26. package/dist/studio/index.html +76 -0
  27. package/package.json +75 -0
  28. package/src/Authoring.d.ts +46 -0
  29. package/src/Authoring.js +1 -0
  30. package/src/AuthoringSchema-BQ5kbhVB.js +926 -0
  31. package/src/AuthoringSchema-BQ5kbhVB.js.map +1 -0
  32. package/src/Configuration-BGYFD2N1.js +150 -0
  33. package/src/Configuration-BGYFD2N1.js.map +1 -0
  34. package/src/Configuration.d.ts +44 -0
  35. package/src/Configuration.js +9 -0
  36. package/src/Configuration.js.map +1 -0
  37. package/src/DocumentEngine-Da0kWotL.js +851 -0
  38. package/src/DocumentEngine-Da0kWotL.js.map +1 -0
  39. package/src/DocumentModel.d.ts +30 -0
  40. package/src/DocumentModel.js +15 -0
  41. package/src/DocumentModel.js.map +1 -0
  42. package/src/HttpPaths-86qLGB90.js +15 -0
  43. package/src/HttpPaths-86qLGB90.js.map +1 -0
  44. package/src/Module.d.ts +12 -0
  45. package/src/Module.js +167 -0
  46. package/src/Module.js.map +1 -0
  47. package/src/StudioHttp-BTLLooh0.js +916 -0
  48. package/src/StudioHttp-BTLLooh0.js.map +1 -0
  49. package/src/connection-ZGtL54qY.js +94 -0
  50. package/src/connection-ZGtL54qY.js.map +1 -0
  51. package/src/installation-BNKaVjni.js +9128 -0
  52. package/src/installation-BNKaVjni.js.map +1 -0
  53. package/src/internal/authoring-compiler.js +120 -0
  54. package/src/internal/authoring-compiler.js.map +1 -0
  55. package/src/internal/authoring-metadata.js +163 -0
  56. package/src/internal/authoring-metadata.js.map +1 -0
  57. package/src/internal/cms-config.js +46 -0
  58. package/src/internal/cms-config.js.map +1 -0
  59. package/src/internal/component-metadata.js +37 -0
  60. package/src/internal/component-metadata.js.map +1 -0
  61. package/src/internal/configuration.js +93 -0
  62. package/src/internal/configuration.js.map +1 -0
  63. package/src/internal/document-model.js +236 -0
  64. package/src/internal/document-model.js.map +1 -0
  65. package/src/internal/field-metadata.js +6 -0
  66. package/src/internal/field-metadata.js.map +1 -0
  67. package/src/metadata-Czvi3E4K.js +190 -0
  68. package/src/metadata-Czvi3E4K.js.map +1 -0
  69. package/src/models-Citx8jBi.js +306 -0
  70. package/src/models-Citx8jBi.js.map +1 -0
  71. package/src/models-DS5ClMsH.js +153 -0
  72. package/src/models-DS5ClMsH.js.map +1 -0
  73. package/src/runtime/api.js +9 -0
  74. package/src/runtime/api.js.map +1 -0
  75. package/src/runtime/collaboration.js +40 -0
  76. package/src/runtime/collaboration.js.map +1 -0
  77. package/src/runtime/delivery/DocumentField.js +23 -0
  78. package/src/runtime/delivery/DocumentField.js.map +1 -0
  79. package/src/runtime/delivery/DocumentRenderer.js +51 -0
  80. package/src/runtime/delivery/DocumentRenderer.js.map +1 -0
  81. package/src/runtime/delivery/DocumentScope.js +41 -0
  82. package/src/runtime/delivery/DocumentScope.js.map +1 -0
  83. package/src/runtime/delivery/document-page.js +23 -0
  84. package/src/runtime/delivery/document-page.js.map +1 -0
  85. package/src/runtime/delivery/document.js +25 -0
  86. package/src/runtime/delivery/document.js.map +1 -0
  87. package/src/runtime/delivery/preview.d.ts +11 -0
  88. package/src/runtime/delivery/preview.js +6 -0
  89. package/src/runtime/delivery/preview.js.map +1 -0
  90. package/src/runtime/delivery/types.d.ts +80 -0
  91. package/src/runtime/delivery/types.js +1 -0
  92. package/src/runtime/delivery/useDocument.d.ts +6 -0
  93. package/src/runtime/delivery/useDocument.js +20 -0
  94. package/src/runtime/delivery/useDocument.js.map +1 -0
  95. package/src/runtime/delivery/useDocumentQuery.d.ts +7 -0
  96. package/src/runtime/delivery/useDocumentQuery.js +26 -0
  97. package/src/runtime/delivery/useDocumentQuery.js.map +1 -0
  98. package/src/runtime/installation.js +3 -0
  99. package/src/runtime/plugin.js +32 -0
  100. package/src/runtime/plugin.js.map +1 -0
  101. package/src/runtime/preview/CmsStudioPreviewMarker.js +15 -0
  102. package/src/runtime/preview/CmsStudioPreviewMarker.js.map +1 -0
  103. package/src/runtime/preview/comark-document.js +38 -0
  104. package/src/runtime/preview/comark-document.js.map +1 -0
  105. package/src/runtime/preview/connection.js +3 -0
  106. package/src/runtime/preview/controller.js +247 -0
  107. package/src/runtime/preview/controller.js.map +1 -0
  108. package/src/runtime/preview/plugin.client.js +70 -0
  109. package/src/runtime/preview/plugin.client.js.map +1 -0
  110. package/src/runtime/preview/preview.css +9 -0
  111. package/src/runtime/preview/protocol.d.ts +10 -0
  112. package/src/runtime/preview/protocol.js +11 -0
  113. package/src/runtime/preview/protocol.js.map +1 -0
  114. package/src/runtime/preview/store.js +4 -0
  115. package/src/runtime/preview/targets.js +102 -0
  116. package/src/runtime/preview/targets.js.map +1 -0
  117. package/src/runtime/studio-app.js +13 -0
  118. package/src/runtime/studio-app.js.map +1 -0
  119. package/src/store-Nl4uxEXx.js +221 -0
  120. package/src/store-Nl4uxEXx.js.map +1 -0
@@ -0,0 +1,137 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{A as t,B as n,C as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,L as d,M as f,N as p,P as m,R as h,S as g,T as _,U as v,V as y,W as b,X as x,Y as S,_ as C,a as w,b as T,c as E,d as ee,f as te,g as ne,h as D,i as re,j as ie,k as ae,l as oe,m as se,n as ce,o as le,q as ue,r as de,s as fe,u as pe,w as me,x as he,y as ge,z as _e}from"./collaboration-BLnCzfvV.js";function ve(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var O={},ye=[],be=()=>{},xe=()=>!1,Se=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ce=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,we=e=>e.startsWith(`onUpdate:`),k=Object.assign,Te=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},Ee=Object.prototype.hasOwnProperty,A=(e,t)=>Ee.call(e,t),j=Array.isArray,De=e=>Fe(e)===`[object Map]`,Oe=e=>Fe(e)===`[object Set]`,ke=e=>Fe(e)===`[object Date]`,Ae=e=>Fe(e)===`[object RegExp]`,M=e=>typeof e==`function`,N=e=>typeof e==`string`,je=e=>typeof e==`symbol`,Me=e=>typeof e==`object`&&!!e,Ne=e=>(Me(e)||M(e))&&M(e.then)&&M(e.catch),Pe=Object.prototype.toString,Fe=e=>Pe.call(e),Ie=e=>Fe(e).slice(8,-1),Le=e=>Fe(e)===`[object Object]`,Re=e=>N(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ze=ve(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),Be=ve(`slot,component`),Ve=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},He=/-(\w)/g,Ue=(e,t)=>t?t.toUpperCase():``,We=Ve(e=>e.replace(He,Ue)),Ge=/\B([A-Z])/g,Ke=Ve(e=>e.replace(Ge,`-$1`).toLowerCase()),qe=Ve(e=>e.charAt(0).toUpperCase()+e.slice(1)),Je=Ve(e=>e?`on${qe(e)}`:``),Ye=e=>`${e===`modelValue`||e===`model-value`?`model`:e}Modifiers${e===`model`?`$`:``}`,Xe=(e,t)=>!Object.is(e,t),Ze=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Qe=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},$e=e=>{let t=parseFloat(e);return isNaN(t)?e:t},et=e=>{let t=N(e)?Number(e):NaN;return isNaN(t)?e:t},tt,nt=()=>tt||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function rt(e){return e!==`PROGRESS`&&!e.includes(`-`)}var it=ve(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function at(e){if(j(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=N(r)?lt(r):at(r);if(i)for(let e in i)t[e]=i[e]}return t}if(N(e)||Me(e))return e}var ot=/;(?![^(]*\))/g,st=/:([^]+)/,ct=/\/\*[^]*?\*\//g;function lt(e){let t={};return e.replace(ct,``).split(ot).forEach(e=>{if(e){let n=e.split(st);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ut(e){let t=``;if(N(e))t=e;else if(j(e))for(let n=0;n<e.length;n++){let r=ut(e[n]);r&&(t+=r+` `)}else if(Me(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function dt(e){if(!e)return null;let{class:t,style:n}=e;return t&&!N(t)&&(e.class=ut(t)),n&&(e.style=at(n)),e}var ft=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,pt=ve(ft),mt=ve(ft+`,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);function ht(e){return!!e||e===``}var gt=ve(`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`),_t=ve(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`);function vt(e){if(e==null)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`}function yt(e,t){return t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`form`||t===`list`&&e===`INPUT`||t===`type`&&e===`TEXTAREA`||(t===`width`||t===`height`)&&(e===`IMG`||e===`VIDEO`||e===`CANVAS`||e===`SOURCE`)||t===`sandbox`&&e===`IFRAME`}function bt(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=St(e[r],t[r]);return n}function xt(e,t){if(e.size!==t.size)return!1;let n=Array.from(t),r=new Uint8Array(n.length);for(let t of e){let e=-1;for(let i=0;i<n.length;i++)if(!r[i]&&St(t,n[i])){e=i;break}if(e<0)return!1;r[e]=1}return!0}function St(e,t){if(e===t)return!0;let n=ke(e),r=ke(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=je(e),r=je(t),n||r)return e===t;if(n=j(e),r=j(t),n||r)return n&&r?bt(e,t):!1;if(n=Me(e),r=Me(t),n||r){if(!n||!r)return!1;if(n=De(e),r=De(t),n||r||(n=Oe(e),r=Oe(t),n||r))return n&&r?xt(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!St(e[n],t[n]))return!1}}return String(e)===String(t)}function Ct(e,t){return e.findIndex(e=>St(e,t))}var wt=e=>!!(e&&e.__v_isRef===!0),Tt=e=>{switch(typeof e){case`string`:return e;case`object`:if(e){if(wt(e))return Tt(e.value);if(j(e)||e.toString===Pe||!M(e.toString))return JSON.stringify(e,Et,2)}default:return e==null?``:String(e)}},Et=(e,t)=>wt(t)?Et(e,t.value):De(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Dt(t,r)+` =>`]=n,e),{})}:Oe(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Dt(e))}:je(t)?Dt(t):Me(t)&&!j(t)&&!Le(t)?String(t):t,Dt=(e,t=``)=>je(e)?`Symbol(${e.description??t})`:e;function Ot(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function kt(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}function At(e){return!!(e&12)}function jt(e){return At(e)&&!(e&8)}function Mt(e){return At(e)&&!(e&2)}var Nt={None:0,0:`None`,Mutable:1,1:`Mutable`,Watching:2,2:`Watching`,RecursedCheck:4,4:`RecursedCheck`,Recursed:8,8:`Recursed`,Dirty:16,16:`Dirty`,Pending:32,32:`Pending`},Pt=[],Ft=0,It=void 0,Lt=0;function Rt(){++Lt}function zt(){--Lt}var Bt=0,Vt=0,Ht=0;function P(e){try{return It}finally{It=e}}function Ut(){++Ft}function Wt(){!--Ft&&Ht&&Xt()}function Gt(e,t){let n=t.depsTail;if(n!==void 0&&n.dep===e)return;let r=n===void 0?t.deps:n.nextDep;if(r!==void 0&&r.dep===e){r.version=Bt,t.depsTail=r;return}let i=e.subsTail;if(i!==void 0&&i.version===Bt&&i.sub===t)return;let a=t.depsTail=e.subsTail={version:Bt,dep:e,sub:t,prevDep:n,nextDep:r,prevSub:i,nextSub:void 0};r!==void 0&&(r.prevDep=a),n===void 0?t.deps=a:n.nextDep=a,i===void 0?e.subs=a:i.nextSub=a}function Kt(e,t=e.sub){let n=e.dep,r=e.prevDep,i=e.nextDep,a=e.nextSub,o=e.prevSub;if(i===void 0?t.depsTail=r:i.prevDep=r,r===void 0?t.deps=i:r.nextDep=i,a===void 0?n.subsTail=o:a.prevSub=o,o!==void 0)o.nextSub=a;else if((n.subs=a)===void 0){let e=n.deps;if(e!==void 0){do e=Kt(e,n);while(e!==void 0);n.flags|=16}}return i}function qt(e){let t=e.nextSub,n;top:do{let r=e.sub,i=r.flags;if(i&3&&(i&60?i&12?i&4?!(i&48)&&$t(e,r)?(r.flags=i|40,i&=1):i=0:r.flags=i&-9|32:i=0:(r.flags=i|32,Lt&&(r.flags|=8)),i&2&&(Pt[Ht++]=r),i&1)){let i=r.subs;if(i!==void 0){e=i,i.nextSub!==void 0&&(n={value:t,prev:n},t=e.nextSub);continue}}if((e=t)!==void 0){t=e.nextSub;continue}for(;n!==void 0;)if(e=n.value,n=n.prev,e!==void 0){t=e.nextSub;continue top}break}while(1)}function Jt(e){return++Bt,e.depsTail=void 0,e.flags=e.flags&-57|4,P(e)}function Yt(e,t){It=t;let n=e.depsTail,r=n===void 0?e.deps:n.nextDep;for(;r!==void 0;)r=Kt(r,e);e.flags&=-5}function Xt(){for(;Vt<Ht;){let e=Pt[Vt];Pt[Vt++]=void 0,e.notify()}Vt=0,Ht=0}function Zt(e,t){let n,r=0;top:do{let i=e.dep,a=i.flags,o=!1;if(t.flags&16)o=!0;else if((a&17)==17){let e=i.subs;i.update()&&(e.nextSub!==void 0&&Qt(e),o=!0)}else if((a&33)==33){n={value:e,prev:n},e=i.deps,t=i,++r;continue}if(!o&&e.nextDep!==void 0){e=e.nextDep;continue}for(;r;){if(--r,e=n.value,n=n.prev,o){let n=t.subs;if(t.update()){n.nextSub!==void 0&&Qt(n),t=e.sub;continue}}else t.flags&=-33;if(t=e.sub,e.nextDep!==void 0){e=e.nextDep;continue top}o=!1}return o&&!!t.flags}while(1)}function Qt(e){do{let t=e.sub,n=e.nextSub,r=t.flags;(r&48)==32&&(t.flags=r|16),e=n}while(e!==void 0)}function $t(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}var en=class{constructor(e,t){this.map=e,this.key=t,this._subs=void 0,this.subsTail=void 0,this.flags=0}get subs(){return this._subs}set subs(e){this._subs=e,e===void 0&&this.map.delete(this.key)}},tn=new WeakMap,nn=Symbol(``),rn=Symbol(``),an=Symbol(``);function on(e,t,n){if(It!==void 0){let t=tn.get(e);t||tn.set(e,t=new Map);let r=t.get(n);r||t.set(n,r=new en(t,n)),Gt(r,It)}}function sn(e,t,n,r,i,a){let o=tn.get(e);if(!o)return;let s=e=>{e!==void 0&&e.subs!==void 0&&(qt(e.subs),Qt(e.subs))};if(Ut(),t===`clear`)o.forEach(s);else{let i=j(e),a=i&&Re(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===an||!je(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(an)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(nn)),De(e)&&s(o.get(rn)));break;case`delete`:i||(s(o.get(nn)),De(e)&&s(o.get(rn)));break;case`set`:De(e)&&s(o.get(nn))}}Wt()}function cn(e,t){let n=tn.get(e);return n&&n.get(t)}function ln(e){let t=F(e);return t===e?t:(on(t,`iterate`,an),Zn(e)?t:t.map(er))}function un(e){return on(e=F(e),`iterate`,an),e}function dn(e,t){return Xn(e)?tr(Yn(e)?er(t):t):er(t)}var fn={__proto__:null,[Symbol.iterator](){return pn(this,Symbol.iterator,e=>dn(this,e))},concat(...e){return ln(this).concat(...e.map(e=>j(e)?ln(e):e))},entries(){return pn(this,`entries`,e=>(e[1]=dn(this,e[1]),e))},every(e,t){return hn(this,`every`,e,t,void 0,arguments)},filter(e,t){return hn(this,`filter`,e,t,e=>e.map(e=>dn(this,e)),arguments)},find(e,t){return hn(this,`find`,e,t,e=>dn(this,e),arguments)},findIndex(e,t){return hn(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return hn(this,`findLast`,e,t,e=>dn(this,e),arguments)},findLastIndex(e,t){return hn(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return hn(this,`forEach`,e,t,void 0,arguments)},includes(...e){return _n(this,`includes`,e)},indexOf(...e){return _n(this,`indexOf`,e)},join(e){return ln(this).join(e)},lastIndexOf(...e){return _n(this,`lastIndexOf`,e)},map(e,t){return hn(this,`map`,e,t,void 0,arguments)},pop(){return vn(this,`pop`)},push(...e){return vn(this,`push`,e)},reduce(e,...t){return gn(this,`reduce`,e,t)},reduceRight(e,...t){return gn(this,`reduceRight`,e,t)},shift(){return vn(this,`shift`)},some(e,t){return hn(this,`some`,e,t,void 0,arguments)},splice(...e){return vn(this,`splice`,e)},toReversed(){return ln(this).toReversed()},toSorted(e){return ln(this).toSorted(e)},toSpliced(...e){return ln(this).toSpliced(...e)},unshift(...e){return vn(this,`unshift`,e)},values(){return pn(this,`values`,e=>dn(this,e))}};function pn(e,t,n){let r=un(e),i=r[t]();return r!==e&&!Zn(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var mn=Array.prototype;function hn(e,t,n,r,i,a){let o=un(e),s=o!==e&&!Zn(e),c=o[t];if(c!==mn[t]){let t=c.apply(e,a);return s?er(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,dn(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function gn(e,t,n,r){let i=un(e),a=i!==e&&!Zn(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=dn(e,t)),n.call(this,t,dn(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?dn(e,c):c}function _n(e,t,n){let r=F(e);on(r,`iterate`,an);let i=r[t](...n);return(i===-1||i===!1)&&Qn(n[0])?(n[0]=F(n[0]),r[t](...n)):i}function vn(e,t,n=[]){Ut();let r=P(),i=F(e)[t].apply(e,n);return P(r),Wt(),i}var yn=ve(`__proto__,__v_isRef,__isVue`),bn=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(je));function xn(e){je(e)||(e=String(e));let t=F(this);return on(t,`has`,e),t.hasOwnProperty(e)}var Sn=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Hn:Vn:i?Bn:zn).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=j(e);if(!r){let e;if(a&&(e=fn[t]))return e;if(t===`hasOwnProperty`)return xn}let o=nr(e),s=Reflect.get(e,t,o?e:n);if(o&&t!==`value`||(je(t)?bn.has(t):yn(t))||(r||on(e,`get`,t),i))return s;if(nr(s)){let e=a&&Re(t)?s:s.value;return r&&Me(e)?Kn(e):e}return Me(s)?r?Kn(s):Wn(s):s}},Cn=class extends Sn{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=j(e)&&Re(t);if(!this._isShallow){let e=Xn(i);if(!Zn(n)&&!Xn(n)&&(i=F(i),n=F(n)),!a&&nr(i)&&!nr(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:A(e,t),s=Reflect.set(e,t,n,nr(e)?e:r);return e===F(r)&&s&&(o?Xe(n,i)&&sn(e,`set`,t,n,i):sn(e,`add`,t,n)),s}deleteProperty(e,t){let n=A(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&sn(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!je(t)||!bn.has(t))&&on(e,`has`,t),n}ownKeys(e){return on(e,`iterate`,j(e)?`length`:nn),Reflect.ownKeys(e)}},wn=class extends Sn{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Tn=new Cn,En=new wn,Dn=new Cn(!0),On=new wn(!0),kn=e=>e,An=e=>Reflect.getPrototypeOf(e);function jn(e,t,n){return function(...r){let i=this.__v_raw,a=F(i),o=De(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?kn:t?tr:er;return!t&&on(a,`iterate`,c?rn:nn),k(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function Mn(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Nn(e,t){let n={get(n){let r=this.__v_raw,i=F(r),a=F(n);e||(Xe(n,a)&&on(i,`get`,n),on(i,`get`,a));let{has:o}=An(i),s=t?kn:e?tr:er;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&on(F(t),`iterate`,nn),t.size},has(t){let n=this.__v_raw,r=F(n),i=F(t);return e||(Xe(t,i)&&on(r,`has`,t),on(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=F(a),s=t?kn:e?tr:er;return!e&&on(o,`iterate`,nn),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return k(n,e?{add:Mn(`add`),set:Mn(`set`),delete:Mn(`delete`),clear:Mn(`clear`)}:{add(e){let n=F(this),r=An(n),i=F(e),a=!t&&!Zn(e)&&!Xn(e)?i:e;return r.has.call(n,a)||Xe(e,a)&&r.has.call(n,e)||Xe(i,a)&&r.has.call(n,i)||(n.add(a),sn(n,`add`,a,a)),this},set(e,n){!t&&!Zn(n)&&!Xn(n)&&(n=F(n));let r=F(this),{has:i,get:a}=An(r),o=i.call(r,e);o||=(e=F(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?Xe(n,s)&&sn(r,`set`,e,n,s):sn(r,`add`,e,n),this},delete(e){let t=F(this),{has:n,get:r}=An(t),i=n.call(t,e);i||=(e=F(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&sn(t,`delete`,e,void 0,a),o},clear(){let e=F(this),t=e.size!==0,n=e.clear();return t&&sn(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=jn(r,e,t)}),n}function Pn(e,t){let n=Nn(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(A(n,r)&&r in t?n:t,r,i)}var Fn={get:Pn(!1,!1)},In={get:Pn(!1,!0)},Ln={get:Pn(!0,!1)},Rn={get:Pn(!0,!0)},zn=new WeakMap,Bn=new WeakMap,Vn=new WeakMap,Hn=new WeakMap;function Un(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Wn(e){return Xn(e)?e:Jn(e,!1,Tn,Fn,zn)}function Gn(e){return Jn(e,!1,Dn,In,Bn)}function Kn(e){return Jn(e,!0,En,Ln,Vn)}function qn(e){return Jn(e,!0,On,Rn,Hn)}function Jn(e,t,n,r,i){if(!Me(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Un(Ie(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Yn(e){return Xn(e)?Yn(e.__v_raw):!!(e&&e.__v_isReactive)}function Xn(e){return!!(e&&e.__v_isReadonly)}function Zn(e){return!!(e&&e.__v_isShallow)}function Qn(e){return e?!!e.__v_raw:!1}function F(e){let t=e&&e.__v_raw;return t?F(t):e}function $n(e){return!A(e,`__v_skip`)&&Object.isExtensible(e)&&Qe(e,`__v_skip`,!0),e}var er=e=>Me(e)?Wn(e):e,tr=e=>Me(e)?Kn(e):e;function nr(e){return e?e.__v_isRef===!0:!1}function rr(e){return ar(e,er)}function ir(e){return ar(e)}function ar(e,t){return nr(e)?e:new or(e,t)}var or=class{constructor(e,t){this.subs=void 0,this.subsTail=void 0,this.flags=Nt.Mutable,this.__v_isRef=!0,this.__v_isShallow=!1,this._oldValue=this._rawValue=t?F(e):e,this._value=t?t(e):e,this._wrap=t,this.__v_isShallow=!t}get dep(){return this}get value(){if(cr(this),this.flags&Nt.Dirty&&this.update()){let e=this.subs;e!==void 0&&Qt(e)}return this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Zn(e)||Xn(e);if(e=n?e:F(e),Xe(e,t)){this.flags|=Nt.Dirty,this._rawValue=e,this._value=!n&&this._wrap?this._wrap(e):e;let t=this.subs;t!==void 0&&(qt(t),Ft||Xt())}}update(){return this.flags&=~Nt.Dirty,Xe(this._oldValue,this._oldValue=this._rawValue)}};function sr(e){let t=e.dep;t!==void 0&&t.subs!==void 0&&(qt(t.subs),Qt(t.subs),Ft||Xt())}function cr(e){It!==void 0&&Gt(e,It)}function lr(e){return nr(e)?e.value:e}function ur(e){return M(e)?e():lr(e)}var dr={get:(e,t,n)=>t===`__v_raw`?e:lr(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return nr(i)&&!nr(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function fr(e){return Yn(e)?e:new Proxy(e,dr)}var pr=class{constructor(e){this.subs=void 0,this.subsTail=void 0,this.flags=Nt.None,this.__v_isRef=!0,this._value=void 0;let{get:t,set:n}=e(()=>cr(this),()=>sr(this));this._get=t,this._set=n}get dep(){return this}get value(){return this._value=this._get()}set value(e){this._set(e)}};function mr(e){return new pr(e)}function hr(e){let t=j(e)?Array(e.length):{};for(let n in e)t[n]=yr(e,n);return t}var gr=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=je(t)?t:String(t),this._raw=F(e);let r=!0,i=e;if(!j(e)||je(this._key)||!Re(this._key))do r=!Qn(i)||Zn(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=lr(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&nr(this._raw[this._key])){let t=this._object[this._key];if(nr(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return cn(this._raw,this._key)}},_r=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function vr(e,t,n){return nr(e)?e:M(e)?new _r(e):Me(e)&&arguments.length>1?yr(e,t,n):rr(e)}function yr(e,t,n){return new gr(e,t,n)}var br=class{fn(){}constructor(e){this.deps=void 0,this.depsTail=void 0,this.subs=void 0,this.subsTail=void 0,this.flags=18,this.cleanups=[],this.cleanupsLength=0,e!==void 0&&(this.fn=e),kr&&Gt(this,kr)}get active(){return!(this.flags&1024)}pause(){this.flags|=256}resume(){(this.flags&=-257)&48&&this.notify()}notify(){!(this.flags&256)&&this.dirty&&this.run()}run(){if(!this.active)return this.fn();Er(this);let e=Jt(this);Rt();try{return this.fn()}finally{zt(),Yt(this,e);let t=this.flags;(t&136)==136&&(this.flags=t&-9,this.notify())}}stop(){if(!this.active)return;this.flags=1024;let e=this.deps;for(;e!==void 0;)e=Kt(e,this);let t=this.subs;t!==void 0&&Kt(t),Er(this)}get dirty(){let e=this.flags;if(e&16)return!0;if(e&32){if(Zt(this.deps,this))return this.flags=e|16,!0;this.flags=e&-33}return!1}};function xr(e,t){e.effect instanceof br&&(e=e.effect.fn);let n=new br(e);if(t){let{onStop:e,scheduler:r}=t;if(e){t.onStop=void 0;let r=n.stop.bind(n);n.stop=()=>{r(),e()}}r&&(t.scheduler=void 0,n.notify=()=>{n.flags&256||r()}),k(n,t)}try{n.run()}catch(e){throw n.stop(),e}let r=n.run.bind(n);return r.effect=n,r}function Sr(e){e.effect.stop()}var Cr=[];function wr(){Cr.push(It),P()}function Tr(){Cr.length?P(Cr.pop()):P()}function Er(e){let t=e.cleanupsLength;if(t){for(let n=0;n<t;n++)e.cleanups[n]();e.cleanupsLength=0}}function Dr(e,t=!1){It instanceof br&&(It.cleanups[It.cleanupsLength++]=()=>Or(e))}function Or(e){let t=P();try{e()}finally{P(t)}}var kr,Ar=class{constructor(e=!1){this.deps=void 0,this.depsTail=void 0,this.subs=void 0,this.subsTail=void 0,this.flags=0,this.cleanups=[],this.cleanupsLength=0,!e&&kr&&Gt(this,kr)}get active(){return!(this.flags&1024)}pause(){if(!(this.flags&256)){this.flags|=256;for(let e=this.deps;e!==void 0;e=e.nextDep){let t=e.dep;`pause`in t&&t.pause()}}}resume(){let e=this.flags;if(e&256){this.flags=e&-257;for(let e=this.deps;e!==void 0;e=e.nextDep){let t=e.dep;`resume`in t&&t.resume()}}}run(e){let t=kr;try{return kr=this,e()}finally{kr=t}}stop(){if(!this.active)return;this.flags=1024,this.reset();let e=this.subs;e!==void 0&&Kt(e)}reset(){let e=this.deps;for(;e!==void 0;){let t=e.dep;`stop`in t?(e=e.nextDep,t.stop()):e=Kt(e,this)}Er(this)}};function jr(e){return new Ar(e)}function Mr(){return kr}function Nr(e){try{return kr}finally{kr=e}}function Pr(e,t=!1){kr!==void 0&&(kr.cleanups[kr.cleanupsLength++]=e)}var Fr=class{get effect(){return this}get dep(){return this}get _dirty(){let e=this.flags;if(e&Nt.Dirty)return!0;if(e&Nt.Pending){if(Zt(this.deps,this))return this.flags=e|Nt.Dirty,!0;this.flags=e&~Nt.Pending}return!1}set _dirty(e){e?this.flags|=Nt.Dirty:this.flags&=~(Nt.Dirty|Nt.Pending)}constructor(e,t){this.fn=e,this.setter=t,this._value=void 0,this.subs=void 0,this.subsTail=void 0,this.deps=void 0,this.depsTail=void 0,this.flags=Nt.Mutable|Nt.Dirty,this.__v_isRef=!0,this.__v_isReadonly=!t}get value(){let e=this.flags;if(e&Nt.Dirty||e&Nt.Pending&&Zt(this.deps,this)){if(this.update()){let e=this.subs;e!==void 0&&Qt(e)}}else e&Nt.Pending&&(this.flags=e&~Nt.Pending);return It===void 0?kr!==void 0&&Gt(this,kr):Gt(this,It),this._value}set value(e){this.setter&&this.setter(e)}update(){let e=Jt(this);try{let e=this._value,t=this.fn(e);return Xe(e,t)?(this._value=t,!0):!1}finally{Yt(this,e)}}};function Ir(e,t,n=!1){let r,i;return M(e)?r=e:(r=e.get,i=e.set),new Fr(r,i)}var Lr={GET:`get`,HAS:`has`,ITERATE:`iterate`},Rr={SET:`set`,ADD:`add`,DELETE:`delete`,CLEAR:`clear`},zr={},Br=void 0;function Vr(){return Br}function Hr(e,t=!1,n=Br){if(n){let{call:t}=n.options;t?n.cleanups[n.cleanupsLength++]=()=>t(e,4):n.cleanups[n.cleanupsLength++]=e}}var Ur=class extends br{constructor(e,t,n=O){let{deep:r,once:i,call:a,onWarn:o}=n,s,c=!1,l=!1;if(nr(e)?(s=()=>e.value,c=Zn(e)):Yn(e)?(s=()=>Wr(e,r),c=!0):j(e)?(l=!0,c=e.some(e=>Yn(e)||Zn(e)),s=()=>e.map(e=>{if(nr(e))return e.value;if(Yn(e))return Wr(e,r);if(M(e))return a?a(e,2):e()})):s=M(e)?t?a?()=>a(e,2):e:()=>{if(this.cleanupsLength){let e=P();try{Er(this)}finally{P(e)}}let t=Br;Br=this;try{return a?a(e,3,[this.boundCleanup]):e(this.boundCleanup)}finally{Br=t}}:be,t&&r){let e=s,t=r===!0?1/0:r;s=()=>Kr(e(),t)}if(super(s),this.cb=t,this.options=n,this.boundCleanup=e=>Hr(e,!1,this),this.forceTrigger=c,this.isMultiSource=l,i&&t){let e=t;t=(...t)=>{let n=e(...t);return this.stop(),n}}this.cb=t,this.oldValue=l?Array(e.length).fill(zr):zr}run(e=!1){let t=this.oldValue,n=this.oldValue=super.run();if(!this.cb)return;let{immediate:r,deep:i,call:a}=this.options;if((!e||r)&&(e||i||this.forceTrigger||(this.isMultiSource?n.some((e,n)=>Xe(e,t[n])):Xe(n,t)))){Er(this);let e=Br;Br=this;try{let e=[n,t===zr?void 0:this.isMultiSource&&t[0]===zr?[]:t,this.boundCleanup];a?a(this.cb,3,e):this.cb(...e)}finally{Br=e}}}};function Wr(e,t){return t?e:Zn(e)||t===!1||t===0?Kr(e,1):Kr(e)}function Gr(e,t,n=O){let r=new Ur(e,t,n);r.run(!0);let i=r.stop.bind(r);return i.pause=r.pause.bind(r),i.resume=r.resume.bind(r),i.stop=i,i}function Kr(e,t=1/0,n){if(t<=0||!Me(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,nr(e))Kr(e.value,t,n);else if(j(e))for(let r=0;r<e.length;r++)Kr(e[r],t,n);else if(Oe(e)||De(e))e.forEach(e=>{Kr(e,t,n)});else if(Le(e)){for(let r in e)Kr(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Kr(e[r],t,n)}return e}var qr=[];function Jr(e){qr.push(e)}function Yr(){qr.pop()}var Xr=!1;function Zr(e,...t){if(Xr)return;Xr=!0;let n=P(),r=qr.length?qr[qr.length-1]:null,i=lu(r)?r.component:r,a=i&&i.appContext.config.warnHandler,o=Qr();if(a)oi(a,i,11,[e+t.map(e=>{let t=e.toString;return t==null?JSON.stringify(e):t.call(e)}).join(``),i&&i.proxy||i,o.map(({ctx:e})=>`at <${id(i,e.type)}>`).join(`
2
+ `),o]);else{let n=[`[Vue warn]: ${e}`,...t];o.length&&n.push(`
3
+ `,...$r(o)),console.warn(...n)}P(n),Xr=!1}function Qr(){let e=qr[qr.length-1];if(!e)return[];let t=[];for(;e;){let n=t[0];if(n&&n.ctx===e?n.recurseCount++:t.push({ctx:e,recurseCount:0}),lu(e)){let t=e.component&&e.component.parent;e=t&&t.vnode||t}else e=e.parent}return t}function $r(e){let t=[];return e.forEach((e,n)=>{t.push(...n===0?[]:[`
4
+ `],...ei(e))}),t}function ei({ctx:e,recurseCount:t}){let n=t>0?`... (${t} recursive calls)`:``,r=lu(e)?e.component:e,i=r?r.parent==null:!1,a=` at <${id(r,e.type,i)}`,o=`>`+n;return e.props?[a,...ti(e.props),o]:[a+o]}function ti(e){let t=[],n=Object.keys(e);return n.slice(0,3).forEach(n=>{t.push(...ni(n,e[n]))}),n.length>3&&t.push(` ...`),t}function ni(e,t,n){return N(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t==`number`||typeof t==`boolean`||t==null?n?t:[`${e}=${t}`]:nr(t)?(t=ni(e,F(t.value),!0),n?t:[`${e}=Ref<`,t,`>`]):M(t)?[`${e}=fn${t.name?`<${t.name}>`:``}`]:(t=F(t),n?t:[`${e}=`,t])}function ri(e,t){}var ii={SETUP_FUNCTION:0,0:`SETUP_FUNCTION`,RENDER_FUNCTION:1,1:`RENDER_FUNCTION`,NATIVE_EVENT_HANDLER:5,5:`NATIVE_EVENT_HANDLER`,COMPONENT_EVENT_HANDLER:6,6:`COMPONENT_EVENT_HANDLER`,VNODE_HOOK:7,7:`VNODE_HOOK`,DIRECTIVE_HOOK:8,8:`DIRECTIVE_HOOK`,TRANSITION_HOOK:9,9:`TRANSITION_HOOK`,APP_ERROR_HANDLER:10,10:`APP_ERROR_HANDLER`,APP_WARN_HANDLER:11,11:`APP_WARN_HANDLER`,FUNCTION_REF:12,12:`FUNCTION_REF`,ASYNC_COMPONENT_LOADER:13,13:`ASYNC_COMPONENT_LOADER`,SCHEDULER:14,14:`SCHEDULER`,COMPONENT_UPDATE:15,15:`COMPONENT_UPDATE`,APP_UNMOUNT_CLEANUP:16,16:`APP_UNMOUNT_CLEANUP`},ai={sp:`serverPrefetch hook`,bc:`beforeCreate hook`,c:`created hook`,bm:`beforeMount hook`,m:`mounted hook`,bu:`beforeUpdate hook`,u:`updated`,bum:`beforeUnmount hook`,um:`unmounted hook`,a:`activated hook`,da:`deactivated hook`,ec:`errorCaptured hook`,rtc:`renderTracked hook`,rtg:`renderTriggered hook`,0:`setup function`,1:`render function`,2:`watcher getter`,3:`watcher callback`,4:`watcher cleanup function`,5:`native event handler`,6:`component event handler`,7:`vnode hook`,8:`directive hook`,9:`transition hook`,10:`app errorHandler`,11:`app warnHandler`,12:`ref function`,13:`async component loader`,14:`scheduler flush`,15:`component update`,16:`app unmount cleanup function`};function oi(e,t,n,r){try{return r?e(...r):e()}catch(e){ci(e,t,n)}}function si(e,t,n,r){if(M(e)){let i=oi(e,t,n,r);return i&&Ne(i)&&i.catch(e=>{ci(e,t,n)}),i}if(j(e)){let i=[];for(let a=0;a<e.length;a++)i.push(si(e[a],t,n,r));return i}}function ci(e,t,n,r=!0){let{errorHandler:i,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||O;if(t){let r=t.parent,a=t.proxy||t,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,a,o)===!1)return}r=r.parent}if(i){let t=P();oi(i,null,10,[e,a,o]),P(t);return}}li(e,n,t,r,a)}function li(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var ui={QUEUED:1,1:`QUEUED`,ALLOW_RECURSE:2,2:`ALLOW_RECURSE`,DISPOSED:4,4:`DISPOSED`,REQUEUE_ON_SUSPENSE_DISCARD:8,8:`REQUEUE_ON_SUSPENSE_DISCARD`},di=[],fi=[],pi=null,mi=null,hi=0,gi=0,_i=0,vi=Promise.resolve();function yi(e){let t=mi||vi;return e?t.then(this?e.bind(this):e):t}function bi(e,t,n,r){for(;n<r;){let i=n+r>>>1;t[i].order<=e?n=i+1:r=i}return n}function xi(e,t,n=!1,r=0){Si(e,t===void 0?n?-2:1/0:n?t*2:r?t*2+1+r/(r+1):t*2+1,di,hi,gi)&&(hi++,wi())}function Si(e,t,n,r,i){let a=e.flags;return a&1?!1:(e.flags=a|1,e.order=t,i===r||t>=n[r-1].order?n[r]=e:n.splice(bi(t,n,i,r),0,e),!0)}var Ci=()=>{try{Ai()}catch(e){throw mi=null,(hi||fi.length)&&wi(),e}};function wi(){mi||=vi.then(Ci)}function Ti(e,t=1/0){if(!j(e))pi&&t===-1?pi.splice(_i,0,e):Si(e,t,fi,fi.length,0);else for(let n=0;n<e.length;n++)Si(e[n],t,fi,fi.length,0);wi()}function Ei(e,t){for(let t=gi;t<hi;t++){let n=di[t];if(!(n.order&1||n.order===1/0)&&!(e&&n.order!==e.uid*2)){di.splice(t,1),t--,hi--,n.flags&2&&(n.flags&=-2);try{n()}finally{n.flags&2||(n.flags&=-2)}}}}function Di(e){if(fi.length){if(pi){for(let e=0;e<fi.length;e++)pi.push(fi[e]);fi.length=0;return}pi=fi,fi=[];try{for(;_i<pi.length;){let e=pi[_i++];if(e.flags&2&&(e.flags&=-2),!(e.flags&4))try{e()}finally{e.flags&2||(e.flags&=-2)}}}finally{for(;_i<pi.length;)pi[_i++].flags&=-2;pi=null,_i=0}}}var Oi=!1;function ki(e){if(!Oi){Oi=!0;try{Ei(e),Di()}finally{Oi=!1}}}function Ai(e){try{for(;gi<hi;){let e=di[gi];if(di[gi++]=void 0,!(e.flags&4)){e.flags&2&&(e.flags&=-2);try{e()}catch(t){ci(t,e.i,e.i?15:14)}finally{e.flags&2||(e.flags&=-2)}}}}finally{for(;gi<hi;)di[gi].flags&=-2,di[gi++]=void 0;gi=0,hi=0,di.length=0,Di(e),hi||fi.length?Ai(e):mi=null}}var ji=new Map;function Mi(e){let t=e.type.__hmrId,n=ji.get(t);n||=(Pi(t,e.type),ji.get(t)),n.instances.add(e)}function Ni(e){ji.get(e.type.__hmrId).instances.delete(e)}function Pi(e,t){return!ji.has(e)&&(ji.set(e,{initialDef:Fi(t),instances:new Set}),!0)}function Fi(e){return ad(e)?e.__vccOpts:e}var Ii,Li=[],Ri=!1;function zi(e,...t){Ii?Ii.emit(e,...t):Ri||Li.push({event:e,args:t})}function Bi(e,t){var n;Ii=e,Ii?(Ii.enabled=!0,Li.forEach(({event:e,args:t})=>Ii.emit(e,...t)),Li=[]):typeof window<`u`&&window.HTMLElement&&!((n=window.navigator)!=null&&(n=n.userAgent)!=null&&n.includes(`jsdom`))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{Bi(e,t)}),setTimeout(()=>{Ii||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ri=!0,Li=[])},3e3)):(Ri=!0,Li=[])}var Vi=Hi(`component:added`);function Hi(e){return t=>{zi(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}var Ui=null,Wi=null;function Gi(e){let t=Ui;return Ui=e,Wi=e&&e.type.__scopeId||null,t}function Ki(e){Wi=e}function qi(){Wi=null}var Ji=e=>Yi;function Yi(e,t=Ui,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&au(-1);let i=Gi(t),a=eu.length,o;try{o=e(...n)}finally{for(let e=eu.length;e>a;e--)ru();Gi(i),r._d&&au(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Xi(e,t){if(Ui===null)return e;let n=ed(Ui),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=O]=t[e];i&&(M(i)&&(i={mounted:i,updated:i}),i.deep&&Kr(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function Zi(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];if(c){let r=P();si(c,n,8,[e.el,s,e,t]),P(r)}}}function Qi(e,t){if(L){let n=L.provides,r=L.parent&&L.parent.provides;r===n&&(n=L.provides=Object.create(r)),n[e]=t}}function $i(e,t,n=!1){let r=Ou();if(r||yc){let i=yc?yc._context.provides:r?r.parent==null||r.ce?r.appContext&&r.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&M(t)?t.call(r&&r.proxy):t}}function ea(){return!!(Ou()||yc)}var ta=Symbol.for(`v-scx`),na=()=>$i(ta);function ra(e,t){return ca(e,null,t)}function ia(e,t){return ca(e,null,{flush:`post`})}function aa(e,t){return ca(e,null,{flush:`sync`})}function oa(e,t,n){return ca(e,t,n)}var sa=class extends Ur{constructor(e,t,n,r,i){super(t,n,r),this.flush=i;let a=()=>{this.dirty&&this.run()};n&&(this.flags|=128,a.flags|=2),e&&(a.i=e),this.job=a}notify(){if(!(this.flags&256)){let e=this.flush,t=this.job;e===`post`?I(t,void 0,t.i?t.i.suspense:null):e===`pre`?xi(t,t.i?t.i.uid:void 0,!0):t()}}};function ca(e,t,n=O){let{immediate:r,deep:i,flush:a=`pre`,once:o}=n,s=k({},n),c=t&&r||!t&&a!==`post`,l;if(Au){if(a===`sync`){let e=na();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=be,e.resume=be,e.pause=be,e}}let u=L;s.call=(e,t,n)=>si(e,u,t,n);let d=new sa(u,e,t,s,a);t?d.run(!0):a===`post`?I(d.job,void 0,u&&u.suspense):d.run(!0);let f=d.stop.bind(d);return f.pause=d.pause.bind(d),f.resume=d.resume.bind(d),f.stop=f,Au&&(l?l.push(f):c&&f()),f}function la(e,t,n){let r=this.proxy,i=N(e)?e.includes(`.`)?ua(r,e):()=>r[e]:e.bind(r,r),a;M(t)?a=t:(a=t.handler,n=t);let o=Nu(this),s=ca(i,a.bind(r),n);return Pu(o),s}function ua(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var da=new WeakMap,fa=Symbol(`_vte`),pa=e=>e.__isTeleport,ma=e=>e&&(e.disabled||e.disabled===``),ha=e=>e&&(e.defer||e.defer===``),ga=e=>typeof SVGElement<`u`&&e instanceof SVGElement,_a=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,va=(e,t)=>{let n=e&&e.to;return N(n)?t?t(n):null:n},ya={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=ma(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=ma(e.props),r=e.target=va(e.props,m),a=wa(r,e,h,p);r&&(o!==`svg`&&ga(r)?o=`svg`:o!==`mathml`&&_a(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),Ca(e,!1)))},S=e=>{let t=()=>{if(da.get(e)===t){if(da.delete(e),ma(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),Ca(e,!0)}x(e)}};da.set(e,t),I(t,void 0,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),ha(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),Ca(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=da.get(e);if(u){u.flags|=4,da.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=ma(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||ga(p)?o=`svg`:(o===`mathml`||_a(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),Dl(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ba(t,n,r,l,i,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=va(t.props,m);e&&(t.target=e,ba(t,e,null,l,i,0))}else g&&ba(t,p,h,l,i,1);Ca(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=ma(f),m=a||!p,h=da.get(e);if(h&&(h.flags|=4,da.delete(e)),l&&i(l),u&&i(u),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,m,!!i.dynamicChildren)}},move:ba,hydrate:xa};function ba(e,t,n,{o:{insert:r},m:i},a,o=2){o===0&&r(e.targetAnchor,t,n);let{el:s,anchor:c,shapeFlag:l,children:u,props:d}=e,f=o===2;if(f&&r(s,t,n),!da.has(e)&&(!f||ma(d))&&l&16)for(let e=0;e<u.length;e++)i(u[e],t,n,2,a);f&&r(c,t,n)}function xa(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=va(t.props,c),h=ma(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(p(e,t),f(m,c),t.targetAnchor||wa(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||wa(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),Ca(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}var Sa=ya;function Ca(e,t){let n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute(`data-v-owner`,n.uid),r=r.nextSibling;n.ut()}}function wa(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[fa]=o,e&&(r(a,e,i),r(o,e,i)),o}var Ta=Symbol(`_leaveCb`),Ea=Symbol(`_enterCb`);function Da(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingNodes:new Map};return us(()=>{e.isMounted=!0}),ps(()=>{e.isUnmounting=!0}),e}var Oa=[Function,Array],ka={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Oa,onEnter:Oa,onAfterEnter:Oa,onEnterCancelled:Oa,onBeforeLeave:Oa,onLeave:Oa,onAfterLeave:Oa,onLeaveCancelled:Oa,onBeforeAppear:Oa,onAppear:Oa,onAfterAppear:Oa,onAppearCancelled:Oa},Aa=e=>{let t=Nl(e.type)?e.block:e.subTree;return t.component?Aa(t.component):t},ja={name:`BaseTransition`,props:ka,setup(e,{slots:t}){let n=ku(),r=Da(),i;return()=>{let a=za(t.default&&t.default(),!!n.subTree);if(!a)return;let o=F(e),{mode:s}=o;return Ba(n.subTree,a,o,r,n,s===`out-in`?i||=()=>{n.job.flags&4||n.update()}:be)}}};function Ma(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==Zl){t=n;break}}return t}var Na=ja;function Pa(e,t){let{leavingNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Fa(e,t,n,r,i){let a=String(e.key),o=Pa(n,e);return Ia({isLeaving:()=>o[a]===e,setLeavingNodeCache:()=>{o[a]=e},unsetLeavingNodeCache:()=>{o[a]===e&&delete o[a]},earlyRemove:()=>{let t=o[a];t&&uu(e,t)&&t.el[Ta]&&t.el[Ta]()},cloneHooks:e=>{let a=Fa(e,t,n,r,i);return i&&i(a),a}},t,n,r)}function Ia(e,t,n,r){let{isLeaving:i,setLeavingNodeCache:a,unsetLeavingNodeCache:o,earlyRemove:s,cloneHooks:c}=e,{appear:l,mode:u,persisted:d=!1,onBeforeEnter:f,onEnter:p,onAfterEnter:m,onEnterCancelled:h,onBeforeLeave:g,onLeave:_,onAfterLeave:v,onLeaveCancelled:y,onBeforeAppear:b,onAppear:x,onAfterAppear:S,onAppearCancelled:C}=t,w=(e,t)=>{e&&si(e,r,9,t)},T=(e,t)=>{let n=t[1];w(e,t),j(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},E={mode:u,persisted:d,beforeEnter(e){let t=f;if(!n.isMounted){if(l)t=b||f;else return}e[Ta]&&e[Ta](!0),s(),w(t,[e])},enter(e){if(i())return;let t=p,r=m,a=h;if(!n.isMounted){if(l)t=x||p,r=S||m,a=C||h;else return}let o=!1;e[Ea]=t=>{o||(o=!0,w(t?a:r,[e]),E.delayedLeave&&E.delayedLeave(),e[Ea]=void 0)};let s=e[Ea].bind(null,!1);t?T(t,[e,s]):s()},leave(e,t){if(e[Ea]&&e[Ea](!0),n.isUnmounting)return t();w(g,[e]);let r=!1;e[Ta]=n=>{r||(r=!0,t(),w(n?y:v,[e]),e[Ta]=void 0,o(e))},a(e);let i=e[Ta].bind(null,!1);_?T(_,[e,i]):i()},clone(e){return c?c(e):E}};return E}function La(e){if(Yo(e))return e=vu(e),e.children=null,e}function Ra(e){if(!Yo(e))return pa(e.type)&&e.children?Ma(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&M(n.default))return n.default()}}function za(e,t=!1){let n=e&&Ka(e,!0);return n&&n.length?Ma(n):t?Su():void 0}function Ba(e,t,n,r,i,a,o){if(r.isLeaving)return La(t);let s=Ra(t);if(!s)return La(t);let c=Fa(s,n,r,i,e=>{o&&Va(e,o),c=e});o&&Va(c,o),s.type!==Zl&&Ga(s,c);let l=n.mode,u=e&&Ra(e);if(e&&u&&u.type!==Zl&&!uu(u,s)&&(!e.component||Aa(e.component).type!==Zl)){let e=Ua(u,n,r,i);if(s.type!==Zl&&(l===`out-in`||l===`in-out`)&&Wa(u,e,l===`in-out`?()=>c:void 0,n,r,a))return La(t)}return t}function Va(e,t){let n=t&&t.delayedLeave;n&&(e.delayedLeave=()=>{t.delayedLeave===n&&n(),delete e.delayedLeave})}function Ha(e,t,n,r,i,a){let o=Ra(e);return!o||o.type===Zl||e.component&&Aa(e.component).type===Zl?!1:Wa(o,Ua(o,n,r,i),t?()=>t:void 0,n,r,a)}function Ua(e,t,n,r){return Ga(e,Fa(e,t,n,r))}function Wa(e,t,n,r,i,a){if(r.mode===`out-in`)return i.isLeaving=!0,t.afterLeave=()=>{i.isLeaving=!1,a(),delete t.afterLeave},!0;if(r.mode===`in-out`&&n){let r=e;t.delayLeave=(e,t,a)=>{let o=n();if(!o){a();return}let s=r,c=Pa(i,s);c[String(s.key)]=s,e[Ta]=()=>{t(),e[Ta]=void 0,delete o.delayedLeave,r=void 0},o.delayedLeave=()=>{a(),delete o.delayedLeave,r=void 0}}}return!1}function Ga(e,t){if(e.shapeFlag&6&&e.component){if(e.transition=t,Nl(e.type))Ml(e.component,e).setTransitionHooks(e.component,t);else{let n=e.component.subTree;return Ga(pa(n.type)&&Ra(n)||n,t)}}else if(e.shapeFlag&128){let n=e.ssContent.transition=t.clone(e.ssContent),r=e.ssFallback.transition=t.clone(e.ssFallback);return e.suspense&&e.suspense.activeBranch===e.ssFallback?r:n}else e.transition=t;return t}function Ka(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===Yl?(o.patchFlag&128&&i++,r=r.concat(Ka(o.children,t,s))):(t||o.type!==Zl)&&r.push(s==null?o:vu(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function qa(e){}function Ja(e,t){return M(e)?k({name:e.name},t,{setup:e}):e}function Ya(){let e=Ou();return e?(e.appContext.config.idPrefix||`v`)+`-`+e.ids[0]+e.ids[1]++:``}function Xa(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}var Za=new WeakSet;function Qa(e){let t=Ou(),n=ir(null);if(t){let r=t.refs===O?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}function $a(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var eo=new WeakMap;function to(e,t,n,r,i=!1){if(j(e)){e.forEach((e,a)=>to(e,t&&(j(t)?t[a]:t),n,r,i));return}if(Uo(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&to(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?ed(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===O?s.refs={}:s.refs,d=s.setupState,f=no(d,u),p=(e,t)=>!(t&&$a(u,t));if(l!=null&&l!==c){if(ro(t),N(l))u[l]=null,f(l)&&(d[l]=null);else if(nr(l)){let e=t;p(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(M(c))oi(c,s,12,[o,u]);else{let t=N(c),r=nr(c);if(t||r){let s=()=>{if(e.f){let n=t?f(c)?d[c]:u[c]:p(c)||!e.k?c.value:u[e.k];if(i)j(n)&&Te(n,a);else if(j(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],f(c)&&(d[c]=u[c]);else{let t=[a];p(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,f(c)&&(d[c]=o)):r&&(p(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),eo.delete(e)};eo.set(e,t),I(t,-1,n)}else ro(e),s()}}}function no(e,t){let n=F(e);return e===void 0||e===O?xe:e=>!$a(t,e)&&A(n,e)}function ro(e){let t=eo.get(e);t&&(t.flags|=4,eo.delete(e))}var io=!1;function ao(e){io=e}var oo=!1,so=!1,co=()=>{so||=(console.error(`Hydration completed but contains mismatches.`),!0)},lo=e=>e.namespaceURI.includes(`svg`)&&e.tagName!==`foreignObject`,uo=e=>{if(!e.namespaceURI.includes(`MathML`))return!1;if(e.tagName!==`annotation-xml`)return!0;let t=e.getAttribute(`encoding`);return!t||!t.includes(`html`)},fo=e=>{if(e.nodeType===1){if(lo(e))return`svg`;if(uo(e))return`mathml`}},po=e=>e.nodeType===8;function mo(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:a,parentNode:o,remove:s,insert:c,createComment:l}}=e,u=(e,t)=>{if(io){if(!t.hasChildNodes()){n(null,e,t),Di(),t._vnode=e;return}oo=!0,d(t.firstChild,e,null,null,null),oo=!1,Di(),t._vnode=e}},d=(n,r,s,l,u,v=!1)=>{v||=!!r.dynamicChildren;let y=po(n)&&n.data===`[`,b=()=>h(n,r,s,l,u,y),{type:x,ref:S,shapeFlag:C,patchFlag:w}=r,T=n.nodeType;r.el=n,w===-2&&(v=!1,r.dynamicChildren=null);let E=null;switch(x){case Xl:T===3?(n.data!==r.children&&(co(),n.data=r.children),E=a(n)):r.children===``?(c(r.el=i(``),o(n),n),E=n):E=b();break;case Zl:ho(n)?(E=a(n),_(r.el=n.content.firstChild,n,s)):E=T!==8||y?b():a(n);break;case Ql:if(y&&(n=a(n),T=n.nodeType),T===1||T===3){E=n;let e=!r.children.length;for(let t=0;t<r.staticCount;t++)e&&(r.children+=E.nodeType===1?E.outerHTML:E.data),t===r.staticCount-1&&(r.anchor=E),E=a(E);return y?a(E):E}b();break;case Yl:E=y?m(n,r,s,l,u,v):b();break;case $l:E=Ml(s,r).hydrateSlot(r,n,s,l,u);break;default:if(C&1)E=(T!==1||r.type.toLowerCase()!==n.tagName.toLowerCase())&&!ho(n)?b():f(n,r,s,l,u,v);else if(C&6){r.slotScopeIds=u;let e=o(n);if(E=y?g(n):po(n)&&n.data===`teleport start`?g(n,n.data,`teleport end`):a(n),r.type.__vapor){let t=!Uo(r)&&r.props&&r.props.onVnodeBeforeMount;Ml(s,r).hydrate(r,n,e,E,s,l,()=>{r.dirs&&(Zi(r,null,s,`created`),Zi(r,null,s,`beforeMount`))},()=>{t&&Du(t,s,r)}),r.dirs&&Kl(()=>Zi(r,null,s,`mounted`),void 0,l);let i=!Uo(r)&&r.props&&r.props.onVnodeMounted;i&&Kl(()=>Du(i,s,r),void 0,l)}else{t(r,e,null,s,l,fo(e),v);let i=r.component;if(!i.subTree&&(Uo(r)||i.asyncDep&&!i.asyncResolved)){let t;y?(t=hu(Ql),t.anchor=E?E.previousSibling:e.lastChild):t=n.nodeType===3?bu(``):hu(`div`),t.el=n,i.subTree=t}}}else C&64?E=T===8?r.type.hydrate(n,r,s,l,u,v,e,p):b():C&128&&(E=r.type.hydrate(n,r,s,l,fo(o(n)),u,v,e,d))}return S!=null&&to(S,null,l,r),E},f=(e,t,n,i,a,o)=>{o||=!!t.dynamicChildren;let{type:c,dynamicProps:l,props:u,patchFlag:d,shapeFlag:f,dirs:m,transition:h}=t,g=c===`input`||c===`option`,v=!!l;if(g||v||d!==-1){m&&Zi(t,null,n,`created`);let c=!1;if(ho(e)){c=El(null,h)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;if(c){let e=r.getAttribute(`class`);e&&(r.$cls=e),h.beforeEnter(r)}_(r,e,n),t.el=e=r}if(f&16&&!(u&&(u.innerHTML||u.textContent))){let r=p(e.firstChild,t,e,n,i,a,o);for(r&&!ko(e,1)&&co();r;){let e=r;r=r.nextSibling,s(e)}}else if(f&8){let n=t.children;n[0]===`
5
+ `&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
6
+ `)&&(ko(e,0)||co(),e.textContent=t.children)}if(u){if(g||v||!o||d&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in u)if(g&&(a.endsWith(`value`)||a===`indeterminate`)||Se(a)&&!ze(a)||a[0]===`.`||t&&!ze(a)||l&&l.includes(a)){if(_o(e,a,u[a]))continue;r(e,a,null,u[a],i,n)}}else if(u.onClick)r(e,`onClick`,null,u.onClick,void 0,n);else if(d&4&&Yn(u.style))for(let e in u.style)u.style[e]}let y;(y=u&&u.onVnodeBeforeMount)&&Du(y,n,t),m&&Zi(t,null,n,`beforeMount`),((y=u&&u.onVnodeMounted)||m||c)&&Kl(()=>{y&&Du(y,n,t),c&&h.enter(e),m&&Zi(t,null,n,`mounted`)},void 0,i)}return e.nextSibling},p=(e,t,r,o,s,l,u)=>{u||=!!t.dynamicChildren;let f=t.children,p=f.length,m=!1;for(let t=0;t<p;t++){let h=u?f[t]:f[t]=Cu(f[t]),g=h.type===Xl;e?(g&&!u&&t+1<p&&Cu(f[t+1]).type===Xl&&(c(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=d(e,h,o,s,l,u)):g&&!h.children?c(h.el=i(``),r):(m||(m=!0,ko(r,1)||co()),n(null,h,r,null,o,s,fo(r),l))}return e},m=(e,t,n,r,i,s)=>{let{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);let d=o(e),f=p(a(e),t,d,n,r,i,s);return f&&po(f)&&f.data===`]`?a(t.anchor=f):(co(),c(t.anchor=l(`]`),d,f),f)},h=(e,t,r,i,c,l)=>{if(jo(e,t)||co(),t.el=null,l){let t=g(e);for(;;){let n=a(e);if(n&&n!==t)s(n);else break}}let u=a(e),d=o(e);return s(e),n(null,t,d,u,r,i,fo(d),c),r&&r.vnode&&(r.vnode.el=t.el,Lc(r,t.el)),u},g=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&po(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},_=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode&&i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent};return[u,d]}var ho=e=>e.nodeType===1&&e.tagName===`TEMPLATE`,go=new Set([`src`,`srcset`,`href`,`poster`]);function _o(e,t,n){return go.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}function vo(e,t,n){let r,i;return t===`hidden`?(r=xo(e.getAttribute(t)),i=xo(n)):mt(t)?(r=e.hasAttribute(t),i=ht(n)):n==null?(r=e.hasAttribute(t),i=!1):(r=e.hasAttribute(t)?e.getAttribute(t):t===`value`&&e.tagName===`TEXTAREA`&&e.value,i=vt(n)?String(n):!1),{actual:r,expected:i}}function yo(e,t){return e instanceof SVGElement&&_t(t)||e instanceof HTMLElement&&(mt(t)||gt(t))}function bo(e,t,n,r,i){if(n!=null&&!ko(e,n)){let a=e=>e===!1?`(not rendered)`:`${t}="${e}"`;return Zr(`Hydration ${Oo[n]} mismatch on`,e,`\n - rendered on server: ${a(r)}\n - expected on client: ${a(i)}\n Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.\n You should fix the source of the mismatch.`),!0}return!1}function xo(e){return vt(e)?N(e)?e.toLowerCase()===`until-found`?`until-found`:``:ht(e)?``:!1:!1}function So(e){return new Set(e.trim().split(/\s+/))}function Co(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function wo(e){let t=new Map;for(let n of e.split(`;`)){let[e,r]=n.split(`:`);e=e.trim(),r&&=r.trim(),e&&r&&t.set(e,r)}return t}function To(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e)if(r!==t.get(n))return!1;return!0}var Eo=`data-allow-mismatch`,Do={TEXT:0,0:`TEXT`,CHILDREN:1,1:`CHILDREN`,CLASS:2,2:`CLASS`,STYLE:3,3:`STYLE`,ATTRIBUTE:4,4:`ATTRIBUTE`},Oo={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function ko(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Eo);)e=e.parentElement;return Ao(e&&e.getAttribute(Eo),t)}function Ao(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(Oo[t])}}function jo(e,t){return ko(e.parentElement,1)||Mo(e)||No(t)}function Mo(e){return e.nodeType===1&&Ao(e.getAttribute(Eo),1)}function No({props:e}){let t=e&&e[Eo];return typeof t==`string`&&Ao(t,1)}var Po,Fo;function Io(){if(!Po){let e=nt();Po=e.requestIdleCallback||(e=>setTimeout(e,1)),Fo=e.cancelIdleCallback||(e=>clearTimeout(e))}}var Lo=(e=1e4)=>t=>{Io();let n=Po(t,{timeout:e});return()=>Fo(n)};function Ro(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var zo=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Ro(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Bo=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Vo=(e=[])=>(t,n)=>{N(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),`$evt${e.type}`in e.target||e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Ho(e,t){if(po(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(po(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Uo=e=>!!e.type.__asyncLoader;function Wo(e){let{load:t,getResolvedComp:n,setPendingRequest:r,source:{loadingComponent:i,errorComponent:a,delay:o,hydrate:s,timeout:c,suspensible:l=!0}}=Ko(e);return Ja({name:`AsyncComponentWrapper`,__asyncLoader:t,__asyncHydrate(e,r,i){Jo(e,r,i,n,t,s,!0)},get __asyncResolved(){return n()},setup(){let e=L;Xa(e);let s=n();if(s)return()=>Go(s,e);let u=t=>{r(null),ci(t,e,13,!a)};if(l&&e.suspense||Au)return t().then(t=>()=>Go(t,e)).catch(e=>(u(e),()=>a?hu(a,{error:e}):null));let{loaded:d,error:f,delayed:p}=qo(o,c,u,e);return t().then(()=>{e.isUnmounted||(d.value=!0,e.parent&&e.parent.vnode&&Yo(e.parent.vnode)&&e.parent.update())}).catch(t=>{if(e.isUnmounted){r(null);return}u(t),f.value=t}),()=>{if(s=n(),d.value&&s)return Go(s,e);if(f.value&&a)return hu(a,{error:f.value});if(i&&!p.value)return Go(i,e)}}})}function Go(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=hu(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}function Ko(e){M(e)&&(e={loader:e});let{loader:t,onError:n}=e,r=null,i,a=0,o=()=>(a++,r=null,s()),s=()=>{let e;return r||(e=r=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),n)return new Promise((t,r)=>{n(e,()=>t(o()),()=>r(e),a+1)});throw e}).then(t=>e!==r&&r?r:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),i=t,t)))};return{load:s,source:e,getResolvedComp:()=>i,setPendingRequest:e=>r=e}}var qo=(e,t,n,r=L)=>{let i=rr(!1),a=rr(),o=rr(!!e),s,c;return r&&ms(()=>{s!=null&&clearTimeout(s),c!=null&&clearTimeout(c)},r),e&&(c=setTimeout(()=>{r&&r.isUnmounted||(o.value=!1)},e)),t!=null&&(s=setTimeout(()=>{if(!(r&&r.isUnmounted)&&!i.value&&!a.value){let e=Error(`Async component timed out after ${t}ms.`);n(e),a.value=e}},t)),{loaded:i,error:a,delayed:o}};function Jo(e,t,n,r,i,a,o){let s=e.isConnected,c=!1;o&&(t.bu||=[]).push(()=>c=!0);let l=()=>{c||!e.parentNode||s&&!e.isConnected||n()},u=a?()=>{let n=a(l,t=>Ho(e,t));n&&(t.bum||=[]).push(n)}:l;r()?u():i().then(()=>!t.isUnmounted&&u())}var Yo=e=>e.type.__isKeepAlive,Xo={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=ku(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&e.length===1?e[0]:e};let i=new Map,a=new Set,o=null,s=n.suspense,{renderer:c}=r,{um:l,o:{createElement:u}}=c,d=u(`div`);r.getStorageContainer=()=>d,r.getCachedComponent=e=>{let t=e.key==null?e.type:e.key;return i.get(t)},r.activate=(e,t,r,i,a)=>{is(e,t,r,c,n,s,i,a)},r.deactivate=e=>{as(e,d,c,n,s)};function f(e){ns(e),l(e,n,s,!0)}function p(e){i.forEach((t,n)=>{let r=rd(Uo(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&m(n)})}function m(e){let t=i.get(e);t&&(!o||!uu(t,o))?f(t):o&&ns(o),i.delete(e),a.delete(e)}oa(()=>[e.include,e.exclude],([e,t])=>{e&&p(t=>Zo(e,t)),t&&p(e=>!Zo(t,e))},{flush:`post`,deep:!0});let h=null,g=()=>{h!=null&&(Il(n.subTree.type)?I(()=>{let e=rs(n.subTree);e.component&&i.set(h,e)},void 0,n.subTree.suspense):i.set(h,rs(n.subTree)))};return us(g),fs(g),ps(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=rs(t);if(e.type===i.type&&e.key===i.key){ns(i);let e=i.component.da;e&&I(e,void 0,r);return}f(e)})}),()=>{if(h=null,!t.default)return o=null;let n=t.default(),r=n[0];if(n.length>1)return o=null,n;if(!lu(r)||!(r.shapeFlag&4)&&!(r.shapeFlag&128))return o=null,r;let s=rs(r);if(s.type===Zl)return o=null,s;let c=s.type,l=rd(Uo(s)?s.type.__asyncResolved||{}:c),{include:u,exclude:d,max:f}=e;if(u&&(!l||!Zo(u,l))||d&&l&&Zo(d,l))return s.shapeFlag&=-257,o=s,r;let p=s.key==null?c:s.key,g=i.get(p);return s.el&&(s=vu(s),r.shapeFlag&128&&(r.ssContent=s)),h=p,g?(s.el=g.el,s.component=g.component,s.transition&&Ga(s,s.transition),s.shapeFlag|=512,a.delete(p),a.add(p)):(a.add(p),f&&a.size>parseInt(f,10)&&m(a.values().next().value)),s.shapeFlag|=256,o=s,Il(r.type)?r:s}}};function Zo(e,t){return j(e)?e.some(e=>Zo(e,t)):N(e)?e.split(`,`).includes(t):Ae(e)?(e.lastIndex=0,e.test(t)):!1}function Qo(e,t){es(e,`a`,t)}function $o(e,t){es(e,`da`,t)}function es(e,t,n=Ou()){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(ss(t,r,n),n){let e=n.parent;for(;e&&e.parent;){let i=e.parent;Yo(i.vapor?i:i.vnode)&&ts(r,t,n,e),e=e.parent}}}function ts(e,t,n,r){let i=ss(t,e,r,!0);ms(()=>{Te(r[t],i)},n)}function ns(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function rs(e){return e.shapeFlag&128?e.ssContent:e}function is(e,t,n,{p:r,m:i},a,o,s,c){let l=e.component;i(e,t,n,0,a,o),r(l.vnode,e,t,n,l,o,s,e.slotScopeIds,c),I(()=>{l.isDeactivated=!1,l.a&&Ze(l.a);let t=e.props&&e.props.onVnodeMounted;t&&Du(t,l.parent,e)},void 0,o)}function as(e,t,{m:n},r,i){let a=e.component;kl(a.m),kl(a.a),n(e,t,null,1,r,i),I(()=>{a.da&&Ze(a.da);let t=e.props&&e.props.onVnodeUnmounted;t&&Du(t,a.parent,e),a.isDeactivated=!0},void 0,i)}function ss(e,t,n=L,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{let i=P(),a=Nu(n);try{return si(t,n,e,r)}finally{Pu(a),P(i)}};return r?i.unshift(a):i.push(a),a}}var cs=e=>(t,n=L)=>{(!Au||e===`sp`)&&ss(e,(...e)=>t(...e),n)},ls=cs(`bm`),us=cs(`m`),ds=cs(`bu`),fs=cs(`u`),ps=cs(`bum`),ms=cs(`um`),hs=cs(`sp`),gs=cs(`rtg`),_s=cs(`rtc`);function vs(e,t=L){ss(`ec`,e,t)}var ys=`directives`;function bs(e,t){return ws(`components`,e,!0,t)||e}var xs=Symbol.for(`v-ndc`);function Ss(e){return N(e)?ws(`components`,e,!1)||e:e||xs}function Cs(e){return ws(ys,e)}function ws(e,t,n=!0,r=!1){let i=Ui||L;if(i){let n=i.type;if(e===`components`){let e=rd(n,!1);if(e&&(e===t||e===We(t)||e===qe(We(t))))return n}let a=Ts(i[e]||n[e],t)||Ts(i.appContext[e],t);return!a&&r?n:a}}function Ts(e,t){return e&&(e[t]||e[We(t)]||e[qe(We(t))])}function Es(e,t,n,r){let i,a=n&&n[r],o=j(e);if(o||N(e)){let n=o&&Yn(e),r=!1,s=!1;n&&(r=!Zn(e),s=Xn(e),e=un(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?tr(er(e[n])):er(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(Me(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}function Ds(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(j(r))for(let t=0;t<r.length;t++)e[r[t].name]=r[t].fn;else r&&(e[r.name]=r.key?(...e)=>{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}var Os=Symbol(`rawVaporSlot`),ks=Symbol(`vdomSlotFallback`);function As(e,t,n,r,i,a){n??={};let o=e[t];r&&(r[ks]=!0);let s=o&&o[Os];if(s){let e=(nu(),cu($l,n));return e.vs={slot:s,fallback:r},!i&&e.scopeId&&(e.slotScopeIds=[e.scopeId+`-s`]),e}if(Ui&&(Ui.ce||Ui.parent&&Uo(Ui.parent)&&Ui.parent.ce)){let e=a!=null&&n.key==null?k({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),nu(),cu(Yl,null,[hu(`slot`,e,r&&r())],i?-2:64)}o&&o._c&&(o._d=!1);let c=eu.length;nu();let l;try{let i=o&&js(o(n));Ms(i,r);let s=n.key||a||i&&i.key;l=cu(Yl,{key:(s&&!je(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=eu.length;e>c;e--)ru();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+`-s`]),l}function js(e){return e.some(e=>!lu(e)||!(e.type===Zl||e.type===Yl&&!js(e.children)))?e:null}function Ms(e,t){let n;e&&e.length===1&&lu(e[0])&&(n=e[0].vs)&&(n.outletFallback=t)}function Ns(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:Je(r)]=e[r];return n}var Ps=e=>!e||e.vapor?null:Hu(e)?ed(e):Ps(e.parent),Fs,Is=()=>(Fs||=k(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ps(e.parent),$root:e=>Ps(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>oc(e),$forceUpdate:e=>e.f||=()=>{xi(e.update)},$nextTick:e=>e.n||=yi.bind(e.proxy),$watch:e=>la.bind(e)}),Fs),Ls=(e,t)=>e!==O&&!e.__isScriptSetup&&A(e,t),Rs={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Ls(r,t))return o[t]=1,r[t];else if(i!==O&&A(i,t))return o[t]=2,i[t];else if(A(a,t))return o[t]=3,a[t];else if(n!==O&&A(n,t))return o[t]=4,n[t];else tc&&(o[t]=0)}let l=Is()[t],u,d;if(l)return t===`$attrs`&&on(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==O&&A(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,A(d,t))return d[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Ls(i,t)?(i[t]=n,!0):r!==O&&A(r,t)?(r[t]=n,!0):A(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==O&&s[0]!==`$`&&A(e,s)||Ls(t,s)||A(a,s)||A(r,s)||A(Is(),s)||A(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?A(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},zs=k({},Rs,{get(e,t){if(t!==Symbol.unscopables)return Rs.get(e,t,e)},has(e,t){return t[0]!==`_`&&!it(t)}});function Bs(){return null}function Vs(){return null}function Hs(e){}function Us(e){}function Ws(){return null}function Gs(){}function Ks(e,t){return null}function qs(){return Ys(`useSlots`).slots}function Js(){return Ys(`useAttrs`).attrs}function Ys(e){let t=Ou();if(t.vapor)return t;{let e=t;return e.setupContext||=Qu(e)}}function Xs(e){return j(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function Zs(e,t){let n=Xs(e);for(let e in t){if(e.startsWith(`__skip`))continue;let r=n[e];r?j(r)||M(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:r===null&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function Qs(e,t){return!e||!t?e||t:j(e)&&j(t)?e.concat(t):k({},Xs(e),Xs(t))}function $s(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function ec(e){let t=Ou(),n=Au,r=t&&t.restoreAsyncContext?t.restoreAsyncContext.bind(t):void 0,i=e();Nu(null,void 0),n&&ju(!1);let a=()=>{let e=t&&!t.scope.active?t.scope:void 0;Nu(t),n&&ju(!0);let i=r&&r();return()=>{i&&i(),e&&e.reset()}},o=()=>{Nu(null,void 0),n&&ju(!1)};return Ne(i)&&(i=i.catch(e=>{let t=a();throw Promise.resolve().then(()=>Promise.resolve().then(()=>{t&&t(),o()})),e})),[i,()=>{let e=a();Promise.resolve().then(()=>{e&&e(),o()})}]}var tc=!0;function nc(e){let t=oc(e),n=e.proxy,r=e.ctx;tc=!1,t.beforeCreate&&ic(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:m,activated:h,deactivated:g,beforeDestroy:_,beforeUnmount:v,destroyed:y,unmounted:b,render:x,renderTracked:S,renderTriggered:C,errorCaptured:w,serverPrefetch:T,expose:E,inheritAttrs:ee,components:te,directives:ne,filters:D}=t;if(l&&rc(l,r,null),o)for(let e in o){let t=o[e];M(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);Me(t)&&(e.data=Wn(t))}if(tc=!0,a)for(let e in a){let t=a[e],i=od({get:M(t)?t.bind(n,n):M(t.get)?t.get.bind(n,n):be,set:!M(t)&&M(t.set)?t.set.bind(n):be});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(s)for(let e in s)ac(s[e],r,n,e);if(c){let e=M(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{Qi(t,e[t])})}u&&ic(u,e,`c`);function re(e,t){j(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(re(ls,d),re(us,f),re(ds,p),re(fs,m),re(Qo,h),re($o,g),re(vs,w),re(_s,S),re(gs,C),re(ps,v),re(ms,b),re(hs,T),j(E)){if(E.length){let t=e.exposed||={};E.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}x&&e.render===be&&(e.render=x),ee!=null&&(e.inheritAttrs=ee),te&&(e.components=te),ne&&(e.directives=ne),T&&Xa(e)}function rc(e,t,n=be){j(e)&&(e=dc(e));for(let n in e){let r=e[n],i;i=Me(r)?`default`in r?$i(r.from||n,r.default,!0):$i(r.from||n):$i(r),nr(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function ic(e,t,n){si(j(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ac(e,t,n,r){let i=r.includes(`.`)?ua(n,r):()=>n[r];if(N(e)){let n=t[e];M(n)&&oa(i,n)}else if(M(e))oa(i,e.bind(n));else if(Me(e)){if(j(e))e.forEach(e=>ac(e,t,n,r));else{let r=M(e.handler)?e.handler.bind(n):t[e.handler];M(r)&&oa(i,r,e)}}}function oc(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>sc(c,e,o,!0)),sc(c,t,o)),Me(t)&&a.set(t,c),c}function sc(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&sc(e,a,n,!0),i&&i.forEach(t=>sc(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=cc[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var cc={data:lc,props:mc,emits:mc,methods:pc,computed:pc,beforeCreate:fc,created:fc,beforeMount:fc,mounted:fc,beforeUpdate:fc,updated:fc,beforeDestroy:fc,beforeUnmount:fc,destroyed:fc,unmounted:fc,activated:fc,deactivated:fc,errorCaptured:fc,serverPrefetch:fc,components:pc,directives:pc,watch:hc,provide:lc,inject:uc};function lc(e,t){return t?e?function(){return k(M(e)?e.call(this,this):e,M(t)?t.call(this,this):t)}:t:e}function uc(e,t){return pc(dc(e),dc(t))}function dc(e){if(j(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function fc(e,t){return e?[...new Set([].concat(e,t))]:t}function pc(e,t){return e?k(Object.create(null),e,t):t}function mc(e,t){return e?j(e)&&j(t)?[...new Set([...e,...t])]:k(Object.create(null),Xs(e),Xs(t??{})):t}function hc(e,t){if(!e)return t;if(!t)return e;let n=k(Object.create(null),e);for(let r in t)n[r]=fc(e[r],t[r]);return n}function gc(){return{app:null,config:{isNativeTag:xe,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var _c=0;function vc(e,t,n,r){return function(r,i=null){M(r)||(r=k({},r)),i!=null&&!Me(i)&&(i=null);let a=gc(),o=new WeakSet,s=[],c=!1,l=a.app={_uid:_c++,_component:r,_props:i,_container:null,_context:a,_instance:null,version:dd,get config(){return a.config},set config(e){},use(e,...t){return o.has(e)||(e&&M(e.install)?(o.add(e),e.install(l,...t)):M(e)&&(o.add(e),e(l,...t))),l},mixin(e){return a.mixins.includes(e)||a.mixins.push(e),l},component(e,t){return t?(a.components[e]=t,l):a.components[e]},directive(e,t){return t?(a.directives[e]=t,l):a.directives[e]},mount(t,r,i){if(!c){let a=e(l,t,r,i);return c=!0,l._container=t,t.__vue_app__=l,n(a)}},onUnmount(e){s.push(e)},unmount(){c&&(si(s,l._instance,16),t(l),delete l._container.__vue_app__)},provide(e,t){return a.provides[e]=t,l},runWithContext(e){let t=yc;yc=l;try{return e()}finally{yc=t}}};return l}}var yc=null;function bc(e,t,n=O){let r=Ou(),i=We(t),a=Ke(t),o=xc(e,i,wc),s=mr((o,s)=>{let c,l=O,u;return aa(()=>{let t=e[i];Xe(c,t)&&(c=t,s())}),{get(){return o(),n.get?n.get(c):c},set(e){let o=n.set?n.set(e):e;if(!Xe(o,c)&&!(l!==O&&Xe(e,l)))return;let d,f=!1,p=!1;if(r.rawKeys)d=r.rawKeys();else{let e=r.vnode.props;d=e&&Object.keys(e)}if(d)for(let e of d)e===t||e===i||e===a?f=!0:(e===`onUpdate:${t}`||e===`onUpdate:${i}`||e===`onUpdate:${a}`)&&(p=!0);let m=f&&p;m||(c=e,s()),r.emit(`update:${t}`,o),Xe(e,l)&&(Xe(e,o)&&!Xe(o,u)||m&&l!==O&&!Xe(o,c))&&s(),l=e,u=o}}});return s[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?o||O:s,done:!1}:{done:!0}}}},s}var xc=(e,t,n)=>n(e,Ye(t))||n(e,`${We(t)}Modifiers`)||n(e,`${Ke(t)}Modifiers`);function Sc(e,t,...n){return Cc(e,e.vnode.props||O,wc,t,...n)}function Cc(e,t,n,r,...i){if(e.isUnmounted)return;let a=i,o=r.startsWith(`update:`),s=o&&xc(t,r.slice(7),n);s&&(s.trim&&(a=i.map(e=>N(e)?e.trim():e)),s.number&&(a=a.map($e)));let c,l=n(t,c=Je(r))||n(t,c=Je(We(r)));!l&&o&&(l=n(t,c=Je(Ke(r)))),l&&si(l,e,6,a);let u=n(t,c+`Once`);if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,si(u,e,6,a)}}function wc(e,t){return e[t]}var Tc=new WeakMap;function Ec(e,t,n=!1){let r=n?Tc:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!M(e)){let r=e=>{let n=Ec(e,t,!0);n&&(s=!0,k(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(Me(e)&&r.set(e,null),null):(j(a)?a.forEach(e=>o[e]=null):k(o,a),Me(e)&&r.set(e,o),o)}function Dc(e,t){return!e||!Se(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),A(e,t[0].toLowerCase()+t.slice(1))||A(e,Ke(t))||A(e,t))}function Oc(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=Gi(e),_,v;try{if(n.shapeFlag&4){let e=i||r,t=e;_=Cu(l.call(t,e,u,d,p,f,m)),v=s}else{let e=t;_=Cu(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),v=t.props?s:Mc(s)}}catch(t){eu.length=0,ci(t,e,1),_=hu(Zl)}let y=_;if(v&&h!==!1){let e=Object.keys(v),{shapeFlag:t}=y;e.length&&t&7&&(a&&e.some(we)&&(v=Nc(v,a)),y=vu(y,v,!1,!0))}return n.dirs&&(y=vu(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Ga(pa(y.type)&&Ra(y)||y,n.transition),_=y,Gi(g),_}function kc(e){let t=Object.keys(e),n=[],r=[];for(let e=0,i=t.length;e<i;e++){let i=t[e];Se(i)?we(i)||n.push(i[2].toLowerCase()+i.slice(3)):r.push(i)}r.length&&Zr(`Extraneous non-props attributes (${r.join(`, `)}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`),n.length&&Zr(`Extraneous non-emits event listeners (${n.join(`, `)}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}function Ac(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(lu(r)){if(r.type!==Zl||r.children===`v-if`){if(n)return;n=r}}else return}return n}var jc=e=>e===`class`||e===`style`||Se(e),Mc=e=>{let t;for(let n in e)jc(n)&&((t||={})[n]=e[n]);return t},Nc=(e,t)=>{let n={};for(let r in e)(!we(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Pc(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Fc(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Ic(o,r,n)&&!Dc(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||Fc(r,o,l):!!o;return!1}function Fc(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(Ic(t,e,a)&&!Dc(n,a))return!0}return!1}function Ic(e,t,n){let r=e[n],i=t[n];return n===`style`&&Me(r)&&Me(i)?!St(r,i):r!==i}function Lc({vnode:e,parent:t,suspense:n},r){for(;t&&!t.vapor;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var Rc={},zc=()=>Object.create(Rc),Bc=e=>Object.getPrototypeOf(e)===Rc;function Vc(e,t,n,r=!1){let i=e.props={},a=zc();e.propsDefaults=Object.create(null),Uc(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Gn(i):e.type.props?i:a,e.attrs=a}function Hc(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=F(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(Dc(e.emitsOptions,o))continue;let s=t[o];if(c){if(A(a,o))s!==a[o]&&(a[o]=s,l=!0);else{let t=We(o);i[t]=Wc(c,t,s,e,Gc)}}else s!==a[o]&&(a[o]=s,l=!0)}}}else{Uc(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!A(t,a)&&((r=Ke(a))===a||!A(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=Wc(c,a,void 0,e,Gc,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!A(t,e))&&(delete a[e],l=!0)}l&&sn(e.attrs,`set`,``)}function Uc(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(ze(c))continue;let l=t[c],u;i&&A(i,u=We(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:Dc(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=s||O;for(let r=0;r<a.length;r++){let o=a[r];n[o]=Wc(i,o,t[o],e,Gc,!A(t,o))}}return o}function Wc(e,t,n,r,i,a=!1){let o=e[t];if(o!=null){let e=A(o,`default`);if(e&&n===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&M(e)){let a=r.propsDefaults||={};n=A(a,t)?a[t]:a[t]=i(e,r,t)}else n=e;r.ce&&r.ce._setProp(t,n)}o[0]&&(a&&!e?n=!1:o[1]&&(n===``||n===Ke(t))&&(n=!0))}return n}function Gc(e,t,n){let r,i=Nu(t),a=F(t.props);return r=e.call(null,a),Pu(i),r}var Kc=new WeakMap;function qc(e,t,n=!1){let r=n?Kc:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!M(e)){let r=e=>{c=!0;let[n,r]=qc(e,t,!0);k(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return Me(e)&&r.set(e,ye),ye;Jc(a,o,s);let l=[o,s];return Me(e)&&r.set(e,l),l}function Jc(e,t,n){if(j(e))for(let n=0;n<e.length;n++){let r=We(e[n]);Yc(r)&&(t[r]=O)}else if(e)for(let r in e){let i=We(r);if(Yc(i)){let a=e[r],o=t[i]=j(a)||M(a)?{type:a}:k({},a),s=o.type,c=!1,l=!0;if(j(s))for(let e=0;e<s.length;++e){let t=s[e],n=M(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=M(s)&&s.name===`Boolean`;o[0]=c,o[1]=l,(c||A(o,`default`))&&n.push(i)}}}function Yc(e){return e[0]!==`$`&&!ze(e)}function Xc(e){return e===null?`null`:typeof e==`function`?e.name||``:typeof e==`object`&&e.constructor&&e.constructor.name||``}function Zc(e,t,n){t=F(t);let r=Object.keys(e).map(e=>We(e));for(let e in n){let i=n[e];i!=null&&Qc(e,t[e],i,t,!r.includes(e))}}function Qc(e,t,n,r,i){let{type:a,required:o,validator:s,skipCheck:c}=n;if(o&&i){Zr(`Missing required prop: "`+e+`"`);return}if(t!=null||o){if(a!=null&&a!==!0&&!c){let n=!1,r=j(a)?a:[a],i=[];for(let e=0;e<r.length&&!n;e++){let{valid:a,expectedType:o}=el(t,r[e]);i.push(o||``),n=a}if(!n){Zr(tl(e,t,i));return}}s&&!s(t,r)&&Zr(`Invalid prop: custom validator check failed for prop "`+e+`".`)}}var $c=ve(`String,Number,Boolean,Function,Symbol,BigInt`);function el(e,t){let n,r=Xc(t);if(r===`null`)n=e===null;else if($c(r)){let i=typeof e;n=i===r.toLowerCase(),!n&&i===`object`&&(n=e instanceof t)}else n=r===`Object`?Me(e):r===`Array`?j(e):e instanceof t;return{valid:n,expectedType:r}}function tl(e,t,n){if(n.length===0)return`Prop type [] for prop "${e}" won't match anything. Did you mean to use type Array instead?`;let r=`Invalid prop: type check failed for prop "${e}". Expected ${n.map(qe).join(` | `)}`,i=n[0],a=Ie(t),o=nl(t,i),s=nl(t,a);return n.length===1&&rl(i)&&il(i,a)&&(r+=` with value ${o}`),r+=`, got ${a} `,rl(a)&&(r+=`with value ${s}.`),r}function nl(e,t){return je(e)?e.toString():t===`String`?`"${e}"`:t===`Number`?`${Number(e)}`:`${e}`}function rl(e){return[`string`,`number`,`boolean`].some(t=>e.toLowerCase()===t)}function il(...e){return e.every(e=>{let t=e.toLowerCase();return t!==`boolean`&&t!==`symbol`})}var al=e=>e===`_`||e===`_ctx`||e===`$stable`,ol=e=>j(e)?e.map(Cu):[Cu(e)],sl=(e,t,n)=>{if(t._n)return t;let r=Yi((...e)=>ol(t(...e)),n);return r._c=!1,r},cl=(e,t,n)=>{let r=e._ctx;for(let n in e){if(al(n))continue;let i=e[n];if(M(i))t[n]=sl(n,i,r);else if(i!=null){let e=ol(i);t[n]=()=>e}}},ll=(e,t)=>{let n=ol(t);e.slots.default=()=>n},ul=(e,t,n)=>{for(let r in t)(n||!al(r))&&(e[r]=t[r])},dl=(e,t,n)=>{let r=e.slots=zc();if(e.vnode.shapeFlag&32){let i=t._;i?(ul(r,t,n),n&&Qe(r,`_`,i,!0)):cl(t,r,e)}else t&&ll(e,t)},fl=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=O;if(r.shapeFlag&32){let r=t._;r?n&&r===1?a=!1:ul(i,t,n):(a=!t.$stable,cl(t,i,e)),o=t}else t&&(ll(e,t),o={default:1});if(a)for(let e in i)!al(e)&&o[e]==null&&delete i[e]},pl,ml;function hl(e,t){e.appContext.config.performance&&_l()&&ml.mark(`vue-${t}-${e.uid}`)}function gl(e,t){if(e.appContext.config.performance&&_l()){let n=`vue-${t}-${e.uid}`,r=n+`:end`,i=`<${id(e,e.type)}> ${t}`;ml.mark(r),ml.measure(i,n,r),ml.clearMeasures(i),ml.clearMarks(n),ml.clearMarks(r)}}function _l(){return pl===void 0&&(typeof window<`u`&&window.performance?(pl=!0,ml=window.performance):pl=!1),pl}var vl=!1;function yl(){vl||=!0}var bl={ENTER:0,0:`ENTER`,LEAVE:1,1:`LEAVE`,REORDER:2,2:`REORDER`},I=Kl;function xl(e){return Cl(e)}function Sl(e){return Cl(e,mo)}function Cl(e,t){yl();let n=nt();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=be,insertStaticContent:m}=e,h=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!uu(e,t)&&(r=ge(e),de(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case Xl:g(e,t,n,r);break;case Zl:_(e,t,n,r);break;case Ql:e??v(t,n,r,o);break;case Yl:te(e,t,n,r,i,a,o,s,c);break;case $l:Ml(i,t).slot(e,t,n,r,i,a,s);break;default:d&1?x(e,t,n,r,i,a,o,s,c):d&6?ne(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,ve)}u!=null&&i?to(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&to(e.ref,null,a,e,!0)},g=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=m(e.children,t,n,r,e.el,e.anchor)},y=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=f(e),r(e,n,i),e=a;r(t,n,i)},b=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),i(e),e=n;i(t)},x=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)S(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),T(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},S=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&w(e.children,f,null,i,s,wl(e,c),l,d),_&&Zi(e,null,i,`created`),C(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!ze(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&Du(p,i,e)}_&&Zi(e,null,i,`beforeMount`),g?Al(f,g,()=>r(f,t,n),s):r(f,t,n),((p=m&&m.onVnodeMounted)||_)&&I(()=>{try{p&&Du(p,i,e),_&&Zi(e,null,i,`mounted`)}finally{}},void 0,s)},C=(e,t,n,r,i)=>{if(n&&p(e,n),r)for(let t=0;t<r.length;t++)p(e,r[t]);let a=Pl(t,i);for(let t=0;t<a.length;t++)p(e,a[t])},w=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?wu(e[l]):Cu(e[l]);h(null,c,t,n,r,i,a,o,s)}},T=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:f}=t;l|=e.patchFlag&16;let p=e.props||O,m=t.props||O,h;if(n&&Tl(n,!1),(h=m.onVnodeBeforeUpdate)&&Du(h,n,t,e),t.ibu&&t.ibu(),f&&Zi(t,e,n,`beforeUpdate`),n&&Tl(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(l=0,s=!1,d=null),(p.innerHTML&&m.innerHTML==null||p.textContent&&m.textContent==null)&&u(c,``),d?E(e.dynamicChildren,d,c,n,r,wl(t,i),o):s||se(e,t,c,null,n,r,wl(t,i),o,!1),l>0){if(l&16)ee(c,p,m,n,i);else if(l&2&&p.class!==m.class&&a(c,`class`,null,m.class,i),l&4&&a(c,`style`,p.style,m.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=p[r],s=m[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&d==null&&ee(c,p,m,n,i);((h=m.onVnodeUpdated)||f||t.iu)&&I(()=>{h&&Du(h,n,t,e),t.iu&&t.iu(),f&&Zi(t,e,n,`updated`)},void 0,r)},E=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===Yl||!uu(c,l)||c.shapeFlag&198)?d(c.el):n;h(c,l,u,null,r,i,a,o,!0)}},ee=(e,t,n,r,i)=>{if(t!==n){if(t!==O)for(let o in t)!ze(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(ze(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},te=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),w(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(E(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&Dl(e,t,!0)):se(e,t,n,f,a,o,c,l,u)},ne=(e,t,n,r,i,a,o,s,c)=>{if(t.slotScopeIds=s,t.type.__vapor){if(e==null){if(t.shapeFlag&512)Ml(i,t).activate(t,n,r,i,a);else{let e=!Uo(t)&&t.props&&t.props.onVnodeBeforeMount;Ml(i,t).mount(t,n,r,i,a,()=>{t.dirs&&(Zi(t,null,i,`created`),Zi(t,null,i,`beforeMount`))},()=>{e&&Du(e,i,t)}),t.dirs&&I(()=>Zi(t,null,i,`mounted`),void 0,a);let o=!Uo(t)&&t.props&&t.props.onVnodeMounted;if(o){let e=t;I(()=>Du(o,i,e),void 0,a)}}}else{let n=Pc(e,t,c);Ml(i,t).update(e,t,n,()=>{t.dirs&&Zi(t,e,i,`beforeUpdate`)},()=>{let n=t.props&&t.props.onVnodeBeforeUpdate;n&&Du(n,i,t,e),t.ibu&&t.ibu()});let r=t.props&&t.props.onVnodeUpdated;n&&(r||t.dirs||t.iu)&&I(()=>{t.dirs&&Zi(t,e,i,`updated`),r&&Du(r,i,t,e),t.iu&&t.iu()},void 0,a)}}else e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):D(t,n,r,i,a,o,c):re(e,t,c)},D=(e,t,n,r,a,o,s)=>{let c=e.component=Bu(e,r,a);if(Yo(e)&&(c.ctx.renderer=ve),Uu(c,!1,s),c.asyncDep){if(a){let e=c.vnode.el;a.registerDep(c,t=>{let{vnode:n}=c;Gu(c,t,!1),e&&(n.el=e);let r=!e&&c.subTree.el;ae(c,n,d(e||c.subTree.el),e?null:ge(c.subTree),a,o,s),r&&(n.placeholder=null,i(r)),Lc(c,n.el)})}if(!e.el){let r=c.subTree=hu(Zl);_(null,r,t,n),e.placeholder=r.el}}else ae(c,e,t,n,a,o,s)},re=(e,t,n)=>{let r=t.component=e.component;if(Pc(e,t,n)){if(r.asyncDep&&!r.asyncResolved){oe(r,t,n);return}r.next=t,r.effect.run()}else t.el=e.el,r.vnode=t};class ie extends br{constructor(e,t,n,r,i,a,o){let s=Nr(e.scope);super(),this.instance=e,this.initialVNode=t,this.container=n,this.anchor=r,this.parentSuspense=i,this.namespace=a,this.optimized=o,Nr(s),this.job=e.job=()=>{this.dirty&&this.run()},this.job.i=e}notify(){if(!(this.flags&256)){let e=this.job;xi(e,e.i.uid)}}fn(){let{instance:e,initialVNode:t,container:n,anchor:r,parentSuspense:i,namespace:a,optimized:o}=this;if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Ol(e);if(n){t&&(t.el=c.el,oe(e,t,o)),n.asyncDep.then(()=>{I(()=>{e.isUnmounted||e.update()},void 0,i)});return}}let l=t,u;Tl(e,!1),t?(t.el=c.el,oe(e,t,o)):t=c,n&&Ze(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&Du(u,s,t,c),t.ibu&&t.ibu(),Tl(e,!0);let f=Oc(e),p=e.subTree;e.subTree=f,h(p,f,d(p.el),ge(p),e,i,a),t.el=f.el,l===null&&Lc(e,f.el),r&&I(r,void 0,i),((u=t.props&&t.props.onVnodeUpdated)||t.iu)&&I(()=>{u&&Du(u,s,t,c),t.iu&&t.iu()},void 0,i)}else{let o,{el:s,props:c}=t,{bm:l,parent:u,root:d,type:f}=e,p=Uo(t);if(Tl(e,!1),l&&Ze(l),!p&&(o=c&&c.onVnodeBeforeMount)&&Du(o,u,t),Tl(e,!0),s&&Se){let t=()=>{e.subTree=Oc(e),Se(s,e.subTree,e,i,null)};p&&f.__asyncHydrate?f.__asyncHydrate(s,e,t):t()}else{d.ce&&d.ce._hasShadowRoot()&&d.ce._injectChildStyle(f,e.parent?e.parent.type:void 0);let o=e.subTree=Oc(e);h(null,o,n,r,e,i,a),t.el=o.el}if(e.m&&I(e.m,void 0,i),!p&&(o=c&&c.onVnodeMounted)){let e=t;I(()=>Du(o,u,e),void 0,i)}(t.shapeFlag&256||u&&u.vnode&&Uo(u.vnode)&&u.vnode.shapeFlag&256)&&e.a&&I(e.a,void 0,i),e.isMounted=!0,this.initialVNode=this.container=this.anchor=null}}}let ae=(e,t,n,r,i,a,o)=>{let s=e.effect=new ie(e,t,n,r,i,a,o);e.update=s.run.bind(s),Tl(e,!0),s.run()},oe=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Hc(e,t.props,r,n),fl(e,t.children,n);let i=P();Ei(e),P(i)},se=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){le(l,f,n,r,i,a,o,s,c);return}if(p&256){ce(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&he(l,i,a),f!==l&&u(n,f)):d&16?m&16?le(l,f,n,r,i,a,o,s,c):he(l,i,a,!0):(d&8&&u(n,``),m&16&&w(f,n,r,i,a,o,s,c))},ce=(e,t,n,r,i,a,o,s,c)=>{e||=ye,t||=ye;let l=e.length,u=t.length,d=Math.min(l,u),f=0;for(;f<d;f++){let r=t[f]=c?wu(t[f]):Cu(t[f]);h(e[f],r,n,null,i,a,o,s,c)}l>u?he(e,i,a,!0,!1,d):w(t,n,r,i,a,o,s,c,d)},le=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?wu(t[l]):Cu(t[l]);if(uu(r,u))h(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?wu(t[f]):Cu(t[f]);if(uu(r,l))h(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)h(null,t[l]=c?wu(t[l]):Cu(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)de(e[l],i,a,!0),l++;else{let p=l,m=l,g=new Map;for(l=m;l<=f;l++){let e=t[l]=c?wu(t[l]):Cu(t[l]);e.key!=null&&g.set(e.key,l)}let _,v=0,y=f-m+1,b=!1,x=0,S=Array(y);for(l=0;l<y;l++)S[l]=0;for(l=p;l<=d;l++){let r=e[l];if(v>=y){de(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=m;_<=f;_++)if(S[_-m]===0&&uu(r,t[_])){u=_;break}u===void 0?de(r,i,a,!0):(S[u-m]=l+1,u>=x?x=u:b=!0,h(r,t[u],n,null,i,a,o,s,c),v++)}let C=b?Ot(S):ye;for(_=C.length-1,l=y-1;l>=0;l--){let e=m+l,d=t[e],f=t[e+1],p=e+1<u?f.el||Fl(f):r;S[l]===0?h(null,d,n,p,i,a,o,s,c):b&&(_<0||l!==C[_]?ue(d,n,p,2,i):_--)}}},ue=(e,t,n,a,o,s=null)=>{let{el:c,type:l,transition:u,children:d,shapeFlag:f}=e;if(Nl(l)||l===$l){Ml(o,e).move(e,t,n,a,s);return}if(f&6){ue(e.component.subTree,t,n,a,o);return}if(f&128){e.suspense.move(t,n,a);return}if(f&64){l.move(e,t,n,ve,o);return}if(l===Yl){r(c,t,n);for(let e=0;e<d.length;e++)ue(d[e],t,n,a,o);r(e.anchor,t,n);return}if(l===Ql){y(e,t,n);return}a!==2&&f&1&&u?a===0?Al(c,u,()=>r(c,t,n),s,!0):jl(c,u,()=>{e.ctx.isUnmounted?i(c):r(c,t,n)},!0,!0):r(c,t,n)},de=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null){let t=P();to(s,null,n,e,!0),P(t)}if(p!=null&&(t.renderCache[p]=void 0),u&256){Nl(e.type)?Ml(t,e).deactivate(e,t.ctx.getStorageContainer(),n):t.ctx.deactivate(e);return}let h=u&1&&f,g=!Uo(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Du(_,t,e),u&6){if(Nl(a)){f&&Zi(e,null,t,`beforeUnmount`),Ml(t,e).unmount(e,r,n),(g&&(_=o&&o.onVnodeUnmounted)||f)&&I(()=>{f&&Zi(e,null,t,`unmounted`),_&&Du(_,t,e)},void 0,n);return}me(e.component,n,r)}else{if(u&128){e.suspense.unmount(n,r);return}if(h&&Zi(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,ve,r):l&&!l.hasOnce&&(a!==Yl||d>0&&d&64)?he(l,t,n,!1,!0):(a===Yl&&d&384||!i&&u&16)&&he(c,t,n),a===$l){Ml(t,e).unmount(e,r,n);return}r&&fe(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&I(()=>{_&&Du(_,t,e),h&&Zi(e,null,t,`unmounted`),v&&(e.el=null)},void 0,n)},fe=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===Yl){pe(n,r);return}if(t===Ql){b(e);return}a?jl(n,a,()=>i(n),!!(e.shapeFlag&1)):i(n)},pe=(e,t)=>{let n;for(;e!==t;)n=f(e),i(e),e=n;i(t)},me=(e,t,n)=>{let{bum:r,scope:i,effect:a,subTree:o,um:s,m:c,a:l}=e;kl(c),kl(l),r&&Ze(r),i.stop(),a?(a.stop(),de(o,e,t,n)):n&&o&&e.vnode.el&&fe(o),s&&I(s,void 0,t),I(()=>e.isUnmounted=!0,void 0,t)},he=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)de(e[o],t,n,r,i)},ge=e=>{if(e.shapeFlag&6)return Nl(e.type)?f(e.anchor):ge(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=f(e.anchor||e.el),n=t&&t[fa];return n?f(n):t},_e=(e,t,n)=>{let r;e==null?t._vnode&&(de(t._vnode,null,null,!0),r=t._vnode.component):h(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ki(r)},ve={p:h,um:de,m:ue,r:fe,mt:D,umt:me,mc:w,pc:se,pbc:E,n:ge,o:e},xe,Se;return t&&([xe,Se]=t(ve)),{render:_e,hydrate:xe,hydrateNode:Se,internals:ve,createApp:vc((e,t,n,r)=>{let i=e._ceVNode||hu(e._component,e._props);return i.appContext=e._context,r===!0?r=`svg`:r===!1&&(r=void 0),n&&xe?xe(i,t):_e(i,t,r),i.component},e=>{_e(null,e._container)},ed,_e)}}function wl({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Tl({effect:e,job:t,vapor:n},r){n||(r?(e.flags|=128,t.flags|=2):(e.flags&=-129,t.flags&=-3))}function El(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Dl(e,t,n=!1){let r=e.children,i=t.children;if(j(r)&&j(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=wu(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&Dl(t,a)),a.type===Xl&&(a.patchFlag===-1&&(a=i[e]=wu(a)),a.el=t.el),a.type===Zl&&!a.el&&(a.el=t.el)}}function Ol(e){let t=e.subTree&&e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ol(t)}function kl(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=4}function Al(e,t,n,r,i=!1){if(i&&t.persisted&&!e[Ta]){n();return}i||El(r,t)?(t.beforeEnter(e),n(),I(()=>t.enter(e),void 0,r)):n()}function jl(e,t,n,r=!0,i=!1){let a=()=>{n(),t&&(i||!t.persisted)&&t.afterLeave&&t.afterLeave()};if(i||r&&t&&!t.persisted){let{leave:r,delayLeave:o}=t,s=()=>{let o=e._isLeaving||!!e[Ta];e._isLeaving&&i&&e[Ta](!0),i&&t.persisted&&!o?n():r(e,a)};o?o(e,a,s):s()}else a()}function Ml(e,t){let n=e?e.appContext:t.appContext;return n&&n.vapor}function Nl(e){return e.__vapor}function Pl(e,t,n=!0){let r=[],i=t,a=e;for(;i;){let e=i.subTree;if(!e)break;if(a===e||Il(e.type)&&(e.ssContent===a||e.ssFallback===a)){let e=i.vnode;e.scopeId&&r.push(e.scopeId),e.slotScopeIds&&r.push(...e.slotScopeIds),a=e,i=i.parent}else break}let o=n&&a.vaporScopeIds;return o&&r.push(...o),r}function Fl(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?Fl(t.subTree):null}var Il=e=>e.__isSuspense,Ll=0,Rl={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)Bl(t,n,r,i,a,o,s,c,l);else{if(a&&a.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}Vl(e,t,n,r,i,o,s,c,l)}},hydrate:Ul,normalize:Wl};function zl(e,t){let n=e.props&&e.props[t];M(n)&&n()}function Bl(e,t,n,r,i,a,o,s,c){let{p:l,o:{createElement:u}}=c,d=u(`div`),f=e.suspense=Hl(e,i,r,t,d,n,a,o,s,c);l(null,f.pendingBranch=e.ssContent,d,null,r,f,a,o),f.deps>0?(zl(e,`onPending`),zl(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),ql(f,e.ssFallback)):f.resolve(!1,!0)}function Vl(e,t,n,r,i,a,o,s,{p:c,um:l,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let f=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:h,isInFallback:g,isHydrating:_}=d;if(h){if(d.pendingBranch=f,uu(h,f))c(h,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():g&&!_&&!d.isFallbackMountPending&&(c(m,p,n,r,i,null,a,o,s),ql(d,p));else{d.pendingId=Ll++,_?(d.isHydrating=!1,d.activeBranch=h):l(h,i,d),d.deps=0;for(let e=0;e<d.effects.length;e++){let t=d.effects[e];t.flags&8&&Ti(t)}d.effects.length=0,d.hiddenContainer=u(`div`),g?(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():d.isFallbackMountPending||(c(m,p,n,r,i,null,a,o,s),ql(d,p))):m&&uu(m,f)?(c(m,f,n,r,i,d,a,o,s),d.resolve(!0)):(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0&&d.resolve())}}else if(m&&uu(m,f))c(m,f,n,r,i,d,a,o,s),ql(d,f);else if(zl(t,`onPending`),d.pendingBranch=f,d.pendingId=f.shapeFlag&512?f.component.suspenseId:Ll++,c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):e===0&&d.fallback(p)}}function Hl(e,t,n,r,i,a,o,s,c,l,u=!1){let{p:d,m:f,um:p,n:m,o:{parentNode:h}}=l,g,_=Jl(e);_&&t&&t.pendingBranch&&(g=t.pendingId,t.deps++);let v=e.props?et(e.props.timeout):void 0,y=a,b={vnode:e,parent:t,parentComponent:n,namespace:o,container:r,hiddenContainer:i,deps:0,pendingId:Ll++,timeout:typeof v==`number`?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:o,pendingId:s,effects:c,parentComponent:l,container:u,isInFallback:d}=b,v=!1;if(b.isHydrating)b.isHydrating=!1;else if(!e){v=i&&o.transition&&o.transition.mode===`out-in`;let e=!1;v&&(i.transition.afterLeave=()=>{s===b.pendingId&&(f(o,u,a===y&&!e?m(i):a,0,l),Ti(c),d&&r.ssFallback&&(r.ssFallback.el=null))}),i&&!b.isFallbackMountPending&&(h(i.el)===u&&(a=m(i),e=!0),p(i,l,b,!0),!v&&d&&r.ssFallback&&I(()=>r.ssFallback.el=null,void 0,b)),v||f(o,u,a,0,l)}b.isFallbackMountPending=!1,ql(b,o),b.pendingBranch=null,b.isInFallback=!1;let x=b.parent,S=!1;for(;x;){if(x.pendingBranch){for(let e=0;e<c.length;e++)x.effects.push(c[e]);S=!0;break}x=x.parent}!S&&!v&&Ti(c),b.effects=[],_&&t&&t.pendingBranch&&g===t.pendingId&&(t.deps--,t.deps===0&&!n&&t.resolve()),zl(r,`onResolve`)},fallback(e){if(!b.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:a}=b;zl(t,`onFallback`);let o=m(n),l=()=>{if(b.isFallbackMountPending=!1,!b.isInFallback)return;let e=b.vnode.ssFallback;d(null,e,i,o,r,null,a,s,c),ql(b,e)},u=e.transition&&e.transition.mode===`out-in`;u&&(b.isFallbackMountPending=!0,n.transition.afterLeave=l),b.isInFallback=!0,p(n,r,null,!0),u||l()},move(e,t,r){b.activeBranch&&f(b.activeBranch,e,t,r,n),b.container=e},next(){return b.activeBranch&&m(b.activeBranch)},registerDep(e,t){let n=!!b.pendingBranch;n&&b.deps++,e.asyncDep.catch(t=>{ci(t,e,0)}).then(r=>{e.isUnmounted||b.isUnmounted||b.pendingId!==e.suspenseId||(Nu(null,void 0),e.asyncResolved=!0,t(r),n&&--b.deps===0&&b.resolve())})},unmount(e,t){b.isUnmounted=!0,b.activeBranch&&p(b.activeBranch,n,e,t),b.pendingBranch&&p(b.pendingBranch,n,e,t)}};return b}function Ul(e,t,n,r,i,a,o,s,c){let l=t.suspense=Hl(t,r,n,e.parentNode,document.createElement(`div`),null,i,a,o,s,!0),u=c(e,l.pendingBranch=t.ssContent,n,l,a,o);return l.deps===0&&l.resolve(!1,!0),u}function Wl(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=Gl(r?n.default:n),e.ssFallback=r?Gl(n.fallback):hu(Zl)}function Gl(e){let t;if(M(e)){let n=iu&&e._c;n&&(e._d=!1,nu()),e=e(),n&&(e._d=!0,t=tu,ru())}return j(e)&&(e=Ac(e)),e=Cu(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function Kl(e,t,n){n&&n.pendingBranch?j(e)?n.effects.push(...e):n.effects.push(e):Ti(e,t)}function ql(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,Lc(r,i))}function Jl(e){let t=e.props&&e.props.suspensible;return t!=null&&t!==!1}var Yl=Symbol.for(`v-fgt`),Xl=Symbol.for(`v-txt`),Zl=Symbol.for(`v-cmt`),Ql=Symbol.for(`v-stc`),$l=Symbol.for(`v-vps`),eu=[],tu=null;function nu(e=!1){eu.push(tu=e?null:[])}function ru(){eu.pop(),tu=eu[eu.length-1]||null}var iu=1;function au(e,t=!1){iu+=e,e<0&&tu&&t&&(tu.hasOnce=!0)}function ou(e){return e.dynamicChildren=iu>0?tu||ye:null,ru(),iu>0&&tu&&tu.push(e),e}function su(e,t,n,r,i,a){return ou(mu(e,t,n,r,i,a,!0))}function cu(e,t,n,r,i){return ou(hu(e,t,n,r,i,!0))}function lu(e){return e?e.__v_isVNode===!0:!1}function uu(e,t){return e.type===t.type&&e.key===t.key}function du(e){}var fu=({key:e})=>e??null,pu=({ref:e,ref_key:t,ref_for:n},r=Ui)=>(typeof e==`number`&&(e=``+e),e==null?null:N(e)||nr(e)||M(e)?{i:r,r:e,k:t,f:!!n}:e);function mu(e,t=null,n=null,r=0,i=null,a=e===Yl?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&fu(t),ref:t&&pu(t),scopeId:Wi,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Ui};return s?(Tu(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=N(n)?8:16),iu>0&&!o&&tu&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&tu.push(c),c}var hu=gu;function gu(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===xs)&&(e=Zl),lu(e)){let r=vu(e,t,!0);return n&&Tu(r,n),iu>0&&!a&&tu&&(r.shapeFlag&6?tu[tu.indexOf(e)]=r:tu.push(r)),r.patchFlag=-2,r}if(ad(e)&&(e=e.__vccOpts),t){t=_u(t);let{class:e,style:n}=t;e&&!N(e)&&(t.class=ut(e)),Me(n)&&(Qn(n)&&!j(n)&&(n=k({},n)),t.style=at(n))}let o=N(e)?1:Il(e)?128:pa(e)?64:Me(e)?4:M(e)?2:0;return mu(e,t,n,r,i,o,a,!0)}function _u(e){return e?Qn(e)||Bc(e)?k({},e):e:null}function vu(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Eu(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&fu(l),ref:t&&t.ref?n&&a?j(a)?a.concat(pu(t)):[a,pu(t)]:pu(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Yl?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&vu(e.ssContent),ssFallback:e.ssFallback&&vu(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,vi:e.vi,vs:yu(e),vb:e.vb,ibu:e.ibu,iu:e.iu};return c&&r&&Ga(u,c.clone(u)),u}function yu(e){let t=e.vs;if(!t)return t;let n={slot:t.slot,fallback:t.fallback,outletFallback:t.outletFallback};return e.el&&(n.state=t.state,n.ref=t.ref,n.scope=t.scope),n}function bu(e=` `,t=0){return hu(Xl,null,e,t)}function xu(e,t){let n=hu(Ql,null,e);return n.staticCount=t,n}function Su(e=``,t=!1){return t?(nu(),cu(Zl,null,e)):hu(Zl,null,e)}function Cu(e){return e==null||typeof e==`boolean`?hu(Zl):j(e)?hu(Yl,null,e.slice()):lu(e)?wu(e):hu(Xl,null,String(e))}function wu(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:vu(e)}function Tu(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(j(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Tu(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!Bc(t)?t._ctx=Ui:r===3&&Ui&&(Ui.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(M(t)){if(r&65){Tu(e,{default:t});return}t={default:t,_ctx:Ui},n=32}else t=String(t),r&64?(n=16,t=[bu(t)]):n=8;e.children=t,e.shapeFlag|=n}function Eu(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=ut([t.class,r.class]));else if(e===`style`)t.style=at([t.style,r.style]);else if(Se(e)){let n=t[e],i=r[e];i&&n!==i&&!(j(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!we(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function Du(e,t,n,r=null){si(e,t,7,[n,r])}var L=null,Ou=()=>L||Ui,ku=()=>L&&!L.vapor?L:Ui,Au=!1,ju,Mu;{let e=nt(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Mu=t(`__VUE_INSTANCE_SETTERS__`,e=>L=e),ju=t(`__VUE_SSR_SETTERS__`,e=>Au=e)}var Nu=(e,t=e===null?void 0:e.scope)=>{try{return[L,Nr(t)]}finally{Mu(e)}},Pu=e=>{Nr(e[1]),Mu(e[0])},Fu=[`ce`,`type`,`uid`],Iu=(e,t=!1)=>{let n=Ou();return n?Fu.includes(e)?{hasInstance:!0,value:n[e]}:{hasInstance:!0,value:void 0}:{hasInstance:!1,value:void 0}},Lu=gc(),Ru=0;function zu(){return Ru++}function Bu(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||Lu,a={uid:Ru++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ar(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:qc(r,i),emitsOptions:Ec(r,i),emit:null,emitted:null,propsDefaults:null,inheritAttrs:r.inheritAttrs,ctx:O,data:O,props:O,attrs:O,slots:O,refs:O,setupState:O,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=Sc.bind(null,a),e.ce&&e.ce(a),a}function Vu(e,{isNativeTag:t}){(Be(e)||t(e))&&Zr(`Do not use built-in or reserved HTML elements as component id: `+e)}function Hu(e){return e.vnode.shapeFlag&4}function Uu(e,t=!1,n=!1){t&&ju(t);let{props:r,children:i,vi:a}=e.vnode,o=Hu(e);a?a(e):(Vc(e,r,o,t),dl(e,i,n||t));let s=o?Wu(e,t):void 0;return t&&ju(!1),s}function Wu(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Rs);let{setup:r}=n;if(r){let n=P(),i=e.setupContext=r.length>1?Qu(e):null,a=Nu(e),o=oi(r,e,0,[e.props,i]),s=Ne(o);if(P(n),Pu(a),(s||e.sp)&&!Uo(e)&&Xa(e),s){let n=()=>{Nu(null,void 0)};if(o.then(n,n),t)return o.then(n=>{ju(!0);try{Gu(e,n,t)}finally{ju(!1)}}).catch(t=>{ci(t,e,0)});e.asyncDep=o}else Gu(e,o,t)}else Xu(e,t)}function Gu(e,t,n){M(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Me(t)&&(e.setupState=fr(t)),Xu(e,n)}var Ku,qu;function Ju(e){Ku=e,qu=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,zs))}}var Yu=()=>!Ku;function Xu(e,t,n){let r=e.type;if(!e.render){if(!t&&Ku&&!r.render){let t=r.template||oc(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r,s=k(k({isCustomElement:n,delimiters:a},i),o);r.render=Ku(t,s)}}e.render=r.render||be,qu&&qu(e)}{let t=Nu(e),n=P();try{nc(e)}finally{P(n),Pu(t)}}}var Zu={get(e,t){return on(e,`get`,``),e[t]}};function Qu(e){return{attrs:new Proxy(e.attrs,Zu),slots:e.slots,emit:e.emit,expose:t=>$u(e,t)}}function $u(e,t){e.exposed=t||{}}function ed(e){return e.exposed?e.exposeProxy||=new Proxy(fr($n(e.exposed)),{get(t,n){if(n in t)return t[n];{let t=Is();if(n in t)return t[n](e)}},has(e,t){let n=Is();return t in e||t in n}}):e.proxy}var td=/(?:^|[-_])\w/g,nd=e=>e.replace(td,e=>e.toUpperCase()).replace(/[-_]/g,``);function rd(e,t=!0){return M(e)?e.displayName||e.name:e.name||t&&e.__name}function id(e,t,n=!1){let r=rd(t);if(!r&&t.__file){let e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(r=e[1])}if(!r&&e){let n=e=>{for(let n in e)if(e[n]===t)return n};r=n(e.components)||e.parent&&n(e.parent.type.components)||n(e.appContext.components)}return r?nd(r):n?`App`:`Anonymous`}function ad(e){return M(e)&&`__vccOpts`in e}var od=(e,t)=>Ir(e,t,Au);function sd(e,t,n){try{au(-1);let r=arguments.length;return r===2?Me(t)&&!j(t)?lu(t)?hu(e,null,[t]):hu(e,t):hu(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&lu(n)&&(n=[n]),hu(e,t,n))}finally{au(1)}}function cd(){}function ld(e,t,n,r){let i=n[r];if(i&&ud(i,e))return i;let a=t();return a.memo=e.slice(),a.cacheIndex=r,n[r]=a}function ud(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++)if(Xe(n[e],t[e]))return!1;return iu>0&&tu&&tu.push(e),!0}var dd=`3.6.0-rc.7`,fd=be,pd=ai,md=Ii,hd=Bi,gd={createComponentInstance:Bu,setupComponent:Uu,renderComponentRoot:Oc,setCurrentRenderingInstance:Gi,isVNode:lu,normalizeVNode:Cu,getComponentPublicInstance:ed,ensureValidVNode:js,pushWarningContext:Jr,popWarningContext:Yr},_d=void 0,vd=typeof window<`u`&&window.trustedTypes;if(vd)try{_d=vd.createPolicy(`vue`,{createHTML:e=>e})}catch{}var yd=_d?e=>_d.createHTML(e):e=>e,bd=`http://www.w3.org/2000/svg`,xd=`http://www.w3.org/1998/Math/MathML`,Sd=typeof document<`u`?document:null,Cd=Sd&&Sd.createElement(`template`),wd={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?Sd.createElementNS(bd,e):t===`mathml`?Sd.createElementNS(xd,e):n?Sd.createElement(e,{is:n}):Sd.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>Sd.createTextNode(e),createComment:e=>Sd.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Sd.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{Cd.innerHTML=yd(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Cd.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Td=`transition`,Ed=`animation`,Dd=Symbol(`_vtc`),Od={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},kd=k({},ka,Od),Ad=(e=>(e.displayName=`Transition`,e.props=kd,e))((e,{slots:t})=>sd(Na,Nd(e),t)),jd=(e,t=[])=>{j(e)?e.forEach(e=>e(...t)):e&&e(...t)},Md=e=>e?j(e)?e.some(e=>e.length>1):e.length>1:!1;function Nd(e){let t={};for(let n in e)n in Od||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=Pd(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:v,onEnterCancelled:y,onLeave:b,onLeaveCancelled:x,onBeforeAppear:S=_,onAppear:C=v,onAppearCancelled:w=y}=t,T=(e,t,n,r)=>{e._enterCancelled=r,Ld(e,t?u:s),Ld(e,t?l:o),n&&n()},E=(e,t)=>{e._isLeaving=!1,Ld(e,d),Ld(e,p),Ld(e,f),t&&t()},ee=e=>(t,n)=>{let i=e?C:v,o=()=>T(t,e,n);jd(i,[t,o]),Rd(()=>{Ld(t,e?c:a),Id(t,e?u:s),Md(i)||Bd(t,r,h,o)})};return k(t,{onBeforeEnter(e){jd(_,[e]),Id(e,a),Id(e,o)},onBeforeAppear(e){jd(S,[e]),Id(e,c),Id(e,l)},onEnter:ee(!1),onAppear:ee(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>E(e,t);Id(e,d),e._enterCancelled?(Id(e,f),Wd(e)):(Wd(e),Id(e,f)),Rd(()=>{e._isLeaving&&(Ld(e,d),Id(e,p),Md(b)||Bd(e,r,g,n))}),jd(b,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),jd(y,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),jd(w,[e])},onLeaveCancelled(e){E(e),jd(x,[e])}})}function Pd(e){if(e==null)return null;if(Me(e))return[Fd(e.enter),Fd(e.leave)];{let t=Fd(e);return[t,t]}}function Fd(e){return et(e)}function Id(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Dd]||(e[Dd]=new Set)).add(t)}function Ld(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Dd];n&&(n.delete(t),n.size||(e[Dd]=void 0))}function Rd(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var zd=0;function Bd(e,t,n,r){let i=e._endId=++zd,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Vd(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function Vd(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${Td}Delay`),a=r(`${Td}Duration`),o=Hd(i,a),s=r(`${Ed}Delay`),c=r(`${Ed}Duration`),l=Hd(s,c),u=null,d=0,f=0;t===Td?o>0&&(u=Td,d=o,f=a.length):t===Ed?l>0&&(u=Ed,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?Td:Ed:null,f=u?u===Td?a.length:c.length:0);let p=u===Td&&/\b(?:transform|all)(?:,|$)/.test(r(`${Td}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Hd(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>Ud(t)+Ud(e[n])))}function Ud(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Wd(e){return(e?e.ownerDocument:document).body.offsetHeight}function Gd(e,t,n){let r=e[Dd];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Kd=Symbol(`_vod`),qd=Symbol(`_vsh`),Jd={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Kd]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Yd(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Yd(e,!0),r.enter(e)):r.leave(e,()=>{Yd(e,!1)}):Yd(e,t))},beforeUnmount(e,{value:t}){Yd(e,t)}};function Yd(e,t){e.style.display=t?e[Kd]:`none`,e[qd]=!t}function Xd(){Jd.getSSRProps=({value:e})=>{if(!e)return{style:{display:`none`}}}}var Zd=Symbol(``);function Qd(e){let t=ku();ef(t,()=>t.subTree.el.parentNode,()=>e(t.proxy),e=>{t.ce?tf(t.ce,e):$d(t.subTree,e)})}function $d(e,t){if(e.shapeFlag&128){let n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{$d(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)tf(e.el,t);else if(e.type===Yl)e.children.forEach(e=>$d(e,t));else if(e.type===Ql){let{el:n,anchor:r}=e;for(;n&&(tf(n,t),n!==r);)n=n.nextSibling}}function ef(e,t,n,r){if(!e)return;let i=e.ut=(t=n())=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(e=>tf(e,t))},a=(e=n())=>{r(e),i(e)};ds(()=>{Ti(a)}),us(()=>{oa(()=>{let e=n();k({},e),a(e)},be,{flush:`post`});let e=new MutationObserver(()=>a());e.observe(t(),{childList:!0}),ms(()=>e.disconnect())})}function tf(e,t){if(e.nodeType===1){let n=e.style,r=``;for(let e in t){let i=kt(t[e]);n.setProperty(`--${e}`,i),r+=`--${e}: ${i};`}n[Zd]=r}}var nf=/(?:^|;)\s*display\s*:/;function rf(e,t,n){let r=e.style,i=N(n),a=!1;if(n&&!i){if(t){if(N(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??of(r,t,``)}else for(let e in t)n[e]??of(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?of(r,i,``):uf(e,i,!N(t)&&t?t[i]:void 0,o)||of(r,i,o)}}else if(i){if(t!==n){let e=r[Zd];e&&(n+=`;`+e),r.cssText=n,a=nf.test(n)}}else t&&e.removeAttribute(`style`);Kd in e&&(e[Kd]=a?r.display:``,e[qd]&&(r.display=`none`))}var af=/\s*!important$/;function of(e,t,n){if(j(n))n.forEach(n=>of(e,t,n));else{let r=n==null?``:String(n);if(t.startsWith(`--`))af.test(r)?e.setProperty(t,r.replace(af,``),`important`):e.setProperty(t,r);else{let n=lf(e,t);af.test(r)?e.setProperty(Ke(n),r.replace(af,``),`important`):e[n]=r}}}var sf=[`Webkit`,`Moz`,`ms`],cf={};function lf(e,t){let n=cf[t];if(n)return n;let r=We(t);if(r!==`filter`&&r in e)return cf[t]=r;r=qe(r);for(let n=0;n<sf.length;n++){let i=sf[n]+r;if(i in e)return cf[t]=i}return t}function uf(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&N(r)&&n===r}var df=`http://www.w3.org/1999/xlink`;function ff(e,t,n,r,i,a=pt(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(df,t.slice(6,t.length)):e.setAttributeNS(df,t,n):n==null||a&&!ht(n)?e.removeAttribute(t):e.setAttribute(t,a?``:je(n)?String(n):n)}function pf(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?yd(n):n);return}let a=e.tagName;if(t===`value`&&rt(a)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=ht(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function mf(e,t,n,r){e.addEventListener(t,n,r)}function hf(e,t,n,r){e.removeEventListener(t,n,r)}var gf=Symbol(`_vei`);function _f(e,t,n,r,i=null){let a=e[gf]||(e[gf]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=bf(t);r?mf(e,n,a[t]=wf(r,i),s):o&&(hf(e,n,o,s),a[t]=void 0)}}var vf=/(Once|Passive|Capture)$/,yf=/^on:?(?:Once|Passive|Capture)$/;function bf(e){let t,n;for(;(n=e.match(vf))&&!yf.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):Ke(e.slice(2)),t]}var xf=0,Sf=Promise.resolve(),Cf=()=>xf||=(Sf.then(()=>xf=0),Date.now());function wf(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(j(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&si(e,t,5,a)}}else si(r,t,5,[e])};return n.value=e,n.attached=Cf(),n}var Tf=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?Gd(e,r,o):t===`style`?rf(e,n,r):Se(t)?we(t)||_f(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):Ef(e,t,r,o))?(pf(e,t,r,a),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&ff(e,t,r,o,a,t!==`value`)):e._isVueCE&&(Df(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!N(r)))?pf(e,We(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),ff(e,t,r,o,a))};function Ef(e,t,n,r){return r?!!(t===`innerHTML`||t===`textContent`||t in e&&Ce(t)&&M(n)):yt(e.tagName,t)||Ce(t)&&N(n)?!1:t in e}function Df(e,t){let n=e._def.props;if(!n)return!1;let r=We(t);return Array.isArray(n)?n.some(e=>We(e)===r):Object.keys(n).some(e=>We(e)===r)}var Of={};function kf(e,t,n){let r=Ja(e,t);Le(r)&&(r=k({},r,t));class i extends Nf{constructor(e){super(r,e,n)}}return i.def=r,i}var Af=((e,t)=>kf(e,t,Mp)),jf=typeof HTMLElement<`u`?HTMLElement:class{},Mf=class e extends jf{constructor(e,t={},n){super(),this._isVueCE=!0,this._instance=null,this._app=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._patching=!1,this._dirty=!1,this._ob=null,this._def=e,this._props=t,this._createApp=n,this._nonce=e.nonce,this._needsHydration()?this._root=this.shadowRoot:e.shadowRoot===!1?this._root=this:(this.attachShadow(k({},e.shadowRootOptions,{mode:`open`})),this._root=this.shadowRoot)}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t&&=t.assignedSlot||t.parentNode||t.host;)if(t instanceof e){this._parent=t;break}this._instance||(this._resolved?this._mountComponent(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{if(this._pendingResolve=void 0,this.isConnected)return this._resolveDef()}):this._resolveDef())}disconnectedCallback(){this._connected=!1,yi(()=>{this._connected||(this._ob&&=(this._ob.disconnect(),null),this._unmount(),this._teleportTargets&&=(this._teleportTargets.clear(),void 0))})}_setParent(e=this._parent){e&&this._instance&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}_processMutations(e){for(let t of e)this._setAttr(t.attributeName)}_resolveDef(){if(this._pendingResolve)return this._pendingResolve;for(let e=0;e<this.attributes.length;e++)this._setAttr(this.attributes[e].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});let e=e=>{this._resolved=!0,this._pendingResolve=void 0;let{props:t,styles:n}=e,r;if(t&&!j(t))for(let e in t){let n=t[e];(n===Number||n&&n.type===Number)&&(e in this._props&&(this._props[e]=et(this._props[e])),(r||=Object.create(null))[We(e)]=!0)}this._numberProps=r,this._resolveProps(e),this.shadowRoot&&this._applyStyles(n),this._mountComponent(e)},t=this._def.__asyncLoader;if(t){let{configureApp:n}=this._def;return this._pendingResolve=t().then(t=>{t.configureApp=n,this._def=t,e(t)}),this._pendingResolve}e(this._def)}_mountComponent(e){this._mount(e),this._processExposed()}_processExposed(){let e=this._instance&&this._instance.exposed;if(e)for(let t in e)A(this,t)||Object.defineProperty(this,t,{get:()=>lr(e[t])})}_processInstance(){this._instance.ce=this,this._instance.isCE=!0;let e=(e,t)=>{this.dispatchEvent(new CustomEvent(e,Le(t[0])?k({detail:t},t[0]):{detail:t}))};this._instance.emit=(t,...n)=>{e(t,n),Ke(t)!==t&&e(Ke(t),n)},this._setParent()}_resolveProps(e){let{props:t}=e,n=j(t)?t:Object.keys(t||{});for(let e of Object.keys(this))e[0]!==`_`&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(We))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!this._patching)}})}_setAttr(e){if(e.startsWith(`data-v-`))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):Of,r=We(e);t&&this._numberProps&&this._numberProps[r]&&(n=et(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!1){if(t!==this._props[e]&&(this._dirty=!0,t===Of?delete this._props[e]:(this._props[e]=t,e===`key`&&this._app&&this._app._ceVNode&&(this._app._ceVNode.key=t)),r&&this._instance&&this._update(),n)){let n=this._ob;n&&(this._processMutations(n.takeRecords()),n.disconnect()),t===!0?this.setAttribute(Ke(e),``):typeof t==`string`||typeof t==`number`?this.setAttribute(Ke(e),t+``):t||this.removeAttribute(Ke(e)),n&&n.observe(this,{attributes:!0})}}_applyStyles(e,t,n){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let r=this._nonce,i=this.shadowRoot,a=n?this._getStyleAnchor(n)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i),o=null;for(let s=e.length-1;s>=0;s--){let c=document.createElement(`style`);r&&c.setAttribute(`nonce`,r),c.textContent=e[s],i.insertBefore(c,o||a),o=c,s===0&&(n||this._styleAnchors.set(this._def,c),t&&this._styleAnchors.set(t,c))}}_getStyleAnchor(e){if(!e)return null;let t=this._styleAnchors.get(e);return t&&t.parentNode===this.shadowRoot?t:(t&&this._styleAnchors.delete(e),null)}_getRootStyleInsertionAnchor(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes[t];if(!(n instanceof HTMLStyleElement))return n}return null}_parseSlots(){let e=this._slots={},t;for(;t=this.firstChild;){let n=t.nodeType===1&&t.getAttribute(`slot`)||`default`;(e[n]||(e[n]=[])).push(t),this.removeChild(t)}}_renderSlots(){let e=this._getSlots(),t=this._instance.type.__scopeId;for(let n=0;n<e.length;n++){let r=e[n],i=r.getAttribute(`name`)||`default`,a=this._slots[i],o=r.parentNode;if(a)for(let e of a){if(t&&e.nodeType===1){let n=t+`-s`,r=document.createTreeWalker(e,1);e.setAttribute(n,``);let i;for(;i=r.nextNode();)i.setAttribute(n,``)}o.insertBefore(e,r)}else for(;r.firstChild;)o.insertBefore(r.firstChild,r);o.removeChild(r)}}_getSlots(){let e=[this];this._teleportTargets&&e.push(...this._teleportTargets);let t=new Set;for(let n of e){let e=n.querySelectorAll(`slot`);for(let n=0;n<e.length;n++)t.add(e[n])}return Array.from(t)}_injectChildStyle(e,t){this._applyStyles(e.styles,e,t)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._root!==this}_removeChildStyle(e){}},Nf=class extends Mf{constructor(e,t={},n=jp){super(e,t,n)}_needsHydration(){return!!(this.shadowRoot&&this._createApp!==jp)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root)}_update(){if(!this._app)return;let e=this._createVNode();e.appContext=this._app._context,kp(e,this._root)}_unmount(){this._app&&this._app.unmount(),this._instance&&this._instance.ce&&(this._instance.ce=void 0),this._app=this._instance=null}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=hu(this._def,k(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,this._processInstance()}),t}};function Pf(e){let{hasInstance:t,value:n}=Iu(`ce`,!0);return n||null}function Ff(){let e=Pf();return e&&e.shadowRoot}function If(e=`$style`){{let{hasInstance:t,value:n}=Iu(`type`,!0);if(!t)return O;let r=n.__cssModules;return r&&r[e]||O}}var Lf=new WeakMap,Rf=new WeakMap,zf=Symbol(`_moveCb`),Bf=Symbol(`_enterCb`),Vf=(e=>(delete e.props.mode,e))({name:`TransitionGroup`,props:k({},kd,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=ku(),r=Da(),i,a;return fs(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!qf(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(e=>Hf(e.el)),i.forEach(Uf);let r=i.filter(Wf);Wd(n.vnode.el),r.forEach(e=>{let n=e.el;Jf(n,t)}),i=[]}),()=>{let o=F(e),s=Nd(o),c=o.tag||Yl;if(i=[],a)for(let e=0;e<a.length;e++){let t=a[e];t.el&&t.el instanceof Element&&!t.el[qd]&&(i.push(t),Ga(t,Fa(t,s,r,n)),Lf.set(t,Kf(t.el)))}a=t.default?Ka(t.default()):[];for(let e=0;e<a.length;e++){let t=a[e];t.key!=null&&Ga(t,Fa(t,s,r,n))}return hu(c,null,a)}}});function Hf(e){e[zf]&&e[zf](),e[Bf]&&e[Bf]()}function Uf(e){Rf.set(e,Kf(e.el))}function Wf(e){if(Gf(Lf.get(e),Rf.get(e),e.el))return e}function Gf(e,t,n){let r=e.left-t.left,i=e.top-t.top;if(r||i){let e=n.style,t=n.getBoundingClientRect(),a=1,o=1;return n.offsetWidth&&(a=t.width/n.offsetWidth),n.offsetHeight&&(o=t.height/n.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(o)||o===0)&&(o=1),Math.abs(a-1)<.01&&(a=1),Math.abs(o-1)<.01&&(o=1),e.transform=e.webkitTransform=`translate(${r/a}px,${i/o}px)`,e.transitionDuration=`0s`,!0}return!1}function Kf(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function qf(e,t,n){let r=e.cloneNode(),i=e[Dd];i&&i.forEach(e=>{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=Vd(r);return a.removeChild(r),o}var Jf=(e,t)=>{let n=e.style;Id(e,t),n.transform=n.webkitTransform=n.transitionDuration=``;let r=e[zf]=n=>{n&&n.target!==e||(!n||n.propertyName.endsWith(`transform`))&&(e.removeEventListener(`transitionend`,r),e[zf]=null,Ld(e,t))};e.addEventListener(`transitionend`,r)},Yf=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return j(t)?e=>Ze(t,e):t};function Xf(e){e.target.composing=!0}function Zf(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var Qf=Symbol(`_assign`),$f=Symbol(`_initialValue`),ep={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[$f]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[$f]=e.defaultValue.replace(/\r\n?/g,`
7
+ `))),e[Qf]=Yf(i),np(e,n,r||!!(i.props&&i.props.type===`number`),t)},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[$f];delete e[$f],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Qf](tp(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){e[Qf]=Yf(o),rp(e,n,t,i,a,r)}};function tp(e,t,n){return t&&(e=e.trim()),n&&(e=$e(e)),e}var np=(e,t,n,r,i)=>{mf(e,r?`change`:`input`,r=>{r.target.composing||(i||e[Qf])(tp(e.value,t,n||e.type===`number`))}),(t||n)&&mf(e,`change`,()=>{e.value=tp(e.value,t,n||e.type===`number`)}),r||(mf(e,`compositionstart`,Xf),mf(e,`compositionend`,Zf),mf(e,`change`,Zf))},rp=(e,t,n,r,i,a)=>{if(e.composing)return;let o=(i||e.type===`number`)&&!/^0\d/.test(e.value)?$e(e.value):e.value,s=n??``;if(o===s)return;let c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!==`range`&&(a&&n===t||r&&e.value.trim()===s)||(e.value=s)},ip={deep:!0,created(e,t,n){e[Qf]=Yf(n),ap(e)},mounted(e,t,n){op(e,t.oldValue,t.value,n.props.value)},beforeUpdate(e,t,n){e[Qf]=Yf(n),op(e,t.oldValue,t.value,n.props.value)}},ap=(e,t)=>{mf(e,`change`,()=>{let n=t||e[Qf],r=e._modelValue,i=pp(e),a=e.checked;if(j(r)){let e=Ct(r,i),t=e!==-1;if(a&&!t)n(r.concat(i));else if(!a&&t){let t=[...r];t.splice(e,1),n(t)}}else if(Oe(r)){let e=new Set(r);a?e.add(i):e.delete(i),n(e)}else n(mp(e,a))})},op=(e,t,n,r=pp(e))=>{e._modelValue=n;let i;if(j(n))i=Ct(n,r)>-1;else if(Oe(n))i=n.has(r);else{if(n===t)return;i=St(n,mp(e,!0))}e.checked!==i&&(e.checked=i)},sp={created(e,{value:t},n){e.checked=St(t,n.props.value),e[Qf]=Yf(n),mf(e,`change`,()=>{e[Qf](pp(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Qf]=Yf(r),t!==n&&(e.checked=St(t,r.props.value))}},cp={deep:!0,created(e,{value:t,modifiers:{number:n}},r){lp(e,t,n),e[Qf]=Yf(r)},mounted(e,{value:t}){dp(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Qf]=Yf(n)},updated(e,{value:t}){dp(e,t)}},lp=(e,t,n,r)=>{e._modelValue=t,mf(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?$e(pp(e)):pp(e)),i=e.multiple,a=i?Oe(e._modelValue)?new Set(t):t:t[0],o=e._pendingValue=[i,i?j(a)?t.slice():t:a];try{(r||e[Qf])(a)}finally{yi(()=>{e._pendingValue===o&&(e._pendingValue=void 0)})}})};function up(e,t,n){if(!n||j(e))return St(e,t);if(Oe(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}var dp=(e,t)=>{e._modelValue=t;let n=e._pendingValue;e._pendingValue=void 0,!(n&&n[0]===e.multiple&&up(t,n[1],n[0]))&&fp(e,t)};function fp(e,t){let n=e.multiple,r=j(t);if(!n||r||Oe(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=pp(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Ct(t,o)>-1}else a.selected=t.has(o)}else if(St(pp(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function pp(e){return`_value`in e?e._value:e.value}function mp(e,t){let n=t?`_trueValue`:`_falseValue`;if(n in e)return e[n];let r=t?`true-value`:`false-value`;return e.hasAttribute(r)?e.getAttribute(r):t}var hp={created(e,t,n){_p(e,t,n,null,`created`)},mounted(e,t,n){_p(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){_p(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){_p(e,t,n,r,`updated`)}};function gp(e,t){switch(e){case`SELECT`:return cp;case`TEXTAREA`:return ep;default:switch(t){case`checkbox`:return ip;case`radio`:return sp;default:return ep}}}function _p(e,t,n,r,i){let a=gp(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function vp(){ep.getSSRProps=({value:e})=>({value:e}),sp.getSSRProps=({value:e},t)=>{if(t.props&&St(t.props.value,e))return{checked:!0}},ip.getSSRProps=({value:e},t)=>{if(j(e)){if(t.props&&Ct(e,t.props.value)>-1)return{checked:!0}}else if(Oe(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},hp.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=gp(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var yp=[`ctrl`,`shift`,`alt`,`meta`],bp={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>yp.some(n=>e[`${n}Key`]&&!t.includes(n))},xp=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=bp[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Sp={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Cp=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=Ke(n.key);if(t.some(e=>e===r||Sp[e]===r))return e(n)}))},wp=k({patchProp:Tf},wd),Tp,Ep=!1;function Dp(){return Tp||=xl(wp)}function Op(){return Tp=Ep?Tp:Sl(wp),Ep=!0,Tp}var kp=((...e)=>{Dp().render(...e)}),Ap=((...e)=>{Op().hydrate(...e)}),jp=((...e)=>{let t=Dp().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Pp(e);if(!r)return;let i=t._component;!M(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Np(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),Mp=((...e)=>{ao(!0);let t=Op().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=Pp(e);if(t)return n(t,!0,Np(t))},t});function Np(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Pp(e){return N(e)?document.querySelector(e):e}var Fp=!1,Ip=()=>{Fp||(Fp=!0,vp(),Xd())},Lp,Rp,zp;function Bp(e,t){Lp=e,typeof t==`number`?(Rp=void 0,zp=t):(Rp=t,zp=void 0)}function Vp(){Lp=Rp=zp=void 0}function Hp(e){return document.createElement(e)}function Up(e=``){return document.createTextNode(e)}function Wp(e){return document.createComment(e)}function Gp(e){return document.querySelector(e)}function Kp(e){return e.parentNode}function qp(e){return z?Zp(e)||e.appendChild(Up()):Zp(e)}function Jp(e){return z?$p(e,0):Zp(e)}function Yp(e,t){return z?$p(e,t):e.childNodes[t]}function Xp(e){if(z){let t=Lm(e),n=e.parentNode;return n&&em(n,e,t,1),t}return Qp(e)}function Zp(e){return e.firstChild}function Qp(e){return e.nextSibling}function $p(e,t){let n=e.$llc||Rm(e.firstChild),r=n.$idx||0;for(t<r&&(n=Rm(e.firstChild),r=0);n;){if(r===t)return n.$idx=t,e.$llc=n;n=Lm(n),r++}return null}function em(e,t,n,r=0){let i=e;i.$llc===t&&(n&&(n.$idx=t.$idx+r),i.$llc=n)}var tm=/^<([^\s/>]+)/,nm=null;function rm(e){nm=e}var im=!1;function am(e){im=e}var R=null,z=!1;function om(e){if(!im&&!oo&&!io)return!1;try{return z}finally{z=e}}var sm=0;function cm(){return sm>0}function lm(e){sm++;try{return e()}finally{sm--}}function um(e){let t=om(!1);try{return e()}finally{om(t)}}var dm=!1;function fm(e,t,n){dm||=(bm=Im,xm=zm,Sm=Wm,Comment.prototype.$fe=void 0,Node.prototype.$idx=void 0,Node.prototype.$llc=void 0,Node.prototype.$vha=0,Node.prototype.$rcn=void 0,!0);let r=om(!0),i=R;R=null;try{return t(),e()}finally{n(),R=i,om(r)}}function pm(e,t){return fm(t,()=>Bp(e),()=>Vp())}function mm(e,t){return fm(t,()=>Am(e),()=>{})}var hm=0,gm=!1,_m=!1,vm=null;function ym(e){return hm++===0&&(gm=im,_m=z,vm=R),im||am(!0),om(!0),Am(e),()=>{hm--,R=vm,om(_m),gm||am(!1)}}var bm,xm,Sm,B=(e,t)=>e.nodeType===8&&e.data===t,Cm=null;function wm(e){try{return Cm}finally{Cm=e,Om=null}}var Tm=0;function Em(e){try{return Tm===1}finally{Tm=+!!e}}function Dm(){return{start:null}}var Om=null;function km(e){let t=R;if(t&&Tm!==2){if(B(t,`[`))e.start=t,Am(t.nextSibling);else{let n=Om;if(!n||!n.start||t!==Rm(n.start.nextSibling))return;e.start=n.start,n.start=null}Cm&&(Om=e)}}function Am(e){R=Rm(e)}function jm(e){let t=Rm(e.nextSibling);if(!(t&&R===t)){for(;!t;){let n=e.parentNode;if(!n)break;e=n,t=Rm(e.nextSibling)}R!==t&&(R=t)}}function Mm(e){Tm=Tm===1&&!Lp&&!e?2:0}function Nm(e,t){let n=Pm(t);return xm(e),n.start=R,n}function Pm(e){let t={start:null,resume:Lp?R:void 0,transitionChild:Tm,innermostFragmentClaim:Om};return Mm(e),t}function Fm(e){e&&(Tm=e.transitionChild,Om=e.innermostFragmentClaim,e.resume!==void 0&&Am(e.resume))}function Im(e,t,n=!1,r,i=Wm(t)){return i.type!==8&&(i.blank&&B(e,`]`)&&B(e.previousSibling,`[`)&&e.before(e=Up()),e=nh(e)),Gm(e,i)||(e=Um(e,t,n,r)),jm(e),e}function Lm(e){return Rm(B(e,`[`)?Vm(e).nextSibling:B(e,`teleport start`)?Vm(e,`teleport start`,`teleport end`).nextSibling:e.nextSibling)}function Rm(e){for(;e!==null&&e.$vha&2;)e=e.nextSibling;return e}function zm(e){let t;t=Rp||(Lp?$p(Lp,zp||0):R),Vp(),Am(t),e&&km(e)}function Bm(e){return e&&B(e,`[`)?Vm(e):null}function Vm(e,t=`[`,n=`]`){if(e.$fe)return e.$fe;let r=[e];for(;(e=Qp(e))&&r.length>0;)if(e.nodeType===8){if(e.data===t)e.$fe?e=e.$fe:r.push(e);else if(e.data===n){let t=r.pop();if(t.$fe=e,r.length===0)return e}}return null}function Hm(e){let t=R;return t&&B(t,`]`)&&!$m(t)?e.$fe=t:Vm(e)}function Um(e,t,n,r){qm(e,t),B(e,`[`)&&Jm(e);let i=$m(e),a=Kp(e),o=i?e:Qp(e);if(i||H(e,a),t[0]!==`<`){let n=eh(Up(t));return a.insertBefore(n,o),i||em(a,e,n),n}let s=Hp(`template`),c;if(r){let e=r===1?`svg`:`math`;s.innerHTML=`<${e}>${t}</${e}>`,c=Zp(Zp(s.content)).cloneNode(!0)}else s.innerHTML=t,c=Zp(s.content).cloneNode(!0);if(eh(c),c.nodeType===1){let e=c.querySelectorAll(`*`);for(let t=0;t<e.length;t++)eh(e[t]);nm&&nm(c)}if(n&&e.nodeType===1&&!c.firstChild){let t=e.firstChild;for(;t;){let e=t.nextSibling;c.appendChild(t),t=e}}return a.insertBefore(c,o),i||em(a,e,c),c}function Wm(e){let t,n=null,r=null,i=!1;if(e[0]!==`<`)t=3,i=e.trim()===``;else if(e[1]===`!`)t=8;else{t=1;let i=tm.exec(e);i&&(n=i[1].toLowerCase(),r=i[1].toUpperCase())}return{type:t,tag:n,tagUpper:r,blank:i}}function Gm(e,t){return e.nodeType===t.type?t.type!==1||!t.tag||e.tagName===t.tagUpper||e.tagName.toLowerCase()===t.tag:!1}function Km(e,t){if(e.nodeType!==3)return!1;let n=e;if(n.data===t)return!0;let r=n.parentElement;return r&&!ko(r,0)&&co(),n.data=t,!0}function qm(e,t){ko(e.parentElement,1)||co()}function Jm(e,t){let n=Kp(e);if(!n)return;let r=t||Vm(e);for(;;){let t=Qp(e);if(t&&t!==r)H(t,n);else break}}function Ym(e,t=null){let n=Kp(e);if(n){if(B(e,`[`)){let n=Vm(e);Jm(e,n||void 0);let r=n&&Kp(n);n&&n!==t&&r&&H(n,r)}else if(B(e,`teleport start`)){let n=Vm(e,`teleport start`,`teleport end`);Jm(e,n||void 0);let r=n&&Kp(n);n&&n!==t&&r&&H(n,r)}H(e,n)}}function Xm(e,t,n=null){if(n){let t=e,r=!1;for(;t&&t!==n;)$m(t)||(r=!0),t=Lm(t);if(!t)return;if(!r){Am(n);return}}let r=t||e.parentElement;if(r instanceof Element&&rh(r),!t&&!n){Ym(e);return}let i=e;for(;i&&i!==n&&(!t||i.parentNode===t);){let e=Lm(i);$m(i)||Ym(i,n),i=e}n&&Am(n)}function Zm(e){return e.$vha=1,e}function Qm(e){return e.$vha=3,e}function $m(e){return!!e&&!!(e.$vha&1)}function eh(e){return e.$rcn=1,e}function th(e){return!!e&&e.$rcn===1}function nh(e){for(;;){let t=e.$vha;if(t){if(!(t&2))return e}else if(e.nodeType!==8||e.data!==`[`&&e.data!==`]`&&e.data!==`teleport start`&&e.data!==`teleport end`)return e;let n=e.nextSibling;if(!n)return e;e=n}}function rh(e){e&&!ko(e,1)&&co()}function ih(e){return()=>ah(e)}function ah(e){let t=R;e&&t&&t!==e&&!(e.compareDocumentPosition(t)&4)&&Xm(t,void 0,e)}var oh=!1;function sh(){oh=!0}var ch=Symbol(`interop`),lh=Symbol(`interopSlots`);function uh(e){let t=e.__emitsOptions;if(t)return t;let n=e.emits;if(!n)return null;let r;if(j(n)){r={};for(let e of n)r[e]=null}else r=n;return e.__emitsOptions=r}function dh(e,t,...n){Cc(e,e.rawProps||O,fh,t,...n)}function fh(e,t){let n=e.$;if(n){let e=n.length;for(;e--;){let r=wh(n[e]);if(r&&A(r,t))return oh&&n[ch]||Se(t)&&M(n[e])?r[t]:wh(r[t])}}return e[t]&&wh(e[t])}var ph=!1,mh=null,hh;function gh(){ph=!0}function _h(e){try{return mh}finally{mh=e}}function vh(e){try{return hh}finally{hh=e}}function yh(e,t){let n=vh(e);try{return t()}finally{vh(n)}}function bh(e){return hh===void 0?e:hh}var xh=class extends br{constructor(e,t=!1){super(t?e:void 0),this.render=e;let n=L;this.order=n?n.effectCount++:0,this.i=n,this.job=void 0,this.flags|=128}createJob(){let e=()=>{if(!(this.flags&256)&&this.dirty){let t=ph&&this.i&&this.i.deferredKeepAliveUpdates;if(t){if(Oy(t)){t.effects.push(e);return}ky(t,e);return}this.run()}};return this.i&&(e.i=this.i),e.flags|=2,this.job=e}fn(){let e=this.i,t=this.subs?this.subs.sub:void 0,n=e&&(e.bu||e.u),r=Nu(e,t);try{if(n&&e.isMounted&&!e.isUpdating){e.isUpdating=!0;try{e.bu&&Ze(e.bu),this.render()}catch(t){throw e.isUpdating=!1,t}let t=this.updateJob;t||=this.updateJob=()=>{e.isUpdating=!1,e.u&&Ze(e.u)},I(t,void 0,e.suspense)}else this.render()}finally{Pu(r)}}notify(){this.flags&256||xi(this.job||this.createJob(),this.i?this.i.uid:void 0,!1,this.order)}};function Sh(e,t=!1){if(S_)return e();new xh(e,t).run()}function Ch(e){let t=!1;for(let n in e)n!==`$`&&M(e[n])&&(t=!0);let n=e.$;if(n&&!t)for(let e=0;e<n.length;e++){let r=n[e];if(M(r)){t=!0;break}for(let e in r)if(M(r[e])){t=!0;break}if(t)break}if(!t)return e;let r=Object.create(null),i;for(let t in e){if(t===`$`)continue;let n=e[t];if(M(n)){let e=i||=Gn({});r[t]=()=>e[t]}else r[t]=n}let a,o;if(n){let e=[];a=[],o=[];for(let t=0;t<n.length;t++){let r=n[t];if(M(r)){let n=a[t]=Gn({});o[t]={},e[t]=()=>n}else{let n=Object.create(null),i;for(let e in r){let o=r[e];if(M(o)){i||=a[t]=Gn({});let r=i;n[e]=()=>r[e]}else n[e]=o}e[t]=i?n:r}}let t=Object.getOwnPropertySymbols(n);for(let r=0;r<t.length;r++)e[t[r]]=n[t[r]];r.$=e}return Sh(()=>{if(i)for(let t in e)t!==`$`&&M(e[t])&&(i[t]=wh(e[t]));if(n)for(let e=0;e<n.length;e++){let t=n[e],r=a[e];if(r){if(M(t)){let n=Th(t)||O,i=o[e];for(let e in i)A(n,e)||(delete r[e],delete i[e]);for(let e in n)r[e]=i[e]=n[e]}else for(let e in t)M(t[e])&&(r[e]=wh(t[e]))}}},!0),r}function wh(e){return M(e)?Th(e):e}function Th(e){if(e._cache)return e._cache.value;let t=L&&L.parent;if(t){let n=Nu(t,Mr());try{e._cache=Ir(n=>{let r=Nu(t);try{return Dh(n,e())}finally{Pu(r)}}),Pr(()=>e._cache=void 0)}finally{Pu(n)}return e._cache.value}return e()}function Eh(e){let t=Object.create(null);for(let n in e)if(n!==`$`){let r=wh(e[n]);t[n]=()=>r}let n=e.$;if(n){let e=[];for(let t=0;t<n.length;t++){let r=n[t],i=Object.create(null);if(M(r)){let n=Th(r);for(let e in n)i[e]=n[e];e[t]=()=>i}else{for(let e in r){let t=wh(r[e]);i[e]=()=>t}e[t]=i}}let r=Object.getOwnPropertySymbols(n);for(let t=0;t<r.length;t++)e[r[t]]=n[r[t]];t.$=e}return t}function Dh(e,t){if(!Le(e)||!Le(t))return t;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return t;for(let n=0;n<r.length;n++){let i=r[n];if(!A(e,i)||!Object.is(e[i],t[i]))return t}return e}function Oh(e){if(e.__propsHandlers)return e.__propsHandlers;let t=Mh(e)[0],n=uh(e),r=t?e=>N(e)&&A(t,We(e)):xe,i=t||n?e=>N(e)&&e!==`$`&&!r(e)&&!Dc(n,e):e=>N(e),a=(e,t)=>t&&(e===`class`&&!N(t)?ut(t):e===`style`&&Me(t)?at(t):t),o=(e,n)=>{if(n===`__v_isReactive`)return!0;if(!r(n))return;let i=e.rawProps,o=i.$;if(o){let r=o.length,i,s,c;for(;r--;)for(c in i=o[r],s=M(i),i=s?Th(i):i,i)if(We(c)===n)return Wc(t,n,a(n,s?i[c]:wh(i[c])),e,Nh)}for(let r in i)if(We(r)===n)return Wc(t,n,a(n,wh(i[r])),e,Nh);return Wc(t,n,void 0,e,Nh,!0)},s=e=>((t,n)=>{let r=t.oncePropsCache||=Object.create(null);if(!A(r,n)){wr();try{r[n]=e(t,n)}finally{Tr()}}return r[n]}),c=s(o),l=(e,t)=>(e.isOnce?c:o)(e,t),u=t?{get:l,has:(e,t)=>r(t),ownKeys:()=>Object.keys(t),getOwnPropertyDescriptor(e,t){if(r(t))return{configurable:!0,enumerable:!0,get:()=>l(e,t)}}}:null,d=(e,t)=>{if(N(t)&&!r(t)&&!Dc(n,t))return kh(e,t)},f=(e,t)=>i(t)?Ah(e,t):!1,p=s((e,t)=>d(e.rawProps,t)),m=Symbol(),h=e=>jh(e.rawProps).filter(i),g=e=>{let t=e.oncePropsCache||=Object.create(null);if(!A(t,m)){wr();try{let n=h(e);t[m]=n;for(let r=0;r<n.length;r++){let i=n[r];A(t,i)||(t[i]=d(e.rawProps,i))}}finally{Tr()}}return t[m]},_=e=>e.isOnce?g(e):h(e),v=(e,t)=>e.isOnce?g(e).includes(t)?p(e,t):void 0:d(e.rawProps,t);return e.__propsHandlers=[u,{get:v,has:(e,t)=>e.isOnce?g(e).includes(t):f(e.rawProps,t),ownKeys:_,getOwnPropertyDescriptor(e,t){if(N(t)&&(e.isOnce?g(e).includes(t):f(e.rawProps,t)))return{configurable:!0,enumerable:!0,get:()=>v(e,t)}}}]}function kh(e,t){if(t===`$`)return;let n=t===`class`||t===`style`?[]:void 0,r=e.$;if(r){let e=r.length,i,a;for(;e--;)if(i=r[e],a=M(i),i=a?Th(i):i,i&&A(i,t)){let e=a?i[t]:wh(i[t]);if(n)n.push(e);else return e}}if(A(e,t)){let r=wh(e[t]);if(n)n.push(r);else return r}if(n&&n.length)return n.reverse()}function Ah(e,t){if(t===`$`)return!1;let n=e.$;if(n){let e=n.length;for(;e--;){let r=wh(n[e]);if(r&&A(r,t))return!0}}return A(e,t)}function jh(e){let t=[];for(let n in e)n!==`$`&&t.push(n);let n=e.$;if(n){let e=n.length,r;for(;e--;){r=M(n[e])?Th(n[e]):n[e];for(let e in r)t.push(e)}}return Array.from(new Set(t))}function Mh(e){let t=e.__propsOptions;if(t)return t;let n=e.props;if(!n)return ye;let r={},i=[];return Jc(n,r,i),e.__propsOptions=[r,i]}function Nh(e,t){let n=Nu(t),r=e.call(null,t.props);return Pu(n),r}function Ph(e,t){if(t){if(t.$)return!0;let n=e.props?Mh(e)[0]:null;for(let e in t)if(!n||!A(n,We(e)))return!0}return!1}function Fh(e){let t={};for(let n in e)n!==`$`&&(t[n]=wh(e[n]));if(e.$)for(let n of e.$){let e=M(n),r=e?Th(n):n;for(let i in r){let a=e?r[i]:wh(n[i]);if(i===`class`||i===`style`){let e=t[i];j(e)?e.push(a):t[i]=[e,a]}else t[i]=a}}return t}var Ih={get:kh,has:Ah,ownKeys:jh,getOwnPropertyDescriptor(e,t){if(Ah(e,t))return{configurable:!0,enumerable:!0,get:()=>kh(e,t)}}},Lh=null;function Rh(e){try{return Lh}finally{Lh=e}}function zh(e,t){let n=Rh(e);try{return t()}finally{Rh(n)}}function Bh(e,t){let n=Lh;if(!n)return;t&&Vh(n,t,e);let r;(e.bu||=[]).push(()=>{r=Wv(e)}),(e.u||=[]).push(()=>{Wv(e)!==r&&n.markDirty()})}function Vh(e,t,n){let r=e.onContentInvalid||=[];r.push(t),(n.bum||=[]).push(()=>{let e=r.indexOf(t);e>-1&&r.splice(e,1)})}function Hh(e){for(;e;){if(e.getFallback())return!0;e=e.parent}return!1}function Uh(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Wh(e,t,n,r){if(j(n))n.forEach(n=>Wh(e,t,n,r));else{if(!n)return;e.addEventListener(t,$h(n),r)}}function Gh(e,t,n,r){if(j(n)){n.forEach(n=>Gh(e,t,n,r));return}if(n){if(r&&r.once){let i=`$evtonce_${+!!r.capture}_${t}`;if(e[i])return;let a=n;n=(...t)=>(e[i]=!0,a(...t))}Dr(Uh(e,t,$h(n),r))}}function Kh(e,t,n){let r=`$evt${t}`,i=e[r],a=$h(n);i?j(i)?i.push(a):e[r]=[i,a]:e[r]=a}var qh=Object.create(null),Jh=(...e)=>{for(let t of e)qh[t]||(qh[t]=!0,document.addEventListener(t,Yh))},Yh=e=>{let t=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==t&&Object.defineProperty(e,"target",{configurable:!0,value:t}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}});t!==null;){let n=t[`$evt${e.type}`];if(n){if(j(n)){for(let r of n)if(!t.disabled&&(r(e),e.cancelBubble))return}else if(!t.disabled&&(n(e),e.cancelBubble))return}t=t.host&&t.host!==t&&t.host instanceof Node?t.host:t.parentNode}};function Xh(e,t){for(let n in t){let[r,i]=bf(`on:${n}`);Gh(e,r,t[n],i)}}function Zh(e,t){return $h(typeof e==`function`?xp(e,t):e)}function Qh(e,t){return $h(typeof e==`function`?Cp(e,t):e)}function $h(e){let t=L;return(...n)=>si(e,t,5,n)}var eg=(e,t)=>{let n=L;return!oy&&e.$root&&n.hasFallthrough&&n.type.inheritAttrs!==!1&&t in n.attrs&&!ly(n,t)&&(!sy(n.type)||jc(t))};function tg(e,t,n){t in e?rg(e,t,n):ng(e,t,n)}function ng(e,t,n,r=!1){if(!eg(e,t)){if(t===`true-value`?e._trueValue=n:t===`false-value`&&(e._falseValue=n),z&&!th(e)){e[`$${t}`]=n;return}if(n!==e[`$${t}`]){if(e[`$${t}`]=n,r&&t.startsWith(`xlink:`))n==null?e.removeAttributeNS(df,t.slice(6,t.length)):e.setAttributeNS(df,t,n);else{let r=pt(t);n==null||r&&!ht(n)?e.removeAttribute(t):e.setAttribute(t,r?``:je(n)?String(n):n)}}}}function rg(e,t,n,r=!1,i){if(eg(e,t)||z&&!th(e)&&!r&&!vg(e,t))return;let a=`$p$${t}`;if(n===e[a]&&a in e)return;e[a]=n;let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=ht(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function ig(e,t,n=!1,r=!1){if(e.$clsFlags!==void 0&&(e.$clsFlags=void 0),e.$root)og(e,t,r);else{if(r||(t=ut(t)),z&&!th(e)){e.$cls=t;return}t!==e.$cls&&(n?e.setAttribute(`class`,e.$cls=t):e.className=e.$cls=t)}}function ag(e,t,n,r=``,i=``){if(t===e.$clsFlags)return;let a=r;if(N(n))t&1&&(a+=n);else for(let e=0,r=1;e<n.length;e++,r<<=1)t&r&&(a+=n[e]);!r&&a.charCodeAt(0)===32&&(a=a.slice(1)),i&&(a=a?`${a} ${i}`:i),e.$root||z?ig(e,a,!1,!0):e.className=e.$cls=a,e.$clsFlags=t}function og(e,t,n=!1){let r=`$clsi${oy?`$`:``}`,i=n?t:ut(t);if(z&&!th(e)){e[r]=i;return}let a=e[r];if((t=e[r]=i)!==a){let n=t.split(/\s+/);if(t&&e.classList.add(...n),a)for(let t of a.split(/\s+/))n.includes(t)||e.classList.remove(t)}}function sg(e,t){if(e.$root)cg(e,t);else{let n=at(t);if(z&&!th(e)){e.$sty=n;return}rf(e,e.$sty,e.$sty=n)}}function cg(e,t){let n=`$styi${oy?`$`:``}`,r=N(t)?lt(t):at(t);if(z&&!th(e)){e[n]=r;return}rf(e,e[n],e[n]=r)}function lg(e,t,n=!1){if(eg(e,`value`)||(e._value=t,z&&!th(e)&&!n&&!vg(e,`value`)))return;let r=e.tagName===`OPTION`?e.getAttribute(`value`):e.value,i=t??``;r!==i&&(e.value=i),t==null?e.removeAttribute(`value`):e.setAttribute(`value`,je(i)?String(i):i)}function ug(e,t){if(z&&!th(e)&&!th(e.parentNode)){let n=_g(e.parentNode,t);if(e.nodeValue==n){e.$txt=n;return}let r=e.parentElement;r&&!ko(r,0)&&co()}e.$txt!==t&&(e.nodeValue=e.$txt=t)}function dg(e,t){if(t=Tt(t),z&&!th(e)){let n=_g(e,t);if(e.textContent===n){e.$txt=n;return}ko(e,0)||co()}e.$txt!==t&&(e.textContent=e.$txt=t)}function fg(e,t){if(t=t==null?``:yd(t),z&&!th(e)){e.$html=t;return}e.$html!==t&&(e.innerHTML=e.$html=t)}function pg(e,t,n){let r=t.length>1?Eu(...t):t[0]||O,i=`$dprops${oy?`$`:``}`,a=e[i],o=Object.create(null);if(a)for(let t in a)t in r||mg(e,t,null,n);for(let t of Object.keys(r)){let i=r[t];o[t]=i,!(a&&t in a&&!Se(t)&&(typeof i!=`object`||!i)&&Object.is(a[t],i))&&mg(e,t,i,n)}e[i]=o}function mg(e,t,n,r=!1){let i=!1;if(t===`class`)ig(e,n,r);else if(t===`style`)sg(e,n);else if(Se(t)){if(eg(e,t))return;let[r,i]=bf(t);Gh(e,r,n,i)}else((i=t[0]===`.`)?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):Ef(e,t,n,r))?t===`innerHTML`?fg(e,n):t===`textContent`?dg(e,n):t===`value`&&rt(e.tagName)?lg(e,n,i):rg(e,t,n,i):e._isVueCE&&(Df(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!N(n)))?rg(e,We(t),n,i,t):ng(e,t,n,r);return n}var hg=!1;function gg(){if(hg)return;hg=!0;let e=Element.prototype;e.$transition=void 0,e.$key=void 0,e.$evtclick=void 0,e.$root=!1,e.$clsFlags=void 0,e.$html=e.$cls=e.$sty=``,Text.prototype.$txt=void 0}function _g(e,t){return t[0]===`
8
+ `&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(t=t.slice(1)),t}function vg(e,t){let{tagName:n}=e;return(n===`INPUT`||n===`OPTION`)&&(t.endsWith(`value`)||t===`indeterminate`)||n.includes(`-`)}var yg=!1;function bg(){yg=!0}var xg=class{constructor(e,t,n){this.claim=e,this.parent=t,this.pending=n,this.deferred=null}get endAnchor(){return this.ownEndAnchor||(this.parent?this.parent.endAnchor:null)}get ownEndAnchor(){return Bm(this.claim.start)}exitBoundary(){let e=this.ownEndAnchor;e&&ah(e)}defer(e){return this.pending?((this.deferred||=[]).push(e),!0):!1}settle(e,t=0){let n=this.deferred;if(!n)return;let r=t?n.splice(t):n;t||(this.deferred=null);for(let t=0;t<r.length;t++)e?r[t].onContent():r[t].onFallback()}beginSegment(e){let t=this.pending,n=this.deferred?this.deferred.length:0;this.pending=!0;let r=!0;return i=>{r&&(r=!1,this.settle(i,!i&&t?n:0),this.pending=t,i||Am(e))}}settleAsContent(){this.settle(!0),this.pending=!1}adoptInto(e){this.deferred&&=((e.deferred||=[]).push(...this.deferred),null)}},Sg=null;function Cg(){return Sg?Sg.endAnchor:null}function wg(e){let t=Dm();return xm(t),new xg(t,Sg,e)}function Tg(e){let t=wg(!1),n=Sg;Sg=t;try{return e()}finally{Sg=n,t.exitBoundary()}}function Eg(e){let t=Sg,n=R,r=wg(!0);Sg=r;let i=!1;try{let t=e();return i=!0,t}finally{Sg=t,i?r.pending?(r.adoptInto(t),Am(n)):(r.exitBoundary(),t.settleAsContent()):r.exitBoundary()}}function Dg(e){let t=Sg;return!!t&&t.defer(e)}function Og(e,t,n,r,i,a,o){return()=>{let s=Ag(r,e,t),c=s&&s.parentNode;if(!c)return;let l;r?l=i(r):(Ig(c,s,n),l=n),o&&o(c),Jv(a(),c,l)}}function kg(e){let t=e&&e.previousSibling;t&&B(t,`]`)&&Zm(t)}function Ag(e,t,n){return e||(t&&t.parentNode?t:n)}function jg(e){let t=Sg;return t?t.beginSegment(e):()=>{}}var Mg={finish:be,settle:be};function Ng(e,t){if(!e)return Mg;let n=jg(t),r=e=>{n&&=(n(e),null)};return{finish:r,settle:()=>r(!0)}}function Pg(){let e=Sg;e&&e.pending&&e.settleAsContent()}function Fg(){let e=Sg;return!!(e&&e.pending)}function Ig(e,t,n){e.insertBefore(n,t&&Kp(t)===e?t:null)}function Lg(e,t){return!!e&&(B(e,``)||B(e,`]`)||!1)}function Rg(e,t){let n=Kp(e);return $m(e)&&n?{kind:`create`,parent:n,next:e.nextSibling,resetNodes:t}:{kind:`reuse`,node:e,resetNodes:t}}function zg(e,t){let n=cm()&&t&&!(e.__vf&4)&&!Uv(e.nodes),r=n&&!!e.anchor&&!!e.anchor.parentNode;if(n){let t=null,n=e.anchor||(R===(t=Cg())?t:null);n&&Am(Zm(n))}return r}function Bg(e,t){if(Fg()&&(t||!Uv(e.nodes))){let e=Cg(),t=R||e;if(t){let n=Kp(t);if(n)return{kind:`pending`,parent:n,slotEnd:e}}}}function Vg(e){if(e.__vf&512&&$m(R)&&Kp(R))return{kind:`reuse`,node:R}}function Hg(e){let t=e.__vf&4?Sg&&Sg.ownEndAnchor:e.hydrationClaim&&e.hydrationClaim.start?Hm(e.hydrationClaim.start):null;if(t)return Rg(t)}function Ug(e){let t=e.__vf;if(Lg(R,e))return Rg(R);if(!(t&512)&&R&&B(R,`teleport anchor`)){let e=Kp(R);if(e)return{kind:`create`,parent:e,next:R,mark:R}}if(!(t&4)&&R&&!B(R,`]`)){let n=Kp(R);if(t&512&&n)return{kind:`create-cleanup`,parent:n,next:null,cleanupStart:R,cleanupUntil:null,cleanupContainer:n};if(n){let t=Lm(R);return Lg(t,e)&&Kp(t)?Rg(t,!0):Wg(n,t)}}}function Wg(e,t){return{kind:`create-cleanup`,parent:e,next:t,cleanupStart:R,cleanupUntil:t}}function Gg(e){if(!Uv(e.nodes)&&e.nodes instanceof Comment){if(Lg(e.nodes,e)&&Kp(e.nodes))return Rg(e.nodes,!0);if(!Kp(e.nodes)&&R){let e=Kp(R);if(e)return Wg(e,Lm(R))}}}function Kg(e){let t=$v(e.nodes);return{kind:`create`,parent:t.parentNode,next:t.nextNode}}function qg(e,t){return Bg(e,t)||Vg(e)||Hg(e)||(t?Ug(e):void 0)||Gg(e)||Kg(e)}function Jg(e,t){let n=null,r,i=()=>e.anchor=Qm(Up());try{switch(t.kind){case`reuse`:t.resetNodes&&(e.nodes=Vv),e.anchor=Zm(t.node),R===e.anchor?jm(e.anchor):(r=ih(e.anchor),n=e.anchor);break;case`pending`:{let n=t.slotEnd;Dg({onContent:()=>{let r=R,a=r&&Kp(r);if(r&&a===t.parent&&Lg(r,e)){if($m(r)){let e=r.nextSibling;jm(r),a.insertBefore(i(),e)}else e.anchor=Zm(r),jm(r);return}Ig(t.parent,r&&a===t.parent?r:n,i())},onFallback:()=>{i()}});break}case`create`:t.resetNodes&&(e.nodes=Vv),t.mark&&Zm(t.mark),Ig(t.parent,t.next,i());break;case`create-cleanup`:{e.nodes=Vv;let n=Kp(t.cleanupStart);n&&em(n,t.cleanupStart,t.cleanupUntil,1),t.cleanupUntil?r=ih(t.cleanupUntil):(Xm(t.cleanupStart,t.cleanupContainer),Am(null)),Ig(t.parent,t.next,i());break}}}finally{r&&r(),n&&R===n&&jm(n)}}function Yg(e,t=!1){Jg(e,qg(e,t))}var Xg,Zg=null;function Qg(e){Zg=e}function $g(e,t=0,n){let r=!!(t&1),i=!!(t&2),a,o;return()=>{if(z){(e[0]!==`<`||e[1]!==`!`)&&Pg();let t=null;return i&&!B(R,``)?(t=nh(R),e!==``&&e[0]!==`<`&&Km(t,e),a||=t.cloneNode(!0),jm(t)):t=bm(R,e,!1,n,o||=Sm(e)),r&&(t.$root=!0),t}if(a){let e=Zg?Zg(a):a.cloneNode(!0);return r&&(e.$root=!0),e}if(e[0]!==`<`)return Up(e);if(Xg||=document.createElement(`template`),n){let t=n===1?`svg`:`math`;Xg.innerHTML=`<${t}>${e}</${t}>`,a=Zp(Zp(Xg.content))}else Xg.innerHTML=e,a=Zp(Xg.content);let t=Zg?Zg(a):a.cloneNode(!0);return r&&(t.$root=!0),t}}var e_=null;function t_(e){let t=e_;return e!==t&&(e_=e,(!t||!e)&&(e?(Qg(i_),rm(n_)):(Qg(null),rm(null)))),t}function n_(e){e.nodeType===1&&a_(e,e_)}var r_=new WeakMap;function i_(e){if(e.nodeType!==1)return e.cloneNode(!0);let t=e_,n=r_.get(e);n||r_.set(e,n=new WeakMap);let r=n.get(t);return r||(r=e.cloneNode(!0),a_(r,t),n.set(t,r)),r.cloneNode(!0)}function a_(e,t){o_(e,t);let n=e.firstElementChild;for(;n;)a_(n,t),n=n.nextElementSibling}function o_(e,t){for(let n=0;n<t.length;n++)e.setAttribute(t[n],``)}function s_(e,t){if(e instanceof Element)for(let n=0;n<t.length;n++)e.hasAttribute(t[n])||e.setAttribute(t[n],``);else if(j(e))for(let n of e)s_(n,t);else kv(e)&&!(oh&&Av(e))&&s_(e.nodes,t)}function c_(e,t){let n=t_(e);try{let n=t();return e&&!z&&s_(n,e),n}finally{t_(n)}}function l_(){let e=P_();return e?e.type.__scopeId:void 0}function u_(e,t){let n=t.scopeIdOwners||=[];n.includes(e)||n.push(e)}function d_(e,t){return xy(e.block,{onDynamicFragment:t=>u_(e,t),onComponent:t,excludeSlotOutlets:!0})}function f_(e){for(let t=0;t<e.length;t++)y_(e[t])}var p_=null;function m_(e){p_=e}function h_(e,t){let{scopeId:n,slotScopeIds:r}=e;return n&&(t||=[]).push(n),r&&(t||=[]).push(...r),t}function g_(e){return!!(e.parent&&(e.scopeId||e.slotScopeIds))}function __(e){let t=h_(e,null),n=e;for(;n.parent&&U(n.parent)&&v_(n.parent,n);)n=n.parent,t=h_(n,t);return t}function v_(e,t){return e.block===t||!!e.block&&Sy(e.block)===t}function y_(e){let t=!1,n=d_(e,e=>{g_(e)&&(t=!0)});if(t)return;let r=__(e);r&&(n&&o_(n,r),oh&&p_&&p_(e.block,r))}function b_(e){g_(e)&&y_(e)}function x_(e){if(!g_(e))return;let t=d_(e),n=t&&th(t)?t:void 0,r=oh&&p_;if(!n&&!r)return;let i=__(e);i&&(n&&o_(n,i),r&&r(e.block,i))}var S_=!1;function C_(e,t=!0){let n=S_;try{return S_=t,e()}finally{S_=n}}var w_=new WeakMap,T_=new WeakMap;function E_(e){if(!e)return e;let t=M(e)?{default:e}:e;return w_.has(t)||w_.set(t,P_()),t}function D_(e,t){if(!w_.has(e))return t();let n=N_(w_.get(e)||null);try{return t()}finally{N_(n)}}function O_(e,t,n){if(!w_.has(e))return n;let r=T_.get(e);r||T_.set(e,r=new Map);let i=r.get(t);if(i&&i.slot===n)return i.wrapped;let a=((...t)=>D_(e,()=>n(...t)));return a._=n._,r.set(t,{slot:n,wrapped:a}),a}var k_={get:A_,has:(e,t)=>!!A_(e,t),getOwnPropertyDescriptor(e,t){let n=A_(e,t);if(n)return{configurable:!0,enumerable:!0,value:n}},ownKeys(e){let t=new Set(Object.keys(e).filter(e=>e!==`$`)),n=e.$;if(n)for(let r of n)if(M(r)){let n=D_(e,()=>Th(r));if(n){if(j(n))for(let e of n)t.add(String(e.name));else t.add(String(n.name))}}else for(let e of Object.keys(r))t.add(e);return[...t]},set:xe,deleteProperty:xe};function A_(e,t){let n=j_(e,t);if(n)return O_(e,t,M(n)?n:n.fn)}function j_(e,t){if(t===`$`)return;let n=e.$;if(n){let r=n.length,i;for(;r--;)if(i=n[r],M(i)){let n=D_(e,()=>Th(i));if(n){if(j(n)){for(let e=n.length-1;e>=0;e--)if(String(n[e].name)===t)return n[e]}else if(String(n.name)===t)return n}}else if(A(i,t))return i[t]}if(A(e,t))return e[t]}var M_=null;function N_(e){try{return M_}finally{M_=e}}function P_(){return M_||L}function F_(e=`default`,t,n,r=0){let i=Lp,a=Rp;z||Vp();let o=null,s=P_(),c=s.rawSlots,l=!(r&1)&&s.type.__scopeId,u=e_,d=l?u?[...u,`${l}-s`]:[`${l}-s`]:u,f=!!(r&2),p=t?new Proxy(f?Eh(t):t,Ih):O,m,h=!1,g=oh&&c[lh];if(g){z&&(o=Nm());let t=t_(d);try{m=s.appContext.vdom.slot(g,e,p,s,{fallback:n,flags:r,adoptAnchor:a})}finally{t_(t)}}else{if(f&&n){let e=n;n=(...t)=>C_(()=>e(...t))}z&&(o=Pm());let t=s.ce||yg&&s.parent&&Uo(s.parent)&&s.parent.ce;h=!!(t&&t._hasShadowRoot());let i=!h&&I_(c,e,n,r)?new Tv(r,a):void 0,l;i?m=i:(l=new wv(132,void 0,!1,!1,!1,void 0,a),l.slotBoundary=null,m=l),m.slotScopeIds=d;let u=M(e),g=()=>{if(h){let t=Hp(`slot`);d&&o_(t,d);let r=()=>{let n=M(e)?e():e;pg(t,[p,n==="default"?{}:{name:n}])};if(f?r():Sh(r),n){let e=n,r=t_(d);try{zh(null,()=>{V(e(),t)})}finally{t_(r)}}m.nodes=t;return}let t=M(e)?e():e,r=j_(c,t),a=r?O_(c,t,M(r)?r:r.fn):void 0,o=a?y(a):void 0,s=r&&!M(r)&&A(r,`key`)?r.key:o||n;i?i.updateSlot(o,n,s):z?Tg(()=>l.update(o||n,s)):l.update(o||n,s)},_,v,y=e=>(e!==_&&(_=e,v=()=>c_(d,()=>f?C_(()=>e(p)):e(p))),v);!f&&!h&&(u||c.$)?Sh(g):g()}return z&&oh&&Av(m)&&m.hydrate(),Ov(m,m.anchor,o,i,a,h),m}function I_(e,t,n,r){if(Lh&&At(r))return!0;if(!n||e===O)return!1;if(M(t)||e.$)return!0;let i=j_(e,t);return i?(M(i)?i:i.fn)._===1:!1}var L_,R_,z_,B_,V_=!1;function H_(e,t,n,r){V_=!0,L_=e,R_=t,z_=n,B_=r}var U_=`VaporTransition`;function W_(e){return e.displayName===U_}var G_=!1,K_;function q_(){G_=!0}function J_(e){return q_(),e}function Y_(e){let t=e;for(;yg&&t&&t.vapor&&Uo(t);)t=t.parent;return t&&t.vapor&&Yo(t)?t.ctx:null}function X_(e,t){let n=K_;K_=e;try{return t()}finally{K_=n}}function Z_(e,t,n=!0){if(e){if(e instanceof Node){if(!n&&e.$key!=null)return;e.$key=t}else if(U(e)){if(!n&&e.$key!=null)return;e.$key=t,(!G_||!Yo(e))&&e.block&&Z_(e.block,t,n)}else if(j(e))e.length===1&&Z_(e[0],t,n);else{if(!n&&e.$key!=null)return;e.$key=t,oh&&e.setKey&&e.setKey(t),Z_(e.nodes,t,n)}}}function Q_(e){"@babel/helpers - typeof";return Q_=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Q_(e)}function $_(e,t){if(Q_(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Q_(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ev(e){var t=$_(e,`string`);return Q_(t)==`symbol`?t:t+``}function tv(e,t,n){return(t=ev(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?nv(Object(n),!0).forEach(function(t){tv(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iv(e,t){let n,r=e&&e.getScopeIds?e.getScopeIds():null;for(;e;){let i=e,a=i.getFallback();if(a){let e=!1,o=[],s=r?()=>c_(r,a):a,c=i.run(()=>zh(rv(rv({},i),{},{getFallback:()=>void 0,onContentInvalid:o,markDirty:t=>i.markDirty(!!t||!e&&Hh(i.parent))}),s),t);if(Wv(c))return e=!0,{block:c,onContentInvalid:o};n={block:c,onContentInvalid:o}}e=i.parent}return n}function av(e){return e.activeFallback||e.getContent()}function ov(e,t=!1){if(!e.isDisposed()){if(e.isReconciling||e.isBusy()){e.pendingRecheck=!0,e.pendingRecheckForce=e.pendingRecheckForce||t;return}hv(e,t)}}function sv(e){let t=e.activeFallback?e.activeFallbackInvalidCallbacks:e.boundary.onContentInvalid;if(t)for(let e=0;e<t.length;e++)t[e]()}function cv(e){let t=e.activeFallback;if(t){let n=e.getParentNode();e.fallbackInserted&&n&&H(t,n),e.activeFallback=null,e.fallbackInserted=!1}e.activeFallbackInvalidCallbacks=void 0,e.fallbackScope&&=(e.fallbackScope.stop(),void 0)}function lv(e,t,n){let r=e.activeFallback;return!r||!R_(r,t,n)?!1:(cv(e),!0)}function uv(e){let t=new Ar(!0),n;try{n=iv(e.boundary,t)}catch(e){throw t.stop(),e}if(!n){t.stop();return}return{block:n.block,onContentInvalid:n.onContentInvalid,scope:t}}function dv(e){let t=e.activeFallback;if(z||!t||!Wv(t))return;let n=e.getParentNode();n&&(V(t,n,e.getAnchor()),e.fallbackInserted=!0)}function fv(e,t,n,r,i){if(e.activeFallback=t,e.activeFallbackInvalidCallbacks=r,e.fallbackScope=n,e.fallbackInserted=z,V_&&(e.$transition&&=(Z_(t,`_fb`),L_(t,e.$transition))),i&&!z){let t=e.getParentNode(),n=e.boundary.onContentInvalid;if(n)for(let e=0;e<n.length;e++)n[e]();t&&Yv(e.getContent(),t,!1)}dv(e)}function pv(e,t){let n=uv(e);cv(e),n&&fv(e,n.block,n.scope,n.onContentInvalid,!t)}function mv(e){cv(e),e.pendingRecheck=!1,e.pendingRecheckForce=!1,e.lastNodesValid=void 0}function hv(e,t=!1){if(e.isReconciling){e.pendingRecheck=!0,e.pendingRecheckForce=e.pendingRecheckForce||t;return}let n=t||e.pendingRecheckForce;do{e.pendingRecheck=!1,e.pendingRecheckForce=!1,e.isReconciling=!0;try{gv(e,n)}finally{e.isReconciling=!1}if(!e.pendingRecheck)return;n=e.pendingRecheckForce}while(1)}function gv(e,t){let n=e.activeFallback,r=n?Wv(n):!1,i=e.isContentValid(),a=n?r:i,o=e.lastNodesValid??a;if(!t&&i&&!n&&o){e.syncNodes(),e.lastNodesValid=!0;return}if(i){let t=e.getContent(),r=!!n;if(cv(e),!z&&r){let n=e.getParentNode();n&&V(t,n,e.getAnchor())}}else n?o?(!r&&Hh(e.boundary.parent)||t&&r)&&pv(e,!0):r?dv(e):t&&pv(e,!0):pv(e,!1);let s=e.activeFallback,c=i&&!s?!0:s?s===n?r:Wv(s):e.isContentValid();e.syncNodes(),e.lastNodesValid=c,o!==c&&e.notifyExposedValidityChange()}var _v=class{constructor(e,t=1){this.nodes=e,this.__vf=t}},vv=class extends _v{constructor(e,t=1){super(e,t),this.renderInstance=L,this.slotOwner=M_,this.slotBoundary=Lh,this.slotScopeIds=e_,G_&&(this.keepAliveCtx=Y_(L)),ph&&(this.renderSuspense=mh)}runWithRenderCtx(e,t){return yv(this,e,t)}};function yv(e,t,n){let r=Nu(e.renderInstance,n);try{return xv(e,t)}finally{Pu(r)}}function bv(e,t,n,r,i){return{parent:t,getFallback:n,run:(t,n)=>yv(e,t,n),getScopeIds:()=>e.slotScopeIds,markDirty:r,onContentInvalid:i}}function xv(e,t){let n=ph&&e.renderSuspense||null,r=ph&&mh!==n;if(!r&&M_===e.slotOwner&&Lh===e.slotBoundary&&e_===e.slotScopeIds)return t();let i=r?_h(n):null,a=N_(e.slotOwner),o=Rh(e.slotBoundary),s=t_(e.slotScopeIds);try{return t()}finally{t_(s),Rh(o),N_(a),r&&_h(i)}}var Sv=class extends _v{constructor(e,t,n){super(e,8),t&&Bh(this,n)}onReset(e){(this.resetListeners||=[]).push(e)}},Cv=class extends _v{constructor(e,t,n,r,i,a){super(e,16),this.scope=t,this.itemRef=n,this.keyRef=r,this.indexRef=i,this.key=a}},wv=class extends vv{constructor(e=0,t,n=!1,r=!0,i=!1,a,o){super(Vv,2|e),this.everUpdated=!1,n&&(this.keyed=!0),V_&&L&&W_(L.type)&&(this.inTransition=!0),z?r&&xm():this.anchor=Ev(o,t),i&&Bh(this,a)}get autoHydrate(){return!0}update(e,t=e,n=!1){let r=this.everUpdated;if(this.everUpdated=!0,t===this.current){z&&this.autoHydrate&&Yg(this,!0);return}let i=V_?this.$transition:void 0,a=this.current!==void 0;if(a){let e=this.bu;if(e)for(let t=0;t<e.length;t++)e[t]()}if(i&&z_(this,e,t,n))return;let o=P(),s=z?null:this.getBranchParent(),c;if(a){let r=this.scope,a=this.nodes,l=()=>H(a,s||void 0),u=!1;if(r&&(this.keepAliveCtx?u=this.keepAliveCtx.prepareBranchRemoval(this,r):r.stop()),i&&B_(this,i,s,e,t,n)){P(o);return}u?c=l:l()}let l=z?zg(this,!!e):!1;this.renderBranch(e,i,s,t,n,a||r&&!!s,c),P(o),z&&this.autoHydrate&&!l&&Yg(this,e==null)}getBranchParent(){return this.anchor.parentNode}renderBranch(e,t,n,r,i,a,o){if(this.current=r,e){let r=G_?this.keepAliveCtx:null,a=!i||!!this.fallthrough;r||(this.scope=a?new Ar:void 0);let s=()=>{try{this.nodes=this.runWithRenderCtx(()=>{let t=(a?this.scope.run(e):e())||Vv;n&&this.fallthrough&&this.fallthrough(t);let r=this.bm;if(r)for(let e=0;e<r.length;e++)r[e](t);return t},this.scope)}finally{let e=this.keyed?this.current:this.$key;e!==void 0&&(t||this.inTransition||r)&&Z_(this.nodes,e,!1),V_&&t&&(this.$transition=L_(this.nodes,t))}};r?r.runBranchRender(this,s,a,o):s(),this.scopeIdOwners&&f_(this.scopeIdOwners),n&&(V(this.nodes,n,this.anchor),o&&r&&r.cacheBlock(this))}else this.scope=void 0,this.nodes=Vv,o&&o();let s=this.u;a&&s&&s.forEach(e=>e(this.nodes))}},Tv=class extends wv{constructor(e=0,t){super(1156,void 0,!1,!1,!1,void 0,t),this.disposed=!1,this.activeFallback=null,this.fallbackInserted=!1,this.pendingRecheck=!1,this.pendingRecheckForce=!1,this.isReconciling=!1,this.onContentInvalid=[],this.content=Vv,this.isUpdating=!1,this.sharedFallback=!!(e&8),this.inheritFallback=jt(e),this.notifyParentBoundary=Mt(e),this.sharedFallback&&this.slotBoundary&&Vh(this.slotBoundary,()=>{sv(this);let e=this.anchor,t=e.parentNode;t&&(Yv(this.content,t),this.activeFallback&&Yv(this.activeFallback,t),Xv(e,t))},this),z||(this.insert=(e,t,n)=>this.insertSlot(e,t,n)),this.remove=e=>this.removeSlot(e)}get autoHydrate(){return!1}get boundary(){return this.ownBoundary||=bv(this,this.inheritFallback?this.slotBoundary:null,()=>this.localFallback,e=>ov(this,e),this.onContentInvalid)}insertSlot(e,t,n){this.disposed=!1,V(this.nodes,e,t,n),this.activeFallback===this.nodes&&(this.fallbackInserted=!0)}removeSlot(e){this.disposed=!0;let t=this.nodes;H(t,e),this.activeFallback===t&&(this.activeFallback=null,this.fallbackInserted=!1),this.onContentInvalid.length=0,mv(this)}getBranchParent(){return this.activeFallback?null:super.getBranchParent()}updateContent(e,t){t!==this.current&&(this.onContentInvalid.length=0),this.nodes=this.content,this.update(e,t),this.content=this.nodes}updateHydratingContent(e,t){let n=R,r=Ng(this.sharedFallback||Hh(this.boundary),n);try{this.updateContent(e,t);let i=Wv(this.content);return r.finish(i),{contentStart:n,contentValid:i}}finally{r.settle()}}updateSlot(e,t,n=e||t){let r=this.localFallback;this.localFallback=t;let i=this.boundary,a=e?()=>zh(i,e):()=>Vv;this.isUpdating=!0,this.pendingRecheck=!1;try{let e=r!==t;if(z){if(this.sharedFallback||this.inheritFallback&&!t){let t=Dm();xm(t);let{contentStart:r,contentValid:i}=this.updateHydratingContent(a,n),o=Bm(t.start),s=i;if(this.sharedFallback?(hv(this,e||this.pendingRecheckForce),s=Wv(this.nodes)):(this.syncNodes(),this.lastNodesValid=i),s)o?(this.anchor=Zm(o),jm(o)):Yg(this,!Uv(this.nodes));else if(this.sharedFallback){let e=Cg(),t=o&&o!==e?o:null;t&&jm(t);let n=Qm(Up());this.anchor=n,kg(e);let i=Og(r,e,n,t,e=>this.anchor=Zm(e),()=>this.nodes);Dg({onContent:i,onFallback:()=>{}})||(t&&Zm(t),Ti(i))}else{let e=this.anchor=Qm(Up()),t=Cg(),n=t&&t.parentNode;n&&(kg(t),Ti(()=>{t.parentNode===n&&n.insertBefore(e,t)}))}}else Tg(()=>{this.updateHydratingContent(a,n),hv(this,e||this.pendingRecheckForce),Yg(this,!Uv(this.nodes))})}else this.updateContent(a,n),hv(this,e||this.pendingRecheckForce)}finally{this.pendingRecheck=!1,this.pendingRecheckForce=!1,this.isUpdating=!1}}getContent(){return this.content}getParentNode(){return this.anchor?this.anchor.parentNode:null}getAnchor(){return this.anchor||null}isBusy(){return this.isUpdating}isDisposed(){return this.disposed}isContentValid(){return Wv(this.content)}syncNodes(){this.nodes=av(this)}notifyExposedValidityChange(){this.notifyParentBoundary&&this.slotBoundary&&this.slotBoundary.markDirty()}};function Ev(e,t){return e&&e.nodeType===8?Qm(e):Qm(Up())}function Dv(e,t){return!!t&&e===t}function Ov(e,t,n,r,i,a){z?Fm(n):r&&(a||!Dv(t,i))&&V(e,r,i)}function kv(e){return!!(e&&e.__vf)}function Av(e){return!!(e&&e.__vf&64)}function jv(e){return!!(e&&e.__vf&128)}function Mv(e){return!!(e&&e.__vf&2)}function Nv(e){return!!(e&&e.__vf&8)}function Pv(e){return!!(e&&e.__vf&16)}function Fv(e){return!!(e&&e.__vf&4)}function Iv(e){return!!(e&&e.__vf&1024)}var Lv=!1;function Rv(e){return Lv=!0,e}function zv(e){return!!(e&&e.__isTeleport&&e.__vapor)}function Bv(e){return!!(e&&e.__vf&32)}var Vv=ye;function Hv(e){return e instanceof Node||j(e)||U(e)||kv(e)}function Uv(e,t=!1){return e?e instanceof Node?!(e instanceof Comment)&&!$m(e):U(e)?t||Uv(e.block,t):j(e)?e.length>0&&e.some(e=>Uv(e,t)):oh&&e.isBlockValid?e.isBlockValid(t):Uv(e.nodes,t):!1}function Wv(e){return Uv(e,!0)}function V(e,t,n=null,r){if(e instanceof Node){Gv(e,t,n,r);return}if(U(e))e.isMounted&&!e.isDeactivated?V(e.block,t,n,r):vy(e,t,n);else if(j(e))for(let i of e)V(i,t,n,r);else qv(e,t,n,r)}function Gv(e,t,n=null,r){if(!z){let i=V_&&e instanceof Element?e.$transition:void 0;if(i){let a=()=>t.insertBefore(e,n);Kv(e,i)?(i.beforeEnter(e),a(),I(()=>i.enter(e),void 0,r)):Al(e,i,a,r)}else e!==n&&t.insertBefore(e,n)}}function Kv(e,t){return t.persisted&&!!e.$vshow&&!e[qd]}function qv(e,t,n=null,r){let i=e.anchor;i&&(Gv(i,t,n,r),n=i),e.insert?e.insert(t,n,r,e.$transition):V(e.nodes,t,n,r)}function Jv(e,t,n=null,r=1,i,a){if(e instanceof Node)V_&&e instanceof Element&&e.$transition&&r!==2?r===0?Al(e,e.$transition,()=>t.insertBefore(e,n),a,!0):jl(e,e.$transition,()=>{r===1&&i&&i.isUnmounted?e.remove():t.insertBefore(e,n)},!0,!0):t.insertBefore(e,n);else if(U(e))e.isMounted?Jv(e.block,t,n,r,i,a):vy(e,t,n);else if(j(e))for(let o of e)Jv(o,t,n,r,i,a);else e.anchor&&(Jv(e.anchor,t,n,r,i,a),n=e.anchor),e.insert?e.insert(t,n,a,e.$transition,r):Jv(e.nodes,t,n,r,i,a)}function H(e,t){if(e instanceof Node)Xv(e,t);else if(U(e))yy(e,t,ph&&oh?bh(e.suspense):e.suspense);else if(j(e))for(let n=0;n<e.length;n++)H(e[n],t);else Zv(e,t)}function Yv(e,t,n=!0){if(e instanceof Node)e.parentNode===t&&Xv(e,t);else if(U(e))e.block&&Yv(e.block,t,n);else if(j(e))for(let r=0;r<e.length;r++)Yv(e[r],t,n);else{Yv(e.nodes,t,n);let r=e.anchor;n&&r&&r.parentNode===t&&Xv(r,t)}}function Xv(e,t){V_&&e.$transition&&e instanceof Element?jl(e,e.$transition,()=>t&&e.parentNode===t&&t.removeChild(e)):t&&t.removeChild(e)}function Zv(e,t){let n=e.bum;if(n)for(let e=0;e<n.length;e++)n[e]();e.remove?e.remove(t,e.$transition):H(e.nodes,t),e.anchor&&Xv(e.anchor,t),e.scope&&e.scope.stop()}function Qv(e){if(e instanceof Node)return e;if(j(e)){for(let t=0;t<e.length;t++){let n=Qv(e[t]);if(n)return n}return}if(U(e))return Qv(ty(e));{if(Lv&&Bv(e)){let t=e.placeholder||e.anchor;if(t)return t}let t=e.nodes;return Uv(t)?Qv(t):e.anchor||Qv(t)}}function $v(e){let t=U(e)?ty(e):e,n=ey(t),{parentNode:r,nextSibling:i}=n;return i&&B(i,`]`)&&ny(t)&&!B(n,`]`)&&(n.nodeType!==3||n.data)&&(i=i.nextSibling),{parentNode:r,nextNode:i}}function ey(e){return e&&e instanceof Node?e:j(e)?ey(e[e.length-1]):U(e)?ey(ty(e)):e.anchor?e.anchor:ey(e.nodes)}function ty(e){return ph&&e.pendingBlock||e.block}function ny(e){return j(e)?!0:U(e)?ny(ty(e)):kv(e)?ny(e.nodes):!1}function ry(e,t){return oh&&!!t.vdom&&!e.__vapor}function iy(e,t,n,r,i,a=L&&L.appContext||fy,o=!1,s){let c=S_;c&&(i=!0);let l=Lp,u=Rp,d=null,f,p=null,m,h=!1,g=()=>{m&&m(),d&&R===d&&jm(d)};z?(Pg(),e.__multiRoot&&(f=Dm()),p=Nm(f,!0),f&&f.start&&(d=Vm(f.start),m=ih(d&&Zm(d)))):Vp();let _=null,v=!1;try{if(ph&&L&&L.suspense&&(_=_h(L.suspense),v=!0),(r||V_&&L&&W_(L.type))&&U(L)&&L.type.inheritAttrs!==!1&&L.hasFallthrough){let e=L,n=()=>cy(e);t&&t!==O?(t.$||(t.$=[])).push(n):t={$:[n]}}let m=null;if(G_&&L&&L.vapor&&Yo(L)){let t=L.ctx;m=t;let n=t.getCachedComponent(e);if(n)return n}let y=!1;if(yg&&!z){let t=e.__asyncResolved;t&&!ry(t,a)&&(e=t,y=!0)}if(ry(e,a)){let r=a.vdom.mount(e,L,t,E_(n),i);return z?r.hydrate():l&&V(r,l,u,mh),r}if(Lv&&zv(e)){let r=e.process(t,E_(n),u);return Pr(l?()=>r.disposeTarget():()=>r.scheduleTargetDispose(),!0),z?r.hydrate():l&&V(r,l,u,mh),r}let b;if(m&&(t&&!i||n&&n.$)){let e=new Ar(!0),r=!1;e.run(()=>{if(t&&!i){let e=m.isolatePropSources(t);r=e!==t,t=e}if(n&&n.$){let e=m.isolateSlotSources(n);r||=e!==n,n=e}}),r&&(b=e)}let x=new py(e,t,n,a,i,s);b&&(x.inputScope=b),y&&Xa(x),G_&&!(yg&&Uo(x))&&(m||=Y_(L),m&&m.processShapeFlag(x));let S=N_(null),C=t_(null);try{if(z&&yg&&Uo(x)&&e.__asyncHydrate){let t=()=>ay(x,e);e.__asyncHydrate(R,x,c?()=>C_(t,!1):t)}else if(c?C_(()=>ay(x,e),!1):ay(x,e),z&&ph&&x.suspense&&x.asyncDep){let e=[],t=f&&f.start||p.start,n=Lm(t);do e.push(t),t=t.nextSibling;while(t!==n);x.pendingBlock=e.length===1?e[0]:e,jm(e[e.length-1])}}finally{t_(C),N_(S),ph&&v&&(_h(_),v=!1)}return Pr(()=>yy(x,void 0,oh?bh(x.suspense):x.suspense),!0),!o&&(l||z)&&vy(x,l,u),ph&&z&&d&&x.suspense&&x.asyncDep&&!x.asyncResolved&&x.restoreAsyncContext&&(h=!0,x.deferredHydrationBoundary=()=>{x.block&&d&&$v(x.block).nextNode===d.nextSibling&&Am(d),g()},Fm(p)),x}finally{v&&_h(_),z&&!h&&(g(),Fm(p))}}function ay(e,t){let n=Nu(e),r=P(),i=M(t)?t:t.setup,a=i&&oi(i,e,0,[e.props,e])||O,o=Ne(a);(o||e.sp)&&!(yg&&Uo(e))&&Xa(e),o?e.asyncDep=a:Cy(a,t,e),P(r),Pu(n)}var oy=!1;function sy(e){return M(e)&&!e.props&&!(V_&&W_(e))}function cy(e){let t=sy(e.type)?Mc(e.attrs)||O:e.attrs,n=Mh(e.type)[0];if(n){for(let e in t)if(we(e))return Nc(t,n)}return t}function ly(e,t){if(!we(t))return!1;let n=Mh(e.type)[0];return!!n&&t.slice(9)in n}function uy(e,t){oy=!0;try{pg(e,[t])}finally{oy=!1}}function dy(e,t,n){return oi(e,t,1,[n,t.props,t.emit,t.attrs,t.slots])}var fy={app:null,config:{},provides:Object.create(null)},py=class{constructor(e,t,n,r,i,a){if(this.effectCount=0,this.accessedAttrs=!1,this.vapor=!0,this.uid=zu(),this.type=e,this.parent=L,L?(this.root=L.root,this.appContext=L.appContext,this.provides=L.provides,this.ids=L.ids):(this.root=this,this.appContext=r||fy,this.provides=Object.create(this.appContext.provides),this.ids=[``,0,0]),this.block=null,this.scope=new Ar(!0),this.isOnce=!!i,this.emit=dh.bind(null,this),this.expose=$u.bind(null,this),this.refs=O,this.emitted=this.exposed=this.exposeProxy=this.propsDefaults=null,this.suspense=null,this.suspenseId=0,ph&&(this.suspense=mh,this.suspenseId=mh?mh.pendingId:0),this.asyncDep=null,this.asyncResolved=!1,this.isMounted=this.isUnmounted=this.isUpdating=this.isDeactivated=!1,this.rawProps=this.isOnce&&t?Eh(t):t||O,this.hasFallthrough=!!a||Ph(e,this.rawProps),t||e.props){let[t,n]=Oh(e);this.attrs=new Proxy(this,n),this.props=e.props?new Proxy(this,t):M(e)?this.attrs:O}else this.props=this.attrs=O;let o=E_(n);this.rawSlots=o||O,this.slots=o?new Proxy(o,k_):O,this.scopeId=l_(),this.slotScopeIds=e_,a&&a(this)}rawKeys(){return jh(this.rawProps)}};function U(e){return e instanceof py}function my(e,t,n,r,i,a,o){return hy(bs(e,a),t,n,r,i,o)}function hy(e,t,n,r,i,a){if(e===xs){if(z&&R){if(gy(R)){let e=R;return B(e,``)&&jm(e),e}let e=Lm(R);if(e&&gy(e))return e}return Up(``)}return N(e)?_y(e,t,n,r,i):iy(e,t,n,r,i,a)}function gy(e){return B(e,``)||!1}function _y(e,t,n,r,i){n=E_(n);let a=Lp,o=Rp,s=null;z?(Pg(),s=Nm()):Vp();let c=n&&A_(n,`default`),l=!!n&&!!n.$,u=!!c,d=l&&!c?`<${e}><!></${e}>`:`<${e}/>`,f=z?bm(R,d,u):Hp(e);if(f.$root=r,!z||th(f)){let e=l_();e&&f.setAttribute(e,``),e_&&o_(f,e_)}if(t){let e=()=>pg(f,[Fh(t)]);i?e():Sh(e)}if(n){let e=null;if(z){e=Lm(f);let t=f.firstChild;n.$&&!t&&(t=f.appendChild(Zm(Up()))),Am(t)}if(n.$){let e=new wv(512,void 0);Sh(()=>e.update(A_(n,`default`))),z||V(e,f)}else{let e=A_(n,`default`);if(e){let t=e();z||V(t,f)}}z&&Am(e)}return Ov(f,void 0,s,a,o),f}function vy(e,t,n){if(ph&&e.suspense&&e.asyncDep&&!e.asyncResolved){if(e.asyncDepRegistered){e.pendingBlock?V(e.pendingBlock,t,n):e.block&&V(e.block,t,n),G_&&e.shapeFlag&512&&(e.isDeactivated=!1);return}let r=e.suspense,i=G_&&Ay(e),a=z;a||(e.block=Wp(``),V(e.block,t,n)),e.asyncDepRegistered=!0;let o=e.type,s=!1,c=t=>{if(s)return;s=!0,e.asyncResolved=!0;let n=e.restoreAsyncContext&&e.restoreAsyncContext(),r=()=>{let n=Nu(e),r=P();try{Cy(t,o,e)}finally{P(r),Pu(n)}};try{let t=a?e.pendingBlock:e.block,{parentNode:n,nextNode:i}=$v(t);a?lm(()=>{r(),vy(e,n,i),e.deferredHydrationBoundary&&e.deferredHydrationBoundary()}):(r(),vy(e,n,i),H(t,n))}finally{a&&(e.pendingBlock=void 0,e.deferredHydrationBoundary=void 0),e.restoreAsyncContext=void 0,n&&n()}};if(r.registerDep(e,t=>{i&&(i.pendingRoot===e&&(i.pendingRoot=void 0),i.flushQueued||(i.flushQueued=!0,I(i.flushJob,void 0,i.suspense))),c(t)}),i){let t=i;e.asyncDep.catch(be).then(n=>{s||(!e.isUnmounted&&!r.isUnmounted&&!r.pendingBranch&&c(n),!t.flushQueued&&t.pendingRoot===e&&ky(t))})}return}if(G_&&e.shapeFlag&512&&e.isMounted){e.parent.ctx.activate(e,t,n);return}let{root:r,type:i}=e;r&&r.ce&&r.ce._hasShadowRoot()&&r.ce._injectChildStyle(i,e.parent?e.parent.type:void 0),e.bm&&Ze(e.bm),z?x_(e):(b_(e),V(e.block,t,n,e.suspense)),e.m&&I(e.m,void 0,e.suspense),G_&&e.shapeFlag&256&&e.a&&I(e.a,void 0,e.suspense),e.isMounted=!0}function yy(e,t,n=e.suspense){if(ph&&oh&&hh!==n){yh(n,()=>yy(e,t,n));return}if(G_&&e.shapeFlag&256&&e.parent&&e.parent.vapor&&e.parent.ctx){t&&e.parent.ctx.deactivate(e,n);return}let r=!!e.asyncDep&&!e.asyncResolved;if(!e.isUnmounted&&(e.isMounted||r)){if(kl(e.m),kl(e.a),e.bum&&Ze(e.bum),G_){let t=e.inputScope;t&&t.stop()}e.scope.stop(),e.um&&I(e.um,void 0,n),e.isUnmounted=!0}if(ph&&r){if(e.pendingBlock){if(t){let t=e.pendingBlock,{parentNode:n}=$v(t);n&&H(t,n),e.pendingBlock=void 0}}else if(e.block instanceof Comment){let t=e.block.parentNode;t&&H(e.block,t)}}else t&&e.block&&H(e.block,t);r&&(e.restoreAsyncContext=void 0,e.deferredHydrationBoundary=void 0)}function by(e){if(e.exposed)return e.exposeProxy||=new Proxy($n(e.exposed),{get:(e,t)=>lr(e[t])})}function xy(e,t){if(e instanceof Element)return e;if(U(e))return t&&t.onComponent&&t.onComponent(e),xy(e.block,t);if(kv(e)&&!(Lv&&Bv(e))){if(t){if(t.excludeSlotOutlets&&jv(e))return;if(Mv(e)&&t.onDynamicFragment&&t.onDynamicFragment(e),oh&&t.onInteropFragment&&Av(e)&&e.vnode){t.onInteropFragment(e);return}}let{nodes:n}=e;return n instanceof Element&&n.$root?n:xy(n,t)}if(j(e)){let n,r=!1;for(let t of e){if(t instanceof Comment){r=!0;continue}if(n!==void 0)return;n=t}return!r||n===void 0?void 0:xy(n,t)}}function Sy(e){for(;;){if(U(e))return e;if(kv(e)&&!(Lv&&Bv(e))){if(jv(e))return;e=e.nodes;continue}if(j(e)){let t,n=!1;for(let r of e){if(r instanceof Comment){n=!0;continue}if(t!==void 0)return;t=r}if(n&&t!==void 0){e=t;continue}return}return}}function Cy(e,t,n){n.block=Hv(e)?e:M(t)?[]:t.render&&dy(t.render,n,e)||[],wy(n)}function wy(e){e.hasFallthrough&&e.type.inheritAttrs!==!1&&Ty(e.block,e,void 0)}function Ty(e,t,n){let r={parentScope:n},i=Ey(e,r),{fragments:a,innermost:o,hasSlotFragment:s}=r;if(a)for(let e of a)Dy(e,t);if(i&&!s){let e=n;o&&(e=o.scope||=r.parentScope?r.parentScope.run(()=>new Ar):new Ar);let a=()=>Sh(()=>uy(i,cy(t)));e?e.run(a):a()}}function Ey(e,t){if(e instanceof Element)return e;if(!U(e)){if(kv(e)&&!(Lv&&Bv(e))){if(Mv(e)){if(e.__vf&4){t.hasSlotFragment=!0;return}(t.fragments||=[]).push(e),t.innermost&&t.innermost.scope&&(t.parentScope=t.innermost.scope),t.innermost=e}let{nodes:n}=e;if(n instanceof Element&&n.$root)return n;let r=Ey(n,t);return!r&&t.innermost===e&&(t.hasNonSingleRoot=j(n)&&n.some(e=>!(e instanceof Comment))),r}if(j(e)){let n,r=!1;for(let t of e){if(t instanceof Comment){r=!0;continue}if(n!==void 0)return;n=t}return!r||n===void 0?void 0:Ey(n,t)}}}function Dy(e,t){e.fallthrough||=n=>Ty(n,t,e.scope)}function Oy(e){let t=e.suspense;if(t.isUnmounted||e.pendingId!==t.pendingId)return!1;if(e.flushQueued)return!0;let n=e.pendingRoot;return!!n&&!n.isUnmounted}function ky(e,t){let{effects:n,owners:r}=e;e.effects=[],e.owners=[],e.pendingRoot=void 0;for(let t=0;t<r.length;t++)r[t].deferredKeepAliveUpdates===e&&(r[t].deferredKeepAliveUpdates=void 0);t&&!n.includes(t)&&n.push(t),n.length>1&&n.sort((e,t)=>e.order-t.order);for(let e=0;e<n.length;e++){let t=n[e];oi(t,t.i,t.i?15:14)}}function Ay(e){let t=e.suspense,n=[],r;if(z){let i=e.parent;i&&i.vapor&&Yo(i)&&i.suspense===t&&(r=i,n.push(r))}else{let i=e,a=e.parent;for(;a&&a.vapor&&a.suspense===t;){let e=a,t=e.block;for(;Mv(t)&&!(t.__vf&4);)t=t.nodes;if(t!==i)return;n.push(e),Yo(a)&&(r=e),i=e,a=e.parent}}if(!r)return;let i=r.deferredKeepAliveUpdates;if(!i||i.suspense!==t||i.pendingId!==e.suspenseId){let n=()=>{a.flushQueued=!1,!(r.deferredKeepAliveUpdates!==a||a.pendingRoot)&&ky(a)};n.flags=8;let a={effects:[],owners:[],suspense:t,pendingId:e.suspenseId,pendingRoot:e,flushQueued:!1,flushJob:n};i=a}else i.pendingRoot=e;for(let e=0;e<n.length;e++){let t=n[e];t.deferredKeepAliveUpdates!==i&&(t.deferredKeepAliveUpdates=i,i.owners.push(t))}return i}var jy,My=new WeakMap,Ny=(e,t)=>{gg(),t.nodeType===1&&(t.textContent=``);let n=e._ceComponent||iy(e._component,e._props,null,!1,!1,e._context);return vy(n,t),ki(),My.set(e,n),n},Py,Fy=(e,t)=>{if(!t.hasChildNodes())return Ny(e,t);gg();let n;return pm(t,()=>{n=e._ceComponent||iy(e._component,e._props,null,!1,!1,e._context,!0),vy(n,t),ki()}),My.set(e,n),n},Iy=e=>{let t=My.get(e);yy(t,e._container),ki(t),My.delete(e)};function Ly(){yl();let e=nt();e.__VUE__=!0}function Ry(e){e.vapor=!0;let t=e.mount;e.mount=(e,...n)=>{if(e=Pp(e),!e)return;let r=t(e,...n);return e instanceof Element&&(e.removeAttribute(`v-cloak`),e.setAttribute(`data-v-app`,``)),r}}var zy=(e,t)=>{Ly(),jy||=vc(Ny,Iy,by);let n=jy(e,t);return Ry(n),n},By=(e,t)=>{am(!0),Ly(),Py||=vc(Fy,Iy,by);let n=Py(e,t);return Ry(n),n};function Vy(e,t){return M(e)?k({name:e.name},t,{setup:e,__vapor:!0}):(e.__vapor=!0,e)}function Hy(e){bg();let{load:t,getResolvedComp:n,setPendingRequest:r,source:{loadingComponent:i,errorComponent:a,delay:o,hydrate:s,timeout:c,suspensible:l=!0}}=Ko(e);return Vy({name:`VaporAsyncComponentWrapper`,__asyncLoader:t,__asyncHydrate(e,r,i){if(!z)return;let a=B(e,`[`)?Vm(e):null,o;if(a){let t=Qp(a),n=o=[e],r=e;for(;;){let e=Qp(r);if(e&&e!==t)n.push(r=e);else break}}else o=e;let c=Nu(r);try{let e=new wv(0,void 0,!1,!1);e.nodes=o,r.block=e}finally{Pu(c)}r.isMounted=!0,Am(a||e.nextSibling),Jo(e,r,()=>mm(e,()=>lm(i)),n,t,s,!1)},get __asyncResolved(){return n()},setup(){let e=L;Xa(e);let s=e.block,u;z&&Mv(s)?(u=s,u.nodes=Vv,xm()):u=new wv(0,void 0);let d=n();if(d){if(u.update(()=>Gy(d,e)),u===s){let e=u.u;e&&e.forEach(e=>e(u.nodes))}return u}let f=t=>{r(null),ci(t,e,13,!a)};if(l&&e.suspense){let r=t=>{e.isUnmounted||e.scope.run(()=>u.update(t))};return t().then(()=>(d=n(),d&&r(()=>Gy(d,e)),u)).catch(t=>(f(t),a&&r(()=>Wy(a,e,()=>t)),u))}let{loaded:p,error:m,delayed:h}=qo(o,c,f,e);return t().then(()=>{e.isUnmounted||(p.value=!0)}).catch(t=>{if(e.isUnmounted){r(null);return}f(t),m.value=t}),Sh(()=>{d=n();let t,r;p.value&&d?(t=()=>Gy(d,e),r=1):m.value&&a?(t=()=>Wy(a,e,()=>m.value),r=2):i&&!h.value&&(t=()=>Gy(i,e),r=3),u.update(t,r),G_&&u.keepAliveCtx&&u.keepAliveCtx.cacheBlock()}),u}})}function Uy(e){let t=e.block;if(Mv(t)&&t.current!==void 0&&e.type.__asyncResolved)return t.nodes}function Wy(e,t,n){return Gy(e,t,{error:n},{})}function Gy(e,t,n=t.rawProps,r=t.rawSlots){let i=Nu(t);try{return iy(e,n,r,void 0,t.isOnce,t.appContext)}finally{Pu(i)}}var Ky=!1,qy=()=>{Ky||(Ky=!0,H_(ab,sb,cb,lb))},Jy=e=>{if(!R||!ho(R))return;let t=R,{content:n,parentNode:r}=t,{firstChild:i}=n;if(i){let a;for(let e=i;e;e=e.nextSibling)if(e instanceof Element){a=e;break}if(r.insertBefore(n,t),r.removeChild(t),em(r,t,i),Am(i),a instanceof HTMLElement||a instanceof SVGElement){let t=a.style.display;return a.style.display=`none`,n=>{n.beforeEnter(a),a.style.display=t,I(()=>n.enter(a),void 0,e)}}}},Yy=(e=>(e.displayName=U_,e.props=kd,e.__vapor=!0,e))((e,{slots:t,expose:n})=>{n(),qy();let r=L,i=z?Jy(r.suspense):void 0,a=Da(),{mode:o}=e,s=Ir(()=>Nd(e)),c=new Proxy({},{get(e,t){return s.value[t]}}),l=!!e.appear&&!!i;if(r.rawSlots.$){let e=new wv(0,void 0);a.root=e;let n=!1;return Sh(()=>{e.$transition?e.$transition.mode=s.value.mode:e.$transition=ib(e,c,a,r);let o=e.nodes;e.update(t.default),n&&e.nodes===o&&!a.isLeaving&&(e.$transition=ab(e.nodes,e.$transition)),!n&&l&&i(e.$transition),n=!0}),e}let u=t.default&&t.default()||[];a.root=u;let d={__vapor:!0,state:a,props:c,instance:r},f=!1;return Sh(()=>{d=ab(u,d),f||(f=!0,l&&i(d))}),u}),Xy=new WeakMap;function Zy(e){let t=Xy.get(e);if(t!==void 0)return t;if(e instanceof Element)return e.localName;if(oh&&kv(e)&&e.getTransitionType){let t=e.getTransitionType();if(t!==void 0)return t}return e}function Qy(e,t){Xy.set(e,t)}function $y(e,t){let{leavingNodes:n}=e,r=Zy(t),i=n.get(r);return i||(i=Object.create(null),n.set(r,i)),i}function eb(e){let t=vb(e);if(t)return t;if(kv(e)&&!j(e.nodes)&&(e.nodes instanceof Element||kv(e.nodes)))return eb(e.nodes)}var tb=new WeakMap;function nb(e){let t=tb.get(e);return t===void 0?e.$key:t}var rb=(e,t)=>{let n=String(nb(e)),r=$y(t,e);return{isLeaving:()=>r[n]===e,setLeavingNodeCache:()=>{r[n]=e},unsetLeavingNodeCache:()=>{r[n]===e&&delete r[n]},earlyRemove:()=>{let t=r[n];if(t&&nb(t)===nb(e)){let e=eb(t);e&&e[Ta]&&e[Ta]()}}}};function ib(e,t,n,r){let i=Ia(rb(e,n),t,n,r);return i.__vapor=!0,i.persisted=i.persisted||!!n.persisted,i.state=n,i.props=t,i.instance=r,i}function ab(e,t){if(j(e)){if(e=e.filter(e=>!(e instanceof Comment)),e.length===1)e=e[0];else if(e.length===0)return t}if(t.applyGroup&&(Nv(e)||Fv(e)||U(e)&&Fv(e.block)))return t.applyGroup(e,t.props,t.state,t.instance),t;let n=[],r=ub(e,e=>n.push(e));if(!r)return n.forEach(e=>e.$transition=t),t;let{props:i,instance:a,state:o,delayedLeave:s}=t;o.persisted=ob(o.root);let c=ib(r,i,o,a);return c.delayedLeave=s,r.$transition=c,n.forEach(e=>e.$transition=c),c}function ob(e){for(;e;){if(e.$vshow)return!0;if(U(e)){if(W_(e.type))return!1;e=yg&&Uo(e)?Uy(e):e.block}else if(j(e))e=e.find(e=>!(e instanceof Comment));else if(kv(e)&&(Fv(e)||!(Mv(e)||Nv(e))))e=e.nodes;else return!1}return!1}function sb(e,t,n){let r=ub(e);if(!r)return!1;let{props:i,state:a,instance:o}=t,s=ib(r,i,a,o);r.$transition=s;let{mode:c}=i;return c===`out-in`?(a.isLeaving=!0,s.afterLeave=()=>{a.isLeaving=!1,n(),r.$transition=void 0,delete s.afterLeave}):c===`in-out`&&(s.delayLeave=(e,n,i)=>{let o=$y(a,r),s=String(nb(r));o[s]=r;let c=()=>{i(),r.$transition=void 0,t.delayedLeave===c&&delete t.delayedLeave};e[Ta]=()=>{n(),e[Ta]=void 0,r.$transition=void 0,o[s]===r&&delete o[s],t.delayedLeave===c&&delete t.delayedLeave},t.delayedLeave=c}),!0}function cb(e,t,n,r){if(!e.$transition.state.isLeaving)return!1;e.current=n;let i=e.pending;return i?(i.render=t,i.key=n,i.noScope=r):e.pending={render:t,key:n,noScope:r},!0}function lb(e,t,n,r,i,a){let o=t.mode;if(o&&!t.persisted&&(o!==`in-out`||r)&&(o!==`out-in`||Uv(e.nodes))){let s=L;if(sb(e.nodes,t,()=>{if(t.state.isUnmounting)return;let o=Nu(s);try{let o=e.pending;o?(e.pending=void 0,e.renderBranch(o.render,t,n,o.key,o.noScope,!0)):e.renderBranch(r,t,n,i,a,!0)}finally{Pu(o)}}),o===`out-in`)return e.current=i,n&&H(e.nodes,n),!0}return!1}function ub(e,t){let n=[];return db(e,t,n),n[0]}function db(e,t,n){e instanceof Node?e instanceof Element&&n.push(e):U(e)?fb(e,t,n):j(e)?pb(e,t,n):kv(e)&&mb(e,t,n)}function fb(e,t,n){if(yg&&Uo(e)){let r=Uy(e);if(r===void 0){t&&kv(e.block)&&t(e.block);return}let i=n.length;db(r,t,n),hb(n[i],e);return}if(W_(e.type))return;let r=n.length;db(e.block,t,n),hb(n[r],e)}function pb(e,t,n){for(let r of e){if(r instanceof Comment)continue;let e=[];db(r,t,e),e.length&&n.push(e[0]);break}}function mb(e,t,n){if(oh&&e.hasVDOMContent&&e.hasVDOMContent()){n.push(e);let t=e.getTransitionType();t!==void 0&&Qy(e,t);return}t&&t(e),db(e.nodes,t,n)}function hb(e,t){e&&(e.$key==null&&t.$key!=null&&(e.$key=t.$key),Qy(e,t.type))}function gb(e,t){U(e)&&(e=ub(e.block),!e)||(e.$transition=t)}function _b(e){return e instanceof Element||!!(oh&&kv(e)&&e.hasVDOMContent&&e.hasVDOMContent())}function vb(e){if(e instanceof Element)return e;if(oh&&kv(e)&&e.getTransitionElement)return e.getTransitionElement()}var yb=new WeakMap;function bb(e){let t=yb.get(e);t&&t.job&&(t.job.flags=t.job.flags|4,t.job=void 0)}function xb(e){bb(e);let t=yb.get(e);t&&t.fn()}var Sb=J_(Vy({name:`VaporKeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t,expose:n}){let r;if(n(r),!t.default)return;let i=L,a=new Map,o=new Set,s=Hp(`div`),c=new Map,l=(e,t,n=K_)=>{if(t&&oh){let t=e;return(t.$key===void 0?t.vnode.key??n:t.$key)??t.vnode.type}return e.$key??n??e.type},u,d,f=t=>{let{max:n}=e;o.add(t),n&&o.size>parseInt(n,10)&&y(o.values().next().value)},p=(e,t,n)=>{a.has(e)?n&&(o.delete(e),o.add(e)):f(e),a.set(e,t),n&&(u=t)},m=(t=i.block)=>{if(Mv(t)){let e=t.$transition;if(e&&e.mode===`out-in`&&e.state.isLeaving)return}let[n,r]=Ob(t);if(!n)return;let o=Mv(t)&&t.keyed?t.current:void 0,s=l(n,r,o);if(!wb(n,e,r)){a.has(s)&&y(s);return}Tb(n,r,a.has(s));let{currentBlock:c,currentKey:u}=b();p(s,n,c===n||u===s)},h=t=>{let[n,r]=Ob(t);if(!n||!wb(n,e,r))return!1;let i=l(n,r);return Tb(n,r,a.has(i)),i},g=e=>{a.forEach((t,n)=>{let r=kb(t);if(!r)return;let i=rd(Uo(r)?r.type.__asyncResolved||{}:r.type);i&&!e(i)&&y(n)})},_=e=>{let t=c.get(e);if(t){c.delete(e);for(let[e,n]of c)if(n===t){c.delete(e);break}}return t},v=(e,t,n)=>{let r=c.get(e);if(r&&r!==n){let t=_(e);t&&t.stop()}c.set(e,n),t!==e&&c.set(t,n)},y=e=>{let t=a.get(e);if(t&&(!u||t!==u)){Eb(t);let e=$v(t).parentNode;e&&H(t,e)}else u&&Eb(u);a.delete(e),o.delete(e);let n=_(e);n&&n.stop()};oa(()=>[e.include,e.exclude],([e,t])=>{e&&g(t=>Zo(e,t)),t&&g(e=>!Zo(t,e))},{flush:`post`,deep:!0}),us(m),fs(m);let b=()=>{let e=i.block,[t,n]=Ob(e),r=Mv(e)&&e.keyed?e.current:K_;return{currentBlock:t,interop:n,currentKey:t&&l(t,n,r)}};ps(()=>{let{currentBlock:e,interop:t,currentKey:n}=b(),r=e=>{Eb(e);let t=kb(e);if(t){let e=t.da;e&&I(e,void 0,i.suspense)}},o=!1;a.forEach((e,t)=>{if(n===t){o=!0,r(e);return}Eb(e);let i=$v(e).parentNode;H(e,i||void 0)}),!o&&e&&Db(e,t)&&r(e),c.forEach(e=>e.stop()),c.clear()});let x={isolatePropSources:Ch,isolateSlotSources:Mb,getStorageContainer:()=>s,getCachedComponent:(e,t)=>{if(oh&&lu(e))return a.get(e.key??K_??e.type);let n=t??K_;return n==null?a.get(e)||a.get(e.__asyncResolved):a.get(n)},activate:(e,t,n,r)=>{u=e,Ab(e,t,n,r)},deactivate:(e,t)=>{u=void 0,jb(e,s,t)},prepareBranchRemoval(e,t){if(e!==d)return t.stop(),!1;let n=e.keyed?X_(e.current,()=>h(e.nodes)):h(e.nodes);return n===!1?(t.stop(),!1):(t.pause(),v(n,e.current,t),!0)},runBranchRender(e,t,n,r){let i=n?_(e.current):void 0;e.scope=n?i||new Ar:void 0,i&&i.resume();let o=!1,s=()=>{try{t()}finally{o=h(e.nodes)}};try{e.keyed?X_(e.current,s):s(),r&&o!==!1&&!a.has(o)&&f(o)}finally{r&&r()}},processShapeFlag:h,cacheBlock:m};oh&&(x.clearCurrent=e=>{u===e&&(u=void 0)}),i.ctx=x;let S=t.default();return d=Cb(S,x),j(S)&&(S=S.filter(e=>!(e instanceof Comment)),S.length===1&&(d=Cb(S[0],x)),S.length),S}}));function Cb(e,t){if(Mv(e))return(e.u||=[]).unshift(()=>{e.$transition&&e.$transition.mode===`out-in`&&t.cacheBlock(e)}),e}var wb=(e,t,n=!1)=>{let r=Uo(n?e.vnode:e),i=n&&oh?e.vnode.type:e.type;if(r&&!i.__asyncResolved)return!t.include;let{include:a,exclude:o}=t,s=rd(r?i.__asyncResolved:i);return!(a&&(!s||!Zo(a,s))||o&&s&&Zo(o,s))};function Tb(e,t,n){t&&oh?(n&&(e.vnode.shapeFlag|=512),e.vnode.shapeFlag|=256):(n&&(e.shapeFlag|=512),e.shapeFlag|=256)}var Eb=e=>{if(U(e)){if(ns(e),yg&&Uo(e)){let[t]=Ob(e.block);t&&U(t)&&ns(t)}}else if(oh){let t=e.vnode;ns(t),U(t.component)&&Eb(t.component)}};function Db(e,t){return t&&oh&&Av(e)?!!(e.vnode.shapeFlag&256):!!(e.shapeFlag&256)}function Ob(e){return U(e)?[e,!1]:oh&&Av(e)?[e,!0]:kv(e)?Ob(e.nodes):[void 0,!1]}function kb(e){if(U(e))return e;if(oh)return e.vnode.component}function Ab(e,t,n,r=e.suspense){let i=e.inputScope;i&&i.resume(),Jv(e,t,n,0,e,r),I(()=>{e.isDeactivated=!1,e.a&&Ze(e.a)},void 0,r)}function jb(e,t,n=e.suspense){let r=e.inputScope;r&&r.pause(),xb(e),kl(e.m),kl(e.a),Jv(e,t,null,1,e,n),I(()=>{e.da&&Ze(e.da),e.isDeactivated=!0},void 0,n)}function Mb(e){let t=e.$,n=t.slice(),r=Gn([]),i=!1;for(let e=0;e<t.length;e++){let a=t[e];M(a)&&(i=!0,n[e]=(()=>r[e]))}if(!i)return e;let a=rv(rv({},e),{},{$:n});return Sh(()=>{for(let e=0;e<t.length;e++){let n=t[e];M(n)&&(r[e]=Th(n))}},!0),a}var Nb=ye;function Pb(e){if(!e)return;let t=Ka([e]);return t.length===1?t[0]:void 0}function Fb(e){return!!e&&e.__vapor===!0}function Ib(e){return e.component}function Lb(e,t,n,r,i,a){let o=e.$transition,s=e.renderInstance;if(o&&!Fb(o)){Ga(t,o);return}if(o&&o.applyGroup||!o&&!(n&&s&&W_(s.type)))return;let c=za([t],!0);return o?Ba(r,c,o.props,o.state,o.instance,i,a||o)||Su():c}function Rb(e){let t=Pb(e);return t&&t.type}function zb(e){let t=Pb(e);return t&&t.key}function Bb(e){if(!e)return;let t=e.component;if(U(t)){let e=t.block&&ub(t.block);return e&&vb(e)}if(t)return Bb(t.subTree);if(e.el instanceof Element)return e.el;if(e.type===Yl){let t=Pb(e);if(t)return Bb(t)}else if(e.shapeFlag&64&&j(e.children)){let t=za(e.children);if(t)return Bb(t)}}function Vb(e){let t={};for(let n in e)ze(n)||(t[n]=e[n]);return t}var Hb={mount(e,t,n,r,i,a,o){let s=e.anchor=Up();e.el=s,t.insertBefore(s,n);let c=L;Mu(r);let l=ir(Vb(e.props)),u=ir(kx(e.children)),d=Lx(u),f=null;ph&&i&&(f=_h(i));let p=[()=>l.value];p[ch]=!0;let m=e.component=iy(e.type,{$:p},d,void 0,void 0,r?r.appContext:e.appContext,!0);m.rawPropsRef=l,m.rawSlotsRef=u;let h=Ex(m,e);Bx(m,e),r&&Yo(r)&&(q_(),m.shapeFlag=e.shapeFlag),e.transition&&(qy(),(m.bm||=[]).push(()=>{let e=h.vnode.transition;e&&gb(m,e)})),ph&&i&&_h(f);let g=Sx(m);return g&&(e.el=g),o&&o(),e.dirs&&(g?a&&a():e.dirs=null),vy(m,t,s),Mu(c),m},update(e,t,n,r,i){t.component=e.component,t.el=e.el,t.anchor=e.anchor;let a=Ib(t),o=Ex(a,t);if(n){let e=xy(a);e&&(t.el=e),i&&i(),t.dirs&&(e?r&&r():t.dirs=null),o.pendingVNodeUpdate=t,t.transition&&a.block&&(qy(),gb(a,t.transition)),a.rawPropsRef.value=Vb(t.props),a.rawSlotsRef.value=kx(t.children),Ti(()=>{Cx(t,a),o.pendingVNodeUpdate===t&&!a.isUpdating&&(o.pendingVNodeUpdate=null)})}},unmount(e,t,n){if(ph&&hh!==n){yh(n,()=>Hb.unmount(e,t,n));return}let r=t?e.anchor.parentNode:void 0,i=Ib(e),a=null;if(i){let a=e.anchor;if(i.block){if(yy(i,r,n),!t){let e=dx(i.block)?a&&a.parentNode:void 0;H(i.block,e)}}else yy(i,r,n),t||(i.pendingBlock=void 0)}else if(e.vb){let t=e.anchor;e.el&&e.el!==t&&B(e.el,`[`)&&(a=e.el);let n=r||(dx(e.vb)?t&&t.parentNode:void 0);H(e.vb,n),bx(e)}if(t){if(a){let e=a.parentNode;e&&H(a,e)}let t=e.anchor,n=t.parentNode;n&&H(t,n)}},slot(e,t,n,r,i,a,o){if(!e){let e=yx(t,i,a,o),s=(kv(e)?e.anchor:void 0)||Up();V(t.el=t.anchor=s,n,r),V(t.vb=e,n,s,a)}else if(!e.vs||!t.vs||!e.vs.slot||!t.vs.slot||t.vs.slot!==e.vs.slot){let n=e.anchor,r=n.parentNode,s=n.nextSibling,c=e.el&&e.el!==n&&B(e.el,`[`)?e.el:void 0,l=kv(e.vb)&&e.vb.anchor===n;H(e.vb,r),bx(e);let u=yx(t,i,a,o),d=kv(u)?u.anchor:void 0,f=s;d?l||H(n,r):l?d=Up():(d=n,f=n),V(t.anchor=d,r,f),t.el=c||d,V(t.vb=u,r,d,a)}else{let n=e.vs,r=t.vs;t.el=e.el,t.anchor=e.anchor,t.vb=e.vb,(r.ref=n.ref).value=t.props,r.scope=n.scope,_x(e,t)}},move(e,t,n,r,i){let a=e.vb||e.component,o=U(a)&&!!a.pendingBlock;e.el&&e.el!==e.anchor&&B(e.el,`[`)&&!o&&Jv(e.el,t,n,r,void 0,i),Jv(a,t,n,r,void 0,i),Jv(e.anchor,t,n,r,void 0,i)},hydrate(e,t,n,r,i,a,o,s){if(!z&&!oo&&!io)return t;let c;return mm(t,()=>{c=this.mount(e,n,r,i,a,o,s)}),c&&c.asyncDep&&!c.asyncResolved&&(e.el=t),r},hydrateSlot(e,t,n,r,i){if(!z&&!oo&&!io)return t;let a=Kp(t),o=!1,s=null;return mm(t,()=>{e.vb=yx(e,n,r,i);let c=kv(e.vb)&&e.vb.anchor,l=c||R,u=B(t,`[`)&&B(l,`]`);!c&&!u&&(o=!0,s=l&&Kp(l)===a?l:null,l=Up(),a.insertBefore(l,s)),B(t,`[`)&&B(l,`]`)?(e.el=t,e.anchor=l):e.anchor=e.el=l}),o?s:B(t,`[`)?e.anchor.nextSibling:e.anchor},setTransitionHooks(e,t){qy(),gb(e,t)},activate(e,t,n,r,i){let a=r.ctx.getCachedComponent(e);e.el=a.el,e.component=a.component,e.anchor=a.anchor;let o=Ib(e),s=Ex(o,e),c=xy(o);if(c&&(e.el=c),e.dirs&&!c&&(e.dirs=null),Pc(a,e)){s.pendingVNodeUpdate=e,o.rawPropsRef.value=Vb(e.props),o.rawSlotsRef.value=kx(e.children);let t=e.props&&e.props.onVnodeBeforeUpdate;t&&si(t,r,7,[e,a]),e.ibu&&e.ibu(),e.dirs&&Zi(e,a,r,`beforeUpdate`),Ti(()=>{Cx(e,o),s.pendingVNodeUpdate===e&&!o.isUpdating&&(s.pendingVNodeUpdate=null)}),I(()=>{e.dirs&&Zi(e,a,r,`updated`);let t=e.props&&e.props.onVnodeUpdated;t&&si(t,r,7,[e,a]),e.iu&&e.iu()},void 0,i)}Ab(o,t,n,i),V(e.anchor,t,n);let l=e.props&&e.props.onVnodeMounted;l&&I(()=>{si(l,r,7,[e])},void 0,i)},deactivate(e,t,n){let r=Ib(e);jb(r,t,n),V(e.anchor,t),I(()=>{let t=e.props&&e.props.onVnodeUnmounted;t&&si(t,r.parent,7,[e])},void 0,n)}},Ub={get(e,t){return e.value[t]},has(e,t){return t in e.value},ownKeys(e){return Reflect.ownKeys(e.value)},getOwnPropertyDescriptor(e,t){if(t in e.value)return{enumerable:!0,configurable:!0}}},Wb=new WeakMap,Gb={get(e,t){let n=N(t)&&!Fx(t)?A_(e,t):e[t];if(M(n)){n[Os]=n;let r=Wb.get(e);r||Wb.set(e,r=new Map);let i=r.get(t);if(i&&i.slot===n)return i.wrapped;let a=e=>[As({[t]:n},t,e)];return a[Os]=n,r.set(t,{slot:n,wrapped:a}),a}return n},ownKeys(e){return Array.from(k_.ownKeys(e)).filter(e=>N(e)&&!Fx(e))},getOwnPropertyDescriptor(e,t){if(N(t)&&!Fx(t))return k_.getOwnPropertyDescriptor(e,t)}},Kb;function qb(e){let{type:t,shapeFlag:n,el:r,anchor:i}=e;if(n&64&&r&&i&&i!==r)return[r,i];if((t===Ql||t===Yl)&&i)return r&&i!==r?[r,i]:[i,i];if(n&6){let t=e.component&&e.component.subTree;if(t)return qb(t)}}function Jb(e){if(e.component&&U(e.component)){let t=e.component.block;if(t){let n=e.anchor;return n?[t,n]:t}}let t=qb(e);if(t){let e=[],n=t[0];for(;n&&(e.push(n),n!==t[1]);)n=n.nextSibling;return e}if(e.shapeFlag&6){let t=e.component&&e.component.subTree;if(t)return Jb(t)}return e.el}function Yb(e,t){if(e instanceof Node)e.parentNode===t&&H(e,t);else if(j(e))for(let n=0;n<e.length;n++)Yb(e[n],t)}function Xb(e,t,n){t.ibu=()=>{e.bu&&e.bu.forEach(e=>e())},t.iu=()=>{n(),e.u&&e.u.forEach(e=>e())}}var Zb=class{constructor(){this.nodes=Vv,this.valid=!1,this.resolved=z}};function Qb(e){let t=Yx(Vv,e);t.$key=e.key;let n=new Zb,r=()=>{t.nodes=Jb(t.vnode),n.resolved=!0};return t.isBlockValid=e=>!n.resolved||Uv(t.nodes,e),Xb(t,e,r),{frag:t,syncNodes:r}}function $b(e,t,n,r){let i=mh||n&&n.suspense,a=t;r&&(t=vu(a,r()));let{frag:o,syncNodes:s}=Qb(t),c=!1,l,u=null,d,f=(r,a)=>{a&&Ga(t,a);let s=bh(i);if(t.shapeFlag&256){let r=n.ctx;r.clearCurrent(o);let i=r.getStorageContainer();t.type.__vapor?(jb(t.component,i,s),V(t.anchor,i)):as(t,i,e,n,s)}else e.um(t,n,s,!!r);t.anchor&&r&&t.anchor.parentNode===r&&H(t.anchor,r)};if(o.hydrate=()=>{z&&(px(t,n,o.slotScopeIds),Pr(f,!0),c=!0,s())},o.insert=(r,a,p,m,h=2)=>{if(z)return;p!==void 0&&(i=p);let g=i;if(t.shapeFlag&512){t.type.__vapor?(Ab(t.component,r,a,g),V(t.anchor,r,a)):is(t,r,a,e,n,g,void 0,!1);return}{let i=L;Mu(n),c?(m&&h!==2&&Ga(t,m),e.m(t,r,a,h,n,g)):(m&&Ga(t,m),d=fo(r),e.p(null,t,r,a,n,g,d,o.slotScopeIds),Pr(f,!0),c=!0),Mu(i),l=r,u=a}s(),c&&o.u&&o.u.forEach(e=>e())},r){let f=!1;Sh(()=>{let p=vu(a,r());if(!f){f=!0;return}if(!c||!l)return;let m=t;t=p,Xb(o,t,s),o.vnode=t,o.$key=t.key;let h=L;Mu(n),e.p(m,t,l,u,n,i,d,o.slotScopeIds),Mu(h),s()})}return o.remove=f,o}function ex(e,t,n,r,i,a){let o=mh||n&&n.suspense,s=nx(t),c=s?rx(t):t,l=hu(c,r&&k({},new Proxy(r,Ih))),{frag:u,syncNodes:d}=Qb(l),f=G_?Y_(n):null;if(f&&(f.processShapeFlag(u),t.__asyncLoader)){let e=!1;Pr(()=>e=!0),t.__asyncLoader().then(()=>{e||f.cacheBlock(u)}).catch(be)}l.vi=e=>{let t=new py(s?c:{props:e.propsOptions[0],__propsOptions:e.propsOptions},r,i,n?n.appContext:void 0,a);e.props=Gn(t.props);let o=zc(),l=t=>typeof t==`string`&&Dc(e.emitsOptions,t);e.attrs=new Proxy(o,{get(e,n){if(!l(n))return t.attrs[n]},has(e,n){return!l(n)&&n in t.attrs},ownKeys(){return Reflect.ownKeys(t.attrs).filter(e=>!l(e))},getOwnPropertyDescriptor(e,n){if(!l(n)&&n in t.attrs)return{enumerable:!0,configurable:!0}}}),e.slots=t.rawSlots===O?O:new Proxy(t.rawSlots,Gb)};let p=null,m=!1,h=!1,g=!1,_=e=>{e&&!g&&(Yb(Jb(l),e),g=!0)};return u.hydrate=()=>{z&&(px(l,n,u.slotScopeIds),m=!0,d())},l.scopeId=l_()||null,l.slotScopeIds=e_,u.insert=(t,r,i,a,s=2)=>{if(z)return;i!==void 0&&(o=i);let c=o;if(l.shapeFlag&512)is(l,t,r,e,n,c,void 0,!1);else{let i=L;Mu(n),m?(a&&s!==2&&Ga(l,a),e.m(l,t,r,s,n,c)):(a&&Ga(l,a),e.mt(l,t,r,n,c,fo(t),!1),p&&to(p,null,c,l),m=!0),Mu(i)}d(),m&&u.u&&u.u.forEach(e=>e())},u.remove=(t,r)=>{if(h){r||_(t);return}p&&to(p,null,null,l,!0),r&&Ga(l,r);let i=bh(o);if(l.shapeFlag&256){f.clearCurrent(u),as(l,f.getStorageContainer(),e,n,i);return}h=!0,m=!1,e.umt(l.component,i,!!t),r||_(t)},u.setRef=(e,t,n,r)=>{let i=p;p=pu({ref:t,ref_for:n,ref_key:r},e),m&&(p?to(p,i,o,l):i&&to(i,null,null,l,!0))},u}var tx=new WeakMap;function nx(e){return!!(e.__isTeleport||e.__isSuspense)}function rx(e){let t=tx.get(e);return t||tx.set(e,t=(t,{slots:n})=>hu(e,t,n)),t}function ix(e){return!!js(e.type===Yl&&j(e.children)?e.children:[e])}function ax(e){return e.type===$l||e.type===Yl&&j(e.children)&&e.children.every(e=>lu(e)&&ax(e))}function ox(e,t,n){if(e.type!==Yl||!j(e.children))return!1;let r=e.children,i=B(R,`]`)&&B(R.previousSibling,`[`)?R:null,a=Cg()||i,o=a&&a.previousSibling;if(!n&&R===a&&o&&B(o,`[`))return e.el=o,e.anchor=a,jm(a),!0;let s=B(R,`[`),c=r.length>0,l=r.every(e=>lu(e)&&ax(e));if(!s||!n||!c||!l)return!1;let u=R,d=Vm(u);return!d||u.nextSibling!==d?!1:(e.el=u,Tg(()=>{r.forEach(e=>{px(e,t)})}),e.anchor=d,R===d&&jm(d),!0)}function sx(e,t,n){let r=e=>{n&&(e.ibu=n),e.iu=t,e.type===Yl&&j(e.children)&&e.children.forEach(e=>{lu(e)&&r(e)})};r(e)}function cx(e,t){return k({boundary:e,activeFallback:null,fallbackInserted:!1,pendingRecheck:!1,pendingRecheckForce:!1,isReconciling:!1},t)}function lx(e,t){Object.defineProperty(e,"$transition",{enumerable:!0,configurable:!0,get(){let e=t.$transition;return e&&Fb(e)?e:void 0},set(e){t.$transition=e}})}function ux(e,t,n,r,i,a=O){let{fallback:o,flags:s=0,adoptAnchor:c}=a,l=!!(s&2),u=!!(s&8),d=At(s),f=jt(s),p=Mt(s),m=mh||i.suspense,h=Yx(Vv,null,128),g=h.slotBoundary,_=new Zb,v=jr(),y,b=null,x=!1,S=null,C,w=null,T,E=!1,ee,te,ne=!1,D;h.isBlockValid=e=>_.resolved?D.activeFallback?Uv(D.activeFallback,e):_.valid:!0;let re=bv(h,f?g:null,()=>y,e=>ov(D,e),[ae]),ie=d||o?re:null;return D=cx(re,{getContent:()=>_.nodes,getParentNode:()=>S,getAnchor:()=>w,isBusy:()=>!1,isDisposed:()=>E,isContentValid:()=>_.valid,syncNodes:()=>{h.nodes=av(D)},notifyExposedValidityChange:()=>{p&&!ne&&g&&g.markDirty()}}),lx(D,h),u&&g&&Vh(g,oe,h),p&&Bh(h,u?void 0:ae),y=o?l?()=>C_(()=>o(e,i)):()=>o(e,i):void 0,h.insert=(t,n,r)=>{if(z)return;r!==void 0&&(m=r),y&&!f&&!h.anchor&&(h.anchor=Ev(c,void 0),h.anchor!==c&&t.insertBefore(h.anchor,n),n=h.anchor);let a=!!T;S=t,w=n,x?(a?(V(h.nodes,t,n,m),T=void 0,D.activeFallback&&(D.fallbackInserted=!0)):lu(b)?e.m(b,t,n,2,i,m):b&&V(b,t,n,m),a||dv(D)):(C=fo(t),v.run(me),x=!0),se()},h.remove=e=>{let t=T;e&&!t&&(S=e),v.stop(),E=!0;let n=te&&te.leavingElement;te=void 0;let r=n&&n[Ta];if(r&&r(!0),b&&fe(b,t||e),mv(D),t){let e=h.anchor;e&&e.parentNode===t&&(h.anchor=void 0),T=void 0}},h.hydrate=()=>{if(!z)return;let e=R&&R.parentNode;if(v.run(me),S||=(w=Cg()||R,w.parentNode),C=fo(e||S),_.valid&&y&&!f&&!h.anchor){let e=Qm(Up());Ig(S,w,e),h.anchor=w=e}x=!0},h;function ae(){let t=ee;if(t){ee=void 0;let n=D.$transition,r=D.activeFallback;n&&Ha(t,r&&Wv(r)?n:void 0,n.props,n.state,n.instance,be),e.um(t,i,bh(m),!0);return}S&&Yb(_.nodes,S)}function oe(){if(!S||T)return;sv(D);let e=document.createDocumentFragment(),t=h.anchor;(!t||t.parentNode!==S)&&(t=Up()),e.appendChild(t),V(h.nodes,e,t,m),T=e,S=e,w=t}function se(){wx(i),x&&h.u&&h.u.forEach(e=>e())}function ce(){x&&h.bu&&h.bu.forEach(e=>e())}function le(e=!1){ne=!0;try{hv(D,e)}finally{ne=!1}}function ue(e=!1){le(e),se()}function de(t,n,r,a){xe(n),sx(n,()=>{let e=_.valid,t=h.nodes;Se(n),le(),(_.valid!==e||!Ox(t,h.nodes))&&se()},ce),e.p(t,n,S,w,i,m,C,Vx(h.slotScopeIds,r)),Se(n,a),ue()}function fe(t,n){let r=!!D.activeFallback;lu(t)?e.um(t,i,bh(m),!r&&!!n):H(t,r?void 0:n)}function pe(){Ti(()=>{let e=te;if(te=void 0,!e||E||!S)return;let t=e.content;if(lu(t)){let n=Lb(h,t,d,void 0,be)||t;de(e.placeholder,n,t.slotScopeIds,e.contentValid)}else xe(null),e.placeholder&&fe(e.placeholder,S),t&&V(t,S,w,m),Se(t||null,e.contentValid),ue()})}function me(){let e=L;Mu(h.renderInstance);try{l?he():Sh(he)}finally{Mu(e)}}function he(){ce(),xv(h,()=>zh(ie,()=>{let{content:e,valid:t}=ge();if(z){we(e,t);return}if(te){te.content=e,te.contentValid=t;return}if(lu(e)){_e(e,t);return}if(e){ve(e,t);return}ye()}))}function ge(){let e,i=!1;if(t.value){let a=()=>As(t.value,M(n)?n():n,r);if(e=l?C_(a):a(),lu(e)){if(e.type===Yl){let t=e.children;Ms(t,y),i=ix(e)}else i=!0}else e&&(i=Wv(e))}return{content:e,valid:i}}function _e(e,t){let n=b,r=D.$transition,i=r&&r.props.mode,a;if(D.activeFallback&&!t){ye();return}if(D.activeFallback&&t&&r){if(i===`out-in`){let t=D.activeFallback,n=t&&ub(t);if(te={content:e,placeholder:null,contentValid:!0,leavingElement:n&&vb(n)},lv(D,r,pe))return;te=void 0}else if(i===`in-out`){let e=k({},r);delete e.delayedLeave,lv(D,e,be),a=e}}let o=lu(n),s=o&&(!D.activeFallback||_.valid)?n:null;if(s&&!t&&r&&Hh(re)){if(i===`out-in`){let t=Lb(h,e,d,void 0,be)||Su();if(Ha(s,void 0,r.props,r.state,r.instance,pe)){Ce(s,t,e,!1);return}}else if(i===`in-out`){ee=s,xe(null),Se(null),ue();return}}let c=Lb(h,e,d,s||void 0,pe,a),l=c||e;if(s&&c&&r&&r.state.isLeaving){Ce(s,l,e,t);return}n&&!o&&fe(n,S),de(s,l,e.slotScopeIds,t)}function ve(e,t){xe(null);let n=b;n&&fe(n,S),V(e,S,w,m),Se(e,t),ue()}function ye(){b&&fe(b,S),xe(null),Se(null),ue()}function xe(e){h.vnode=e,h.$key=e?zb(e):void 0}function Se(e,t){b=e,lu(e)?(_.nodes=Jb(e),_.valid=t===void 0?ix(e):t):e?(_.nodes=e,_.valid=t===void 0?Wv(e):t):(_.nodes=Vv,_.valid=!1),_.resolved=!0}function Ce(t,n,r,a){te={content:r,placeholder:n,contentValid:a,leavingElement:Bb(t)},xe(n),b=n,e.p(t,n,S,w,i,m,C,null)}function we(t,n){if(!z)return;n&&Fg()&&Pg();let r=R,a=Bm(r),o=Cg(),s=a&&a!==o?a:null,c=u&&!n&&Fg(),l=!(f||n||c||!y||!s),p=!c&&t&&(n||!Hh(re))?t:void 0;if(lu(p)){let t=Lb(h,p,d,void 0,be)||p;xe(t),sx(t,()=>{h.nodes=Jb(t),se()},ce);let r=Kp(R);ox(t,i,n)||px(t,i,Vx(h.slotScopeIds,t===p?null:p.slotScopeIds)),S=r,w=e.n(t),Se(t,n)}else p?(xe(null),Se(p,n)):(xe(null),Se(null));c&&y&&s?Eg(()=>ue(!0)):l?(Tg(()=>ue(!0)),h.anchor=w=Zm(s),S=s.parentNode,jm(s)):ue(!0);let m=Wv(h.nodes);if(c&&m&&s&&(h.anchor=w=Zm(s),S=s.parentNode),u&&m&&s&&R===s)jm(s);else if(c&&!m){s&&R===s&&jm(s);let e=Qm(Up()),t=document.createDocumentFragment();t.appendChild(e),S=t,w=e,kg(o);let n=Og(r,o,e,s,e=>(h.anchor=w=Zm(e),R===r&&jm(e),w),()=>h.nodes,e=>{S=e});Dg({onContent:()=>{n(),s||Ti(()=>{E||(h.anchor=e)})},onFallback:()=>{h.anchor=e}})||Ti(()=>{n(),!E&&!s&&(h.anchor=e)})}}}function dx(e){return U(e)?Yo(e)||dx(e.block):j(e)?e.some(dx):kv(e)?dx(e.nodes):!1}var fx=e=>{gh(),sh(),m_(Hx),e._context.vapor=Hb;let t=Dp().internals;e._context.vdom={mount:ex.bind(null,t),slot:ux.bind(null,t),mountVNode:$b.bind(null,t)};let n=e.mount;e.mount=((...e)=>(gg(),n(...e)))};function px(e,t,n=null){let r=R;Kb||=Op().hydrateNode;let i=Kb(r,e,t,null,n,!1);i?Am(i):jm(r)}function mx(e,t,n){let r=Dp().internals;return()=>{if(n()){let n=Dx(r,()=>{let t=e();return t==null?Nb:Px(t)},t);return z&&n.hydrate&&n.hydrate(),n}return e()}}var hx=()=>Nb;function gx(e){let t=e.vs,n=t.state;return n||(n={localFallback:ir(t.fallback),outletFallback:ir(t.outletFallback)},t.state=n),n}function _x(e,t){let n=e.vs.state;n&&(t.vs.state=n,n.localFallback.value=t.vs.fallback,n.outletFallback.value=t.vs.outletFallback)}function vx(e,t,n){if(!e)return;let r,i,a=!1;e.run(()=>{Sh(()=>{let e=t.localFallback.value,o=t.outletFallback.value;if(!a){r=e,i=o,a=!0;return}(r!==e||i!==o)&&(r=e,i=o,n())},!0)})}function yx(e,t,n,r){let i=L,a=null;Mu(t),ph&&n&&(a=_h(n));try{if(!e.vs||!e.vs.slot)return Vv;let n=gx(e),i=Yx(Vv,null,128);i.slotScopeIds=Wx(e,t,r);let a=new Zb;i.isBlockValid=e=>!a.resolved||Uv(i.nodes,e);let o=i.slotBoundary,s=!1,c,l,u=null,d=null,f,p=!1,m,h,g=!1,_=!1,v=[()=>{u&&Yb(a.nodes,u)}],y=e=>{let t=h;if(!t){ov(m,e);return}_||=!!e,!g&&(g=!0,Ti(()=>{g=!1;let e=_;_=!1,ov(t,e)}))},b=bv(i,bv(i,o,()=>n.outletFallback.value?l:void 0,y),()=>n.localFallback.value?c:void 0,y,v);m=cx(b,{getContent:()=>a.nodes,getParentNode:()=>u,getAnchor:()=>d,isBusy:()=>s,isDisposed:()=>p,isContentValid:()=>Wv(a.nodes),syncNodes:()=>{i.nodes=av(m),a.resolved=!0},notifyExposedValidityChange:()=>{o&&o.markDirty()}});let x=()=>{let e=m.pendingRecheckForce;return m.pendingRecheck=!1,m.pendingRecheckForce=!1,e},S=e=>{p||(e&&(u=e),p=!0,mv(m),f=void 0,u=null,d=null)};try{c=mx(()=>(n.localFallback.value||hx)(),t,()=>!!n.localFallback.value&&!!n.localFallback.value[ks]),l=mx(()=>(n.outletFallback.value||hx)(),t,()=>!!n.outletFallback.value&&!!n.outletFallback.value[ks]);let r=!!n.localFallback.value||!!n.outletFallback.value;m.pendingRecheck=!1,m.pendingRecheckForce=!1;let o=Mg,g=e=>r&&Iv(e)?(o.finish(!0),e):(a.nodes=e||Vv,o.finish(Wv(a.nodes)),hv(m,x()),e),_;s=!0;try{_=z?Tg(()=>{o=Ng(Hh(b),R);try{return g(xv(i,()=>zh(b,()=>xx(e))))}finally{o.settle()}}):g(xv(i,()=>zh(b,()=>xx(e))))}finally{s=!1}let v=e.vs.scope;return v&&f!==v&&!p&&(f=v,v.run(()=>{Pr(()=>S(),!0)})),r&&Iv(_)?(h=_,vx(e.vs.scope,n,()=>y()),S(),_):(m.pendingRecheck=!1,m.pendingRecheckForce=!1,i.insert=(e,t,n)=>{u=e,d=t,m.activeFallback?dv(m):V(i.nodes,e,t,n)},i.remove=e=>{m.activeFallback||H(i.nodes,e),S(e)},vx(e.vs.scope,n,()=>{hv(m,!0)}),z&&R&&(d=R,u=d.parentNode),i)}catch(t){throw S(),bx(e),t}}finally{ph&&n&&_h(a),Mu(i)}}function bx(e){e.vs&&e.vs.scope&&(e.vs.scope.stop(),e.vs.scope=void 0)}function xx(e){let t=e.vs.ref=ir(e.props),n=jr();e.vs.scope=n;try{return n.run(()=>e.vs.slot(new Proxy(t,Ub)))}catch(t){throw e.vs.scope=void 0,n.stop(),t}}function Sx(e){return xy(e,{onDynamicFragment:t=>zx(e,t)})}function Cx(e,t){let n=Sx(t);n?e.el=n:(e.el=e.anchor,e.dirs=null)}function wx(e){let t=Tx.get(e);t&&Cx(t.vnode,e)}var Tx=new WeakMap;function Ex(e,t){let n=Tx.get(e);return n?n.vnode=t:(n={vnode:t,pendingVNodeUpdate:null},Tx.set(e,n),(e.bu||=[]).push(()=>{if(n.pendingVNodeUpdate)return;let t=n.vnode.props&&n.vnode.props.onVnodeBeforeUpdate;t&&si(t,e.parent,7,[n.vnode,n.vnode]),n.vnode.ibu&&n.vnode.ibu()}),(e.u||=[]).unshift(()=>wx(e)),e.u.push(()=>{if(n.pendingVNodeUpdate){n.pendingVNodeUpdate=null;return}let t=n.vnode.props&&n.vnode.props.onVnodeUpdated;t&&si(t,e.parent,7,[n.vnode,n.vnode]),n.vnode.iu&&n.vnode.iu()})),n}function Dx(e,t,n){let r=mh||n&&n.suspense,i=Yx(),a=new Zb;i.isBlockValid=()=>!a.resolved||a.valid;let o=null,s=Nb,c=null,l,u=null,d=!1,f=!1,p=jr(),m=()=>{c&&Yb(i.nodes,c)};i.slotBoundary&&Vh(i.slotBoundary,m,i);let h=(e=s)=>{let t=!a.resolved||a.valid;return a.valid=!!js(e),e.length===0?i.nodes=Vv:e.length===1?i.nodes=Jb(e[0]):i.nodes=e.map(Jb),a.resolved=!0,t!==a.valid},g=(e=s)=>{let t=h(e);return!a.valid&&i.slotBoundary&&(m(),o=null,s=Nb),t},_=(e=!1)=>{e&&i.slotBoundary&&i.slotBoundary.markDirty(),d&&i.u&&i.u.forEach(e=>e())},v=()=>{d&&i.bu&&i.bu.forEach(e=>e())},y=()=>{let f=L;Mu(n);try{Sh(()=>{xv(i,()=>{let f=t();if(v(),z)f.forEach(e=>px(e,n,i.slotScopeIds)),s=f,o=hu(Yl,null,f),c=R.parentNode,l=fo(c),u=R,i.slotBoundary&&u&&$m(u)&&u!==Cg()&&u.nextSibling&&(u=u.nextSibling);else if(!d){s=f,o=hu(Yl,null,f);let e=a.resolved,t=h(f);e&&_(t);return}else if(!o)s=f,o=hu(Yl,null,f),sx(o,()=>{_(g(f))},v),f.length&&e.mc(f,c,u,n,r,l,i.slotScopeIds,!1);else{let t=hu(Yl,null,f);sx(t,()=>{_(g(f))},v),e.pc(o,t,c,u,n,r,l,i.slotScopeIds,!1),s=f,o=t}let p=g();z?d&&i.u&&i.u.forEach(e=>e()):_(p)})})}finally{Mu(f)}},b=()=>{f||(f=!0,p.run(y))};return z||b(),i.insert=(t,a,f)=>{z||(f!==void 0&&(r=f),c=t,u=a,d?s.forEach(i=>{e.m(i,t,a,2,n,r)}):(l=fo(t),b(),o&&sx(o,()=>{_(g(s))},v),s.length&&e.mc(s,c,u,n,r,l,i.slotScopeIds,!1),h(),d=!0))},i.remove=t=>{p.stop();let i=bh(r);s.forEach(r=>{e.um(r,n,i,!!t)})},i.hydrate=()=>{z&&(b(),d=!0)},i}function Ox(e,t){return e===t||j(e)&&j(t)&&e.length===t.length&&e.every((e,n)=>e===t[n])}function kx(e){if(e==null)return O;if(!Me(e)||j(e)||lu(e))return Nx(e);let t=zc();for(let n in e){if(Fx(n))continue;let r=e[n];M(r)?t[n]=r[Os]||r._n?r:jx(r,e._ctx):r!=null&&(t[n]=()=>Px(r))}return[`_`,`_ctx`,`$stable`].forEach(n=>{let r=Object.getOwnPropertyDescriptor(e,n);r&&Object.defineProperty(t,n,r)}),t}var Ax=new WeakMap;function jx(e,t){let n=Ax.get(e);if(n||Ax.set(e,n={}),t){let r=n.ctx;r||(n.ctx=r=new WeakMap);let i=r.get(t);if(i)return i;let a=Mx(e,t);return r.set(t,a),a}return n.noCtx?n.noCtx:n.noCtx=Mx(e,t)}function Mx(e,t){let n=Yi((...t)=>Px(e(...t)),t);return n._c=!1,n}function Nx(e){let t=zc(),n=Px(e);return t.default=()=>n,t}function Px(e){return j(e)?e.map(e=>Cu(e)):[Cu(e)]}var Fx=e=>e===`_`||e===`_ctx`||e===`$stable`||e===`$`,Ix={get(e,t){let n=e.value;return n&&n[t]},has(e,t){let n=e.value;return!!n&&t in n},ownKeys(e){let t=e.value;return t?Object.keys(t).filter(e=>!Fx(e)):ye},getOwnPropertyDescriptor(e,t){let n=e.value,r=n&&Object.getOwnPropertyDescriptor(n,t);if(r&&r.enumerable&&!Fx(t))return{enumerable:!0,configurable:!0,value:r.value}}};function Lx(e){return{$:[new Proxy(e,Ix)],[lh]:e}}var Rx=new WeakMap;function zx(e,t){Rx.get(t)!==e&&(Rx.set(t,e),(t.u||=[]).push(()=>wx(e)))}function Bx(e,t){e.scopeId=t.scopeId;let n=Pl(t,e.parent);e.slotScopeIds=Vx(t.slotScopeIds,n.length?n:null)}function Vx(e,t){return e?t&&t.length&&t!==e?e.concat(t):e:t||null}function Hx(e,t){let n=t;xy(e,{onComponent:e=>{n=__(e)||[]},onInteropFragment:e=>{Ux(e.vnode,n)},excludeSlotOutlets:!0})}function Ux(e,t){e.vaporScopeIds=t,e.ssContent&&Ux(e.ssContent,t),e.ssFallback&&Ux(e.ssFallback,t)}function Wx(e,t,n){let r=Pl(e,t,!1);return Vx(Vx(n,e.slotScopeIds),r.length?r:null)}function Gx(){return!!this.vnode}function Kx(e){this.vnode&&(this.vnode.key=e)}function qx(){return this.vnode?Rb(this.vnode):void 0}function Jx(){return this.vnode?Bb(this.vnode):void 0}function Yx(e=Vv,t=null,n=0){let r=new vv(e,64|n);return r.vnode=t,r.hasVDOMContent=Gx,r.setKey=Kx,r.getTransitionType=qx,r.getTransitionElement=Jx,r}var Xx={name:`VaporTeleport`,__isTeleport:!0,__vapor:!0,process(e,t,n){return new Zx(e,t,n)}},Zx=class extends vv{constructor(e,t,n){super([],32),this.childrenInitialized=!1,this.childrenScope=Mr(),this.mountState={location:0},this.insert=(e,t,n)=>{if(z)return;n!==void 0&&(this.parentSuspense=n);let r=this.mountState.location===2;this.placeholder||=Up(),V(this.placeholder,e,t),V(this.anchor,e,t),r||this.handlePropsUpdate()},this.dispose=()=>{let e=this.scope;e&&(this.scope=void 0,e.stop());let t=this.mountState;this.nodes&&t.location===1&&(H(this.nodes,t.container),this.nodes=[]),this.disposeTarget(),this.mountState={location:0}},this.remove=e=>{this.dispose(),this.anchor&&=(H(this.anchor,Kp(this.anchor)),void 0),this.placeholder&&=(H(this.placeholder,Kp(this.placeholder)),void 0)},this.hydrate=()=>{if(!z)return;let e=this.target=va(this.resolvedProps,Gp),t=ma(this.resolvedProps);if(this.placeholder=R,e){let n=e._lpa||e.firstChild;t?this.hydrateDisabledTeleport(e,n):(this.anchor=Zm($x(R.nextSibling)),this.hydrateTargetAnchors(e,n),this.mountState={location:2,container:e,anchor:this.targetAnchor||null},n&&Am(n.nextSibling),this.targetAnchor?this.initChildren():this.mountChildren(e))}else t?this.hydrateDisabledTeleport(null,null):this.anchor=Zm($x(R.nextSibling));(e||t)&&this.updateCssVars(),jm(this.anchor)},this.rawSlots=t,this.anchor=z?void 0:Ev(n,`teleport end`);let r=new Proxy(e,Ih);Sh(()=>{let e=this.resolvedProps&&this.resolvedProps.to,t=this.isDisabled;this.resolvedProps=k({},r),this.isDisabled=ma(this.resolvedProps),(t!==this.isDisabled||!this.isDisabled&&e!==this.resolvedProps.to)&&this.handlePropsUpdate()})}get parent(){return this.anchor?Kp(this.anchor):null}get scopeOwner(){return this.slotOwner||this.renderInstance}initChildren(){let e=Nu(this.renderInstance,this.childrenScope);try{this.childrenInitialized=!0,Sh(()=>xv(this,()=>{let e=this.scope;e&&e.stop();let t=this.scope=new Ar;this.handleChildrenUpdate(t.run(()=>this.rawSlots&&this.rawSlots.default?this.rawSlots.default():[])||[])})),this.bindChildren(this.nodes)}finally{Pu(e)}}ensureChildrenInitialized(){this.childrenInitialized||this.initChildren()}registerUpdateCssVars(e){kv(e)?((e.u||=[]).push(()=>this.updateCssVars()),this.registerUpdateCssVars(e.nodes)):U(e)?this.registerUpdateCssVars(e.block):j(e)&&e.forEach(e=>this.registerUpdateCssVars(e))}bindChildren(e){let t=this.scopeOwner;t&&t.ut&&this.registerUpdateCssVars(e)}handleChildrenUpdate(e){let t=this.mountState;if(z||!this.parent||t.location===0){this.nodes=e;return}H(this.nodes,t.container),this.nodes=e,V(e,t.container,t.anchor),this.bindChildren(this.nodes),this.updateCssVars()}mount(e,t,n){V_&&this.$transition&&this.mountState.location===0&&L_(this.nodes,this.$transition),this.mountState.location===0?V(this.nodes,e,t):Jv(this.nodes,e,t,2),this.mountState={location:n,container:e,anchor:t},this.updateCssVars()}prepareTargetAnchors(e){(!this.targetAnchor||Kp(this.targetAnchor)!==e)&&(this.targetStart&&H(this.targetStart,Kp(this.targetStart)),this.targetAnchor&&H(this.targetAnchor,Kp(this.targetAnchor)),V(this.targetStart=Up(``),e),V(this.targetAnchor=Up(``),e))}prepareTarget(){let e=this.target=va(this.resolvedProps,Gp);return e&&this.prepareTargetAnchors(e),e}queueTargetUpdate(){(!this.mountToTargetJob||this.mountToTargetJob.flags&4)&&(this.mountToTargetJob=()=>{this.mountToTargetJob=void 0,this.anchor&&(this.isDisabled?this.targetAnchor||this.prepareTarget():this.mountToTarget())}),I(this.mountToTargetJob,void 0,this.parentSuspense===void 0?ph&&this.renderSuspense||null:this.parentSuspense)}mountToTarget(){let e=this.prepareTarget();e&&(this.ensureChildrenInitialized(),this.mount(e,this.targetAnchor,2),this.cancelMountToTarget())}handlePropsUpdate(){this.parent&&!z&&(this.isDisabled?(this.ensureChildrenInitialized(),this.mount(this.parent,this.anchor,1),this.targetAnchor||(ha(this.resolvedProps)||!this.parent.isConnected?this.queueTargetUpdate():this.prepareTarget())):ha(this.resolvedProps)||!this.parent.isConnected?this.queueTargetUpdate():this.mountToTarget())}cancelMountToTarget(){this.mountToTargetJob&&=(this.mountToTargetJob.flags|=4,void 0)}disposeTarget(){this.cancelMountToTarget();let e=this.mountState;if(this.nodes&&e.location===2){let e=this.targetStart&&Kp(this.targetStart)||this.targetAnchor&&Kp(this.targetAnchor)||void 0;H(this.nodes,e),this.nodes=[],this.mountState={location:0}}this.targetStart&&=(H(this.targetStart,Kp(this.targetStart)),void 0),this.targetAnchor&&=(H(this.targetAnchor,Kp(this.targetAnchor)),void 0),this.target=void 0}scheduleTargetDispose(){this.cancelMountToTarget(),Ti(()=>this.disposeTarget())}hydrateTargetAnchors(e,t){if(!z)return;let n=t;for(;n;){if(n.nodeType===8){if(n.data===`teleport start anchor`)this.targetStart=n;else if(n.data===`teleport anchor`){this.targetAnchor=Zm(n),e._lpa=this.targetAnchor.nextSibling;break}}n=n.nextSibling}}hydrateDisabledTeleport(e,t){if(!z)return;let n=this.placeholder.nextSibling;Am(n),this.anchor=Zm($x(n)),this.mountState={location:1,container:Kp(this.anchor),anchor:this.anchor},e?this.hydrateTargetAnchors(e,t):(this.targetStart=t,this.targetAnchor=t&&t.nextSibling),this.initChildren()}mountChildren(e){z&&(e.appendChild(this.targetStart=Up(``)),e.appendChild(this.targetAnchor=Zm(Up(``))),this.mountState={location:2,container:e,anchor:this.targetAnchor},ko(e,1)||co(),um(this.initChildren.bind(this)))}updateCssVars(){let e=this.scopeOwner;if(e&&e.ut){let t,n;if(this.mountState.location===1)t=this.placeholder,n=this.anchor;else if(this.mountState.location===2)t=this.targetStart,n=this.targetAnchor;else return;for(;t&&t!==n;)t.nodeType===1&&t.setAttribute(`data-v-owner`,String(e.uid)),t=t.nextSibling;wr();try{e.ut()}finally{Tr()}}}},Qx=Rv(Xx);function $x(e=R){let t=0;for(;e;){if(B(e,`teleport start`))t++;else if(B(e,`teleport end`)){if(t===0)return e;t--}e=e.nextSibling}return null}var eS=new WeakMap;function tS(e,t,n,r){let i=Vy(e,t);Le(i)&&(i=k({},i,t));class a extends rS{constructor(e){super(i,e,n)}}return a.def=i,r&&eS.set(a,r),a}var nS=((e,t)=>tS(e,t,By,pm)),rS=class extends Mf{constructor(e,t={},n=zy){super(e,Gn(t),n)}_needsHydration(){let e=eS.get(this.constructor);return!!(this.shadowRoot&&e)}_mount(e){this._app=this._createApp(this._def),this._inheritParentContext(),this._def.configureApp&&this._def.configureApp(this._app);let t=eS.get(this.constructor);this.shadowRoot&&t?t(this._root,this._createComponent.bind(this)):this._createComponent(),this._app.mount(this._root)}_update(){}_unmount(){this._app&&this._app.unmount(),this._instance&&this._instance.ce&&(this._instance.ce=void 0),this._app=this._instance=null}_createComponent(){iy(this._def,this._props,this.shadowRoot?void 0:this._createSlots(),void 0,void 0,this._app._context,!1,e=>{this._app._ceComponent=this._instance=e,this._processInstance()})}_createSlots(){let e=this._slots;if(!e)return;let t=this._def.__scopeId,n;for(let r in e){let i=e[r];if(t){let e=t+`-s`;for(let t of i)if(t.nodeType===1){t.setAttribute(e,``);let n=document.createTreeWalker(t,1),r;for(;r=n.nextNode();)r.setAttribute(e,``)}}(n||={})[r]=()=>i}return n}};function iS(e,t,n,r=1){let i=Lp,a=Rp;z||Vp();let o=null,s,c,l;if(r&16){let i=e();z&&(s=aS(r,i),o=Nm(s===2?Dm():void 0)),l=i?t():n?n():[Qm(Up())]}else{let i=r>>8,u=i>0,d=u?(i-1)*2:0,f=!!(r&128),p=new wv(256,void 0,u,!1,f,f?()=>{let e=p.anchor,t=e.parentNode;t&&Xv(e,t)}:void 0,a);c=p.anchor,l=p,Sh(()=>{let i=e();z&&(s=aS(r,i),p.hydrationClaim=s===2?Dm():void 0,o=Nm(p.hydrationClaim)),p.update(i?t:n,u?d+ +!i:void 0,oS(r,i))})}if(z&&s===0&&o){let e=o.start;e&&R===e&&B(e,``)&&jm(e)}return Ov(l,c,o,i,a),l}function aS(e,t){return e>>(t?0:2)&3}function oS(e,t){return!!(e&(t?32:64))}function sS(e,t,n=!1){let r=Lp,i=Rp;z||Vp();let a=z?Pm():null,o=new wv(0,void 0,!0,!0,n,n?()=>{let e=o.anchor.parentNode;e&&Xv(o.anchor,e)}:void 0,i);return Sh(()=>o.update(t,e())),Ov(o,o.anchor,a,r,i),o}var cS=(e,t,n,r=0)=>{let i=Lp,a=Rp,o=zp,s=null,c;z?(c=Dm(),s=Nm(c)):Vp();let l=!1,u=[],d,f,p,m,h=!1;z||(m=Ev(a,`for`),m===a&&(p=m.parentNode));let g=!!(r&32),_=new Sv(u,g,g?()=>{let e=m.parentNode;e&&Xv(m,e)}:void 0),v=!!(r&2),y=!!(r&1)&&!v,b=!!(r&8),x=!!(r&16),S=!!(r&64),C=M_,w=Lh,T=e_;Pr(()=>{dS(u),d&&d!==u&&dS(d),u=[],d=[]},!0);let E=()=>{let t=mS(e()),r=t.keys,i=t.values.length,a=u.length;if(d=Array(i),f=void 0,n){f=Array(i);for(let e=0;e<i;e++){let i=hS(t,e);f[e]=r?n(i,r[e],e):n(i,e,void 0)}}let o=P(),s=l;if(s&&_.bu)for(let e=0;e<_.bu.length;e++)_.bu[e]();if(!s)l=!0,z?oe(t,i):ie(t,i);else if(p=m.parentNode,!a)ie(t,i);else if(!i){if(_.resetListeners)for(let e of _.resetListeners)e();let e=!y;for(let t=0;t<a;t++)ce(u[t],e);y&&(p.textContent=``,p.appendChild(m))}else if(n){let e=Math.min(a,i),n=0;for(;n<e;){let e=i-n-1,r=f[e],o=u[a-n-1];if(o.key!==r)break;ae(o,t,e),d[e]=o,n++}let r=e-n,o=a-n,s=i-n,c=[],l=new Map;for(let e=0;e<r;e++){let n=f[e],r=u[e];r.key===n?ae(d[e]=r,t,e):(c.push(e),l.set(r.key,e))}for(let e=r;e<o;e++)l.set(u[e].key,e);for(let e=r;e<s;e++)c.push(e);let h=c.length,g=ye,v=0;if(l.size===0)v=h;else{g=Array(h);for(let e=h-1;e>=0;e--){let n=c[e],r=f[n],i=l.get(r);if(i!==void 0){l.delete(r);let a=d[n]=u[i];ae(a,t,n),g[e]=i+1}else g[e]=0,v++}}let b=v===i;if(b&&_.resetListeners)for(let e of _.resetListeners)e();if(l.size)for(let e of l.values())ce(u[e],!(b&&y));b&&y&&(p.textContent=``,p.appendChild(m));let x,S=v!==h;S&&(x=uS(c,g,o,s),h=c.length);let C=S&&x===void 0,w=x?x.length-1:-1,T=i,E;for(let e=h-1;e>=0;e--){let n=c[e],r=C&&g[e]!==0;if(w>=0&&x[w]===e&&(w--,r=g[e]!==0),r)continue;let i;for(let e=n+1;e<T;e++){let t=Qv(d[e].nodes);if(t&&t.parentNode===p){i=t;break}}i===void 0&&(E===void 0&&(E=m),i=E),T=n+1,E=i;let a=d[n];a===void 0?re(t,n,i):Jv(a.nodes,p,i,2)}}else{let e=Math.min(i,a);for(let n=0;n<e;n++)ae(d[n]=u[n],t,n);for(let e=a;e<i;e++)re(t,e,m);for(let e=i;e<a;e++)ce(u[e])}if(u=d,_.nodes=m?[d,m]:[d],s&&_.u)for(let e of _.u)e();P(o)},ee=t.length>1,te=t.length>2,ne=b?(e,t)=>Gv(e.nodes,p,t):x?(e,t)=>qv(e.nodes,p,t):(e,t)=>V(e.nodes,p,t),D=b?e=>Xv(e.nodes,p):x?e=>Zv(e.nodes,p):e=>H(e.nodes,p),re=(e,n,r)=>{let i=e.keys,a=ir(hS(e,n)),o=ee?ir(i?i[n]:n):void 0,s=te?ir(i?n:void 0):void 0,c,l=new Ar(!0),u=Nr(l),m=!1;try{c=t(a,o,s),m=!0}finally{Nr(u),m||l.stop()}let h=d[n]=new Cv(c,l,a,o,s,f?f[n]:void 0);return V_&&_.$transition&&(_.$transition.applyGroup&&Z_(h.nodes,h.key),L_(h.nodes,_.$transition)),p&&ne(h,r),h},ie=(e,t)=>{for(let n=0;n<t;n++)re(e,n,m)},ae=(e,t,n)=>{let r=t.keys;se(e,hS(t,n),r?r[n]:n,r?n:void 0)};function oe(e,t){let n=R,r=c,s,l=Cg(),u=Fg()&&l,f=e=>{m=Zm(e),s=ih(m)};try{for(let n=0;n<t;n++){let t=R,r=null;B(t,`]`)?r=Zm(t):S&&B(t,`[`)&&(r=Lm(t),Am(t.nextSibling)),re(e,n,m),r&&Am(r)}if(r.start){if(f(Hm(r.start)),i){let e=a?a.$idx:o||0;e!==void 0&&(m.$idx=e,i.$llc=m)}}else if(u&&!Wv(d)){let e=R===n?n===l?l:n.nextSibling:R;m=Qm(Up());let t=m;h=!0,(R===n||R===l)&&Am(n);let r=()=>{let n=e.parentNode;n&&n.insertBefore(t,e)};Dg({onContent:()=>Ti(r),onFallback:()=>{}})||Ti(r)}else if(Cm){let e=R;!t&&e&&B(e,``)?m=Zm(e):(m=Zm(Up()),Cm.insertBefore(m,e&&e.parentNode===Cm?e:null),h=!0)}else f(R)}finally{s&&s()}}let se=({itemRef:e,keyRef:t,indexRef:n},r,i,a)=>{r!==e.value&&(e.value=r),t&&i!==void 0&&i!==t.value&&(t.value=i),n&&a!==n.value&&(n.value=a)},ce=(e,t=!0)=>{v||e.scope.stop(),t&&D(e),v&&e.scope.stop()};return r&4?E():Sh(()=>{if(!l)return E();let e=N_(C),t=Lh!==w,n=t?Rh(w):null,r=t_(T);try{E()}finally{t_(r),t&&Rh(n),N_(e)}}),z&&!h&&R===m&&jm(m),Ov(_,m,s,i,a),_};function lS(e){let t=new Map,n=e(),r,i=n,a=!1,o=0;Gr(e,e=>{if(i=e,!a){if(a=!0,r!==void 0)for(let e of r)e();Ti(()=>{if(a=!1,n=i,r=t.get(n),r!==void 0)for(let e of r)e()})}});let s=(e,i)=>{i();let a=t.get(e);a===void 0?(a=[i],t.set(e,a),e===n&&(r=a)):a.push(i);let s=o;Pr(()=>{if(s!==o)return;let a=t.get(e);if(a!==void 0){if(a.length===1)t.delete(e),e===n&&(r=void 0);else{let e=a.indexOf(i);e!==-1&&a.splice(e,1)}}},!0)};return s.reset=()=>{t.clear(),r=void 0,o++},s}function uS(e,t,n,r){let i=e.length,a=r-e[0],o=i*2>=a,s=!1,c=0;if(o){let n=i-1;e.length=t.length=a;for(let i=a-1,o=r-1;i>=0;i--,o--)n>=0&&e[n]===o?t[i]=t[n--]:t[i]=o+1,e[i]=o;i=a;for(let e=0;e<i;e++){let n=t[e];n!==0&&(n<c?s=!0:c=n)}}else{let a=0;for(;a<i;){let o=a;for(;o+1<i&&e[o+1]===e[o]+1;)o++;let l=e[a]-1,u=e[o]+1,d=u<r?u:n;for(let e=a;e<=o;e++){let n=t[e],r=n-1;r<=l||r>=d?t[e]=0:n<c?s=!0:c=n}a=o+1}}return s?Ot(t):void 0}function dS(e){for(let t=0;t<e.length;t++){let n=e[t];if(n){let e=n.scope;e&&e.stop()}}}function fS(e,t){return Object.is(e,t)||e===0&&t===0}function pS(e,t,n,r){let i=[],a=t.length>1,o=t.length>2,s=(e,[t,n,r])=>{Object.is(e.itemRef.value,t)||(e.itemRef.value=t),e.keyRef&&!Object.is(e.keyRef.value,n)&&(e.keyRef.value=n),e.indexRef&&!Object.is(e.indexRef.value,r)&&(e.indexRef.value=r)};return()=>{let c=mS(e()),l=c.values.length,u=Array(l),d=r?Array(l):u,f=Array(l),p=l===i.length;for(let e=0;e<l;e++){let t=f[e]=gS(c,e),a=u[e]=String(n(...t)),o=d[e]=r?r(...t):a;p&&(!fS(i[e].rawIdentity,o)||i[e].name!==a)&&(p=!1)}if(p){let e=P();for(let e=l-1;e>=0;e--)s(i[e],f[e]);return P(e),i}let m=new Map;for(let e=0;e<i.length;e++)m.set(i[e].rawIdentity,i[e]);let h=Array(l),g=P();for(let e=l-1;e>=0;e--){let n=f[e],r=d[e],i=m.get(r);if(i)m.delete(r),s(i,n),i.name=u[e];else{let[s,c,l]=n,d=ir(s),f=a?ir(c):void 0,p=o?ir(l):void 0;i={rawIdentity:r,itemRef:d,keyRef:f,indexRef:p,name:u[e],fn:t(d,f,p),key:d}}h[e]=i}return P(g),i=h,h}}function mS(e){let t=e,n=!1,r=!1,i;if(j(e))Yn(e)&&(n=!Zn(e),t=un(e),r=Xn(e));else if(N(e))t=e.split(``);else if(typeof e==`number`){t=Array(e);for(let n=0;n<e;n++)t[n]=n+1}else if(Me(e)){if(e[Symbol.iterator])t=Array.from(e);else{i=Object.keys(e),t=Array(i.length);for(let n=0,r=i.length;n<r;n++)t[n]=e[i[n]]}}else t=[];return{values:t,needsWrap:n,isReadonlySource:r,keys:i}}function hS({values:e,needsWrap:t,isReadonlySource:n},r){return t?n?tr(er(e[r])):er(e[r]):e[r]}function gS(e,t){let n=hS(e,t);return e.keys?[n,e.keys[t],t]:[n,t,void 0]}function _S(e,t){let n={};for(let r of Object.keys(e))t.includes(r)||(n[r]=e[r]);return n}function vS(e,t){return e===void 0?t():e}function yS(e){if(Mv(e))return e;if(yg&&U(e)&&Uo(e))return e.block}function bS(e,t,n){let r=yS(e);return r&&t!==r?((r.u||=[]).push(()=>{U(e)&&e.isDeactivated||n()}),r):t}function xS(e){let t=yb.get(e);return t||(yb.set(e,t={fn:be}),Pr(()=>{bb(e),t.fn(),yb.delete(e)})),t}function SS(){let e=P_(),t=new WeakMap;return(n,r,i,a)=>{let o=t.get(n);o||t.set(n,o={ref:r,suspense:mh}),CS(e,n,o,r,i,a)}}function CS(e,t,n,r,i,a){n.ref=r,n.refFor=i,n.refKey=a,n.registeredFrag=bS(t,n.registeredFrag,()=>{ES(e,n.suspense,t,n.ref,n.oldRef,n.refFor,n.refKey,n.oldRefKey),n.oldRef=n.ref,n.oldRefKey=n.ref==null?void 0:n.refKey}),ES(e,n.suspense,t,r,n.oldRef,i,a,n.oldRefKey),n.oldRef=r,n.oldRefKey=r==null?void 0:a}function wS(e,t,n,r){let i=P_(),a=mh;ES(i,a,e,t,void 0,n,r),bS(e,void 0,()=>{ES(i,a,e,t,t,n,r)})}function TS(e,t,n,r){let i=P_(),a;Sh(()=>{let o=t();a||={ref:o,suspense:mh},CS(i,e,a,o,n,r)})}function ES(e,t,n,r,i,a=!1,o,s){if(!e||e.isUnmounted)return;let c=DS(n);if(oh){let t=kv(n)&&n.setRef?n:c&&kv(c)&&c.setRef?c:null;if(t){t.setRef(e,r,a,o);return}}let l=e.refs===O?e.refs={}:e.refs,u=(e,t)=>!(t&&$a(l,t));if(i!=null&&i!==r?(bb(n),N(i)?l[i]=null:nr(i)?(u(i,s)&&(i.value=null),s&&(l[s]=null)):M(i)&&Mv(n)&&oi(i,e,12,[null,l])):i!=null&&Mv(n)&&(M(i)?oi(i,e,12,[null,l]):a&&xb(n)),r!=null){if(M(r)){let t=t=>{oi(r,e,12,[t,l])};t(c),xS(n).fn=()=>t(null)}else{let e=N(r),i=nr(r),s;if(e||i){let d=()=>{if(a){if(c==null)return;s=e?l[r]:u(r)||!o?r.value:l[o],j(s)?s.includes(c)||s.push(c):(s=[c],e?l[r]=s:(u(r,o)&&(r.value=s),o&&(l[o]=s)))}else e?l[r]=c:i&&(u(r,o)&&(r.value=c),o&&(l[o]=c))},f=xS(n);if(f.fn=()=>{a?j(s)&&Te(s,c):e?l[r]=null:i&&(u(r,o)&&(r.value=null),o&&(l[o]=null))},bb(n),c!=null){let e=()=>{d(),f.job===e&&(f.job=void 0)};f.job=e,I(e,-1,t)}else d()}}}}var DS=e=>{if(U(e)){if(yg&&Uo(e)){let t=Uy(e);return t===void 0?null:DS(t)}return by(e)||e}return Lv&&Bv(e)?null:Mv(e)?j(e.nodes)?null:DS(e.nodes):e};function OS(e){let t=L;ef(t,()=>kS(t.block),e,e=>AS(t,e))}function kS(e){return e instanceof Node?e.parentNode:j(e)?kS(e[e.length-1]):U(e)?kS(e.block):kS(e.anchor||e.nodes)}function AS(e,t){e.ce?tf(e.ce,t):jS(e.block,t)}function jS(e,t){if(e instanceof Node)tf(e,t);else if(j(e))e.forEach(e=>jS(e,t));else if(U(e))jS(e.block,t);else if(Lv&&Bv(e))return;else jS(e.nodes,t)}function MS(e,t,n,r=0){let i=!!(r&1),a=!!(r&2),o=!!(r&4),s=Lp,c=Rp;z||Vp();let l=z?Pm():null,u=new wv(0,void 0,!1,!0,o,o?()=>{let e=u.nodes;if(e instanceof Node){let t=e.parentNode;t&&Xv(e,t)}let t=u.anchor.parentNode;t&&Xv(u.anchor,t)}:void 0,c),d=E_(n),f=P_(),p=()=>{let n=e(),r=L&&L.appContext||fy,o=Hv(n)||oh&&r.vdom&&lu(n)?n:NS(f,()=>Ss(n));if(o===xs){u.update(void 0,o);return}u.update(()=>{if(Hv(n))return n;if(oh&&r.vdom&&lu(n)){if(Yo(L)){q_();let e=L.ctx.getCachedComponent(n.type,n.key);if(e)return e}let e=i&&U(L)&&L.hasFallthrough&&L.type.inheritAttrs!==!1?L:void 0,t=r.vdom.mountVNode(n,L,e&&(()=>cy(e)));return z&&(xm(PS(n)?Dm():void 0),t.hydrate()),t}return hy(o,t,d,i,a,r)},n)};return a?p():Sh(p),Ov(u,u.anchor,l,s,c),u}function NS(e,t){let n=Gi(e);try{return t()}finally{Gi(n)}}function PS(e){if(e.type===Yl)return!1;if(e.shapeFlag&6){let t=e.type;return!!t.__vapor&&!t.__multiRoot}return!0}function FS(e){let t=L;if(z&&t&&t.vapor){let e=R;t.restoreAsyncContext=()=>ym(e)}return ec(e)}function IS(e,t){if(U(e))return IS(e.block,t);if(j(e)&&e.length===1)return IS(e[0],t);if(e.$vshow=!0,Mv(e))(e.bm||=[]).push(e=>LS(e,t));else if(kv(e)&&e.insert){let n=e.insert;e.insert=(...r)=>{let i=n.call(e,...r);return LS(e,t),i}}Sh(()=>RS(e,t()))}function LS(e,t){let n=P();try{RS(e,t())}finally{P(n)}}function RS(e,t,n=void 0){if(U(e))return RS(e.block,t,n);if(j(e)){if(e.length===0)return;if(e.length===1)return RS(e[0],t,n)}if(kv(e))return oh&&Av(e)&&e.$transition&&(n=e.$transition),RS(e.nodes,t,n);if(e instanceof Element){let r=e,i=!t;if(!(Kd in r)){e.$vshow=!0,r[Kd]=r.style.display===`none`?``:r.style.display,r[qd]=i,zS(r,t);return}if(r[qd]===i)return;r[qd]=i;let{$transition:a=n}=e;if(a){let n=P();try{t?(a.beforeEnter(e),r.style.display=r[Kd],a.enter(e)):e.isConnected?a.leave(e,()=>{r.style.display=`none`}):r.style.display=`none`}finally{P(n)}}else zS(r,t)}}function zS(e,t){e.style.display=t?e[Kd]:`none`}function BS(e){L.isMounted?e():us(e)}var VS=(e,t,n,{trim:r,number:i,lazy:a}={})=>{np(e,r,i,a,n),BS(()=>{let n;Sh(()=>{rp(e,n,n=t(),r,i,a)})})},HS=(e,t,n)=>{ap(e,n),BS(()=>{let n;Sh(()=>{op(e,n,Kr(n=t()))})})},US=(e,t,n)=>{e.addEventListener(`change`,()=>n(pp(e))),BS(()=>{let n;Sh(()=>{n!==(n=t())&&(e.checked=St(n,pp(e)))})})},WS=(e,t,n,r)=>{lp(e,t(),r&&r.number,n),BS(()=>{Sh(()=>dp(e,Kr(t())))})},GS=(e,t,n,r)=>{let i=VS;e.tagName===`SELECT`?i=WS:e.tagName===`TEXTAREA`?i=VS:e.type===`checkbox`?i=HS:e.type===`radio`&&(i=US),i(e,t,n,r)};function KS(e,t){if(e instanceof Element){qS(e,t);return}let n=L,r=new WeakSet,i=null,a,o=!1;function s(){a&&=(a.stop(),void 0)}function c(){if(o)return;let r=l(e),c=xy(e);if(!c&&r){i!==null&&(i=null,s());return}if(c===i||(i=c,s(),!c))return;a=new Ar(!0);let u=Nu(n,a);try{qS(c,t)}finally{Pu(u)}}function l(e){if(U(e)){if(e.asyncDep&&!e.asyncResolved)return r.has(e)||(r.add(e),ls(c,e)),!0;let t=e.block;return l(t)?!0:yg&&Uo(e)&&kv(t)&&t.nodes===Vv}if(j(e)){let t=!1;for(let n of e)l(n)&&(t=!0);return t}return kv(e)?(r.has(e)||(r.add(e),(e.u||=[]).push(c)),oh&&Av(e)&&e.nodes===Vv||l(e.nodes)):!1}Pr(()=>{o=!0,s()},!0),c()}function qS(e,t){for(let[n,r,i,a]of t)if(n){let t=n(e,r,i,a);t&&Pr(t)}}var JS=new WeakMap,YS=new WeakMap,XS=new WeakSet,ZS=(e=>(delete e.props.mode,e))(Vy({name:`VaporTransitionGroup`,props:k({},kd,{tag:String,moveClass:String}),setup(e,{slots:t,expose:n}){n(),V_||H_(ab,()=>!1,()=>!1,()=>!1);let r=L,i=Da(),a,o=new Proxy({},{get(e,t){return a[t]}}),s=[],c=!1,l=!1,u=[],d=()=>{if(c)return;c=!0,s=[];let e=QS(u,void 0,void 0,!0);for(let t=0;t<e.length;t++){let n=e[t],r=_b(n)&&n.$transition?vb(n):void 0;r&&!r[qd]&&(s.push(n),JS.set(n,r.getBoundingClientRect()))}},f=()=>{if(l=!1,!c||(c=!1,!s.length))return;let t=e.moveClass||`${e.name||`v`}-move`,n=oC(s);if(!(n&&qf(n,n.parentNode,t))){s=[];return}s.forEach(e=>{let t=vb(e);t&&Hf(t)}),s.forEach(iC);let r=s.filter(aC);Wd(n),r.forEach(e=>Jf(vb(e),t)),s=[]},p=()=>{c&&!l&&(l=!0,I(f,void 0,r.suspense))};ds(d),fs(p);let m={beforeUpdate:d,updated:p},h=new wv(0,void 0),g,_,v=!1;return Sh(()=>{a=Nd(e),v&&tC(u,o,i,r,m)},!0),Sh(()=>{let n=e.tag,a=t.default;if(v&&n===g&&a===_)return;let s=n?z?bm(R,`<${n}/>`):Hp(n):void 0,c=null,l=null,d=!1;z&&s&&(l=wm(s),d=Em(!0),c=Lm(s),Am(s.firstChild||s));let f=u,p=[];try{h.update(()=>(f=a&&a()||[],p=tC(f,o,i,r,m),s?(z||V(f,s),s):f)),z&&s&&R&&R.parentNode===s&&!p.some(e=>e===R)&&Xm(R,s)}finally{z&&s&&(wm(l),Em(d),Am(c))}u=f,g=n,_=a,v=!0}),h}}));function QS(e,t,n,r=!1){let i=[];if(r)return $S(e,i,t,n),i;let a=new Map;$S(e,i,t,n,a);for(let e=0;e<i.length;e++){let t=i[e],n=a.get(t);n===void 0?tb.delete(t):tb.set(t,n)}return i}function $S(e,t,n,r,i){if(e instanceof Node)e instanceof Element&&t.push(e);else if(U(e)){let a=e.block&&Fv(e.block);r&&!a&&r(e);let o=t.length;if($S(e.block,t,n,a?r:void 0,i),i){if(!a)for(let n=o;n<t.length;n++)Qy(t[n],e.type);eC(t,o,e.$key,i)}}else if(j(e))for(let a=0;a<e.length;a++)$S(e[a],t,n,r,i);else if(kv(e)){let a=Pv(e);if(a||(n&&n(e),r&&r(e)),oh&&e.hasVDOMContent&&e.hasVDOMContent())t.push(e);else{let o=t.length;if($S(e.nodes,t,n,r,i),i){if(a){if(t.length-o===1)t[o].$key=e.key;else if(e.key!=null)for(let n=o;n<t.length;n++)i.set(t[n],`${e.key}:${n-o}`)}else eC(t,o,e.$key,i)}}}}function eC(e,t,n,r){if(n!=null)for(let i=t;i<e.length;i++){let a=e[i],o=r.get(a),s=o===void 0?a.$key==null?i-t:a.$key:o;r.set(a,String(n)+String(s))}}function tC(e,t,n,r,i){let a=[],o=QS(e,e=>a.push(e),e=>nC(e,r,i));for(let e=0;e<o.length;e++){let i=o[e];_b(i)&&nb(i)!=null&&(i.$transition=ib(i,t,n,r))}return a.forEach(e=>{let a=ib(e,t,n,r);a.applyGroup=(e,t,n,r)=>tC(e,t,n,r,i),e.$transition=a}),o}function nC(e,t,n){if(XS.has(e))return;if(kv(e)){XS.add(e),(e.bu||=[]).push(n.beforeUpdate),(e.u||=[]).push(n.updated);return}if(!rC(e.rawProps))return;XS.add(e);let r=Nu(t,e.scope);try{Sh(()=>{let t=Nu(e,e.scope);try{Fh(e.rawProps)}finally{Pu(t)}})}finally{Pu(r)}}function rC(e){if(e.$)return!0;for(let t in e)if(t!==`$`&&M(e[t]))return!0;return!1}function iC(e){let t=vb(e);t&&YS.set(e,t.getBoundingClientRect())}function aC(e){let t=vb(e);if(t&&Gf(JS.get(e),YS.get(e),t))return e}function oC(e){for(let t=0;t<e.length;t++){let n=e[t],r=vb(n);if(r&&r.isConnected)return r}}var sC=e({BaseTransition:()=>Na,BaseTransitionPropsValidators:()=>ka,Comment:()=>Zl,DeprecationTypes:()=>null,DynamicFragment:()=>wv,EffectScope:()=>Ar,ErrorCodes:()=>ii,ErrorTypeStrings:()=>pd,Fragment:()=>Yl,KeepAlive:()=>Xo,MismatchTypes:()=>Do,MoveType:()=>bl,NULL_DYNAMIC_COMPONENT:()=>xs,ReactiveEffect:()=>br,SchedulerJobFlags:()=>ui,Static:()=>Ql,Suspense:()=>Rl,Teleport:()=>Sa,Text:()=>Xl,TrackOpTypes:()=>Lr,Transition:()=>Ad,TransitionGroup:()=>Vf,TransitionPropsValidators:()=>kd,TriggerOpTypes:()=>Rr,VaporElement:()=>rS,VaporFragment:()=>_v,VaporKeepAlive:()=>Sb,VaporSlot:()=>$l,VaporTeleport:()=>Qx,VaporTransition:()=>Yy,VaporTransitionGroup:()=>ZS,VueElement:()=>Nf,VueElementBase:()=>Mf,activate:()=>is,applyCheckboxModel:()=>HS,applyDynamicModel:()=>GS,applyRadioModel:()=>US,applySelectModel:()=>WS,applyTextModel:()=>VS,applyVShow:()=>IS,assertNumber:()=>ri,baseApplyTranslation:()=>Gf,baseEmit:()=>Cc,baseNormalizePropsOptions:()=>Jc,baseResolveTransitionHooks:()=>Ia,baseUseCssVars:()=>ef,callPendingCbs:()=>Hf,callWithAsyncErrorHandling:()=>si,callWithErrorHandling:()=>oi,camelize:()=>We,capitalize:()=>qe,checkTransitionMode:()=>qa,child:()=>Jp,cloneVNode:()=>vu,compatUtils:()=>null,compile:()=>cC,computed:()=>od,createApp:()=>jp,createAppAPI:()=>vc,createAssetComponent:()=>my,createAsyncComponentContext:()=>Ko,createBlock:()=>cu,createCanSetSetupRefChecker:()=>no,createCommentVNode:()=>Su,createComponent:()=>iy,createComponentWithFallback:()=>hy,createDynamicComponent:()=>MS,createElementBlock:()=>su,createElementVNode:()=>mu,createFor:()=>cS,createForSlots:()=>pS,createHydrationRenderer:()=>Sl,createIf:()=>iS,createInternalObject:()=>zc,createInvoker:()=>$h,createKeyedFragment:()=>sS,createPlainElement:()=>_y,createPropsRestProxy:()=>$s,createRenderer:()=>xl,createSSRApp:()=>Mp,createSelector:()=>lS,createSlot:()=>F_,createSlots:()=>Ds,createStaticVNode:()=>xu,createTemplateRefSetter:()=>SS,createTextNode:()=>Up,createTextVNode:()=>bu,createVNode:()=>hu,createVaporApp:()=>zy,createVaporSSRApp:()=>By,currentInstance:()=>L,customRef:()=>mr,deactivate:()=>as,defineAsyncComponent:()=>Wo,defineComponent:()=>Ja,defineCustomElement:()=>kf,defineEmits:()=>Vs,defineExpose:()=>Hs,defineModel:()=>Gs,defineOptions:()=>Us,defineProps:()=>Bs,defineSSRCustomElement:()=>Af,defineSlots:()=>Ws,defineVaporAsyncComponent:()=>Hy,defineVaporComponent:()=>Vy,defineVaporCustomElement:()=>tS,defineVaporSSRCustomElement:()=>nS,delegate:()=>Kh,delegateEvents:()=>Jh,devtools:()=>md,devtoolsComponentAdded:()=>Vi,effect:()=>xr,effectScope:()=>jr,endMeasure:()=>gl,ensureHydrationRenderer:()=>Op,ensureRenderer:()=>Dp,ensureValidVNode:()=>js,ensureVaporSlotFallback:()=>Ms,expose:()=>$u,extend:()=>k,filterModelListeners:()=>Nc,flushOnAppMount:()=>ki,forceReflow:()=>Wd,getAttributeMismatch:()=>vo,getComponentName:()=>rd,getContainerType:()=>fo,getCurrentInstance:()=>ku,getCurrentScope:()=>Mr,getCurrentWatcher:()=>Vr,getDefaultValue:()=>vS,getFunctionalFallthrough:()=>Mc,getInheritedScopeIds:()=>Pl,getRestElement:()=>_S,getTransitionRawChildren:()=>Ka,guardReactiveProps:()=>_u,h:()=>sd,handleError:()=>ci,handleMovedChildren:()=>Jf,hasCSSTransform:()=>qf,hasInjectionContext:()=>ea,hydrate:()=>Ap,hydrateOnIdle:()=>Lo,hydrateOnInteraction:()=>Vo,hydrateOnMediaQuery:()=>Bo,hydrateOnVisible:()=>zo,initCustomFormatter:()=>cd,initDirectivesForSSR:()=>Ip,initFeatureFlags:()=>yl,inject:()=>$i,insert:()=>V,invalidateMount:()=>kl,invokeDirectiveHook:()=>Zi,isAsyncWrapper:()=>Uo,isEmitListener:()=>Dc,isFragment:()=>kv,isFunctionalFallthroughKey:()=>jc,isHydrating:()=>oo,isHydratingEnabled:()=>io,isKeepAlive:()=>Yo,isMapEqual:()=>To,isMemoSame:()=>ud,isMismatchAllowed:()=>ko,isProxy:()=>Qn,isReactive:()=>Yn,isReadonly:()=>Xn,isRef:()=>nr,isRuntimeOnly:()=>Yu,isSetEqual:()=>Co,isShallow:()=>Zn,isTeleportDeferred:()=>ha,isTeleportDisabled:()=>ma,isTemplateNode:()=>ho,isTemplateRefKey:()=>$a,isVNode:()=>lu,isValidHtmlOrSvgAttribute:()=>yo,isVaporComponent:()=>U,knownTemplateRefs:()=>Za,leaveCbKey:()=>Ta,logMismatchError:()=>co,markAsyncBoundary:()=>Xa,markRaw:()=>$n,matches:()=>Zo,mergeDefaults:()=>Zs,mergeModels:()=>Qs,mergeProps:()=>Eu,next:()=>Xp,nextTick:()=>yi,nextUid:()=>zu,nodeOps:()=>wd,normalizeClass:()=>ut,normalizeContainer:()=>Pp,normalizeProps:()=>dt,normalizeRef:()=>pu,normalizeStyle:()=>at,normalizeVNode:()=>Cu,nthChild:()=>Yp,on:()=>Wh,onActivated:()=>Qo,onBeforeMount:()=>ls,onBeforeUnmount:()=>ps,onBeforeUpdate:()=>ds,onBinding:()=>Gh,onDeactivated:()=>$o,onErrorCaptured:()=>vs,onMounted:()=>us,onRenderTracked:()=>_s,onRenderTriggered:()=>gs,onScopeDispose:()=>Pr,onServerPrefetch:()=>hs,onUnmounted:()=>ms,onUpdated:()=>fs,onWatcherCleanup:()=>Hr,openBlock:()=>nu,parseEventName:()=>bf,patchProp:()=>Tf,patchStyle:()=>rf,performAsyncHydrate:()=>Jo,performTransitionEnter:()=>Al,performTransitionLeave:()=>jl,popScopeId:()=>qi,popWarningContext:()=>Yr,prepareTransitionLeave:()=>Ha,prepareTransitionSwitch:()=>Ba,provide:()=>Qi,proxyRefs:()=>fr,pushScopeId:()=>Ki,pushWarningContext:()=>Jr,queueJob:()=>xi,queuePostFlushCb:()=>Ti,queuePostRenderEffect:()=>I,rawVaporSlotKey:()=>Os,reactive:()=>Wn,readonly:()=>Kn,ref:()=>rr,registerHMR:()=>Mi,registerRuntimeCompiler:()=>Ju,remove:()=>H,render:()=>kp,renderEffect:()=>Sh,renderList:()=>Es,renderSlot:()=>As,resetShapeFlag:()=>ns,resolveComponent:()=>bs,resolveDirective:()=>Cs,resolveDynamicComponent:()=>Ss,resolveFilter:()=>null,resolvePropValue:()=>Wc,resolveTeleportTarget:()=>va,resolveTransitionChild:()=>za,resolveTransitionHooks:()=>Fa,resolveTransitionProps:()=>Nd,restoreCurrentInstance:()=>Pu,setAttr:()=>ng,setBlockKey:()=>Z_,setBlockTracking:()=>au,setClass:()=>ig,setClassName:()=>ag,setCurrentInstance:()=>Nu,setCurrentRenderingInstance:()=>Gi,setDOMProp:()=>rg,setDevtoolsHook:()=>hd,setDynamicEvents:()=>Xh,setDynamicProps:()=>pg,setElementText:()=>dg,setHtml:()=>fg,setInsertionState:()=>Bp,setIsHydratingEnabled:()=>ao,setProp:()=>tg,setRef:()=>to,setStaticTemplateRef:()=>wS,setStyle:()=>sg,setTemplateRefBinding:()=>TS,setText:()=>ug,setTransitionHooks:()=>Ga,setValue:()=>lg,setVarsOnNode:()=>tf,shallowReactive:()=>Gn,shallowReadonly:()=>qn,shallowRef:()=>ir,shouldSetAsProp:()=>Ef,shouldSetAsPropForVueCE:()=>Df,shouldUpdateComponent:()=>Pc,simpleSetCurrentInstance:()=>Mu,ssrContextKey:()=>ta,ssrUtils:()=>gd,startMeasure:()=>hl,stop:()=>Sr,svgNS:()=>bd,template:()=>$g,toClassSet:()=>So,toDisplayString:()=>Tt,toHandlerKey:()=>Je,toHandlers:()=>Ns,toRaw:()=>F,toRef:()=>vr,toRefs:()=>hr,toStyleMap:()=>wo,toValue:()=>ur,transformVNodeArgs:()=>du,triggerRef:()=>sr,txt:()=>qp,unref:()=>lr,unregisterHMR:()=>Ni,unsafeToTrustedHTML:()=>yd,useAsyncComponentState:()=>qo,useAttrs:()=>Js,useCssModule:()=>If,useCssVars:()=>Qd,useHost:()=>Pf,useId:()=>Ya,useInstanceOption:()=>Iu,useModel:()=>bc,useSSRContext:()=>na,useShadowRoot:()=>Ff,useSlots:()=>qs,useTemplateRef:()=>Qa,useTransitionState:()=>Da,useVaporCssVars:()=>OS,vModelCheckbox:()=>ip,vModelCheckboxInit:()=>ap,vModelCheckboxUpdate:()=>op,vModelDynamic:()=>hp,vModelGetValue:()=>pp,vModelRadio:()=>sp,vModelSelect:()=>cp,vModelSelectInit:()=>lp,vModelSetSelected:()=>dp,vModelText:()=>ep,vModelTextInit:()=>np,vModelTextUpdate:()=>rp,vShow:()=>Jd,vShowHidden:()=>qd,vShowOriginalDisplay:()=>Kd,validateComponentName:()=>Vu,validateProps:()=>Zc,vaporInteropPlugin:()=>fx,vdomSlotFallbackKey:()=>ks,version:()=>dd,warn:()=>fd,warnExtraneousAttributes:()=>kc,warnPropMismatch:()=>bo,watch:()=>oa,watchEffect:()=>ra,watchPostEffect:()=>ia,watchSyncEffect:()=>aa,withAsyncContext:()=>FS,withCtx:()=>Yi,withDefaults:()=>Ks,withDirectives:()=>Xi,withKeys:()=>Cp,withMemo:()=>ld,withModifiers:()=>xp,withScopeId:()=>Ji,withVaporDirectives:()=>KS,withVaporKeys:()=>Qh,withVaporModifiers:()=>Zh,xlinkNS:()=>df}),cC=e=>be,lC=[`top`,`right`,`bottom`,`left`],uC=[`start`,`end`],dC=lC.reduce((e,t)=>e.concat(t,t+`-`+uC[0],t+`-`+uC[1]),[]),fC=Math.min,pC=Math.max,mC=Math.round,hC=Math.floor,gC=e=>({x:e,y:e}),_C={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function vC(e,t,n){return pC(e,fC(t,n))}function yC(e,t){return typeof e==`function`?e(t):e}function bC(e){return e.split(`-`)[0]}function xC(e){return e.split(`-`)[1]}function SC(e){return e===`x`?`y`:`x`}function CC(e){return e===`y`?`height`:`width`}function wC(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function TC(e){return SC(wC(e))}function EC(e,t,n){n===void 0&&(n=!1);let r=xC(e),i=TC(e),a=CC(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=FC(o)),[o,FC(o)]}function DC(e){let t=FC(e);return[OC(e),t,OC(t)]}function OC(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var kC=[`left`,`right`],AC=[`right`,`left`],jC=[`top`,`bottom`],MC=[`bottom`,`top`];function NC(e,t,n){switch(e){case`top`:case`bottom`:return n?t?AC:kC:t?kC:AC;case`left`:case`right`:return t?jC:MC;default:return[]}}function PC(e,t,n,r){let i=xC(e),a=NC(bC(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(OC)))),a}function FC(e){let t=bC(e);return _C[t]+e.slice(t.length)}function IC(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function LC(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:IC(e)}function RC(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function zC(e,t,n){let{reference:r,floating:i}=e,a=wC(t),o=TC(t),s=CC(o),c=bC(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=xC(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function BC(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=yC(t,e),p=LC(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=RC(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=RC(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var VC=50,HC=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:BC},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=zC(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<VC&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=zC(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},UC=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=yC(e,t)||{};if(l==null)return{};let d=LC(u),f={x:n,y:r},p=TC(i),m=CC(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=fC(d[_],T),ee=fC(d[v],T),te=C-h[m]-ee,ne=C/2-h[m]/2+w,D=vC(E,ne,te),re=!c.arrow&&xC(i)!=null&&ne!==D&&a.reference[m]/2-(ne<E?E:ee)-h[m]/2<0,ie=re?ne<E?ne-E:ne-te:0;return{[p]:f[p]+ie,data:{[p]:D,centerOffset:ne-D-ie,...re&&{alignmentOffset:ie}},reset:re}}});function WC(e,t,n){return(e?[...n.filter(t=>xC(t)===e),...n.filter(t=>xC(t)!==e)]:n.filter(e=>bC(e)===e)).filter(n=>!e||xC(n)===e||(t?OC(n)!==n:!1))}var GC=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=dC,autoAlignment:u=!0,...d}=yC(e,t),f=c!==void 0||l===dC?WC(c||null,u,l):l,p=r.autoPlacement?.index||0,m=f[p];if(m==null)return{};if(i!==m)return{reset:{placement:f[0]}};let h=await a.detectOverflow(t,d),g=EC(m,n,await(a.isRTL==null?void 0:a.isRTL(o.floating))),_=[h[bC(m)],h[g[0]],h[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:m,overflows:_}],y=f[p+1];if(y)return{data:{index:p+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=xC(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,xC(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:p+1,overflows:v},reset:{placement:x}}}}},KC=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=yC(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=bC(r),_=wC(o),v=bC(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[FC(o)]:DC(o)),x=p!==`none`;!d&&x&&b.push(...PC(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=EC(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===wC(t)||T.every(e=>wC(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=wC(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function qC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function JC(e){return lC.some(t=>e[t]>=0)}var YC=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=yC(e,t);switch(i){case`referenceHidden`:{let e=qC(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:JC(e)}}}case`escaped`:{let e=qC(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:JC(e)}}}default:return{}}}}};function XC(e){let t=fC(...e.map(e=>e.left)),n=fC(...e.map(e=>e.top)),r=pC(...e.map(e=>e.right)),i=pC(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function ZC(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>RC(XC(e)))}var QC=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=yC(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=ZC(u),f=RC(XC(u)),p=LC(s);function m(){if(d.length===2&&(d[0].left>d[1].right||d[1].left>d[0].right)&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(wC(n)===`y`){let e=d[0],t=d[d.length-1],r=bC(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return RC({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=bC(n)===`left`,t=pC(...d.map(e=>e.right)),r=fC(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom;return RC({x:r,y:a,width:t-r,height:o-a})}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},$C=new Set([`left`,`top`]);async function ew(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=bC(n),s=xC(n),c=wC(n)===`y`,l=$C.has(o)?-1:1,u=a&&c?-1:1,d=yC(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var tw=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ew(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},nw=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=yC(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=wC(i),p=SC(f),m=u[p],h=u[f],g=(e,t)=>vC(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},rw=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=yC(e,t),u={x:n,y:r},d=wC(i),f=SC(d),p=u[f],m=u[d],h=yC(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=$C.has(bC(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},iw=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=yC(e,t),c=await i.detectOverflow(t,s),l=bC(n),u=xC(n),d=wC(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=fC(p-c[m],g),y=fC(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*pC(c.left,c.right):S=p-2*pC(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function aw(){return typeof window<`u`}function ow(e){return lw(e)?(e.nodeName||``).toLowerCase():`#document`}function sw(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cw(e){return((lw(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function lw(e){return aw()?e instanceof Node||e instanceof sw(e).Node:!1}function uw(e){return aw()?e instanceof Element||e instanceof sw(e).Element:!1}function dw(e){return aw()?e instanceof HTMLElement||e instanceof sw(e).HTMLElement:!1}function fw(e){return!aw()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof sw(e).ShadowRoot}function pw(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ww(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function mw(e){return/^(table|td|th)$/.test(ow(e))}function hw(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var gw=/transform|translate|scale|rotate|perspective|filter/,_w=/paint|layout|strict|content/,vw=e=>!!e&&e!==`none`,yw;function bw(e){let t=uw(e)?ww(e):e;return vw(t.transform)||vw(t.translate)||vw(t.scale)||vw(t.rotate)||vw(t.perspective)||!Sw()&&(vw(t.backdropFilter)||vw(t.filter))||gw.test(t.willChange||``)||_w.test(t.contain||``)}function xw(e){let t=Ew(e);for(;dw(t)&&!Cw(t);){if(bw(t))return t;if(hw(t))return null;t=Ew(t)}return null}function Sw(){return yw??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),yw}function Cw(e){return/^(html|body|#document)$/.test(ow(e))}function ww(e){return sw(e).getComputedStyle(e)}function Tw(e){return uw(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ew(e){if(ow(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||fw(e)&&e.host||cw(e);return fw(t)?t.host:t}function Dw(e){let t=Ew(e);return Cw(t)?(e.ownerDocument||e).body:dw(t)&&pw(t)?t:Dw(t)}function Ow(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Dw(e),i=r===e.ownerDocument?.body,a=sw(r);if(i){let e=kw(a);return t.concat(a,a.visualViewport||[],pw(r)?r:[],e&&n?Ow(e):[])}return t.concat(r,Ow(r,[],n))}function kw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Aw(e){let t=ww(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=dw(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=mC(n)!==a||mC(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function jw(e){return uw(e)?e:e.contextElement}function Mw(e){let t=jw(e);if(!dw(t))return gC(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Aw(t),o=(a?mC(n.width):n.width)/r,s=(a?mC(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Nw=gC(0);function Pw(e){let t=sw(e);return!Sw()||!t.visualViewport?Nw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fw(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===sw(e)}function Iw(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=jw(e),o=gC(1);t&&(r?uw(r)&&(o=Mw(r)):o=Mw(e));let s=Fw(a,n,r)?Pw(a):gC(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=sw(a),t=uw(r)?sw(r):r,n=e,i=kw(n);for(;i&&t!==n;){let e=Mw(i),t=i.getBoundingClientRect(),r=ww(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=sw(i),i=kw(n)}}return RC({width:u,height:d,x:c,y:l})}function Lw(e,t){let n=Tw(e).scrollLeft;return t?t.left+n:Iw(cw(e)).left+n}function Rw(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Lw(e,n),y:n.top+t.scrollTop}}function zw(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=cw(r),s=t?hw(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=gC(1),u=gC(0),d=dw(r);if((d||!a)&&((ow(r)!==`body`||pw(o))&&(c=Tw(r)),d)){let e=Iw(r);l=Mw(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Rw(o,c):gC(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Bw(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Vw(e){let t=Tw(e),n=e.ownerDocument.body,r=pC(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=pC(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Lw(e),o=-t.scrollTop;return ww(n).direction===`rtl`&&(a+=pC(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Hw=25;function Uw(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=sw(e),a=cw(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Sw()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Lw(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Hw&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ww(e,t){let n=Iw(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Mw(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Gw(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Uw(e,n,t);else if(t===`document`)r=Vw(cw(e));else if(uw(t))r=Ww(t,n);else{let n=Pw(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return RC(r)}function Kw(e,t){let n=t.get(e);if(n)return n;let r=Ow(e,[],!1).filter(e=>uw(e)&&ow(e)!==`body`),i=null,a=ww(e).position===`fixed`,o=a?Ew(e):e;for(;uw(o)&&!Cw(o);){let e=ww(o),t=bw(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Ew(o)}return t.set(e,r),r}function qw(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?hw(t)?[]:Kw(t,this._c):[].concat(n),r],o=Gw(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Gw(t,a[e],i);s=pC(n.top,s),c=fC(n.right,c),l=fC(n.bottom,l),u=pC(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Jw(e){let{width:t,height:n}=Aw(e);return{width:t,height:n}}function Yw(e,t,n){let r=dw(t),i=cw(t),a=n===`fixed`,o=Iw(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=gC(0);if((r||!a)&&((ow(t)!==`body`||pw(i))&&(s=Tw(t)),r)){let e=Iw(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Lw(i));let l=i&&!r&&!a?Rw(i,s):gC(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Xw(e){return ww(e).position===`static`}function Zw(e,t){if(!dw(e)||ww(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return cw(e)===n&&(n=n.ownerDocument.body),n}function Qw(e,t){let n=sw(e);if(hw(e))return n;if(!dw(e)){let t=Ew(e);for(;t&&!Cw(t);){if(uw(t)&&!Xw(t))return t;t=Ew(t)}return n}let r=Zw(e,t);for(;r&&mw(r)&&Xw(r);)r=Zw(r,t);return r&&Cw(r)&&Xw(r)&&!bw(r)?n:r||xw(e)||n}var $w=async function(e){let t=this.getOffsetParent||Qw,n=this.getDimensions,r=await n(e.floating);return{reference:Yw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function eT(e){return ww(e).direction===`rtl`}var tT={convertOffsetParentRelativeRectToViewportRelativeRect:zw,getDocumentElement:cw,getClippingRect:qw,getOffsetParent:Qw,getElementRects:$w,getClientRects:Bw,getDimensions:Jw,getScale:Mw,isElement:uw,isRTL:eT};function nT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rT(e,t,n){let r=null,i,a=cw(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=hC(d),h=hC(a.clientWidth-(u+f)),g=hC(a.clientHeight-(d+p)),_=hC(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:pC(0,fC(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!nT(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=sw(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function iT(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=jw(e),u=i||a?[...l?Ow(l):[],...t?Ow(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?rT(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Iw(e):null;c&&g();function g(){let t=Iw(e);h&&!nT(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var aT=tw,oT=GC,sT=nw,cT=KC,lT=iw,uT=YC,dT=UC,fT=QC,pT=rw,mT=(e,t,n)=>{let r=new Map,i=n??{},a={...tT,...i.platform,_c:r};return HC(e,t,{...i,platform:a})},hT=Object.defineProperty,gT=(e,t)=>{let n={};for(var r in e)hT(n,r,{get:e[r],enumerable:!0});return t||hT(n,Symbol.toStringTag,{value:`Module`}),n};function _T(e){this.content=e}_T.prototype={constructor:_T,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new _T(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new _T(n)},addToStart:function(e,t){return new _T([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new _T(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new _T(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=_T.from(e),e.size?new _T(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=_T.from(e),e.size?new _T(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=_T.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},_T.from=function(e){if(e instanceof _T)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new _T(t)};function vT(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&xT(e.charCodeAt(r-1))&&bT(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=vT(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function yT(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&xT(e.charCodeAt(i-1))&&bT(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=yT(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function bT(e){return e>=56320&&e<57344}function xT(e){return e>=55296&&e<56320}var W=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.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 RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return vT(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return yT(this,e,t,n)}findIndex(e){if(e==0)return CT(0,e);if(e==this.size)return CT(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?CT(t+1,i):CT(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};W.empty=new W([],0);var ST={index:0,offset:0};function CT(e,t){return ST.index=e,ST.offset=t,ST}function wT(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!wT(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!wT(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var TT=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||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&&wT(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 RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};TT.none=[];var ET=class extends Error{},G=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=OT(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(DT(this.content,t+this.openStart,n+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(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(W.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};G.empty=new G(W.empty,0,0);function DT(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(DT(a.content,t-i-1,n-i-1)))}function OT(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=OT(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function kT(e,t,n){if(n.openStart>e.depth)throw new ET(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ET(`Inconsistent open depths`);return AT(e,t,n,0)}function AT(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=AT(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return FT(a,LT(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return FT(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=RT(n,e);return FT(a,IT(e,i,o,t,r))}}function jT(e,t){if(!t.type.compatibleContent(e.type))throw new ET(`Cannot join `+t.type.name+` onto `+e.type.name)}function MT(e,t,n){let r=e.node(n);return jT(r,t.node(n)),r}function NT(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function PT(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(NT(e.nodeAfter,r),a++));for(let e=a;e<o;e++)NT(i.child(e),r);t&&t.depth==n&&t.textOffset&&NT(t.nodeBefore,r)}function FT(e,t){if(!e.type.validContent(t))throw new ET(`Invalid content for node `+e.type.name);return e.copy(t)}function IT(e,t,n,r,i){let a=e.depth>i&&MT(e,t,i+1),o=r.depth>i&&MT(n,r,i+1),s=[];return PT(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(jT(a,o),NT(FT(a,IT(e,t,n,r,i+1)),s)):(a&&NT(FT(a,LT(e,t,i+1)),s),PT(t,n,i,s),o&&NT(FT(o,LT(n,r,i+1)),s)),PT(r,null,i,s),new W(s)}function LT(e,t,n){let r=[];return PT(null,e,n,r),e.depth>n&&NT(FT(MT(e,t,n+1),LT(e,t,n+1)),r),PT(t,null,n,r),new W(r)}function RT(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(W.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var zT=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,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 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 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 n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}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 n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return TT.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}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 n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new UT(this,e,n);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(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=HT.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else HT.set(t,r=new BT);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%VT,i}},BT=class{constructor(){this.elts=[],this.i=0}},VT=12,HT=new WeakMap,UT=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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)}},WT=Object.create(null),GT=class e{constructor(e,t,n,r=TT.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||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,n,r=0){this.content.nodesBetween(e,t,n,r,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,n,r){return this.content.textBetween(e,t,n,r)}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,n){return this.type==e&&wT(this.attrs,t||e.defaultAttrs||WT)&&TT.sameSet(this.marks,n||TT.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}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,n=!1){if(e==t)return G.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new G(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return kT(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return zT.resolveCached(this,e)}resolveNoCache(e){return zT.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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()+`)`),qT(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=W.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.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=TT.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!TT.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.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(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=W.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};GT.prototype.text=void 0;var KT=class e extends GT{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):qT(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(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,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 qT(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var JT=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new YT(t,n);if(r.next==null)return e.empty;let i=XT(r);r.next&&r.err(`Unexpected trailing text`);let a=oE(rE(i));return sE(a,r),a}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,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}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 n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return W.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
9
+ `)}};JT.empty=new JT(!0);var YT=class{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 SyntaxError(e+` (in content expression '`+this.string+`')`)}};function XT(e){let t=[];do t.push(ZT(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function ZT(e){let t=[];do t.push(QT(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function QT(e){let t=nE(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=eE(e,t);else break;return t}function $T(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function eE(e,t){let n=$T(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:$T(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function tE(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function nE(e){if(e.eat(`(`)){let t=XT(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=tE(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function rE(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function iE(e,t){return t-e}function aE(e,t){let n=[];return r(t),n.sort(iE);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function oE(e){let t=Object.create(null);return n(aE(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);aE(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new JT(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(iE);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function sE(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function cE(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function lE(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function uE(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function dE(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new mE(e,r,t[r]);return n}var fE=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=dE(e,n.attrs),this.defaultAttrs=cE(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==JT.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:lE(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new GT(this,this.computeAttrs(e),W.from(t),TT.setFrom(n))}createChecked(e=null,t,n){return t=W.from(t),this.checkContent(t),new GT(this,this.computeAttrs(e),t,TT.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=W.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(W.empty,!0);return i?new GT(this,e,t.append(i),TT.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){uE(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 n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:TT.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function pE(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var mE=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?pE(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},hE=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=dE(e,r.attrs),this.excluded=null;let i=cE(this.attrs);this.instance=i?new TT(this,i):null}create(e=null){return!e&&this.instance?this.instance:new TT(this,lE(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),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){uE(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},gE=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=_T.from(e.nodes),t.marks=_T.from(e.marks||{}),this.nodes=fE.compile(this.spec.nodes,this),this.marks=hE.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=JT.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?_E(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:_E(this,n.split(` `))}this.nodeFromJSON=e=>GT.fromJSON(this,e),this.markFromJSON=e=>TT.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof fE))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new KT(n,n.defaultAttrs,e,TT.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 RangeError(`Unknown node type: `+e);return t}};function _E(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function vE(e){return e.tag!=null}function yE(e){return e.style!=null}var bE=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(vE(e))this.tags.push(e);else if(yE(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new kE(this,t,!1);return n.addAll(e,TT.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new kE(this,t,!0);return n.addAll(e,TT.none,t.from,t.to),G.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(jE(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=ME(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=ME(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},xE={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},SE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},CE={ol:!0,ul:!0},wE=1,TE=2,EE=4;function DE(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?wE:0)|(t===`full`?TE:0)}var OE=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=TT.none,this.match=i||(a&EE?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 t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&wE)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[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&&!xE.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},kE=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=DE(null,t.preserveWhitespace,0)|(n?EE:0);i=r?new OE(r.type,r.attrs,TT.none,!0,t.topMatch||r.type.contentMatch,a):n?new OE(null,null,TT.none,!0,null,a):new OE(e.schema.topNodeType,null,TT.none,!0,null,a),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 n=e.nodeValue,r=this.top,i=r.options&TE?`full`:this.localPreserveWS||(r.options&wE)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
10
+ `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;CE.hasOwnProperty(a)&&this.parser.normalizeLists&&AE(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:SE.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(xE.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
11
+ `),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 n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=TT.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):NE(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=DE(e,i,a.options);a.options&EE&&a.content.length==0&&(o|=EE);let s=TT.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):NE(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new OE(e,t,s,r,null,o)),this.open++,n}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;else this.localPreserveWS&&(this.nodes[t].options|=wE);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].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,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].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(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function AE(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&CE.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function jE(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ME(e){let t={};for(let n in e)t[n]=e[n];return t}function NE(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var PE=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=IE(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return IE(t).createTextNode(e.text);let{dom:n,contentDOM:r}=BE(IE(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&BE(IE(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:BE(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=FE(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return FE(e.marks)}};function FE(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function IE(e){return e.document||window.document}var LE=new WeakMap;function RE(e){let t=LE.get(e);return t===void 0&&LE.set(e,t=zE(e)),t}function zE(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function BE(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=RE(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=BE(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var VE=65535,HE=2**16;function UE(e,t){return e+t*HE}function WE(e){return e&VE}function GE(e){return(e-(e&VE))/HE}var KE=1,qE=2,JE=4,YE=8,XE=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&YE)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&JE)>0}},ZE=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=WE(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+GE(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:UE(o/3,e-s),f=e==s?qE:e==u?KE:JE;return(t<0?e!=s:e!=u)&&(f|=YE),new XE(a,f,d)}r+=l-c}return n?e+r:new XE(e+r,0,null)}touches(e,t){let n=0,r=WE(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};ZE.empty=new ZE([]);var QE=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r: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.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new XE(e,r,null)}},$E=Object.create(null),eD=class{getMap(){return ZE.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=$E[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in $E)throw RangeError(`Duplicate use of step JSON ID `+e);return $E[e]=t,t.prototype.jsonID=e,t}},tD=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof ET)return e.fail(t.message);throw t}}};function nD(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(nD(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return W.fromArray(r)}var rD=class e extends eD{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new G(nD(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return tD.fromReplace(e,this.from,this.to,i)}invert(){return new iD(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};eD.jsonID(`addMark`,rD);var iD=class e extends eD{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new G(nD(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return tD.fromReplace(e,this.from,this.to,n)}invert(){return new rD(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};eD.jsonID(`removeMark`,iD);var aD=class e extends eD{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return tD.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return tD.fromReplace(e,this.pos,this.pos+1,new G(W.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new oD(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};eD.jsonID(`addNodeMark`,aD);var oD=class e extends eD{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return tD.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return tD.fromReplace(e,this.pos,this.pos+1,new G(W.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new aD(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};eD.jsonID(`removeNodeMark`,oD);var sD=class e extends eD{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&lD(e,this.from,this.to)?tD.fail(`Structure replace would overwrite content`):tD.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ZE([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?G.empty:new G(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?G.empty:new G(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}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(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,G.fromJSON(t,n.slice),!!n.structure)}};sD.MAP_BIAS=1,eD.jsonID(`replace`,sD);var cD=class e extends eD{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(lD(e,this.from,this.gapFrom)||lD(e,this.gapTo,this.to)))return tD.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return tD.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?tD.fromReplace(e,this.from,this.to,n):tD.fail(`Content does not fit in gap`)}getMap(){return new ZE([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,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(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,G.fromJSON(t,n.slice),n.insert,!!n.structure)}};eD.jsonID(`replaceAround`,cD);function lD(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function uD(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new iD(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new rD(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function dD(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof hE){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new iD(t.from,t.to,t.style)))}function fD(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new sD(s,l,G.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new iD(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new G(W.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new sD(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(W.empty,!0);e.replace(s,s,new G(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function pD(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function mD(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!pD(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function hD(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=W.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=W.from(r.node(e).copy(u)),d++):c--;let f=W.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=W.from(i.node(e).copy(f)),p++):l++;e.step(new cD(c,l,o,s,new G(u.append(f),d,p),u.size-d,!0))}function gD(e,t,n=null,r=e){let i=vD(e,t),a=i&&yD(r,t);return a?i.map(_D).concat({type:t,attrs:n}).concat(a.map(_D)):null}function _D(e){return{type:e,attrs:null}}function vD(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function yD(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function bD(e,t,n){let r=W.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=W.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new cD(i,a,i,a,new G(r,0,0),n.length,!0))}function xD(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&wD(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&CD(e,t,n,a),fD(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new cD(c,l,c+1,l-1,new G(W.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&SD(e,t,n,a),!1}})}function SD(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function CD(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
12
+ `))}})}function wD(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function TD(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new cD(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new G(W.from(o),0,0),1,!0))}function ED(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function DD(e,t,n=1,r){let i=e.doc.resolve(t),a=W.empty,o=W.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=W.from(i.node(e).copy(a));let t=r&&r[s];o=W.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new sD(t,t,new G(a.append(o),n,n),!0))}function OD(e,t){let n=e.resolve(t),r=n.index();return AD(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function kD(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function AD(e,t){return!!(e&&t&&!e.isLeaf&&kD(e,t))}function jD(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&AD(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function MD(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);CD(e,r.node(),r.before(),s)}o.inlineContent&&fD(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new sD(l,c.map(t+n,-1),G.empty,!0)),r===!0){let t=e.doc.resolve(l);SD(e,t.node(),t.before(),e.steps.length)}return e}function ND(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function PD(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function FD(e,t,n=t,r=G.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return ID(i,a,r)?new sD(t,n,r):new LD(i,a,r).fit()}function ID(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var LD=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=W.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=W.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new G(i,a,o);return e>-1?new cD(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new sD(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=BD(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(W.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=BD(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new G(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=BD(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new G(RD(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new G(RD(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(VD(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=zD(this.placed,t,W.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?G.empty:new G(RD(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new G(RD(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!HD(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=HD(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=HD(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=zD(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=zD(this.placed,this.depth,W.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(W.empty,!0);e.childCount&&(this.placed=zD(this.placed,this.frontier.length,e))}};function RD(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(RD(e.firstChild.content,t-1,n)))}function zD(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(zD(e.lastChild.content,t-1,n)))}function BD(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function VD(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,VD(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(W.empty,!0)))),e.copy(r)}function HD(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!UD(n,a.content,o)?s:null}function UD(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function WD(e){return e.spec.defining||e.spec.definingForContent}function GD(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(ID(i,a,r))return e.step(new sD(t,n,r));let o=YD(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=WD(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new G(KD(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function KD(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(KD(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(W.empty,!0))}return e}function qD(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=ND(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new G(W.from(r),0,0))}function JD(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=YD(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function YD(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var XD=class e extends eD{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return tD.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return tD.fromReplace(e,this.pos,this.pos+1,new G(W.from(r),0,+!t.isLeaf))}getMap(){return ZE.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};eD.jsonID(`attr`,XD);var ZD=class e extends eD{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return tD.ok(n)}getMap(){return ZE.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};eD.jsonID(`docAttr`,ZD);var QD=class extends Error{};QD=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},QD.prototype=Object.create(Error.prototype),QD.prototype.constructor=QD,QD.prototype.name=`TransformError`;var $D=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new QE}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new QD(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=G.empty){let r=FD(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new G(W.from(n),0,0))}delete(e,t){return this.replace(e,t,G.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return GD(this,e,t,n),this}replaceRangeWith(e,t,n){return qD(this,e,t,n),this}deleteRange(e,t){return JD(this,e,t),this}lift(e,t){return hD(this,e,t),this}join(e,t=1){return MD(this,e,t),this}wrap(e,t){return bD(this,e,t),this}setBlockType(e,t=e,n,r=null){return xD(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return TD(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new XD(e,t,n)),this}setDocAttribute(e,t){return this.step(new ZD(e,t)),this}addNodeMark(e,t){return this.step(new aD(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof TT)t.isInSet(n.marks)&&this.step(new oD(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new oD(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return DD(this,e,t,n),this}addMark(e,t,n){return uD(this,e,t,n),this}removeMark(e,t,n){return dD(this,e,t,n),this}clearIncompatible(e,t,n){return fD(this,e,t,n),this}},eO=Object.create(null),K=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new tO(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=G.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?G.empty:t),o==0&&lO(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),lO(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new q(e):cO(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?cO(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):cO(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new oO(e.node(0))}static atStart(e){return cO(e,e,0,0,1)||new oO(e)}static atEnd(e){return cO(e,e,e.content.size,e.childCount,-1)||new oO(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=eO[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in eO)throw RangeError(`Duplicate use of selection JSON ID `+e);return eO[e]=t,t.prototype.jsonID=e,t}getBookmark(){return q.between(this.$anchor,this.$head).getBookmark()}};K.prototype.visible=!0;var tO=class{constructor(e,t){this.$from=e,this.$to=t}},nO=!1;function rO(e){!nO&&!e.parent.inlineContent&&(nO=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var q=class e extends K{constructor(e,t=e){rO(e),rO(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return K.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=G.empty){if(super.replace(e,t),t==G.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new iO(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=K.findFrom(n,r,!0)||K.findFrom(n,-r,!0);if(e)n=e.$head;else return K.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(K.findFrom(t,-r,!0)||K.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};K.jsonID(`text`,q);var iO=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return q.between(e.resolve(this.anchor),e.resolve(this.head))}},J=class e extends K{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?K.near(a):new e(a)}content(){return new G(W.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new aO(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};J.prototype.visible=!1,K.jsonID(`node`,J);var aO=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new iO(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&J.isSelectable(n)?new J(t):K.near(t)}},oO=class e extends K{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=G.empty){if(t==G.empty){e.delete(0,e.doc.content.size);let t=K.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return sO}};K.jsonID(`all`,oO);var sO={map(){return this},resolve(e){return new oO(e)}};function cO(e,t,n,r,i,a=!1){if(t.inlineContent)return q.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=cO(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&J.isSelectable(r))return J.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function lO(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof sD||i instanceof cD))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(K.near(e.doc.resolve(o),n))}var uO=1,dO=2,fO=4,pO=class extends $D{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|uO)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&uO)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=dO,this}ensureMarks(e){return TT.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&dO)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||TT.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(K.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=fO,this}get scrolledIntoView(){return(this.updated&fO)>0}};function mO(e,t){return!t||!e?e:e.bind(t)}var hO=class{constructor(e,t,n){this.name=e,this.init=mO(t.init,n),this.apply=mO(t.apply,n)}},gO=[new hO(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new hO(`selection`,{init(e,t){return e.selection||K.atStart(t.doc)},apply(e){return e.selection}}),new hO(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new hO(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],_O=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=gO.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new hO(e.key,e.spec.state,e))})}},vO=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new pO(this)}static create(t){let n=new _O(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new _O(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new _O(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=GT.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=K.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function yO(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=yO(i,t,{})),n[r]=i}return n}var Y=class{constructor(e){this.spec=e,this.props={},e.props&&yO(e.props,this,this.props),this.key=e.key?e.key.key:xO(`plugin`)}getState(e){return e[this.key]}},bO=Object.create(null);function xO(e){return e in bO?e+`$`+ ++bO[e]:(bO[e]=0,e+`$`)}var X=class{constructor(e=`key`){this.key=xO(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},SO=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function CO(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var wO=(e,t,n)=>{let r=CO(e,n);if(!r)return!1;let i=AO(r);if(!i){let n=r.blockRange(),i=n&&mD(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(JO(e,i,t,-1))return!0;if(r.parent.content.size==0&&(OO(a,`end`)||J.isSelectable(a)))for(let n=r.depth;;n--){let o=FD(e.doc,r.before(n),r.after(n),G.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(OO(a,`end`)?K.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):J.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},TO=(e,t,n)=>{let r=CO(e,n);if(!r)return!1;let i=AO(r);return i?DO(e,i,t):!1},EO=(e,t,n)=>{let r=jO(e,n);if(!r)return!1;let i=PO(r);return i?DO(e,i,t):!1};function DO(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=FD(e.doc,i,o,G.empty);if(!s||s.from!=i||s instanceof sD&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(q.create(t.doc,i)),n(t.scrollIntoView())}return!0}function OO(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var kO=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=AO(r)}let o=a&&a.nodeBefore;return!o||!J.isSelectable(o)?!1:(t&&t(e.tr.setSelection(J.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function AO(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function jO(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var MO=(e,t,n)=>{let r=jO(e,n);if(!r)return!1;let i=PO(r);if(!i)return!1;let a=i.nodeAfter;if(JO(e,i,t,1))return!0;if(r.parent.content.size==0&&(OO(a,`start`)||J.isSelectable(a))){let n=FD(e.doc,r.before(),r.after(),G.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(OO(a,`start`)?K.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):J.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},NO=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=PO(r)}let o=a&&a.nodeAfter;return!o||!J.isSelectable(o)?!1:(t&&t(e.tr.setSelection(J.create(e.doc,a.pos)).scrollIntoView()),!0)};function PO(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var FO=(e,t)=>{let n=e.selection,r=n instanceof J,i;if(r){if(n.node.isTextblock||!OD(e.doc,n.from))return!1;i=n.from}else if(i=jD(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(J.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},IO=(e,t)=>{let n=e.selection,r;if(n instanceof J){if(n.node.isTextblock||!OD(e.doc,n.to))return!1;r=n.to}else if(r=jD(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},LO=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&mD(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},RO=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
13
+ `).scrollIntoView()),!0)};function zO(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var BO=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=zO(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(K.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},VO=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof oO||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=zO(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(q.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},HO=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(ED(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&mD(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function UO(e){return(t,n)=>{if(t.selection instanceof J&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!ED(t.doc,e.pos)?!1:(n&&n(t.tr.split(e.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof q||t.selection instanceof oO)&&r.deleteSelection();let{$from:i}=r.selection,a=r.steps.length,o=[],s,c,l=!1,u=!1;for(let t=i.depth;;t--)if(i.node(t).isBlock){l=i.end(t)==i.pos+(i.depth-t),u=i.start(t)==i.pos-(i.depth-t),c=zO(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let n=e&&e(i.parent,l,i);o.unshift(n||(l&&c?{type:c}:null)),s=t;break}else{if(t==1)return!1;o.unshift(null)}let d=i.pos,f=ED(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,ED(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!l&&u&&i.node(s).type!=c){let e=r.mapping.slice(a),t=e.map(i.before(s)),n=r.doc.resolve(t);c&&i.node(s-1).canReplaceWith(n.index(),n.index()+1,c)&&r.setNodeMarkup(e.map(i.before(s)),c)}return n&&n(r.scrollIntoView()),!0}}var WO=UO(),GO=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0&&(i=n.before(a),t&&t(e.tr.setSelection(J.create(e.doc,i))),!0)},KO=(e,t)=>(t&&t(e.tr.setSelection(new oO(e.doc))),!0);function qO(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||OD(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function JO(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&qO(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=W.empty;for(let e=o.length-1;e>=0;e--)s=W.from(o[e].create(null,s));s=W.from(i.copy(s));let c=e.tr.step(new cD(t.pos-1,r,t.pos,r,new G(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&OD(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:K.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&mD(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&OO(a,`start`,!0)&&OO(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=W.empty;for(let e=o.length-1;e>=0;e--)r=W.from(o[e].copy(r));n(e.tr.step(new cD(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new G(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function YO(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(q.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var XO=YO(-1),ZO=YO(1);function QO(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&gD(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function $O(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t)){if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function ek(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var tk=ek(SO,wO,kO),nk=ek(SO,MO,NO),rk={Enter:ek(RO,VO,HO,WO),"Mod-Enter":BO,Backspace:tk,"Mod-Backspace":tk,"Shift-Backspace":tk,Delete:nk,"Mod-Delete":nk,"Mod-a":KO},ik={"Ctrl-h":rk.Backspace,"Alt-Backspace":rk[`Mod-Backspace`],"Ctrl-d":rk.Delete,"Ctrl-Alt-Backspace":rk[`Mod-Delete`],"Alt-Delete":rk[`Mod-Delete`],"Alt-d":rk[`Mod-Delete`],"Ctrl-a":XO,"Ctrl-e":ZO};for(let e in rk)ik[e]=rk[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function ak(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return ok(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function ok(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new UT(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new UT(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=gD(a,n,r,t);return s?(e&&sk(e,t,s,i,n),!0):!1}function sk(e,t,n,r,i){let a=W.empty;for(let e=n.length-1;e>=0;e--)a=W.from(n[e].type.create(n[e].attrs,a));e.step(new cD(t.start-(r?2:0),t.end,t.start,t.end,new G(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&ED(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function ck(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?lk(t,n,e,a):uk(t,n,a):!0:!1}}function lk(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new cD(a-1,o,a,o,new G(W.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new UT(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=mD(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return OD(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function uk(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?W.empty:W.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new cD(d-+!!s,f+ +!!c,d+1,f-1,new G((s?W.empty:W.from(i.copy(W.empty))).append(c?W.empty:W.from(i.copy(W.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function dk(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=W.from(r?e.create():null),o=new G(W.from(e.create(null,W.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new cD(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var fk=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},pk=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},mk=null,hk=function(e,t,n){let r=mk||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},gk=function(){mk=null},_k=function(e,t,n,r){return n&&(yk(e,t,n,r,-1)||yk(e,t,n,r,1))},vk=/^(img|br|input|textarea|hr)$/i;function yk(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:bk(e))){let n=e.parentNode;if(!n||n.nodeType!=1||wk(e)||vk.test(e.nodeName)||e.contentEditable==`false`)return!1;t=fk(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?bk(e):0}else return!1}}function bk(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function xk(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=bk(e)}else if(e.parentNode&&!wk(e))t=fk(e),e=e.parentNode;else return null}}function Sk(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!wk(e))t=fk(e)+1,e=e.parentNode;else return null}}function Ck(e,t,n){for(let r=t==0,i=t==bk(e);r||i;){if(e==n)return!0;let t=fk(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==bk(e)}}function wk(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Tk=function(e){return e.focusNode&&_k(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ek(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Dk(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Ok(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(bk(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(bk(r.startContainer),r.startOffset)}}}var kk=typeof navigator<`u`?navigator:null,Ak=typeof document<`u`?document:null,jk=kk&&kk.userAgent||``,Mk=/Edge\/(\d+)/.exec(jk),Nk=/MSIE \d/.exec(jk),Pk=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(jk),Fk=!!(Nk||Pk||Mk),Ik=Nk?document.documentMode:Pk?+Pk[1]:Mk?+Mk[1]:0,Lk=!Fk&&/gecko\/(\d+)/i.test(jk);Lk&&+(/Firefox\/(\d+)/.exec(jk)||[0,0])[1];var Rk=!Fk&&/Chrome\/(\d+)/.exec(jk),zk=!!Rk,Bk=Rk?+Rk[1]:0,Vk=!Fk&&!!kk&&/Apple Computer/.test(kk.vendor),Hk=Vk&&(/Mobile\/\w+/.test(jk)||!!kk&&kk.maxTouchPoints>2),Uk=Hk||(kk?/Mac/.test(kk.platform):!1),Wk=kk?/Win/.test(kk.platform):!1,Gk=/Android \d/.test(jk),Kk=!!Ak&&`webkitFontSmoothing`in Ak.documentElement.style,qk=Kk?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Jk(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Yk(e,t){return typeof e==`number`?e:e[t]}function Xk(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Zk(e,t,n){if(!fA(t)&&t.left==0)return;let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=pk(o);continue}let e=o,n=e==a.body,s=n?Jk(a):Xk(e),c=0,l=0;if(t.top<s.top+Yk(r,`top`)?l=-(s.top-t.top+Yk(i,`top`)):t.bottom>s.bottom-Yk(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Yk(i,`top`)-s.top:t.bottom-s.bottom+Yk(i,`bottom`)),t.left<s.left+Yk(r,`left`)?c=-(s.left-t.left+Yk(i,`left`)):t.right>s.right-Yk(r,`right`)&&(c=t.right-s.right+Yk(i,`right`)),c||l){if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:pk(o)}}function Qk(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:$k(e.dom)}}function $k(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=pk(r));return t}function eA({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;tA(n,r==0?0:r-t)}function tA(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var nA=null;function rA(e){if(e.setActive)return e.setActive();if(nA)return e.focus(nA);let t=$k(e);e.focus(nA==null?{get preventScroll(){return nA={preventScroll:!0},!0}}:void 0),nA||(nA=!1,tA(t,0))}function iA(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=hk(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?aA(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:iA(n,i)}function aA(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=pA(r,1);if(n.top!=n.bottom&&oA(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function oA(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function sA(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function cA(e,t,n){let{node:r,offset:i}=iA(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function lA(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function uA(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(oA(t,i))return uA(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function dA(e,t){let n=e.dom.ownerDocument,r,i=0,a=Ok(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!oA(t,n)||(o=uA(e.dom,t,n),!o))return null}if(Vk)for(let e=o;r&&e;e=pk(e))e.draggable&&(r=void 0);if(o=sA(o,t),r){if(Lk&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;Kk&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=lA(e,r,i,t))}s??=cA(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function fA(e){return e.top<e.bottom||e.left<e.right}function pA(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(fA(e))return e}return Array.prototype.find.call(n,fA)||e.getBoundingClientRect()}var mA=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function hA(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Kk||Lk;if(r.nodeType==3){if(o&&(mA.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=pA(hk(r,i,i),n);if(Lk&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=pA(hk(r,i-1,i-1),-1);if(t.top==e.top){let n=pA(hk(r,i,i+1),-1);if(n.top!=e.top)return gA(n,n.left<t.left)}}return e}{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,gA(pA(hk(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==bk(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return _A(e.getBoundingClientRect(),!1)}if(a==null&&i<bk(r)){let e=r.childNodes[i];if(e.nodeType==1)return _A(e.getBoundingClientRect(),!0)}return _A(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==bk(r))){let e=r.childNodes[i-1],t=e.nodeType==3?hk(e,bk(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return gA(pA(t,1),!1)}if(a==null&&i<bk(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?hk(e,0,+!o):e.nodeType==1?e:null:null;if(t)return gA(pA(t,-1),!0)}return gA(pA(r.nodeType==3?hk(r):r,-n),n>=0)}function gA(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function _A(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function vA(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function yA(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return vA(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=hA(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=hk(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var bA=/[\u0590-\u08ac]/;function xA(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!bA.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:vA(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var SA=null,CA=null,wA=!1;function TA(e,t,n){return SA==t&&CA==n?wA:(SA=t,CA=n,wA=n==`up`||n==`down`?yA(e,t,n):xA(e,t,n))}var EA=0,DA=1,OA=2,kA=3,AA=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=EA,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>fk(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node)){if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof LA){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof jA&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?fk(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?fk(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=fk(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=fk(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((Lk||Vk)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
14
+ `),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:fk(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(Lk&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Vk)&&_k(o.node,o.offset,l.anchorNode,l.anchorOffset)&&_k(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&Lk)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?OA:DA,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=kA:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?OA:kA}n=a}this.dirty=OA}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?OA:DA;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},jA=class extends AA{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.hasAttribute(`contenteditable`)||(a.contentEditable=`false`),a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==EA&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},MA=class extends AA{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},NA=class e extends AA{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=PE.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&kA||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=kA&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=EA){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=EA}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=ej(a,n,o,r)),t>0&&(a=ej(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},PA=class e extends AA{constructor(e,t,n,r,i,a,o){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=PE.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=GA(u,r,n),l?c=new RA(t,n,r,i,u,d||null,f,l):n.isText?new IA(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(t.preserveWhitespace=`full`),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>t.nodeType==1&&e.indexOf(t.parentNode)<0&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>W.empty}}return t}matchesNode(e,t,n){return this.dirty==EA&&e.eq(this.node)&&KA(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new JA(this,a&&a.node,e);ZA(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?TT.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==OA)&&(a&&this.protectLocalComposition(e,a),zA(this.contentDOM,this.children,e),Hk&&QA(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof q)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=$A(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new MA(this,i,t,r);e.input.compositionNodes.push(a),this.children=ej(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==kA||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=EA}updateOuterDeco(e){if(KA(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=UA(this.dom,this.nodeDOM,HA(this.outerDeco,this.node,t),HA(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function FA(e,t,n,r,i){GA(r,t,e);let a=new PA(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var IA=class e extends PA{constructor(e,t,n,r,i,a){super(e,t,n,r,i,null,a)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==kA||this.dirty!=EA&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=EA||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=EA,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=kA)}get domAtom(){return!1}isText(e){return this.node.text==e}},LA=class extends AA{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==EA&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},RA=class extends PA{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o),this.spec=s}update(e,t,n,r){if(this.dirty==kA)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function zA(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=qA(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof NA){let t=r?r.previousSibling:e.lastChild;zA(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=qA(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var BA=function(e){e&&(this.nodeName=e)};BA.prototype=Object.create(null);var VA=[new BA];function HA(e,t,n){if(e.length==0)return VA;let r=n?VA[0]:new BA,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new BA(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new BA(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function UA(e,t,n,r){if(n==VA&&r==VA)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=VA[0],i=t)}WA(i,o||VA[0],a)}return i}function WA(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function GA(e,t,n){return UA(e,e,VA,HA(t,n,e.nodeType!=1))}function KA(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function qA(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var JA=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=YA(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=EA,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof NA&&t.dirty!=kA&&t.mark.type==e[a].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[a])&&(t.mark=e[a],i=this.index,this.changed=!0)}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=NA.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==kA&&a.dom==a.contentDOM&&(a.dirty=OA),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof PA){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=kA&&KA(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=OA,u.updateChildren(r,a+1),u.dirty=EA),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!KA(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=PA.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=PA.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new jA(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof NA;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof IA)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Vk||zk)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new LA(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function YA(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof NA)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function XA(e,t){return e.type.side-t.type.side}function ZA(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u){if(d){d.sort(XA);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c)}let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function QA(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function $A(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function ej(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function tj(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(Tk(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&J.isSelectable(e)&&i.parent&&!(e.isInline&&Ck(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new J(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=fj(e,u,s,n)}return l}function nj(e){return e.editable?e.hasFocus():mj(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function rj(e,t=!1){let n=e.state.selection;if(uj(e,n),!nj(e))return;let r=e.input.mouseDown;if(!t&&zk&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&_k(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)lj(e);else{let{anchor:r,head:i}=n,a,o;ij&&!(n instanceof q)&&(n.$from.parent.inlineContent||(a=aj(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=aj(e,n.to))),e.docView.setSelection(r,i,e,t),ij&&(a&&sj(a),o&&sj(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&cj(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var ij=Vk||zk&&Bk<63;function aj(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(Vk&&i&&i.contentEditable==`false`)return oj(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return oj(i);if(a)return oj(a)}}function oj(e){return e.contentEditable=`true`,Vk&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function sj(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function cj(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!nj(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function lj(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,fk(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Fk&&Ik<=11&&(n.disabled=!0,n.disabled=!1)}function uj(e,t){if(t instanceof J){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(dj(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else dj(e)}function dj(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function fj(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||q.between(t,n,r)}function pj(e){return e.editable&&!e.hasFocus()?!1:mj(e)}function mj(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function hj(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return _k(t.node,t.offset,n.anchorNode,n.anchorOffset)}function gj(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&K.findFrom(a,t)}function _j(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function vj(e,t,n){let r=e.state.selection;if(r instanceof q){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return _j(e,new q(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=gj(e.state,t);return n&&n instanceof J?_j(e,n):!1}if(!(Uk&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?J.isSelectable(i)?_j(e,new J(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Kk?_j(e,new q(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof J&&r.node.isInline)return _j(e,new q(t>0?r.$to:r.$from));else{let n=gj(e.state,t);return n?_j(e,n):!1}}function yj(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function bj(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function xj(e,t){return t<0?Sj(e):Cj(e)}function Sj(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(Lk&&n.nodeType==1&&r<yj(n)&&bj(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(bj(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(wj(n))break;else{let t=n.previousSibling;for(;t&&bj(t,-1);)i=n.parentNode,a=fk(t),t=t.previousSibling;if(t)n=t,r=yj(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?Dj(e,n,r):i&&Dj(e,i,a)}function Cj(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=yj(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(bj(e,1))a=n,o=++r;else break}else if(wj(n))break;else{let t=n.nextSibling;for(;t&&bj(t,1);)a=t.parentNode,o=fk(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=yj(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&Dj(e,a,o)}function wj(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Tj(e,t){for(;e&&t==e.childNodes.length&&!wk(e);)t=fk(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function Ej(e,t){for(;e&&!t&&!wk(e);)t=fk(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function Dj(e,t,n){if(t.nodeType!=3){let e,r;(r=Tj(t,n))?(t=r,n=0):(e=Ej(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Tk(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&rj(e)},50)}function Oj(e,t){let n=e.state.doc.resolve(t);if(!(zk||Wk)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function kj(e,t,n){let r=e.state.selection;if(r instanceof q&&!r.empty||n.indexOf(`s`)>-1||Uk&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=gj(e.state,t);if(n&&n instanceof J)return _j(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof oO?K.near(n,t):K.findFrom(n,t);return o?_j(e,o):!1}return!1}function Aj(e,t){if(!(e.state.selection instanceof q))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function jj(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Mj(e){if(!Vk||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;jj(e,n,`true`),setTimeout(()=>jj(e,n,`false`),20)}return!1}function Nj(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Pj(e,t){let n=t.keyCode,r=Nj(t);if(n==8||Uk&&n==72&&r==`c`)return Aj(e,-1)||xj(e,-1);if(n==46&&!t.shiftKey||Uk&&n==68&&r==`c`)return Aj(e,1)||xj(e,1);if(n==13||n==27)return!0;if(n==37||Uk&&n==66&&r==`c`){let t=n==37?Oj(e,e.state.selection.from)==`ltr`?-1:1:-1;return vj(e,t,r)||xj(e,t)}if(n==39||Uk&&n==70&&r==`c`){let t=n==39?Oj(e,e.state.selection.from)==`ltr`?1:-1:1;return vj(e,t,r)||xj(e,t)}return n==38||Uk&&n==80&&r==`c`?kj(e,-1,r)||xj(e,-1):n==40||Uk&&n==78&&r==`c`?Mj(e)||kj(e,1,r)||xj(e,1):!(r!=(Uk?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function Fj(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||PE.fromSchema(e.state.schema),s=Gj(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=Wj[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
15
+
16
+ `),slice:t}}function Ij(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new G(W.from(e.state.schema.text(t.replace(/\r\n?/g,`
17
+ `))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=PE.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=Jj(n),Kk&&Yj(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||bE.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!Lj.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Xj(Uj(s,+u[1],+u[2]),u[4]);else if(s=G.maxOpen(Rj(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Uj(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var Lj=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Rj(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&Bj(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=Vj(a[a.length-1],i.length));let n=zj(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return W.from(a)}return e}function zj(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,W.from(e));return e}function Bj(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=Bj(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(W.from(zj(n,e,i+1))))}}function Vj(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Vj(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(W.empty,!0);return e.copy(n.append(r))}function Hj(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=Hj(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(W.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function Uj(e,t,n){return t<e.openStart&&(e=new G(Hj(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new G(Hj(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Wj={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]};function Gj(){return document.implementation.createHTMLDocument(`title`)}var Kj=null;function qj(e){let t=window.trustedTypes;if(!t)return e;if(!Kj){if(Kj=t.defaultPolicy)try{return Kj.createHTML(e)}catch{}Kj=t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e})}return Kj.createHTML(e)}function Jj(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Gj(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),a;if((a=i&&Wj[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>`</`+e+`>`).reverse().join(``)),r.innerHTML=qj(e),a)for(let e=0;e<a.length;e++)r=r.querySelector(a[e])||r;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=r.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return r}function Yj(e){let t=e.querySelectorAll(zk?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function Xj(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;try{t.checkAttrs(r[e+1])}catch{break}i=W.from(t.create(r[e+1],i)),a++,o++}return new G(i,a,o)}var Zj={},Qj={},$j={touchstart:!0,touchmove:!0},eM=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function tM(e){for(let t in Zj){let n=Zj[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{oM(e,t)&&!aM(e,t)&&(e.editable||!(t.type in Qj))&&n(e,t)},$j[t]?{passive:!0}:void 0)}Vk&&e.dom.addEventListener(`input`,()=>null),iM(e)}function nM(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function rM(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function iM(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>aM(e,t))})}function aM(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function oM(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function sM(e,t){!aM(e,t)&&Zj[t.type]&&(e.editable||!(t.type in Qj))&&Zj[t.type](e,t)}Qj.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!wM(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Gk&&zk&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),Hk&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,Ek(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Pj(e,n)?n.preventDefault():nM(e,`key`)}},Qj.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Qj.keypress=(e,t)=>{let n=t;if(wM(e)||!n.charCode||n.ctrlKey&&!n.altKey||Uk&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof q)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function cM(e){return{left:e.clientX,top:e.clientY}}function lM(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function uM(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function dM(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function fM(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(dM(e,new J(n),`pointer`),!0):!1}function pM(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof J&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(J.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i!=null&&(dM(e,J.create(e.state.doc,i),`pointer`),!0)}function mM(e,t,n,r,i){return uM(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?pM(e,n):fM(e,n))}function hM(e,t,n,r){return uM(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function gM(e,t,n,r){return uM(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||_M(e,n,r)}function _M(e,t,n){if(n.button!=0)return!1;let r=vM(e,t,!0),i=e.state.doc;return r?(dM(e,r,`pointer`),r instanceof q&&i.eq(e.state.doc)&&(e.input.mouseDown=new CM(e,r)),!0):!1}function vM(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?q.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return q.create(r,a+1,a+1+t.content.size);if(n&&J.isSelectable(t))return J.create(r,a)}return null}function yM(e){return AM(e)}var bM=Uk?`metaKey`:`ctrlKey`;Zj.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=yM(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&lM(n,e.input.lastClick)&&!n[bM]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(cM(n));o&&(a==`singleClick`?e.input.mouseDown=new SM(e,o,n,!!r):(a==`doubleClick`?hM:gM)(e,o.pos,o.inside,n)?n.preventDefault():nM(e,`pointer`))};var xM=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},SM=class extends xM{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[bM],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof J&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!!(this.target&&Lk&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),nM(e,`pointer`)}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||rj(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(cM(e))),this.updateAllowDefault(e),this.allowDefault||!t?nM(this.view,`pointer`):mM(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Vk&&this.mightDrag&&!this.mightDrag.node.isAtom||zk&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(dM(this.view,K.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):nM(this.view,`pointer`)}move(e){this.updateAllowDefault(e),nM(this.view,`pointer`),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},CM=class extends xM{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),nM(this.view,`pointer`);let t=this.view.posAtCoords(cM(e)),n=t&&vM(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];dM(this.view,q.create(r,a,o),`pointer`)}};Zj.touchstart=e=>{e.input.lastTouch=Date.now(),yM(e),nM(e,`pointer`)},Zj.touchmove=e=>{e.input.lastTouch=Date.now(),nM(e,`pointer`)},Zj.contextmenu=e=>yM(e);function wM(e,t){return e.composing?!0:Vk&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var TM=Gk?5e3:-1;Qj.compositionstart=Qj.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof q&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||zk&&Wk&&EM(e)))e.markCursor=e.state.storedMarks||n.marks(),AM(e,!0),e.markCursor=null;else if(AM(e,!t.selection.empty),Lk&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}DM(e,TM)};function EM(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}Qj.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,DM(e,20))};function DM(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>AM(e),t))}function OM(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function kM(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=xk(t.focusNode,t.focusOffset),r=Sk(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function AM(e,t=!1){if(!(Gk&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),OM(e),t||e.docView&&e.docView.dirty){let n=tj(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function jM(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var MM=Fk&&Ik<15||Hk&&qk<604;Zj.copy=Qj.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=MM?null:n.clipboardData,{dom:o,text:s}=Fj(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):jM(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function NM(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function PM(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?FM(e,r.value,null,i,t):FM(e,r.textContent,r.innerHTML,i,t)},50)}function FM(e,t,n,r,i){let a=Ij(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||G.empty)))return!0;if(!a)return!1;let o=NM(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function IM(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}Qj.paste=(e,t)=>{let n=t;if(e.composing&&!Gk)return;let r=MM?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&FM(e,IM(r),r.getData(`text/html`),i,n)?n.preventDefault():PM(e,n)};var LM=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},RM=Uk?`altKey`:`ctrlKey`;function zM(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[RM]:!n}Zj.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(cM(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof J?i.to-1:i.to))){if(r&&r.mightDrag)o=J.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=J.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=Fj(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!zk||Bk>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(MM?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,MM||n.dataTransfer.setData(`text/plain`,c),e.dragging=new LM(l,zM(e,n),o)},Zj.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Qj.dragover=Qj.dragenter=(e,t)=>t.preventDefault(),Qj.drop=(e,t)=>{try{BM(e,t,e.dragging)}finally{e.dragging=null}};function BM(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(cM(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=Ij(e,IM(t.dataTransfer),MM?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&zM(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||G.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?PD(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&J.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new J(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(fj(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}Zj.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&rj(e)},20))},Zj.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},Zj.beforeinput=(e,t)=>{if(Gk&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,Ek(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in Qj)Zj[e]=Qj[e];function VM(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var HM=class e{constructor(e,t){this.toDOM=e,this.spec=t||qM,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new GM(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&VM(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},UM=class e{constructor(e,t){this.attrs=e,this.spec=t||qM}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new GM(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&VM(this.attrs,t.attrs)&&VM(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},WM=class e{constructor(e,t){this.attrs=e,this.spec=t||qM}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new GM(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&VM(this.attrs,t.attrs)&&VM(this.spec,t.spec)}destroy(){}},GM=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new HM(n,r))}static inline(t,n,r,i){return new e(t,n,new UM(r,i))}static node(t,n,r,i){return new e(t,n,new WM(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof UM}get widget(){return this.type instanceof HM}},KM=[],qM={},JM=class e{constructor(e,t){this.local=e.length?e:KM,this.children=t.length?t:KM}static create(e,t){return t.length?nN(t,e,0,qM):YM}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==YM||e.maps.length==0?this:this.mapInner(e,t,0,0,n||qM)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?ZM(this.children,o||[],t,n,r,i,a):o?new e(o.sort(rN),KM):YM}add(t,n){return n.length?this==YM?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=eN(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,nN(s,e,o+1,qM)),a+=3}});let o=QM(a?tN(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(rN):this.local,i||this.children)}remove(e){return e.length==0||this==YM?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==YM?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):YM}forChild(t,n){if(this==YM)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof UM){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(rN),KM);return r?new XM([t,r]):t}return r||YM}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return iN(this.localsInner(e))}localsInner(e){if(this==YM)return KM;if(e.inlineContent||!this.local.some(UM.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof UM||t.push(this.local[e]);return t}forEachSet(e){e(this)}};JM.empty=new JM([],[]),JM.removeOverlap=iN;var YM=JM.empty,XM=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,qM));return e.from(r)}forChild(t,n){if(n.isLeaf)return JM.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=YM&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length){if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}}return t?iN(n?t:t.sort(rN)):KM}static from(t){switch(t.length){case 0:return YM;case 1:return t[0];default:return new e(t.every(e=>e instanceof JM)?t:t.reduce((e,t)=>e.concat(t instanceof JM?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function ZM(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==YM?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=nN($M(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new JM(t.sort(rN),s)}function QM(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new GM(i.from+t,i.to+t,i.type))}return n}function $M(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function eN(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function tN(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function nN(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=eN(e,t,o+n);if(s){a=!0;let e=nN(s,t,n+o+1,r);e!=YM&&i.push(o,o+t.nodeSize,e)}});let o=QM(a?tN(e):e,-n).sort(rN);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new JM(o,i):YM}function rN(e,t){return e.from-t.from||e.to-t.to}function iN(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),aN(t,i+1,a.copy(r.to,a.to)));continue}a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),aN(t,i,r.copy(a.from,r.to)));break}}return t}function aN(e,t,n){for(;t<e.length&&rN(n,e[t])>0;)t++;e.splice(t,0,n)}function oN(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=YM&&t.push(r)}),e.cursorWrapper&&t.push(JM.create(e.state.doc,[e.cursorWrapper.deco])),XM.from(t)}var sN={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},cN=Fk&&Ik<=11,lN=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},uN=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new lN,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);Fk&&Ik<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Vk&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),cN&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,sN)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(pj(this.view)){if(this.suppressingSelectionUpdates)return rj(this.view);if(Fk&&Ik<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&_k(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=pk(n))t.add(n);for(let r=e.anchorNode;r;r=pk(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&pj(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||zk&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(Lk&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||gN(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Tk(n)&&(c=tj(e))&&c.eq(K.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,rj(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),pN(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,_N(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||rj(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Fk&&Ik<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?fk(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?fk(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}return e.type==`attributes`?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},dN=new WeakMap,fN=!1;function pN(e){if(!dN.has(e)&&(dN.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Lk,fN)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),fN=!0}}function mN(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return _k(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function hN(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return mN(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?mN(e,n):null}function gN(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function _N(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function vN(e,t,n,r){let{node:i,fromOffset:a,toOffset:o,from:s,to:c}=e.docView.parseRange(t,n),l=e.domSelectionRange(),u,d=l.anchorNode;if(d&&e.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:l.anchorOffset}],Tk(l)||u.push({node:l.focusNode,offset:l.focusOffset})),zk&&e.input.lastKeyCode===8)for(let e=o;e>a;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){o=e;break}if(!n||n.size)break}let f=e.state.doc,p=e.someProp(`domParser`)||bE.fromSchema(e.state.schema),m=f.resolve(s),h=null,g=p.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:o,preserveWhitespace:m.parent.type.whitespace!=`pre`||`full`,findPositions:u,ruleFromNode:yN(r),context:m});if(u&&u[0].pos!=null){let e=u[0].pos,t=u[1]&&u[1].pos;t??=e,h={anchor:e+s,head:t+s}}return{doc:g,sel:h,from:s,to:c}}var yN=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName==`BR`&&t.parentNode){if(Vk&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}if(t.parentNode.lastChild==t||Vk&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==`IMG`&&t.getAttribute(`mark-placeholder`))return{ignore:!0};return null},bN=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function xN(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=tj(e,t);if(n&&!e.state.selection.eq(n)){if(zk&&Gk&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,Ek(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=vN(e,t,n,i),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=EN(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(Hk&&e.input.lastIOSEnter>Date.now()-225||Gk)&&i.some(e=>e.nodeType==1&&!bN.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Ek(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m){if(r&&c instanceof q&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=SN(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof q&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Fk&&Ik<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((Hk&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,Ek(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&wN(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Ek(8,`Backspace`)))){Gk&&zk&&e.domObserver.suppressSelectionUpdates();return}zk&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Gk&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,Ek(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=SN(e,n.doc,l.sel);t&&!(zk&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||Fk&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v){if(h.pos==g.pos){Fk&&Ik<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>rj(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=CN(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x())}else e.dispatch(x())}function SN(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:fj(e,t.resolve(n.anchor),t.resolve(n.head))}function CN(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(W.from(l).eq(e))return{mark:s,type:o}}function wN(e,t,n,r,i){if(n-t<=i.pos-r.pos||TN(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(TN(a,!0,!0));return!o.parent.isTextblock||o.pos>n||TN(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function TN(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function EN(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c<a&&o<s){let e=r<=a&&r>=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l<a){let e=r<=a&&r>=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}var DN=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new eM,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(PN),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=AN(this),kN(this),this.nodeViews=MN(this),this.docView=FA(this.state.doc,ON(this),oN(this),this.dom,this),this.domObserver=new uN(this,(e,t,n,r)=>xN(this,e,t,n,r)),this.domObserver.start(),tM(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&iM(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(PN),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(OM(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=MN(this);NN(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&iM(this),this.editable=AN(this),kN(this);let o=oN(this),s=ON(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Qk(this);if(i){this.domObserver.stop();let t=l&&(Fk||zk)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&jN(n.selection,e.selection);if(l){let n=zk?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=kM(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=FA(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&hj(this)&&i.delaySelUpdate())?rj(this,t):(uj(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&eA(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(e.nodeType==1?e:e.parentNode)&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof J){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Zk(this,t.getBoundingClientRect(),e)}else Zk(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new LM(e.slice,e.move,r<0?void 0:J.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(Fk){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&rA(this.dom),rj(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return dA(this,e)}coordsAtPos(e,t=1){return hA(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return TA(this,t||this.state,e)}pasteHTML(e,t){return FM(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return FM(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return Fj(this,e)}destroy(){this.docView&&(rM(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],oN(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,gk())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return sM(this,e)}domSelectionRange(){let e=this.domSelection();return e?Vk&&this.root.nodeType===11&&Dk(this.dom.ownerDocument)==this.dom&&hN(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};DN.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function ON(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[GM.node(0,e.state.doc.content.size,t)]}function kN(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:GM.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function AN(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function jN(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function MN(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function NN(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function PN(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var FN={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},IN={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},LN=typeof navigator<`u`&&/Mac/.test(navigator.platform),RN=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),zN=0;zN<10;zN++)FN[48+zN]=FN[96+zN]=String(zN);for(var zN=1;zN<=24;zN++)FN[zN+111]=`F`+zN;for(var zN=65;zN<=90;zN++)FN[zN]=String.fromCharCode(zN+32),IN[zN]=String.fromCharCode(zN);for(var BN in FN)IN.hasOwnProperty(BN)||(IN[BN]=FN[BN]);function VN(e){var t=!(LN&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||RN&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?IN:FN)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var HN=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),UN=typeof navigator<`u`&&/Win/.test(navigator.platform);function WN(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))HN?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function GN(e){let t=Object.create(null);for(let n in e)t[WN(n)]=e[n];return t}function KN(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function qN(e){return new Y({props:{handleKeyDown:JN(e)}})}function JN(e){let t=GN(e);return function(e,n){let r=VN(n),i,a=t[KN(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[KN(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(UN&&n.ctrlKey&&n.altKey)&&(i=FN[n.keyCode])&&i!=r){let r=t[KN(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}function YN(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var XN=class e{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if(n!==`then`)return n===`run`?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if(t!==`then`)return t===`chain`?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:YN({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},ZN=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)==null||(n=n.getSelection())==null||n.removeAllRanges()}}),!0),QN=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),$N=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=mD(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},eP=e=>t=>e(t),tP=()=>({state:e,dispatch:t})=>VO(e,t),nP=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new q(r.doc.resolve(Math.max(o-1,0)))),!0},rP=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function iP(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var aP=e=>({tr:t,state:n,dispatch:r})=>{let i=iP(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},oP=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},sP=e=>e.content?/^text(\*|\+)/.test(e.content):!1,cP=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos<e.end())return e.pos;let r=t.nodes[e.parent.type.name].spec;return sP(r)?n===`left`?e.start()-1:e.end()+1:e.pos},lP=(e,t,n)=>({from:cP(e,n,`left`),to:cP(t,n,`right`)}),uP=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(i),{from:a,to:o}=lP(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.selection.empty||n.setSelection(q.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},dP=()=>({commands:e})=>e.keyboardShortcut(`Enter`),fP=()=>({state:e,dispatch:t})=>BO(e,t);function pP(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function mP(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:pP(t[r])?t[r].test(e[r]):t[r]===e[r])}function hP(e,t,n={}){return e.find(e=>e.type===t&&mP(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function gP(e,t,n={}){return!!hP(e,t,n)}function _P(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!hP([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&gP([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&gP([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function vP(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var yP=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=vP(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=_P(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=q.create(o,e.from,e.to);n.setSelection(t)}}return!0},bP=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function xP(e){return e instanceof q}function SP(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function CP(e,t=null){if(!t)return null;let n=K.atStart(e),r=K.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?q.create(e,SP(0,i,a),SP(e.content.size,i,a)):q.create(e,SP(t,i,a),SP(t,i,a))}function wP(){return[`Android`].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function TP(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function EP(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var DP=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(TP()||wP())&&r.dom.focus(),EP()&&!TP()&&!wP()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!xP(n.state.selection))return o(),!0;let s=CP(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},OP=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),kP=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),AP=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&AP(r)}return e};function jP(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return AP(n)}function MP(e){return typeof e?.nodesBetween==`function`}function NP(e,t,n){if(MP(e))return e;let r=typeof e==`object`&&!!e;n={slice:!0,parseOptions:{},...n};let i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return W.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),NP(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new gE({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?bE.fromSchema(a).parseSlice(jP(e),n.parseOptions):bE.fromSchema(a).parse(jP(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=bE.fromSchema(t);return n.slice?r.parseSlice(jP(e),n.parseOptions).content:r.parse(jP(e),n.parseOptions)}return NP(``,t,n)}function PP(e){return!(`type`in e)}function FP(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof sD||i instanceof cD))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(K.near(e.doc.resolve(o),n))}var IP=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{NP(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=NP(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0,f=PP(i)?i.content:[i];if(f.forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let p;if(u)p=Array.isArray(t)?t.map(e=>e.text||``).join(``):MP(t)?f.map(e=>e.text??``).join(``):typeof t==`object`&&t&&t.text?t.text:t,r.insertText(p,c,l);else{p=W.from(f);let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,i=t.isText||t.isTextblock,a=t.content.size>0;n&&i&&a&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&FP(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:p}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:p})}return!0};function LP(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var RP=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{pos:i,attrs:a,content:o,updateSelection:s=!0}=e,c;c=typeof i==`number`?t.doc.resolve(i):i||t.selection.$from;let l=LP(c.parent.contentMatchAt(c.index()));if(!l)return!1;let u=Object.keys(l.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{},f;if(o){let e=NP(o,r.schema);f=l.createAndFill(d,e)}else f=l.createAndFill(d);return f?(n&&(t.insert(c.pos,f),s&&FP(t,t.steps.length-1,-1)),!0):!1},zP=()=>({state:e,dispatch:t})=>FO(e,t),BP=()=>({state:e,dispatch:t})=>IO(e,t),VP=()=>({state:e,dispatch:t})=>wO(e,t),HP=()=>({state:e,dispatch:t})=>MO(e,t),UP=()=>({state:e,dispatch:t,tr:n})=>{try{let r=jD(e.doc,e.selection.$from.pos,-1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},WP=()=>({state:e,dispatch:t,tr:n})=>{try{let r=jD(e.doc,e.selection.$from.pos,1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},GP=()=>({state:e,dispatch:t})=>TO(e,t),KP=()=>({state:e,dispatch:t})=>EO(e,t);function qP(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function JP(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))TP()||qP()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var YP=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=JP(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function XP(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?iP(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>!o||o.name===e.node.type.name).filter(e=>mP(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var ZP=(e,t={})=>({state:n,dispatch:r})=>XP(n,iP(e,n.schema),t)?LO(n,r):!1,QP=()=>({state:e,dispatch:t})=>HO(e,t),$P=e=>({state:t,dispatch:n})=>ck(iP(e,t.schema))(t,n),eF=()=>({state:e,dispatch:t})=>RO(e,t);function tF(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function nF(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var rF=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=tF(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=iP(e,r.schema)),s===`mark`&&(o=vP(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,nF(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(nF(a.attrs,t))))})})}),c},iF=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),aF=()=>({tr:e,dispatch:t})=>{if(t){let t=new oO(e.doc);e.setSelection(t)}return!0},oF=()=>({state:e,dispatch:t})=>kO(e,t),sF=()=>({state:e,dispatch:t})=>NO(e,t),cF=()=>({state:e,dispatch:t})=>GO(e,t),lF=()=>({state:e,dispatch:t})=>ZO(e,t),uF=()=>({state:e,dispatch:t})=>XO(e,t);function dF(e,t,n={},r={}){return NP(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var fF=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=dF(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});if(o){let e=PP(s)?s.content:[s];a.replaceWith(0,c.content.size,e).setMeta(`preventUpdate`,!n)}return!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function pF(e,t){let n=vP(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function mF(e,t){let n=new $D(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function hF(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function gF(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function _F(e){return t=>gF(t.$from,e)}function Z(e,t,n){return e.config[t]===void 0&&e.parent?Z(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?Z(e.parent,t,n):null}):e.config[t]}function vF(e){return e.map(e=>{let t=Z(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...vF(t())]:e}).flat(10)}function yF(e,t){let n=PE.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function bF(e){return typeof e==`function`}function xF(e,t=void 0,...n){return bF(e)?t?e.bind(t)(...n):e(...n):e}function SF(e={}){return Object.keys(e).length===0&&e.constructor===Object}function CF(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function wF(e){let t=[],{nodeExtensions:n,markExtensions:r}=CF(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=Z(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=Z(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function TF(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function EF(e){let t=[],n=TF(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function DF(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(e===`__proto__`){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});return}if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...EF(n[e]),...EF(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function OF(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>DF(e,t),{})}function kF(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function AF(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):kF(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function jF(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&SF(t)?!1:t!=null))}function MF(e){var t,n;let r={};return!(e!=null&&(t=e.attribute)!=null&&t.isRequired)&&`default`in(e?.attribute||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function NF(e,t){let n=wF(e),{nodeExtensions:r,markExtensions:i}=CF(e),a=r.find(e=>Z(e,`topNode`))?.name;return new gE({topNode:a,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=jF({...e.reduce((e,t)=>{let n=Z(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:xF(Z(r,`content`,a)),marks:xF(Z(r,`marks`,a)),group:xF(Z(r,`group`,a)),inline:xF(Z(r,`inline`,a)),atom:xF(Z(r,`atom`,a)),selectable:xF(Z(r,`selectable`,a)),draggable:xF(Z(r,`draggable`,a)),code:xF(Z(r,`code`,a)),whitespace:xF(Z(r,`whitespace`,a)),linebreakReplacement:xF(Z(r,`linebreakReplacement`,a)),defining:xF(Z(r,`defining`,a)),isolating:xF(Z(r,`isolating`,a)),attrs:Object.fromEntries(i.map(MF))}),s=xF(Z(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>AF(e,i)));let c=Z(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:OF(e,i)}));let l=Z(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=jF({...e.reduce((e,t)=>{let n=Z(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:xF(Z(r,`inclusive`,a)),excludes:xF(Z(r,`excludes`,a)),group:xF(Z(r,`group`,a)),spanning:xF(Z(r,`spanning`,a)),code:xF(Z(r,`code`,a)),attrs:Object.fromEntries(i.map(MF))}),s=xF(Z(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>AF(e,i)));let c=Z(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:OF(e,i)})),[r.name,o]}))})}function PF(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function FF(e){return e.sort((e,t)=>{let n=Z(e,`priority`)||100,r=Z(t,`priority`)||100;return n>r?-1:+(n<r)})}function IF(e){let t=FF(vF(e)),n=PF(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function LF(e,t){return NF(IF(e),t)}function RF(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
18
+
19
+ `,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;if(e.isText){var d;s+=e==null||(d=e.text)==null?void 0:d.slice(Math.max(r,n)-n,i-n)}}),s}function zF(e,t){return RF(e,{from:0,to:e.content.size},t)}function BF(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function VF(e,t){let n=iP(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function HF(e,t){let n=tF(typeof t==`string`?t:t.name,e.schema);return n===`node`?VF(e,t):n===`mark`?pF(e,t):{}}function UF(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function WF(e){let t=UF(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function GF(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),WF(r)}function KF(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=_P(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&e?.nodeSize!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var qF=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]},JF=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return n===0?null:e.node(t).child(n-1)};function YF(e,t){return t.nodes[e]||t.marks[e]||null}function XF(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var ZF=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function QF(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?vP(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>mP(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>!a||a.name===e.mark.type.name).filter(e=>mP(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>!a||e.mark.type!==a&&e.mark.type.excludes(a)).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function $F(e,t,n={}){if(!t)return XP(e,null,n)||QF(e,null,n);let r=tF(t,e.schema);return r===`node`?XP(e,t,n):r===`mark`&&QF(e,t,n)}var eI=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=_F(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},tI=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function nI(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function rI(e,t){let{nodeExtensions:n}=CF(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=xF(Z(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function iI(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(iI(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function aI(e){return e instanceof J}function oI({selection:e,pos:t,nodeSize:n,selectedOnTextSelection:r=!1}){let{from:i,to:a}=e;return!!(i<=t&&a>=t+n||r&&xP(e)&&i>t&&a<t+n)}var sI=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function cI(e,t){let n=t.mapping.mapResult(e.position);return{position:new sI(n.pos),mapResult:n}}function lI(e){return new sI(e)}function uI(e,t,n){let r=e.state.doc.content.size,i=SP(t,0,r),a=SP(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function dI(e,t,n){let{selection:r}=t,i=null;if(xP(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var fI=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=vP(e,r.schema);if(i){if(o){let e=pF(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})})}return dI(r,n,c)},pI=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),mI=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=iP(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>$O(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>$O(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},hI=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=SP(e,0,n.content.size),i=J.create(n,r);t.setSelection(i)}return!0},gI=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},_I=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=q.atStart(n).from,o=q.atEnd(n).to,s=SP(r,a,o),c=SP(i,a,o),l=q.create(n,s,c);t.setSelection(l)}return!0},vI=e=>({state:t,dispatch:n})=>dk(iP(e,t.schema))(t,n);function yI(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var bI=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=XF(l,s.node().type.name,s.node().attrs);if(a instanceof J&&a.node.isBlock)return!s.parentOffset||!ED(o,s.pos)?!1:(r&&(e&&yI(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:LP(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=ED(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&ED(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof q&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&yI(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},xI=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=iP(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=W.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=W.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...XF(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(W.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new G(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(q.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...XF(d,u.type.name,u.attrs),...t},m={...XF(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!ED(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0};function SI(e){return!e||e===`1`?null:e}function CI(e,t){return SI(e)===SI(t)}var wI=(e,t)=>{let n=_F(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&OD(e.doc,n.pos))||!CI(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},TI=(e,t)=>{let n=_F(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&OD(e.doc,r))||!CI(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function EI(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return q.between(r,i)}var DI=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=iP(e,o.schema),m=iP(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=_F(e=>rI(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&rI(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,ee=!!x&&y.depth>=1&&y.depth-x.depth<=1,te=!!T;if((ee||te)&&E){if(E.node.type===p)return S&&te?c().command(({tr:e,dispatch:t})=>{let n=EI(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(rI(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>wI(a,p)).command(()=>TI(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>wI(a,p)).command(()=>TI(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>wI(a,p)).command(()=>TI(a,p)).run()},OI=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=vP(e,r.schema);return QF(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},kI=(e,t,n={})=>({state:r,commands:i})=>{let a=iP(e,r.schema),o=iP(t,r.schema),s=XP(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},AI=(e,t={})=>({state:n,commands:r})=>{let i=iP(e,n.schema);return XP(n,i,t)?r.lift(i):r.wrapIn(i,t)},jI=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},MI=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},NI=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=vP(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=_P(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},PI=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},FI=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=tF(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=iP(e,r.schema)),s===`mark`&&(o=vP(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},II=new X(`__tiptap_decorations__`),LI=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(II,{type:`force`,name:e}),!0),RI=(e,t={})=>({state:n,dispatch:r})=>QO(iP(e,n.schema),t)(n,r),zI=(e,t={})=>({state:n,dispatch:r})=>ak(iP(e,n.schema),t)(n,r),BI=gT({blur:()=>ZN,clearContent:()=>QN,clearNodes:()=>$N,command:()=>eP,createParagraphNear:()=>tP,cut:()=>nP,deleteCurrentNode:()=>rP,deleteNode:()=>aP,deleteRange:()=>oP,deleteSelection:()=>uP,enter:()=>dP,exitCode:()=>fP,extendMarkRange:()=>yP,first:()=>bP,focus:()=>DP,forEach:()=>OP,insertContent:()=>kP,insertContentAt:()=>IP,insertDefaultBlock:()=>RP,joinBackward:()=>VP,joinDown:()=>BP,joinForward:()=>HP,joinItemBackward:()=>UP,joinItemForward:()=>WP,joinTextblockBackward:()=>GP,joinTextblockForward:()=>KP,joinUp:()=>zP,keyboardShortcut:()=>YP,lift:()=>ZP,liftEmptyBlock:()=>QP,liftListItem:()=>$P,newlineInCode:()=>eF,resetAttributes:()=>rF,scrollIntoView:()=>iF,selectAll:()=>aF,selectNodeBackward:()=>oF,selectNodeForward:()=>sF,selectParentNode:()=>cF,selectTextblockEnd:()=>lF,selectTextblockStart:()=>uF,setContent:()=>fF,setMark:()=>fI,setMeta:()=>pI,setNode:()=>mI,setNodeSelection:()=>hI,setTextDirection:()=>gI,setTextSelection:()=>_I,sinkListItem:()=>vI,splitBlock:()=>bI,splitListItem:()=>xI,toggleList:()=>DI,toggleMark:()=>OI,toggleNode:()=>kI,toggleWrap:()=>AI,undoInputRule:()=>jI,unsetAllMarks:()=>MI,unsetMark:()=>NI,unsetTextDirection:()=>PI,updateAttributes:()=>FI,updateDecorations:()=>LI,wrapIn:()=>RI,wrapInList:()=>zI}),VI=new WeakMap;function HI(e,t){VI.set(e,(VI.get(e)??0)+1);try{return t()}finally{let t=(VI.get(e)??1)-1;t>0?VI.set(e,t):VI.delete(e)}}function UI(e){return VI.has(e)}var WI=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},GI=typeof process<`u`&&!1;function KI(e){return e.kind===`widget`}function qI(e,t){let n=[],r=new Set;for(let i of e)i.kind===`widget`&&KI(i)&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function JI(e,t,n){let{decorations:r,widgetKeys:i}=qI(t,n);return{set:JM.create(e,r),widgetKeys:i}}function YI({position:e,from:t,to:n,docSize:r}){return e<t?!1:e<n||e===n&&n===r}function XI({decorations:e,from:t,to:n,docSize:r,extensionName:i,warnedExtensions:a}){return e.filter(e=>YI({position:e.anchor,from:t,to:n,docSize:r})?!0:(e.anchor===n||a.has(i)||(a.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function ZI(e){let t=e.spec?.key;return typeof t==`string`?t:void 0}function QI(e){let t=new Map,n=new Map;for(let r of e.find()){let e=ZI(r);if(!e)continue;let i=r.spec.extensionName??`unknown`,a=t.get(e)??new Set;a.add(i),t.set(e,a),n.set(e,(n.get(e)??0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>(n.get(e)??0)>1)}function $I(e){return e.jsonID===`attr`}function eL(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||$I(e))return!0;let n=e;return typeof n.from==`number`&&typeof n.to==`number`}function tL(e,t){let n=null,r=0,i=0;for(let a=0;a<e.childCount&&!(i>t.to);a+=1){let o=i+e.child(a).nodeSize;o>=t.from&&(n===null&&(n=i),r=o),i=o}return n===null?null:{from:n,to:r}}function nL(e,t){if(e.steps.some(e=>!eL(e)))return{type:`full`};let n=GF(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!$I(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=tL(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:`ranges`,ranges:i}}function rL(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=e?.key;typeof t==`string`&&r.delete(t)}})}function iL(e,t,n){let r=t.decorationSetsByExtension[e]??JM.empty,i=new Set(t.widgetKeysByExtension[e]??[]);return{set:rL(r,n.mapping,n.doc,i),widgetKeys:i}}function aL(e,t){let n=Object.values(t).flatMap(e=>e.find());return JM.create(e,n)}function oL(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}function sL(e,t){switch(t.update??`document`){case`document`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case`changedRanges`:if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case`manual`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function cL(e,t,n){return n?!0:e.update===`manual`?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}var lL=new Set,uL=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=II.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>sL(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(`beforeTransaction`,this.handleBeforeTransaction)}destroy(){this.editor.off(`beforeTransaction`,this.handleBeforeTransaction)}liveWidgetKeys(){return II.getState(this.editor.state)?.widgetKeys??lL}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new Y({key:II,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:a}of t){let{set:t,widgetKeys:o}=this.buildFullSet(e,a,n);r[e]=t,i[e]=o}let a={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:oL(i)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,i,a)=>{let o=n.getMeta(II),s=o?.type===`force`&&!o.name,c=o?.type===`force`?o.name:void 0,l={},u={},d=new Set;return HI(e,()=>{for(let{name:o,spec:f}of t){let t=s||c===o;if(!cL(f,{editor:e,tr:n,oldState:i,newState:a},t)){let e=iL(o,r,n);l[o]=e.set,u[o]=e.widgetKeys}else if(f.update===`changedRanges`&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(o,f,r,n,a);l[o]=e.set,u[o]=e.widgetKeys,d.add(o)}else{let{set:e,widgetKeys:t}=this.buildFullSet(o,f,a);l[o]=e,u[o]=t,d.add(o)}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:l,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:l,recomputedNames:d}),widgetKeys:oL(u)}}},props:{decorations(e){return II.getState(e)?.mergedDecorationSet??JM.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let a=nL(r,i.doc);return a.type===`full`?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,a.ranges)}rebuildRanges(e,t,n,r,i,a){let o=n.decorationSetsByExtension[e]??JM.empty,s=new Set(n.widgetKeysByExtension[e]??[]),c=rL(o,r.mapping,r.doc,s),l=i.doc.content.size;for(let{from:n,to:r}of a){let a=c.find(n,r).filter(e=>YI({position:e.from,from:n,to:r,docSize:l}));for(let e of a){let t=ZI(e);t&&s.delete(t)}c=c.remove(a);let{decorations:o,widgetKeys:u}=qI(XI({decorations:this.runCreate(e,`createInRange`,()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:l,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);c=c.add(i.doc,o);for(let e of u)s.add(e)}return{set:c,widgetKeys:s}}buildFullSet(e,t,n){let r=this.runCreate(e,`create`,()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return JI(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!GI)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let t=QI(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(`, `);console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${n.size===1?``:`s`} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return n.length===1?t[n[0]]:aL(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return e.length===1?r[e[0].name]:i.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):aL(n.doc,r)}};function dL(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof J){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function fL(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function pL(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}function mL(){return typeof navigator<`u`&&/Firefox/.test(navigator.userAgent)}function hL(e){return typeof e==`number`}function gL(e){return Object.prototype.toString.call(e).slice(8,-1)}function _L(e){return gL(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function vL(e,t,n){let r=e.split(`
20
+ `),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],u=e.match(t.itemPattern);if(!u){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}return}let d=t.extractItemData(u),{indentLevel:f,mainContent:p}=d;a=`${a}${e}\n`;let m=[p];for(o+=1;o<r.length;){var c;let e=r[o];if(e.trim()===``){var l;let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((((l=r[o+1+t].match(/^(\s*)/))==null||(l=l[1])==null?void 0:l.length)||0)>f){m.push(e),a=`${a}${e}\n`,o+=1;continue}break}if((((c=e.match(/^(\s*)/))==null||(c=c[1])==null?void 0:c.length)||0)>f)m.push(e),a=`${a}${e}\n`,o+=1;else break}let h,g=m.slice(1);if(g.length>0){let e=g.map(e=>e.slice(f+s)).join(`
21
+ `);e.trim()&&(h=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let _=t.createToken(d,h);i.push(_)}if(i.length!==0)return{items:i,raw:a}}var yL=4;function bL(e){let t=0;for(let n of e)t=n===` `?t+yL-t%yL:t+1;return t}function xL(e,t,n,r,i){if(!e||!Array.isArray(e.content))return``;let a=typeof n==`function`?n(r):n,[o,...s]=e.content,c=`${a}${t.renderChildren([o])}`;return s&&s.length>0&&s.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=e=>{if(!i?.alignNestedToPrefix)return t.indent(e);let n=t.indent(``),r=bL(a);return(bL(n)>=r?n:` `.repeat(r))+e},o=r.split(`
22
+ `).map(e=>n(e||``)).join(`
23
+ `);c+=e.type===`paragraph`?`\n\n${o}`:`\n${o}`}}),c}function SL(e,t){let n={...e};return _L(e)&&_L(t)&&Object.keys(t).forEach(r=>{_L(t[r])&&_L(e[r])?n[r]=SL(e[r],t[r]):n[r]=t[r]}),n}function CL(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var wL=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},TL=(e,t)=>{if(pP(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function EL(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=ZF(c)+i;return a.forEach(e=>{if(l)return;let a=TL(u,e.find);if(!a)return;let d=a[0].length-i.length;if(d>0){let e=c.parentOffset-d;if(e<0||c.parent.textBetween(e,c.parentOffset)!==a[0].slice(0,d))return}let f=s.state.tr,p=YN({state:s.state,transaction:f}),m={from:n-(a[0].length-i.length),to:r},{commands:h,chain:g,can:_}=new XN({editor:t,state:p});e.handler({state:p,range:m,match:a,commands:h,chain:g,can:_})!==null&&f.steps.length&&(e.undoable&&f.setMeta(o,{transform:f,from:n,to:r,text:i}),s.dispatch(f),l=!0)}),l}function DL(e){let{editor:t,rules:n}=e,r=new Y({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:yF(W.from(e),a.schema);let{from:i}=s,o=i+e.length;EL({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return EL({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&EL({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?EL({editor:t,from:a.pos,to:a.pos,text:`
24
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var OL=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...xF(Z(this,`addOptions`,{name:this.name}))}}get storage(){return{...xF(Z(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>SL(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},kL=class e extends OL{constructor(...e){super(...e),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},AL=class{constructor(e){this.find=e.find,this.handler=e.handler}},jL=(e,t,n)=>{if(pP(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function ML(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new XN({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{var f;if((f=e.type)!=null&&(f=f.spec)!=null&&f.code||!(e.isText||e.isTextblock||e.isInline))return;let p=e.content?.size??e.nodeSize??0,m=Math.max(r,t),h=Math.min(i,t+p);m>=h||jL(e.isText?e.text||``:e.textBetween(m-t,h-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=m+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var NL=null,PL=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function FL(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr,l=YN({state:e,transaction:c});if(ML({editor:t,state:l,from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})&&c.steps.length){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new Y({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(NL=t)},i=()=>{NL&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=NL;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:yF(W.from(t),r.schema);let{from:n}=d,i=n+t.length,a=PL(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(hL(p)&&m&&p!==m.b)return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var IL=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=IF(e),this.schema=NF(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=Z(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:YF(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=FF([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:YF(t.name,this.schema)},r=[],i=Z(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&Z(t,`exitable`,n)&&(a.ArrowRight=()=>kL.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=qN(a);r.push(o);let s=Z(t,`addInputRules`,n);if(nI(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=DL({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=Z(t,`addPasteRules`,n);if(nI(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=FL({editor:e,rules:t});r.push(...n)}}let l=Z(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;(e=this.decorationManager)==null||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=Z(e,`addDecorations`,{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:YF(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new uL({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return wF(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=CF(this.extensions);return Object.fromEntries(t.filter(e=>!!Z(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=Z(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:iP(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=OF(r,n);return i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:l})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return FF([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:YF(n.name,this.schema)},i=Z(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return FF([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:YF(n.name,this.schema)},i=Z(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=CF(this.extensions);return Object.fromEntries(t.filter(e=>!!Z(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=Z(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:vP(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=OF(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{CL(i,e,t)}})}]:[]}))}destroy(){var e;(e=this.decorationManager)==null||e.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:YF(e.name,this.schema)};e.type===`mark`&&((xF(Z(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(xF(Z(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=Z(e,`onBeforeCreate`,t),r=Z(e,`onCreate`,t),i=Z(e,`onUpdate`,t),a=Z(e,`onSelectionUpdate`,t),o=Z(e,`onTransaction`,t),s=Z(e,`onFocus`,t),c=Z(e,`onBlur`,t),l=Z(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};IL.resolve=IF,IL.sort=FF,IL.flatten=vF;var LL=class e extends OL{constructor(...e){super(...e),this.type=`extension`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},RL=LL.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Y({key:new X(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=BF(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>RF(r,{from:e.pos,to:t.pos},s)).join(o??`
25
+
26
+ `)}}})]}}),zL=LL.create({name:`commands`,addCommands(){return{...BI}}}),BL=LL.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){var n;let r=()=>{var n,r;if(((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null||(r=n.filterTransaction)==null?void 0:r.call(n,e))??e.getMeta(`y-sync$`))return;let i=mF(e.before,[e,...t]);GF(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter&&i.mapping.mapResult(t.oldRange.to).deletedBefore&&i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let a=r+n.nodeSize-2,o=t.oldRange.from<=r&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:r,to:a,newFrom:i.mapping.map(r),newTo:i.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:i})})});let a=i.mapping;i.steps.forEach((t,n)=>{if(t instanceof iD){let r=a.slice(n).map(t.from,-1),o=a.slice(n).map(t.to),s=a.invert().map(r,-1),c=a.invert().map(o),l=r>0&&i.doc.nodeAt(r-1)?.marks.some(e=>e.eq(t.mark)),u=i.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:r,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:i})}})};((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null?void 0:n.async)??!0?setTimeout(r,0):r()}}),VL=LL.create({name:`drop`,addProseMirrorPlugins(){return[new Y({key:new X(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),HL=LL.create({name:`editable`,addProseMirrorPlugins(){return[new Y({key:new X(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),UL=new X(`focusEvents`),WL=LL.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new Y({key:UL,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),GL=LL.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:K.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return TP()||qP()?i:r},addProseMirrorPlugins(){return[new Y({key:new X(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=K.atStart(t.doc).from,l=K.atEnd(t.doc).to;if(a||o!==c||s!==l||!iI(n.doc))return;let u=n.tr,d=YN({state:n,transaction:u}),{commands:f}=new XN({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),KL=LL.create({name:`paste`,addProseMirrorPlugins(){return[new Y({key:new X(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),qL=LL.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Y({key:new X(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),JL=LL.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=CF(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Y({key:new X(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),YL=!1;function XL(e){if(YL)return;YL=!0;let t;try{t=sD.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof W||console.warn(`[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.`)}var ZL=class e{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e){if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r}r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},QL=`.ProseMirror {
27
+ position: relative;
28
+ }
29
+
30
+ .ProseMirror {
31
+ word-wrap: break-word;
32
+ white-space: pre-wrap;
33
+ white-space: break-spaces;
34
+ -webkit-font-variant-ligatures: none;
35
+ font-variant-ligatures: none;
36
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
37
+ }
38
+
39
+ .ProseMirror [contenteditable="false"] {
40
+ white-space: normal;
41
+ }
42
+
43
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
44
+ white-space: pre-wrap;
45
+ }
46
+
47
+ .ProseMirror pre {
48
+ white-space: pre-wrap;
49
+ }
50
+
51
+ img.ProseMirror-separator {
52
+ display: inline !important;
53
+ border: none !important;
54
+ margin: 0 !important;
55
+ width: 0 !important;
56
+ height: 0 !important;
57
+ }
58
+
59
+ .ProseMirror-gapcursor {
60
+ display: none;
61
+ pointer-events: none;
62
+ position: absolute;
63
+ margin: 0;
64
+ }
65
+
66
+ .ProseMirror-gapcursor:after {
67
+ content: "";
68
+ display: block;
69
+ position: absolute;
70
+ top: -2px;
71
+ width: 20px;
72
+ border-top: 1px solid black;
73
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
74
+ }
75
+
76
+ @keyframes ProseMirror-cursor-blink {
77
+ to {
78
+ visibility: hidden;
79
+ }
80
+ }
81
+
82
+ .ProseMirror-hideselection *::selection {
83
+ background: transparent;
84
+ }
85
+
86
+ .ProseMirror-hideselection *::-moz-selection {
87
+ background: transparent;
88
+ }
89
+
90
+ .ProseMirror-hideselection * {
91
+ caret-color: transparent;
92
+ }
93
+
94
+ .ProseMirror-focused .ProseMirror-gapcursor {
95
+ display: block;
96
+ }`,$L=class extends WI{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:cI,createMappablePosition:lI},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=CP(t,this.options.autofocus);this.editorState=vO.create({doc:t,schema:this.schema,selection:e||void 0})}XL(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():XN.createFakeChain()}can(){return this.commandManager?this.commandManager.can():XN.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=fL(QL,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return GI&&!this.hasWarnedStaleDecorationRead&&UI(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=bF(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[HL,RL.configure({blockSeparator:(e=this.options.coreExtensionOptions)==null||(e=e.clipboardTextSerializer)==null?void 0:e.blockSeparator}),zL,WL,GL,qL.configure({value:(t=this.options.coreExtensionOptions)==null||(t=t.tabindex)==null?void 0:t.value}),VL,KL,BL,JL.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions!=`object`||this.options.enableCoreExtensions[e.name]!==!1):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new IL(n,this)}createCommandManager(){this.commandManager=new XN({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=dF(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(e.message))throw e;let t=dF(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=vO.create({doc:t,schema:this.schema,selection:CP(t,this.options.autofocus)||void 0}),this.emit(`contentError`,{editor:this,error:e,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),this.editorState.doc}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new DN(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return HF(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return $F(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return yF(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
97
+
98
+ `,textSerializers:n={}}=e||{};return zF(this.state.doc,{blockSeparator:t,textSerializers:{...BF(this.schema),...n}})}get isEmpty(){return iI(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new ZL(t,this,!1,n)}get $doc(){return this.$pos(0)}};function eR(e){return new wL({find:e.find,handler:({state:t,range:n,match:r})=>{let i=xF(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(KF(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function tR(e){return new wL({find:e.find,handler:({state:t,range:n,match:r})=>{let i=xF(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function nR(e){return new wL({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=xF(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function rR(e){return new wL({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=xF(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&gD(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&OD(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var iR=class e extends OL{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},aR=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=()=>{try{return t.getPos()}catch{return}},this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){let{view:t}=this.editor,n=e.target,r=n.nodeType===3?n.parentElement?.closest(`[data-drag-handle]`):n.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(n)||!r)return;let i=0,a=0;if(this.dom!==r){let t=this.dom.getBoundingClientRect(),n=r.getBoundingClientRect(),o=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;i=n.x-t.x+o,a=n.y-t.y+s}let o=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();o.style.width=`${Math.round(e.width)}px`,o.style.height=`${Math.round(e.height)}px`,o.style.boxSizing=`border-box`,o.style.pointerEvents=`none`}catch{}let s=null;try{var c;s=document.createElement(`div`),s.style.position=`absolute`,s.style.top=`-9999px`,s.style.left=`-9999px`,s.style.pointerEvents=`none`,s.appendChild(o),document.body.appendChild(s),(c=e.dataTransfer)==null||c.setDragImage(o,i,a)}finally{s&&setTimeout(()=>{try{s?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=J.create(t.state.doc,l),d=t.state.tr.setSelection(u);t.dispatch(d)}stopEvent(e){if(!this.dom)return!1;if(typeof this.options.stopEvent==`function`)return this.options.stopEvent({event:e});let t=e.target;if(!this.dom.contains(t)||this.contentDOM?.contains(t))return!1;let n=e.type.startsWith(`drag`),r=e.type===`dragover`||e.type===`dragenter`,i=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!i&&!n)return!0;let{isEditable:a}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,c=J.isSelectable(this.node),l=e.type===`copy`,u=e.type===`paste`,d=e.type===`cut`,f=e.type===`mousedown`;if(!s&&c&&n&&e.target===this.dom&&e.preventDefault(),s&&n&&!o&&e.target===this.dom)return e.preventDefault(),!1;if(s&&a&&!o&&f){let e=t.closest(`[data-drag-handle]`);e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener(`dragend`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`drop`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`mouseup`,()=>{this.isDragging=!1},{once:!0}))}return!(o||r||i||l||u||d||f&&c)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type===`selection`||this.contentDOM.contains(e.target)&&e.type===`childList`&&(TP()||wP())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return typeof n==`number`&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){let e=this.getPos();if(typeof e!=`number`)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function oR(e){return new AL({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=xF(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(KF(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}function sR(e){return mr((t,n)=>({get(){return t(),e},set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var cR=class extends $L{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=sR(this.view.state),this.reactiveExtensionStorage=sR(this.extensionStorage),this.on(`beforeTransaction`,({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),$n(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){let n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){let t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},lR=Ja({name:`EditorContent`,props:{editor:{default:null,type:Object}},setup(e){let t=rr(),n=ku();return ra(()=>{let r=e.editor;r&&r.options.element&&t.value&&yi(()=>{if(!t.value||!r.view.dom?.parentNode)return;let e=lr(t.value);t.value.append(...r.view.dom.parentNode.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:e}),r.createNodeViews()})}),ps(()=>{let t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:t}},render(){return sd(`div`,{ref:e=>{this.rootEl=e}})}}),uR=Ja({name:`NodeViewContent`,props:{as:{type:String,default:`div`}},inject:{nodeViewContentRef:{default:void 0}},mounted(){let e=this.nodeViewContentRef;e&&this.$el&&e(this.$el)},beforeUnmount(){let e=this.nodeViewContentRef;e&&e(null)},render(){return sd(this.as,{style:{whiteSpace:`pre-wrap`},"data-node-view-content":``})}}),dR=Ja({name:`NodeViewWrapper`,props:{as:{type:String,default:`div`}},inject:[`onDragStart`,`decorationClasses`],render(){var e;return sd(this.as,{class:this.decorationClasses,style:{whiteSpace:`normal`},"data-node-view-wrapper":``,onDragstart:this.onDragStart},(e=this.$slots).default?.call(e))}}),fR=class{constructor(e,{props:t={},editor:n}){this.destroyed=!1,this.editor=n,this.component=$n(e),this.el=document.createElement(`div`),this.props=Wn(t),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,t;return(e=this.renderedComponent.vNode)!=null&&(e=e.component)!=null&&e.exposed?this.renderedComponent.vNode.component.exposed:(t=this.renderedComponent.vNode)==null||(t=t.component)==null?void 0:t.proxy}renderComponent(){if(this.destroyed)return this.renderedComponent;let e=sd(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<`u`&&this.el&&kp(e,this.el),{vNode:e,destroy:()=>{this.el&&kp(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){this.destroyed||(Object.entries(e).forEach(([e,t])=>{this.props[e]=t}),this.renderComponent())}destroy(){this.destroyed||(this.destroyed=!0,this.renderedComponent.destroy())}},pR=class extends aR{constructor(e,t,n){super(e,t,n),this.cachedExtensionWithSyncedStorage=null,this.handlePositionUpdate=()=>{let e=this.getPos();typeof e==`number`&&e!==this.currentPos&&(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}))},this.options.trackNodeViewPosition&&this.editor.on(`update`,this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()},t=e,n=this.onDragStart.bind(this);this.decorationClasses=rr(this.getDecorationClasses());let r=Ja({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:e=>{var t;return Qi(`onDragStart`,n),Qi(`decorationClasses`,this.decorationClasses),Qi(`nodeViewContentRef`,e=>{if(e&&e!==this.contentDOMElement){if(this.contentDOMElement)for(;this.contentDOMElement.firstChild;)e.appendChild(this.contentDOMElement.firstChild);this.contentDOMElement=e}}),(t=this.component).setup?.call(t,e,{expose:()=>void 0})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on(`selectionUpdate`,this.handleSelectionUpdate),this.currentPos=this.getPos(),this.node.isLeaf||(this.contentDOMElement=this.options.contentDOMElementTag?document.createElement(this.options.contentDOMElementTag):document.createElement(this.node.isInline?`span`:`div`),this.contentDOMElement.style.whiteSpace=`inherit`,this.contentDOMElement.dataset.nodeViewContentVue=``),this.renderer=new fR(r,{editor:this.editor,props:t})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){let e=this.getPos();if(typeof e==`number`){if(oI({selection:this.editor.state.selection,pos:e,nodeSize:this.node.nodeSize,selectedOnTextSelection:this.options.selectedOnTextSelection})){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}}update(e,t,n){let r=e=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(e)};if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(e.type!==this.node.type)return!1;if(e===this.node)return this.node=e,this.decorations=t,this.innerDecorations=n,this.decorationClasses.value=this.getDecorationClasses(),!0;this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos();let i={node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(i.getPos=()=>this.getPos()),r(i),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add(`ProseMirror-selectednode`)}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove(`ProseMirror-selectednode`)}getDecorationClasses(){return this.decorations.flatMap(e=>e.type.attrs.class).join(` `)}destroy(){this.renderer.destroy(),this.editor.off(`selectionUpdate`,this.handleSelectionUpdate),this.options.trackNodeViewPosition&&this.editor.off(`update`,this.handlePositionUpdate),this.contentDOMElement=null}};function mR(e,t){return n=>n.editor.contentComponent?new pR(typeof e==`function`&&`__vccOpts`in e?e.__vccOpts:e,n,t):{}}function hR(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=pL(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,h=Array.from(p.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),_=RegExp(`^[${i?.join(``)}\0]?$`).test(g);if(i!==null&&!_)return null;let v=m+h.index,y=v+h[0].length;return s&&l.test(p.slice(y-1,y+1))&&(h[0]+=` `,y+=1),v<o.pos&&y>=o.pos?{range:{from:v,to:y},query:h[0].slice(t.length),text:h[0]}:null}function gR(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,`
99
+ `);return/\s/.test(n)}):!1}function _R(e){return()=>{let t=e.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=e.view.coordsAtPos(t);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}}}function vR(e,t,n,r){return n?()=>{let n=r.getState(e.state)?.decorationId;return t.dom.querySelector(`[data-decoration-id="${n}"]`)?.getBoundingClientRect()||null}:_R(e)}function yR({match:e,dismissedRange:t,state:n,transaction:r,editor:i,shouldResetDismissed:a,effectiveAllowSpaces:o}){return a?.({editor:i,state:n,range:t,match:e,transaction:r,allowSpaces:o})?!1:o?e.range.from===t.from:e.range.from===t.from&&!gR(r)}function bR({view:e,pluginKeyRef:t}){let n=e.state.tr.setMeta(t,{exit:!0});e.dispatch(n)}function xR({pluginKey:e,decorationTag:t,decorationClass:n,decorationContent:r,decorationEmptyClass:i,renderer:a,dispatchExit:o}){return{handleKeyDown(t,n){var r;let i=e.getState(t.state);if(!i.active)return!1;if(n.key===`Escape`||n.key===`Esc`){var s;return a==null||(s=a.onKeyDown)==null||s.call(a,{view:t,event:n,range:i.range}),o(t),!0}return(a==null||(r=a.onKeyDown)==null?void 0:r.call(a,{view:t,event:n,range:i.range}))||!1},decorations(a){let{active:o,range:s,decorationId:c,query:l}=e.getState(a);if(!o)return null;let u=!l?.length,d=[n];return u&&d.push(i),JM.create(a.doc,[GM.inline(s.from,s.to,{nodeName:t,class:d.join(` `),"data-decoration-id":c||void 0,"data-decoration-content":r})])}}}function SR({editor:e,char:t,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,findSuggestionMatch:o,allow:s,shouldShow:c,shouldKeepDismissed:l,pluginKey:u}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(d,f,p,m){let{isEditable:h}=e,{composing:g}=e.view,{selection:_}=d,{empty:v,from:y}=_,b={...f},x=d.getMeta(u);if(x&&x.exit)return b.active=!1,b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null,b.dismissedRange=f.active?{...f.range}:f.dismissedRange,b;if(b.composing=g,d.docChanged&&b.dismissedRange!==null&&(b.dismissedRange={from:d.mapping.map(b.dismissedRange.from),to:d.mapping.map(b.dismissedRange.to)}),h&&(v||e.view.composing)){(y<f.range.from||y>f.range.to)&&!g&&!f.composing&&(b.active=!1);let u=o({char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:_.$from}),p=`id_${Math.floor(Math.random()*4294967295)}`;u&&s({editor:e,state:m,range:u.range,isActive:f.active})&&(!c||c({editor:e,range:u.range,query:u.query,text:u.text,transaction:d}))?(b.dismissedRange!==null&&!l({match:u,dismissedRange:b.dismissedRange,state:m,transaction:d})&&(b.dismissedRange=null),b.dismissedRange===null?(b.active=!0,b.decorationId=f.decorationId||p,b.range=u.range,b.query=u.query,b.text=u.text):b.active=!1):(u||(b.dismissedRange=null),b.active=!1)}else b.active=!1;return b.active||(b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null),b}}}function CR({editor:e,items:t}){let n=null,r=null,i=null,a=()=>{r!==null&&(clearTimeout(r),r=null),i?.(),i=null},o=e=>new Promise(t=>{i=t,r=setTimeout(()=>{r=null;let e=i;i=null,e?.()},e)}),s=()=>{n?.abort(),a(),n=null};return{abort:s,fetch:async(r,i)=>{s(),n=new AbortController;let a=n;if(i>0&&await o(i),n!==a||a.signal.aborted)return{status:`aborted`};try{let i=await t({editor:e,query:r,signal:a.signal});return n!==a||a.signal.aborted?{status:`aborted`}:{status:`resolved`,items:i}}catch{return n!==a||a.signal.aborted?{status:`aborted`}:{status:`error`}}}}}function wR({placement:e,offset:t,flip:n,floatingUi:r}){var i;let a=[aT({mainAxis:t.mainAxis??4,crossAxis:t.crossAxis??0})];return n&&a.push(cT()),r!=null&&(i=r.middleware)!=null&&i.length&&a.push(...r.middleware),{placement:e,strategy:r?.strategy??`absolute`,middleware:a}}function TR(e){if(e instanceof HTMLElement)return e;if(typeof e==`string`)try{let t=document.querySelector(e);if(t)return t}catch{return document.body}return document.body}function ER({getReferenceRect:e,contextElement:t,config:n,container:r,dismissOnOutsideClick:i,dismiss:a}){return(o,s={})=>{let c={getBoundingClientRect:()=>e()??new DOMRect,contextElement:t},l=!1,u=!o.isConnected;u&&TR(r).appendChild(o),s.onPosition||(o.style.visibility=`hidden`,o.style.width=`max-content`);let d=iT(c,o,()=>{mT(c,o,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:e,y:t,placement:n,strategy:r})=>{if(s.onPosition){s.onPosition({x:e,y:t,placement:n,strategy:r});return}Object.assign(o.style,{position:r,left:`${e}px`,top:`${t}px`}),l||(l=!0,o.style.visibility=``)})},s.autoUpdate),f;return i&&(f=e=>{let n=e.target;!(n instanceof Node)||o.contains(n)||t.contains(n)||a()},document.addEventListener(`pointerdown`,f,!0)),()=>{d(),f&&document.removeEventListener(`pointerdown`,f,!0),u&&o.remove()}}}function DR({editor:e,pluginKey:t,items:n,renderer:r,minQueryLength:i,debounce:a,initialItems:o,placement:s,offset:c,container:l,flip:u,floatingUi:d,dismissOnOutsideClick:f,command:p,clientRectFor:m,dispatchExit:h}){let g,_=CR({editor:e,items:n}),v=wR({placement:s,offset:c,flip:u,floatingUi:d});function y(e,t){switch(e){case`started`:var n;r==null||(n=r.onStart)==null||n.call(r,t);break;case`updated`:var i;r==null||(i=r.onUpdate)==null||i.call(r,t);break;case`stopped`:var a;r==null||(a=r.onExit)==null||a.call(r,t)}}return{update:async(n,d)=>{let b=t.getState(d),x=t.getState(n.state);if(!b||!x)return;let S=null,C=b.query!==x.query,w=b.text!==x.text,T=b.range.from!==x.range.from||b.range.to!==x.range.to,E=C||w||T;if(!b.active&&x.active)S=`started`;else if(b.active&&!x.active)S=`stopped`;else if(x.active&&E)S=`updated`;else return;let ee=S===`stopped`?b:x,te=n.dom.querySelector(`[data-decoration-id="${ee.decorationId}"]`),ne=m(n,te),D=i===0||(ee.query?ee.query.length>=i:!1),re=(S===`started`||S===`updated`)&&D;if(g={editor:e,range:ee.range,query:ee.query||``,text:ee.text||``,items:o??[],command:t=>p({editor:e,range:ee.range,props:t}),decorationNode:te,clientRect:ne,loading:re,placement:s,offset:{mainAxis:c.mainAxis??4,crossAxis:c.crossAxis??0},container:l,flip:u,floatingUi:v,mount:ER({getReferenceRect:ne,contextElement:n.dom,config:v,container:l,dismissOnOutsideClick:f,dismiss:()=>h(e.view)})},S===`started`){var ie;r==null||(ie=r.onBeforeStart)==null||ie.call(r,g)}if(S===`updated`){var ae;r==null||(ae=r.onBeforeUpdate)==null||ae.call(r,g)}if(S===`started`&&y(S,g),S===`started`||S===`updated`){if(!re)_.abort(),g={...g,items:o??[],loading:!1};else{g={...g,items:o??[],loading:!0},S=`updated`,y(S,g);let e=await _.fetch(ee.query||``,a);if(e.status===`aborted`)return;if(!t.getState(n.state)?.active){_.abort();return}g=e.status===`resolved`?{...g,items:e.items,loading:!1}:{...g,loading:!1}}}if(S===`stopped`){_.abort(),y(S,g),g=void 0;return}S===`updated`&&y(S,g)},destroy:()=>{var e;_.abort(),g&&(r==null||(e=r.onExit)==null||e.call(r,g))}}}var OR=new X(`suggestion`);function kR({pluginKey:e=OR,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],minQueryLength:p=0,debounce:m=0,initialItems:h,placement:g=`bottom-start`,offset:_={},container:v,flip:y=!0,floatingUi:b,dismissOnOutsideClick:x=!0,render:S=()=>({}),allow:C=()=>!0,findSuggestionMatch:w=hR,shouldShow:T,shouldResetDismissed:E}){let ee=S?.(),te=r&&!i,ne=(n,r)=>vR(t,n,r,e);function D(e){return yR({...e,editor:t,shouldResetDismissed:E,effectiveAllowSpaces:te})}let re=t=>bR({view:t,pluginKeyRef:e});return new Y({key:e,view:()=>DR({editor:t,pluginKey:e,items:f,renderer:ee,minQueryLength:p,debounce:m,initialItems:h,placement:g,offset:_,container:v,flip:y,floatingUi:b,dismissOnOutsideClick:x,command:d,clientRectFor:ne,dispatchExit:re}),state:SR({editor:t,char:n,effectiveAllowSpaces:te,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,findSuggestionMatch:w,allow:C,shouldShow:T,shouldKeepDismissed:D,pluginKey:e}),props:xR({pluginKey:e,decorationTag:s,decorationClass:c,decorationContent:l,decorationEmptyClass:u,renderer:ee,dispatchExit:re})})}var AR=kR,jR=new WeakSet,MR=new WeakSet;function NR(e){let t=e;return jR.add(t),t}function PR(e){return Array.isArray(e)&&jR.has(e)}function FR(e){return e.flatMap(e=>e==null?[]:Array.isArray(e)&&MR.has(e)&&!PR(e)?FR(e):[e])}function IR(e,t){if(e===`slot`)return 0;if(e instanceof Function){let n=e(t);return Array.isArray(n)&&!PR(n)&&!MR.has(n)?NR(n):n}let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);if(Array.isArray(n)){if(PR(n))return NR([e,r,n]);if(n.length===0)return NR([e,r]);let t=FR(n);return t.length===0?NR([e,r]):NR([e,r,...t])}return NR(n==null?[e,r]:[e,r,n])}var LR=(e,t)=>IR(e,t),RR=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new G(n,0,0);return e.replace(l,i.after(),r),e.setSelection(q.create(e.doc,l+n.size)),e.scrollIntoView(),t(e),!0})},zR=/^\s*>\s$/,BR=iR.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return LR(`blockquote`,{...DF(this.options.HTMLAttributes,e),children:LR(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
100
+ `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
101
+ `))}),n.join(`
102
+ >
103
+ `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>RR(this.editor,this.type)}},addInputRules(){return[rR({find:zR,type:this.type})]}}),VR=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,HR=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,UR=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,WR=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,GR=kL.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return LR(`strong`,{...DF(this.options.HTMLAttributes,e),children:LR(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[eR({find:VR,type:this.type}),eR({find:UR,type:this.type})]},addPasteRules(){return[oR({find:HR,type:this.type}),oR({find:WR,type:this.type})]}}),KR=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},qR=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},JR=kL.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,DF(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[eR({find:KR,type:this.type})]},addPasteRules(){return[oR({find:qR,type:this.type})]}}),YR=4,XR=/^```([a-z]+)?[\s\n]$/,ZR=/^~~~([a-z]+)?[\s\n]$/,QR=iR.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:YR,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,DF(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
104
+ `):`\`\`\`${r}\n\n\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??YR,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
105
+ `,`
106
+ `).split(`
107
+ `).map(e=>o+e).join(`
108
+ `);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??YR,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
109
+ `,`
110
+ `).split(`
111
+ `),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(q.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
112
+ `,`
113
+ `).split(`
114
+ `).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
115
+ `);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
116
+
117
+ `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let a=r.before();return a>0?!1:e.commands.insertDefaultBlock({pos:a})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(K.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[nR({find:XR,type:this.type,getAttributes:e=>({language:e[1]})}),nR({find:ZR,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Y({key:new X(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
118
+ `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(q.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),$R=iR.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
119
+
120
+ `):``}),ez=iR.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,DF(this.options.HTMLAttributes,e)]},renderText(){return`
121
+ `},renderMarkdown:()=>`
122
+ `,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),tz=iR.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,DF(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>nR({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),nz=iR.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,DF(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!dL(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return aI(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(q.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(J.create(t.doc,n.pos)):t.setSelection(q.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(q.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[tR({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),rz=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,iz=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,az=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,oz=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,sz=kL.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,DF(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[eR({find:rz,type:this.type}),eR({find:az,type:this.type})]},addPasteRules(){return[oR({find:iz,type:this.type}),oR({find:oz,type:this.type})]}}),cz=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,lz=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,uz=`numeric`,dz=`ascii`,fz=`alpha`,pz=`asciinumeric`,mz=`alphanumeric`,hz=`domain`,gz=`emoji`,_z=`scheme`,vz=`slashscheme`,yz=`whitespace`;function bz(e,t){return e in t||(t[e]=[]),t[e]}function xz(e,t,n){t[uz]&&(t[pz]=!0,t[mz]=!0),t[dz]&&(t[pz]=!0,t[fz]=!0),t[pz]&&(t[mz]=!0),t[fz]&&(t[mz]=!0),t[mz]&&(t[hz]=!0),t[gz]&&(t[hz]=!0);for(let r in t){let t=bz(r,n);t.indexOf(e)<0&&t.push(e)}}function Sz(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Cz(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Cz.groups={},Cz.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=Cz.groups;let i;return t&&t.j?i=t:(i=new Cz(t),n&&r&&xz(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=Cz.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new Cz,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new Cz,a&&(r&&(o.t&&typeof o.t==`string`?xz(a,Object.assign(Sz(o.t,r),n),r):n&&xz(a,n,r)),o.t=a),i.j[e]=o,o}};var Q=(e,t,n,r,i)=>e.ta(t,n,r,i),wz=(e,t,n,r,i)=>e.tr(t,n,r,i),Tz=(e,t,n,r,i)=>e.ts(t,n,r,i),$=(e,t,n,r,i)=>e.tt(t,n,r,i),Ez=`WORD`,Dz=`UWORD`,Oz=`ASCIINUMERICAL`,kz=`ALPHANUMERICAL`,Az=`LOCALHOST`,jz=`TLD`,Mz=`UTLD`,Nz=`SCHEME`,Pz=`SLASH_SCHEME`,Fz=`NUM`,Iz=`WS`,Lz=`NL`,Rz=`OPENBRACE`,zz=`CLOSEBRACE`,Bz=`OPENBRACKET`,Vz=`CLOSEBRACKET`,Hz=`OPENPAREN`,Uz=`CLOSEPAREN`,Wz=`OPENANGLEBRACKET`,Gz=`CLOSEANGLEBRACKET`,Kz=`FULLWIDTHLEFTPAREN`,qz=`FULLWIDTHRIGHTPAREN`,Jz=`LEFTCORNERBRACKET`,Yz=`RIGHTCORNERBRACKET`,Xz=`LEFTWHITECORNERBRACKET`,Zz=`RIGHTWHITECORNERBRACKET`,Qz=`FULLWIDTHLESSTHAN`,$z=`FULLWIDTHGREATERTHAN`,eB=`AMPERSAND`,tB=`APOSTROPHE`,nB=`ASTERISK`,rB=`AT`,iB=`BACKSLASH`,aB=`BACKTICK`,oB=`CARET`,sB=`COLON`,cB=`COMMA`,lB=`DOLLAR`,uB=`DOT`,dB=`EQUALS`,fB=`EXCLAMATION`,pB=`HYPHEN`,mB=`PERCENT`,hB=`PIPE`,gB=`PLUS`,_B=`POUND`,vB=`QUERY`,yB=`QUOTE`,bB=`FULLWIDTHMIDDLEDOT`,xB=`SEMI`,SB=`SLASH`,CB=`TILDE`,wB=`UNDERSCORE`,TB=`EMOJI`,EB=`SYM`,DB=Object.freeze({__proto__:null,ALPHANUMERICAL:kz,AMPERSAND:eB,APOSTROPHE:tB,ASCIINUMERICAL:Oz,ASTERISK:nB,AT:rB,BACKSLASH:iB,BACKTICK:aB,CARET:oB,CLOSEANGLEBRACKET:Gz,CLOSEBRACE:zz,CLOSEBRACKET:Vz,CLOSEPAREN:Uz,COLON:sB,COMMA:cB,DOLLAR:lB,DOT:uB,EMOJI:TB,EQUALS:dB,EXCLAMATION:fB,FULLWIDTHGREATERTHAN:$z,FULLWIDTHLEFTPAREN:Kz,FULLWIDTHLESSTHAN:Qz,FULLWIDTHMIDDLEDOT:bB,FULLWIDTHRIGHTPAREN:qz,HYPHEN:pB,LEFTCORNERBRACKET:Jz,LEFTWHITECORNERBRACKET:Xz,LOCALHOST:Az,NL:Lz,NUM:Fz,OPENANGLEBRACKET:Wz,OPENBRACE:Rz,OPENBRACKET:Bz,OPENPAREN:Hz,PERCENT:mB,PIPE:hB,PLUS:gB,POUND:_B,QUERY:vB,QUOTE:yB,RIGHTCORNERBRACKET:Yz,RIGHTWHITECORNERBRACKET:Zz,SCHEME:Nz,SEMI:xB,SLASH:SB,SLASH_SCHEME:Pz,SYM:EB,TILDE:CB,TLD:jz,UNDERSCORE:wB,UTLD:Mz,UWORD:Dz,WORD:Ez,WS:Iz}),OB=/[a-z]/,kB=/\p{L}/u,AB=/\p{Emoji}/u,jB=/\d/,MB=/\s/,NB=`\r`,PB=`
123
+ `,FB=`️`,IB=`‍`,LB=``,RB=null,zB=null;function BB(e=[]){let t={};Cz.groups=t;let n=new Cz;RB??=WB(cz),zB??=WB(lz),$(n,`'`,tB),$(n,`{`,Rz),$(n,`}`,zz),$(n,`[`,Bz),$(n,`]`,Vz),$(n,`(`,Hz),$(n,`)`,Uz),$(n,`<`,Wz),$(n,`>`,Gz),$(n,`(`,Kz),$(n,`)`,qz),$(n,`「`,Jz),$(n,`」`,Yz),$(n,`『`,Xz),$(n,`』`,Zz),$(n,`<`,Qz),$(n,`>`,$z),$(n,`&`,eB),$(n,`*`,nB),$(n,`@`,rB),$(n,"`",aB),$(n,`^`,oB),$(n,`:`,sB),$(n,`,`,cB),$(n,`$`,lB),$(n,`.`,uB),$(n,`=`,dB),$(n,`!`,fB),$(n,`-`,pB),$(n,`%`,mB),$(n,`|`,hB),$(n,`+`,gB),$(n,`#`,_B),$(n,`?`,vB),$(n,`"`,yB),$(n,`/`,SB),$(n,`;`,xB),$(n,`~`,CB),$(n,`_`,wB),$(n,`\\`,iB),$(n,`・`,bB);let r=wz(n,jB,Fz,{[uz]:!0});wz(r,jB,r);let i=wz(r,OB,Oz,{[pz]:!0}),a=wz(r,kB,kz,{[mz]:!0}),o=wz(n,OB,Ez,{[dz]:!0});wz(o,jB,i),wz(o,OB,o),wz(i,jB,i),wz(i,OB,i);let s=wz(n,kB,Dz,{[fz]:!0});wz(s,OB),wz(s,jB,a),wz(s,kB,s),wz(a,jB,a),wz(a,OB),wz(a,kB,a);let c=$(n,PB,Lz,{[yz]:!0}),l=$(n,NB,Iz,{[yz]:!0}),u=wz(n,MB,Iz,{[yz]:!0});$(n,LB,u),$(l,PB,c),$(l,LB,u),wz(l,MB,u),$(u,NB),$(u,PB),wz(u,MB,u),$(u,LB,u);let d=wz(n,AB,TB,{[gz]:!0});$(d,`#`),wz(d,AB,d),$(d,FB,d);let f=$(d,IB);$(f,`#`),wz(f,AB,d);let p=[[OB,o],[jB,i]],m=[[OB,null],[kB,s],[jB,a]];for(let e=0;e<RB.length;e++)UB(n,RB[e],jz,Ez,p);for(let e=0;e<zB.length;e++)UB(n,zB[e],Mz,Dz,m);xz(jz,{tld:!0,ascii:!0},t),xz(Mz,{utld:!0,alpha:!0},t),UB(n,`file`,Nz,Ez,p),UB(n,`mailto`,Nz,Ez,p),UB(n,`http`,Pz,Ez,p),UB(n,`https`,Pz,Ez,p),UB(n,`ftp`,Pz,Ez,p),UB(n,`ftps`,Pz,Ez,p),xz(Nz,{scheme:!0,ascii:!0},t),xz(Pz,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[_z]:!0}:{[vz]:!0};r.indexOf(`-`)>=0?i[hz]=!0:OB.test(r)?jB.test(r)?i[pz]=!0:i[dz]=!0:i[uz]=!0,Tz(n,r,r,i)}return Tz(n,`localhost`,Az,{ascii:!0}),n.jd=new Cz(EB),{start:n,tokens:Object.assign({groups:t},DB)}}function VB(e,t){let n=HB(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function HB(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function UB(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new Cz(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new Cz(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function WB(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var GB={defaultProtocol:`http`,events:null,format:qB,formatHref:qB,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function KB(e,t=null){let n=Object.assign({},GB);e&&(n=Object.assign(n,e instanceof KB?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}KB.prototype={o:GB,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:GB[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function qB(e){return e}function JB(e,t){this.t=`token`,this.v=e,this.tk=t}JB.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=GB.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function YB(e,t){class n extends JB{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var XB=YB(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),ZB=YB(`text`),QB=YB(`nl`),$B=YB(`url`,{isLink:!0,toHref(e=GB.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==Az&&e[1].t===sB}}),eV=e=>new Cz(e);function tV({groups:e}){let t=e.domain.concat([eB,nB,rB,iB,aB,oB,lB,dB,pB,Fz,mB,hB,gB,_B,SB,EB,CB,wB]),n=[tB,sB,cB,uB,fB,mB,vB,yB,xB,Wz,Gz,Rz,zz,Vz,Bz,Hz,Uz,Kz,qz,Jz,Yz,Xz,Zz,Qz,$z],r=[eB,tB,nB,iB,aB,oB,lB,dB,pB,Rz,zz,mB,hB,gB,_B,vB,SB,EB,CB,wB],i=eV(),a=$(i,CB);Q(a,r,a),Q(a,e.domain,a);let o=eV(),s=eV(),c=eV();Q(i,e.domain,o),Q(i,e.scheme,s),Q(i,e.slashscheme,c),Q(o,r,a),Q(o,e.domain,o);let l=$(o,rB);$(a,rB,l),$(s,rB,l),$(c,rB,l);let u=$(a,uB);Q(u,r,a),Q(u,e.domain,a);let d=eV();Q(l,e.domain,d),Q(d,e.domain,d);let f=$(d,uB);Q(f,e.domain,d);let p=eV(XB);Q(f,e.tld,p),Q(f,e.utld,p),$(l,Az,p);let m=$(d,pB);$(m,pB,m),Q(m,e.domain,d),Q(p,e.domain,d),$(p,uB,f),$(p,pB,m);let h=$(o,pB),g=$(o,uB);$(h,pB,h),Q(h,e.domain,o),Q(g,r,a),Q(g,e.domain,o);let _=eV($B);Q(g,e.tld,_),Q(g,e.utld,_),Q(_,e.domain,o),Q(_,r,a),$(_,uB,g),$(_,pB,h),$(_,rB,l);let v=$(_,sB),y=eV($B);Q(v,e.numeric,y);let b=eV($B),x=eV();Q(b,t,b),Q(b,n,x),Q(x,t,b),Q(x,n,x),$(_,SB,b),$(y,SB,b);let S=$(s,sB),C=$($($(c,sB),SB),SB);Q(s,e.domain,o),$(s,uB,g),$(s,pB,h),Q(c,e.domain,o),$(c,uB,g),$(c,pB,h),Q(S,e.domain,b),$(S,SB,b),$(S,vB,b),Q(C,e.domain,b),Q(C,t,b),$(C,SB,b);let w=[[Rz,zz],[Bz,Vz],[Hz,Uz],[Wz,Gz],[Kz,qz],[Jz,Yz],[Xz,Zz],[Qz,$z]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=$(b,r);$(x,r,a);let o=eV($B);Q(a,t,o);let s=eV();Q(a,n,s),$(a,i,b),Q(o,t,o),Q(o,n,s),Q(s,t,o),Q(s,n,s),$(o,i,b),$(s,i,b)}return $(i,Az,_),$(i,Lz,QB),{start:i,tokens:DB}}function nV(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(rV(ZB,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(rV(e,t,r))}}return o.length>0&&a.push(rV(ZB,t,o)),a}function rV(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var iV=typeof console<`u`&&console&&console.warn||(()=>{}),aV=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,oV={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function sV(){return Cz.groups={},oV.scanner=null,oV.parser=null,oV.tokenQueue=[],oV.pluginQueue=[],oV.customSchemes=[],oV.initialized=!1,oV}function cV(e,t=!1){if(oV.initialized&&iV(`linkifyjs: already initialized - will not register custom scheme "${e}" ${aV}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
124
+ 1. Must only contain digits, lowercase ASCII letters or "-"
125
+ 2. Cannot start or end with "-"
126
+ 3. "-" cannot repeat`);oV.customSchemes.push([e,t])}function lV(){oV.scanner=BB(oV.customSchemes);for(let e=0;e<oV.tokenQueue.length;e++)oV.tokenQueue[e][1]({scanner:oV.scanner});oV.parser=tV(oV.scanner.tokens);for(let e=0;e<oV.pluginQueue.length;e++)oV.pluginQueue[e][1]({scanner:oV.scanner,parser:oV.parser});return oV.initialized=!0,oV}function uV(e){return oV.initialized||lV(),nV(oV.parser.start,e,VB(oV.scanner.start,e))}uV.scan=VB;function dV(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new KB(n),i=uV(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var fV=`[\0- \xA0 ᠎ -\u2029  ]`,pV=new RegExp(fV),mV=RegExp(`${fV}$`),hV=new RegExp(fV,`g`);function gV(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function _V(e){return new Y({key:new X(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(GF(mF(n.doc,[...t])).forEach(({newRange:t})=>{let n=hF(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!mV.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(pV).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=uV(n).map(t=>t.toObject(e.defaultProtocol));if(!gV(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{KF(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function vV(e){return new Y({key:new X(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=HF(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}var yV=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,bV=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function xV(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;--r)n+=1;return n%2==1}function SV(e,t){let n=0,r=0;for(;r<t;){if(e[r]!=="`"){r+=1;continue}if(n===0&&xV(e,r)){r+=1;continue}let i=0;for(;r<t&&e[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function CV(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||xV(e,t.index??0)||SV(e,t.index??0)?!1:!!r.trim()&&n(i)}function wV(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function TV(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function EV(e){return{href:e.data?.href,title:e.data?.title??null}}function DV(e){let t=eR({find:t=>{let n=yV.exec(t);return!n||!CV(t,n,e.isAllowedHref)?null:wV(n)},type:e.type,getAttributes:EV});return new wL({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function OV(e){let t=oR({find:t=>{let n=[];for(let r of t.matchAll(bV))CV(t,r,e.isAllowedHref)&&n.push(wV(r));let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>TV(t,e)));return[...n,...r]},type:e.type,getAttributes:EV});return new AL({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.match.data?.markdown&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function kV(e){return new Y({key:new X(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=dV(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function AV(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(hV,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var jV=kL.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){cV(e);return}cV(e.scheme,e.optionalSlashes)})},onDestroy(){sV()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!AV(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target??null},rel:{default:this.options.HTMLAttributes.rel??null},class:{default:this.options.HTMLAttributes.class??null},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!AV(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!AV(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,DF(this.options.HTMLAttributes,e),0]:[`a`,DF(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!AV(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!AV(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addInputRules(){return this.options.markdownLinks?[DV({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!AV(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let e=e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options;dV(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!AV(e,n),protocols:n,defaultProtocol:r})).forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t};return this.options.markdownLinks?[OV({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!AV(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[oR({find:e,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(_V({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!AV(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(vV({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(kV({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),MV=`listItem`,NV=`textStyle`,PV=/^\s*([-+*])\s$/,FV=iR.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,DF(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
127
+ `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(MV,this.editor.getAttributes(NV)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=rR({find:PV,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=rR({find:PV,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(NV),editor:this.editor})),[e]}}),IV=(e,t,n)=>{let{selection:r}=e;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a<0)return null;let o=i.node(a),s=i.index(a);if(s+1>=o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l&&e.childCount>1&&(u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},LV=(e,t,n,r)=>{let i=IV(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:s,insertPos:c,items:l}=i,u=e.tr;u.delete(s,s+o.nodeSize);let d=u.mapping.map(c);return u.insert(d,W.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},RV=(e,t,n)=>LV(e.state,e.view.dispatch,t,n),zV=(e,t)=>LL.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>RV(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),BV=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],VV=`abcdefghijklmnopqrstuvwxyz`,HV=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function UV(e){let t=e,n=``;for(let[e,r]of BV)for(;t>=e;)n+=r,t-=e;return n}function WV(e){return UV(e).toUpperCase()}function GV(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of BV)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function KV(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=GV(e);return t<=0?!1:(e===e.toLowerCase()?UV(t):WV(t))===e}function qV(e){let t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){let e=t.charCodeAt(0)-97,n=t.charCodeAt(1)-97;return(e+1)*26+n+1}return 0}function JV(e){if(e<=26)return VV[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?VV[n]:VV[t]+VV[n]}function YV(e){if(e&&!/^\d+$/.test(e)){if(KV(e))return e===e.toLowerCase()?`i`:`I`;if(/^[a-z]{1,2}$/.test(e))return`a`;if(/^[A-Z]{1,2}$/.test(e))return`A`}}function XV(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=YV(e);if(t===`i`||t===`I`)return GV(e);if(t===`a`||t===`A`){let t=qV(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function ZV(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return JV(t);case`A`:return JV(t).toUpperCase();case`i`:return UV(t);case`I`:return WV(t);default:return String(t)}}function QV(e){if(e.length===0)return!1;let t=YV(e[0])??`numeric`,n=XV(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=ZV(t,n+r);if(e[r]!==i)return!1}return!0}function $V(e){return{type:YV(e),start:XV(e)}}function eH(e){let{type:t,start:n}=$V(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function tH(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${JV(r)}${n}`;case`A`:return`${JV(r).toUpperCase()}${n}`;case`i`:return`${UV(r)}${n}`;case`I`:return`${WV(r)}${n}`;default:return`${r}${n}`}}function nH(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function rH(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var iH=iR.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,DF(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(nH(e))return{type:`listItem`,content:[{type:`paragraph`,content:rH(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>xL(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){var t,n;let r=((t=e.meta)==null||(t=t.parentAttrs)==null?void 0:t.start)||1;return tH((n=e.meta)==null||(n=n.parentAttrs)==null?void 0:n.type,r-1+(e.index||0),`. `)}return`- `},n,{alignNestedToPrefix:n?.parentType===`orderedList`}),addExtensions(){return[zV(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),aH=(e,t)=>{let{$from:n}=t.selection,r=iP(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},oH=(e,t)=>{let n=aH(e,t);if(!n)return!1;let[,r]=qF(t,e,n.$pos.pos+4);return r},sH=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},cH=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!XP(e.state,t)&&sH(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!XP(e.state,t)||!tI(e.state))return!1;let{$from:r}=e.state.selection,i=r.depth-1;return r.node(i).type!==e.schema.nodes[t]||r.index(i)!==0?!1:e.chain().liftListItem(t).run()},lH=(e,t)=>{let n=oH(e,t),r=aH(e,t);return!r||!n?!1:n>r.depth},uH=(e,t)=>{let n=oH(e,t),r=aH(e,t);return!r||!n?!1:n<r.depth},dH=(e,t)=>{if(!XP(e.state,t)||!eI(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:lH(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():uH(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},fH=(e,t,n)=>{let{state:r}=e,{selection:i}=r;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0||!a.parent.isTextblock||XP(r,t))return!1;let o=JF(a);if(!o||!n.includes(o.type.name))return!1;let s=o.lastChild;if(!s||s.type.name!==t)return!1;let c=a.parent;if(!s.canReplace(s.childCount,s.childCount,W.from(c)))return!1;let l=a.before(),u=a.after(),d=l-2;return e.commands.command(({tr:e,dispatch:t})=>(t&&(e.delete(l,u).insert(d,W.from(c)),e.setSelection(q.create(e.doc,d+1)),e.scrollIntoView()),!0))},pH=LL.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&dH(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&dH(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&cH(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&cH(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(let{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&fH(e,t,n))return!0;return!1}}}}),mH=RegExp(`^(\\s*)(${HV})([.)])\\s+(.*)$`),hH=/^\s/,gH={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function _H(e){return mH.test(e.trimStart())}function vH(e){let t=e.trimStart();return gH.bulletItem.test(t)||_H(t)||gH.heading.test(t)||gH.thematicBreak.test(t)&&!t.startsWith(`-`)||/^>\s?/.test(t)||gH.codeFence.test(t)||gH.blockMath.test(t)}function yH(e){return Object.values(gH).some(t=>t.test(e))}function bH(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&vH(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function xH(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(mH);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?YV(s):void 0,p=isNaN(d)?XV(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(mH))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(hH)){let e=t.length-t.trimStart().length,n=u+s.length+1;g.push(t),m.push(t.slice(Math.min(e,n))),h+=1}else{if(_||yH(t))break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(`
128
+ `).trim(),contentLines:m,raw:g.join(`
129
+ `)}),r=h,n=h}return[t,r]}var SH=RegExp(`^(${HV})([.)])\\s+(.+)$`);function CH(e){let t=e.split(`
130
+ `).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(SH);if(!t)return null;n.push({marker:t[1],content:t[3]})}return QV(n.map(e=>e.marker))?{type:`orderedList`,attrs:eH(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function wH(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=bH(a.contentLines),c=o.join(`
131
+ `).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`
132
+ `).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=wH(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(`
133
+ `)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function TH(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var EH=`listItem`,DH=`textStyle`,OH=/^(\d+)\.\s$/;function kH(e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var AH=iR.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=kH(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=kH(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=DF(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.typeMarker,i=e.items?TH(e.items,t):[],a={};return n!==1&&(a.start=n),r&&(a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
134
+ `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let r=e.split(`
135
+ `),[i,a]=xH(r);if(i.length===0)return;let o=wH(i,i[0].indent,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,typeMarker:i[0]?.type,items:o,raw:r.slice(0,a).join(`
136
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(EH,this.editor.getAttributes(DH)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new Y({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=CH(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=rR({find:OH,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=rR({find:OH,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(DH)}),joinPredicate:e,editor:this.editor})),[t]}}),jH=/^\s*(\[([( |x])?\])\s$/,MH=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,NH=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)==null?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||`empty task item`}`},PH=iR.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>e.querySelector(`div`)??e}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,DF(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>xL(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[zV(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`);o.style.cssText=MH;let l=e=>{let t=NH(e,e.attrs.checked,this.options.a11y);s.setAttribute(`aria-label`,t),o.textContent=t};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=OF(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[rR({find:jH,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),FH=iR.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,DF(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
137
+ `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=vL(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(t){let r={type:`taskList`,raw:t.raw,items:t.items},i=e.slice(t.raw.length);return i.trim()?[r,...n.blockTokens(i)]:[r]}return n.blockTokens(e)},i=vL(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});LL.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(FV.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(iH.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(pH.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(AH.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(PH.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(FH.configure(this.options.taskList)),e}});var IH=`&nbsp;`,LH=`\xA0`,RH=iR.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,DF(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===IH||n[0].text===IH||n[0].raw===LH||n[0].text===LH)&&r.length===1&&r[0].type===`text`&&(r[0].text===IH||r[0].text===LH)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){var i,a;let e=Array.isArray(n==null||(i=n.previousNode)==null?void 0:i.content)?n.previousNode.content:[];return(n==null||(a=n.previousNode)==null?void 0:a.type)===`paragraph`&&e.length===0?IH:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),zH=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,BH=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,VH=kL.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,DF(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[eR({find:zH,type:this.type})]},addPasteRules(){return[oR({find:BH,type:this.type})]}}),HH=iR.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),UH=kL.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,DF(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function WH(e={}){return new Y({view(t){return new GH(t,e)}})}var GH=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=PD(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},KH=class e extends K{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):K.near(r)}content(){return G.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new qH(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!YH(e)||!XH(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!J.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};KH.prototype.visible=!1,KH.findFrom=KH.findGapCursorFrom,K.jsonID(`gapcursor`,KH);var qH=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return KH.valid(t)?new KH(t):K.near(t)}};function JH(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function YH(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||JH(e.type))return!0;if(e.inlineContent)return!1}}return!0}function XH(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||JH(e.type))return!0;if(e.inlineContent)return!1}}return!0}function ZH(){return new Y({props:{decorations:nU,createSelectionBetween(e,t,n){return t.pos==n.pos&&KH.valid(n)?new KH(n):null},handleClick:eU,handleKeyDown:QH,handleDOMEvents:{beforeinput:tU}}})}var QH=JN({ArrowLeft:$H(`horiz`,-1),ArrowRight:$H(`horiz`,1),ArrowUp:$H(`vert`,-1),ArrowDown:$H(`vert`,1)});function $H(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof q){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=KH.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new KH(c))),!0):!1}}function eU(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!KH.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&J.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new KH(r))),!0)}function tU(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof KH))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=W.empty;for(let e=r.length-1;e>=0;e--)i=W.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new G(i,0,0));return a.setSelection(q.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function nU(e){if(!(e.selection instanceof KH))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,JM.create(e.doc,[GM.widget(e.selection.head,t,{key:`gapcursor`})])}var rU=200,iU=function(){};iU.prototype.append=function(e){return e.length?(e=iU.from(e),!this.length&&e||e.length<rU&&this.leafAppend(e)||this.length<rU&&e.leafPrepend(this)||this.appendInner(e)):this},iU.prototype.prepend=function(e){return e.length?iU.from(e).append(this):this},iU.prototype.appendInner=function(e){return new oU(this,e)},iU.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?iU.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},iU.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},iU.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},iU.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},iU.from=function(e){return e instanceof iU?e:e&&e.length?new aU(e):iU.empty};var aU=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=rU)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=rU)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(iU);iU.empty=new aU([]);var oU=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(iU),sU=500,cU=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new uU(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new uU(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new uU(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>fU&&(s=lU(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new QE;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new uU(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new uU(i,o,l))}else r.push(new uU(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new uU(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>sU&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new uU(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(iU.from(i.reverse()),a)}};cU.empty=new cU(iU.empty,0);function lU(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var uU=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},dU=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},fU=20;function pU(e,t,n,r){let i=n.getMeta(xU),a;if(i)return i.historyState;n.getMeta(SU)&&(e=new dU(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(xU))return o.getMeta(xU).redo?new dU(e.done.addTransform(n,void 0,r,bU(t)),e.undone,hU(n.mapping.maps),e.prevTime,e.prevComposition):new dU(e.done,e.undone.addTransform(n,void 0,r,bU(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!mU(n,e.prevRanges)),s=o?gU(e.prevRanges,n.mapping):hU(n.mapping.maps);return new dU(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,bU(t)),cU.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new dU(e.done.rebased(n,a),e.undone.rebased(n,a),gU(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new dU(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),gU(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function mU(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function hU(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function gU(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function _U(e,t,n){let r=bU(t),i=xU.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new dU(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(xU,{redo:n,historyState:c})}var vU=!1,yU=null;function bU(e){let t=e.plugins;if(yU!=t){vU=!1,yU=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){vU=!0;break}}return vU}var xU=new X(`history`),SU=new X(`closeHistory`);function CU(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Y({key:xU,state:{init(){return new dU(cU.empty,cU.empty,null,0,-1)},apply(t,n,r){return pU(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?TU:n==`historyRedo`?EU:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function wU(e,t){return(n,r)=>{let i=xU.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=_U(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var TU=wU(!1,!0),EU=wU(!0,!0);LL.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Y({key:new X(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var DU=LL.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[WH(this.options)]}});LL.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new Y({key:new X(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return JM.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(GM.node(t,t+e.nodeSize,{class:this.options.className}))}),JM.create(e,a)}}})]}});var OU=LL.create({name:`gapCursor`,addProseMirrorPlugins(){return[ZH()]},extendNodeSchema(e){return{allowGapCursor:xF(Z(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),kU=`placeholder`,AU=new X(`tiptap__placeholder`);function jU(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),GM.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function MU(e,t){return typeof e==`function`?e(t):e}function NU({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:a,to:o}){let{anchor:s}=i,c=[],l=e.isEmpty;return r.nodesBetween(a,o,(r,i)=>{let a=s>=i&&s<=i+r.nodeSize,o=!r.isLeaf&&iI(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(jU({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:MU(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function PU({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!e.isEditable&&t.showOnlyWhenEditable)return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&iI(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(jU({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:MU(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...NU({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return JM.create(r,o)}function FU(e,t){let n=e.resolve(t);if(n.depth===0){let e=n.nodeAfter??n.nodeBefore;if(!e)return{from:t,to:t};let r=n.nodeAfter?t:t-e.nodeSize;return{from:r,to:r+e.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function IU(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function LU(e,t,n){let r=[];return e.forEach((e,i)=>{let a=i,o=a+e.nodeSize,s=a+1,c=o+1;s<n&&c>t&&r.push({from:a,to:o})}),r}function RU(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let e=1;e<t.length;e+=1){let r=n[n.length-1],i=t[e];i.from<=r.to?r.to=Math.max(r.to,i.to):n.push({...i})}return n}function zU(e,t){let n=LU(e,t.from,t.to);return n.push(IU(e,FU(e,t.from))),t.to>t.from?n.push(IU(e,FU(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(IU(e,FU(e,Math.min(t.from+1,e.content.size)))),n}function BU(e,t,n){let r=[];if(e.docChanged){let t=GF(e);for(let e of t)r.push(...zU(n.doc,e.newRange))}return e.selectionSet&&(r.push(IU(n.doc,FU(n.doc,e.mapping.map(t.selection.anchor)))),r.push(IU(n.doc,FU(n.doc,n.selection.anchor)))),RU(r)}function VU(e,t,n){let r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function HU({decorations:e,ranges:t,editor:n,options:r,dataAttribute:i,doc:a,selection:o}){let s=e;for(let e of t){let{from:t,to:c}=VU(e.from,e.to,a),l=s.find(t,c).filter(e=>e.from>=t&&e.to<=c);l.length&&(s=s.remove(l));let u=NU({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function UU({editor:e,options:t,dataAttribute:n}){return{init(r,i){return PU({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??JM.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:HU({decorations:i.map(r.mapping,r.doc),ranges:BU(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function WU(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function GU({editor:e,options:t}){let n=t.dataAttribute?`data-${WU(t.dataAttribute)}`:`data-${kU}`,r=t.showOnlyCurrent&&!t.includeChildren;return new Y({key:AU,...r?{}:{state:UU({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>PU({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?JM.empty:AU.getState(n)??JM.empty}})}var KU=LL.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:kU,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[GU({editor:this.editor,options:this.options})]}});function qU(e,t){return!e.selection.empty&&!aI(e.selection)&&t.isEditable}function JU(e,t){return qU(e,t)&&!t.isFocused&&!t.view.dragging}function YU(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function XU(e){e.focus()}LL.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new Y({key:new X(`selection`),props:{decorations(n){return JU(n,e)?JM.create(n.doc,[GM.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return qU(t.state,e)&&YU(),!1},focus(t){return qU(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&XU(t)}),!1}}}})]}});function ZU({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var QU=LL.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new X(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new Y({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!ZU({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!ZU({node:r,types:n})}}})]}}),$U=LL.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>TU(e,t),redo:()=>({state:e,dispatch:t})=>EU(e,t)}},addProseMirrorPlugins(){return[CU(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),eW=LL.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(GR.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(BR.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(FV.configure(this.options.bulletList)),this.options.code!==!1&&e.push(JR.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(QR.configure(this.options.codeBlock)),this.options.document!==!1&&e.push($R.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(DU.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(OU.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(ez.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(tz.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push($U.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(nz.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(sz.configure(this.options.italic)),this.options.listItem!==!1&&e.push(iH.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(pH.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(jV.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(AH.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(RH.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(VH.configure(this.options.strike)),this.options.text!==!1&&e.push(HH.configure(this.options.text)),this.options.underline!==!1&&e.push(UH.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(QU.configure(this.options?.trailingNode)),e}}),tW=new X(`y-sync`),nW=new X(`y-undo`),rW=new X(`yjs-cursor`),iW=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},aW=e=>_e(iW(ce(h(e)))),oW=()=>({mapping:new Map,isOMark:new Map}),sW=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!ie(t.ds,e.id),cW=[{light:`#ecd44433`,dark:`#ecd444`}],lW=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=l();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,v(t))}return e.get(n)},uW=(e,{colors:t=cW,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new gW(e,a),l=new Y({props:{editable:e=>{let t=tW.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:tW,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(tW);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return e.docChanged&&(t.addToHistory=e.getMeta(`addToHistory`)!==!1),t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&c(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=l.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=nW.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},tW)})}},destroy:()=>{s.destroy()}})});return l},dW=(e,t,n,r)=>{if(n==null||!(r===null||n>1&&r<=1||iG(t,e,n,r)))return r;let i=nG(t,e,n);return i===null?r:i},fW=(e,t,n,r)=>{if(t!==null&&t.anchor!==null&&t.head!==null){if(t.type===`all`)e.setSelection(new oO(e.doc));else if(t.type===`node`){let r=QW(n.doc,n.type,t.anchor,n.mapping);r!==null&&e.setSelection(pW(e,r))}else if(t.type===`nodeRange`){let r=mW(e,QW(n.doc,n.type,t.anchor,n.mapping),QW(n.doc,n.type,t.head,n.mapping),t.depth);r!==null&&e.setSelection(r)}else{let i=QW(n.doc,n.type,t.anchor,n.mapping),a=QW(n.doc,n.type,t.head,n.mapping);r!=null&&(i=dW(e.doc,r,t.absAnchor,i),a=dW(e.doc,r,t.absHead,a)),i===null&&(i=a),a===null&&(a=i),i!==null&&a!==null&&e.setSelection(q.between(e.doc.resolve(i),e.doc.resolve(a)))}}},pW=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?J.create(e.doc,t):q.near(n)},mW=(e,t,n,r)=>{if(t===null||n===null)return null;let i=Math.min(Math.max(t,0),e.doc.content.size),a=Math.min(Math.max(n,0),e.doc.content.size);try{let t=K.fromJSON(e.doc,{type:`nodeRange`,anchor:i,head:a,depth:r});return t.ranges.length?t:q.near(e.doc.resolve(i))}catch{return q.near(e.doc.resolve(i))}},hW=(e,t)=>{let n=t.selection.jsonID;return{type:n,depth:n===`nodeRange`?t.selection.depth:void 0,anchor:YW(t.selection.anchor,e.type,e.mapping),head:YW(t.selection.head,e.type,e.mapping),absAnchor:t.selection.anchor,absHead:t.selection.head}},gW=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=re(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=hW(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(n&&this._domSelectionInView===null&&(c(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=d.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=i(g(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(tW,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>vW(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new G(W.from(e),0,0));t.setMeta(tW,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>vW(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new G(W.from(t),0,0));if(e){let t=ue(u(e.anchor,0),n.doc.content.size),r=ue(u(e.head,0),n.doc.content.size);n.setSelection(q.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(tW,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=m(this.doc),e instanceof Uint8Array||t instanceof Uint8Array){if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&o(),r=new E({gc:!1}),ge(r,t),t=m(r),ge(r,e),e=m(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[ae(e,i._item.id.clock)].content.type}}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let o=n.permanentUserData;o&&o.dss.forEach(e=>{p(r,e,e=>{})});let s=(e,t)=>{let r=e===`added`?o.getUserByClientId(t.client):o.getUserByDeletedId(t);return{user:r,type:e,color:lW(n.colorMapping,n.colors,r)}},c=a(i,new ee(t.ds,e.sv)).map(n=>!n._item.deleted||sW(n._item,e)||sW(n._item,t)?vW(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,s):null).filter(e=>e!==null),l=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new G(W.from(c),0,0));this.prosemirrorView.dispatch(l.setMeta(tW,{isChangeOrigin:!0}))},tW)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=tW.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);p(t,t.deleteSet,e=>{if(e.constructor===oe){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e),this.mapping.clear();let n=this.type.toArray().map(e=>_W(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this.prosemirrorView.state.doc,i=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new G(W.from(n),0,0));fW(i,this.beforeTransactionSelection,this,r),i=i.setMeta(tW,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof te}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&i.scrollIntoView(),this.prosemirrorView.dispatch(i)})}_prosemirrorChanged(e){this.doc.transact(()=>{HW(this.doc,this.type,e,this),this.beforeTransactionSelection=hW(this,this.prosemirrorView.state)},tW)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},_W=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof D)return vW(e,t,n,r,i,a);throw b()}return o},vW=(e,t,n,r,i,o)=>{let s=[],c=e=>{if(e instanceof D){let a=_W(e,t,n,r,i,o);a!==null&&s.push(a)}else{let a=e._item.right?.content?.type;a instanceof se&&!a._item.deleted&&a._item.id.client===a.doc.clientID&&(e.applyDelta([{retain:e.length},...a.toDelta()]),a.doc.transact(e=>{a._item.delete(e)}));let c=yW(e,t,n,r,i,o);c!==null&&c.forEach(e=>{e!==null&&s.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(c):a(e,new ee(i.ds,r.sv)).forEach(c);try{let a=e.getAttributes(r);r!==void 0&&(sW(e._item,r)?sW(e._item,i)||(a.ychange=o?o(`added`,e._item.id):{type:`added`}):a.ychange=o?o(`removed`,e._item.id):{type:`removed`});let c=t.node(e.nodeName,a,s);return n.mapping.set(e,c),c}catch{return e.doc.transact(t=>{e._item.delete(t)},tW),n.mapping.delete(e),null}},yW=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,BW(n.attributes,t)))}}catch{return e.doc.transact(t=>{e._item.delete(t)},tW),null}return o},bW=(e,t)=>{let n=new C,r=e.map(e=>({insert:e.text,attributes:VW(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},xW=(e,t)=>{let n=new D(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}return n.insert(0,TW(e).map(e=>SW(e,t))),t.mapping.set(n,e),n},SW=(e,t)=>e instanceof Array?bW(e,t):xW(e,t),CW=e=>typeof e==`object`&&!!e,wW=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===Object.keys(t).filter(e=>t[e]!==null).length;for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||CW(o)&&CW(s)&&wW(o,s)}return r},TW=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},EW=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&s(e.attributes||{}).length===t[n].marks.length&&y(e.attributes,(e,r)=>{let i=zW(r),a=t[n].marks;return a.find(e=>e.type.name===i)?wW(e,a.find(e=>e.type.name===i)?.attrs):!1}))},DW=(e,t)=>{if(e instanceof D&&!(t instanceof Array)&&UW(e,t)){let n=TW(t);return e._length===n.length&&wW(e.getAttributes(),t.attrs)&&e.toArray().every((e,t)=>DW(e,n[t]))}return e instanceof C&&t instanceof Array&&EW(e,t)},OW=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),kW=(e,t,n)=>{let r=new Map;t.forEach((e,t)=>{r.has(e)||r.set(e,t)});let i=[];if(e.forEach((e,a)=>{let o=n.mapping.get(e),s=r.get(o);s!==void 0&&OW(o,t[s])&&i.push({yIndex:a,pIndex:s,yChild:e})}),i.length===0)return[];let a=Array(i.length),o=[];for(let e=0;e<i.length;e++){let t=0,n=o.length;for(;t<n;){let r=t+n>>1;i[o[r]].pIndex<i[e].pIndex?t=r+1:n=r}a[e]=t>0?o[t-1]:-1,o[t]=e}let s=[];for(let e=o[o.length-1];e!==-1;e=a[e])s.push(i[e]);return s.reverse()},AW=(e,t,n,r)=>{n>0&&(e.slice(t,t+n).forEach(e=>r.mapping.delete(e)),e.delete(t,n))},jW=(e,t,n,r,i,a)=>{if(r<i){let o=[];for(let e=r;e<i;e++)o.push(SW(n[e],a));e.insert(t,o)}},MW=(e,t,n,r)=>t instanceof C&&n instanceof Array?(EW(t,n)?r.mapping.set(t,n):LW(t,n,r),!0):t instanceof D&&!(n instanceof Array)&&UW(t,n)?(DW(t,n)?r.mapping.set(t,n):HW(e,t,n,r),!0):!1,NW=(e,t,n,r,i,a,o,s,c)=>{let l=ue(a-i,s-o);for(let a=0;a<l;a++){let s=r[i+a],l=n[o+a];MW(e,s,l,c)||(AW(t,o+a,1,c),jW(t,o+a,n,o+a,o+a+1,c))}AW(t,o+l,a-i-l,c),jW(t,o+l,n,o+l,s,c)},PW=(e,t,n,r,i)=>{let a=kW(r,n,i);if(a.length<2||!a.some(e=>e.yIndex!==e.pIndex)||a.some(e=>{let t=n[e.pIndex];return!(e.yChild instanceof C&&t instanceof Array||e.yChild instanceof D&&!(t instanceof Array))}))return!1;let o=0,s=0;for(let c of a){NW(e,t,n,r,o,c.yIndex,s,c.pIndex,i);let a=n[c.pIndex];MW(e,c.yChild,a,i),o=c.yIndex+1,s=c.pIndex+1}return NW(e,t,n,r,o,r.length,s,n.length,i),!0},FW=(e,t,n)=>{let r=e.toArray(),i=TW(t),a=i.length,o=r.length,s=ue(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(OW(n.mapping.get(e),t))u=!0;else if(!DW(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(OW(n.mapping.get(e),t))u=!0;else if(!DW(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},IW=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof le?t+=n.content.str:n.content instanceof w&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},LW=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=IW(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,VW(e.marks,n))})),{insert:o,remove:s,index:c}=de(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},RW=/(.*)(--[a-zA-Z0-9+/=]{8})$/,zW=e=>RW.exec(e)?.[1]??e,BW=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(zW(r),e[r]));return n},VW=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=x(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${aW(e.toJSON())}`:e.type.name]=e.attrs}}),n},HW=(e,t,n,r)=>{if(t instanceof D&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof D){let e=t.getAttributes(),r=n.attrs;for(let n in r)r[n]===null?t.removeAttribute(n):e[n]!==r[n]&&n!==`ychange`&&t.setAttribute(n,r[n]);for(let n in e)r[n]===void 0&&t.removeAttribute(n)}let i=TW(n),a=i.length,o=t.toArray(),s=o.length,c=ue(a,s);if(PW(e,t,i,o,r))return;let l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!OW(r.mapping.get(e),t)){if(DW(e,t))r.mapping.set(e,t);else break}}for(;u+l+1<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!OW(r.mapping.get(e),t)){if(DW(e,t))r.mapping.set(e,t);else break}}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof C&&c instanceof Array)EW(n,c)||LW(n,c,r),l+=1;else{let i=n instanceof D&&UW(n,c),a=d instanceof D&&UW(d,f);if(i&&a){let e=FW(n,c,r),t=FW(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(HW(e,n,c,r),l+=1):a?(HW(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[SW(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof C?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(SW(i[t],r));t.insert(l,e)}},tW)},UW=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,WW=null,GW=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=tW.getState(this.view.state);if(e&&e.binding&&!e.binding.isDestroyed){let e=this.view.state.tr;e.setMeta(this.key,this.value),this.view.dispatch(e)}}},KW=class e{constructor(e=[]){this.entries=e}getFirst(){return this.entries[0]}dequeueFirst(){return this.entries.shift()}isEmpty(){return this.entries.length===0}static fromViewsToUpdate(){let t=WW;WW=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new GW(t,r,e))})}),new e(n)}},qW=(e=KW.fromViewsToUpdate(),t=!1)=>{let n=!0;for(;!e.isEmpty();){let r=e.getFirst();try{r.apply()}catch(r){if(r instanceof RangeError){t&&n&&e.dequeueFirst(),e.isEmpty()||c(0,()=>qW(e,!0));return}throw r}n=!1,e.dequeueFirst()}},JW=(e,t,n)=>{WW||(WW=new Map,c(0,qW)),x(WW,e,S).set(t,n)},YW=(e,n,r)=>{if(e===0)return _(n,0,-1);let i=n._first===null?null:n._first.content.type;for(;i!==null&&n!==i;){if(i instanceof C){if(i._length>=e)return _(i,e,-1);if(e-=i._length,i._item!==null&&i._item.next!==null)i=i._item.next.content.type;else{do i=i._item===null?null:i._item.parent,e--;while(i!==n&&i!==null&&i._item!==null&&i._item.next===null);i!==null&&i!==n&&(i=i._item===null?null:i._item.next.content.type)}}else{let a=(r.get(i)||{nodeSize:0}).nodeSize;if(i._first!==null&&e<a)i=i._first.content.type,e--;else{if(e===1&&i._length===0&&a>1)return new pe(i._item===null?null:i._item.id,i._item===null?t(i):null,null);if(e-=a,i._item!==null&&i._item.next!==null)i=i._item.next.content.type;else{if(e===0)return i=i._item===null?i:i._item.parent,new pe(i._item===null?null:i._item.id,i._item===null?t(i):null,null);do i=i._item.parent,e--;while(i!==n&&i._item.next===null);i!==n&&(i=i._item.next.content.type)}}}if(i===null)throw o();if(e===0&&i.constructor!==C&&i!==n)return ZW(i._item.parent,i._item)}return _(n,n._length,-1)},XW=(e,t,n)=>{if(n===null)return!1;let r=he(t,e);return r!==null&&r.type instanceof C&&t.item!==null&&n<=1},ZW=(e,n)=>{let i=null,a=null;return e._item===null?a=t(e):i=r(e._item.id.client,e._item.id.clock),new pe(i,a,n.id)},QW=(e,t,n,r)=>{let i=he(n,e);if(i===null||i.type!==t&&!f(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===C)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;if(t++,n instanceof C)o+=n._length;else{let e=r.get(n);if(e==null)return null;o+=e.nodeSize}}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;if(!t.deleted){if(e instanceof C)o+=e._length;else{let t=r.get(e);if(t==null)return null;o+=t.nodeSize}}t=t.right}}a=e}let s=o-1;return XW(e,n,s)?null:s},$W=(e,t)=>{if(e===t)return!0;let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])},eG=e=>{let t=e.type.spec.attrs||{};return Object.keys(e.attrs).some(n=>{let r=t[n];return r==null||!Object.prototype.hasOwnProperty.call(r,`default`)||r.default!==e.attrs[n]})},tG=(e,t,n)=>{let r=t+1,i=n;for(let t=1;t<e.depth;t++){let n=e.index(t);if(n>=i.childCount)return null;for(let e=0;e<n;e++)r+=i.child(e).nodeSize;if(r+=1,i=i.child(n),i.type!==e.node(t+1).type)return null}return i.isTextblock?r+Math.min(e.parentOffset,i.content.size):null},nG=(e,t,n)=>{let r=0,i=0;for(;i<e.childCount;i++){let t=e.child(i);if(r+t.nodeSize>n)break;r+=t.nodeSize}if(i>=e.childCount)return null;let a=e.child(i),o=e.resolve(n),s=(e,t)=>{if(o.depth===0){let i=e+(n-r),a=e+1,o=e+t.nodeSize-1;return Math.max(a,Math.min(i,o))}return tG(o,e,t)},c=(n,r=!1)=>{let a=0;for(let t=0;t<=i;t++)n(e.child(t))&&a++;let o=0,c=-1,l=null,u=0;for(let e=0;e<t.childCount;e++){let r=t.child(e);n(r)&&(o++,o===a&&(c=u,l=r)),u+=r.nodeSize}return l===null||r&&(a!==1||o!==1)?null:s(c,l)},l=e=>e.type===a.type&&$W(e.attrs,a.attrs),u=a.textContent,d=c(e=>l(e)&&e.textContent===u);if(d!==null)return d;let f=c(e=>e.type===a.type&&e.textContent===u);if(f!==null)return f;if(eG(a)){let e=c(l,!0);if(e!==null)return e}return c(e=>l(e)&&u!==``&&e.textContent!==``&&(u.startsWith(e.textContent)||e.textContent.startsWith(u)),!0)},rG=(e,t)=>{if(!e.docChanged)return!1;if(e.doc.childCount!==t.childCount)return!0;for(let n of e.steps)if(n instanceof sD){if(n.from===0&&n.to===t.content.size)return!0;if(n.slice.content.size>0){let e=!1;if(n.slice.content.forEach(t=>{t.isBlock&&(e=!0)}),e)return!0}else if(n.to>n.from){let e=t.resolve(n.from),r=t.resolve(n.to);if(e.depth===0&&r.depth===0&&e.index()!==r.index())return!0}}return!1},iG=(e,t,n,r)=>{if(r===null)return!1;let i=e.resolve(n),a=t.resolve(r);if(!i.parent.isTextblock)return!1;if(!a.parent.isTextblock||i.parent.textContent!==a.parent.textContent||i.parentOffset!==0&&a.parentOffset===0)return!0;let o=i.parentOffset===0&&a.parentOffset===0,s=i.parentOffset!==a.parentOffset||i.parent.type!==a.parent.type||!$W(i.parent.attrs,a.parent.attrs);if(o||s){let i=nG(e,t,n);return i!==null&&i!==r}return!1},aG=(e,t)=>{let n=e.toArray().map(e=>vW(e,t,oW())).filter(e=>e!==null);return W.fromArray(n)},oG=(e,t)=>t.topNodeType.create(null,aG(e,t)),sG=(e,t)=>{let n=oW(),r=e.toArray().map(e=>vW(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,W.fromArray(r)),meta:n,mapping:n.mapping}};function cG(e,t=`prosemirror`){let n=new E,r=n.get(t,ne);return r.doc?(lG(e,r),r.doc):n}function lG(e,t){let n=t||new ne;return HW(n.doc?n.doc:{transact:e=>e(void 0)},n,e,{mapping:new Map,isOMark:new Map}),n}function uG(e,t,n=`prosemirror`){return cG(GT.fromJSON(e,t),n)}var dG=(e,t,n)=>e!==t,fG=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(`⁠`),i=document.createTextNode(`⁠`);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},pG=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),mG=/^#[0-9a-fA-F]{6}$/,hG=(e,t,n,r,i)=>{let a=tW.getState(e);if(a==null||a.doc==null||a.binding==null)return JM.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?JM.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:mG.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=QW(o,a.type,me(t.cursor.anchor),a.binding.mapping),d=QW(o,a.type,me(t.cursor.head),a.binding.mapping);if(l!==null&&d!==null){let t=u(e.doc.content.size-1,0);l=ue(l,t),d=ue(d,t),s.push(GM.widget(d,()=>r(n,c),{key:c+``,side:10}));let a=ue(l,d),o=u(l,d);s.push(GM.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),JM.create(e.doc,s))},gG=(e,{awarenessStateFilter:t=dG,cursorBuilder:n=fG,selectionBuilder:r=pG,getSelection:i=e=>e.selection}={},a=`cursor`)=>new Y({key:rW,state:{init(i,a){return hG(a,e,t,n,r)},apply(i,a,o,s){let c=tW.getState(s),l=i.getMeta(rW),u=c&&c.isChangeOrigin;return i.docChanged&&!u&&rG(i,o.doc)?JM.empty:u||l&&l.awarenessUpdated?hG(s,e,t,n,r):i.docChanged?a.map(i.mapping,i.doc):a}},props:{decorations:e=>rW.getState(e)},view:t=>{let n=()=>{t.docView&&JW(t,rW,{awarenessUpdated:!0})},r=(t,n={})=>{let r=tW.getState(t.state);if(!r||!r.binding)return;let o=e.getLocalState()||{};if(t.hasFocus()){let s=i(t.state),c=YW(s.anchor,r.type,r.binding.mapping),l=YW(s.head,r.type,r.binding.mapping);(n.force||o.cursor==null||!T(me(o.cursor.anchor),c)||!T(me(o.cursor.head),l))&&e.setLocalStateField(a,{anchor:c,head:l})}else o.cursor!=null&&QW(r.doc,r.type,me(o.cursor.anchor),r.binding.mapping)!==null&&e.setLocalStateField(a,null)},o=()=>r(t);return e.on(`change`,n),t.dom.addEventListener(`focusin`,o),t.dom.addEventListener(`focusout`,o),{update:(e,t)=>{let n=!!(tW.getState(e.state)?.isChangeOrigin&&t?.doc&&!t.doc.eq(e.state.doc));r(e,{force:n})},destroy:()=>{t.dom.removeEventListener(`focusin`,o),t.dom.removeEventListener(`focusout`,o),e.off(`change`,n),e.setLocalStateField(a,null)}}}}),_G=e=>{let t=nW.getState(e).undoManager;if(t!=null)return t.undo(),!0},vG=e=>{let t=nW.getState(e).undoManager;if(t!=null)return t.redo(),!0},yG=new Set([`paragraph`]),bG=(e,t)=>!(e instanceof oe)||!(e.content instanceof fe)||!(e.content.type instanceof se||e.content.type instanceof D&&t.has(e.content.type.nodeName))||e.content.type._length===0,xG=({protectedNodes:e=yG,trackedOrigins:t=[],undoManager:n=null}={})=>new Y({key:nW,state:{init:(r,i)=>{let a=tW.getState(i),o=n;if(!o){let n=a.doc,r=new Set(n?n._observers.get(`destroy`):[]);o=new te(a.type,{trackedOrigins:new Set([tW].concat(t)),deleteFilter:t=>bG(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});let i=n?n._observers.get(`destroy`):new Set;o._yTiptapDocDestroyListeners=Array.from(i||[]).filter(e=>!r.has(e))}return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=tW.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:hW(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=tW.getState(e.state),n=nW.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,nW.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy();let e=n._yTiptapDocDestroyListeners;e&&n.doc&&(e.forEach(e=>n.doc.off(`destroy`,e)),n._yTiptapDocDestroyListeners=null)}}}});function SG(e){return!!e.getMeta(tW)}function CG(e,t){let n=tW.getState(e);return QW(n.doc,n.type,t,n.binding.mapping)||0}function wG(e,t){let n=tW.getState(e);return YW(t,n.type,n.binding.mapping)}var TG=class e extends sI{constructor(e,t){super(e),this.yRelativePosition=t}static fromJSON(t){return new e(t.position,t.yRelativePosition)}toJSON(){return{position:this.position,yRelativePosition:this.yRelativePosition}}};function EG(e,t){return new TG(e,wG(t,e))}function DG(e,t,n){let r=e instanceof TG?e.yRelativePosition:null;if(SG(t)&&r)return{position:new TG(CG(n,r),r),mapResult:null};let i=cI(e,t),a=i.position.position;return{position:new TG(a,r??wG(n,a)),mapResult:i.mapResult}}var OG=LL.create({name:`collaboration`,priority:1e3,addOptions(){return{document:null,field:`default`,fragment:null,provider:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(e=>e.name===`undoRedo`)&&console.warn(`[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-undo-redo".`)},onBeforeCreate(){this.editor.utils.getUpdatedPosition=(e,t)=>DG(e,t,this.editor.state),this.editor.utils.createMappablePosition=e=>EG(e,this.editor.state)},addCommands(){return{undo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),nW.getState(t).undoManager.undoStack.length===0?!1:!n||_G(t)),redo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),nW.getState(t).undoManager.redoStack.length===0?!1:!n||vG(t))}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){let e=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),t=xG(this.options.yUndoOptions),n=t.spec.view;return t.spec.view=e=>{let{undoManager:t}=nW.getState(e.state);t.restore&&=(t.restore(),()=>{});let r=n?n(e):void 0;return{destroy:()=>{let e=t.trackedOrigins.has(t),n=t._observers;t.restore=()=>{e&&t.trackedOrigins.add(t),t.doc.on(`afterTransaction`,t.afterTransactionHandler),t._observers=n},r?.destroy&&r.destroy()}}},[uW(e,{...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender}),t,this.editor.options.enableContentCheck&&new Y({key:new X(`filterInvalidContent`),filterTransaction:t=>{if(!SG(t))return!0;if(this.storage.isDisabled)return!1;if(!t.docChanged)return!0;try{return t.doc.check(),!0}catch(t){return this.storage.isDisabled=!0,this.editor.emit(`contentError`,{error:t,editor:this.editor,disableCollaboration:()=>{var t;(t=e.doc)==null||t.destroy()}}),!0}}})].filter(Boolean)}});function kG(e){return typeof e==`string`&&/^#[0-9a-fA-F]{6}$/.test(e)}var AG=e=>Array.from(e.entries()).map(([e,t])=>t&&t.user?{clientId:e,...t.user}:{clientId:e}),jG=()=>null,MG=e=>({...e,color:kG(e.color)?e.color:`transparent`}),NG=LL.create({name:`collaborationCaret`,priority:999,addOptions(){return{provider:null,user:{name:null,color:null},render:e=>{let t=document.createElement(`span`),{color:n}=MG(e);t.classList.add(`collaboration-carets__caret`),t.style.borderColor=n;let r=document.createElement(`div`);return r.classList.add(`collaboration-carets__label`),r.style.backgroundColor=n,r.insertBefore(document.createTextNode(e.name),null),t.insertBefore(r,null),t},selectionRender:e=>kG(e.color)?pG(e):{},onUpdate:jG}},onCreate(){if(this.options.onUpdate!==jG&&console.warn('[tiptap warn]: DEPRECATED: The "onUpdate" option is deprecated. Please use `editor.storage.collaborationCaret.users` instead. Read more: https://tiptap.dev/api/extensions/collaboration-caret'),!this.options.provider)throw Error(`The "provider" option is required for the CollaborationCaret extension`)},addStorage(){return{users:[]}},addCommands(){return{updateUser:e=>()=>(this.options.provider.awareness.setLocalStateField(`user`,e),!0),user:e=>({editor:t})=>(console.warn(`[tiptap warn]: DEPRECATED: The "user" command is deprecated. Please use "updateUser" instead. Read more: https://tiptap.dev/api/extensions/collaboration-caret`),t.commands.updateUser(e))}},addProseMirrorPlugins(){let{provider:e}=this.options,t=this.storage,n=this.options.user;return[new Y({key:new X(`collaborationCaretAwarenessListener`),view:()=>{let r=()=>{t.users=AG(e.awareness.states)};return e.awareness.setLocalStateField(`user`,n),t.users=AG(e.awareness.states),e.awareness.on(`update`,r),{destroy:()=>{e.awareness.off(`update`,r),t.users=[]}}}}),gG(e.awareness,{cursorBuilder:e=>this.options.render(MG(e)),selectionBuilder:e=>this.options.selectionRender(MG(e))})]}}),PG=KU;function FG(e){if(!e.length)return JM.empty;let t=[],n=e[0].$from.node(0);return e.forEach(e=>{let n=e.$from.pos,r=e.$from.nodeAfter;r&&t.push(GM.node(n,n+r.nodeSize,{class:`ProseMirror-selectednoderange`}))}),JM.create(n,t)}function IG(e,t,n){let r=n.isText||n.isAtom?0:1;return{start:e+r,end:e+t-r}}function LG(e,t,n,r={}){let i=[],a=e.node(0),{extendOnBoundaryOverlap:o=!0}=r;typeof n==`number`&&n>=0||(n=e.sameParent(t)?Math.max(0,e.sharedDepth(t.pos)-1):e.sharedDepth(t.pos));let s=new UT(e,t,n),c=s.depth===0?0:a.resolve(s.start).posAtIndex(0);return s.parent.forEach((n,r)=>{let l=c+r,u=l+n.nodeSize,d=IG(l,n.nodeSize,n),f=o?t.pos>=d.start&&e.pos<=d.end:t.pos>d.start&&e.pos<d.end;if(l<s.start||l>=s.end||!f)return;let p=new tO(a.resolve(l),a.resolve(u));i.push(p)}),i}var RG=class e{constructor(e,t,n){this.anchor=e,this.head=t,this.depth=n??0}map(t){return new e(t.map(this.anchor),t.map(this.head),this.depth)}resolve(e){return new zG(e.resolve(this.anchor),e.resolve(this.head),this.depth)}},zG=class e extends K{constructor(e,t,n,r=1){let{doc:i}=e,a=e===t,o=e.pos===i.content.size&&t.pos===i.content.size,s=a&&!o?i.resolve(t.pos+(r>0?1:-1)):t,c=a&&o?i.resolve(e.pos-(r>0?1:-1)):e,l=LG(c.min(s),c.max(s),n),u=s.pos>=e.pos?l[0].$from:l[l.length-1].$to,d=s.pos>=e.pos?l[l.length-1].$to:l[0].$from;super(u,d,l),this.depth=n}get $to(){return this.ranges[this.ranges.length-1].$to}eq(t){return t instanceof e&&t.$from.pos===this.$from.pos&&t.$to.pos===this.$to.pos}map(t,n){let r=t.resolve(n.map(this.anchor)),i=t.resolve(n.map(this.head));return new e(r,i,this.depth)}toJSON(){return{type:`nodeRange`,anchor:this.anchor,head:this.head,depth:this.depth}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){let{doc:t}=this.$from;if(this.isForwards&&this.ranges.length>1){let t=this.ranges.slice(0,-1),n=t[0].$from,r=t[t.length-1].$to;return new e(n,r,this.depth)}let n=this.ranges[0],r=t.resolve(Math.max(0,n.$from.pos-1));return new e(this.$anchor,r,this.depth)}extendForwards(){let{doc:t}=this.$from;if(this.isBackwards&&this.ranges.length>1){let t=this.ranges.slice(1),n=t[0].$from,r=t[t.length-1].$to;return new e(r,n,this.depth)}let n=this.ranges[this.ranges.length-1],r=t.resolve(Math.min(t.content.size,n.$to.pos+1));return new e(this.$anchor,r,this.depth)}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head),n.depth)}static create(e,t,n,r,i=1){return new this(e.resolve(t),e.resolve(n),r,i)}getBookmark(){return new RG(this.anchor,this.head,this.depth)}};zG.prototype.visible=!1;try{K.jsonID(`nodeRange`,zG)}catch{}function BG(e){return e instanceof zG}LL.create({name:`nodeRange`,addOptions(){return{depth:void 0,key:`Mod`}},addKeyboardShortcuts(){return{"Shift-ArrowUp":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!BG(a)){let e=zG.create(i,s,c,t,-1);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendBackwards();return o.setSelection(l),n.dispatch(o),!0},"Shift-ArrowDown":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!BG(a)){let e=zG.create(i,s,c,t);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendForwards();return o.setSelection(l),n.dispatch(o),!0},"Mod-a":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,tr:a}=r,o=zG.create(i,0,i.content.size,t);return a.setSelection(o),n.dispatch(a),!0}}},onSelectionUpdate(){let{selection:e}=this.editor.state;BG(e)&&this.editor.view.dom.classList.add(`ProseMirror-noderangeselection`)},addProseMirrorPlugins(){let e=!1,t=!1;return[new Y({key:new X(`nodeRange`),props:{attributes:()=>e?{class:`ProseMirror-noderangeselection`}:{class:``},handleDOMEvents:{mousedown:(e,n)=>{let{key:r}=this.options,i=/Mac/.test(navigator.platform),a=!!n.shiftKey,o=!!n.ctrlKey,s=!!n.altKey,c=!!n.metaKey;return(r==null||r===`Shift`&&a||r===`Control`&&o||r===`Alt`&&s||r===`Meta`&&c||r===`Mod`&&(i?c:o))&&(t=!0),t&&document.addEventListener(`mouseup`,()=>{t=!1;let{state:n}=e,{doc:r,selection:i,tr:a}=n,{$anchor:o,$head:s}=i;if(o.sameParent(s))return;let c=zG.create(r,o.pos,s.pos,this.options.depth);a.setSelection(c),e.dispatch(a)},{once:!0}),!1}},decorations:n=>{let{selection:r}=n,i=BG(r);if(e=!1,!t)return i?(e=!0,FG(r.ranges)):null;let{$from:a,$to:o}=r;if(!i&&a.sameParent(o))return null;let s=LG(a,o,this.options.depth);return s.length?(e=!0,FG(s)):null}}})]}});function VG(e,t){let n=getComputedStyle(e);if(t)return t.map(e=>e.trim()).filter(e=>e.length>0).map(e=>`${e}:${n.getPropertyValue(e)};`).join(``);let r=``;for(let e=0;e<n.length;e+=1)r+=`${n[e]}:${n.getPropertyValue(n[e])};`;return r}function HG(e,t){let n=e.cloneNode(!0),r=[e,...Array.from(e.getElementsByTagName(`*`))],i=[n,...Array.from(n.getElementsByTagName(`*`))];return r.forEach((e,n)=>{i[n].style.cssText=VG(e,t)}),n}var UG=[{id:`listItemFirstChild`,evaluate:({parent:e,isFirst:t})=>t&&e&&[`listItem`,`taskItem`].includes(e.type.name)?1e3:0},{id:`listWrapperDeprioritize`,evaluate:({node:e})=>{let t=[`listItem`,`taskItem`],n=e.firstChild;return n&&t.includes(n.type.name)?1e3:0}},{id:`tableStructure`,evaluate:({node:e,parent:t})=>[`tableRow`,`tableCell`,`tableHeader`].includes(e.type.name)||t&&t.type.name===`tableHeader`?1e3:0},{id:`inlineContent`,evaluate:({node:e})=>e.isInline||e.isText?1e3:0}],WG={edges:[`left`,`top`],threshold:12,strength:500};function GG(e){return e===void 0||e===`left`?{...WG}:e===`right`?{edges:[`right`,`top`],threshold:12,strength:500}:e===`both`?{edges:[`left`,`right`,`top`],threshold:12,strength:500}:e===`none`?{edges:[],threshold:0,strength:0}:{...WG,...e}}function KG(e,t,n){if(n.edges.length===0)return!1;let r=t.getBoundingClientRect(),{threshold:i,edges:a}=n;return a.some(t=>t===`left`?e.x-r.left<i:t===`right`?r.right-e.x<i:t===`top`?e.y-r.top<i:t===`bottom`&&r.bottom-e.y<i)}function qG(e,t,n,r){return!t||n.edges.length===0?0:KG(e,t,n)?n.strength*r:0}var JG=1e3;function YG(e,t,n,r){let i=JG,a=!1;if(t.every(t=>{let n=t.evaluate(e);return i-=n,i<=0?(a=!0,!1):!0}),a)return-1;let o=e.view.nodeDOM(e.pos);return i-=qG(r,o,n,e.depth),i<=0?-1:i}function XG(e,t,n){return Array.from({length:t},(e,n)=>t-1-n).some(t=>n.includes(e.node(t).type.name))}function ZG(e,t,n){if(!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let r=e.posAtCoords({left:t.x,top:t.y});if(!r)return null;let{doc:i}=e.state,a=i.resolve(r.pos),o=[];n.defaultRules&&o.push(...UG),o.push(...n.rules);let s=Array.from({length:a.depth},(e,t)=>a.depth-t).map(r=>{let i=a.node(r),s=a.before(r);if(n.allowedContainers&&r>0&&!XG(a,r,n.allowedContainers))return null;let c=r>0?a.node(r-1):null,l=r>0?a.index(r-1):0,u=c?c.childCount:1,d=YG({node:i,pos:s,depth:r,parent:c,index:l,isFirst:l===0,isLast:l===u-1,$pos:a,view:e},o,n.edgeDetection,t);return d<0?null:{node:i,pos:s,depth:r,score:d,dom:e.nodeDOM(s)}}).filter(e=>e!==null),c=a.nodeAfter;if(c&&c.isAtom&&!c.isInline){let i=r.pos,l=a.depth+1,u=a.parent,d=a.index(),f=u.childCount,p=!0;if(n.allowedContainers&&(p=XG(a,l,n.allowedContainers)),p){let r=YG({node:c,pos:i,depth:l,parent:u,index:d,isFirst:d===0,isLast:d===f-1,$pos:a,view:e},o,n.edgeDetection,t);if(r>=0){let t=e.nodeDOM(i);t&&s.push({node:c,pos:i,depth:l,score:r,dom:t})}}}if(s.length===0)return null;s.sort((e,t)=>t.score===e.score?t.depth-e.depth:t.score-e.score);let l=s[0];return l.dom?{node:l.node,pos:l.pos,dom:l.dom}:null}function QG(e,t){let n=e;for(;n?.parentElement&&n.parentElement!==t.dom;)n=n.parentElement;if(n?.parentElement===t.dom&&n.pmViewDesc?.node)return n}function $G(e){return Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)&&e.width>0&&e.height>0}function eK(e,t){let n=t===`first`?e.firstElementChild:e.lastElementChild;for(;n;){let e=n.getBoundingClientRect();if($G(e))return e;n=t===`first`?n.nextElementSibling:n.previousElementSibling}return null}function tK(e,t,n,r=5){if(!Number.isFinite(t)||!Number.isFinite(n))return null;let i=e.dom,a=eK(i,`first`),o=eK(i,`last`);if(!a||!o)return null;let s=Math.min(Math.max(a.top+r,n),o.bottom-r),c=.5,l=Math.abs(a.left-o.left)<c,u=Math.abs(a.right-o.right)<c,d=a;l&&u&&(d=a);let f=Math.min(Math.max(d.left+r,t),d.right-r);return!Number.isFinite(f)||!Number.isFinite(s)?null:{x:f,y:s}}var nK=e=>{let{x:t,y:n,editor:r,nestedOptions:i}=e,{view:a,state:o}=r,s=tK(a,t,n,5);if(!s)return{resultElement:null,resultNode:null,pos:null};let{x:c,y:l}=s;if(i?.enabled){let e=ZG(a,{x:c,y:l},i);return e?{resultElement:e.dom,resultNode:e.node,pos:e.pos}:{resultElement:null,resultNode:null,pos:null}}let u=a.root.elementsFromPoint(c,l),d;if(Array.prototype.some.call(u,e=>{if(!a.dom.contains(e))return!1;let t=QG(e,a);return t?(d=t,!0):!1}),!d){let e=a.posAtCoords({left:c,top:l});if(e){let t=o.doc.resolve(e.pos),n=Math.min(t.depth,1),r=n>0?t.before(n):t.pos,i=o.doc.nodeAt(r);if(i){let e=a.nodeDOM(r);return{resultElement:e instanceof HTMLElement?e:null,resultNode:i,pos:r}}}return{resultElement:null,resultNode:null,pos:null}}let f;try{f=a.posAtDOM(d,0)}catch{return{resultElement:null,resultNode:null,pos:null}}let p=o.doc.nodeAt(f);if(!p){let e=o.doc.resolve(f),t=e.parent;return{resultElement:d,resultNode:t,pos:e.start()}}return{resultElement:d,resultNode:p,pos:f}};function rK(e,t){let n=e.nodeDOM(t);if(n instanceof Element&&n!==e.dom)return n;let{node:r,offset:i}=e.domAtPos(t),a=r.childNodes[i];return a instanceof Element?a:r instanceof Element?r:r.nodeType===Node.TEXT_NODE&&r.parentElement?r.parentElement:null}function iK(e,t){let n=rK(e,t);return(n?getComputedStyle(n).direction:getComputedStyle(e.dom).direction)||`ltr`}function aK(e){var t;(t=e.parentNode)==null||t.removeChild(e)}function oK(e,t){return e===`rtl`?t:0}function sK(e){return!e||!e.some(e=>{let t=e.trim().toLowerCase();return t===`margin`||t.startsWith(`margin-`)})}function cK(e,t,n,r){let{doc:i}=t.view.state;if(n?.enabled&&r?.node&&r.pos>=0){let e=r.pos,t=r.pos+r.node.nodeSize;return[{$from:i.resolve(e),$to:i.resolve(t)}]}let a=nK({editor:t,x:e.clientX,y:e.clientY,direction:`right`,nestedOptions:n});if(!a.resultNode||a.pos===null)return[];let o=a.resultNode.isText||a.resultNode.isAtom?0:-1;return LG(i.resolve(a.pos),i.resolve(a.pos+a.resultNode.nodeSize+o),0,{extendOnBoundaryOverlap:!1})}function lK(e,t,n,r,i){let{view:a}=t;if(!e.dataTransfer)return;let{empty:o,$from:s,$to:c}=a.state.selection,l=cK(e,t,n,r),u=LG(s,c,0,{extendOnBoundaryOverlap:!1}),d=u.some(e=>l.find(t=>t.$from===e.$from&&t.$to===e.$to)),f=o||!d?l:u;if(!f.length)return;let{tr:p}=a.state,m=document.createElement(`div`),h=f[0].$from.pos,g=f[f.length-1].$to.pos,_=iK(a,h);m.setAttribute(`dir`,_);let v=n?.enabled&&r?.node,y=f.length===1,b,x;v&&y?(b=a.state.doc.slice(h,g),x=J.create(a.state.doc,h)):(x=zG.create(a.state.doc,h,g),b=x.content());let S=sK(i);f.forEach(e=>{let t=rK(a,e.$from.pos);if(!t)return;let n=HG(t,i);S&&(n.style.margin=`0`),m.append(n)}),m.style.position=`absolute`,m.style.top=`-10000px`,document.body.append(m),e.dataTransfer.clearData();let C=oK(_,m.getBoundingClientRect().width);e.dataTransfer.setDragImage(m,C,0);let w=!1,T=()=>{w||(w=!0,aK(m),document.removeEventListener(`drop`,T),document.removeEventListener(`dragend`,T))},E=x instanceof J?x:void 0;a.dragging={slice:b,move:!0,node:E},p.setSelection(x),a.dispatch(p),document.addEventListener(`drop`,T),document.addEventListener(`dragend`,T)}var uK=(e,t)=>{let n=e.resolve(t),{depth:r}=n;return r===0?t:n.pos-n.parentOffset-1},dK=(e,t)=>{let n=e.nodeAt(t),r=e.resolve(t),{depth:i}=r,a=n;for(;i>0;){let e=r.node(i);--i,i===0&&(a=e)}return a};function fK(e,t,n){if(!t.docChanged)return e;if(n.isChangeOrigin&&e.relativeAnchorPos!=null){let t=n.getAbsolutePos(e.relativeAnchorPos);return!Number.isFinite(t)||t<=0?null:{...e,anchorPos:t}}let r=t.mapping.mapResult(e.anchorPos,1);return r.deleted?null:{...e,anchorPos:r.pos}}function pK(e,t,n){let r=0;for(let i=t;i<n;i+=1)r+=e.child(i).nodeSize;return r}function mK(e){return BG(e)?{anchorPos:e.from,nodeCount:e.ranges.length,depth:e.depth??0}:null}function hK(e,t,n,r){let i=e.resolve(t),a=i.node(r),o=i.index(r);o>=a.childCount&&(o=Math.max(0,a.childCount-n));let s=Math.min(n,a.childCount-o);if(s<=0)return null;let c=i.start(r)+pK(a,0,o);return{anchor:c,head:c+pK(a,o,o+s),count:s}}function gK(e,t,n,r){try{let i=hK(e,t,n,r);if(!i)return null;let a=zG.create(e,i.anchor,i.head,r);return a.ranges.length===n?a:null}catch{return null}}var _K=(e,t)=>{let n=tW.getState(e);return n?YW(t,n.type,n.binding.mapping):null},vK=(e,t)=>{let n=tW.getState(e);return n?QW(n.doc,n.type,t,n.binding.mapping)||0:-1},yK=(e,t)=>{let n=t;for(;n?.parentNode&&n.parentNode!==e.dom;)n=n.parentNode;return n},bK=new X(`dragHandle`),xK=({pluginKey:e=bK,element:t,editor:n,computePositionConfig:r,getReferencedVirtualElement:i,onNodeChange:a,onElementDragStart:o,onElementDragEnd:s,nestedOptions:c,dragImageProperties:l})=>{let u=document.createElement(`div`),d=!1,f=null,p=-1,m,h=null,g=null,_=null,v=null;function y(){_=null,v=null}function b(e,t){v&&=fK(v,e,{isChangeOrigin:SG(e),getAbsolutePos:e=>vK(t,e)})}function x(e){if(!v)return null;let t=gK(e.doc,v.anchorPos,v.nodeCount,v.depth);return t?(y(),e.tr.setSelection(t)):(v=null,_=null,null)}function S(){t&&(t.style.visibility=`hidden`,t.style.pointerEvents=`none`)}function C(){if(t){if(!n.isEditable){S();return}t.style.visibility=``,t.style.pointerEvents=`auto`}}function w(e){mT(i?.()||{getBoundingClientRect:()=>e.getBoundingClientRect()},t,r).then(e=>{Object.assign(t.style,{position:e.strategy,left:`${e.x}px`,top:`${e.y}px`})})}function T(e){o?.(e),lK(e,n,c,{node:f,pos:p},l),_=mK(n.state.selection),t&&(t.dataset.dragging=`true`),setTimeout(()=>{t&&(t.style.pointerEvents=`none`)},0)}function E(e){s?.(e),_=null,S(),t&&(t.style.pointerEvents=`auto`,t.dataset.dragging=`false`)}function ee(e){if(!e.target||!n.view.dom.contains(e.target))return;if(mL()){let e=n.view.dom;requestAnimationFrame(()=>{e.isContentEditable&&(e.contentEditable=`false`,e.contentEditable=`true`)})}if(!_||n.view.state.selection.empty)return;let t=n.state.selection.from,r=_K(n.state,t);v={..._,anchorPos:t,relativeAnchorPos:r??void 0},n.view.dispatch(n.state.tr.setMeta(`addToHistory`,!1))}function te(){t.removeEventListener(`dragstart`,T),t.removeEventListener(`dragend`,E),document.removeEventListener(`drop`,ee),h&&(cancelAnimationFrame(h),h=null,g=null),y()}return u.appendChild(t),{unbind(){te()},plugin:new Y({key:typeof e==`string`?new X(e):e,state:{init(){return{locked:!1}},apply(e,r,i,o){b(e,o);let s=e.getMeta(`lockDragHandle`),c=e.getMeta(`hideDragHandle`);if(s!==void 0&&(d=s),c)return S(),d=!1,f=null,p=-1,a?.({editor:n,node:null,pos:-1}),r;if(e.docChanged&&p!==-1&&t){if(SG(e)){let e=vK(o,m);e!==p&&(p=e)}else{let t=e.mapping.map(p);t!==p&&(p=t,m=_K(o,p))}}return r}},appendTransaction(e,t,n){return x(n)},view:e=>{var r;return t.draggable=!0,t.style.pointerEvents=`auto`,t.dataset.dragging=`false`,(r=n.view.dom.parentElement)==null||r.appendChild(u),u.style.pointerEvents=`none`,u.style.position=`absolute`,u.style.top=`0`,u.style.left=`0`,u.style.zIndex=`10`,t.addEventListener(`dragstart`,T),t.addEventListener(`dragend`,E),document.addEventListener(`drop`,ee),{update(r,i){if(!t)return;if(!n.isEditable){S();return}if(t.draggable=!d,e.state.doc.eq(i.doc)||p===-1)return;let o=e.nodeDOM(p);if(o=yK(e,o),o===e.dom||o?.nodeType!==1)return;let s=e.posAtDOM(o,0),c=dK(n.state.doc,s),l=uK(n.state.doc,s);f=c,p=l,m=_K(e.state,p),a?.({editor:n,node:f,pos:p}),w(o)},destroy(){te(),t&&aK(u)}}},props:{handleDOMEvents:{keydown(e){return!t||d?!1:e.hasFocus()?(S(),f=null,p=-1,a?.({editor:n,node:null,pos:-1}),!1):!1},mouseleave(e,t){return d||t.target&&!u.contains(t.relatedTarget)&&(S(),f=null,p=-1,a?.({editor:n,node:null,pos:-1})),!1},mousemove(e,r){return!t||d||(g={x:r.clientX,y:r.clientY},h)||(h=requestAnimationFrame(()=>{if(h=null,!g)return;let{x:t,y:r}=g;g=null;let i=nK({x:t,y:r,direction:`right`,editor:n,nestedOptions:c});if(!i.resultElement)return;let o=i.resultElement,s=i.resultNode,l=i.pos;if(!c?.enabled){if(o=yK(e,o),o===e.dom||o?.nodeType!==1)return;let t=e.posAtDOM(o,0);s=dK(n.state.doc,t),l=uK(n.state.doc,t)}s!==f&&(f=s,p=l??-1,m=_K(e.state,p),a?.({editor:n,node:f,pos:p}),w(o),C())})),!1}}}})}};function SK(e){return e===!1||e===void 0?{enabled:!1,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:GG(`none`)}:e===!0?{enabled:!0,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:GG(`left`)}:{enabled:!0,rules:e.rules??[],defaultRules:e.defaultRules??!0,allowedContainers:e.allowedContainers,edgeDetection:GG(e.edgeDetection)}}var CK={placement:`left-start`,strategy:`absolute`};LL.create({name:`dragHandle`,addOptions(){return{render(){let e=document.createElement(`div`);return e.classList.add(`drag-handle`),e},computePositionConfig:{},locked:!1,onNodeChange:()=>null,onElementDragStart:void 0,onElementDragEnd:void 0,nested:!1,dragImageProperties:void 0}},addCommands(){return{lockDragHandle:()=>({editor:e})=>(this.options.locked=!0,e.commands.setMeta(`lockDragHandle`,this.options.locked)),unlockDragHandle:()=>({editor:e})=>(this.options.locked=!1,e.commands.setMeta(`lockDragHandle`,this.options.locked)),toggleDragHandle:()=>({editor:e})=>(this.options.locked=!this.options.locked,e.commands.setMeta(`lockDragHandle`,this.options.locked))}},addProseMirrorPlugins(){let e=this.options.render(),t=SK(this.options.nested);return[xK({computePositionConfig:{...CK,...this.options.computePositionConfig},getReferencedVirtualElement:this.options.getReferencedVirtualElement,element:e,editor:this.editor,onNodeChange:this.options.onNodeChange,onElementDragStart:this.options.onElementDragStart,onElementDragEnd:this.options.onElementDragEnd,nestedOptions:t,dragImageProperties:this.options.dragImageProperties}).plugin]}});var wK=Ja({name:`DragHandleVue`,props:{pluginKey:{type:[String,Object],default:bK},editor:{type:Object,required:!0},computePositionConfig:{type:Object,default:()=>({})},onNodeChange:{type:Function,default:null},onElementDragStart:{type:Function,default:null},onElementDragEnd:{type:Function,default:null},class:{type:String,default:`drag-handle`},nested:{type:[Boolean,Object],default:!1}},setup(e,{slots:t}){let n=rr(null),r=ir(null),i=()=>{let{editor:t,pluginKey:i,onNodeChange:a,onElementDragEnd:o,onElementDragStart:s,computePositionConfig:c,nested:l}=e;if(!n.value||!e.editor||e.editor.isDestroyed)return;n.value.style.visibility=`hidden`;let u=SK(l),d=xK({editor:t,element:n.value,pluginKey:i,computePositionConfig:{...CK,...c},onNodeChange:a,onElementDragStart:s,onElementDragEnd:o,nestedOptions:u});r.value=d,e.editor.registerPlugin(d.plugin)},a=()=>{var t,n;r.value&&=(e.editor&&!e.editor.isDestroyed&&e.editor.unregisterPlugin(e.pluginKey),(t=(n=r.value).unbind)==null||t.call(n),null)};return us(async()=>{await yi(),i()}),oa(()=>e.nested,()=>{a(),i()},{deep:!0}),ps(()=>{a()}),()=>sd(`div`,{ref:n,class:e.class,style:{position:`absolute`},"data-dragging":`false`},t.default?.call(t))}}),TK,EK;if(typeof WeakMap<`u`){let e=new WeakMap;TK=t=>e.get(t),EK=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;TK=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},EK=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var DK=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return TK(e)||EK(e,OK(e))}};function OK(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=kK(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new DK(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&AK(s,o,e),s}function kK(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function AK(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=jK(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function jK(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function MK(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}new X(`selectingCells`);function NK(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function PK(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function FK(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=NK(t.$head)||IK(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function IK(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function LK(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function RK(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function zK(e,t,n){let r=e.node(-1),i=DK.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function BK(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}var VK=class e extends K{constructor(e,t=e){let n=e.node(-1),r=DK.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new tO(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(LK(r)&&LK(i)&&RK(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return q.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=DK.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=BK(e,0,l)),u>0&&(e=BK(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(W.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new G(W.from(o),1,1)}replace(e,t=G.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?G.empty:t)}let i=K.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new G(W.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=DK.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=DK.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=DK.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=DK.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new HK(this.$anchorCell.pos,this.$headCell.pos)}};VK.prototype.visible=!1,K.jsonID(`cell`,VK);var HK=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&RK(t,n)?new VK(t,n):K.near(n,1)}};new X(`fix-tables`);function UK(e){let t=e.selection,n=FK(e),r=n.node(-1),i=n.start(-1),a=DK.get(r);return{...t instanceof VK?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function WK(e){return function(t,n){if(!PK(t))return!1;if(n){let r=MK(t.schema),i=UK(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function GK(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function KK(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?WK(e):function(t,n){if(!PK(t))return!1;if(n){let r=MK(t.schema),i=UK(t),a=t.tr,o=GK(`row`,i,r),s=GK(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}KK(`row`,{useDeprecatedLogic:!0}),KK(`column`,{useDeprecatedLogic:!0}),KK(`cell`,{useDeprecatedLogic:!0});function qK(e,t){let n=e.selection;if(!(n instanceof VK))return!1;if(t){let r=e.tr,i=MK(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new G(i,0,0))}),r.docChanged&&t(r)}return!0}JN({ArrowLeft:YK(`horiz`,-1),ArrowRight:YK(`horiz`,1),ArrowUp:YK(`vert`,-1),ArrowDown:YK(`vert`,1),"Shift-ArrowLeft":XK(`horiz`,-1),"Shift-ArrowRight":XK(`horiz`,1),"Shift-ArrowUp":XK(`vert`,-1),"Shift-ArrowDown":XK(`vert`,1),Backspace:qK,"Mod-Backspace":qK,Delete:qK,"Mod-Delete":qK});function JK(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function YK(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof VK)return JK(n,r,K.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=ZK(i,e,t);if(o==null)return!1;if(e==`horiz`)return JK(n,r,K.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=zK(i,e,t),s;return s=a?K.near(a,1):t<0?K.near(n.doc.resolve(i.before(-1)),-1):K.near(n.doc.resolve(i.after(-1)),1),JK(n,r,s)}}}function XK(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof VK)o=a;else{let r=ZK(i,e,t);if(r==null)return!1;o=new VK(n.doc.resolve(r))}let s=zK(o.$headCell,e,t);return s?JK(n,r,new VK(o.$anchorCell,s)):!1}}function ZK(e,t,n){if(!(e.state.selection instanceof q))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}new X(`tableColumnResizing`);function QK(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var $K=class{get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(cT(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(sT(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(aT(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(dT(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(lT(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(oT(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(uT(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(fT(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){var e;let{selection:t}=this.editor.state,n=this.getReferencedVirtualElement?.call(this);if(n)return n;if(!((e=this.view)!=null&&(e=e.dom)!=null&&e.parentNode))return;let r=uI(this.view,t.from,t.to),i={getBoundingClientRect:()=>r,getClientRects:()=>[r]};if(t instanceof J){let e=this.view.nodeDOM(t.from),n=e.dataset.nodeViewWrapper?e:e.querySelector(`[data-node-view-wrapper]`);n&&(e=n),e&&(i={getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>[e.getBoundingClientRect()]})}if(t instanceof VK){let{$anchorCell:e,$headCell:n}=t,r=e?e.pos:n.pos,a=n?n.pos:e.pos,o=this.view.nodeDOM(r),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():QK(o.getBoundingClientRect(),s.getBoundingClientRect());i={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return i}constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&xP(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);(n||r)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&mT(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(this.isVisible&&!this.editor.isDestroyed&&this.element.isConnected){if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},eq=e=>new Y({key:typeof e.pluginKey==`string`?new X(e.pluginKey):e.pluginKey,view:t=>new $K({view:t,...e})});LL.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[eq({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var tq=class{getTextContent(e){return zF(e,{textSerializers:BF(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(cT(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(sT(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(aT(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(dT(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(lT(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(oT(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(uT(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(fT(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!((e=this.view)!=null&&(e=e.dom)!=null&&e.parentNode))return;let{selection:t}=this.editor.state,n=uI(this.view,t.from,t.to);mT({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},nq=e=>new Y({key:typeof e.pluginKey==`string`?new X(e.pluginKey):e.pluginKey,view:t=>new tq({view:t,...e})});LL.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[nq({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var rq=Ja({name:`BubbleMenu`,inheritAttrs:!1,props:{pluginKey:{type:[String,Object],default:void 0},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:()=>({})},appendTo:{type:[Object,Function],default:void 0},shouldShow:{type:Function,default:null},getReferencedVirtualElement:{type:Function,default:void 0}},setup(e,{slots:t,attrs:n}){let r=rr(null),i=e.pluginKey??new X(`bubbleMenu`);return us(()=>{let{editor:t,options:n,resizeDelay:a,appendTo:o,shouldShow:s,getReferencedVirtualElement:c,updateDelay:l}=e,u=r.value;u&&(u.style.visibility=`hidden`,u.style.position=`absolute`,u.remove(),yi(()=>{t.registerPlugin(eq({editor:t,element:u,options:n,pluginKey:i,resizeDelay:a,appendTo:o,shouldShow:s,getReferencedVirtualElement:c,updateDelay:l}))}))}),ps(()=>{let{editor:t}=e;t.unregisterPlugin(i)}),()=>sd(`div`,{ref:r,...n},t.default?.call(t))}}),iq=Ja({name:`FloatingMenu`,inheritAttrs:!1,props:{pluginKey:{type:null,default:void 0},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:()=>({})},appendTo:{type:[Object,Function],default:void 0},shouldShow:{type:Function,default:null}},setup(e,{slots:t,attrs:n}){let r=rr(null),i=e.pluginKey??new X(`floatingMenu`);return us(()=>{let{editor:t,updateDelay:n,resizeDelay:a,options:o,appendTo:s,shouldShow:c}=e,l=r.value;l&&(l.style.visibility=`hidden`,l.style.position=`absolute`,l.remove(),t.registerPlugin(nq({pluginKey:i,editor:t,element:l,updateDelay:n,resizeDelay:a,options:o,appendTo:s,shouldShow:c})))}),ps(()=>{let{editor:t}=e;t.unregisterPlugin(i)}),()=>sd(`div`,{ref:r,...n},t.default?.call(t))}});export{cu as $,F as $t,oT as A,Ya as At,ow as B,ld as Bt,aI as C,nu as Ct,X as D,Ss as Dt,Y as E,As as Et,fT as F,ra as Ft,Cp as G,$n as Gt,sC as H,jr as Ht,pT as I,ia as It,Yl as J,Kn as Jt,xp as K,Pr as Kt,aT as L,aa as Lt,mT as M,qs as Mt,cT as N,Qa as Nt,q as O,Ns as Ot,uT as P,oa as Pt,mu as Q,ir as Qt,sT as R,Yi as Rt,LF as S,fs as St,J as T,Es as Tt,jp as U,Mr as Ut,lw as V,mr as Vt,Jd as W,nr as Wt,vu as X,Gn as Xt,Sa as Y,rr as Yt,od as Z,qn as Zt,dR as _,ls as _t,NG as a,We as an,Wo as at,LL as b,us as bt,uG as c,at as cn,_u as ct,eW as d,$i as dt,vr as en,Su as et,KH as f,Zs as ft,uR as g,Qo as gt,lR as h,yi as ht,PG as i,lr as in,hu as it,iT as j,bc as jt,dT as k,Js as kt,tW as l,Tt as ln,sd as lt,cR as m,Eu as mt,iq as n,ur as nn,Ds as nt,OG as o,ut as on,Ja as ot,AR as p,Qs as pt,Zl as q,Wn as qt,wK as r,sr as rn,bu as rt,sG as s,dt as sn,ku as st,rq as t,hr as tn,su as tt,oG as u,Je as un,ea as ut,mR as v,ps as vt,DF as w,Qi as wt,iR as x,ms as xt,fR as y,$o as yt,lT as z,Xi as zt};