@octane-xplat/tiptap 0.10.0 → 0.11.1
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.
- package/README.md +58 -2
- package/dist/macos/browser.js +1 -1
- package/dist/native/index3.js +38 -21
- package/dist/native/octane-client-build.json +1 -1
- package/dist/web/index2.js +13 -3
- package/dist/web/octane-client-build.json +1 -1
- package/package.json +8 -6
- package/src/TiptapEditor.mobile.test.ts +229 -0
- package/src/TiptapEditor.tsrx +52 -20
- package/src/TiptapEditor.web.test.tsrx +129 -0
- package/src/TiptapEditor.web.tsrx +25 -3
- package/src/types.ts +27 -1
- package/types/types.d.ts +26 -1
package/dist/macos/browser.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by build-browser.mjs; local WebKit editor document.
|
|
2
|
-
export default "<!doctype html><html><head><meta charset=\"utf-8\"><meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'none'; script-src 'nonce-xplat-editor'; style-src 'unsafe-inline'; img-src data:\"><style>html,body{margin:0;height:100%;font:14px system-ui} .ProseMirror,.vx-lexical-input{min-height:100px;padding:8px;outline:none} .ProseMirror:empty:before{content:attr(data-placeholder);opacity:.5} </style></head><body><div id=\"root\"></div><script nonce=\"xplat-editor\">(function(){var e=Reflect.apply,t=Symbol.for,n=null;try{let r=e(Function.prototype.toString,t,[]);typeof t==`function`&&typeof r==`string`&&/^function for\\(\\)\\s*\\{\\s*\\[native code\\]\\s*\\}$/.test(r)&&(n=t)}catch{}var r=[];function i(e){return r[e]??={prefix:``,tag:``,size:0,value:``,path:``,slots:null}}function a(t,r,a,o=!1){let s=t.length,c=a?`@octane:universal-hook:`:`@octane:hook:`,l=s<16;for(let u=0;u<=s;u++){let d=u===s,f=d?r:t[u];l&&=f===null||typeof f!=`object`&&typeof f!=`function`;let p,m,h,g;if(!a&&d&&r===void 0)p=``,m=0,h=``;else if(!a)p=typeof f==`number`?`n`:o&&typeof f==`string`?`t`:`s`,h=typeof f==`number`?String(f):o&&typeof f==`string`?f:f.description??``,m=h.length,(typeof h!=`string`||typeof m!=`number`)&&(g=p+m+`:`+h,l=!1);else{p=typeof f==`symbol`?`s`:`v`,m=typeof f==`symbol`?f.description?.length??0:String(f).length;let e=typeof m==`number`?void 0:`${p}${m}:`;h=typeof f==`symbol`?f.description??``:String(f),(e!==void 0||typeof h!=`string`)&&(g=`${e??`${p}${m}:`}${h}`,l=!1)}if(d){let t=Symbol,a=t.for;if(!l||a!==n){let r=c+(g??(p===``?``:p+m+`:`+h));return a===n?a(r):e(a,t,[r])}let o=i(s),u=o.slots??=new Map,d=u.get(r);if(d!==void 0&&d.prefix===c&&d.tag===p&&d.size===m&&d.value===h)return d.resolved;let f=a(c+(p===``?``:p+m+`:`+h));return d===void 0?u.size<32&&u.set(r,{prefix:c,tag:p,size:m,value:h,resolved:f}):(d.prefix=c,d.tag=p,d.size=m,d.value=h,d.resolved=f),f}if(!l){c+=g??p+m+`:`+h;continue}let _=i(u);(_.prefix!==c||_.tag!==p||_.size!==m||_.value!==h)&&(_.prefix=c,_.tag=p,_.size=m,_.value=h,_.path=c+p+m+`:`+h),c=_.path}throw Error(`Unreachable hook path`)}var o=new Set;for(let e of`animationIterationCount.aspectRatio.borderImageOutset.borderImageSlice.borderImageWidth.boxFlex.boxFlexGroup.boxOrdinalGroup.columnCount.columns.flex.flexGrow.flexPositive.flexShrink.flexNegative.flexOrder.gridArea.gridRow.gridRowEnd.gridRowSpan.gridRowStart.gridColumn.gridColumnEnd.gridColumnSpan.gridColumnStart.fontWeight.lineClamp.lineHeight.opacity.order.orphans.scale.tabSize.widows.zIndex.zoom.fillOpacity.floodOpacity.stopOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeOpacity.strokeWidth`.split(`.`)){let t=e.toLowerCase();o.add(t),o.add(`webkit`+t),o.add(`ms`+t),o.add(`moz`+t),o.add(`o`+t)}var s=new Map;function c(e){let t=s.get(e);if(t!==void 0)return t;let n=o.has(e.replaceAll(`-`,``).toLowerCase());return s.set(e,n),n}function l(e,t){return typeof t==`number`&&t!==0&&e.charCodeAt(0)!==45&&!c(e)?t+`px`:typeof t==`string`?t.trim():``+t}function u(e){if(e===`cssFloat`)return`float`;if(e.charCodeAt(0)===45)return e;let t=!1;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=65&&r<=90){t=!0;break}}if(!t)return e;let n=``;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);n+=r>=65&&r<=90?`-`+String.fromCharCode(r+32):e[t]}return n.charCodeAt(0)===109&&n.charCodeAt(1)===115&&n.charCodeAt(2)===45&&(n=`-`+n),n}function d(e){if(typeof e==`string`)return e;if(typeof e!=`object`)return typeof e==`number`&&e?``+e:``;if(e===null)return``;let t=``;if(Array.isArray(e))for(let n=0;n<e.length;n++){let r=e[n];if(r){let e=d(r);e&&(t=t?t+` `+e:e)}}else for(let n in e)e[n]&&(t=t?t+` `+n:n);return t}var f=/^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*\\:/i,p=`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`,m=new Set([`annotation-xml`,`color-profile`,`font-face`,`font-face-src`,`font-face-uri`,`font-face-format`,`font-face-name`,`missing-glyph`]);function h(e){let t=e.charCodeAt(0);return t>32&&t<127&&t!==74&&t!==106?e:f.test(e)?p:e}function g(e,t){return e=e===void 0?void 0:e.toLowerCase(),e!==void 0&&e.includes(`-`)&&!m.has(e)?!1:(t=t.toLowerCase(),t===`src`||t===`href`||t===`action`||t===`formaction`||t===`xlink:href`||t===`xlinkhref`||t===`data`&&e===`object`)}function _(e,t,n){return g(e,t)?h(n):n}var v=`data-octane-input`,y=`data-octane-signal-control`,b=`[b;`,x=`;b;`,S=`[f0`+x,C=`[f1`+x,w=S.length,ee=b.length,te=`;root`;function ne(e){let t=e.startsWith(S)||e.startsWith(C);if(!t&&!e.startsWith(b))return!1;let n=t?w:ee,r=e.indexOf(`;`,n);if(r<=n||r===e.length-1)return!1;if(t)return e.indexOf(`;`,r+1)===-1;if(e.length-r===5&&e.endsWith(te))return!0;let i=e.indexOf(`;`,r+1);if(i<=r+1||i===e.length-1)return!1;let a=i+1;if(e.length===a+1){let t=e.charCodeAt(a);return t===116||t===118||t===115||t===111||t>=48&&t<=57}if(e.charCodeAt(a)===107&&e.charCodeAt(a+1)===59)return(e.charCodeAt(a+2)===115||e.charCodeAt(a+2)===110)&&e.charCodeAt(a+3)===58&&e.length>a+4;if(e.length===a+2&&e.endsWith(`-1`))return!0;if(e.charCodeAt(a)<49||e.charCodeAt(a)>57)return!1;for(let t=a+1;t<e.length;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}return!0}var T=`data-oct-b`,re=`https://octanejs.dev/errors/`,ie=/[\\uD800-\\uDFFF]/gu;function ae(e){return encodeURIComponent(String(e).replace(ie,`�`))}function oe(e,t){let n=re+e;for(let e=0;e<t.length;e++)n+=`${e===0?`?`:`&`}args[]=${ae(t[e])}`;return`Minified Octane error #${e}; visit ${n} for the full message or use a development build for full errors and additional helpful warnings.`}function E(e,...t){return oe(e,t)}function se(e){return`Minified Octane error #`+e+`; visit https://octanejs.dev/errors/`+e+` for the full message or use a development build for full errors and additional helpful warnings.`}var ce,le=null,ue,de;function fe(){return ce===void 0?le??ue?.()??null:ce.current()??le}function pe(){return ce?.current()??le}function me(e){if(typeof e!=`function`)throw TypeError(se(190));let t=ue;return ue=e,()=>{ue===e&&(ue=t)}}function he(e,t){if(typeof t!=`function`)throw TypeError(se(191));if(ce)return ce.run(e,t);let n=le;le=e;try{return t()}finally{le=n}}function ge(e){de?.(e)}var _e=Symbol(`octane.transitionConsumer`),ve;function ye(e){let t=ve;return ve=e,t}var be=class extends Error{scopeKey;nodeKey;read;constructor(e,t,n=`value`){super(E(194,n,e,t)),this.name=`NativeAdoptionMiss`,this.scopeKey=e,this.nodeKey=t,this.read=n}},xe=null;function Se(){let e=xe;return e?.startBatch(),e}function Ce(e){e?.endBatch()}function we(e){let t=Se();try{return e()}finally{Ce(t)}}var Te=new WeakMap;function Ee(e){e.owner=void 0}function De(e,t,n){let r=Te.get(e),i=r?.get(t)??0,a=n?2:1;return(i&a)!==0&&((i&~a)===0?r.delete(t):r.set(t,i&~a),!0)}function Oe(e){Te.delete(e)}var ke=globalThis[Symbol.for(`octane.contextEpoch`)]??={value:0};function Ae(){return ke.value}function je(){ke.value++}var Me=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),Ne=new Set([`allowfullscreen`,`async`,`autoplay`,`controls`,`credentialless`,`default`,`defer`,`disabled`,`disablepictureinpicture`,`disableremoteplayback`,`formnovalidate`,`hidden`,`inert`,`itemscope`,`loop`,`nomodule`,`novalidate`,`open`,`playsinline`,`readonly`,`required`,`reversed`,`scoped`,`seamless`]),Pe=new Set([`size`,`cols`,`rows`,`span`]),Fe=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),Ie=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`],[`xlinkActuate`,`xlink:actuate`],[`xlinkArcrole`,`xlink:arcrole`],[`xlinkHref`,`xlink:href`],[`xlinkRole`,`xlink:role`],[`xlinkShow`,`xlink:show`],[`xlinkTitle`,`xlink:title`],[`xlinkType`,`xlink:type`],[`xmlBase`,`xml:base`],[`xmlLang`,`xml:lang`],[`xmlSpace`,`xml:space`],[`tabIndex`,`tabindex`]]);function Le(e){switch(e.length){case 10:return e.toLowerCase()===`spellcheck`;case 9:return e.toLowerCase()===`draggable`;case 15:return e.toLowerCase()===`contenteditable`}return!1}var Re=Symbol.for(`octane.external-hydration-promise`),ze=Symbol.for(`octane.hydration-range-boundary`),Be=Me,Ve=Ne,He=Pe,Ue=/^[^\\s\"'>\\/=\\u0000-\\u001F]+$/,We=Fe,Ge=Ie,Ke=Le,qe=l,Je=`Abort AnimationEnd AnimationIteration AnimationStart AuxClick BeforeInput BeforeToggle Blur Cancel CanPlay CanPlayThrough Change Click Close CompositionEnd CompositionStart CompositionUpdate ContextMenu Copy Cut DoubleClick Drag DragEnd DragEnter DragExit DragLeave DragOver DragStart Drop DurationChange Emptied Encrypted Ended Error Focus GotPointerCapture Input Invalid KeyDown KeyPress KeyUp Load LoadedData LoadedMetadata LoadStart LostPointerCapture MouseDown MouseEnter MouseLeave MouseMove MouseOut MouseOver MouseUp Paste Pause Play Playing PointerCancel PointerDown PointerEnter PointerLeave PointerMove PointerOut PointerOver PointerUp Progress RateChange Reset Resize Scroll ScrollEnd Seeked Seeking Select Stalled Submit Suspend TimeUpdate Toggle TouchCancel TouchEnd TouchMove TouchStart TransitionCancel TransitionEnd TransitionRun TransitionStart VolumeChange Waiting Wheel`,Ye;function Xe(e){if(Ye===void 0){Ye=new Set;for(let e of Je.split(` `))Ye.add(`on`+e),Ye.add(`on`+e+`Capture`)}return Ye.has(e)}var Ze=Object.prototype.hasOwnProperty;function Qe(e,t){let n=e?.defaultProps;if(n!=null)for(let e in n)t[e]===void 0&&(t[e]=n[e])}function $e(e){if(typeof e!=`object`||!e)return null;let t=typeof Symbol==`function`&&e[Symbol.iterator]||e[`@@iterator`];return typeof t==`function`?t:null}var et=`__octaneEarlyHydrationIntents`,tt=new WeakMap,nt=new WeakMap,rt=new WeakMap,it=new WeakMap,at=new WeakSet;function ot(e){return typeof e==`object`&&!!e&&`documentOwner`in e}function st(e){return ot(e)?e.instanceOwner:e}function ct(e,t,n){return JSON.stringify([e,t,n])}function lt(e,t){tt.set(st(e),t),ot(e)&&tt.set(e.documentOwner,t)}function ut(e){let t=e.getAttribute(y);if(t===null)return null;try{let e=JSON.parse(t);if(!Array.isArray(e)||e.length!==3||e[0]!==1||typeof e[1]!=`string`||!Array.isArray(e[2]))return null;let n=[];for(let t of e[2]){if(!Array.isArray(t)||t.length!==3||typeof t[0]!=`string`||typeof t[1]!=`string`||t[2]!==`value`&&t[2]!==`checked`)return null;n.push(t)}return{ownerKey:e[1],bindings:n}}catch{return null}}function dt(e,t){return t===`checked`?e.checked:e.localName===`select`&&e.multiple?Array.from(e.selectedOptions,e=>e.value):e.value}function ft(e,t){let n=ut(e);if(n!==null){let r=nt.get(e.ownerDocument);r===void 0&&nt.set(e.ownerDocument,r=new Map);for(let[i,a,o]of n.bindings){let s=ct(n.ownerKey,i,a),c=r.get(s);(at.has(e.ownerDocument)||c===void 0||t>=c.revision)&&r.set(s,{revision:t,value:dt(e,o)})}}let r=rt.get(e);if(r!==void 0)for(let[t,n]of r)n(dt(e,t))}function pt(e,t,n){let r=rt.get(e);return r===void 0&&rt.set(e,r=new Map),r.set(t,n),()=>{r.get(t)===n&&(r.delete(t),r.size===0&&rt.delete(e))}}function mt(e){return it.get(e)??0}function ht(e){it.delete(e)}function gt(e){at.add(e)}function _t(e,t){at.has(e.ownerDocument)||(it.set(e,t),ft(e,t))}if(typeof globalThis<`u`){let e=globalThis;e.__octanePublishSignalControl=_t;let t=e.__octaneEarlySignalControls;if(t!==void 0){t.p=_t;let e=t.q.splice(0);for(let[t,n]of e)_t(t,n)}}var vt=new WeakSet;function yt([e,t,n,r,i,a,,,o],s){return!o&&e.target===t&&t.isConnected&&n.isConnected&&t.ownerDocument===s&&n.ownerDocument===s&&t.closest(`[data-octane-hydrate-independent]`)===n&&n.getAttribute(`data-octane-hydrate-id`)===r&&n.getAttribute(`data-octane-hydrate-when`)===i&&n.getAttribute(`data-octane-hydrate-interaction-events`)===a}function bt(e){return e!==null&&e.nodeType===1}var xt=new WeakMap;function St(e){if(!bt(e))return null;let t=e.localName;return t===`input`||t===`textarea`||t===`select`||e.isContentEditable?e:null}function Ct(e){let t=xt.get(e);if(t===void 0){let n=mt(e);t={editRevision:n,selectionRevision:0,revision:n,composing:!1},xt.set(e,t)}return t}function wt(e){let t=St(e.target);if(t===null)return;let n=Ct(t);switch(e.type){case`input`:n.editRevision++,n.revision++,ft(t,n.revision);break;case`compositionstart`:n.composing=!0,n.revision++;break;case`compositionupdate`:n.revision++;break;case`compositionend`:n.composing=!1,n.revision++;break;case`focusin`:case`focusout`:n.revision++}}function Tt(e){let t=e.currentTarget,n=St(t.activeElement);if(n===null)return;let r=Ct(n);r.selectionRevision++,r.revision++}function Et(e){if(St(e)===null)return null;let t=xt.get(e),n=t===void 0?mt(e):0,r=e,i,a,o,s=null,c=null,l=null;if(e.localName===`select`){let e=r;i=e.value,e.multiple&&(o=Array.from(e.selectedOptions,e=>e.value))}else if(e.isContentEditable)i=e.textContent??``;else{i=r.value,e.localName===`input`&&(a=r.checked);try{s=r.selectionStart,c=r.selectionEnd,l=r.selectionDirection}catch{}}return{editRevision:t?.editRevision??n,selectionRevision:t?.selectionRevision??0,revision:t?.revision??n,value:i,...a===void 0?{}:{checked:a},...o===void 0?{}:{selectedValues:o},selectionStart:s,selectionEnd:c,selectionDirection:l,focused:e.ownerDocument.activeElement===e,composing:t?.composing??!1}}function Dt(e,t){if(e.localName!==`textarea`||typeof t!=`string`||xt.get(e)?.composing===!0)return!1;let n=e,r=n.defaultValue.replace(/\\r\\n?/g,`\n`);return t.replace(/\\r\\n?/g,`\n`)===r&&n.value!==r}function Ot(e,t){kt(e.ownerDocument);let n=Ct(e);return n.revision===t&&(n.editRevision=0,n.selectionRevision=0,ht(e),!0)}function kt(e){let t=e??(typeof document>`u`?void 0:document);if(t===void 0||vt.has(t))return;vt.add(t);let n=t[et],r=typeof n?.stop==`function`?t.defaultView??t:t,i=r===t?wt:e=>{e.target?.ownerDocument===t&&wt(e)};for(let e of[`input`,`compositionstart`,`compositionupdate`,`compositionend`,`focusin`,`focusout`])r.addEventListener(e,i,!0);t.addEventListener(`selectionchange`,Tt,!0),gt(t);for(let e of n?.q??[]){let[n]=e,r=St(n.target);r!==null&&yt(e,t)&&(n.type===`input`&&mt(r)>0||wt(n))}}var At=Symbol.for(`octane.flags.component`);function jt(e,t){return typeof e==`function`&&Ze.call(e,At)&&(e[At]&t)===t}var Mt=Symbol.for(`octane.element`),Nt=Symbol.for(`octane.portal`),Pt=Symbol.for(`octane.Fragment`),Ft=Symbol.for(`octane.context`),It=Symbol.for(`octane.childrenBlock`);function Lt(e,t,n,r,i){let a=t===r;if(!a&&r!==null&&t.nodeType===1){let e=r;do{if(t.contains(e)){a=!0;break}e=e.getRootNode().host}while(e!==void 0)}if(!a){e.insertBefore(t,n);return}let o=e.moveBefore;if(!i&&typeof o==`function`){o.call(e,t,n);return}if(t.parentNode!==e||n!==null&&n.parentNode!==e){e.insertBefore(t,n);return}if(t!==n&&t.nextSibling!==n){if(n===null||(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0){let r=t.nextSibling;for(;r!==n;){let n=r.nextSibling;e.insertBefore(r,t),r=n}}else{let r=t.nextSibling,i=n;for(;i!==t;){let t=i.nextSibling;e.insertBefore(i,r),i=t}}}}var Rt=new WeakSet;function zt(e){return Rt.has(e)}var Bt=[];function Vt(e){return Bt.push(e),()=>{let t=Bt.indexOf(e);t!==-1&&Bt.splice(t,1)}}var Ht,Ut;function Wt(e){let t=Gt,n=ye(null);Gt=void 0;try{return e()}finally{Gt=t,ye(n)}}var Gt;function Kt(e){let t=Gt;return Gt=e,t}var qt=null;function Jt(e){let t=qt?.get(e);if(t!==void 0)return t.depth++,t;let n=Se();if(n===null)return null;let r={hooks:n,depth:1,closed:!1};return(qt??=new WeakMap).set(e,r),r}function Yt(e,t){if(t.closed)return;t.closed=!0,qt?.get(e)===t&&qt.delete(e);let n=t.hooks;t.hooks=null,Ce(n)}function Xt(e,t,n,r){if(t===null||t.closed||--t.depth!==0)return;if(!n){Yt(e,t);return}let i=()=>{if(!(t.depth!==0||t.closed))try{Yt(e,t)}catch(e){r(e)}},a=e.target;e.type===`change`&&a?.localName===`input`&&(a.type===`checkbox`||a.type===`radio`)?setTimeout(i,0):queueMicrotask(i)}function Zt(e){return`Minified Octane error #`+e+`; visit https://octanejs.dev/errors/`+e+` for the full message or use a development build for full errors and additional helpful warnings.`}var Qt=new WeakMap,$t=!1,en=!1,tn;function nn(e){let t=e.nodeType===9?e:e.ownerDocument;if(t===null)throw TypeError(Zt(123));let n=Qt.get(t);return n===void 0&&(n=Object.freeze({scopeKey:`octane:document`}),Qt.set(t,n)),lt(n,t),n}function rn(e=1){if(e!==1)throw TypeError(Zt(74));en=!0,!$t&&($t=!0,typeof document<`u`&&me(()=>nn(document)))}var an=Symbol.for(`octane.signal-handle`),on=Symbol.for(`octane.signal-binding-read`),sn=Symbol.for(`octane.signal-binding-subscribe`);function cn(e,t){let n=d(e),r=d(t);return n?r?n+` `+r:n:r}var ln=new Map;function un(e){let t=ln.get(e);if(t!==void 0)return t;let n=u(e);return ln.set(e,n),n}function dn(e){return e.hooks??=new Map}function fn(e,t){(e.cleanups??=[]).push(t)}var D=null,pn=null,mn=null,hn=!1,gn=new WeakMap,_n,vn=new WeakMap;function yn(e){let t=e;for(;t!==null;){let e=t.__trySlot;if(e!==void 0&&!e.propagateSuspense)return e;t=t.parentBlock}}function bn(e){fr++;let t=D?.pauseLifecycle()??-1;try{ge(e)}finally{t>=0&&D.resumeLifecycle(t),fr--}}function xn(e,t){let n=e.children;if(n!==null)for(let e of n){if(e.scope===t)return[`scope`,e.key];let n=xn(e.scope,t);if(n!==null)return[`scope`,e.key,...n]}let r=t.block;for(let t=0;t<e.slots.length;t++){let n=e.slots[t];if(typeof n==`object`&&n){if(r.forSlot!==null&&(n===r.forSlot||n.forSlot===r.forSlot))return[`slot`,t,`item`,r.key];if(n.block===r||n.tryBlock===r||n.emptyBlock===r)return[`slot`,t,n.__kind,n.tryBlock===r?`primary`:n.branch,n.emptyBlock===r?`empty`:n.currentIsBodyFn?void 0:n.currentComp,n.prevKey]}}return null}function Sn(e,t){if(e===t)return[];let n=vn.get(e),r=n?.parent??e.parent??e.block.parentBlock;for(;r instanceof pc;)r=r.parentBlock;if(r===null)return null;let i=n===void 0?xn(r,e):[`slot`,n.slot,n.kind,n.branch,n.component,n.key];if(i===null)return null;let a=Sn(r,t);return a===null?null:a.concat(i)}function Cn(e,t,n){let r=e.paths;for(let e of t){let t=r.children?.get(e);if(t===void 0){if(!n)return;t={},(r.children??=new Map).set(e,t)}r=t}return r}function wn(e,t,n,r=!1){let i=gn.get(e);if(i){let r=Sn(e,t);if(r!==null){let e=n.retrySignalOwners??={paths:{},owners:new Set},t=Cn(e,r,!0),a=t.owner;t.owner=i,e.owners.add(i),a!==void 0&&a!==i&&(e.owners.delete(a),bn(a))}}if(r)O_(e,e=>wn(e,t,n,!0));else if(e.children!==null)for(let r of e.children)wn(r.scope,t,n)}function Tn(e){let t=e.retrySignalOwners;if(t!==void 0){e.retrySignalOwners=void 0;for(let e of t.owners)bn(e)}}function En(e,t){let n=_n;if(Bl(t)){let t=e.idState.renderOwner,n=yn(e),r=n?.tryBlock??t?.current,i=n??t;i!==void 0&&r!=null&&(wn(e,r,i,!0),_n=i.retrySignalOwners)}try{L(e,H()===null&&!M?.hydrating&&!M?.retainedCreated?.has(e))}finally{_n=n}}function Dn(e,t,n){for(;e instanceof pc;)e=e.parentBlock;for(let r=0;r<e.slots.length;r++){let i=e.slots[r];if(i===t||i?.forSlot===t){let t=Sn(e,n);return t===null?null:t.concat(`slot`,r,`item`)}}if(e.children!==null)for(let r of e.children){let e=Dn(r.scope,t,n);if(e!==null)return e}return null}function On(e,t,n){if(e.owner!==void 0&&(t.owners.delete(e.owner),n.push(e.owner),e.owner=void 0),e.children!==void 0)for(let r of e.children.values())On(r,t,n)}function kn(e,t,n,r){let i=yn(e),a=e.idState.renderOwner,o=i?.retrySignalOwners??a?.retrySignalOwners,s=i?.retrySignalOwners===void 0?a?.current:i.tryBlock;if(o===void 0||s==null)return;let c=Dn(e,t,s),l=c===null?void 0:Cn(o,c,!1);if(l?.children===void 0)return;let u=e=>{let t=new Set(e),n=[];for(let[e,r]of l.children)t.has(e)||(l.children.delete(e),On(r,o,n));for(let e of n)bn(e)};if(typeof r!=`function`){u(r);return}if(n===0){u([]);return}let d=new Map,f=!1;return(e,t)=>{f||(d.set(e,t),d.size===n&&(f=!0,u(d.values())))}}function An(e=1,t=!1){if(e!==1)throw TypeError(E(74));hn=!0,t||rn(e)}function jn(e,t){if(e===null)return`null`;let n=typeof e;return n===`string`||n===`number`||n===`bigint`||n===`boolean`?n.charCodeAt(0).toString(36)+`:`+String(e):n===`undefined`?`u:`:{value:e,position:t}}function Mn(e,t,n,r,i,a){if(typeof e==`string`)return e;let o=t+JSON.stringify([n??`legacy`,r,i]),s=a.signalState??={prefix:a.prefix,next:0},c=s.opaqueKeys??=new Map,l=c.get(o);l===void 0&&(l={objects:new WeakMap,symbols:new Map,used:new Set,next:0},c.set(o,l));let u=e.value,d=typeof u==`symbol`?l.symbols.get(u):l.objects.get(u);if(d===void 0){if(d=e.position,d===void 0||l.used.has(d)){for(;l.used.has(l.next);)l.next++;d=l.next++}l.used.add(d),typeof u==`symbol`?l.symbols.set(u,d):l.objects.set(u,d)}return`o:`+d.toString(36)}function Nn(e){return JSON.stringify([e.signalState?.prefix??e.prefix,`root`])}function Pn(e){let t=e.signalInstanceResolved;if(t!==void 0)return t;let n=e.signalInstanceParent;if(n===null)return;let r=In(n,e.signalInstanceSite,e.signalInstanceValue,e.signalInstanceHasKey);return e.signalInstanceResolved=r,r}function Fn(e,t){if(typeof t==`string`){e.signalInstanceResolved=t;return}e.signalInstanceParent=t.parentScope,e.signalInstanceSite=t.invocationSite,e.signalInstanceValue=t.key,e.signalInstanceHasKey=t.hasKey,e.signalInstanceResolved=void 0}function In(e,t,n,r){let i=Pn(e),a=[],o=new Set,s=e;for(;i===void 0&&s!==null;){let e=s.block;o.has(e)||(o.add(e),e.forSlot!==null&&a.push(jn(e.key,e.itemIndex)),i=Pn(e)),s=s.parent,i===void 0&&s!==null&&(i=Pn(s))}let c=e.block;for(;i===void 0&&c!==null;)o.has(c)||(o.add(c),c.forSlot!==null&&a.push(jn(c.key,c.itemIndex))),i=Pn(c),c=c.parentBlock;i??=Nn(e.block.idState),a.reverse();let l=e.block.idState,u=a;for(let e of a)if(typeof e!=`string`){u=[];for(let e of a)u.push(Mn(e,i,t,u,!1,l));break}return i+JSON.stringify([t??`legacy`,u,r?Mn(jn(n),i,t,u,!0,l):``])}function Ln(e){if(e===null)return;let t=e.block.idState.renderOwner,n=t?.signalOwner;if(n===void 0&&en&&(n=nn(e.block.parentNode),t!==void 0&&(t.signalOwner=n)),n===void 0)return;let r=gn.get(e);if((r===void 0||r===!1)&&e.block.forSlot===null&&e.signalInstanceParent===null&&e.signalInstanceResolved===void 0){let t=e.parent??e.block.parentBlock;for(;t!==null&&!(t instanceof pc||t.signalInstanceParent!==null||t.signalInstanceResolved!==void 0);){if(t.block.forSlot?.signalSite!==void 0)return gn.set(e,!1),Ln(t);t=t.parent??t.block.parentBlock}}let i=r===null;if(!r||r.documentOwner!==n){let a=e.block.idState;r=void 0;let o=yn(e.block),s=o?.retrySignalOwners??t?.retrySignalOwners,c=o?.retrySignalOwners===void 0?t?.current:o.tryBlock;if(s!==void 0&&!i&&!e.block.disposed&&c!=null){let t=Sn(e,c),n=t===null?void 0:Cn(s,t,!1);n?.owner!==void 0&&(r=n.owner,n.owner=void 0,s.owners.delete(r))}if(r===void 0||r.documentOwner!==n){let t={scopeKey:n.scopeKey,documentOwner:n,instanceOwner:e,instanceKey:Pn(e)??(e.block.forSlot?.signalSite===void 0?Nn(a):In(e,e.block.forSlot.signalSite,void 0,!1))};t.instanceOwner=t,r=Object.freeze(t)}gn.set(e,r),i&&bn(r)}return lt(r,e.block.parentNode.ownerDocument),r}function Rn(e,t){let n=Ln(e);return n!==void 0&&tn?.(n),n===void 0||fe()===n?t():he(n,t)}function zn(e){let t=k;return t===null?-1:D.beginScope(e,t)}function Bn(e){let t=Sl===0?null:Cl(e);if(t!==null){rc(e,t.block),t.activationRequested&&(t.serverActivationStarted=!1,Do(t.parentBlock));return}rc(e,e);let n=Po?.holdsNativeRead(e)===!0;n&&yr++;try{Do(e)}finally{n&&yr--}}function Vn(e,t,n=!1){let r=D;if(r===null)return!1;if(F?.stageAction(()=>Vn(e,t,n))===!0)return!0;let i=r.acceptCapture(e);if(t===void 0)return!1;let a=n&&r.replayDeferredRefs(e,t);return(i||a||r.hasPublication(t))&&r.stampPublication(t,[e.effects[no],e.effects[ro],e.effects[io],e.events,e.refs]),!1}function Hn(){let e=mn;if(e!==null){mn=null;for(let t of e)t.release()}}var Un=0;function Wn(e){let t=Un;return Un+=e,t}function Gn(e,t){let n=e.locs;if(n===void 0)return``;let r=n[t];return r===void 0?``:`${e.locFile??`<unknown>`}:${r[0]}:${r[1]}`}function Kn(e){return e!==null&&e.__oct_suppress===!0}var qn=0,Jn=1,Yn=2,Xn=0,O=null,k=null,Zn=0,Qn=0,$n=1,er=[],tr=1,nr=0,rr=new WeakMap,ir=0,ar=new WeakMap,or=0,sr=-1,cr=0,lr=null,ur=0,dr=0,fr=0;function pr(e,t=null){fr++;let n=D?.pauseLifecycle()??-1;try{en||t?.block.idState.renderOwner?.signalOwner!==void 0?Rn(t,e):e()}finally{n>=0&&D.resumeLifecycle(n),fr--}}function mr(e,t=-1,n=null){let r=sr;sr=t,or++;try{pr(e,n)}finally{or--,sr=r}}var A=[],hr=0,gr=!1,_r=!1,vr=!1,yr=0,br=0,xr=null;function Sr(){xr??={render:Dh,commit:Mh,dispose:Nh,splice:kh,begin:fi,end:pi,beginUrgent:ac,endUrgent:oc,holdRoot:xi,retryRoot:Si,commitRoot:Ci,discardRoot:wi,keepsRoot:bi,cancelEqual:ai,hasHeld:ii,heldUpdate:ri,rebaseHeld:oi}}var Cr=null,wr=null;function Tr(e){Cr.queue(e)}function Er(e){Cr.prepare(e)}function Dr(e){Cr?.retire(e)}function Or(){!gr&&!_r&&(gr=!0,queueMicrotask(Io))}var kr=null,Ar=null,jr=!1;function Mr(e){let t=e.native;return t!==void 0&&!t.validate()&&(t.hasWrites()?t.rebase():(t.discard(),t=void 0)),t??=e.native=Ht?.(),t!==void 0&&Cr===null&&(Cr=Ut({get attempt(){return wr},set attempt(e){wr=e},get visibility(){return Po},get rollback(){return Wi},get fallbackTimeout(){return e_},schedule:Or,beginRoot:qi,endRoot:Ji,beginAttempt:fi,endAttempt:pi,invalidate:rc,render:I,journal:Ma,journalProperty:N,isSuspense:Bl,releaseHookHolder:Yr,rebaseUpdate:Ir,flushBatch:zr,currentPresentations:Mu,validateCapture:e=>D===null||D.validateCapture(e),acceptCapture:Vn,commitRoots:ua,rollbackRoot:ca,applyMemoSwap:gi,handleError:y_,reportError:g_,unsupportedError:()=>TypeError(E(79))})),t}function Nr(){jr||=!0}function Pr(){return{updates:new Map,pendingActions:0,closed:!1,flushed:!1,hook:null,hooks:null,hooksPending:!1}}function Fr(){return kr===null?_r||dp>0?null:Ar:kr}function Ir(e){if(e.state!==void 0||e.reducer!==void 0||Object.is(e.baseValue,e.slot.value))return e.value;let t=e.slot.value;for(let n of e.operations)t=n(t);return e.baseValue=e.slot.value,e.value=t,e.slot.pendingActionBatch!==void 0&&(e.slot.pendingActionValue=t),t}function Lr(e,t){let n=Fr();if(n===null)return e.value;let r=n.updates.get(e);if(r!==void 0)return Ir(r);if(e.renderTransition!==void 0)return e.renderTransition.value;let i=t===void 0?void 0:xr?.heldUpdate(e,t);return i===void 0?e.value:i.value}function Rr(e,t,n,r,i=!1){let a=Fr();if(a===null)return null;let o=typeof n==`function`?n:()=>n,s=a.updates.get(e);return s===void 0?(s={batch:a,slot:e,block:t,operations:[o],baseValue:e.value,value:r,forceRender:i},a.updates.set(e,s)):(s.operations.push(o),s.value=r,s.forceRender||=i),e.pendingActionBatch=a,e.pendingActionValue=r,s}function zr(e){if(!e.flushed){if(e.native!==void 0){if(e.native.hasWrites()){Jr(e,e),Tr(e),Ar===e&&(Ar=null);return}e.native.discard(),e.native=void 0}e.flushed=!0;for(let t of e.updates.values()){let{slot:n,block:r,forceRender:i}=t,a=t.state===void 0&&t.reducer===void 0?Ir(t):t.value;if(n.pendingActionBatch===e&&(n.pendingActionBatch=void 0,n.pendingActionValue=void 0),r.disposed)continue;let o=t.state,s=t.reducer,c=o?.renderTransition??s?.renderTransition;(o!==void 0||s!==void 0)&&(t.baseValue=c===void 0?n.value:c.baseValue,o===void 0?s!==void 0&&(s.renderPhaseActions=void 0):o.updates=void 0);let l=!Object.is(n.value,a);(l||i||t.previous!==void 0)&&(l&&(n.value=a),t.reducer!==void 0&&(t.reducer.renderTransition=t),t.state!==void 0&&(t.state.renderTransition=t),Do(r))}if(e.updates.size>0){let t=[];for(let n of e.updates.values())n.block.disposed||t.push(n);t.length>0&&Qr.push(t)}e.updates.clear(),Ar===e&&(Ar=null)}}function Br(e){e.closed&&e.pendingActions===0&&zr(e)}var Vr=!1,Hr=0,Ur=new Set,Wr=null;function Gr(e,t){if(e.hook===null)e.hook=t;else if(e.hook!==t){let n=e.hooks;if(n===null)e.hooks=[t];else if(n.includes(t))return;else n.push(t)}else return;e.hooksPending&&(t.pendingBatches++,t.publish(!0))}function Kr(e){let t=e.hook;if(t===null||e.hooksPending)return;e.hooksPending=!0,t.pendingBatches++,t.publish(!0);let n=e.hooks;if(n!==null)for(let e=0;e<n.length;e++)n[e].pendingBatches++,n[e].publish(!0)}function qr(e){if(!e.workComplete||e.pendingActions!==0||(e.pendingHolds??0)!==0||!e.hooksPending)return;e.hooksPending=!1;let t=e.hook;--t.pendingBatches===0&&t.publish(!1);let n=e.hooks;if(n!==null)for(let e=0;e<n.length;e++)--n[e].pendingBatches===0&&n[e].publish(!1)}function Jr(e,t){if(t.hook===null)return;let n=Wr??=new WeakMap,r=n.get(e);r===void 0&&n.set(e,r=new Set),!r.has(t)&&(r.add(t),t.pendingHolds=(t.pendingHolds??0)+1,Kr(t))}function Yr(e){let t=Wr?.get(e);if(t!==void 0){Wr.delete(e);for(let e of t)e.pendingHolds--,qr(e)}}var Xr=0,Zr=null,Qr=[],$r=null;function ei(e){return yr===0&&(k!==e||e.currentRenderMode!==`transition`)&&(_r||dp>0||br===0)}function ti(e){for(;e.next?.batch?.flushed===!0&&!e.next.superseded;)e=e.next;return e}function ni(e,t){if(ei(t))return ri(e,t)}function ri(e,t){if(t.disposed)return;let n=t.idState.renderOwner?.transition;if($r===null&&n===void 0&&Qr.length===0)return;let r=[$r?.entries,n?.entries];for(let t of r)if(t!==void 0)for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.slot===e&&!r.superseded&&Object.is(e.value,r.baseValue))return ti(r)}for(let t=Qr.length-1;t>=0;t--){let n=Qr[t];for(let t=n.length-1;t>=0;t--){let r=n[t];if(r.slot===e&&!r.superseded&&Object.is(e.value,r.baseValue)&&(r.state===void 0&&r.reducer===void 0||e.renderTransition!==void 0))return ti(r)}}}function ii(e,t){return ni(e,t)!==void 0}function ai(e,t){if(!ei(t))return!1;let n=t.idState.renderOwner?.transition;if($r===null&&n===void 0&&Qr.length===0)return!1;let r=!1,i=t=>{if(t!==void 0)for(let n of t)n.slot===e&&!n.superseded&&(n.superseded=!0,r=!0)};i($r?.entries),i(n?.entries);for(let e of Qr)i(e);return r}function oi(e,t,n,r){let i=ni(e,t);if(i===void 0||e.pendingActionBatch?.flushed===!1)return;let a=i.value;for(let e of n)a=r?r(a,e):typeof e==`function`?e(a):e;if(Object.is(a,i.baseValue)){ai(e,t);return}let o=!Object.is(a,i.value);for(let e=i;e;e=e.previous)e.value=a;for(let e of n)i.operations.push(r?t=>r(t,e):typeof e==`function`?e:()=>e);o&&si(i,t)}function si(e,t){let n=$r;if(n!==null&&n.entries.includes(e)){if(n.replayScheduled)return;n.replayScheduled=!0,queueMicrotask(()=>{$r===n&&(n.replayScheduled=!1,vi())});return}let r=t.idState.renderOwner,i=r?.transition;i!==void 0&&i.entries.includes(e)&&!i.replayScheduled&&(i.replayScheduled=!0,queueMicrotask(()=>{r.transition===i&&(i.replayScheduled=!1,Si(r))}))}var ci=null,li=null;function ui(e){let t=[];for(let n=Qr.length-1;n>=0;n--){let r=Qr[n],i=!0;for(let t=0;t<r.length;t++)if(r[t].block!==e){i=!1;break}if(i){for(let e=0;e<r.length;e++)t.push(r[e]);Qr.splice(n,1)}}return t}function di(e,t){if(t!==null)for(let e=0;e<t.length;e++)t[e].taken=!1;let n=e=>{let r=e.block.__warmCache;if(r!==void 0)for(let[e,n]of r)for(let r=0;r<n.length;r++){let i=n[r];if(i.available){let n={slot:e,deps:i.deps,value:i.value,taken:!1};i.nativeWitness!==void 0&&(n.nativeWitness=i.nativeWitness),(t??=[]).push(n)}}O_(e,n)};return n(e),t}function fi(e){let t=e.idState.renderOwner;if(t?.transition!==void 0&&!t.transition.promoted&&!yi(t.transition)&&wi(t),e.pendingMode!==`transition`||Zr!==null)return null;j??=[],Fi??=new Map,Li.push(Ii),Bi.push(Ri),Ii=j.length,Ri=++zi,Vi++;let n=P,r=n?.effects??ao,i={origin:e,capture:n,journalCheckpoint:j.length,effects:[r[0].length,r[1].length,r[2].length],effectEvents:(n?.events??oo).length,effectEventActions:(n?.eventActions??so).length,stores:(n?.stores??uo).length,refAttach:(n?.refs??fo).length,refDetach:n===null?ns.length:n.detaches?.length??0,effectDeps:M===null?c_(e):null,heldSlots:null,memoSwaps:null};return Zr=i,i}function pi(e){if(e===null)return;Zr=null;let t=e.heldSlots;(t===null||t.size===0)&&(ci=null,li=null);let n=null;if(t!==null&&t.size>0&&(n=ui(e.origin)),t!==null&&t.size>0&&n!==null&&n.length>0){$a(e.journalCheckpoint,e.origin);let r=e.capture,i=r?.effects??ao;for(let t=0;t<3;t++)i[t].length=e.effects[t];(r?.events??oo).length=e.effectEvents,(r?.eventActions??so).length=e.effectEventActions;let a=r?.stores??uo;for(let t=e.stores;t<a.length;t++)a[t].queued=!1;a.length=e.stores,(r?.refs??fo).length=e.refAttach,r===null?ns.length=e.refDetach:r.detaches!==void 0&&(r.detaches.length=e.refDetach),e.effectDeps!==null&&l_(e.origin,e.effectDeps);let o=ci!==null||li!==null,s=e.memoSwaps;if(o)ci!==null&&(s=s===null?ci:ci.concat(s),ci=null);else if(s!==null)for(let e=s.length-1;e>=0;e--)gi(s[e],!1);for(let e=0;e<n.length;e++)n[e].slot.value=n[e].baseValue;let c=di(e.origin,li);li=null,$r={origin:e.origin,entries:n,memoSwaps:s,warmHarvest:c,holders:new Set(t)},o||Do(e.origin)}Ii=Li.pop(),Ri=Bi.pop(),--Vi===0&&(j=null,Fi=null,Za())}function mi(e,t,n){let r=Zr;if(r===null)return;let i=dn(e);(r.memoSwaps??=[]).push([0,i,t,i.get(t),n])}function hi(e,t,n){let r=Zr;r!==null&&(r.memoSwaps??=[]).push([1,e,t,e.slice(t,t+n.length),n])}function gi(e,t){if(e[0]===0){let n=t?e[4]:e[3];!t&&n===void 0?e[1].delete(e[2]):e[1].set(e[2],n);return}let n=t?e[4]:e[3];for(let t=0;t<n.length;t++)e[1][e[2]+t]=n[t]}function _i(e){for(let t of e)if(!t.superseded&&t.slot.pendingActionBatch?.flushed===!1)return!0;return!1}function vi(){let e=$r;if(e===null||_i(e.entries))return!1;$r=null;let t=[];for(let n=0;n<e.entries.length;n++){let r=e.entries[n];!r.superseded&&Object.is(r.slot.value,r.baseValue)&&(r.slot.value=r.value,r.block.disposed||t.push(r))}if(t.length===0)return ci=null,li=null,!1;let n=e.memoSwaps;if(n!==null){for(let e=0;e<n.length;e++)gi(n[e],!0);ci=ci===null?n:ci.concat(n)}li=e.warmHarvest,yr++;try{for(let e=0;e<t.length;e++)Do(t[e].block)}finally{yr--}return Qr.push(t),!0}function yi(e){for(let t=0;t<e.entries.length;t++){let n=e.entries[t];if(n.superseded||!Object.is(n.slot.value,n.baseValue))return!1}return!0}function bi(e,t=!1){let n=e.transition;return n!==void 0&&!n.origin.disposed&&(n.promoted?t:yi(n))}function xi(e,t,n){let r=e.transition;if(n===null||!n.origin.mounted||n.origin.disposed||ia(t,n.origin)||n.heldSlots!==null&&n.heldSlots.size!==0)return r!==void 0&&!yi(r)&&wi(e),!1;let i=r?.promoted===!0,a=i?r.origin:n.origin;if(a.idState.renderOwner!==e||!eu(n.origin,a))return!1;let o=ui(a);if(o.length===0)return r!==void 0&&!yi(r)&&wi(e),!1;if(ca(t),e.disposed||a.disposed)return wi(e),!0;let s=n.memoSwaps;if(i)r.memoSwaps!==null&&(s=s===null?r.memoSwaps:r.memoSwaps.concat(s));else if(s!==null)for(let e=s.length-1;e>=0;e--)gi(s[e],!1);for(let e=0;e<o.length;e++)o[e].slot.value=o[e].baseValue;e.transition={origin:a,entries:o,memoSwaps:s,warmHarvest:di(a,i?r.warmHarvest:null),promoted:!1,cue:!i};for(let t of o)t.batch!==void 0&&Jr(e,t.batch);return(r===void 0||r.promoted)&&to(1),!0}function Si(e){let t=e.transition;if(t===void 0)return!1;if(t.origin.disposed||!yi(t))return wi(e),!1;if(_i(t.entries))return!0;if(t.promoted=!0,t.cue=!1,t.memoSwaps!==null)for(let e=0;e<t.memoSwaps.length;e++)gi(t.memoSwaps[e],!0);yr++;try{to(-1),Yr(e);for(let e=0;e<t.entries.length;e++){let n=t.entries[e];n.slot.value=n.value,n.block.disposed||Do(n.block)}Qr.push(t.entries),e.retry()}finally{yr--}return!0}function Ci(e,t){let n=e.transition;if(n!==void 0){if(e.disposed||n.origin.disposed){wi(e);return}if(t.aborted){n.cue&&e.transaction===null&&(n.cue=!1,Do(n.origin));return}(n.promoted||!yi(n))&&wi(e)}}function wi(e){let t=e.transition;t!==void 0&&(e.transition=void 0,e.wakeable=null,e.generation++,t.promoted||to(-1),Yr(e))}var Ti=0,Ei=1,Di=2,Oi=3,ki=4,Ai=5,ji=6,Mi=7,Ni=8,Pi=9,j=null,Fi=null,Ii=0,Li=[],Ri=0,zi=0,Bi=[],Vi=0,Hi=!1,M=null,Ui=[],Wi=!1,Gi=0;function Ki(e,t=!1){let n=e.block.idState.renderOwner;return n===void 0||n.disposed||t&&!n.transaction?.rootRequest?null:n.retryKey??={}}function qi(e){if(e===void 0||M===e.transaction&&M!==null)return null;let t=e.transaction;if(t===null){e.nativeRetry?.clear();let n=ho();n.rootTransaction=!0,t={owner:e,log:[],bags:new Map,capture:n,created:null,createdStamp:++Gi,bagWindow:++zi,retainedCreated:null,retired:null,structures:null,commit:null,parked:null,aborted:!1,rootRequest:!1},e.transaction=t,Ui.push(t)}let n={transaction:t,previous:M,log:j,bags:Fi,checkpoint:Ii,bagWindow:Ri,depth:Vi,parked:za,capture:P};return F?.recordRootTransaction(t),M=t,j=t.log,Fi=t.bags,Ii=0,Ri=t.bagWindow,Vi=1,za=t.parked,P=t.capture,n}function Ji(e){e!==null&&(e.transaction.parked=za,M=e.previous,j=e.log,Fi=e.bags,Ii=e.checkpoint,Ri=e.bagWindow,Vi=e.depth,za=e.parked,P=e.capture)}function Yi(e){j.push(ji,e,null,null)}function N(e,t,n){M===null||Wi||j.push(Oi,e,t,n)}function Xi(e,t,n,r){let i=M;if(i===null||i.aborted||Wi)return;let a=i.structures??=new Map;(a.get(e)??-1)>=Ii||(a.set(e,j.length),Ma(e),Yi(()=>{a.delete(e)}),Du?.revision===void 0&&Zi(t,n,r))}function Zi(e,t,n){let r=M?.owner.bindingLeases,i=[];for(let r=t===null?B(e):V(t);r!==null&&r!==n;r=V(r))i.push(r);Yi(()=>{let a=i;for(let t of r??[]){if(t.end===void 0||!t.active())continue;let n=e;for(;n!==null&&n.parentNode!==t.root.parentNode;)n=n.parentNode;for(let e=t.root;e!==null;e=e.nextSibling){if(e===n)return;if(e===t.end)break}let r=a.indexOf(t.root),i=a.indexOf(t.end);if(r<0||i<r||t.root.parentNode!==e)continue;let o=[];for(let e=t.root;e!==null&&(o.push(e),e!==t.end);e=e.nextSibling);a=[...a.slice(0,r),...o,...a.slice(i+1)]}if(t!==null&&(R?.view(t)??t).parentNode!==e||n!==null&&(R?.view(n)??n).parentNode!==e)return;let o=t!==null&&(R?.view(t)??t).parentNode===e?V(t):B(e),s=n!==null&&(R?.view(n)??n).parentNode===e?n:null,c=new Set(a);for(;o!==null&&o!==s;){let t=V(o);c.has(o)||(R?.view(e)??e).removeChild(o),o=t}$i(e,a,s)})}function Qi(e){let t=M;if(t===null||Wi)return;let n=t.structures??=new Map;(n.get(e)??-1)>=Ii||(n.set(e,j.length),Yi(()=>{n.delete(e)}),Zi(e,null,null))}function $i(e,t,n){for(let r=t.length-1;r>=0;r--){let i=t[r];((R?.view(i)??i).parentNode!==e||V(i)!==n)&&(Uo===null?(R?.view(e)??e).insertBefore(i,n):(Yo(e,Uo),ev(e,i,n,Uo))),n=i}}function ea(e){let t=M;if(t===null||t.aborted||Wi||e.idState.renderOwner!==t.owner)return;let n=t.retired??=new Set;n.has(e)||(n.add(e),j.push(Mi,n,e,null)),e.pending&&=(N(e,`pending`,e.pending),!1)}function ta(e,t,n,r,i){ea(e),na(t,n,r,()=>{e.disposed||L(e,!1)},i)}function na(e,t,n,r,i){let a=[];if(t!==null&&n!==null)for(let e=t;e!==null&&(a.push(e),e!==n);e=V(e));let o=!1;Yi(()=>{o=!0}),(M.commit??=[]).push(()=>{if(!o){r?.();for(let t of a)(R?.view(t)??t).parentNode===e&&(R?.view(e)??e).removeChild(t);i?.()}})}function ra(e,t){let n=M;if(n===null||n.aborted||Wi||e.idState.renderOwner!==n.owner||!e.mounted||ia(n,e))return!1;ea(e);let r=e.startMarker,i=e.endMarker,a=[],o=null,s=null;if(r!==null&&i!==null&&(R?.view(r)??r).parentNode!==null){o=(R?.view(r)??r).parentNode;let n=e.exclusiveMarkers||!t&&r!==i;s=n?i:V(i);for(let e=n?V(r):r;e!==null&&e!==s;e=V(e))a.push(e)}else if(e.kind===`root`){o=e.parentNode;for(let e=B(o);e!==null;e=V(e))a.push(e)}let c=!1;Yi(()=>{if(c=!0,o!==null){let e=(R?.view(s)??s)?.parentNode===o?s:null;$i(o,a,e)}});let l=as;if((n.commit??=[]).push(()=>{if(c||e.disposed)return;if(o!==null){let e=(R?.view(s)??s)?.parentNode===o?s:null;for(let t of a)(R?.view(t)??t).parentNode!==o&&(R?.view(o)??o).insertBefore(t,e)}let t=as;as=l;try{L(e,!1)}finally{as=t}if(o!==null)for(let e of a)(R?.view(e)??e).parentNode===o&&(R?.view(o)??o).removeChild(e)}),t&&o!==null)for(let e of a)(R?.view(o)??o).removeChild(e);return!0}function ia(e,t){return t.createdStamp===e.createdStamp}function aa(e,t){let n=ns.length;L(e,(!t.hydrating||e.kind===`portal`)&&!t.retainedCreated?.has(e)),ns.length=n}function oa(e){let t=M;t===null||Wi||ia(t,e)||(e.createdStamp=t.createdStamp,Du?.revision!==void 0&&sa(e),(t.created??=[]).push(e),j.push(ki,e,t,null))}function sa(e){M!==null&&(M.retainedCreated??=new Set).add(e)}function ca(e){if(e.aborted)return;e.aborted=!0,e.owner.retrySignalOwners!==void 0&&e.owner.retrySignalOwners!==_n&&Tn(e.owner);let t=qi(e.owner),n=Wi;Wi=!0;try{let t=e.owner.current;if(t!==null)$a(0,t);else{for(let t=e.log.length-4;t>=0;t-=4)if(e.log[t]===ji)e.log[t+1]();else if(e.log[t]===ki)aa(e.log[t+1],e.log[t+2]);else if(e.log[t]===Mi)e.log[t+1].delete(e.log[t+2]);else if(e.log[t]===Pi){let n=e.log[t+1],r=e.log[t+2],i=e.log[t+3];i===void 0?n.delete(r):n.set(r,i)}e.log.length=0}Ah(e.capture),e.commit=null;let n=ns.length;Za(),ns.length=n}finally{Wi=n,Ji(t)}}function la(e){for(let t of e.bindingLeases){let n=t.host!==void 0&&!t.active()?Ou.get(t):void 0;if(!(n===void 0?e.bindingContainer.contains(t.anchor):!n.scope.block.disposed)){e.bindingLeases.delete(t),Ou.delete(t),Ee(t);try{t.retire()}catch(t){cv(e.current,t)||console.error(t)}}}}function ua(){let e=Ui;if(e.length!==0){Ui=[];for(let t of e){let e=t.owner,n=F?.enterRootCommit(e);try{if(t.aborted||e.disposed){e.transaction===t&&(e.transaction=null),e.transition!==void 0&&xr.commitRoot(e,t);continue}if(!t.nativeAdmitted&&(!Mu(t.capture)||D!==null&&!D.validateCapture(t.capture))){let n=!Mu(t.capture);ca(t),e.transaction===t&&(e.transaction=null),e.disposed||(e.wakeable=null,e.generation++,n?Nu(t.capture):e.retry());continue}e.transaction===t&&(e.transaction=null),t.capture.presentations!==void 0&&gs!==null&&(_s(gs,e),gs.owners.get(e).presentation=t),t.rootRequest&&(e.transition===void 0||!xr.keepsRoot(e))&&(e.wakeable=null,e.generation++),e.wakeable===null&&(e.retryKey=null,e.nativeRetry?.clear(),e.retrySignalOwners!==void 0&&Tn(e));let n=Vn(t.capture,e,!0),r=e.generation,i=t.commit;if(i!==null)for(let t of i){if(e.disposed||e.generation!==r)break;t()}let a=t.parked;if(a!==null)for(let t of a){if(e.disposed||e.generation!==r)break;Qa(t)}if(D!==null&&F?.stageAction(()=>D.pruneDeferredRefs(e))!==!0&&D.pruneDeferredRefs(e),e.disposed||e.generation!==r){Ah(t.capture);continue}Oh(t.capture,n),e.bindingLeases!==void 0&&e.bindingLeases.size>0&&F?.stageAction(()=>la(e))!==!0&&la(e),e.transition!==void 0&&xr.commitRoot(e,t)}finally{n?.()}}}}function da(e,t,n){let r=e.idState.renderOwner;if(r===void 0||r.disposed)return!1;let i=r.transaction;if(i===null)return!1;if(xr===null||!xr.holdRoot(r,i,n)){if(Gl&&i.created!==null)for(let e of i.created)(e.parentBlock===null||!ia(i,e.parentBlock))&&$l(e);let e=_n,t=r.current;if(t!==null&&i.created!==null&&r.signalOwner!==void 0){for(let e of i.created)e.disposed||wn(e,t,r);_n=r.retrySignalOwners}try{ca(i)}finally{_n=e}}r.wakeable=t;let a=++r.generation,o=!1,s=()=>{o||(o=!0,queueMicrotask(()=>{r.disposed||r.generation!==a||r.wakeable!==t||(r.wakeable=null,(r.transition===void 0||!xr.retryRoot(r))&&r.retry())}))};return t.then(s,s),!0}var fa=Symbol();function pa(e){return{...e}}function ma(e){return{...e}}function ha(e){return{...e}}function ga(e){return{...e}}function _a(e){return{...e}}function va(e){return{...e}}function ya(e){return{...e}}function ba(e){return{...e}}function xa(e){return{...e}}function Sa(e){return{...e}}function Ca(e){return{...e}}function wa(e){return{...e}}function Ta(e){return{...e}}function Ea(e){return{...e}}function Da(e){return{...e}}function Oa(e){return{...e}}function ka(e){return{...e}}function Aa(e,t){switch(t){case 0:return pa(e);case 1:return ma(e);case 2:return ha(e);case 3:return ga(e);case 4:return _a(e);case 5:return va(e);case 6:return ya(e);case 7:return ba(e);case 8:return xa(e);case 9:return Sa(e);case 10:return Ca(e);case 11:return wa(e);case 12:return Ta(e);case 13:return Ea(e);case 14:return Da(e);case 15:return Oa(e);case 16:return ka(e);default:return{...e}}}function ja(){let e=O;if(e===null)return;let t=M;if(t!==null&&!t.hydrating&&t.retainedCreated===null&&Vi===1&&e.block.createdStamp===t.createdStamp)return;let n=e.slots[0];if(typeof n!=`object`||!n)return;let r=n[fa];if(r!==void 0){let e=Ri;if(n.__journalWindow===e)return;let t=Aa(n,r);j.push(Di,n,t,null),n.__journalWindow=e;return}n.__kind===void 0&&Ma(n)}function Ma(e){let t=Fi;(t.get(e)??-1)>=Ii||(t.set(e,j.length),j.push(Di,e,{...e},Array.isArray(e)?e.length:null))}function Na(e){if(M!==null&&e.ownerDocument.activeElement===e){let t=(R?.view(e)??e).selectionStart,n=(R?.view(e)??e).selectionEnd,r=(R?.view(e)??e).selectionDirection;t!==null&&n!==null&&Yi(()=>(R?.view(e)??e).setSelectionRange(t,n,r??void 0))}}function Pa(e,t,n){t===`value`&&Na(e);let r=j;r.push(Oi,e,t,(R?.view(e)??e)[t]),r.push(Oi,e,n,(R?.view(e)??e)[n]);let i=vm(e);i!==void 0&&Ma(i);let a=e;t===`checked`&&(R?.view(a)??a).type===`radio`&&(R?.view(a)??a).name!==``&&La(a),ja()}function Fa(e){Na(e),e.localName===`textarea`?(M===null?j.push(Oi,e,`defaultValue`,(R?.view(e)??e).defaultValue):Qi(e),ja()):Xa(e,`value`)}function Ia(e){let t=(R?.view(e)??e).form;if(t!==null)return(R?.view(t)??t).elements;let n=(R?.view(e)??e).getRootNode();return n.nodeType===9?(R?.view(n)??n).getElementsByName((R?.view(e)??e).name):(R?.view(n)??n).querySelectorAll(`input[type=\"radio\"]`)}function La(e){let t=(R?.view(e)??e).name,n=Ia(e);for(let r=0;r<n.length;r++){let i=n[r];i!==e&&(R?.view(i)??i).checked&&i.localName===`input`&&(R?.view(i)??i).type===`radio`&&(R?.view(i)??i).name===t&&(R?.view(i)??i).form===(R?.view(e)??e).form&&j.push(Oi,i,`checked`,!0)}}function Ra(e,t){j.push(Oi,e,`selected`,(R?.view(e)??e).selected),t&&j.push(Oi,e,`defaultSelected`,(R?.view(e)??e).defaultSelected)}var za=null;function Ba(e,t){let n=za;if(n!==null)for(let r of n){let n=r.block;if(n.forSlot===e||n.exclusiveMarkers&&n.startMarker===e.start&&n.endMarker===e.end)for(let e of r.nodes)(t??=new Set).add(e)}let r=M.retired;if(r!==null)for(let n of r){if(n.forSlot!==e)continue;let r=n.startMarker;r!==null&&r===n.endMarker&&(t??=new Set).add(r)}return t}function Va(e,t){let n=M!==null&&!Wi;n&&ea(e);let r=t!==void 0&&n?Ba(t,null):null,i=[],a=e.startMarker,o=e.endMarker;if(a&&o){let t=(R?.view(a)??a).parentNode;if(t!==null){let s=e.exclusiveMarkers,c=s?V(a):a,l=s?o:V(o);if(r===null)for(;c!==null&&c!==l;){let e=V(c);n||(R?.view(t)??t).removeChild(c),i.push(c),c=e}else for(;c!==null&&c!==l;){let e=V(c);r.has(c)||(n||(R?.view(t)??t).removeChild(c),i.push(c)),c=e}}}(za??=[]).push({block:e,nodes:i})}function Ha(){return j!==null}function Ua(e){return j!==null&&Fi.has(e)}function Wa(e){let t=Fi;if((t.get(e)??-1)>=Ii)return;if(t.set(e,j.length),M!==null&&(M.hydrating===!0&&H()!==null||e.adopt!==null)){Yi(()=>{t.delete(e)}),Zi(z(e.start).parentNode,e.start,e.end);return}let n=[];for(let t=e.head;t!==null;t=t.nextSibling)n.push(t);let r=null,i=0;for(let t of e.items.values())r===null&&n[i]!==t&&(r=n.slice(0,i)),r?.push(t),i++;r===null&&i!==n.length&&(r=n.slice(0,i));let a={empty:e.emptyBlock,mapOrder:r};Yi(()=>{Ka(e,a,n),Fi.delete(e)})}function Ga(e){let t=Fi,n=e.items;t.set(e,j.length);let r={head:e.head,tail:e.tail,size:e.size,empty:e.emptyBlock,entries:n};Yi(()=>{Ka(e,r,null),t.delete(e)}),e.items=new Map}function Ka(e,t,n){let r=n===null?t.entries:null,i=n===null?null:new Set(n);for(let t=e.head;t!==null;t=t.nextSibling)(r!==null||!i.has(t))&&L(t,!1);if(z(e.end).parentNode===null)return;if(e.head=n===null?t.head:n[0]??null,e.tail=n===null?t.tail:n[n.length-1]??null,e.size=n===null?t.size:n.length,r!==null)e.items=r;else{let r=n;e.items.clear();for(let e=0;e<r.length;e++){let t=r[e];t.nextSibling=r[e+1]??null,t.prevSibling=r[e-1]??null}let i=t.mapOrder??r;for(let t=0;t<i.length;t++){let n=i[t];e.items.set(n.key,n)}}let a=[];for(let t=e.head;t!==null;t=t.nextSibling){let e=qa(t);if(e!==null)for(let t of e)a.push(t);else if(t.startMarker!==null&&t.startMarker===t.endMarker)a.push(t.startMarker);else for(let e of Ja(t))a.push(e)}if(e.emptyBlock!==t.empty&&(e.emptyBlock!==null&&L(e.emptyBlock,!1),e.emptyBlock=t.empty),z(e.end).parentNode===null)return;if(t.empty!==null){let e=qa(t.empty)??Ja(t.empty);for(let t of e)a.push(t)}let o=z(e.end).parentNode,s=new Set(a);M!==null&&Ba(e,s);let c=V(e.start);for(;c!==null&&c!==e.end;){let e=V(c);s.has(c)||(R?.view(o)??o).removeChild(c),c=e}let l=e.end;for(let e=a.length-1;e>=0;e--){let t=a[e];((R?.view(t)??t).parentNode!==o||V(t)!==l)&&(Uo===null?(R?.view(o)??o).insertBefore(t,l):ev(o,t,l,Uo)),l=t}}function qa(e){let t=za;if(t===null)return null;for(let n=0;n<t.length;n++)if(t[n].block===e){let e=t[n].nodes;return t.splice(n,1),e}return null}function Ja(e){let t=[],n=e.startMarker,r=e.endMarker;if(!n||!r||(R?.view(n)??n).parentNode===null)return t;let i=e.exclusiveMarkers,a=i?V(n):n,o=i?r:V(r);for(;a!==null&&a!==o;)t.push(a),a=V(a);return t}function Ya(e,t){j.push(Ti,e,t,null),ja()}function Xa(e,t){j.push(Ei,e,t,(R?.view(e)??e).getAttribute(t)),ja()}function Za(){let e=za;if(e!==null){za=null;for(let t=0;t<e.length;t++)Qa(e[t])}}function Qa(e){try{L(e.block,!1)}finally{for(let t of e.nodes)(R?.view(t)??t).parentNode!==null&&z((R?.view(t)??t).parentNode).removeChild(t)}}function $a(e,t){if(e<0)return;let n=j;if(n===null)return;let r=Hi;Hi=!0;try{for(let r=n.length-4;r>=e;r-=4){let e=n[r+1],i=n[r+2],a=n[r+3];switch(n[r]){case Ti:(R?.view(e)??e).nodeValue=i;break;case Ei:a===null?(R?.view(e)??e).removeAttribute(i):(R?.view(e)??e).setAttribute(i,a);break;case Oi:(R!==null&&e?.nodeType!==void 0?R?.view(e)??e:e)[i]=a;break;case Ni:e.extra=a,e.props=i;break;case ki:aa(e,i);break;case Mi:e.delete(i);break;case Ai:!e.disposed&&(e===t||Ts(t,e))&&rc(e,t);break;case ji:e();break;case Pi:a===void 0?e.delete(i):e.set(i,a);break;default:for(let t of Reflect.ownKeys(e))!Object.prototype.hasOwnProperty.call(i,t)&&Object.prototype.propertyIsEnumerable.call(e,t)&&delete e[t];for(let t of Reflect.ownKeys(i))(typeof t!=`symbol`||!Reflect.set(e,t,i[t])&&!Object.is(e[t],i[t]))&&(e[t]=i[t]);a!==null&&(e.length=a),Fi.delete(e)}}n.length=e}finally{Hi=r}}var eo=null;function to(e){Hr+=e,Hr<0&&(Hr=0),Xr++;try{for(let e of Ur)try{e()}catch(e){console.error(e)}}finally{Xr--}}var no=0,ro=1,io=2,ao=[[],[],[]],oo=[],so=[],co=!1,lo=0,uo=[],fo=[];function po(e){e._reapply(),bd(e._currentRef,e)}var P=null,mo=null;function ho(){return{rootTransaction:!1,renderRoot:null,renderedBlocks:null,effects:[[],[],[]],events:[],eventActions:[],refs:[],detaches:void 0,stores:[],suspenseCommits:void 0,renderCleanups:void 0}}var go=oo,_o=so,vo=new Set;function yo(){if(vo.size!==0)for(let e of vo)e._reapply()}var bo=0,xo=null,So=50,Co=0;function wo(){return or>0||ur>0||dr>0}var To=class extends Error{};function Eo(){return new To(E(1))}function Do(e){if(e.disposed)return;let t=k===e;k!==null&&!t&&Xr===0&&fr===0&&(e.crossRenderUpdate=!0);let n=yr>0||t&&e.currentRenderMode===`transition`||!_r&&dp===0&&br>0?`transition`:`urgent`,r=Vr||t&&e.currentRenderDeferred;if(F?.schedulePending(e),e.pending){n===`urgent`&&(e.pendingMode=`urgent`,e.pendingDeferred=!1);return}sr===io&&!_r||(wo()?(e.nestedUpdateChain!==Co&&(e.nestedUpdateChain=Co,e.nestedUpdateCount=0),++e.nestedUpdateCount>So&&(e.nestedUpdateError=!0)):k===null&&(Co++,e.nestedUpdateChain=Co,e.nestedUpdateCount=0,e.nestedUpdateError=!1)),e.pending=!0,e.pendingMode=n,e.pendingDeferred=r,A.push(e),!_r&&(gr||(gr=!0,queueMicrotask(Io)))}var Oo=0,ko=25;function Ao(e,t){for(let n=e;n!==null;n=n.parentBlock)if(n===t)return!0;return!1}function jo(e){let t=null,n=0,r=0,i=hr;try{for(;n<A.length;){let a=A[n++];if(!Ao(a,e)){A[r++]=a;continue}if(!(!a.pending&&!a.nestedUpdateError||a.disposed)){try{if(a.nestedUpdateError)throw a.nestedUpdateError=!1,Eo();let e=(t??=new Map).get(a)??0,n=a.crossRenderUpdate;if(e>=(n?So:ko))throw n?Eo():Error(E(9));t.set(a,e+1),a.crossRenderUpdate=!1,I(a)}catch(e){v_(a,e)}i!==hr&&(i=hr,n=0,r=0)}}}finally{if(i===hr){for(;n<A.length;)A[r++]=A[n++];A.length=r,hr++}}}function Mo(e,t){let n=-t;for(let t=0;t<e.length;t++){let r=e[t];if(r.drainStamp===n)continue;let i=r,a=0;for(;i!==null&&i.drainStamp!==n;)a++,i=i.parentBlock;for(a+=i===null?-1:i.drainRenders,i=r;i!==null&&i.drainStamp!==n;)i.drainStamp!==void 0&&(i.drainStamp=n,i.drainRenders=a),a--,i=i.parentBlock}return e.sort(No),e}function No(e,t){return e.drainRenders-t.drainRenders}var Po=null;function Fo(){let e=null,t=null,n=++Oo;A.length>1&&Mo(A,n);for(let r=0;r<A.length;r++){let i=A[r];if(!i.pending&&!i.nestedUpdateError)continue;if(i.pending=!1,i.disposed){i.nestedUpdateError=!1;continue}let a=i.idState.renderOwner?.transaction;if(a?.aborted===!0)continue;let o=a?.retired;if(o!=null&&o.size!==0){let e=i;for(;e!==null&&!o.has(e);)e=e.parentBlock;if(e!==null)continue}let s=i.crossRenderUpdate;i.crossRenderUpdate=!1;let c=Po,l=c===null?null:c.find(i,!0,i.pendingMode??`urgent`),u=null,d=null,f=null;l!==null&&(l.__kind===`trySlotSlot`?l.hiddenDom===null?f=l:d=l:u=l);let p=qi(i.idState.renderOwner),m=null;try{if(i.kind===`root`&&!i.mounted&&oa(i),i.nestedUpdateError)throw i.nestedUpdateError=!1,Eo();if(i.drainStamp===n){if(++i.drainRenders>(s?So:ko))throw s?Eo():Error(E(9))}else i.drainStamp=n,i.drainRenders=1;if(d!==null){c.reveal(d,i.pendingMode??`urgent`);continue}if(u!==null&&u.pendingThenable!==null){c.retryActivity(u,!0);continue}let e=xr;m=e===null?null:e.begin(i);try{if(u!==null)c.retryActivity(u,!1,i);else if(f!==null)c.visible(f,i);else{let e=i.idState.renderOwner;if(e!==void 0&&e.current===i&&e.request!==null){let t=e.request;e.request=null;let n=i.pendingMode??`urgent`;i.pendingMode=null,t(n)}else I(i)}}finally{e!==null&&e.end(m)}}catch(t){try{v_(i,t,m)}catch(t){let n=i.idState.renderOwner?.transaction;n!=null&&ca(n);let r=t instanceof ku&&Object.prototype.hasOwnProperty.call(t,`failure`)?t.failure:t;cv(i,r)||(e===null?e={err:r,all:[r]}:(e.all.push(r),e.err=typeof AggregateError==`function`?AggregateError(e.all,E(13)):e.all[0]));let a=i;for(;a.parentBlock!==null;)a=a.parentBlock;a.kind===`root`&&!a.disposed&&(t instanceof ku&&a.idState.renderOwner!==void 0?(a.idState.renderOwner.preservePresentation=!0,ar.get(a)?.()):L(a))}}finally{Ji(p),u!==null&&(t??=new Set).add(u)}}if(A.length=0,hr++,t!==null)for(let e of t)Po.rehide(e);return ua(),Cr?.flush(),e}function Io(){if(gr=!1,vr){(A.length>0||Ui.length>0)&&!gr&&(gr=!0,queueMicrotask(Io));return}if(Cs()||ns.length!==0||fo.length!==0||vo.size!==0||Qr.length!==0||eo!==null)try{if(eo?.routeFlush()===!0)return;Zo()}catch(e){if(bo===0)throw e;(xo??=[]).push(e)}}function Lo(e){try{let t=e.activeElement;if(t===e.body&&(t=t?.shadowRoot?.activeElement??null,t===null))return null;for(;t!==null;){if(t.localName===`iframe`){let e;try{e=t.contentDocument}catch{break}if(e===null)break;let n=e.activeElement;if(n===null)break;t=n;continue}let e=t.shadowRoot?.activeElement;if(e==null)break;t=e}return t}catch{return null}}function Ro(e){if(e.localName===`textarea`)return!0;if(e.localName!==`input`)return!1;switch((R?.view(e)??e).type){case`text`:case`search`:case`tel`:case`url`:case`password`:return!0}return!1}function zo(e,t,n,r,i){let a=e,o=null,s=0,c=-1,l=-1,u=0,d=0;selection:for(;;){for(;;){if(a===t&&(n===0||a.nodeType===3)&&(c=s+n),a===r&&(i===0||a.nodeType===3)&&(l=s+i),c!==-1&&l!==-1)break selection;a.nodeType===3&&(s+=(R?.view(a)??a).nodeValue.length);let e=B(a);if(e===null)break;o=a,a=e}for(;;){if(a===e||(o===t&&++u===n&&(c=s),o===r&&++d===i&&(l=s),c!==-1&&l!==-1))break selection;let f=V(a);if(f!==null){a=f;break}a=o,o=(R?.view(a)??a).parentNode}}return c===-1||l===-1?null:{focused:e,start:c,end:l,contentEditable:!0}}function Bo(e){let t=Lo(e);if(t===null||t===t.ownerDocument.body)return null;if(Ro(t)){let e=t;return{focused:t,start:(R?.view(e)??e).selectionStart??0,end:(R?.view(e)??e).selectionEnd??0,contentEditable:!1}}if(t.contentEditable===`true`||(R?.view(t)??t).getAttribute(`contenteditable`)===`true`){let e=t.ownerDocument.getSelection();if(e!==null&&e.anchorNode!==null&&e.focusNode!==null&&(R?.view(t)??t).contains(e.anchorNode)&&(R?.view(t)??t).contains(e.focusNode)){let n=e.anchorNode,r=e.focusNode;if(n===r&&n.nodeType===3){if(n===B(t))return{focused:t,start:e.anchorOffset,end:e.focusOffset,contentEditable:!0};if((R?.view(n)??n).nodeValue.length<256){let r=t.ownerDocument.createRange();r.selectNodeContents(t),r.setEnd(n,e.anchorOffset);let i=r.toString().length;return{focused:t,start:i,end:i+e.focusOffset-e.anchorOffset,contentEditable:!0}}}let i=zo(t,n,e.anchorOffset,r,e.focusOffset);if(i!==null)return i}}return{focused:t,start:-1,end:-1,contentEditable:!1}}function Vo(e,t){let n=e.ownerDocument.createTreeWalker(e,4),r=n.nextNode(),i=null;for(;r!==null;){let e=(R?.view(r)??r).textContent?.length??0;if(t<=e)return[r,t];t-=e,i=r,r=n.nextNode()}return i===null?[e,0]:[i,(R?.view(i)??i).textContent?.length??0]}function Ho(e){if(e===null)return;let{focused:t}=e,n=t.ownerDocument;if(Lo(n)===t||!(R?.view(t)??t).isConnected)return;if(e.start!==-1){if(e.contentEditable){let r=n.getSelection();if(r!==null){let[i,a]=Vo(t,e.start),[o,s]=Vo(t,e.end),c=n.createRange();c.setStart(i,a),c.collapse(!0),r.removeAllRanges(),r.addRange(c),r.extend(o,s)}}else{let n=t;(R?.view(n)??n).setSelectionRange(e.start,Math.min(e.end,(R?.view(n)??n).value.length))}}let r=[],i=(R?.view(t)??t).parentElement;for(;i!==null;)r.push({element:i,left:(R?.view(i)??i).scrollLeft,top:(R?.view(i)??i).scrollTop}),i=(R?.view(i)??i).parentElement;(R?.view(t)??t).focus();for(let e=0;e<r.length;e++){let t=r[e];z(t.element).scrollLeft=t.left,z(t.element).scrollTop=t.top}}var Uo=null,Wo=null;function Go(){if(A.length===0)return null;let e=A[0].parentNode.ownerDocument;if(e===null)return null;let t=Bo(e),n=null;for(let r=1;r<A.length;r++){let i=A[r].parentNode.ownerDocument;if(i===null||i===e||n?.includes(i))continue;(n??=[e]).push(i);let a=Bo(i);a!==null&&(t===null?t=a:Array.isArray(t)?t.push(a):t=[t,a])}return t}function Ko(e){if(Array.isArray(e))for(let t=0;t<e.length;t++)Ho(e[t]);else Ho(e)}function qo(e){if(e===null&&Uo===null)return Fo();let t=Uo,n=Wo;Uo=e,Wo=null;try{return Fo()}finally{try{Jo()}finally{Wo=n,Uo=t}}}function Jo(){if(Wo!==null)for(let e=0;e<Wo.length;e++){let t=Wo[e],n=t.snapshot;if(n.contentEditable){let e=n.focused.ownerDocument,t=e.getSelection();if(t!==null&&Lo(e)===n.focused){let[r,i]=Vo(n.focused,n.start),[a,o]=Vo(n.focused,n.end);if(t.anchorNode!==r||t.anchorOffset!==i||t.focusNode!==a||t.focusOffset!==o){let n=e.createRange();n.setStart(r,i),n.collapse(!0),t.removeAllRanges(),t.addRange(n),t.extend(a,o)}}}for(let e=0;e<t.ancestors.length;e++){let n=t.ancestors[e];z(n.element).scrollLeft=n.left,z(n.element).scrollTop=n.top}}}function Yo(e,t){let n=null;if(Array.isArray(t)){for(let r=0;r<t.length;r++)if(t[r].focused.ownerDocument===e.ownerDocument){n=t[r];break}}else t.focused.ownerDocument===e.ownerDocument&&(n=t);if(n===null||!(R?.view(e)??e).contains(n.focused))return;if(Wo!==null){for(let e=0;e<Wo.length;e++)if(Wo[e].snapshot===n)return}let r=[];for(let e=z(n.focused).parentElement;e!==null;e=(R?.view(e)??e).parentElement)r.push({element:e,left:(R?.view(e)??e).scrollLeft,top:(R?.view(e)??e).scrollTop});(Wo??=[]).push({snapshot:n,ancestors:r})}function Xo(e){for(let t=0;(A.length>0||Ui.length>0)&&t<es;t++){Qo();let t=A.length===0?null:Go(),n=qo(t);t!==null&&Ko(t),n!==null&&e===null&&(e=n),ys()}return e}function Zo(){vr=!0;let e=Qr.length>0,t=eo,n=t?.shouldClearTypesAfterFlush()===!0;try{A.length>0&&Qo();let e=A.length===0?null:Go(),t=qo(e);if(e!==null&&Ko(e),ys(),F?.capturing()!==!0&&(A.length>0||Ui.length>0)&&(t=Xo(t)),t!==null)throw t.err}finally{vr=!1,(e||Qr.length>0)&&(Qr.length=0),n&&t.clearTypes()}}function Qo(){if(ao[io].length>0||Rs.length>0){if(F?.holdPassivesBeforeRender()===!0)return;Ss()}}function $o(e){if(vr)return we(e);eo?.interrupt();let t=_r;_r=!0;try{let t=we(e);vr=!0;let n=null;try{A.length>0&&Qo();let e=A.length===0?null:Go();n=qo(e),e!==null&&Ko(e),ys(),(A.length>0||Ui.length>0)&&(n=Xo(n))}finally{vr=!1}if((A.length>0||Ui.length>0)&&!gr&&(gr=!0,queueMicrotask(Io)),n!==null)throw n.err;return t}finally{_r=t}}var es=50;function ts(e,t,n){vd?.(e.block,n);let r={ref:t,el:n,block:e.block};if((P===null?fo:P.refs).push(r),P===null&&D!==null){let t=e.block.idState.renderOwner;t!==void 0&&D.stampQueuedPublication(t,r)}}var ns=[];function rs(e,t){if(e==null||ss(t))return;if(t!==null&&D?.unpublishedRef(t,e)){D.forgetUnpublishedRef(t);return}let n=t===null?void 0:_d?.get(t);if(n?.hidden&&n.connected!==e)return;let r=M?.aborted&&!Wi?null:P;(r===null?ns:r.detaches??=[]).push(e,t,hc,gc)}function is(e,t){e!=null&&Object.prototype.propertyIsEnumerable.call(Object(e),`ref`)&&e.ref!=null&&rs(e.ref,t)}var as=null;function ss(e){if(e===null)return!1;for(let t=as;t!==null;t=t.parent)if(t.elements.has(e))return!0;return!1}function cs(e,t){if(e===null||e.length===0)return t();let n=new Set;for(let t=0;t<e.length;t++){let r=e[t].el;r!==null&&n.add(r)}if(n.size===0)return t();let r=as;as={elements:n,parent:r};try{return t()}finally{as=r}}function ls(){if(ns.length===0)return;let e=ns.splice(0);for(let t=0;t<e.length;t+=4)try{ur++;try{bd(e[t],null,e[t+1])}finally{ur--}}catch(n){if(n instanceof To)throw n;let r=e[t+2],i=e[t+3];r===null?cv(i,n)||console.error(n):ov(i,n,r(n))}}function us(){if(fo.length===0)return;let e=fo.splice(0);if(e.length>1){let t=e[0].block?.parentBlock??null;for(let n=1;n<e.length;n++)if((e[n].block?.parentBlock??null)!==t){e.sort(Os);break}}for(let t of e){if(ms(t.block))continue;if(D!==null&&!D.publicationCurrent(t)){D.deferRef(t,t.el,t.ref===po?t.el._currentRef:t.ref);continue}let e=_d?.get(t.el);if(e!==void 0&&s_(t.block)!==null){e.hidden=!0;continue}try{D?.forgetUnpublishedRef(t.el),ur++;try{bd(t.ref,t.el)}finally{ur--}}catch(e){if(e instanceof To)throw e;let n=__(t.block);n?ov(t.block,e,n(e)):cv(t.block,e)||console.error(e)}}}var ds=null,fs=!1;function ps(e=null){let t=ds,n=fs;ds=e,fs=!0;try{ls(),us()}finally{let e=ds;if(ds=t,fs=n,e!==null){ur++;try{for(let[t,n]of e)n.block.disposed||Object.is(t.value,n.previous)||Do(n.block)}finally{ur--}}}}function ms(e){let t=e;for(;t!==null;){if(t.disposed)return!0;t=t.parentBlock}return!1}function hs(e,t,n){return e!==null&&e.get(t)===n}var F=null,gs=null;function _s(e,t){if(t===void 0)return;let n=e.owners.get(t);if(n===void 0){let r={generation:t.generation,current:t.current,guard:()=>!t.disposed&&t.generation===r.generation};n=r,e.owners.set(t,n)}return n.guard}function vs(){return j!==null&&!Wi&&!Hi}function ys(){if(F?.stageEffects()===!0)return;if(oo.length===0&&so.length===0&&ao[no].length===0&&ao[ro].length===0&&ns.length===0&&fo.length===0&&uo.length===0&&mn===null&&vo.size===0&&!pm()){if(F?.defer(null,null)===!0)return;(ao[io].length>0||Rs.length>0)&&F?.beforeCommit(),(ao[io].length>0||Rs.length>0)&&!co&&bs();return}F?.beforeCommit();let e=D?.pauseLifecycle()??-1;cr++;try{ws();let e=Ls();Pm();let t=Ps();if(F?.defer(t,e)===!0)return;ps(),yo(),t!==null&&Fs(t),e!==null&&sv(e),Hn(),Vs(),(ao[io].length>0||Rs.length>0)&&!co&&bs()}finally{e>=0&&D.resumeLifecycle(e),ks()}}function bs(){co=!0,Ys(xs)}function xs(){co=!1,Is()}function Ss(){co=!1,Gs(),Is()}function Cs(){return A.length>0||Ui.length>0||Cr?.hasWork()===!0||oo.length>0||so.length>0||ao[no].length>0||ao[ro].length>0||ao[io].length>0||Rs.length>0||uo.length>0||mn!==null||pm()}function ws(){if(oo.length===0)return;let e=oo.splice(0);for(let t=0;t<e.length;t++){let n=e[t],r=n.block;if(!n.cell.active||D?.publicationCurrent(n)===!1||ms(r))continue;let i=a_(r,!0);if(r.renderStatus===qn||i!==null){if(i!==null&&i.__kind===`trySlotSlot`){qc(i,()=>{n.cell.active&&!ms(r)&&r.effectEventRenderVersion===n.renderVersion&&r.effectEventCompletedVersion===n.renderVersion&&(n.cell.impl=n.nextImpl)});continue}r.effectEventRenderVersion===n.renderVersion&&r.effectEventCompletedVersion===n.renderVersion&&(n.cell.impl=n.nextImpl)}}}function Ts(e,t){for(let n=t.parentBlock;n!==null;n=n.parentBlock)if(n===e)return!0;return!1}function Es(e,t,n,r){if(e!==n&&e!==null&&n!==null){let i=e.parentBlock,a=n.parentBlock;if(i===n)return-1;if(a===e)return 1;if(i===a)return t-r;for(let t=a;t!==null;t=t.parentBlock)if(t===e)return 1;for(let e=i;e!==null;e=e.parentBlock)if(e===n)return-1}return t-r}function Ds(e,t){return e.scope===t.scope?e.order-t.order||e.seq-t.seq:Es(e.scope.block,e.seq,t.scope.block,t.seq)}function Os(e,t){return Es(e.block,0,t.block,0)}function ks(){if(--cr!==0||lr===null)return;let e=lr;lr=null;for(let{block:t,error:n,handler:r}of e)As(t,n,r)}function As(e,t,n){if(cr>0){(lr??=[]).push({block:e,error:t,handler:n});return}let r=n===void 0?__(e):n;if(r!==null){ov(e,t,r(t));return}let i=e;for(;i!==null&&i.parentBlock!==null;)i=i.parentBlock;i!==null&&i.kind===`root`&&!i.disposed&&(L(i),ls()),cv(e,t)||console.error(t)}function js(e){let t=e.scope.hooks?.get(e.slot);if(t===void 0||t.revision!==e.revision||!Ns(e,t))return;let n=e.fn===null,r=t.cleanup;if(n&&(t.connectedFn=null,t.connectedArgs=void 0,t.disconnected=!1),r){t.cleanup=void 0;try{mr(r,e.phase,e.scope)}catch(t){if(t instanceof To)throw t;As(e.scope.block,t)}}}function Ms(e){if(e.fn===null)return;let t,n=e.scope.hooks?.get(e.slot);if(n!==void 0&&n.revision===e.revision&&Ns(e,n)){n.connectedFn=e.fn,n.connectedArgs=e.args,n.disconnected=!1;try{let n=sr;sr=e.phase,or++;try{t=en||e.scope.block.idState.renderOwner?.signalOwner!==void 0?Rn(e.scope,()=>e.fn.apply(null,e.args)):e.fn.apply(null,e.args)}finally{or--,sr=n}}catch(t){if(t instanceof To)throw t;As(e.scope.block,t);return}typeof t==`function`&&(n.cleanup=t)}}function Ns(e,t){return D?.publicationCurrent(e)!==!1||(M!==null&&Ma(t),t.deps=void 0,t.active=t.connectedFn!==null,!e.scope.block.idState.renderOwner?.disposed&&!ms(e.scope.block)&&Bn(e.scope.block),!1)}function Ps(){let e=ao[no],t=ao[ro];if(e.length===0&&t.length===0)return null;let n=e.length===0?t.splice(0):t.length===0?e.splice(0):e.splice(0).concat(t.splice(0));n.sort(Ds);let r=n.length,i=0;for(;i<r;){let e=n[i].scope,t=i+1;for(;t<r&&n[t].scope===e;)t++;for(let e=i;e<t;e++){let t=n[e];t.phase===no&&!t.scope.block.disposed&&js(t)}for(let e=i;e<t;e++){let t=n[e];t.phase===no&&!t.scope.block.disposed&&Ms(t)}for(let e=i;e<t;e++){let t=n[e];t.phase===ro&&!t.scope.block.disposed&&(t.fn===null||!Yc(t.scope.block))&&js(t)}i=t}return n}function Fs(e){for(let t=0;t<e.length;t++){let n=e[t];n.phase===ro&&(n.scope.block.disposed||Yc(n.scope.block)||Ms(n))}}function Is(){cr++;try{zs();let e=ao[io];if(e.length===0)return;let t=e.splice(0);t.sort(Ds);for(let e=0;e<t.length;e++){let n=t[e];n.scope.block.disposed||n.fn!==null&&Yc(n.scope.block)||js(n)}for(let e=0;e<t.length;e++){let n=t[e];n.scope.block.disposed||Yc(n.scope.block)||Ms(n)}}finally{ks()}}function Ls(){if(so.length===0)return null;let e=so.splice(0),t=null;for(let n=0;n<e.length;n++)try{let r=e[n]();r!==void 0&&(t??=[]).push(r)}catch(e){console.error(e)}return t}var Rs=[];function zs(){if(Rs.length===0)return;let e=Rs.splice(0);for(let t=0;t<e.length;t+=3)try{mr(e[t],io,e[t+2])}catch(n){if(n instanceof To)throw n;let r=e[t+1],i=e[t+2];As(i,n,r)}}function Bs(e){try{return!Object.is(e.value,e.getSnapshot())}catch{return!0}}function Vs(){if(uo.length===0)return;let e=uo.splice(0);dr++;try{for(let t=0;t<e.length;t++){let n=e[t];n.queued=!1,!(n.block.disposed||Yc(n.block))&&(n.value=n.pending,Bs(n)&&n.forceUpdate())}}finally{dr--}}var Hs=[],Us=null,Ws=0;function Gs(){Hs.length!==0&&(Hs=[],Ws++,Us!==null&&(clearTimeout(Us),Us=null))}function Ks(e){if(e!==void 0&&e!==Ws)return;let t=Hs;if(t.length!==0){Gs();for(let e=0;e<t.length;e++)t[e]()}}var qs;function Js(){if(qs===void 0){if(typeof MessageChannel>`u`)qs=e=>setTimeout(()=>Ks(e),0);else{let e=new MessageChannel;e.port1.onmessage=e=>Ks(e?.data),qs=t=>e.port2.postMessage(t)}}return qs}function Ys(e){if(Hs.push(e),Hs.length!==1)return;let t=Js(),n=++Ws,r=typeof document<`u`&&document.visibilityState===`hidden`,i=typeof requestAnimationFrame==`function`;Us=setTimeout(()=>Ks(n),r||!i?0:250),!r&&i&&requestAnimationFrame(()=>{t(n)})}var Xs=class{constructor(e,t,n,r,i,a,o,s,c){this.body=a,this.props=o,this.extra=s,this.outputHandler=c,this.memoInChain=a?.__memo===!0||t!==null&&t.memoInChain===!0,this.parentNode=n,this.parentBlock=t,this.idState=t?.idState??{prefix:``,next:0},this.startMarker=r,this.endMarker=i,this.exclusiveMarkers=!1,this.itemIndex=0,this.pending=!1,this.disposed=!1,this.mounted=!1,this.renderStatus=qn,this.pendingMode=null,this.currentRenderMode=null,this.pendingDeferred=!1,this.currentRenderDeferred=!1,this.inactive=!1,this.hooks=null,this.cleanups=null,this.effectSlots=null,this.children=null,this._slots=null,this.refFields=null,this.$$ctxValues=null,this.$$ctxReads=null,this.$$ctxDirect=null,this.$$ctxDepsEpoch=-1,this.$$ctxCache=null,this.$$ctxCacheOwner=null,this.$$implicitBail=!1,this.__thenableIdx=0,this.drainStamp=0,this.drainRenders=0,this.crossRenderUpdate=!1,this.nestedUpdateChain=-1,this.nestedUpdateCount=0,this.nestedUpdateError=!1,this.effectEventRenderVersion=0,this.effectEventCompletedVersion=0,this.deoptNode=null,this.deoptRefs=!1,this.slots=[],this.compilerMemo=null,this.forSlot=null,this.prevSibling=null,this.nextSibling=null,this.key=null,this.vt=null,this.parent=null,this.block=this,this.kind=e,this.createdStamp=0,this.__warmEpisode=void 0,this.__thenableDone=void 0,this.__thenables=void 0,this.$$tryHandler=void 0,this.__suspenseHandler=void 0,this.__trySlot=void 0,this.__activitySlot=void 0,this.__warmCache=void 0,this.__warmCacheEpisode=void 0,this.signalInstanceParent=null,this.signalInstanceSite=void 0,this.signalInstanceValue=void 0,this.signalInstanceHasKey=!1,this.signalInstanceResolved=void 0}},Zs=class{constructor(e,t){this.block=t,this.parent=e,this.hooks=null,this.cleanups=null,this.effectSlots=null,this.children=null,this._slots=null,this.refFields=null,this.$$ctxValues=null,this.$$ctxReads=null,this.$$ctxCache=null,this.$$ctxCacheOwner=null,this.mounted=!1,this.slots=[],this.compilerMemo=null,this.signalInstanceParent=null,this.signalInstanceSite=void 0,this.signalInstanceValue=void 0,this.signalInstanceHasKey=!1,this.signalInstanceResolved=void 0}};function Qs(e,t,n,r,i,a,o,s,c=null){let l=new Xs(e,t,n,r,i,a,o,s,c);return t!==null&&l.idState.renderOwner===M?.owner&&oa(l),l}var $s=null,ec=null;function tc(e,t){let n=ec??=new Map;n.has(e)||n.set(e,{value:e.value,queue:e[t]?.slice(),key:t})}function I(e){if(en||e.idState.renderOwner?.signalOwner!==void 0){let t=Ln(e);if(t!==void 0&&tn?.(t),t!==void 0&&fe()!==t){he(t,()=>I(e));return}}let t=H();if(t!==null&&(!t.owns(e)||e.kind===`dynamic`&&e.endMarker!==null&&t.isFresh(e.endMarker))){t.suspend(()=>I(e));return}let n=$s,r=ec;$s=e,ec=null;try{let t=0;for(;sc(e);){if(e.nestedUpdateError)throw e.nestedUpdateError=!1,Eo();if(++t>ko)throw Error(E(9))}en&&e.__trySlot?.tryBlock===e&&e.__trySlot.retrySignalOwners!==void 0&&Tn(e.__trySlot);let i=ec;if(i!==null&&n!==null&&Ts(n,e)){r??=new Map;for(let[e,t]of i)r.has(e)||r.set(e,t)}}catch(t){let n=ec;if(n!==null){for(let[e,t]of n)e.value=t.value,e[t.key]=t.queue;e.crossRenderUpdate||(e.pending=!1)}throw e.idState.renderOwner?.signalOwner!==void 0&&!e.mounted&&e.forSlot!==null&&e.forSlot.items.get(e.key)!==e&&En(e,t),t}finally{$s=n,ec=r}}function nc(e){F?.recordStageEntry(e),_o.push(e)}function rc(e,t=null){if(!e.disposed)for(let n=e;n!==null&&(n.block===n&&(n.renderStatus=Jn,n.forSlot!==null&&(n.forSlot.cachedDeps=null)),!(n===t||t===null&&n.inactive));n=n.parentBlock);}function ic(e,t){if(e.rootTransaction===!0)return;let n=e.renderRoot??=t;(t===n||Ts(n,t))&&(e.renderedBlocks??=new Set).add(t)}function ac(e,t){let n=new Map;for(let r of Qr)for(let i of r){if(i.block!==e||i.superseded)continue;let r=n.get(i.slot);r===void 0?(n.set(i.slot,t.cells.length),t.cells.push({update:i,baseValue:i.baseValue,value:i.slot.value,hook:void 0})):t.cells[r].update=i}for(let e of t.cells)e.hook=Wc(e.update),e.hook===null&&(e.update.slot.value=e.baseValue)}function oc(e,t){for(let n=t.cells.length-1;n>=0;n--){let r=t.cells[n];r.hook!==void 0&&(r.hook===null?!e.disposed&&!r.update.superseded&&Object.is(r.update.slot.value,r.baseValue)&&(r.update.slot.value=r.value):Gc(r.hook))}e.disposed||e.pending&&e.pendingMode===`urgent`||t.cells.length!==0&&t.cells.every(e=>e.update.superseded)||(e.pending=!0,e.pendingMode=`transition`,e.pendingDeferred=t.pendingDeferred,t.queueEpoch!==hr&&!A.includes(e)&&A.push(e))}function sc(e){e.renderStatus===Jn&&(e.renderStatus=Yn),P!==null&&P.rootTransaction!==!0&&ic(P,e),j!==null&&j.push(Ai,e,null,null);let t=O,n=k,r=Zn,i=Qn,a=nr,o=er.length,s=go,c=_o,l=P?.events??s,u=P?.eventActions??c,d=l.length,f=u.length;O=e,k=e,Zn=e.effectSlots===null?0:$n++,Qn=0;let p=n!==null&&eu(n,e),m=e.pending&&e.pendingMode===`transition`&&p&&n.currentRenderMode===`urgent`?xr:null,h=m===null?null:{pendingDeferred:e.pendingDeferred,queueEpoch:hr,cells:[]};if(p)nr===0&&(nr=tr++);else{let t=n===null&&Wl?e.__warmEpisode:void 0;nr=typeof t==`number`?t:tr++}e.__warmEpisode=nr,go=l,_o=u,e.effectEventRenderVersion!==0&&e.effectEventRenderVersion++,e.pending=!1,e.crossRenderUpdate=!1,e.__thenableIdx=0;{let t=e.__thenables;t!==void 0&&t.length!==0&&(!Wl||e.__thenableDone===!0)&&(t.length=0),e.__thenableDone=!1}if(e.$$ctxReads!==null&&e.$$ctxReads.clear(),e.$$ctxDirect!==null){let t=e.slots[0];t?.__kind===`hydrateBlockSlot`&&t.parentBlock===e&&!t.independent&&!t.hydrated&&(t.contextChanged=e.$$ctxDepsEpoch!==Ae()&&Bg(e)),e.$$ctxDirect.clear()}e.$$ctxDepsEpoch=Ae(),e.currentRenderMode=h===null?e.pendingMode??n?.currentRenderMode??`urgent`:`urgent`,e.currentRenderDeferred=h===null?e.pendingMode===null?n?.currentRenderDeferred??!1:e.pendingDeferred:!1,e.pendingMode=null,e.pendingDeferred=!1;let g,_=!1,v=!1;D?.beginRender(e),pn?.get(e)?.clear();try{h!==null&&m.beginUrgent(e,h);let t=e.body(e.props,e,e.extra);if(e.pending&&!e.crossRenderUpdate)return v=!0,!0;e.outputHandler!==null&&(t!==void 0||e.slots[0]?.returnedOutput===!0)&&e.outputHandler(e,t??null),e.effectSlots!==null&&Zc(e),e.mounted||=!0,e.renderStatus===Yn&&(e.renderStatus=qn),e.effectEventRenderVersion!==0&&(e.effectEventCompletedVersion=e.effectEventRenderVersion),_=!0,e.__thenableDone=!0}catch(e){if(typeof e==`object`&&e)try{typeof e.then==`function`&&(e=new zl(e))}catch{}throw g=e,e}finally{if(!_){if(v&&(e.renderStatus=Jn),e.renderStatus!==Jn){let t=null,n=Bl(g);if(n||!kl(g)){for(let r=e;r!==null;r=r.parentBlock)if(n?r.__suspenseHandler:r.$$tryHandler&&r.__trySlot?.catchBody!==null){t=r;break}}rc(e,t)}l.length=d,u.length=f}go=s,_o=c,er.length=o,nr=a,Zn=r,Qn=i,O=t,k=n;try{D?.endRender(e,_,Bl(g))}finally{h!==null&&m.endUrgent(e,h)}}}var cc=null;function lc(e,t){e.returnedOutput!==t&&(j!==null&&!Wi&&j.push(Oi,e,`returnedOutput`,e.returnedOutput),e.returnedOutput=t)}function uc(e,t){let n=[t?.end,t?.block?.endMarker,t?.hostNode,t?.text,e.endMarker,z(e.parentNode).lastChild];for(let t=0;t<n.length;t++){let r=n[t];if(r!=null&&(R?.view(r)??r).parentNode===e.parentNode)return r}return null}function dc(e,t,n){let r=cc;cc=e;try{if(n===!0){let t=e.slots[0];t!==void 0&&fc(e,t);return}let r=t!==null&&t.$$kind===Mt&&t.key==null&&typeof t.type==`function`,i=e.slots[0],a=null,o=null,s=r&&(t.type.$$singleRoot===!0||H()?.passthroughRanges===!0||i!==void 0&&i.__kind===`componentSlotSlot`&&i.currentComp===t.type);if(i!==void 0&&i.__kind!==(s?`componentSlotSlot`:`childSlot`)){let n=xr,r=e.currentRenderMode===`transition`,s=n!==null&&H()===null&&b_(e),c=M===null||s?n:null,l=c!==null&&!r&&H()===null&&s;if(c!==null&&H()===null&&(r||l)){let n=uc(e,i);if(n!==null){let r=c.render(e,e.parentNode,n,fv,t,dc);if(c.dispose(r.wip),r.failed)throw r.error;if(r.suspended)throw new zl(r.suspended)}}if(M!==null&&!i.inherited&&!i.borrowed&&i.ownerHost==null){let t=i.start??i.hostNode??i.text??i.block?.startMarker??i.end??null,n=i.end??i.block?.endMarker??t;w_(e,t,n)&&(a=t,o=n)}if(fc(e,i),e.disposed)return}if(s){let n=t;Ch(e,0,e.parentNode,n.type,n.props,e.endMarker,n.key??void 0,!0,void 0,H()!==null&&eh(n),n.__octaneInvocationSite)}else{let n=H();if(n!==null&&e.slots[0]===void 0&&e.startMarker!==null&&e.endMarker!==null&&e.startMarker!==e.endMarker&&e.startMarker.nodeType===8&&e.endMarker.nodeType===8&&(V(e.startMarker)===e.endMarker||n.isUnframedRootRange(e.startMarker,e.endMarker))){let t={__kind:`childSlot`,start:e.startMarker,end:e.endMarker,ownerHost:null,borrowed:!0,compactable:!1,block:null,text:null,currentComp:null,currentIsBodyFn:!1,forSlot:null,hostNode:null,portal:null};e.slots[0]=t,xc(e,t)}Ig(e,0,e.parentNode,t,e.endMarker)}if(a!==null){let t=e.slots[0],n=t.start??t.hostNode??t.text??t.block?.startMarker??t.end??null,r=t.end??t.block?.endMarker??n;C_(e,a,o,n,r)}let c=e.slots[0];!e.disposed&&c!==void 0&&c.returnedOutput!==!0&&(j!==null&&!Wi&&j.push(Oi,c,`returnedOutput`,c.returnedOutput),c.returnedOutput=!0)}finally{cc=r}}function fc(e,t){let n=t.__kind,r=(n===`ifBlockSlot`||n===`switchBlockSlot`)&&t.start===null&&t.block?.endMarker!=null?t.block.endMarker:t.end,i=M;if(i!==null&&!i.aborted&&!Wi){let n=t.ownerHost??e.parentNode,i=t.inherited===!0||t.borrowed===!0,a=t.ownerHost!=null||i&&t.start===null?B(n):i?V(t.start):t.start??t.hostNode??t.text??t.block?.startMarker??r??null;i&&a===r&&(a=null);let o=a===null?null:t.ownerHost!=null||i&&r===null?(R?.view(n)??n).lastChild:i?z(r).previousSibling:r??t.block?.endMarker??a;Xi(t,n,i?t.start:a===null?(R?.view(n)??n).lastChild:(R?.view(a)??a).previousSibling,i?r:(R?.view(o)??o)?.nextSibling??null);let s=t.block??t.portal?.block;if(s!=null&&ea(s),t.forSlot!=null){for(let e=t.forSlot.head;e!==null;e=e.nextSibling)ea(e);t.forSlot.emptyBlock!==null&&ea(t.forSlot.emptyBlock)}na(n,a,o,()=>Oc(t,!1)),N(e.slots,0,e.slots[0]);let c=e._slots;if(c!==null){let e=c.indexOf(t);e!==-1&&(Yi(()=>c.splice(e,0,t)),c.splice(e,1))}e.slots[0]=void 0;return}if(n===`childSlot`){if(t.portal&&=(Jm(t.portal),null),t.forSlot){for(let e=t.forSlot.head;e!==null;e=e.nextSibling)L(e,!0);t.forSlot.emptyBlock&&L(t.forSlot.emptyBlock,!0),t.forSlot=null}Ph(t),t.borrowed||(z(t.start)?.remove(),z(r)?.remove())}else n===`componentSlotSlot`?t.block&&L(t.block,!0):Oc(t,!0),!t.inherited&&!t.borrowed&&(z(t.start)?.remove?.(),z(r)?.remove?.());let a=e._slots;if(a!==null){let e=a.indexOf(t);e!==-1&&a.splice(e,1)}e.slots[0]=void 0}var pc=class{constructor(e,t,n){this.parentNode=e,this.endMarker=t,this.parentBlock=n,this.$$ctxValues=null,this.idState=n.idState,this.signalInstanceParent=null,this.signalInstanceSite=void 0,this.signalInstanceValue=void 0,this.signalInstanceHasKey=!1,this.signalInstanceResolved=void 0}},mc=0,hc=null,gc=null,_c=null;function vc(e){hc===null?cv(gc,e)||console.error(e):(_c??=[]).push(e)}function yc(){let e=_c,t=hc,n=gc;if(_c=null,hc=null,gc=null,e!==null&&t!==null)for(let r=0;r<e.length;r++)ov(n,e[r],t(e[r]))}function L(e,t=!0){if(!e.disposed&&(Wi&&M!==null&&(M.retainedCreated?.has(e)||M.hydrating&&e.kind!==`portal`)&&(t=!1),!ra(e,t))){mc===0&&(hc=__(e.parentBlock)??El(e),gc=e),mc++;try{bc(e,t)}finally{--mc===0&&yc()}}}function bc(e,t){e.disposed=!0;let n=e.idState.renderOwner;n?.current===e&&(n.generation++,n.wakeable=null,n.request=null,n.transition!==void 0&&xr.discardRoot(n)),eo?.unregister(e),e.deoptNode!==null&&e.deoptRefs&&U(e.deoptNode,null);let r=t&&(e.kind===`root`||e.startMarker!==null&&e.endMarker!==null&&z(e.startMarker).parentNode!==null);if(Cc(e,t&&!r),n?.current===e&&D?.clearDeferredRefs(n),t){if(e.startMarker&&e.endMarker){let t=z(e.startMarker).parentNode;if(t){let n=e.exclusiveMarkers,r=n?V(e.startMarker):e.startMarker,i=n?e.endMarker:V(e.endMarker);for(;r&&r!==i;){let e=V(r);(R?.view(t)??t).removeChild(r),r=e}}}else if(e.kind===`root`){let t;for(;(t=B(e.parentNode))!==null;)z(e.parentNode).removeChild(t)}}}function xc(e,t){let n=e._slots,r=M;r!==null&&e.mounted&&!ia(r,e.block)&&Yi(()=>{Oc(t,!0);let r=e.slots.indexOf(t);if(r!==-1&&(e.slots[r]=void 0),n===null)e._slots=null;else{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}),n===null?e._slots=[t]:n.push(t)}var Sc=1;function Cc(e,t=!0){let n=e.effectSlots;if(n!==null)for(let t=0;t<n.length;t++){let r=n[t],i=r.cleanup;if(i!==void 0){if(r.cleanup=void 0,r.phase===io)Rs.push(i,hc,gc),co||bs();else{if(gs!==null&&F.stageTeardown(i,r.phase,e)===!0)continue;try{mr(i,r.phase,e)}catch(e){vc(e)}}}}let r=null;e.mounted!==!0&&(r=[],A_(e,r)),cs(r,()=>{Ec(e,t)})}function wc(e,t){let n=e.cleanups;if(n!==null){for(let t=n.length-1;t>=0;t--)if(gs===null||F.stageTeardown(n[t],-1,e)!==!0)try{pr(n[t],e)}catch(e){vc(e)}}let r=gn.get(e);if(r){if(_n?.owners.has(r)||gs!==null&&F.stageAction(()=>{t?gn.set(e,null):gn.delete(e),bn(r)},!0))return;t?gn.set(e,null):gn.delete(e),bn(r)}else if(t&&r===!1){if(gs!==null&&F.stageAction(()=>Tc(e),!0))return;Tc(e)}}function Tc(e){let t=gn.get(e);t===!1?gn.set(e,null):t&&(gn.set(e,null),bn(t))}function Ec(e,t,n=!0){wc(e,n),Dc(e,t)}function Dc(e,t){let n=e.children;if(n!==null)for(let e=0,r=n.length;e<r;e++)Cc(n[e].scope,t);let r=e._slots;if(r!==null)for(let e=0,n=r.length;e<n;e++){let n=r[e];Oc(n,t)}}function Oc(e,t){(e.__flags&Sc)!==0&&e.__teardown(e,t);let n=e.__kind;if(n===`ifBlockSlot`||n===`switchBlockSlot`||n===`activityBlockSlot`)e.block&&L(e.block,t);else if(n===`forBlockSlot`){for(let n=e.head;n!==null;n=n.nextSibling)L(n,t);e.emptyBlock&&L(e.emptyBlock,t)}else if(n===`hydrateBlockSlot`)e.block&&L(e.block,t);else if(n===`childSlot`){if(e.block&&L(e.block,t),e.forSlot){for(let n=e.forSlot.head;n!==null;n=n.nextSibling)L(n,t);e.forSlot.emptyBlock&&L(e.forSlot.emptyBlock,t)}e.portal&&Jm(e.portal),e.hostNode!=null&&U(e.hostNode,null)}else{let r=n===`portalSlotSlot`||t;e.block&&L(e.block,r),n===`portalSlotSlot`&&e.target&&(Um(e.target,e),lp(e.target))}}function kc(e){throw Error(E(15,e))}var Ac=[],jc=null;function Mc(e,t,n){let r=jc??={pending:Ac[Ac.length-1],active:!1},i=r.pending,a=r.active;r.pending=void 0,r.active=!0;try{if(i===void 0)return Reflect.apply(e,t,n);switch(n.length){case 0:return e.call(t,i);case 1:return e.call(t,n[0],i);case 2:return e.call(t,n[0],n[1],i);case 3:return e.call(t,n[0],n[1],n[2],i);case 4:return e.call(t,n[0],n[1],n[2],n[3],i);default:{let r=Array(n.length+1);for(let e=0;e<n.length;e++)r[e]=n[e];return r[n.length]=i,e.apply(t,r)}}}finally{r.pending=i,r.active=a}}function Nc(e,t,...n){let r=jc,i=r?.pending,a=r?.active??!1;r!==null&&(r.pending=e,r.active=!1),Ac.push(e);try{return t(...n)}finally{Ac.pop(),jc!==null&&(jc.pending=r===null?Ac[Ac.length-1]:i,jc.active=a)}}function Pc(e,t){let n=typeof t==`number`?String(t):t.description??``;return e+(typeof t==`number`?`n`:`s`)+n.length+`:`+n}function Fc(e){let t=Ac.length;return t===0?e:e===void 0&&t===1?Ac[0]:a(Ac,e,!1)}function Ic(e,t,n,r){r=Fc(r),(r===void 0||O===null)&&kc(e);let i=O,a=i.hooks?.get(r);if(a===void 0){a={nativeValue:t()},dn(i).set(r,a);let e=a.nativeValue;fn(i,()=>n(e))}return a.nativeValue}Vt(()=>O===null?null:Ic);function Lc(e,t){let n=Rc(e,t,arguments.length===1);return[n.value,n.setter]}function Rc(e,t,n){t===void 0&&typeof e==`symbol`&&n&&(Ac.length===0||jc?.active===!0)&&(t=e,e=void 0),t=Fc(t),t===void 0&&kc(`useState`);let r=O,i=k,a=r.hooks?.get(t);if(a===void 0&&(a={value:typeof e==`function`?e():e,setter:e=>{if(i.disposed)return;if(a.pendingActionBatch!==void 0&&Fr()===null&&Hc(a,e),(a.updates!==void 0||a.renderTransition!==void 0||typeof e==`function`&&Hr>0&&xr?.hasHeld(a,i)||i.pending&&typeof e==`function`)&&Fr()===null){k===i&&tc(a,`updates`),(a.updates??=[]).push(e),Do(i);return}let t=Lr(a,i),n,r=!1;try{n=typeof e==`function`?e(t):e}catch{if(Fr()===null){k===i&&tc(a,`updates`),(a.updates??=[]).push(e),Do(i);return}n=t,r=!0}let o=r||a.updates!==void 0||a.renderTransition!==void 0||a.pendingActionBatch!==void 0||i.pending&&typeof e==`function`;if(Object.is(n,t)&&!o){typeof e!=`function`&&xr?.cancelEqual(a,i)&&Do(i);return}let s=Rr(a,i,e,n,o);if(s!==null){s.state===void 0&&(s.state=a,Vc(s,a));return}if(fs&&ur>0&&!o){let e=ds??=new Map,t=a;if(!e.has(t)){let n={block:i,previous:a.value};e.set(t,n)}a.value=n;return}k===i&&tc(a,`updates`),a.value=n,i.disposed,Do(i)},updates:void 0,renderTransition:void 0,urgentTransition:void 0,getter:void 0,pendingActionBatch:void 0,pendingActionValue:void 0},dn(r).set(t,a)),a.renderTransition!==void 0||a.updates!==void 0){let e=zc(a);!a.urgentTransition&&a.updates!==void 0&&Object.is(e,a.value)&&xr?.rebaseHeld(a,i,a.updates),a.value=e,a.urgentTransition||(a.renderTransition!==void 0&&(Uc(a.renderTransition,a.value),a.renderTransition=void 0),a.updates=void 0)}return a}function zc(e){let t=e.renderTransition,n=t===void 0?e.value:Bc(t,e.urgentTransition===!0);if(e.updates!==void 0)for(let t of e.updates)n=typeof t==`function`?t(n):t;return n}function Bc(e,t,n){let r=e;for(;r.previous!==void 0;)r=r.previous;let i=r.replayBaseValue;for(let a=r;;a=a.next){if(a.stateUpdates!==void 0)for(let e of a.stateUpdates)i=typeof e==`function`?e(i):e;if(a.reducerActions!==void 0)for(let e of a.reducerActions)i=n(i,e);if((t||a.superseded)&&a.urgentOperations!==void 0)for(let e of a.urgentOperations)i=a.operations[e](i);else if(!t&&!a.superseded)for(let e of a.operations)i=e(i);if(a===e)return i}}function Vc(e,t){e.replayBaseValue=t.value;let n=t.renderTransition??xr?.heldUpdate(t,e.block);n!==void 0&&(e.previous=n,n.next=e),e.state===void 0?e.reducerActions=e.reducer.renderPhaseActions?.slice():e.stateUpdates=e.state.updates?.slice()}function Hc(e,t){let n=e.pendingActionBatch.updates.get(e);n!==void 0&&((n.urgentOperations??=[]).push(n.operations.length),n.operations.push(typeof t==`function`?t:()=>t),n.forceRender=!0)}function Uc(e,t){for(let n=e;n;n=n.previous)n.value=t,n!==e&&Object.is(t,n.baseValue)&&(n.superseded=!0)}function Wc(e){let t=e.state??e.reducer;return e.block.disposed||e.superseded||t===void 0||t.renderTransition===void 0?null:(t.urgentTransition=!0,t.value=e.baseValue,{update:e,cell:t})}function Gc(e){let{update:t,cell:n}=e;if(n.urgentTransition=!1,t.block.disposed||t.superseded){n.renderTransition=void 0;return}for(let e=t;e;e=e.previous)e.baseValue=n.value}var Kc=null;function qc(e,t){let n=Kc??=new WeakMap,r=n.get(e);r===void 0&&(r={entries:[],live:0},n.set(e,r));let i={action:t,active:!0,queue:r};return r.entries.push(i),r.live++,i}function Jc(e,t,n=!1){if(e===void 0||t===void 0)return!0;let r=e.length;if(r!==t.length){if(!n)return!0;r=Math.min(r,t.length)}for(let n=0;n<r;n++)if(!Object.is(e[n],t[n]))return!0;return!1}function Yc(e){for(let t=e;t!==null;t=t.parentBlock)if(t.inactive)return!0;return!1}function Xc(){return Zn===0&&(Zn=$n++),Zn}function Zc(e){let t=e.effectSlots;if(t!==null&&Zn!==0&&Qn!==t.length)for(let n=0;n<t.length;n++){let r=t[n];if(r.renderVersion===Zn||(r.phase===no&&d_(r),!r.active))continue;M!==null&&Ma(r),r.deps=void 0,r.active=!1;let i=++r.revision,a=P===null?ao[r.phase]:P.effects[r.phase];a.push({scope:e,slot:r.slot,fn:null,order:r.order,revision:i,args:void 0,phase:r.phase,seq:lo++}),f_(r,r.phase,a)}}function Qc(e,t,n,r){let i=O,a=i.hooks?.get(e);r===no&&(a===void 0?yd?.(i.block):d_(a));let o=Xc(),s=a!==void 0&&a.renderVersion!==o;if(s&&(Qn++,a.renderVersion=o),r!==no&&Yc(i.block)){rc(i.block),a&&!a.active&&(M!==null&&Ma(a),a.active=!0,a.revision++);return}if(a){let e=Jc(a.deps,n,!0);if(a.active&&!e)return;M!==null&&Ma(a);let t=!1;if(a.active||(a.active=!0,a.revision++,t=!0),!e)return;s&&!t&&a.revision++}let c;if(a)a.deps=n,c=a;else{if(M!==null){let t=i.effectSlots,n=t?.length??0;Yi(()=>{i.hooks?.delete(e),t===null?i.effectSlots=null:t.length=n})}Qn++;let t={deps:n,cleanup:void 0,renderVersion:o,revision:0,active:!0,order:i.effectSlots===null?0:i.effectSlots.length,effect:!0,phase:r,slot:e,connectedFn:null,connectedArgs:void 0,disconnected:!1};dn(i).set(e,t),i.effectSlots===null?i.effectSlots=[t]:i.effectSlots.push(t),c=t}let l={scope:i,slot:e,fn:t,order:c.order,revision:c.revision,args:n,phase:r,seq:lo++},u=P===null?ao[r]:P.effects[r];u.push(l),f_(c,r,u)}function $c(e,t,n){return n===void 0&&typeof t==`symbol`&&(n=t,t=void 0),t===null&&(t=void 0),n=Fc(n),n===void 0&&kc(e),[t,n]}function el(e,t,n){let[r,i]=$c(`useEffect`,t,n);Qc(i,e,r,io)}function tl(e,t,n){let[r,i]=$c(`useLayoutEffect`,t,n);Qc(i,e,r,ro)}function nl(e,t){return t.warmEpisode!==nr&&Zl(e,t.deps,t)&&(t.warmEpisode=nr),t}function rl(e,t,n){let r=tu(t,n);if(r===ql)return null;let i={deps:n,value:r.value,warmEpisode:nr,warmRecord:void 0,nativeWitness:void 0};return Zr!==null&&mi(e,t,i),dn(e).set(t,i),Ql(r,i),i}function il(e,t,n,r,i){let a={deps:n,value:r,warmEpisode:void 0,warmRecord:void 0,nativeWitness:i};return Zr!==null&&mi(e,t,a),dn(e).set(t,a),n!==void 0&&Zl(t,n,a)&&(a.warmEpisode=nr),r}var al=Object.is;function ol(e,t){let n=e.compilerMemo;return n!==null&&n.bodyId===t?n:sl(e,t,n)}function sl(e,t,n){if(n===null)return e.compilerMemo={bodyId:t,auto:void 0,hooks:void 0,overflow:null};let r=n.overflow;r===null&&(n.overflow=r=new Map);let i=r.get(t);return i===void 0&&(i={bodyId:t,auto:void 0,hooks:void 0,overflow:null},r.set(t,i)),i}function cl(e){return Array(e).fill(null)}function ll(e,t,n,r){return Zr!==null&&hi(e,t,[!0,r,n]),e[t+2]=n,e[t+1]=r,e[t]=!0,n}function ul(e,t){t===void 0&&typeof e==`symbol`&&arguments.length===1&&(Ac.length===0||jc?.active===!0)&&(t=e,e=void 0),t=Fc(t),t===void 0&&kc(`useRef`);let n=O,r=n.hooks?.get(t);return r===void 0&&(r={current:e},dn(n).set(t,r)),r}function dl(e,t){let n=[],r,i=!1;function a(e){if(e!=null){if(Array.isArray(e)){for(let t=0;t<e.length;t++)a(e[t]);return}if(i||=(r=t(),!0),typeof e==`function`){let t=e(r);n.push(typeof t==`function`?t:()=>e(null))}else{let t=e;t.current=r,n.push(()=>{t.current=null})}}}function o(){let e,t=!1;for(let r of n)try{r()}catch(n){t||=(e=n,!0)}if(n.length=0,t)throw e}try{a(e)}catch(e){try{o()}finally{throw e}}return o}function fl(e,t,n,r){let[i,a]=$c(`useImperativeHandle`,n,r);n=i,r=a;let o=n===void 0?void 0:[...n,e];Qc(r,()=>{if(Array.isArray(e))return dl(e,t);let n;return typeof e==`function`?n=e(t()):e!=null&&(e.current=t()),()=>{if(typeof n==`function`){n();return}typeof e==`function`?e(null):e!=null&&(e.current=null)}},o,ro)}var pl=new Map;function ml(e){let t=pl.get(e);if(t===void 0){let n=Pc(`@octane:uses:`,e);t={inst:Symbol.for(n+`:uses:inst`),effect:Symbol.for(n+`:uses:effect`)},pl.set(e,t)}return t}function hl(e,t,n){e.pending=t,e.subscribe=n,!e.queued&&(e.queued=!0,(P===null?uo:P.stores).push(e))}function gl(e,t){return Bs(e)&&e.forceUpdate(),t(e.onStoreChange)}function _l(e){let t=yr,n=br;yr=0,br=0;try{Do(e)}finally{yr=t,br=n}}function vl(e,t,n=void 0,r){let i=arguments.length,a=i>4?arguments[i-1]:i===4?r:n;a=Fc(a),a===void 0&&kc(`useSyncExternalStore`);let o=i>=4?n:void 0,s=ml(a),c=(H()!==null&&o!==void 0?o:t)(),l=O,u=l.hooks?.get(s.inst);if(u===void 0){let n=k,r={value:c,getSnapshot:t,pending:c,subscribe:e,effectDeps:null,forceUpdate:()=>_l(n),onStoreChange:()=>{n.disposed||(k!==null||!n.pending||n.pendingMode!==`urgent`||n.pendingDeferred)&&Bs(r)&&r.forceUpdate()},block:n,queued:!1};u=r,r.effectDeps=[r,e],dn(l).set(s.inst,u),hl(u,c,e)}else u.getSnapshot=t,(!Object.is(c,u.value)||e!==u.subscribe)&&hl(u,c,e);return u.effectDeps[1]!==e&&(u.effectDeps=[u,e]),el(gl,u.effectDeps,s.effect),c}function yl(e){return e.$$singleRoot=!0,e}function bl(e){return typeof e==`function`&&e[It]===!0}`${T}`;var xl=null,Sl=0;function Cl(e){let t=null;for(let n=e;n!==null;n=n.parentBlock){if(n.block!==n)continue;let e=n.slots[0];e?.__kind===`hydrateBlockSlot`&&!e.hydrated&&xl?.has(e)&&(t=e)}return t}var wl=Symbol(`octane.ctx.default`);function Tl(e){if(ir===0)return null;let t=e;for(;t!==null&&t.parentBlock!==null;)t=t.parentBlock;if(t===null)return null;let n=rr.get(t);return n!==void 0&&n.active?n:null}function El(e){let t=Tl(e);return t===null?null:e=>{if(!t.routeError(e))throw e}}function Dl(e){let t=Tl(e);return t===null?null:e=>{if(!t.routeSuspense(e))throw new zl(e)}}var Ol=Symbol.for(`octane.host-context-request`);function kl(e){return typeof e==`object`&&!!e&&e.$$kind===Ol}function Al(e,t){if(e!==null&&e.memoInChain){(e.$$ctxDirect??=new Map).set(t,t.$$version);for(let n=e;n!==null;n=n.parentBlock)(n.body?.__memo===!0||n.$$implicitBail===!0)&&(n.$$ctxReads??=new Map).set(t,t.$$version)}}var jl=!1,Ml=null;function Nl(e){if(e===null)return!1;for(let[t,n]of e)if(t.$$version!==n)return!0;return!1}function Pl(e,t){for(let[n,r]of e)t!==null&&Al(t,n),jl&&(Ml??=new Map).set(n,r)}function Fl(e){let t=!1,n=null,r=null,i;return()=>{let a=O,o=n===a||n!==null&&a!==null&&a.block.parentBlock===n.block&&a.$$ctxValues===null;if(!t||Nl(r)||r!==null&&!o){let o=jl,s=Ml;jl=!0,Ml=null;let c,l;try{c=e()}finally{l=Ml,jl=o,Ml=s,o&&l!==null&&Pl(l,null)}n=a,r=l,i=c,t=!0}else n=a,r!==null&&Pl(r,k);return i}}function Il(e,t,n){if(e===null)return;let r=e.$$ctxCache;if(r===null){e.$$ctxCache=t,e.$$ctxCacheOwner=n;return}let i=e.$$ctxCacheOwner;if(i!==null){let a=new Map;a.set(r,i),a.set(t,n),e.$$ctxCache=a,e.$$ctxCacheOwner=null}else r.set(t,n)}function Ll(e,t,n){if(jl&&(Ml??=new Map).set(n,n.$$version),e!==null){let r=e.$$ctxCache,i=r===n?e.$$ctxCacheOwner:r!==null&&e.$$ctxCacheOwner===null?r.get(n):void 0;if(i!=null){if(i===wl){let e=Tl(t);return e===null?n.defaultValue:e.readContext(n)}return i.$$ctxValues.get(n)}}let r=e;for(;r!==null;){let t=r.$$ctxValues;if(t!==null&&t.has(n))return Il(e,n,r),t.get(n);r=r.parent}let i=t?.parentBlock??null;for(;i!==null;){let t=i.$$ctxValues;if(t!==null&&t.has(n))return Il(e,n,i),t.get(n);i=i.parentBlock}let a=Tl(t);return a===null?(Il(e,n,wl),n.defaultValue):a.readContext(n)}function Rl(e){return Al(k,e),Ll(O,k,e)}var zl=class{constructor(e){this.thenable=e}thenable;__isSuspense=!0};function Bl(e){return typeof e==`object`&&!!e&&e.__isSuspense===!0}function Vl(e){try{return e[Re]===!0}catch{return!1}}function Hl(e,t=!1){let n=k,r=n.__thenables??=[],i=n.__thenableIdx;n.__thenableIdx=i+1;let a=H();if(!Vl(e)&&a!==null&&a.seeds!==null&&a.seedCursor<a.seeds.length)return a.useSeed(e,r,i,t);let o=r[i];if(o===e){if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:new zl(e)}if(o!==void 0&&Wl&&!t){if(o.status===`fulfilled`)return o.value;throw o.status===`rejected`?o.reason:new zl(o)}if(r[i]=e,Ul(e),e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:new zl(e)}function Ul(e){e.status===void 0&&(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))}var Wl=!1,Gl=!1,Kl=0,ql=Symbol(`octane.warm.miss`),Jl=null;function Yl(e){for(let t=e;t!==null;t=t.parentBlock)if(t.__suspenseHandler)return null;return Ki(e)}function Xl(e){for(let t=e;t!==null;t=t.parentBlock){if(t.__warmCacheEpisode!==nr)continue;let e=t.__warmCache;if(e!==void 0)return e}let t=Yl(e),n=t===null?void 0:Jl?.get(t);return n===void 0&&(n=new Map,t!==null&&(Jl??=new WeakMap).set(t,n)),e.__warmCache=n,e.__warmCacheEpisode=nr,nr>Kl&&(Kl=nr),n}function Zl(e,t,n){let r=k;if(r===null)return!1;let i=null;for(let e=0;e<er.length;e+=3){let t=er[e];if(eu(t,r)){i=t;break}}if(i===null)return!1;let a=Xl(i),o=a.get(e);o===void 0&&(o=[],a.set(e,o));let s={deps:t,value:void 0,available:!1,source:n};return o.push(s),n.warmRecord=s,Gl=!0,!0}function Ql(e,t){`available`in e&&(e.source=t,e.value=void 0,t.warmRecord=e)}function $l(e){if(Gl){if(e.hooks!==null)for(let t of e.hooks.values()){let e=t,n=e?.warmRecord;n!==void 0&&n.source===e&&(n.source=void 0,n.value=e.value,n.available=!0,e.nativeWitness!==void 0&&(n.nativeWitness=e.nativeWitness),e.warmRecord=void 0)}O_(e,$l)}}function eu(e,t){for(let n=t;n!==null;n=n.parentBlock)if(n===e)return!0;return!1}function tu(e,t,n){let r=nr<=Kl?k:null;for(;r!==null;){let i=r.__warmCache;if(r.__warmCacheEpisode===nr&&i!==void 0){let r=nu(i,e,t,n);if(r!==ql)return r}r=r.parentBlock}let i=k?.idState.renderOwner?.retryKey,a=i==null?void 0:Jl?.get(i);if(a!==void 0){let r=nu(a,e,t,n);if(r!==ql)return r}let o=k?.idState.renderOwner?.transition,s=(o?.warmHarvest!=null&&eu(o.origin,k)?o.warmHarvest:null)??$r?.warmHarvest??li;if(s!=null)for(let r=0;r<s.length;r++){let i=s[r];if(!i.taken&&i.slot===e&&!Jc(i.deps,t)&&(n===void 0||n(i)))return i.taken=!0,i}return ql}function nu(e,t,n,r){let i=e.get(t);if(i!==void 0){for(let e of i)if(e.available&&!Jc(e.deps,n)&&(r===void 0||r(e)))return e.available=!1,e}return ql}function ru(e,t){let n=Fc(e);return n===void 0&&kc(t),n}function iu(e,t,n,r,i){let a=O,o=a.hooks?.get(e);if(o!==void 0){let a=o.deps;if(a!==void 0&&a.length===4&&Object.is(a[0],t)&&Object.is(a[1],n)&&Object.is(a[2],r)&&Object.is(a[3],i))return nl(e,o)}return Gl?rl(a,e,[t,n,r,i]):null}function au(e,t,...n){return il(O,e,n,t)}var ou=Symbol.for(`octane.lazyBodyCheck`);function su(e,t){Object.defineProperty(e,ou,{get(){return this===e?t:void 0}})}var R=null;function z(e){return R===null||e==null?e:R.view(e)}var cu,lu;function B(e){return R===null?cu===void 0?e.firstChild:cu.call(e):R.view(e).firstChild}function V(e){return R===null?lu===void 0?e.nextSibling:lu.call(e):R.view(e).nextSibling}function uu(e,t,n=!0){t in e||(n?e[t]=void 0:Object.defineProperty(e,t,{value:void 0,writable:!0,configurable:!0}))}var du=!1;function fu(){if(du||typeof Element>`u`)return;du=!0;let e=Node.prototype;cu=Object.getOwnPropertyDescriptor(e,`firstChild`)?.get,lu=Object.getOwnPropertyDescriptor(e,`nextSibling`)?.get;let t=Element.prototype;Object.isExtensible(t)&&(uu(t,`$$portalParent`),uu(t,`$$portalEnd`),uu(t,`$$deoptKey`),uu(t,`$$ctrl`),uu(t,`__oct_suppress`),uu(t,`__oct_frag`),uu(t,`__oct_vfrag`),uu(t,id,!1),uu(t,od,!1),uu(t,sd,!1),uu(t,qh,!1),uu(t,Am,!1)),typeof CharacterData<`u`&&Object.isExtensible(CharacterData.prototype)&&(uu(CharacterData.prototype,`$$portalEnd`),uu(CharacterData.prototype,`$$deoptKey`),uu(CharacterData.prototype,qh,!1))}var pu=Symbol(`octane.lazy-template`);function mu(e){for(let t of(R?.view(e)??e).querySelectorAll(`*`))if(t.localName.includes(`-`)||(R?.view(t)??t).hasAttribute(`is`))return e.__oct_frag=!0,e;let t=(R?.view(document)??document).createDocumentFragment(),n;for(;(n=B(e))!==null;)(R?.view(t)??t).appendChild(n);return t.__oct_frag=!0,t}function hu(e,t,n){fu();let r=(R?.view(document)??document).createElement(`template`);if(t===0){(R?.view(r)??r).innerHTML=n?`<octane-frag>${e}</octane-frag>`:e;let t=B(r.content);return t.nodeType===1&&t.localName===`octane-frag`?mu(t):t}let i=t===1?`svg`:`math`;(R?.view(r)??r).innerHTML=`<${i}>${e}</${i}>`;let a=B(r.content);return n?mu(a):B(a)}function gu(e,t=0,n=0){return{[pu]:{html:e,ns:t===1?1:t===2?2:t===3?3:0,frag:n,parsed:[null,null,null],root:0}}}function _u(e){let t;if(e.ns===3){let e=O===null?void 0:Vd(O.block.parentNode);t=e===Id?1:e===Ld?2:0}else t=e.ns;let n=e.parsed[t];return n===null&&(n=hu(e.html,t,e.frag),e.parsed[t]=n),n}var vu=null;function H(){let e=vu;return e!==null&&e.isActive()?e:null}function yu(e){return e.nodeType===1&&e.localName===`style`&&(R?.view(e)??e).hasAttribute(`data-octane`)}var bu=null;function xu(e,t,n){if(bu!==null&&bu.node!==null){let t=bu.node;bu.node=null;let n=e.nodeType===void 0?(R?.view(e)??e)[pu]:void 0,r=n===void 0?e:_u(n);if(t.localName===r.localName&&t.namespaceURI===r.namespaceURI){for(let e=B(t);e!==null;e=V(e))U(e,null);(R?.view(t)??t).replaceChildren();for(let e=B(r);e!==null;e=V(e))(R?.view(t)??t).appendChild((R?.view(e)??e).cloneNode(!0));return t}let i=(R?.view(r)??r).cloneNode(!0),a=O.block;return U(t,null),z((R?.view(t)??t).parentNode).replaceChild(i,t),a.startMarker===t&&(a.startMarker=i),a.endMarker===t&&(a.endMarker=i),a.deoptNode=null,i}let r=e.nodeType===void 0?(R?.view(e)??e)[pu]:void 0;if(r!==void 0){let e=H();if(e!==null)return e.cloneLazy(r,t);let i=_u(r);return e===null?(R?.view(i)??i).cloneNode(!0):e.clone(i,t,n)}let i=H();return i===null?(R?.view(e)??e).cloneNode(!0):i.clone(e,t,n)}function Su(e,t,n){if(H()!==null&&e.__oct_vfrag===!0)return;if(Du?.revision!==void 0&&ju(!1),e.nodeType===11){(R?.view(t)??t).insertBefore(e,n);return}let r;for(;(r=B(e))!==null;)(R?.view(t)??t).insertBefore(r,n)}function Cu(e,t,n){if(t!==null){let n=e.block,r=H();if(r===null||r.isFresh(t)||(R?.view(t)??t).parentNode!==n.parentNode){let e=n.parentNode;(R?.view(e)??e).insertBefore(t,n.endMarker)}}return e.slots[0]=n,n}function wu(e,t,n,r,i){return Cu(e,t,{a:n,b:r,c:i,__journalWindow:0,[fa]:3})}function Tu(e,t,n,r,i,a,o,s,c,l){return Cu(e,t,{a:n,b:r,c:i,d:a,e:o,f:s,g:c,h:l,__journalWindow:0,[fa]:8})}function Eu(e){return e==null||e===!1?``:typeof e==`string`?e:String(e)}var Du=null,Ou=new WeakMap,ku=class extends Error{constructor(e,t,n=Du?.revision){super(E(75)),this.lease=e,this.retry=t,this.revision=n}lease;retry;revision};function Au(e){return e instanceof be||e instanceof ku}function ju(e=!0){throw new ku(Du?.lease,e)}function Mu(e){return e.presentations?.every(e=>e.current(e))!==!1}function Nu(e){let t=new Set;for(let n of e.presentations??[])Ou.delete(n.lease),n.hydration?.retryPresentation&&t.add(n.hydration.retryPresentation);for(let e of t)e()}var Pu=Symbol.for(`octane.binding.children-site`);function Fu(e,t,n,r){let i=t===null?void 0:e.lease.ranges?.().get(t);return(e.lease.revision?.()!==e.revision||t?.nodeType!==8||t.data!==n||i?.kind!==r||i.end.parentNode!==t.parentNode||H()?.close(t)!==i.end)&&ju(),i}function Iu(e,t){let n=t?`[`:`]`;if(e===n||t&&(e===`[f0`||e===`[f1`)||t&&(e.startsWith(b)||e.startsWith(`[f`))&&ne(e))return 1;if(e.length<2||e.charCodeAt(0)!==n.charCodeAt(0))return 0;let r=e.charCodeAt(1);if(r<49||r>57)return 0;let i=r-48;for(let t=2;t<e.length;t++){let n=e.charCodeAt(t)-48;if(n<0||n>9||(i=i*10+n,!Number.isSafeInteger(i)))return 0}return i>=2?i:0}function Lu(e){if(e===null||e.nodeType!==8)return!1;let t=(R?.view(e)??e).data;return t===`]`||Iu(t,!1)>1}function Ru(e){return vu===null?B(e):(R?.view(e)??e).firstChild}function zu(e,t=1){let n=H();if(n!==null)return n.sibling(e,t);let r=e;for(let e=0;e<t;e++){if(r===null)return null;r=V(r)}return r}var Bu=null,Vu=null;function Hu(e,t){if(Bu!==null&&Bu(e,t))return;let n=(R?.view(e)??e).nodeValue;n!==t&&(j!==null&&Ya(e,n),(R?.view(e)??e).nodeValue=t)}function Uu(e,t){eo?.markDirty(),j!==null&&Ya(e,(R?.view(e)??e).nodeValue);let n=Eu(t);Bu!==null&&Bu(e,n)||((R?.view(e)??e).nodeValue=n)}function Wu(e){return(typeof e==`object`||typeof e==`function`)&&e!==null&&e[an]===!0}function Gu(e){return e[on]()}function Ku(e,t){return Object.assign(t,{[_e]:{active:()=>!e.disposed&&!e.scope.block.disposed,prepare:()=>Er(e.scope.block)}})}function qu(e){return Wu(e)&&e.kind===`signal`&&typeof e.set==`function`}function Ju(e,t){let n=(R?.view(e)??e).getAttribute(v);if(n===null&&H()===null){(R?.view(e)??e).setAttribute(v,t);return}if(n!==t)throw Error(E(67,t))}function Yu(e,t,n){let r=d(e);return t!==r&&Gd(n,r),r}function Xu(e,t){let n=t==null?``:String(t),r=B(e);r!==null&&r===(R?.view(e)??e).lastChild&&r.nodeType===3?Hu(r,n):(M!==null&&(ja(),Zi(e,null,null)),(R?.view(e)??e).textContent=n)}var Zu=/(<\\/|<)(s)(cript)/gi;function Qu(e){return e.replace(Zu,(e,t,n,r)=>`${t}${n===`s`?`\\\\u0073`:`\\\\u0053`}${r}`)}var $u=/\\r\\n?|\\u0000/g;function ed(e){return e.replace($u,e=>e===`\\0`?`�`:`\n`)}function td(e,t){let n=e.ownerDocument,r=e.namespaceURI,i=r===`http://www.w3.org/2000/svg`||r===`http://www.w3.org/1998/Math/MathML`?(R?.view(n)??n).createElementNS(r,e.tagName):(R?.view(n)??n).createElement(e.tagName);return(R?.view(i)??i).innerHTML=t,(R?.view(i)??i).innerHTML}function nd(e,t){let n=t==null?``:String(t),r=H();if(r!==null&&!r.isFresh(e)){if((e.localName===`script`?(R?.view(e)??e).textContent??``:(R?.view(e)??e).innerHTML)===(e.localName===`script`?ed(Qu(n)):td(e,n))){if(e.localName!==`script`){let t=R?.view(e)??e;N(e,rd,t[rd]),t[rd]=n}return}if(Kn(e))return;e.__oct_loc;return}if(e.localName===`script`){Xu(e,n);return}let i=R?.view(e)??e;if(i[rd]!==n){if(N(e,rd,i[rd]),M!==null&&!Wi){ja(),Zi(e,null,null),na(e,B(e),(R?.view(e)??e).lastChild);let t=(R?.view(e)??e).cloneNode(!1);for((R?.view(t)??t).innerHTML=n;B(t)!==null;)(R?.view(e)??e).appendChild(B(t))}else(R?.view(e)??e).innerHTML=n;i[rd]=n}}var rd=Symbol(`octane.dangerHTMLValue`),id=`__oct_dangerHTML`,ad=!1,od=`__oct_dangerChild`,sd=`__oct_dangerSpreadChild`,cd=`__oct_dangerResolved`,ld=`__oct_dangerResolvedChild`;function ud(){return Error(E(5))}function dd(e){if(e!=null&&(typeof e!=`object`||!(`__html`in e)))throw Error(E(6))}function fd(e,t){dd(t),N(e,id,(R?.view(e)??e)[id]);let n=(R?.view(e)??e)[id]===!0;if(t==null){if((R?.view(e)??e)[id]=!1,n){nd(e,null);let t=R?.view(e)??e;t[rd]!==void 0&&(N(e,rd,t[rd]),t[rd]=void 0)}return}if(t!=null&&Be.has(e.localName))throw Error(E(7,e.localName));if(t!=null&&((R?.view(e)??e)[od]===!0||(R?.view(e)??e)[sd]!=null))throw ud();(R?.view(e)??e)[id]=!0,ad=!0,nd(e,t.__html)}function pd(e,t,n=!1){let r=!1,i=null,a=!1,o=null;for(let e of t){let[t,s]=e;if(!t){e.length===2?(r=!0,i=s):s===`dangerouslySetInnerHTML`?(r=!0,i=e[2]):!n&&s===`children`&&(a=!0,o=e[2]);continue}if(!(s==null||typeof s!=`object`&&typeof s!=`function`))for(let e of Object.keys(Object(s)))e===`dangerouslySetInnerHTML`?(r=!0,i=s[e]):!n&&e===`children`&&(a=!0,o=s[e])}let s=r&&i!=null?i:null,c=a?o:null;if(Be.has(e.localName)&&(s!==null||c!=null))throw Error(E(8,e.localName));if(s!==null&&c!=null)throw ud();dd(s),!(Ze.call(e,cd)&&Object.is((R?.view(e)??e)[cd],s)&&Object.is((R?.view(e)??e)[ld],c))&&(N(e,sd,(R?.view(e)??e)[sd]),N(e,cd,(R?.view(e)??e)[cd]),N(e,ld,(R?.view(e)??e)[ld]),(R?.view(e)??e)[sd]=c,fd(e,s),(R?.view(e)??e)[cd]=s,(R?.view(e)??e)[ld]=c)}function md(e,t){if(!ad||e.nodeType!==1||(R?.view(e)??e)[id]!==!0)return!1;if(t!=null)throw ud();return!0}var hd=new WeakMap,gd=new WeakMap,_d=null,vd=null,yd=null;function bd(e,t,n){if(e==null)return;let r=t??n,i=r==null?void 0:_d?.get(r);if(i!==void 0){if(t!==null)i.hidden=!1,i.connected=e;else if(n!=null){if(i.hidden&&i.connected!==e)return;i.connected===e&&(i.connected=null)}}xd(e,t,n)}function xd(e,t,n){if(e!=null){if(typeof e==`function`){if(t===null){let t=hd.get(e),r=n??gd.get(e),i=t!==void 0&&r!=null?t.get(r):void 0;i===void 0?e(null):(t.delete(r),gd.get(e)===r&&gd.delete(e),i())}else{let n=e(t);if(typeof n==`function`){let r=hd.get(e);r===void 0&&hd.set(e,r=new WeakMap),r.set(t,n),gd.set(e,t)}}return}if(Array.isArray(e)){for(let r=0;r<e.length;r++)xd(e[r],t,n);return}e.current=t}}var Sd=Pt,Cd=null,wd=class{_ownerBlock;_startMarker;_endMarker;_destroyed;_children;_pendingChildren;_portalAnchors;_listeners;_observers;_currentRef;constructor(e,t,n){this._ownerBlock=e,this._startMarker=t,this._endMarker=n,this._destroyed=!1,this._children=new Set,this._pendingChildren=new Set,this._portalAnchors=null,this._listeners=null,this._observers=null,this._currentRef=null;for(let e of Ed(this))this._children.add(e),this._attachChild(e);vo.add(this)}_destroy(){this._destroyed=!0,vo.delete(this);for(let e of this._children)this._detachChild(e);this._children.clear(),this._pendingChildren.clear(),this._portalAnchors?.clear(),this._portalAnchors=null,this._listeners=null,this._observers=null}_registerPortal(e,t){if(this._destroyed)return;let n=this._portalAnchors??=new Map,r=n.get(t);r===void 0&&n.set(t,r=new Set),r.add(e)}_unregisterPortal(e,t){let n=this._portalAnchors,r=n?.get(t);if(r===void 0||!r.delete(e))return;r.size===0&&n.delete(t),n.size===0&&(this._portalAnchors=null);let i=z(e.start)?.nextSibling??null;for(;i!==null&&i!==e.end;){let e=V(i);(i.nodeType===1||i.nodeType===3)&&this._children.delete(i)&&this._detachChild(i),i=e}}_attachChild(e){if(this._listeners!==null)for(let t of this._listeners)(R?.view(e)??e).addEventListener(t.type,t.listener,t.options);if(e.nodeType===1&&this._observers!==null)for(let t of this._observers)t.observe(e);let t=e;(t.reactFragments??=new Set).add(this)}_detachChild(e){if(this._listeners!==null)for(let t of this._listeners)(R?.view(e)??e).removeEventListener(t.type,t.listener,t.options);e.reactFragments?.delete(this)}_reapply(){if(this._destroyed)return;let e=this._children,t=this._pendingChildren;for(let n of Ed(this))t.add(n),e.has(n)||this._attachChild(n);for(let n of e)t.has(n)||this._detachChild(n);e.clear(),this._children=t,this._pendingChildren=e}focus(e){if(!this._destroyed){for(let t of Od(this))if(kd(t,e))return}}focusLast(e){if(this._destroyed)return;let t=Array.from(Od(this));for(let n=t.length-1;n>=0;n--)if(kd(t[n],e))return}blur(){if(this._destroyed)return;let e=this._startMarker.ownerDocument||document,t=e.activeElement;if(t&&t!==e.body){for(let e of Dd(this))if(e===t||(R?.view(e)??e).contains(t)){(R?.view(t)??t).blur();return}}}addEventListener(e,t,n){if(this._destroyed)return;let r=Td(n);this._listeners||=[];for(let n of this._listeners)if(n.type===e&&n.listener===t&&Td(n.options)===r)return;this._listeners.push({type:e,listener:t,options:n});for(let r of Ed(this))(R?.view(r)??r).addEventListener(e,t,n)}removeEventListener(e,t,n){if(this._destroyed||!this._listeners)return;let r=Td(n);for(let n=this._listeners.length-1;n>=0;n--){let i=this._listeners[n];if(i.type===e&&i.listener===t&&Td(i.options)===r){for(let n of Ed(this))(R?.view(n)??n).removeEventListener(e,t,i.options);this._listeners.splice(n,1);return}}}observeUsing(e){if(!this._destroyed){this._observers||=new Set,this._observers.add(e);for(let t of Dd(this))e.observe(t)}}unobserveUsing(e){if(!this._destroyed&&this._observers!==null&&this._observers.has(e)){this._observers.delete(e);for(let t of Dd(this))e.unobserve(t)}}getClientRects(){let e=[];if(this._destroyed)return e;for(let t of Ed(this))if(t.nodeType===3){let n=t.ownerDocument.createRange();if(n.selectNodeContents(t),typeof n.getClientRects!=`function`)continue;let r=n.getClientRects();for(let t=0;t<r.length;t++)e.push(r[t])}else{let n=t.getClientRects();for(let t=0;t<n.length;t++)e.push(n[t])}return e}getRootNode(e){if(this._destroyed)return this;let t=z(this._startMarker).parentNode;return t===null?this:(R?.view(t)??t).getRootNode(e)}compareDocumentPosition(e){if(this._destroyed)return Node.DOCUMENT_POSITION_DISCONNECTED;let t=z(this._startMarker).parentNode;if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;let n=null,r=null;for(let i of Ed(this))if(n??=i,r=i,i===e||i.nodeType===1&&(R?.view(i)??i).contains(e))return(R?.view(t)??t).contains(i)?Node.DOCUMENT_POSITION_CONTAINED_BY:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;if(n===null||r===null){let n=this._startMarker.$$portalParent??t,r=(R?.view(n)??n).compareDocumentPosition(e);if(n===e)r=Node.DOCUMENT_POSITION_CONTAINS;else if((r&Node.DOCUMENT_POSITION_CONTAINED_BY)!==0){let t=Ad(this._endMarker,!0);r=t!==null&&(t===e||((R?.view(t)??t).compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)!==0)?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING}return r|Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}let i=(R?.view(n)??n).compareDocumentPosition(e);if((i&Node.DOCUMENT_POSITION_DISCONNECTED)!==0)return i;let a=(R?.view(r)??r).compareDocumentPosition(e);if((R?.view(t)??t).contains(n)&&(R?.view(t)??t).contains(r)&&(i&Node.DOCUMENT_POSITION_FOLLOWING)!==0&&(a&Node.DOCUMENT_POSITION_PRECEDING)!==0)return Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;let o=this._startMarker,s=o.$$portalParent;if(s!==void 0&&s!==t&&(R?.view(s)??s).contains(e)){let t=o.$$portalSourceAnchor;if(t===void 0)return Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;let n=Node.DOCUMENT_POSITION_PRECEDING|Node.DOCUMENT_POSITION_FOLLOWING,r=(R?.view(t)??t).compareDocumentPosition(e)&n;if((i&n)!==r)return Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}return i}dispatchEvent(e){if(this._destroyed)return!0;let t=z(this._startMarker).parentNode;if(!t)return!0;let n=this._listeners;if(e.bubbles&&(n===null||n.length===0))return t.dispatchEvent(e);let r=z(t.ownerDocument||document).createTextNode(``);if(n!==null)for(let e of n)(R?.view(r)??r).addEventListener(e.type,e.listener,e.options);(R?.view(t)??t).appendChild(r);try{return r.dispatchEvent(e)}finally{if(n!==null)for(let e of n)(R?.view(r)??r).removeEventListener(e.type,e.listener,e.options);(R?.view(r)??r).parentNode===t&&(R?.view(t)??t).removeChild(r)}}scrollIntoView(e){if(typeof e==`object`)throw Error(E(49));if(this._destroyed)return;let t=e!==!1,n=Array.from(Ed(this));if(n.length===0){let n=Ad(this._endMarker,!0),r=Ad(this._startMarker,!1),i=t?n||r||z(this._startMarker).parentNode:r||n;if(i==null||i.nodeType===9)return;if(i.nodeType===11){let t=i.host;t&&t.scrollIntoView(e);return}i.nodeType===3?jd(i,t):i.scrollIntoView(e);return}for(let r=t?n.length-1:0;t?r>=0:r<n.length;r+=t?-1:1){let i=n[r];i.nodeType===3?jd(i,t):i.scrollIntoView(e)}}};function Td(e){return e==null?!1:typeof e==`boolean`?e:!!e.capture}function*Ed(e){let t=e._portalAnchors,n=V(e._startMarker);for(;n!==null;){let r=V(n),i=t===null?void 0:t.get(n);if(i!==void 0){if(i.size===0){let e=n.$$portalEnd;if(e!==void 0){n=hg(n,e);continue}}for(let e of i){if(e.block===null||s_(e.block)!==null)continue;let t=z(e.start)?.nextSibling??null;for(;t!==null&&t!==e.end;){let e=V(t);(t.nodeType===1||t.nodeType===3)&&i_(t)&&(yield t),t=e}}}if(n===e._endMarker)return;(n.nodeType===1||n.nodeType===3)&&i_(n)&&(yield n),n=r}}function*Dd(e){for(let t of Ed(e))t.nodeType===1&&(yield t)}function*Od(e){for(let t of Dd(e)){yield t;let e=(t.ownerDocument||document).createTreeWalker(t,1),n=e.nextNode();for(;n;)yield n,n=e.nextNode()}}function kd(e,t){let n=e,r=n.ownerDocument;if(r.activeElement===n)return!0;let i=!1,a=()=>{i=!0};(R?.view(r)??r).addEventListener(`focus`,a,!0);try{((R?.view(n)??n).focus||HTMLElement.prototype.focus).call(n,t)}finally{(R?.view(r)??r).removeEventListener(`focus`,a,!0)}return i}function Ad(e,t){let n=t?V(e):(R?.view(e)??e).previousSibling;for(;n!==null;){if(n.nodeType===1||n.nodeType===3)return n;n=t?V(n):(R?.view(n)??n).previousSibling}return null}function jd(e,t){let n=e.ownerDocument.createRange();if(n.selectNodeContents(e),typeof n.getBoundingClientRect!=`function`)return;let r=n.getBoundingClientRect(),i=e.ownerDocument.defaultView||window,a=t?i.scrollY+r.top:i.scrollY+r.bottom-i.innerHeight;i.scrollTo(i.scrollX+r.left,a)}function Md(e,t,n,r){let i=new wd(e.block,t,n);return i._currentRef=r,ts(e,po,i),(e.cleanups??=[]).push(()=>{rs(i._currentRef,i),i._destroy()}),i}var Nd=`http://www.w3.org/1999/xlink`,Pd=`http://www.w3.org/XML/1998/namespace`,Fd=`http://www.w3.org/2000/xmlns/`,Id=`http://www.w3.org/2000/svg`,Ld=`http://www.w3.org/1998/Math/MathML`,Rd=`http://www.w3.org/1999/xhtml`;function zd(e){return e.namespaceURI===Rd&&e.localName.indexOf(`-`)!==-1}function Bd(e,t){return e===`svg`?Id:e===`math`?Ld:t===void 0&&We.has(e)?Id:t}function Vd(e){if(e.nodeType!==1)return;let t=e;if(t.namespaceURI===Id)return t.localName===`foreignObject`?void 0:Id;if(t.namespaceURI===Ld)return Ld}function Hd(e){if(e===`xmlns`)return Fd;let t=e.indexOf(`:`);if(t<=0)return null;let n=e.slice(0,t);return n===`xlink`?Nd:n===`xml`?Pd:n===`xmlns`?Fd:null}function Ud(e,t,n){if(t===`innerText`||t===`textContent`)return;if(t===`dangerouslySetInnerHTML`){fd(e,n);return}if(t===`suppressContentEditableWarning`||t===`suppressNativeChangeWarning`||t===`__octaneNativeChangeDiagnostic`)return;switch(t.length){case 5:if(t===`value`){let t=e.localName;if(t===`input`||t===`textarea`)return Cm(e,n);if(t===`select`)return Dm(e,n)}else if(t===`muted`&&!zd(e)){(R?.view(e)??e).muted=n&&typeof n!=`function`&&typeof n!=`symbol`;return}break;case 7:if(t===`checked`&&e.localName===`input`)return Em(e,n);break;case 8:if((t===`multiple`||t===`selected`)&&!zd(e)){if(t===`selected`){let t=H();if(t!==null&&!t.isFresh(e))return}(R?.view(e)??e)[t]=n&&typeof n!=`function`&&typeof n!=`symbol`;return}break;case 9:if(t===`autoFocus`&&!zd(e))return mm(e,n);break;case 12:if(t===`defaultValue`){let t=e.localName;if(t===`input`||t===`textarea`||t===`select`)return km(e,n)}break;case 14:if(t===`defaultChecked`&&e.localName===`input`)return Mm(e,n)}if(t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&zd(e)&&(typeof n==`function`||e.$$ceListeners?.[t]!==void 0)){let r=t.endsWith(`Capture`),i=r?t.slice(2,-7):t.slice(2),a=e.$$ceListeners??={},o=a[t];if(o!==void 0&&o!==n&&(R?.view(e)??e).removeEventListener(i,o,r),typeof n==`function`){o!==n&&(R?.view(e)??e).addEventListener(i,n,r),a[t]=n,(R?.view(e)??e).removeAttribute(t);return}delete a[t]}if(!zd(e)){let e=Ge.get(t);e!==void 0&&(t=e)}let r=Wd(e,t,n);r!==null&&(r=_(e.localName,t,r));let i=H();if(i!==null&&!i.allowAttribute(e,t,r))return;let a=Hd(t);if(j!==null&&Xa(e,t),r===null){if(a){let n=t.indexOf(`:`);(R?.view(e)??e).removeAttributeNS(a,n>=0?t.slice(n+1):t)}else(R?.view(e)??e).removeAttribute(t);return}Ue.test(t)&&(a?(R?.view(e)??e).setAttributeNS(a,t,r):(R?.view(e)??e).setAttribute(t,r))}function Wd(e,t,n){if(t.charCodeAt(0)===97&&t.startsWith(`aria-`))return n==null||typeof n==`function`||typeof n==`symbol`?null:String(n);let r=typeof n;if(r===`boolean`&&Ke(t)||r===`boolean`&&t.startsWith(`data-`))return n?`true`:`false`;if(r===`function`||r===`symbol`)return null;if(!zd(e)){let e=t.toLowerCase();if(Ve.has(e)||r===`boolean`&&(e===`download`||e===`capture`))return n?``:null;if(r===`boolean`||He.has(e)&&!(Number(n)>=1)||(e===`rowspan`||e===`start`)&&Number.isNaN(Number(n))||t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110)return null}if(n==null||n===!1)return null;let i;return i=n===!0?``:String(n),i===``&&(t===`src`||t===`href`&&e.nodeName!==`A`&&e.nodeName!==`AREA`||t===`data`&&e.nodeName===`OBJECT`)?null:i}function Gd(e,t){let n=d(t),r=H();if(r!==null){r.queueClass(e,n,!0,!1,t==null||t===!1);return}j!==null&&Xa(e,`class`),t==null||t===!1?(R?.view(e)??e).removeAttribute(`class`):(R?.view(e)??e).className=n}function Kd(e,t){let n=t==null||t===!1?null:d(t),r=H();if(r!==null){r.queueClass(e,n,!1,!0,n===null);return}j!==null&&Xa(e,`class`),n===null?(R?.view(e)??e).removeAttribute(`class`):(R?.view(e)??e).setAttribute(`class`,n)}function qd(e,t){e.namespaceURI===Id?Kd(e,t):Gd(e,t)}var Jd=`!important`;function Yd(e,t,n){let r=(R?.view(e)??e).style,i=H();i!==null&&i.applyStyle(e,t,n)||(j!==null&&Xa(e,`style`),!(Vu!==null&&Vu(e,t,n))&&Xd(e,r,t,n))}function Xd(e,t,n,r){if(n==null||n===!1||n===``){if(r&&typeof r==`object`)for(let e in r)t.removeProperty(un(e));else typeof r==`string`&&(t.cssText=``);return}if(typeof n==`string`){r!==n&&(t.cssText=n);return}if(r&&typeof r==`object`){for(let e in r)e in n||t.removeProperty(un(e));for(let i in n){let a=n[i];a!==r[i]&&(a==null||typeof a==`boolean`?t.removeProperty(un(i)):Zd(e,t,i,a))}}else{typeof r==`string`&&(t.cssText=``);for(let r in n){let i=n[r];i!=null&&typeof i!=`boolean`&&Zd(e,t,r,i)}}}function Zd(e,t,n,r){let i=un(n),a;a=qe(n,r);let o=a.trimEnd();o.endsWith(Jd)?t.setProperty(i,o.slice(0,o.length-10).trimEnd(),`important`):t.setProperty(i,a)}function Qd(e){let t=e.charCodeAt(2);return e.length>2&&e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&t>=65&&t<=90}var $d=`$$capture:`;function ef(e){return e===`DoubleClick`?`dblclick`:e===`Focus`?`focusin`:e===`Blur`?`focusout`:e.toLowerCase()}var tf;function nf(e,t){if(!Qd(e)||t!==void 0&&zd(t)&&!Xe(e))return null;let n=tf?.get(e);if(n!==void 0)return n;let r=e.slice(2),i=!1;r.length>7&&r.endsWith(`Capture`)&&e!==`onGotPointerCapture`&&e!==`onLostPointerCapture`&&(i=!0,r=r.slice(0,r.length-7));let a=ef(r),o={type:a,key:i?$d+a:`$$`+a,capture:i};return Xe(e)&&(tf??=new Map).set(e,o),o}function rf(e,t,n){if(t===`class`||t===`className`)j!==null&&Xa(e,`class`),(R?.view(e)??e).removeAttribute(`class`);else if(t===`style`)Yd(e,null,n);else if(t===`dangerouslySetInnerHTML`)fd(e,null);else if(t===`suppressHydrationWarning`)e.__oct_suppress=!1;else if(t!==`suppressNativeChangeWarning`&&t!==`__octaneNativeChangeDiagnostic`){let r=of(e,t);if(r!==null){tm(e,r,null,n);return}let i=nf(t,e);i?jf(e,i.key,null):Ud(e,t,null)}}function af(e){if(e==null)return null;let t=Object(e),n=Object.create(null);for(let e of Reflect.ownKeys(t)){if(!Object.prototype.propertyIsEnumerable.call(t,e))continue;let r=t[e];typeof e==`string`&&(n[e]=r)}return n}function of(e,t){return t===`action`&&e.localName===`form`?`action`:(t===`formAction`||t===`formaction`)&&(e.localName===`button`||e.localName===`input`)?`formaction`:null}function sf(e){return e===`ref`||e===`children`||e===`dangerouslySetInnerHTML`||e===`suppressHydrationWarning`||e===`suppressContentEditableWarning`||e===`suppressNativeChangeWarning`||e===`__octaneNativeChangeDiagnostic`||e===`autoFocus`||e===`value`||e===`defaultValue`||e===`checked`||e===`defaultChecked`||e===`multiple`||Qd(e)}function cf(e,t){if(t===`class`||t===`className`)return`class`;let n=of(e,t);return n===null?zd(e)?t:Ge.get(t)??t:n}function lf(e,t,n,r){let i=null,a=0;function o(e,t){if(typeof e!=`string`)return;let r=a++,i=n.get(e);i===void 0?n.set(e,{name:e,value:t,firstOrder:r,lastOrder:r}):(i.value=t,i.lastOrder=r)}for(let e of t){if(!e[0]){let t=e[1];if(e[3]===!0&&typeof t==`string`&&(t===`class`||t===`className`)){(i??=[]).push({rawName:t,value:e[2],order:a++});continue}o(t,e[2]);continue}let t=e[1];if(!(t==null||typeof t!=`object`&&typeof t!=`function`))for(let e of Object.keys(Object(t)))o(e,t[e])}let s=new Map,c=e.namespaceURI===`http://www.w3.org/1999/xhtml`,l=!1;for(let t of n.values()){let n=t.name;if(n===`key`)continue;let r=sf(n),i=r?n:cf(e,n),a=c&&!r?i.toLowerCase():i,o=s.get(a);if(o!==void 0){if(o.lastOrder>=t.lastOrder)continue;l=!0}t.name=i,s.set(a,t)}if(i!==null)for(let e of i){let t=s.get(`class`);t===void 0?s.set(`class`,{name:`class`,value:e.value,firstOrder:e.order,lastOrder:e.order}):(t.value=cn(t.value,e.value),t.lastOrder=e.order)}let u=Object.create(null),d=l?[...s.values()].sort((e,t)=>e.firstOrder-t.firstOrder):s.values();for(let{name:e,value:t}of d)u[e]=t;return r!==void 0&&`style`in u&&(u.style=r(u.style)),u}function uf(e,t,n,r,i=!1,a,o=!1){let s=new Map,c=lf(e,t,s,a),l=e.localName,u=l===`input`||l===`textarea`||l===`select`;return Tf(e,c,n,r,!0,u),pd(e,t,i),u&&!o&&Nm(e,l,s.get(`value`)?.value,s.get(`defaultValue`)?.value,s.get(`checked`)?.value,s.get(`defaultChecked`)?.value,s.get(`multiple`)?.value),c}var df=Symbol(`octane.signal-host-prop-sources`);function ff(e,t,n){if(Wu(e))return t.add(e),n(e);if(typeof e!=`object`||!e||Array.isArray(e))return e;let r;for(let i of Object.keys(e)){let a=e[i];Wu(a)&&(t.add(a),r??={...e},r[i]=n(a))}return r??e}function pf(e,t,n=Gu){let r=new Set,i;for(let a=0;a<e.length;a++){let o=e[a];if(!o[0]){let s=o[1]===`children`||o[1]===`style`&&t!==void 0?o[2]:o[1]===`style`?ff(o[2],r,n):Wu(o[2])?(r.add(o[2]),n(o[2])):o[2];s!==o[2]&&(i??=e.slice(),i[a]=[!1,o[1],s,o[3]]);continue}let s=o[1];if(typeof s!=`object`||!s)continue;let c;for(let e of Object.keys(s)){let i=s[e],a=e===`children`||e===`style`&&t!==void 0?i:e===`style`?ff(i,r,n):Wu(i)?(r.add(i),n(i)):i;a!==i&&(c??={...s},c[e]=a)}c!==void 0&&(i??=e.slice(),i[a]=[!0,c])}return{sources:i??e,handles:r}}function mf(e,t){let n;for(let r of e){if(!r[0]){r[1]===t&&(n=r[2]);continue}let e=r[1];typeof e==`object`&&e&&Object.prototype.propertyIsEnumerable.call(e,t)&&(n=e[t])}return Wu(n)?n:null}function hf(e){if(!(e.disposed||e.pendingControl||e.scope.block.disposed))try{Rn(e.scope,()=>{let t=pf(e.sources,e.readStyle);e.resolved=uf(e.element,t.sources,e.resolved,e.scope,e.hasNestedChildren,e.readStyle)})}catch{Do(e.scope.block)}}function gf(e,t){let n=t[sn](Ku(e,()=>hf(e)));return e.subscriptions.set(t,n),n}function _f(e,t){for(let[n,r]of e.subscriptions)t.has(n)||(r(),e.subscriptions.delete(n),j!==null&&Yi(()=>{e.disposed||e.scope.block.disposed||Rn(e.scope,()=>gf(e,n))}));for(let n of t){if(e.subscriptions.has(n))continue;let t=gf(e,n);j!==null&&Yi(()=>{t(),e.subscriptions.delete(n)})}}function vf(e,t){let n=pt(e.element,t,n=>{Wt(()=>Rn(e.scope,()=>{let r=mf(e.sources,t);!e.disposed&&!e.pendingControl&&qu(r)&&r.set(n)}))});return e.controlWriters.set(t,n),n}function yf(e){let t=e.element,n=mf(e.sources,`value`),r=mf(e.sources,`checked`),i=qu(n)||qu(r);for(let[t,i]of e.controlWriters)t===`value`&&qu(n)||t===`checked`&&qu(r)||(i(),e.controlWriters.delete(t),j!==null&&Yi(()=>{!e.disposed&&!e.scope.block.disposed&&vf(e,t)}));if(qu(n)&&!e.controlWriters.has(`value`)){let t=vf(e,`value`);j!==null&&Yi(()=>{t(),e.controlWriters.delete(`value`)})}if(qu(r)&&!e.controlWriters.has(`checked`)){let t=vf(e,`checked`);j!==null&&Yi(()=>{t(),e.controlWriters.delete(`checked`)})}if(!i){if(e.input!==void 0){let n=e.input;(R?.view(t)??t).removeEventListener(`input`,n),j!==null&&Yi(()=>{!e.disposed&&!e.scope.block.disposed&&(R?.view(t)??t).addEventListener(`input`,n)}),e.input=void 0}return}if(Ju(t,e.site),e.input!==void 0)return;let a=()=>{if(e.disposed||e.pendingControl)return;let n=Et(t);n!==null&&Wt(()=>Rn(e.scope,()=>{let t=mf(e.sources,`value`),r=mf(e.sources,`checked`);qu(r)&&n.checked!==void 0&&r.set(n.checked),qu(t)&&t.set(n.selectedValues??n.value)}))};e.input=a,(R?.view(t)??t).addEventListener(`input`,a),j!==null&&Yi(()=>(R?.view(t)??t).removeEventListener(`input`,a))}function bf(e){if(!e.disposed&&F?.stageAction(()=>bf(e))!==!0){e.disposed=!0;for(let t of e.subscriptions.values())t();Dr(e.scope.block),e.subscriptions.clear();for(let t of e.controlWriters.values())t();e.controlWriters.clear(),e.input!==void 0&&z(e.element).removeEventListener(`input`,e.input),is(e.resolved,e.element)}}function xf(e,t){nc(()=>{e.disposed||e.scope.block.disposed||!e.pendingControl||Wt(()=>Rn(e.scope,()=>{let n=Et(e.element),r=mf(e.sources,`value`);if(n.editRevision>0||e.element.localName===`textarea`&&qu(r)&&Object.is(Gu(r),t)){let t=mf(e.sources,`checked`);qu(t)&&n.checked!==void 0&&t.set(n.checked),qu(r)&&r.set(n.selectedValues??n.value)}if(!(e.disposed||e.scope.block.disposed)){if(!Ot(e.element,n.revision)){xf(e,t);return}e.pendingControl=!1,hf(e)}}))})}function Sf(e,t,n,r,i,a){let o={[df]:!0,scope:e,element:t,site:r,hasNestedChildren:i,readStyle:a,sources:n,resolved:void 0,subscriptions:new Map,controlWriters:new Map,disposed:!1};return fn(e,()=>bf(o)),o}function Cf(e,t,n,r,i,a=!1,o){let s=typeof t==`object`&&t&&t[df]===!0?t:void 0;s===void 0?s=Sf(e,n,r,i,a,o):gs===null&&(j!==null&&Ma(s),s.sources=r);let c=s;if(gs!==null){let e=gs.signalHosts??=new Map;s=e.get(c),s===void 0?(s={...c},e.set(c,s),vs()&&Yi(()=>e.delete(c))):j!==null&&Ma(s),s.sources=r}let l=mf(r,`value`);l!==null&&e.block.idState.renderOwner?.controlLeases?.has(n)&&ju(!1);let u=mf(r,`checked`),d=qu(l)||qu(u)?Et(n):null;d!==null&&(Ju(n,i),s.pendingControl||=H()!==null&&(d.editRevision>0||qu(l)&&Dt(n,Gu(l))));let f=pf(r,o);return s.resolved=uf(n,f.sources,s.resolved,e,a,o,s.pendingControl),gs===null?(_f(s,f.handles),yf(s),!s.pendingControl&&d!==null&&Ot(n,d.revision)):F.stageAction(()=>{c.disposed||(c.sources=s.sources,c.resolved=s.resolved,c.pendingControl=s.pendingControl,Rn(e,()=>{_f(c,f.handles),yf(c)}),!c.pendingControl&&d!==null&&Ot(n,d.revision),hf(c))}),s.pendingControl&&xf(c,s.resolved?.value),c}function wf(e,t){switch(e.localName){case`input`:return t===`value`||t===`defaultValue`||t===`checked`||t===`defaultChecked`;case`textarea`:return t===`value`||t===`defaultValue`;case`select`:return t===`value`||t===`defaultValue`||t===`multiple`}return!1}function Tf(e,t,n,r,i=!1,a=!1){if(t!=null&&Object.prototype.propertyIsEnumerable.call(Object(t),`suppressHydrationWarning`)&&(e.__oct_suppress=t.suppressHydrationWarning===!0),!i){if(t!=null&&Object.prototype.propertyIsEnumerable.call(Object(t),`children`)){if((R?.view(e)??e)[sd]=t.children,t.children!=null&&(R?.view(e)??e)[id]===!0)throw ud()}else n!=null&&Object.prototype.propertyIsEnumerable.call(Object(n),`children`)&&((R?.view(e)??e)[sd]=void 0)}if(n){for(let r of Object.keys(Object(n)))if(r!==`key`&&r!==`children`&&!(i&&r===`dangerouslySetInnerHTML`)&&!(a&&wf(e,r))){if(r===`ref`){let r=t?t.ref:void 0;n.ref!=null&&n.ref!==r&&rs(n.ref,e);continue}t!=null&&Object.prototype.propertyIsEnumerable.call(Object(t),r)||rf(e,r,n[r])}}if(t==null)return;let o=n===void 0?H():null,s=o!==null&&!o.isFresh(e);for(let o of Object.keys(Object(t))){if(o===`key`||o===`children`||i&&o===`dangerouslySetInnerHTML`||a&&wf(e,o))continue;let c=t[o],l=n?n[o]:void 0;if(o===`ref`){if(c===l)continue;r?ts(r,c,e):bd(c,e);continue}if(o===`suppressHydrationWarning`||o===`suppressNativeChangeWarning`||o===`__octaneNativeChangeDiagnostic`)continue;if(o===`class`||o===`className`){if(c===l&&!s)continue;Kd(e,c);continue}if(o===`style`){Yd(e,c,l);continue}if(o===`dangerouslySetInnerHTML`){fd(e,c);continue}let u=of(e,o);if(u!==null){if(c===l&&!s)continue;tm(e,u,c,l);continue}if(c===l&&!zm(e,o)&&!s)continue;let d=nf(o,e);if(d){if(c===l)continue;d.capture?Qf.has(d.type)||sp([d.type]):Vf.has(d.type)||op([d.type]),jf(e,d.key,c);continue}(n===void 0||o!==`autoFocus`||zd(e))&&Ud(e,o,c)}}var Ef=Symbol(),Df=1;function Of(e){return typeof e==`object`&&!!e&&e[Ef]===Df}var kf=[],Af=null;function jf(e,t,n){t!==void 0&&(j!==null&&(j.push(Oi,e,t,(R?.view(e)??e)[t]),ja()),(R?.view(e)??e)[t]=n);let r=le!==null||ce!==void 0?pe():null;if(hn||en||r!==null||Af!==null){let t=r??(en||O?.block.idState.renderOwner?.signalOwner!==void 0?O===null?fe():gn.get(O)||O:O);if(t!==null){(t instanceof Zs||t instanceof Xs)&&gn.get(t)===void 0&&gn.set(t,!1);let n=Af??=new WeakMap;if(gs!==null)F.stageAction(()=>{n.get(e)!==t&&n.set(e,t)});else{let r=n.get(e);r!==t&&(j!==null&&j.push(Pi,n,e,r),n.set(e,t))}}}}var Mf=1,Nf=2,Pf=4,Ff=8,If=16,Lf=32,Rf=64,zf=128,Bf=256,Vf=new Map,Hf=new Map,Uf=new WeakMap,Wf=0,Gf=Symbol(`octane.portalPathLength`),Kf=new WeakMap,qf=0,Jf=Symbol(`octane.rootEpoch`);function Yf(e,t){let n=Kf.get(e);Kf.set(e,{count:(n?.count||0)+t,since:++qf,previous:n}),n!==void 0&&setTimeout(()=>{let t=Kf.get(e);t!==void 0&&(t.previous=void 0)},0)}function Xf(e,t){let n=Kf.get(e);for(;n!==void 0&&n.since>t;)n=n.previous;return n!==void 0&&n.count>0}function Zf(e,t){if(Hf.size===1&&Wf===0){Oe(e),e[Jf]=qf;return}let n=e.composedPath();if(Hf.size===1)return Oe(e),e[Jf]=qf,Wf!==0&&(Ap(n,qf),e[Gf]=n.length),n;for(let r=n.length-1;r>=0;r--)if(Hf.has(n[r])){n[r]===t?(Oe(e),e[Jf]=qf,Wf!==0&&(Ap(n,qf),e[Gf]=n.length)):Wf!==0&&n.length>(e[Gf]||0)&&(Ap(n,e[Jf]??qf),e[Gf]=n.length);break}return n}var Qf=new Map,$f=`abort.beforetoggle.cancel.canplay.canplaythrough.close.durationchange.emptied.encrypted.ended.error.load.loadeddata.loadedmetadata.loadstart.pause.play.playing.progress.ratechange.resize.seeked.seeking.stalled.suspend.timeupdate.toggle.volumechange.waiting`.split(`.`),ep=new Set([`focus`,`blur`,`invalid`,`pointerenter`,`pointerleave`,`mouseenter`,`mouseleave`,`scroll`,`scrollend`,...$f]),tp=e=>ep.has(e),np={passive:!1},rp={capture:!0,passive:!1};function ip(e,t){return e===`touchstart`||e===`touchmove`?t?rp:np:t}var ap=new Set([`pointerenter`,`pointerleave`,`mouseenter`,`mouseleave`,`scroll`,`scrollend`]);function op(e){let t=typeof Element<`u`&&Object.isExtensible(Element.prototype);for(let n=0;n<e.length;n++){let r=e[n];if(Vf.has(r))continue;let i=Qf.get(r)??fp(r);i.flags|=Mf,Vf.set(r,i),t&&uu(Element.prototype,`$$`+r);for(let e of Hf.keys())tp(r)&&Qf.has(r)||(e.addEventListener(r,Rp,ip(r,tp(r))),tp(r)||e.addEventListener(r,zp,ip(r,!0)))}}function sp(e){let t=typeof Element<`u`&&Object.isExtensible(Element.prototype);for(let n=0;n<e.length;n++){let r=e[n];if(Qf.has(r))continue;let i=Vf.get(r)??fp(r);i.flags|=Nf,Qf.set(r,i),t&&uu(Element.prototype,$d+r);for(let e of Hf.keys())Vf.has(r)||e.addEventListener(r,tp(r)?Rp:zp,ip(r,!0))}}function cp(e,t=!1){if(F?.stageDelegation(e,t,!0)===!0)return;fu(),t&&Yf(e,1);let n=Hf.get(e)||0;if(Hf.set(e,n+1),n===0){e.onclick==null&&e.nodeType===1&&(e.onclick=Bp);for(let t of Vf.keys())e.addEventListener(t,Rp,ip(t,tp(t))),tp(t)||e.addEventListener(t,zp,ip(t,!0));for(let t of Qf.keys())Vf.has(t)||e.addEventListener(t,tp(t)?Rp:zp,ip(t,!0))}}function lp(e,t=!1){if(F?.stageDelegation(e,t,!1)===!0)return;t&&Yf(e,-1);let n=Hf.get(e);if(n){if(n===1){Hf.delete(e);for(let t of Vf.keys())e.removeEventListener(t,Rp,tp(t)),tp(t)||e.removeEventListener(t,zp,!0);for(let t of Qf.keys())e.removeEventListener(t,tp(t)?Rp:zp,!0)}else Hf.set(e,n-1)}}var up=new Set(`auxclick.beforeblur.beforeinput.blur.cancel.change.click.close.compositionend.compositionstart.compositionupdate.contextmenu.copy.cut.dblclick.dragend.dragstart.drop.focus.focusin.focusout.fullscreenchange.gotpointercapture.hashchange.input.invalid.keydown.keypress.keyup.lostpointercapture.mousedown.mouseup.paste.pause.play.pointercancel.pointerdown.pointerup.popstate.ratechange.reset.resize.seeked.select.selectionchange.selectstart.submit.textInput.touchcancel.touchend.touchstart.volumechange`.split(`.`)),dp=0;function fp(e){return{name:e,bubbleKey:`$$`+e,captureKey:$d+e,flags:(tp(e)?Pf:0)|(ap.has(e)?Ff:0)|(up.has(e)?If:0)|(am.has(e)?Lf:0)|(e===`click`||e===`dblclick`||e===`mousedown`||e===`mousemove`||e===`mouseup`?Rf:0)|(e===`mouseenter`?zf:0)|(e===`invalid`||$f.includes(e)?Bf:0)}}var pp=Symbol(`octane.bubbleVersion`),mp=[],hp=0;function gp(e){for(let t=hp-1;t>=0;t--){let n=mp[t];if(n.event===e)return n}}function _p(){let e=gp(this);e!==void 0&&(e.flags|=1);let t=e?.stop||this.stopPropagation;(t===_p?Event.prototype.stopPropagation:t).call(this)}function vp(){let e=gp(this);e!==void 0&&(e.flags|=2);let t=e?.immediate||this.stopImmediatePropagation;(t===vp?Event.prototype.stopImmediatePropagation:t).call(this)}var yp={configurable:!0,writable:!0,value:_p},bp={configurable:!0,writable:!0,value:vp};function xp(e,t,n,r){n?.configurable===!1?n.writable&&Object.defineProperty(e,t,{value:r.value}):Object.defineProperty(e,t,r)}function Sp(e,t,n){let r=mp[hp];return r===void 0&&(r={event:null,flags:0,stop:null,immediate:null,currentTarget:null},mp.push(r)),hp++,r.event=e,r.flags=0,r.stop=e.stopPropagation,xp(e,`stopPropagation`,t,yp),n!==null&&(r.immediate=e.stopImmediatePropagation,xp(e,`stopImmediatePropagation`,n,bp)),r}function Cp(e,t,n){let r=mp[--hp];r.event=null,r.stop=null,r.immediate=null,r.currentTarget=null,t===void 0?delete e.stopPropagation:Object.defineProperty(e,\"stopPropagation\",t),n!==null&&(n===void 0?delete e.stopImmediatePropagation:Object.defineProperty(e,\"stopImmediatePropagation\",n))}var wp={configurable:!0,get(){return gp(this)?.currentTarget}},Tp=[],Ep=[],Dp=null;function Op(e,t,n){let r=n?t.captureKey:t.bubbleKey,i=(t.flags&Rf)!==0||!n&&(t.flags&zf)!==0,a=!1;for(let t=e;t<Tp.length;t++){let e=Tp[t],n=e[r],o=n!=null&&i&&e.disabled&&(e.localName===`button`||e.localName===`input`||e.localName===`select`||e.localName===`textarea`)?null:n;Ep[t]=o,o!=null&&(a=!0,Af!==null&&((Dp??=[])[t]=Af.get(e)))}return a}function kp(e){if(e.$$portalParent!=null||(R?.view(e)??e).parentNode===null)return;let t=(R?.view(e)??e).parentNode,n=Uf.get(t);if(n===void 0)return;let r,i=(R?.view(e)??e).previousSibling,a=n.size;for(;i!==null;){let o=i.$$portalEventStart,s=o?.$$portalEventRange;if(a!==0&&o!==void 0&&s!==void 0&&n.has(s)&&s.start===o&&s.end===i&&(R?.view(o)??o).parentNode===t){a--,i=(R?.view(o)??o).previousSibling;continue}let c=i.$$portalEventRange,l=c?.end;if(c!==void 0&&n.has(c)&&c.start===i&&l!=null&&(R?.view(l)??l).parentNode===t&&((R?.view(i)??i).compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)!==0&&((R?.view(e)??e).compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING)!==0){r=c;break}i=(R?.view(i)??i).previousSibling}r!==void 0&&(M!==null&&(N(e,`$$portalParent`,e.$$portalParent),N(e,`$$portalContainer`,e.$$portalContainer)),e.$$portalParent=r.host,e.$$portalContainer=t)}function Ap(e,t){for(let n=0;n<e.length;n++){let r=jp(e[n]);if(r===null)continue;kp(r);let i=r.$$portalParent;for(;i!=null&&!Xf(i,t)&&e.indexOf(i)<0;)kp(i),i=i.$$portalParent||(R?.view(i)??i).parentNode}}function jp(e){return e!=null&&typeof e.nodeType==`number`?e:null}function Mp(e,t,n=e.composedPath()){let r=Tp,i=r.length,a=e[Jf]??qf,o=Wf!==0||a!==qf,s=n.indexOf(t);if(s<0)return 0;if(Hf.size===1&&a===qf&&Xf(t,a)){let e=0;for(;e<s;e++){let t=jp(n[e]);if(t===null||o&&t.$$portalParent!=null)break;r.push(t)}if(e===s)return r.length-i;r.length=i}let c=jp(n[0]);if(c===null)return 0;let l=0,u=!1;for(;;){r.length=i;let e=c,d=l,f=null,p=!1,m=!1;for(;e!==null;){if(Xf(e,a)&&!(e===c&&u)){f??=e,e===t&&(f===e?p=!0:m=!0);break}r.push(e);let s=o?e.$$portalParent:void 0;if(s!=null){let a=e.$$portalContainer;if(a==null)return r.length=i,0;f??=a,a===t&&(f===a?p=!0:m=!0),e=s,d=n.indexOf(s)}else e=d>=0?jp(n[++d]):(R?.view(e)??e).parentNode}if(m)return r.length=i,0;if(p)return r.length-i;if(f===null)return r.length=i,0;let h=n.indexOf(f);if(h<l||h>=s||h===l&&u)return r.length=i,0;c=f,l=h,u=!0}}function Np(e,t,n){let r=O,i=k;O=null,k=null;let a=()=>{if(typeof e==`function`){e(t);return}if(Of(e)){let n=e,r=n.args;if(typeof r!=`number`)switch(r.length){case 0:n.fn();break;case 1:n.fn(r[0]);break;case 2:n.fn(r[0],r[1]);break;default:n.fn.apply(null,r)}else r===1?n.fn(n.a0):r===2?n.fn(n.a0,n.a1):r===-1?n.fn(t,n.a0):n.fn(t,n.a0,n.a1);return}Pp(`${t.type} event`,e,t)};try{let e=n instanceof Zs||n instanceof Xs?Ln(n):n;e===void 0||fe()===e?a():he(e,a)}catch(e){Fp(e)}finally{O=r,k=i}}function Pp(e,t,n){if(t)throw Error(E(46,e,typeof t));t(n)}function Fp(e){if(typeof reportError==`function`){reportError(e);return}if(typeof window<`u`&&typeof ErrorEvent==`function`){let t=new ErrorEvent(`error`,{error:e,message:String(e?.message??e),cancelable:!0});window.dispatchEvent(t),t.defaultPrevented||console.error(e);return}console.error(e)}function Ip(e){dp===0&&(e.flags&If)!==0&&om.length>0&&(!vr&&Cs()&&(eo?.queueAllTransition()===!0?Io():$o(Bp)),Rm()),e.name===`click`&&(sm=null)}function Lp(e,t){if(!e.bubbles||e.cancelBubble||(t.flags&Mf)===0){e.bubbles&&(t.flags&Mf)!==0&&Bm(e,t),Ip(t);return}if((t.flags&If)===0)return;if(om.length===0){if((t.flags&Lf)===0)return;let n=e.target?.localName;if(n!==`input`&&n!==`textarea`&&n!==`select`)return}let n=e[pp],r=()=>{e[pp]===n&&(Bm(e,t),Ip(t))};e.isTrusted?setTimeout(r,0):queueMicrotask(r)}function Rp(e){let t=Vf.get(e.type)??Qf.get(e.type);if(t===void 0)return;let n=(t.flags&Pf)!==0,r=n?Zf(e,this):void 0;e[pp]=(e[pp]||0)+1,Bm(e,t);let i=(t.flags&Ff)!==0;dp++;let a=e.target,o=Jp,s=e.type===`submit`&&a!=null&&a.nodeName===`FORM`?qp(a,e):null;s!==null&&(Jp=s);let c=Jt(e),l=Tp.length,u,d=!1,f;try{if(n&&(t.flags&Nf)!==0&&(r??=e.composedPath(),zp.call(this,e,r,t))||(t.flags&Mf)===0||a?.nodeType===1&&zd(a)&&(t.flags&Bf)!==0||(Mp(e,this,r),!Op(l,t,!1)&&s===null))return;u=Object.getOwnPropertyDescriptor(e,`stopPropagation`),d=!0,f=Sp(e,u,null);for(let t=l;t<Tp.length;t++){let n=Tp[t];if(i&&n!==e.target)break;let r=Ep[t];if(r!=null&&!De(e,n,!1)&&(Vp(e,n,f),Np(r,e,Dp?.[t]),f.flags&1)||i)break}s!==null&&Yp!==null&&!e.defaultPrevented&&Tp.includes(s.form,l)&&Yp(s.form,e,s.action,s.submitter)}finally{Tp.length=l,Ep.length=l,Dp!==null&&(Dp.length=l),d&&Cp(e,u,null),s!==null&&(Jp=o,Xp(s)),d&&Hp(e);try{Xt(e,c,!1,Fp)}catch(e){Fp(e)}dp--,Ip(t)}}function zp(e,t,n=Vf.get(e.type)??Qf.get(e.type)){if(t??=Zf(e,this),n===void 0||(n.flags&Nf)===0)return!1;t??=e.composedPath(),(!e.bubbles||(n.flags&Mf)===0)&&Bm(e,n);let r=Tp.length;Mp(e,this,t);let i=Op(r,n,!0),a=i?Object.getOwnPropertyDescriptor(e,`stopPropagation`):void 0,o=i&&(n.flags&Pf)!==0?Object.getOwnPropertyDescriptor(e,`stopImmediatePropagation`):null,s=e.cancelBubble,c=!1;dp++;let l=Jt(e),u;try{if(i){u=Sp(e,a,o);for(let t=Tp.length-1;t>=r;t--){let n=Ep[t];if(n!=null&&!De(e,Tp[t],!0)&&(Vp(e,Tp[t],u),Np(n,e,Dp?.[t]),u.flags&1))break}}}finally{c=(u===void 0?i:u.flags!==0)||!s&&e.cancelBubble,Tp.length=r,Ep.length=r,Dp!==null&&(Dp.length=r),i&&(Cp(e,a,o),Hp(e));try{Xt(e,l,e.bubbles&&!e.cancelBubble&&(n.flags&Mf)!==0,Fp)}catch(e){Fp(e)}dp--,Lp(e,n)}return c}function Bp(){}function Vp(e,t,n){n.currentTarget=t,Object.defineProperty(e,\"currentTarget\",wp)}function Hp(e){delete e.currentTarget}var Up={pending:!1,data:null,method:null,action:null},Wp=new WeakMap,Gp=new WeakMap;function Kp(e,t){Wp.set(e,t);let n=Gp.get(e);if(n)for(let e of n)e()}function qp(e,t){let n=t.submitter,r=e.$$formAction;if(n!=null){let e=n.$$formAction??(R?.view(n)??n).getAttribute(`formaction`);e!=null&&(r=e,n=null)}return{form:e,event:t,action:r,submitter:n??null,transitions:0,published:!1,intercepted:!1}}var Jp=null,Yp=null;function Xp(e){if(e.intercepted||e.transitions===0||!e.event.defaultPrevented)return;let t=e.form,n=null;try{n=new FormData(t);let r=e.event.submitter;r&&(R?.view(r)??r).name&&n.append((R?.view(r)??r).name,(R?.view(r)??r).value??``)}catch{}let r=t;r.$$pendingSubmits=(r.$$pendingSubmits||0)+1,e.published=!0,Kp(t,{pending:!0,data:n,method:t.method||`get`,action:r.$$formAction??(R?.view(t)??t).getAttribute(`action`)})}function Zp(e){if(e.transitions--,e.transitions!==0||!e.published)return;let t=e.form;t.$$pendingSubmits=Math.max(0,(t.$$pendingSubmits||1)-1),t.$$pendingSubmits===0&&Kp(e.form,Up)}var Qp=null;function $p(e){try{e.reset(),Vm(e)}catch{}}function em(){if(Qp===null||yr>0||br>0)return;let e=Qp;Qp=null;for(let t of e)$p(t)}function tm(e,t,n,r){if(typeof n==`function`){(R?.view(e)??e).$$formAction=n,e.$$formSubmitWired||(e.$$formSubmitWired=!0,Yp=nm,op([`submit`])),(R?.view(e)??e).removeAttribute(t);return}(R?.view(e)??e).$$formAction=void 0,Ud(e,t,n)}function nm(e,t,n,r){if(typeof n!=`function`)return;t.preventDefault(),Jp!==null&&Jp.form===e&&(Jp.intercepted=!0);let i=new FormData(e);r&&(R?.view(r)??r).name&&i.append((R?.view(r)??r).name,(R?.view(r)??r).value??``);let a=n,o=e;o.$$pendingSubmits=(o.$$pendingSubmits||0)+1,Kp(e,{pending:!0,data:i,method:`post`,action:a});let s=a.$$isActionDispatcher===!0,c=t=>{if(o.$$pendingSubmits=Math.max(0,(o.$$pendingSubmits||1)-1),o.$$pendingSubmits===0&&Kp(e,Up),t&&!s)try{e.reset(),Vm(e)}catch{}},l;try{s?l=a(i):m_(()=>(l=a(i),l))}catch(e){c(!1),console.error(e);return}Promise.resolve(l).then(()=>c(!0),()=>c(!1))}var rm=Symbol(`octane.uncontrolled`),im=[`input`,`change`,`click`],am=new Set(im),om=[],sm=null,cm=null,lm=[],um=[],dm=[];function fm(e,t){t!==null&&(typeof t==`object`||typeof t==`function`)&&F?.recordStageEntry(t),e.push(t),M!==null&&Yi(()=>{let n=e.lastIndexOf(t);n!==-1&&e.splice(n,1)})}function pm(){return lm.length>0||um.length>0||dm.length>0}function mm(e,t){if(e.$$afSeen!==void 0||(e.$$afSeen=!0,!t))return;switch(e.localName){case`button`:case`input`:case`select`:case`textarea`:break;default:return}let n=H();(n===null||n.isFresh(e))&&fm(dm,e)}function hm(e){if(e.localName===`textarea`)return!0;if(e.localName!==`input`)return!1;switch((R?.view(e)??e).type){case`text`:case`search`:case`url`:case`tel`:case`password`:case`email`:case`number`:return!0}return!1}function gm(e){let t=e.currentTarget,n=t.$$ctrl;n!==void 0&&(n.compositionEndTask!==void 0&&n.compositionEndTask!==null&&(clearTimeout(n.compositionEndTask),n.compositionEndTask=null),n.composing=!0,(R?.view(t)??t).addEventListener(`blur`,_m))}function _m(e){let t=e.currentTarget,n=t.$$ctrl;if(n===void 0)return;(R?.view(t)??t).removeEventListener(`blur`,_m),n.compositionEndTask!==void 0&&n.compositionEndTask!==null&&clearTimeout(n.compositionEndTask),n.composing=!0;let r=()=>{n.compositionEndTask=null,n.composing=!1,Fm(t)};n.compositionEndTask=e.type===`blur`?setTimeout(r,0):setTimeout(()=>{n.compositionEndTask=setTimeout(r,0)},0)}function vm(e){let t=(R?.view(e)??e).$$ctrl;return t===void 0?void 0:F?.projectControlled(t)??t}function ym(e){let t=vm(e);return t===void 0&&(t={v:rm,c:-1,sv:null,sawV:!1,sawC:!1,sawDC:!1,dvv:rm,composing:!1,compositionEndTask:void 0,queued:!1,formSeen:!1,formMultiple:!1},(R?.view(e)??e).$$ctrl=t,op(im)),t}function bm(e){let t=vm(e);return t===void 0&&(t=ym(e)),t.compositionEndTask===void 0&&hm(e)&&(t.compositionEndTask=null,(R?.view(e)??e).addEventListener(`compositionstart`,gm),(R?.view(e)??e).addEventListener(`compositionend`,_m)),t}function xm(e){return typeof e==`string`?e:typeof e==`function`||typeof e==`symbol`?``:String(e)}function Sm(e,t){return(R?.view(e)??e).type===`number`?t===0&&(R?.view(e)??e).value===``||(R?.view(e)??e).value!=t:(R?.view(e)??e).value!==xm(t)}function Cm(e,t){O?.block.idState.renderOwner?.controlLeases?.has(e)&&ju(!1);let n=e,r=bm(e);j!==null&&Pa(e,`value`,`defaultValue`);let i=!r.sawV;if(r.sawV=!0,t==null){r.v=rm;return}let a=xm(t);if(i){r.v=t;let i=H();if(i!==null&&!i.isFresh(e))return;(R?.view(n)??n).value!==a&&((R?.view(n)??n).value=a),(R?.view(n)??n).defaultValue=a;return}let o=r.v;if(r.v=t,!(r.composing&&Object.is(o,t))&&Sm(n,t)&&((R?.view(n)??n).value=a),(R?.view(n)??n).defaultValue!==a){let t=R===null&&e.localName===`textarea`?B(e):null;t!==null&&t.nodeType===3&&V(t)===null?z(t).data=a:(R?.view(n)??n).defaultValue=a}}function wm(e,t,n){let r=!n.sawC;if(n.sawC=!0,t==null){n.c=-1;return}let i=!!t;if(cm??=Im,r){n.c=i;let t=H();if(t!==null&&!t.isFresh(e)){(R?.view(e)??e).checked=(R?.view(e)??e).checked,n.sawDC=!0;return}(R?.view(e)??e).checked=i,(R?.view(e)??e).defaultChecked=i,n.sawDC=!0;return}let a=i!==n.c;n.c=i,(a||!Tm(e))&&(R?.view(e)??e).checked!==i&&((R?.view(e)??e).checked=i)}function Tm(e){let t=sm;return t===null?!1:e===t||(R?.view(e)??e).type===`radio`&&(R?.view(t)??t).type===`radio`&&(R?.view(e)??e).name!==``&&(R?.view(e)??e).name===(R?.view(t)??t).name&&(R?.view(e)??e).form===(R?.view(t)??t).form&&((R?.view(e)??e).form!==null||(R?.view(e)??e).getRootNode()===(R?.view(t)??t).getRootNode())}function Em(e,t){let n=bm(e);j!==null&&Pa(e,`checked`,`defaultChecked`),wm(e,t,n)}function Dm(e,t){let n=e,r=bm(e);if(j!==null&&(Ma(r),ja()),r.sawV,r.sawV=!0,t==null){r.sv=null;return}if((R?.view(n)??n).multiple){if(!Array.isArray(t))return;let e=new Set;for(let n=0;n<t.length;n++)e.add(xm(t[n]));r.sv=e}else{if(Array.isArray(t))return;r.sv=xm(t)}let i=H();(i===null||i.isFresh(e))&&(Om(n,r.sv,!1),r.queued||(r.queued=!0,fm(lm,n)))}function Om(e,t,n){let r=(R?.view(e)??e).options;if(j!==null)for(let e=0;e<r.length;e++)Ra(r[e],n);if(typeof t!=`string`){for(let e=0;e<r.length;e++){let i=r[e],a=t.has((R?.view(i)??i).value);(R?.view(i)??i).selected!==a&&((R?.view(i)??i).selected=a),n&&((R?.view(i)??i).defaultSelected=a)}return}let i=null;for(let e=0;e<r.length;e++){let a=r[e];if((R?.view(a)??a).value===t){(R?.view(a)??a).selected=!0,n&&((R?.view(a)??a).defaultSelected=!0);return}i===null&&!(R?.view(a)??a).disabled&&(i=a)}i!==null&&((R?.view(i)??i).selected=!0)}function km(e,t,n){let r=bm(e),i=H();if(e.localName===`select`){let n=r.dvv===rm,a=(R?.view(e)??e).multiple,o=r.formMultiple!==a;if(n||o){if(j!==null&&(Ma(r),ja()),r.dvv=t,r.formMultiple=a,i!==null&&!i.isFresh(e))return;t==null?o&&Om(e,a?new Set:``,!1):fm(um,{el:e,value:t})}return}let a=n??!r.sawV,o=r.dvv;j!==null&&Ma(r),r.sawV=!0,r.dvv=t;let s=i!==null&&!i.isFresh(e);if(r.v!==rm)return;let c=e;if(t==null){o!==rm&&o!=null&&(j!==null&&Fa(c),e.localName===`input`?(R?.view(c)??c).removeAttribute(`value`):(R?.view(c)??c).defaultValue=``);return}let l=xm(t);a&&!s&&(R?.view(c)??c).value!==l&&(j!==null&&Pa(e,`value`,`defaultValue`),(R?.view(c)??c).value=l),((R?.view(c)??c).defaultValue!==l||l===``&&e.localName===`input`&&!(R?.view(c)??c).hasAttribute(`value`))&&(j!==null&&Fa(c),(R?.view(c)??c).defaultValue=l)}var Am=Symbol(`octane.defaultValue`),jm=Symbol(`octane.defaultCheckedInitialized`);function Mm(e,t){let n=bm(e),r=e,i=H(),a=i!==null&&!i.isFresh(e),o=!n.sawDC;if(o&&(j!==null&&(Ma(n),ja()),n.sawDC=!0),a){o&&((R?.view(r)??r).checked=(R?.view(r)??r).checked);return}if(n.c!==-1||(o&&!(jm in r)&&(j!==null&&(j.push(Oi,r,`checked`,(R?.view(r)??r).checked),(R?.view(r)??r).type===`radio`&&(R?.view(r)??r).name!==``&&t&&La(r)),(R?.view(r)??r).checked=t==null?(R?.view(r)??r).checked:!!t),t==null))return;let s=!!t;(R?.view(r)??r).defaultChecked!==s&&(j!==null&&((R?.view(r)??r).type===`radio`&&(R?.view(r)??r).name!==``&&La(r),Xa(r,`checked`)),(R?.view(r)??r).defaultChecked=s)}function Nm(e,t,n,r,i,a,o){let s=bm(e),c=!s.formSeen,l=s.formMultiple;if(j!==null&&(Ma(s),ja()),s.formSeen=!0,t===`input`){let t=e,o=r==null?null:xm(r);Cm(t,n),n??km(t,o,c),Em(t,i),i==null&&(a!=null||c)&&Mm(t,a);return}if(t===`textarea`){let t=e;Cm(t,n),n??(r==null?!c&&(R?.view(t)??t).defaultValue!==``&&((R?.view(t)??t).defaultValue=``):km(t,r,c));return}let u=e,d=typeof o,f=!!o&&d!==`function`&&d!==`symbol`;if(s.formMultiple=f,(R?.view(u)??u).multiple!==f){if(j!==null){for(let e=0;e<(R?.view(u)??u).options.length;e++)Ra((R?.view(u)??u).options[e],!1);j.push(Oi,u,`multiple`,(R?.view(u)??u).multiple)}(R?.view(u)??u).multiple=f}!c&&l!==f&&n==null&&(r==null?Om(u,f?new Set:``,!1):s.dvv=rm),Dm(u,n),r==null?c&&(s.dvv=void 0):km(u,r)}function Pm(){if(dm.length>0){let e=dm;dm=[];for(let t=0;t<e.length;t++)z(e[t]).isConnected&&z(e[t]).focus()}if(um.length>0){let e=um;um=[];for(let t=0;t<e.length;t++){let n=e[t].el,r=n.$$ctrl;if(r!==void 0&&r.sv!==null)continue;let i=e[t].value,a=(R?.view(n)??n).multiple?Array.isArray(i)?new Set(i.map(xm)):null:xm(i);a!==null&&Om(n,a,!0)}}if(lm.length>0){let e=lm;lm=[];for(let t=0;t<e.length;t++){let n=e[t].$$ctrl;n!==void 0&&(n.queued=!1,n.sv!==null&&Om(e[t],n.sv,!1))}}}function Fm(e){let t=e.$$ctrl;if(t!==void 0&&!t.composing&&(R?.view(e)??e).isConnected){if(e.localName===`select`){t.sv!==null&&Om(e,t.sv,!1);return}cm?.(e,t),t.v!==rm&&Sm(e,t.v)&&((R?.view(e)??e).value=xm(t.v))}}function Im(e,t){t.c!==-1&&((R?.view(e)??e).checked!==t.c&&((R?.view(e)??e).checked=t.c),(R?.view(e)??e).type===`radio`&&(R?.view(e)??e).name!==``&&Lm(e))}function Lm(e){let t=(R?.view(e)??e).name,n=Ia(e);for(let r=0;r<n.length;r++){let i=n[r];if(i===e||i.localName!==`input`||(R?.view(i)??i).type!==`radio`||(R?.view(i)??i).name!==t||(R?.view(i)??i).form!==(R?.view(e)??e).form)continue;let a=i.$$ctrl;a!==void 0&&a.c!==-1&&(R?.view(i)??i).checked!==a.c&&((R?.view(i)??i).checked=a.c)}}function Rm(){let e=om;om=[];for(let t=0;t<e.length;t++)Fm(e[t])}function zm(e,t){switch(t.length){case 5:if(t!==`value`)return!1;break;case 7:if(t!==`checked`)return!1;break;default:return!1}let n=e.localName;return n===`input`||n===`textarea`||n===`select`}function Bm(e,t){let n=e.target;if(n===null||n.$$ctrl===void 0||(t.flags&Lf)===0)return;let r=n.$$ctrl;if(e.type===`input`&&r.compositionEndTask!==void 0){let t=e,i=t.inputType;t.isComposing===!0||i===`insertCompositionText`||i===`deleteCompositionText`?(r.compositionEndTask!==null&&(clearTimeout(r.compositionEndTask),r.compositionEndTask=null),r.composing||n.addEventListener(`blur`,_m),r.composing=!0):r.composing&&typeof t.isComposing==`boolean`&&(r.compositionEndTask!==null&&(clearTimeout(r.compositionEndTask),r.compositionEndTask=null),n.removeEventListener(`blur`,_m),r.composing=!1)}let i=n.localName===`input`&&(n.type===`checkbox`||n.type===`radio`);if(e.type===`click`){i&&(r.c!==-1&&(sm=n),n.$$checkableActivation=!0,setTimeout(()=>{n.$$checkableActivation===!0&&(n.$$checkableActivation=!1,n===sm&&(sm=null),Fm(n))},0));return}if(n===sm&&(sm=null),e.type===`input`&&n.localName===`select`){n.$$selectPick=!0,setTimeout(()=>{n.$$selectPick===!0&&(n.$$selectPick=!1,Fm(n))},0);return}e.type===`input`&&i&&n.$$checkableActivation===!0||(e.type===`change`&&(i&&(n.$$checkableActivation=!1),n.localName===`select`&&(n.$$selectPick=!1)),om.indexOf(n)===-1&&om.push(n))}function Vm(e){let t=e.elements;for(let e=0;e<t.length;e++)t[e].$$ctrl!==void 0&&Fm(t[e])}function Hm(e,t){if(F?.stageAction(()=>Hm(e,t))===!0)return;let n=Uf.get(e);n===void 0&&(n=new Set,Uf.set(e,n),Wf++,qf++),n.add(t),t.start.$$portalEventRange=t,t.end.$$portalEventStart=t.start}function Um(e,t){if(F?.stageAction(()=>Um(e,t),!0)===!0)return;let n=t.start,r=t.end;n?.$$portalEventRange===t&&delete n.$$portalEventRange,r?.$$portalEventStart===n&&delete r.$$portalEventStart;let i=Uf.get(e);i!==void 0&&(i.delete(t),i.size===0&&(Uf.delete(e),Wf--,qf++))}function Wm(e,t,n){let r=e.fragmentOwners;if(r!==void 0){if(e.fragmentAnchor===n){if(!Array.isArray(r)&&!Array.isArray(t)&&r===t)return;if(Array.isArray(r)&&Array.isArray(t)&&r.length===t.length){let e=!0;for(let n=0;n<r.length;n++)if(r[n]!==t[n]){e=!1;break}if(e)return}}Gm(e)}if(e.fragmentOwners=t,e.fragmentAnchor=n,Array.isArray(t))for(let r of t)r._registerPortal(e,n);else t._registerPortal(e,n);r===void 0&&(e.block.cleanups??=[]).push(()=>Gm(e))}function Gm(e){let t=e.fragmentOwners,n=e.fragmentAnchor;if(t!==void 0&&n!==void 0){if(e.fragmentOwners=void 0,e.fragmentAnchor=void 0,Array.isArray(t))for(let r of t)r._unregisterPortal(e,n);else t._unregisterPortal(e,n)}}function Km(e,t,n){let r=null,i=null;for(let e of vo){let a=e._ownerBlock;(a===t||Ts(a,t))&&z(e._startMarker).parentNode===(R?.view(n)??n).parentNode&&(z(e._startMarker).compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0&&(z(e._endMarker).compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)!==0&&(r===null?r=e:(i??=[r]).push(e))}r!==null&&Wm(e,i??r,n)}function qm(e,t,n,r,i,a,o,s=null){let c=H();if(c!==null)return c.suspend(()=>qm(e,t,n,r,i,a,o,s));let l=Ym(r,i),u=e;if(u===null||u.target!==n||u.key!==s){u!==null&&Jm(u);let e=(R?.view(document)??document).createComment(`portal`),r=(R?.view(document)??document).createComment(`/portal`);e.$$portalEnd=r,(R?.view(n)??n).appendChild(e),(R?.view(n)??n).appendChild(r);let i=Qs(`portal`,t,n,e,r,l.body,l.props,o,dc);if(u={__kind:`portalSlotSlot`,block:i,target:n,key:s,host:a,start:e,end:r},Hm(n,u),D_?.(i),cp(n),M!==null){let e=u;Yi(()=>{Um(n,e),lp(n)})}I(i)}else u.host!==a&&N(u,`host`,u.host),u.host=a,u.block.body!==l.body&&N(u.block,`body`,u.block.body),u.block.props!==l.props&&N(u.block,`props`,u.block.props),u.block.extra!==o&&N(u.block,`extra`,u.block.extra),u.block.body=l.body,u.block.props=l.props,u.block.extra=o,I(u.block);let d=V(u.start);if(u.interleavedFragment===void 0)for(;d!==null&&d!==u.end;)d.$$portalParent=a,d.$$portalContainer=n,d=V(d);else for(;d!==null&&d!==u.end;){let e=d.$$portalEnd;if(e!==void 0){d=hg(d,e);continue}d.$$portalParent=a,d.$$portalContainer=n,d=V(d)}return u}function Jm(e){let t=M;if(t!==null&&!t.aborted&&!Wi&&e.block?.mounted&&!ia(t,e.block)&&e.target!==null){na(e.target,e.start,e.end,()=>Jm(e));return}e.block&&=(L(e.block,!0),null),e.target&&=(Um(e.target,e),lp(e.target),null)}function Ym(e,t){return typeof e==`function`?{body:e,props:t}:e!=null&&e.$$kind===Mt&&typeof e.type==`function`?{body:e.type,props:e.props}:{body:Xm,props:e}}function Xm(e,t){Ig(t,0,t.parentNode,e,t.endMarker)}function Zm(e){return typeof e==`string`||typeof e==`number`?String(e):null}function Qm(e,t,n=void 0){let r=Zm(n);return{$$kind:Nt,body:e,target:t,key:r,props:r===null?n:void 0}}var $m=new WeakSet;function eh(e){return e.key!==null||$m.has(e)}var th=new WeakSet,nh=Symbol(`octane.scopedChildren`);function rh(e){return e==null||typeof e!=`object`&&typeof e!=`function`?!1:e.key!==void 0}function ih(e){let t={};if(e==null)return t;for(let n in e)n!==`key`&&Ze.call(e,n)&&(t[n]=e[n]);return t}function ah(e){return e}var oh=Symbol(`octane.scopedValue`);function sh(){return this[oh]().type}function ch(){return this[oh]().props}function lh(){let e=this[oh](),t=e.key;return t===null&&$m.has(e)&&$m.add(this),t}function uh(){return this[oh]().ref}function dh(){return this[oh]().children}function fh(){return this[oh]().__octaneInvocationSite}var ph={type:{configurable:!0,enumerable:!0,get:sh},props:{configurable:!0,enumerable:!0,get:ch},key:{configurable:!0,enumerable:!0,get:lh},ref:{configurable:!0,enumerable:!0,get:uh},children:{configurable:!0,enumerable:!0,get:dh},__octaneInvocationSite:{configurable:!0,enumerable:!0,get:fh}};function mh(e){return hh(Fl(e))}function hh(e){let t={$$kind:Mt};return Object.defineProperty(t,oh,{value:e}),Object.defineProperty(t,\"type\",ph.type),Object.defineProperty(t,\"props\",ph.props),Object.defineProperty(t,\"key\",ph.key),Object.defineProperty(t,\"ref\",ph.ref),Object.defineProperty(t,\"children\",ph.children),Object.defineProperty(t,\"__octaneInvocationSite\",ph.__octaneInvocationSite),t}function gh(e,t,n,r=kf){typeof t==`function`&&zt(t);let i=n??null,a=rh(i)?``+i.key:null,o=r.length>0,s=o?r.length===1?r[0]:r:i?.children;r.length>1&&Lh.add(r);let c=ih(i);o&&(c.children=s),Qe(t,c),s=c.children;let l={$$kind:Mt,type:t,props:c,key:a,ref:c.ref===void 0?null:c.ref,children:s??null};return e!==void 0&&(l.__octaneInvocationSite=e),a===null&&i!=null&&(typeof i==`object`||typeof i==`function`)&&`key`in i&&$m.add(l),ah(l)}function _h(e){return e!=null&&e.$$kind===Mt}function vh(e){return e!=null&&e.$$kind===Mt&&typeof e.type==`string`}function yh(e){let t;try{t=String(e)}catch{return`object with keys {`+Object.keys(e).join(`, `)+`}`}return t===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:t}function bh(e){let t=yh(e);return Error(E(3,t))}function xh(e){let t=e===null?`null`:e===void 0?`undefined`:typeof e==`object`?yh(e):JSON.stringify(e);return Error(E(24,t))}var Sh=Symbol(`NO_KEY`);function Ch(e,t,n,r,i,a,o,s,c,l,u){let d=Cd,f=d!==null&&r===d.type;if(!f&&typeof r!=`function`&&typeof r!=`string`)throw xh(r);let p=f?d.body:typeof r==`string`?xg:r;f&&(s=!1,c=!1,!l&&o===void 0&&rh(i)&&(o=i.key,l=!0)),Th(dc,e,t,n,p,r,i,typeof r==`string`?{$$kind:Mt,type:r,props:i,key:null,ref:i!=null&&i.ref!==void 0?i.ref:null,children:i==null?null:i.children}:i,a,o,s,c,l,u)}function wh(e,t,n,r,i,a,o,s,c,l,u){if(typeof r!=`function`)throw xh(r);Th(null,e,t,n,r,r,i,i,a,o,s,c,l,u)}function Th(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(k?.pending&&!k.crossRenderUpdate)return;if(n===0&&t!==cc){let e=t.slots[0];if(e?.returnedOutput===!0){if(e.__kind===`componentSlotSlot`)lc(e,!1);else{let e=t.block;if(e.outputHandler(e,null,!0),e.disposed)return}}}let m=t.block,h=H();if(h!==null&&(c!=null&&h.isFresh(c)||h.isFresh(r))){h.suspend(()=>Th(e,t,n,r,i,a,o,s,c,l,u,d,f,p));return}let g=t.slots[n],_=null;if(g===void 0){let e=null,i=null,o=!1,s=h===null?void 0:a[ze],p=h?.passthroughRanges===!0,v=p&&s!==`owner`;if(p&&s===`owner`&&(h.passthroughRanges=!1),!v&&d===!0&&jt(a,1)&&(d=!1),v)o=!0;else if(d===!0&&m!==null){let t=m.startMarker,n=m.endMarker;t!=null&&n!=null&&t!==n&&t.nodeType===8&&n.nodeType===8?(e=t,i=n,o=!0):t===null&&n===null&&(o=!0)}let y=null;if(!o&&h!==null&&h.isOpen(c??null))y=c,_=y;else if(!o&&h!==null&&!h.isOpen(c??null)){let e=h.node;(e===null||(R?.view(e)??e).parentNode!==r)&&(e=B(r)),_=e,e!==null&&h.isOpen(e)&&(y=e)}if(!o){if(y!==null)e=y,i=h.close(y),m===h.rootBlock&&h.claimRootRemainder(V(i)),h.node=V(e);else if(u===!0||u===2&&a.$$singleRoot===!0)e=null,i=null;else{if(h!==null){let e=_;Gn(t,n),uv(()=>Error(E(55)));let r=e;for(;r!==null&&r!==c&&!Lu(r);){let e=V(r);(R?.view(r)??r).remove(),r=e}}e=(R?.view(document)??document).createComment(`comp`),i=(R?.view(document)??document).createComment(`/comp`),(R?.view(r)??r).insertBefore(e,c??null),(R?.view(r)??r).insertBefore(i,c??null),h!==null&&(h.markFresh(e),h.markFresh(i),h.node=i)}}g={__kind:`componentSlotSlot`,start:e,end:i,anchor:c??null,singleRoot:e===null&&!o,inherited:o,block:null,currentComp:null,prevKey:Sh,keyed:f===!0||l!==void 0},t.slots[n]=g,xc(t,g)}let v=l===void 0?Sh:``+l,y=l!==void 0&&g.prevKey!==Sh&&v!==g.prevKey,b=a!==g.currentComp||y,x=M!==null&&g.block!==null&&b;if(x){if(g.inherited)Xi(g,r,g.start,g.end);else{let e=g.start??g.block.startMarker,t=g.end??g.block.endMarker;if(e!==null&&t!==null&&(R?.view(e)??e).parentNode===r&&(R?.view(t)??t).parentNode===r)Xi(g,r,(R?.view(e)??e).previousSibling,V(t));else{let e=g.anchor;Xi(g,r,e===null?(R?.view(r)??r).lastChild:(R?.view(e)??e).previousSibling,e)}}}if((f===!0||l!==void 0)&&!g.keyed&&(x||N(g,`keyed`,g.keyed),g.keyed=!0),y&&(g.currentComp=null),!x&&!Object.is(g.prevKey,v)&&N(g,`prevKey`,g.prevKey),g.prevKey=v,b){let o=hn||en?{parentScope:t,invocationSite:p,key:l,hasKey:l!=null}:void 0,c=g.block===null||!g.block.mounted||m.idState.renderOwner?.signalOwner===void 0?void 0:{parent:t,slot:n,kind:g.__kind,branch:void 0,component:a,key:v},u=xr,d=m.currentRenderMode===`transition`,f=u!==null&&g.block!==null&&g.block.mounted&&h===null,y=f&&b_(m),b=M===null||y?u:null,x=f&&!d&&y,S=x&&!d,C=M;if(C!==null&&!y&&h===null&&g.block!==null&&g.block.mounted&&!ia(C,g.block)){let t=g.block,n=t.startMarker,l=t.endMarker,u=g.inherited,d=u?g.start===null?B(r):V(g.start):g.start??n;u&&d===g.end&&(d=null);let f=u?d===null?null:g.end===null?(R?.view(r)??r).lastChild:z(g.end).previousSibling:g.end??l,p=d===null?u?g.start:null:f;if(p!==null&&(R?.view(p)??p).parentNode===r){let h=Dh(m,r,p,i,s,e,`dynamic`,void 0,!1,o,c);if(h.suspended||h.failed)throw Nh(h.wip),h.suspended===null?h.error:new zl(h.suspended);z(h.wip.start).data=`comp`,z(h.wip.end).data=`/comp`,g.start=h.wip.start,g.end=h.wip.end,g.singleRoot=!1,g.inherited=!1,g.block=h.wip.block,g.currentComp=a,u||C_(m,n,l,h.wip.start,h.wip.end),kh(h.wip),ta(t,r,d,f);return}}if(b!==null&&f&&(d||x)){if(!S&&!g.singleRoot&&!g.inherited&&g.end!==null){let t=b.render(m,r,g.end,i,s,e,`dynamic`,void 0,!1,o,c);if(t.suspended||t.failed)throw b.dispose(t.wip),t.failed?t.error:new zl(t.suspended);z(t.wip.start).data=`comp`,z(t.wip.end).data=`/comp`;let n=g.block;g.start=t.wip.start,g.end=t.wip.end,g.block=t.wip.block,g.currentComp=a,b.splice(t.wip),L(n),m.disposed||g.block!==t.wip.block||t.wip.block.disposed;return}let t=g.end??g.anchor;if(t!==null){let n=b.render(m,r,t,i,s,e,`dynamic`,void 0,!1,o,c);if(b.dispose(n.wip),n.failed)throw n.error;if(n.suspended)throw new zl(n.suspended)}}if(g.block){if(g.inherited){if(L(g.block),m.disposed)return;if(g.start===null)for(;B(r);)(R?.view(r)??r).removeChild(B(r))}else if(g.singleRoot){if(L(g.block),m.disposed)return}else{let e=V(g.end);if(L(g.block),m.disposed)return;let t=(R?.view(document)??document).createComment(`comp`),n=(R?.view(document)??document).createComment(`/comp`);(R?.view(r)??r).insertBefore(t,e),(R?.view(r)??r).insertBefore(n,e),g.start=t,g.end=n}}if(g.currentComp=a,g.singleRoot){let t=g.anchor?z(g.anchor).previousSibling:(R?.view(r)??r).lastChild,n=Qs(`dynamic`,m,r,null,g.anchor,i,s,void 0,e);o!==void 0&&Fn(n,o),g.block=n;try{I(n)}finally{if(h!==null&&_!==null&&(R?.view(_)??_).parentNode===r)n.startMarker=_,n.endMarker=_;else{let e=g.anchor?z(g.anchor).previousSibling:(R?.view(r)??r).lastChild;e!==null&&e!==t&&(n.startMarker=e,n.endMarker=e)}}}else{let t=Qs(`dynamic`,m,r,g.start,g.end,i,s,void 0,e);o!==void 0&&Fn(t,o),g.inherited&&(t.exclusiveMarkers=!0),g.block=t,I(t)}}else if(g.block){if(Ug(g.block,a,o))return;g.block.props!==s&&N(g.block,`props`,g.block.props),g.block.props=s,I(g.block)}h!==null&&!g.inherited&&g.end!==null&&(h.node=V(g.end))}function Eh(e){return e==null||e===!1||e===!0?``:String(e)}function Dh(e,t,n,r,i,a,o=`dynamic`,s,c=!1,l,u){let d=(R?.view(document)??document).createComment(`wip`),f=(R?.view(document)??document).createComment(`/wip`),p=V(n);(R?.view(t)??t).insertBefore(d,p),(R?.view(t)??t).insertBefore(f,p);let m=ho(),h=ns.length,g=P;P=m;let _=Qs(o,e,t,d,f,r,i,s,a);l!==void 0&&Fn(_,l),u!==void 0&&vn.set(_,u),c&&(_.$$implicitBail=!0,_.memoInChain=!0);let v=null,y=null,b=!1;try{I(_)}catch(e){Bl(e)?v=e.thenable:(y=e,b=!0)}finally{P=g}let x={block:_,start:d,end:f,capture:m,domParent:t,refDetachCheckpoint:h};if(v!==null&&u!==void 0){let t=e.idState.renderOwner,n=yn(e),r=n?.tryBlock??t?.current,i=n??t;if(i!==void 0&&r!=null){wn(_,r,i,!0);for(let e of M?.created??[])!e.disposed&&Ts(_,e)&&wn(e,r,i);x.retrySignalOwners=i.retrySignalOwners}}return{wip:x,suspended:v,error:y,failed:b}}function Oh(e,t=!1){e.presentations!==void 0&&P!==null&&(P.presentations??=[]).push(...e.presentations),(P!==null||!t)&&D?.spliceCapture(e,P);let n=e.renderedBlocks;if(e.renderedBlocks=null,e.renderRoot=null,n!==null&&P!==null)for(let e of n)ic(P,e);for(let t=0;t<3;t++){let n=e.effects[t],r=P===null?ao[t]:P.effects[t];for(let e=0;e<n.length;e++)r.push(n[e])}let r=P===null?oo:P.events;for(let t=0;t<e.events.length;t++)r.push(e.events[t]);let i=P===null?so:P.eventActions;for(let t=0;t<e.eventActions.length;t++)i.push(e.eventActions[t]);let a=P===null?fo:P.refs;for(let t=0;t<e.refs.length;t++)a.push(e.refs[t]);if(e.detaches!==void 0){let t=P===null?ns:P.detaches??=[];for(let n of e.detaches)t.push(n)}let o=P===null?uo:P.stores;for(let t=0;t<e.stores.length;t++)o.push(e.stores[t]);if(e.suspenseCommits!==void 0)for(let t of e.suspenseCommits)mo(t);let s=e.renderCleanups;if(s!==void 0){if(e.renderCleanups=void 0,P!==null){let e=P.renderCleanups??=[];for(let t of s)e.push(t)}else for(let e of s)F?.stageAction(()=>e(!1))!==!0&&e(!1)}}function kh(e){Oh(e.capture)}function Ah(e){if(e===null)return;D?.discardCapture(e);let t=e.renderedBlocks,n=e.renderRoot;if(e.renderedBlocks=null,e.renderRoot=null,t!==null)for(let e of t)rc(e,n);for(let t=0;t<e.stores.length;t++)e.stores[t].queued=!1;let r=e.renderCleanups;if(r!==void 0){e.renderCleanups=void 0;for(let e of r)e(!0)}}function jh(e,t){let n=e.domParent,r=e.start;for(;r!==null;){let i=V(r);if((R?.view(n)??n).insertBefore(r,t),r===e.end)break;r=i}}function Mh(e,t){jh(e,t),kh(e)}function Nh(e){let t=P,n=_n;e.retrySignalOwners!==void 0&&(_n=e.retrySignalOwners),P=e.capture;try{L(e.block,!0)}finally{_n=n,P=t,ns.splice(e.refDetachCheckpoint),Ah(e.capture)}}function Ph(e){let t=M;if(t!==null&&!t.aborted&&!Wi){if(e.block===null&&e.forSlot===null&&e.text===null&&e.hostNode===null)return;let t=e.ownerHost??z(e.start)?.parentNode??z(e.text)?.parentNode??z(e.hostNode)?.parentNode??e.block?.parentNode??null;if(t!==null){Og(e,t);let n=e.ownerHost!==null||e.borrowed&&e.start===null?B(t):e.start===null?e.text??e.hostNode:V(e.start),r=e.ownerHost===null?e.start!==null||e.borrowed?e.end:(R?.view(n)??n)?.nextSibling??null:null;n===r&&(n=null);let i=n===null?null:r===null?(R?.view(t)??t).lastChild:(R?.view(r)??r).previousSibling,a=e.block,o=e.forSlot,s=e.hostNode;if(a!==null)ta(a,t,n,i);else{if(o!==null){for(let e=o.head;e!==null;e=e.nextSibling)ea(e);o.emptyBlock!==null&&ea(o.emptyBlock)}na(t,n,i,()=>{if(o!==null){for(let e=o.head;e!==null;e=e.nextSibling)L(e,!1);o.emptyBlock!==null&&L(o.emptyBlock,!1)}else s!==null&&U(s,null)})}e.block=null,e.forSlot=null,e.text=null,e.hostNode=null,e.currentComp=null,e.ownerHost!==null&&(e.start=null,e.end=null);return}}let n=e.block!==null;if(e.block!==null&&(L(e.block,!1),e.block=null),e.ownerHost!==null){let t=e.ownerHost,r=B(t);for(;r!==null;){let e=V(r);n||U(r,null),(R?.view(t)??t).removeChild(r),r=e}e.start=null,e.end=null}else if(e.start!==null){let t=z(e.start).parentNode;if(t!==null){let r=V(e.start);for(;r!==null&&r!==e.end;){let e=V(r);n||U(r,null),(R?.view(t)??t).removeChild(r),r=e}}}else e.text===null?e.hostNode!==null&&z(e.hostNode).parentNode!==null&&(U(e.hostNode,null),z(z(e.hostNode).parentNode).removeChild(e.hostNode)):z(e.text).remove();e.text=null,e.currentComp=null,e.hostNode=null}function Fh(e,t){if(M!==null&&!Wi){let n=e.ownerHost??z(e.start)?.parentNode??t.parentNode,r=e.ownerHost===null?z(e.start)?.nextSibling??null:B(n),i=e.ownerHost===null?e.end:null;r===i&&(r=null);let a=r===null?null:i===null?(R?.view(n)??n).lastChild:(R?.view(i)??i).previousSibling;ta(t,n,r,a);return}if(L(t,!1),e.ownerHost!==null){let t=B(e.ownerHost);for(;t!==null;){let n=V(t);z(e.ownerHost).removeChild(t),t=n}}else if(e.start!==null){let t=z(e.start).parentNode;if(t!==null){let n=V(e.start);for(;n!==null&&n!==e.end;){let e=V(n);(R?.view(t)??t).removeChild(n),n=e}}}}function Ih(e,t){let n=e!=null&&e.$$kind===Mt;return e?.$$kind===Nt&&e.key!=null||n&&e.key!=null&&!th.has(e)||n&&e.key!=null?e.key:t}var Lh=new WeakSet;function Rh(e,t){return e!=null&&(e.$$kind===Mt||e.$$kind===Nt)&&e.key!=null?e.key:t}var zh=!1;function Bh(e){zh=!0;let t=e;for(;t!==null&&!t.deoptRefs;)t.deoptRefs=!0,t=t.parentBlock}function Vh(e,t,n,r){let i=of(e,t);if(i!==null){tm(e,i,n,void 0);return}if(t===`ref`)n!=null&&(Bh(r),ts(r,n,e));else if(t===`className`||t===`class`)qd(e,n);else if(t===`style`)Yd(e,n,void 0);else{let r=nf(t,e);r===null?Ud(e,t,n):(jf(e,r.key,n),r.capture?Qf.has(r.type)||sp([r.type]):Vf.has(r.type)||op([r.type]))}}function Hh(e){if(e==null||e.dangerouslySetInnerHTML==null)return!1;if(dd(e.dangerouslySetInnerHTML),e.children!=null)throw ud();return!0}function Uh(e){return Hh(e.props)||e.type===`textarea`&&(e.props?.value!=null||e.props?.defaultValue!=null)}function Wh(e){(R?.view(e)??e).checked=(R?.view(e)??e).checked,(R?.view(e)??e)[jm]=!0}function Gh(e,t,n){if(t==null){e.localName===`input`&&Wh(e);return}let r=e.localName===`input`;for(let i in t){if(i===`key`||i===`children`)continue;if(i===`suppressHydrationWarning`){e.__oct_suppress=t[i]===!0;continue}let a=t[i];r&&(i===`defaultChecked`||i===`checked`&&a!=null)&&(r=!1),Vh(e,i,a,n)}r&&Wh(e)}function Kh(e,t,n,r){let i=t?.ref,a=n?.ref;if(i!=null&&i!==a&&rs(i,e),t!=null)for(let r in t)r!==`key`&&r!==`children`&&r!==`ref`&&(n==null||!(r in n))&&rf(e,r,t[r]);if(n!=null)for(let i in n){if(i===`key`||i===`children`)continue;if(i===`suppressHydrationWarning`){e.__oct_suppress=n[i]===!0;continue}let a=n[i];if(t==null||t[i]!==a||zm(e,i)){if(i===`autoFocus`&&!zd(e))continue;i===`style`?Yd(e,a,t?.style):Vh(e,i,a,r)}}}var qh=Symbol(`octane.deoptDesc`);function Jh(e){let t=B(e);for(;t!==null;){let e=t.$$portalEnd;if(e!=null){t=hg(t,e);continue}if(t.$$deoptKey!==void 0||Yh(t)!==void 0)return!0;t=V(t)}return!1}function Yh(e){return(R?.view(e)??e)[qh]}function Xh(e,t,n){return e!==void 0&&e.type===t.type&&e.props===t.props&&e.key===t.key&&e.ref===t.ref&&e.children===n}function Zh(e,t){let n=t[oh];if(n===void 0&&t[nh]===void 0)return!0;let r=n===void 0?t:n(),i=e.deoptNode===null?void 0:Yh(e.deoptNode);return i===r||Xh(i,r,r.children)}function Qh(e,t){let n=t[oh],r=n===void 0?t:n();if(r[nh]!==void 0){let t=r.children,n=Yh(e);r=Xh(n,r,t)?n:{$$kind:Mt,type:r.type,props:r.props,key:r.key,ref:r.ref,children:t}}j!==null&&j.push(Oi,e,qh,Yh(e)),(R?.view(e)??e)[qh]=r}function $h(e){return _h(e)&&e.type===Sd}function eg(e){let t=e.children;return t==null?[]:Array.isArray(t)?t:[t]}function tg(e){return{$$kind:Mt,type:ng,props:e,key:e.key,ref:null,children:null}}function ng(e,t){let n=t.block,r=n.slots[1];if(r===void 0){let i=H(),a,o,s=i?.node;if(s?.nodeType===8&&(R?.view(s)??s).data===`frag`){a=s;let e=1,t=V(a);for(;t!==null;){if(t.nodeType===8){if((R?.view(t)??t).data===`frag`)e++;else if((R?.view(t)??t).data===`/frag`&&--e===0)break}t=V(t)}if(t===null)throw Error(E(50));o=t,i.node=V(a)}else a=(R?.view(document)??document).createComment(`frag`),o=(R?.view(document)??document).createComment(`/frag`),z(n.parentNode).insertBefore(a,n.endMarker),z(n.parentNode).insertBefore(o,n.endMarker);r=Md(t,a,o,e.ref),n.slots[0]={a:r},n.slots[1]=r,n.refFields=[`f`,`a`,``]}else r._currentRef!==e.ref&&(N(r,`_currentRef`,r._currentRef),r._currentRef!=null&&rs(r._currentRef,r),e.ref!=null&&ts(t,e.ref,r),r._currentRef=e.ref);Ig(t,2,n.parentNode,e.children,r._endMarker);let i=H();i!==null&&(i.node=V(r._endMarker))}function rg(e){return Lh.has(e)?`fragment`:`array`}var ig=JSON.stringify,ag=String;function og(e){if(JSON.stringify!==ig||`toJSON`in e)return null;for(let t=0;t<e.length;t++){let n=typeof e[t];if(n!==`string`&&n!==`number`)return null}return`[`+JSON.stringify(e)+`,`}function sg(e,t,n,r,i,a){let o=(_h(n)||n?.$$kind===Nt)&&n.key!=null;return t.length===0?(e.push(o?`k`+String(i):r),a):a!==null&&(!o||typeof i==`string`&&String===ag)&&JSON.stringify===ig&&!(`toJSON`in t)&&(a===void 0&&(a=og(t)),a!==null)?(e.push(o?a+`\"key\",`+JSON.stringify(String(i))+`]`:a+`\"index\",`+r+`]`),a):(e.push(JSON.stringify([t,o?`key`:`index`,o?String(i):r])),null)}function cg(e,t,n,r,i){let a=r===`fragment`?Rh:Ih,o=n.length,s=o>1?void 0:null;for(let c=0;c<o;c++){let l=n[c];if($h(l)){if(l.ref!=null||Ze.call(l.props,`ref`)){e.push(tg(l)),s=sg(t,i,l,c,a(l,c),s);continue}let n=eg(l);l.key==null?cg(e,t,n,`fragment`,r===`fragment`?[...i,`wrapper`,o===1?0:c]:o===1?i:[...i,`position`,c,`fragment`]):cg(e,t,n,`fragment`,[...i,`keyed-fragment`,l.key]);continue}if(Array.isArray(l)){let n=rg(l);cg(e,t,l,n,n===r?[...i,`wrapper`,o===1?0:c]:o===1?i:[...i,`position`,c,n]);continue}e.push(l),s=sg(t,i,l,c,a(l,c),s)}}function lg(e,t){return(_h(e)||e?.$$kind===Nt)&&e.key!=null?`k`+String(t):0}function ug(e,t=!1,n=!0){if($h(e)){if(e.ref!=null||Ze.call(e.props,`ref`))return{items:[tg(e)],keys:[lg(e,e.key??0)]};let t=[],n=[],r=e.key==null?[]:[`keyed-fragment`,e.key];return cg(t,n,eg(e),`fragment`,r),{items:t,keys:n}}if(Array.isArray(e)){let t=[],n=[];return cg(t,n,e,rg(e),[]),{items:t,keys:n}}return n&&_h(e)&&e.key!=null?{items:[e],keys:[lg(e,e.key)]}:t?{items:[e],keys:[lg(e,Rh(e,0))]}:null}function dg(e){if(e==null||typeof e==`string`||Array.isArray(e)||_h(e))return null;let t=$e(e);if(t===null)return null;let n=[],r=t.call(e),i;for(;!(i=r.next()).done;)n.push(i.value);return n}function fg(e,t,n,r){if(n==null||n===!1||n===!0||n===``)return;if(Array.isArray(n)){let i=Lh.has(n)?Rh:Ih;for(let a=0;a<n.length;a++){let o=n[a];if(Array.isArray(o))fg(e,t,o,r+`:`+a);else if(o!=null&&o!==!1&&o!==!0&&o!==``){e.push(o);let n=i(o,a);if(r===``)t.push(typeof n==`string`&&n[0]===`:`?`:`+n:n);else{let e=o?.$$kind===Mt&&o.key!=null;t.push(r+`:`+(e?`k`:`i`)+String(n))}}}return}e.push(n);let i=n?.$$kind===Mt&&n.key!=null?n.key:0;t.push(r===``?typeof i==`string`&&i[0]===`:`?`:`+i:i:r+`:i0`)}function pg(e,t,n,r){if(t==null||t===!1||t===!0||t===``)return null;let i=typeof t;if(i===`string`||i===`number`||i===`bigint`){let n=String(t);if(e!==null&&e.nodeType===3){let t=H();return t!==null&&!t.isFresh((R?.view(e)??e).parentNode)?t.htextSwap(e,n):(Hu(e,n),e)}return(R?.view(document)??document).createTextNode(n)}if(vh(t)){let i=Bd(t.type,r),a;return e!==null&&e.nodeType===1&&e.localName===t.type&&e.namespaceURI===(i??Rd)?(a=e,Kh(a,Yh(a)?.props??null,t.props,n)):(a=i===void 0?(R?.view(document)??document).createElement(t.type):(R?.view(document)??document).createElementNS(i,t.type),H()?.markFresh(a),Gh(a,t.props,n)),Qh(a,t),Uh(t)||mg(a,t.children,n),a}if(_h(t))throw Error(E(25));if(i===`object`)throw bh(t);return null}function mg(e,t,n){let r=typeof t;if(r===`string`&&t!==``||r===`number`||r===`bigint`){let n=B(e);if(n!==null&&n.nodeType===3&&V(n)===null&&n.$$deoptKey===0&&n.$$portalEnd==null){let r=H();r!==null&&!r.isFresh(e)?r.htextSwap(n,String(t)):Hu(n,String(t));return}}if((t==null||r===`boolean`||t===``)&&B(e)===null)return;let i=Vd(e),a=[],o=[];fg(a,o,t,``);let s=B(e),c=M!==null&&(R?.view(e)??e).parentNode!==null&&(n.mounted||M.hydrating||M.retainedCreated?.has(n));if(s===null){for(let t=0;t<a.length;t++){let r=pg(null,a[t],n,i);r!==null&&(c&&Qi(e),r.$$deoptKey=o[t],(R?.view(e)??e).appendChild(r))}return}if(a.length===0&&H()===null&&!Jh(e))return;let l=[],u=!1,d,f=null,p=[],m=s;for(;m!==null;){let e=m.$$portalEnd;if(e!=null){u=!0,m=hg(m,e);continue}let t=m.$$deoptKey,n=t===void 0?Yh(m):void 0;if(t===void 0&&n===void 0&&!(d??=H()!==null)){u=!0,m=V(m);continue}l.push(m);let r=t??n?.key;if(r!=null&&(f===null&&(f=new Map),!f.has(r))){f.set(r,m),m=V(m);continue}p.push(m),m=V(m)}let h=0,g=[];for(let e=0;e<a.length;e++){let t=a[e],r=o[e],s=null;f!==null&&(s=f.get(r)??null,s!==null&&f.delete(r)),s===null&&h<p.length&&(s=p[h++]);let c=pg(s,t,n,i);c!==null&&(c.$$deoptKey=r,g.push(c))}let _=g.length>0?new Set(g):null;for(let t=l.length-1;t>=0;t--){let r=l[t];if(_===null||!_.has(r)){let t=H();t!==null&&!t.isFresh(e)&&uv(()=>Error(E(62)),n),c?(Qi(e),na(e,r,r,()=>U(r,null))):(U(r,null),(R?.view(e)??e).removeChild(r))}}let v=B(e);for(let t=0;t<g.length;t++){let n=g[t],r=u?gg(v,d===!0):v;r!==n&&(c&&Qi(e),Uo===null?(R?.view(e)??e).insertBefore(n,r):(Yo(e,Uo),ev(e,n,r,Uo))),v=V(n)}}function hg(e,t){let n=e;for(;n!==null&&n!==t;)n=V(n);return V(n??e)}function gg(e,t){for(;e!==null;){let n=e.$$portalEnd;if(n!=null){e=hg(e,n);continue}if(!t&&e.$$deoptKey===void 0&&Yh(e)===void 0){e=V(e);continue}return e}return null}function _g(e,t){let n=t.block,r=H(),i=t.slots[0],a=vh(e)&&i?.__kind===`childSlot`&&i.currentComp===bg||yg(e),o=n.startMarker;if(o!==null&&o===n.endMarker&&o.nodeType!==8&&(R?.view(o)??o).parentNode!==null&&(a||!vh(e))){let e=(R?.view(o)??o).parentNode;M!==null&&(Zi(e,(R?.view(o)??o).previousSibling,V(o)),N(n,`startMarker`,n.startMarker),N(n,`endMarker`,n.endMarker));let t=(R?.view(document)??document).createComment(`it`),r=(R?.view(document)??document).createComment(`/it`);(R?.view(e)??e).insertBefore(t,o),(R?.view(e)??e).insertBefore(r,V(o)),n.startMarker=t,n.endMarker=r}if(a){let i=n.deoptNode,a=null;if(i!=null){if(N(n,`deoptNode`,n.deoptNode),t.slots[0]===void 0&&i.nodeType===1&&vh(e)&&i.localName===e.type&&(R?.view(i)??i).parentNode===n.parentNode)a=i;else if((R?.view(i)??i).parentNode===n.parentNode){if(M!==null)Zi(n.parentNode,(R?.view(i)??i).previousSibling,V(i)),na(n.parentNode,i,i,()=>U(i,null));else{U(i,null);let e=n.parentNode;(R?.view(e)??e).removeChild(i)}}n.deoptNode=null}if(r!==null&&t.slots[0]===void 0&&r.isOpen(n.startMarker)){let e={__kind:`childSlot`,start:n.startMarker,end:n.endMarker,ownerHost:null,borrowed:!0,compactable:!1,block:null,text:null,currentComp:null,currentIsBodyFn:!1,forSlot:null,hostNode:null,portal:null};t.slots[0]=e,xc(t,e)}if(r===null&&t.slots[0]===void 0&&n.startMarker!==null&&n.endMarker!==null&&n.startMarker!==n.endMarker&&n.startMarker.nodeType===8&&n.endMarker.nodeType===8){let e={__kind:`childSlot`,start:n.startMarker,end:n.endMarker,ownerHost:null,borrowed:!0,compactable:!1,block:null,text:null,currentComp:null,currentIsBodyFn:!1,forSlot:null,hostNode:a,portal:null};t.slots[0]=e,xc(t,e)}else if(a!==null&&(R?.view(a)??a).parentNode!==null){U(a,null);let e=(R?.view(a)??a).parentNode;(R?.view(e)??e).removeChild(a)}Ig(t,0,n.parentNode,e,n.endMarker,void 0,void 0,void 0,!1);return}t.slots[0]!==void 0&&t.slots[0]!==null&&t.slots[0].__kind===`childSlot`&&Ig(t,0,n.parentNode,null,n.endMarker);let s=n.endMarker,c=n.deoptNode;if(c===null&&r!==null){let e=n.startMarker;c=e==null?null:V(e),c===s&&(c=null)}let l=pg(c,e,n,Vd(n.parentNode));if(l!==c){if(N(n,`deoptNode`,n.deoptNode),c!=null&&c!==l&&(R?.view(c)??c).parentNode===n.parentNode){if(M!==null&&Zi(n.parentNode,(R?.view(c)??c).previousSibling,V(c)),l!==null){let e=n.parentNode;(R?.view(e)??e).insertBefore(l,c)}if(M!==null){let e=c;na(n.parentNode,e,e,()=>U(e,null))}else{U(c,null);let e=n.parentNode;(R?.view(e)??e).removeChild(c)}}else if(l!==null){M!==null&&n.mounted&&Zi(n.parentNode,(R?.view(s)??s)?.previousSibling??z(n.parentNode).lastChild,s);let e=n.parentNode;(R?.view(e)??e).insertBefore(l,s)}c!==null&&n.startMarker===c&&(N(n,`startMarker`,n.startMarker),N(n,`endMarker`,n.endMarker),n.startMarker=l,n.endMarker=l)}n.deoptNode=l}function vg(e,t){let n=t.slots[0],r=t.block;if(_h(e)&&typeof e.type==`function`){if(n===void 0||n.__kind===`componentSlotSlot`){let n=r.deoptNode;n!==null&&(U(n,null),(R?.view(n)??n).parentNode===r.parentNode&&z(r.parentNode).removeChild(n),r.deoptNode=null),Ch(t,0,r.parentNode,e.type,e.props,r.endMarker,void 0,!0,!0,void 0,e.__octaneInvocationSite);return}}else if(n?.__kind===`componentSlotSlot`){let e=r.startMarker;if(e!==null&&e===r.endMarker&&e.nodeType!==8&&(R?.view(e)??e).parentNode!==null){let t=(R?.view(document)??document).createComment(`it`),n=(R?.view(document)??document).createComment(`/it`);z((R?.view(e)??e).parentNode).insertBefore(t,e),z((R?.view(e)??e).parentNode).insertBefore(n,V(e)),r.startMarker=t,r.endMarker=n}fc(r,n),r.deoptNode=null}_g(e,t)}function yg(e){if(typeof e==`function`)return!0;if(typeof e!=`object`||!e)return!1;if(typeof e.then==`function`)return!0;if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(yg(e[t]))return!0;return!1}return!_h(e)&&$e(e)!==null?!0:e.$$kind===Mt?e.type===Sd||Cd!==null&&e.type===Cd.type||typeof e.type==`function`||yg(e.children):e.$$kind===Nt}function bg(e,t){let n=t.deoptNode,r=H(),i=Bd(e.type,Vd(t.parentNode));if(n===null&&r!==null&&r.node!==null&&r.node.nodeType===1&&r.node.localName===e.type&&(i===void 0||r.node.namespaceURI===i)){n=r.node,t.deoptNode=n,Gh(n,e.props,t),Qh(n,e);let i=V(r.node);Uh(e)||(r.node=B(n),Ig(t,0,n,e.children,null,!1,n)),r.node=i;return}if(n===null&&r!==null&&r.node!==null){let a=r.node;if(r.isOpen(a)){let e=r.close(a);r.node=V(e),r.removeRange(a,e)}else r.node=V(a),(R?.view(a)??a).remove();n=i===void 0?(R?.view(document)??document).createElement(e.type):(R?.view(document)??document).createElementNS(i,e.type),r.markFresh(n),t.deoptNode=n;let o=t.parentNode;(R?.view(o)??o).insertBefore(n,t.endMarker),Gh(n,e.props,t),Qh(n,e),Uh(e)||r.suspend(()=>Ig(t,0,n,e.children,null,!1,n));return}if(n===null||n.localName!==e.type||i!==void 0&&n.namespaceURI!==i){if(n!==null){let e=n;M!==null&&(Zi(t.parentNode,(R?.view(e)??e).previousSibling,V(e)),N(t,`deoptNode`,t.deoptNode));let r=t.slots[0];r!==void 0&&fc(t,r);let i=()=>{let t=Yh(e)?.props?.ref;t!=null&&rs(t,e)};M===null?(i(),(R?.view(e)??e).remove()):na(t.parentNode,e,e,i)}n=i===void 0?(R?.view(document)??document).createElement(e.type):(R?.view(document)??document).createElementNS(i,e.type),r!==null&&r.markFresh(n),t.deoptNode=n;let a=t.parentNode;(R?.view(a)??a).insertBefore(n,t.endMarker),Gh(n,e.props,t)}else Kh(n,Yh(n)?.props??null,e.props,t);Qh(n,e),Uh(e)||Ig(t,0,n,e.children,null,!1,n)}function xg(e,t){let n=e.type,r=t.deoptNode,i=H(),a=Bd(n,Vd(t.parentNode));if(r===null){if(i!==null&&i.node!==null&&i.node.nodeType===1&&i.node.localName===n&&(a===void 0||i.node.namespaceURI===a)){r=i.node,t.deoptNode=r,Gh(r,e.props,t),Qh(r,e);let n=V(i.node);Uh(e)||(i.node=B(r),Sg(e,t,r)),i.node=n;return}if(i!==null&&i.node!==null){uv(()=>Error(E(51)));let o=i.node;if(i.isOpen(o)){let e=i.close(o);i.node=V(e),i.removeRange(o,e)}else i.node=V(o),(R?.view(o)??o).remove();r=a===void 0?(R?.view(document)??document).createElement(n):(R?.view(document)??document).createElementNS(a,n),i.markFresh(r),t.deoptNode=r;let s=t.parentNode;(R?.view(s)??s).insertBefore(r,t.endMarker),Gh(r,e.props,t),Qh(r,e),Uh(e)||i.suspend(()=>Sg(e,t,r));return}r=a===void 0?(R?.view(document)??document).createElement(n):(R?.view(document)??document).createElementNS(a,n),i!==null&&i.markFresh(r),t.deoptNode=r;let o=t.parentNode;(R?.view(o)??o).insertBefore(r,t.endMarker),Gh(r,e.props,t)}else Kh(r,Yh(r)?.props??null,e.props,t);Qh(r,e),Uh(e)||Sg(e,t,r)}function Sg(e,t,n){let r=e.children;if(r!=null){if(typeof r==`function`){let e=t.slots[0];e===void 0?(e={__kind:`hostTagChildrenSlot`,block:Qs(`dynamic`,t,n,null,null,r,{},void 0,dc)},t.slots[0]=e,xc(t,e)):e.block.body=r,I(e.block);return}Ig(t,1,n,r,null,!1,n)}}function Cg(e){let t=e.forSlot;X_(t,t.items),t.head=null,t.tail=null,t.size=0,e.forSlot=null}var wg=null;function Tg(e,t){if(Array.isArray(e)){let n=[],r=e.length;for(let i=0;i<r;i++)n[i]=Tg(e[i],t);return Lh.has(e)&&Lh.add(n),n}if(e==null||e===!1||e===!0||e===``)return e;let n=typeof e,r=_h(e);if(!r&&n!==`string`&&n!==`number`&&n!==`bigint`)return e;let i=t.node;return i===null||i===t.end?e:(t.node=V(i),r?Yh(i)??e:e)}function Eg(e,t,n){let{items:r,keys:i}=ug(Tg(e,{node:V(t),end:n}),!0),a=[],o=V(t);for(let e=0;e<r.length;e++){let t=r[e];if(t==null||t===!1||t===!0||t===``)continue;if(o===null||o===n)break;let s=typeof t;if(!(s===`string`||s===`number`||s===`bigint`?o.nodeType===3:vh(t)&&o.nodeType===1&&o.localName===t.type))break;a.push({key:i[e],node:o}),o=V(o)}return a}function Dg(e,t){for(let n=e;n!==null;n=n.parentBlock)if(n.kind===`portal`&&n.parentNode===t)return!0;return!1}Array.prototype.map,Object.getOwnPropertyDescriptor(Array,Symbol.species)?.get;function Og(e,t){if(!(M===null||M.aborted||Wi)){if(ja(),e.ownerHost!==null)Xi(e,e.ownerHost,null,null);else if(e.start!==null)Xi(e,t,e.borrowed?e.start:z(e.start).previousSibling,e.borrowed?e.end:z(e.end)?.nextSibling??null);else if(e.borrowed&&e.block!==null&&e.block.startMarker===null)Xi(e,t,null,e.end);else{let n=e.text??e.hostNode??e.block?.startMarker??e.end,r=e.end??e.block?.endMarker??n,i=(R?.view(r)??r)?.nextSibling??null;Xi(e,t,n===null?(R?.view(t)??t).lastChild:(R?.view(n)??n).previousSibling,i)}}}function kg(e,t,n,r,i,a,o,s,c,l,u,d){let f=i?.passthroughRanges===!0&&e.borrowed,p=null,m=null;if(r.items.length===0&&i===null&&e.ownerHost!==null){e.forSlot!==null&&M===null&&Cg(e),Ph(e);return}if(e.forSlot===null){if(i===null&&!a&&Ph(e),e.end!==null&&z(e.end).parentNode===null&&(e.end=null,e.start=null),e.end===null){e.end=(R?.view(document)??document).createComment(``);let r=null;if(f){for(let e=t;e!==null;e=e.parentBlock)if(e.forSlot!==null&&e.endMarker!==null&&z(e.endMarker).parentNode===n){r=e.endMarker;break}if(r===null){let e=(R?.view(n)??n).lastChild;for(;e!==null&&yu(e);)r=e,e=(R?.view(e)??e).previousSibling}}if((R?.view(n)??n).insertBefore(e.end,r),f&&(i.markFresh(e.end),m=e.end,j!==null)){let t=e.end;Yi(()=>(R?.view(t)??t).remove())}}if(e.start===null){e.start=(R?.view(document)??document).createComment(``);let t=f?i.node:null;if((R?.view(n)??n).insertBefore(e.start,a?B(n):t!==null&&z(t).parentNode===n?t:e.end),f&&(i.markFresh(e.start),p=e.start,j!==null)){let t=e.start;Yi(()=>(R?.view(t)??t).remove())}}e.forSlot={__kind:`forBlockSlot`,start:e.start,end:e.end,items:new Map,head:null,tail:null,size:0,cachedDeps:null,emptyBlock:null,env:void 0,adopt:null,plainDeopt:!1,mappedNative:void 0,selectionItems:void 0,signalSite:void 0},a&&(e.forSlot.adopt=Eg(o,e.start,e.end))}let{items:h,keys:g}=r,_=d===!0&&i!==null&&!i.isOpen(i.node),v=c||g,y=!!c,b=e.forSlot.mappedNative===!0,x=s||(d===!0?vg:_g);if(s===void 0&&b&&e.forSlot.size>0)for(let t=0;t<h.length;t++){let n=h[t];if(!vh(n))continue;let r=e.forSlot.items.get(H_(v,n,t,y));if(r!==void 0&&r.startMarker!==null&&r.startMarker===r.endMarker&&r.startMarker.nodeType===1&&r.startMarker.localName===n.type){let e=r.startMarker,t=B(e);if(t?.nodeType===3&&V(t)===null){let e=Object.getOwnPropertyDescriptor(n,`children`);if(e!==void 0&&`value`in e&&(typeof e.value==`string`||typeof e.value==`number`||typeof e.value==`bigint`))t.$$deoptKey=0;else if(e?.get!==void 0){let e=r.slots[0];if(e!=null){for(let n in e)if(e[n]===t){t.$$deoptKey=0;break}}}}r.deoptNode=r.startMarker}}if(s!==void 0&&(e.forSlot.mappedNative===!1&&(x=(e,t,n)=>{let r=t.slots[0]===void 0?t.block.deoptNode:null;if(r===null||r.nodeType!==1){s(e,t,n);return}let i=bu,a={node:r};bu=a;try{s(e,t,n),a.node===null&&(t.block.deoptNode=null)}finally{bu=i}}),e.forSlot.mappedNative=!0),_){let e=x;x=(t,n)=>{let r=n.block.startMarker;r!==null&&r===n.block.endMarker&&r.nodeType===1&&n.block.deoptNode===null&&(n.block.deoptNode=r),e(t,n)}}let S=s===void 0&&d!==!0;e.forSlot.plainDeopt=S;let C=l||0,w=s===void 0?_||S:!!(C&16),ee=!!(C&1),te=!1;if(s!==void 0&&(e.forSlot.env=u,C&4&&u!==void 0&&(e.forSlot.cachedDeps!==null&&P_(e.forSlot.cachedDeps,u)?ee=!0:te=!0,e.forSlot.cachedDeps=u)),e.forSlot.size===0)try{U_(t,e.forSlot,h,v,x,s===void 0?2:!!(C&2),w,y,f)}catch(t){throw p!==null&&((R?.view(p)??p).remove(),e.start=null),m!==null&&((R?.view(m)??m).remove(),e.end=null),(p!==null||m!==null)&&(e.forSlot=null),t}else K_(t,e.forSlot,h,v,x,ee,s===void 0?2:!!(C&2),te,!!(C&8),w,y);if(e.forSlot.adopt!==null){let t=e.forSlot.adopt;for(let e=0;e<t.length;e++){let n=t[e].node;(R?.view(n)??n).parentNode!==null&&(M===null?(U(n,null),z((R?.view(n)??n).parentNode).removeChild(n)):na((R?.view(n)??n).parentNode,n,n,()=>U(n,null)))}e.forSlot.adopt=null}f&&!i.passthroughRanges&&(i.node=V(e.forSlot.end))}var Ag=Symbol(`octane.direct-signal-child`),jg=0;function Mg(e){e.disposed||(e.disposed=!0,e.unsubscribe?.(),Dr(e.scope.block))}function Ng(e){if(!(e.disposed||e.scope.block.disposed))try{Rn(e.scope,()=>{let t=Gu(e.handle);if(Object.is(e.value,t))return;let n=e.scope.slots[e.slotKey],r=typeof t,i=t==null||r!==`object`&&r!==`function`?Eh(t):null;if(n===void 0&&e.text!=null&&i!==null&&i!==``){Uu(e.text,i),e.value=t;return}if(n===e.state&&n?.block===null&&n.forSlot===null&&n.hostNode===null&&n.portal===null&&i!==null&&i!==``&&n.text!==null){Uu(n.text,i),e.value=t;return}Do(e.scope.block)})}catch{Do(e.scope.block)}}function Pg(e,t,n,r,i,a,o,s,c,l,u,d){let f=typeof t==`object`&&t&&t[Ag]===!0?t:null,p=f?.text??(t instanceof Text?t:null);if(!Wu(i)){let t=u?Rg(e,n,r,i,p):(d===void 0?Ig(e,n,r,i,o,s,c,l):Fg(e,n,r,i,d,o,s),null);if(f!==null){j!==null&&ja();let e=e=>{e||Mg(f)};P===null?e(!1):(P.renderCleanups??=[]).push(e)}return t}if(f!==null&&!f.disposed&&f.handle===i){let t=Gu(i);return j!==null&&Ma(f),u?f.text=Rg(e,n,r,t,p):d===void 0?Ig(e,n,r,t,o,s,c,l):Fg(e,n,r,t,d,o,s),f.value=t,f.state=e.slots[n],f}let m=Gu(i),h=u?Rg(e,n,r,m,p):(d===void 0?Ig(e,n,r,m,o,s,c,l):Fg(e,n,r,m,d,o,s),null);j!==null&&ja();let g={[Ag]:!0,scope:e,slotKey:n,handle:i,text:h,state:e.slots[n],value:m,disposed:!1};if(g.unsubscribe=i[sn](Ku(g,()=>Ng(g))),fn(e,()=>Mg(g)),f!==null){let e=e=>Mg(e?g:f);P===null?e(!1):(P.renderCleanups??=[]).push(e)}return g}function Fg(e,t,n,r,i,a,o){let s=Du;if(s?.revision!==void 0){let e=H()?.resolveOpen(a??null,n)??null,t=Fu(s,e,i,`slot`);(r==null?t.slot!==void 0||V(e)!==t.end:t.slot===void 0||typeof r!=`function`||r[Pu]!==t.slot)&&ju(!1)}Ig(e,t,n,r,a,o,void 0,!1,!0,void 0,void 0,void 0,void 0,void 0,i)}function Ig(e,t,n,r,i,a,o,s,c=!0,l,u,d,f,p,m){if(k?.pending&&!k.crossRenderUpdate)return;if(t===0&&e!==cc){let t=e.slots[0];if(t?.returnedOutput===!0){if(t.__kind===`childSlot`)lc(t,!1);else{let t=e.block;if(t.outputHandler(t,null,!0),t.disposed)return}}}if(jg===0){let c=e.slots[t]?.implicitSignal;if(Wu(r)||c!==void 0){Wu(r)&&An(),jg++;let l;try{l=Rn(e,()=>Pg(e,c,t,n,r,`runtime:${t}`,i,a,o,s,void 0,m))}finally{jg--}let u=e.slots[t];u!==void 0&&(u.implicitSignal=l);return}}if(r!=null&&c&&n.nodeType===1&&Be.has(n.localName)&&!Dg(e.block,n))throw Error(E(26,n.localName));if(md(n,r))return;let h=e.block,g=H();if(g!==null&&(i!=null&&g.isFresh(i)||g.isFresh(n))){g.suspend(()=>Ig(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m));return}for(;r!==null&&(typeof r==`object`||typeof r==`function`);){if(r.$$kind===Ft){r=Rl(r);continue}if(typeof r.then==`function`){r=Hl(r);continue}break}let _=typeof r==`function`?r:_h(r)&&typeof r.type==`function`?r.type:null,v=g?.passthroughRanges===!0&&_?.[ze]!==`owner`;g?.passthroughRanges===!0&&!v&&(g.passthroughRanges=!1);let y=dg(r);y!==null&&(r=y);let b=l===void 0?ug(r,!1,c):{items:r,keys:null},x=e.slots[t],S=b===null&&vh(r)&&x?.currentComp!==bg&&!yg(r),C=!1;if(x!==void 0&&M!==null){let e=S||b!==null?null:vh(r)?bg:_,t=b!==null&&x.forSlot!==null,i=x.block!==null&&e!==null&&(e===x.currentComp||typeof r==`function`&&x.currentIsBodyFn),a=S&&x.hostNode!==null&&x.block===null&&x.hostNode.nodeType===1&&x.hostNode.localName===r.type,o=r==null||typeof r!=`object`&&typeof r!=`function`,s=o?Eh(r):null,c=o&&x.block===null&&x.forSlot===null&&x.hostNode===null&&x.portal===null&&x.text===null==(s===``);!t&&!i&&!a&&!c&&(Og(x,n),C=!0)}let w=x===void 0&&g!==null&&h===g.rootBlock&&g.node!==null&&z(g.node).parentNode===n&&b===null&&_h(r)&&typeof r.type==`function`&&!g.isOpen(i??null)&&!g.isOpen(g.node);if(x===void 0&&g!==null&&!v&&h===g.rootBlock&&!g.isOpen(i??null)&&!g.isOpen(g.node)){let h=g.node;if(!(r===null||r===``?h===null:typeof r==`string`&&h?.nodeType===3||w)){g.abandonRoot(void 0),Ig(e,t,n,r,(R?.view(i)??i)?.parentNode===n?i:null,a,o,s,c,l,u,d,f,p,m);return}}if(x===void 0){let r=M;if(r!==null&&!r.aborted&&!Wi&&e.mounted&&!ia(r,h)){ja();let e=o===void 0?i??null:null;Zi(n,o===void 0?e===null?(R?.view(n)??n).lastChild:(R?.view(e)??e).previousSibling:null,e)}let c,l;v?(c=null,l=null):w?[c,l]=g.wrapUnframedRoot(g.node):g!==null&&g.isOpen(i??null)?(c=i,l=g.close(i),h===g.rootBlock&&g.claimRootRemainder(V(l)),g.node=V(c)):g!==null&&g.isOpen(g.node)?(c=g.node,l=g.close(g.node),h===g.rootBlock&&(g.protectRootAnchor(l),g.claimRootRemainder(V(l))),g.node=V(c)):m===void 0?a&&i!=null?(c=null,l=i):g===null&&o!==void 0||g===null&&S?(c=null,l=null):(c=null,l=(R?.view(document)??document).createComment(``),(R?.view(n)??n).insertBefore(l,i??null),g!==null&&h===g.rootBlock&&g.protectRootAnchor(l)):(c=(R?.view(document)??document).createComment(m),l=a&&i!=null?i:(R?.view(document)??document).createComment(`]`),(R?.view(l)??l).data=`]`,(R?.view(n)??n).insertBefore(c,i??null),l!==i&&(R?.view(n)??n).insertBefore(l,i??null)),x={__kind:`childSlot`,start:c,end:l,ownerHost:g===null?o??null:null,borrowed:v,compactable:s===!0,block:null,text:null,currentComp:null,currentIsBodyFn:!1,forSlot:null,hostNode:null,portal:null,implicitSignal:void 0},e.slots[t]=x,xc(e,x)}s===!0&&(x.compactable=!0);let ee,te=!1;if(wg!==null&&wg.block===e.block&&o!==void 0&&(M!==null&&Qi(n),ee=wg.children,te=!0,wg=null),x.end===null&&!S&&x.ownerHost===null&&!x.borrowed){let e=(R?.view(document)??document).createComment(``),t=(R?.view(document)??document).createComment(``),r=x.hostNode;if(r!==null&&(R?.view(r)??r).parentNode!==null){let n=(R?.view(r)??r).parentNode;(R?.view(n)??n).insertBefore(e,r),(R?.view(n)??n).insertBefore(t,V(r)),C_(h,r,r,e,t)}else(R?.view(n)??n).insertBefore(e,i??null),(R?.view(n)??n).insertBefore(t,i??null);x.start=e,x.end=t}let ne=r!=null&&r.$$kind===Nt?r:null;if(ne===null&&x.portal!=null&&(Jm(x.portal),x.portal=null),ne!==null){x.forSlot!==null&&(M!==null&&g===null?Ph(x):Cg(x)),(x.block!==null||x.text!==null||x.hostNode!==null)&&Ph(x),x.portal=qm(x.portal,h,ne.target,ne.body,ne.props,n,void 0,ne.key),vo.size!==0&&x.end!==null&&Km(x.portal,h,x.end);return}if(b!==null){kg(x,h,n,b,g,te,ee,l,u,d,f,p);return}if(x.forSlot!==null&&(M!==null&&g===null?Ph(x):Cg(x)),te&&x.hostNode===null&&x.block===null){let e=B(n);if(e!==null&&V(e)===null&&(e.nodeType===1||e.nodeType===3))x.hostNode=e;else{let e=B(n);for(;e!==null;){let t=V(e);if(M!==null){let t=e;na(n,t,t,()=>U(t,null))}else U(e,null),(R?.view(n)??n).removeChild(e);e=t}}}let T=null,re={},ie=!1,ae,oe,se=!1;if(vh(r)){if(S){if((x.block!==null||x.text!==null)&&Ph(x),x.end===null){let e=x.hostNode,t=pg(e,r,h,Vd(n));if(t!==e){if(e!==null&&(R?.view(e)??e).parentNode!==null){let n=(R?.view(e)??e).parentNode;M===null?(t!==null&&(R?.view(n)??n).insertBefore(t,e),U(e,null),(R?.view(n)??n).removeChild(e)):(Og(x,n),na(n,e,e,()=>U(e,null)),t!==null&&(R?.view(n)??n).insertBefore(t,e))}else t!==null&&(R?.view(n)??n).insertBefore(t,i??null)}x.hostNode=t;return}x.start===null&&(x.start=(R?.view(document)??document).createComment(``),(R?.view(n)??n).insertBefore(x.start,x.end));let e=x.hostNode;e===null&&g!==null&&(e=V(x.start),e===x.end&&(e=null));let t=pg(e,r,h,Vd(n));if(t!==e){if(e!=null&&e!==t&&(R?.view(e)??e).parentNode!==null){if(M!==null){Og(x,n);let t=e;na((R?.view(e)??e).parentNode,e,e,()=>U(t,null))}else U(e,null),z((R?.view(e)??e).parentNode).removeChild(e)}t!==null&&z(z(x.start).parentNode).insertBefore(t,x.end)}x.hostNode=t;return}T=bg,re=r}else if(typeof r==`function`)T=r,ie=!0;else if(_h(r)){let e=Cd,t=e!==null&&r.type===e.type;if(!t&&typeof r.type!=`function`&&typeof r.type!=`string`)throw xh(r.type);T=t?e.body:r.type,re=r.props,ae=r.__octaneInvocationSite,oe=r.key,se=r.key!=null}if(T!==null){if(ie&&x.block!==null&&x.currentIsBodyFn){let e=bl(T),t=x.block.$$implicitBail;if(e&&!t&&(x.block.$$implicitBail=!0,x.block.memoInChain=!0),t&&e&&T===x.currentComp&&Wg(x.block))return;x.block.body!==T&&N(x.block,`body`,x.block.body),x.currentComp!==T&&N(x,`currentComp`,x.currentComp),x.block.body=T,I(x.block),x.currentComp=T;return}if(x.block!==null&&T===x.currentComp){if(Ug(x.block,T,re)||re===x.block.props&&(T!==bg||Zh(x.block,re))&&Wg(x.block))return;x.block.props!==re&&N(x.block,`props`,x.block.props),x.block.props=re,I(x.block);return}let r=hn||en?{parentScope:e,invocationSite:ae,key:oe,hasKey:se}:void 0,i=x.block===null&&x.hostNode===null&&x.text===null||h.idState.renderOwner?.signalOwner===void 0?void 0:{parent:e,slot:t,kind:x.__kind,branch:void 0,component:ie?void 0:T,key:void 0},a=xr,o=h.currentRenderMode===`transition`,s=a!==null&&x.block!==null&&x.block.mounted&&g===null&&b_(h),c=M===null||s?a:null,l=c!==null&&x.block!==null&&x.block.mounted&&x.end!==null&&g===null,u=l&&!o&&s,d=u&&!o;if(l&&(o||u)){let e=c.render(h,n,x.end,T,re,dc,`dynamic`,void 0,!1,r,i);if(e.suspended||e.failed)throw c.dispose(e.wip),e.failed?e.error:new zl(e.suspended);if(x.borrowed||d)c.dispose(e.wip);else{let t=x.block;if(x.block=e.wip.block,x.currentComp=T,x.currentIsBodyFn=ie,c.splice(e.wip),Fh(x,t),h.disposed||x.block!==e.wip.block||e.wip.block.disposed)return;jh(e.wip,x.end);return}}if(g===null&&T===bg&&x.block===null&&x.hostNode!==null&&x.hostNode.nodeType===1&&x.hostNode.localName===re.type&&x.hostNode.namespaceURI===(Bd(re.type,Vd(n))??Rd)&&!Hh(re.props)&&!Hh(Yh(x.hostNode)?.props??null)){let e=x.hostNode;x.hostNode=null,x.currentComp=T,x.currentIsBodyFn=!1;let t=Qs(`dynamic`,h,n,x.start,x.end,T,re,void 0,dc);r!==void 0&&Fn(t,r),sa(t),x.borrowed&&(t.exclusiveMarkers=!0),t.$$implicitBail=!0,t.memoInChain=!0,t.deoptNode=e,x.block=t,wg={block:t,children:Yh(e)?.children};try{I(t)}finally{wg=null}return}if(M!==null&&C&&(e.mounted||M.retainedCreated?.has(h))&&!s&&g===null){let t=x.ownerHost!==null||x.borrowed&&x.start===null?(R?.view(n)??n).lastChild:x.end===null?x.block?.endMarker??x.text??x.hostNode:z(x.end).previousSibling;if(t!==null&&(R?.view(t)??t).parentNode===n){Ph(x);let a=!ie||bl(T),o=Dh(h,n,t,T,re,dc,`dynamic`,void 0,a,r,i);if(o.suspended||o.failed)throw Nh(o.wip),o.suspended===null?o.error:new zl(o.suspended);if(e===h&&h.forSlot!==null&&!h.exclusiveMarkers&&x.borrowed&&w_(h,x.start,x.end)){let e=x.start,t=x.end;x.start=o.wip.start,x.end=o.wip.end,N(o.wip.block,`exclusiveMarkers`,o.wip.block.exclusiveMarkers),o.wip.block.exclusiveMarkers=!0,C_(h,e,t,x.start,x.end),na(n,e,e),na(n,t,t)}x.start===null&&x.ownerHost===null&&!x.borrowed&&(x.start=o.wip.start),x.block=o.wip.block,x.currentComp=T,x.currentIsBodyFn=ie,kh(o.wip);return}}if(g===null&&(Ph(x),h.disposed))return;x.currentComp=T,x.currentIsBodyFn=ie,x.start===null&&x.ownerHost===null&&!x.borrowed&&(x.start=(R?.view(document)??document).createComment(``),(R?.view(n)??n).insertBefore(x.start,x.end));let f=Qs(`dynamic`,h,n,x.start,x.end,T,re,void 0,dc);r!==void 0&&Fn(f,r),x.borrowed&&(f.exclusiveMarkers=!0),(!ie||bl(T))&&(f.$$implicitBail=!0,f.memoInChain=!0),x.block=f,I(f),g!==null&&!x.borrowed&&x.end!==null&&(g.node=V(x.end));return}if(typeof r==`object`&&r)throw bh(r);(x.block!==null||x.hostNode!==null)&&Ph(x);let ce=Eh(r);if(ce===``){x.text!==null&&(M===null?(z(x.text).remove(),x.text=null):Ph(x));return}if(x.text!==null){Hu(x.text,ce);return}if(g!==null){let e=g.node;if(e!==null&&e!==x.end&&e.nodeType===3){x.text=e,g.node=V(e),Hu(e,ce);return}}let le=(R?.view(document)??document).createTextNode(ce);(R?.view(n)??n).insertBefore(le,x.end),x.text=le}function Lg(e,t,n,r,i,a,o){if(md(n,r))return;let s=typeof r;if(s===`object`||s===`function`){Ig(e,t,n,r,i,a,void 0,o);return}let c=e.slots[t];if(c===void 0||c.block!==null||c.forSlot!==null||c.hostNode!==null||c.portal!==null){Ig(e,t,n,r,i,a,void 0,o);return}t===0&&e!==cc&&c.returnedOutput===!0&&lc(c,!1);let l=s===`string`?r:s===`boolean`||r==null?``:String(r);if(c.text!==null){Hu(c.text,l);return}if(l===``)return;M!==null&&Og(c,n);let u=(R?.view(document)??document).createTextNode(l);(R?.view(n)??n).insertBefore(u,c.end),c.text=u}function Rg(e,t,n,r,i){if(n.nodeType===1&&Be.has(n.localName)&&!Dg(e.block,n)&&r!=null)throw Error(E(26,n.localName));if(md(n,r))return null;let a=typeof r,o=e.slots[t];if(M!==null&&o===void 0&&e.mounted&&(ja(),Zi(n,null,null),N(e.slots,t,e.slots[t])),o===void 0&&a!==`object`&&a!==`function`){let o=r==null||r===!1||r===!0?``:a===`string`?r:String(r);if(o===``)return i!==null&&(R?.view(i)??i).remove(),null;if(i!==null)return Hu(i,o),i;let s=H();if(s!==null)return s.htext(n,o,Gn(e,t));let c=(R?.view(document)??document).createTextNode(o);return(R?.view(n)??n).appendChild(c),c}o===void 0&&i!==null&&(R?.view(i)??i).remove();let s=H();s!==null&&o===void 0&&(s.node=B(n)),Ig(e,t,n,r,null,!1,n);let c=e.slots[t];return c.block===null&&c.forSlot===null&&c.hostNode===null?c.text:null}function zg(e){let t=e.$$ctxReads;if(t===null)return!1;for(let[e,n]of t)if(e.$$version!==n)return!0;return!1}function Bg(e){let t=e.$$ctxDirect;if(t===null)return!1;for(let[e,n]of t)if(e.$$version!==n)return!0;return!1}function Vg(e){if(e.$$ctxDepsEpoch!==Ae()){if(Bg(e))return!1;zg(e)?Hg(e):e.$$ctxDepsEpoch=Ae()}return!0}function Hg(e){let t=e._slots;if(t!==null)for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n.__kind===`forBlockSlot`){let e=n.items;for(let t of e.values())Kg(t);n.emptyBlock&&Kg(n.emptyBlock)}else if(n.block)Kg(n.block);else if(n.__kind===`childSlot`&&n.forSlot){let e=n.forSlot.items;for(let t of e.values())Kg(t)}else n.__kind===`childSlot`&&n.portal!==null&&n.portal.block!==null&&Kg(n.portal.block)}}function Ug(e,t,n){if(t.__memo!==!0||!e.mounted||e.renderStatus!==qn)return!1;let r=t.__compare;return!(r?t[ou]===void 0?r(e.props,n):r(e.props,n,e):Jg(e.props,n))||!Vg(e)?!1:(Gg(e),p_(e),!0)}function Wg(e){if(e.$$implicitBail!==!0||!e.mounted||e.renderStatus!==qn)return!1;let t=e.body[ou];return t!==void 0&&!t(e)||!Vg(e)?!1:(Gg(e),p_(e),!0)}function Gg(e){let t=e.$$ctxReads,n=e.$$ctxDirect,r=t!==null&&t.size>0,i=n!==null&&n.size>0;if(r||i)for(let a=e.parentBlock;a!==null;a=a.parentBlock){if(a.body?.__memo!==!0&&a.$$implicitBail!==!0)continue;let e=a.$$ctxReads??=new Map;if(r)for(let[n,r]of t){let t=e.get(n);if(t!==r){let i=n.$$version;(t===void 0||t===i)&&(e.set(n,r),r!==i&&(a.$$ctxDepsEpoch=-1))}}if(i)for(let[t,r]of n){let n=e.get(t);if(n!==r){let i=t.$$version;(n===void 0||n===i)&&(e.set(t,r),r!==i&&(a.$$ctxDepsEpoch=-1))}}}}function Kg(e){let t=e.$$ctxDepsEpoch===Ae();!t&&Bg(e)?I(e):e.body?.__memo===!0||e.$$implicitBail===!0?t||(zg(e)?Hg(e):e.$$ctxDepsEpoch=Ae()):(t||(e.$$ctxDepsEpoch=Ae()),Hg(e))}var qg=Object.prototype;function Jg(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t);if(n!==qg&&n!==null||r!==qg&&r!==null)return Yg(e,t);let i=0;for(let n in e){let r=e[n];if(!Ze.call(t,n)||!Object.is(r,t[n]))return!1;i++}for(let e in t)i--;return i===0}function Yg(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++){let i=n[r];if(!Ze.call(t,i)||!Object.is(e[i],t[i]))return!1}return!0}var Xg=Symbol(`memoOwner`),Zg={get(){return this===this[Xg]}},Qg={configurable:!0,get(){return this.type.defaultProps},set(e){this.type.defaultProps=e}};function $g(e,t){function n(t,n,r){return e(t,n,r)}Object.defineProperty(n,Xg,{value:n}),Object.defineProperty(n,\"type\",{value:e}),Object.defineProperty(n,\"displayName\",{configurable:!0,writable:!0,value:e.displayName||e.name||`Memo`}),Object.defineProperty(n,\"__memo\",Zg),Object.defineProperty(n,\"defaultProps\",Qg);let r=e[ou];return r===void 0?t&&Object.defineProperty(n,\"__compare\",{value:t}):(su(n,r),Object.defineProperty(n,\"__compare\",{value:(e,n,i)=>r(i)&&(t?t(e,n):Jg(e,n))})),n}var e_=1/0;function t_(e){for(;e.parentBlock!==null;)e=e.parentBlock;return e}var n_=null,r_=0;function i_(e){if(r_===0)return!0;let t=n_;for(let n=e;n!==null;n=(R?.view(n)??n).parentNode)if(t.has(n))return!1;return!0}function a_(e,t,n=null){let r=null,i=null;for(let a=e;a!==null;a=a.parentBlock){if(t&&r===null&&a.inactive){let e=a.__activitySlot;e!==void 0&&e.block===a&&e.hidden&&(r=e)}let e=a.__trySlot;if(e!==void 0&&e.tryBlock===a){if(e.hiddenDom!==null)return e;n!==null&&!e.propagateSuspense&&e.hasResolved&&e.branch===1&&(e.transitionHeld||n===`transition`)&&(i=e)}}return r??i}function o_(e){return a_(e,!1)}function s_(e){for(let t=e;t!==null;t=t.parentBlock){if(!t.inactive)continue;let e=t.__activitySlot;if(e!==void 0&&e.block===t&&e.hidden)return e}return null}function c_(e,t){let n=new Map,r=e=>{let i=e.effectSlots;if(i!==null)for(let e=0;e<i.length;e++){let r=i[e];(t===void 0||r.phase===t)&&n.set(r,{deps:r.deps,revision:r.revision,active:r.active})}O_(e,r)};return r(e),n}function l_(e,t,n){let r=e=>{let i=e.effectSlots;if(i!==null)for(let e=0;e<i.length;e++){let r=i[e];if(n!==void 0&&r.phase!==n)continue;let a=t.get(r);a===void 0?(r.deps=void 0,r.revision=0,r.active=!1):(r.deps=a.deps,r.revision=a.revision,r.active=a.active)}O_(e,r)};r(e)}var u_=null;function d_(e){for(let t=u_;t!==null;t=t.parent)t.insertionReplays?.delete(e)}function f_(e,t,n){for(let r=u_;r!==null;r=r.parent)r.queues[t]===n&&r.queuedSlots.add(e)}function p_(e){let t=u_;if(t===null||e!==t.root&&!Ts(t.root,e))return;let n=[],r=e=>{let i=e.effectSlots;if(i!==null)for(let r=0;r<i.length;r++){let a=i[r];if(t.queuedSlots.has(a))continue;let o=t.insertionReplays?.get(a);if(o!==void 0){n.push({scope:e,effect:a,replay:o});continue}a.active&&a.disconnected&&a.connectedFn!==null&&n.push({scope:e,effect:a,replay:null})}O_(e,r)};r(e);for(let e=0;e<n.length;e++){let{scope:r,effect:i,replay:a}=n[e],o=t.queues[i.phase];if(a!==null){let e=a[a.length-1];M!==null&&Ma(i),i.active=e.fn!==null,i.deps=e.fn===null?void 0:e.args;let t=++i.revision;for(let e=0;e<a.length;e++)o.push({...a[e],revision:t,seq:lo++})}else o.push({scope:r,slot:i.slot,fn:i.connectedFn,order:i.order,revision:i.revision,args:i.connectedArgs,phase:i.phase,seq:lo++});f_(i,i.phase,o)}}function m_(e){h_(e)}function h_(e,t){Sr(),Nr(),yr++;let n=kr,r=Ar,i=n??r??Pr(),a=n===null&&r===null;kr=i,t!==void 0&&(Gr(i,t),Kr(i));let o=Jp;o!==null&&o.transitions++;let s;try{to(1);try{let t=Gt,n=ye(()=>{let e=Mr(i);return Kt(e),e});try{s=e()}finally{Kt(t),ye(n)}s!=null&&typeof s.then==`function`&&(i.pendingActions++,Ar=i),a&&(i.closed=!0,Br(i))}catch(e){throw a&&(i.closed=!0,Br(i)),e}finally{kr=n,yr--}}catch(e){to(-1),o!==null&&Zp(o),em(),i.workComplete=!0,qr(i),g_(e,t);return}if(s!=null&&typeof s.then==`function`){br++;let e=!1,n=()=>{e||(e=!0,i.pendingActions--,Br(i),to(-1),br--,o!==null&&Zp(o),em(),queueMicrotask(()=>{i.workComplete=!0,qr(i)}))};s.then(n,e=>{n(),g_(e,t)})}else queueMicrotask(()=>{to(-1),o!==null&&Zp(o),em(),i.workComplete=!0,qr(i)})}function g_(e,t){t!==void 0&&!t.block.disposed?(t.error={value:e},Do(t.block)):Fp(e)}function __(e){let t=e,n=e;for(;n;){let e=n.$$tryHandler;if(e&&n.__trySlot?.catchBody!==null)return e;n=n.parentBlock}return El(t)}function v_(e,t,n=null){if(Au(t))throw t;if(kl(t)){let n=Tl(e);if(n!==null&&n.routeSuspense(t.thenable))return;t=Error(E(27))}if(Bl(t)){let r=e;for(;r;){let n=r.__suspenseHandler;if(n){n(t.thenable,e);return}r=r.parentBlock}let i=Dl(e);if(i!==null){i(t.thenable);return}if(da(e,t.thenable,n))return;throw t}let r=__(e);if(r)ov(e,t,r(t));else throw t}function y_(e,t){try{v_(e,t)}catch(t){if(k!==null||vr)throw t;let n=t_(e);cv(e,t)||console.error(t),n.kind===`root`&&!n.disposed&&L(n)}}function b_(e){for(let t=e;t!==null;t=t.parentBlock){let e=t.__trySlot;if(e!==void 0&&e.tryBlock===t&&e.pendingBody!==null&&e.hasResolved&&e.branch===1&&e.hiddenDom===null)return!0}return!1}function x_(e,t,n,r=null){let i=0,a=e._slots;if(a!==null)for(let e=0;e<a.length;e++){let o=a[e];o.anchor===n&&(o.__kind===`ifBlockSlot`||o.__kind===`switchBlockSlot`||o.__kind===`componentSlotSlot`&&o.block?.parentNode===t)&&(i++,r!==null&&(N(o,`anchor`,o.anchor),o.anchor=r))}let o=e.children;if(o!==null)for(let a=0;a<o.length;a++){let s=o[a].scope,c=s.block;c!==e.block&&c.parentNode===t&&c.endMarker===n&&(i+=x_(s,t,n,r)||1,r!==null&&(N(c,`endMarker`,c.endMarker),c.endMarker=r))}return i}function S_(e,t,n,r,i,a){if(e.markerlessBefore=void 0,e.borrowed&&e.start===null)return;let o=i?V(i):B(t),s=a?(R?.view(a)??a).previousSibling:(R?.view(t)??t).lastChild;if(s!==null&&o===s&&o.nodeType===1&&x_(n,t,a)<=1)n.startMarker=o,n.endMarker=o,e.end=o;else{let i=(R?.view(document)??document).createComment(r),s=(R?.view(document)??document).createComment(`/`+r);(R?.view(t)??t).insertBefore(i,o??a),(R?.view(t)??t).insertBefore(s,a),n.startMarker=i,n.endMarker=s,n.exclusiveMarkers=!0,e.start=i,e.end=s,x_(n,t,a,s)}}function C_(e,t,n,r,i){if(t===null||n===null)return;let a=e;for(;a!==null&&a.startMarker===t&&a.endMarker===n;)N(a,`startMarker`,a.startMarker),N(a,`endMarker`,a.endMarker),a.startMarker=r,a.endMarker=i,a=a.parentBlock}function w_(e,t,n){return e!==null&&t!==null&&n!==null&&e.startMarker===t&&e.endMarker===n}function T_(e,t,n,r,i,a,o,s){if(k?.pending&&!k.crossRenderUpdate)return;let c=e.block,l=H();if(i!==n.branch){if(M!==null&&(n.branch!==-1||l!==null)){let e=n.block;if(n.markerlessBefore!==void 0&&e!==null)Xi(n,r,n.markerlessBefore,e.endMarker);else if(n.start!==null)Xi(n,r,n.borrowed?n.start:z(n.start).previousSibling,n.borrowed?n.end:z(n.end)?.nextSibling??null);else if(n.borrowed&&e?.startMarker==null)Xi(n,r,null,null);else{let t=e?.startMarker??null,i=e?.endMarker??null;if(t!==null&&i!==null&&(R?.view(t)??t).parentNode===r&&(R?.view(i)??i).parentNode===r)Xi(n,r,(R?.view(t)??t).previousSibling,V(i));else{let e=n.anchor;Xi(n,r,e===null?(R?.view(r)??r).lastChild:(R?.view(e)??e).previousSibling,e)}}}let u=xr,d=c.currentRenderMode===`transition`,f=u!==null&&n.block!==null&&n.block.mounted&&n.markerlessBefore===void 0&&a!==null&&l===null&&b_(c),p=M===null||f?u:null,m=!d&&f,h=null,g=n.markerlessBefore;if(g!==void 0&&n.block!==null){let e=n.block;h=e.endMarker;let t=g?V(g):B(r);if(n.block=null,n.markerlessBefore=void 0,L(e,!1),c.disposed)return;for(;t!==null&&t!==h;){let e=V(t);(R?.view(t)??t).parentNode===r&&(R?.view(r)??r).removeChild(t),t=e}}let _=h===null&&n.start===null&&n.block!==null&&n.block.endMarker!==null?n.block.endMarker:n.end,v=M;if(v!==null&&!f&&l===null&&n.block!==null&&n.block.mounted&&!ia(v,n.block)){let l=n.block,u=l.startMarker,d=l.endMarker,f=n.borrowed,p=f?n.start===null?B(r):V(n.start):n.start??u;f&&p===n.end&&(p=null);let m=f?p===null?null:n.end===null?(R?.view(r)??r).lastChild:z(n.end).previousSibling:_;if(a===null){if(n.start!==null)p=V(n.start),p===n.end&&(p=null),m=p===null?null:z(n.end).previousSibling;else{let e=m===null?n.anchor:V(m);if(w_(c,u,d)){let t=(R?.view(document)??document).createComment(o),i=(R?.view(document)??document).createComment(`/`+o);(R?.view(r)??r).insertBefore(t,e),(R?.view(r)??r).insertBefore(i,e),n.start=t,n.end=i,n.borrowed=!1,C_(c,u,d,t,i)}else n.anchor=e,n.end=null}n.block=null,n.branch=i,ta(l,r,p,m);return}let h=p===null?f?n.start:null:m;if(h!==null&&(R?.view(h)??h).parentNode===r){let g=Dh(c,r,h,a,void 0,null,`control-flow`,s,!1,void 0,c.idState.renderOwner?.signalOwner===void 0?void 0:{parent:e,slot:t,kind:n.__kind,branch:i,component:void 0,key:void 0});if(g.suspended||g.failed)throw Nh(g.wip),g.suspended===null?g.error:new zl(g.suspended);z(g.wip.start).data=o,z(g.wip.end).data=`/`+o,n.start=g.wip.start,n.end=g.wip.end,n.borrowed=!1,n.block=g.wip.block,n.branch=i,f||C_(c,u,d,g.wip.start,g.wip.end),N(g.wip.block,`exclusiveMarkers`,g.wip.block.exclusiveMarkers),g.wip.block.exclusiveMarkers=!0,kh(g.wip),ta(l,r,p,m);return}}if(p!==null&&n.block!==null&&a!==null&&l===null&&(d||m)&&_!==null){let l=n.block,u=l.startMarker,d=l.endMarker,f=p.render(c,r,_,a,void 0,null,`control-flow`,s,!1,void 0,c.idState.renderOwner?.signalOwner===void 0?void 0:{parent:e,slot:t,kind:n.__kind,branch:i,component:void 0,key:void 0});if(f.suspended||f.failed)throw p.dispose(f.wip),f.failed?f.error:new zl(f.suspended);if(n.borrowed)p.dispose(f.wip);else{z(f.wip.start).data=o,z(f.wip.end).data=`/`+o;let e=n.start,t=n.end,r=n.block;n.start=f.wip.start,n.end=f.wip.end,n.block=f.wip.block,n.branch=i,C_(c,u,d,f.wip.start,f.wip.end),f.wip.block.exclusiveMarkers=!0,p.splice(f.wip),L(r),e!==null&&((R?.view(e)??e).remove(),(R?.view(t)??t)?.remove()),c.disposed||n.block!==f.wip.block||f.wip.block.disposed;return}}let y=h??(_===null?n.anchor:V(_)),b=n.block,x=b?.startMarker??null,S=b?.endMarker??null,C=w_(c,x,S);if(n.block){if(L(n.block),c.disposed)return;n.block=null}if(n.branch=i,n.start===null&&a!==null&&C){let e=(R?.view(document)??document).createComment(o),t=(R?.view(document)??document).createComment(`/`+o);(R?.view(r)??r).insertBefore(e,y),(R?.view(r)??r).insertBefore(t,y),n.start=e,n.end=t,C_(c,x,S,e,t)}if(n.start!==null){if(a){let e,t,i=!1,o=!1,u=null,d=null;if(l!==null&&l.isOpen(V(n.start))&&(u=V(n.start),d=l.close(u),d!==n.end&&V(d)!==n.end)){if(Du?.revision!==void 0)throw Error(E(75));N_(V(n.start),n.end),u=null,o=!0}u===null?(e=n.start,t=n.end,i=!0,l!==null&&(l.node=V(n.start))):(e=u,t=d,l.node=V(u));let f=Qs(`control-flow`,c,r,e,t,a,void 0,s);i&&(f.exclusiveMarkers=!0),n.block=f,o?(l.suspend(()=>I(f)),l.node=V(n.end)):I(f)}else if(l!==null&&V(n.start)!==n.end){if(Du?.revision!==void 0)throw Error(E(75));N_(V(n.start),n.end)}}else if(a){let e=y?(R?.view(y)??y).previousSibling:(R?.view(r)??r).lastChild,t=Qs(`control-flow`,c,r,null,y,a,void 0,s);n.block=t,n.markerlessBefore=e,I(t),S_(n,r,t,o,e,y),C_(c,x,S,t.startMarker,t.endMarker)}else if(!C)n.anchor=y,n.end=null;else{let e=(R?.view(document)??document).createComment(o),t=(R?.view(document)??document).createComment(`/`+o);(R?.view(r)??r).insertBefore(e,y),(R?.view(r)??r).insertBefore(t,y),n.start=e,n.end=t,C_(c,x,S,e,t)}}else if(n.block){n.block.body!==a&&N(n.block,`body`,n.block.body),n.block.extra!==s&&N(n.block,`extra`,n.block.extra),n.block.body=a,n.block.extra=s,I(n.block);let e=n.markerlessBefore;e!==void 0&&S_(n,r,n.block,o,e,n.block.endMarker)}l!==null&&!n.borrowed&&n.end!==null&&(l.node=V(n.end))}function E_(e,t,n,r,i,a,o,s){let c=e.slots[t];if(t===0&&e!==cc&&c?.returnedOutput===!0){if(k?.pending&&!k.crossRenderUpdate)return;if(c.__kind===`ifBlockSlot`)lc(c,!1);else{let t=e.block;if(t.outputHandler(t,null,!0),t.disposed)return;c=void 0}}if(c===void 0){let r=H(),i=null,a=null,s=r?.passthroughRanges===!0,l=s?null:r?.resolveOpen(o??null,n)??null;l!==null&&(i=l,a=r.close(l)),c={__kind:`ifBlockSlot`,anchor:o??null,start:i,end:a,borrowed:s,branch:-1,block:null,markerlessBefore:void 0},e.slots[t]=c,xc(e,c)}let l=+!!r;T_(e,t,c,n,l,l?i:a,`if`,s)}var D_=null;function O_(e,t,n=!0){let r=e.children;if(r!==null)for(let e=0,n=r.length;e<n;e++)t(r[e].scope);let i=e._slots;if(i!==null)for(let e=0,r=i.length;e<r;e++){let r=i[e];if(r.__kind===`forBlockSlot`){for(let e=r.head;e!==null;e=e.nextSibling)t(e);r.emptyBlock&&t(r.emptyBlock)}else if(r.__kind===`childSlot`){if(r.block&&t(r.block),r.forSlot){for(let e=r.forSlot.head;e!==null;e=e.nextSibling)t(e);r.forSlot.emptyBlock&&t(r.forSlot.emptyBlock)}r.portal?.block&&t(r.portal.block)}else r.block&&(t(r.block),n&&r.__kind===`trySlotSlot`&&r.tryBlock&&r.tryBlock!==r.block&&t(r.tryBlock))}}function k_(e,t,n=!0,r=!0,i=null,a=null){let o=e.deoptNode;o!=null&&U(o,t,n,e,i,a);let s=e.refFields;if(s!==null){let r=e.slots[0];if(r!=null)for(let o=0,c=s.length;o<c;o+=3){let c=s[o];if(c===`r`){let c=r[s[o+2]],l=r[s[o+1]]??a?.get(c)?.connected;if(l==null)continue;t.push({ref:l,el:c,scope:e}),n&&!hs(i,c,l)&&bd(l,null,c)}else if(c===`s`){let c=r[s[o+2]];if(c==null)continue;let l=r[s[o+1]],u=(l?.[df]===!0?l.resolved:l)?.ref??a?.get(c)?.connected;if(u==null)continue;t.push({ref:u,el:c,scope:e}),n&&!hs(i,c,u)&&bd(u,null,c)}else{let c=r[s[o+1]];if(c==null)continue;let l=c._currentRef??a?.get(c)?.connected;if(l==null)continue;t.push({ref:l,el:c,scope:e}),n&&!hs(i,c,l)&&bd(l,null,c)}}}let c=e.slots;for(let r=0,o=c.length;r<o;r++){let o=c[r];if(typeof o==`object`&&o){if(o.anchor!==void 0&&o.el instanceof Element){let r=o.ref??a?.get(o.el)?.connected;r!=null&&(t.push({ref:r,el:o.el,scope:e}),n&&!hs(i,o.el,r)&&bd(r,null,o.el))}o.__kind===`childSlot`&&o.hostNode!=null&&U(o.hostNode,t,n,e,i,a)}}O_(e,e=>k_(e,t,n,r,i,a),r)}function A_(e,t,n=null){k_(e,t,!1,!1,null,n)}function U(e,t,n=!0,r,i=null,a=null){if(!zh)return;let o=Yh(e)?.props?.ref??a?.get(e)?.connected;o!=null&&(t===null?rs(o,e):(t.push({ref:o,el:e,scope:r}),n&&!hs(i,e,o)&&bd(o,null,e)));let s=B(e);for(;s!==null;){let e=s.$$portalEnd;if(e!=null){s=hg(s,e);continue}U(s,t,n,r,i,a),s=V(s)}}function j_(e,t,n,r,i,a,o,s,c,l,u,d){if(k?.pending&&!k.crossRenderUpdate)return;let f=Array.isArray(r)?r:Array.from(r),p=e.block,m=H(),h=e.slots[t];if(h===void 0){let r,i;m!==null&&m.isOpen(l??null)?(r=l,i=m.close(l),m.node=V(r)):m!==null&&m.isOpen(m.node)?(r=m.node,i=m.close(m.node),m.node=V(r)):(r=(R?.view(document)??document).createComment(`for`),u===!0&&l?.nodeType===8?(i=l,(R?.view(i)??i).data=`/for`,(R?.view(n)??n).insertBefore(r,i)):(i=(R?.view(document)??document).createComment(`/for`),(R?.view(n)??n).insertBefore(r,l??null),(R?.view(n)??n).insertBefore(i,l??null))),h={__kind:`forBlockSlot`,start:r,end:i,items:new Map,head:null,tail:null,size:0,cachedDeps:null,emptyBlock:null,env:void 0,adopt:null,plainDeopt:!1,mappedNative:void 0,selectionItems:void 0,signalSite:d},e.slots[t]=h,xc(e,h)}m!==null&&h.size===0&&(m.node=V(h.start));let g=m?.markerState(h.start)??-1;M!==null&&h.env!==s&&N(h,`env`,h.env),h.env=s;let _=f.length===0;if(_&&c){if(h.size>0&&K_(p,h,f,i,a,!1,!1),h.emptyBlock)h.emptyBlock.body!==c&&N(h.emptyBlock,`body`,h.emptyBlock.body),h.emptyBlock.extra!==h.env&&N(h.emptyBlock,`extra`,h.emptyBlock.extra),h.emptyBlock.body=c,h.emptyBlock.extra=h.env,I(h.emptyBlock);else{j!==null&&Wa(h);let e=!1;m!==null&&(g===1||g===-1&&m.isOpen(V(h.start)))?(N_(V(h.start),h.end),e=!0):m!==null&&(m.node=V(h.start));let t=Qs(`control-flow`,p,n,h.start,h.end,c,void 0,h.env);t.exclusiveMarkers=!0,sa(t),h.emptyBlock=t,e?m.suspend(()=>I(t)):I(t)}m!==null&&(m.node=V(h.end));return}h.emptyBlock&&(Ha()?(Wa(h),Va(h.emptyBlock,h)):L(h.emptyBlock),h.emptyBlock=null),!_&&m!==null&&(g===0||g===-1&&!((o||0)&16)&&V(h.start)!==null&&V(h.start)!==h.end&&!m.isOpen(V(h.start)))&&(N_(V(h.start),h.end),m.node=h.end);let v=o||0,y=!!(v&1),b=!1;if(v&4&&s!==void 0){let e=!!(v&32);e&&j!==null&&M===null?(h.cachedDeps=null,y=!1):(h.cachedDeps!==null&&P_(h.cachedDeps,s)?y=!0:b=!e,M!==null&&h.cachedDeps!==s&&N(h,`cachedDeps`,h.cachedDeps),h.cachedDeps=s)}h.size===0?(U_(p,h,f,i,a,!!(v&2),!!(v&16)),m!==null&&M_(h.end,m)):K_(p,h,f,i,a,y,!!(v&2),b,!!(v&8),!!(v&16)),m!==null&&(m.node=V(h.end))}function M_(e,t){let n=t.node;n!==null&&n!==e&&(R?.view(n)??n).parentNode===(R?.view(e)??e).parentNode&&(uv(()=>Error(E(56))),N_(n,e))}function N_(e,t){let n=e;for(;n!==null&&n!==t;){let e=V(n);(R?.view(n)??n).remove(),n=e}}function P_(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!Object.is(e[r],t[r]))return!1;return!0}function F_(e,t,n){if(j===null&&D===null){t(e.props,e,n);return}let r=O;O=e;let i=D===null?-1:zn(e);try{t(e.props,e,n)}finally{i>=0&&D.endScope(i),O=r}}var I_=4,L_=new Int32Array(I_),R_=16384,z_=null,B_=null;function V_(e,t,n,r,i,a,o,s){let c=M!==null&&!Wi;c&&e.itemIndex!==n&&N(e,`itemIndex`,e.itemIndex),c&&e.body!==r&&N(e,`body`,e.body),i&&e.props===t&&(o||e.itemIndex===n)?(e.itemIndex=n,e.body=r):(c&&(e.props!==t||e.extra!==s)&&j.push(Ni,e,e.props,e.extra),e.props=t,e.body=r,e.itemIndex=n,e.extra=s,a?F_(e,r,s):I(e))}function H_(e,t,n,r){return typeof e==`function`?r?`k`+String(e(t,n)):e(t,n):e[n]}function U_(e,t,n,r,i,a,o,s=!1,c=!1){let l=n.length,u=e.idState.renderOwner?.signalOwner===void 0?void 0:kn(e,t,l,r);if(l===0)return;j!==null&&Wa(t);let d=t.items,f=z(t.end).parentNode,p=t.adopt,m=null,h=null;if(p!==null){m=new Map;for(let e=0;e<p.length;e++){let t=p[e];m.has(t.key)||m.set(t.key,t)}}let g=null;try{for(let p=0;p<l;p++){let l=n[p],_=H_(r,l,p,s);u!==void 0&&u(p,_);let v=null,y=t.end;if(m!==null){y=V(g===null?t.start:g.endMarker);let e=m.get(_);e!==void 0&&(v=e.node,m.delete(_),(h??=new Set).add(v),v!==y&&(Uo===null?(R?.view(f)??f).insertBefore(v,y):(Yo(f,Uo),ev(f,v,y,Uo))))}let b=c?W_(e,f,y,l,p,_,i,t):Z_(e,f,y,l,p,_,i,t,a,o,v);d.set(_,b),b.prevSibling=g,b.nextSibling=null,g?g.nextSibling=b:t.head=b,g=b}t.tail=g,t.size=l}catch(e){for(;g!==null;){let t=g;g=t.prevSibling,d.delete(t.key);let n=c?t.startMarker:null,r=c?t.endMarker:null,i=c&&!Bl(e)&&!kl(e)&&!Au(e);i&&n!==null&&z(n).parentNode!==null&&Qi(z(n).parentNode),Bl(e)&&$l(t),t.idState.renderOwner?.signalOwner===void 0?L(t,!M?.retainedCreated?.has(t)):En(t,e),n!==null&&r!==null&&G_(n,r,i)}throw t.head=null,t.tail=null,t.size=0,e}if(m!==null){let e=0;for(let t=0;t<p.length;t++){let n=p[t];h?.has(n.node)||(p[e++]=n)}p.length=e}}function W_(e,t,n,r,i,a,o,s){let c=H(),l=c.node,u=l!==null&&z(l).parentNode===t?l:n,d=(R?.view(document)??document).createComment(`it`),f=(R?.view(document)??document).createComment(`/it`);(R?.view(t)??t).insertBefore(d,u),(R?.view(t)??t).insertBefore(f,n),j!==null&&Yi(()=>{(R?.view(d)??d).remove(),(R?.view(f)??f).remove()});let p=Qs(`control-flow`,e,t,d,f,o,r,s.env);p.forSlot=s,p.key=a,p.itemIndex=i,sa(p);let m=l===null||l===n||c.isFresh(l),h=c.passthroughRanges;c.passthroughRanges=!0;try{m?c.suspend(()=>I(p)):I(p)}catch(e){Bl(e)&&$l(p);let n=h&&!c.passthroughRanges&&!Bl(e)&&!kl(e)&&!Au(e);throw n&&Qi(t),L(p,!1),G_(d,f,n),e}finally{c.passthroughRanges=h&&c.passthroughRanges}let g=c.node;if((R?.view(t)??t).insertBefore(f,g!==null&&z(g).parentNode===t?g:n),c.node=V(f),c.markFresh(d),c.markFresh(f),m)for(let e=V(d);e!==null&&e!==f;e=V(e))c.markFresh(e);return p}function G_(e,t,n){if(!n){(R?.view(e)??e).remove(),(R?.view(t)??t).remove();return}for(let n=e;n!==null;){let e=V(n);if(yu(n)||(R?.view(n)??n).remove(),n===t)break;n=e}}function K_(e,t,n,r,i,a,o,s=!1,c=!1,l=!1,u=!1){let d=t.items,f=t.size,p=n.length,m=z(t.end).parentNode,h=j!==null;if(f===0){U_(e,t,n,r,i,o,l,u);return}let g=e.idState.renderOwner?.signalOwner===void 0?void 0:kn(e,t,p,r);if(p===0){let e=h&&J_(t);e&&(Fi.get(t)??-1)<Ii?Ga(t):h&&Wa(t),X_(t,e?t.items:d,e),t.head=null,t.tail=null,t.size=0;return}let _=t.head,v=0;for(;_!==null&&v<p;){let e=n[v],o=H_(r,e,v,u);if(_.key!==o)break;g!==void 0&&g(v,o);let l=_;(!a||l.props!==e||l.body!==i||l.itemIndex!==v)&&V_(l,e,v,i,a,s,c,t.env),_=l.nextSibling,v++}if(v===p&&_===null)return;let y=t.tail,b=p-1,x=f-v;for(;y!==null&&x>0&&b>=v;){let e=n[b],o=H_(r,e,b,u);if(y.key!==o)break;g!==void 0&&g(b,o);let l=y;(!a||l.props!==e||l.body!==i||l.itemIndex!==b)&&V_(l,e,b,i,a,s,c,t.env),y=l.prevSibling,b--,x--}let S,C;if(x===0?(C=_,S=C?C.prevSibling:t.tail):(S=_.prevSibling,C=y.nextSibling),x===0){h&&Wa(t);let a=C?C.startMarker:t.end,s=S;for(let c=v;c<=b;c++){let f=n[c],p=H_(r,f,c,u);g!==void 0&&g(c,p);let h=Z_(e,m,a,f,c,p,i,t,o,l);d.set(p,h),h.prevSibling=s,h.nextSibling=C,s?s.nextSibling=h:t.head=h,s=h}C?C.prevSibling=s:t.tail=s,t.size+=b-v+1;return}if(v>b){h&&Wa(t);let e=_,n=0;for(;e!==C;){let t=e.nextSibling;Ha()?Va(e):L(e),d.delete(e.key),e=t,n++}S?S.nextSibling=C:t.head=C,C?C.prevSibling=S:t.tail=S,t.size-=n;return}let w=b-v+1,ee=[],te=new Map;for(let e=0;e<w;e++){let t=H_(r,n[v+e],v+e,u);ee[e]=t,te.set(t,e),g!==void 0&&g(v+e,t)}if(S===null&&C===null&&!te.has(_.key)){let r=!1,a=_.nextSibling;for(;a!==null;){if(te.has(a.key)){r=!0;break}a=a.nextSibling}if(!r){h&&Wa(t),X_(t,d),t.head=null,t.tail=null,t.size=0;let r=null;for(let a=0;a<p;a++){let s=n[a],c=ee[a],u=Z_(e,m,t.end,s,a,c,i,t,o,l);d.set(c,u),u.prevSibling=r,u.nextSibling=null,r?r.nextSibling=u:t.head=u,r=u}t.tail=r,t.size=p;return}}let ne=z_,T;ne!==null&&ne.length>=w?(z_=null,T=ne):T=new Int32Array(w);try{for(let e=0;e<w;e++)T[e]=-1;let r=!1,u=0,f=0,p=_,g=0;for(;p!==C;){let e=p.nextSibling,o=te.get(p.key);if(o===void 0)h&&=(Wa(t),!1),Ha()?Va(p):L(p),d.delete(p.key),t.size--;else{T[o]=g,o<u?r=!0:u=o,f++;let e=v+o,l=n[e];(!a||p.props!==l||p.body!==i||p.itemIndex!==e)&&V_(p,l,e,i,a,s,c,t.env)}p=e,g++}if(!r&&f===w){if(x!==f){let e=S;for(let n=0;n<w;n++){let r=d.get(ee[n]);r.prevSibling=e,e?e.nextSibling=r:t.head=r,e=r}e.nextSibling=C,C?C.prevSibling=e:t.tail=e}return}if(h&&Wa(t),r&&f===w){let e=0;for(let t=0;t<w;t++)if(T[t]!==t){if(e===I_){e=5;break}L_[e++]=t}if(e<=I_){let n=C?C.startMarker:t.end;for(let t=e-1;t>=0;t--){let e=L_[t];Q_(d.get(ee[e]),e+1<w?d.get(ee[e+1]).startMarker:n)}for(let n=0;n<e;n++){let e=L_[n],r=d.get(ee[e]),i=e>0?d.get(ee[e-1]):S,a=e+1<w?d.get(ee[e+1]):C;r.prevSibling=i,r.nextSibling=a,i?i.nextSibling=r:t.head=r,a?a.prevSibling=r:t.tail=r}let r=d.get(ee[0]),i=d.get(ee[w-1]);r.prevSibling=S,i.nextSibling=C,S?S.nextSibling=r:t.head=r,C?C.prevSibling=i:t.tail=i;return}}let y=C?C.startMarker:t.end;if(f===w){let e=tv(T,w),n=e.length-1,r=C;for(let i=w-1;i>=0;i--){let a=d.get(ee[i]);n<0||i!==e[n]?Q_(a,r?r.startMarker:y):n--,a.nextSibling=r,r?r.prevSibling=a:t.tail=a,r=a}r.prevSibling=S,S?S.nextSibling=r:t.head=r;return}if(r){let e=tv(T,w),t=e.length-1,n=y;for(let r=w-1;r>=0;r--){if(T[r]===-1)continue;let i=d.get(ee[r]);t<0||r!==e[t]?Q_(i,n):t--,n=i.startMarker}}let b=S,ne=0;for(let r=0;r<w;r++){let a=ee[r],s;if(T[r]===-1){if(ne<=r)for(ne=r+1;ne<w&&T[ne]===-1;)ne++;let c=ne<w?d.get(ee[ne]).startMarker:y,u=r+v;s=Z_(e,m,c,n[u],u,a,i,t,o,l),d.set(a,s),t.size++}else s=d.get(a);s.prevSibling=b,b?b.nextSibling=s:t.head=s,b=s}b.nextSibling=C,C?C.prevSibling=b:t.tail=b}finally{T.length<=R_&&(z_===null||z_.length<T.length)&&(z_=T)}}var q_=512;function J_(e){let t=M,n=z(e.start).parentNode;if(t===null||t.aborted||Wi||t.hydrating===!0||e.adopt!==null||e.size<16||n===null||n.nodeType!==1&&n.nodeType!==11||z(e.end).parentNode!==n||z(e.start).previousSibling!==null||V(e.end)!==null)return!1;let r=e.head;for(let e=r;e!==null;e=e.nextSibling)if(!e.mounted||e.idState.renderOwner!==t.owner||e.startMarker===null||e.startMarker!==e.endMarker||e.hooks!==null||e.effectSlots!==null||e.cleanups!==null||e.children!==null||e._slots!==null||e.refFields!==null||e.deoptNode!==null||e.vt!==null)return!1;return!0}function Y_(e,t=!1){if(!t&&!J_(e))return!1;let n=M,r=z(e.start).parentNode,i=e.head,a=n.retired??=new Set,o=[];for(let e=i;e!==null;e=e.nextSibling)a.has(e)||(a.add(e),o.push(e)),e.pending&&(N(e,`pending`,e.pending),e.pending=!1);let s=!1;Yi(()=>{s=!0;for(let e=0;e<o.length;e++)a.delete(o[e])});let c=e.start,l=e.end;return(n.commit??=[]).push(()=>{if(s)return;let t=e.size===0&&(R?.view(c)??c).parentNode===r&&(R?.view(l)??l).parentNode===r&&(R?.view(c)??c).previousSibling===null&&V(l)===null;if(t){let e=V(c);for(let n=i;n!==null;n=n.nextSibling){if(e!==n.startMarker){t=!1;break}e=V(e)}e!==l&&(t=!1)}for(let e=i;e!==null;e=e.nextSibling)e.disposed=!0;if(t)(R?.view(r)??r).textContent=``,(R?.view(r)??r).appendChild(c),(R?.view(r)??r).appendChild(l);else for(let e=i;e!==null;e=e.nextSibling){let t=e.startMarker;(R?.view(t)??t).parentNode!==null&&z((R?.view(t)??t).parentNode).removeChild(t)}}),!0}function X_(e,t,n=!1){if(Ua(e)){if(Y_(e,n)){t.clear();return}let r;for(let t=e.head;t!==null;t=r)r=t.nextSibling,Va(t);t.clear();return}let r=z(e.start).parentNode;if(z(e.start).previousSibling===null&&V(e.end)===null)(R?.view(r)??r).textContent=``,(R?.view(r)??r).appendChild(e.start),(R?.view(r)??r).appendChild(e.end);else if(t.size<q_)N_(V(e.start),e.end);else if(R!==null)R.clearBetween(e.start,e.end);else{let t=document.createRange();t.setStartAfter(e.start),t.setEndBefore(e.end),t.deleteContents()}for(let t=e.head;t!==null;t=t.nextSibling)t.cleanups!==null||t.children!==null||t._slots!==null?L(t,!1):(t.deoptNode!==null&&t.deoptRefs&&U(t.deoptNode,null),t.disposed=!0);t.clear()}function Z_(e,t,n,r,i,a,o,s,c,l,u=null){let d=H();if(d!==null){if(l&&!d.isOpen(d.node)&&(c!==2||s.plainDeopt!==!0||vh(r)&&!yg(r))){if(d.node!==null&&d.node!==s.end&&(c!==2||s.plainDeopt!==!0||d.node.nodeType===1&&z(d.node).parentNode===t)){let n=d.node,l=Qs(`control-flow`,e,t,n,n,o,r,s.env);return l.forSlot=s,l.key=a,l.itemIndex=i,c===2&&s.plainDeopt===!0&&(l.deoptNode=n),I(l),d.node=z(l.endMarker)?.nextSibling??V(n),l}return d.suspend(()=>Z_(e,t,n,r,i,a,o,s,c,l))}if(!d.isOpen(d.node))return d.suspend(()=>Z_(e,t,n,r,i,a,o,s,c,l));let u=d.node,f=d.close(u);d.node=V(u);let p=Qs(`control-flow`,e,t,u,f,o,r,s.env);return p.forSlot=s,p.key=a,p.itemIndex=i,I(p),d.node=V(f),p}if(c===!0||c===2&&vh(r)&&!yg(r)){if(u!==null){let n=Qs(`control-flow`,e,t,u,u,o,r,s.env);return n.forSlot=s,n.key=a,n.itemIndex=i,n.deoptNode=u,sa(n),I(n),n}let c=Qs(`control-flow`,e,t,null,n,o,r,s.env);c.forSlot=s,c.key=a,c.itemIndex=i,I(c);let l=(R?.view(n)??n).previousSibling;return c.startMarker=l,c.endMarker=l,c}let f=(R?.view(document)??document).createComment(`it`),p=(R?.view(document)??document).createComment(`/it`);u===null?((R?.view(t)??t).insertBefore(f,n),(R?.view(t)??t).insertBefore(p,n)):((R?.view(t)??t).insertBefore(f,u),(R?.view(t)??t).insertBefore(p,V(u)));let m=Qs(`control-flow`,e,t,f,p,o,r,s.env);m.forSlot=s,m.key=a,m.itemIndex=i,u!==null&&(m.deoptNode=u,sa(m));try{I(m)}catch(e){throw Bl(e)&&$l(m),L(m,!M?.retainedCreated?.has(m)),e}return m}function Q_(e,t){let n=z(e.startMarker).parentNode,r=e.endMarker,i=e.startMarker;if(Uo!==null){Yo(n,Uo),$_(n,i,r,t,Uo);return}for(;i;){let e=i===r,a=V(i);if((R?.view(n)??n).insertBefore(i,t),e)break;i=a}}function $_(e,t,n,r,i){let a=t;for(;a!==null;){let t=a===n,o=V(a);if(ev(e,a,r,i),t)break;a=o}}function ev(e,t,n,r){let i=null;if(Array.isArray(r)){for(let e=0;e<r.length;e++)if(r[e].focused.ownerDocument===t.ownerDocument){i=r[e];break}}else r.focused.ownerDocument===t.ownerDocument&&(i=r);if(R===null){Lt(e,t,n,i?.focused??null,i?.contentEditable??!1);return}let a=i?.focused??null,o=t===a;if(!o&&a!==null&&t.nodeType===1){let e=a;do{if(R.view(t).contains(e)){o=!0;break}e=R.view(e).getRootNode().host}while(e!==void 0)}if(!o){(R?.view(e)??e).insertBefore(t,n);return}let s=(R?.view(e)??e).moveBefore;if(!i.contentEditable&&typeof s==`function`){s.call(e,t,n);return}if(R.view(t).parentNode!==e||n!==null&&R.view(n).parentNode!==e){R.view(e).insertBefore(t,n);return}if(t!==n&&V(t)!==n){if(n===null||((R?.view(t)??t).compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0){let r=V(t);for(;r!==n;){let n=V(r);(R?.view(e)??e).insertBefore(r,t),r=n}}else{let r=V(t),i=n;for(;i!==t;){let t=V(i);(R?.view(e)??e).insertBefore(i,r),i=t}}}}function tv(e,t){let n=B_;(n===null||n.length<t)&&(n=new Int32Array(t),t<=R_&&(B_=n));let r=[];for(let i=0;i<t;i++){let t=e[i];if(t===-1)continue;if(r.length===0||e[r[r.length-1]]<t){n[i]=r.length===0?-1:r[r.length-1],r.push(i);continue}let a=0,o=r.length-1;for(;a<o;){let n=a+o>>1;e[r[n]]<t?a=n+1:o=n}t<e[r[a]]&&(n[i]=a>0?r[a-1]:-1,r[a]=i)}let i=r.length,a=r[i-1];for(;i-->0;)r[i]=a,a=n[a];return r}var nv=null;function rv(e,t){if(t===void 0)return;let{onCaughtError:n,onUncaughtError:r,onRecoverableError:i}=t;(n!==void 0||r!==void 0||i!==void 0)&&(nv??=new WeakMap).set(e,{onCaughtError:n,onUncaughtError:r,onRecoverableError:i})}function iv(e){if(nv===null||e===null)return null;let t=e;for(;t.parentBlock!==null;)t=t.parentBlock;return nv.get(t)??null}function av(e,t){try{e(t)}catch(e){console.error(e)}}function ov(e,t,n){let r=iv(e)?.onCaughtError;if(!(r===void 0||n===null||n?.disposed)){if(n!==void 0){let e=o_(n);if(e!==null){let i=()=>{if(n.disposed)return;let e=o_(n);if(e!==null){qc(e,i);return}av(r,t)};qc(e,i);return}}av(r,t)}}function sv(e){for(let t=0;t<e.length;t++){let n=e[t];if(!(n.block.disposed||n.state.block!==n.block)){if(a_(n.block,!0)!==null){n.resume();continue}av(n.handler,n.error)}}}function cv(e,t){let n=iv(e)?.onUncaughtError;return n!==void 0&&(av(n,t),!0)}var lv=null;function uv(e,t=null){if(nv===null)return;let n=t??k,r=iv(n)?.onRecoverableError;if(r===void 0)return;let i=n;for(;i.parentBlock!==null;)i=i.parentBlock;let a=lv??=new WeakSet;a.has(i)||(a.add(i),queueMicrotask(()=>{a.delete(i),av(r,e())}))}var dv=null,fv=(e=>e===void 0?null:e);function pv(e){if(typeof e!=`object`||!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(E(63))}function mv(e){if(e.nodeType!==9){(R?.view(e)??e).textContent=``;return}for(let t=B(e);t!==null;){let n=V(t);t.nodeType!==10&&(R?.view(e)??e).removeChild(t),t=n}}function hv(e){return null}function gv(e,t){t!==null&&t===void 0&&dv.delete(e)}function _v(e){if(!_h(e))return e}function vv(e,t,n,r,i,a,o,s,c){let l,u=!1,d=-1,f=0,p=e=>{let n=!1;ar.set(e,()=>{if(!(n||t!==e)){n=!0;try{l.unmount()}finally{n=!1}}})},m={current:t,signalOwner:s,retry:Bp,request:null,generation:0,wakeable:null,retryKey:null,transaction:null,disposed:!1};i.renderOwner=m;let h=(o,s,d,f)=>{if(u)return;if(je(),t&&!t.disposed&&n===o&&Object.is(r,d)){let e=t;m.request=t=>{m.transaction.rootRequest=!0;let n=e.props;n!==s&&N(e,`props`,n),e.props=s,e.pendingMode=t,I(e)},Do(t);return}if(f===void 0&&t!==null&&!t.disposed&&(yr>0||br>0)){m.request=e=>h(o,s,d,e),Do(t);return}if(!vr&&k===null&&f===void 0&&yr===0&&br===0&&(eo?.interrupt(),u))return;let g=qi(m);m.transaction.rootRequest=!0;let _=t,v=n,y=r,b=e.nodeType!==9&&_!==null&&_.mounted&&!_.disposed&&!ia(m.transaction,_),x=b?B(e):null,S=b?(R?.view(e)??e).lastChild:null;Yi(()=>{t=_,n=v,r=y,m.current=_,_!==null&&p(_)});try{t&&(ar.delete(t),b||L(t),t=null,n=null,r=null);let u=null,h=null;if(b?(u=(R?.view(document)??document).createComment(`root`),h=(R?.view(document)??document).createComment(`/root`),(R?.view(e)??e).append(u,h)):mv(e),t=Qs(`root`,null,e,u,h,o,s,void 0,a),t.idState=i,m.current=t,oa(t),rv(t,c),p(t),n=o,r=d,f===void 0&&(yr>0||br>0)){t.pending=!0,t.pendingMode=`transition`,A.push(t),!_r&&!gr&&(gr=!0,queueMicrotask(Io));return}let g=t;g.pendingMode=f??null;try{I(g),A.length>0&&jo(g)}catch(e){try{v_(g,e)}catch(e){let n=m.transaction;if(n!==null&&ca(n),t!==null&&!t.disposed&&L(t),!cv(g,e))throw e;return}m.wakeable===null&&l.unmount();return}b&&ta(_,e,x,S),!_r&&!gr&&(gr=!0,queueMicrotask(Io))}finally{Ji(g),!vr&&M===null&&ua()}};return l={render(e,i){if(u)throw Error(E(29));if(!vr&&k===null&&!wo()&&yr===0&&br===0&&(eo?.interrupt(),u))return;if(wo()||k!==null){if(d!==Co&&(d=Co,f=0),++f>So){t!==null&&!t.disposed&&(t.nestedUpdateError=!0,Do(t));return}}else Co++,d=Co,f=0;let a,o=null;_h(e)?(arguments.length,o=e.key??null,typeof e.type==`function`?(a=e.type,i=e.props):(a=fv,i=e)):typeof e==`function`?a=e:(a=fv,i=typeof e==`symbol`?null:e),m.transition!==void 0&&t!==null&&!t.disposed&&n===a&&Object.is(r,o)&&xr.keepsRoot(m,!0)||(m.transition!==void 0&&xr.discardRoot(m),m.generation++,m.wakeable=null),t!==null&&!t.disposed&&n===a&&Object.is(r,o)&&(vr?F?.refreshPublishingOwner(m):eo?.refreshPendingOwner(m)),m.nativeRetry?.clear(),m.retrySignalOwners!==void 0&&Tn(m),m.retryKey=null,m.request=null,m.transaction?.aborted===!0&&(m.transaction=null),m.retry=()=>h(a,i,o),h(a,i,o)},unmount(){if(arguments.length,u)return;let a=null;if(m.bindingLeases!==void 0)for(let e of m.bindingLeases){let t=Ou.get(e);t?.revision!==void 0&&A_(t.scope,a??=[])}if(a!==null&&m.generation++,!(!vr&&k===null&&!wo()&&fr===0&&(eo?.interrupt(),u))){if(!vr&&k===null&&!wo()&&fr===0&&Co++,u=!0,m.disposed=!0,m.controlLeases!==void 0){for(let e of m.controlLeases.values())e!==void 0&&(e.owner=void 0);m.controlLeases.clear()}if(m.bindingLeases!==void 0){for(let e of m.bindingLeases){Ee(e),Ou.delete(e);try{m.preservePresentation||e.retire()}catch(e){cv(t,e)||console.error(e)}}m.bindingLeases.clear()}m.nativeRetry?.clear(),m.retrySignalOwners!==void 0&&Tn(m),m.retry=Bp,m.transition!==void 0&&xr.discardRoot(m),m.generation++,m.wakeable=null,m.request=null,m.transaction!==null&&ca(m.transaction);try{t&&(ar.delete(t),cs(a,()=>L(t,!1)),ls(),m.preservePresentation||mv(e),zs(),t=null,n=null,r=null)}finally{i.signalState?.opaqueKeys?.clear(),D?.clearDeferredRefs(m),m.current=null,m.retry=Bp,m.adopt=void 0,m.initialDocumentSignals=void 0,m.retryKey=null,m.transaction=null,lp(e,!0),gv(e,o)}}}},t!==null&&(p(t),m.adopt=e=>{t!==null&&ar.delete(t),t=e,m.current=e,p(e)}),l}function yv(e,t,n){if(pv(e),t?.bindingLeases!==void 0||t?.controlLeases!==void 0)throw Error(E(76));t=_v(t);let r=hv(e);cp(e,!0);let i=(t?.identifierPrefix??``)+`r`+(Xn++).toString(36)+`-`;return vv(e,null,null,null,{prefix:i,next:0,signalState:{prefix:t?.signalInstancePrefix??i,next:0}},n,r,t?.signalOwner??(en?nn(e):void 0),t)}function bv(e,t){return yv(e,t,dc)}function xv(e={}){let t=new Map,n=e.slotlessPrefix===void 0?null:new Map,r=e.parentPrefix??``,i=e.tagPrefix??`:`,a=e.parentDescriptionFallback??``,o=e.includeParentDescription!==!1,s=e.global===!1?Symbol:Symbol.for,c=e.slotlessGlobal===!1||e.slotlessGlobal===void 0&&e.global===!1?Symbol:Symbol.for;return(l,u)=>{if(l===void 0){if(n===null)return;let t=n.get(u);return t===void 0&&(t=c(e.slotlessPrefix+u),n.set(u,t)),t}let d=t.get(l);d===void 0&&t.set(l,d=new Map);let f=d.get(u);if(f===void 0){let e=o?l.description??a:``;f=s(r+e+i+u),d.set(u,f)}return f}}xv(),An(1,!0);var Sv=gu(`<div></div><!>`,0,1),Cv=Wn(5),wv=e=>e.id;function Tv(e,t,n){let r=t.block;Ch(t,0,r.parentNode,Ov,{entry:e},r.endMarker,void 0,void 0,void 0,void 0,`c:8d0f11cb`)}function Ev(e,t,n){let r=t.block,i=n[0];wh(t,0,r.parentNode,kv,{contentComponent:i},r.endMarker,void 0,void 0,void 0,void 0,`c:812f2433`)}var Dv=[`s`,`d`,`c`];function Ov({entry:e}){return e.portal}var kv=function({contentComponent:e},t,n){let r=t.block,i=ol(t,Cv+0),a=i.auto,o=a===void 0?[]:a,s=vl(e.subscribe,e.getSnapshot,e.getServerSnapshot,Cv+0),c=Object.values(s);if(!t.block.pending||t.block.crossRenderUpdate){{let e=c;{let n=e;(t.slots[0]===void 0||o[1]!==!0||!al(o[0],n))&&(j_(t,0,r.parentNode,e,wv,Tv,9,void 0,null,r.endMarker),o===a&&(o=o.slice()),o[0]=n,o[1]=!0)}}o!==a&&(i.auto=o)}};function Av(){let e=new Set,t={},n=!1,r=()=>{!n&&e.size&&(n=!0,queueMicrotask(()=>{n=!1,e.forEach(e=>e())}))};return{subscribe(t){return e.add(t),()=>e.delete(t)},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(e,n){t={...t,[e]:{id:e,portal:Qm(n.reactElement,n.element)}},r()},removeRenderer(e){let n={...t};delete n[e],t=n,r()}}}var jv=function(e,t,n){let r=t.block,{editor:i,innerRef:a,ref:o,...s}=e,c=i,l=ul(null,Cv+1),[u,d]=Lc(null,Cv+2);tl(()=>{if(!c||c.isDestroyed||c.isEditorContentInitialized)return;let e=l.current,t=c.view.dom?.parentNode;if(!e||!t)return;e.append(...t.childNodes),c.setOptions({element:e});let n=Av();return c.contentComponent=n,c.createNodeViews(),c.isEditorContentInitialized=!0,d(n),()=>{c.isEditorContentInitialized=!1,c.isDestroyed||c.view.setProps({nodeViews:{},markViews:{}}),c.contentComponent=null;try{let e=c.view.dom?.parentNode;if(!e)return;let t=document.createElement(`div`);t.append(...e.childNodes),c.setOptions({element:t})}catch{}}},[c],Cv+3);let f=t.slots[0];if(f===void 0){let e,n,i,c,u,d,p=xu(Sv),m=Ru(p);e=af(s),n=[o??null,a??null,l],i=m,c=Cf(t,void 0,m,[[!0,e],[!1,`ref`,n]],`b:54ad651c`,!1),u=r.parentNode,d=zu(m,1),Su(p,r.parentNode,r.endMarker),f=Tu(t,null,e,n,i,c,u,d,null,void 0),t.refFields=Dv}else{f.a=af(s);{let e=[o??null,a??null,l];f.b!==e&&(f.b=e)}f.d=Cf(t,f.d,f.c,[[!0,f.a],[!1,`ref`,f.b]],`b:54ad651c`,!1)}f.i=Pg(t,f.i,1,f.c,Object.prototype.propertyIsEnumerable.call(f.d.resolved,`children`)?f.d.resolved.children:void 0,`b:54ad651c`,null,void 0,void 0,void 0,!0);{let e=u;E_(t,2,f.e,e,Ev,null,f.f,e?[u]:void 0)}},Mv=$g(function(e,t,n){let r=t.block,i=ol(t,Cv+4),a=i.hooks;a===void 0&&(i.hooks=a=cl(3));let o,s=(o=e.editor,a[0]!==!0||!al(a[1],o)?ll(a,0,Math.floor(Math.random()*4294967295).toString(),o):a[2]);(!t.block.pending||t.block.crossRenderUpdate)&&Lg(t,0,r.parentNode,gh(`c:3e15e84d`,jv,{key:s,...e}),r.endMarker)});function Nv(e){this.content=e}Nv.prototype={constructor:Nv,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 Nv(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 Nv(n)},addToStart:function(e,t){return new Nv([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Nv(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 Nv(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=Nv.from(e),e.size?new Nv(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Nv.from(e),e.size?new Nv(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Nv.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}},Nv.from=function(e){if(e instanceof Nv)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Nv(t)};function Pv(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&&Lv(e.charCodeAt(r-1))&&Iv(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=Pv(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Fv(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&&Lv(e.charCodeAt(i-1))&&Iv(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=Fv(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function Iv(e){return e>=56320&&e<57344}function Lv(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 Pv(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Fv(this,e,t,n)}findIndex(e){if(e==0)return zv(0,e);if(e==this.size)return zv(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?zv(t+1,i):zv(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 Rv={index:0,offset:0};function zv(e,t){return Rv.index=e,Rv.offset=t,Rv}function Bv(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(!Bv(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Bv(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Vv=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&&Bv(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`);return n.create(t.attrs)}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}};Vv.none=[];var Hv=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=Wv(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(Uv(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 Uv(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(Uv(a.content,t-i-1,n-i-1)))}function Wv(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=Wv(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 Gv(e,t,n){if(n.openStart>e.depth)throw new Hv(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Hv(`Inconsistent open depths`);return Kv(e,t,n,0)}function Kv(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=Kv(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Zv(a,$v(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Zv(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=ey(n,e);return Zv(a,Qv(e,i,o,t,r))}}function qv(e,t){if(!t.type.compatibleContent(e.type))throw new Hv(`Cannot join `+t.type.name+` onto `+e.type.name)}function Jv(e,t,n){let r=e.node(n);return qv(r,t.node(n)),r}function Yv(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 Xv(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&&(Yv(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Yv(i.child(e),r);t&&t.depth==n&&t.textOffset&&Yv(t.nodeBefore,r)}function Zv(e,t){if(!e.type.validContent(t))throw new Hv(`Invalid content for node `+e.type.name);return e.copy(t)}function Qv(e,t,n,r,i){let a=e.depth>i&&Jv(e,t,i+1),o=r.depth>i&&Jv(n,r,i+1),s=[];return Xv(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(qv(a,o),Yv(Zv(a,Qv(e,t,n,r,i+1)),s)):(a&&Yv(Zv(a,$v(e,t,i+1)),s),Xv(t,n,i,s),o&&Yv(Zv(o,$v(n,r,i+1)),s)),Xv(r,null,i,s),new W(s)}function $v(e,t,n){let r=[];return Xv(null,e,n,r),e.depth>n&&Yv(Zv(Jv(e,t,n+1),$v(e,t,n+1)),r),Xv(t,null,n,r),new W(r)}function ey(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 ty=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 Vv.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 ay(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=iy.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 iy.set(t,r=new ny);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ry,i}},ny=class{constructor(){this.elts=[],this.i=0}},ry=12,iy=new WeakMap,ay=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)}},oy=Object.create(null),sy=class e{constructor(e,t,n,r=Vv.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&&Bv(this.attrs,t||e.defaultAttrs||oy)&&Vv.sameSet(this.marks,n||Vv.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 Gv(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 ty.resolveCached(this,e)}resolveNoCache(e){return ty.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()+`)`),ly(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),uy(this.type.attrs,this.attrs,`node`,this.type.name);let e=Vv.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];uy(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!Vv.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);return e.nodeType(t.type).create(t.attrs,r,n)}};sy.prototype.text=void 0;var cy=class e extends sy{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):ly(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 ly(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function uy(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])}var dy=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new fy(t,n);if(r.next==null)return e.empty;let i=py(r);r.next&&r.err(`Unexpected trailing text`);let a=Cy(by(i));return wy(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(`\n`)}};dy.empty=new dy(!0);var fy=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 py(e){let t=[];do t.push(my(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function my(e){let t=[];do t.push(hy(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function hy(e){let t=yy(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=_y(e,t);else break;return t}function gy(e){/\\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function _y(e,t){let n=gy(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:gy(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function vy(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 yy(e){if(e.eat(`(`)){let t=py(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=vy(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 by(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 xy(e,t){return t-e}function Sy(e,t){let n=[];return r(t),n.sort(xy);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 Cy(e){let t=Object.create(null);return n(Sy(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]);Sy(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new dy(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(xy);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function wy(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 Ty(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 Ey(e,t){let n=Object.create(null);for(let r in e){let i=e[r],a=t&&t[r];if(a===void 0){if(i.hasDefault)a=i.default;else throw RangeError(`No value supplied for attribute `+r)}else i.validate&&i.validate(a);n[r]=a}return n}function Dy(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Ay(e,r,t[r]);return n}var Oy=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=Dy(e,n.attrs),this.defaultAttrs=Ty(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==dy.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:Ey(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new sy(this,this.computeAttrs(e),W.from(t),Vv.setFrom(n))}createChecked(e=null,t,n){return t=W.from(t),this.checkContent(t),new sy(this,this.computeAttrs(e),t,Vv.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 sy(this,e,t.append(i),Vv.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){}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:Vv.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 ky(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 Ay=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?ky(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},jy=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Dy(e,r.attrs),this.excluded=null;let i=Ty(this.attrs);this.instance=i?new Vv(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Vv(this,Ey(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]}excludes(e){return this.excluded.indexOf(e)>-1}},My=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=Nv.from(e.nodes),t.marks=Nv.from(e.marks||{}),this.nodes=Oy.compile(this.spec.nodes,this),this.marks=jy.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]=dy.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?Ny(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==``?[]:Ny(this,n.split(` `))}this.nodeFromJSON=e=>sy.fromJSON(this,e),this.markFromJSON=e=>Vv.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 Oy))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 cy(n,n.defaultAttrs,e,Vv.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 Ny(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 Py(e){return e.tag!=null}function Fy(e){return e.style!=null}var Iy=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Py(e))this.tags.push(e);else if(Fy(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 Gy(this,t,!1);return n.addAll(e,Vv.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Gy(this,t,!0);return n.addAll(e,Vv.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(qy(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=Jy(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=Jy(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)))}},Ly={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},Ry={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},zy={ol:!0,ul:!0},By=1,Vy=2,Hy=4;function Uy(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?By:0)|(t===`full`?Vy:0)}var Wy=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=Vv.none,this.match=i||(a&Hy?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&By)){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&&!Ly.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Gy=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=Uy(null,t.preserveWhitespace,0)|(n?Hy:0);i=r?new Wy(r.type,r.attrs,Vv.none,!0,t.topMatch||r.type.contentMatch,a):n?new Wy(null,null,Vv.none,!0,null,a):new Wy(e.schema.topNodeType,null,Vv.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&Vy?`full`:this.localPreserveWS||(r.options&By)>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,`\n`);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;zy.hasOwnProperty(a)&&this.parser.normalizeLists&&Ky(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Ry.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(Ly.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(`\n`),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=Vv.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Yy(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=Uy(e,i,a.options);a.options&Hy&&a.content.length==0&&(o|=Hy);let s=Vv.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):Yy(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new Wy(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|=By);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 Ky(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&zy.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function qy(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Jy(e){let t={};for(let n in e)t[n]=e[n];return t}function Yy(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 Xy=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Qy(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 Qy(t).createTextNode(e.text);let{dom:n,contentDOM:r}=nb(Qy(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&&nb(Qy(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:nb(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=Zy(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Zy(e.marks)}};function Zy(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Qy(e){return e.document||window.document}var $y=new WeakMap;function eb(e){let t=$y.get(e);return t===void 0&&$y.set(e,t=tb(e)),t}function tb(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 nb(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=eb(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}=nb(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var rb=65535,ib=2**16;function ab(e,t){return e+t*ib}function ob(e){return e&rb}function sb(e){return(e-(e&rb))/ib}var cb=1,lb=2,ub=4,db=8,fb=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&db)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&ub)>0}},pb=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=ob(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+sb(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:ab(o/3,e-s),f=0;return c&&(f|=e==s?lb:e==u?cb:ub,(t<0?e!=s:e!=u)&&(f|=db)),new fb(a,f,d)}r+=l-c}return n?e+r:new fb(e+r,0,null)}touches(e,t){let n=0,r=ob(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])}};pb.empty=new pb([]);var mb=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 fb(e,r,null)}},hb=Object.create(null),gb=class{getMap(){return pb.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=hb[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in hb)throw RangeError(`Duplicate use of step JSON ID `+e);return hb[e]=t,t.prototype.jsonID=e,t}},_b=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 Hv)return e.fail(t.message);throw t}}};function vb(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(vb(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return W.fromArray(r)}var yb=class e extends gb{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(vb(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 _b.fromReplace(e,this.from,this.to,i)}invert(){return new bb(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))}};gb.jsonID(`addMark`,yb);var bb=class e extends gb{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(vb(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return _b.fromReplace(e,this.from,this.to,n)}invert(){return new yb(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))}};gb.jsonID(`removeMark`,bb);var xb=class e extends gb{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return _b.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return _b.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 Sb(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))}};gb.jsonID(`addNodeMark`,xb);var Sb=class e extends gb{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return _b.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return _b.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 xb(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))}};gb.jsonID(`removeNodeMark`,Sb);var Cb=class e extends gb{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Tb(e,this.from,this.to)?_b.fail(`Structure replace would overwrite content`):_b.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new pb([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)}};Cb.MAP_BIAS=1,gb.jsonID(`replace`,Cb);var wb=class e extends gb{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&&(Tb(e,this.from,this.gapFrom)||Tb(e,this.gapTo,this.to)))return _b.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return _b.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?_b.fromReplace(e,this.from,this.to,n):_b.fail(`Content does not fit in gap`)}getMap(){return new pb([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)}};gb.jsonID(`replaceAround`,wb);function Tb(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 Eb(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 bb(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new yb(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Db(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 jy){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 bb(t.from,t.to,t.style)))}function Ob(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 Cb(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 bb(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 Cb(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 kb(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Ab(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||!kb(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function jb(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 wb(c,l,o,s,new G(u.append(f),d,p),u.size-d,!0))}function Mb(e,t,n=null,r=e){let i=Pb(e,t),a=i&&Fb(r,t);return a?i.map(Nb).concat({type:t,attrs:n}).concat(a.map(Nb)):null}function Nb(e){return{type:e,attrs:null}}function Pb(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 Fb(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 Ib(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 wb(i,a,i,a,new G(r,0,0),n.length,!0))}function Lb(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)&&Bb(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&&zb(e,t,n,a),Ob(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 wb(c,l,c+1,l-1,new G(W.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Rb(e,t,n,a),!1}})}function Rb(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 zb(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(`\n`))}})}function Bb(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Vb(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 wb(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new G(W.from(o),0,0),1,!0))}function Hb(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 Ub(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 Cb(t,t,new G(a.append(o),n,n),!0))}function Wb(e,t){let n=e.resolve(t),r=n.index();return Kb(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Gb(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 Kb(e,t){return!!(e&&t&&!e.isLeaf&&Gb(e,t))}function qb(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&&Kb(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 Jb(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);zb(e,r.node(),r.before(),s)}o.inlineContent&&Ob(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 Cb(l,c.map(t+n,-1),G.empty,!0)),r===!0){let t=e.doc.resolve(l);Rb(e,t.node(),t.before(),e.steps.length)}return e}function Yb(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 Xb(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 Zb(e,t,n=t,r=G.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Qb(i,a,r)?new Cb(t,n,r):new $b(i,a,r).fit()}function Qb(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var $b=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 wb(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Cb(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=nx(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;return sx(e,-1)<=t?!1:(this.unplaced.size>1&&sx(e,1)>n&&n++,this.unplaced=new G(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=nx(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new G(ex(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new G(ex(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(rx(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=tx(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(ex(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new G(ex(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||!ix(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=ix(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=ix(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=tx(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=tx(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=tx(this.placed,this.frontier.length,e))}};function ex(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(ex(e.firstChild.content,t-1,n)))}function tx(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(tx(e.lastChild.content,t-1,n)))}function nx(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function rx(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,rx(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 ix(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&&!ax(n,a.content,o)?s:null}function ax(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function ox(e){return e.spec.defining||e.spec.definingForContent}function sx(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function cx(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Qb(i,a,r))return e.step(new Cb(t,n,r));let o=fx(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=ox(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(lx(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 lx(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(lx(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 ux(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Yb(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new G(W.from(r),0,0))}function dx(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=fx(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 fx(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 px=class e extends gb{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 _b.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 _b.fromReplace(e,this.pos,this.pos+1,new G(W.from(r),0,+!t.isLeaf))}getMap(){return pb.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)}};gb.jsonID(`attr`,px);var mx=class e extends gb{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 _b.ok(n)}getMap(){return pb.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)}};gb.jsonID(`docAttr`,mx);var hx=class extends Error{};hx=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},hx.prototype=Object.create(Error.prototype),hx.prototype.constructor=hx,hx.prototype.name=`TransformError`;var gx=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new mb}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new hx(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=Zb(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 cx(this,e,t,n),this}replaceRangeWith(e,t,n){return ux(this,e,t,n),this}deleteRange(e,t){return dx(this,e,t),this}lift(e,t){return jb(this,e,t),this}join(e,t=1){return Jb(this,e,t),this}wrap(e,t){return Ib(this,e,t),this}setBlockType(e,t=e,n,r=null){return Lb(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Vb(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new px(e,t,n)),this}setDocAttribute(e,t){return this.step(new mx(e,t)),this}addNodeMark(e,t){return this.step(new xb(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof Vv)t.isInSet(n.marks)&&this.step(new Sb(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Sb(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 Ub(this,e,t,n),this}addMark(e,t,n){return Eb(this,e,t,n),this}removeMark(e,t,n){return Db(this,e,t,n),this}clearIncompatible(e,t,n){return Ob(this,e,t,n),this}},_x=Object.create(null),K=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new vx(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&&Ex(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),Ex(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new q(e):Tx(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?Tx(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Tx(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 Cx(e.node(0))}static atStart(e){return Tx(e,e,0,0,1)||new Cx(e)}static atEnd(e){return Tx(e,e,e.content.size,e.childCount,-1)||new Cx(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=_x[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in _x)throw RangeError(`Duplicate use of selection JSON ID `+e);return _x[e]=t,t.prototype.jsonID=e,t}getBookmark(){return q.between(this.$anchor,this.$head).getBookmark()}};K.prototype.visible=!0;var vx=class{constructor(e,t){this.$from=e,this.$to=t}},yx=!1;function bx(e){!yx&&!e.parent.inlineContent&&(yx=!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){bx(e),bx(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 xx(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 xx=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 Sx(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 Sx=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new xx(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)}},Cx=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 wx}};K.jsonID(`all`,Cx);var wx={map(){return this},resolve(e){return new Cx(e)}};function Tx(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=Tx(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 Ex(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Cb||i instanceof wb))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 Dx=1,Ox=2,kx=4,Ax=class extends gx{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|Dx)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Dx)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ox,this}ensureMarks(e){return Vv.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&Ox)>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)||Vv.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|=kx,this}get scrolledIntoView(){return(this.updated&kx)>0}};function jx(e,t){return!t||!e?e:e.bind(t)}var Mx=class{constructor(e,t,n){this.name=e,this.init=jx(t.init,n),this.apply=jx(t.apply,n)}},Nx=[new Mx(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Mx(`selection`,{init(e,t){return e.selection||K.atStart(t.doc)},apply(e){return e.selection}}),new Mx(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Mx(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Px=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Nx.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 Mx(e.key,e.spec.state,e))})}},Fx=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 Ax(this)}static create(t){let n=new Px(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 Px(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 Px(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=sy.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 Ix(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Ix(i,t,{})),n[r]=i}return n}var Lx=class{constructor(e){this.spec=e,this.props={},e.props&&Ix(e.props,this,this.props),this.key=e.key?e.key.key:zx(`plugin`)}getState(e){return e[this.key]}},Rx=Object.create(null);function zx(e){return e in Rx?e+`$`+ ++Rx[e]:(Rx[e]=0,e+`$`)}var Bx=class{constructor(e=`key`){this.key=zx(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Vx=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Hx(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var Ux=(e,t,n)=>{let r=Hx(e,n);if(!r)return!1;let i=Yx(r);if(!i){let n=r.blockRange(),i=n&&Ab(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(pS(e,i,t,-1))return!0;if(r.parent.content.size==0&&(qx(a,`end`)||J.isSelectable(a)))for(let n=r.depth;;n--){let o=Zb(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(qx(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},Wx=(e,t,n)=>{let r=Hx(e,n);if(!r)return!1;let i=Yx(r);return i?Kx(e,i,t):!1},Gx=(e,t,n)=>{let r=Xx(e,n);if(!r)return!1;let i=$x(r);return i?Kx(e,i,t):!1};function Kx(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=Zb(e.doc,i,o,G.empty);if(!s||s.from!=i||s instanceof Cb&&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 qx(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 Jx=(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=Yx(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 Yx(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 Xx(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var Zx=(e,t,n)=>{let r=Xx(e,n);if(!r)return!1;let i=$x(r);if(!i)return!1;let a=i.nodeAfter;if(pS(e,i,t,1))return!0;if(r.parent.content.size==0&&(qx(a,`start`)||J.isSelectable(a))){let n=Zb(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(qx(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},Qx=(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=$x(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 $x(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 eS=(e,t)=>{let n=e.selection,r=n instanceof J,i;if(r){if(n.node.isTextblock||!Wb(e.doc,n.from))return!1;i=n.from}else if(i=qb(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},tS=(e,t)=>{let n=e.selection,r;if(n instanceof J){if(n.node.isTextblock||!Wb(e.doc,n.to))return!1;r=n.to}else if(r=qb(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},nS=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&Ab(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},rS=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`\n`).scrollIntoView()),!0)};function iS(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 aS=(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=iS(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},oS=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Cx||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=iS(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},sS=(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(Hb(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ab(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function cS(e){return(t,n)=>{if(t.selection instanceof J&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!Hb(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 Cx)&&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=iS(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=Hb(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,Hb(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 lS=cS(),uS=(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)},dS=(e,t)=>(t&&t(e.tr.setSelection(new Cx(e.doc))),!0);function fS(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||Wb(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function pS(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&fS(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 wb(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&&Wb(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&&Ab(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&qx(a,`start`,!0)&&qx(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 wb(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 mS(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 hS=mS(-1),gS=mS(1);function _S(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&Mb(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function vS(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 yS(...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 bS=yS(Vx,Ux,Jx),xS=yS(Vx,Zx,Qx),SS={Enter:yS(rS,oS,sS,lS),\"Mod-Enter\":aS,Backspace:bS,\"Mod-Backspace\":bS,\"Shift-Backspace\":bS,Delete:xS,\"Mod-Delete\":xS,\"Mod-a\":dS},CS={\"Ctrl-h\":SS.Backspace,\"Alt-Backspace\":SS[`Mod-Backspace`],\"Ctrl-d\":SS.Delete,\"Ctrl-Alt-Backspace\":SS[`Mod-Delete`],\"Alt-Delete\":SS[`Mod-Delete`],\"Alt-d\":SS[`Mod-Delete`],\"Ctrl-a\":hS,\"Ctrl-e\":gS};for(let e in SS)CS[e]=SS[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function wS(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 TS(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function TS(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 ay(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new ay(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=Mb(a,n,r,t);return s?(e&&ES(e,t,s,i,n),!0):!1}function ES(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 wb(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&&Hb(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function DS(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?OS(t,n,e,a):kS(t,n,a):!0:!1}}function OS(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new wb(a-1,o,a,o,new G(W.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ay(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=Ab(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Wb(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function kS(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 wb(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 AS(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 wb(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var jS=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},MS=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},NS=null,PS=function(e,t,n){let r=NS||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},FS=function(){NS=null},IS=function(e,t,n,r){return n&&(RS(e,t,n,r,-1)||RS(e,t,n,r,1))},LS=/^(img|br|input|textarea|hr)$/i;function RS(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:zS(e))){let n=e.parentNode;if(!n||!Y(n)||GS(e)||LS.test(e.nodeName)||e.contentEditable==`false`)return!1;t=jS(e)+(i<0?0:1),e=n}else if(Y(e)){let n=e.childNodes[t+(i<0?-1:0)];if(Y(n)&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?zS(e):0}else return!1}}function zS(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Y(e){return e.nodeType==1}function BS(e){return e.nodeType==3}function VS(e,t){return t?e.contains(Y(t)?t:t.parentNode):!1}function HS(e,t){for(;;){if(BS(e)&&t)return e;if(Y(e)&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=zS(e)}else if(e.parentNode&&!GS(e))t=jS(e),e=e.parentNode;else return null}}function US(e,t){for(;;){if(BS(e)&&t<e.nodeValue.length)return e;if(Y(e)&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!GS(e))t=jS(e)+1,e=e.parentNode;else return null}}function WS(e,t,n){for(let r=t==0,i=t==zS(e);r||i;){if(e==n)return!0;let t=jS(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==zS(e)}}function GS(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 KS=function(e){return e.focusNode&&IS(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function qS(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function JS(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function YS(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(zS(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(zS(r.startContainer),r.startOffset)}}}var XS=typeof navigator<`u`?navigator:null,ZS=typeof document<`u`?document:null,QS=XS&&XS.userAgent||``,$S=/Edge\\/(\\d+)/.exec(QS),eC=/MSIE \\d/.exec(QS),tC=/Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(QS),nC=!!(eC||tC||$S),rC=eC?document.documentMode:tC?+tC[1]:$S?+$S[1]:0,iC=!nC&&/gecko\\/(\\d+)/i.test(QS);iC&&+(/Firefox\\/(\\d+)/.exec(QS)||[0,0])[1];var aC=!nC&&/Chrome\\/(\\d+)/.exec(QS),oC=!!aC,sC=aC?+aC[1]:0,cC=!nC&&!!XS&&/Apple Computer/.test(XS.vendor),lC=cC&&(/Mobile\\/\\w+/.test(QS)||!!XS&&XS.maxTouchPoints>2),uC=lC||(XS?/Mac/.test(XS.platform):!1),dC=XS?/Win/.test(XS.platform):!1,fC=/Android \\d/.test(QS),pC=!!ZS&&`webkitFontSmoothing`in ZS.documentElement.style,mC=pC?+(/\\bAppleWebKit\\/(\\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function hC(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 gC(e,t){return typeof e==`number`?e:e[t]}function _C(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 vC(e,t,n){if(!NC(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(!Y(o)){o=MS(o);continue}let e=o==a.body,n=e?hC(a):_C(o),s=0,c=0;if(t.top<n.top+gC(r,`top`)?c=-(n.top-t.top+gC(i,`top`)):t.bottom>n.bottom-gC(r,`bottom`)&&(c=t.bottom-t.top>n.bottom-n.top?t.top+gC(i,`top`)-n.top:t.bottom-n.bottom+gC(i,`bottom`)),t.left<n.left+gC(r,`left`)?s=-(n.left-t.left+gC(i,`left`)):t.right>n.right-gC(r,`right`)&&(s=t.right-n.right+gC(i,`right`)),s||c){if(e)a.defaultView.scrollBy(s,c);else{let e=o.scrollLeft,n=o.scrollTop;c&&(o.scrollTop+=c),s&&(o.scrollLeft+=s);let r=o.scrollLeft-e,i=o.scrollTop-n;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i}}}let l=e?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(l))break;o=l==`absolute`?o.offsetParent:MS(o)}}function yC(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:bC(e.dom)}}function bC(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=MS(r));return t}function xC({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;SC(n,r==0?0:r-t)}function SC(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 CC=null;function wC(e){if(e.setActive)return e.setActive();if(CC)return e.focus(CC);let t=bC(e);e.focus(CC==null?{get preventScroll(){return CC={preventScroll:!0},!0}}:void 0),CC||(CC=!1,SC(t,0))}function TC(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(Y(u))e=u.getClientRects();else if(BS(u))e=PS(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&&BS(n)?{left:p.right<t.left?p.right:p.left,top:t.top}:t,Y(u)&&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&&BS(n)?EC(n,i):!n||r?{node:e,offset:a}:TC(n,i)}function EC(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=PC(r,1);if(n.top!=n.bottom&&DC(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function DC(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function OC(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function kC(e,t,n){let{node:r,offset:i}=TC(t,n),a=-1;if(Y(r)&&!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 AC(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(Y(t.dom)&&(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 jC(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(Y(n)){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(DC(t,i))return jC(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function MC(e,t){let n=e.dom.ownerDocument,r,i=0,a=YS(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)){let n=e.dom.getBoundingClientRect();if(!DC(t,n)||(o=jC(e.dom,t,n),!o))return null}if(cC)for(let e=o;r&&e;e=MS(e))e.draggable&&(r=void 0);if(o=OC(o,t),r){if(iC&&Y(r)&&(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;pC&&i&&Y(r)&&Y(n=r.childNodes[i-1])&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&Y(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||!Y(r)||r.childNodes[i-1].nodeName!=`BR`)&&(s=AC(e,r,i,t))}s??=kC(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function NC(e){return e.top<e.bottom||e.left<e.right}function PC(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(NC(e))return e}return Array.prototype.find.call(n,NC)||e.getBoundingClientRect()}var FC=/[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;function IC(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=pC||iC;if(BS(r)){if(o&&(FC.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=PC(PS(r,i,i),n);if(iC&&i&&/\\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=PC(PS(r,i-1,i-1),-1);if(t.top==e.top){let n=PC(PS(r,i,i+1),-1);if(n.top!=e.top)return LC(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++,LC(PC(PS(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==zS(r))){let e=r.childNodes[i-1];if(Y(e))return RC(e.getBoundingClientRect(),!1)}if(a==null&&i<zS(r)){let e=r.childNodes[i];if(Y(e))return RC(e.getBoundingClientRect(),!0)}return RC(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==zS(r))){let e=r.childNodes[i-1],t=BS(e)?PS(e,zS(e)-+!o):Y(e)&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return LC(PC(t,1),!1)}if(a==null&&i<zS(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?BS(e)?PS(e,0,+!o):Y(e)?e:null:null;if(t)return LC(PC(t,-1),!0)}return LC(PC(BS(r)?PS(r):r,-n),n>=0)}function LC(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 RC(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 zC(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 BC(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return zC(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=IC(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(Y(e))t=e.getClientRects();else if(BS(e))t=PS(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 VC=/[\\u0590-\\u08ac]/;function HC(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?!VC.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:zC(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&&!VS(l,u)||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 UC=null,WC=null,GC=!1;function KC(e,t,n){return UC==t&&WC==n?GC:(UC=t,WC=n,GC=n==`up`||n==`down`?BC(e,t,n):HC(e,t,n))}var qC=0,JC=1,YC=2,XC=3,ZC=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=qC,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&&VS(this.contentDOM,e)){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>jS(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=!!(e.compareDocumentPosition(this.contentDOM)&4);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)&&!(Y(a)?VS(a,e):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){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof iw||e instanceof QC&&e.side>=0))break}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?jS(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?jS(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=jS(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=jS(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(!Y(t)||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((iC||cC)&&e==t){let{node:e,offset:t}=o;if(BS(e)){if(u=!!(t&&e.nodeValue[t-1]==`\n`),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:jS(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(iC&&l.focusNode&&l.focusNode!=s.node&&Y(l.focusNode)){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&cC)&&IS(o.node,o.offset,l.anchorNode,l.anchorOffset)&&IS(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&iC)){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?YC:JC,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=XC:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?YC:XC}n=a}this.dirty=YC}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?YC:JC;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},QC=class extends ZC{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){let e=Y(a)?a:document.createElement(`span`);e!=a&&e.appendChild(a),e.hasAttribute(`contenteditable`)||(e.contentEditable=`false`),e.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==qC&&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}},$C=class extends ZC{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}},ew=class e extends ZC{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=Xy.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&XC||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=XC&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=qC){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=qC}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=xw(a,n,o,r)),t>0&&(a=xw(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()}},tw=class e extends ZC{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(!BS(u))throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Xy.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=fw(u,r,n),l?c=new aw(t,n,r,i,u,d||null,f,l):n.isText?new rw(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=>Y(t)&&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==qC&&e.eq(this.node)&&pw(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 hw(this,a&&a.node,e),c=this.node.inlineContent,l=c&&this.node.isBlock;vw(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?Vv.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,u,d)=>{s.syncToMarks(t.marks,n,e,d),l&&t.isAtom&&!t.isText&&s.addHackNode(`IMG`,s.top);let f;s.findNodeMatch(t,a,u,d)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(f=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,u,f,e)||s.updateNextNode(t,a,u,e,d,r)||s.addNode(t,a,u,e,r),r+=t.nodeSize,c&&(l=t.isAtom&&!t.isText)}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==YC)&&(a&&this.protectLocalComposition(e,a),ow(this.contentDOM,this.children,e),lC&&yw(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=bw(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 $C(this,i,t,r);e.input.compositionNodes.push(a),this.children=xw(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==XC||!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=qC}updateOuterDeco(e){if(pw(e,this.outerDeco))return;let t=!Y(this.nodeDOM),n=this.dom;this.dom=uw(this.dom,this.nodeDOM,lw(this.outerDeco,this.node,t),lw(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){Y(this.nodeDOM)&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){Y(this.nodeDOM)&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function nw(e,t,n,r,i){fw(r,t,e);let a=new tw(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var rw=class e extends tw{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==XC||this.dirty!=qC&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=qC||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=qC,!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=XC)}get domAtom(){return!1}isText(e){return this.node.text==e}},iw=class extends ZC{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==qC&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},aw=class extends tw{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==XC)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 ow(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=mw(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof ew){let t=r?r.previousSibling:e.lastChild;ow(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=mw(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var sw=function(e){e&&(this.nodeName=e)};sw.prototype=Object.create(null);var cw=[new sw];function lw(e,t,n){if(e.length==0)return cw;let r=n?cw[0]:new sw,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new sw(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new sw(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 uw(e,t,n,r){if(n==cw&&r==cw)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=cw[0],i=t)}dw(i,o||cw[0],a)}return i}function dw(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 fw(e,t,n){return uw(e,e,cw,lw(t,n,!Y(e)))}function pw(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 mw(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var hw=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=gw(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=qC,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 ew&&t.dirty!=XC&&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=ew.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==XC&&a.dom==a.contentDOM&&(a.dirty=YC),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 tw){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!=XC&&pw(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=YC,u.updateChildren(r,a+1),u.dirty=qC),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)||!pw(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=tw.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=tw.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 QC(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 ew;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof rw)||/\\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\\s$/.test(e.node.text))&&((cC||oC)&&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 iw(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||Y(e)&&e.contains(this.lock.parentNode))}};function gw(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 ew)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 _w(e,t){return e.type.side-t.type.side}function vw(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(_w);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 yw(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 bw(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 xw(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 Sw(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(KS(n)){for(c=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&J.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&WS(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new J(o==e?s:r.resolve(e))}else if(iC&&t==`key`&&o>e.state.selection.to&&Y(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if(getComputedStyle(e).overflow!=`visible`){l=K.findFrom(r.resolve(i.posAtStart),1);break}if(e==i.dom||e.nextSibling||!e.parentNode||!Y(e.parentNode))break}}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=Nw(e,u,s,n)}return l}function Cw(e){return e.editable?e.hasFocus():Fw(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ww(e,t=!1){let n=e.state.selection;if(jw(e,n),!Cw(e))return;let r=e.input.mouseDown;if(!t&&oC&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&IS(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Aw(e);else{let{anchor:r,head:i}=n,a,o;Tw&&!(n instanceof q)&&(n.$from.parent.inlineContent||(a=Ew(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Ew(e,n.to))),e.docView.setSelection(r,i,e,t),Tw&&(a&&Ow(a),o&&Ow(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&kw(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var Tw=cC||oC&&sC<63;function Ew(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(cC&&i&&i.contentEditable==`false`)return Dw(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Dw(i);if(a)return Dw(a)}}function Dw(e){return e.contentEditable=`true`,cC&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ow(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function kw(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(()=>{(!Cw(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Aw(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,jS(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&nC&&rC<=11&&(n.disabled=!0,n.disabled=!1)}function jw(e,t){if(t instanceof J){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Mw(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Mw(e)}function Mw(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function Nw(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||q.between(t,n,r)}function Pw(e){return e.editable&&!e.hasFocus()?!1:Fw(e)}function Fw(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return VS(e.dom,t.anchorNode)&&(e.editable||VS(e.dom,t.focusNode))}catch{return!1}}function Iw(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return IS(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Lw(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 Rw(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function zw(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 Rw(e,new q(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=Lw(e.state,t);return n&&n instanceof J?Rw(e,n):!1}if(!(uC&&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)?Rw(e,new J(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Rw(e,new q(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1}}else if(r instanceof J&&r.node.isInline)return Rw(e,new q(t>0?r.$to:r.$from));else{let n=Lw(e.state,t);return n?Rw(e,n):!1}}function Bw(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`):Y(e)&&e.contentEditable==`false`}function Vw(e,t){return t<0?Hw(e):Uw(e)}function Hw(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(iC&&Y(n)&&r<zS(n)&&Bw(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(!Y(n))break;let e=n.childNodes[r-1];if(Bw(e,-1))i=n,a=--r;else if(BS(e))n=e,r=n.nodeValue.length;else break}else if(Ww(n))break;else{let t=n.previousSibling;for(;t&&Bw(t,-1);)i=n.parentNode,a=jS(t),t=t.previousSibling;if(t)n=t,r=zS(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?qw(e,n,r):i&&qw(e,i,a)}function Uw(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=zS(n),a,o;for(;;)if(r<i){if(!Y(n))break;let e=n.childNodes[r];if(Bw(e,1))a=n,o=++r;else break}else if(Ww(n))break;else{let t=n.nextSibling;for(;t&&Bw(t,1);)a=t.parentNode,o=jS(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=zS(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&qw(e,a,o)}function Ww(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Gw(e,t){for(;e&&t==e.childNodes.length&&!GS(e);)t=jS(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(BS(n))return n;if(Y(n)&&n.contentEditable==`false`)break;e=n,t=0}}function Kw(e,t){for(;e&&!t&&!GS(e);)t=jS(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(BS(n))return n;if(Y(n)&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function qw(e,t,n){if(!BS(t)){let e,r;(r=Gw(t,n))?(t=r,n=0):(e=Kw(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(KS(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&&ww(e)},50)}function Jw(e,t){let n=e.state.doc.resolve(t);if(!(oC||dC)&&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 Yw(e,t,n){let r=e.state.selection;if(r instanceof q&&!r.empty||n.indexOf(`s`)>-1||uC&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=Lw(e.state,t);if(n&&n instanceof J)return Rw(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof Cx?K.near(n,t):K.findFrom(n,t);return o?Rw(e,o):!1}return!1}function Xw(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 Zw(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Qw(e){if(!cC||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&Y(t)&&n==0&&t.firstChild&&Y(t.firstChild)&&t.firstChild.contentEditable==`false`){let n=t.firstChild;Zw(e,n,`true`),setTimeout(()=>Zw(e,n,`false`),20)}return!1}function $w(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function eT(e,t){let n=t.keyCode,r=$w(t);if(n==8||uC&&n==72&&r==`c`)return Xw(e,-1)||Vw(e,-1);if(n==46&&!t.shiftKey||uC&&n==68&&r==`c`)return Xw(e,1)||Vw(e,1);if(n==13||n==27)return!0;if(n==37||uC&&n==66&&r==`c`){let t=n==37?Jw(e,e.state.selection.from)==`ltr`?-1:1:-1;return zw(e,t,r)||Vw(e,t)}if(n==39||uC&&n==70&&r==`c`){let t=n==39?Jw(e,e.state.selection.from)==`ltr`?1:-1:1;return zw(e,t,r)||Vw(e,t)}return n==38||uC&&n==80&&r==`c`?Yw(e,-1,r)||Vw(e,-1):n==40||uC&&n==78&&r==`c`?Qw(e)||Yw(e,1,r)||Vw(e,1):!(r!=(uC?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function tT(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`)||Xy.fromSchema(e.state.schema),s=dT(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&Y(l)&&(u=uT[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&&Y(l)&&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,`\n\n`),slice:t}}function nT(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,`\n`))),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=Xy.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=mT(n),pC&&hT(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&&!Y(e);)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Iy.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!rT.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=gT(lT(s,+u[1],+u[2]),u[4]);else if(s=G.maxOpen(iT(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=lT(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var rT=/^(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 iT(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&&oT(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=sT(a[a.length-1],i.length));let n=aT(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return W.from(a)}return e}function aT(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,W.from(e));return e}function oT(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=oT(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(aT(n,e,i+1))))}}function sT(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,sT(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(W.empty,!0);return e.copy(n.append(r))}function cT(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=cT(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 lT(e,t,n){return t<e.openStart&&(e=new G(cT(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new G(cT(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var uT={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 dT(){return document.implementation.createHTMLDocument(`title`)}var fT=null;function pT(e){let t=window.trustedTypes;if(!t)return e;if(!fT){if(fT=t.defaultPolicy)try{return fT.createHTML(e)}catch{}fT=t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e})}return fT.createHTML(e)}function mT(e){let t=/^(\\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=dT(),r=n.body,i=/<([a-z][^>\\s]+)/i.exec(e),a;if((a=i&&uT[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>`</`+e+`>`).reverse().join(``)),r.innerHTML=pT(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 hT(e){let t=e.querySelectorAll(oC?`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 gT(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{i=W.from(t.create(r[e+1],i))}catch{break}a++,o++}return new G(i,a,o)}var _T={},vT={},yT={touchstart:!0,touchmove:!0},bT=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 xT(e){for(let t in _T){let n=_T[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{ET(e,t)&&!TT(e,t)&&(e.editable||!(t.type in vT))&&n(e,t)},yT[t]?{passive:!0}:void 0)}cC&&e.dom.addEventListener(`input`,()=>null),wT(e)}function ST(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function CT(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 wT(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>TT(e,t))})}function TT(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function ET(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 DT(e,t){!TT(e,t)&&_T[t.type]&&(e.editable||!(t.type in vT))&&_T[t.type](e,t)}vT.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!WT(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(fC&&oC&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),lC&&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,qS(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||eT(e,n)?n.preventDefault():ST(e,`key`)}},vT.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},vT.keypress=(e,t)=>{let n=t;if(WT(e)||!n.charCode||n.ctrlKey&&!n.altKey||uC&&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 OT(e){return{left:e.clientX,top:e.clientY}}function kT(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function AT(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 jT(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta(`pointer`,!0),e.dispatch(r)}function MT(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(jT(e,new J(n)),!0):!1}function NT(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&&(jT(e,J.create(e.state.doc,i)),!0)}function PT(e,t,n,r,i){return AT(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?NT(e,n):MT(e,n))}function FT(e,t,n,r){return AT(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function IT(e,t,n,r){return AT(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||LT(e,n,r)}function LT(e,t,n){if(n.button!=0)return!1;let r=RT(e,t,!0),i=e.state.doc;return r?(jT(e,r),r instanceof q&&i.eq(e.state.doc)&&(e.input.mouseDown=new UT(e,r)),!0):!1}function RT(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 zT(e){return XT(e)}var BT=uC?`metaKey`:`ctrlKey`;_T.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=zT(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&kT(n,e.input.lastClick)&&!n[BT]&&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(OT(n));o&&(a==`singleClick`?e.input.mouseDown=new HT(e,o,n,!!r):(a==`doubleClick`?FT:IT)(e,o.pos,o.inside,n)?n.preventDefault():ST(e,`pointer`))};var VT=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}},HT=class extends VT{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[BT],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&&Y(s.nodeDOM)?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&&iC&&!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()),ST(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||ww(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(OT(e))),this.updateAllowDefault(e),this.allowDefault||!t?ST(this.view,`pointer`):PT(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||cC&&this.mightDrag&&!this.mightDrag.node.isAtom||oC&&!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)?(jT(this.view,K.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):ST(this.view,`pointer`)}move(e){this.updateAllowDefault(e),ST(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}},UT=class extends VT{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(),ST(this.view,`pointer`);let t=this.view.posAtCoords(OT(e)),n=t&&RT(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];jT(this.view,q.create(r,a,o))}};_T.touchstart=e=>{e.input.lastTouch=Date.now(),zT(e),ST(e,`pointer`)},_T.touchmove=e=>{e.input.lastTouch=Date.now(),ST(e,`pointer`)},_T.contextmenu=e=>zT(e);function WT(e,t){return e.composing?!0:cC&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var GT=fC?5e3:-1;vT.compositionstart=vT.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof q&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||oC&&dC&&KT(e)))e.markCursor=e.state.storedMarks||n.marks(),XT(e,!0),e.markCursor=null;else if(XT(e,!t.selection.empty),iC&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&Y(n)&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(BS(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}qT(e,GT)};function KT(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!Y(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return Y(r)&&r.contentEditable==`false`}vT.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++,qT(e,20))};function qT(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>XT(e),t))}function JT(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function YT(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=HS(t.focusNode,t.focusOffset),r=US(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 XT(e,t=!1){if(!(fC&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),JT(e),t||e.docView&&e.docView.dirty){let n=Sw(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 ZT(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 QT=nC&&rC<15||lC&&mC<604;_T.copy=vT.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=QT?null:n.clipboardData,{dom:o,text:s}=tT(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):ZT(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function $T(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function eE(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?tE(e,r.value,null,i,t):tE(e,r.textContent,r.innerHTML,i,t)},50)}function tE(e,t,n,r,i){let a=nT(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=$T(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 nE(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,` `):``}vT.paste=(e,t)=>{let n=t;if(e.composing&&!fC)return;let r=QT?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&tE(e,nE(r),r.getData(`text/html`),i,n)?n.preventDefault():eE(e,n)};var rE=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},iE=uC?`altKey`:`ctrlKey`;function aE(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[iE]:!n}_T.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(OT(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&&Y(n.target)){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}=tT(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!oC||sC>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(QT?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,QT||n.dataTransfer.setData(`text/plain`,c),e.dragging=new rE(l,aE(e,n),o)},_T.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},vT.dragover=vT.dragenter=(e,t)=>t.preventDefault(),vT.drop=(e,t)=>{try{oE(e,t,e.dragging)}finally{e.dragging=null}};function oE(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(OT(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=nT(e,nE(t.dataTransfer),QT?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&aE(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?Xb(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(Nw(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}_T.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())&&ww(e)},20))},_T.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)},_T.beforeinput=(e,t)=>{if(fC&&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,qS(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 vT)_T[e]=vT[e];function sE(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 cE=class e{constructor(e,t){this.toDOM=e,this.spec=t||pE,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 dE(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&&sE(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},lE=class e{constructor(e,t){this.attrs=e,this.spec=t||pE}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 dE(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&sE(this.attrs,t.attrs)&&sE(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},uE=class e{constructor(e,t){this.attrs=e,this.spec=t||pE}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 dE(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&&sE(this.attrs,t.attrs)&&sE(this.spec,t.spec)}destroy(){}},dE=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 cE(n,r))}static inline(t,n,r,i){return new e(t,n,new lE(r,i))}static node(t,n,r,i){return new e(t,n,new uE(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof lE}get widget(){return this.type instanceof cE}},fE=[],pE={},mE=class e{constructor(e,t){this.local=e.length?e:fE,this.children=t.length?t:fE}static create(e,t){return t.length?SE(t,e,0,pE):hE}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==hE||e.maps.length==0?this:this.mapInner(e,t,0,0,n||pE)}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?_E(this.children,o||[],t,n,r,i,a):o?new e(o.sort(CE),fE):hE}add(t,n){return n.length?this==hE?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=bE(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,SE(s,e,o+1,pE)),a+=3}});let o=vE(a?xE(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(CE):this.local,i||this.children)}remove(e){return e.length==0||this==hE?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==hE?(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):hE}forChild(t,n){if(this==hE)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 lE){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(CE),fE);return r?new gE([t,r]):t}return r||hE}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 wE(this.localsInner(e))}localsInner(e){if(this==hE)return fE;if(e.inlineContent||!this.local.some(lE.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof lE||t.push(this.local[e]);return t}forEachSet(e){e(this)}};mE.empty=new mE([],[]),mE.removeOverlap=wE;var hE=mE.empty,gE=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,pE));return e.from(r)}forChild(t,n){if(n.isLeaf)return mE.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=hE&&(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?wE(n?t:t.sort(CE)):fE}static from(t){switch(t.length){case 0:return hE;case 1:return t[0];default:return new e(t.every(e=>e instanceof mE)?t:t.reduce((e,t)=>e.concat(t instanceof mE?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function _E(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==hE?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=SE(yE(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 mE(t.sort(CE),s)}function vE(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 dE(i.from+t,i.to+t,i.type))}return n}function yE(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 bE(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 xE(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function SE(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=bE(e,t,o+n);if(s){a=!0;let e=SE(s,t,n+o+1,r);e!=hE&&i.push(o,o+t.nodeSize,e)}});let o=vE(a?xE(e):e,-n).sort(CE);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 mE(o,i):hE}function CE(e,t){return e.from-t.from||e.to-t.to}function wE(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),TE(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),TE(t,i,r.copy(a.from,r.to)));break}}return t}function TE(e,t,n){for(;t<e.length&&CE(n,e[t])>0;)t++;e.splice(t,0,n)}function EE(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=hE&&t.push(r)}),e.cursorWrapper&&t.push(mE.create(e.state.doc,[e.cursorWrapper.deco])),gE.from(t)}var DE={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},OE=nC&&rC<=11,kE=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}},AE=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new kE,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]);nC&&rC<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():cC&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),OE&&(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,DE)),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(Pw(this.view)){if(this.suppressingSelectionUpdates)return ww(this.view);if(nC&&rC<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&IS(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=MS(n))t.add(n);for(let r=e.anchorNode;r;r=MS(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:BS(n)?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)&&Pw(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||oC&&(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&&Y(t);){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(iC&&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||IE(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&&KS(n)&&(c=Sw(e))&&c.eq(K.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,ww(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),NE(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,LE(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||ww(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),BS(r)&&(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(nC&&rC<=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?jS(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?jS(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})}},jE=new WeakMap,ME=!1;function NE(e){if(!jE.has(e)&&(jE.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=iC,ME)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.`),ME=!0}}function PE(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return IS(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function FE(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return PE(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?PE(e,n):null}function IE(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 LE(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||!Y(e)||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 RE(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&&VS(e.dom,d)&&(u=[{node:d,offset:l.anchorOffset}],KS(l)||u.push({node:l.focusNode,offset:l.focusOffset})),oC&&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`)||Iy.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:zE(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 zE=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName==`BR`&&t.parentNode){if(cC&&/^(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||cC&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==`IMG`&&t.getAttribute(`mark-placeholder`))return{ignore:!0};return null},BE=/^(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 VE(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=Sw(e,t);if(n&&!e.state.selection.eq(n)){if(oC&&fC&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,qS(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=RE(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=qE(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(lC&&e.input.lastIOSEnter>Date.now()-225||fC)&&i.some(e=>Y(e)&&!BE.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,qS(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=HE(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)),nC&&rC<=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((lC&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&GE(l.doc,h.pos,g.pos))&&e.someProp(`handleKeyDown`,t=>t(e,qS(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&WE(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,qS(8,`Backspace`)))){fC&&oC&&e.domObserver.suppressSelectionUpdates();return}oC&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),fC&&!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,qS(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=HE(e,n.doc,l.sel);t&&!(oC&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||nC&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v){if(h.pos==g.pos){nC&&rC<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ww(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=UE(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 HE(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Nw(e,t.resolve(n.anchor),t.resolve(n.head))}function UE(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 WE(e,t,n,r,i){if(n-t<=i.pos-r.pos||KE(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(KE(a,!0,!0));return!o.parent.isTextblock||o.pos>n||KE(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function GE(e,t,n){let r=0,i=0;return e.nodesBetween(t,n,(e,a)=>{e.isTextblock&&a>=t&&a<n?r++:(e.isText?/\\S/.test(e.text.slice(Math.max(0,t-a),Math.min(e.nodeSize,n-a))):e.isLeaf)&&i++}),i==0&&r==1}function KE(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 qE(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 JE=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 bT,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(tD),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=ZE(this),XE(this),this.nodeViews=$E(this),this.docView=nw(this.state.doc,YE(this),EE(this),this.dom,this),this.domObserver=new AE(this,(e,t,n,r)=>VE(this,e,t,n,r)),this.domObserver.start(),xT(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&&wT(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(tD),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&&(JT(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=$E(this);eD(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&wT(this),this.editable=ZE(this),XE(this);let o=EE(this),s=YE(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&&yC(this);if(i){this.domObserver.stop();let t=l&&(nC||oC)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&QE(n.selection,e.selection);if(l){let n=oC?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=YT(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=nw(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())&&Iw(this)&&i.delaySelUpdate())?ww(this,t):(jw(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&&xC(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&VS(this.dom,e)&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof J){let t=this.docView.domAfterPos(this.state.selection.from);Y(t)&&vC(this,t.getBoundingClientRect(),e)}else vC(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 rE(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(nC){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&&wC(this.dom),ww(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 MC(this,e)}coordsAtPos(e,t=1){return IC(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 KC(this,t||this.state,e)}pasteHTML(e,t){return tE(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return tE(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return tT(this,e)}destroy(){this.docView&&(CT(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],EE(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,FS())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return DT(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?cC&&this.root.nodeType===11&&JS(this.dom.ownerDocument)==this.dom&&FE(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};JE.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function YE(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`,[dE.node(0,e.state.doc.content.size,t)]}function XE(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:dE.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ZE(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function QE(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 $E(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 eD(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 tD(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 nD={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:`'`},rD={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`\"`},iD=typeof navigator<`u`&&/Mac/.test(navigator.platform),aD=typeof navigator<`u`&&/MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent),oD=0;oD<10;oD++)nD[48+oD]=nD[96+oD]=String(oD);for(var oD=1;oD<=24;oD++)nD[oD+111]=`F`+oD;for(var oD=65;oD<=90;oD++)nD[oD]=String.fromCharCode(oD+32),rD[oD]=String.fromCharCode(oD);for(var sD in nD)rD.hasOwnProperty(sD)||(rD[sD]=nD[sD]);function cD(e){var t=!(iD&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||aD&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?rD:nD)[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 lD=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),uD=typeof navigator<`u`&&/Win/.test(navigator.platform);function dD(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))lD?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 fD(e){let t=Object.create(null);for(let n in e)t[dD(n)]=e[n];return t}function pD(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 mD(e){return new Lx({props:{handleKeyDown:hD(e)}})}function hD(e){let t=fD(e);return function(e,n){let r=cD(n),i,a=t[pD(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[pD(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(uD&&n.ctrlKey&&n.altKey)&&(i=nD[n.keyCode])&&i!=r){let r=t[pD(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var gD=Object.defineProperty,_D=(e,t)=>{for(var n in t)gD(e,n,{get:t[n],enumerable:!0})};function vD(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 yD=class{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}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)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:vD({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}},bD={};_D(bD,{blur:()=>xD,clearContent:()=>SD,clearNodes:()=>CD,command:()=>wD,createParagraphNear:()=>TD,cut:()=>ED,deleteCurrentNode:()=>DD,deleteNode:()=>kD,deleteRange:()=>AD,deleteSelection:()=>PD,enter:()=>FD,exitCode:()=>ID,extendMarkRange:()=>UD,first:()=>WD,focus:()=>ZD,forEach:()=>QD,insertContent:()=>$D,insertContentAt:()=>aO,joinBackward:()=>cO,joinDown:()=>sO,joinForward:()=>lO,joinItemBackward:()=>uO,joinItemForward:()=>dO,joinTextblockBackward:()=>fO,joinTextblockForward:()=>pO,joinUp:()=>oO,keyboardShortcut:()=>gO,lift:()=>vO,liftEmptyBlock:()=>yO,liftListItem:()=>bO,newlineInCode:()=>xO,resetAttributes:()=>wO,scrollIntoView:()=>TO,selectAll:()=>EO,selectNodeBackward:()=>DO,selectNodeForward:()=>OO,selectParentNode:()=>kO,selectTextblockEnd:()=>AO,selectTextblockStart:()=>jO,setContent:()=>NO,setMark:()=>kk,setMeta:()=>Ak,setNode:()=>jk,setNodeSelection:()=>Mk,setTextDirection:()=>Nk,setTextSelection:()=>Pk,sinkListItem:()=>Fk,splitBlock:()=>Lk,splitListItem:()=>Rk,toggleList:()=>Wk,toggleMark:()=>Gk,toggleNode:()=>Kk,toggleWrap:()=>qk,undoInputRule:()=>Jk,unsetAllMarks:()=>Yk,unsetMark:()=>Xk,unsetTextDirection:()=>Zk,updateAttributes:()=>Qk,wrapIn:()=>$k,wrapInList:()=>eA});var xD=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),SD=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),CD=()=>({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=Ab(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},wD=e=>t=>e(t),TD=()=>({state:e,dispatch:t})=>oS(e,t),ED=(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},DD=()=>({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 OD(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 kD=e=>({tr:t,state:n,dispatch:r})=>{let i=OD(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},AD=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},jD=e=>e.content?/^text(\\*|\\+)/.test(e.content):!1,MD=(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 jD(r)?n===`left`?e.start()-1:e.end()+1:e.pos},ND=(e,t,n)=>({from:MD(e,n,`left`),to:MD(t,n,`right`)}),PD=()=>({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}=ND(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.scrollIntoView(),t(n)}return!0},FD=()=>({commands:e})=>e.keyboardShortcut(`Enter`),ID=()=>({state:e,dispatch:t})=>aS(e,t);function LD(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function RD(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:LD(t[r])?t[r].test(e[r]):t[r]===e[r])}function zD(e,t,n={}){return e.find(e=>e.type===t&&RD(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function BD(e,t,n={}){return!!zD(e,t,n)}function VD(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(!zD([...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&&BD([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&BD([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function HD(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 UD=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=HD(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=VD(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},WD=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 GD(e){return e instanceof q}function KD(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function qD(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,KD(0,i,a),KD(e.content.size,i,a)):q.create(e,KD(t,i,a),KD(t,i,a))}function JD(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function YD(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function XD(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var ZD=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(YD()||JD())&&r.dom.focus(),XD()&&!YD()&&!JD()&&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&&!GD(n.state.selection))return o(),!0;let s=qD(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},QD=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),$D=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),eO=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&&eO(r)}return e};function tO(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 eO(n)}function nO(e,t,n){if(e instanceof sy||e instanceof W)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,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),nO(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new My({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?Iy.fromSchema(a).parseSlice(tO(e),n.parseOptions):Iy.fromSchema(a).parse(tO(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=Iy.fromSchema(t);return n.slice?r.parseSlice(tO(e),n.parseOptions).content:r.parse(tO(e),n.parseOptions)}return nO(``,t,n)}function rO(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Cb||i instanceof wb))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 iO=e=>!(`type`in e),aO=(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{nO(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=nO(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;if((iO(i)?i:[i]).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 f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof W){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&rO(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},oO=()=>({state:e,dispatch:t})=>eS(e,t),sO=()=>({state:e,dispatch:t})=>tS(e,t),cO=()=>({state:e,dispatch:t})=>Ux(e,t),lO=()=>({state:e,dispatch:t})=>Zx(e,t),uO=()=>({state:e,dispatch:t,tr:n})=>{try{let r=qb(e.doc,e.selection.$from.pos,-1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},dO=()=>({state:e,dispatch:t,tr:n})=>{try{let r=qb(e.doc,e.selection.$from.pos,1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},fO=()=>({state:e,dispatch:t})=>Wx(e,t),pO=()=>({state:e,dispatch:t})=>Gx(e,t);function mO(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function hO(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))YD()||mO()?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 gO=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=hO(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 _O(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?OD(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=>RD(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var vO=(e,t={})=>({state:n,dispatch:r})=>_O(n,OD(e,n.schema),t)?nS(n,r):!1,yO=()=>({state:e,dispatch:t})=>sS(e,t),bO=e=>({state:t,dispatch:n})=>DS(OD(e,t.schema))(t,n),xO=()=>({state:e,dispatch:t})=>rS(e,t);function SO(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function CO(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 wO=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=SO(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=OD(e,r.schema)),s===`mark`&&(o=HD(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,CO(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(CO(a.attrs,t))))})})}),c},TO=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),EO=()=>({tr:e,dispatch:t})=>{if(t){let t=new Cx(e.doc);e.setSelection(t)}return!0},DO=()=>({state:e,dispatch:t})=>Jx(e,t),OO=()=>({state:e,dispatch:t})=>Qx(e,t),kO=()=>({state:e,dispatch:t})=>uS(e,t),AO=()=>({state:e,dispatch:t})=>gS(e,t),jO=()=>({state:e,dispatch:t})=>hS(e,t);function MO(e,t,n={},r={}){return nO(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var NO=(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=MO(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function PO(e,t){let n=HD(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 FO(e,t){let n=new gx(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function IO(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}function LO(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function RO(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 zO(e){return t=>RO(t.$from,e)}function X(e,t,n){return e.config[t]===void 0&&e.parent?X(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?X(e.parent,t,n):null}):e.config[t]}function BO(e){return e.map(e=>{let t=X(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...BO(t())]:e}).flat(10)}function VO(e,t){let n=Xy.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function HO(e){return typeof e==`function`}function Z(e,t=void 0,...n){return HO(e)?t?e.bind(t)(...n):e(...n):e}function UO(e={}){return Object.keys(e).length===0&&e.constructor===Object}function WO(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function GO(e){let t=[],{nodeExtensions:n,markExtensions:r}=WO(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=X(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=X(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 KO(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 qO(e){let t=[],n=KO(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 JO(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{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([...qO(n[e]),...qO(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function YO(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)=>JO(e,t),{})}function XO(e){return typeof e==`string`?e.match(/^[+-]?(?:\\d*\\.)?\\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function ZO(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):XO(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function QO(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&UO(t)?!1:t!=null))}function $O(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function ek(e,t){let n=GO(e),{nodeExtensions:r,markExtensions:i}=WO(e),a=r.find(e=>X(e,`topNode`))?.name;return new My({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=QO({...e.reduce((e,t)=>{let n=X(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:Z(X(r,`content`,a)),marks:Z(X(r,`marks`,a)),group:Z(X(r,`group`,a)),inline:Z(X(r,`inline`,a)),atom:Z(X(r,`atom`,a)),selectable:Z(X(r,`selectable`,a)),draggable:Z(X(r,`draggable`,a)),code:Z(X(r,`code`,a)),whitespace:Z(X(r,`whitespace`,a)),linebreakReplacement:Z(X(r,`linebreakReplacement`,a)),defining:Z(X(r,`defining`,a)),isolating:Z(X(r,`isolating`,a)),attrs:Object.fromEntries(i.map($O))}),s=Z(X(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>ZO(e,i)));let c=X(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:YO(e,i)}));let l=X(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=QO({...e.reduce((e,t)=>{let n=X(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:Z(X(r,`inclusive`,a)),excludes:Z(X(r,`excludes`,a)),group:Z(X(r,`group`,a)),spanning:Z(X(r,`spanning`,a)),code:Z(X(r,`code`,a)),attrs:Object.fromEntries(i.map($O))}),s=Z(X(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>ZO(e,i)));let c=X(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:YO(e,i)})),[r.name,o]}))})}function tk(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function nk(e){return e.sort((e,t)=>{let n=X(e,`priority`)||100,r=X(t,`priority`)||100;return n>r?-1:+(n<r)})}function rk(e){let t=nk(BO(e)),n=tk(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 ik(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`\n\n`,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;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function ak(e,t){return ik(e,{from:0,to:e.content.size},t)}function ok(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function sk(e,t){let n=OD(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 ck(e,t){let n=SO(typeof t==`string`?t:t.name,e.schema);return n===`node`?sk(e,t):n===`mark`?PO(e,t):{}}function lk(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 uk(e){let t=lk(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 dk(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}})})}),uk(r)}function fk(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=VD(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 pk=(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]};function mk(e,t){return t.nodes[e]||t.marks[e]||null}function hk(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 gk=(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 _k(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?HD(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>RD(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=>RD(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 vk(e,t,n={}){if(!t)return _O(e,null,n)||_k(e,null,n);let r=SO(t,e.schema);return r===`node`?_O(e,t,n):r===`mark`&&_k(e,t,n)}var yk=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=zO(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)},bk=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function xk(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Sk(e,t){let{nodeExtensions:n}=WO(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=Z(X(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function Ck(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&&(Ck(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function wk(e){return e instanceof J}var Tk=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Ek(e,t){let n=t.mapping.mapResult(e.position);return{position:new Tk(n.pos),mapResult:n}}function Dk(e){return new Tk(e)}function Ok(e,t,n){let{selection:r}=t,i=null;if(GD(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 kk=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=HD(e,r.schema);if(i){if(o){let e=PO(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 Ok(r,n,c)},Ak=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),jk=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=OD(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>vS(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>vS(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently \"setNode()\" only supports text block nodes.`),!1)},Mk=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=KD(e,0,n.content.size),i=J.create(n,r);t.setSelection(i)}return!0},Nk=(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},Pk=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=KD(r,a,o),c=KD(i,a,o),l=q.create(n,s,c);t.setSelection(l)}return!0},Fk=e=>({state:t,dispatch:n})=>AS(OD(e,t.schema))(t,n);function Ik(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 Lk=({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=hk(l,s.node().type.name,s.node().attrs);if(a instanceof J&&a.node.isBlock)return!s.parentOffset||!Hb(o,s.pos)?!1:(r&&(e&&Ik(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:IO(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=Hb(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&Hb(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&&Ik(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},Rk=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=OD(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={...hk(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={...hk(d,u.type.name,u.attrs),...t},m={...hk(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(!Hb(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 zk(e){return!e||e===`1`?null:e}function Bk(e,t){return zk(e)===zk(t)}var Vk=(e,t)=>{let n=zO(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&&Wb(e.doc,n.pos))||!Bk(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},Hk=(e,t)=>{let n=zO(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&&Wb(e.doc,r))||!Bk(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function Uk(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 Wk=(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=OD(e,o.schema),m=OD(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=zO(e=>Sk(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,ee=S&&w&&Sk(w.type.name,d)?{node:w,pos:0,depth:0}:null,te=x??ee,ne=!!x&&y.depth>=1&&y.depth-x.depth<=1,T=!!ee;if((ne||T)&&te){if(te.node.type===p)return S&&T?c().command(({tr:e,dispatch:t})=>{let n=Uk(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Sk(te.node.type.name,d)&&p.validContent(te.node.content))return c().command(()=>(a.setNodeMarkup(te.pos,p),!0)).command(()=>Vk(a,p)).command(()=>Hk(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>Vk(a,p)).command(()=>Hk(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(()=>Vk(a,p)).command(()=>Hk(a,p)).run()},Gk=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=HD(e,r.schema);return _k(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},Kk=(e,t,n={})=>({state:r,commands:i})=>{let a=OD(e,r.schema),o=OD(t,r.schema),s=_O(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})},qk=(e,t={})=>({state:n,commands:r})=>{let i=OD(e,n.schema);return _O(n,i,t)?r.lift(i):r.wrapIn(i,t)},Jk=()=>({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},Yk=(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},Xk=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=HD(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=VD(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},Zk=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},Qk=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=SO(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=OD(e,r.schema)),s===`mark`&&(o=HD(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},$k=(e,t={})=>({state:n,dispatch:r})=>_S(OD(e,n.schema),t)(n,r),eA=(e,t={})=>({state:n,dispatch:r})=>wS(OD(e,n.schema),t)(n,r),tA=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={}}};function nA(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 rA(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 iA(e){return typeof e==`number`}function aA(e){return Object.prototype.toString.call(e).slice(8,-1)}function oA(e){return aA(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}_D({},{createAtomBlockMarkdownSpec:()=>lA,createBlockMarkdownSpec:()=>uA,createInlineMarkdownSpec:()=>pA,parseAttributes:()=>sA,parseIndentedBlocks:()=>mA,renderNestedMarkdownContent:()=>hA,serializeAttributes:()=>cA});function sA(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/[\"']([^\"']*)[\"']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\\s)\\.([\\w-]+)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\\s)#([\\w-]+)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\\w-]*)\\s*=\\s*(__QUOTED_\\d+__)/g)).forEach(([,e,r])=>{let i=parseInt(r.match(/__QUOTED_(\\d+)__/)?.[1]||`0`,10),a=n[i];a&&(t[e]=a.slice(1,-1))});let o=r.replace(/(?:^|\\s)\\.([\\w-]+)/g,``).replace(/(?:^|\\s)#([\\w-]+)/g,``).replace(/([a-zA-Z][\\w-]*)\\s*=\\s*__QUOTED_\\d+__/g,``).trim();return o&&o.split(/\\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\\w-]*$/)&&(t[e]=!0)}),t}function cA(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e!==`class`&&e!==`id`&&(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}=\"${String(n)}\"`))}),t.join(` `)}function lA(e){let{nodeName:t,name:n,parseAttributes:r=sA,serializeAttributes:i=cA,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\\\s+\\\\{([^}]*)\\\\})?\\\\s*:::(?:\\\\n|$)`),s=e.match(a);if(!s)return;let l=s[1]||``,u=r(l);if(!o.find(e=>!(e in u)))return{type:t,raw:s[0],attributes:u}}},renderMarkdown:e=>{let t=l(e.attrs||{}),n=i(t),r=n?` {${n}}`:``;return`:::${c}${r} :::`}}}function uA(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=sA,serializeAttributes:a=cA,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\\\s+\\\\{([^}]*)\\\\})?\\\\s*\\\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\\w-]*)(\\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m){if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m)}return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=u(e.attrs||{}),r=a(n),i=r?` {${r}}`:``,o=t.renderChildren(e.content||[],`\n\n`);return`:::${l}${i}\n\n${o}\n\n:::`}}}function dA(e){if(!e.trim())return{};let t={},n=/(\\w+)=(?:\"([^\"]*)\"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function fA(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}=\"${t}\"`).join(` `)}function pA(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=dA,serializeAttributes:a=fA,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\\]\\\\]/g,`\\\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\\\[${d}\\\\s*[^\\\\]]*\\\\]`:`\\\\[${d}\\\\s*[^\\\\]]*\\\\][\\\\s\\\\S]*?\\\\[\\\\/${d}\\\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\\\[${d}\\\\s*([^\\\\]]*)\\\\]`:`^\\\\[${d}\\\\s*([^\\\\]]*)\\\\]([\\\\s\\\\S]*?)\\\\[\\\\/${d}\\\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=u(e.attrs||{}),i=a(n),o=i?` ${i}`:``;return s?`[${l}${o}]`:`[${l}${o}]${t}[/${l}]`}}}function mA(e,t,n){let r=e.split(`\n`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}\n`;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}\n`,o+=1;continue}break}if((e.match(/^(\\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}\n`,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`\n`);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function hA(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`\n`).map(e=>e?t.indent(e):t.indent(``)).join(`\n`);s+=e.type===`paragraph`?`\n\n${n}`:`\n${n}`}}),s}function gA(e,t){let n={...e};return oA(e)&&oA(t)&&Object.keys(t).forEach(r=>{oA(t[r])&&oA(e[r])?n[r]=gA(e[r],t[r]):n[r]=t[r]}),n}function _A(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 vA=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},yA=(e,t)=>{if(LD(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 bA(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=gk(c)+i;return a.forEach(e=>{if(l)return;let a=yA(u,e.find);if(!a)return;let c=s.state.tr,d=vD({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new yD({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})!==null&&c.steps.length&&(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function xA(e){let{editor:t,rules:n}=e,r=new Lx({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:VO(W.from(e),a.schema);let{from:i}=s,o=i+e.length;bA({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 bA({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&bA({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?bA({editor:t,from:a.pos,to:a.pos,text:`\n`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var SA=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{...Z(X(this,`addOptions`,{name:this.name}))}}get storage(){return{...Z(X(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>gA(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}},CA=class e extends SA{constructor(){super(...arguments),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)}},wA=class{constructor(e){this.find=e.find,this.handler=e.handler}},TA=(e,t,n)=>{if(LD(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 EA(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new yD({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||TA(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+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 DA=null,OA=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function kA(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=vD({state:e,transaction:c});if(EA({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 Lx({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(DA=t)},i=()=>{DA&&=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=DA;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:VO(W.from(t),r.schema);let{from:n}=d,i=n+t.length,a=OA(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(iA(p)&&m&&p!==m.b)return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var AA=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=rk(e),this.schema=ek(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=X(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:mk(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return nk([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:mk(t.name,this.schema)},r=[],i=X(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&X(t,`exitable`,n)&&(a.ArrowRight=()=>CA.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=mD(a);r.push(o);let s=X(t,`addInputRules`,n);if(xk(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=xA({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=X(t,`addPasteRules`,n);if(xk(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=kA({editor:e,rules:t});r.push(...n)}}let l=X(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return GO(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=WO(this.extensions);return Object.fromEntries(t.filter(e=>!!X(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=X(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:OD(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=YO(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 nk([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:mk(n.name,this.schema)},i=X(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return nk([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:mk(n.name,this.schema)},i=X(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}=WO(this.extensions);return Object.fromEntries(t.filter(e=>!!X(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=X(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:HD(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=YO(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{_A(i,e,t)}})}]:[]}))}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.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:mk(e.name,this.schema)};e.type===`mark`&&((Z(X(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(Z(X(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=X(e,`onBeforeCreate`,t),r=X(e,`onCreate`,t),i=X(e,`onUpdate`,t),a=X(e,`onSelectionUpdate`,t),o=X(e,`onTransaction`,t),s=X(e,`onFocus`,t),c=X(e,`onBlur`,t),l=X(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)})}};AA.resolve=rk,AA.sort=nk,AA.flatten=BO,_D({},{ClipboardTextSerializer:()=>MA,Commands:()=>NA,Delete:()=>PA,Drop:()=>FA,Editable:()=>IA,FocusEvents:()=>RA,Keymap:()=>zA,Paste:()=>BA,Tabindex:()=>VA,TextDirection:()=>HA,focusEventsPluginKey:()=>LA});var jA=class e extends SA{constructor(){super(...arguments),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)}},MA=jA.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Lx({key:new Bx(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=ok(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})=>ik(r,{from:e.pos,to:t.pos},s)).join(o??`\n\n`)}}})]}}),NA=jA.create({name:`commands`,addCommands(){return{...bD}}}),PA=jA.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=FO(e.before,[e,...t]);dk(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof bb){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0&&r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)),u=r.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:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),FA=jA.create({name:`drop`,addProseMirrorPlugins(){return[new Lx({key:new Bx(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),IA=jA.create({name:`editable`,addProseMirrorPlugins(){return[new Lx({key:new Bx(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),LA=new Bx(`focusEvents`),RA=jA.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new Lx({key:LA,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}}}})]}}),zA=jA.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 YD()||mO()?i:r},addProseMirrorPlugins(){return[new Lx({key:new Bx(`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||!Ck(n.doc))return;let u=n.tr,d=vD({state:n,transaction:u}),{commands:f}=new yD({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),BA=jA.create({name:`paste`,addProseMirrorPlugins(){return[new Lx({key:new Bx(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),VA=jA.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Lx({key:new Bx(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),HA=jA.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=WO(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 Lx({key:new Bx(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),UA=class e{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 name(){return this.node.type.name}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\\u2019t 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)}},WA=`.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}`,GA=class extends tA{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.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:Ek,createMappablePosition:Dk},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(),n=qD(t,this.options.autofocus);this.editorState=Fx.create({doc:t,schema:this.schema,selection:n||void 0}),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){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.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=rA(WA,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 this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=HO(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(){let e=[...this.options.enableCoreExtensions?[IA,MA.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),NA,RA,zA,VA.configure({value:this.options.coreExtensionOptions?.tabindex?.value}),FA,BA,PA,HA.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 AA(e,this)}createCommandManager(){this.commandManager=new yD({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=MO(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,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()}}),e=MO(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}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 JE(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 ck(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return vk(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return VO(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`\n\n`,textSerializers:n={}}=e||{};return ak(this.state.doc,{blockSeparator:t,textSerializers:{...ok(this.schema),...n}})}get isEmpty(){return Ck(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:null;return new UA(t,this,!1,n)}get $doc(){return this.$pos(0)}};function KA(e){return new vA({find:e.find,handler:({state:t,range:n,match:r})=>{let i=Z(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(fk(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 qA(e){return new vA({find:e.find,handler:({state:t,range:n,match:r})=>{let i=Z(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 JA(e){return new vA({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=Z(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 YA(e){return new vA({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=Z(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&Mb(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&&Wb(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var XA=class e extends SA{constructor(){super(...arguments),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)}};function ZA(e){return new wA({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=Z(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(fk(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)}}})}var QA=xv({tagPrefix:`:@octanejs/tiptap:`,slotlessPrefix:`@octanejs/tiptap:`});function $A(e){let t=e.at(-1);return typeof t==`symbol`?[e.slice(0,-1),t]:[e,void 0]}var{getOwnPropertyNames:ej,getOwnPropertySymbols:tj}=Object,{hasOwnProperty:nj}=Object.prototype;function rj(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function ij(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function aj(e){return e?.[Symbol.toStringTag]}function oj(e){return ej(e).concat(tj(e))}var sj=Object.hasOwn||((e,t)=>nj.call(e,t));function cj(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var lj=`__v`,uj=`__o`,dj=`_owner`,fj=typeof Float16Array<`u`,{getOwnPropertyDescriptor:pj,keys:mj}=Object;function hj(e,t){return e.byteLength===t.byteLength&&Oj(new Uint8Array(e),new Uint8Array(t))}function gj(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function _j(e,t){return e.byteLength===t.byteLength&&Oj(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function vj(e,t){return cj(e.getTime(),t.getTime())}function yj(e,t,n){return e.name===t.name&&e.message===t.message&&e.stack===t.stack&&n.equals(e.cause,t.cause,`cause`,`cause`,e,t,n)}function bj(e,t){return e===t}function xj(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var Sj=cj;function Cj(e,t,n){let r=mj(e),i=r.length;if(mj(t).length!==i)return!1;for(;i-->0;)if(!Mj(e,t,n,r[i]))return!1;return!0}function wj(e,t,n){let r=oj(e),i=r.length;if(oj(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!Mj(e,t,n,a)||(o=pj(e,a),s=pj(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Tj(e,t){return cj(e.valueOf(),t.valueOf())}function Ej(e,t){return e.source===t.source&&e.flags===t.flags}function Dj(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function Oj(e,t){let n=e.length;if(t.length!==n||e.byteOffset!==t.byteOffset)return!1;if(e instanceof Float64Array||e instanceof Float32Array||fj&&e instanceof Float16Array){for(;n-->0;)if(e[n]!==t[n]&&(e[n]===e[n]||t[n]===t[n]))return!1;return!0}for(;n-->0;)if(e[n]!==t[n])return!1;return!0}function kj(e,t){return e.href===t.href||e.protocol===t.protocol&&e.username===t.username&&e.password===t.password&&e.host===t.host&&e.pathname===t.pathname&&e.hash===t.hash&&Aj(e.searchParams,t.searchParams)}function Aj(e,t){let n=e.toString(),r=t.toString();return n===r||jj(n)===jj(r)}function jj(e){return e.split(`&`).sort().join(`&`)}function Mj(e,t,n,r){return(r===dj||r===uj||r===lj)&&(e.$$typeof||t.$$typeof)?!0:sj(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Nj=`[object ArrayBuffer]`,Pj=`[object Arguments]`,Fj=`[object Boolean]`,Ij=`[object DataView]`,Lj=`[object Date]`,Rj=`[object Error]`,zj=`[object Map]`,Bj=`[object Number]`,Vj=`[object Object]`,Hj=`[object RegExp]`,Uj=`[object Set]`,Wj=`[object String]`,Gj={\"[object Int8Array]\":!0,\"[object Uint8Array]\":!0,\"[object Uint8ClampedArray]\":!0,\"[object Int16Array]\":!0,\"[object Uint16Array]\":!0,\"[object Int32Array]\":!0,\"[object Uint32Array]\":!0,\"[object Float16Array]\":!0,\"[object Float32Array]\":!0,\"[object Float64Array]\":!0,\"[object BigInt64Array]\":!0,\"[object BigUint64Array]\":!0},Kj=`[object URL]`,qj=Object.prototype.toString;function Jj({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`&&a(h,g,_);let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);if(y==null)return c(h,g,_);let b=qj.call(h);if(b===Lj)return r(h,g,_);if(b===Hj)return u(h,g,_);if(b===zj)return o(h,g,_);if(b===Uj)return d(h,g,_);if(b===Vj)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===Kj)return p(h,g,_);if(b===Rj)return i(h,g,_);if(b===Pj)return c(h,g,_);if(Gj[b])return f(h,g,_);if(b===Nj)return e(h,g,_);if(b===Ij)return n(h,g,_);if(b===Fj||b===Bj||b===Wj)return l(h,g,_);if(m){let e=m[b];if(!e){let t=aj(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function Yj({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:hj,areArraysEqual:n?wj:gj,areDataViewsEqual:_j,areDatesEqual:vj,areErrorsEqual:n?rj(yj,wj):rj(yj,Cj),areFunctionsEqual:bj,areMapsEqual:n?rj(xj,wj):xj,areNumbersEqual:Sj,areObjectsEqual:n?wj:Cj,arePrimitiveWrappersEqual:Tj,areRegExpsEqual:Ej,areSetsEqual:n?rj(Dj,wj):Dj,areTypedArraysEqual:n?rj(Oj,wj):Oj,areUrlsEqual:kj,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=ij(r.areArraysEqual),t=ij(r.areErrorsEqual),n=ij(r.areMapsEqual),i=ij(r.areObjectsEqual),a=ij(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areErrorsEqual:t,areMapsEqual:n,areObjectsEqual:i,areSetsEqual:a})}return r}function Xj(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function Zj({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var Qj=$j();$j({strict:!0}),$j({circular:!0}),$j({circular:!0,strict:!0}),$j({createInternalComparator:()=>cj}),$j({strict:!0,createInternalComparator:()=>cj}),$j({circular:!0,createInternalComparator:()=>cj}),$j({circular:!0,createInternalComparator:()=>cj,strict:!0});function $j(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=Jj(Yj(e));return Zj({circular:t,comparator:a,createState:r,equals:n?n(a):Xj(a),strict:i})}var eM=typeof Object.is==`function`?Object.is:(e,t)=>e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t;function tM(e,t,n,r){return Mc(nM,this,arguments)}function nM(e,t,n,r,...i){let a,o,s,c,l,u,d,f,[p,m]=$A(i),h=p[0],g=ul(null,QA(m,`selector:instance`)),_;if(g.current===null?(_={hasValue:!1,value:null},g.current=_):_=g.current,s=t,c=n,l=r,u=h,o=ru(QA(m,`selector:memo`),`useMemo`),f=iu(o,s,c,l,u),f===null){__hkl:{let e=!1,i,a,o=t=>{if(!e){e=!0,i=t;let n=r(t);if(h!==void 0&&_.hasValue){let e=_.value;if(h(e,n))return a=e,e}return a=n,n}let n=a;if(eM(i,t))return n;let o=r(t);return h!==void 0&&h(n,o)?(i=t,n):(i=t,a=o,o)},s=n??void 0;d=[()=>o(t()),s===void 0?void 0:()=>o(s())];break __hkl}a=au(o,d,s,c,l,u)}else a=f.value;let[v,y]=a,b=vl(e,v,y??v,QA(m,`selector:store`));return el(()=>{_.hasValue=!0,_.value=b},[b],QA(m,`selector:effect`)),b}var rM=typeof window<`u`?tl:el,iM=class{transactionNumber=0;lastTransactionNumber=0;lastSnapshot;editor;subscribers=new Set;constructor(e){this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor!==e&&(this.editor=e,this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.subscribers.forEach(e=>e())),!this.editor)return;let t=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},n=this.editor;return n.on(`transaction`,t),()=>{n.off(`transaction`,t)}}};function aM(e){return Mc(oM,this,arguments)}function oM(e,...t){let[,n]=$A(t),[r]=Lc(()=>new iM(e.editor),QA(n,`editor-state:manager`)),i=tM(r.subscribe,r.getSnapshot,r.getServerSnapshot,e.selector,e.equalityFn??Qj,QA(n,`editor-state:selector`));return rM(()=>r.watch(e.editor),[e.editor,r],QA(n,`editor-state:watch`)),QA(n,`editor-state:debug`),i}var sM=typeof window>`u`,cM=sM||!!(typeof window<`u`&&window.next),lM=new Set([`onBeforeCreate`,`onBlur`,`onCreate`,`onDestroy`,`onFocus`,`onSelectionUpdate`,`onTransaction`,`onUpdate`,`onContentError`,`onDrop`,`onPaste`,`onDelete`,`onMount`,`onUnmount`]),uM=class e{editor=null;options;subscriptions=new Set;scheduledDestructionTimeout;isComponentMounted=!1;previousDeps=null;instanceId=``;constructor(e){this.options=e,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=e??!0;return(sM||cM&&e===void 0)&&(t=!1),t?this.createEditor():null}createEditor(){return new GA({...this.options.current,onBeforeCreate:(...e)=>this.options.current.onBeforeCreate?.(...e),onBlur:(...e)=>this.options.current.onBlur?.(...e),onCreate:(...e)=>this.options.current.onCreate?.(...e),onDestroy:(...e)=>this.options.current.onDestroy?.(...e),onFocus:(...e)=>this.options.current.onFocus?.(...e),onSelectionUpdate:(...e)=>this.options.current.onSelectionUpdate?.(...e),onTransaction:(...e)=>this.options.current.onTransaction?.(...e),onUpdate:(...e)=>this.options.current.onUpdate?.(...e),onContentError:(...e)=>this.options.current.onContentError?.(...e),onDrop:(...e)=>this.options.current.onDrop?.(...e),onPaste:(...e)=>this.options.current.onPaste?.(...e),onDelete:(...e)=>this.options.current.onDelete?.(...e),onMount:(...e)=>this.options.current.onMount?.(...e),onUnmount:(...e)=>this.options.current.onUnmount?.(...e)})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>lM.has(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>e===t.extensions?.[n]):e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;clearTimeout(this.scheduledDestructionTimeout),this.scheduledDestructionTimeout=setTimeout(()=>{if(this.scheduledDestructionTimeout=void 0,typeof window<`u`){if(this.isComponentMounted&&this.instanceId===e){t?.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}},1)}};function dM(){return Mc(fM,this,arguments)}function fM(...e){let[t,n]=$A(e),r=t[0]??{},i=t[1]??[],a=ul(r,QA(n,`editor:options`));a.current=r;let[o]=Lc(()=>new uM(a),QA(n,`editor:manager`)),s=vl(o.subscribe,o.getEditor,o.getServerSnapshot,QA(n,`editor:store`));return QA(n,`editor:debug`),el(o.onRender(i),null,QA(n,`editor:lifecycle`)),aM({editor:s,selector:({transactionNumber:e})=>r.shouldRerenderOnTransaction===!1||r.shouldRerenderOnTransaction===void 0?null:r.immediatelyRender&&e===0?0:e+1},QA(n,`editor:state`)),s}var pM=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},mM=(e,t)=>{let{state:n,view:r}=e,{selection:i}=n;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0)return!1;let o=a.depth-1;if(o<0)return!1;let s=a.node(o),c=a.index(o);if(c===0)return!1;if(s.type===t)return e.commands.lift(t.name);let l=s.child(c-1);if(l.type!==t||!l.lastChild?.isTextblock)return!1;let u=a.before(),d=u-1-1,{tr:f}=n;return f.delete(u,a.after()).insert(d,a.parent.content),f.setSelection(q.create(f.doc,d)),r.dispatch(f.scrollIntoView()),!0},hM=/^\\s*>\\s$/,gM=XA.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return pM(`blockquote`,{...JO(this.options.HTMLAttributes,e),children:pM(`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(`\n`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`\n`))}),n.join(`\n>\n`)},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:()=>mM(this.editor,this.type)}},addInputRules(){return[YA({find:hM,type:this.type})]}}),_M=/(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/,vM=/(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g,yM=/(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/,bM=/(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g,xM=CA.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 pM(`strong`,{...JO(this.options.HTMLAttributes,e),children:pM(`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[KA({find:_M,type:this.type}),KA({find:yM,type:this.type})]},addPasteRules(){return[ZA({find:vM,type:this.type}),ZA({find:bM,type:this.type})]}}),SM=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]===\"`\"?null:{index:t.index,text:t[0],replaceWith:t[1]}},CM=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},wM=CA.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,JO(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[KA({find:SM,type:this.type})]},addPasteRules(){return[ZA({find:CM,type:this.type})]}}),TM=4,EM=/^```([a-z]+)?[\\s\\n]$/,DM=/^~~~([a-z]+)?[\\s\\n]$/,OM=XA.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:TM,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`,JO(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(`\n`):`\\`\\`\\`${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??TM,{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,`\n`,`\n`).split(`\n`).map(e=>o+e).join(`\n`);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??TM,{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,`\n`,`\n`).split(`\n`),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,`\n`,`\n`).split(`\n`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`\n`);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(`\n\n`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},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[JA({find:EM,type:this.type,getAttributes:e=>({language:e[1]})}),JA({find:DM,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Lx({key:new Bx(`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,`\n`));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}}})]}}),kM=XA.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`\n\n`):``}),AM=XA.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`,JO(this.options.HTMLAttributes,e)]},renderText(){return`\n`},renderMarkdown:()=>` \n`,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}).run()})])}},addKeyboardShortcuts(){return{\"Mod-Enter\":()=>this.editor.commands.setHardBreak(),\"Shift-Enter\":()=>this.editor.commands.setHardBreak()}}}),jM=XA.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]}`,JO(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=>JA({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\\\s$`),type:this.type,getAttributes:{level:e}}))}}),MM=XA.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,JO(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!nA(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return wk(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[qA({find:/^(?:---|—-|___\\s|\\*\\*\\*\\s)$/,type:this.type})]}}),NM=/(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))$/,PM=/(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))/g,FM=/(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))$/,IM=/(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))/g,LM=CA.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`,JO(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[KA({find:NM,type:this.type}),KA({find:FM,type:this.type})]},addPasteRules(){return[ZA({find:PM,type:this.type}),ZA({find:IM,type:this.type})]}}),RM=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,zM=`ελ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`,BM=`numeric`,VM=`ascii`,HM=`alpha`,UM=`asciinumeric`,WM=`alphanumeric`,GM=`domain`,KM=`emoji`,qM=`scheme`,JM=`slashscheme`,YM=`whitespace`;function XM(e,t){return e in t||(t[e]=[]),t[e]}function ZM(e,t,n){t[BM]&&(t[UM]=!0,t[WM]=!0),t[VM]&&(t[UM]=!0,t[HM]=!0),t[UM]&&(t[WM]=!0),t[HM]&&(t[WM]=!0),t[WM]&&(t[GM]=!0),t[KM]&&(t[GM]=!0);for(let r in t){let t=XM(r,n);t.indexOf(e)<0&&t.push(e)}}function QM(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function $M(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}$M.groups={},$M.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||=$M.groups;let i;return t&&t.j?i=t:(i=new $M(t),n&&r&&ZM(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||=$M.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 $M,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new $M,a&&(r&&(o.t&&typeof o.t==`string`?ZM(a,Object.assign(QM(o.t,r),n),r):n&&ZM(a,n,r)),o.t=a),i.j[e]=o,o}};var Q=(e,t,n,r,i)=>e.ta(t,n,r,i),eN=(e,t,n,r,i)=>e.tr(t,n,r,i),tN=(e,t,n,r,i)=>e.ts(t,n,r,i),$=(e,t,n,r,i)=>e.tt(t,n,r,i),nN=`WORD`,rN=`UWORD`,iN=`ASCIINUMERICAL`,aN=`ALPHANUMERICAL`,oN=`LOCALHOST`,sN=`TLD`,cN=`UTLD`,lN=`SCHEME`,uN=`SLASH_SCHEME`,dN=`NUM`,fN=`WS`,pN=`NL`,mN=`OPENBRACE`,hN=`CLOSEBRACE`,gN=`OPENBRACKET`,_N=`CLOSEBRACKET`,vN=`OPENPAREN`,yN=`CLOSEPAREN`,bN=`OPENANGLEBRACKET`,xN=`CLOSEANGLEBRACKET`,SN=`FULLWIDTHLEFTPAREN`,CN=`FULLWIDTHRIGHTPAREN`,wN=`LEFTCORNERBRACKET`,TN=`RIGHTCORNERBRACKET`,EN=`LEFTWHITECORNERBRACKET`,DN=`RIGHTWHITECORNERBRACKET`,ON=`FULLWIDTHLESSTHAN`,kN=`FULLWIDTHGREATERTHAN`,AN=`AMPERSAND`,jN=`APOSTROPHE`,MN=`ASTERISK`,NN=`AT`,PN=`BACKSLASH`,FN=`BACKTICK`,IN=`CARET`,LN=`COLON`,RN=`COMMA`,zN=`DOLLAR`,BN=`DOT`,VN=`EQUALS`,HN=`EXCLAMATION`,UN=`HYPHEN`,WN=`PERCENT`,GN=`PIPE`,KN=`PLUS`,qN=`POUND`,JN=`QUERY`,YN=`QUOTE`,XN=`FULLWIDTHMIDDLEDOT`,ZN=`SEMI`,QN=`SLASH`,$N=`TILDE`,eP=`UNDERSCORE`,tP=`EMOJI`,nP=`SYM`,rP=Object.freeze({__proto__:null,ALPHANUMERICAL:aN,AMPERSAND:AN,APOSTROPHE:jN,ASCIINUMERICAL:iN,ASTERISK:MN,AT:NN,BACKSLASH:PN,BACKTICK:FN,CARET:IN,CLOSEANGLEBRACKET:xN,CLOSEBRACE:hN,CLOSEBRACKET:_N,CLOSEPAREN:yN,COLON:LN,COMMA:RN,DOLLAR:zN,DOT:BN,EMOJI:tP,EQUALS:VN,EXCLAMATION:HN,FULLWIDTHGREATERTHAN:kN,FULLWIDTHLEFTPAREN:SN,FULLWIDTHLESSTHAN:ON,FULLWIDTHMIDDLEDOT:XN,FULLWIDTHRIGHTPAREN:CN,HYPHEN:UN,LEFTCORNERBRACKET:wN,LEFTWHITECORNERBRACKET:EN,LOCALHOST:oN,NL:pN,NUM:dN,OPENANGLEBRACKET:bN,OPENBRACE:mN,OPENBRACKET:gN,OPENPAREN:vN,PERCENT:WN,PIPE:GN,PLUS:KN,POUND:qN,QUERY:JN,QUOTE:YN,RIGHTCORNERBRACKET:TN,RIGHTWHITECORNERBRACKET:DN,SCHEME:lN,SEMI:ZN,SLASH:QN,SLASH_SCHEME:uN,SYM:nP,TILDE:$N,TLD:sN,UNDERSCORE:eP,UTLD:cN,UWORD:rN,WORD:nN,WS:fN}),iP=/[a-z]/,aP=/[a-z]/i,oP=/[\\u{1F000}-\\u{1FAFF}\\u{2600}-\\u{27BF}\\u{FE0F}]/u;try{aP=RegExp(`\\\\p{L}`,`u`),oP=RegExp(`\\\\p{Emoji}`,`u`)}catch{}var sP=/\\d/,cP=/\\s/,lP=`\\r`,uP=`\n`,dP=`️`,fP=``,pP=``,mP=null,hP=null;function gP(e=[]){let t={};$M.groups=t;let n=new $M;mP??=bP(RM),hP??=bP(zM),$(n,`'`,jN),$(n,`{`,mN),$(n,`}`,hN),$(n,`[`,gN),$(n,`]`,_N),$(n,`(`,vN),$(n,`)`,yN),$(n,`<`,bN),$(n,`>`,xN),$(n,`(`,SN),$(n,`)`,CN),$(n,`「`,wN),$(n,`」`,TN),$(n,`『`,EN),$(n,`』`,DN),$(n,`<`,ON),$(n,`>`,kN),$(n,`&`,AN),$(n,`*`,MN),$(n,`@`,NN),$(n,\"`\",FN),$(n,`^`,IN),$(n,`:`,LN),$(n,`,`,RN),$(n,`$`,zN),$(n,`.`,BN),$(n,`=`,VN),$(n,`!`,HN),$(n,`-`,UN),$(n,`%`,WN),$(n,`|`,GN),$(n,`+`,KN),$(n,`#`,qN),$(n,`?`,JN),$(n,`\"`,YN),$(n,`/`,QN),$(n,`;`,ZN),$(n,`~`,$N),$(n,`_`,eP),$(n,`\\\\`,PN),$(n,`・`,XN);let r=eN(n,sP,dN,{[BM]:!0});eN(r,sP,r);let i=eN(r,iP,iN,{[UM]:!0}),a=eN(r,aP,aN,{[WM]:!0}),o=eN(n,iP,nN,{[VM]:!0});eN(o,sP,i),eN(o,iP,o),eN(i,sP,i),eN(i,iP,i);let s=eN(n,aP,rN,{[HM]:!0});eN(s,iP),eN(s,sP,a),eN(s,aP,s),eN(a,sP,a),eN(a,iP),eN(a,aP,a);let c=$(n,uP,pN,{[YM]:!0}),l=$(n,lP,fN,{[YM]:!0}),u=eN(n,cP,fN,{[YM]:!0});$(n,pP,u),$(l,uP,c),$(l,pP,u),eN(l,cP,u),$(u,lP),$(u,uP),eN(u,cP,u),$(u,pP,u);let d=eN(n,oP,tP,{[KM]:!0});$(d,`#`),eN(d,oP,d),$(d,dP,d);let f=$(d,fP);$(f,`#`),eN(f,oP,d);let p=[[iP,o],[sP,i]],m=[[iP,null],[aP,s],[sP,a]];for(let e=0;e<mP.length;e++)yP(n,mP[e],sN,nN,p);for(let e=0;e<hP.length;e++)yP(n,hP[e],cN,rN,m);ZM(sN,{tld:!0,ascii:!0},t),ZM(cN,{utld:!0,alpha:!0},t),yP(n,`file`,lN,nN,p),yP(n,`mailto`,lN,nN,p),yP(n,`http`,uN,nN,p),yP(n,`https`,uN,nN,p),yP(n,`ftp`,uN,nN,p),yP(n,`ftps`,uN,nN,p),ZM(lN,{scheme:!0,ascii:!0},t),ZM(uN,{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]?{[qM]:!0}:{[JM]:!0};r.indexOf(`-`)>=0?i[GM]=!0:iP.test(r)?sP.test(r)?i[UM]=!0:i[VM]=!0:i[BM]=!0,tN(n,r,r,i)}return tN(n,`localhost`,oN,{ascii:!0}),n.jd=new $M(nP),{start:n,tokens:Object.assign({groups:t},rP)}}function _P(e,t){let n=vP(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 vP(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 yP(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 $M(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new $M(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function bP(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 xP={defaultProtocol:`http`,events:null,format:CP,formatHref:CP,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function SP(e,t=null){let n=Object.assign({},xP);e&&(n=Object.assign(n,e instanceof SP?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}SP.prototype={o:xP,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]:xP[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 CP(e){return e}function wP(e,t){this.t=`token`,this.v=e,this.tk=t}wP.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=xP.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 TP(e,t){class n extends wP{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 EP=TP(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),DP=TP(`text`),OP=TP(`nl`),kP=TP(`url`,{isLink:!0,toHref(e=xP.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==oN&&e[1].t===LN}}),AP=e=>new $M(e);function jP({groups:e}){let t=e.domain.concat([AN,MN,NN,PN,FN,IN,zN,VN,UN,dN,WN,GN,KN,qN,QN,nP,$N,eP]),n=[jN,LN,RN,BN,HN,WN,JN,YN,ZN,bN,xN,mN,hN,_N,gN,vN,yN,SN,CN,wN,TN,EN,DN,ON,kN],r=[AN,jN,MN,PN,FN,IN,zN,VN,UN,mN,hN,WN,GN,KN,qN,JN,QN,nP,$N,eP],i=AP(),a=$(i,$N);Q(a,r,a),Q(a,e.domain,a);let o=AP(),s=AP(),c=AP();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,NN);$(a,NN,l),$(s,NN,l),$(c,NN,l);let u=$(a,BN);Q(u,r,a),Q(u,e.domain,a);let d=AP();Q(l,e.domain,d),Q(d,e.domain,d);let f=$(d,BN);Q(f,e.domain,d);let p=AP(EP);Q(f,e.tld,p),Q(f,e.utld,p),$(l,oN,p);let m=$(d,UN);$(m,UN,m),Q(m,e.domain,d),Q(p,e.domain,d),$(p,BN,f),$(p,UN,m);let h=$(o,UN),g=$(o,BN);$(h,UN,h),Q(h,e.domain,o),Q(g,r,a),Q(g,e.domain,o);let _=AP(kP);Q(g,e.tld,_),Q(g,e.utld,_),Q(_,e.domain,o),Q(_,r,a),$(_,BN,g),$(_,UN,h),$(_,NN,l);let v=$(_,LN),y=AP(kP);Q(v,e.numeric,y);let b=AP(kP),x=AP();Q(b,t,b),Q(b,n,x),Q(x,t,b),Q(x,n,x),$(_,QN,b),$(y,QN,b);let S=$(s,LN),C=$($($(c,LN),QN),QN);Q(s,e.domain,o),$(s,BN,g),$(s,UN,h),Q(c,e.domain,o),$(c,BN,g),$(c,UN,h),Q(S,e.domain,b),$(S,QN,b),$(S,JN,b),Q(C,e.domain,b),Q(C,t,b),$(C,QN,b);let w=[[mN,hN],[gN,_N],[vN,yN],[bN,xN],[SN,CN],[wN,TN],[EN,DN],[ON,kN]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=$(b,r);$(x,r,a);let o=AP(kP);Q(a,t,o);let s=AP();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,oN,_),$(i,pN,OP),{start:i,tokens:rP}}function MP(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(NP(DP,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(NP(e,t,r))}}return o.length>0&&a.push(NP(DP,t,o)),a}function NP(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var PP=typeof console<`u`&&console&&console.warn||(()=>{}),FP=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,IP={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function LP(){return $M.groups={},IP.scanner=null,IP.parser=null,IP.tokenQueue=[],IP.pluginQueue=[],IP.customSchemes=[],IP.initialized=!1,IP}function RP(e,t=!1){if(IP.initialized&&PP(`linkifyjs: already initialized - will not register custom scheme \"${e}\" ${FP}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or \"-\"\n2. Cannot start or end with \"-\"\n3. \"-\" cannot repeat`);IP.customSchemes.push([e,t])}function zP(){IP.scanner=gP(IP.customSchemes);for(let e=0;e<IP.tokenQueue.length;e++)IP.tokenQueue[e][1]({scanner:IP.scanner});IP.parser=jP(IP.scanner.tokens);for(let e=0;e<IP.pluginQueue.length;e++)IP.pluginQueue[e][1]({scanner:IP.scanner,parser:IP.parser});return IP.initialized=!0,IP}function BP(e){return IP.initialized||zP(),MP(IP.parser.start,e,_P(IP.scanner.start,e))}BP.scan=_P;function VP(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 SP(n),i=BP(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 HP=`[\\0- \\xA0 -\\u2029 ]`,UP=new RegExp(HP),WP=RegExp(`${HP}$`),GP=new RegExp(HP,`g`);function KP(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function qP(e){return new Lx({key:new Bx(`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(dk(FO(n.doc,[...t])).forEach(({newRange:t})=>{let n=LO(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(!WP.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(UP).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=BP(n).map(t=>t.toObject(e.defaultProtocol));if(!KP(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=>{fk(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 JP(e){return new Lx({key:new Bx(`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=ck(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function YP(e){return new Lx({key:new Bx(`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=VP(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 XP(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(GP,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\\\^$*+?.()|[\\]{}]/g,`\\\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\\\-]+(?:[^a-z+.\\\\-:]|$))`,`i`))}var ZP=CA.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`){RP(e);return}RP(e.scheme,e.optionalSlashes)})},onDestroy(){LP()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!XP(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=>!!XP(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=>!!XP(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,JO(this.options.HTMLAttributes,e),0]:[`a`,JO(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=>!!XP(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=>!!XP(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()}},addPasteRules(){return[ZA({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=VP(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!XP(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(qP({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!XP(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(JP({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(YP({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),QP=Object.defineProperty,$P=(e,t)=>{for(var n in t)QP(e,n,{get:t[n],enumerable:!0})},eF=`listItem`,tF=`textStyle`,nF=/^\\s*([-+*])\\s$/,rF=XA.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`,JO(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,`\n`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eF,this.editor.getAttributes(tF)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{\"Mod-Shift-8\":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=YA({find:nF,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=YA({find:nF,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(tF),editor:this.editor})),[e]}}),iF=(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}},aF=(e,t,n,r)=>{let i=iF(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},oF=(e,t,n)=>aF(e.state,e.view.dispatch,t,n),sF=(e,t)=>jA.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>oF(this.editor,e,t);return{Delete:n,\"Mod-Delete\":n}}}),cF=[[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`]],lF=`abcdefghijklmnopqrstuvwxyz`,uF=String.raw`\\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function dF(e){let t=e,n=``;for(let[e,r]of cF)for(;t>=e;)n+=r,t-=e;return n}function fF(e){return dF(e).toUpperCase()}function pF(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of cF)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function mF(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=pF(e);return t<=0?!1:(e===e.toLowerCase()?dF(t):fF(t))===e}function hF(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 gF(e){if(e<=26)return lF[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?lF[n]:lF[t]+lF[n]}function _F(e){if(e&&!/^\\d+$/.test(e)){if(mF(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 vF(e){if(/^\\d+$/.test(e))return parseInt(e,10);let t=_F(e);if(t===`i`||t===`I`)return pF(e);if(t===`a`||t===`A`){let t=hF(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function yF(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return gF(t);case`A`:return gF(t).toUpperCase();case`i`:return dF(t);case`I`:return fF(t);default:return String(t)}}function bF(e){if(e.length===0)return!1;let t=_F(e[0])??`numeric`,n=vF(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=yF(t,n+r);if(e[r]!==i)return!1}return!0}function xF(e){return{type:_F(e),start:vF(e)}}function SF(e){let{type:t,start:n}=xF(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function CF(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${gF(r)}${n}`;case`A`:return`${gF(r).toUpperCase()}${n}`;case`i`:return`${dF(r)}${n}`;case`I`:return`${fF(r)}${n}`;default:return`${r}${n}`}}function wF(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function TF(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var EF=XA.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,JO(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(wF(e))return{type:`listItem`,content:[{type:`paragraph`,content:TF(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)=>hA(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){let t=e.meta?.parentAttrs?.start||1;return CF(e.meta?.parentAttrs?.type,t-1+(e.index||0),`. `)}return`- `},n),addExtensions(){return[sF(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)}}});$P({},{findListItemPos:()=>DF,getNextListDepth:()=>OF,handleBackspace:()=>AF,handleDelete:()=>NF,hasListBefore:()=>kF,hasListItemAfter:()=>PF,hasListItemBefore:()=>FF,listItemHasSubList:()=>IF,nextListIsDeeper:()=>jF,nextListIsHigher:()=>MF});var DF=(e,t)=>{let{$from:n}=t.selection,r=OD(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}},OF=(e,t)=>{let n=DF(e,t);if(!n)return!1;let[,r]=pk(t,e,n.$pos.pos+4);return r},kF=(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))},AF=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!_O(e.state,t)&&kF(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()}return!_O(e.state,t)||!bk(e.state)?!1:e.chain().liftListItem(t).run()},jF=(e,t)=>{let n=OF(e,t),r=DF(e,t);return!r||!n?!1:n>r.depth},MF=(e,t)=>{let n=OF(e,t),r=DF(e,t);return!r||!n?!1:n<r.depth},NF=(e,t)=>{if(!_O(e.state,t)||!yk(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:jF(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():MF(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},PF=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return r.index()!==r.parent.childCount-1&&r.nodeAfter?.type.name===e},FF=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return r.index()!==0&&r.nodeBefore?.type.name===e},IF=(e,t,n)=>{if(!n)return!1;let r=OD(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},LF=jA.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&&NF(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&&NF(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&&AF(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&&AF(e,n,r)&&(t=!0)}),t}}}}),RF=RegExp(`^(\\\\s*)(${uF})([.)])\\\\s+(.*)$`),zF=/^\\s/,BF={heading:/^#{1,6}(?:\\s|$)/,bulletItem:/^[-+*]\\s+/,codeFence:/^(?:```|~~~)/,thematicBreak:/^(?:(?:-[ \\t]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})$/};function VF(e){return RF.test(e.trimStart())}function HF(e){let t=e.trimStart();return BF.bulletItem.test(t)||VF(t)||BF.heading.test(t)||BF.thematicBreak.test(t)&&!t.startsWith(`-`)||/^>\\s?/.test(t)||BF.codeFence.test(t)}function UF(e){return Object.values(BF).some(t=>t.test(e))}function WF(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&&HF(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function GF(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(RF);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?_F(s):void 0,p=isNaN(d)?vF(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(RF))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(zF)){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(_||UF(t))break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(`\n`).trim(),contentLines:m,raw:g.join(`\n`)}),r=h,n=h}return[t,r]}var KF=RegExp(`^(${uF})([.)])\\\\s+(.+)$`);function qF(e){let t=e.split(`\n`).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(KF);if(!t)return null;n.push({marker:t[1],content:t[3]})}return bF(n.map(e=>e.marker))?{type:`orderedList`,attrs:SF(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function JF(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=WF(a.contentLines),c=o.join(`\n`).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`\n`).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=JF(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(`\n`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function YF(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 XF=`listItem`,ZF=`textStyle`,QF=/^(\\d+)\\.\\s$/;function $F(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 eI=XA.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=$F(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=$F(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=JO(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?YF(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,`\n`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let r=e.split(`\n`),[i,a]=GF(r);if(i.length===0)return;let o=JF(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(`\n`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(XF,this.editor.getAttributes(ZF)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{\"Mod-Shift-7\":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new Lx({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=qF(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=YA({find:QF,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=YA({find:QF,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(ZF)}),joinPredicate:e,editor:this.editor})),[t]}}),tI=/^\\s*(\\[([( |x])?\\])\\s$/,nI=XA.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}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,JO(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)=>hA(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[sF(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`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};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=YO(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[YA({find:tI,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),rI=XA.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`,JO(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,`\n`):``,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=mA(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=mA(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()}}});jA.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(rF.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(EF.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(LF.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(eI.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(nI.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(rI.configure(this.options.taskList)),e}});var iI=` `,aI=`\\xA0`,oI=XA.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,JO(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===iI||n[0].text===iI||n[0].raw===aI||n[0].text===aI)&&r.length===1&&r[0].type===`text`&&(r[0].text===iI||r[0].text===aI)?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){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?iI:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{\"Mod-Alt-0\":()=>this.editor.commands.setParagraph()}}}),sI=/(?:^|\\s)(~~(?!\\s+~~)((?:[^~]+))~~(?!\\s+~~))$/,cI=/(?:^|\\s)(~~(?!\\s+~~)((?:[^~]+))~~(?!\\s+~~))/g,lI=CA.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`,JO(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[KA({find:sI,type:this.type})]},addPasteRules(){return[ZA({find:cI,type:this.type})]}}),uI=XA.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),dI=CA.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`,JO(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 fI(e={}){return new Lx({view(t){return new pI(t,e)}})}var pI=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.setCursor(null),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=Xb(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)}},mI=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 hI(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!_I(e)||!vI(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}}};mI.prototype.visible=!1,mI.findFrom=mI.findGapCursorFrom,K.jsonID(`gapcursor`,mI);var hI=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 mI.valid(t)?new mI(t):K.near(t)}};function gI(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function _I(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||gI(e.type))return!0;if(e.inlineContent)return!1}}return!0}function vI(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||gI(e.type))return!0;if(e.inlineContent)return!1}}return!0}function yI(){return new Lx({props:{decorations:wI,createSelectionBetween(e,t,n){return t.pos==n.pos&&mI.valid(n)?new mI(n):null},handleClick:SI,handleKeyDown:bI,handleDOMEvents:{beforeinput:CI}}})}var bI=hD({ArrowLeft:xI(`horiz`,-1),ArrowRight:xI(`horiz`,1),ArrowUp:xI(`vert`,-1),ArrowDown:xI(`vert`,1)});function xI(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=mI.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new mI(c))),!0):!1}}function SI(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!mI.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 mI(r))),!0)}function CI(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof mI))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 wI(e){if(!(e.selection instanceof mI))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,mE.create(e.doc,[dE.widget(e.selection.head,t,{key:`gapcursor`})])}var TI=200,EI=function(){};EI.prototype.append=function(e){return e.length?(e=EI.from(e),!this.length&&e||e.length<TI&&this.leafAppend(e)||this.length<TI&&e.leafPrepend(this)||this.appendInner(e)):this},EI.prototype.prepend=function(e){return e.length?EI.from(e).append(this):this},EI.prototype.appendInner=function(e){return new OI(this,e)},EI.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?EI.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},EI.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},EI.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)},EI.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},EI.from=function(e){return e instanceof EI?e:e&&e.length?new DI(e):EI.empty};var DI=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<=TI)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=TI)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}(EI);EI.empty=new DI([]);var OI=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}(EI),kI=500,AI=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 MI(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 MI(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 MI(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>PI&&(s=jI(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new mb;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 MI(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;n=Math.min(this.items.length,n);let r=[],i=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 MI(i,o,l))}else r.push(new MI(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new MI(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>kI&&(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 MI(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(EI.from(i.reverse()),a)}};AI.empty=new AI(EI.empty,0);function jI(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var MI=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)}}},NI=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},PI=20;function FI(e,t,n,r){let i=n.getMeta(UI),a;if(i)return i.historyState;n.getMeta(WI)&&(e=new NI(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(UI))return o.getMeta(UI).redo?new NI(e.done.addTransform(n,void 0,r,HI(t)),e.undone,LI(n.mapping.maps),e.prevTime,e.prevComposition):new NI(e.done,e.undone.addTransform(n,void 0,r,HI(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||!II(n,e.prevRanges)),s=o?RI(e.prevRanges,n.mapping):LI(n.mapping.maps);return new NI(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,HI(t)),AI.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new NI(e.done.rebased(n,a),e.undone.rebased(n,a),RI(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new NI(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),RI(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function II(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 LI(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 RI(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 zI(e,t,n){let r=HI(t),i=UI.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 NI(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(UI,{redo:n,historyState:c})}var BI=!1,VI=null;function HI(e){let t=e.plugins;if(VI!=t){BI=!1,VI=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){BI=!0;break}}return BI}var UI=new Bx(`history`),WI=new Bx(`closeHistory`);function GI(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Lx({key:UI,state:{init(){return new NI(AI.empty,AI.empty,null,0,-1)},apply(t,n,r){return FI(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?qI:n==`historyRedo`?JI:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function KI(e,t){return(n,r)=>{let i=UI.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=zI(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var qI=KI(!1,!0),JI=KI(!0,!0);jA.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 Lx({key:new Bx(`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 YI=jA.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[fI(this.options)]}});jA.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new Lx({key:new Bx(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return mE.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(dE.node(t,t+e.nodeSize,{class:this.options.className}))}),mE.create(e,a)}}})]}});var XI=jA.create({name:`gapCursor`,addProseMirrorPlugins(){return[yI()]},extendNodeSchema(e){return{allowGapCursor:Z(X(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),ZI=`placeholder`,QI=new Bx(`tiptap__placeholder`);function $I(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),dE.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function eL(e,t){return typeof e==`function`?e(t):e}function tL({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&&Ck(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push($I({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:eL(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function nL({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&&Ck(c)){let r=a>=l&&a<=l+c.nodeSize;o.push($I({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:eL(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...tL({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return mE.create(r,o)}function rL(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 iL(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function aL(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 oL(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 sL(e,t){let n=aL(e,t.from,t.to);return n.push(iL(e,rL(e,t.from))),t.to>t.from?n.push(iL(e,rL(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(iL(e,rL(e,Math.min(t.from+1,e.content.size)))),n}function cL(e,t,n){let r=[];if(e.docChanged){let t=dk(e);for(let e of t)r.push(...sL(n.doc,e.newRange))}return e.selectionSet&&(r.push(iL(n.doc,rL(n.doc,e.mapping.map(t.selection.anchor)))),r.push(iL(n.doc,rL(n.doc,n.selection.anchor)))),oL(r)}function lL(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 uL({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}=lL(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=tL({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function dL({editor:e,options:t,dataAttribute:n}){return{init(r,i){return nL({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??mE.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:uL({decorations:i.map(r.mapping,r.doc),ranges:cL(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function fL(e){return e.replace(/\\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function pL({editor:e,options:t}){let n=t.dataAttribute?`data-${fL(t.dataAttribute)}`:`data-${ZI}`,r=t.showOnlyCurrent&&!t.includeChildren;return new Lx({key:QI,...r?{}:{state:dL({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>nL({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?mE.empty:QI.getState(n)??mE.empty}})}jA.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:ZI,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[pL({editor:this.editor,options:this.options})]}});function mL(e,t){return!e.selection.empty&&!wk(e.selection)&&t.isEditable}function hL(e,t){return mL(e,t)&&!t.isFocused&&!t.view.dragging}function gL(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function _L(e){e.focus()}jA.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new Lx({key:new Bx(`selection`),props:{decorations(n){return hL(n,e)?mE.create(n.doc,[dE.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return mL(t.state,e)&&gL(),!1},focus(t){return mL(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&_L(t)}),!1}}}})]}});function vL({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var yL=jA.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new Bx(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 Lx({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!vL({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!vL({node:r,types:n})}}})]}}),bL=jA.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>qI(e,t),redo:()=>({state:e,dispatch:t})=>JI(e,t)}},addProseMirrorPlugins(){return[GI(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()}}}),xL=jA.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(xM.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(gM.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(rF.configure(this.options.bulletList)),this.options.code!==!1&&e.push(wM.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(OM.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(kM.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(YI.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(XI.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(AM.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(jM.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(bL.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(MM.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(LM.configure(this.options.italic)),this.options.listItem!==!1&&e.push(EF.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(LF.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(ZP.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(eI.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(oI.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(lI.configure(this.options.strike)),this.options.text!==!1&&e.push(uI.configure(this.options.text)),this.options.underline!==!1&&e.push(dI.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(yL.configure(this.options?.trailingNode)),e}}),SL=gu(`<div></div>`),CL=Wn(10),wL=Symbol(CL+5),TL={bold:e=>e.toggleBold(),italic:e=>e.toggleItalic(),underline:e=>e.toggleUnderline(),strikethrough:e=>e.toggleStrike(),code:e=>e.toggleCode(),blockquote:e=>e.toggleBlockquote(),bulletList:e=>e.toggleBulletList(),orderedList:e=>e.toggleOrderedList(),codeBlock:e=>e.toggleCodeBlock(),horizontalRule:e=>e.setHorizontalRule(),paragraph:e=>e.setParagraph(),heading1:e=>e.toggleHeading({level:1}),heading2:e=>e.toggleHeading({level:2}),heading3:e=>e.toggleHeading({level:3}),heading4:e=>e.toggleHeading({level:4}),heading5:e=>e.toggleHeading({level:5}),heading6:e=>e.toggleHeading({level:6})},EL=[[`bold`,`bold`],[`italic`,`italic`],[`underline`,`underline`],[`strikethrough`,`strike`],[`code`,`code`],[`blockquote`,`blockquote`],[`bulletList`,`bulletList`],[`orderedList`,`orderedList`],[`codeBlock`,`codeBlock`],[`link`,`link`],[`heading1`,`heading`,{level:1}],[`heading2`,`heading`,{level:2}],[`heading3`,`heading`,{level:3}],[`heading4`,`heading`,{level:4}],[`heading5`,`heading`,{level:5}],[`heading6`,`heading`,{level:6}],[`paragraph`,`paragraph`]];function DL(e){let t=[];for(let[n,r,i]of EL)e.isActive(r,i)&&t.push(n);return t}var OL=yl(function(e,t,n){let r=ul(void 0,CL+0),i=ul(void 0,CL+1),a=ul(JSON.stringify([e.json!==void 0,e.value]),CL+2),o=ul(JSON.stringify(e.json),CL+3),s=ul(void 0,CL+4),c=Nc(wL,dM,{extensions:[xL],content:e.json??e.value??``,editable:e.editable!==!1,autofocus:e.autofocus??!1,onCreate:()=>e.onReady?.(),onUpdate:({editor:t})=>{let n=t.getHTML();r.current=n,e.onChange?.(n);let a=t.getJSON();i.current=JSON.stringify(a),e.onJSONChange?.(a)},onFocus:()=>e.onFocus?.(),onBlur:()=>e.onBlur?.(),onSelectionUpdate:({editor:t})=>e.onSelectionChange?.({start:t.state.selection.from,end:t.state.selection.to,active:DL(t)})});if(el(()=>{if(!c)return;let t=JSON.stringify([e.json!==void 0,e.value]);t!==a.current&&(a.current=t,e.value!==void 0&&e.json===void 0&&e.value!==r.current&&c.commands.setContent(e.value))},[c,e.value,e.json],CL+6),el(()=>{if(!c)return;let t=JSON.stringify(e.json);t!==o.current&&(o.current=t,e.json!==void 0&&t!==i.current&&c.commands.setContent(e.json))},[c,e.json],CL+7),el(()=>{c&&c.setEditable(e.editable!==!1)},[c,e.editable],CL+8),fl(e.ref,()=>{if(!c)return null;let e=c;return s.current={getHTML:()=>e.getHTML(),setHTML:t=>e.commands.setContent(t),getJSON:()=>e.getJSON(),setJSON:t=>e.commands.setContent(t),apply:t=>{let n=TL[t];n&&n(e.chain().focus()).run()},linkTo:(t,n)=>{n!=null&&n!==``?e.chain().focus().insertContent({type:`text`,text:n,marks:[{type:`link`,attrs:{href:t}}]}).run():e.chain().focus().extendMarkRange(`link`).setLink({href:t}).run()},removeLink:()=>e.chain().focus().unsetLink().run(),isActive:t=>DL(e).includes(t),undo:()=>e.commands.undo(),redo:()=>e.commands.redo(),focus:()=>e.commands.focus(),blur:()=>e.commands.blur(),isFocused:()=>e.isFocused,native:e},s.current},[c],CL+9),t.block.pending&&!t.block.crossRenderUpdate)return;let l=t.slots[0];if(l===void 0){let e,n=xu(SL);e=n,l=wu(t,n,void 0,e,void 0)}l.a=Yu([`vx-richtext`,e.className],l.a,l.b);{let t=e.style;l.c!==t&&(Yd(l.b,t,l.c),l.c=t)}Ch(t,1,l.b,Mv,{editor:c},void 0,void 0,2,void 0,void 0,`c:e9be3bbb`)}),kL=[`bold`,`italic`,`underline`,`strikethrough`,`code`,`blockquote`,`bulletList`,`orderedList`,`taskList`,`codeBlock`,`horizontalRule`,`highlight`,`subscript`,`superscript`,`paragraph`,`heading1`,`heading2`,`heading3`,`heading4`,`heading5`,`heading6`,`alignLeft`,`alignCenter`,`alignRight`,`link`];function AL(e){let t=null,n=[],r={start:0,end:0,active:[]},i=(e,n={})=>{let i={event:e,html:t?.getHTML()??``,json:t?.getJSON?.()??null,focused:t?.isFocused()??!1,selection:r,...n};window.webkit.messageHandlers.editor.postMessage(JSON.stringify(i))},a=e=>{setTimeout(()=>{t&&(r={...r,active:kL.filter(e=>t.isActive(e))},i(e))},0)},o=r=>{r.method===`props`?(e({...r.args[0],...s}),t&&a(`snapshot`)):t?[`setHTML`,`setJSON`,`apply`,`linkTo`,`removeLink`,`undo`,`redo`,`focus`,`blur`].includes(r.method)&&(t[r.method]?.(...r.args),a(`snapshot`)):n.push(r)},s={ref(e){if(e&&e!==t){t=e,a(`ready`);for(let e of n.splice(0))o(e)}},onChange:()=>a(`change`),onSelectionChange(e){r=e,a(`selection`)},onFocus:()=>a(`focus`),onBlur:()=>a(`blur`)};window.__xplatEditorReceive=e=>{try{o(JSON.parse(e))}catch(e){i(`error`,{message:String(e)})}},window.addEventListener(`error`,e=>i(`error`,{message:e.message})),window.addEventListener(`unhandledrejection`,e=>i(`error`,{message:String(e.reason)})),i(`boot`)}var jL=bv(document.getElementById(`root`));AL(e=>jL.render(mh(()=>gh(`c:5a3f7d0e`,OL,{...e}))))})();</script></body></html>"
|
|
2
|
+
export default "<!doctype html><html><head><meta charset=\"utf-8\"><meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'none'; script-src 'nonce-xplat-editor'; style-src 'unsafe-inline'; img-src data:\"><style>html,body{margin:0;height:100%;font:14px system-ui} .ProseMirror,.vx-lexical-input{min-height:100px;padding:8px;outline:none} .ProseMirror:empty:before{content:attr(data-placeholder);opacity:.5} </style></head><body><div id=\"root\"></div><script nonce=\"xplat-editor\">(function(){var e=Reflect.apply,t=Symbol.for,n=null;try{let r=e(Function.prototype.toString,t,[]);typeof t==`function`&&typeof r==`string`&&/^function for\\(\\)\\s*\\{\\s*\\[native code\\]\\s*\\}$/.test(r)&&(n=t)}catch{}var r=[];function i(e){return r[e]??={prefix:``,tag:``,size:0,value:``,path:``,slots:null}}function a(t,r,a,o=!1){let s=t.length,c=a?`@octane:universal-hook:`:`@octane:hook:`,l=s<16;for(let u=0;u<=s;u++){let d=u===s,f=d?r:t[u];l&&=f===null||typeof f!=`object`&&typeof f!=`function`;let p,m,h,g;if(!a&&d&&r===void 0)p=``,m=0,h=``;else if(!a)p=typeof f==`number`?`n`:o&&typeof f==`string`?`t`:`s`,h=typeof f==`number`?String(f):o&&typeof f==`string`?f:f.description??``,m=h.length,(typeof h!=`string`||typeof m!=`number`)&&(g=p+m+`:`+h,l=!1);else{p=typeof f==`symbol`?`s`:`v`,m=typeof f==`symbol`?f.description?.length??0:String(f).length;let e=typeof m==`number`?void 0:`${p}${m}:`;h=typeof f==`symbol`?f.description??``:String(f),(e!==void 0||typeof h!=`string`)&&(g=`${e??`${p}${m}:`}${h}`,l=!1)}if(d){let t=Symbol,a=t.for;if(!l||a!==n){let r=c+(g??(p===``?``:p+m+`:`+h));return a===n?a(r):e(a,t,[r])}let o=i(s),u=o.slots??=new Map,d=u.get(r);if(d!==void 0&&d.prefix===c&&d.tag===p&&d.size===m&&d.value===h)return d.resolved;let f=a(c+(p===``?``:p+m+`:`+h));return d===void 0?u.size<32&&u.set(r,{prefix:c,tag:p,size:m,value:h,resolved:f}):(d.prefix=c,d.tag=p,d.size=m,d.value=h,d.resolved=f),f}if(!l){c+=g??p+m+`:`+h;continue}let _=i(u);(_.prefix!==c||_.tag!==p||_.size!==m||_.value!==h)&&(_.prefix=c,_.tag=p,_.size=m,_.value=h,_.path=c+p+m+`:`+h),c=_.path}throw Error(`Unreachable hook path`)}var o=new Set;for(let e of`animationIterationCount.aspectRatio.borderImageOutset.borderImageSlice.borderImageWidth.boxFlex.boxFlexGroup.boxOrdinalGroup.columnCount.columns.flex.flexGrow.flexPositive.flexShrink.flexNegative.flexOrder.gridArea.gridRow.gridRowEnd.gridRowSpan.gridRowStart.gridColumn.gridColumnEnd.gridColumnSpan.gridColumnStart.fontWeight.lineClamp.lineHeight.opacity.order.orphans.scale.tabSize.widows.zIndex.zoom.fillOpacity.floodOpacity.stopOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeOpacity.strokeWidth`.split(`.`)){let t=e.toLowerCase();o.add(t),o.add(`webkit`+t),o.add(`ms`+t),o.add(`moz`+t),o.add(`o`+t)}var s=new Map;function c(e){let t=s.get(e);if(t!==void 0)return t;let n=o.has(e.replaceAll(`-`,``).toLowerCase());return s.set(e,n),n}function l(e,t){return typeof t==`number`&&t!==0&&e.charCodeAt(0)!==45&&!c(e)?t+`px`:typeof t==`string`?t.trim():``+t}function u(e){if(e===`cssFloat`)return`float`;if(e.charCodeAt(0)===45)return e;let t=!1;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=65&&r<=90){t=!0;break}}if(!t)return e;let n=``;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);n+=r>=65&&r<=90?`-`+String.fromCharCode(r+32):e[t]}return n.charCodeAt(0)===109&&n.charCodeAt(1)===115&&n.charCodeAt(2)===45&&(n=`-`+n),n}function d(e){if(typeof e==`string`)return e;if(typeof e!=`object`)return typeof e==`number`&&e?``+e:``;if(e===null)return``;let t=``;if(Array.isArray(e))for(let n=0;n<e.length;n++){let r=e[n];if(r){let e=d(r);e&&(t=t?t+` `+e:e)}}else for(let n in e)e[n]&&(t=t?t+` `+n:n);return t}var f=/^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*\\:/i,p=`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`,m=new Set([`annotation-xml`,`color-profile`,`font-face`,`font-face-src`,`font-face-uri`,`font-face-format`,`font-face-name`,`missing-glyph`]);function h(e){let t=e.charCodeAt(0);return t>32&&t<127&&t!==74&&t!==106?e:f.test(e)?p:e}function g(e,t){return e=e===void 0?void 0:e.toLowerCase(),e!==void 0&&e.includes(`-`)&&!m.has(e)?!1:(t=t.toLowerCase(),t===`src`||t===`href`||t===`action`||t===`formaction`||t===`xlink:href`||t===`xlinkhref`||t===`data`&&e===`object`)}function _(e,t,n){return g(e,t)?h(n):n}var v=`data-octane-input`,y=`data-octane-signal-control`,b=`[b;`,x=`;b;`,S=`[f0`+x,C=`[f1`+x,w=S.length,ee=b.length,te=`;root`;function ne(e){let t=e.startsWith(S)||e.startsWith(C);if(!t&&!e.startsWith(b))return!1;let n=t?w:ee,r=e.indexOf(`;`,n);if(r<=n||r===e.length-1)return!1;if(t)return e.indexOf(`;`,r+1)===-1;if(e.length-r===5&&e.endsWith(te))return!0;let i=e.indexOf(`;`,r+1);if(i<=r+1||i===e.length-1)return!1;let a=i+1;if(e.length===a+1){let t=e.charCodeAt(a);return t===116||t===118||t===115||t===111||t>=48&&t<=57}if(e.charCodeAt(a)===107&&e.charCodeAt(a+1)===59)return(e.charCodeAt(a+2)===115||e.charCodeAt(a+2)===110)&&e.charCodeAt(a+3)===58&&e.length>a+4;if(e.length===a+2&&e.endsWith(`-1`))return!0;if(e.charCodeAt(a)<49||e.charCodeAt(a)>57)return!1;for(let t=a+1;t<e.length;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}return!0}var T=`data-oct-b`,re=`https://octanejs.dev/errors/`,ie=/[\\uD800-\\uDFFF]/gu;function ae(e){return encodeURIComponent(String(e).replace(ie,`�`))}function oe(e,t){let n=re+e;for(let e=0;e<t.length;e++)n+=`${e===0?`?`:`&`}args[]=${ae(t[e])}`;return`Minified Octane error #${e}; visit ${n} for the full message or use a development build for full errors and additional helpful warnings.`}function E(e,...t){return oe(e,t)}function se(e){return`Minified Octane error #`+e+`; visit https://octanejs.dev/errors/`+e+` for the full message or use a development build for full errors and additional helpful warnings.`}var ce,le=null,ue,de;function fe(){return ce===void 0?le??ue?.()??null:ce.current()??le}function pe(){return ce?.current()??le}function me(e){if(typeof e!=`function`)throw TypeError(se(190));let t=ue;return ue=e,()=>{ue===e&&(ue=t)}}function he(e,t){if(typeof t!=`function`)throw TypeError(se(191));if(ce)return ce.run(e,t);let n=le;le=e;try{return t()}finally{le=n}}function ge(e){de?.(e)}var _e=Symbol(`octane.transitionConsumer`),ve;function ye(e){let t=ve;return ve=e,t}var be=class extends Error{scopeKey;nodeKey;read;constructor(e,t,n=`value`){super(E(194,n,e,t)),this.name=`NativeAdoptionMiss`,this.scopeKey=e,this.nodeKey=t,this.read=n}},xe=null;function Se(){let e=xe;return e?.startBatch(),e}function Ce(e){e?.endBatch()}function we(e){let t=Se();try{return e()}finally{Ce(t)}}var Te=new WeakMap;function Ee(e){e.owner=void 0}function De(e,t,n){let r=Te.get(e),i=r?.get(t)??0,a=n?2:1;return(i&a)!==0&&((i&~a)===0?r.delete(t):r.set(t,i&~a),!0)}function Oe(e){Te.delete(e)}var ke=globalThis[Symbol.for(`octane.contextEpoch`)]??={value:0};function Ae(){return ke.value}function je(){ke.value++}var Me=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),Ne=new Set([`allowfullscreen`,`async`,`autoplay`,`controls`,`credentialless`,`default`,`defer`,`disabled`,`disablepictureinpicture`,`disableremoteplayback`,`formnovalidate`,`hidden`,`inert`,`itemscope`,`loop`,`nomodule`,`novalidate`,`open`,`playsinline`,`readonly`,`required`,`reversed`,`scoped`,`seamless`]),Pe=new Set([`size`,`cols`,`rows`,`span`]),Fe=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),Ie=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`],[`xlinkActuate`,`xlink:actuate`],[`xlinkArcrole`,`xlink:arcrole`],[`xlinkHref`,`xlink:href`],[`xlinkRole`,`xlink:role`],[`xlinkShow`,`xlink:show`],[`xlinkTitle`,`xlink:title`],[`xlinkType`,`xlink:type`],[`xmlBase`,`xml:base`],[`xmlLang`,`xml:lang`],[`xmlSpace`,`xml:space`],[`tabIndex`,`tabindex`]]);function Le(e){switch(e.length){case 10:return e.toLowerCase()===`spellcheck`;case 9:return e.toLowerCase()===`draggable`;case 15:return e.toLowerCase()===`contenteditable`}return!1}var Re=Symbol.for(`octane.external-hydration-promise`),ze=Symbol.for(`octane.hydration-range-boundary`),Be=Me,Ve=Ne,He=Pe,Ue=/^[^\\s\"'>\\/=\\u0000-\\u001F]+$/,We=Fe,Ge=Ie,Ke=Le,qe=l,Je=`Abort AnimationEnd AnimationIteration AnimationStart AuxClick BeforeInput BeforeToggle Blur Cancel CanPlay CanPlayThrough Change Click Close CompositionEnd CompositionStart CompositionUpdate ContextMenu Copy Cut DoubleClick Drag DragEnd DragEnter DragExit DragLeave DragOver DragStart Drop DurationChange Emptied Encrypted Ended Error Focus GotPointerCapture Input Invalid KeyDown KeyPress KeyUp Load LoadedData LoadedMetadata LoadStart LostPointerCapture MouseDown MouseEnter MouseLeave MouseMove MouseOut MouseOver MouseUp Paste Pause Play Playing PointerCancel PointerDown PointerEnter PointerLeave PointerMove PointerOut PointerOver PointerUp Progress RateChange Reset Resize Scroll ScrollEnd Seeked Seeking Select Stalled Submit Suspend TimeUpdate Toggle TouchCancel TouchEnd TouchMove TouchStart TransitionCancel TransitionEnd TransitionRun TransitionStart VolumeChange Waiting Wheel`,Ye;function Xe(e){if(Ye===void 0){Ye=new Set;for(let e of Je.split(` `))Ye.add(`on`+e),Ye.add(`on`+e+`Capture`)}return Ye.has(e)}var Ze=Object.prototype.hasOwnProperty;function Qe(e,t){let n=e?.defaultProps;if(n!=null)for(let e in n)t[e]===void 0&&(t[e]=n[e])}function $e(e){if(typeof e!=`object`||!e)return null;let t=typeof Symbol==`function`&&e[Symbol.iterator]||e[`@@iterator`];return typeof t==`function`?t:null}var et=`__octaneEarlyHydrationIntents`,tt=new WeakMap,nt=new WeakMap,rt=new WeakMap,it=new WeakMap,at=new WeakSet;function ot(e){return typeof e==`object`&&!!e&&`documentOwner`in e}function st(e){return ot(e)?e.instanceOwner:e}function ct(e,t,n){return JSON.stringify([e,t,n])}function lt(e,t){tt.set(st(e),t),ot(e)&&tt.set(e.documentOwner,t)}function ut(e){let t=e.getAttribute(y);if(t===null)return null;try{let e=JSON.parse(t);if(!Array.isArray(e)||e.length!==3||e[0]!==1||typeof e[1]!=`string`||!Array.isArray(e[2]))return null;let n=[];for(let t of e[2]){if(!Array.isArray(t)||t.length!==3||typeof t[0]!=`string`||typeof t[1]!=`string`||t[2]!==`value`&&t[2]!==`checked`)return null;n.push(t)}return{ownerKey:e[1],bindings:n}}catch{return null}}function dt(e,t){return t===`checked`?e.checked:e.localName===`select`&&e.multiple?Array.from(e.selectedOptions,e=>e.value):e.value}function ft(e,t){let n=ut(e);if(n!==null){let r=nt.get(e.ownerDocument);r===void 0&&nt.set(e.ownerDocument,r=new Map);for(let[i,a,o]of n.bindings){let s=ct(n.ownerKey,i,a),c=r.get(s);(at.has(e.ownerDocument)||c===void 0||t>=c.revision)&&r.set(s,{revision:t,value:dt(e,o)})}}let r=rt.get(e);if(r!==void 0)for(let[t,n]of r)n(dt(e,t))}function pt(e,t,n){let r=rt.get(e);return r===void 0&&rt.set(e,r=new Map),r.set(t,n),()=>{r.get(t)===n&&(r.delete(t),r.size===0&&rt.delete(e))}}function mt(e){return it.get(e)??0}function ht(e){it.delete(e)}function gt(e){at.add(e)}function _t(e,t){at.has(e.ownerDocument)||(it.set(e,t),ft(e,t))}if(typeof globalThis<`u`){let e=globalThis;e.__octanePublishSignalControl=_t;let t=e.__octaneEarlySignalControls;if(t!==void 0){t.p=_t;let e=t.q.splice(0);for(let[t,n]of e)_t(t,n)}}var vt=new WeakSet;function yt([e,t,n,r,i,a,,,o],s){return!o&&e.target===t&&t.isConnected&&n.isConnected&&t.ownerDocument===s&&n.ownerDocument===s&&t.closest(`[data-octane-hydrate-independent]`)===n&&n.getAttribute(`data-octane-hydrate-id`)===r&&n.getAttribute(`data-octane-hydrate-when`)===i&&n.getAttribute(`data-octane-hydrate-interaction-events`)===a}function bt(e){return e!==null&&e.nodeType===1}var xt=new WeakMap;function St(e){if(!bt(e))return null;let t=e.localName;return t===`input`||t===`textarea`||t===`select`||e.isContentEditable?e:null}function Ct(e){let t=xt.get(e);if(t===void 0){let n=mt(e);t={editRevision:n,selectionRevision:0,revision:n,composing:!1},xt.set(e,t)}return t}function wt(e){let t=St(e.target);if(t===null)return;let n=Ct(t);switch(e.type){case`input`:n.editRevision++,n.revision++,ft(t,n.revision);break;case`compositionstart`:n.composing=!0,n.revision++;break;case`compositionupdate`:n.revision++;break;case`compositionend`:n.composing=!1,n.revision++;break;case`focusin`:case`focusout`:n.revision++}}function Tt(e){let t=e.currentTarget,n=St(t.activeElement);if(n===null)return;let r=Ct(n);r.selectionRevision++,r.revision++}function Et(e){if(St(e)===null)return null;let t=xt.get(e),n=t===void 0?mt(e):0,r=e,i,a,o,s=null,c=null,l=null;if(e.localName===`select`){let e=r;i=e.value,e.multiple&&(o=Array.from(e.selectedOptions,e=>e.value))}else if(e.isContentEditable)i=e.textContent??``;else{i=r.value,e.localName===`input`&&(a=r.checked);try{s=r.selectionStart,c=r.selectionEnd,l=r.selectionDirection}catch{}}return{editRevision:t?.editRevision??n,selectionRevision:t?.selectionRevision??0,revision:t?.revision??n,value:i,...a===void 0?{}:{checked:a},...o===void 0?{}:{selectedValues:o},selectionStart:s,selectionEnd:c,selectionDirection:l,focused:e.ownerDocument.activeElement===e,composing:t?.composing??!1}}function Dt(e,t){if(e.localName!==`textarea`||typeof t!=`string`||xt.get(e)?.composing===!0)return!1;let n=e,r=n.defaultValue.replace(/\\r\\n?/g,`\n`);return t.replace(/\\r\\n?/g,`\n`)===r&&n.value!==r}function Ot(e,t){kt(e.ownerDocument);let n=Ct(e);return n.revision===t&&(n.editRevision=0,n.selectionRevision=0,ht(e),!0)}function kt(e){let t=e??(typeof document>`u`?void 0:document);if(t===void 0||vt.has(t))return;vt.add(t);let n=t[et],r=typeof n?.stop==`function`?t.defaultView??t:t,i=r===t?wt:e=>{e.target?.ownerDocument===t&&wt(e)};for(let e of[`input`,`compositionstart`,`compositionupdate`,`compositionend`,`focusin`,`focusout`])r.addEventListener(e,i,!0);t.addEventListener(`selectionchange`,Tt,!0),gt(t);for(let e of n?.q??[]){let[n]=e,r=St(n.target);r!==null&&yt(e,t)&&(n.type===`input`&&mt(r)>0||wt(n))}}var At=Symbol.for(`octane.flags.component`);function jt(e,t){return typeof e==`function`&&Ze.call(e,At)&&(e[At]&t)===t}var Mt=Symbol.for(`octane.element`),Nt=Symbol.for(`octane.portal`),Pt=Symbol.for(`octane.Fragment`),Ft=Symbol.for(`octane.context`),It=Symbol.for(`octane.childrenBlock`);function Lt(e,t,n,r,i){let a=t===r;if(!a&&r!==null&&t.nodeType===1){let e=r;do{if(t.contains(e)){a=!0;break}e=e.getRootNode().host}while(e!==void 0)}if(!a){e.insertBefore(t,n);return}let o=e.moveBefore;if(!i&&typeof o==`function`){o.call(e,t,n);return}if(t.parentNode!==e||n!==null&&n.parentNode!==e){e.insertBefore(t,n);return}if(t!==n&&t.nextSibling!==n){if(n===null||(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0){let r=t.nextSibling;for(;r!==n;){let n=r.nextSibling;e.insertBefore(r,t),r=n}}else{let r=t.nextSibling,i=n;for(;i!==t;){let t=i.nextSibling;e.insertBefore(i,r),i=t}}}}var Rt=new WeakSet;function zt(e){return Rt.has(e)}var Bt=[];function Vt(e){return Bt.push(e),()=>{let t=Bt.indexOf(e);t!==-1&&Bt.splice(t,1)}}var Ht,Ut;function Wt(e){let t=Gt,n=ye(null);Gt=void 0;try{return e()}finally{Gt=t,ye(n)}}var Gt;function Kt(e){let t=Gt;return Gt=e,t}var qt=null;function Jt(e){let t=qt?.get(e);if(t!==void 0)return t.depth++,t;let n=Se();if(n===null)return null;let r={hooks:n,depth:1,closed:!1};return(qt??=new WeakMap).set(e,r),r}function Yt(e,t){if(t.closed)return;t.closed=!0,qt?.get(e)===t&&qt.delete(e);let n=t.hooks;t.hooks=null,Ce(n)}function Xt(e,t,n,r){if(t===null||t.closed||--t.depth!==0)return;if(!n){Yt(e,t);return}let i=()=>{if(!(t.depth!==0||t.closed))try{Yt(e,t)}catch(e){r(e)}},a=e.target;e.type===`change`&&a?.localName===`input`&&(a.type===`checkbox`||a.type===`radio`)?setTimeout(i,0):queueMicrotask(i)}function Zt(e){return`Minified Octane error #`+e+`; visit https://octanejs.dev/errors/`+e+` for the full message or use a development build for full errors and additional helpful warnings.`}var Qt=new WeakMap,$t=!1,en=!1,tn;function nn(e){let t=e.nodeType===9?e:e.ownerDocument;if(t===null)throw TypeError(Zt(123));let n=Qt.get(t);return n===void 0&&(n=Object.freeze({scopeKey:`octane:document`}),Qt.set(t,n)),lt(n,t),n}function rn(e=1){if(e!==1)throw TypeError(Zt(74));en=!0,!$t&&($t=!0,typeof document<`u`&&me(()=>nn(document)))}var an=Symbol.for(`octane.signal-handle`),on=Symbol.for(`octane.signal-binding-read`),sn=Symbol.for(`octane.signal-binding-subscribe`);function cn(e,t){let n=d(e),r=d(t);return n?r?n+` `+r:n:r}var ln=new Map;function un(e){let t=ln.get(e);if(t!==void 0)return t;let n=u(e);return ln.set(e,n),n}function dn(e){return e.hooks??=new Map}function fn(e,t){(e.cleanups??=[]).push(t)}var D=null,pn=null,mn=null,hn=!1,gn=new WeakMap,_n,vn=new WeakMap;function yn(e){let t=e;for(;t!==null;){let e=t.__trySlot;if(e!==void 0&&!e.propagateSuspense)return e;t=t.parentBlock}}function bn(e){fr++;let t=D?.pauseLifecycle()??-1;try{ge(e)}finally{t>=0&&D.resumeLifecycle(t),fr--}}function xn(e,t){let n=e.children;if(n!==null)for(let e of n){if(e.scope===t)return[`scope`,e.key];let n=xn(e.scope,t);if(n!==null)return[`scope`,e.key,...n]}let r=t.block;for(let t=0;t<e.slots.length;t++){let n=e.slots[t];if(typeof n==`object`&&n){if(r.forSlot!==null&&(n===r.forSlot||n.forSlot===r.forSlot))return[`slot`,t,`item`,r.key];if(n.block===r||n.tryBlock===r||n.emptyBlock===r)return[`slot`,t,n.__kind,n.tryBlock===r?`primary`:n.branch,n.emptyBlock===r?`empty`:n.currentIsBodyFn?void 0:n.currentComp,n.prevKey]}}return null}function Sn(e,t){if(e===t)return[];let n=vn.get(e),r=n?.parent??e.parent??e.block.parentBlock;for(;r instanceof pc;)r=r.parentBlock;if(r===null)return null;let i=n===void 0?xn(r,e):[`slot`,n.slot,n.kind,n.branch,n.component,n.key];if(i===null)return null;let a=Sn(r,t);return a===null?null:a.concat(i)}function Cn(e,t,n){let r=e.paths;for(let e of t){let t=r.children?.get(e);if(t===void 0){if(!n)return;t={},(r.children??=new Map).set(e,t)}r=t}return r}function wn(e,t,n,r=!1){let i=gn.get(e);if(i){let r=Sn(e,t);if(r!==null){let e=n.retrySignalOwners??={paths:{},owners:new Set},t=Cn(e,r,!0),a=t.owner;t.owner=i,e.owners.add(i),a!==void 0&&a!==i&&(e.owners.delete(a),bn(a))}}if(r)k_(e,e=>wn(e,t,n,!0));else if(e.children!==null)for(let r of e.children)wn(r.scope,t,n)}function Tn(e){let t=e.retrySignalOwners;if(t!==void 0){e.retrySignalOwners=void 0;for(let e of t.owners)bn(e)}}function En(e,t){let n=_n;if(Vl(t)){let t=e.idState.renderOwner,n=yn(e),r=n?.tryBlock??t?.current,i=n??t;i!==void 0&&r!=null&&(wn(e,r,i,!0),_n=i.retrySignalOwners)}try{L(e,H()===null&&!M?.hydrating&&!M?.retainedCreated?.has(e))}finally{_n=n}}function Dn(e,t,n){for(;e instanceof pc;)e=e.parentBlock;for(let r=0;r<e.slots.length;r++){let i=e.slots[r];if(i===t||i?.forSlot===t){let t=Sn(e,n);return t===null?null:t.concat(`slot`,r,`item`)}}if(e.children!==null)for(let r of e.children){let e=Dn(r.scope,t,n);if(e!==null)return e}return null}function On(e,t,n){if(e.owner!==void 0&&(t.owners.delete(e.owner),n.push(e.owner),e.owner=void 0),e.children!==void 0)for(let r of e.children.values())On(r,t,n)}function kn(e,t,n,r){let i=yn(e),a=e.idState.renderOwner,o=i?.retrySignalOwners??a?.retrySignalOwners,s=i?.retrySignalOwners===void 0?a?.current:i.tryBlock;if(o===void 0||s==null)return;let c=Dn(e,t,s),l=c===null?void 0:Cn(o,c,!1);if(l?.children===void 0)return;let u=e=>{let t=new Set(e),n=[];for(let[e,r]of l.children)t.has(e)||(l.children.delete(e),On(r,o,n));for(let e of n)bn(e)};if(typeof r!=`function`){u(r);return}if(n===0){u([]);return}let d=new Map,f=!1;return(e,t)=>{f||(d.set(e,t),d.size===n&&(f=!0,u(d.values())))}}function An(e=1,t=!1){if(e!==1)throw TypeError(E(74));hn=!0,t||rn(e)}function jn(e,t){if(e===null)return`null`;let n=typeof e;return n===`string`||n===`number`||n===`bigint`||n===`boolean`?n.charCodeAt(0).toString(36)+`:`+String(e):n===`undefined`?`u:`:{value:e,position:t}}function Mn(e,t,n,r,i,a){if(typeof e==`string`)return e;let o=t+JSON.stringify([n??`legacy`,r,i]),s=a.signalState??={prefix:a.prefix,next:0},c=s.opaqueKeys??=new Map,l=c.get(o);l===void 0&&(l={objects:new WeakMap,symbols:new Map,used:new Set,next:0},c.set(o,l));let u=e.value,d=typeof u==`symbol`?l.symbols.get(u):l.objects.get(u);if(d===void 0){if(d=e.position,d===void 0||l.used.has(d)){for(;l.used.has(l.next);)l.next++;d=l.next++}l.used.add(d),typeof u==`symbol`?l.symbols.set(u,d):l.objects.set(u,d)}return`o:`+d.toString(36)}function Nn(e){return JSON.stringify([e.signalState?.prefix??e.prefix,`root`])}function Pn(e){let t=e.signalInstanceResolved;if(t!==void 0)return t;let n=e.signalInstanceParent;if(n===null)return;let r=In(n,e.signalInstanceSite,e.signalInstanceValue,e.signalInstanceHasKey);return e.signalInstanceResolved=r,r}function Fn(e,t){if(typeof t==`string`){e.signalInstanceResolved=t;return}e.signalInstanceParent=t.parentScope,e.signalInstanceSite=t.invocationSite,e.signalInstanceValue=t.key,e.signalInstanceHasKey=t.hasKey,e.signalInstanceResolved=void 0}function In(e,t,n,r){let i=Pn(e),a=[],o=new Set,s=e;for(;i===void 0&&s!==null;){let e=s.block;o.has(e)||(o.add(e),e.forSlot!==null&&a.push(jn(e.key,e.itemIndex)),i=Pn(e)),s=s.parent,i===void 0&&s!==null&&(i=Pn(s))}let c=e.block;for(;i===void 0&&c!==null;)o.has(c)||(o.add(c),c.forSlot!==null&&a.push(jn(c.key,c.itemIndex))),i=Pn(c),c=c.parentBlock;i??=Nn(e.block.idState),a.reverse();let l=e.block.idState,u=a;for(let e of a)if(typeof e!=`string`){u=[];for(let e of a)u.push(Mn(e,i,t,u,!1,l));break}return i+JSON.stringify([t??`legacy`,u,r?Mn(jn(n),i,t,u,!0,l):``])}function Ln(e){if(e===null)return;let t=e.block.idState.renderOwner,n=t?.signalOwner;if(n===void 0&&en&&(n=nn(e.block.parentNode),t!==void 0&&(t.signalOwner=n)),n===void 0)return;let r=gn.get(e);if((r===void 0||r===!1)&&e.block.forSlot===null&&e.signalInstanceParent===null&&e.signalInstanceResolved===void 0){let t=e.parent??e.block.parentBlock;for(;t!==null&&!(t instanceof pc||t.signalInstanceParent!==null||t.signalInstanceResolved!==void 0);){if(t.block.forSlot?.signalSite!==void 0)return gn.set(e,!1),Ln(t);t=t.parent??t.block.parentBlock}}let i=r===null;if(!r||r.documentOwner!==n){let a=e.block.idState;r=void 0;let o=yn(e.block),s=o?.retrySignalOwners??t?.retrySignalOwners,c=o?.retrySignalOwners===void 0?t?.current:o.tryBlock;if(s!==void 0&&!i&&!e.block.disposed&&c!=null){let t=Sn(e,c),n=t===null?void 0:Cn(s,t,!1);n?.owner!==void 0&&(r=n.owner,n.owner=void 0,s.owners.delete(r))}if(r===void 0||r.documentOwner!==n){let t={scopeKey:n.scopeKey,documentOwner:n,instanceOwner:e,instanceKey:Pn(e)??(e.block.forSlot?.signalSite===void 0?Nn(a):In(e,e.block.forSlot.signalSite,void 0,!1))};t.instanceOwner=t,r=Object.freeze(t)}gn.set(e,r),i&&bn(r)}return lt(r,e.block.parentNode.ownerDocument),r}function Rn(e,t){let n=Ln(e);return n!==void 0&&tn?.(n),n===void 0||fe()===n?t():he(n,t)}function zn(e){let t=k;return t===null?-1:D.beginScope(e,t)}function Bn(e){let t=Cl===0?null:wl(e);if(t!==null){rc(e,t.block),t.activationRequested&&(t.serverActivationStarted=!1,Do(t.parentBlock));return}rc(e,e);let n=Po?.holdsNativeRead(e)===!0;n&&yr++;try{Do(e)}finally{n&&yr--}}function Vn(e,t,n=!1){let r=D;if(r===null)return!1;if(F?.stageAction(()=>Vn(e,t,n))===!0)return!0;let i=r.acceptCapture(e);if(t===void 0)return!1;let a=n&&r.replayDeferredRefs(e,t);return(i||a||r.hasPublication(t))&&r.stampPublication(t,[e.effects[no],e.effects[ro],e.effects[io],e.events,e.refs]),!1}function Hn(){let e=mn;if(e!==null){mn=null;for(let t of e)t.release()}}var Un=0;function Wn(e){let t=Un;return Un+=e,t}function Gn(e,t){let n=e.locs;if(n===void 0)return``;let r=n[t];return r===void 0?``:`${e.locFile??`<unknown>`}:${r[0]}:${r[1]}`}function Kn(e){return e!==null&&e.__oct_suppress===!0}var qn=0,Jn=1,Yn=2,Xn=0,O=null,k=null,Zn=0,Qn=0,$n=1,er=[],tr=1,nr=0,rr=new WeakMap,ir=0,ar=new WeakMap,or=0,sr=-1,cr=0,lr=null,ur=0,dr=0,fr=0;function pr(e,t=null){fr++;let n=D?.pauseLifecycle()??-1;try{en||t?.block.idState.renderOwner?.signalOwner!==void 0?Rn(t,e):e()}finally{n>=0&&D.resumeLifecycle(n),fr--}}function mr(e,t=-1,n=null){let r=sr;sr=t,or++;try{pr(e,n)}finally{or--,sr=r}}var A=[],hr=0,gr=!1,_r=!1,vr=!1,yr=0,br=0,xr=null;function Sr(){xr??={render:Oh,commit:Nh,dispose:Ph,splice:Ah,begin:fi,end:pi,beginUrgent:ac,endUrgent:oc,holdRoot:xi,retryRoot:Si,commitRoot:Ci,discardRoot:wi,keepsRoot:bi,cancelEqual:ai,hasHeld:ii,heldUpdate:ri,rebaseHeld:oi}}var Cr=null,wr=null;function Tr(e){Cr.queue(e)}function Er(e){Cr.prepare(e)}function Dr(e){Cr?.retire(e)}function Or(){!gr&&!_r&&(gr=!0,queueMicrotask(Io))}var kr=null,Ar=null,jr=!1;function Mr(e){let t=e.native;return t!==void 0&&!t.validate()&&(t.hasWrites()?t.rebase():(t.discard(),t=void 0)),t??=e.native=Ht?.(),t!==void 0&&Cr===null&&(Cr=Ut({get attempt(){return wr},set attempt(e){wr=e},get visibility(){return Po},get rollback(){return Wi},get fallbackTimeout(){return t_},schedule:Or,beginRoot:qi,endRoot:Ji,beginAttempt:fi,endAttempt:pi,invalidate:rc,render:I,journal:Ma,journalProperty:N,isSuspense:Vl,releaseHookHolder:Yr,rebaseUpdate:Ir,flushBatch:zr,currentPresentations:Nu,validateCapture:e=>D===null||D.validateCapture(e),acceptCapture:Vn,commitRoots:ua,rollbackRoot:ca,applyMemoSwap:gi,handleError:b_,reportError:__,unsupportedError:()=>TypeError(E(79))})),t}function Nr(){jr||=!0}function Pr(){return{updates:new Map,pendingActions:0,closed:!1,flushed:!1,hook:null,hooks:null,hooksPending:!1}}function Fr(){return kr===null?_r||fp>0?null:Ar:kr}function Ir(e){if(e.state!==void 0||e.reducer!==void 0||Object.is(e.baseValue,e.slot.value))return e.value;let t=e.slot.value;for(let n of e.operations)t=n(t);return e.baseValue=e.slot.value,e.value=t,e.slot.pendingActionBatch!==void 0&&(e.slot.pendingActionValue=t),t}function Lr(e,t){let n=Fr();if(n===null)return e.value;let r=n.updates.get(e);if(r!==void 0)return Ir(r);if(e.renderTransition!==void 0)return e.renderTransition.value;let i=t===void 0?void 0:xr?.heldUpdate(e,t);return i===void 0?e.value:i.value}function Rr(e,t,n,r,i=!1){let a=Fr();if(a===null)return null;let o=typeof n==`function`?n:()=>n,s=a.updates.get(e);return s===void 0?(s={batch:a,slot:e,block:t,operations:[o],baseValue:e.value,value:r,forceRender:i},a.updates.set(e,s)):(s.operations.push(o),s.value=r,s.forceRender||=i),e.pendingActionBatch=a,e.pendingActionValue=r,s}function zr(e){if(!e.flushed){if(e.native!==void 0){if(e.native.hasWrites()){Jr(e,e),Tr(e),Ar===e&&(Ar=null);return}e.native.discard(),e.native=void 0}e.flushed=!0;for(let t of e.updates.values()){let{slot:n,block:r,forceRender:i}=t,a=t.state===void 0&&t.reducer===void 0?Ir(t):t.value;if(n.pendingActionBatch===e&&(n.pendingActionBatch=void 0,n.pendingActionValue=void 0),r.disposed)continue;let o=t.state,s=t.reducer,c=o?.renderTransition??s?.renderTransition;(o!==void 0||s!==void 0)&&(t.baseValue=c===void 0?n.value:c.baseValue,o===void 0?s!==void 0&&(s.renderPhaseActions=void 0):o.updates=void 0);let l=!Object.is(n.value,a);(l||i||t.previous!==void 0)&&(l&&(n.value=a),t.reducer!==void 0&&(t.reducer.renderTransition=t),t.state!==void 0&&(t.state.renderTransition=t),Do(r))}if(e.updates.size>0){let t=[];for(let n of e.updates.values())n.block.disposed||t.push(n);t.length>0&&Qr.push(t)}e.updates.clear(),Ar===e&&(Ar=null)}}function Br(e){e.closed&&e.pendingActions===0&&zr(e)}var Vr=!1,Hr=0,Ur=new Set,Wr=null;function Gr(e,t){if(e.hook===null)e.hook=t;else if(e.hook!==t){let n=e.hooks;if(n===null)e.hooks=[t];else if(n.includes(t))return;else n.push(t)}else return;e.hooksPending&&(t.pendingBatches++,t.publish(!0))}function Kr(e){let t=e.hook;if(t===null||e.hooksPending)return;e.hooksPending=!0,t.pendingBatches++,t.publish(!0);let n=e.hooks;if(n!==null)for(let e=0;e<n.length;e++)n[e].pendingBatches++,n[e].publish(!0)}function qr(e){if(!e.workComplete||e.pendingActions!==0||(e.pendingHolds??0)!==0||!e.hooksPending)return;e.hooksPending=!1;let t=e.hook;--t.pendingBatches===0&&t.publish(!1);let n=e.hooks;if(n!==null)for(let e=0;e<n.length;e++)--n[e].pendingBatches===0&&n[e].publish(!1)}function Jr(e,t){if(t.hook===null)return;let n=Wr??=new WeakMap,r=n.get(e);r===void 0&&n.set(e,r=new Set),!r.has(t)&&(r.add(t),t.pendingHolds=(t.pendingHolds??0)+1,Kr(t))}function Yr(e){let t=Wr?.get(e);if(t!==void 0){Wr.delete(e);for(let e of t)e.pendingHolds--,qr(e)}}var Xr=0,Zr=null,Qr=[],$r=null;function ei(e){return yr===0&&(k!==e||e.currentRenderMode!==`transition`)&&(_r||fp>0||br===0)}function ti(e){for(;e.next?.batch?.flushed===!0&&!e.next.superseded;)e=e.next;return e}function ni(e,t){if(ei(t))return ri(e,t)}function ri(e,t){if(t.disposed)return;let n=t.idState.renderOwner?.transition;if($r===null&&n===void 0&&Qr.length===0)return;let r=[$r?.entries,n?.entries];for(let t of r)if(t!==void 0)for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.slot===e&&!r.superseded&&Object.is(e.value,r.baseValue))return ti(r)}for(let t=Qr.length-1;t>=0;t--){let n=Qr[t];for(let t=n.length-1;t>=0;t--){let r=n[t];if(r.slot===e&&!r.superseded&&Object.is(e.value,r.baseValue)&&(r.state===void 0&&r.reducer===void 0||e.renderTransition!==void 0))return ti(r)}}}function ii(e,t){return ni(e,t)!==void 0}function ai(e,t){if(!ei(t))return!1;let n=t.idState.renderOwner?.transition;if($r===null&&n===void 0&&Qr.length===0)return!1;let r=!1,i=t=>{if(t!==void 0)for(let n of t)n.slot===e&&!n.superseded&&(n.superseded=!0,r=!0)};i($r?.entries),i(n?.entries);for(let e of Qr)i(e);return r}function oi(e,t,n,r){let i=ni(e,t);if(i===void 0||e.pendingActionBatch?.flushed===!1)return;let a=i.value;for(let e of n)a=r?r(a,e):typeof e==`function`?e(a):e;if(Object.is(a,i.baseValue)){ai(e,t);return}let o=!Object.is(a,i.value);for(let e=i;e;e=e.previous)e.value=a;for(let e of n)i.operations.push(r?t=>r(t,e):typeof e==`function`?e:()=>e);o&&si(i,t)}function si(e,t){let n=$r;if(n!==null&&n.entries.includes(e)){if(n.replayScheduled)return;n.replayScheduled=!0,queueMicrotask(()=>{$r===n&&(n.replayScheduled=!1,vi())});return}let r=t.idState.renderOwner,i=r?.transition;i!==void 0&&i.entries.includes(e)&&!i.replayScheduled&&(i.replayScheduled=!0,queueMicrotask(()=>{r.transition===i&&(i.replayScheduled=!1,Si(r))}))}var ci=null,li=null;function ui(e){let t=[];for(let n=Qr.length-1;n>=0;n--){let r=Qr[n],i=!0;for(let t=0;t<r.length;t++)if(r[t].block!==e){i=!1;break}if(i){for(let e=0;e<r.length;e++)t.push(r[e]);Qr.splice(n,1)}}return t}function di(e,t){if(t!==null)for(let e=0;e<t.length;e++)t[e].taken=!1;let n=e=>{let r=e.block.__warmCache;if(r!==void 0)for(let[e,n]of r)for(let r=0;r<n.length;r++){let i=n[r];if(i.available){let n={slot:e,deps:i.deps,value:i.value,taken:!1};i.nativeWitness!==void 0&&(n.nativeWitness=i.nativeWitness),(t??=[]).push(n)}}k_(e,n)};return n(e),t}function fi(e){let t=e.idState.renderOwner;if(t?.transition!==void 0&&!t.transition.promoted&&!yi(t.transition)&&wi(t),e.pendingMode!==`transition`||Zr!==null)return null;j??=[],Fi??=new Map,Li.push(Ii),Bi.push(Ri),Ii=j.length,Ri=++zi,Vi++;let n=P,r=n?.effects??ao,i={origin:e,capture:n,journalCheckpoint:j.length,effects:[r[0].length,r[1].length,r[2].length],effectEvents:(n?.events??oo).length,effectEventActions:(n?.eventActions??so).length,stores:(n?.stores??uo).length,refAttach:(n?.refs??fo).length,refDetach:n===null?ns.length:n.detaches?.length??0,effectDeps:M===null?l_(e):null,heldSlots:null,memoSwaps:null};return Zr=i,i}function pi(e){if(e===null)return;Zr=null;let t=e.heldSlots;(t===null||t.size===0)&&(ci=null,li=null);let n=null;if(t!==null&&t.size>0&&(n=ui(e.origin)),t!==null&&t.size>0&&n!==null&&n.length>0){$a(e.journalCheckpoint,e.origin);let r=e.capture,i=r?.effects??ao;for(let t=0;t<3;t++)i[t].length=e.effects[t];(r?.events??oo).length=e.effectEvents,(r?.eventActions??so).length=e.effectEventActions;let a=r?.stores??uo;for(let t=e.stores;t<a.length;t++)a[t].queued=!1;a.length=e.stores,(r?.refs??fo).length=e.refAttach,r===null?ns.length=e.refDetach:r.detaches!==void 0&&(r.detaches.length=e.refDetach),e.effectDeps!==null&&u_(e.origin,e.effectDeps);let o=ci!==null||li!==null,s=e.memoSwaps;if(o)ci!==null&&(s=s===null?ci:ci.concat(s),ci=null);else if(s!==null)for(let e=s.length-1;e>=0;e--)gi(s[e],!1);for(let e=0;e<n.length;e++)n[e].slot.value=n[e].baseValue;let c=di(e.origin,li);li=null,$r={origin:e.origin,entries:n,memoSwaps:s,warmHarvest:c,holders:new Set(t)},o||Do(e.origin)}Ii=Li.pop(),Ri=Bi.pop(),--Vi===0&&(j=null,Fi=null,Za())}function mi(e,t,n){let r=Zr;if(r===null)return;let i=dn(e);(r.memoSwaps??=[]).push([0,i,t,i.get(t),n])}function hi(e,t,n){let r=Zr;r!==null&&(r.memoSwaps??=[]).push([1,e,t,e.slice(t,t+n.length),n])}function gi(e,t){if(e[0]===0){let n=t?e[4]:e[3];!t&&n===void 0?e[1].delete(e[2]):e[1].set(e[2],n);return}let n=t?e[4]:e[3];for(let t=0;t<n.length;t++)e[1][e[2]+t]=n[t]}function _i(e){for(let t of e)if(!t.superseded&&t.slot.pendingActionBatch?.flushed===!1)return!0;return!1}function vi(){let e=$r;if(e===null||_i(e.entries))return!1;$r=null;let t=[];for(let n=0;n<e.entries.length;n++){let r=e.entries[n];!r.superseded&&Object.is(r.slot.value,r.baseValue)&&(r.slot.value=r.value,r.block.disposed||t.push(r))}if(t.length===0)return ci=null,li=null,!1;let n=e.memoSwaps;if(n!==null){for(let e=0;e<n.length;e++)gi(n[e],!0);ci=ci===null?n:ci.concat(n)}li=e.warmHarvest,yr++;try{for(let e=0;e<t.length;e++)Do(t[e].block)}finally{yr--}return Qr.push(t),!0}function yi(e){for(let t=0;t<e.entries.length;t++){let n=e.entries[t];if(n.superseded||!Object.is(n.slot.value,n.baseValue))return!1}return!0}function bi(e,t=!1){let n=e.transition;return n!==void 0&&!n.origin.disposed&&(n.promoted?t:yi(n))}function xi(e,t,n){let r=e.transition;if(n===null||!n.origin.mounted||n.origin.disposed||ia(t,n.origin)||n.heldSlots!==null&&n.heldSlots.size!==0)return r!==void 0&&!yi(r)&&wi(e),!1;let i=r?.promoted===!0,a=i?r.origin:n.origin;if(a.idState.renderOwner!==e||!tu(n.origin,a))return!1;let o=ui(a);if(o.length===0)return r!==void 0&&!yi(r)&&wi(e),!1;if(ca(t),e.disposed||a.disposed)return wi(e),!0;let s=n.memoSwaps;if(i)r.memoSwaps!==null&&(s=s===null?r.memoSwaps:r.memoSwaps.concat(s));else if(s!==null)for(let e=s.length-1;e>=0;e--)gi(s[e],!1);for(let e=0;e<o.length;e++)o[e].slot.value=o[e].baseValue;e.transition={origin:a,entries:o,memoSwaps:s,warmHarvest:di(a,i?r.warmHarvest:null),promoted:!1,cue:!i};for(let t of o)t.batch!==void 0&&Jr(e,t.batch);return(r===void 0||r.promoted)&&to(1),!0}function Si(e){let t=e.transition;if(t===void 0)return!1;if(t.origin.disposed||!yi(t))return wi(e),!1;if(_i(t.entries))return!0;if(t.promoted=!0,t.cue=!1,t.memoSwaps!==null)for(let e=0;e<t.memoSwaps.length;e++)gi(t.memoSwaps[e],!0);yr++;try{to(-1),Yr(e);for(let e=0;e<t.entries.length;e++){let n=t.entries[e];n.slot.value=n.value,n.block.disposed||Do(n.block)}Qr.push(t.entries),e.retry()}finally{yr--}return!0}function Ci(e,t){let n=e.transition;if(n!==void 0){if(e.disposed||n.origin.disposed){wi(e);return}if(t.aborted){n.cue&&e.transaction===null&&(n.cue=!1,Do(n.origin));return}(n.promoted||!yi(n))&&wi(e)}}function wi(e){let t=e.transition;t!==void 0&&(e.transition=void 0,e.wakeable=null,e.generation++,t.promoted||to(-1),Yr(e))}var Ti=0,Ei=1,Di=2,Oi=3,ki=4,Ai=5,ji=6,Mi=7,Ni=8,Pi=9,j=null,Fi=null,Ii=0,Li=[],Ri=0,zi=0,Bi=[],Vi=0,Hi=!1,M=null,Ui=[],Wi=!1,Gi=0;function Ki(e,t=!1){let n=e.block.idState.renderOwner;return n===void 0||n.disposed||t&&!n.transaction?.rootRequest?null:n.retryKey??={}}function qi(e){if(e===void 0||M===e.transaction&&M!==null)return null;let t=e.transaction;if(t===null){e.nativeRetry?.clear();let n=ho();n.rootTransaction=!0,t={owner:e,log:[],bags:new Map,capture:n,created:null,createdStamp:++Gi,bagWindow:++zi,retainedCreated:null,retired:null,structures:null,commit:null,parked:null,aborted:!1,rootRequest:!1},e.transaction=t,Ui.push(t)}let n={transaction:t,previous:M,log:j,bags:Fi,checkpoint:Ii,bagWindow:Ri,depth:Vi,parked:za,capture:P};return F?.recordRootTransaction(t),M=t,j=t.log,Fi=t.bags,Ii=0,Ri=t.bagWindow,Vi=1,za=t.parked,P=t.capture,n}function Ji(e){e!==null&&(e.transaction.parked=za,M=e.previous,j=e.log,Fi=e.bags,Ii=e.checkpoint,Ri=e.bagWindow,Vi=e.depth,za=e.parked,P=e.capture)}function Yi(e){j.push(ji,e,null,null)}function N(e,t,n){M===null||Wi||j.push(Oi,e,t,n)}function Xi(e,t,n,r){let i=M;if(i===null||i.aborted||Wi)return;let a=i.structures??=new Map;(a.get(e)??-1)>=Ii||(a.set(e,j.length),Ma(e),Yi(()=>{a.delete(e)}),Ou?.revision===void 0&&Zi(t,n,r))}function Zi(e,t,n){let r=M?.owner.bindingLeases,i=[];for(let r=t===null?B(e):V(t);r!==null&&r!==n;r=V(r))i.push(r);Yi(()=>{let a=i;for(let t of r??[]){if(t.end===void 0||!t.active())continue;let n=e;for(;n!==null&&n.parentNode!==t.root.parentNode;)n=n.parentNode;for(let e=t.root;e!==null;e=e.nextSibling){if(e===n)return;if(e===t.end)break}let r=a.indexOf(t.root),i=a.indexOf(t.end);if(r<0||i<r||t.root.parentNode!==e)continue;let o=[];for(let e=t.root;e!==null&&(o.push(e),e!==t.end);e=e.nextSibling);a=[...a.slice(0,r),...o,...a.slice(i+1)]}if(t!==null&&(R?.view(t)??t).parentNode!==e||n!==null&&(R?.view(n)??n).parentNode!==e)return;let o=t!==null&&(R?.view(t)??t).parentNode===e?V(t):B(e),s=n!==null&&(R?.view(n)??n).parentNode===e?n:null,c=new Set(a);for(;o!==null&&o!==s;){let t=V(o);c.has(o)||(R?.view(e)??e).removeChild(o),o=t}$i(e,a,s)})}function Qi(e){let t=M;if(t===null||Wi)return;let n=t.structures??=new Map;(n.get(e)??-1)>=Ii||(n.set(e,j.length),Yi(()=>{n.delete(e)}),Zi(e,null,null))}function $i(e,t,n){for(let r=t.length-1;r>=0;r--){let i=t[r];((R?.view(i)??i).parentNode!==e||V(i)!==n)&&(Uo===null?(R?.view(e)??e).insertBefore(i,n):(Yo(e,Uo),tv(e,i,n,Uo))),n=i}}function ea(e){let t=M;if(t===null||t.aborted||Wi||e.idState.renderOwner!==t.owner)return;let n=t.retired??=new Set;n.has(e)||(n.add(e),j.push(Mi,n,e,null)),e.pending&&=(N(e,`pending`,e.pending),!1)}function ta(e,t,n,r,i){ea(e),na(t,n,r,()=>{e.disposed||L(e,!1)},i)}function na(e,t,n,r,i){let a=[];if(t!==null&&n!==null)for(let e=t;e!==null&&(a.push(e),e!==n);e=V(e));let o=!1;Yi(()=>{o=!0}),(M.commit??=[]).push(()=>{if(!o){r?.();for(let t of a)(R?.view(t)??t).parentNode===e&&(R?.view(e)??e).removeChild(t);i?.()}})}function ra(e,t){let n=M;if(n===null||n.aborted||Wi||e.idState.renderOwner!==n.owner||!e.mounted||ia(n,e))return!1;ea(e);let r=e.startMarker,i=e.endMarker,a=[],o=null,s=null;if(r!==null&&i!==null&&(R?.view(r)??r).parentNode!==null){o=(R?.view(r)??r).parentNode;let n=e.exclusiveMarkers||!t&&r!==i;s=n?i:V(i);for(let e=n?V(r):r;e!==null&&e!==s;e=V(e))a.push(e)}else if(e.kind===`root`){o=e.parentNode;for(let e=B(o);e!==null;e=V(e))a.push(e)}let c=!1;Yi(()=>{if(c=!0,o!==null){let e=(R?.view(s)??s)?.parentNode===o?s:null;$i(o,a,e)}});let l=as;if((n.commit??=[]).push(()=>{if(c||e.disposed)return;if(o!==null){let e=(R?.view(s)??s)?.parentNode===o?s:null;for(let t of a)(R?.view(t)??t).parentNode!==o&&(R?.view(o)??o).insertBefore(t,e)}let t=as;as=l;try{L(e,!1)}finally{as=t}if(o!==null)for(let e of a)(R?.view(e)??e).parentNode===o&&(R?.view(o)??o).removeChild(e)}),t&&o!==null)for(let e of a)(R?.view(o)??o).removeChild(e);return!0}function ia(e,t){return t.createdStamp===e.createdStamp}function aa(e,t){let n=ns.length;L(e,(!t.hydrating||e.kind===`portal`)&&!t.retainedCreated?.has(e)),ns.length=n}function oa(e){let t=M;t===null||Wi||ia(t,e)||(e.createdStamp=t.createdStamp,Ou?.revision!==void 0&&sa(e),(t.created??=[]).push(e),j.push(ki,e,t,null))}function sa(e){M!==null&&(M.retainedCreated??=new Set).add(e)}function ca(e){if(e.aborted)return;e.aborted=!0,e.owner.retrySignalOwners!==void 0&&e.owner.retrySignalOwners!==_n&&Tn(e.owner);let t=qi(e.owner),n=Wi;Wi=!0;try{let t=e.owner.current;if(t!==null)$a(0,t);else{for(let t=e.log.length-4;t>=0;t-=4)if(e.log[t]===ji)e.log[t+1]();else if(e.log[t]===ki)aa(e.log[t+1],e.log[t+2]);else if(e.log[t]===Mi)e.log[t+1].delete(e.log[t+2]);else if(e.log[t]===Pi){let n=e.log[t+1],r=e.log[t+2],i=e.log[t+3];i===void 0?n.delete(r):n.set(r,i)}e.log.length=0}jh(e.capture),e.commit=null;let n=ns.length;Za(),ns.length=n}finally{Wi=n,Ji(t)}}function la(e){for(let t of e.bindingLeases){let n=t.host!==void 0&&!t.active()?ku.get(t):void 0;if(!(n===void 0?e.bindingContainer.contains(t.anchor):!n.scope.block.disposed)){e.bindingLeases.delete(t),ku.delete(t),Ee(t);try{t.retire()}catch(t){lv(e.current,t)||console.error(t)}}}}function ua(){let e=Ui;if(e.length!==0){Ui=[];for(let t of e){let e=t.owner,n=F?.enterRootCommit(e);try{if(t.aborted||e.disposed){e.transaction===t&&(e.transaction=null),e.transition!==void 0&&xr.commitRoot(e,t);continue}if(!t.nativeAdmitted&&(!Nu(t.capture)||D!==null&&!D.validateCapture(t.capture))){let n=!Nu(t.capture);ca(t),e.transaction===t&&(e.transaction=null),e.disposed||(e.wakeable=null,e.generation++,n?Pu(t.capture):e.retry());continue}e.transaction===t&&(e.transaction=null),t.capture.presentations!==void 0&&gs!==null&&(_s(gs,e),gs.owners.get(e).presentation=t),t.rootRequest&&(e.transition===void 0||!xr.keepsRoot(e))&&(e.wakeable=null,e.generation++),e.wakeable===null&&(e.retryKey=null,e.nativeRetry?.clear(),e.retrySignalOwners!==void 0&&Tn(e));let n=Vn(t.capture,e,!0),r=e.generation,i=t.commit;if(i!==null)for(let t of i){if(e.disposed||e.generation!==r)break;t()}let a=t.parked;if(a!==null)for(let t of a){if(e.disposed||e.generation!==r)break;Qa(t)}if(D!==null&&F?.stageAction(()=>D.pruneDeferredRefs(e))!==!0&&D.pruneDeferredRefs(e),e.disposed||e.generation!==r){jh(t.capture);continue}kh(t.capture,n),e.bindingLeases!==void 0&&e.bindingLeases.size>0&&F?.stageAction(()=>la(e))!==!0&&la(e),e.transition!==void 0&&xr.commitRoot(e,t)}finally{n?.()}}}}function da(e,t,n){let r=e.idState.renderOwner;if(r===void 0||r.disposed)return!1;let i=r.transaction;if(i===null)return!1;if(xr===null||!xr.holdRoot(r,i,n)){if(Kl&&i.created!==null)for(let e of i.created)(e.parentBlock===null||!ia(i,e.parentBlock))&&eu(e);let e=_n,t=r.current;if(t!==null&&i.created!==null&&r.signalOwner!==void 0){for(let e of i.created)e.disposed||wn(e,t,r);_n=r.retrySignalOwners}try{ca(i)}finally{_n=e}}r.wakeable=t;let a=++r.generation,o=!1,s=()=>{o||(o=!0,queueMicrotask(()=>{r.disposed||r.generation!==a||r.wakeable!==t||(r.wakeable=null,(r.transition===void 0||!xr.retryRoot(r))&&r.retry())}))};return t.then(s,s),!0}var fa=Symbol();function pa(e){return{...e}}function ma(e){return{...e}}function ha(e){return{...e}}function ga(e){return{...e}}function _a(e){return{...e}}function va(e){return{...e}}function ya(e){return{...e}}function ba(e){return{...e}}function xa(e){return{...e}}function Sa(e){return{...e}}function Ca(e){return{...e}}function wa(e){return{...e}}function Ta(e){return{...e}}function Ea(e){return{...e}}function Da(e){return{...e}}function Oa(e){return{...e}}function ka(e){return{...e}}function Aa(e,t){switch(t){case 0:return pa(e);case 1:return ma(e);case 2:return ha(e);case 3:return ga(e);case 4:return _a(e);case 5:return va(e);case 6:return ya(e);case 7:return ba(e);case 8:return xa(e);case 9:return Sa(e);case 10:return Ca(e);case 11:return wa(e);case 12:return Ta(e);case 13:return Ea(e);case 14:return Da(e);case 15:return Oa(e);case 16:return ka(e);default:return{...e}}}function ja(){let e=O;if(e===null)return;let t=M;if(t!==null&&!t.hydrating&&t.retainedCreated===null&&Vi===1&&e.block.createdStamp===t.createdStamp)return;let n=e.slots[0];if(typeof n!=`object`||!n)return;let r=n[fa];if(r!==void 0){let e=Ri;if(n.__journalWindow===e)return;let t=Aa(n,r);j.push(Di,n,t,null),n.__journalWindow=e;return}n.__kind===void 0&&Ma(n)}function Ma(e){let t=Fi;(t.get(e)??-1)>=Ii||(t.set(e,j.length),j.push(Di,e,{...e},Array.isArray(e)?e.length:null))}function Na(e){if(M!==null&&e.ownerDocument.activeElement===e){let t=(R?.view(e)??e).selectionStart,n=(R?.view(e)??e).selectionEnd,r=(R?.view(e)??e).selectionDirection;t!==null&&n!==null&&Yi(()=>(R?.view(e)??e).setSelectionRange(t,n,r??void 0))}}function Pa(e,t,n){t===`value`&&Na(e);let r=j;r.push(Oi,e,t,(R?.view(e)??e)[t]),r.push(Oi,e,n,(R?.view(e)??e)[n]);let i=ym(e);i!==void 0&&Ma(i);let a=e;t===`checked`&&(R?.view(a)??a).type===`radio`&&(R?.view(a)??a).name!==``&&La(a),ja()}function Fa(e){Na(e),e.localName===`textarea`?(M===null?j.push(Oi,e,`defaultValue`,(R?.view(e)??e).defaultValue):Qi(e),ja()):Xa(e,`value`)}function Ia(e){let t=(R?.view(e)??e).form;if(t!==null)return(R?.view(t)??t).elements;let n=(R?.view(e)??e).getRootNode();return n.nodeType===9?(R?.view(n)??n).getElementsByName((R?.view(e)??e).name):(R?.view(n)??n).querySelectorAll(`input[type=\"radio\"]`)}function La(e){let t=(R?.view(e)??e).name,n=Ia(e);for(let r=0;r<n.length;r++){let i=n[r];i!==e&&(R?.view(i)??i).checked&&i.localName===`input`&&(R?.view(i)??i).type===`radio`&&(R?.view(i)??i).name===t&&(R?.view(i)??i).form===(R?.view(e)??e).form&&j.push(Oi,i,`checked`,!0)}}function Ra(e,t){j.push(Oi,e,`selected`,(R?.view(e)??e).selected),t&&j.push(Oi,e,`defaultSelected`,(R?.view(e)??e).defaultSelected)}var za=null;function Ba(e,t){let n=za;if(n!==null)for(let r of n){let n=r.block;if(n.forSlot===e||n.exclusiveMarkers&&n.startMarker===e.start&&n.endMarker===e.end)for(let e of r.nodes)(t??=new Set).add(e)}let r=M.retired;if(r!==null)for(let n of r){if(n.forSlot!==e)continue;let r=n.startMarker;r!==null&&r===n.endMarker&&(t??=new Set).add(r)}return t}function Va(e,t){let n=M!==null&&!Wi;n&&ea(e);let r=t!==void 0&&n?Ba(t,null):null,i=[],a=e.startMarker,o=e.endMarker;if(a&&o){let t=(R?.view(a)??a).parentNode;if(t!==null){let s=e.exclusiveMarkers,c=s?V(a):a,l=s?o:V(o);if(r===null)for(;c!==null&&c!==l;){let e=V(c);n||(R?.view(t)??t).removeChild(c),i.push(c),c=e}else for(;c!==null&&c!==l;){let e=V(c);r.has(c)||(n||(R?.view(t)??t).removeChild(c),i.push(c)),c=e}}}(za??=[]).push({block:e,nodes:i})}function Ha(){return j!==null}function Ua(e){return j!==null&&Fi.has(e)}function Wa(e){let t=Fi;if((t.get(e)??-1)>=Ii)return;if(t.set(e,j.length),M!==null&&(M.hydrating===!0&&H()!==null||e.adopt!==null)){Yi(()=>{t.delete(e)}),Zi(z(e.start).parentNode,e.start,e.end);return}let n=[];for(let t=e.head;t!==null;t=t.nextSibling)n.push(t);let r=null,i=0;for(let t of e.items.values())r===null&&n[i]!==t&&(r=n.slice(0,i)),r?.push(t),i++;r===null&&i!==n.length&&(r=n.slice(0,i));let a={empty:e.emptyBlock,mapOrder:r};Yi(()=>{Ka(e,a,n),Fi.delete(e)})}function Ga(e){let t=Fi,n=e.items;t.set(e,j.length);let r={head:e.head,tail:e.tail,size:e.size,empty:e.emptyBlock,entries:n};Yi(()=>{Ka(e,r,null),t.delete(e)}),e.items=new Map}function Ka(e,t,n){let r=n===null?t.entries:null,i=n===null?null:new Set(n);for(let t=e.head;t!==null;t=t.nextSibling)(r!==null||!i.has(t))&&L(t,!1);if(z(e.end).parentNode===null)return;if(e.head=n===null?t.head:n[0]??null,e.tail=n===null?t.tail:n[n.length-1]??null,e.size=n===null?t.size:n.length,r!==null)e.items=r;else{let r=n;e.items.clear();for(let e=0;e<r.length;e++){let t=r[e];t.nextSibling=r[e+1]??null,t.prevSibling=r[e-1]??null}let i=t.mapOrder??r;for(let t=0;t<i.length;t++){let n=i[t];e.items.set(n.key,n)}}let a=[];for(let t=e.head;t!==null;t=t.nextSibling){let e=qa(t);if(e!==null)for(let t of e)a.push(t);else if(t.startMarker!==null&&t.startMarker===t.endMarker)a.push(t.startMarker);else for(let e of Ja(t))a.push(e)}if(e.emptyBlock!==t.empty&&(e.emptyBlock!==null&&L(e.emptyBlock,!1),e.emptyBlock=t.empty),z(e.end).parentNode===null)return;if(t.empty!==null){let e=qa(t.empty)??Ja(t.empty);for(let t of e)a.push(t)}let o=z(e.end).parentNode,s=new Set(a);M!==null&&Ba(e,s);let c=V(e.start);for(;c!==null&&c!==e.end;){let e=V(c);s.has(c)||(R?.view(o)??o).removeChild(c),c=e}let l=e.end;for(let e=a.length-1;e>=0;e--){let t=a[e];((R?.view(t)??t).parentNode!==o||V(t)!==l)&&(Uo===null?(R?.view(o)??o).insertBefore(t,l):tv(o,t,l,Uo)),l=t}}function qa(e){let t=za;if(t===null)return null;for(let n=0;n<t.length;n++)if(t[n].block===e){let e=t[n].nodes;return t.splice(n,1),e}return null}function Ja(e){let t=[],n=e.startMarker,r=e.endMarker;if(!n||!r||(R?.view(n)??n).parentNode===null)return t;let i=e.exclusiveMarkers,a=i?V(n):n,o=i?r:V(r);for(;a!==null&&a!==o;)t.push(a),a=V(a);return t}function Ya(e,t){j.push(Ti,e,t,null),ja()}function Xa(e,t){j.push(Ei,e,t,(R?.view(e)??e).getAttribute(t)),ja()}function Za(){let e=za;if(e!==null){za=null;for(let t=0;t<e.length;t++)Qa(e[t])}}function Qa(e){try{L(e.block,!1)}finally{for(let t of e.nodes)(R?.view(t)??t).parentNode!==null&&z((R?.view(t)??t).parentNode).removeChild(t)}}function $a(e,t){if(e<0)return;let n=j;if(n===null)return;let r=Hi;Hi=!0;try{for(let r=n.length-4;r>=e;r-=4){let e=n[r+1],i=n[r+2],a=n[r+3];switch(n[r]){case Ti:(R?.view(e)??e).nodeValue=i;break;case Ei:a===null?(R?.view(e)??e).removeAttribute(i):(R?.view(e)??e).setAttribute(i,a);break;case Oi:(R!==null&&e?.nodeType!==void 0?R?.view(e)??e:e)[i]=a;break;case Ni:e.extra=a,e.props=i;break;case ki:aa(e,i);break;case Mi:e.delete(i);break;case Ai:!e.disposed&&(e===t||Ts(t,e))&&rc(e,t);break;case ji:e();break;case Pi:a===void 0?e.delete(i):e.set(i,a);break;default:for(let t of Reflect.ownKeys(e))!Object.prototype.hasOwnProperty.call(i,t)&&Object.prototype.propertyIsEnumerable.call(e,t)&&delete e[t];for(let t of Reflect.ownKeys(i))(typeof t!=`symbol`||!Reflect.set(e,t,i[t])&&!Object.is(e[t],i[t]))&&(e[t]=i[t]);a!==null&&(e.length=a),Fi.delete(e)}}n.length=e}finally{Hi=r}}var eo=null;function to(e){Hr+=e,Hr<0&&(Hr=0),Xr++;try{for(let e of Ur)try{e()}catch(e){console.error(e)}}finally{Xr--}}var no=0,ro=1,io=2,ao=[[],[],[]],oo=[],so=[],co=!1,lo=0,uo=[],fo=[];function po(e){e._reapply(),xd(e._currentRef,e)}var P=null,mo=null;function ho(){return{rootTransaction:!1,renderRoot:null,renderedBlocks:null,effects:[[],[],[]],events:[],eventActions:[],refs:[],detaches:void 0,stores:[],suspenseCommits:void 0,renderCleanups:void 0}}var go=oo,_o=so,vo=new Set;function yo(){if(vo.size!==0)for(let e of vo)e._reapply()}var bo=0,xo=null,So=50,Co=0;function wo(){return or>0||ur>0||dr>0}var To=class extends Error{};function Eo(){return new To(E(1))}function Do(e){if(e.disposed)return;let t=k===e;k!==null&&!t&&Xr===0&&fr===0&&(e.crossRenderUpdate=!0);let n=yr>0||t&&e.currentRenderMode===`transition`||!_r&&fp===0&&br>0?`transition`:`urgent`,r=Vr||t&&e.currentRenderDeferred;if(F?.schedulePending(e),e.pending){n===`urgent`&&(e.pendingMode=`urgent`,e.pendingDeferred=!1);return}sr===io&&!_r||(wo()?(e.nestedUpdateChain!==Co&&(e.nestedUpdateChain=Co,e.nestedUpdateCount=0),++e.nestedUpdateCount>So&&(e.nestedUpdateError=!0)):k===null&&(Co++,e.nestedUpdateChain=Co,e.nestedUpdateCount=0,e.nestedUpdateError=!1)),e.pending=!0,e.pendingMode=n,e.pendingDeferred=r,A.push(e),!_r&&(gr||(gr=!0,queueMicrotask(Io)))}var Oo=0,ko=25;function Ao(e,t){for(let n=e;n!==null;n=n.parentBlock)if(n===t)return!0;return!1}function jo(e){let t=null,n=0,r=0,i=hr;try{for(;n<A.length;){let a=A[n++];if(!Ao(a,e)){A[r++]=a;continue}if(!(!a.pending&&!a.nestedUpdateError||a.disposed)){try{if(a.nestedUpdateError)throw a.nestedUpdateError=!1,Eo();let e=(t??=new Map).get(a)??0,n=a.crossRenderUpdate;if(e>=(n?So:ko))throw n?Eo():Error(E(9));t.set(a,e+1),a.crossRenderUpdate=!1,I(a)}catch(e){y_(a,e)}i!==hr&&(i=hr,n=0,r=0)}}}finally{if(i===hr){for(;n<A.length;)A[r++]=A[n++];A.length=r,hr++}}}function Mo(e,t){let n=-t;for(let t=0;t<e.length;t++){let r=e[t];if(r.drainStamp===n)continue;let i=r,a=0;for(;i!==null&&i.drainStamp!==n;)a++,i=i.parentBlock;for(a+=i===null?-1:i.drainRenders,i=r;i!==null&&i.drainStamp!==n;)i.drainStamp!==void 0&&(i.drainStamp=n,i.drainRenders=a),a--,i=i.parentBlock}return e.sort(No),e}function No(e,t){return e.drainRenders-t.drainRenders}var Po=null;function Fo(){let e=null,t=null,n=++Oo;A.length>1&&Mo(A,n);for(let r=0;r<A.length;r++){let i=A[r];if(!i.pending&&!i.nestedUpdateError)continue;if(i.pending=!1,i.disposed){i.nestedUpdateError=!1;continue}let a=i.idState.renderOwner?.transaction;if(a?.aborted===!0)continue;let o=a?.retired;if(o!=null&&o.size!==0){let e=i;for(;e!==null&&!o.has(e);)e=e.parentBlock;if(e!==null)continue}let s=i.crossRenderUpdate;i.crossRenderUpdate=!1;let c=Po,l=c===null?null:c.find(i,!0,i.pendingMode??`urgent`),u=null,d=null,f=null;l!==null&&(l.__kind===`trySlotSlot`?l.hiddenDom===null?f=l:d=l:u=l);let p=qi(i.idState.renderOwner),m=null;try{if(i.kind===`root`&&!i.mounted&&oa(i),i.nestedUpdateError)throw i.nestedUpdateError=!1,Eo();if(i.drainStamp===n){if(++i.drainRenders>(s?So:ko))throw s?Eo():Error(E(9))}else i.drainStamp=n,i.drainRenders=1;if(d!==null){c.reveal(d,i.pendingMode??`urgent`);continue}if(u!==null&&u.pendingThenable!==null){c.retryActivity(u,!0);continue}let e=xr;m=e===null?null:e.begin(i);try{if(u!==null)c.retryActivity(u,!1,i);else if(f!==null)c.visible(f,i);else{let e=i.idState.renderOwner;if(e!==void 0&&e.current===i&&e.request!==null){let t=e.request;e.request=null;let n=i.pendingMode??`urgent`;i.pendingMode=null,t(n)}else I(i)}}finally{e!==null&&e.end(m)}}catch(t){try{y_(i,t,m)}catch(t){let n=i.idState.renderOwner?.transaction;n!=null&&ca(n);let r=t instanceof Au&&Object.prototype.hasOwnProperty.call(t,`failure`)?t.failure:t;lv(i,r)||(e===null?e={err:r,all:[r]}:(e.all.push(r),e.err=typeof AggregateError==`function`?AggregateError(e.all,E(13)):e.all[0]));let a=i;for(;a.parentBlock!==null;)a=a.parentBlock;a.kind===`root`&&!a.disposed&&(t instanceof Au&&a.idState.renderOwner!==void 0?(a.idState.renderOwner.preservePresentation=!0,ar.get(a)?.()):L(a))}}finally{Ji(p),u!==null&&(t??=new Set).add(u)}}if(A.length=0,hr++,t!==null)for(let e of t)Po.rehide(e);return ua(),Cr?.flush(),e}function Io(){if(gr=!1,vr){(A.length>0||Ui.length>0)&&!gr&&(gr=!0,queueMicrotask(Io));return}if(Cs()||ns.length!==0||fo.length!==0||vo.size!==0||Qr.length!==0||eo!==null)try{if(eo?.routeFlush()===!0)return;Zo()}catch(e){if(bo===0)throw e;(xo??=[]).push(e)}}function Lo(e){try{let t=e.activeElement;if(t===e.body&&(t=t?.shadowRoot?.activeElement??null,t===null))return null;for(;t!==null;){if(t.localName===`iframe`){let e;try{e=t.contentDocument}catch{break}if(e===null)break;let n=e.activeElement;if(n===null)break;t=n;continue}let e=t.shadowRoot?.activeElement;if(e==null)break;t=e}return t}catch{return null}}function Ro(e){if(e.localName===`textarea`)return!0;if(e.localName!==`input`)return!1;switch((R?.view(e)??e).type){case`text`:case`search`:case`tel`:case`url`:case`password`:return!0}return!1}function zo(e,t,n,r,i){let a=e,o=null,s=0,c=-1,l=-1,u=0,d=0;selection:for(;;){for(;;){if(a===t&&(n===0||a.nodeType===3)&&(c=s+n),a===r&&(i===0||a.nodeType===3)&&(l=s+i),c!==-1&&l!==-1)break selection;a.nodeType===3&&(s+=(R?.view(a)??a).nodeValue.length);let e=B(a);if(e===null)break;o=a,a=e}for(;;){if(a===e||(o===t&&++u===n&&(c=s),o===r&&++d===i&&(l=s),c!==-1&&l!==-1))break selection;let f=V(a);if(f!==null){a=f;break}a=o,o=(R?.view(a)??a).parentNode}}return c===-1||l===-1?null:{focused:e,start:c,end:l,contentEditable:!0}}function Bo(e){let t=Lo(e);if(t===null||t===t.ownerDocument.body)return null;if(Ro(t)){let e=t;return{focused:t,start:(R?.view(e)??e).selectionStart??0,end:(R?.view(e)??e).selectionEnd??0,contentEditable:!1}}if(t.contentEditable===`true`||(R?.view(t)??t).getAttribute(`contenteditable`)===`true`){let e=t.ownerDocument.getSelection();if(e!==null&&e.anchorNode!==null&&e.focusNode!==null&&(R?.view(t)??t).contains(e.anchorNode)&&(R?.view(t)??t).contains(e.focusNode)){let n=e.anchorNode,r=e.focusNode;if(n===r&&n.nodeType===3){if(n===B(t))return{focused:t,start:e.anchorOffset,end:e.focusOffset,contentEditable:!0};if((R?.view(n)??n).nodeValue.length<256){let r=t.ownerDocument.createRange();r.selectNodeContents(t),r.setEnd(n,e.anchorOffset);let i=r.toString().length;return{focused:t,start:i,end:i+e.focusOffset-e.anchorOffset,contentEditable:!0}}}let i=zo(t,n,e.anchorOffset,r,e.focusOffset);if(i!==null)return i}}return{focused:t,start:-1,end:-1,contentEditable:!1}}function Vo(e,t){let n=e.ownerDocument.createTreeWalker(e,4),r=n.nextNode(),i=null;for(;r!==null;){let e=(R?.view(r)??r).textContent?.length??0;if(t<=e)return[r,t];t-=e,i=r,r=n.nextNode()}return i===null?[e,0]:[i,(R?.view(i)??i).textContent?.length??0]}function Ho(e){if(e===null)return;let{focused:t}=e,n=t.ownerDocument;if(Lo(n)===t||!(R?.view(t)??t).isConnected)return;if(e.start!==-1){if(e.contentEditable){let r=n.getSelection();if(r!==null){let[i,a]=Vo(t,e.start),[o,s]=Vo(t,e.end),c=n.createRange();c.setStart(i,a),c.collapse(!0),r.removeAllRanges(),r.addRange(c),r.extend(o,s)}}else{let n=t;(R?.view(n)??n).setSelectionRange(e.start,Math.min(e.end,(R?.view(n)??n).value.length))}}let r=[],i=(R?.view(t)??t).parentElement;for(;i!==null;)r.push({element:i,left:(R?.view(i)??i).scrollLeft,top:(R?.view(i)??i).scrollTop}),i=(R?.view(i)??i).parentElement;(R?.view(t)??t).focus();for(let e=0;e<r.length;e++){let t=r[e];z(t.element).scrollLeft=t.left,z(t.element).scrollTop=t.top}}var Uo=null,Wo=null;function Go(){if(A.length===0)return null;let e=A[0].parentNode.ownerDocument;if(e===null)return null;let t=Bo(e),n=null;for(let r=1;r<A.length;r++){let i=A[r].parentNode.ownerDocument;if(i===null||i===e||n?.includes(i))continue;(n??=[e]).push(i);let a=Bo(i);a!==null&&(t===null?t=a:Array.isArray(t)?t.push(a):t=[t,a])}return t}function Ko(e){if(Array.isArray(e))for(let t=0;t<e.length;t++)Ho(e[t]);else Ho(e)}function qo(e){if(e===null&&Uo===null)return Fo();let t=Uo,n=Wo;Uo=e,Wo=null;try{return Fo()}finally{try{Jo()}finally{Wo=n,Uo=t}}}function Jo(){if(Wo!==null)for(let e=0;e<Wo.length;e++){let t=Wo[e],n=t.snapshot;if(n.contentEditable){let e=n.focused.ownerDocument,t=e.getSelection();if(t!==null&&Lo(e)===n.focused){let[r,i]=Vo(n.focused,n.start),[a,o]=Vo(n.focused,n.end);if(t.anchorNode!==r||t.anchorOffset!==i||t.focusNode!==a||t.focusOffset!==o){let n=e.createRange();n.setStart(r,i),n.collapse(!0),t.removeAllRanges(),t.addRange(n),t.extend(a,o)}}}for(let e=0;e<t.ancestors.length;e++){let n=t.ancestors[e];z(n.element).scrollLeft=n.left,z(n.element).scrollTop=n.top}}}function Yo(e,t){let n=null;if(Array.isArray(t)){for(let r=0;r<t.length;r++)if(t[r].focused.ownerDocument===e.ownerDocument){n=t[r];break}}else t.focused.ownerDocument===e.ownerDocument&&(n=t);if(n===null||!(R?.view(e)??e).contains(n.focused))return;if(Wo!==null){for(let e=0;e<Wo.length;e++)if(Wo[e].snapshot===n)return}let r=[];for(let e=z(n.focused).parentElement;e!==null;e=(R?.view(e)??e).parentElement)r.push({element:e,left:(R?.view(e)??e).scrollLeft,top:(R?.view(e)??e).scrollTop});(Wo??=[]).push({snapshot:n,ancestors:r})}function Xo(e){for(let t=0;(A.length>0||Ui.length>0)&&t<es;t++){Qo();let t=A.length===0?null:Go(),n=qo(t);t!==null&&Ko(t),n!==null&&e===null&&(e=n),ys()}return e}function Zo(){vr=!0;let e=Qr.length>0,t=eo,n=t?.shouldClearTypesAfterFlush()===!0;try{A.length>0&&Qo();let e=A.length===0?null:Go(),t=qo(e);if(e!==null&&Ko(e),ys(),F?.capturing()!==!0&&(A.length>0||Ui.length>0)&&(t=Xo(t)),t!==null)throw t.err}finally{vr=!1,(e||Qr.length>0)&&(Qr.length=0),n&&t.clearTypes()}}function Qo(){if(ao[io].length>0||Rs.length>0){if(F?.holdPassivesBeforeRender()===!0)return;Ss()}}function $o(e){if(vr)return we(e);eo?.interrupt();let t=_r;_r=!0;try{let t=we(e);vr=!0;let n=null;try{A.length>0&&Qo();let e=A.length===0?null:Go();n=qo(e),e!==null&&Ko(e),ys(),(A.length>0||Ui.length>0)&&(n=Xo(n))}finally{vr=!1}if((A.length>0||Ui.length>0)&&!gr&&(gr=!0,queueMicrotask(Io)),n!==null)throw n.err;return t}finally{_r=t}}var es=50;function ts(e,t,n){yd?.(e.block,n);let r={ref:t,el:n,block:e.block};if((P===null?fo:P.refs).push(r),P===null&&D!==null){let t=e.block.idState.renderOwner;t!==void 0&&D.stampQueuedPublication(t,r)}}var ns=[];function rs(e,t){if(e==null||ss(t))return;if(t!==null&&D?.unpublishedRef(t,e)){D.forgetUnpublishedRef(t);return}let n=t===null?void 0:vd?.get(t);if(n?.hidden&&n.connected!==e)return;let r=M?.aborted&&!Wi?null:P;(r===null?ns:r.detaches??=[]).push(e,t,hc,gc)}function is(e,t){e!=null&&Object.prototype.propertyIsEnumerable.call(Object(e),`ref`)&&e.ref!=null&&rs(e.ref,t)}var as=null;function ss(e){if(e===null)return!1;for(let t=as;t!==null;t=t.parent)if(t.elements.has(e))return!0;return!1}function cs(e,t){if(e===null||e.length===0)return t();let n=new Set;for(let t=0;t<e.length;t++){let r=e[t].el;r!==null&&n.add(r)}if(n.size===0)return t();let r=as;as={elements:n,parent:r};try{return t()}finally{as=r}}function ls(){if(ns.length===0)return;let e=ns.splice(0);for(let t=0;t<e.length;t+=4)try{ur++;try{xd(e[t],null,e[t+1])}finally{ur--}}catch(n){if(n instanceof To)throw n;let r=e[t+2],i=e[t+3];r===null?lv(i,n)||console.error(n):sv(i,n,r(n))}}function us(){if(fo.length===0)return;let e=fo.splice(0);if(e.length>1){let t=e[0].block?.parentBlock??null;for(let n=1;n<e.length;n++)if((e[n].block?.parentBlock??null)!==t){e.sort(Os);break}}for(let t of e){if(ms(t.block))continue;if(D!==null&&!D.publicationCurrent(t)){D.deferRef(t,t.el,t.ref===po?t.el._currentRef:t.ref);continue}let e=vd?.get(t.el);if(e!==void 0&&c_(t.block)!==null){e.hidden=!0;continue}try{D?.forgetUnpublishedRef(t.el),ur++;try{xd(t.ref,t.el)}finally{ur--}}catch(e){if(e instanceof To)throw e;let n=v_(t.block);n?sv(t.block,e,n(e)):lv(t.block,e)||console.error(e)}}}var ds=null,fs=!1;function ps(e=null){let t=ds,n=fs;ds=e,fs=!0;try{ls(),us()}finally{let e=ds;if(ds=t,fs=n,e!==null){ur++;try{for(let[t,n]of e)n.block.disposed||Object.is(t.value,n.previous)||Do(n.block)}finally{ur--}}}}function ms(e){let t=e;for(;t!==null;){if(t.disposed)return!0;t=t.parentBlock}return!1}function hs(e,t,n){return e!==null&&e.get(t)===n}var F=null,gs=null;function _s(e,t){if(t===void 0)return;let n=e.owners.get(t);if(n===void 0){let r={generation:t.generation,current:t.current,guard:()=>!t.disposed&&t.generation===r.generation};n=r,e.owners.set(t,n)}return n.guard}function vs(){return j!==null&&!Wi&&!Hi}function ys(){if(F?.stageEffects()===!0)return;if(oo.length===0&&so.length===0&&ao[no].length===0&&ao[ro].length===0&&ns.length===0&&fo.length===0&&uo.length===0&&mn===null&&vo.size===0&&!mm()){if(F?.defer(null,null)===!0)return;(ao[io].length>0||Rs.length>0)&&F?.beforeCommit(),(ao[io].length>0||Rs.length>0)&&!co&&bs();return}F?.beforeCommit();let e=D?.pauseLifecycle()??-1;cr++;try{ws();let e=Ls();Fm();let t=Ps();if(F?.defer(t,e)===!0)return;ps(),yo(),t!==null&&Fs(t),e!==null&&cv(e),Hn(),Vs(),(ao[io].length>0||Rs.length>0)&&!co&&bs()}finally{e>=0&&D.resumeLifecycle(e),ks()}}function bs(){co=!0,Ys(xs)}function xs(){co=!1,Is()}function Ss(){co=!1,Gs(),Is()}function Cs(){return A.length>0||Ui.length>0||Cr?.hasWork()===!0||oo.length>0||so.length>0||ao[no].length>0||ao[ro].length>0||ao[io].length>0||Rs.length>0||uo.length>0||mn!==null||mm()}function ws(){if(oo.length===0)return;let e=oo.splice(0);for(let t=0;t<e.length;t++){let n=e[t],r=n.block;if(!n.cell.active||D?.publicationCurrent(n)===!1||ms(r))continue;let i=o_(r,!0);if(r.renderStatus===qn||i!==null){if(i!==null&&i.__kind===`trySlotSlot`){qc(i,()=>{n.cell.active&&!ms(r)&&r.effectEventRenderVersion===n.renderVersion&&r.effectEventCompletedVersion===n.renderVersion&&(n.cell.impl=n.nextImpl)});continue}r.effectEventRenderVersion===n.renderVersion&&r.effectEventCompletedVersion===n.renderVersion&&(n.cell.impl=n.nextImpl)}}}function Ts(e,t){for(let n=t.parentBlock;n!==null;n=n.parentBlock)if(n===e)return!0;return!1}function Es(e,t,n,r){if(e!==n&&e!==null&&n!==null){let i=e.parentBlock,a=n.parentBlock;if(i===n)return-1;if(a===e)return 1;if(i===a)return t-r;for(let t=a;t!==null;t=t.parentBlock)if(t===e)return 1;for(let e=i;e!==null;e=e.parentBlock)if(e===n)return-1}return t-r}function Ds(e,t){return e.scope===t.scope?e.order-t.order||e.seq-t.seq:Es(e.scope.block,e.seq,t.scope.block,t.seq)}function Os(e,t){return Es(e.block,0,t.block,0)}function ks(){if(--cr!==0||lr===null)return;let e=lr;lr=null;for(let{block:t,error:n,handler:r}of e)As(t,n,r)}function As(e,t,n){if(cr>0){(lr??=[]).push({block:e,error:t,handler:n});return}let r=n===void 0?v_(e):n;if(r!==null){sv(e,t,r(t));return}let i=e;for(;i!==null&&i.parentBlock!==null;)i=i.parentBlock;i!==null&&i.kind===`root`&&!i.disposed&&(L(i),ls()),lv(e,t)||console.error(t)}function js(e){let t=e.scope.hooks?.get(e.slot);if(t===void 0||t.revision!==e.revision||!Ns(e,t))return;let n=e.fn===null,r=t.cleanup;if(n&&(t.connectedFn=null,t.connectedArgs=void 0,t.disconnected=!1),r){t.cleanup=void 0;try{mr(r,e.phase,e.scope)}catch(t){if(t instanceof To)throw t;As(e.scope.block,t)}}}function Ms(e){if(e.fn===null)return;let t,n=e.scope.hooks?.get(e.slot);if(n!==void 0&&n.revision===e.revision&&Ns(e,n)){n.connectedFn=e.fn,n.connectedArgs=e.args,n.disconnected=!1;try{let n=sr;sr=e.phase,or++;try{t=en||e.scope.block.idState.renderOwner?.signalOwner!==void 0?Rn(e.scope,()=>e.fn.apply(null,e.args)):e.fn.apply(null,e.args)}finally{or--,sr=n}}catch(t){if(t instanceof To)throw t;As(e.scope.block,t);return}typeof t==`function`&&(n.cleanup=t)}}function Ns(e,t){return D?.publicationCurrent(e)!==!1||(M!==null&&Ma(t),t.deps=void 0,t.active=t.connectedFn!==null,!e.scope.block.idState.renderOwner?.disposed&&!ms(e.scope.block)&&Bn(e.scope.block),!1)}function Ps(){let e=ao[no],t=ao[ro];if(e.length===0&&t.length===0)return null;let n=e.length===0?t.splice(0):t.length===0?e.splice(0):e.splice(0).concat(t.splice(0));n.sort(Ds);let r=n.length,i=0;for(;i<r;){let e=n[i].scope,t=i+1;for(;t<r&&n[t].scope===e;)t++;for(let e=i;e<t;e++){let t=n[e];t.phase===no&&!t.scope.block.disposed&&js(t)}for(let e=i;e<t;e++){let t=n[e];t.phase===no&&!t.scope.block.disposed&&Ms(t)}for(let e=i;e<t;e++){let t=n[e];t.phase===ro&&!t.scope.block.disposed&&(t.fn===null||!Yc(t.scope.block))&&js(t)}i=t}return n}function Fs(e){for(let t=0;t<e.length;t++){let n=e[t];n.phase===ro&&(n.scope.block.disposed||Yc(n.scope.block)||Ms(n))}}function Is(){cr++;try{zs();let e=ao[io];if(e.length===0)return;let t=e.splice(0);t.sort(Ds);for(let e=0;e<t.length;e++){let n=t[e];n.scope.block.disposed||n.fn!==null&&Yc(n.scope.block)||js(n)}for(let e=0;e<t.length;e++){let n=t[e];n.scope.block.disposed||Yc(n.scope.block)||Ms(n)}}finally{ks()}}function Ls(){if(so.length===0)return null;let e=so.splice(0),t=null;for(let n=0;n<e.length;n++)try{let r=e[n]();r!==void 0&&(t??=[]).push(r)}catch(e){console.error(e)}return t}var Rs=[];function zs(){if(Rs.length===0)return;let e=Rs.splice(0);for(let t=0;t<e.length;t+=3)try{mr(e[t],io,e[t+2])}catch(n){if(n instanceof To)throw n;let r=e[t+1],i=e[t+2];As(i,n,r)}}function Bs(e){try{return!Object.is(e.value,e.getSnapshot())}catch{return!0}}function Vs(){if(uo.length===0)return;let e=uo.splice(0);dr++;try{for(let t=0;t<e.length;t++){let n=e[t];n.queued=!1,!(n.block.disposed||Yc(n.block))&&(n.value=n.pending,Bs(n)&&n.forceUpdate())}}finally{dr--}}var Hs=[],Us=null,Ws=0;function Gs(){Hs.length!==0&&(Hs=[],Ws++,Us!==null&&(clearTimeout(Us),Us=null))}function Ks(e){if(e!==void 0&&e!==Ws)return;let t=Hs;if(t.length!==0){Gs();for(let e=0;e<t.length;e++)t[e]()}}var qs;function Js(){if(qs===void 0){if(typeof MessageChannel>`u`)qs=e=>setTimeout(()=>Ks(e),0);else{let e=new MessageChannel;e.port1.onmessage=e=>Ks(e?.data),qs=t=>e.port2.postMessage(t)}}return qs}function Ys(e){if(Hs.push(e),Hs.length!==1)return;let t=Js(),n=++Ws,r=typeof document<`u`&&document.visibilityState===`hidden`,i=typeof requestAnimationFrame==`function`;Us=setTimeout(()=>Ks(n),r||!i?0:250),!r&&i&&requestAnimationFrame(()=>{t(n)})}var Xs=class{constructor(e,t,n,r,i,a,o,s,c){this.body=a,this.props=o,this.extra=s,this.outputHandler=c,this.memoInChain=a?.__memo===!0||t!==null&&t.memoInChain===!0,this.parentNode=n,this.parentBlock=t,this.idState=t?.idState??{prefix:``,next:0},this.startMarker=r,this.endMarker=i,this.exclusiveMarkers=!1,this.itemIndex=0,this.pending=!1,this.disposed=!1,this.mounted=!1,this.renderStatus=qn,this.pendingMode=null,this.currentRenderMode=null,this.pendingDeferred=!1,this.currentRenderDeferred=!1,this.inactive=!1,this.hooks=null,this.cleanups=null,this.effectSlots=null,this.children=null,this._slots=null,this.refFields=null,this.$$ctxValues=null,this.$$ctxReads=null,this.$$ctxDirect=null,this.$$ctxDepsEpoch=-1,this.$$ctxCache=null,this.$$ctxCacheOwner=null,this.$$implicitBail=!1,this.__thenableIdx=0,this.drainStamp=0,this.drainRenders=0,this.crossRenderUpdate=!1,this.nestedUpdateChain=-1,this.nestedUpdateCount=0,this.nestedUpdateError=!1,this.effectEventRenderVersion=0,this.effectEventCompletedVersion=0,this.deoptNode=null,this.deoptRefs=!1,this.slots=[],this.compilerMemo=null,this.forSlot=null,this.prevSibling=null,this.nextSibling=null,this.key=null,this.vt=null,this.parent=null,this.block=this,this.kind=e,this.createdStamp=0,this.__warmEpisode=void 0,this.__thenableDone=void 0,this.__thenables=void 0,this.$$tryHandler=void 0,this.__suspenseHandler=void 0,this.__trySlot=void 0,this.__activitySlot=void 0,this.__warmCache=void 0,this.__warmCacheEpisode=void 0,this.signalInstanceParent=null,this.signalInstanceSite=void 0,this.signalInstanceValue=void 0,this.signalInstanceHasKey=!1,this.signalInstanceResolved=void 0}},Zs=class{constructor(e,t){this.block=t,this.parent=e,this.hooks=null,this.cleanups=null,this.effectSlots=null,this.children=null,this._slots=null,this.refFields=null,this.$$ctxValues=null,this.$$ctxReads=null,this.$$ctxCache=null,this.$$ctxCacheOwner=null,this.mounted=!1,this.slots=[],this.compilerMemo=null,this.signalInstanceParent=null,this.signalInstanceSite=void 0,this.signalInstanceValue=void 0,this.signalInstanceHasKey=!1,this.signalInstanceResolved=void 0}};function Qs(e,t,n,r,i,a,o,s,c=null){let l=new Xs(e,t,n,r,i,a,o,s,c);return t!==null&&l.idState.renderOwner===M?.owner&&oa(l),l}var $s=null,ec=null;function tc(e,t){let n=ec??=new Map;n.has(e)||n.set(e,{value:e.value,queue:e[t]?.slice(),key:t})}function I(e){if(en||e.idState.renderOwner?.signalOwner!==void 0){let t=Ln(e);if(t!==void 0&&tn?.(t),t!==void 0&&fe()!==t){he(t,()=>I(e));return}}let t=H();if(t!==null&&(!t.owns(e)||e.kind===`dynamic`&&e.endMarker!==null&&t.isFresh(e.endMarker))){t.suspend(()=>I(e));return}let n=$s,r=ec;$s=e,ec=null;try{let t=0;for(;sc(e);){if(e.nestedUpdateError)throw e.nestedUpdateError=!1,Eo();if(++t>ko)throw Error(E(9))}en&&e.__trySlot?.tryBlock===e&&e.__trySlot.retrySignalOwners!==void 0&&Tn(e.__trySlot);let i=ec;if(i!==null&&n!==null&&Ts(n,e)){r??=new Map;for(let[e,t]of i)r.has(e)||r.set(e,t)}}catch(t){let n=ec;if(n!==null){for(let[e,t]of n)e.value=t.value,e[t.key]=t.queue;e.crossRenderUpdate||(e.pending=!1)}throw e.idState.renderOwner?.signalOwner!==void 0&&!e.mounted&&e.forSlot!==null&&e.forSlot.items.get(e.key)!==e&&En(e,t),t}finally{$s=n,ec=r}}function nc(e){F?.recordStageEntry(e),_o.push(e)}function rc(e,t=null){if(!e.disposed)for(let n=e;n!==null&&(n.block===n&&(n.renderStatus=Jn,n.forSlot!==null&&(n.forSlot.cachedDeps=null)),!(n===t||t===null&&n.inactive));n=n.parentBlock);}function ic(e,t){if(e.rootTransaction===!0)return;let n=e.renderRoot??=t;(t===n||Ts(n,t))&&(e.renderedBlocks??=new Set).add(t)}function ac(e,t){let n=new Map;for(let r of Qr)for(let i of r){if(i.block!==e||i.superseded)continue;let r=n.get(i.slot);r===void 0?(n.set(i.slot,t.cells.length),t.cells.push({update:i,baseValue:i.baseValue,value:i.slot.value,hook:void 0})):t.cells[r].update=i}for(let e of t.cells)e.hook=Wc(e.update),e.hook===null&&(e.update.slot.value=e.baseValue)}function oc(e,t){for(let n=t.cells.length-1;n>=0;n--){let r=t.cells[n];r.hook!==void 0&&(r.hook===null?!e.disposed&&!r.update.superseded&&Object.is(r.update.slot.value,r.baseValue)&&(r.update.slot.value=r.value):Gc(r.hook))}e.disposed||e.pending&&e.pendingMode===`urgent`||t.cells.length!==0&&t.cells.every(e=>e.update.superseded)||(e.pending=!0,e.pendingMode=`transition`,e.pendingDeferred=t.pendingDeferred,t.queueEpoch!==hr&&!A.includes(e)&&A.push(e))}function sc(e){e.renderStatus===Jn&&(e.renderStatus=Yn),P!==null&&P.rootTransaction!==!0&&ic(P,e),j!==null&&j.push(Ai,e,null,null);let t=O,n=k,r=Zn,i=Qn,a=nr,o=er.length,s=go,c=_o,l=P?.events??s,u=P?.eventActions??c,d=l.length,f=u.length;O=e,k=e,Zn=e.effectSlots===null?0:$n++,Qn=0;let p=n!==null&&tu(n,e),m=e.pending&&e.pendingMode===`transition`&&p&&n.currentRenderMode===`urgent`?xr:null,h=m===null?null:{pendingDeferred:e.pendingDeferred,queueEpoch:hr,cells:[]};if(p)nr===0&&(nr=tr++);else{let t=n===null&&Gl?e.__warmEpisode:void 0;nr=typeof t==`number`?t:tr++}e.__warmEpisode=nr,go=l,_o=u,e.effectEventRenderVersion!==0&&e.effectEventRenderVersion++,e.pending=!1,e.crossRenderUpdate=!1,e.__thenableIdx=0;{let t=e.__thenables;t!==void 0&&t.length!==0&&(!Gl||e.__thenableDone===!0)&&(t.length=0),e.__thenableDone=!1}if(e.$$ctxReads!==null&&e.$$ctxReads.clear(),e.$$ctxDirect!==null){let t=e.slots[0];t?.__kind===`hydrateBlockSlot`&&t.parentBlock===e&&!t.independent&&!t.hydrated&&(t.contextChanged=e.$$ctxDepsEpoch!==Ae()&&Vg(e)),e.$$ctxDirect.clear()}e.$$ctxDepsEpoch=Ae(),e.currentRenderMode=h===null?e.pendingMode??n?.currentRenderMode??`urgent`:`urgent`,e.currentRenderDeferred=h===null?e.pendingMode===null?n?.currentRenderDeferred??!1:e.pendingDeferred:!1,e.pendingMode=null,e.pendingDeferred=!1;let g,_=!1,v=!1;D?.beginRender(e),pn?.get(e)?.clear();try{h!==null&&m.beginUrgent(e,h);let t=e.body(e.props,e,e.extra);if(e.pending&&!e.crossRenderUpdate)return v=!0,!0;e.outputHandler!==null&&(t!==void 0||e.slots[0]?.returnedOutput===!0)&&e.outputHandler(e,t??null),e.effectSlots!==null&&Zc(e),e.mounted||=!0,e.renderStatus===Yn&&(e.renderStatus=qn),e.effectEventRenderVersion!==0&&(e.effectEventCompletedVersion=e.effectEventRenderVersion),_=!0,e.__thenableDone=!0}catch(e){if(typeof e==`object`&&e)try{typeof e.then==`function`&&(e=new Bl(e))}catch{}throw g=e,e}finally{if(!_){if(v&&(e.renderStatus=Jn),e.renderStatus!==Jn){let t=null,n=Vl(g);if(n||!Al(g)){for(let r=e;r!==null;r=r.parentBlock)if(n?r.__suspenseHandler:r.$$tryHandler&&r.__trySlot?.catchBody!==null){t=r;break}}rc(e,t)}l.length=d,u.length=f}go=s,_o=c,er.length=o,nr=a,Zn=r,Qn=i,O=t,k=n;try{D?.endRender(e,_,Vl(g))}finally{h!==null&&m.endUrgent(e,h)}}}var cc=null;function lc(e,t){e.returnedOutput!==t&&(j!==null&&!Wi&&j.push(Oi,e,`returnedOutput`,e.returnedOutput),e.returnedOutput=t)}function uc(e,t){let n=[t?.end,t?.block?.endMarker,t?.hostNode,t?.text,e.endMarker,z(e.parentNode).lastChild];for(let t=0;t<n.length;t++){let r=n[t];if(r!=null&&(R?.view(r)??r).parentNode===e.parentNode)return r}return null}function dc(e,t,n){let r=cc;cc=e;try{if(n===!0){let t=e.slots[0];t!==void 0&&fc(e,t);return}let r=t!==null&&t.$$kind===Mt&&t.key==null&&typeof t.type==`function`,i=e.slots[0],a=null,o=null,s=r&&(t.type.$$singleRoot===!0||H()?.passthroughRanges===!0||i!==void 0&&i.__kind===`componentSlotSlot`&&i.currentComp===t.type);if(i!==void 0&&i.__kind!==(s?`componentSlotSlot`:`childSlot`)){let n=xr,r=e.currentRenderMode===`transition`,s=n!==null&&H()===null&&x_(e),c=M===null||s?n:null,l=c!==null&&!r&&H()===null&&s;if(c!==null&&H()===null&&(r||l)){let n=uc(e,i);if(n!==null){let r=c.render(e,e.parentNode,n,pv,t,dc);if(c.dispose(r.wip),r.failed)throw r.error;if(r.suspended)throw new Bl(r.suspended)}}if(M!==null&&!i.inherited&&!i.borrowed&&i.ownerHost==null){let t=i.start??i.hostNode??i.text??i.block?.startMarker??i.end??null,n=i.end??i.block?.endMarker??t;T_(e,t,n)&&(a=t,o=n)}if(fc(e,i),e.disposed)return}if(s){let n=t;wh(e,0,e.parentNode,n.type,n.props,e.endMarker,n.key??void 0,!0,void 0,H()!==null&&th(n),n.__octaneInvocationSite)}else{let n=H();if(n!==null&&e.slots[0]===void 0&&e.startMarker!==null&&e.endMarker!==null&&e.startMarker!==e.endMarker&&e.startMarker.nodeType===8&&e.endMarker.nodeType===8&&(V(e.startMarker)===e.endMarker||n.isUnframedRootRange(e.startMarker,e.endMarker))){let t={__kind:`childSlot`,start:e.startMarker,end:e.endMarker,ownerHost:null,borrowed:!0,compactable:!1,block:null,text:null,currentComp:null,currentIsBodyFn:!1,forSlot:null,hostNode:null,portal:null};e.slots[0]=t,xc(e,t)}Lg(e,0,e.parentNode,t,e.endMarker)}if(a!==null){let t=e.slots[0],n=t.start??t.hostNode??t.text??t.block?.startMarker??t.end??null,r=t.end??t.block?.endMarker??n;w_(e,a,o,n,r)}let c=e.slots[0];!e.disposed&&c!==void 0&&c.returnedOutput!==!0&&(j!==null&&!Wi&&j.push(Oi,c,`returnedOutput`,c.returnedOutput),c.returnedOutput=!0)}finally{cc=r}}function fc(e,t){let n=t.__kind,r=(n===`ifBlockSlot`||n===`switchBlockSlot`)&&t.start===null&&t.block?.endMarker!=null?t.block.endMarker:t.end,i=M;if(i!==null&&!i.aborted&&!Wi){let n=t.ownerHost??e.parentNode,i=t.inherited===!0||t.borrowed===!0,a=t.ownerHost!=null||i&&t.start===null?B(n):i?V(t.start):t.start??t.hostNode??t.text??t.block?.startMarker??r??null;i&&a===r&&(a=null);let o=a===null?null:t.ownerHost!=null||i&&r===null?(R?.view(n)??n).lastChild:i?z(r).previousSibling:r??t.block?.endMarker??a;Xi(t,n,i?t.start:a===null?(R?.view(n)??n).lastChild:(R?.view(a)??a).previousSibling,i?r:(R?.view(o)??o)?.nextSibling??null);let s=t.block??t.portal?.block;if(s!=null&&ea(s),t.forSlot!=null){for(let e=t.forSlot.head;e!==null;e=e.nextSibling)ea(e);t.forSlot.emptyBlock!==null&&ea(t.forSlot.emptyBlock)}na(n,a,o,()=>Oc(t,!1)),N(e.slots,0,e.slots[0]);let c=e._slots;if(c!==null){let e=c.indexOf(t);e!==-1&&(Yi(()=>c.splice(e,0,t)),c.splice(e,1))}e.slots[0]=void 0;return}if(n===`childSlot`){if(t.portal&&=(Ym(t.portal),null),t.forSlot){for(let e=t.forSlot.head;e!==null;e=e.nextSibling)L(e,!0);t.forSlot.emptyBlock&&L(t.forSlot.emptyBlock,!0),t.forSlot=null}Fh(t),t.borrowed||(z(t.start)?.remove(),z(r)?.remove())}else n===`componentSlotSlot`?t.block&&L(t.block,!0):Oc(t,!0),!t.inherited&&!t.borrowed&&(z(t.start)?.remove?.(),z(r)?.remove?.());let a=e._slots;if(a!==null){let e=a.indexOf(t);e!==-1&&a.splice(e,1)}e.slots[0]=void 0}var pc=class{constructor(e,t,n){this.parentNode=e,this.endMarker=t,this.parentBlock=n,this.$$ctxValues=null,this.idState=n.idState,this.signalInstanceParent=null,this.signalInstanceSite=void 0,this.signalInstanceValue=void 0,this.signalInstanceHasKey=!1,this.signalInstanceResolved=void 0}},mc=0,hc=null,gc=null,_c=null;function vc(e){hc===null?lv(gc,e)||console.error(e):(_c??=[]).push(e)}function yc(){let e=_c,t=hc,n=gc;if(_c=null,hc=null,gc=null,e!==null&&t!==null)for(let r=0;r<e.length;r++)sv(n,e[r],t(e[r]))}function L(e,t=!0){if(!e.disposed&&(Wi&&M!==null&&(M.retainedCreated?.has(e)||M.hydrating&&e.kind!==`portal`)&&(t=!1),!ra(e,t))){mc===0&&(hc=v_(e.parentBlock)??Dl(e),gc=e),mc++;try{bc(e,t)}finally{--mc===0&&yc()}}}function bc(e,t){e.disposed=!0;let n=e.idState.renderOwner;n?.current===e&&(n.generation++,n.wakeable=null,n.request=null,n.transition!==void 0&&xr.discardRoot(n)),eo?.unregister(e),e.deoptNode!==null&&e.deoptRefs&&U(e.deoptNode,null);let r=t&&(e.kind===`root`||e.startMarker!==null&&e.endMarker!==null&&z(e.startMarker).parentNode!==null);if(Cc(e,t&&!r),n?.current===e&&D?.clearDeferredRefs(n),t){if(e.startMarker&&e.endMarker){let t=z(e.startMarker).parentNode;if(t){let n=e.exclusiveMarkers,r=n?V(e.startMarker):e.startMarker,i=n?e.endMarker:V(e.endMarker);for(;r&&r!==i;){let e=V(r);(R?.view(t)??t).removeChild(r),r=e}}}else if(e.kind===`root`){let t;for(;(t=B(e.parentNode))!==null;)z(e.parentNode).removeChild(t)}}}function xc(e,t){let n=e._slots,r=M;r!==null&&e.mounted&&!ia(r,e.block)&&Yi(()=>{Oc(t,!0);let r=e.slots.indexOf(t);if(r!==-1&&(e.slots[r]=void 0),n===null)e._slots=null;else{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}),n===null?e._slots=[t]:n.push(t)}var Sc=1;function Cc(e,t=!0){let n=e.effectSlots;if(n!==null)for(let t=0;t<n.length;t++){let r=n[t],i=r.cleanup;if(i!==void 0){if(r.cleanup=void 0,r.phase===io)Rs.push(i,hc,gc),co||bs();else{if(gs!==null&&F.stageTeardown(i,r.phase,e)===!0)continue;try{mr(i,r.phase,e)}catch(e){vc(e)}}}}let r=null;e.mounted!==!0&&(r=[],j_(e,r)),cs(r,()=>{Ec(e,t)})}function wc(e,t){let n=e.cleanups;if(n!==null){for(let t=n.length-1;t>=0;t--)if(gs===null||F.stageTeardown(n[t],-1,e)!==!0)try{pr(n[t],e)}catch(e){vc(e)}}let r=gn.get(e);if(r){if(_n?.owners.has(r)||gs!==null&&F.stageAction(()=>{t?gn.set(e,null):gn.delete(e),bn(r)},!0))return;t?gn.set(e,null):gn.delete(e),bn(r)}else if(t&&r===!1){if(gs!==null&&F.stageAction(()=>Tc(e),!0))return;Tc(e)}}function Tc(e){let t=gn.get(e);t===!1?gn.set(e,null):t&&(gn.set(e,null),bn(t))}function Ec(e,t,n=!0){wc(e,n),Dc(e,t)}function Dc(e,t){let n=e.children;if(n!==null)for(let e=0,r=n.length;e<r;e++)Cc(n[e].scope,t);let r=e._slots;if(r!==null)for(let e=0,n=r.length;e<n;e++){let n=r[e];Oc(n,t)}}function Oc(e,t){(e.__flags&Sc)!==0&&e.__teardown(e,t);let n=e.__kind;if(n===`ifBlockSlot`||n===`switchBlockSlot`||n===`activityBlockSlot`)e.block&&L(e.block,t);else if(n===`forBlockSlot`){for(let n=e.head;n!==null;n=n.nextSibling)L(n,t);e.emptyBlock&&L(e.emptyBlock,t)}else if(n===`hydrateBlockSlot`)e.block&&L(e.block,t);else if(n===`childSlot`){if(e.block&&L(e.block,t),e.forSlot){for(let n=e.forSlot.head;n!==null;n=n.nextSibling)L(n,t);e.forSlot.emptyBlock&&L(e.forSlot.emptyBlock,t)}e.portal&&Ym(e.portal),e.hostNode!=null&&U(e.hostNode,null)}else{let r=n===`portalSlotSlot`||t;e.block&&L(e.block,r),n===`portalSlotSlot`&&e.target&&(Wm(e.target,e),up(e.target))}}function kc(e){throw Error(E(15,e))}var Ac=[],jc=null;function Mc(e,t,n){let r=jc??={pending:Ac[Ac.length-1],active:!1},i=r.pending,a=r.active;r.pending=void 0,r.active=!0;try{if(i===void 0)return Reflect.apply(e,t,n);switch(n.length){case 0:return e.call(t,i);case 1:return e.call(t,n[0],i);case 2:return e.call(t,n[0],n[1],i);case 3:return e.call(t,n[0],n[1],n[2],i);case 4:return e.call(t,n[0],n[1],n[2],n[3],i);default:{let r=Array(n.length+1);for(let e=0;e<n.length;e++)r[e]=n[e];return r[n.length]=i,e.apply(t,r)}}}finally{r.pending=i,r.active=a}}function Nc(e,t,...n){let r=jc,i=r?.pending,a=r?.active??!1;r!==null&&(r.pending=e,r.active=!1),Ac.push(e);try{return t(...n)}finally{Ac.pop(),jc!==null&&(jc.pending=r===null?Ac[Ac.length-1]:i,jc.active=a)}}function Pc(e,t){let n=typeof t==`number`?String(t):t.description??``;return e+(typeof t==`number`?`n`:`s`)+n.length+`:`+n}function Fc(e){let t=Ac.length;return t===0?e:e===void 0&&t===1?Ac[0]:a(Ac,e,!1)}function Ic(e,t,n,r){r=Fc(r),(r===void 0||O===null)&&kc(e);let i=O,a=i.hooks?.get(r);if(a===void 0){a={nativeValue:t()},dn(i).set(r,a);let e=a.nativeValue;fn(i,()=>n(e))}return a.nativeValue}Vt(()=>O===null?null:Ic);function Lc(e,t){let n=Rc(e,t,arguments.length===1);return[n.value,n.setter]}function Rc(e,t,n){t===void 0&&typeof e==`symbol`&&n&&(Ac.length===0||jc?.active===!0)&&(t=e,e=void 0),t=Fc(t),t===void 0&&kc(`useState`);let r=O,i=k,a=r.hooks?.get(t);if(a===void 0&&(a={value:typeof e==`function`?e():e,setter:e=>{if(i.disposed)return;if(a.pendingActionBatch!==void 0&&Fr()===null&&Hc(a,e),(a.updates!==void 0||a.renderTransition!==void 0||typeof e==`function`&&Hr>0&&xr?.hasHeld(a,i)||i.pending&&typeof e==`function`)&&Fr()===null){k===i&&tc(a,`updates`),(a.updates??=[]).push(e),Do(i);return}let t=Lr(a,i),n,r=!1;try{n=typeof e==`function`?e(t):e}catch{if(Fr()===null){k===i&&tc(a,`updates`),(a.updates??=[]).push(e),Do(i);return}n=t,r=!0}let o=r||a.updates!==void 0||a.renderTransition!==void 0||a.pendingActionBatch!==void 0||i.pending&&typeof e==`function`;if(Object.is(n,t)&&!o){typeof e!=`function`&&xr?.cancelEqual(a,i)&&Do(i);return}let s=Rr(a,i,e,n,o);if(s!==null){s.state===void 0&&(s.state=a,Vc(s,a));return}if(fs&&ur>0&&!o){let e=ds??=new Map,t=a;if(!e.has(t)){let n={block:i,previous:a.value};e.set(t,n)}a.value=n;return}k===i&&tc(a,`updates`),a.value=n,i.disposed,Do(i)},updates:void 0,renderTransition:void 0,urgentTransition:void 0,getter:void 0,pendingActionBatch:void 0,pendingActionValue:void 0},dn(r).set(t,a)),a.renderTransition!==void 0||a.updates!==void 0){let e=zc(a);!a.urgentTransition&&a.updates!==void 0&&Object.is(e,a.value)&&xr?.rebaseHeld(a,i,a.updates),a.value=e,a.urgentTransition||(a.renderTransition!==void 0&&(Uc(a.renderTransition,a.value),a.renderTransition=void 0),a.updates=void 0)}return a}function zc(e){let t=e.renderTransition,n=t===void 0?e.value:Bc(t,e.urgentTransition===!0);if(e.updates!==void 0)for(let t of e.updates)n=typeof t==`function`?t(n):t;return n}function Bc(e,t,n){let r=e;for(;r.previous!==void 0;)r=r.previous;let i=r.replayBaseValue;for(let a=r;;a=a.next){if(a.stateUpdates!==void 0)for(let e of a.stateUpdates)i=typeof e==`function`?e(i):e;if(a.reducerActions!==void 0)for(let e of a.reducerActions)i=n(i,e);if((t||a.superseded)&&a.urgentOperations!==void 0)for(let e of a.urgentOperations)i=a.operations[e](i);else if(!t&&!a.superseded)for(let e of a.operations)i=e(i);if(a===e)return i}}function Vc(e,t){e.replayBaseValue=t.value;let n=t.renderTransition??xr?.heldUpdate(t,e.block);n!==void 0&&(e.previous=n,n.next=e),e.state===void 0?e.reducerActions=e.reducer.renderPhaseActions?.slice():e.stateUpdates=e.state.updates?.slice()}function Hc(e,t){let n=e.pendingActionBatch.updates.get(e);n!==void 0&&((n.urgentOperations??=[]).push(n.operations.length),n.operations.push(typeof t==`function`?t:()=>t),n.forceRender=!0)}function Uc(e,t){for(let n=e;n;n=n.previous)n.value=t,n!==e&&Object.is(t,n.baseValue)&&(n.superseded=!0)}function Wc(e){let t=e.state??e.reducer;return e.block.disposed||e.superseded||t===void 0||t.renderTransition===void 0?null:(t.urgentTransition=!0,t.value=e.baseValue,{update:e,cell:t})}function Gc(e){let{update:t,cell:n}=e;if(n.urgentTransition=!1,t.block.disposed||t.superseded){n.renderTransition=void 0;return}for(let e=t;e;e=e.previous)e.baseValue=n.value}var Kc=null;function qc(e,t){let n=Kc??=new WeakMap,r=n.get(e);r===void 0&&(r={entries:[],live:0},n.set(e,r));let i={action:t,active:!0,queue:r};return r.entries.push(i),r.live++,i}function Jc(e,t,n=!1){if(e===void 0||t===void 0)return!0;let r=e.length;if(r!==t.length){if(!n)return!0;r=Math.min(r,t.length)}for(let n=0;n<r;n++)if(!Object.is(e[n],t[n]))return!0;return!1}function Yc(e){for(let t=e;t!==null;t=t.parentBlock)if(t.inactive)return!0;return!1}function Xc(){return Zn===0&&(Zn=$n++),Zn}function Zc(e){let t=e.effectSlots;if(t!==null&&Zn!==0&&Qn!==t.length)for(let n=0;n<t.length;n++){let r=t[n];if(r.renderVersion===Zn||(r.phase===no&&f_(r),!r.active))continue;M!==null&&Ma(r),r.deps=void 0,r.active=!1;let i=++r.revision,a=P===null?ao[r.phase]:P.effects[r.phase];a.push({scope:e,slot:r.slot,fn:null,order:r.order,revision:i,args:void 0,phase:r.phase,seq:lo++}),p_(r,r.phase,a)}}function Qc(e,t,n,r){let i=O,a=i.hooks?.get(e);r===no&&(a===void 0?bd?.(i.block):f_(a));let o=Xc(),s=a!==void 0&&a.renderVersion!==o;if(s&&(Qn++,a.renderVersion=o),r!==no&&Yc(i.block)){rc(i.block),a&&!a.active&&(M!==null&&Ma(a),a.active=!0,a.revision++);return}if(a){let e=Jc(a.deps,n,!0);if(a.active&&!e)return;M!==null&&Ma(a);let t=!1;if(a.active||(a.active=!0,a.revision++,t=!0),!e)return;s&&!t&&a.revision++}let c;if(a)a.deps=n,c=a;else{if(M!==null){let t=i.effectSlots,n=t?.length??0;Yi(()=>{i.hooks?.delete(e),t===null?i.effectSlots=null:t.length=n})}Qn++;let t={deps:n,cleanup:void 0,renderVersion:o,revision:0,active:!0,order:i.effectSlots===null?0:i.effectSlots.length,effect:!0,phase:r,slot:e,connectedFn:null,connectedArgs:void 0,disconnected:!1};dn(i).set(e,t),i.effectSlots===null?i.effectSlots=[t]:i.effectSlots.push(t),c=t}let l={scope:i,slot:e,fn:t,order:c.order,revision:c.revision,args:n,phase:r,seq:lo++},u=P===null?ao[r]:P.effects[r];u.push(l),p_(c,r,u)}function $c(e,t,n){return n===void 0&&typeof t==`symbol`&&(n=t,t=void 0),t===null&&(t=void 0),n=Fc(n),n===void 0&&kc(e),[t,n]}function el(e,t,n){let[r,i]=$c(`useEffect`,t,n);Qc(i,e,r,io)}function tl(e,t,n){let[r,i]=$c(`useLayoutEffect`,t,n);Qc(i,e,r,ro)}function nl(e,t){return t.warmEpisode!==nr&&Ql(e,t.deps,t)&&(t.warmEpisode=nr),t}function rl(e,t,n){let r=nu(t,n);if(r===Jl)return null;let i={deps:n,value:r.value,warmEpisode:nr,warmRecord:void 0,nativeWitness:void 0};return Zr!==null&&mi(e,t,i),dn(e).set(t,i),$l(r,i),i}function il(e,t,n,r,i){let a={deps:n,value:r,warmEpisode:void 0,warmRecord:void 0,nativeWitness:i};return Zr!==null&&mi(e,t,a),dn(e).set(t,a),n!==void 0&&Ql(t,n,a)&&(a.warmEpisode=nr),r}var al=Object.is;function ol(e,t){let n=e.compilerMemo;return n!==null&&n.bodyId===t?n:sl(e,t,n)}function sl(e,t,n){if(n===null)return e.compilerMemo={bodyId:t,auto:void 0,hooks:void 0,overflow:null};let r=n.overflow;r===null&&(n.overflow=r=new Map);let i=r.get(t);return i===void 0&&(i={bodyId:t,auto:void 0,hooks:void 0,overflow:null},r.set(t,i)),i}function cl(e){return Array(e).fill(null)}function ll(e,t,n,r){return Zr!==null&&hi(e,t,[!0,r,n]),e[t+2]=n,e[t+1]=r,e[t]=!0,n}function ul(e,t,n,r,i){return Zr!==null&&hi(e,t,[!0,r,i,n]),e[t+3]=n,e[t+1]=r,e[t+2]=i,e[t]=!0,n}function dl(e,t){t===void 0&&typeof e==`symbol`&&arguments.length===1&&(Ac.length===0||jc?.active===!0)&&(t=e,e=void 0),t=Fc(t),t===void 0&&kc(`useRef`);let n=O,r=n.hooks?.get(t);return r===void 0&&(r={current:e},dn(n).set(t,r)),r}function fl(e,t){let n=[],r,i=!1;function a(e){if(e!=null){if(Array.isArray(e)){for(let t=0;t<e.length;t++)a(e[t]);return}if(i||=(r=t(),!0),typeof e==`function`){let t=e(r);n.push(typeof t==`function`?t:()=>e(null))}else{let t=e;t.current=r,n.push(()=>{t.current=null})}}}function o(){let e,t=!1;for(let r of n)try{r()}catch(n){t||=(e=n,!0)}if(n.length=0,t)throw e}try{a(e)}catch(e){try{o()}finally{throw e}}return o}function pl(e,t,n,r){let[i,a]=$c(`useImperativeHandle`,n,r);n=i,r=a;let o=n===void 0?void 0:[...n,e];Qc(r,()=>{if(Array.isArray(e))return fl(e,t);let n;return typeof e==`function`?n=e(t()):e!=null&&(e.current=t()),()=>{if(typeof n==`function`){n();return}typeof e==`function`?e(null):e!=null&&(e.current=null)}},o,ro)}var ml=new Map;function hl(e){let t=ml.get(e);if(t===void 0){let n=Pc(`@octane:uses:`,e);t={inst:Symbol.for(n+`:uses:inst`),effect:Symbol.for(n+`:uses:effect`)},ml.set(e,t)}return t}function gl(e,t,n){e.pending=t,e.subscribe=n,!e.queued&&(e.queued=!0,(P===null?uo:P.stores).push(e))}function _l(e,t){return Bs(e)&&e.forceUpdate(),t(e.onStoreChange)}function vl(e){let t=yr,n=br;yr=0,br=0;try{Do(e)}finally{yr=t,br=n}}function yl(e,t,n=void 0,r){let i=arguments.length,a=i>4?arguments[i-1]:i===4?r:n;a=Fc(a),a===void 0&&kc(`useSyncExternalStore`);let o=i>=4?n:void 0,s=hl(a),c=(H()!==null&&o!==void 0?o:t)(),l=O,u=l.hooks?.get(s.inst);if(u===void 0){let n=k,r={value:c,getSnapshot:t,pending:c,subscribe:e,effectDeps:null,forceUpdate:()=>vl(n),onStoreChange:()=>{n.disposed||(k!==null||!n.pending||n.pendingMode!==`urgent`||n.pendingDeferred)&&Bs(r)&&r.forceUpdate()},block:n,queued:!1};u=r,r.effectDeps=[r,e],dn(l).set(s.inst,u),gl(u,c,e)}else u.getSnapshot=t,(!Object.is(c,u.value)||e!==u.subscribe)&&gl(u,c,e);return u.effectDeps[1]!==e&&(u.effectDeps=[u,e]),el(_l,u.effectDeps,s.effect),c}function bl(e){return e.$$singleRoot=!0,e}function xl(e){return typeof e==`function`&&e[It]===!0}`${T}`;var Sl=null,Cl=0;function wl(e){let t=null;for(let n=e;n!==null;n=n.parentBlock){if(n.block!==n)continue;let e=n.slots[0];e?.__kind===`hydrateBlockSlot`&&!e.hydrated&&Sl?.has(e)&&(t=e)}return t}var Tl=Symbol(`octane.ctx.default`);function El(e){if(ir===0)return null;let t=e;for(;t!==null&&t.parentBlock!==null;)t=t.parentBlock;if(t===null)return null;let n=rr.get(t);return n!==void 0&&n.active?n:null}function Dl(e){let t=El(e);return t===null?null:e=>{if(!t.routeError(e))throw e}}function Ol(e){let t=El(e);return t===null?null:e=>{if(!t.routeSuspense(e))throw new Bl(e)}}var kl=Symbol.for(`octane.host-context-request`);function Al(e){return typeof e==`object`&&!!e&&e.$$kind===kl}function jl(e,t){if(e!==null&&e.memoInChain){(e.$$ctxDirect??=new Map).set(t,t.$$version);for(let n=e;n!==null;n=n.parentBlock)(n.body?.__memo===!0||n.$$implicitBail===!0)&&(n.$$ctxReads??=new Map).set(t,t.$$version)}}var Ml=!1,Nl=null;function Pl(e){if(e===null)return!1;for(let[t,n]of e)if(t.$$version!==n)return!0;return!1}function Fl(e,t){for(let[n,r]of e)t!==null&&jl(t,n),Ml&&(Nl??=new Map).set(n,r)}function Il(e){let t=!1,n=null,r=null,i;return()=>{let a=O,o=n===a||n!==null&&a!==null&&a.block.parentBlock===n.block&&a.$$ctxValues===null;if(!t||Pl(r)||r!==null&&!o){let o=Ml,s=Nl;Ml=!0,Nl=null;let c,l;try{c=e()}finally{l=Nl,Ml=o,Nl=s,o&&l!==null&&Fl(l,null)}n=a,r=l,i=c,t=!0}else n=a,r!==null&&Fl(r,k);return i}}function Ll(e,t,n){if(e===null)return;let r=e.$$ctxCache;if(r===null){e.$$ctxCache=t,e.$$ctxCacheOwner=n;return}let i=e.$$ctxCacheOwner;if(i!==null){let a=new Map;a.set(r,i),a.set(t,n),e.$$ctxCache=a,e.$$ctxCacheOwner=null}else r.set(t,n)}function Rl(e,t,n){if(Ml&&(Nl??=new Map).set(n,n.$$version),e!==null){let r=e.$$ctxCache,i=r===n?e.$$ctxCacheOwner:r!==null&&e.$$ctxCacheOwner===null?r.get(n):void 0;if(i!=null){if(i===Tl){let e=El(t);return e===null?n.defaultValue:e.readContext(n)}return i.$$ctxValues.get(n)}}let r=e;for(;r!==null;){let t=r.$$ctxValues;if(t!==null&&t.has(n))return Ll(e,n,r),t.get(n);r=r.parent}let i=t?.parentBlock??null;for(;i!==null;){let t=i.$$ctxValues;if(t!==null&&t.has(n))return Ll(e,n,i),t.get(n);i=i.parentBlock}let a=El(t);return a===null?(Ll(e,n,Tl),n.defaultValue):a.readContext(n)}function zl(e){return jl(k,e),Rl(O,k,e)}var Bl=class{constructor(e){this.thenable=e}thenable;__isSuspense=!0};function Vl(e){return typeof e==`object`&&!!e&&e.__isSuspense===!0}function Hl(e){try{return e[Re]===!0}catch{return!1}}function Ul(e,t=!1){let n=k,r=n.__thenables??=[],i=n.__thenableIdx;n.__thenableIdx=i+1;let a=H();if(!Hl(e)&&a!==null&&a.seeds!==null&&a.seedCursor<a.seeds.length)return a.useSeed(e,r,i,t);let o=r[i];if(o===e){if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:new Bl(e)}if(o!==void 0&&Gl&&!t){if(o.status===`fulfilled`)return o.value;throw o.status===`rejected`?o.reason:new Bl(o)}if(r[i]=e,Wl(e),e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:new Bl(e)}function Wl(e){e.status===void 0&&(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))}var Gl=!1,Kl=!1,ql=0,Jl=Symbol(`octane.warm.miss`),Yl=null;function Xl(e){for(let t=e;t!==null;t=t.parentBlock)if(t.__suspenseHandler)return null;return Ki(e)}function Zl(e){for(let t=e;t!==null;t=t.parentBlock){if(t.__warmCacheEpisode!==nr)continue;let e=t.__warmCache;if(e!==void 0)return e}let t=Xl(e),n=t===null?void 0:Yl?.get(t);return n===void 0&&(n=new Map,t!==null&&(Yl??=new WeakMap).set(t,n)),e.__warmCache=n,e.__warmCacheEpisode=nr,nr>ql&&(ql=nr),n}function Ql(e,t,n){let r=k;if(r===null)return!1;let i=null;for(let e=0;e<er.length;e+=3){let t=er[e];if(tu(t,r)){i=t;break}}if(i===null)return!1;let a=Zl(i),o=a.get(e);o===void 0&&(o=[],a.set(e,o));let s={deps:t,value:void 0,available:!1,source:n};return o.push(s),n.warmRecord=s,Kl=!0,!0}function $l(e,t){`available`in e&&(e.source=t,e.value=void 0,t.warmRecord=e)}function eu(e){if(Kl){if(e.hooks!==null)for(let t of e.hooks.values()){let e=t,n=e?.warmRecord;n!==void 0&&n.source===e&&(n.source=void 0,n.value=e.value,n.available=!0,e.nativeWitness!==void 0&&(n.nativeWitness=e.nativeWitness),e.warmRecord=void 0)}k_(e,eu)}}function tu(e,t){for(let n=t;n!==null;n=n.parentBlock)if(n===e)return!0;return!1}function nu(e,t,n){let r=nr<=ql?k:null;for(;r!==null;){let i=r.__warmCache;if(r.__warmCacheEpisode===nr&&i!==void 0){let r=ru(i,e,t,n);if(r!==Jl)return r}r=r.parentBlock}let i=k?.idState.renderOwner?.retryKey,a=i==null?void 0:Yl?.get(i);if(a!==void 0){let r=ru(a,e,t,n);if(r!==Jl)return r}let o=k?.idState.renderOwner?.transition,s=(o?.warmHarvest!=null&&tu(o.origin,k)?o.warmHarvest:null)??$r?.warmHarvest??li;if(s!=null)for(let r=0;r<s.length;r++){let i=s[r];if(!i.taken&&i.slot===e&&!Jc(i.deps,t)&&(n===void 0||n(i)))return i.taken=!0,i}return Jl}function ru(e,t,n,r){let i=e.get(t);if(i!==void 0){for(let e of i)if(e.available&&!Jc(e.deps,n)&&(r===void 0||r(e)))return e.available=!1,e}return Jl}function iu(e,t){let n=Fc(e);return n===void 0&&kc(t),n}function au(e,t,n,r,i){let a=O,o=a.hooks?.get(e);if(o!==void 0){let a=o.deps;if(a!==void 0&&a.length===4&&Object.is(a[0],t)&&Object.is(a[1],n)&&Object.is(a[2],r)&&Object.is(a[3],i))return nl(e,o)}return Kl?rl(a,e,[t,n,r,i]):null}function ou(e,t,...n){return il(O,e,n,t)}var su=Symbol.for(`octane.lazyBodyCheck`);function cu(e,t){Object.defineProperty(e,su,{get(){return this===e?t:void 0}})}var R=null;function z(e){return R===null||e==null?e:R.view(e)}var lu,uu;function B(e){return R===null?lu===void 0?e.firstChild:lu.call(e):R.view(e).firstChild}function V(e){return R===null?uu===void 0?e.nextSibling:uu.call(e):R.view(e).nextSibling}function du(e,t,n=!0){t in e||(n?e[t]=void 0:Object.defineProperty(e,t,{value:void 0,writable:!0,configurable:!0}))}var fu=!1;function pu(){if(fu||typeof Element>`u`)return;fu=!0;let e=Node.prototype;lu=Object.getOwnPropertyDescriptor(e,`firstChild`)?.get,uu=Object.getOwnPropertyDescriptor(e,`nextSibling`)?.get;let t=Element.prototype;Object.isExtensible(t)&&(du(t,`$$portalParent`),du(t,`$$portalEnd`),du(t,`$$deoptKey`),du(t,`$$ctrl`),du(t,`__oct_suppress`),du(t,`__oct_frag`),du(t,`__oct_vfrag`),du(t,ad,!1),du(t,sd,!1),du(t,cd,!1),du(t,Jh,!1),du(t,jm,!1)),typeof CharacterData<`u`&&Object.isExtensible(CharacterData.prototype)&&(du(CharacterData.prototype,`$$portalEnd`),du(CharacterData.prototype,`$$deoptKey`),du(CharacterData.prototype,Jh,!1))}var mu=Symbol(`octane.lazy-template`);function hu(e){for(let t of(R?.view(e)??e).querySelectorAll(`*`))if(t.localName.includes(`-`)||(R?.view(t)??t).hasAttribute(`is`))return e.__oct_frag=!0,e;let t=(R?.view(document)??document).createDocumentFragment(),n;for(;(n=B(e))!==null;)(R?.view(t)??t).appendChild(n);return t.__oct_frag=!0,t}function gu(e,t,n){pu();let r=(R?.view(document)??document).createElement(`template`);if(t===0){(R?.view(r)??r).innerHTML=n?`<octane-frag>${e}</octane-frag>`:e;let t=B(r.content);return t.nodeType===1&&t.localName===`octane-frag`?hu(t):t}let i=t===1?`svg`:`math`;(R?.view(r)??r).innerHTML=`<${i}>${e}</${i}>`;let a=B(r.content);return n?hu(a):B(a)}function _u(e,t=0,n=0){return{[mu]:{html:e,ns:t===1?1:t===2?2:t===3?3:0,frag:n,parsed:[null,null,null],root:0}}}function vu(e){let t;if(e.ns===3){let e=O===null?void 0:Hd(O.block.parentNode);t=e===Ld?1:e===Rd?2:0}else t=e.ns;let n=e.parsed[t];return n===null&&(n=gu(e.html,t,e.frag),e.parsed[t]=n),n}var yu=null;function H(){let e=yu;return e!==null&&e.isActive()?e:null}function bu(e){return e.nodeType===1&&e.localName===`style`&&(R?.view(e)??e).hasAttribute(`data-octane`)}var xu=null;function Su(e,t,n){if(xu!==null&&xu.node!==null){let t=xu.node;xu.node=null;let n=e.nodeType===void 0?(R?.view(e)??e)[mu]:void 0,r=n===void 0?e:vu(n);if(t.localName===r.localName&&t.namespaceURI===r.namespaceURI){for(let e=B(t);e!==null;e=V(e))U(e,null);(R?.view(t)??t).replaceChildren();for(let e=B(r);e!==null;e=V(e))(R?.view(t)??t).appendChild((R?.view(e)??e).cloneNode(!0));return t}let i=(R?.view(r)??r).cloneNode(!0),a=O.block;return U(t,null),z((R?.view(t)??t).parentNode).replaceChild(i,t),a.startMarker===t&&(a.startMarker=i),a.endMarker===t&&(a.endMarker=i),a.deoptNode=null,i}let r=e.nodeType===void 0?(R?.view(e)??e)[mu]:void 0;if(r!==void 0){let e=H();if(e!==null)return e.cloneLazy(r,t);let i=vu(r);return e===null?(R?.view(i)??i).cloneNode(!0):e.clone(i,t,n)}let i=H();return i===null?(R?.view(e)??e).cloneNode(!0):i.clone(e,t,n)}function Cu(e,t,n){if(H()!==null&&e.__oct_vfrag===!0)return;if(Ou?.revision!==void 0&&Mu(!1),e.nodeType===11){(R?.view(t)??t).insertBefore(e,n);return}let r;for(;(r=B(e))!==null;)(R?.view(t)??t).insertBefore(r,n)}function wu(e,t,n){if(t!==null){let n=e.block,r=H();if(r===null||r.isFresh(t)||(R?.view(t)??t).parentNode!==n.parentNode){let e=n.parentNode;(R?.view(e)??e).insertBefore(t,n.endMarker)}}return e.slots[0]=n,n}function Tu(e,t,n,r,i){return wu(e,t,{a:n,b:r,c:i,__journalWindow:0,[fa]:3})}function Eu(e,t,n,r,i,a,o,s,c,l){return wu(e,t,{a:n,b:r,c:i,d:a,e:o,f:s,g:c,h:l,__journalWindow:0,[fa]:8})}function Du(e){return e==null||e===!1?``:typeof e==`string`?e:String(e)}var Ou=null,ku=new WeakMap,Au=class extends Error{constructor(e,t,n=Ou?.revision){super(E(75)),this.lease=e,this.retry=t,this.revision=n}lease;retry;revision};function ju(e){return e instanceof be||e instanceof Au}function Mu(e=!0){throw new Au(Ou?.lease,e)}function Nu(e){return e.presentations?.every(e=>e.current(e))!==!1}function Pu(e){let t=new Set;for(let n of e.presentations??[])ku.delete(n.lease),n.hydration?.retryPresentation&&t.add(n.hydration.retryPresentation);for(let e of t)e()}var Fu=Symbol.for(`octane.binding.children-site`);function Iu(e,t,n,r){let i=t===null?void 0:e.lease.ranges?.().get(t);return(e.lease.revision?.()!==e.revision||t?.nodeType!==8||t.data!==n||i?.kind!==r||i.end.parentNode!==t.parentNode||H()?.close(t)!==i.end)&&Mu(),i}function Lu(e,t){let n=t?`[`:`]`;if(e===n||t&&(e===`[f0`||e===`[f1`)||t&&(e.startsWith(b)||e.startsWith(`[f`))&&ne(e))return 1;if(e.length<2||e.charCodeAt(0)!==n.charCodeAt(0))return 0;let r=e.charCodeAt(1);if(r<49||r>57)return 0;let i=r-48;for(let t=2;t<e.length;t++){let n=e.charCodeAt(t)-48;if(n<0||n>9||(i=i*10+n,!Number.isSafeInteger(i)))return 0}return i>=2?i:0}function Ru(e){if(e===null||e.nodeType!==8)return!1;let t=(R?.view(e)??e).data;return t===`]`||Lu(t,!1)>1}function zu(e){return yu===null?B(e):(R?.view(e)??e).firstChild}function Bu(e,t=1){let n=H();if(n!==null)return n.sibling(e,t);let r=e;for(let e=0;e<t;e++){if(r===null)return null;r=V(r)}return r}var Vu=null,Hu=null;function Uu(e,t){if(Vu!==null&&Vu(e,t))return;let n=(R?.view(e)??e).nodeValue;n!==t&&(j!==null&&Ya(e,n),(R?.view(e)??e).nodeValue=t)}function Wu(e,t){eo?.markDirty(),j!==null&&Ya(e,(R?.view(e)??e).nodeValue);let n=Du(t);Vu!==null&&Vu(e,n)||((R?.view(e)??e).nodeValue=n)}function Gu(e){return(typeof e==`object`||typeof e==`function`)&&e!==null&&e[an]===!0}function Ku(e){return e[on]()}function qu(e,t){return Object.assign(t,{[_e]:{active:()=>!e.disposed&&!e.scope.block.disposed,prepare:()=>Er(e.scope.block)}})}function Ju(e){return Gu(e)&&e.kind===`signal`&&typeof e.set==`function`}function Yu(e,t){let n=(R?.view(e)??e).getAttribute(v);if(n===null&&H()===null){(R?.view(e)??e).setAttribute(v,t);return}if(n!==t)throw Error(E(67,t))}function Xu(e,t,n){let r=d(e);return t!==r&&Kd(n,r),r}function Zu(e,t){let n=t==null?``:String(t),r=B(e);r!==null&&r===(R?.view(e)??e).lastChild&&r.nodeType===3?Uu(r,n):(M!==null&&(ja(),Zi(e,null,null)),(R?.view(e)??e).textContent=n)}var Qu=/(<\\/|<)(s)(cript)/gi;function $u(e){return e.replace(Qu,(e,t,n,r)=>`${t}${n===`s`?`\\\\u0073`:`\\\\u0053`}${r}`)}var ed=/\\r\\n?|\\u0000/g;function td(e){return e.replace(ed,e=>e===`\\0`?`�`:`\n`)}function nd(e,t){let n=e.ownerDocument,r=e.namespaceURI,i=r===`http://www.w3.org/2000/svg`||r===`http://www.w3.org/1998/Math/MathML`?(R?.view(n)??n).createElementNS(r,e.tagName):(R?.view(n)??n).createElement(e.tagName);return(R?.view(i)??i).innerHTML=t,(R?.view(i)??i).innerHTML}function rd(e,t){let n=t==null?``:String(t),r=H();if(r!==null&&!r.isFresh(e)){if((e.localName===`script`?(R?.view(e)??e).textContent??``:(R?.view(e)??e).innerHTML)===(e.localName===`script`?td($u(n)):nd(e,n))){if(e.localName!==`script`){let t=R?.view(e)??e;N(e,id,t[id]),t[id]=n}return}if(Kn(e))return;e.__oct_loc;return}if(e.localName===`script`){Zu(e,n);return}let i=R?.view(e)??e;if(i[id]!==n){if(N(e,id,i[id]),M!==null&&!Wi){ja(),Zi(e,null,null),na(e,B(e),(R?.view(e)??e).lastChild);let t=(R?.view(e)??e).cloneNode(!1);for((R?.view(t)??t).innerHTML=n;B(t)!==null;)(R?.view(e)??e).appendChild(B(t))}else(R?.view(e)??e).innerHTML=n;i[id]=n}}var id=Symbol(`octane.dangerHTMLValue`),ad=`__oct_dangerHTML`,od=!1,sd=`__oct_dangerChild`,cd=`__oct_dangerSpreadChild`,ld=`__oct_dangerResolved`,ud=`__oct_dangerResolvedChild`;function dd(){return Error(E(5))}function fd(e){if(e!=null&&(typeof e!=`object`||!(`__html`in e)))throw Error(E(6))}function pd(e,t){fd(t),N(e,ad,(R?.view(e)??e)[ad]);let n=(R?.view(e)??e)[ad]===!0;if(t==null){if((R?.view(e)??e)[ad]=!1,n){rd(e,null);let t=R?.view(e)??e;t[id]!==void 0&&(N(e,id,t[id]),t[id]=void 0)}return}if(t!=null&&Be.has(e.localName))throw Error(E(7,e.localName));if(t!=null&&((R?.view(e)??e)[sd]===!0||(R?.view(e)??e)[cd]!=null))throw dd();(R?.view(e)??e)[ad]=!0,od=!0,rd(e,t.__html)}function md(e,t,n=!1){let r=!1,i=null,a=!1,o=null;for(let e of t){let[t,s]=e;if(!t){e.length===2?(r=!0,i=s):s===`dangerouslySetInnerHTML`?(r=!0,i=e[2]):!n&&s===`children`&&(a=!0,o=e[2]);continue}if(!(s==null||typeof s!=`object`&&typeof s!=`function`))for(let e of Object.keys(Object(s)))e===`dangerouslySetInnerHTML`?(r=!0,i=s[e]):!n&&e===`children`&&(a=!0,o=s[e])}let s=r&&i!=null?i:null,c=a?o:null;if(Be.has(e.localName)&&(s!==null||c!=null))throw Error(E(8,e.localName));if(s!==null&&c!=null)throw dd();fd(s),!(Ze.call(e,ld)&&Object.is((R?.view(e)??e)[ld],s)&&Object.is((R?.view(e)??e)[ud],c))&&(N(e,cd,(R?.view(e)??e)[cd]),N(e,ld,(R?.view(e)??e)[ld]),N(e,ud,(R?.view(e)??e)[ud]),(R?.view(e)??e)[cd]=c,pd(e,s),(R?.view(e)??e)[ld]=s,(R?.view(e)??e)[ud]=c)}function hd(e,t){if(!od||e.nodeType!==1||(R?.view(e)??e)[ad]!==!0)return!1;if(t!=null)throw dd();return!0}var gd=new WeakMap,_d=new WeakMap,vd=null,yd=null,bd=null;function xd(e,t,n){if(e==null)return;let r=t??n,i=r==null?void 0:vd?.get(r);if(i!==void 0){if(t!==null)i.hidden=!1,i.connected=e;else if(n!=null){if(i.hidden&&i.connected!==e)return;i.connected===e&&(i.connected=null)}}Sd(e,t,n)}function Sd(e,t,n){if(e!=null){if(typeof e==`function`){if(t===null){let t=gd.get(e),r=n??_d.get(e),i=t!==void 0&&r!=null?t.get(r):void 0;i===void 0?e(null):(t.delete(r),_d.get(e)===r&&_d.delete(e),i())}else{let n=e(t);if(typeof n==`function`){let r=gd.get(e);r===void 0&&gd.set(e,r=new WeakMap),r.set(t,n),_d.set(e,t)}}return}if(Array.isArray(e)){for(let r=0;r<e.length;r++)Sd(e[r],t,n);return}e.current=t}}var Cd=Pt,wd=null,Td=class{_ownerBlock;_startMarker;_endMarker;_destroyed;_children;_pendingChildren;_portalAnchors;_listeners;_observers;_currentRef;constructor(e,t,n){this._ownerBlock=e,this._startMarker=t,this._endMarker=n,this._destroyed=!1,this._children=new Set,this._pendingChildren=new Set,this._portalAnchors=null,this._listeners=null,this._observers=null,this._currentRef=null;for(let e of Dd(this))this._children.add(e),this._attachChild(e);vo.add(this)}_destroy(){this._destroyed=!0,vo.delete(this);for(let e of this._children)this._detachChild(e);this._children.clear(),this._pendingChildren.clear(),this._portalAnchors?.clear(),this._portalAnchors=null,this._listeners=null,this._observers=null}_registerPortal(e,t){if(this._destroyed)return;let n=this._portalAnchors??=new Map,r=n.get(t);r===void 0&&n.set(t,r=new Set),r.add(e)}_unregisterPortal(e,t){let n=this._portalAnchors,r=n?.get(t);if(r===void 0||!r.delete(e))return;r.size===0&&n.delete(t),n.size===0&&(this._portalAnchors=null);let i=z(e.start)?.nextSibling??null;for(;i!==null&&i!==e.end;){let e=V(i);(i.nodeType===1||i.nodeType===3)&&this._children.delete(i)&&this._detachChild(i),i=e}}_attachChild(e){if(this._listeners!==null)for(let t of this._listeners)(R?.view(e)??e).addEventListener(t.type,t.listener,t.options);if(e.nodeType===1&&this._observers!==null)for(let t of this._observers)t.observe(e);let t=e;(t.reactFragments??=new Set).add(this)}_detachChild(e){if(this._listeners!==null)for(let t of this._listeners)(R?.view(e)??e).removeEventListener(t.type,t.listener,t.options);e.reactFragments?.delete(this)}_reapply(){if(this._destroyed)return;let e=this._children,t=this._pendingChildren;for(let n of Dd(this))t.add(n),e.has(n)||this._attachChild(n);for(let n of e)t.has(n)||this._detachChild(n);e.clear(),this._children=t,this._pendingChildren=e}focus(e){if(!this._destroyed){for(let t of kd(this))if(Ad(t,e))return}}focusLast(e){if(this._destroyed)return;let t=Array.from(kd(this));for(let n=t.length-1;n>=0;n--)if(Ad(t[n],e))return}blur(){if(this._destroyed)return;let e=this._startMarker.ownerDocument||document,t=e.activeElement;if(t&&t!==e.body){for(let e of Od(this))if(e===t||(R?.view(e)??e).contains(t)){(R?.view(t)??t).blur();return}}}addEventListener(e,t,n){if(this._destroyed)return;let r=Ed(n);this._listeners||=[];for(let n of this._listeners)if(n.type===e&&n.listener===t&&Ed(n.options)===r)return;this._listeners.push({type:e,listener:t,options:n});for(let r of Dd(this))(R?.view(r)??r).addEventListener(e,t,n)}removeEventListener(e,t,n){if(this._destroyed||!this._listeners)return;let r=Ed(n);for(let n=this._listeners.length-1;n>=0;n--){let i=this._listeners[n];if(i.type===e&&i.listener===t&&Ed(i.options)===r){for(let n of Dd(this))(R?.view(n)??n).removeEventListener(e,t,i.options);this._listeners.splice(n,1);return}}}observeUsing(e){if(!this._destroyed){this._observers||=new Set,this._observers.add(e);for(let t of Od(this))e.observe(t)}}unobserveUsing(e){if(!this._destroyed&&this._observers!==null&&this._observers.has(e)){this._observers.delete(e);for(let t of Od(this))e.unobserve(t)}}getClientRects(){let e=[];if(this._destroyed)return e;for(let t of Dd(this))if(t.nodeType===3){let n=t.ownerDocument.createRange();if(n.selectNodeContents(t),typeof n.getClientRects!=`function`)continue;let r=n.getClientRects();for(let t=0;t<r.length;t++)e.push(r[t])}else{let n=t.getClientRects();for(let t=0;t<n.length;t++)e.push(n[t])}return e}getRootNode(e){if(this._destroyed)return this;let t=z(this._startMarker).parentNode;return t===null?this:(R?.view(t)??t).getRootNode(e)}compareDocumentPosition(e){if(this._destroyed)return Node.DOCUMENT_POSITION_DISCONNECTED;let t=z(this._startMarker).parentNode;if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;let n=null,r=null;for(let i of Dd(this))if(n??=i,r=i,i===e||i.nodeType===1&&(R?.view(i)??i).contains(e))return(R?.view(t)??t).contains(i)?Node.DOCUMENT_POSITION_CONTAINED_BY:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;if(n===null||r===null){let n=this._startMarker.$$portalParent??t,r=(R?.view(n)??n).compareDocumentPosition(e);if(n===e)r=Node.DOCUMENT_POSITION_CONTAINS;else if((r&Node.DOCUMENT_POSITION_CONTAINED_BY)!==0){let t=jd(this._endMarker,!0);r=t!==null&&(t===e||((R?.view(t)??t).compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)!==0)?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING}return r|Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}let i=(R?.view(n)??n).compareDocumentPosition(e);if((i&Node.DOCUMENT_POSITION_DISCONNECTED)!==0)return i;let a=(R?.view(r)??r).compareDocumentPosition(e);if((R?.view(t)??t).contains(n)&&(R?.view(t)??t).contains(r)&&(i&Node.DOCUMENT_POSITION_FOLLOWING)!==0&&(a&Node.DOCUMENT_POSITION_PRECEDING)!==0)return Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;let o=this._startMarker,s=o.$$portalParent;if(s!==void 0&&s!==t&&(R?.view(s)??s).contains(e)){let t=o.$$portalSourceAnchor;if(t===void 0)return Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;let n=Node.DOCUMENT_POSITION_PRECEDING|Node.DOCUMENT_POSITION_FOLLOWING,r=(R?.view(t)??t).compareDocumentPosition(e)&n;if((i&n)!==r)return Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}return i}dispatchEvent(e){if(this._destroyed)return!0;let t=z(this._startMarker).parentNode;if(!t)return!0;let n=this._listeners;if(e.bubbles&&(n===null||n.length===0))return t.dispatchEvent(e);let r=z(t.ownerDocument||document).createTextNode(``);if(n!==null)for(let e of n)(R?.view(r)??r).addEventListener(e.type,e.listener,e.options);(R?.view(t)??t).appendChild(r);try{return r.dispatchEvent(e)}finally{if(n!==null)for(let e of n)(R?.view(r)??r).removeEventListener(e.type,e.listener,e.options);(R?.view(r)??r).parentNode===t&&(R?.view(t)??t).removeChild(r)}}scrollIntoView(e){if(typeof e==`object`)throw Error(E(49));if(this._destroyed)return;let t=e!==!1,n=Array.from(Dd(this));if(n.length===0){let n=jd(this._endMarker,!0),r=jd(this._startMarker,!1),i=t?n||r||z(this._startMarker).parentNode:r||n;if(i==null||i.nodeType===9)return;if(i.nodeType===11){let t=i.host;t&&t.scrollIntoView(e);return}i.nodeType===3?Md(i,t):i.scrollIntoView(e);return}for(let r=t?n.length-1:0;t?r>=0:r<n.length;r+=t?-1:1){let i=n[r];i.nodeType===3?Md(i,t):i.scrollIntoView(e)}}};function Ed(e){return e==null?!1:typeof e==`boolean`?e:!!e.capture}function*Dd(e){let t=e._portalAnchors,n=V(e._startMarker);for(;n!==null;){let r=V(n),i=t===null?void 0:t.get(n);if(i!==void 0){if(i.size===0){let e=n.$$portalEnd;if(e!==void 0){n=gg(n,e);continue}}for(let e of i){if(e.block===null||c_(e.block)!==null)continue;let t=z(e.start)?.nextSibling??null;for(;t!==null&&t!==e.end;){let e=V(t);(t.nodeType===1||t.nodeType===3)&&a_(t)&&(yield t),t=e}}}if(n===e._endMarker)return;(n.nodeType===1||n.nodeType===3)&&a_(n)&&(yield n),n=r}}function*Od(e){for(let t of Dd(e))t.nodeType===1&&(yield t)}function*kd(e){for(let t of Od(e)){yield t;let e=(t.ownerDocument||document).createTreeWalker(t,1),n=e.nextNode();for(;n;)yield n,n=e.nextNode()}}function Ad(e,t){let n=e,r=n.ownerDocument;if(r.activeElement===n)return!0;let i=!1,a=()=>{i=!0};(R?.view(r)??r).addEventListener(`focus`,a,!0);try{((R?.view(n)??n).focus||HTMLElement.prototype.focus).call(n,t)}finally{(R?.view(r)??r).removeEventListener(`focus`,a,!0)}return i}function jd(e,t){let n=t?V(e):(R?.view(e)??e).previousSibling;for(;n!==null;){if(n.nodeType===1||n.nodeType===3)return n;n=t?V(n):(R?.view(n)??n).previousSibling}return null}function Md(e,t){let n=e.ownerDocument.createRange();if(n.selectNodeContents(e),typeof n.getBoundingClientRect!=`function`)return;let r=n.getBoundingClientRect(),i=e.ownerDocument.defaultView||window,a=t?i.scrollY+r.top:i.scrollY+r.bottom-i.innerHeight;i.scrollTo(i.scrollX+r.left,a)}function Nd(e,t,n,r){let i=new Td(e.block,t,n);return i._currentRef=r,ts(e,po,i),(e.cleanups??=[]).push(()=>{rs(i._currentRef,i),i._destroy()}),i}var Pd=`http://www.w3.org/1999/xlink`,Fd=`http://www.w3.org/XML/1998/namespace`,Id=`http://www.w3.org/2000/xmlns/`,Ld=`http://www.w3.org/2000/svg`,Rd=`http://www.w3.org/1998/Math/MathML`,zd=`http://www.w3.org/1999/xhtml`;function Bd(e){return e.namespaceURI===zd&&e.localName.indexOf(`-`)!==-1}function Vd(e,t){return e===`svg`?Ld:e===`math`?Rd:t===void 0&&We.has(e)?Ld:t}function Hd(e){if(e.nodeType!==1)return;let t=e;if(t.namespaceURI===Ld)return t.localName===`foreignObject`?void 0:Ld;if(t.namespaceURI===Rd)return Rd}function Ud(e){if(e===`xmlns`)return Id;let t=e.indexOf(`:`);if(t<=0)return null;let n=e.slice(0,t);return n===`xlink`?Pd:n===`xml`?Fd:n===`xmlns`?Id:null}function Wd(e,t,n){if(t===`innerText`||t===`textContent`)return;if(t===`dangerouslySetInnerHTML`){pd(e,n);return}if(t===`suppressContentEditableWarning`||t===`suppressNativeChangeWarning`||t===`__octaneNativeChangeDiagnostic`)return;switch(t.length){case 5:if(t===`value`){let t=e.localName;if(t===`input`||t===`textarea`)return wm(e,n);if(t===`select`)return Om(e,n)}else if(t===`muted`&&!Bd(e)){(R?.view(e)??e).muted=n&&typeof n!=`function`&&typeof n!=`symbol`;return}break;case 7:if(t===`checked`&&e.localName===`input`)return Dm(e,n);break;case 8:if((t===`multiple`||t===`selected`)&&!Bd(e)){if(t===`selected`){let t=H();if(t!==null&&!t.isFresh(e))return}(R?.view(e)??e)[t]=n&&typeof n!=`function`&&typeof n!=`symbol`;return}break;case 9:if(t===`autoFocus`&&!Bd(e))return hm(e,n);break;case 12:if(t===`defaultValue`){let t=e.localName;if(t===`input`||t===`textarea`||t===`select`)return Am(e,n)}break;case 14:if(t===`defaultChecked`&&e.localName===`input`)return Nm(e,n)}if(t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&Bd(e)&&(typeof n==`function`||e.$$ceListeners?.[t]!==void 0)){let r=t.endsWith(`Capture`),i=r?t.slice(2,-7):t.slice(2),a=e.$$ceListeners??={},o=a[t];if(o!==void 0&&o!==n&&(R?.view(e)??e).removeEventListener(i,o,r),typeof n==`function`){o!==n&&(R?.view(e)??e).addEventListener(i,n,r),a[t]=n,(R?.view(e)??e).removeAttribute(t);return}delete a[t]}if(!Bd(e)){let e=Ge.get(t);e!==void 0&&(t=e)}let r=Gd(e,t,n);r!==null&&(r=_(e.localName,t,r));let i=H();if(i!==null&&!i.allowAttribute(e,t,r))return;let a=Ud(t);if(j!==null&&Xa(e,t),r===null){if(a){let n=t.indexOf(`:`);(R?.view(e)??e).removeAttributeNS(a,n>=0?t.slice(n+1):t)}else(R?.view(e)??e).removeAttribute(t);return}Ue.test(t)&&(a?(R?.view(e)??e).setAttributeNS(a,t,r):(R?.view(e)??e).setAttribute(t,r))}function Gd(e,t,n){if(t.charCodeAt(0)===97&&t.startsWith(`aria-`))return n==null||typeof n==`function`||typeof n==`symbol`?null:String(n);let r=typeof n;if(r===`boolean`&&Ke(t)||r===`boolean`&&t.startsWith(`data-`))return n?`true`:`false`;if(r===`function`||r===`symbol`)return null;if(!Bd(e)){let e=t.toLowerCase();if(Ve.has(e)||r===`boolean`&&(e===`download`||e===`capture`))return n?``:null;if(r===`boolean`||He.has(e)&&!(Number(n)>=1)||(e===`rowspan`||e===`start`)&&Number.isNaN(Number(n))||t.length>2&&t.charCodeAt(0)===111&&t.charCodeAt(1)===110)return null}if(n==null||n===!1)return null;let i;return i=n===!0?``:String(n),i===``&&(t===`src`||t===`href`&&e.nodeName!==`A`&&e.nodeName!==`AREA`||t===`data`&&e.nodeName===`OBJECT`)?null:i}function Kd(e,t){let n=d(t),r=H();if(r!==null){r.queueClass(e,n,!0,!1,t==null||t===!1);return}j!==null&&Xa(e,`class`),t==null||t===!1?(R?.view(e)??e).removeAttribute(`class`):(R?.view(e)??e).className=n}function qd(e,t){let n=t==null||t===!1?null:d(t),r=H();if(r!==null){r.queueClass(e,n,!1,!0,n===null);return}j!==null&&Xa(e,`class`),n===null?(R?.view(e)??e).removeAttribute(`class`):(R?.view(e)??e).setAttribute(`class`,n)}function Jd(e,t){e.namespaceURI===Ld?qd(e,t):Kd(e,t)}var Yd=`!important`;function Xd(e,t,n){let r=(R?.view(e)??e).style,i=H();i!==null&&i.applyStyle(e,t,n)||(j!==null&&Xa(e,`style`),!(Hu!==null&&Hu(e,t,n))&&Zd(e,r,t,n))}function Zd(e,t,n,r){if(n==null||n===!1||n===``){if(r&&typeof r==`object`)for(let e in r)t.removeProperty(un(e));else typeof r==`string`&&(t.cssText=``);return}if(typeof n==`string`){r!==n&&(t.cssText=n);return}if(r&&typeof r==`object`){for(let e in r)e in n||t.removeProperty(un(e));for(let i in n){let a=n[i];a!==r[i]&&(a==null||typeof a==`boolean`?t.removeProperty(un(i)):Qd(e,t,i,a))}}else{typeof r==`string`&&(t.cssText=``);for(let r in n){let i=n[r];i!=null&&typeof i!=`boolean`&&Qd(e,t,r,i)}}}function Qd(e,t,n,r){let i=un(n),a;a=qe(n,r);let o=a.trimEnd();o.endsWith(Yd)?t.setProperty(i,o.slice(0,o.length-10).trimEnd(),`important`):t.setProperty(i,a)}function $d(e){let t=e.charCodeAt(2);return e.length>2&&e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&t>=65&&t<=90}var ef=`$$capture:`;function tf(e){return e===`DoubleClick`?`dblclick`:e===`Focus`?`focusin`:e===`Blur`?`focusout`:e.toLowerCase()}var nf;function rf(e,t){if(!$d(e)||t!==void 0&&Bd(t)&&!Xe(e))return null;let n=nf?.get(e);if(n!==void 0)return n;let r=e.slice(2),i=!1;r.length>7&&r.endsWith(`Capture`)&&e!==`onGotPointerCapture`&&e!==`onLostPointerCapture`&&(i=!0,r=r.slice(0,r.length-7));let a=tf(r),o={type:a,key:i?ef+a:`$$`+a,capture:i};return Xe(e)&&(nf??=new Map).set(e,o),o}function af(e,t,n){if(t===`class`||t===`className`)j!==null&&Xa(e,`class`),(R?.view(e)??e).removeAttribute(`class`);else if(t===`style`)Xd(e,null,n);else if(t===`dangerouslySetInnerHTML`)pd(e,null);else if(t===`suppressHydrationWarning`)e.__oct_suppress=!1;else if(t!==`suppressNativeChangeWarning`&&t!==`__octaneNativeChangeDiagnostic`){let r=sf(e,t);if(r!==null){nm(e,r,null,n);return}let i=rf(t,e);i?Mf(e,i.key,null):Wd(e,t,null)}}function of(e){if(e==null)return null;let t=Object(e),n=Object.create(null);for(let e of Reflect.ownKeys(t)){if(!Object.prototype.propertyIsEnumerable.call(t,e))continue;let r=t[e];typeof e==`string`&&(n[e]=r)}return n}function sf(e,t){return t===`action`&&e.localName===`form`?`action`:(t===`formAction`||t===`formaction`)&&(e.localName===`button`||e.localName===`input`)?`formaction`:null}function cf(e){return e===`ref`||e===`children`||e===`dangerouslySetInnerHTML`||e===`suppressHydrationWarning`||e===`suppressContentEditableWarning`||e===`suppressNativeChangeWarning`||e===`__octaneNativeChangeDiagnostic`||e===`autoFocus`||e===`value`||e===`defaultValue`||e===`checked`||e===`defaultChecked`||e===`multiple`||$d(e)}function lf(e,t){if(t===`class`||t===`className`)return`class`;let n=sf(e,t);return n===null?Bd(e)?t:Ge.get(t)??t:n}function uf(e,t,n,r){let i=null,a=0;function o(e,t){if(typeof e!=`string`)return;let r=a++,i=n.get(e);i===void 0?n.set(e,{name:e,value:t,firstOrder:r,lastOrder:r}):(i.value=t,i.lastOrder=r)}for(let e of t){if(!e[0]){let t=e[1];if(e[3]===!0&&typeof t==`string`&&(t===`class`||t===`className`)){(i??=[]).push({rawName:t,value:e[2],order:a++});continue}o(t,e[2]);continue}let t=e[1];if(!(t==null||typeof t!=`object`&&typeof t!=`function`))for(let e of Object.keys(Object(t)))o(e,t[e])}let s=new Map,c=e.namespaceURI===`http://www.w3.org/1999/xhtml`,l=!1;for(let t of n.values()){let n=t.name;if(n===`key`)continue;let r=cf(n),i=r?n:lf(e,n),a=c&&!r?i.toLowerCase():i,o=s.get(a);if(o!==void 0){if(o.lastOrder>=t.lastOrder)continue;l=!0}t.name=i,s.set(a,t)}if(i!==null)for(let e of i){let t=s.get(`class`);t===void 0?s.set(`class`,{name:`class`,value:e.value,firstOrder:e.order,lastOrder:e.order}):(t.value=cn(t.value,e.value),t.lastOrder=e.order)}let u=Object.create(null),d=l?[...s.values()].sort((e,t)=>e.firstOrder-t.firstOrder):s.values();for(let{name:e,value:t}of d)u[e]=t;return r!==void 0&&`style`in u&&(u.style=r(u.style)),u}function df(e,t,n,r,i=!1,a,o=!1){let s=new Map,c=uf(e,t,s,a),l=e.localName,u=l===`input`||l===`textarea`||l===`select`;return Ef(e,c,n,r,!0,u),md(e,t,i),u&&!o&&Pm(e,l,s.get(`value`)?.value,s.get(`defaultValue`)?.value,s.get(`checked`)?.value,s.get(`defaultChecked`)?.value,s.get(`multiple`)?.value),c}var ff=Symbol(`octane.signal-host-prop-sources`);function pf(e,t,n){if(Gu(e))return t.add(e),n(e);if(typeof e!=`object`||!e||Array.isArray(e))return e;let r;for(let i of Object.keys(e)){let a=e[i];Gu(a)&&(t.add(a),r??={...e},r[i]=n(a))}return r??e}function mf(e,t,n=Ku){let r=new Set,i;for(let a=0;a<e.length;a++){let o=e[a];if(!o[0]){let s=o[1]===`children`||o[1]===`style`&&t!==void 0?o[2]:o[1]===`style`?pf(o[2],r,n):Gu(o[2])?(r.add(o[2]),n(o[2])):o[2];s!==o[2]&&(i??=e.slice(),i[a]=[!1,o[1],s,o[3]]);continue}let s=o[1];if(typeof s!=`object`||!s)continue;let c;for(let e of Object.keys(s)){let i=s[e],a=e===`children`||e===`style`&&t!==void 0?i:e===`style`?pf(i,r,n):Gu(i)?(r.add(i),n(i)):i;a!==i&&(c??={...s},c[e]=a)}c!==void 0&&(i??=e.slice(),i[a]=[!0,c])}return{sources:i??e,handles:r}}function hf(e,t){let n;for(let r of e){if(!r[0]){r[1]===t&&(n=r[2]);continue}let e=r[1];typeof e==`object`&&e&&Object.prototype.propertyIsEnumerable.call(e,t)&&(n=e[t])}return Gu(n)?n:null}function gf(e){if(!(e.disposed||e.pendingControl||e.scope.block.disposed))try{Rn(e.scope,()=>{let t=mf(e.sources,e.readStyle);e.resolved=df(e.element,t.sources,e.resolved,e.scope,e.hasNestedChildren,e.readStyle)})}catch{Do(e.scope.block)}}function _f(e,t){let n=t[sn](qu(e,()=>gf(e)));return e.subscriptions.set(t,n),n}function vf(e,t){for(let[n,r]of e.subscriptions)t.has(n)||(r(),e.subscriptions.delete(n),j!==null&&Yi(()=>{e.disposed||e.scope.block.disposed||Rn(e.scope,()=>_f(e,n))}));for(let n of t){if(e.subscriptions.has(n))continue;let t=_f(e,n);j!==null&&Yi(()=>{t(),e.subscriptions.delete(n)})}}function yf(e,t){let n=pt(e.element,t,n=>{Wt(()=>Rn(e.scope,()=>{let r=hf(e.sources,t);!e.disposed&&!e.pendingControl&&Ju(r)&&r.set(n)}))});return e.controlWriters.set(t,n),n}function bf(e){let t=e.element,n=hf(e.sources,`value`),r=hf(e.sources,`checked`),i=Ju(n)||Ju(r);for(let[t,i]of e.controlWriters)t===`value`&&Ju(n)||t===`checked`&&Ju(r)||(i(),e.controlWriters.delete(t),j!==null&&Yi(()=>{!e.disposed&&!e.scope.block.disposed&&yf(e,t)}));if(Ju(n)&&!e.controlWriters.has(`value`)){let t=yf(e,`value`);j!==null&&Yi(()=>{t(),e.controlWriters.delete(`value`)})}if(Ju(r)&&!e.controlWriters.has(`checked`)){let t=yf(e,`checked`);j!==null&&Yi(()=>{t(),e.controlWriters.delete(`checked`)})}if(!i){if(e.input!==void 0){let n=e.input;(R?.view(t)??t).removeEventListener(`input`,n),j!==null&&Yi(()=>{!e.disposed&&!e.scope.block.disposed&&(R?.view(t)??t).addEventListener(`input`,n)}),e.input=void 0}return}if(Yu(t,e.site),e.input!==void 0)return;let a=()=>{if(e.disposed||e.pendingControl)return;let n=Et(t);n!==null&&Wt(()=>Rn(e.scope,()=>{let t=hf(e.sources,`value`),r=hf(e.sources,`checked`);Ju(r)&&n.checked!==void 0&&r.set(n.checked),Ju(t)&&t.set(n.selectedValues??n.value)}))};e.input=a,(R?.view(t)??t).addEventListener(`input`,a),j!==null&&Yi(()=>(R?.view(t)??t).removeEventListener(`input`,a))}function xf(e){if(!e.disposed&&F?.stageAction(()=>xf(e))!==!0){e.disposed=!0;for(let t of e.subscriptions.values())t();Dr(e.scope.block),e.subscriptions.clear();for(let t of e.controlWriters.values())t();e.controlWriters.clear(),e.input!==void 0&&z(e.element).removeEventListener(`input`,e.input),is(e.resolved,e.element)}}function Sf(e,t){nc(()=>{e.disposed||e.scope.block.disposed||!e.pendingControl||Wt(()=>Rn(e.scope,()=>{let n=Et(e.element),r=hf(e.sources,`value`);if(n.editRevision>0||e.element.localName===`textarea`&&Ju(r)&&Object.is(Ku(r),t)){let t=hf(e.sources,`checked`);Ju(t)&&n.checked!==void 0&&t.set(n.checked),Ju(r)&&r.set(n.selectedValues??n.value)}if(!(e.disposed||e.scope.block.disposed)){if(!Ot(e.element,n.revision)){Sf(e,t);return}e.pendingControl=!1,gf(e)}}))})}function Cf(e,t,n,r,i,a){let o={[ff]:!0,scope:e,element:t,site:r,hasNestedChildren:i,readStyle:a,sources:n,resolved:void 0,subscriptions:new Map,controlWriters:new Map,disposed:!1};return fn(e,()=>xf(o)),o}function wf(e,t,n,r,i,a=!1,o){let s=typeof t==`object`&&t&&t[ff]===!0?t:void 0;s===void 0?s=Cf(e,n,r,i,a,o):gs===null&&(j!==null&&Ma(s),s.sources=r);let c=s;if(gs!==null){let e=gs.signalHosts??=new Map;s=e.get(c),s===void 0?(s={...c},e.set(c,s),vs()&&Yi(()=>e.delete(c))):j!==null&&Ma(s),s.sources=r}let l=hf(r,`value`);l!==null&&e.block.idState.renderOwner?.controlLeases?.has(n)&&Mu(!1);let u=hf(r,`checked`),d=Ju(l)||Ju(u)?Et(n):null;d!==null&&(Yu(n,i),s.pendingControl||=H()!==null&&(d.editRevision>0||Ju(l)&&Dt(n,Ku(l))));let f=mf(r,o);return s.resolved=df(n,f.sources,s.resolved,e,a,o,s.pendingControl),gs===null?(vf(s,f.handles),bf(s),!s.pendingControl&&d!==null&&Ot(n,d.revision)):F.stageAction(()=>{c.disposed||(c.sources=s.sources,c.resolved=s.resolved,c.pendingControl=s.pendingControl,Rn(e,()=>{vf(c,f.handles),bf(c)}),!c.pendingControl&&d!==null&&Ot(n,d.revision),gf(c))}),s.pendingControl&&Sf(c,s.resolved?.value),c}function Tf(e,t){switch(e.localName){case`input`:return t===`value`||t===`defaultValue`||t===`checked`||t===`defaultChecked`;case`textarea`:return t===`value`||t===`defaultValue`;case`select`:return t===`value`||t===`defaultValue`||t===`multiple`}return!1}function Ef(e,t,n,r,i=!1,a=!1){if(t!=null&&Object.prototype.propertyIsEnumerable.call(Object(t),`suppressHydrationWarning`)&&(e.__oct_suppress=t.suppressHydrationWarning===!0),!i){if(t!=null&&Object.prototype.propertyIsEnumerable.call(Object(t),`children`)){if((R?.view(e)??e)[cd]=t.children,t.children!=null&&(R?.view(e)??e)[ad]===!0)throw dd()}else n!=null&&Object.prototype.propertyIsEnumerable.call(Object(n),`children`)&&((R?.view(e)??e)[cd]=void 0)}if(n){for(let r of Object.keys(Object(n)))if(r!==`key`&&r!==`children`&&!(i&&r===`dangerouslySetInnerHTML`)&&!(a&&Tf(e,r))){if(r===`ref`){let r=t?t.ref:void 0;n.ref!=null&&n.ref!==r&&rs(n.ref,e);continue}t!=null&&Object.prototype.propertyIsEnumerable.call(Object(t),r)||af(e,r,n[r])}}if(t==null)return;let o=n===void 0?H():null,s=o!==null&&!o.isFresh(e);for(let o of Object.keys(Object(t))){if(o===`key`||o===`children`||i&&o===`dangerouslySetInnerHTML`||a&&Tf(e,o))continue;let c=t[o],l=n?n[o]:void 0;if(o===`ref`){if(c===l)continue;r?ts(r,c,e):xd(c,e);continue}if(o===`suppressHydrationWarning`||o===`suppressNativeChangeWarning`||o===`__octaneNativeChangeDiagnostic`)continue;if(o===`class`||o===`className`){if(c===l&&!s)continue;qd(e,c);continue}if(o===`style`){Xd(e,c,l);continue}if(o===`dangerouslySetInnerHTML`){pd(e,c);continue}let u=sf(e,o);if(u!==null){if(c===l&&!s)continue;nm(e,u,c,l);continue}if(c===l&&!Bm(e,o)&&!s)continue;let d=rf(o,e);if(d){if(c===l)continue;d.capture?$f.has(d.type)||cp([d.type]):Hf.has(d.type)||sp([d.type]),Mf(e,d.key,c);continue}(n===void 0||o!==`autoFocus`||Bd(e))&&Wd(e,o,c)}}var Df=Symbol(),Of=1;function kf(e){return typeof e==`object`&&!!e&&e[Df]===Of}var Af=[],jf=null;function Mf(e,t,n){t!==void 0&&(j!==null&&(j.push(Oi,e,t,(R?.view(e)??e)[t]),ja()),(R?.view(e)??e)[t]=n);let r=le!==null||ce!==void 0?pe():null;if(hn||en||r!==null||jf!==null){let t=r??(en||O?.block.idState.renderOwner?.signalOwner!==void 0?O===null?fe():gn.get(O)||O:O);if(t!==null){(t instanceof Zs||t instanceof Xs)&&gn.get(t)===void 0&&gn.set(t,!1);let n=jf??=new WeakMap;if(gs!==null)F.stageAction(()=>{n.get(e)!==t&&n.set(e,t)});else{let r=n.get(e);r!==t&&(j!==null&&j.push(Pi,n,e,r),n.set(e,t))}}}}var Nf=1,Pf=2,Ff=4,If=8,Lf=16,Rf=32,zf=64,Bf=128,Vf=256,Hf=new Map,Uf=new Map,Wf=new WeakMap,Gf=0,Kf=Symbol(`octane.portalPathLength`),qf=new WeakMap,Jf=0,Yf=Symbol(`octane.rootEpoch`);function Xf(e,t){let n=qf.get(e);qf.set(e,{count:(n?.count||0)+t,since:++Jf,previous:n}),n!==void 0&&setTimeout(()=>{let t=qf.get(e);t!==void 0&&(t.previous=void 0)},0)}function Zf(e,t){let n=qf.get(e);for(;n!==void 0&&n.since>t;)n=n.previous;return n!==void 0&&n.count>0}function Qf(e,t){if(Uf.size===1&&Gf===0){Oe(e),e[Yf]=Jf;return}let n=e.composedPath();if(Uf.size===1)return Oe(e),e[Yf]=Jf,Gf!==0&&(jp(n,Jf),e[Kf]=n.length),n;for(let r=n.length-1;r>=0;r--)if(Uf.has(n[r])){n[r]===t?(Oe(e),e[Yf]=Jf,Gf!==0&&(jp(n,Jf),e[Kf]=n.length)):Gf!==0&&n.length>(e[Kf]||0)&&(jp(n,e[Yf]??Jf),e[Kf]=n.length);break}return n}var $f=new Map,ep=`abort.beforetoggle.cancel.canplay.canplaythrough.close.durationchange.emptied.encrypted.ended.error.load.loadeddata.loadedmetadata.loadstart.pause.play.playing.progress.ratechange.resize.seeked.seeking.stalled.suspend.timeupdate.toggle.volumechange.waiting`.split(`.`),tp=new Set([`focus`,`blur`,`invalid`,`pointerenter`,`pointerleave`,`mouseenter`,`mouseleave`,`scroll`,`scrollend`,...ep]),np=e=>tp.has(e),rp={passive:!1},ip={capture:!0,passive:!1};function ap(e,t){return e===`touchstart`||e===`touchmove`?t?ip:rp:t}var op=new Set([`pointerenter`,`pointerleave`,`mouseenter`,`mouseleave`,`scroll`,`scrollend`]);function sp(e){let t=typeof Element<`u`&&Object.isExtensible(Element.prototype);for(let n=0;n<e.length;n++){let r=e[n];if(Hf.has(r))continue;let i=$f.get(r)??pp(r);i.flags|=Nf,Hf.set(r,i),t&&du(Element.prototype,`$$`+r);for(let e of Uf.keys())np(r)&&$f.has(r)||(e.addEventListener(r,zp,ap(r,np(r))),np(r)||e.addEventListener(r,Bp,ap(r,!0)))}}function cp(e){let t=typeof Element<`u`&&Object.isExtensible(Element.prototype);for(let n=0;n<e.length;n++){let r=e[n];if($f.has(r))continue;let i=Hf.get(r)??pp(r);i.flags|=Pf,$f.set(r,i),t&&du(Element.prototype,ef+r);for(let e of Uf.keys())Hf.has(r)||e.addEventListener(r,np(r)?zp:Bp,ap(r,!0))}}function lp(e,t=!1){if(F?.stageDelegation(e,t,!0)===!0)return;pu(),t&&Xf(e,1);let n=Uf.get(e)||0;if(Uf.set(e,n+1),n===0){e.onclick==null&&e.nodeType===1&&(e.onclick=Vp);for(let t of Hf.keys())e.addEventListener(t,zp,ap(t,np(t))),np(t)||e.addEventListener(t,Bp,ap(t,!0));for(let t of $f.keys())Hf.has(t)||e.addEventListener(t,np(t)?zp:Bp,ap(t,!0))}}function up(e,t=!1){if(F?.stageDelegation(e,t,!1)===!0)return;t&&Xf(e,-1);let n=Uf.get(e);if(n){if(n===1){Uf.delete(e);for(let t of Hf.keys())e.removeEventListener(t,zp,np(t)),np(t)||e.removeEventListener(t,Bp,!0);for(let t of $f.keys())e.removeEventListener(t,np(t)?zp:Bp,!0)}else Uf.set(e,n-1)}}var dp=new Set(`auxclick.beforeblur.beforeinput.blur.cancel.change.click.close.compositionend.compositionstart.compositionupdate.contextmenu.copy.cut.dblclick.dragend.dragstart.drop.focus.focusin.focusout.fullscreenchange.gotpointercapture.hashchange.input.invalid.keydown.keypress.keyup.lostpointercapture.mousedown.mouseup.paste.pause.play.pointercancel.pointerdown.pointerup.popstate.ratechange.reset.resize.seeked.select.selectionchange.selectstart.submit.textInput.touchcancel.touchend.touchstart.volumechange`.split(`.`)),fp=0;function pp(e){return{name:e,bubbleKey:`$$`+e,captureKey:ef+e,flags:(np(e)?Ff:0)|(op.has(e)?If:0)|(dp.has(e)?Lf:0)|(om.has(e)?Rf:0)|(e===`click`||e===`dblclick`||e===`mousedown`||e===`mousemove`||e===`mouseup`?zf:0)|(e===`mouseenter`?Bf:0)|(e===`invalid`||ep.includes(e)?Vf:0)}}var mp=Symbol(`octane.bubbleVersion`),hp=[],gp=0;function _p(e){for(let t=gp-1;t>=0;t--){let n=hp[t];if(n.event===e)return n}}function vp(){let e=_p(this);e!==void 0&&(e.flags|=1);let t=e?.stop||this.stopPropagation;(t===vp?Event.prototype.stopPropagation:t).call(this)}function yp(){let e=_p(this);e!==void 0&&(e.flags|=2);let t=e?.immediate||this.stopImmediatePropagation;(t===yp?Event.prototype.stopImmediatePropagation:t).call(this)}var bp={configurable:!0,writable:!0,value:vp},xp={configurable:!0,writable:!0,value:yp};function Sp(e,t,n,r){n?.configurable===!1?n.writable&&Object.defineProperty(e,t,{value:r.value}):Object.defineProperty(e,t,r)}function Cp(e,t,n){let r=hp[gp];return r===void 0&&(r={event:null,flags:0,stop:null,immediate:null,currentTarget:null},hp.push(r)),gp++,r.event=e,r.flags=0,r.stop=e.stopPropagation,Sp(e,`stopPropagation`,t,bp),n!==null&&(r.immediate=e.stopImmediatePropagation,Sp(e,`stopImmediatePropagation`,n,xp)),r}function wp(e,t,n){let r=hp[--gp];r.event=null,r.stop=null,r.immediate=null,r.currentTarget=null,t===void 0?delete e.stopPropagation:Object.defineProperty(e,\"stopPropagation\",t),n!==null&&(n===void 0?delete e.stopImmediatePropagation:Object.defineProperty(e,\"stopImmediatePropagation\",n))}var Tp={configurable:!0,get(){return _p(this)?.currentTarget}},Ep=[],Dp=[],Op=null;function kp(e,t,n){let r=n?t.captureKey:t.bubbleKey,i=(t.flags&zf)!==0||!n&&(t.flags&Bf)!==0,a=!1;for(let t=e;t<Ep.length;t++){let e=Ep[t],n=e[r],o=n!=null&&i&&e.disabled&&(e.localName===`button`||e.localName===`input`||e.localName===`select`||e.localName===`textarea`)?null:n;Dp[t]=o,o!=null&&(a=!0,jf!==null&&((Op??=[])[t]=jf.get(e)))}return a}function Ap(e){if(e.$$portalParent!=null||(R?.view(e)??e).parentNode===null)return;let t=(R?.view(e)??e).parentNode,n=Wf.get(t);if(n===void 0)return;let r,i=(R?.view(e)??e).previousSibling,a=n.size;for(;i!==null;){let o=i.$$portalEventStart,s=o?.$$portalEventRange;if(a!==0&&o!==void 0&&s!==void 0&&n.has(s)&&s.start===o&&s.end===i&&(R?.view(o)??o).parentNode===t){a--,i=(R?.view(o)??o).previousSibling;continue}let c=i.$$portalEventRange,l=c?.end;if(c!==void 0&&n.has(c)&&c.start===i&&l!=null&&(R?.view(l)??l).parentNode===t&&((R?.view(i)??i).compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)!==0&&((R?.view(e)??e).compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING)!==0){r=c;break}i=(R?.view(i)??i).previousSibling}r!==void 0&&(M!==null&&(N(e,`$$portalParent`,e.$$portalParent),N(e,`$$portalContainer`,e.$$portalContainer)),e.$$portalParent=r.host,e.$$portalContainer=t)}function jp(e,t){for(let n=0;n<e.length;n++){let r=Mp(e[n]);if(r===null)continue;Ap(r);let i=r.$$portalParent;for(;i!=null&&!Zf(i,t)&&e.indexOf(i)<0;)Ap(i),i=i.$$portalParent||(R?.view(i)??i).parentNode}}function Mp(e){return e!=null&&typeof e.nodeType==`number`?e:null}function Np(e,t,n=e.composedPath()){let r=Ep,i=r.length,a=e[Yf]??Jf,o=Gf!==0||a!==Jf,s=n.indexOf(t);if(s<0)return 0;if(Uf.size===1&&a===Jf&&Zf(t,a)){let e=0;for(;e<s;e++){let t=Mp(n[e]);if(t===null||o&&t.$$portalParent!=null)break;r.push(t)}if(e===s)return r.length-i;r.length=i}let c=Mp(n[0]);if(c===null)return 0;let l=0,u=!1;for(;;){r.length=i;let e=c,d=l,f=null,p=!1,m=!1;for(;e!==null;){if(Zf(e,a)&&!(e===c&&u)){f??=e,e===t&&(f===e?p=!0:m=!0);break}r.push(e);let s=o?e.$$portalParent:void 0;if(s!=null){let a=e.$$portalContainer;if(a==null)return r.length=i,0;f??=a,a===t&&(f===a?p=!0:m=!0),e=s,d=n.indexOf(s)}else e=d>=0?Mp(n[++d]):(R?.view(e)??e).parentNode}if(m)return r.length=i,0;if(p)return r.length-i;if(f===null)return r.length=i,0;let h=n.indexOf(f);if(h<l||h>=s||h===l&&u)return r.length=i,0;c=f,l=h,u=!0}}function Pp(e,t,n){let r=O,i=k;O=null,k=null;let a=()=>{if(typeof e==`function`){e(t);return}if(kf(e)){let n=e,r=n.args;if(typeof r!=`number`)switch(r.length){case 0:n.fn();break;case 1:n.fn(r[0]);break;case 2:n.fn(r[0],r[1]);break;default:n.fn.apply(null,r)}else r===1?n.fn(n.a0):r===2?n.fn(n.a0,n.a1):r===-1?n.fn(t,n.a0):n.fn(t,n.a0,n.a1);return}Fp(`${t.type} event`,e,t)};try{let e=n instanceof Zs||n instanceof Xs?Ln(n):n;e===void 0||fe()===e?a():he(e,a)}catch(e){Ip(e)}finally{O=r,k=i}}function Fp(e,t,n){if(t)throw Error(E(46,e,typeof t));t(n)}function Ip(e){if(typeof reportError==`function`){reportError(e);return}if(typeof window<`u`&&typeof ErrorEvent==`function`){let t=new ErrorEvent(`error`,{error:e,message:String(e?.message??e),cancelable:!0});window.dispatchEvent(t),t.defaultPrevented||console.error(e);return}console.error(e)}function Lp(e){fp===0&&(e.flags&Lf)!==0&&sm.length>0&&(!vr&&Cs()&&(eo?.queueAllTransition()===!0?Io():$o(Vp)),zm()),e.name===`click`&&(cm=null)}function Rp(e,t){if(!e.bubbles||e.cancelBubble||(t.flags&Nf)===0){e.bubbles&&(t.flags&Nf)!==0&&Vm(e,t),Lp(t);return}if((t.flags&Lf)===0)return;if(sm.length===0){if((t.flags&Rf)===0)return;let n=e.target?.localName;if(n!==`input`&&n!==`textarea`&&n!==`select`)return}let n=e[mp],r=()=>{e[mp]===n&&(Vm(e,t),Lp(t))};e.isTrusted?setTimeout(r,0):queueMicrotask(r)}function zp(e){let t=Hf.get(e.type)??$f.get(e.type);if(t===void 0)return;let n=(t.flags&Ff)!==0,r=n?Qf(e,this):void 0;e[mp]=(e[mp]||0)+1,Vm(e,t);let i=(t.flags&If)!==0;fp++;let a=e.target,o=Yp,s=e.type===`submit`&&a!=null&&a.nodeName===`FORM`?Jp(a,e):null;s!==null&&(Yp=s);let c=Jt(e),l=Ep.length,u,d=!1,f;try{if(n&&(t.flags&Pf)!==0&&(r??=e.composedPath(),Bp.call(this,e,r,t))||(t.flags&Nf)===0||a?.nodeType===1&&Bd(a)&&(t.flags&Vf)!==0||(Np(e,this,r),!kp(l,t,!1)&&s===null))return;u=Object.getOwnPropertyDescriptor(e,`stopPropagation`),d=!0,f=Cp(e,u,null);for(let t=l;t<Ep.length;t++){let n=Ep[t];if(i&&n!==e.target)break;let r=Dp[t];if(r!=null&&!De(e,n,!1)&&(Hp(e,n,f),Pp(r,e,Op?.[t]),f.flags&1)||i)break}s!==null&&Xp!==null&&!e.defaultPrevented&&Ep.includes(s.form,l)&&Xp(s.form,e,s.action,s.submitter)}finally{Ep.length=l,Dp.length=l,Op!==null&&(Op.length=l),d&&wp(e,u,null),s!==null&&(Yp=o,Zp(s)),d&&Up(e);try{Xt(e,c,!1,Ip)}catch(e){Ip(e)}fp--,Lp(t)}}function Bp(e,t,n=Hf.get(e.type)??$f.get(e.type)){if(t??=Qf(e,this),n===void 0||(n.flags&Pf)===0)return!1;t??=e.composedPath(),(!e.bubbles||(n.flags&Nf)===0)&&Vm(e,n);let r=Ep.length;Np(e,this,t);let i=kp(r,n,!0),a=i?Object.getOwnPropertyDescriptor(e,`stopPropagation`):void 0,o=i&&(n.flags&Ff)!==0?Object.getOwnPropertyDescriptor(e,`stopImmediatePropagation`):null,s=e.cancelBubble,c=!1;fp++;let l=Jt(e),u;try{if(i){u=Cp(e,a,o);for(let t=Ep.length-1;t>=r;t--){let n=Dp[t];if(n!=null&&!De(e,Ep[t],!0)&&(Hp(e,Ep[t],u),Pp(n,e,Op?.[t]),u.flags&1))break}}}finally{c=(u===void 0?i:u.flags!==0)||!s&&e.cancelBubble,Ep.length=r,Dp.length=r,Op!==null&&(Op.length=r),i&&(wp(e,a,o),Up(e));try{Xt(e,l,e.bubbles&&!e.cancelBubble&&(n.flags&Nf)!==0,Ip)}catch(e){Ip(e)}fp--,Rp(e,n)}return c}function Vp(){}function Hp(e,t,n){n.currentTarget=t,Object.defineProperty(e,\"currentTarget\",Tp)}function Up(e){delete e.currentTarget}var Wp={pending:!1,data:null,method:null,action:null},Gp=new WeakMap,Kp=new WeakMap;function qp(e,t){Gp.set(e,t);let n=Kp.get(e);if(n)for(let e of n)e()}function Jp(e,t){let n=t.submitter,r=e.$$formAction;if(n!=null){let e=n.$$formAction??(R?.view(n)??n).getAttribute(`formaction`);e!=null&&(r=e,n=null)}return{form:e,event:t,action:r,submitter:n??null,transitions:0,published:!1,intercepted:!1}}var Yp=null,Xp=null;function Zp(e){if(e.intercepted||e.transitions===0||!e.event.defaultPrevented)return;let t=e.form,n=null;try{n=new FormData(t);let r=e.event.submitter;r&&(R?.view(r)??r).name&&n.append((R?.view(r)??r).name,(R?.view(r)??r).value??``)}catch{}let r=t;r.$$pendingSubmits=(r.$$pendingSubmits||0)+1,e.published=!0,qp(t,{pending:!0,data:n,method:t.method||`get`,action:r.$$formAction??(R?.view(t)??t).getAttribute(`action`)})}function Qp(e){if(e.transitions--,e.transitions!==0||!e.published)return;let t=e.form;t.$$pendingSubmits=Math.max(0,(t.$$pendingSubmits||1)-1),t.$$pendingSubmits===0&&qp(e.form,Wp)}var $p=null;function em(e){try{e.reset(),Hm(e)}catch{}}function tm(){if($p===null||yr>0||br>0)return;let e=$p;$p=null;for(let t of e)em(t)}function nm(e,t,n,r){if(typeof n==`function`){(R?.view(e)??e).$$formAction=n,e.$$formSubmitWired||(e.$$formSubmitWired=!0,Xp=rm,sp([`submit`])),(R?.view(e)??e).removeAttribute(t);return}(R?.view(e)??e).$$formAction=void 0,Wd(e,t,n)}function rm(e,t,n,r){if(typeof n!=`function`)return;t.preventDefault(),Yp!==null&&Yp.form===e&&(Yp.intercepted=!0);let i=new FormData(e);r&&(R?.view(r)??r).name&&i.append((R?.view(r)??r).name,(R?.view(r)??r).value??``);let a=n,o=e;o.$$pendingSubmits=(o.$$pendingSubmits||0)+1,qp(e,{pending:!0,data:i,method:`post`,action:a});let s=a.$$isActionDispatcher===!0,c=t=>{if(o.$$pendingSubmits=Math.max(0,(o.$$pendingSubmits||1)-1),o.$$pendingSubmits===0&&qp(e,Wp),t&&!s)try{e.reset(),Hm(e)}catch{}},l;try{s?l=a(i):h_(()=>(l=a(i),l))}catch(e){c(!1),console.error(e);return}Promise.resolve(l).then(()=>c(!0),()=>c(!1))}var im=Symbol(`octane.uncontrolled`),am=[`input`,`change`,`click`],om=new Set(am),sm=[],cm=null,lm=null,um=[],dm=[],fm=[];function pm(e,t){t!==null&&(typeof t==`object`||typeof t==`function`)&&F?.recordStageEntry(t),e.push(t),M!==null&&Yi(()=>{let n=e.lastIndexOf(t);n!==-1&&e.splice(n,1)})}function mm(){return um.length>0||dm.length>0||fm.length>0}function hm(e,t){if(e.$$afSeen!==void 0||(e.$$afSeen=!0,!t))return;switch(e.localName){case`button`:case`input`:case`select`:case`textarea`:break;default:return}let n=H();(n===null||n.isFresh(e))&&pm(fm,e)}function gm(e){if(e.localName===`textarea`)return!0;if(e.localName!==`input`)return!1;switch((R?.view(e)??e).type){case`text`:case`search`:case`url`:case`tel`:case`password`:case`email`:case`number`:return!0}return!1}function _m(e){let t=e.currentTarget,n=t.$$ctrl;n!==void 0&&(n.compositionEndTask!==void 0&&n.compositionEndTask!==null&&(clearTimeout(n.compositionEndTask),n.compositionEndTask=null),n.composing=!0,(R?.view(t)??t).addEventListener(`blur`,vm))}function vm(e){let t=e.currentTarget,n=t.$$ctrl;if(n===void 0)return;(R?.view(t)??t).removeEventListener(`blur`,vm),n.compositionEndTask!==void 0&&n.compositionEndTask!==null&&clearTimeout(n.compositionEndTask),n.composing=!0;let r=()=>{n.compositionEndTask=null,n.composing=!1,Im(t)};n.compositionEndTask=e.type===`blur`?setTimeout(r,0):setTimeout(()=>{n.compositionEndTask=setTimeout(r,0)},0)}function ym(e){let t=(R?.view(e)??e).$$ctrl;return t===void 0?void 0:F?.projectControlled(t)??t}function bm(e){let t=ym(e);return t===void 0&&(t={v:im,c:-1,sv:null,sawV:!1,sawC:!1,sawDC:!1,dvv:im,composing:!1,compositionEndTask:void 0,queued:!1,formSeen:!1,formMultiple:!1},(R?.view(e)??e).$$ctrl=t,sp(am)),t}function xm(e){let t=ym(e);return t===void 0&&(t=bm(e)),t.compositionEndTask===void 0&&gm(e)&&(t.compositionEndTask=null,(R?.view(e)??e).addEventListener(`compositionstart`,_m),(R?.view(e)??e).addEventListener(`compositionend`,vm)),t}function Sm(e){return typeof e==`string`?e:typeof e==`function`||typeof e==`symbol`?``:String(e)}function Cm(e,t){return(R?.view(e)??e).type===`number`?t===0&&(R?.view(e)??e).value===``||(R?.view(e)??e).value!=t:(R?.view(e)??e).value!==Sm(t)}function wm(e,t){O?.block.idState.renderOwner?.controlLeases?.has(e)&&Mu(!1);let n=e,r=xm(e);j!==null&&Pa(e,`value`,`defaultValue`);let i=!r.sawV;if(r.sawV=!0,t==null){r.v=im;return}let a=Sm(t);if(i){r.v=t;let i=H();if(i!==null&&!i.isFresh(e))return;(R?.view(n)??n).value!==a&&((R?.view(n)??n).value=a),(R?.view(n)??n).defaultValue=a;return}let o=r.v;if(r.v=t,!(r.composing&&Object.is(o,t))&&Cm(n,t)&&((R?.view(n)??n).value=a),(R?.view(n)??n).defaultValue!==a){let t=R===null&&e.localName===`textarea`?B(e):null;t!==null&&t.nodeType===3&&V(t)===null?z(t).data=a:(R?.view(n)??n).defaultValue=a}}function Tm(e,t,n){let r=!n.sawC;if(n.sawC=!0,t==null){n.c=-1;return}let i=!!t;if(lm??=Lm,r){n.c=i;let t=H();if(t!==null&&!t.isFresh(e)){(R?.view(e)??e).checked=(R?.view(e)??e).checked,n.sawDC=!0;return}(R?.view(e)??e).checked=i,(R?.view(e)??e).defaultChecked=i,n.sawDC=!0;return}let a=i!==n.c;n.c=i,(a||!Em(e))&&(R?.view(e)??e).checked!==i&&((R?.view(e)??e).checked=i)}function Em(e){let t=cm;return t===null?!1:e===t||(R?.view(e)??e).type===`radio`&&(R?.view(t)??t).type===`radio`&&(R?.view(e)??e).name!==``&&(R?.view(e)??e).name===(R?.view(t)??t).name&&(R?.view(e)??e).form===(R?.view(t)??t).form&&((R?.view(e)??e).form!==null||(R?.view(e)??e).getRootNode()===(R?.view(t)??t).getRootNode())}function Dm(e,t){let n=xm(e);j!==null&&Pa(e,`checked`,`defaultChecked`),Tm(e,t,n)}function Om(e,t){let n=e,r=xm(e);if(j!==null&&(Ma(r),ja()),r.sawV,r.sawV=!0,t==null){r.sv=null;return}if((R?.view(n)??n).multiple){if(!Array.isArray(t))return;let e=new Set;for(let n=0;n<t.length;n++)e.add(Sm(t[n]));r.sv=e}else{if(Array.isArray(t))return;r.sv=Sm(t)}let i=H();(i===null||i.isFresh(e))&&(km(n,r.sv,!1),r.queued||(r.queued=!0,pm(um,n)))}function km(e,t,n){let r=(R?.view(e)??e).options;if(j!==null)for(let e=0;e<r.length;e++)Ra(r[e],n);if(typeof t!=`string`){for(let e=0;e<r.length;e++){let i=r[e],a=t.has((R?.view(i)??i).value);(R?.view(i)??i).selected!==a&&((R?.view(i)??i).selected=a),n&&((R?.view(i)??i).defaultSelected=a)}return}let i=null;for(let e=0;e<r.length;e++){let a=r[e];if((R?.view(a)??a).value===t){(R?.view(a)??a).selected=!0,n&&((R?.view(a)??a).defaultSelected=!0);return}i===null&&!(R?.view(a)??a).disabled&&(i=a)}i!==null&&((R?.view(i)??i).selected=!0)}function Am(e,t,n){let r=xm(e),i=H();if(e.localName===`select`){let n=r.dvv===im,a=(R?.view(e)??e).multiple,o=r.formMultiple!==a;if(n||o){if(j!==null&&(Ma(r),ja()),r.dvv=t,r.formMultiple=a,i!==null&&!i.isFresh(e))return;t==null?o&&km(e,a?new Set:``,!1):pm(dm,{el:e,value:t})}return}let a=n??!r.sawV,o=r.dvv;j!==null&&Ma(r),r.sawV=!0,r.dvv=t;let s=i!==null&&!i.isFresh(e);if(r.v!==im)return;let c=e;if(t==null){o!==im&&o!=null&&(j!==null&&Fa(c),e.localName===`input`?(R?.view(c)??c).removeAttribute(`value`):(R?.view(c)??c).defaultValue=``);return}let l=Sm(t);a&&!s&&(R?.view(c)??c).value!==l&&(j!==null&&Pa(e,`value`,`defaultValue`),(R?.view(c)??c).value=l),((R?.view(c)??c).defaultValue!==l||l===``&&e.localName===`input`&&!(R?.view(c)??c).hasAttribute(`value`))&&(j!==null&&Fa(c),(R?.view(c)??c).defaultValue=l)}var jm=Symbol(`octane.defaultValue`),Mm=Symbol(`octane.defaultCheckedInitialized`);function Nm(e,t){let n=xm(e),r=e,i=H(),a=i!==null&&!i.isFresh(e),o=!n.sawDC;if(o&&(j!==null&&(Ma(n),ja()),n.sawDC=!0),a){o&&((R?.view(r)??r).checked=(R?.view(r)??r).checked);return}if(n.c!==-1||(o&&!(Mm in r)&&(j!==null&&(j.push(Oi,r,`checked`,(R?.view(r)??r).checked),(R?.view(r)??r).type===`radio`&&(R?.view(r)??r).name!==``&&t&&La(r)),(R?.view(r)??r).checked=t==null?(R?.view(r)??r).checked:!!t),t==null))return;let s=!!t;(R?.view(r)??r).defaultChecked!==s&&(j!==null&&((R?.view(r)??r).type===`radio`&&(R?.view(r)??r).name!==``&&La(r),Xa(r,`checked`)),(R?.view(r)??r).defaultChecked=s)}function Pm(e,t,n,r,i,a,o){let s=xm(e),c=!s.formSeen,l=s.formMultiple;if(j!==null&&(Ma(s),ja()),s.formSeen=!0,t===`input`){let t=e,o=r==null?null:Sm(r);wm(t,n),n??Am(t,o,c),Dm(t,i),i==null&&(a!=null||c)&&Nm(t,a);return}if(t===`textarea`){let t=e;wm(t,n),n??(r==null?!c&&(R?.view(t)??t).defaultValue!==``&&((R?.view(t)??t).defaultValue=``):Am(t,r,c));return}let u=e,d=typeof o,f=!!o&&d!==`function`&&d!==`symbol`;if(s.formMultiple=f,(R?.view(u)??u).multiple!==f){if(j!==null){for(let e=0;e<(R?.view(u)??u).options.length;e++)Ra((R?.view(u)??u).options[e],!1);j.push(Oi,u,`multiple`,(R?.view(u)??u).multiple)}(R?.view(u)??u).multiple=f}!c&&l!==f&&n==null&&(r==null?km(u,f?new Set:``,!1):s.dvv=im),Om(u,n),r==null?c&&(s.dvv=void 0):Am(u,r)}function Fm(){if(fm.length>0){let e=fm;fm=[];for(let t=0;t<e.length;t++)z(e[t]).isConnected&&z(e[t]).focus()}if(dm.length>0){let e=dm;dm=[];for(let t=0;t<e.length;t++){let n=e[t].el,r=n.$$ctrl;if(r!==void 0&&r.sv!==null)continue;let i=e[t].value,a=(R?.view(n)??n).multiple?Array.isArray(i)?new Set(i.map(Sm)):null:Sm(i);a!==null&&km(n,a,!0)}}if(um.length>0){let e=um;um=[];for(let t=0;t<e.length;t++){let n=e[t].$$ctrl;n!==void 0&&(n.queued=!1,n.sv!==null&&km(e[t],n.sv,!1))}}}function Im(e){let t=e.$$ctrl;if(t!==void 0&&!t.composing&&(R?.view(e)??e).isConnected){if(e.localName===`select`){t.sv!==null&&km(e,t.sv,!1);return}lm?.(e,t),t.v!==im&&Cm(e,t.v)&&((R?.view(e)??e).value=Sm(t.v))}}function Lm(e,t){t.c!==-1&&((R?.view(e)??e).checked!==t.c&&((R?.view(e)??e).checked=t.c),(R?.view(e)??e).type===`radio`&&(R?.view(e)??e).name!==``&&Rm(e))}function Rm(e){let t=(R?.view(e)??e).name,n=Ia(e);for(let r=0;r<n.length;r++){let i=n[r];if(i===e||i.localName!==`input`||(R?.view(i)??i).type!==`radio`||(R?.view(i)??i).name!==t||(R?.view(i)??i).form!==(R?.view(e)??e).form)continue;let a=i.$$ctrl;a!==void 0&&a.c!==-1&&(R?.view(i)??i).checked!==a.c&&((R?.view(i)??i).checked=a.c)}}function zm(){let e=sm;sm=[];for(let t=0;t<e.length;t++)Im(e[t])}function Bm(e,t){switch(t.length){case 5:if(t!==`value`)return!1;break;case 7:if(t!==`checked`)return!1;break;default:return!1}let n=e.localName;return n===`input`||n===`textarea`||n===`select`}function Vm(e,t){let n=e.target;if(n===null||n.$$ctrl===void 0||(t.flags&Rf)===0)return;let r=n.$$ctrl;if(e.type===`input`&&r.compositionEndTask!==void 0){let t=e,i=t.inputType;t.isComposing===!0||i===`insertCompositionText`||i===`deleteCompositionText`?(r.compositionEndTask!==null&&(clearTimeout(r.compositionEndTask),r.compositionEndTask=null),r.composing||n.addEventListener(`blur`,vm),r.composing=!0):r.composing&&typeof t.isComposing==`boolean`&&(r.compositionEndTask!==null&&(clearTimeout(r.compositionEndTask),r.compositionEndTask=null),n.removeEventListener(`blur`,vm),r.composing=!1)}let i=n.localName===`input`&&(n.type===`checkbox`||n.type===`radio`);if(e.type===`click`){i&&(r.c!==-1&&(cm=n),n.$$checkableActivation=!0,setTimeout(()=>{n.$$checkableActivation===!0&&(n.$$checkableActivation=!1,n===cm&&(cm=null),Im(n))},0));return}if(n===cm&&(cm=null),e.type===`input`&&n.localName===`select`){n.$$selectPick=!0,setTimeout(()=>{n.$$selectPick===!0&&(n.$$selectPick=!1,Im(n))},0);return}e.type===`input`&&i&&n.$$checkableActivation===!0||(e.type===`change`&&(i&&(n.$$checkableActivation=!1),n.localName===`select`&&(n.$$selectPick=!1)),sm.indexOf(n)===-1&&sm.push(n))}function Hm(e){let t=e.elements;for(let e=0;e<t.length;e++)t[e].$$ctrl!==void 0&&Im(t[e])}function Um(e,t){if(F?.stageAction(()=>Um(e,t))===!0)return;let n=Wf.get(e);n===void 0&&(n=new Set,Wf.set(e,n),Gf++,Jf++),n.add(t),t.start.$$portalEventRange=t,t.end.$$portalEventStart=t.start}function Wm(e,t){if(F?.stageAction(()=>Wm(e,t),!0)===!0)return;let n=t.start,r=t.end;n?.$$portalEventRange===t&&delete n.$$portalEventRange,r?.$$portalEventStart===n&&delete r.$$portalEventStart;let i=Wf.get(e);i!==void 0&&(i.delete(t),i.size===0&&(Wf.delete(e),Gf--,Jf++))}function Gm(e,t,n){let r=e.fragmentOwners;if(r!==void 0){if(e.fragmentAnchor===n){if(!Array.isArray(r)&&!Array.isArray(t)&&r===t)return;if(Array.isArray(r)&&Array.isArray(t)&&r.length===t.length){let e=!0;for(let n=0;n<r.length;n++)if(r[n]!==t[n]){e=!1;break}if(e)return}}Km(e)}if(e.fragmentOwners=t,e.fragmentAnchor=n,Array.isArray(t))for(let r of t)r._registerPortal(e,n);else t._registerPortal(e,n);r===void 0&&(e.block.cleanups??=[]).push(()=>Km(e))}function Km(e){let t=e.fragmentOwners,n=e.fragmentAnchor;if(t!==void 0&&n!==void 0){if(e.fragmentOwners=void 0,e.fragmentAnchor=void 0,Array.isArray(t))for(let r of t)r._unregisterPortal(e,n);else t._unregisterPortal(e,n)}}function qm(e,t,n){let r=null,i=null;for(let e of vo){let a=e._ownerBlock;(a===t||Ts(a,t))&&z(e._startMarker).parentNode===(R?.view(n)??n).parentNode&&(z(e._startMarker).compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0&&(z(e._endMarker).compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)!==0&&(r===null?r=e:(i??=[r]).push(e))}r!==null&&Gm(e,i??r,n)}function Jm(e,t,n,r,i,a,o,s=null){let c=H();if(c!==null)return c.suspend(()=>Jm(e,t,n,r,i,a,o,s));let l=Xm(r,i),u=e;if(u===null||u.target!==n||u.key!==s){u!==null&&Ym(u);let e=(R?.view(document)??document).createComment(`portal`),r=(R?.view(document)??document).createComment(`/portal`);e.$$portalEnd=r,(R?.view(n)??n).appendChild(e),(R?.view(n)??n).appendChild(r);let i=Qs(`portal`,t,n,e,r,l.body,l.props,o,dc);if(u={__kind:`portalSlotSlot`,block:i,target:n,key:s,host:a,start:e,end:r},Um(n,u),O_?.(i),lp(n),M!==null){let e=u;Yi(()=>{Wm(n,e),up(n)})}I(i)}else u.host!==a&&N(u,`host`,u.host),u.host=a,u.block.body!==l.body&&N(u.block,`body`,u.block.body),u.block.props!==l.props&&N(u.block,`props`,u.block.props),u.block.extra!==o&&N(u.block,`extra`,u.block.extra),u.block.body=l.body,u.block.props=l.props,u.block.extra=o,I(u.block);let d=V(u.start);if(u.interleavedFragment===void 0)for(;d!==null&&d!==u.end;)d.$$portalParent=a,d.$$portalContainer=n,d=V(d);else for(;d!==null&&d!==u.end;){let e=d.$$portalEnd;if(e!==void 0){d=gg(d,e);continue}d.$$portalParent=a,d.$$portalContainer=n,d=V(d)}return u}function Ym(e){let t=M;if(t!==null&&!t.aborted&&!Wi&&e.block?.mounted&&!ia(t,e.block)&&e.target!==null){na(e.target,e.start,e.end,()=>Ym(e));return}e.block&&=(L(e.block,!0),null),e.target&&=(Wm(e.target,e),up(e.target),null)}function Xm(e,t){return typeof e==`function`?{body:e,props:t}:e!=null&&e.$$kind===Mt&&typeof e.type==`function`?{body:e.type,props:e.props}:{body:Zm,props:e}}function Zm(e,t){Lg(t,0,t.parentNode,e,t.endMarker)}function Qm(e){return typeof e==`string`||typeof e==`number`?String(e):null}function $m(e,t,n=void 0){let r=Qm(n);return{$$kind:Nt,body:e,target:t,key:r,props:r===null?n:void 0}}var eh=new WeakSet;function th(e){return e.key!==null||eh.has(e)}var nh=new WeakSet,rh=Symbol(`octane.scopedChildren`);function ih(e){return e==null||typeof e!=`object`&&typeof e!=`function`?!1:e.key!==void 0}function ah(e){let t={};if(e==null)return t;for(let n in e)n!==`key`&&Ze.call(e,n)&&(t[n]=e[n]);return t}function oh(e){return e}var sh=Symbol(`octane.scopedValue`);function ch(){return this[sh]().type}function lh(){return this[sh]().props}function uh(){let e=this[sh](),t=e.key;return t===null&&eh.has(e)&&eh.add(this),t}function dh(){return this[sh]().ref}function fh(){return this[sh]().children}function ph(){return this[sh]().__octaneInvocationSite}var mh={type:{configurable:!0,enumerable:!0,get:ch},props:{configurable:!0,enumerable:!0,get:lh},key:{configurable:!0,enumerable:!0,get:uh},ref:{configurable:!0,enumerable:!0,get:dh},children:{configurable:!0,enumerable:!0,get:fh},__octaneInvocationSite:{configurable:!0,enumerable:!0,get:ph}};function hh(e){return gh(Il(e))}function gh(e){let t={$$kind:Mt};return Object.defineProperty(t,sh,{value:e}),Object.defineProperty(t,\"type\",mh.type),Object.defineProperty(t,\"props\",mh.props),Object.defineProperty(t,\"key\",mh.key),Object.defineProperty(t,\"ref\",mh.ref),Object.defineProperty(t,\"children\",mh.children),Object.defineProperty(t,\"__octaneInvocationSite\",mh.__octaneInvocationSite),t}function _h(e,t,n,r=Af){typeof t==`function`&&zt(t);let i=n??null,a=ih(i)?``+i.key:null,o=r.length>0,s=o?r.length===1?r[0]:r:i?.children;r.length>1&&Rh.add(r);let c=ah(i);o&&(c.children=s),Qe(t,c),s=c.children;let l={$$kind:Mt,type:t,props:c,key:a,ref:c.ref===void 0?null:c.ref,children:s??null};return e!==void 0&&(l.__octaneInvocationSite=e),a===null&&i!=null&&(typeof i==`object`||typeof i==`function`)&&`key`in i&&eh.add(l),oh(l)}function vh(e){return e!=null&&e.$$kind===Mt}function yh(e){return e!=null&&e.$$kind===Mt&&typeof e.type==`string`}function bh(e){let t;try{t=String(e)}catch{return`object with keys {`+Object.keys(e).join(`, `)+`}`}return t===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:t}function xh(e){let t=bh(e);return Error(E(3,t))}function Sh(e){let t=e===null?`null`:e===void 0?`undefined`:typeof e==`object`?bh(e):JSON.stringify(e);return Error(E(24,t))}var Ch=Symbol(`NO_KEY`);function wh(e,t,n,r,i,a,o,s,c,l,u){let d=wd,f=d!==null&&r===d.type;if(!f&&typeof r!=`function`&&typeof r!=`string`)throw Sh(r);let p=f?d.body:typeof r==`string`?Sg:r;f&&(s=!1,c=!1,!l&&o===void 0&&ih(i)&&(o=i.key,l=!0)),Eh(dc,e,t,n,p,r,i,typeof r==`string`?{$$kind:Mt,type:r,props:i,key:null,ref:i!=null&&i.ref!==void 0?i.ref:null,children:i==null?null:i.children}:i,a,o,s,c,l,u)}function Th(e,t,n,r,i,a,o,s,c,l,u){if(typeof r!=`function`)throw Sh(r);Eh(null,e,t,n,r,r,i,i,a,o,s,c,l,u)}function Eh(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(k?.pending&&!k.crossRenderUpdate)return;if(n===0&&t!==cc){let e=t.slots[0];if(e?.returnedOutput===!0){if(e.__kind===`componentSlotSlot`)lc(e,!1);else{let e=t.block;if(e.outputHandler(e,null,!0),e.disposed)return}}}let m=t.block,h=H();if(h!==null&&(c!=null&&h.isFresh(c)||h.isFresh(r))){h.suspend(()=>Eh(e,t,n,r,i,a,o,s,c,l,u,d,f,p));return}let g=t.slots[n],_=null;if(g===void 0){let e=null,i=null,o=!1,s=h===null?void 0:a[ze],p=h?.passthroughRanges===!0,v=p&&s!==`owner`;if(p&&s===`owner`&&(h.passthroughRanges=!1),!v&&d===!0&&jt(a,1)&&(d=!1),v)o=!0;else if(d===!0&&m!==null){let t=m.startMarker,n=m.endMarker;t!=null&&n!=null&&t!==n&&t.nodeType===8&&n.nodeType===8?(e=t,i=n,o=!0):t===null&&n===null&&(o=!0)}let y=null;if(!o&&h!==null&&h.isOpen(c??null))y=c,_=y;else if(!o&&h!==null&&!h.isOpen(c??null)){let e=h.node;(e===null||(R?.view(e)??e).parentNode!==r)&&(e=B(r)),_=e,e!==null&&h.isOpen(e)&&(y=e)}if(!o){if(y!==null)e=y,i=h.close(y),m===h.rootBlock&&h.claimRootRemainder(V(i)),h.node=V(e);else if(u===!0||u===2&&a.$$singleRoot===!0)e=null,i=null;else{if(h!==null){let e=_;Gn(t,n),dv(()=>Error(E(55)));let r=e;for(;r!==null&&r!==c&&!Ru(r);){let e=V(r);(R?.view(r)??r).remove(),r=e}}e=(R?.view(document)??document).createComment(`comp`),i=(R?.view(document)??document).createComment(`/comp`),(R?.view(r)??r).insertBefore(e,c??null),(R?.view(r)??r).insertBefore(i,c??null),h!==null&&(h.markFresh(e),h.markFresh(i),h.node=i)}}g={__kind:`componentSlotSlot`,start:e,end:i,anchor:c??null,singleRoot:e===null&&!o,inherited:o,block:null,currentComp:null,prevKey:Ch,keyed:f===!0||l!==void 0},t.slots[n]=g,xc(t,g)}let v=l===void 0?Ch:``+l,y=l!==void 0&&g.prevKey!==Ch&&v!==g.prevKey,b=a!==g.currentComp||y,x=M!==null&&g.block!==null&&b;if(x){if(g.inherited)Xi(g,r,g.start,g.end);else{let e=g.start??g.block.startMarker,t=g.end??g.block.endMarker;if(e!==null&&t!==null&&(R?.view(e)??e).parentNode===r&&(R?.view(t)??t).parentNode===r)Xi(g,r,(R?.view(e)??e).previousSibling,V(t));else{let e=g.anchor;Xi(g,r,e===null?(R?.view(r)??r).lastChild:(R?.view(e)??e).previousSibling,e)}}}if((f===!0||l!==void 0)&&!g.keyed&&(x||N(g,`keyed`,g.keyed),g.keyed=!0),y&&(g.currentComp=null),!x&&!Object.is(g.prevKey,v)&&N(g,`prevKey`,g.prevKey),g.prevKey=v,b){let o=hn||en?{parentScope:t,invocationSite:p,key:l,hasKey:l!=null}:void 0,c=g.block===null||!g.block.mounted||m.idState.renderOwner?.signalOwner===void 0?void 0:{parent:t,slot:n,kind:g.__kind,branch:void 0,component:a,key:v},u=xr,d=m.currentRenderMode===`transition`,f=u!==null&&g.block!==null&&g.block.mounted&&h===null,y=f&&x_(m),b=M===null||y?u:null,x=f&&!d&&y,S=x&&!d,C=M;if(C!==null&&!y&&h===null&&g.block!==null&&g.block.mounted&&!ia(C,g.block)){let t=g.block,n=t.startMarker,l=t.endMarker,u=g.inherited,d=u?g.start===null?B(r):V(g.start):g.start??n;u&&d===g.end&&(d=null);let f=u?d===null?null:g.end===null?(R?.view(r)??r).lastChild:z(g.end).previousSibling:g.end??l,p=d===null?u?g.start:null:f;if(p!==null&&(R?.view(p)??p).parentNode===r){let h=Oh(m,r,p,i,s,e,`dynamic`,void 0,!1,o,c);if(h.suspended||h.failed)throw Ph(h.wip),h.suspended===null?h.error:new Bl(h.suspended);z(h.wip.start).data=`comp`,z(h.wip.end).data=`/comp`,g.start=h.wip.start,g.end=h.wip.end,g.singleRoot=!1,g.inherited=!1,g.block=h.wip.block,g.currentComp=a,u||w_(m,n,l,h.wip.start,h.wip.end),Ah(h.wip),ta(t,r,d,f);return}}if(b!==null&&f&&(d||x)){if(!S&&!g.singleRoot&&!g.inherited&&g.end!==null){let t=b.render(m,r,g.end,i,s,e,`dynamic`,void 0,!1,o,c);if(t.suspended||t.failed)throw b.dispose(t.wip),t.failed?t.error:new Bl(t.suspended);z(t.wip.start).data=`comp`,z(t.wip.end).data=`/comp`;let n=g.block;g.start=t.wip.start,g.end=t.wip.end,g.block=t.wip.block,g.currentComp=a,b.splice(t.wip),L(n),m.disposed||g.block!==t.wip.block||t.wip.block.disposed;return}let t=g.end??g.anchor;if(t!==null){let n=b.render(m,r,t,i,s,e,`dynamic`,void 0,!1,o,c);if(b.dispose(n.wip),n.failed)throw n.error;if(n.suspended)throw new Bl(n.suspended)}}if(g.block){if(g.inherited){if(L(g.block),m.disposed)return;if(g.start===null)for(;B(r);)(R?.view(r)??r).removeChild(B(r))}else if(g.singleRoot){if(L(g.block),m.disposed)return}else{let e=V(g.end);if(L(g.block),m.disposed)return;let t=(R?.view(document)??document).createComment(`comp`),n=(R?.view(document)??document).createComment(`/comp`);(R?.view(r)??r).insertBefore(t,e),(R?.view(r)??r).insertBefore(n,e),g.start=t,g.end=n}}if(g.currentComp=a,g.singleRoot){let t=g.anchor?z(g.anchor).previousSibling:(R?.view(r)??r).lastChild,n=Qs(`dynamic`,m,r,null,g.anchor,i,s,void 0,e);o!==void 0&&Fn(n,o),g.block=n;try{I(n)}finally{if(h!==null&&_!==null&&(R?.view(_)??_).parentNode===r)n.startMarker=_,n.endMarker=_;else{let e=g.anchor?z(g.anchor).previousSibling:(R?.view(r)??r).lastChild;e!==null&&e!==t&&(n.startMarker=e,n.endMarker=e)}}}else{let t=Qs(`dynamic`,m,r,g.start,g.end,i,s,void 0,e);o!==void 0&&Fn(t,o),g.inherited&&(t.exclusiveMarkers=!0),g.block=t,I(t)}}else if(g.block){if(Wg(g.block,a,o))return;g.block.props!==s&&N(g.block,`props`,g.block.props),g.block.props=s,I(g.block)}h!==null&&!g.inherited&&g.end!==null&&(h.node=V(g.end))}function Dh(e){return e==null||e===!1||e===!0?``:String(e)}function Oh(e,t,n,r,i,a,o=`dynamic`,s,c=!1,l,u){let d=(R?.view(document)??document).createComment(`wip`),f=(R?.view(document)??document).createComment(`/wip`),p=V(n);(R?.view(t)??t).insertBefore(d,p),(R?.view(t)??t).insertBefore(f,p);let m=ho(),h=ns.length,g=P;P=m;let _=Qs(o,e,t,d,f,r,i,s,a);l!==void 0&&Fn(_,l),u!==void 0&&vn.set(_,u),c&&(_.$$implicitBail=!0,_.memoInChain=!0);let v=null,y=null,b=!1;try{I(_)}catch(e){Vl(e)?v=e.thenable:(y=e,b=!0)}finally{P=g}let x={block:_,start:d,end:f,capture:m,domParent:t,refDetachCheckpoint:h};if(v!==null&&u!==void 0){let t=e.idState.renderOwner,n=yn(e),r=n?.tryBlock??t?.current,i=n??t;if(i!==void 0&&r!=null){wn(_,r,i,!0);for(let e of M?.created??[])!e.disposed&&Ts(_,e)&&wn(e,r,i);x.retrySignalOwners=i.retrySignalOwners}}return{wip:x,suspended:v,error:y,failed:b}}function kh(e,t=!1){e.presentations!==void 0&&P!==null&&(P.presentations??=[]).push(...e.presentations),(P!==null||!t)&&D?.spliceCapture(e,P);let n=e.renderedBlocks;if(e.renderedBlocks=null,e.renderRoot=null,n!==null&&P!==null)for(let e of n)ic(P,e);for(let t=0;t<3;t++){let n=e.effects[t],r=P===null?ao[t]:P.effects[t];for(let e=0;e<n.length;e++)r.push(n[e])}let r=P===null?oo:P.events;for(let t=0;t<e.events.length;t++)r.push(e.events[t]);let i=P===null?so:P.eventActions;for(let t=0;t<e.eventActions.length;t++)i.push(e.eventActions[t]);let a=P===null?fo:P.refs;for(let t=0;t<e.refs.length;t++)a.push(e.refs[t]);if(e.detaches!==void 0){let t=P===null?ns:P.detaches??=[];for(let n of e.detaches)t.push(n)}let o=P===null?uo:P.stores;for(let t=0;t<e.stores.length;t++)o.push(e.stores[t]);if(e.suspenseCommits!==void 0)for(let t of e.suspenseCommits)mo(t);let s=e.renderCleanups;if(s!==void 0){if(e.renderCleanups=void 0,P!==null){let e=P.renderCleanups??=[];for(let t of s)e.push(t)}else for(let e of s)F?.stageAction(()=>e(!1))!==!0&&e(!1)}}function Ah(e){kh(e.capture)}function jh(e){if(e===null)return;D?.discardCapture(e);let t=e.renderedBlocks,n=e.renderRoot;if(e.renderedBlocks=null,e.renderRoot=null,t!==null)for(let e of t)rc(e,n);for(let t=0;t<e.stores.length;t++)e.stores[t].queued=!1;let r=e.renderCleanups;if(r!==void 0){e.renderCleanups=void 0;for(let e of r)e(!0)}}function Mh(e,t){let n=e.domParent,r=e.start;for(;r!==null;){let i=V(r);if((R?.view(n)??n).insertBefore(r,t),r===e.end)break;r=i}}function Nh(e,t){Mh(e,t),Ah(e)}function Ph(e){let t=P,n=_n;e.retrySignalOwners!==void 0&&(_n=e.retrySignalOwners),P=e.capture;try{L(e.block,!0)}finally{_n=n,P=t,ns.splice(e.refDetachCheckpoint),jh(e.capture)}}function Fh(e){let t=M;if(t!==null&&!t.aborted&&!Wi){if(e.block===null&&e.forSlot===null&&e.text===null&&e.hostNode===null)return;let t=e.ownerHost??z(e.start)?.parentNode??z(e.text)?.parentNode??z(e.hostNode)?.parentNode??e.block?.parentNode??null;if(t!==null){kg(e,t);let n=e.ownerHost!==null||e.borrowed&&e.start===null?B(t):e.start===null?e.text??e.hostNode:V(e.start),r=e.ownerHost===null?e.start!==null||e.borrowed?e.end:(R?.view(n)??n)?.nextSibling??null:null;n===r&&(n=null);let i=n===null?null:r===null?(R?.view(t)??t).lastChild:(R?.view(r)??r).previousSibling,a=e.block,o=e.forSlot,s=e.hostNode;if(a!==null)ta(a,t,n,i);else{if(o!==null){for(let e=o.head;e!==null;e=e.nextSibling)ea(e);o.emptyBlock!==null&&ea(o.emptyBlock)}na(t,n,i,()=>{if(o!==null){for(let e=o.head;e!==null;e=e.nextSibling)L(e,!1);o.emptyBlock!==null&&L(o.emptyBlock,!1)}else s!==null&&U(s,null)})}e.block=null,e.forSlot=null,e.text=null,e.hostNode=null,e.currentComp=null,e.ownerHost!==null&&(e.start=null,e.end=null);return}}let n=e.block!==null;if(e.block!==null&&(L(e.block,!1),e.block=null),e.ownerHost!==null){let t=e.ownerHost,r=B(t);for(;r!==null;){let e=V(r);n||U(r,null),(R?.view(t)??t).removeChild(r),r=e}e.start=null,e.end=null}else if(e.start!==null){let t=z(e.start).parentNode;if(t!==null){let r=V(e.start);for(;r!==null&&r!==e.end;){let e=V(r);n||U(r,null),(R?.view(t)??t).removeChild(r),r=e}}}else e.text===null?e.hostNode!==null&&z(e.hostNode).parentNode!==null&&(U(e.hostNode,null),z(z(e.hostNode).parentNode).removeChild(e.hostNode)):z(e.text).remove();e.text=null,e.currentComp=null,e.hostNode=null}function Ih(e,t){if(M!==null&&!Wi){let n=e.ownerHost??z(e.start)?.parentNode??t.parentNode,r=e.ownerHost===null?z(e.start)?.nextSibling??null:B(n),i=e.ownerHost===null?e.end:null;r===i&&(r=null);let a=r===null?null:i===null?(R?.view(n)??n).lastChild:(R?.view(i)??i).previousSibling;ta(t,n,r,a);return}if(L(t,!1),e.ownerHost!==null){let t=B(e.ownerHost);for(;t!==null;){let n=V(t);z(e.ownerHost).removeChild(t),t=n}}else if(e.start!==null){let t=z(e.start).parentNode;if(t!==null){let n=V(e.start);for(;n!==null&&n!==e.end;){let e=V(n);(R?.view(t)??t).removeChild(n),n=e}}}}function Lh(e,t){let n=e!=null&&e.$$kind===Mt;return e?.$$kind===Nt&&e.key!=null||n&&e.key!=null&&!nh.has(e)||n&&e.key!=null?e.key:t}var Rh=new WeakSet;function zh(e,t){return e!=null&&(e.$$kind===Mt||e.$$kind===Nt)&&e.key!=null?e.key:t}var Bh=!1;function Vh(e){Bh=!0;let t=e;for(;t!==null&&!t.deoptRefs;)t.deoptRefs=!0,t=t.parentBlock}function Hh(e,t,n,r){let i=sf(e,t);if(i!==null){nm(e,i,n,void 0);return}if(t===`ref`)n!=null&&(Vh(r),ts(r,n,e));else if(t===`className`||t===`class`)Jd(e,n);else if(t===`style`)Xd(e,n,void 0);else{let r=rf(t,e);r===null?Wd(e,t,n):(Mf(e,r.key,n),r.capture?$f.has(r.type)||cp([r.type]):Hf.has(r.type)||sp([r.type]))}}function Uh(e){if(e==null||e.dangerouslySetInnerHTML==null)return!1;if(fd(e.dangerouslySetInnerHTML),e.children!=null)throw dd();return!0}function Wh(e){return Uh(e.props)||e.type===`textarea`&&(e.props?.value!=null||e.props?.defaultValue!=null)}function Gh(e){(R?.view(e)??e).checked=(R?.view(e)??e).checked,(R?.view(e)??e)[Mm]=!0}function Kh(e,t,n){if(t==null){e.localName===`input`&&Gh(e);return}let r=e.localName===`input`;for(let i in t){if(i===`key`||i===`children`)continue;if(i===`suppressHydrationWarning`){e.__oct_suppress=t[i]===!0;continue}let a=t[i];r&&(i===`defaultChecked`||i===`checked`&&a!=null)&&(r=!1),Hh(e,i,a,n)}r&&Gh(e)}function qh(e,t,n,r){let i=t?.ref,a=n?.ref;if(i!=null&&i!==a&&rs(i,e),t!=null)for(let r in t)r!==`key`&&r!==`children`&&r!==`ref`&&(n==null||!(r in n))&&af(e,r,t[r]);if(n!=null)for(let i in n){if(i===`key`||i===`children`)continue;if(i===`suppressHydrationWarning`){e.__oct_suppress=n[i]===!0;continue}let a=n[i];if(t==null||t[i]!==a||Bm(e,i)){if(i===`autoFocus`&&!Bd(e))continue;i===`style`?Xd(e,a,t?.style):Hh(e,i,a,r)}}}var Jh=Symbol(`octane.deoptDesc`);function Yh(e){let t=B(e);for(;t!==null;){let e=t.$$portalEnd;if(e!=null){t=gg(t,e);continue}if(t.$$deoptKey!==void 0||Xh(t)!==void 0)return!0;t=V(t)}return!1}function Xh(e){return(R?.view(e)??e)[Jh]}function Zh(e,t,n){return e!==void 0&&e.type===t.type&&e.props===t.props&&e.key===t.key&&e.ref===t.ref&&e.children===n}function Qh(e,t){let n=t[sh];if(n===void 0&&t[rh]===void 0)return!0;let r=n===void 0?t:n(),i=e.deoptNode===null?void 0:Xh(e.deoptNode);return i===r||Zh(i,r,r.children)}function $h(e,t){let n=t[sh],r=n===void 0?t:n();if(r[rh]!==void 0){let t=r.children,n=Xh(e);r=Zh(n,r,t)?n:{$$kind:Mt,type:r.type,props:r.props,key:r.key,ref:r.ref,children:t}}j!==null&&j.push(Oi,e,Jh,Xh(e)),(R?.view(e)??e)[Jh]=r}function eg(e){return vh(e)&&e.type===Cd}function tg(e){let t=e.children;return t==null?[]:Array.isArray(t)?t:[t]}function ng(e){return{$$kind:Mt,type:rg,props:e,key:e.key,ref:null,children:null}}function rg(e,t){let n=t.block,r=n.slots[1];if(r===void 0){let i=H(),a,o,s=i?.node;if(s?.nodeType===8&&(R?.view(s)??s).data===`frag`){a=s;let e=1,t=V(a);for(;t!==null;){if(t.nodeType===8){if((R?.view(t)??t).data===`frag`)e++;else if((R?.view(t)??t).data===`/frag`&&--e===0)break}t=V(t)}if(t===null)throw Error(E(50));o=t,i.node=V(a)}else a=(R?.view(document)??document).createComment(`frag`),o=(R?.view(document)??document).createComment(`/frag`),z(n.parentNode).insertBefore(a,n.endMarker),z(n.parentNode).insertBefore(o,n.endMarker);r=Nd(t,a,o,e.ref),n.slots[0]={a:r},n.slots[1]=r,n.refFields=[`f`,`a`,``]}else r._currentRef!==e.ref&&(N(r,`_currentRef`,r._currentRef),r._currentRef!=null&&rs(r._currentRef,r),e.ref!=null&&ts(t,e.ref,r),r._currentRef=e.ref);Lg(t,2,n.parentNode,e.children,r._endMarker);let i=H();i!==null&&(i.node=V(r._endMarker))}function ig(e){return Rh.has(e)?`fragment`:`array`}var ag=JSON.stringify,og=String;function sg(e){if(JSON.stringify!==ag||`toJSON`in e)return null;for(let t=0;t<e.length;t++){let n=typeof e[t];if(n!==`string`&&n!==`number`)return null}return`[`+JSON.stringify(e)+`,`}function cg(e,t,n,r,i,a){let o=(vh(n)||n?.$$kind===Nt)&&n.key!=null;return t.length===0?(e.push(o?`k`+String(i):r),a):a!==null&&(!o||typeof i==`string`&&String===og)&&JSON.stringify===ag&&!(`toJSON`in t)&&(a===void 0&&(a=sg(t)),a!==null)?(e.push(o?a+`\"key\",`+JSON.stringify(String(i))+`]`:a+`\"index\",`+r+`]`),a):(e.push(JSON.stringify([t,o?`key`:`index`,o?String(i):r])),null)}function lg(e,t,n,r,i){let a=r===`fragment`?zh:Lh,o=n.length,s=o>1?void 0:null;for(let c=0;c<o;c++){let l=n[c];if(eg(l)){if(l.ref!=null||Ze.call(l.props,`ref`)){e.push(ng(l)),s=cg(t,i,l,c,a(l,c),s);continue}let n=tg(l);l.key==null?lg(e,t,n,`fragment`,r===`fragment`?[...i,`wrapper`,o===1?0:c]:o===1?i:[...i,`position`,c,`fragment`]):lg(e,t,n,`fragment`,[...i,`keyed-fragment`,l.key]);continue}if(Array.isArray(l)){let n=ig(l);lg(e,t,l,n,n===r?[...i,`wrapper`,o===1?0:c]:o===1?i:[...i,`position`,c,n]);continue}e.push(l),s=cg(t,i,l,c,a(l,c),s)}}function ug(e,t){return(vh(e)||e?.$$kind===Nt)&&e.key!=null?`k`+String(t):0}function dg(e,t=!1,n=!0){if(eg(e)){if(e.ref!=null||Ze.call(e.props,`ref`))return{items:[ng(e)],keys:[ug(e,e.key??0)]};let t=[],n=[],r=e.key==null?[]:[`keyed-fragment`,e.key];return lg(t,n,tg(e),`fragment`,r),{items:t,keys:n}}if(Array.isArray(e)){let t=[],n=[];return lg(t,n,e,ig(e),[]),{items:t,keys:n}}return n&&vh(e)&&e.key!=null?{items:[e],keys:[ug(e,e.key)]}:t?{items:[e],keys:[ug(e,zh(e,0))]}:null}function fg(e){if(e==null||typeof e==`string`||Array.isArray(e)||vh(e))return null;let t=$e(e);if(t===null)return null;let n=[],r=t.call(e),i;for(;!(i=r.next()).done;)n.push(i.value);return n}function pg(e,t,n,r){if(n==null||n===!1||n===!0||n===``)return;if(Array.isArray(n)){let i=Rh.has(n)?zh:Lh;for(let a=0;a<n.length;a++){let o=n[a];if(Array.isArray(o))pg(e,t,o,r+`:`+a);else if(o!=null&&o!==!1&&o!==!0&&o!==``){e.push(o);let n=i(o,a);if(r===``)t.push(typeof n==`string`&&n[0]===`:`?`:`+n:n);else{let e=o?.$$kind===Mt&&o.key!=null;t.push(r+`:`+(e?`k`:`i`)+String(n))}}}return}e.push(n);let i=n?.$$kind===Mt&&n.key!=null?n.key:0;t.push(r===``?typeof i==`string`&&i[0]===`:`?`:`+i:i:r+`:i0`)}function mg(e,t,n,r){if(t==null||t===!1||t===!0||t===``)return null;let i=typeof t;if(i===`string`||i===`number`||i===`bigint`){let n=String(t);if(e!==null&&e.nodeType===3){let t=H();return t!==null&&!t.isFresh((R?.view(e)??e).parentNode)?t.htextSwap(e,n):(Uu(e,n),e)}return(R?.view(document)??document).createTextNode(n)}if(yh(t)){let i=Vd(t.type,r),a;return e!==null&&e.nodeType===1&&e.localName===t.type&&e.namespaceURI===(i??zd)?(a=e,qh(a,Xh(a)?.props??null,t.props,n)):(a=i===void 0?(R?.view(document)??document).createElement(t.type):(R?.view(document)??document).createElementNS(i,t.type),H()?.markFresh(a),Kh(a,t.props,n)),$h(a,t),Wh(t)||hg(a,t.children,n),a}if(vh(t))throw Error(E(25));if(i===`object`)throw xh(t);return null}function hg(e,t,n){let r=typeof t;if(r===`string`&&t!==``||r===`number`||r===`bigint`){let n=B(e);if(n!==null&&n.nodeType===3&&V(n)===null&&n.$$deoptKey===0&&n.$$portalEnd==null){let r=H();r!==null&&!r.isFresh(e)?r.htextSwap(n,String(t)):Uu(n,String(t));return}}if((t==null||r===`boolean`||t===``)&&B(e)===null)return;let i=Hd(e),a=[],o=[];pg(a,o,t,``);let s=B(e),c=M!==null&&(R?.view(e)??e).parentNode!==null&&(n.mounted||M.hydrating||M.retainedCreated?.has(n));if(s===null){for(let t=0;t<a.length;t++){let r=mg(null,a[t],n,i);r!==null&&(c&&Qi(e),r.$$deoptKey=o[t],(R?.view(e)??e).appendChild(r))}return}if(a.length===0&&H()===null&&!Yh(e))return;let l=[],u=!1,d,f=null,p=[],m=s;for(;m!==null;){let e=m.$$portalEnd;if(e!=null){u=!0,m=gg(m,e);continue}let t=m.$$deoptKey,n=t===void 0?Xh(m):void 0;if(t===void 0&&n===void 0&&!(d??=H()!==null)){u=!0,m=V(m);continue}l.push(m);let r=t??n?.key;if(r!=null&&(f===null&&(f=new Map),!f.has(r))){f.set(r,m),m=V(m);continue}p.push(m),m=V(m)}let h=0,g=[];for(let e=0;e<a.length;e++){let t=a[e],r=o[e],s=null;f!==null&&(s=f.get(r)??null,s!==null&&f.delete(r)),s===null&&h<p.length&&(s=p[h++]);let c=mg(s,t,n,i);c!==null&&(c.$$deoptKey=r,g.push(c))}let _=g.length>0?new Set(g):null;for(let t=l.length-1;t>=0;t--){let r=l[t];if(_===null||!_.has(r)){let t=H();t!==null&&!t.isFresh(e)&&dv(()=>Error(E(62)),n),c?(Qi(e),na(e,r,r,()=>U(r,null))):(U(r,null),(R?.view(e)??e).removeChild(r))}}let v=B(e);for(let t=0;t<g.length;t++){let n=g[t],r=u?_g(v,d===!0):v;r!==n&&(c&&Qi(e),Uo===null?(R?.view(e)??e).insertBefore(n,r):(Yo(e,Uo),tv(e,n,r,Uo))),v=V(n)}}function gg(e,t){let n=e;for(;n!==null&&n!==t;)n=V(n);return V(n??e)}function _g(e,t){for(;e!==null;){let n=e.$$portalEnd;if(n!=null){e=gg(e,n);continue}if(!t&&e.$$deoptKey===void 0&&Xh(e)===void 0){e=V(e);continue}return e}return null}function vg(e,t){let n=t.block,r=H(),i=t.slots[0],a=yh(e)&&i?.__kind===`childSlot`&&i.currentComp===xg||bg(e),o=n.startMarker;if(o!==null&&o===n.endMarker&&o.nodeType!==8&&(R?.view(o)??o).parentNode!==null&&(a||!yh(e))){let e=(R?.view(o)??o).parentNode;M!==null&&(Zi(e,(R?.view(o)??o).previousSibling,V(o)),N(n,`startMarker`,n.startMarker),N(n,`endMarker`,n.endMarker));let t=(R?.view(document)??document).createComment(`it`),r=(R?.view(document)??document).createComment(`/it`);(R?.view(e)??e).insertBefore(t,o),(R?.view(e)??e).insertBefore(r,V(o)),n.startMarker=t,n.endMarker=r}if(a){let i=n.deoptNode,a=null;if(i!=null){if(N(n,`deoptNode`,n.deoptNode),t.slots[0]===void 0&&i.nodeType===1&&yh(e)&&i.localName===e.type&&(R?.view(i)??i).parentNode===n.parentNode)a=i;else if((R?.view(i)??i).parentNode===n.parentNode){if(M!==null)Zi(n.parentNode,(R?.view(i)??i).previousSibling,V(i)),na(n.parentNode,i,i,()=>U(i,null));else{U(i,null);let e=n.parentNode;(R?.view(e)??e).removeChild(i)}}n.deoptNode=null}if(r!==null&&t.slots[0]===void 0&&r.isOpen(n.startMarker)){let e={__kind:`childSlot`,start:n.startMarker,end:n.endMarker,ownerHost:null,borrowed:!0,compactable:!1,block:null,text:null,currentComp:null,currentIsBodyFn:!1,forSlot:null,hostNode:null,portal:null};t.slots[0]=e,xc(t,e)}if(r===null&&t.slots[0]===void 0&&n.startMarker!==null&&n.endMarker!==null&&n.startMarker!==n.endMarker&&n.startMarker.nodeType===8&&n.endMarker.nodeType===8){let e={__kind:`childSlot`,start:n.startMarker,end:n.endMarker,ownerHost:null,borrowed:!0,compactable:!1,block:null,text:null,currentComp:null,currentIsBodyFn:!1,forSlot:null,hostNode:a,portal:null};t.slots[0]=e,xc(t,e)}else if(a!==null&&(R?.view(a)??a).parentNode!==null){U(a,null);let e=(R?.view(a)??a).parentNode;(R?.view(e)??e).removeChild(a)}Lg(t,0,n.parentNode,e,n.endMarker,void 0,void 0,void 0,!1);return}t.slots[0]!==void 0&&t.slots[0]!==null&&t.slots[0].__kind===`childSlot`&&Lg(t,0,n.parentNode,null,n.endMarker);let s=n.endMarker,c=n.deoptNode;if(c===null&&r!==null){let e=n.startMarker;c=e==null?null:V(e),c===s&&(c=null)}let l=mg(c,e,n,Hd(n.parentNode));if(l!==c){if(N(n,`deoptNode`,n.deoptNode),c!=null&&c!==l&&(R?.view(c)??c).parentNode===n.parentNode){if(M!==null&&Zi(n.parentNode,(R?.view(c)??c).previousSibling,V(c)),l!==null){let e=n.parentNode;(R?.view(e)??e).insertBefore(l,c)}if(M!==null){let e=c;na(n.parentNode,e,e,()=>U(e,null))}else{U(c,null);let e=n.parentNode;(R?.view(e)??e).removeChild(c)}}else if(l!==null){M!==null&&n.mounted&&Zi(n.parentNode,(R?.view(s)??s)?.previousSibling??z(n.parentNode).lastChild,s);let e=n.parentNode;(R?.view(e)??e).insertBefore(l,s)}c!==null&&n.startMarker===c&&(N(n,`startMarker`,n.startMarker),N(n,`endMarker`,n.endMarker),n.startMarker=l,n.endMarker=l)}n.deoptNode=l}function yg(e,t){let n=t.slots[0],r=t.block;if(vh(e)&&typeof e.type==`function`){if(n===void 0||n.__kind===`componentSlotSlot`){let n=r.deoptNode;n!==null&&(U(n,null),(R?.view(n)??n).parentNode===r.parentNode&&z(r.parentNode).removeChild(n),r.deoptNode=null),wh(t,0,r.parentNode,e.type,e.props,r.endMarker,void 0,!0,!0,void 0,e.__octaneInvocationSite);return}}else if(n?.__kind===`componentSlotSlot`){let e=r.startMarker;if(e!==null&&e===r.endMarker&&e.nodeType!==8&&(R?.view(e)??e).parentNode!==null){let t=(R?.view(document)??document).createComment(`it`),n=(R?.view(document)??document).createComment(`/it`);z((R?.view(e)??e).parentNode).insertBefore(t,e),z((R?.view(e)??e).parentNode).insertBefore(n,V(e)),r.startMarker=t,r.endMarker=n}fc(r,n),r.deoptNode=null}vg(e,t)}function bg(e){if(typeof e==`function`)return!0;if(typeof e!=`object`||!e)return!1;if(typeof e.then==`function`)return!0;if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(bg(e[t]))return!0;return!1}return!vh(e)&&$e(e)!==null?!0:e.$$kind===Mt?e.type===Cd||wd!==null&&e.type===wd.type||typeof e.type==`function`||bg(e.children):e.$$kind===Nt}function xg(e,t){let n=t.deoptNode,r=H(),i=Vd(e.type,Hd(t.parentNode));if(n===null&&r!==null&&r.node!==null&&r.node.nodeType===1&&r.node.localName===e.type&&(i===void 0||r.node.namespaceURI===i)){n=r.node,t.deoptNode=n,Kh(n,e.props,t),$h(n,e);let i=V(r.node);Wh(e)||(r.node=B(n),Lg(t,0,n,e.children,null,!1,n)),r.node=i;return}if(n===null&&r!==null&&r.node!==null){let a=r.node;if(r.isOpen(a)){let e=r.close(a);r.node=V(e),r.removeRange(a,e)}else r.node=V(a),(R?.view(a)??a).remove();n=i===void 0?(R?.view(document)??document).createElement(e.type):(R?.view(document)??document).createElementNS(i,e.type),r.markFresh(n),t.deoptNode=n;let o=t.parentNode;(R?.view(o)??o).insertBefore(n,t.endMarker),Kh(n,e.props,t),$h(n,e),Wh(e)||r.suspend(()=>Lg(t,0,n,e.children,null,!1,n));return}if(n===null||n.localName!==e.type||i!==void 0&&n.namespaceURI!==i){if(n!==null){let e=n;M!==null&&(Zi(t.parentNode,(R?.view(e)??e).previousSibling,V(e)),N(t,`deoptNode`,t.deoptNode));let r=t.slots[0];r!==void 0&&fc(t,r);let i=()=>{let t=Xh(e)?.props?.ref;t!=null&&rs(t,e)};M===null?(i(),(R?.view(e)??e).remove()):na(t.parentNode,e,e,i)}n=i===void 0?(R?.view(document)??document).createElement(e.type):(R?.view(document)??document).createElementNS(i,e.type),r!==null&&r.markFresh(n),t.deoptNode=n;let a=t.parentNode;(R?.view(a)??a).insertBefore(n,t.endMarker),Kh(n,e.props,t)}else qh(n,Xh(n)?.props??null,e.props,t);$h(n,e),Wh(e)||Lg(t,0,n,e.children,null,!1,n)}function Sg(e,t){let n=e.type,r=t.deoptNode,i=H(),a=Vd(n,Hd(t.parentNode));if(r===null){if(i!==null&&i.node!==null&&i.node.nodeType===1&&i.node.localName===n&&(a===void 0||i.node.namespaceURI===a)){r=i.node,t.deoptNode=r,Kh(r,e.props,t),$h(r,e);let n=V(i.node);Wh(e)||(i.node=B(r),Cg(e,t,r)),i.node=n;return}if(i!==null&&i.node!==null){dv(()=>Error(E(51)));let o=i.node;if(i.isOpen(o)){let e=i.close(o);i.node=V(e),i.removeRange(o,e)}else i.node=V(o),(R?.view(o)??o).remove();r=a===void 0?(R?.view(document)??document).createElement(n):(R?.view(document)??document).createElementNS(a,n),i.markFresh(r),t.deoptNode=r;let s=t.parentNode;(R?.view(s)??s).insertBefore(r,t.endMarker),Kh(r,e.props,t),$h(r,e),Wh(e)||i.suspend(()=>Cg(e,t,r));return}r=a===void 0?(R?.view(document)??document).createElement(n):(R?.view(document)??document).createElementNS(a,n),i!==null&&i.markFresh(r),t.deoptNode=r;let o=t.parentNode;(R?.view(o)??o).insertBefore(r,t.endMarker),Kh(r,e.props,t)}else qh(r,Xh(r)?.props??null,e.props,t);$h(r,e),Wh(e)||Cg(e,t,r)}function Cg(e,t,n){let r=e.children;if(r!=null){if(typeof r==`function`){let e=t.slots[0];e===void 0?(e={__kind:`hostTagChildrenSlot`,block:Qs(`dynamic`,t,n,null,null,r,{},void 0,dc)},t.slots[0]=e,xc(t,e)):e.block.body=r,I(e.block);return}Lg(t,1,n,r,null,!1,n)}}function wg(e){let t=e.forSlot;Z_(t,t.items),t.head=null,t.tail=null,t.size=0,e.forSlot=null}var Tg=null;function Eg(e,t){if(Array.isArray(e)){let n=[],r=e.length;for(let i=0;i<r;i++)n[i]=Eg(e[i],t);return Rh.has(e)&&Rh.add(n),n}if(e==null||e===!1||e===!0||e===``)return e;let n=typeof e,r=vh(e);if(!r&&n!==`string`&&n!==`number`&&n!==`bigint`)return e;let i=t.node;return i===null||i===t.end?e:(t.node=V(i),r?Xh(i)??e:e)}function Dg(e,t,n){let{items:r,keys:i}=dg(Eg(e,{node:V(t),end:n}),!0),a=[],o=V(t);for(let e=0;e<r.length;e++){let t=r[e];if(t==null||t===!1||t===!0||t===``)continue;if(o===null||o===n)break;let s=typeof t;if(!(s===`string`||s===`number`||s===`bigint`?o.nodeType===3:yh(t)&&o.nodeType===1&&o.localName===t.type))break;a.push({key:i[e],node:o}),o=V(o)}return a}function Og(e,t){for(let n=e;n!==null;n=n.parentBlock)if(n.kind===`portal`&&n.parentNode===t)return!0;return!1}Array.prototype.map,Object.getOwnPropertyDescriptor(Array,Symbol.species)?.get;function kg(e,t){if(!(M===null||M.aborted||Wi)){if(ja(),e.ownerHost!==null)Xi(e,e.ownerHost,null,null);else if(e.start!==null)Xi(e,t,e.borrowed?e.start:z(e.start).previousSibling,e.borrowed?e.end:z(e.end)?.nextSibling??null);else if(e.borrowed&&e.block!==null&&e.block.startMarker===null)Xi(e,t,null,e.end);else{let n=e.text??e.hostNode??e.block?.startMarker??e.end,r=e.end??e.block?.endMarker??n,i=(R?.view(r)??r)?.nextSibling??null;Xi(e,t,n===null?(R?.view(t)??t).lastChild:(R?.view(n)??n).previousSibling,i)}}}function Ag(e,t,n,r,i,a,o,s,c,l,u,d){let f=i?.passthroughRanges===!0&&e.borrowed,p=null,m=null;if(r.items.length===0&&i===null&&e.ownerHost!==null){e.forSlot!==null&&M===null&&wg(e),Fh(e);return}if(e.forSlot===null){if(i===null&&!a&&Fh(e),e.end!==null&&z(e.end).parentNode===null&&(e.end=null,e.start=null),e.end===null){e.end=(R?.view(document)??document).createComment(``);let r=null;if(f){for(let e=t;e!==null;e=e.parentBlock)if(e.forSlot!==null&&e.endMarker!==null&&z(e.endMarker).parentNode===n){r=e.endMarker;break}if(r===null){let e=(R?.view(n)??n).lastChild;for(;e!==null&&bu(e);)r=e,e=(R?.view(e)??e).previousSibling}}if((R?.view(n)??n).insertBefore(e.end,r),f&&(i.markFresh(e.end),m=e.end,j!==null)){let t=e.end;Yi(()=>(R?.view(t)??t).remove())}}if(e.start===null){e.start=(R?.view(document)??document).createComment(``);let t=f?i.node:null;if((R?.view(n)??n).insertBefore(e.start,a?B(n):t!==null&&z(t).parentNode===n?t:e.end),f&&(i.markFresh(e.start),p=e.start,j!==null)){let t=e.start;Yi(()=>(R?.view(t)??t).remove())}}e.forSlot={__kind:`forBlockSlot`,start:e.start,end:e.end,items:new Map,head:null,tail:null,size:0,cachedDeps:null,emptyBlock:null,env:void 0,adopt:null,plainDeopt:!1,mappedNative:void 0,selectionItems:void 0,signalSite:void 0},a&&(e.forSlot.adopt=Dg(o,e.start,e.end))}let{items:h,keys:g}=r,_=d===!0&&i!==null&&!i.isOpen(i.node),v=c||g,y=!!c,b=e.forSlot.mappedNative===!0,x=s||(d===!0?yg:vg);if(s===void 0&&b&&e.forSlot.size>0)for(let t=0;t<h.length;t++){let n=h[t];if(!yh(n))continue;let r=e.forSlot.items.get(U_(v,n,t,y));if(r!==void 0&&r.startMarker!==null&&r.startMarker===r.endMarker&&r.startMarker.nodeType===1&&r.startMarker.localName===n.type){let e=r.startMarker,t=B(e);if(t?.nodeType===3&&V(t)===null){let e=Object.getOwnPropertyDescriptor(n,`children`);if(e!==void 0&&`value`in e&&(typeof e.value==`string`||typeof e.value==`number`||typeof e.value==`bigint`))t.$$deoptKey=0;else if(e?.get!==void 0){let e=r.slots[0];if(e!=null){for(let n in e)if(e[n]===t){t.$$deoptKey=0;break}}}}r.deoptNode=r.startMarker}}if(s!==void 0&&(e.forSlot.mappedNative===!1&&(x=(e,t,n)=>{let r=t.slots[0]===void 0?t.block.deoptNode:null;if(r===null||r.nodeType!==1){s(e,t,n);return}let i=xu,a={node:r};xu=a;try{s(e,t,n),a.node===null&&(t.block.deoptNode=null)}finally{xu=i}}),e.forSlot.mappedNative=!0),_){let e=x;x=(t,n)=>{let r=n.block.startMarker;r!==null&&r===n.block.endMarker&&r.nodeType===1&&n.block.deoptNode===null&&(n.block.deoptNode=r),e(t,n)}}let S=s===void 0&&d!==!0;e.forSlot.plainDeopt=S;let C=l||0,w=s===void 0?_||S:!!(C&16),ee=!!(C&1),te=!1;if(s!==void 0&&(e.forSlot.env=u,C&4&&u!==void 0&&(e.forSlot.cachedDeps!==null&&F_(e.forSlot.cachedDeps,u)?ee=!0:te=!0,e.forSlot.cachedDeps=u)),e.forSlot.size===0)try{W_(t,e.forSlot,h,v,x,s===void 0?2:!!(C&2),w,y,f)}catch(t){throw p!==null&&((R?.view(p)??p).remove(),e.start=null),m!==null&&((R?.view(m)??m).remove(),e.end=null),(p!==null||m!==null)&&(e.forSlot=null),t}else q_(t,e.forSlot,h,v,x,ee,s===void 0?2:!!(C&2),te,!!(C&8),w,y);if(e.forSlot.adopt!==null){let t=e.forSlot.adopt;for(let e=0;e<t.length;e++){let n=t[e].node;(R?.view(n)??n).parentNode!==null&&(M===null?(U(n,null),z((R?.view(n)??n).parentNode).removeChild(n)):na((R?.view(n)??n).parentNode,n,n,()=>U(n,null)))}e.forSlot.adopt=null}f&&!i.passthroughRanges&&(i.node=V(e.forSlot.end))}var jg=Symbol(`octane.direct-signal-child`),Mg=0;function Ng(e){e.disposed||(e.disposed=!0,e.unsubscribe?.(),Dr(e.scope.block))}function Pg(e){if(!(e.disposed||e.scope.block.disposed))try{Rn(e.scope,()=>{let t=Ku(e.handle);if(Object.is(e.value,t))return;let n=e.scope.slots[e.slotKey],r=typeof t,i=t==null||r!==`object`&&r!==`function`?Dh(t):null;if(n===void 0&&e.text!=null&&i!==null&&i!==``){Wu(e.text,i),e.value=t;return}if(n===e.state&&n?.block===null&&n.forSlot===null&&n.hostNode===null&&n.portal===null&&i!==null&&i!==``&&n.text!==null){Wu(n.text,i),e.value=t;return}Do(e.scope.block)})}catch{Do(e.scope.block)}}function Fg(e,t,n,r,i,a,o,s,c,l,u,d){let f=typeof t==`object`&&t&&t[jg]===!0?t:null,p=f?.text??(t instanceof Text?t:null);if(!Gu(i)){let t=u?zg(e,n,r,i,p):(d===void 0?Lg(e,n,r,i,o,s,c,l):Ig(e,n,r,i,d,o,s),null);if(f!==null){j!==null&&ja();let e=e=>{e||Ng(f)};P===null?e(!1):(P.renderCleanups??=[]).push(e)}return t}if(f!==null&&!f.disposed&&f.handle===i){let t=Ku(i);return j!==null&&Ma(f),u?f.text=zg(e,n,r,t,p):d===void 0?Lg(e,n,r,t,o,s,c,l):Ig(e,n,r,t,d,o,s),f.value=t,f.state=e.slots[n],f}let m=Ku(i),h=u?zg(e,n,r,m,p):(d===void 0?Lg(e,n,r,m,o,s,c,l):Ig(e,n,r,m,d,o,s),null);j!==null&&ja();let g={[jg]:!0,scope:e,slotKey:n,handle:i,text:h,state:e.slots[n],value:m,disposed:!1};if(g.unsubscribe=i[sn](qu(g,()=>Pg(g))),fn(e,()=>Ng(g)),f!==null){let e=e=>Ng(e?g:f);P===null?e(!1):(P.renderCleanups??=[]).push(e)}return g}function Ig(e,t,n,r,i,a,o){let s=Ou;if(s?.revision!==void 0){let e=H()?.resolveOpen(a??null,n)??null,t=Iu(s,e,i,`slot`);(r==null?t.slot!==void 0||V(e)!==t.end:t.slot===void 0||typeof r!=`function`||r[Fu]!==t.slot)&&Mu(!1)}Lg(e,t,n,r,a,o,void 0,!1,!0,void 0,void 0,void 0,void 0,void 0,i)}function Lg(e,t,n,r,i,a,o,s,c=!0,l,u,d,f,p,m){if(k?.pending&&!k.crossRenderUpdate)return;if(t===0&&e!==cc){let t=e.slots[0];if(t?.returnedOutput===!0){if(t.__kind===`childSlot`)lc(t,!1);else{let t=e.block;if(t.outputHandler(t,null,!0),t.disposed)return}}}if(Mg===0){let c=e.slots[t]?.implicitSignal;if(Gu(r)||c!==void 0){Gu(r)&&An(),Mg++;let l;try{l=Rn(e,()=>Fg(e,c,t,n,r,`runtime:${t}`,i,a,o,s,void 0,m))}finally{Mg--}let u=e.slots[t];u!==void 0&&(u.implicitSignal=l);return}}if(r!=null&&c&&n.nodeType===1&&Be.has(n.localName)&&!Og(e.block,n))throw Error(E(26,n.localName));if(hd(n,r))return;let h=e.block,g=H();if(g!==null&&(i!=null&&g.isFresh(i)||g.isFresh(n))){g.suspend(()=>Lg(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m));return}for(;r!==null&&(typeof r==`object`||typeof r==`function`);){if(r.$$kind===Ft){r=zl(r);continue}if(typeof r.then==`function`){r=Ul(r);continue}break}let _=typeof r==`function`?r:vh(r)&&typeof r.type==`function`?r.type:null,v=g?.passthroughRanges===!0&&_?.[ze]!==`owner`;g?.passthroughRanges===!0&&!v&&(g.passthroughRanges=!1);let y=fg(r);y!==null&&(r=y);let b=l===void 0?dg(r,!1,c):{items:r,keys:null},x=e.slots[t],S=b===null&&yh(r)&&x?.currentComp!==xg&&!bg(r),C=!1;if(x!==void 0&&M!==null){let e=S||b!==null?null:yh(r)?xg:_,t=b!==null&&x.forSlot!==null,i=x.block!==null&&e!==null&&(e===x.currentComp||typeof r==`function`&&x.currentIsBodyFn),a=S&&x.hostNode!==null&&x.block===null&&x.hostNode.nodeType===1&&x.hostNode.localName===r.type,o=r==null||typeof r!=`object`&&typeof r!=`function`,s=o?Dh(r):null,c=o&&x.block===null&&x.forSlot===null&&x.hostNode===null&&x.portal===null&&x.text===null==(s===``);!t&&!i&&!a&&!c&&(kg(x,n),C=!0)}let w=x===void 0&&g!==null&&h===g.rootBlock&&g.node!==null&&z(g.node).parentNode===n&&b===null&&vh(r)&&typeof r.type==`function`&&!g.isOpen(i??null)&&!g.isOpen(g.node);if(x===void 0&&g!==null&&!v&&h===g.rootBlock&&!g.isOpen(i??null)&&!g.isOpen(g.node)){let h=g.node;if(!(r===null||r===``?h===null:typeof r==`string`&&h?.nodeType===3||w)){g.abandonRoot(void 0),Lg(e,t,n,r,(R?.view(i)??i)?.parentNode===n?i:null,a,o,s,c,l,u,d,f,p,m);return}}if(x===void 0){let r=M;if(r!==null&&!r.aborted&&!Wi&&e.mounted&&!ia(r,h)){ja();let e=o===void 0?i??null:null;Zi(n,o===void 0?e===null?(R?.view(n)??n).lastChild:(R?.view(e)??e).previousSibling:null,e)}let c,l;v?(c=null,l=null):w?[c,l]=g.wrapUnframedRoot(g.node):g!==null&&g.isOpen(i??null)?(c=i,l=g.close(i),h===g.rootBlock&&g.claimRootRemainder(V(l)),g.node=V(c)):g!==null&&g.isOpen(g.node)?(c=g.node,l=g.close(g.node),h===g.rootBlock&&(g.protectRootAnchor(l),g.claimRootRemainder(V(l))),g.node=V(c)):m===void 0?a&&i!=null?(c=null,l=i):g===null&&o!==void 0||g===null&&S?(c=null,l=null):(c=null,l=(R?.view(document)??document).createComment(``),(R?.view(n)??n).insertBefore(l,i??null),g!==null&&h===g.rootBlock&&g.protectRootAnchor(l)):(c=(R?.view(document)??document).createComment(m),l=a&&i!=null?i:(R?.view(document)??document).createComment(`]`),(R?.view(l)??l).data=`]`,(R?.view(n)??n).insertBefore(c,i??null),l!==i&&(R?.view(n)??n).insertBefore(l,i??null)),x={__kind:`childSlot`,start:c,end:l,ownerHost:g===null?o??null:null,borrowed:v,compactable:s===!0,block:null,text:null,currentComp:null,currentIsBodyFn:!1,forSlot:null,hostNode:null,portal:null,implicitSignal:void 0},e.slots[t]=x,xc(e,x)}s===!0&&(x.compactable=!0);let ee,te=!1;if(Tg!==null&&Tg.block===e.block&&o!==void 0&&(M!==null&&Qi(n),ee=Tg.children,te=!0,Tg=null),x.end===null&&!S&&x.ownerHost===null&&!x.borrowed){let e=(R?.view(document)??document).createComment(``),t=(R?.view(document)??document).createComment(``),r=x.hostNode;if(r!==null&&(R?.view(r)??r).parentNode!==null){let n=(R?.view(r)??r).parentNode;(R?.view(n)??n).insertBefore(e,r),(R?.view(n)??n).insertBefore(t,V(r)),w_(h,r,r,e,t)}else(R?.view(n)??n).insertBefore(e,i??null),(R?.view(n)??n).insertBefore(t,i??null);x.start=e,x.end=t}let ne=r!=null&&r.$$kind===Nt?r:null;if(ne===null&&x.portal!=null&&(Ym(x.portal),x.portal=null),ne!==null){x.forSlot!==null&&(M!==null&&g===null?Fh(x):wg(x)),(x.block!==null||x.text!==null||x.hostNode!==null)&&Fh(x),x.portal=Jm(x.portal,h,ne.target,ne.body,ne.props,n,void 0,ne.key),vo.size!==0&&x.end!==null&&qm(x.portal,h,x.end);return}if(b!==null){Ag(x,h,n,b,g,te,ee,l,u,d,f,p);return}if(x.forSlot!==null&&(M!==null&&g===null?Fh(x):wg(x)),te&&x.hostNode===null&&x.block===null){let e=B(n);if(e!==null&&V(e)===null&&(e.nodeType===1||e.nodeType===3))x.hostNode=e;else{let e=B(n);for(;e!==null;){let t=V(e);if(M!==null){let t=e;na(n,t,t,()=>U(t,null))}else U(e,null),(R?.view(n)??n).removeChild(e);e=t}}}let T=null,re={},ie=!1,ae,oe,se=!1;if(yh(r)){if(S){if((x.block!==null||x.text!==null)&&Fh(x),x.end===null){let e=x.hostNode,t=mg(e,r,h,Hd(n));if(t!==e){if(e!==null&&(R?.view(e)??e).parentNode!==null){let n=(R?.view(e)??e).parentNode;M===null?(t!==null&&(R?.view(n)??n).insertBefore(t,e),U(e,null),(R?.view(n)??n).removeChild(e)):(kg(x,n),na(n,e,e,()=>U(e,null)),t!==null&&(R?.view(n)??n).insertBefore(t,e))}else t!==null&&(R?.view(n)??n).insertBefore(t,i??null)}x.hostNode=t;return}x.start===null&&(x.start=(R?.view(document)??document).createComment(``),(R?.view(n)??n).insertBefore(x.start,x.end));let e=x.hostNode;e===null&&g!==null&&(e=V(x.start),e===x.end&&(e=null));let t=mg(e,r,h,Hd(n));if(t!==e){if(e!=null&&e!==t&&(R?.view(e)??e).parentNode!==null){if(M!==null){kg(x,n);let t=e;na((R?.view(e)??e).parentNode,e,e,()=>U(t,null))}else U(e,null),z((R?.view(e)??e).parentNode).removeChild(e)}t!==null&&z(z(x.start).parentNode).insertBefore(t,x.end)}x.hostNode=t;return}T=xg,re=r}else if(typeof r==`function`)T=r,ie=!0;else if(vh(r)){let e=wd,t=e!==null&&r.type===e.type;if(!t&&typeof r.type!=`function`&&typeof r.type!=`string`)throw Sh(r.type);T=t?e.body:r.type,re=r.props,ae=r.__octaneInvocationSite,oe=r.key,se=r.key!=null}if(T!==null){if(ie&&x.block!==null&&x.currentIsBodyFn){let e=xl(T),t=x.block.$$implicitBail;if(e&&!t&&(x.block.$$implicitBail=!0,x.block.memoInChain=!0),t&&e&&T===x.currentComp&&Gg(x.block))return;x.block.body!==T&&N(x.block,`body`,x.block.body),x.currentComp!==T&&N(x,`currentComp`,x.currentComp),x.block.body=T,I(x.block),x.currentComp=T;return}if(x.block!==null&&T===x.currentComp){if(Wg(x.block,T,re)||re===x.block.props&&(T!==xg||Qh(x.block,re))&&Gg(x.block))return;x.block.props!==re&&N(x.block,`props`,x.block.props),x.block.props=re,I(x.block);return}let r=hn||en?{parentScope:e,invocationSite:ae,key:oe,hasKey:se}:void 0,i=x.block===null&&x.hostNode===null&&x.text===null||h.idState.renderOwner?.signalOwner===void 0?void 0:{parent:e,slot:t,kind:x.__kind,branch:void 0,component:ie?void 0:T,key:void 0},a=xr,o=h.currentRenderMode===`transition`,s=a!==null&&x.block!==null&&x.block.mounted&&g===null&&x_(h),c=M===null||s?a:null,l=c!==null&&x.block!==null&&x.block.mounted&&x.end!==null&&g===null,u=l&&!o&&s,d=u&&!o;if(l&&(o||u)){let e=c.render(h,n,x.end,T,re,dc,`dynamic`,void 0,!1,r,i);if(e.suspended||e.failed)throw c.dispose(e.wip),e.failed?e.error:new Bl(e.suspended);if(x.borrowed||d)c.dispose(e.wip);else{let t=x.block;if(x.block=e.wip.block,x.currentComp=T,x.currentIsBodyFn=ie,c.splice(e.wip),Ih(x,t),h.disposed||x.block!==e.wip.block||e.wip.block.disposed)return;Mh(e.wip,x.end);return}}if(g===null&&T===xg&&x.block===null&&x.hostNode!==null&&x.hostNode.nodeType===1&&x.hostNode.localName===re.type&&x.hostNode.namespaceURI===(Vd(re.type,Hd(n))??zd)&&!Uh(re.props)&&!Uh(Xh(x.hostNode)?.props??null)){let e=x.hostNode;x.hostNode=null,x.currentComp=T,x.currentIsBodyFn=!1;let t=Qs(`dynamic`,h,n,x.start,x.end,T,re,void 0,dc);r!==void 0&&Fn(t,r),sa(t),x.borrowed&&(t.exclusiveMarkers=!0),t.$$implicitBail=!0,t.memoInChain=!0,t.deoptNode=e,x.block=t,Tg={block:t,children:Xh(e)?.children};try{I(t)}finally{Tg=null}return}if(M!==null&&C&&(e.mounted||M.retainedCreated?.has(h))&&!s&&g===null){let t=x.ownerHost!==null||x.borrowed&&x.start===null?(R?.view(n)??n).lastChild:x.end===null?x.block?.endMarker??x.text??x.hostNode:z(x.end).previousSibling;if(t!==null&&(R?.view(t)??t).parentNode===n){Fh(x);let a=!ie||xl(T),o=Oh(h,n,t,T,re,dc,`dynamic`,void 0,a,r,i);if(o.suspended||o.failed)throw Ph(o.wip),o.suspended===null?o.error:new Bl(o.suspended);if(e===h&&h.forSlot!==null&&!h.exclusiveMarkers&&x.borrowed&&T_(h,x.start,x.end)){let e=x.start,t=x.end;x.start=o.wip.start,x.end=o.wip.end,N(o.wip.block,`exclusiveMarkers`,o.wip.block.exclusiveMarkers),o.wip.block.exclusiveMarkers=!0,w_(h,e,t,x.start,x.end),na(n,e,e),na(n,t,t)}x.start===null&&x.ownerHost===null&&!x.borrowed&&(x.start=o.wip.start),x.block=o.wip.block,x.currentComp=T,x.currentIsBodyFn=ie,Ah(o.wip);return}}if(g===null&&(Fh(x),h.disposed))return;x.currentComp=T,x.currentIsBodyFn=ie,x.start===null&&x.ownerHost===null&&!x.borrowed&&(x.start=(R?.view(document)??document).createComment(``),(R?.view(n)??n).insertBefore(x.start,x.end));let f=Qs(`dynamic`,h,n,x.start,x.end,T,re,void 0,dc);r!==void 0&&Fn(f,r),x.borrowed&&(f.exclusiveMarkers=!0),(!ie||xl(T))&&(f.$$implicitBail=!0,f.memoInChain=!0),x.block=f,I(f),g!==null&&!x.borrowed&&x.end!==null&&(g.node=V(x.end));return}if(typeof r==`object`&&r)throw xh(r);(x.block!==null||x.hostNode!==null)&&Fh(x);let ce=Dh(r);if(ce===``){x.text!==null&&(M===null?(z(x.text).remove(),x.text=null):Fh(x));return}if(x.text!==null){Uu(x.text,ce);return}if(g!==null){let e=g.node;if(e!==null&&e!==x.end&&e.nodeType===3){x.text=e,g.node=V(e),Uu(e,ce);return}}let le=(R?.view(document)??document).createTextNode(ce);(R?.view(n)??n).insertBefore(le,x.end),x.text=le}function Rg(e,t,n,r,i,a,o){if(hd(n,r))return;let s=typeof r;if(s===`object`||s===`function`){Lg(e,t,n,r,i,a,void 0,o);return}let c=e.slots[t];if(c===void 0||c.block!==null||c.forSlot!==null||c.hostNode!==null||c.portal!==null){Lg(e,t,n,r,i,a,void 0,o);return}t===0&&e!==cc&&c.returnedOutput===!0&&lc(c,!1);let l=s===`string`?r:s===`boolean`||r==null?``:String(r);if(c.text!==null){Uu(c.text,l);return}if(l===``)return;M!==null&&kg(c,n);let u=(R?.view(document)??document).createTextNode(l);(R?.view(n)??n).insertBefore(u,c.end),c.text=u}function zg(e,t,n,r,i){if(n.nodeType===1&&Be.has(n.localName)&&!Og(e.block,n)&&r!=null)throw Error(E(26,n.localName));if(hd(n,r))return null;let a=typeof r,o=e.slots[t];if(M!==null&&o===void 0&&e.mounted&&(ja(),Zi(n,null,null),N(e.slots,t,e.slots[t])),o===void 0&&a!==`object`&&a!==`function`){let o=r==null||r===!1||r===!0?``:a===`string`?r:String(r);if(o===``)return i!==null&&(R?.view(i)??i).remove(),null;if(i!==null)return Uu(i,o),i;let s=H();if(s!==null)return s.htext(n,o,Gn(e,t));let c=(R?.view(document)??document).createTextNode(o);return(R?.view(n)??n).appendChild(c),c}o===void 0&&i!==null&&(R?.view(i)??i).remove();let s=H();s!==null&&o===void 0&&(s.node=B(n)),Lg(e,t,n,r,null,!1,n);let c=e.slots[t];return c.block===null&&c.forSlot===null&&c.hostNode===null?c.text:null}function Bg(e){let t=e.$$ctxReads;if(t===null)return!1;for(let[e,n]of t)if(e.$$version!==n)return!0;return!1}function Vg(e){let t=e.$$ctxDirect;if(t===null)return!1;for(let[e,n]of t)if(e.$$version!==n)return!0;return!1}function Hg(e){if(e.$$ctxDepsEpoch!==Ae()){if(Vg(e))return!1;Bg(e)?Ug(e):e.$$ctxDepsEpoch=Ae()}return!0}function Ug(e){let t=e._slots;if(t!==null)for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n.__kind===`forBlockSlot`){let e=n.items;for(let t of e.values())qg(t);n.emptyBlock&&qg(n.emptyBlock)}else if(n.block)qg(n.block);else if(n.__kind===`childSlot`&&n.forSlot){let e=n.forSlot.items;for(let t of e.values())qg(t)}else n.__kind===`childSlot`&&n.portal!==null&&n.portal.block!==null&&qg(n.portal.block)}}function Wg(e,t,n){if(t.__memo!==!0||!e.mounted||e.renderStatus!==qn)return!1;let r=t.__compare;return!(r?t[su]===void 0?r(e.props,n):r(e.props,n,e):Yg(e.props,n))||!Hg(e)?!1:(Kg(e),m_(e),!0)}function Gg(e){if(e.$$implicitBail!==!0||!e.mounted||e.renderStatus!==qn)return!1;let t=e.body[su];return t!==void 0&&!t(e)||!Hg(e)?!1:(Kg(e),m_(e),!0)}function Kg(e){let t=e.$$ctxReads,n=e.$$ctxDirect,r=t!==null&&t.size>0,i=n!==null&&n.size>0;if(r||i)for(let a=e.parentBlock;a!==null;a=a.parentBlock){if(a.body?.__memo!==!0&&a.$$implicitBail!==!0)continue;let e=a.$$ctxReads??=new Map;if(r)for(let[n,r]of t){let t=e.get(n);if(t!==r){let i=n.$$version;(t===void 0||t===i)&&(e.set(n,r),r!==i&&(a.$$ctxDepsEpoch=-1))}}if(i)for(let[t,r]of n){let n=e.get(t);if(n!==r){let i=t.$$version;(n===void 0||n===i)&&(e.set(t,r),r!==i&&(a.$$ctxDepsEpoch=-1))}}}}function qg(e){let t=e.$$ctxDepsEpoch===Ae();!t&&Vg(e)?I(e):e.body?.__memo===!0||e.$$implicitBail===!0?t||(Bg(e)?Ug(e):e.$$ctxDepsEpoch=Ae()):(t||(e.$$ctxDepsEpoch=Ae()),Ug(e))}var Jg=Object.prototype;function Yg(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t);if(n!==Jg&&n!==null||r!==Jg&&r!==null)return Xg(e,t);let i=0;for(let n in e){let r=e[n];if(!Ze.call(t,n)||!Object.is(r,t[n]))return!1;i++}for(let e in t)i--;return i===0}function Xg(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++){let i=n[r];if(!Ze.call(t,i)||!Object.is(e[i],t[i]))return!1}return!0}var Zg=Symbol(`memoOwner`),Qg={get(){return this===this[Zg]}},$g={configurable:!0,get(){return this.type.defaultProps},set(e){this.type.defaultProps=e}};function e_(e,t){function n(t,n,r){return e(t,n,r)}Object.defineProperty(n,Zg,{value:n}),Object.defineProperty(n,\"type\",{value:e}),Object.defineProperty(n,\"displayName\",{configurable:!0,writable:!0,value:e.displayName||e.name||`Memo`}),Object.defineProperty(n,\"__memo\",Qg),Object.defineProperty(n,\"defaultProps\",$g);let r=e[su];return r===void 0?t&&Object.defineProperty(n,\"__compare\",{value:t}):(cu(n,r),Object.defineProperty(n,\"__compare\",{value:(e,n,i)=>r(i)&&(t?t(e,n):Yg(e,n))})),n}var t_=1/0;function n_(e){for(;e.parentBlock!==null;)e=e.parentBlock;return e}var r_=null,i_=0;function a_(e){if(i_===0)return!0;let t=r_;for(let n=e;n!==null;n=(R?.view(n)??n).parentNode)if(t.has(n))return!1;return!0}function o_(e,t,n=null){let r=null,i=null;for(let a=e;a!==null;a=a.parentBlock){if(t&&r===null&&a.inactive){let e=a.__activitySlot;e!==void 0&&e.block===a&&e.hidden&&(r=e)}let e=a.__trySlot;if(e!==void 0&&e.tryBlock===a){if(e.hiddenDom!==null)return e;n!==null&&!e.propagateSuspense&&e.hasResolved&&e.branch===1&&(e.transitionHeld||n===`transition`)&&(i=e)}}return r??i}function s_(e){return o_(e,!1)}function c_(e){for(let t=e;t!==null;t=t.parentBlock){if(!t.inactive)continue;let e=t.__activitySlot;if(e!==void 0&&e.block===t&&e.hidden)return e}return null}function l_(e,t){let n=new Map,r=e=>{let i=e.effectSlots;if(i!==null)for(let e=0;e<i.length;e++){let r=i[e];(t===void 0||r.phase===t)&&n.set(r,{deps:r.deps,revision:r.revision,active:r.active})}k_(e,r)};return r(e),n}function u_(e,t,n){let r=e=>{let i=e.effectSlots;if(i!==null)for(let e=0;e<i.length;e++){let r=i[e];if(n!==void 0&&r.phase!==n)continue;let a=t.get(r);a===void 0?(r.deps=void 0,r.revision=0,r.active=!1):(r.deps=a.deps,r.revision=a.revision,r.active=a.active)}k_(e,r)};r(e)}var d_=null;function f_(e){for(let t=d_;t!==null;t=t.parent)t.insertionReplays?.delete(e)}function p_(e,t,n){for(let r=d_;r!==null;r=r.parent)r.queues[t]===n&&r.queuedSlots.add(e)}function m_(e){let t=d_;if(t===null||e!==t.root&&!Ts(t.root,e))return;let n=[],r=e=>{let i=e.effectSlots;if(i!==null)for(let r=0;r<i.length;r++){let a=i[r];if(t.queuedSlots.has(a))continue;let o=t.insertionReplays?.get(a);if(o!==void 0){n.push({scope:e,effect:a,replay:o});continue}a.active&&a.disconnected&&a.connectedFn!==null&&n.push({scope:e,effect:a,replay:null})}k_(e,r)};r(e);for(let e=0;e<n.length;e++){let{scope:r,effect:i,replay:a}=n[e],o=t.queues[i.phase];if(a!==null){let e=a[a.length-1];M!==null&&Ma(i),i.active=e.fn!==null,i.deps=e.fn===null?void 0:e.args;let t=++i.revision;for(let e=0;e<a.length;e++)o.push({...a[e],revision:t,seq:lo++})}else o.push({scope:r,slot:i.slot,fn:i.connectedFn,order:i.order,revision:i.revision,args:i.connectedArgs,phase:i.phase,seq:lo++});p_(i,i.phase,o)}}function h_(e){g_(e)}function g_(e,t){Sr(),Nr(),yr++;let n=kr,r=Ar,i=n??r??Pr(),a=n===null&&r===null;kr=i,t!==void 0&&(Gr(i,t),Kr(i));let o=Yp;o!==null&&o.transitions++;let s;try{to(1);try{let t=Gt,n=ye(()=>{let e=Mr(i);return Kt(e),e});try{s=e()}finally{Kt(t),ye(n)}s!=null&&typeof s.then==`function`&&(i.pendingActions++,Ar=i),a&&(i.closed=!0,Br(i))}catch(e){throw a&&(i.closed=!0,Br(i)),e}finally{kr=n,yr--}}catch(e){to(-1),o!==null&&Qp(o),tm(),i.workComplete=!0,qr(i),__(e,t);return}if(s!=null&&typeof s.then==`function`){br++;let e=!1,n=()=>{e||(e=!0,i.pendingActions--,Br(i),to(-1),br--,o!==null&&Qp(o),tm(),queueMicrotask(()=>{i.workComplete=!0,qr(i)}))};s.then(n,e=>{n(),__(e,t)})}else queueMicrotask(()=>{to(-1),o!==null&&Qp(o),tm(),i.workComplete=!0,qr(i)})}function __(e,t){t!==void 0&&!t.block.disposed?(t.error={value:e},Do(t.block)):Ip(e)}function v_(e){let t=e,n=e;for(;n;){let e=n.$$tryHandler;if(e&&n.__trySlot?.catchBody!==null)return e;n=n.parentBlock}return Dl(t)}function y_(e,t,n=null){if(ju(t))throw t;if(Al(t)){let n=El(e);if(n!==null&&n.routeSuspense(t.thenable))return;t=Error(E(27))}if(Vl(t)){let r=e;for(;r;){let n=r.__suspenseHandler;if(n){n(t.thenable,e);return}r=r.parentBlock}let i=Ol(e);if(i!==null){i(t.thenable);return}if(da(e,t.thenable,n))return;throw t}let r=v_(e);if(r)sv(e,t,r(t));else throw t}function b_(e,t){try{y_(e,t)}catch(t){if(k!==null||vr)throw t;let n=n_(e);lv(e,t)||console.error(t),n.kind===`root`&&!n.disposed&&L(n)}}function x_(e){for(let t=e;t!==null;t=t.parentBlock){let e=t.__trySlot;if(e!==void 0&&e.tryBlock===t&&e.pendingBody!==null&&e.hasResolved&&e.branch===1&&e.hiddenDom===null)return!0}return!1}function S_(e,t,n,r=null){let i=0,a=e._slots;if(a!==null)for(let e=0;e<a.length;e++){let o=a[e];o.anchor===n&&(o.__kind===`ifBlockSlot`||o.__kind===`switchBlockSlot`||o.__kind===`componentSlotSlot`&&o.block?.parentNode===t)&&(i++,r!==null&&(N(o,`anchor`,o.anchor),o.anchor=r))}let o=e.children;if(o!==null)for(let a=0;a<o.length;a++){let s=o[a].scope,c=s.block;c!==e.block&&c.parentNode===t&&c.endMarker===n&&(i+=S_(s,t,n,r)||1,r!==null&&(N(c,`endMarker`,c.endMarker),c.endMarker=r))}return i}function C_(e,t,n,r,i,a){if(e.markerlessBefore=void 0,e.borrowed&&e.start===null)return;let o=i?V(i):B(t),s=a?(R?.view(a)??a).previousSibling:(R?.view(t)??t).lastChild;if(s!==null&&o===s&&o.nodeType===1&&S_(n,t,a)<=1)n.startMarker=o,n.endMarker=o,e.end=o;else{let i=(R?.view(document)??document).createComment(r),s=(R?.view(document)??document).createComment(`/`+r);(R?.view(t)??t).insertBefore(i,o??a),(R?.view(t)??t).insertBefore(s,a),n.startMarker=i,n.endMarker=s,n.exclusiveMarkers=!0,e.start=i,e.end=s,S_(n,t,a,s)}}function w_(e,t,n,r,i){if(t===null||n===null)return;let a=e;for(;a!==null&&a.startMarker===t&&a.endMarker===n;)N(a,`startMarker`,a.startMarker),N(a,`endMarker`,a.endMarker),a.startMarker=r,a.endMarker=i,a=a.parentBlock}function T_(e,t,n){return e!==null&&t!==null&&n!==null&&e.startMarker===t&&e.endMarker===n}function E_(e,t,n,r,i,a,o,s){if(k?.pending&&!k.crossRenderUpdate)return;let c=e.block,l=H();if(i!==n.branch){if(M!==null&&(n.branch!==-1||l!==null)){let e=n.block;if(n.markerlessBefore!==void 0&&e!==null)Xi(n,r,n.markerlessBefore,e.endMarker);else if(n.start!==null)Xi(n,r,n.borrowed?n.start:z(n.start).previousSibling,n.borrowed?n.end:z(n.end)?.nextSibling??null);else if(n.borrowed&&e?.startMarker==null)Xi(n,r,null,null);else{let t=e?.startMarker??null,i=e?.endMarker??null;if(t!==null&&i!==null&&(R?.view(t)??t).parentNode===r&&(R?.view(i)??i).parentNode===r)Xi(n,r,(R?.view(t)??t).previousSibling,V(i));else{let e=n.anchor;Xi(n,r,e===null?(R?.view(r)??r).lastChild:(R?.view(e)??e).previousSibling,e)}}}let u=xr,d=c.currentRenderMode===`transition`,f=u!==null&&n.block!==null&&n.block.mounted&&n.markerlessBefore===void 0&&a!==null&&l===null&&x_(c),p=M===null||f?u:null,m=!d&&f,h=null,g=n.markerlessBefore;if(g!==void 0&&n.block!==null){let e=n.block;h=e.endMarker;let t=g?V(g):B(r);if(n.block=null,n.markerlessBefore=void 0,L(e,!1),c.disposed)return;for(;t!==null&&t!==h;){let e=V(t);(R?.view(t)??t).parentNode===r&&(R?.view(r)??r).removeChild(t),t=e}}let _=h===null&&n.start===null&&n.block!==null&&n.block.endMarker!==null?n.block.endMarker:n.end,v=M;if(v!==null&&!f&&l===null&&n.block!==null&&n.block.mounted&&!ia(v,n.block)){let l=n.block,u=l.startMarker,d=l.endMarker,f=n.borrowed,p=f?n.start===null?B(r):V(n.start):n.start??u;f&&p===n.end&&(p=null);let m=f?p===null?null:n.end===null?(R?.view(r)??r).lastChild:z(n.end).previousSibling:_;if(a===null){if(n.start!==null)p=V(n.start),p===n.end&&(p=null),m=p===null?null:z(n.end).previousSibling;else{let e=m===null?n.anchor:V(m);if(T_(c,u,d)){let t=(R?.view(document)??document).createComment(o),i=(R?.view(document)??document).createComment(`/`+o);(R?.view(r)??r).insertBefore(t,e),(R?.view(r)??r).insertBefore(i,e),n.start=t,n.end=i,n.borrowed=!1,w_(c,u,d,t,i)}else n.anchor=e,n.end=null}n.block=null,n.branch=i,ta(l,r,p,m);return}let h=p===null?f?n.start:null:m;if(h!==null&&(R?.view(h)??h).parentNode===r){let g=Oh(c,r,h,a,void 0,null,`control-flow`,s,!1,void 0,c.idState.renderOwner?.signalOwner===void 0?void 0:{parent:e,slot:t,kind:n.__kind,branch:i,component:void 0,key:void 0});if(g.suspended||g.failed)throw Ph(g.wip),g.suspended===null?g.error:new Bl(g.suspended);z(g.wip.start).data=o,z(g.wip.end).data=`/`+o,n.start=g.wip.start,n.end=g.wip.end,n.borrowed=!1,n.block=g.wip.block,n.branch=i,f||w_(c,u,d,g.wip.start,g.wip.end),N(g.wip.block,`exclusiveMarkers`,g.wip.block.exclusiveMarkers),g.wip.block.exclusiveMarkers=!0,Ah(g.wip),ta(l,r,p,m);return}}if(p!==null&&n.block!==null&&a!==null&&l===null&&(d||m)&&_!==null){let l=n.block,u=l.startMarker,d=l.endMarker,f=p.render(c,r,_,a,void 0,null,`control-flow`,s,!1,void 0,c.idState.renderOwner?.signalOwner===void 0?void 0:{parent:e,slot:t,kind:n.__kind,branch:i,component:void 0,key:void 0});if(f.suspended||f.failed)throw p.dispose(f.wip),f.failed?f.error:new Bl(f.suspended);if(n.borrowed)p.dispose(f.wip);else{z(f.wip.start).data=o,z(f.wip.end).data=`/`+o;let e=n.start,t=n.end,r=n.block;n.start=f.wip.start,n.end=f.wip.end,n.block=f.wip.block,n.branch=i,w_(c,u,d,f.wip.start,f.wip.end),f.wip.block.exclusiveMarkers=!0,p.splice(f.wip),L(r),e!==null&&((R?.view(e)??e).remove(),(R?.view(t)??t)?.remove()),c.disposed||n.block!==f.wip.block||f.wip.block.disposed;return}}let y=h??(_===null?n.anchor:V(_)),b=n.block,x=b?.startMarker??null,S=b?.endMarker??null,C=T_(c,x,S);if(n.block){if(L(n.block),c.disposed)return;n.block=null}if(n.branch=i,n.start===null&&a!==null&&C){let e=(R?.view(document)??document).createComment(o),t=(R?.view(document)??document).createComment(`/`+o);(R?.view(r)??r).insertBefore(e,y),(R?.view(r)??r).insertBefore(t,y),n.start=e,n.end=t,w_(c,x,S,e,t)}if(n.start!==null){if(a){let e,t,i=!1,o=!1,u=null,d=null;if(l!==null&&l.isOpen(V(n.start))&&(u=V(n.start),d=l.close(u),d!==n.end&&V(d)!==n.end)){if(Ou?.revision!==void 0)throw Error(E(75));P_(V(n.start),n.end),u=null,o=!0}u===null?(e=n.start,t=n.end,i=!0,l!==null&&(l.node=V(n.start))):(e=u,t=d,l.node=V(u));let f=Qs(`control-flow`,c,r,e,t,a,void 0,s);i&&(f.exclusiveMarkers=!0),n.block=f,o?(l.suspend(()=>I(f)),l.node=V(n.end)):I(f)}else if(l!==null&&V(n.start)!==n.end){if(Ou?.revision!==void 0)throw Error(E(75));P_(V(n.start),n.end)}}else if(a){let e=y?(R?.view(y)??y).previousSibling:(R?.view(r)??r).lastChild,t=Qs(`control-flow`,c,r,null,y,a,void 0,s);n.block=t,n.markerlessBefore=e,I(t),C_(n,r,t,o,e,y),w_(c,x,S,t.startMarker,t.endMarker)}else if(!C)n.anchor=y,n.end=null;else{let e=(R?.view(document)??document).createComment(o),t=(R?.view(document)??document).createComment(`/`+o);(R?.view(r)??r).insertBefore(e,y),(R?.view(r)??r).insertBefore(t,y),n.start=e,n.end=t,w_(c,x,S,e,t)}}else if(n.block){n.block.body!==a&&N(n.block,`body`,n.block.body),n.block.extra!==s&&N(n.block,`extra`,n.block.extra),n.block.body=a,n.block.extra=s,I(n.block);let e=n.markerlessBefore;e!==void 0&&C_(n,r,n.block,o,e,n.block.endMarker)}l!==null&&!n.borrowed&&n.end!==null&&(l.node=V(n.end))}function D_(e,t,n,r,i,a,o,s){let c=e.slots[t];if(t===0&&e!==cc&&c?.returnedOutput===!0){if(k?.pending&&!k.crossRenderUpdate)return;if(c.__kind===`ifBlockSlot`)lc(c,!1);else{let t=e.block;if(t.outputHandler(t,null,!0),t.disposed)return;c=void 0}}if(c===void 0){let r=H(),i=null,a=null,s=r?.passthroughRanges===!0,l=s?null:r?.resolveOpen(o??null,n)??null;l!==null&&(i=l,a=r.close(l)),c={__kind:`ifBlockSlot`,anchor:o??null,start:i,end:a,borrowed:s,branch:-1,block:null,markerlessBefore:void 0},e.slots[t]=c,xc(e,c)}let l=+!!r;E_(e,t,c,n,l,l?i:a,`if`,s)}var O_=null;function k_(e,t,n=!0){let r=e.children;if(r!==null)for(let e=0,n=r.length;e<n;e++)t(r[e].scope);let i=e._slots;if(i!==null)for(let e=0,r=i.length;e<r;e++){let r=i[e];if(r.__kind===`forBlockSlot`){for(let e=r.head;e!==null;e=e.nextSibling)t(e);r.emptyBlock&&t(r.emptyBlock)}else if(r.__kind===`childSlot`){if(r.block&&t(r.block),r.forSlot){for(let e=r.forSlot.head;e!==null;e=e.nextSibling)t(e);r.forSlot.emptyBlock&&t(r.forSlot.emptyBlock)}r.portal?.block&&t(r.portal.block)}else r.block&&(t(r.block),n&&r.__kind===`trySlotSlot`&&r.tryBlock&&r.tryBlock!==r.block&&t(r.tryBlock))}}function A_(e,t,n=!0,r=!0,i=null,a=null){let o=e.deoptNode;o!=null&&U(o,t,n,e,i,a);let s=e.refFields;if(s!==null){let r=e.slots[0];if(r!=null)for(let o=0,c=s.length;o<c;o+=3){let c=s[o];if(c===`r`){let c=r[s[o+2]],l=r[s[o+1]]??a?.get(c)?.connected;if(l==null)continue;t.push({ref:l,el:c,scope:e}),n&&!hs(i,c,l)&&xd(l,null,c)}else if(c===`s`){let c=r[s[o+2]];if(c==null)continue;let l=r[s[o+1]],u=(l?.[ff]===!0?l.resolved:l)?.ref??a?.get(c)?.connected;if(u==null)continue;t.push({ref:u,el:c,scope:e}),n&&!hs(i,c,u)&&xd(u,null,c)}else{let c=r[s[o+1]];if(c==null)continue;let l=c._currentRef??a?.get(c)?.connected;if(l==null)continue;t.push({ref:l,el:c,scope:e}),n&&!hs(i,c,l)&&xd(l,null,c)}}}let c=e.slots;for(let r=0,o=c.length;r<o;r++){let o=c[r];if(typeof o==`object`&&o){if(o.anchor!==void 0&&o.el instanceof Element){let r=o.ref??a?.get(o.el)?.connected;r!=null&&(t.push({ref:r,el:o.el,scope:e}),n&&!hs(i,o.el,r)&&xd(r,null,o.el))}o.__kind===`childSlot`&&o.hostNode!=null&&U(o.hostNode,t,n,e,i,a)}}k_(e,e=>A_(e,t,n,r,i,a),r)}function j_(e,t,n=null){A_(e,t,!1,!1,null,n)}function U(e,t,n=!0,r,i=null,a=null){if(!Bh)return;let o=Xh(e)?.props?.ref??a?.get(e)?.connected;o!=null&&(t===null?rs(o,e):(t.push({ref:o,el:e,scope:r}),n&&!hs(i,e,o)&&xd(o,null,e)));let s=B(e);for(;s!==null;){let e=s.$$portalEnd;if(e!=null){s=gg(s,e);continue}U(s,t,n,r,i,a),s=V(s)}}function M_(e,t,n,r,i,a,o,s,c,l,u,d){if(k?.pending&&!k.crossRenderUpdate)return;let f=Array.isArray(r)?r:Array.from(r),p=e.block,m=H(),h=e.slots[t];if(h===void 0){let r,i;m!==null&&m.isOpen(l??null)?(r=l,i=m.close(l),m.node=V(r)):m!==null&&m.isOpen(m.node)?(r=m.node,i=m.close(m.node),m.node=V(r)):(r=(R?.view(document)??document).createComment(`for`),u===!0&&l?.nodeType===8?(i=l,(R?.view(i)??i).data=`/for`,(R?.view(n)??n).insertBefore(r,i)):(i=(R?.view(document)??document).createComment(`/for`),(R?.view(n)??n).insertBefore(r,l??null),(R?.view(n)??n).insertBefore(i,l??null))),h={__kind:`forBlockSlot`,start:r,end:i,items:new Map,head:null,tail:null,size:0,cachedDeps:null,emptyBlock:null,env:void 0,adopt:null,plainDeopt:!1,mappedNative:void 0,selectionItems:void 0,signalSite:d},e.slots[t]=h,xc(e,h)}m!==null&&h.size===0&&(m.node=V(h.start));let g=m?.markerState(h.start)??-1;M!==null&&h.env!==s&&N(h,`env`,h.env),h.env=s;let _=f.length===0;if(_&&c){if(h.size>0&&q_(p,h,f,i,a,!1,!1),h.emptyBlock)h.emptyBlock.body!==c&&N(h.emptyBlock,`body`,h.emptyBlock.body),h.emptyBlock.extra!==h.env&&N(h.emptyBlock,`extra`,h.emptyBlock.extra),h.emptyBlock.body=c,h.emptyBlock.extra=h.env,I(h.emptyBlock);else{j!==null&&Wa(h);let e=!1;m!==null&&(g===1||g===-1&&m.isOpen(V(h.start)))?(P_(V(h.start),h.end),e=!0):m!==null&&(m.node=V(h.start));let t=Qs(`control-flow`,p,n,h.start,h.end,c,void 0,h.env);t.exclusiveMarkers=!0,sa(t),h.emptyBlock=t,e?m.suspend(()=>I(t)):I(t)}m!==null&&(m.node=V(h.end));return}h.emptyBlock&&(Ha()?(Wa(h),Va(h.emptyBlock,h)):L(h.emptyBlock),h.emptyBlock=null),!_&&m!==null&&(g===0||g===-1&&!((o||0)&16)&&V(h.start)!==null&&V(h.start)!==h.end&&!m.isOpen(V(h.start)))&&(P_(V(h.start),h.end),m.node=h.end);let v=o||0,y=!!(v&1),b=!1;if(v&4&&s!==void 0){let e=!!(v&32);e&&j!==null&&M===null?(h.cachedDeps=null,y=!1):(h.cachedDeps!==null&&F_(h.cachedDeps,s)?y=!0:b=!e,M!==null&&h.cachedDeps!==s&&N(h,`cachedDeps`,h.cachedDeps),h.cachedDeps=s)}h.size===0?(W_(p,h,f,i,a,!!(v&2),!!(v&16)),m!==null&&N_(h.end,m)):q_(p,h,f,i,a,y,!!(v&2),b,!!(v&8),!!(v&16)),m!==null&&(m.node=V(h.end))}function N_(e,t){let n=t.node;n!==null&&n!==e&&(R?.view(n)??n).parentNode===(R?.view(e)??e).parentNode&&(dv(()=>Error(E(56))),P_(n,e))}function P_(e,t){let n=e;for(;n!==null&&n!==t;){let e=V(n);(R?.view(n)??n).remove(),n=e}}function F_(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!Object.is(e[r],t[r]))return!1;return!0}function I_(e,t,n){if(j===null&&D===null){t(e.props,e,n);return}let r=O;O=e;let i=D===null?-1:zn(e);try{t(e.props,e,n)}finally{i>=0&&D.endScope(i),O=r}}var L_=4,R_=new Int32Array(L_),z_=16384,B_=null,V_=null;function H_(e,t,n,r,i,a,o,s){let c=M!==null&&!Wi;c&&e.itemIndex!==n&&N(e,`itemIndex`,e.itemIndex),c&&e.body!==r&&N(e,`body`,e.body),i&&e.props===t&&(o||e.itemIndex===n)?(e.itemIndex=n,e.body=r):(c&&(e.props!==t||e.extra!==s)&&j.push(Ni,e,e.props,e.extra),e.props=t,e.body=r,e.itemIndex=n,e.extra=s,a?I_(e,r,s):I(e))}function U_(e,t,n,r){return typeof e==`function`?r?`k`+String(e(t,n)):e(t,n):e[n]}function W_(e,t,n,r,i,a,o,s=!1,c=!1){let l=n.length,u=e.idState.renderOwner?.signalOwner===void 0?void 0:kn(e,t,l,r);if(l===0)return;j!==null&&Wa(t);let d=t.items,f=z(t.end).parentNode,p=t.adopt,m=null,h=null;if(p!==null){m=new Map;for(let e=0;e<p.length;e++){let t=p[e];m.has(t.key)||m.set(t.key,t)}}let g=null;try{for(let p=0;p<l;p++){let l=n[p],_=U_(r,l,p,s);u!==void 0&&u(p,_);let v=null,y=t.end;if(m!==null){y=V(g===null?t.start:g.endMarker);let e=m.get(_);e!==void 0&&(v=e.node,m.delete(_),(h??=new Set).add(v),v!==y&&(Uo===null?(R?.view(f)??f).insertBefore(v,y):(Yo(f,Uo),tv(f,v,y,Uo))))}let b=c?G_(e,f,y,l,p,_,i,t):Q_(e,f,y,l,p,_,i,t,a,o,v);d.set(_,b),b.prevSibling=g,b.nextSibling=null,g?g.nextSibling=b:t.head=b,g=b}t.tail=g,t.size=l}catch(e){for(;g!==null;){let t=g;g=t.prevSibling,d.delete(t.key);let n=c?t.startMarker:null,r=c?t.endMarker:null,i=c&&!Vl(e)&&!Al(e)&&!ju(e);i&&n!==null&&z(n).parentNode!==null&&Qi(z(n).parentNode),Vl(e)&&eu(t),t.idState.renderOwner?.signalOwner===void 0?L(t,!M?.retainedCreated?.has(t)):En(t,e),n!==null&&r!==null&&K_(n,r,i)}throw t.head=null,t.tail=null,t.size=0,e}if(m!==null){let e=0;for(let t=0;t<p.length;t++){let n=p[t];h?.has(n.node)||(p[e++]=n)}p.length=e}}function G_(e,t,n,r,i,a,o,s){let c=H(),l=c.node,u=l!==null&&z(l).parentNode===t?l:n,d=(R?.view(document)??document).createComment(`it`),f=(R?.view(document)??document).createComment(`/it`);(R?.view(t)??t).insertBefore(d,u),(R?.view(t)??t).insertBefore(f,n),j!==null&&Yi(()=>{(R?.view(d)??d).remove(),(R?.view(f)??f).remove()});let p=Qs(`control-flow`,e,t,d,f,o,r,s.env);p.forSlot=s,p.key=a,p.itemIndex=i,sa(p);let m=l===null||l===n||c.isFresh(l),h=c.passthroughRanges;c.passthroughRanges=!0;try{m?c.suspend(()=>I(p)):I(p)}catch(e){Vl(e)&&eu(p);let n=h&&!c.passthroughRanges&&!Vl(e)&&!Al(e)&&!ju(e);throw n&&Qi(t),L(p,!1),K_(d,f,n),e}finally{c.passthroughRanges=h&&c.passthroughRanges}let g=c.node;if((R?.view(t)??t).insertBefore(f,g!==null&&z(g).parentNode===t?g:n),c.node=V(f),c.markFresh(d),c.markFresh(f),m)for(let e=V(d);e!==null&&e!==f;e=V(e))c.markFresh(e);return p}function K_(e,t,n){if(!n){(R?.view(e)??e).remove(),(R?.view(t)??t).remove();return}for(let n=e;n!==null;){let e=V(n);if(bu(n)||(R?.view(n)??n).remove(),n===t)break;n=e}}function q_(e,t,n,r,i,a,o,s=!1,c=!1,l=!1,u=!1){let d=t.items,f=t.size,p=n.length,m=z(t.end).parentNode,h=j!==null;if(f===0){W_(e,t,n,r,i,o,l,u);return}let g=e.idState.renderOwner?.signalOwner===void 0?void 0:kn(e,t,p,r);if(p===0){let e=h&&Y_(t);e&&(Fi.get(t)??-1)<Ii?Ga(t):h&&Wa(t),Z_(t,e?t.items:d,e),t.head=null,t.tail=null,t.size=0;return}let _=t.head,v=0;for(;_!==null&&v<p;){let e=n[v],o=U_(r,e,v,u);if(_.key!==o)break;g!==void 0&&g(v,o);let l=_;(!a||l.props!==e||l.body!==i||l.itemIndex!==v)&&H_(l,e,v,i,a,s,c,t.env),_=l.nextSibling,v++}if(v===p&&_===null)return;let y=t.tail,b=p-1,x=f-v;for(;y!==null&&x>0&&b>=v;){let e=n[b],o=U_(r,e,b,u);if(y.key!==o)break;g!==void 0&&g(b,o);let l=y;(!a||l.props!==e||l.body!==i||l.itemIndex!==b)&&H_(l,e,b,i,a,s,c,t.env),y=l.prevSibling,b--,x--}let S,C;if(x===0?(C=_,S=C?C.prevSibling:t.tail):(S=_.prevSibling,C=y.nextSibling),x===0){h&&Wa(t);let a=C?C.startMarker:t.end,s=S;for(let c=v;c<=b;c++){let f=n[c],p=U_(r,f,c,u);g!==void 0&&g(c,p);let h=Q_(e,m,a,f,c,p,i,t,o,l);d.set(p,h),h.prevSibling=s,h.nextSibling=C,s?s.nextSibling=h:t.head=h,s=h}C?C.prevSibling=s:t.tail=s,t.size+=b-v+1;return}if(v>b){h&&Wa(t);let e=_,n=0;for(;e!==C;){let t=e.nextSibling;Ha()?Va(e):L(e),d.delete(e.key),e=t,n++}S?S.nextSibling=C:t.head=C,C?C.prevSibling=S:t.tail=S,t.size-=n;return}let w=b-v+1,ee=[],te=new Map;for(let e=0;e<w;e++){let t=U_(r,n[v+e],v+e,u);ee[e]=t,te.set(t,e),g!==void 0&&g(v+e,t)}if(S===null&&C===null&&!te.has(_.key)){let r=!1,a=_.nextSibling;for(;a!==null;){if(te.has(a.key)){r=!0;break}a=a.nextSibling}if(!r){h&&Wa(t),Z_(t,d),t.head=null,t.tail=null,t.size=0;let r=null;for(let a=0;a<p;a++){let s=n[a],c=ee[a],u=Q_(e,m,t.end,s,a,c,i,t,o,l);d.set(c,u),u.prevSibling=r,u.nextSibling=null,r?r.nextSibling=u:t.head=u,r=u}t.tail=r,t.size=p;return}}let ne=B_,T;ne!==null&&ne.length>=w?(B_=null,T=ne):T=new Int32Array(w);try{for(let e=0;e<w;e++)T[e]=-1;let r=!1,u=0,f=0,p=_,g=0;for(;p!==C;){let e=p.nextSibling,o=te.get(p.key);if(o===void 0)h&&=(Wa(t),!1),Ha()?Va(p):L(p),d.delete(p.key),t.size--;else{T[o]=g,o<u?r=!0:u=o,f++;let e=v+o,l=n[e];(!a||p.props!==l||p.body!==i||p.itemIndex!==e)&&H_(p,l,e,i,a,s,c,t.env)}p=e,g++}if(!r&&f===w){if(x!==f){let e=S;for(let n=0;n<w;n++){let r=d.get(ee[n]);r.prevSibling=e,e?e.nextSibling=r:t.head=r,e=r}e.nextSibling=C,C?C.prevSibling=e:t.tail=e}return}if(h&&Wa(t),r&&f===w){let e=0;for(let t=0;t<w;t++)if(T[t]!==t){if(e===L_){e=5;break}R_[e++]=t}if(e<=L_){let n=C?C.startMarker:t.end;for(let t=e-1;t>=0;t--){let e=R_[t];$_(d.get(ee[e]),e+1<w?d.get(ee[e+1]).startMarker:n)}for(let n=0;n<e;n++){let e=R_[n],r=d.get(ee[e]),i=e>0?d.get(ee[e-1]):S,a=e+1<w?d.get(ee[e+1]):C;r.prevSibling=i,r.nextSibling=a,i?i.nextSibling=r:t.head=r,a?a.prevSibling=r:t.tail=r}let r=d.get(ee[0]),i=d.get(ee[w-1]);r.prevSibling=S,i.nextSibling=C,S?S.nextSibling=r:t.head=r,C?C.prevSibling=i:t.tail=i;return}}let y=C?C.startMarker:t.end;if(f===w){let e=nv(T,w),n=e.length-1,r=C;for(let i=w-1;i>=0;i--){let a=d.get(ee[i]);n<0||i!==e[n]?$_(a,r?r.startMarker:y):n--,a.nextSibling=r,r?r.prevSibling=a:t.tail=a,r=a}r.prevSibling=S,S?S.nextSibling=r:t.head=r;return}if(r){let e=nv(T,w),t=e.length-1,n=y;for(let r=w-1;r>=0;r--){if(T[r]===-1)continue;let i=d.get(ee[r]);t<0||r!==e[t]?$_(i,n):t--,n=i.startMarker}}let b=S,ne=0;for(let r=0;r<w;r++){let a=ee[r],s;if(T[r]===-1){if(ne<=r)for(ne=r+1;ne<w&&T[ne]===-1;)ne++;let c=ne<w?d.get(ee[ne]).startMarker:y,u=r+v;s=Q_(e,m,c,n[u],u,a,i,t,o,l),d.set(a,s),t.size++}else s=d.get(a);s.prevSibling=b,b?b.nextSibling=s:t.head=s,b=s}b.nextSibling=C,C?C.prevSibling=b:t.tail=b}finally{T.length<=z_&&(B_===null||B_.length<T.length)&&(B_=T)}}var J_=512;function Y_(e){let t=M,n=z(e.start).parentNode;if(t===null||t.aborted||Wi||t.hydrating===!0||e.adopt!==null||e.size<16||n===null||n.nodeType!==1&&n.nodeType!==11||z(e.end).parentNode!==n||z(e.start).previousSibling!==null||V(e.end)!==null)return!1;let r=e.head;for(let e=r;e!==null;e=e.nextSibling)if(!e.mounted||e.idState.renderOwner!==t.owner||e.startMarker===null||e.startMarker!==e.endMarker||e.hooks!==null||e.effectSlots!==null||e.cleanups!==null||e.children!==null||e._slots!==null||e.refFields!==null||e.deoptNode!==null||e.vt!==null)return!1;return!0}function X_(e,t=!1){if(!t&&!Y_(e))return!1;let n=M,r=z(e.start).parentNode,i=e.head,a=n.retired??=new Set,o=[];for(let e=i;e!==null;e=e.nextSibling)a.has(e)||(a.add(e),o.push(e)),e.pending&&(N(e,`pending`,e.pending),e.pending=!1);let s=!1;Yi(()=>{s=!0;for(let e=0;e<o.length;e++)a.delete(o[e])});let c=e.start,l=e.end;return(n.commit??=[]).push(()=>{if(s)return;let t=e.size===0&&(R?.view(c)??c).parentNode===r&&(R?.view(l)??l).parentNode===r&&(R?.view(c)??c).previousSibling===null&&V(l)===null;if(t){let e=V(c);for(let n=i;n!==null;n=n.nextSibling){if(e!==n.startMarker){t=!1;break}e=V(e)}e!==l&&(t=!1)}for(let e=i;e!==null;e=e.nextSibling)e.disposed=!0;if(t)(R?.view(r)??r).textContent=``,(R?.view(r)??r).appendChild(c),(R?.view(r)??r).appendChild(l);else for(let e=i;e!==null;e=e.nextSibling){let t=e.startMarker;(R?.view(t)??t).parentNode!==null&&z((R?.view(t)??t).parentNode).removeChild(t)}}),!0}function Z_(e,t,n=!1){if(Ua(e)){if(X_(e,n)){t.clear();return}let r;for(let t=e.head;t!==null;t=r)r=t.nextSibling,Va(t);t.clear();return}let r=z(e.start).parentNode;if(z(e.start).previousSibling===null&&V(e.end)===null)(R?.view(r)??r).textContent=``,(R?.view(r)??r).appendChild(e.start),(R?.view(r)??r).appendChild(e.end);else if(t.size<J_)P_(V(e.start),e.end);else if(R!==null)R.clearBetween(e.start,e.end);else{let t=document.createRange();t.setStartAfter(e.start),t.setEndBefore(e.end),t.deleteContents()}for(let t=e.head;t!==null;t=t.nextSibling)t.cleanups!==null||t.children!==null||t._slots!==null?L(t,!1):(t.deoptNode!==null&&t.deoptRefs&&U(t.deoptNode,null),t.disposed=!0);t.clear()}function Q_(e,t,n,r,i,a,o,s,c,l,u=null){let d=H();if(d!==null){if(l&&!d.isOpen(d.node)&&(c!==2||s.plainDeopt!==!0||yh(r)&&!bg(r))){if(d.node!==null&&d.node!==s.end&&(c!==2||s.plainDeopt!==!0||d.node.nodeType===1&&z(d.node).parentNode===t)){let n=d.node,l=Qs(`control-flow`,e,t,n,n,o,r,s.env);return l.forSlot=s,l.key=a,l.itemIndex=i,c===2&&s.plainDeopt===!0&&(l.deoptNode=n),I(l),d.node=z(l.endMarker)?.nextSibling??V(n),l}return d.suspend(()=>Q_(e,t,n,r,i,a,o,s,c,l))}if(!d.isOpen(d.node))return d.suspend(()=>Q_(e,t,n,r,i,a,o,s,c,l));let u=d.node,f=d.close(u);d.node=V(u);let p=Qs(`control-flow`,e,t,u,f,o,r,s.env);return p.forSlot=s,p.key=a,p.itemIndex=i,I(p),d.node=V(f),p}if(c===!0||c===2&&yh(r)&&!bg(r)){if(u!==null){let n=Qs(`control-flow`,e,t,u,u,o,r,s.env);return n.forSlot=s,n.key=a,n.itemIndex=i,n.deoptNode=u,sa(n),I(n),n}let c=Qs(`control-flow`,e,t,null,n,o,r,s.env);c.forSlot=s,c.key=a,c.itemIndex=i,I(c);let l=(R?.view(n)??n).previousSibling;return c.startMarker=l,c.endMarker=l,c}let f=(R?.view(document)??document).createComment(`it`),p=(R?.view(document)??document).createComment(`/it`);u===null?((R?.view(t)??t).insertBefore(f,n),(R?.view(t)??t).insertBefore(p,n)):((R?.view(t)??t).insertBefore(f,u),(R?.view(t)??t).insertBefore(p,V(u)));let m=Qs(`control-flow`,e,t,f,p,o,r,s.env);m.forSlot=s,m.key=a,m.itemIndex=i,u!==null&&(m.deoptNode=u,sa(m));try{I(m)}catch(e){throw Vl(e)&&eu(m),L(m,!M?.retainedCreated?.has(m)),e}return m}function $_(e,t){let n=z(e.startMarker).parentNode,r=e.endMarker,i=e.startMarker;if(Uo!==null){Yo(n,Uo),ev(n,i,r,t,Uo);return}for(;i;){let e=i===r,a=V(i);if((R?.view(n)??n).insertBefore(i,t),e)break;i=a}}function ev(e,t,n,r,i){let a=t;for(;a!==null;){let t=a===n,o=V(a);if(tv(e,a,r,i),t)break;a=o}}function tv(e,t,n,r){let i=null;if(Array.isArray(r)){for(let e=0;e<r.length;e++)if(r[e].focused.ownerDocument===t.ownerDocument){i=r[e];break}}else r.focused.ownerDocument===t.ownerDocument&&(i=r);if(R===null){Lt(e,t,n,i?.focused??null,i?.contentEditable??!1);return}let a=i?.focused??null,o=t===a;if(!o&&a!==null&&t.nodeType===1){let e=a;do{if(R.view(t).contains(e)){o=!0;break}e=R.view(e).getRootNode().host}while(e!==void 0)}if(!o){(R?.view(e)??e).insertBefore(t,n);return}let s=(R?.view(e)??e).moveBefore;if(!i.contentEditable&&typeof s==`function`){s.call(e,t,n);return}if(R.view(t).parentNode!==e||n!==null&&R.view(n).parentNode!==e){R.view(e).insertBefore(t,n);return}if(t!==n&&V(t)!==n){if(n===null||((R?.view(t)??t).compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0){let r=V(t);for(;r!==n;){let n=V(r);(R?.view(e)??e).insertBefore(r,t),r=n}}else{let r=V(t),i=n;for(;i!==t;){let t=V(i);(R?.view(e)??e).insertBefore(i,r),i=t}}}}function nv(e,t){let n=V_;(n===null||n.length<t)&&(n=new Int32Array(t),t<=z_&&(V_=n));let r=[];for(let i=0;i<t;i++){let t=e[i];if(t===-1)continue;if(r.length===0||e[r[r.length-1]]<t){n[i]=r.length===0?-1:r[r.length-1],r.push(i);continue}let a=0,o=r.length-1;for(;a<o;){let n=a+o>>1;e[r[n]]<t?a=n+1:o=n}t<e[r[a]]&&(n[i]=a>0?r[a-1]:-1,r[a]=i)}let i=r.length,a=r[i-1];for(;i-->0;)r[i]=a,a=n[a];return r}var rv=null;function iv(e,t){if(t===void 0)return;let{onCaughtError:n,onUncaughtError:r,onRecoverableError:i}=t;(n!==void 0||r!==void 0||i!==void 0)&&(rv??=new WeakMap).set(e,{onCaughtError:n,onUncaughtError:r,onRecoverableError:i})}function av(e){if(rv===null||e===null)return null;let t=e;for(;t.parentBlock!==null;)t=t.parentBlock;return rv.get(t)??null}function ov(e,t){try{e(t)}catch(e){console.error(e)}}function sv(e,t,n){let r=av(e)?.onCaughtError;if(!(r===void 0||n===null||n?.disposed)){if(n!==void 0){let e=s_(n);if(e!==null){let i=()=>{if(n.disposed)return;let e=s_(n);if(e!==null){qc(e,i);return}ov(r,t)};qc(e,i);return}}ov(r,t)}}function cv(e){for(let t=0;t<e.length;t++){let n=e[t];if(!(n.block.disposed||n.state.block!==n.block)){if(o_(n.block,!0)!==null){n.resume();continue}ov(n.handler,n.error)}}}function lv(e,t){let n=av(e)?.onUncaughtError;return n!==void 0&&(ov(n,t),!0)}var uv=null;function dv(e,t=null){if(rv===null)return;let n=t??k,r=av(n)?.onRecoverableError;if(r===void 0)return;let i=n;for(;i.parentBlock!==null;)i=i.parentBlock;let a=uv??=new WeakSet;a.has(i)||(a.add(i),queueMicrotask(()=>{a.delete(i),ov(r,e())}))}var fv=null,pv=(e=>e===void 0?null:e);function mv(e){if(typeof e!=`object`||!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(E(63))}function hv(e){if(e.nodeType!==9){(R?.view(e)??e).textContent=``;return}for(let t=B(e);t!==null;){let n=V(t);t.nodeType!==10&&(R?.view(e)??e).removeChild(t),t=n}}function gv(e){return null}function _v(e,t){t!==null&&t===void 0&&fv.delete(e)}function vv(e){if(!vh(e))return e}function yv(e,t,n,r,i,a,o,s,c){let l,u=!1,d=-1,f=0,p=e=>{let n=!1;ar.set(e,()=>{if(!(n||t!==e)){n=!0;try{l.unmount()}finally{n=!1}}})},m={current:t,signalOwner:s,retry:Vp,request:null,generation:0,wakeable:null,retryKey:null,transaction:null,disposed:!1};i.renderOwner=m;let h=(o,s,d,f)=>{if(u)return;if(je(),t&&!t.disposed&&n===o&&Object.is(r,d)){let e=t;m.request=t=>{m.transaction.rootRequest=!0;let n=e.props;n!==s&&N(e,`props`,n),e.props=s,e.pendingMode=t,I(e)},Do(t);return}if(f===void 0&&t!==null&&!t.disposed&&(yr>0||br>0)){m.request=e=>h(o,s,d,e),Do(t);return}if(!vr&&k===null&&f===void 0&&yr===0&&br===0&&(eo?.interrupt(),u))return;let g=qi(m);m.transaction.rootRequest=!0;let _=t,v=n,y=r,b=e.nodeType!==9&&_!==null&&_.mounted&&!_.disposed&&!ia(m.transaction,_),x=b?B(e):null,S=b?(R?.view(e)??e).lastChild:null;Yi(()=>{t=_,n=v,r=y,m.current=_,_!==null&&p(_)});try{t&&(ar.delete(t),b||L(t),t=null,n=null,r=null);let u=null,h=null;if(b?(u=(R?.view(document)??document).createComment(`root`),h=(R?.view(document)??document).createComment(`/root`),(R?.view(e)??e).append(u,h)):hv(e),t=Qs(`root`,null,e,u,h,o,s,void 0,a),t.idState=i,m.current=t,oa(t),iv(t,c),p(t),n=o,r=d,f===void 0&&(yr>0||br>0)){t.pending=!0,t.pendingMode=`transition`,A.push(t),!_r&&!gr&&(gr=!0,queueMicrotask(Io));return}let g=t;g.pendingMode=f??null;try{I(g),A.length>0&&jo(g)}catch(e){try{y_(g,e)}catch(e){let n=m.transaction;if(n!==null&&ca(n),t!==null&&!t.disposed&&L(t),!lv(g,e))throw e;return}m.wakeable===null&&l.unmount();return}b&&ta(_,e,x,S),!_r&&!gr&&(gr=!0,queueMicrotask(Io))}finally{Ji(g),!vr&&M===null&&ua()}};return l={render(e,i){if(u)throw Error(E(29));if(!vr&&k===null&&!wo()&&yr===0&&br===0&&(eo?.interrupt(),u))return;if(wo()||k!==null){if(d!==Co&&(d=Co,f=0),++f>So){t!==null&&!t.disposed&&(t.nestedUpdateError=!0,Do(t));return}}else Co++,d=Co,f=0;let a,o=null;vh(e)?(arguments.length,o=e.key??null,typeof e.type==`function`?(a=e.type,i=e.props):(a=pv,i=e)):typeof e==`function`?a=e:(a=pv,i=typeof e==`symbol`?null:e),m.transition!==void 0&&t!==null&&!t.disposed&&n===a&&Object.is(r,o)&&xr.keepsRoot(m,!0)||(m.transition!==void 0&&xr.discardRoot(m),m.generation++,m.wakeable=null),t!==null&&!t.disposed&&n===a&&Object.is(r,o)&&(vr?F?.refreshPublishingOwner(m):eo?.refreshPendingOwner(m)),m.nativeRetry?.clear(),m.retrySignalOwners!==void 0&&Tn(m),m.retryKey=null,m.request=null,m.transaction?.aborted===!0&&(m.transaction=null),m.retry=()=>h(a,i,o),h(a,i,o)},unmount(){if(arguments.length,u)return;let a=null;if(m.bindingLeases!==void 0)for(let e of m.bindingLeases){let t=ku.get(e);t?.revision!==void 0&&j_(t.scope,a??=[])}if(a!==null&&m.generation++,!(!vr&&k===null&&!wo()&&fr===0&&(eo?.interrupt(),u))){if(!vr&&k===null&&!wo()&&fr===0&&Co++,u=!0,m.disposed=!0,m.controlLeases!==void 0){for(let e of m.controlLeases.values())e!==void 0&&(e.owner=void 0);m.controlLeases.clear()}if(m.bindingLeases!==void 0){for(let e of m.bindingLeases){Ee(e),ku.delete(e);try{m.preservePresentation||e.retire()}catch(e){lv(t,e)||console.error(e)}}m.bindingLeases.clear()}m.nativeRetry?.clear(),m.retrySignalOwners!==void 0&&Tn(m),m.retry=Vp,m.transition!==void 0&&xr.discardRoot(m),m.generation++,m.wakeable=null,m.request=null,m.transaction!==null&&ca(m.transaction);try{t&&(ar.delete(t),cs(a,()=>L(t,!1)),ls(),m.preservePresentation||hv(e),zs(),t=null,n=null,r=null)}finally{i.signalState?.opaqueKeys?.clear(),D?.clearDeferredRefs(m),m.current=null,m.retry=Vp,m.adopt=void 0,m.initialDocumentSignals=void 0,m.retryKey=null,m.transaction=null,up(e,!0),_v(e,o)}}}},t!==null&&(p(t),m.adopt=e=>{t!==null&&ar.delete(t),t=e,m.current=e,p(e)}),l}function bv(e,t,n){if(mv(e),t?.bindingLeases!==void 0||t?.controlLeases!==void 0)throw Error(E(76));t=vv(t);let r=gv(e);lp(e,!0);let i=(t?.identifierPrefix??``)+`r`+(Xn++).toString(36)+`-`;return yv(e,null,null,null,{prefix:i,next:0,signalState:{prefix:t?.signalInstancePrefix??i,next:0}},n,r,t?.signalOwner??(en?nn(e):void 0),t)}function xv(e,t){return bv(e,t,dc)}function Sv(e={}){let t=new Map,n=e.slotlessPrefix===void 0?null:new Map,r=e.parentPrefix??``,i=e.tagPrefix??`:`,a=e.parentDescriptionFallback??``,o=e.includeParentDescription!==!1,s=e.global===!1?Symbol:Symbol.for,c=e.slotlessGlobal===!1||e.slotlessGlobal===void 0&&e.global===!1?Symbol:Symbol.for;return(l,u)=>{if(l===void 0){if(n===null)return;let t=n.get(u);return t===void 0&&(t=c(e.slotlessPrefix+u),n.set(u,t)),t}let d=t.get(l);d===void 0&&t.set(l,d=new Map);let f=d.get(u);if(f===void 0){let e=o?l.description??a:``;f=s(r+e+i+u),d.set(u,f)}return f}}Sv(),An(1,!0);var Cv=_u(`<div></div><!>`,0,1),wv=Wn(5),Tv=e=>e.id;function Ev(e,t,n){let r=t.block;wh(t,0,r.parentNode,kv,{entry:e},r.endMarker,void 0,void 0,void 0,void 0,`c:17138c58`)}function Dv(e,t,n){let r=t.block,i=n[0];Th(t,0,r.parentNode,Av,{contentComponent:i},r.endMarker,void 0,void 0,void 0,void 0,`c:f7809913`)}var Ov=[`s`,`d`,`c`];function kv({entry:e}){return e.portal}var Av=function({contentComponent:e},t,n){let r=t.block,i=ol(t,wv+0),a=i.auto,o=a===void 0?[]:a,s=yl(e.subscribe,e.getSnapshot,e.getServerSnapshot,wv+0),c=Object.values(s);if(!t.block.pending||t.block.crossRenderUpdate){{let e=c;{let n=e;(t.slots[0]===void 0||o[1]!==!0||!al(o[0],n))&&(M_(t,0,r.parentNode,e,Tv,Ev,9,void 0,null,r.endMarker),o===a&&(o=o.slice()),o[0]=n,o[1]=!0)}}o!==a&&(i.auto=o)}};function jv(){let e=new Set,t={},n=!1,r=()=>{!n&&e.size&&(n=!0,queueMicrotask(()=>{n=!1,e.forEach(e=>e())}))};return{subscribe(t){return e.add(t),()=>e.delete(t)},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(e,n){t={...t,[e]:{id:e,portal:$m(n.reactElement,n.element)}},r()},removeRenderer(e){let n={...t};delete n[e],t=n,r()}}}var Mv=function(e,t,n){let r=t.block,{editor:i,innerRef:a,ref:o,...s}=e,c=i,l=dl(null,wv+1),[u,d]=Lc(null,wv+2);tl(()=>{if(!c||c.isDestroyed||c.isEditorContentInitialized)return;let e=l.current,t=c.view.dom?.parentNode;if(!e||!t)return;e.append(...t.childNodes),c.setOptions({element:e});let n=jv();return c.contentComponent=n,c.createNodeViews(),c.isEditorContentInitialized=!0,d(n),()=>{c.isEditorContentInitialized=!1,c.isDestroyed||c.view.setProps({nodeViews:{},markViews:{}}),c.contentComponent=null;try{let e=c.view.dom?.parentNode;if(!e)return;let t=document.createElement(`div`);t.append(...e.childNodes),c.setOptions({element:t})}catch{}}},[c],wv+3);let f=t.slots[0];if(f===void 0){let e,n,i,c,u,d,p=Su(Cv),m=zu(p);e=of(s),n=[o??null,a??null,l],i=m,c=wf(t,void 0,m,[[!0,e],[!1,`ref`,n]],`b:f51c1afa`,!1),u=r.parentNode,d=Bu(m,1),Cu(p,r.parentNode,r.endMarker),f=Eu(t,null,e,n,i,c,u,d,null,void 0),t.refFields=Ov}else{f.a=of(s);{let e=[o??null,a??null,l];f.b!==e&&(f.b=e)}f.d=wf(t,f.d,f.c,[[!0,f.a],[!1,`ref`,f.b]],`b:f51c1afa`,!1)}f.i=Fg(t,f.i,1,f.c,Object.prototype.propertyIsEnumerable.call(f.d.resolved,`children`)?f.d.resolved.children:void 0,`b:f51c1afa`,null,void 0,void 0,void 0,!0);{let e=u;D_(t,2,f.e,e,Dv,null,f.f,e?[u]:void 0)}},Nv=e_(function(e,t,n){let r=t.block,i=ol(t,wv+4),a=i.hooks;a===void 0&&(i.hooks=a=cl(3));let o,s=(o=e.editor,a[0]!==!0||!al(a[1],o)?ll(a,0,Math.floor(Math.random()*4294967295).toString(),o):a[2]);(!t.block.pending||t.block.crossRenderUpdate)&&Rg(t,0,r.parentNode,_h(`c:c25bf200`,Mv,{key:s,...e}),r.endMarker)});function Pv(e){this.content=e}Pv.prototype={constructor:Pv,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 Pv(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 Pv(n)},addToStart:function(e,t){return new Pv([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Pv(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 Pv(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=Pv.from(e),e.size?new Pv(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Pv.from(e),e.size?new Pv(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Pv.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}},Pv.from=function(e){if(e instanceof Pv)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Pv(t)};function Fv(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&&Rv(e.charCodeAt(r-1))&&Lv(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=Fv(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Iv(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&&Rv(e.charCodeAt(i-1))&&Lv(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=Iv(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function Lv(e){return e>=56320&&e<57344}function Rv(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 Fv(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Iv(this,e,t,n)}findIndex(e){if(e==0)return Bv(0,e);if(e==this.size)return Bv(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?Bv(t+1,i):Bv(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 zv={index:0,offset:0};function Bv(e,t){return zv.index=e,zv.offset=t,zv}function Vv(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(!Vv(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Vv(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Hv=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&&Vv(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`);return n.create(t.attrs)}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}};Hv.none=[];var Uv=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=Gv(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(Wv(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 Wv(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(Wv(a.content,t-i-1,n-i-1)))}function Gv(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=Gv(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 Kv(e,t,n){if(n.openStart>e.depth)throw new Uv(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Uv(`Inconsistent open depths`);return qv(e,t,n,0)}function qv(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=qv(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Qv(a,ey(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Qv(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=ty(n,e);return Qv(a,$v(e,i,o,t,r))}}function Jv(e,t){if(!t.type.compatibleContent(e.type))throw new Uv(`Cannot join `+t.type.name+` onto `+e.type.name)}function Yv(e,t,n){let r=e.node(n);return Jv(r,t.node(n)),r}function Xv(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 Zv(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&&(Xv(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Xv(i.child(e),r);t&&t.depth==n&&t.textOffset&&Xv(t.nodeBefore,r)}function Qv(e,t){if(!e.type.validContent(t))throw new Uv(`Invalid content for node `+e.type.name);return e.copy(t)}function $v(e,t,n,r,i){let a=e.depth>i&&Yv(e,t,i+1),o=r.depth>i&&Yv(n,r,i+1),s=[];return Zv(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Jv(a,o),Xv(Qv(a,$v(e,t,n,r,i+1)),s)):(a&&Xv(Qv(a,ey(e,t,i+1)),s),Zv(t,n,i,s),o&&Xv(Qv(o,ey(n,r,i+1)),s)),Zv(r,null,i,s),new W(s)}function ey(e,t,n){let r=[];return Zv(null,e,n,r),e.depth>n&&Xv(Qv(Yv(e,t,n+1),ey(e,t,n+1)),r),Zv(t,null,n,r),new W(r)}function ty(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 ny=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 Hv.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 oy(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=ay.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 ay.set(t,r=new ry);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%iy,i}},ry=class{constructor(){this.elts=[],this.i=0}},iy=12,ay=new WeakMap,oy=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)}},sy=Object.create(null),cy=class e{constructor(e,t,n,r=Hv.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&&Vv(this.attrs,t||e.defaultAttrs||sy)&&Hv.sameSet(this.marks,n||Hv.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 Kv(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 ny.resolveCached(this,e)}resolveNoCache(e){return ny.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()+`)`),uy(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),dy(this.type.attrs,this.attrs,`node`,this.type.name);let e=Hv.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];dy(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!Hv.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);return e.nodeType(t.type).create(t.attrs,r,n)}};cy.prototype.text=void 0;var ly=class e extends cy{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):uy(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 uy(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function dy(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])}var fy=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new py(t,n);if(r.next==null)return e.empty;let i=my(r);r.next&&r.err(`Unexpected trailing text`);let a=wy(xy(i));return Ty(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(`\n`)}};fy.empty=new fy(!0);var py=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 my(e){let t=[];do t.push(hy(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function hy(e){let t=[];do t.push(gy(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function gy(e){let t=by(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=vy(e,t);else break;return t}function _y(e){/\\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function vy(e,t){let n=_y(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:_y(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function yy(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 by(e){if(e.eat(`(`)){let t=my(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=yy(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 xy(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 Sy(e,t){return t-e}function Cy(e,t){let n=[];return r(t),n.sort(Sy);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 wy(e){let t=Object.create(null);return n(Cy(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]);Cy(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new fy(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Sy);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Ty(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 Ey(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 Dy(e,t){let n=Object.create(null);for(let r in e){let i=e[r],a=t&&t[r];if(a===void 0){if(i.hasDefault)a=i.default;else throw RangeError(`No value supplied for attribute `+r)}else i.validate&&i.validate(a);n[r]=a}return n}function Oy(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new jy(e,r,t[r]);return n}var ky=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=Oy(e,n.attrs),this.defaultAttrs=Ey(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==fy.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:Dy(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new cy(this,this.computeAttrs(e),W.from(t),Hv.setFrom(n))}createChecked(e=null,t,n){return t=W.from(t),this.checkContent(t),new cy(this,this.computeAttrs(e),t,Hv.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 cy(this,e,t.append(i),Hv.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){}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:Hv.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 Ay(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 jy=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Ay(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},My=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Oy(e,r.attrs),this.excluded=null;let i=Ey(this.attrs);this.instance=i?new Hv(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Hv(this,Dy(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]}excludes(e){return this.excluded.indexOf(e)>-1}},Ny=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=Pv.from(e.nodes),t.marks=Pv.from(e.marks||{}),this.nodes=ky.compile(this.spec.nodes,this),this.marks=My.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]=fy.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?Py(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==``?[]:Py(this,n.split(` `))}this.nodeFromJSON=e=>cy.fromJSON(this,e),this.markFromJSON=e=>Hv.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 ky))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 ly(n,n.defaultAttrs,e,Hv.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 Py(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 Fy(e){return e.tag!=null}function Iy(e){return e.style!=null}var Ly=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Fy(e))this.tags.push(e);else if(Iy(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 Ky(this,t,!1);return n.addAll(e,Hv.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ky(this,t,!0);return n.addAll(e,Hv.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(Jy(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=Yy(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=Yy(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)))}},Ry={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},zy={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},By={ol:!0,ul:!0},Vy=1,Hy=2,Uy=4;function Wy(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Vy:0)|(t===`full`?Hy:0)}var Gy=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=Hv.none,this.match=i||(a&Uy?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&Vy)){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&&!Ry.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Ky=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=Wy(null,t.preserveWhitespace,0)|(n?Uy:0);i=r?new Gy(r.type,r.attrs,Hv.none,!0,t.topMatch||r.type.contentMatch,a):n?new Gy(null,null,Hv.none,!0,null,a):new Gy(e.schema.topNodeType,null,Hv.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&Hy?`full`:this.localPreserveWS||(r.options&Vy)>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,`\n`);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;By.hasOwnProperty(a)&&this.parser.normalizeLists&&qy(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:zy.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(Ry.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(`\n`),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=Hv.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Xy(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=Wy(e,i,a.options);a.options&Uy&&a.content.length==0&&(o|=Uy);let s=Hv.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):Xy(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new Gy(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|=Vy);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 qy(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&By.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Jy(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Yy(e){let t={};for(let n in e)t[n]=e[n];return t}function Xy(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 Zy=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=$y(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 $y(t).createTextNode(e.text);let{dom:n,contentDOM:r}=rb($y(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&&rb($y(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:rb(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=Qy(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Qy(e.marks)}};function Qy(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function $y(e){return e.document||window.document}var eb=new WeakMap;function tb(e){let t=eb.get(e);return t===void 0&&eb.set(e,t=nb(e)),t}function nb(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 rb(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=tb(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}=rb(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var ib=65535,ab=2**16;function ob(e,t){return e+t*ab}function sb(e){return e&ib}function cb(e){return(e-(e&ib))/ab}var lb=1,ub=2,db=4,fb=8,pb=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&fb)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&db)>0}},mb=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=sb(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+cb(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:ob(o/3,e-s),f=0;return c&&(f|=e==s?ub:e==u?lb:db,(t<0?e!=s:e!=u)&&(f|=fb)),new pb(a,f,d)}r+=l-c}return n?e+r:new pb(e+r,0,null)}touches(e,t){let n=0,r=sb(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])}};mb.empty=new mb([]);var hb=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 pb(e,r,null)}},gb=Object.create(null),_b=class{getMap(){return mb.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=gb[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in gb)throw RangeError(`Duplicate use of step JSON ID `+e);return gb[e]=t,t.prototype.jsonID=e,t}},vb=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 Uv)return e.fail(t.message);throw t}}};function yb(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(yb(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return W.fromArray(r)}var bb=class e extends _b{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(yb(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 vb.fromReplace(e,this.from,this.to,i)}invert(){return new xb(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))}};_b.jsonID(`addMark`,bb);var xb=class e extends _b{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(yb(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return vb.fromReplace(e,this.from,this.to,n)}invert(){return new bb(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))}};_b.jsonID(`removeMark`,xb);var Sb=class e extends _b{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return vb.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return vb.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 Cb(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))}};_b.jsonID(`addNodeMark`,Sb);var Cb=class e extends _b{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return vb.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return vb.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 Sb(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))}};_b.jsonID(`removeNodeMark`,Cb);var wb=class e extends _b{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Eb(e,this.from,this.to)?vb.fail(`Structure replace would overwrite content`):vb.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new mb([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)}};wb.MAP_BIAS=1,_b.jsonID(`replace`,wb);var Tb=class e extends _b{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&&(Eb(e,this.from,this.gapFrom)||Eb(e,this.gapTo,this.to)))return vb.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return vb.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?vb.fromReplace(e,this.from,this.to,n):vb.fail(`Content does not fit in gap`)}getMap(){return new mb([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)}};_b.jsonID(`replaceAround`,Tb);function Eb(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 Db(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 xb(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new bb(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Ob(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 My){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 xb(t.from,t.to,t.style)))}function kb(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 wb(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 xb(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 wb(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 Ab(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function jb(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||!Ab(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Mb(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 Tb(c,l,o,s,new G(u.append(f),d,p),u.size-d,!0))}function Nb(e,t,n=null,r=e){let i=Fb(e,t),a=i&&Ib(r,t);return a?i.map(Pb).concat({type:t,attrs:n}).concat(a.map(Pb)):null}function Pb(e){return{type:e,attrs:null}}function Fb(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 Ib(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 Lb(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 Tb(i,a,i,a,new G(r,0,0),n.length,!0))}function Rb(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)&&Vb(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&&Bb(e,t,n,a),kb(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 Tb(c,l,c+1,l-1,new G(W.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&zb(e,t,n,a),!1}})}function zb(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 Bb(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(`\n`))}})}function Vb(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Hb(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 Tb(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new G(W.from(o),0,0),1,!0))}function Ub(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 Wb(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 wb(t,t,new G(a.append(o),n,n),!0))}function Gb(e,t){let n=e.resolve(t),r=n.index();return qb(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Kb(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 qb(e,t){return!!(e&&t&&!e.isLeaf&&Kb(e,t))}function Jb(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&&qb(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 Yb(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);Bb(e,r.node(),r.before(),s)}o.inlineContent&&kb(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 wb(l,c.map(t+n,-1),G.empty,!0)),r===!0){let t=e.doc.resolve(l);zb(e,t.node(),t.before(),e.steps.length)}return e}function Xb(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 Zb(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 Qb(e,t,n=t,r=G.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return $b(i,a,r)?new wb(t,n,r):new ex(i,a,r).fit()}function $b(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var ex=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 Tb(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new wb(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=rx(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;return cx(e,-1)<=t?!1:(this.unplaced.size>1&&cx(e,1)>n&&n++,this.unplaced=new G(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=rx(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new G(tx(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new G(tx(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(ix(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=nx(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(tx(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new G(tx(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||!ax(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=ax(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=ax(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=nx(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=nx(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=nx(this.placed,this.frontier.length,e))}};function tx(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(tx(e.firstChild.content,t-1,n)))}function nx(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(nx(e.lastChild.content,t-1,n)))}function rx(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function ix(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,ix(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 ax(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&&!ox(n,a.content,o)?s:null}function ox(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function sx(e){return e.spec.defining||e.spec.definingForContent}function cx(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function lx(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if($b(i,a,r))return e.step(new wb(t,n,r));let o=px(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=sx(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(ux(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 ux(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(ux(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 dx(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Xb(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new G(W.from(r),0,0))}function fx(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=px(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 px(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 mx=class e extends _b{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 vb.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 vb.fromReplace(e,this.pos,this.pos+1,new G(W.from(r),0,+!t.isLeaf))}getMap(){return mb.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)}};_b.jsonID(`attr`,mx);var hx=class e extends _b{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 vb.ok(n)}getMap(){return mb.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)}};_b.jsonID(`docAttr`,hx);var gx=class extends Error{};gx=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},gx.prototype=Object.create(Error.prototype),gx.prototype.constructor=gx,gx.prototype.name=`TransformError`;var _x=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new hb}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new gx(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=Qb(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 lx(this,e,t,n),this}replaceRangeWith(e,t,n){return dx(this,e,t,n),this}deleteRange(e,t){return fx(this,e,t),this}lift(e,t){return Mb(this,e,t),this}join(e,t=1){return Yb(this,e,t),this}wrap(e,t){return Lb(this,e,t),this}setBlockType(e,t=e,n,r=null){return Rb(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Hb(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new mx(e,t,n)),this}setDocAttribute(e,t){return this.step(new hx(e,t)),this}addNodeMark(e,t){return this.step(new Sb(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof Hv)t.isInSet(n.marks)&&this.step(new Cb(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Cb(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 Wb(this,e,t,n),this}addMark(e,t,n){return Db(this,e,t,n),this}removeMark(e,t,n){return Ob(this,e,t,n),this}clearIncompatible(e,t,n){return kb(this,e,t,n),this}},vx=Object.create(null),K=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new yx(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&&Dx(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),Dx(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new q(e):Ex(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?Ex(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Ex(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 wx(e.node(0))}static atStart(e){return Ex(e,e,0,0,1)||new wx(e)}static atEnd(e){return Ex(e,e,e.content.size,e.childCount,-1)||new wx(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=vx[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in vx)throw RangeError(`Duplicate use of selection JSON ID `+e);return vx[e]=t,t.prototype.jsonID=e,t}getBookmark(){return q.between(this.$anchor,this.$head).getBookmark()}};K.prototype.visible=!0;var yx=class{constructor(e,t){this.$from=e,this.$to=t}},bx=!1;function xx(e){!bx&&!e.parent.inlineContent&&(bx=!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){xx(e),xx(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 Sx(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 Sx=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 Cx(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 Cx=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Sx(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)}},wx=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 Tx}};K.jsonID(`all`,wx);var Tx={map(){return this},resolve(e){return new wx(e)}};function Ex(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=Ex(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 Dx(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof wb||i instanceof Tb))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 Ox=1,kx=2,Ax=4,jx=class extends _x{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|Ox)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ox)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=kx,this}ensureMarks(e){return Hv.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&kx)>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)||Hv.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|=Ax,this}get scrolledIntoView(){return(this.updated&Ax)>0}};function Mx(e,t){return!t||!e?e:e.bind(t)}var Nx=class{constructor(e,t,n){this.name=e,this.init=Mx(t.init,n),this.apply=Mx(t.apply,n)}},Px=[new Nx(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Nx(`selection`,{init(e,t){return e.selection||K.atStart(t.doc)},apply(e){return e.selection}}),new Nx(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Nx(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Fx=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Px.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 Nx(e.key,e.spec.state,e))})}},Ix=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 jx(this)}static create(t){let n=new Fx(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 Fx(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 Fx(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=cy.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 Lx(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Lx(i,t,{})),n[r]=i}return n}var Rx=class{constructor(e){this.spec=e,this.props={},e.props&&Lx(e.props,this,this.props),this.key=e.key?e.key.key:Bx(`plugin`)}getState(e){return e[this.key]}},zx=Object.create(null);function Bx(e){return e in zx?e+`$`+ ++zx[e]:(zx[e]=0,e+`$`)}var Vx=class{constructor(e=`key`){this.key=Bx(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Hx=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Ux(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var Wx=(e,t,n)=>{let r=Ux(e,n);if(!r)return!1;let i=Xx(r);if(!i){let n=r.blockRange(),i=n&&jb(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(mS(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Jx(a,`end`)||J.isSelectable(a)))for(let n=r.depth;;n--){let o=Qb(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(Jx(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},Gx=(e,t,n)=>{let r=Ux(e,n);if(!r)return!1;let i=Xx(r);return i?qx(e,i,t):!1},Kx=(e,t,n)=>{let r=Zx(e,n);if(!r)return!1;let i=eS(r);return i?qx(e,i,t):!1};function qx(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=Qb(e.doc,i,o,G.empty);if(!s||s.from!=i||s instanceof wb&&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 Jx(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 Yx=(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=Xx(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 Xx(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 Zx(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var Qx=(e,t,n)=>{let r=Zx(e,n);if(!r)return!1;let i=eS(r);if(!i)return!1;let a=i.nodeAfter;if(mS(e,i,t,1))return!0;if(r.parent.content.size==0&&(Jx(a,`start`)||J.isSelectable(a))){let n=Qb(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(Jx(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},$x=(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=eS(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 eS(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 tS=(e,t)=>{let n=e.selection,r=n instanceof J,i;if(r){if(n.node.isTextblock||!Gb(e.doc,n.from))return!1;i=n.from}else if(i=Jb(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},nS=(e,t)=>{let n=e.selection,r;if(n instanceof J){if(n.node.isTextblock||!Gb(e.doc,n.to))return!1;r=n.to}else if(r=Jb(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},rS=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&jb(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},iS=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`\n`).scrollIntoView()),!0)};function aS(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 oS=(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=aS(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},sS=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof wx||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=aS(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},cS=(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(Ub(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&jb(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function lS(e){return(t,n)=>{if(t.selection instanceof J&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!Ub(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 wx)&&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=aS(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=Ub(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,Ub(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 uS=lS(),dS=(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)},fS=(e,t)=>(t&&t(e.tr.setSelection(new wx(e.doc))),!0);function pS(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||Gb(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function mS(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&pS(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 Tb(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&&Gb(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&&jb(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&Jx(a,`start`,!0)&&Jx(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 Tb(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 hS(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 gS=hS(-1),_S=hS(1);function vS(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&Nb(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function yS(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 bS(...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 xS=bS(Hx,Wx,Yx),SS=bS(Hx,Qx,$x),CS={Enter:bS(iS,sS,cS,uS),\"Mod-Enter\":oS,Backspace:xS,\"Mod-Backspace\":xS,\"Shift-Backspace\":xS,Delete:SS,\"Mod-Delete\":SS,\"Mod-a\":fS},wS={\"Ctrl-h\":CS.Backspace,\"Alt-Backspace\":CS[`Mod-Backspace`],\"Ctrl-d\":CS.Delete,\"Ctrl-Alt-Backspace\":CS[`Mod-Delete`],\"Alt-Delete\":CS[`Mod-Delete`],\"Alt-d\":CS[`Mod-Delete`],\"Ctrl-a\":gS,\"Ctrl-e\":_S};for(let e in CS)wS[e]=CS[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function TS(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 ES(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function ES(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 oy(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new oy(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=Nb(a,n,r,t);return s?(e&&DS(e,t,s,i,n),!0):!1}function DS(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 Tb(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&&Ub(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function OS(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?kS(t,n,e,a):AS(t,n,a):!0:!1}}function kS(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Tb(a-1,o,a,o,new G(W.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new oy(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=jb(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Gb(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function AS(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 Tb(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 jS(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 Tb(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var MS=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},NS=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},PS=null,FS=function(e,t,n){let r=PS||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},IS=function(){PS=null},LS=function(e,t,n,r){return n&&(zS(e,t,n,r,-1)||zS(e,t,n,r,1))},RS=/^(img|br|input|textarea|hr)$/i;function zS(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:BS(e))){let n=e.parentNode;if(!n||!Y(n)||KS(e)||RS.test(e.nodeName)||e.contentEditable==`false`)return!1;t=MS(e)+(i<0?0:1),e=n}else if(Y(e)){let n=e.childNodes[t+(i<0?-1:0)];if(Y(n)&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?BS(e):0}else return!1}}function BS(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Y(e){return e.nodeType==1}function VS(e){return e.nodeType==3}function HS(e,t){return t?e.contains(Y(t)?t:t.parentNode):!1}function US(e,t){for(;;){if(VS(e)&&t)return e;if(Y(e)&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=BS(e)}else if(e.parentNode&&!KS(e))t=MS(e),e=e.parentNode;else return null}}function WS(e,t){for(;;){if(VS(e)&&t<e.nodeValue.length)return e;if(Y(e)&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!KS(e))t=MS(e)+1,e=e.parentNode;else return null}}function GS(e,t,n){for(let r=t==0,i=t==BS(e);r||i;){if(e==n)return!0;let t=MS(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==BS(e)}}function KS(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 qS=function(e){return e.focusNode&&LS(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function JS(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function YS(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function XS(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(BS(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(BS(r.startContainer),r.startOffset)}}}var ZS=typeof navigator<`u`?navigator:null,QS=typeof document<`u`?document:null,$S=ZS&&ZS.userAgent||``,eC=/Edge\\/(\\d+)/.exec($S),tC=/MSIE \\d/.exec($S),nC=/Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec($S),rC=!!(tC||nC||eC),iC=tC?document.documentMode:nC?+nC[1]:eC?+eC[1]:0,aC=!rC&&/gecko\\/(\\d+)/i.test($S);aC&&+(/Firefox\\/(\\d+)/.exec($S)||[0,0])[1];var oC=!rC&&/Chrome\\/(\\d+)/.exec($S),sC=!!oC,cC=oC?+oC[1]:0,lC=!rC&&!!ZS&&/Apple Computer/.test(ZS.vendor),uC=lC&&(/Mobile\\/\\w+/.test($S)||!!ZS&&ZS.maxTouchPoints>2),dC=uC||(ZS?/Mac/.test(ZS.platform):!1),fC=ZS?/Win/.test(ZS.platform):!1,pC=/Android \\d/.test($S),mC=!!QS&&`webkitFontSmoothing`in QS.documentElement.style,hC=mC?+(/\\bAppleWebKit\\/(\\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function gC(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 _C(e,t){return typeof e==`number`?e:e[t]}function vC(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 yC(e,t,n){if(!PC(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(!Y(o)){o=NS(o);continue}let e=o==a.body,n=e?gC(a):vC(o),s=0,c=0;if(t.top<n.top+_C(r,`top`)?c=-(n.top-t.top+_C(i,`top`)):t.bottom>n.bottom-_C(r,`bottom`)&&(c=t.bottom-t.top>n.bottom-n.top?t.top+_C(i,`top`)-n.top:t.bottom-n.bottom+_C(i,`bottom`)),t.left<n.left+_C(r,`left`)?s=-(n.left-t.left+_C(i,`left`)):t.right>n.right-_C(r,`right`)&&(s=t.right-n.right+_C(i,`right`)),s||c){if(e)a.defaultView.scrollBy(s,c);else{let e=o.scrollLeft,n=o.scrollTop;c&&(o.scrollTop+=c),s&&(o.scrollLeft+=s);let r=o.scrollLeft-e,i=o.scrollTop-n;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i}}}let l=e?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(l))break;o=l==`absolute`?o.offsetParent:NS(o)}}function bC(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:xC(e.dom)}}function xC(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=NS(r));return t}function SC({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;CC(n,r==0?0:r-t)}function CC(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 wC=null;function TC(e){if(e.setActive)return e.setActive();if(wC)return e.focus(wC);let t=xC(e);e.focus(wC==null?{get preventScroll(){return wC={preventScroll:!0},!0}}:void 0),wC||(wC=!1,CC(t,0))}function EC(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(Y(u))e=u.getClientRects();else if(VS(u))e=FS(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&&VS(n)?{left:p.right<t.left?p.right:p.left,top:t.top}:t,Y(u)&&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&&VS(n)?DC(n,i):!n||r?{node:e,offset:a}:EC(n,i)}function DC(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=FC(r,1);if(n.top!=n.bottom&&OC(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function OC(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function kC(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function AC(e,t,n){let{node:r,offset:i}=EC(t,n),a=-1;if(Y(r)&&!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 jC(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(Y(t.dom)&&(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 MC(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(Y(n)){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(OC(t,i))return MC(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function NC(e,t){let n=e.dom.ownerDocument,r,i=0,a=XS(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)){let n=e.dom.getBoundingClientRect();if(!OC(t,n)||(o=MC(e.dom,t,n),!o))return null}if(lC)for(let e=o;r&&e;e=NS(e))e.draggable&&(r=void 0);if(o=kC(o,t),r){if(aC&&Y(r)&&(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;mC&&i&&Y(r)&&Y(n=r.childNodes[i-1])&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&Y(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||!Y(r)||r.childNodes[i-1].nodeName!=`BR`)&&(s=jC(e,r,i,t))}s??=AC(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function PC(e){return e.top<e.bottom||e.left<e.right}function FC(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(PC(e))return e}return Array.prototype.find.call(n,PC)||e.getBoundingClientRect()}var IC=/[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;function LC(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=mC||aC;if(VS(r)){if(o&&(IC.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=FC(FS(r,i,i),n);if(aC&&i&&/\\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=FC(FS(r,i-1,i-1),-1);if(t.top==e.top){let n=FC(FS(r,i,i+1),-1);if(n.top!=e.top)return RC(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++,RC(FC(FS(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==BS(r))){let e=r.childNodes[i-1];if(Y(e))return zC(e.getBoundingClientRect(),!1)}if(a==null&&i<BS(r)){let e=r.childNodes[i];if(Y(e))return zC(e.getBoundingClientRect(),!0)}return zC(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==BS(r))){let e=r.childNodes[i-1],t=VS(e)?FS(e,BS(e)-+!o):Y(e)&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return RC(FC(t,1),!1)}if(a==null&&i<BS(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?VS(e)?FS(e,0,+!o):Y(e)?e:null:null;if(t)return RC(FC(t,-1),!0)}return RC(FC(VS(r)?FS(r):r,-n),n>=0)}function RC(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 zC(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 BC(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 VC(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return BC(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=LC(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(Y(e))t=e.getClientRects();else if(VS(e))t=FS(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 HC=/[\\u0590-\\u08ac]/;function UC(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?!HC.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:BC(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&&!HS(l,u)||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 WC=null,GC=null,KC=!1;function qC(e,t,n){return WC==t&&GC==n?KC:(WC=t,GC=n,KC=n==`up`||n==`down`?VC(e,t,n):UC(e,t,n))}var JC=0,YC=1,XC=2,ZC=3,QC=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=JC,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&&HS(this.contentDOM,e)){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>MS(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=!!(e.compareDocumentPosition(this.contentDOM)&4);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)&&!(Y(a)?HS(a,e):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){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof aw||e instanceof $C&&e.side>=0))break}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?MS(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?MS(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=MS(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=MS(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(!Y(t)||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((aC||lC)&&e==t){let{node:e,offset:t}=o;if(VS(e)){if(u=!!(t&&e.nodeValue[t-1]==`\n`),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:MS(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(aC&&l.focusNode&&l.focusNode!=s.node&&Y(l.focusNode)){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&lC)&&LS(o.node,o.offset,l.anchorNode,l.anchorOffset)&&LS(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&aC)){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?XC:YC,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=ZC:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?XC:ZC}n=a}this.dirty=XC}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?XC:YC;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},$C=class extends QC{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){let e=Y(a)?a:document.createElement(`span`);e!=a&&e.appendChild(a),e.hasAttribute(`contenteditable`)||(e.contentEditable=`false`),e.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==JC&&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}},ew=class extends QC{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}},tw=class e extends QC{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=Zy.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&ZC||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ZC&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=JC){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=JC}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=Sw(a,n,o,r)),t>0&&(a=Sw(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()}},nw=class e extends QC{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(!VS(u))throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Zy.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=pw(u,r,n),l?c=new ow(t,n,r,i,u,d||null,f,l):n.isText?new iw(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=>Y(t)&&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==JC&&e.eq(this.node)&&mw(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 gw(this,a&&a.node,e),c=this.node.inlineContent,l=c&&this.node.isBlock;yw(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?Hv.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,u,d)=>{s.syncToMarks(t.marks,n,e,d),l&&t.isAtom&&!t.isText&&s.addHackNode(`IMG`,s.top);let f;s.findNodeMatch(t,a,u,d)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(f=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,u,f,e)||s.updateNextNode(t,a,u,e,d,r)||s.addNode(t,a,u,e,r),r+=t.nodeSize,c&&(l=t.isAtom&&!t.isText)}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==XC)&&(a&&this.protectLocalComposition(e,a),sw(this.contentDOM,this.children,e),uC&&bw(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=xw(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 ew(this,i,t,r);e.input.compositionNodes.push(a),this.children=Sw(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==ZC||!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=JC}updateOuterDeco(e){if(mw(e,this.outerDeco))return;let t=!Y(this.nodeDOM),n=this.dom;this.dom=dw(this.dom,this.nodeDOM,uw(this.outerDeco,this.node,t),uw(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){Y(this.nodeDOM)&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){Y(this.nodeDOM)&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function rw(e,t,n,r,i){pw(r,t,e);let a=new nw(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var iw=class e extends nw{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==ZC||this.dirty!=JC&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=JC||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=JC,!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=ZC)}get domAtom(){return!1}isText(e){return this.node.text==e}},aw=class extends QC{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==JC&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},ow=class extends nw{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==ZC)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 sw(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=hw(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof tw){let t=r?r.previousSibling:e.lastChild;sw(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=hw(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var cw=function(e){e&&(this.nodeName=e)};cw.prototype=Object.create(null);var lw=[new cw];function uw(e,t,n){if(e.length==0)return lw;let r=n?lw[0]:new cw,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new cw(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new cw(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 dw(e,t,n,r){if(n==lw&&r==lw)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=lw[0],i=t)}fw(i,o||lw[0],a)}return i}function fw(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 pw(e,t,n){return dw(e,e,lw,uw(t,n,!Y(e)))}function mw(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 hw(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var gw=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=_w(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=JC,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 tw&&t.dirty!=ZC&&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=tw.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==ZC&&a.dom==a.contentDOM&&(a.dirty=XC),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 nw){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!=ZC&&mw(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=XC,u.updateChildren(r,a+1),u.dirty=JC),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)||!mw(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=nw.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=nw.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 $C(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 tw;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof iw)||/\\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\\s$/.test(e.node.text))&&((lC||sC)&&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 aw(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||Y(e)&&e.contains(this.lock.parentNode))}};function _w(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 tw)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 vw(e,t){return e.type.side-t.type.side}function yw(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(vw);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 bw(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 xw(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 Sw(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 Cw(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(qS(n)){for(c=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&J.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&GS(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new J(o==e?s:r.resolve(e))}else if(aC&&t==`key`&&o>e.state.selection.to&&Y(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if(getComputedStyle(e).overflow!=`visible`){l=K.findFrom(r.resolve(i.posAtStart),1);break}if(e==i.dom||e.nextSibling||!e.parentNode||!Y(e.parentNode))break}}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=Pw(e,u,s,n)}return l}function ww(e){return e.editable?e.hasFocus():Iw(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Tw(e,t=!1){let n=e.state.selection;if(Mw(e,n),!ww(e))return;let r=e.input.mouseDown;if(!t&&sC&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&LS(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)jw(e);else{let{anchor:r,head:i}=n,a,o;Ew&&!(n instanceof q)&&(n.$from.parent.inlineContent||(a=Dw(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Dw(e,n.to))),e.docView.setSelection(r,i,e,t),Ew&&(a&&kw(a),o&&kw(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Aw(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var Ew=lC||sC&&cC<63;function Dw(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(lC&&i&&i.contentEditable==`false`)return Ow(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Ow(i);if(a)return Ow(a)}}function Ow(e){return e.contentEditable=`true`,lC&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function kw(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Aw(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(()=>{(!ww(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function jw(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,MS(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&rC&&iC<=11&&(n.disabled=!0,n.disabled=!1)}function Mw(e,t){if(t instanceof J){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Nw(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Nw(e)}function Nw(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function Pw(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||q.between(t,n,r)}function Fw(e){return e.editable&&!e.hasFocus()?!1:Iw(e)}function Iw(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return HS(e.dom,t.anchorNode)&&(e.editable||HS(e.dom,t.focusNode))}catch{return!1}}function Lw(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return LS(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Rw(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 zw(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Bw(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 zw(e,new q(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=Rw(e.state,t);return n&&n instanceof J?zw(e,n):!1}if(!(dC&&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)?zw(e,new J(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):zw(e,new q(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1}}else if(r instanceof J&&r.node.isInline)return zw(e,new q(t>0?r.$to:r.$from));else{let n=Rw(e.state,t);return n?zw(e,n):!1}}function Vw(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`):Y(e)&&e.contentEditable==`false`}function Hw(e,t){return t<0?Uw(e):Ww(e)}function Uw(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(aC&&Y(n)&&r<BS(n)&&Vw(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(!Y(n))break;let e=n.childNodes[r-1];if(Vw(e,-1))i=n,a=--r;else if(VS(e))n=e,r=n.nodeValue.length;else break}else if(Gw(n))break;else{let t=n.previousSibling;for(;t&&Vw(t,-1);)i=n.parentNode,a=MS(t),t=t.previousSibling;if(t)n=t,r=BS(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?Jw(e,n,r):i&&Jw(e,i,a)}function Ww(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=BS(n),a,o;for(;;)if(r<i){if(!Y(n))break;let e=n.childNodes[r];if(Vw(e,1))a=n,o=++r;else break}else if(Gw(n))break;else{let t=n.nextSibling;for(;t&&Vw(t,1);)a=t.parentNode,o=MS(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=BS(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&Jw(e,a,o)}function Gw(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Kw(e,t){for(;e&&t==e.childNodes.length&&!KS(e);)t=MS(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(VS(n))return n;if(Y(n)&&n.contentEditable==`false`)break;e=n,t=0}}function qw(e,t){for(;e&&!t&&!KS(e);)t=MS(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(VS(n))return n;if(Y(n)&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function Jw(e,t,n){if(!VS(t)){let e,r;(r=Kw(t,n))?(t=r,n=0):(e=qw(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(qS(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&&Tw(e)},50)}function Yw(e,t){let n=e.state.doc.resolve(t);if(!(sC||fC)&&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 Xw(e,t,n){let r=e.state.selection;if(r instanceof q&&!r.empty||n.indexOf(`s`)>-1||dC&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=Rw(e.state,t);if(n&&n instanceof J)return zw(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof wx?K.near(n,t):K.findFrom(n,t);return o?zw(e,o):!1}return!1}function Zw(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 Qw(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function $w(e){if(!lC||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&Y(t)&&n==0&&t.firstChild&&Y(t.firstChild)&&t.firstChild.contentEditable==`false`){let n=t.firstChild;Qw(e,n,`true`),setTimeout(()=>Qw(e,n,`false`),20)}return!1}function eT(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function tT(e,t){let n=t.keyCode,r=eT(t);if(n==8||dC&&n==72&&r==`c`)return Zw(e,-1)||Hw(e,-1);if(n==46&&!t.shiftKey||dC&&n==68&&r==`c`)return Zw(e,1)||Hw(e,1);if(n==13||n==27)return!0;if(n==37||dC&&n==66&&r==`c`){let t=n==37?Yw(e,e.state.selection.from)==`ltr`?-1:1:-1;return Bw(e,t,r)||Hw(e,t)}if(n==39||dC&&n==70&&r==`c`){let t=n==39?Yw(e,e.state.selection.from)==`ltr`?1:-1:1;return Bw(e,t,r)||Hw(e,t)}return n==38||dC&&n==80&&r==`c`?Xw(e,-1,r)||Hw(e,-1):n==40||dC&&n==78&&r==`c`?$w(e)||Xw(e,1,r)||Hw(e,1):!(r!=(dC?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function nT(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`)||Zy.fromSchema(e.state.schema),s=fT(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&Y(l)&&(u=dT[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&&Y(l)&&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,`\n\n`),slice:t}}function rT(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,`\n`))),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=Zy.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=hT(n),mC&&gT(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&&!Y(e);)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Ly.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!iT.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=_T(uT(s,+u[1],+u[2]),u[4]);else if(s=G.maxOpen(aT(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=uT(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var iT=/^(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 aT(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&&sT(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=cT(a[a.length-1],i.length));let n=oT(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return W.from(a)}return e}function oT(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,W.from(e));return e}function sT(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=sT(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(oT(n,e,i+1))))}}function cT(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,cT(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(W.empty,!0);return e.copy(n.append(r))}function lT(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=lT(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 uT(e,t,n){return t<e.openStart&&(e=new G(lT(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new G(lT(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var dT={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 fT(){return document.implementation.createHTMLDocument(`title`)}var pT=null;function mT(e){let t=window.trustedTypes;if(!t)return e;if(!pT){if(pT=t.defaultPolicy)try{return pT.createHTML(e)}catch{}pT=t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e})}return pT.createHTML(e)}function hT(e){let t=/^(\\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=fT(),r=n.body,i=/<([a-z][^>\\s]+)/i.exec(e),a;if((a=i&&dT[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>`</`+e+`>`).reverse().join(``)),r.innerHTML=mT(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 gT(e){let t=e.querySelectorAll(sC?`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 _T(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{i=W.from(t.create(r[e+1],i))}catch{break}a++,o++}return new G(i,a,o)}var vT={},yT={},bT={touchstart:!0,touchmove:!0},xT=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 ST(e){for(let t in vT){let n=vT[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{DT(e,t)&&!ET(e,t)&&(e.editable||!(t.type in yT))&&n(e,t)},bT[t]?{passive:!0}:void 0)}lC&&e.dom.addEventListener(`input`,()=>null),TT(e)}function CT(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function wT(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 TT(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>ET(e,t))})}function ET(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function DT(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 OT(e,t){!ET(e,t)&&vT[t.type]&&(e.editable||!(t.type in yT))&&vT[t.type](e,t)}yT.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!GT(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(pC&&sC&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),uC&&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,JS(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||tT(e,n)?n.preventDefault():CT(e,`key`)}},yT.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},yT.keypress=(e,t)=>{let n=t;if(GT(e)||!n.charCode||n.ctrlKey&&!n.altKey||dC&&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 kT(e){return{left:e.clientX,top:e.clientY}}function AT(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function jT(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 MT(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta(`pointer`,!0),e.dispatch(r)}function NT(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(MT(e,new J(n)),!0):!1}function PT(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&&(MT(e,J.create(e.state.doc,i)),!0)}function FT(e,t,n,r,i){return jT(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?PT(e,n):NT(e,n))}function IT(e,t,n,r){return jT(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function LT(e,t,n,r){return jT(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||RT(e,n,r)}function RT(e,t,n){if(n.button!=0)return!1;let r=zT(e,t,!0),i=e.state.doc;return r?(MT(e,r),r instanceof q&&i.eq(e.state.doc)&&(e.input.mouseDown=new WT(e,r)),!0):!1}function zT(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 BT(e){return ZT(e)}var VT=dC?`metaKey`:`ctrlKey`;vT.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=BT(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&AT(n,e.input.lastClick)&&!n[VT]&&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(kT(n));o&&(a==`singleClick`?e.input.mouseDown=new UT(e,o,n,!!r):(a==`doubleClick`?IT:LT)(e,o.pos,o.inside,n)?n.preventDefault():CT(e,`pointer`))};var HT=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}},UT=class extends HT{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[VT],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&&Y(s.nodeDOM)?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&&aC&&!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()),CT(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||Tw(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(kT(e))),this.updateAllowDefault(e),this.allowDefault||!t?CT(this.view,`pointer`):FT(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||lC&&this.mightDrag&&!this.mightDrag.node.isAtom||sC&&!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)?(MT(this.view,K.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):CT(this.view,`pointer`)}move(e){this.updateAllowDefault(e),CT(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}},WT=class extends HT{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(),CT(this.view,`pointer`);let t=this.view.posAtCoords(kT(e)),n=t&&zT(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];MT(this.view,q.create(r,a,o))}};vT.touchstart=e=>{e.input.lastTouch=Date.now(),BT(e),CT(e,`pointer`)},vT.touchmove=e=>{e.input.lastTouch=Date.now(),CT(e,`pointer`)},vT.contextmenu=e=>BT(e);function GT(e,t){return e.composing?!0:lC&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var KT=pC?5e3:-1;yT.compositionstart=yT.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof q&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||sC&&fC&&qT(e)))e.markCursor=e.state.storedMarks||n.marks(),ZT(e,!0),e.markCursor=null;else if(ZT(e,!t.selection.empty),aC&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&Y(n)&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(VS(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}JT(e,KT)};function qT(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!Y(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return Y(r)&&r.contentEditable==`false`}yT.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++,JT(e,20))};function JT(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>ZT(e),t))}function YT(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function XT(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=US(t.focusNode,t.focusOffset),r=WS(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 ZT(e,t=!1){if(!(pC&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),YT(e),t||e.docView&&e.docView.dirty){let n=Cw(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 QT(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 $T=rC&&iC<15||uC&&hC<604;vT.copy=yT.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=$T?null:n.clipboardData,{dom:o,text:s}=nT(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):QT(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function eE(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function tE(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?nE(e,r.value,null,i,t):nE(e,r.textContent,r.innerHTML,i,t)},50)}function nE(e,t,n,r,i){let a=rT(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=eE(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 rE(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,` `):``}yT.paste=(e,t)=>{let n=t;if(e.composing&&!pC)return;let r=$T?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&nE(e,rE(r),r.getData(`text/html`),i,n)?n.preventDefault():tE(e,n)};var iE=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},aE=dC?`altKey`:`ctrlKey`;function oE(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[aE]:!n}vT.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(kT(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&&Y(n.target)){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}=nT(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!sC||cC>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData($T?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,$T||n.dataTransfer.setData(`text/plain`,c),e.dragging=new iE(l,oE(e,n),o)},vT.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},yT.dragover=yT.dragenter=(e,t)=>t.preventDefault(),yT.drop=(e,t)=>{try{sE(e,t,e.dragging)}finally{e.dragging=null}};function sE(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(kT(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=rT(e,rE(t.dataTransfer),$T?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&oE(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?Zb(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(Pw(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}vT.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())&&Tw(e)},20))},vT.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)},vT.beforeinput=(e,t)=>{if(pC&&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,JS(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 yT)vT[e]=yT[e];function cE(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 lE=class e{constructor(e,t){this.toDOM=e,this.spec=t||mE,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 fE(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&&cE(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},uE=class e{constructor(e,t){this.attrs=e,this.spec=t||mE}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 fE(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&cE(this.attrs,t.attrs)&&cE(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},dE=class e{constructor(e,t){this.attrs=e,this.spec=t||mE}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 fE(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&&cE(this.attrs,t.attrs)&&cE(this.spec,t.spec)}destroy(){}},fE=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 lE(n,r))}static inline(t,n,r,i){return new e(t,n,new uE(r,i))}static node(t,n,r,i){return new e(t,n,new dE(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof uE}get widget(){return this.type instanceof lE}},pE=[],mE={},hE=class e{constructor(e,t){this.local=e.length?e:pE,this.children=t.length?t:pE}static create(e,t){return t.length?CE(t,e,0,mE):gE}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==gE||e.maps.length==0?this:this.mapInner(e,t,0,0,n||mE)}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?vE(this.children,o||[],t,n,r,i,a):o?new e(o.sort(wE),pE):gE}add(t,n){return n.length?this==gE?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=xE(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,CE(s,e,o+1,mE)),a+=3}});let o=yE(a?SE(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(wE):this.local,i||this.children)}remove(e){return e.length==0||this==gE?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==gE?(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):gE}forChild(t,n){if(this==gE)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 uE){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(wE),pE);return r?new _E([t,r]):t}return r||gE}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 TE(this.localsInner(e))}localsInner(e){if(this==gE)return pE;if(e.inlineContent||!this.local.some(uE.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof uE||t.push(this.local[e]);return t}forEachSet(e){e(this)}};hE.empty=new hE([],[]),hE.removeOverlap=TE;var gE=hE.empty,_E=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,mE));return e.from(r)}forChild(t,n){if(n.isLeaf)return hE.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=gE&&(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?TE(n?t:t.sort(wE)):pE}static from(t){switch(t.length){case 0:return gE;case 1:return t[0];default:return new e(t.every(e=>e instanceof hE)?t:t.reduce((e,t)=>e.concat(t instanceof hE?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function vE(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==gE?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=CE(bE(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 hE(t.sort(wE),s)}function yE(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 fE(i.from+t,i.to+t,i.type))}return n}function bE(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 xE(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 SE(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function CE(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=xE(e,t,o+n);if(s){a=!0;let e=CE(s,t,n+o+1,r);e!=gE&&i.push(o,o+t.nodeSize,e)}});let o=yE(a?SE(e):e,-n).sort(wE);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 hE(o,i):gE}function wE(e,t){return e.from-t.from||e.to-t.to}function TE(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),EE(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),EE(t,i,r.copy(a.from,r.to)));break}}return t}function EE(e,t,n){for(;t<e.length&&wE(n,e[t])>0;)t++;e.splice(t,0,n)}function DE(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=gE&&t.push(r)}),e.cursorWrapper&&t.push(hE.create(e.state.doc,[e.cursorWrapper.deco])),_E.from(t)}var OE={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},kE=rC&&iC<=11,AE=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}},jE=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new AE,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]);rC&&iC<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():lC&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),kE&&(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,OE)),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(Fw(this.view)){if(this.suppressingSelectionUpdates)return Tw(this.view);if(rC&&iC<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&LS(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=NS(n))t.add(n);for(let r=e.anchorNode;r;r=NS(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:VS(n)?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)&&Fw(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||sC&&(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&&Y(t);){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(aC&&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||LE(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&&qS(n)&&(c=Cw(e))&&c.eq(K.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Tw(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),PE(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,RE(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Tw(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),VS(r)&&(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(rC&&iC<=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?MS(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?MS(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})}},ME=new WeakMap,NE=!1;function PE(e){if(!ME.has(e)&&(ME.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=aC,NE)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.`),NE=!0}}function FE(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return LS(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function IE(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return FE(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?FE(e,n):null}function LE(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 RE(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||!Y(e)||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 zE(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&&HS(e.dom,d)&&(u=[{node:d,offset:l.anchorOffset}],qS(l)||u.push({node:l.focusNode,offset:l.focusOffset})),sC&&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`)||Ly.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:BE(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 BE=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName==`BR`&&t.parentNode){if(lC&&/^(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||lC&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==`IMG`&&t.getAttribute(`mark-placeholder`))return{ignore:!0};return null},VE=/^(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 HE(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=Cw(e,t);if(n&&!e.state.selection.eq(n)){if(sC&&pC&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,JS(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=zE(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=JE(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(uC&&e.input.lastIOSEnter>Date.now()-225||pC)&&i.some(e=>Y(e)&&!VE.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,JS(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=UE(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)),rC&&iC<=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((uC&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&KE(l.doc,h.pos,g.pos))&&e.someProp(`handleKeyDown`,t=>t(e,JS(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&GE(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,JS(8,`Backspace`)))){pC&&sC&&e.domObserver.suppressSelectionUpdates();return}sC&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),pC&&!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,JS(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=UE(e,n.doc,l.sel);t&&!(sC&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||rC&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v){if(h.pos==g.pos){rC&&iC<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Tw(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=WE(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 UE(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Pw(e,t.resolve(n.anchor),t.resolve(n.head))}function WE(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 GE(e,t,n,r,i){if(n-t<=i.pos-r.pos||qE(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(qE(a,!0,!0));return!o.parent.isTextblock||o.pos>n||qE(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function KE(e,t,n){let r=0,i=0;return e.nodesBetween(t,n,(e,a)=>{e.isTextblock&&a>=t&&a<n?r++:(e.isText?/\\S/.test(e.text.slice(Math.max(0,t-a),Math.min(e.nodeSize,n-a))):e.isLeaf)&&i++}),i==0&&r==1}function qE(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 JE(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 YE=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 xT,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(nD),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=QE(this),ZE(this),this.nodeViews=eD(this),this.docView=rw(this.state.doc,XE(this),DE(this),this.dom,this),this.domObserver=new jE(this,(e,t,n,r)=>HE(this,e,t,n,r)),this.domObserver.start(),ST(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&&TT(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(nD),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&&(YT(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=eD(this);tD(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&TT(this),this.editable=QE(this),ZE(this);let o=DE(this),s=XE(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&&bC(this);if(i){this.domObserver.stop();let t=l&&(rC||sC)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&$E(n.selection,e.selection);if(l){let n=sC?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=XT(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=rw(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())&&Lw(this)&&i.delaySelUpdate())?Tw(this,t):(Mw(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&&SC(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&HS(this.dom,e)&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof J){let t=this.docView.domAfterPos(this.state.selection.from);Y(t)&&yC(this,t.getBoundingClientRect(),e)}else yC(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 iE(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(rC){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&&TC(this.dom),Tw(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 NC(this,e)}coordsAtPos(e,t=1){return LC(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 qC(this,t||this.state,e)}pasteHTML(e,t){return nE(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return nE(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return nT(this,e)}destroy(){this.docView&&(wT(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],DE(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,IS())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return OT(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?lC&&this.root.nodeType===11&&YS(this.dom.ownerDocument)==this.dom&&IE(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};YE.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function XE(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`,[fE.node(0,e.state.doc.content.size,t)]}function ZE(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:fE.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function QE(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function $E(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 eD(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 tD(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 nD(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 rD={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:`'`},iD={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`\"`},aD=typeof navigator<`u`&&/Mac/.test(navigator.platform),oD=typeof navigator<`u`&&/MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent),sD=0;sD<10;sD++)rD[48+sD]=rD[96+sD]=String(sD);for(var sD=1;sD<=24;sD++)rD[sD+111]=`F`+sD;for(var sD=65;sD<=90;sD++)rD[sD]=String.fromCharCode(sD+32),iD[sD]=String.fromCharCode(sD);for(var cD in rD)iD.hasOwnProperty(cD)||(iD[cD]=rD[cD]);function lD(e){var t=!(aD&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||oD&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?iD:rD)[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 uD=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),dD=typeof navigator<`u`&&/Win/.test(navigator.platform);function fD(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))uD?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 pD(e){let t=Object.create(null);for(let n in e)t[fD(n)]=e[n];return t}function mD(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 hD(e){return new Rx({props:{handleKeyDown:gD(e)}})}function gD(e){let t=pD(e);return function(e,n){let r=lD(n),i,a=t[mD(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[mD(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(dD&&n.ctrlKey&&n.altKey)&&(i=rD[n.keyCode])&&i!=r){let r=t[mD(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var _D=Object.defineProperty,vD=(e,t)=>{for(var n in t)_D(e,n,{get:t[n],enumerable:!0})};function yD(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 bD=class{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}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)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:yD({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}},xD={};vD(xD,{blur:()=>SD,clearContent:()=>CD,clearNodes:()=>wD,command:()=>TD,createParagraphNear:()=>ED,cut:()=>DD,deleteCurrentNode:()=>OD,deleteNode:()=>AD,deleteRange:()=>jD,deleteSelection:()=>FD,enter:()=>ID,exitCode:()=>LD,extendMarkRange:()=>WD,first:()=>GD,focus:()=>QD,forEach:()=>$D,insertContent:()=>eO,insertContentAt:()=>oO,joinBackward:()=>lO,joinDown:()=>cO,joinForward:()=>uO,joinItemBackward:()=>dO,joinItemForward:()=>fO,joinTextblockBackward:()=>pO,joinTextblockForward:()=>mO,joinUp:()=>sO,keyboardShortcut:()=>_O,lift:()=>yO,liftEmptyBlock:()=>bO,liftListItem:()=>xO,newlineInCode:()=>SO,resetAttributes:()=>TO,scrollIntoView:()=>EO,selectAll:()=>DO,selectNodeBackward:()=>OO,selectNodeForward:()=>kO,selectParentNode:()=>AO,selectTextblockEnd:()=>jO,selectTextblockStart:()=>MO,setContent:()=>PO,setMark:()=>Ak,setMeta:()=>jk,setNode:()=>Mk,setNodeSelection:()=>Nk,setTextDirection:()=>Pk,setTextSelection:()=>Fk,sinkListItem:()=>Ik,splitBlock:()=>Rk,splitListItem:()=>zk,toggleList:()=>Gk,toggleMark:()=>Kk,toggleNode:()=>qk,toggleWrap:()=>Jk,undoInputRule:()=>Yk,unsetAllMarks:()=>Xk,unsetMark:()=>Zk,unsetTextDirection:()=>Qk,updateAttributes:()=>$k,wrapIn:()=>eA,wrapInList:()=>tA});var SD=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),CD=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),wD=()=>({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=jb(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},TD=e=>t=>e(t),ED=()=>({state:e,dispatch:t})=>sS(e,t),DD=(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},OD=()=>({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 kD(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 AD=e=>({tr:t,state:n,dispatch:r})=>{let i=kD(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},jD=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},MD=e=>e.content?/^text(\\*|\\+)/.test(e.content):!1,ND=(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 MD(r)?n===`left`?e.start()-1:e.end()+1:e.pos},PD=(e,t,n)=>({from:ND(e,n,`left`),to:ND(t,n,`right`)}),FD=()=>({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}=PD(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.scrollIntoView(),t(n)}return!0},ID=()=>({commands:e})=>e.keyboardShortcut(`Enter`),LD=()=>({state:e,dispatch:t})=>oS(e,t);function RD(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function zD(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:RD(t[r])?t[r].test(e[r]):t[r]===e[r])}function BD(e,t,n={}){return e.find(e=>e.type===t&&zD(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function VD(e,t,n={}){return!!BD(e,t,n)}function HD(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(!BD([...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&&VD([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&VD([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function UD(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 WD=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=UD(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=HD(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},GD=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 KD(e){return e instanceof q}function qD(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function JD(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,qD(0,i,a),qD(e.content.size,i,a)):q.create(e,qD(t,i,a),qD(t,i,a))}function YD(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function XD(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function ZD(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var QD=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(XD()||YD())&&r.dom.focus(),ZD()&&!XD()&&!YD()&&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&&!KD(n.state.selection))return o(),!0;let s=JD(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},$D=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),eO=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),tO=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&&tO(r)}return e};function nO(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 tO(n)}function rO(e,t,n){if(e instanceof cy||e instanceof W)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,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),rO(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new Ny({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?Ly.fromSchema(a).parseSlice(nO(e),n.parseOptions):Ly.fromSchema(a).parse(nO(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=Ly.fromSchema(t);return n.slice?r.parseSlice(nO(e),n.parseOptions).content:r.parse(nO(e),n.parseOptions)}return rO(``,t,n)}function iO(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof wb||i instanceof Tb))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 aO=e=>!(`type`in e),oO=(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{rO(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=rO(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;if((aO(i)?i:[i]).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 f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof W){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&iO(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},sO=()=>({state:e,dispatch:t})=>tS(e,t),cO=()=>({state:e,dispatch:t})=>nS(e,t),lO=()=>({state:e,dispatch:t})=>Wx(e,t),uO=()=>({state:e,dispatch:t})=>Qx(e,t),dO=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Jb(e.doc,e.selection.$from.pos,-1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},fO=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Jb(e.doc,e.selection.$from.pos,1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},pO=()=>({state:e,dispatch:t})=>Gx(e,t),mO=()=>({state:e,dispatch:t})=>Kx(e,t);function hO(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function gO(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))XD()||hO()?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 _O=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=gO(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 vO(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?kD(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=>zD(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var yO=(e,t={})=>({state:n,dispatch:r})=>vO(n,kD(e,n.schema),t)?rS(n,r):!1,bO=()=>({state:e,dispatch:t})=>cS(e,t),xO=e=>({state:t,dispatch:n})=>OS(kD(e,t.schema))(t,n),SO=()=>({state:e,dispatch:t})=>iS(e,t);function CO(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function wO(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 TO=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=CO(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=kD(e,r.schema)),s===`mark`&&(o=UD(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,wO(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(wO(a.attrs,t))))})})}),c},EO=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),DO=()=>({tr:e,dispatch:t})=>{if(t){let t=new wx(e.doc);e.setSelection(t)}return!0},OO=()=>({state:e,dispatch:t})=>Yx(e,t),kO=()=>({state:e,dispatch:t})=>$x(e,t),AO=()=>({state:e,dispatch:t})=>dS(e,t),jO=()=>({state:e,dispatch:t})=>_S(e,t),MO=()=>({state:e,dispatch:t})=>gS(e,t);function NO(e,t,n={},r={}){return rO(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var PO=(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=NO(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function FO(e,t){let n=UD(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 IO(e,t){let n=new _x(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function LO(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}function RO(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function zO(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 BO(e){return t=>zO(t.$from,e)}function X(e,t,n){return e.config[t]===void 0&&e.parent?X(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?X(e.parent,t,n):null}):e.config[t]}function VO(e){return e.map(e=>{let t=X(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...VO(t())]:e}).flat(10)}function HO(e,t){let n=Zy.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function UO(e){return typeof e==`function`}function Z(e,t=void 0,...n){return UO(e)?t?e.bind(t)(...n):e(...n):e}function WO(e={}){return Object.keys(e).length===0&&e.constructor===Object}function GO(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function KO(e){let t=[],{nodeExtensions:n,markExtensions:r}=GO(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=X(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=X(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 qO(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 JO(e){let t=[],n=qO(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 YO(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{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([...JO(n[e]),...JO(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function XO(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)=>YO(e,t),{})}function ZO(e){return typeof e==`string`?e.match(/^[+-]?(?:\\d*\\.)?\\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function QO(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):ZO(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function $O(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&WO(t)?!1:t!=null))}function ek(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function tk(e,t){let n=KO(e),{nodeExtensions:r,markExtensions:i}=GO(e),a=r.find(e=>X(e,`topNode`))?.name;return new Ny({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=$O({...e.reduce((e,t)=>{let n=X(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:Z(X(r,`content`,a)),marks:Z(X(r,`marks`,a)),group:Z(X(r,`group`,a)),inline:Z(X(r,`inline`,a)),atom:Z(X(r,`atom`,a)),selectable:Z(X(r,`selectable`,a)),draggable:Z(X(r,`draggable`,a)),code:Z(X(r,`code`,a)),whitespace:Z(X(r,`whitespace`,a)),linebreakReplacement:Z(X(r,`linebreakReplacement`,a)),defining:Z(X(r,`defining`,a)),isolating:Z(X(r,`isolating`,a)),attrs:Object.fromEntries(i.map(ek))}),s=Z(X(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>QO(e,i)));let c=X(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:XO(e,i)}));let l=X(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=$O({...e.reduce((e,t)=>{let n=X(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:Z(X(r,`inclusive`,a)),excludes:Z(X(r,`excludes`,a)),group:Z(X(r,`group`,a)),spanning:Z(X(r,`spanning`,a)),code:Z(X(r,`code`,a)),attrs:Object.fromEntries(i.map(ek))}),s=Z(X(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>QO(e,i)));let c=X(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:XO(e,i)})),[r.name,o]}))})}function nk(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function rk(e){return e.sort((e,t)=>{let n=X(e,`priority`)||100,r=X(t,`priority`)||100;return n>r?-1:+(n<r)})}function ik(e){let t=rk(VO(e)),n=nk(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 ak(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`\n\n`,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;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function ok(e,t){return ak(e,{from:0,to:e.content.size},t)}function sk(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function ck(e,t){let n=kD(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 lk(e,t){let n=CO(typeof t==`string`?t:t.name,e.schema);return n===`node`?ck(e,t):n===`mark`?FO(e,t):{}}function uk(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 dk(e){let t=uk(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 fk(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}})})}),dk(r)}function pk(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=HD(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 mk=(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]};function hk(e,t){return t.nodes[e]||t.marks[e]||null}function gk(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 _k=(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 vk(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?UD(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>zD(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=>zD(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 yk(e,t,n={}){if(!t)return vO(e,null,n)||vk(e,null,n);let r=CO(t,e.schema);return r===`node`?vO(e,t,n):r===`mark`&&vk(e,t,n)}var bk=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=BO(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)},xk=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Sk(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Ck(e,t){let{nodeExtensions:n}=GO(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=Z(X(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function wk(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&&(wk(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function Tk(e){return e instanceof J}var Ek=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Dk(e,t){let n=t.mapping.mapResult(e.position);return{position:new Ek(n.pos),mapResult:n}}function Ok(e){return new Ek(e)}function kk(e,t,n){let{selection:r}=t,i=null;if(KD(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 Ak=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=UD(e,r.schema);if(i){if(o){let e=FO(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 kk(r,n,c)},jk=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Mk=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=kD(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>yS(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>yS(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently \"setNode()\" only supports text block nodes.`),!1)},Nk=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=qD(e,0,n.content.size),i=J.create(n,r);t.setSelection(i)}return!0},Pk=(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},Fk=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=qD(r,a,o),c=qD(i,a,o),l=q.create(n,s,c);t.setSelection(l)}return!0},Ik=e=>({state:t,dispatch:n})=>jS(kD(e,t.schema))(t,n);function Lk(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 Rk=({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=gk(l,s.node().type.name,s.node().attrs);if(a instanceof J&&a.node.isBlock)return!s.parentOffset||!Ub(o,s.pos)?!1:(r&&(e&&Lk(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:LO(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=Ub(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&Ub(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&&Lk(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},zk=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=kD(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={...gk(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={...gk(d,u.type.name,u.attrs),...t},m={...gk(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(!Ub(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 Bk(e){return!e||e===`1`?null:e}function Vk(e,t){return Bk(e)===Bk(t)}var Hk=(e,t)=>{let n=BO(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&&Gb(e.doc,n.pos))||!Vk(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},Uk=(e,t)=>{let n=BO(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&&Gb(e.doc,r))||!Vk(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function Wk(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 Gk=(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=kD(e,o.schema),m=kD(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=BO(e=>Ck(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,ee=S&&w&&Ck(w.type.name,d)?{node:w,pos:0,depth:0}:null,te=x??ee,ne=!!x&&y.depth>=1&&y.depth-x.depth<=1,T=!!ee;if((ne||T)&&te){if(te.node.type===p)return S&&T?c().command(({tr:e,dispatch:t})=>{let n=Wk(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Ck(te.node.type.name,d)&&p.validContent(te.node.content))return c().command(()=>(a.setNodeMarkup(te.pos,p),!0)).command(()=>Hk(a,p)).command(()=>Uk(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>Hk(a,p)).command(()=>Uk(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(()=>Hk(a,p)).command(()=>Uk(a,p)).run()},Kk=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=UD(e,r.schema);return vk(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},qk=(e,t,n={})=>({state:r,commands:i})=>{let a=kD(e,r.schema),o=kD(t,r.schema),s=vO(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})},Jk=(e,t={})=>({state:n,commands:r})=>{let i=kD(e,n.schema);return vO(n,i,t)?r.lift(i):r.wrapIn(i,t)},Yk=()=>({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},Xk=(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},Zk=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=UD(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=HD(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},Qk=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},$k=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=CO(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=kD(e,r.schema)),s===`mark`&&(o=UD(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},eA=(e,t={})=>({state:n,dispatch:r})=>vS(kD(e,n.schema),t)(n,r),tA=(e,t={})=>({state:n,dispatch:r})=>TS(kD(e,n.schema),t)(n,r),nA=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={}}};function rA(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 iA(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 aA(e){return typeof e==`number`}function oA(e){return Object.prototype.toString.call(e).slice(8,-1)}function sA(e){return oA(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}vD({},{createAtomBlockMarkdownSpec:()=>uA,createBlockMarkdownSpec:()=>dA,createInlineMarkdownSpec:()=>mA,parseAttributes:()=>cA,parseIndentedBlocks:()=>hA,renderNestedMarkdownContent:()=>gA,serializeAttributes:()=>lA});function cA(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/[\"']([^\"']*)[\"']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\\s)\\.([\\w-]+)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\\s)#([\\w-]+)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\\w-]*)\\s*=\\s*(__QUOTED_\\d+__)/g)).forEach(([,e,r])=>{let i=parseInt(r.match(/__QUOTED_(\\d+)__/)?.[1]||`0`,10),a=n[i];a&&(t[e]=a.slice(1,-1))});let o=r.replace(/(?:^|\\s)\\.([\\w-]+)/g,``).replace(/(?:^|\\s)#([\\w-]+)/g,``).replace(/([a-zA-Z][\\w-]*)\\s*=\\s*__QUOTED_\\d+__/g,``).trim();return o&&o.split(/\\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\\w-]*$/)&&(t[e]=!0)}),t}function lA(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e!==`class`&&e!==`id`&&(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}=\"${String(n)}\"`))}),t.join(` `)}function uA(e){let{nodeName:t,name:n,parseAttributes:r=cA,serializeAttributes:i=lA,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\\\s+\\\\{([^}]*)\\\\})?\\\\s*:::(?:\\\\n|$)`),s=e.match(a);if(!s)return;let l=s[1]||``,u=r(l);if(!o.find(e=>!(e in u)))return{type:t,raw:s[0],attributes:u}}},renderMarkdown:e=>{let t=l(e.attrs||{}),n=i(t),r=n?` {${n}}`:``;return`:::${c}${r} :::`}}}function dA(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=cA,serializeAttributes:a=lA,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\\\s+\\\\{([^}]*)\\\\})?\\\\s*\\\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\\w-]*)(\\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m){if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m)}return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=u(e.attrs||{}),r=a(n),i=r?` {${r}}`:``,o=t.renderChildren(e.content||[],`\n\n`);return`:::${l}${i}\n\n${o}\n\n:::`}}}function fA(e){if(!e.trim())return{};let t={},n=/(\\w+)=(?:\"([^\"]*)\"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function pA(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}=\"${t}\"`).join(` `)}function mA(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=fA,serializeAttributes:a=pA,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\\]\\\\]/g,`\\\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\\\[${d}\\\\s*[^\\\\]]*\\\\]`:`\\\\[${d}\\\\s*[^\\\\]]*\\\\][\\\\s\\\\S]*?\\\\[\\\\/${d}\\\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\\\[${d}\\\\s*([^\\\\]]*)\\\\]`:`^\\\\[${d}\\\\s*([^\\\\]]*)\\\\]([\\\\s\\\\S]*?)\\\\[\\\\/${d}\\\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=u(e.attrs||{}),i=a(n),o=i?` ${i}`:``;return s?`[${l}${o}]`:`[${l}${o}]${t}[/${l}]`}}}function hA(e,t,n){let r=e.split(`\n`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}\n`;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}\n`,o+=1;continue}break}if((e.match(/^(\\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}\n`,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`\n`);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function gA(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`\n`).map(e=>e?t.indent(e):t.indent(``)).join(`\n`);s+=e.type===`paragraph`?`\n\n${n}`:`\n${n}`}}),s}function _A(e,t){let n={...e};return sA(e)&&sA(t)&&Object.keys(t).forEach(r=>{sA(t[r])&&sA(e[r])?n[r]=_A(e[r],t[r]):n[r]=t[r]}),n}function vA(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 yA=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},bA=(e,t)=>{if(RD(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 xA(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=_k(c)+i;return a.forEach(e=>{if(l)return;let a=bA(u,e.find);if(!a)return;let c=s.state.tr,d=yD({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new bD({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})!==null&&c.steps.length&&(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function SA(e){let{editor:t,rules:n}=e,r=new Rx({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:HO(W.from(e),a.schema);let{from:i}=s,o=i+e.length;xA({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 xA({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&xA({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?xA({editor:t,from:a.pos,to:a.pos,text:`\n`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var CA=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{...Z(X(this,`addOptions`,{name:this.name}))}}get storage(){return{...Z(X(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>_A(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}},wA=class e extends CA{constructor(){super(...arguments),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)}},TA=class{constructor(e){this.find=e.find,this.handler=e.handler}},EA=(e,t,n)=>{if(RD(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 DA(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new bD({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||EA(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+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 OA=null,kA=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function AA(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=yD({state:e,transaction:c});if(DA({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 Rx({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(OA=t)},i=()=>{OA&&=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=OA;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:HO(W.from(t),r.schema);let{from:n}=d,i=n+t.length,a=kA(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(aA(p)&&m&&p!==m.b)return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var jA=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=ik(e),this.schema=tk(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=X(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:hk(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return rk([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:hk(t.name,this.schema)},r=[],i=X(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&X(t,`exitable`,n)&&(a.ArrowRight=()=>wA.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=hD(a);r.push(o);let s=X(t,`addInputRules`,n);if(Sk(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=SA({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=X(t,`addPasteRules`,n);if(Sk(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=AA({editor:e,rules:t});r.push(...n)}}let l=X(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return KO(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=GO(this.extensions);return Object.fromEntries(t.filter(e=>!!X(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=X(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:kD(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=XO(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 rk([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:hk(n.name,this.schema)},i=X(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return rk([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:hk(n.name,this.schema)},i=X(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}=GO(this.extensions);return Object.fromEntries(t.filter(e=>!!X(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=X(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:UD(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=XO(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{vA(i,e,t)}})}]:[]}))}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.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:hk(e.name,this.schema)};e.type===`mark`&&((Z(X(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(Z(X(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=X(e,`onBeforeCreate`,t),r=X(e,`onCreate`,t),i=X(e,`onUpdate`,t),a=X(e,`onSelectionUpdate`,t),o=X(e,`onTransaction`,t),s=X(e,`onFocus`,t),c=X(e,`onBlur`,t),l=X(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)})}};jA.resolve=ik,jA.sort=rk,jA.flatten=VO,vD({},{ClipboardTextSerializer:()=>NA,Commands:()=>PA,Delete:()=>FA,Drop:()=>IA,Editable:()=>LA,FocusEvents:()=>zA,Keymap:()=>BA,Paste:()=>VA,Tabindex:()=>HA,TextDirection:()=>UA,focusEventsPluginKey:()=>RA});var MA=class e extends CA{constructor(){super(...arguments),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)}},NA=MA.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Rx({key:new Vx(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=sk(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})=>ak(r,{from:e.pos,to:t.pos},s)).join(o??`\n\n`)}}})]}}),PA=MA.create({name:`commands`,addCommands(){return{...xD}}}),FA=MA.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=IO(e.before,[e,...t]);fk(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof xb){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0&&r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)),u=r.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:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),IA=MA.create({name:`drop`,addProseMirrorPlugins(){return[new Rx({key:new Vx(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),LA=MA.create({name:`editable`,addProseMirrorPlugins(){return[new Rx({key:new Vx(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),RA=new Vx(`focusEvents`),zA=MA.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new Rx({key:RA,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}}}})]}}),BA=MA.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 XD()||hO()?i:r},addProseMirrorPlugins(){return[new Rx({key:new Vx(`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||!wk(n.doc))return;let u=n.tr,d=yD({state:n,transaction:u}),{commands:f}=new bD({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),VA=MA.create({name:`paste`,addProseMirrorPlugins(){return[new Rx({key:new Vx(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),HA=MA.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Rx({key:new Vx(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),UA=MA.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=GO(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 Rx({key:new Vx(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),WA=class e{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 name(){return this.node.type.name}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\\u2019t 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)}},GA=`.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}`,KA=class extends nA{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.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:Dk,createMappablePosition:Ok},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(),n=JD(t,this.options.autofocus);this.editorState=Ix.create({doc:t,schema:this.schema,selection:n||void 0}),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){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.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=iA(GA,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 this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=UO(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(){let e=[...this.options.enableCoreExtensions?[LA,NA.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),PA,zA,BA,HA.configure({value:this.options.coreExtensionOptions?.tabindex?.value}),IA,VA,FA,UA.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 jA(e,this)}createCommandManager(){this.commandManager=new bD({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=NO(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,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()}}),e=NO(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}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 YE(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 lk(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return yk(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return HO(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`\n\n`,textSerializers:n={}}=e||{};return ok(this.state.doc,{blockSeparator:t,textSerializers:{...sk(this.schema),...n}})}get isEmpty(){return wk(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:null;return new WA(t,this,!1,n)}get $doc(){return this.$pos(0)}};function qA(e){return new yA({find:e.find,handler:({state:t,range:n,match:r})=>{let i=Z(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(pk(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 JA(e){return new yA({find:e.find,handler:({state:t,range:n,match:r})=>{let i=Z(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 YA(e){return new yA({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=Z(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 XA(e){return new yA({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=Z(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&Nb(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&&Gb(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var ZA=class e extends CA{constructor(){super(...arguments),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)}};function QA(e){return new TA({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=Z(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(pk(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)}}})}var $A=Sv({tagPrefix:`:@octanejs/tiptap:`,slotlessPrefix:`@octanejs/tiptap:`});function ej(e){let t=e.at(-1);return typeof t==`symbol`?[e.slice(0,-1),t]:[e,void 0]}var{getOwnPropertyNames:tj,getOwnPropertySymbols:nj}=Object,{hasOwnProperty:rj}=Object.prototype;function ij(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function aj(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function oj(e){return e?.[Symbol.toStringTag]}function sj(e){return tj(e).concat(nj(e))}var cj=Object.hasOwn||((e,t)=>rj.call(e,t));function lj(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var uj=`__v`,dj=`__o`,fj=`_owner`,pj=typeof Float16Array<`u`,{getOwnPropertyDescriptor:mj,keys:hj}=Object;function gj(e,t){return e.byteLength===t.byteLength&&kj(new Uint8Array(e),new Uint8Array(t))}function _j(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function vj(e,t){return e.byteLength===t.byteLength&&kj(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function yj(e,t){return lj(e.getTime(),t.getTime())}function bj(e,t,n){return e.name===t.name&&e.message===t.message&&e.stack===t.stack&&n.equals(e.cause,t.cause,`cause`,`cause`,e,t,n)}function xj(e,t){return e===t}function Sj(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var Cj=lj;function wj(e,t,n){let r=hj(e),i=r.length;if(hj(t).length!==i)return!1;for(;i-->0;)if(!Nj(e,t,n,r[i]))return!1;return!0}function Tj(e,t,n){let r=sj(e),i=r.length;if(sj(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!Nj(e,t,n,a)||(o=mj(e,a),s=mj(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Ej(e,t){return lj(e.valueOf(),t.valueOf())}function Dj(e,t){return e.source===t.source&&e.flags===t.flags}function Oj(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function kj(e,t){let n=e.length;if(t.length!==n||e.byteOffset!==t.byteOffset)return!1;if(e instanceof Float64Array||e instanceof Float32Array||pj&&e instanceof Float16Array){for(;n-->0;)if(e[n]!==t[n]&&(e[n]===e[n]||t[n]===t[n]))return!1;return!0}for(;n-->0;)if(e[n]!==t[n])return!1;return!0}function Aj(e,t){return e.href===t.href||e.protocol===t.protocol&&e.username===t.username&&e.password===t.password&&e.host===t.host&&e.pathname===t.pathname&&e.hash===t.hash&&jj(e.searchParams,t.searchParams)}function jj(e,t){let n=e.toString(),r=t.toString();return n===r||Mj(n)===Mj(r)}function Mj(e){return e.split(`&`).sort().join(`&`)}function Nj(e,t,n,r){return(r===fj||r===dj||r===uj)&&(e.$$typeof||t.$$typeof)?!0:cj(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Pj=`[object ArrayBuffer]`,Fj=`[object Arguments]`,Ij=`[object Boolean]`,Lj=`[object DataView]`,Rj=`[object Date]`,zj=`[object Error]`,Bj=`[object Map]`,Vj=`[object Number]`,Hj=`[object Object]`,Uj=`[object RegExp]`,Wj=`[object Set]`,Gj=`[object String]`,Kj={\"[object Int8Array]\":!0,\"[object Uint8Array]\":!0,\"[object Uint8ClampedArray]\":!0,\"[object Int16Array]\":!0,\"[object Uint16Array]\":!0,\"[object Int32Array]\":!0,\"[object Uint32Array]\":!0,\"[object Float16Array]\":!0,\"[object Float32Array]\":!0,\"[object Float64Array]\":!0,\"[object BigInt64Array]\":!0,\"[object BigUint64Array]\":!0},qj=`[object URL]`,Jj=Object.prototype.toString;function Yj({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`&&a(h,g,_);let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);if(y==null)return c(h,g,_);let b=Jj.call(h);if(b===Rj)return r(h,g,_);if(b===Uj)return u(h,g,_);if(b===Bj)return o(h,g,_);if(b===Wj)return d(h,g,_);if(b===Hj)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===qj)return p(h,g,_);if(b===zj)return i(h,g,_);if(b===Fj)return c(h,g,_);if(Kj[b])return f(h,g,_);if(b===Pj)return e(h,g,_);if(b===Lj)return n(h,g,_);if(b===Ij||b===Vj||b===Gj)return l(h,g,_);if(m){let e=m[b];if(!e){let t=oj(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function Xj({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:gj,areArraysEqual:n?Tj:_j,areDataViewsEqual:vj,areDatesEqual:yj,areErrorsEqual:n?ij(bj,Tj):ij(bj,wj),areFunctionsEqual:xj,areMapsEqual:n?ij(Sj,Tj):Sj,areNumbersEqual:Cj,areObjectsEqual:n?Tj:wj,arePrimitiveWrappersEqual:Ej,areRegExpsEqual:Dj,areSetsEqual:n?ij(Oj,Tj):Oj,areTypedArraysEqual:n?ij(kj,Tj):kj,areUrlsEqual:Aj,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=aj(r.areArraysEqual),t=aj(r.areErrorsEqual),n=aj(r.areMapsEqual),i=aj(r.areObjectsEqual),a=aj(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areErrorsEqual:t,areMapsEqual:n,areObjectsEqual:i,areSetsEqual:a})}return r}function Zj(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function Qj({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var $j=eM();eM({strict:!0}),eM({circular:!0}),eM({circular:!0,strict:!0}),eM({createInternalComparator:()=>lj}),eM({strict:!0,createInternalComparator:()=>lj}),eM({circular:!0,createInternalComparator:()=>lj}),eM({circular:!0,createInternalComparator:()=>lj,strict:!0});function eM(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=Yj(Xj(e));return Qj({circular:t,comparator:a,createState:r,equals:n?n(a):Zj(a),strict:i})}var tM=typeof Object.is==`function`?Object.is:(e,t)=>e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t;function nM(e,t,n,r){return Mc(rM,this,arguments)}function rM(e,t,n,r,...i){let a,o,s,c,l,u,d,f,[p,m]=ej(i),h=p[0],g=dl(null,$A(m,`selector:instance`)),_;if(g.current===null?(_={hasValue:!1,value:null},g.current=_):_=g.current,s=t,c=n,l=r,u=h,o=iu($A(m,`selector:memo`),`useMemo`),f=au(o,s,c,l,u),f===null){__hkl:{let e=!1,i,a,o=t=>{if(!e){e=!0,i=t;let n=r(t);if(h!==void 0&&_.hasValue){let e=_.value;if(h(e,n))return a=e,e}return a=n,n}let n=a;if(tM(i,t))return n;let o=r(t);return h!==void 0&&h(n,o)?(i=t,n):(i=t,a=o,o)},s=n??void 0;d=[()=>o(t()),s===void 0?void 0:()=>o(s())];break __hkl}a=ou(o,d,s,c,l,u)}else a=f.value;let[v,y]=a,b=yl(e,v,y??v,$A(m,`selector:store`));return el(()=>{_.hasValue=!0,_.value=b},[b],$A(m,`selector:effect`)),b}var iM=typeof window<`u`?tl:el,aM=class{transactionNumber=0;lastTransactionNumber=0;lastSnapshot;editor;subscribers=new Set;constructor(e){this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor!==e&&(this.editor=e,this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.subscribers.forEach(e=>e())),!this.editor)return;let t=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},n=this.editor;return n.on(`transaction`,t),()=>{n.off(`transaction`,t)}}};function oM(e){return Mc(sM,this,arguments)}function sM(e,...t){let[,n]=ej(t),[r]=Lc(()=>new aM(e.editor),$A(n,`editor-state:manager`)),i=nM(r.subscribe,r.getSnapshot,r.getServerSnapshot,e.selector,e.equalityFn??$j,$A(n,`editor-state:selector`));return iM(()=>r.watch(e.editor),[e.editor,r],$A(n,`editor-state:watch`)),$A(n,`editor-state:debug`),i}var cM=typeof window>`u`,lM=cM||!!(typeof window<`u`&&window.next),uM=new Set([`onBeforeCreate`,`onBlur`,`onCreate`,`onDestroy`,`onFocus`,`onSelectionUpdate`,`onTransaction`,`onUpdate`,`onContentError`,`onDrop`,`onPaste`,`onDelete`,`onMount`,`onUnmount`]),dM=class e{editor=null;options;subscriptions=new Set;scheduledDestructionTimeout;isComponentMounted=!1;previousDeps=null;instanceId=``;constructor(e){this.options=e,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=e??!0;return(cM||lM&&e===void 0)&&(t=!1),t?this.createEditor():null}createEditor(){return new KA({...this.options.current,onBeforeCreate:(...e)=>this.options.current.onBeforeCreate?.(...e),onBlur:(...e)=>this.options.current.onBlur?.(...e),onCreate:(...e)=>this.options.current.onCreate?.(...e),onDestroy:(...e)=>this.options.current.onDestroy?.(...e),onFocus:(...e)=>this.options.current.onFocus?.(...e),onSelectionUpdate:(...e)=>this.options.current.onSelectionUpdate?.(...e),onTransaction:(...e)=>this.options.current.onTransaction?.(...e),onUpdate:(...e)=>this.options.current.onUpdate?.(...e),onContentError:(...e)=>this.options.current.onContentError?.(...e),onDrop:(...e)=>this.options.current.onDrop?.(...e),onPaste:(...e)=>this.options.current.onPaste?.(...e),onDelete:(...e)=>this.options.current.onDelete?.(...e),onMount:(...e)=>this.options.current.onMount?.(...e),onUnmount:(...e)=>this.options.current.onUnmount?.(...e)})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>uM.has(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>e===t.extensions?.[n]):e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;clearTimeout(this.scheduledDestructionTimeout),this.scheduledDestructionTimeout=setTimeout(()=>{if(this.scheduledDestructionTimeout=void 0,typeof window<`u`){if(this.isComponentMounted&&this.instanceId===e){t?.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}},1)}};function fM(){return Mc(pM,this,arguments)}function pM(...e){let[t,n]=ej(e),r=t[0]??{},i=t[1]??[],a=dl(r,$A(n,`editor:options`));a.current=r;let[o]=Lc(()=>new dM(a),$A(n,`editor:manager`)),s=yl(o.subscribe,o.getEditor,o.getServerSnapshot,$A(n,`editor:store`));return $A(n,`editor:debug`),el(o.onRender(i),null,$A(n,`editor:lifecycle`)),oM({editor:s,selector:({transactionNumber:e})=>r.shouldRerenderOnTransaction===!1||r.shouldRerenderOnTransaction===void 0?null:r.immediatelyRender&&e===0?0:e+1},$A(n,`editor:state`)),s}var mM=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},hM=(e,t)=>{let{state:n,view:r}=e,{selection:i}=n;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0)return!1;let o=a.depth-1;if(o<0)return!1;let s=a.node(o),c=a.index(o);if(c===0)return!1;if(s.type===t)return e.commands.lift(t.name);let l=s.child(c-1);if(l.type!==t||!l.lastChild?.isTextblock)return!1;let u=a.before(),d=u-1-1,{tr:f}=n;return f.delete(u,a.after()).insert(d,a.parent.content),f.setSelection(q.create(f.doc,d)),r.dispatch(f.scrollIntoView()),!0},gM=/^\\s*>\\s$/,_M=ZA.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return mM(`blockquote`,{...YO(this.options.HTMLAttributes,e),children:mM(`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(`\n`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`\n`))}),n.join(`\n>\n`)},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:()=>hM(this.editor,this.type)}},addInputRules(){return[XA({find:gM,type:this.type})]}}),vM=/(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/,yM=/(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g,bM=/(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/,xM=/(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g,SM=wA.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 mM(`strong`,{...YO(this.options.HTMLAttributes,e),children:mM(`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[qA({find:vM,type:this.type}),qA({find:bM,type:this.type})]},addPasteRules(){return[QA({find:yM,type:this.type}),QA({find:xM,type:this.type})]}}),CM=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]===\"`\"?null:{index:t.index,text:t[0],replaceWith:t[1]}},wM=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},TM=wA.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,YO(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[qA({find:CM,type:this.type})]},addPasteRules(){return[QA({find:wM,type:this.type})]}}),EM=4,DM=/^```([a-z]+)?[\\s\\n]$/,OM=/^~~~([a-z]+)?[\\s\\n]$/,kM=ZA.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:EM,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`,YO(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(`\n`):`\\`\\`\\`${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??EM,{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,`\n`,`\n`).split(`\n`).map(e=>o+e).join(`\n`);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??EM,{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,`\n`,`\n`).split(`\n`),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,`\n`,`\n`).split(`\n`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`\n`);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(`\n\n`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},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[YA({find:DM,type:this.type,getAttributes:e=>({language:e[1]})}),YA({find:OM,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Rx({key:new Vx(`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,`\n`));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}}})]}}),AM=ZA.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`\n\n`):``}),jM=ZA.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`,YO(this.options.HTMLAttributes,e)]},renderText(){return`\n`},renderMarkdown:()=>` \n`,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}).run()})])}},addKeyboardShortcuts(){return{\"Mod-Enter\":()=>this.editor.commands.setHardBreak(),\"Shift-Enter\":()=>this.editor.commands.setHardBreak()}}}),MM=ZA.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]}`,YO(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=>YA({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\\\s$`),type:this.type,getAttributes:{level:e}}))}}),NM=ZA.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,YO(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!rA(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return Tk(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[JA({find:/^(?:---|—-|___\\s|\\*\\*\\*\\s)$/,type:this.type})]}}),PM=/(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))$/,FM=/(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))/g,IM=/(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))$/,LM=/(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))/g,RM=wA.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`,YO(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[qA({find:PM,type:this.type}),qA({find:IM,type:this.type})]},addPasteRules(){return[QA({find:FM,type:this.type}),QA({find:LM,type:this.type})]}}),zM=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,BM=`ελ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`,VM=`numeric`,HM=`ascii`,UM=`alpha`,WM=`asciinumeric`,GM=`alphanumeric`,KM=`domain`,qM=`emoji`,JM=`scheme`,YM=`slashscheme`,XM=`whitespace`;function ZM(e,t){return e in t||(t[e]=[]),t[e]}function QM(e,t,n){t[VM]&&(t[WM]=!0,t[GM]=!0),t[HM]&&(t[WM]=!0,t[UM]=!0),t[WM]&&(t[GM]=!0),t[UM]&&(t[GM]=!0),t[GM]&&(t[KM]=!0),t[qM]&&(t[KM]=!0);for(let r in t){let t=ZM(r,n);t.indexOf(e)<0&&t.push(e)}}function $M(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function eN(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}eN.groups={},eN.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||=eN.groups;let i;return t&&t.j?i=t:(i=new eN(t),n&&r&&QM(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||=eN.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 eN,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new eN,a&&(r&&(o.t&&typeof o.t==`string`?QM(a,Object.assign($M(o.t,r),n),r):n&&QM(a,n,r)),o.t=a),i.j[e]=o,o}};var Q=(e,t,n,r,i)=>e.ta(t,n,r,i),tN=(e,t,n,r,i)=>e.tr(t,n,r,i),nN=(e,t,n,r,i)=>e.ts(t,n,r,i),$=(e,t,n,r,i)=>e.tt(t,n,r,i),rN=`WORD`,iN=`UWORD`,aN=`ASCIINUMERICAL`,oN=`ALPHANUMERICAL`,sN=`LOCALHOST`,cN=`TLD`,lN=`UTLD`,uN=`SCHEME`,dN=`SLASH_SCHEME`,fN=`NUM`,pN=`WS`,mN=`NL`,hN=`OPENBRACE`,gN=`CLOSEBRACE`,_N=`OPENBRACKET`,vN=`CLOSEBRACKET`,yN=`OPENPAREN`,bN=`CLOSEPAREN`,xN=`OPENANGLEBRACKET`,SN=`CLOSEANGLEBRACKET`,CN=`FULLWIDTHLEFTPAREN`,wN=`FULLWIDTHRIGHTPAREN`,TN=`LEFTCORNERBRACKET`,EN=`RIGHTCORNERBRACKET`,DN=`LEFTWHITECORNERBRACKET`,ON=`RIGHTWHITECORNERBRACKET`,kN=`FULLWIDTHLESSTHAN`,AN=`FULLWIDTHGREATERTHAN`,jN=`AMPERSAND`,MN=`APOSTROPHE`,NN=`ASTERISK`,PN=`AT`,FN=`BACKSLASH`,IN=`BACKTICK`,LN=`CARET`,RN=`COLON`,zN=`COMMA`,BN=`DOLLAR`,VN=`DOT`,HN=`EQUALS`,UN=`EXCLAMATION`,WN=`HYPHEN`,GN=`PERCENT`,KN=`PIPE`,qN=`PLUS`,JN=`POUND`,YN=`QUERY`,XN=`QUOTE`,ZN=`FULLWIDTHMIDDLEDOT`,QN=`SEMI`,$N=`SLASH`,eP=`TILDE`,tP=`UNDERSCORE`,nP=`EMOJI`,rP=`SYM`,iP=Object.freeze({__proto__:null,ALPHANUMERICAL:oN,AMPERSAND:jN,APOSTROPHE:MN,ASCIINUMERICAL:aN,ASTERISK:NN,AT:PN,BACKSLASH:FN,BACKTICK:IN,CARET:LN,CLOSEANGLEBRACKET:SN,CLOSEBRACE:gN,CLOSEBRACKET:vN,CLOSEPAREN:bN,COLON:RN,COMMA:zN,DOLLAR:BN,DOT:VN,EMOJI:nP,EQUALS:HN,EXCLAMATION:UN,FULLWIDTHGREATERTHAN:AN,FULLWIDTHLEFTPAREN:CN,FULLWIDTHLESSTHAN:kN,FULLWIDTHMIDDLEDOT:ZN,FULLWIDTHRIGHTPAREN:wN,HYPHEN:WN,LEFTCORNERBRACKET:TN,LEFTWHITECORNERBRACKET:DN,LOCALHOST:sN,NL:mN,NUM:fN,OPENANGLEBRACKET:xN,OPENBRACE:hN,OPENBRACKET:_N,OPENPAREN:yN,PERCENT:GN,PIPE:KN,PLUS:qN,POUND:JN,QUERY:YN,QUOTE:XN,RIGHTCORNERBRACKET:EN,RIGHTWHITECORNERBRACKET:ON,SCHEME:uN,SEMI:QN,SLASH:$N,SLASH_SCHEME:dN,SYM:rP,TILDE:eP,TLD:cN,UNDERSCORE:tP,UTLD:lN,UWORD:iN,WORD:rN,WS:pN}),aP=/[a-z]/,oP=/[a-z]/i,sP=/[\\u{1F000}-\\u{1FAFF}\\u{2600}-\\u{27BF}\\u{FE0F}]/u;try{oP=RegExp(`\\\\p{L}`,`u`),sP=RegExp(`\\\\p{Emoji}`,`u`)}catch{}var cP=/\\d/,lP=/\\s/,uP=`\\r`,dP=`\n`,fP=`️`,pP=``,mP=``,hP=null,gP=null;function _P(e=[]){let t={};eN.groups=t;let n=new eN;hP??=xP(zM),gP??=xP(BM),$(n,`'`,MN),$(n,`{`,hN),$(n,`}`,gN),$(n,`[`,_N),$(n,`]`,vN),$(n,`(`,yN),$(n,`)`,bN),$(n,`<`,xN),$(n,`>`,SN),$(n,`(`,CN),$(n,`)`,wN),$(n,`「`,TN),$(n,`」`,EN),$(n,`『`,DN),$(n,`』`,ON),$(n,`<`,kN),$(n,`>`,AN),$(n,`&`,jN),$(n,`*`,NN),$(n,`@`,PN),$(n,\"`\",IN),$(n,`^`,LN),$(n,`:`,RN),$(n,`,`,zN),$(n,`$`,BN),$(n,`.`,VN),$(n,`=`,HN),$(n,`!`,UN),$(n,`-`,WN),$(n,`%`,GN),$(n,`|`,KN),$(n,`+`,qN),$(n,`#`,JN),$(n,`?`,YN),$(n,`\"`,XN),$(n,`/`,$N),$(n,`;`,QN),$(n,`~`,eP),$(n,`_`,tP),$(n,`\\\\`,FN),$(n,`・`,ZN);let r=tN(n,cP,fN,{[VM]:!0});tN(r,cP,r);let i=tN(r,aP,aN,{[WM]:!0}),a=tN(r,oP,oN,{[GM]:!0}),o=tN(n,aP,rN,{[HM]:!0});tN(o,cP,i),tN(o,aP,o),tN(i,cP,i),tN(i,aP,i);let s=tN(n,oP,iN,{[UM]:!0});tN(s,aP),tN(s,cP,a),tN(s,oP,s),tN(a,cP,a),tN(a,aP),tN(a,oP,a);let c=$(n,dP,mN,{[XM]:!0}),l=$(n,uP,pN,{[XM]:!0}),u=tN(n,lP,pN,{[XM]:!0});$(n,mP,u),$(l,dP,c),$(l,mP,u),tN(l,lP,u),$(u,uP),$(u,dP),tN(u,lP,u),$(u,mP,u);let d=tN(n,sP,nP,{[qM]:!0});$(d,`#`),tN(d,sP,d),$(d,fP,d);let f=$(d,pP);$(f,`#`),tN(f,sP,d);let p=[[aP,o],[cP,i]],m=[[aP,null],[oP,s],[cP,a]];for(let e=0;e<hP.length;e++)bP(n,hP[e],cN,rN,p);for(let e=0;e<gP.length;e++)bP(n,gP[e],lN,iN,m);QM(cN,{tld:!0,ascii:!0},t),QM(lN,{utld:!0,alpha:!0},t),bP(n,`file`,uN,rN,p),bP(n,`mailto`,uN,rN,p),bP(n,`http`,dN,rN,p),bP(n,`https`,dN,rN,p),bP(n,`ftp`,dN,rN,p),bP(n,`ftps`,dN,rN,p),QM(uN,{scheme:!0,ascii:!0},t),QM(dN,{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]?{[JM]:!0}:{[YM]:!0};r.indexOf(`-`)>=0?i[KM]=!0:aP.test(r)?cP.test(r)?i[WM]=!0:i[HM]=!0:i[VM]=!0,nN(n,r,r,i)}return nN(n,`localhost`,sN,{ascii:!0}),n.jd=new eN(rP),{start:n,tokens:Object.assign({groups:t},iP)}}function vP(e,t){let n=yP(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 yP(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 bP(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 eN(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new eN(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function xP(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 SP={defaultProtocol:`http`,events:null,format:wP,formatHref:wP,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function CP(e,t=null){let n=Object.assign({},SP);e&&(n=Object.assign(n,e instanceof CP?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}CP.prototype={o:SP,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]:SP[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 wP(e){return e}function TP(e,t){this.t=`token`,this.v=e,this.tk=t}TP.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=SP.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 EP(e,t){class n extends TP{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 DP=EP(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),OP=EP(`text`),kP=EP(`nl`),AP=EP(`url`,{isLink:!0,toHref(e=SP.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==sN&&e[1].t===RN}}),jP=e=>new eN(e);function MP({groups:e}){let t=e.domain.concat([jN,NN,PN,FN,IN,LN,BN,HN,WN,fN,GN,KN,qN,JN,$N,rP,eP,tP]),n=[MN,RN,zN,VN,UN,GN,YN,XN,QN,xN,SN,hN,gN,vN,_N,yN,bN,CN,wN,TN,EN,DN,ON,kN,AN],r=[jN,MN,NN,FN,IN,LN,BN,HN,WN,hN,gN,GN,KN,qN,JN,YN,$N,rP,eP,tP],i=jP(),a=$(i,eP);Q(a,r,a),Q(a,e.domain,a);let o=jP(),s=jP(),c=jP();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,PN);$(a,PN,l),$(s,PN,l),$(c,PN,l);let u=$(a,VN);Q(u,r,a),Q(u,e.domain,a);let d=jP();Q(l,e.domain,d),Q(d,e.domain,d);let f=$(d,VN);Q(f,e.domain,d);let p=jP(DP);Q(f,e.tld,p),Q(f,e.utld,p),$(l,sN,p);let m=$(d,WN);$(m,WN,m),Q(m,e.domain,d),Q(p,e.domain,d),$(p,VN,f),$(p,WN,m);let h=$(o,WN),g=$(o,VN);$(h,WN,h),Q(h,e.domain,o),Q(g,r,a),Q(g,e.domain,o);let _=jP(AP);Q(g,e.tld,_),Q(g,e.utld,_),Q(_,e.domain,o),Q(_,r,a),$(_,VN,g),$(_,WN,h),$(_,PN,l);let v=$(_,RN),y=jP(AP);Q(v,e.numeric,y);let b=jP(AP),x=jP();Q(b,t,b),Q(b,n,x),Q(x,t,b),Q(x,n,x),$(_,$N,b),$(y,$N,b);let S=$(s,RN),C=$($($(c,RN),$N),$N);Q(s,e.domain,o),$(s,VN,g),$(s,WN,h),Q(c,e.domain,o),$(c,VN,g),$(c,WN,h),Q(S,e.domain,b),$(S,$N,b),$(S,YN,b),Q(C,e.domain,b),Q(C,t,b),$(C,$N,b);let w=[[hN,gN],[_N,vN],[yN,bN],[xN,SN],[CN,wN],[TN,EN],[DN,ON],[kN,AN]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=$(b,r);$(x,r,a);let o=jP(AP);Q(a,t,o);let s=jP();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,sN,_),$(i,mN,kP),{start:i,tokens:iP}}function NP(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(PP(OP,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(PP(e,t,r))}}return o.length>0&&a.push(PP(OP,t,o)),a}function PP(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var FP=typeof console<`u`&&console&&console.warn||(()=>{}),IP=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,LP={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function RP(){return eN.groups={},LP.scanner=null,LP.parser=null,LP.tokenQueue=[],LP.pluginQueue=[],LP.customSchemes=[],LP.initialized=!1,LP}function zP(e,t=!1){if(LP.initialized&&FP(`linkifyjs: already initialized - will not register custom scheme \"${e}\" ${IP}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or \"-\"\n2. Cannot start or end with \"-\"\n3. \"-\" cannot repeat`);LP.customSchemes.push([e,t])}function BP(){LP.scanner=_P(LP.customSchemes);for(let e=0;e<LP.tokenQueue.length;e++)LP.tokenQueue[e][1]({scanner:LP.scanner});LP.parser=MP(LP.scanner.tokens);for(let e=0;e<LP.pluginQueue.length;e++)LP.pluginQueue[e][1]({scanner:LP.scanner,parser:LP.parser});return LP.initialized=!0,LP}function VP(e){return LP.initialized||BP(),NP(LP.parser.start,e,vP(LP.scanner.start,e))}VP.scan=vP;function HP(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 CP(n),i=VP(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 UP=`[\\0- \\xA0 -\\u2029 ]`,WP=new RegExp(UP),GP=RegExp(`${UP}$`),KP=new RegExp(UP,`g`);function qP(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function JP(e){return new Rx({key:new Vx(`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(fk(IO(n.doc,[...t])).forEach(({newRange:t})=>{let n=RO(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(!GP.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(WP).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=VP(n).map(t=>t.toObject(e.defaultProtocol));if(!qP(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=>{pk(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 YP(e){return new Rx({key:new Vx(`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=lk(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function XP(e){return new Rx({key:new Vx(`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=HP(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 ZP(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(KP,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\\\^$*+?.()|[\\]{}]/g,`\\\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\\\-]+(?:[^a-z+.\\\\-:]|$))`,`i`))}var QP=wA.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`){zP(e);return}zP(e.scheme,e.optionalSlashes)})},onDestroy(){RP()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!ZP(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=>!!ZP(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=>!!ZP(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,YO(this.options.HTMLAttributes,e),0]:[`a`,YO(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=>!!ZP(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=>!!ZP(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()}},addPasteRules(){return[QA({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=HP(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!ZP(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(JP({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!ZP(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(YP({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(XP({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),$P=Object.defineProperty,eF=(e,t)=>{for(var n in t)$P(e,n,{get:t[n],enumerable:!0})},tF=`listItem`,nF=`textStyle`,rF=/^\\s*([-+*])\\s$/,iF=ZA.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`,YO(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,`\n`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(tF,this.editor.getAttributes(nF)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{\"Mod-Shift-8\":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=XA({find:rF,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=XA({find:rF,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(nF),editor:this.editor})),[e]}}),aF=(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}},oF=(e,t,n,r)=>{let i=aF(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},sF=(e,t,n)=>oF(e.state,e.view.dispatch,t,n),cF=(e,t)=>MA.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>sF(this.editor,e,t);return{Delete:n,\"Mod-Delete\":n}}}),lF=[[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`]],uF=`abcdefghijklmnopqrstuvwxyz`,dF=String.raw`\\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function fF(e){let t=e,n=``;for(let[e,r]of lF)for(;t>=e;)n+=r,t-=e;return n}function pF(e){return fF(e).toUpperCase()}function mF(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of lF)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function hF(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=mF(e);return t<=0?!1:(e===e.toLowerCase()?fF(t):pF(t))===e}function gF(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 _F(e){if(e<=26)return uF[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?uF[n]:uF[t]+uF[n]}function vF(e){if(e&&!/^\\d+$/.test(e)){if(hF(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 yF(e){if(/^\\d+$/.test(e))return parseInt(e,10);let t=vF(e);if(t===`i`||t===`I`)return mF(e);if(t===`a`||t===`A`){let t=gF(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function bF(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return _F(t);case`A`:return _F(t).toUpperCase();case`i`:return fF(t);case`I`:return pF(t);default:return String(t)}}function xF(e){if(e.length===0)return!1;let t=vF(e[0])??`numeric`,n=yF(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=bF(t,n+r);if(e[r]!==i)return!1}return!0}function SF(e){return{type:vF(e),start:yF(e)}}function CF(e){let{type:t,start:n}=SF(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function wF(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${_F(r)}${n}`;case`A`:return`${_F(r).toUpperCase()}${n}`;case`i`:return`${fF(r)}${n}`;case`I`:return`${pF(r)}${n}`;default:return`${r}${n}`}}function TF(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function EF(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var DF=ZA.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,YO(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(TF(e))return{type:`listItem`,content:[{type:`paragraph`,content:EF(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)=>gA(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){let t=e.meta?.parentAttrs?.start||1;return wF(e.meta?.parentAttrs?.type,t-1+(e.index||0),`. `)}return`- `},n),addExtensions(){return[cF(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)}}});eF({},{findListItemPos:()=>OF,getNextListDepth:()=>kF,handleBackspace:()=>jF,handleDelete:()=>PF,hasListBefore:()=>AF,hasListItemAfter:()=>FF,hasListItemBefore:()=>IF,listItemHasSubList:()=>LF,nextListIsDeeper:()=>MF,nextListIsHigher:()=>NF});var OF=(e,t)=>{let{$from:n}=t.selection,r=kD(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}},kF=(e,t)=>{let n=OF(e,t);if(!n)return!1;let[,r]=mk(t,e,n.$pos.pos+4);return r},AF=(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))},jF=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!vO(e.state,t)&&AF(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()}return!vO(e.state,t)||!xk(e.state)?!1:e.chain().liftListItem(t).run()},MF=(e,t)=>{let n=kF(e,t),r=OF(e,t);return!r||!n?!1:n>r.depth},NF=(e,t)=>{let n=kF(e,t),r=OF(e,t);return!r||!n?!1:n<r.depth},PF=(e,t)=>{if(!vO(e.state,t)||!bk(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:MF(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():NF(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},FF=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return r.index()!==r.parent.childCount-1&&r.nodeAfter?.type.name===e},IF=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return r.index()!==0&&r.nodeBefore?.type.name===e},LF=(e,t,n)=>{if(!n)return!1;let r=kD(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},RF=MA.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&&PF(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&&PF(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&&jF(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&&jF(e,n,r)&&(t=!0)}),t}}}}),zF=RegExp(`^(\\\\s*)(${dF})([.)])\\\\s+(.*)$`),BF=/^\\s/,VF={heading:/^#{1,6}(?:\\s|$)/,bulletItem:/^[-+*]\\s+/,codeFence:/^(?:```|~~~)/,thematicBreak:/^(?:(?:-[ \\t]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})$/};function HF(e){return zF.test(e.trimStart())}function UF(e){let t=e.trimStart();return VF.bulletItem.test(t)||HF(t)||VF.heading.test(t)||VF.thematicBreak.test(t)&&!t.startsWith(`-`)||/^>\\s?/.test(t)||VF.codeFence.test(t)}function WF(e){return Object.values(VF).some(t=>t.test(e))}function GF(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&&UF(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function KF(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(zF);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?vF(s):void 0,p=isNaN(d)?yF(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(zF))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(BF)){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(_||WF(t))break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(`\n`).trim(),contentLines:m,raw:g.join(`\n`)}),r=h,n=h}return[t,r]}var qF=RegExp(`^(${dF})([.)])\\\\s+(.+)$`);function JF(e){let t=e.split(`\n`).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(qF);if(!t)return null;n.push({marker:t[1],content:t[3]})}return xF(n.map(e=>e.marker))?{type:`orderedList`,attrs:CF(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function YF(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=GF(a.contentLines),c=o.join(`\n`).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`\n`).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=YF(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(`\n`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function XF(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 ZF=`listItem`,QF=`textStyle`,$F=/^(\\d+)\\.\\s$/;function eI(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 tI=ZA.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=eI(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=eI(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=YO(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?XF(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,`\n`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let r=e.split(`\n`),[i,a]=KF(r);if(i.length===0)return;let o=YF(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(`\n`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ZF,this.editor.getAttributes(QF)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{\"Mod-Shift-7\":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new Rx({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=JF(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=XA({find:$F,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=XA({find:$F,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(QF)}),joinPredicate:e,editor:this.editor})),[t]}}),nI=/^\\s*(\\[([( |x])?\\])\\s$/,rI=ZA.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}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,YO(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)=>gA(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[cF(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`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};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=XO(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[XA({find:nI,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),iI=ZA.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`,YO(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,`\n`):``,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=hA(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=hA(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()}}});MA.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(iF.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(DF.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(RF.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(tI.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(rI.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(iI.configure(this.options.taskList)),e}});var aI=` `,oI=`\\xA0`,sI=ZA.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,YO(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===aI||n[0].text===aI||n[0].raw===oI||n[0].text===oI)&&r.length===1&&r[0].type===`text`&&(r[0].text===aI||r[0].text===oI)?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){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?aI:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{\"Mod-Alt-0\":()=>this.editor.commands.setParagraph()}}}),cI=/(?:^|\\s)(~~(?!\\s+~~)((?:[^~]+))~~(?!\\s+~~))$/,lI=/(?:^|\\s)(~~(?!\\s+~~)((?:[^~]+))~~(?!\\s+~~))/g,uI=wA.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`,YO(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[qA({find:cI,type:this.type})]},addPasteRules(){return[QA({find:lI,type:this.type})]}}),dI=ZA.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),fI=wA.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`,YO(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 pI(e={}){return new Rx({view(t){return new mI(t,e)}})}var mI=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.setCursor(null),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=Zb(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)}},hI=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 gI(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!vI(e)||!yI(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}}};hI.prototype.visible=!1,hI.findFrom=hI.findGapCursorFrom,K.jsonID(`gapcursor`,hI);var gI=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 hI.valid(t)?new hI(t):K.near(t)}};function _I(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function vI(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||_I(e.type))return!0;if(e.inlineContent)return!1}}return!0}function yI(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||_I(e.type))return!0;if(e.inlineContent)return!1}}return!0}function bI(){return new Rx({props:{decorations:TI,createSelectionBetween(e,t,n){return t.pos==n.pos&&hI.valid(n)?new hI(n):null},handleClick:CI,handleKeyDown:xI,handleDOMEvents:{beforeinput:wI}}})}var xI=gD({ArrowLeft:SI(`horiz`,-1),ArrowRight:SI(`horiz`,1),ArrowUp:SI(`vert`,-1),ArrowDown:SI(`vert`,1)});function SI(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=hI.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new hI(c))),!0):!1}}function CI(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!hI.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 hI(r))),!0)}function wI(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof hI))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 TI(e){if(!(e.selection instanceof hI))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,hE.create(e.doc,[fE.widget(e.selection.head,t,{key:`gapcursor`})])}var EI=200,DI=function(){};DI.prototype.append=function(e){return e.length?(e=DI.from(e),!this.length&&e||e.length<EI&&this.leafAppend(e)||this.length<EI&&e.leafPrepend(this)||this.appendInner(e)):this},DI.prototype.prepend=function(e){return e.length?DI.from(e).append(this):this},DI.prototype.appendInner=function(e){return new kI(this,e)},DI.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?DI.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},DI.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},DI.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)},DI.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},DI.from=function(e){return e instanceof DI?e:e&&e.length?new OI(e):DI.empty};var OI=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<=EI)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=EI)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}(DI);DI.empty=new OI([]);var kI=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}(DI),AI=500,jI=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 NI(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 NI(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 NI(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>FI&&(s=MI(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new hb;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 NI(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;n=Math.min(this.items.length,n);let r=[],i=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 NI(i,o,l))}else r.push(new NI(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new NI(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>AI&&(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 NI(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(DI.from(i.reverse()),a)}};jI.empty=new jI(DI.empty,0);function MI(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var NI=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)}}},PI=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},FI=20;function II(e,t,n,r){let i=n.getMeta(WI),a;if(i)return i.historyState;n.getMeta(GI)&&(e=new PI(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(WI))return o.getMeta(WI).redo?new PI(e.done.addTransform(n,void 0,r,UI(t)),e.undone,RI(n.mapping.maps),e.prevTime,e.prevComposition):new PI(e.done,e.undone.addTransform(n,void 0,r,UI(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||!LI(n,e.prevRanges)),s=o?zI(e.prevRanges,n.mapping):RI(n.mapping.maps);return new PI(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,UI(t)),jI.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new PI(e.done.rebased(n,a),e.undone.rebased(n,a),zI(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new PI(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),zI(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function LI(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 RI(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 zI(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 BI(e,t,n){let r=UI(t),i=WI.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 PI(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(WI,{redo:n,historyState:c})}var VI=!1,HI=null;function UI(e){let t=e.plugins;if(HI!=t){VI=!1,HI=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){VI=!0;break}}return VI}var WI=new Vx(`history`),GI=new Vx(`closeHistory`);function KI(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Rx({key:WI,state:{init(){return new PI(jI.empty,jI.empty,null,0,-1)},apply(t,n,r){return II(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?JI:n==`historyRedo`?YI:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function qI(e,t){return(n,r)=>{let i=WI.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=BI(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var JI=qI(!1,!0),YI=qI(!0,!0);MA.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 Rx({key:new Vx(`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 XI=MA.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[pI(this.options)]}});MA.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new Rx({key:new Vx(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return hE.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(fE.node(t,t+e.nodeSize,{class:this.options.className}))}),hE.create(e,a)}}})]}});var ZI=MA.create({name:`gapCursor`,addProseMirrorPlugins(){return[bI()]},extendNodeSchema(e){return{allowGapCursor:Z(X(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),QI=`placeholder`,$I=new Vx(`tiptap__placeholder`);function eL(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),fE.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function tL(e,t){return typeof e==`function`?e(t):e}function nL({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&&wk(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(eL({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:tL(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function rL({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&&wk(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(eL({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:tL(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...nL({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return hE.create(r,o)}function iL(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 aL(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function oL(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 sL(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 cL(e,t){let n=oL(e,t.from,t.to);return n.push(aL(e,iL(e,t.from))),t.to>t.from?n.push(aL(e,iL(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(aL(e,iL(e,Math.min(t.from+1,e.content.size)))),n}function lL(e,t,n){let r=[];if(e.docChanged){let t=fk(e);for(let e of t)r.push(...cL(n.doc,e.newRange))}return e.selectionSet&&(r.push(aL(n.doc,iL(n.doc,e.mapping.map(t.selection.anchor)))),r.push(aL(n.doc,iL(n.doc,n.selection.anchor)))),sL(r)}function uL(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 dL({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}=uL(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=nL({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function fL({editor:e,options:t,dataAttribute:n}){return{init(r,i){return rL({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??hE.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:dL({decorations:i.map(r.mapping,r.doc),ranges:lL(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function pL(e){return e.replace(/\\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function mL({editor:e,options:t}){let n=t.dataAttribute?`data-${pL(t.dataAttribute)}`:`data-${QI}`,r=t.showOnlyCurrent&&!t.includeChildren;return new Rx({key:$I,...r?{}:{state:fL({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>rL({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?hE.empty:$I.getState(n)??hE.empty}})}MA.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:QI,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[mL({editor:this.editor,options:this.options})]}});function hL(e,t){return!e.selection.empty&&!Tk(e.selection)&&t.isEditable}function gL(e,t){return hL(e,t)&&!t.isFocused&&!t.view.dragging}function _L(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function vL(e){e.focus()}MA.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new Rx({key:new Vx(`selection`),props:{decorations(n){return gL(n,e)?hE.create(n.doc,[fE.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return hL(t.state,e)&&_L(),!1},focus(t){return hL(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&vL(t)}),!1}}}})]}});function yL({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var bL=MA.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new Vx(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 Rx({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!yL({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!yL({node:r,types:n})}}})]}}),xL=MA.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>JI(e,t),redo:()=>({state:e,dispatch:t})=>YI(e,t)}},addProseMirrorPlugins(){return[KI(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()}}}),SL=MA.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(SM.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(_M.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(iF.configure(this.options.bulletList)),this.options.code!==!1&&e.push(TM.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(kM.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(AM.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(XI.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(ZI.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(jM.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(MM.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(xL.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(NM.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(RM.configure(this.options.italic)),this.options.listItem!==!1&&e.push(DF.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(RF.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(QP.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(tI.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(sI.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(uI.configure(this.options.strike)),this.options.text!==!1&&e.push(dI.configure(this.options.text)),this.options.underline!==!1&&e.push(fI.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(bL.configure(this.options?.trailingNode)),e}}),CL=_u(`<div></div>`),wL=Wn(10),TL=Symbol(wL+5),EL={bold:e=>e.toggleBold(),italic:e=>e.toggleItalic(),underline:e=>e.toggleUnderline(),strikethrough:e=>e.toggleStrike(),code:e=>e.toggleCode(),blockquote:e=>e.toggleBlockquote(),bulletList:e=>e.toggleBulletList(),orderedList:e=>e.toggleOrderedList(),codeBlock:e=>e.toggleCodeBlock(),horizontalRule:e=>e.setHorizontalRule(),paragraph:e=>e.setParagraph(),heading1:e=>e.toggleHeading({level:1}),heading2:e=>e.toggleHeading({level:2}),heading3:e=>e.toggleHeading({level:3}),heading4:e=>e.toggleHeading({level:4}),heading5:e=>e.toggleHeading({level:5}),heading6:e=>e.toggleHeading({level:6})},DL=[[`bold`,`bold`],[`italic`,`italic`],[`underline`,`underline`],[`strikethrough`,`strike`],[`code`,`code`],[`blockquote`,`blockquote`],[`bulletList`,`bulletList`],[`orderedList`,`orderedList`],[`codeBlock`,`codeBlock`],[`link`,`link`],[`heading1`,`heading`,{level:1}],[`heading2`,`heading`,{level:2}],[`heading3`,`heading`,{level:3}],[`heading4`,`heading`,{level:4}],[`heading5`,`heading`,{level:5}],[`heading6`,`heading`,{level:6}],[`paragraph`,`paragraph`]];function OL(e){let t=[];for(let[n,r,i]of DL)e.isActive(r,i)&&t.push(n);return t}function kL(e){let t=e?.extensions??[];return e?.starterKit===!1||t.some(e=>e?.name===`starterKit`)?t:[e?.starterKit?SL.configure(e.starterKit):SL,...t]}var AL=bl(function(e,t,n){let r=ol(t,wL+0),i=r.hooks;i===void 0&&(r.hooks=i=cl(4));let a,o,s=dl(void 0,wL+0),c=dl(void 0,wL+1),l=dl(JSON.stringify([e.json!==void 0,e.value]),wL+2),u=dl(JSON.stringify(e.json),wL+3),d=dl(void 0,wL+4),f=Nc(TL,fM,{extensions:(a=e.web?.extensions,o=e.web?.starterKit,i[0]!==!0||!al(i[1],a)||!al(i[2],o)?ul(i,0,kL(e.web),a,o):i[3]),content:e.json??e.value??``,editable:e.editable!==!1,autofocus:e.autofocus??!1,onCreate:()=>e.onReady?.(),onUpdate:({editor:t})=>{let n=t.getHTML();s.current=n,e.onChange?.(n);let r=t.getJSON();c.current=JSON.stringify(r),e.onJSONChange?.(r)},onFocus:()=>e.onFocus?.(),onBlur:()=>e.onBlur?.(),onSelectionUpdate:({editor:t})=>e.onSelectionChange?.({start:t.state.selection.from,end:t.state.selection.to,active:OL(t)})});if(el(()=>{if(!f)return;let t=JSON.stringify([e.json!==void 0,e.value]);t!==l.current&&(l.current=t,e.value!==void 0&&e.json===void 0&&e.value!==s.current&&f.commands.setContent(e.value))},[f,e.value,e.json],wL+6),el(()=>{if(!f)return;let t=JSON.stringify(e.json);t!==u.current&&(u.current=t,e.json!==void 0&&t!==c.current&&f.commands.setContent(e.json))},[f,e.json],wL+7),el(()=>{f&&f.setEditable(e.editable!==!1)},[f,e.editable],wL+8),pl(e.ref,()=>{if(!f)return null;let e=f;return d.current={getHTML:()=>e.getHTML(),setHTML:t=>e.commands.setContent(t),getJSON:()=>e.getJSON(),setJSON:t=>e.commands.setContent(t),apply:t=>{let n=EL[t];n&&n(e.chain().focus()).run()},linkTo:(t,n)=>{n!=null&&n!==``?e.chain().focus().insertContent({type:`text`,text:n,marks:[{type:`link`,attrs:{href:t}}]}).run():e.chain().focus().extendMarkRange(`link`).setLink({href:t}).run()},removeLink:()=>e.chain().focus().unsetLink().run(),isActive:t=>OL(e).includes(t),undo:()=>e.commands.undo(),redo:()=>e.commands.redo(),focus:()=>e.commands.focus(),blur:()=>e.commands.blur(),isFocused:()=>e.isFocused,native:e},d.current},[f],wL+9),t.block.pending&&!t.block.crossRenderUpdate)return;let p=t.slots[0];if(p===void 0){let e,n=Su(CL);e=n,p=Tu(t,n,void 0,e,void 0)}p.a=Xu([`vx-richtext`,e.className],p.a,p.b);{let t=e.style;p.c!==t&&(Xd(p.b,t,p.c),p.c=t)}wh(t,1,p.b,Nv,{editor:f},void 0,void 0,2,void 0,void 0,`c:95ead9de`)}),jL=[`bold`,`italic`,`underline`,`strikethrough`,`code`,`blockquote`,`bulletList`,`orderedList`,`taskList`,`codeBlock`,`horizontalRule`,`highlight`,`subscript`,`superscript`,`paragraph`,`heading1`,`heading2`,`heading3`,`heading4`,`heading5`,`heading6`,`alignLeft`,`alignCenter`,`alignRight`,`link`];function ML(e){let t=null,n=[],r={start:0,end:0,active:[]},i=(e,n={})=>{let i={event:e,html:t?.getHTML()??``,json:t?.getJSON?.()??null,focused:t?.isFocused()??!1,selection:r,...n};window.webkit.messageHandlers.editor.postMessage(JSON.stringify(i))},a=e=>{setTimeout(()=>{t&&(r={...r,active:jL.filter(e=>t.isActive(e))},i(e))},0)},o=r=>{r.method===`props`?(e({...r.args[0],...s}),t&&a(`snapshot`)):t?[`setHTML`,`setJSON`,`apply`,`linkTo`,`removeLink`,`undo`,`redo`,`focus`,`blur`].includes(r.method)&&(t[r.method]?.(...r.args),a(`snapshot`)):n.push(r)},s={ref(e){if(e&&e!==t){t=e,a(`ready`);for(let e of n.splice(0))o(e)}},onChange:()=>a(`change`),onSelectionChange(e){r=e,a(`selection`)},onFocus:()=>a(`focus`),onBlur:()=>a(`blur`)};window.__xplatEditorReceive=e=>{try{o(JSON.parse(e))}catch(e){i(`error`,{message:String(e)})}},window.addEventListener(`error`,e=>i(`error`,{message:e.message})),window.addEventListener(`unhandledrejection`,e=>i(`error`,{message:String(e.reason)})),i(`boot`)}var NL=xv(document.getElementById(`root`));ML(e=>NL.render(hh(()=>_h(`c:5a3f7d0e`,AL,{...e}))))})();</script></body></html>"
|