@witty-works/editor 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +56 -0
- package/dist/witty-editor.js +201 -0
- package/package.json +53 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/*! @witty-works/editor 2.0.0 (eb5d21fe) | MIT | https://witty.works */
|
|
2
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.witty-works-button{cursor:pointer!important;box-shadow:none!important;font:inherit!important;color:inherit!important;text-align:inherit!important;text-transform:none!important;line-height:inherit!important;background-color:#0000!important;border:none!important;outline:none!important;margin:0!important;padding:0!important}#witty-works-ext-popover{display:"flex";box-sizing:border-box;z-index:2147483647;background-color:#fff;border-radius:5px;min-width:272px;padding:0 8px;box-shadow:1px 0 18px 7px #3232321a}#witty-works-ext-popover-content{flex-direction:column;display:flex}.witty-works-ext-wittyworks-popover-alternative-btn-container{flex-direction:row;align-items:center;display:flex;margin-bottom:.5em!important}.witty-works-ext-wittyworks-popover-alternative-btn-container:hover .witty-works-ext-wittyworks-popover-alternative-btn{background-color:#5fca7d4d}.witty-works-ext-wittyworks-popover-alternative-btn-container:hover .witty-works-ext-wittyworks-popover-alternative-context{color:#365e3b}.witty-works-ext-wittyworks-popover-alternative-btn{cursor:pointer;font:inherit;text-align:left;background-color:#f1fff3;border:none;border-radius:4px;padding:3px 8px;display:table}.witty-works-ext-wittyworks-popover-alternative-btn.witty-works-ext-remove-text{text-decoration:line-through!important}button.witty-works-ext-dropdown-select{background:0 0}#witty-works-ext-popover button:focus-visible,#witty-works-ext-popover a:focus-visible{outline-offset:1px;outline:2px solid #9489db!important}.witty-works-ext-ignore-color-transformer{filter:invert(38%)sepia(2%)saturate(0%)hue-rotate(73deg)brightness()contrast(89%)}.witty-works-ext-ignore-color-transformer:hover{filter:invert(39%)sepia(86%)saturate(747%)hue-rotate(323deg)brightness(109%)contrast(80%);color:#8b1b1b;cursor:pointer}.witty-works-ext-lato-small-paragraph-title-h4{color:#000;font-family:Lato,Arial,Helvetica,sans-serif;font-size:22px;font-style:normal;font-weight:600;line-height:28px}.witty-works-ext-lato-popover-text{color:#000;font-family:Lato,Arial,Helvetica,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:20px}.witty-works-ext-lato-popover-text-green{color:#365e3b;font-family:Lato,Arial,Helvetica,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:20px}.witty-works-ext-lato-popover-text-gray{color:#656565;font-family:Lato,Arial,Helvetica,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:20px}.witty-works-ext-lato-popover-text-light-gray{color:#ddd;stroke:#ddd;font-family:Lato,Arial,Helvetica,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:20px}.witty-works-ext-lato-popup-title{color:#000;font-family:Lato,Arial,Helvetica,sans-serif;font-size:16px;font-style:normal;font-weight:700;line-height:20px}.witty-works-ext-lato-popup-text{color:#000;font-family:Lato,Arial,Helvetica,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:20px}.witty-works-ext-lato-popup-text-purple{color:#9489db;font-family:Lato,Arial,Helvetica,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:20px;text-decoration-line:underline}.witty-works-ext-button{cursor:pointer;border:none;gap:10px;margin-right:1em;padding:10px 15px;font-family:Lato,Arial,Helvetica,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:14px;display:flex}.witty-works-ext-primary-button-red{color:#fff;background:#f06464;border-radius:8px}.witty-works-ext-primary-button-purple{color:#fff;background:#9489db;border-radius:8px}.witty-works-ext-secondary-button-purple{color:#8b1b1b;background:#fff;border:1px solid #8b1b1b;border-radius:8px}.witty-works-ext-secondary-button-red{color:#f06464;border:1px solid #f06464;border-radius:8px;padding:.4em}.witty-works-ext-ignore-button{padding:2px 6px}.witty-works-ext-strong-gradient-background{background:linear-gradient(114.59deg,#f06464 1.6%,#f277d0 32.79%,#9489db 71.64%,#37d1e5 101.91%,#5acfb9 131.52%)}.witty-works-ext-light-gray-background{background:#eee}.witty-works-ext-dark-gray-background{background:#ddd}.witty-works-ext-section{flex-direction:column;justify-content:space-around;padding-bottom:0;display:flex;padding:1em!important}.witty-works-ext-ignore-section{flex-direction:row;align-items:center;padding-bottom:0;font-size:12px;display:flex;white-space:nowrap!important;justify-content:flex-start!important;margin-right:.5em!important;padding:0 0 1em .3em!important}.witty-works-ext-wittyworks-container{align-items:left;flex-direction:column;padding-bottom:.5em;display:flex}.witty-works-ext-container-rounded{border-radius:8px}.witty-works-ext-container-row{align-items:center;display:flex;flex-direction:row!important}.witty-works-ext-rephrasing ins{color:#00f!important}.witty-works-ext-rephrasing del{color:red!important}.witty-works-ext-justify-start{justify-content:flex-start!important}.witty-works-ext-justify-end{justify-content:flex-end!important}.witty-works-ext-justify-space-between{justify-content:space-between!important}.witty-works-ext-center{flex-direction:column;justify-content:center;align-items:center;display:flex}.witty-works-ext-full-padding{padding:1em}.witty-works-ext-left{flex-direction:column;justify-content:center;align-items:flex-start;display:flex}.witty-works-ext-margin-right{display:flex;margin-right:.5em!important}.witty-works-ext-margin-left{margin-left:.5em!important}.witty-works-ext-margin-top{margin-top:1em!important}.witty-works-ext-margin-top-half{margin-top:.5em!important}.witty-works-ext-margin-bottom{margin-bottom:1em!important}.witty-works-ext-body{color:#000;font-family:Lato,Arial,Helvetica,sans-serif}#witty-works-ext-popup-root{flex-direction:column;min-width:300px;display:flex}.witty-works-ext-header{justify-content:space-between;padding:1em 1em 1.3em;display:flex}.witty-works-ext-header svg{cursor:pointer}.witty-works-ext-separator{background-color:#f1f2f2;border:0;width:calc(100% + 16px);height:1px;margin-left:-8px;overflow:hidden}.witty-works-ext-cursor-pointer{cursor:pointer}.witty-works-ext-margin-auto{margin-top:auto;margin-bottom:auto}.witty-works-ext-learning-bite-dig-deeper{background-color:#fff;border:none;justify-content:space-between;align-items:center;min-width:800px;min-height:320px;margin:1em 1em .4em;display:flex}.witty-works-ext-dropdown-select{cursor:pointer;color:#8b1b1b;border:1px solid #8b1b1b;border-radius:8px;gap:10px;margin-right:1em;padding:10px 15px;font-family:Lato,Arial,Helvetica,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:14px;display:flex}.witty-works-dig-deeper{cursor:pointer;color:#fff;background-color:#8b1b1b;border-radius:8px;gap:10px;max-width:fit-content;margin-top:20px;margin-right:1em;padding:10px 15px;font-family:Lato,Arial,Helvetica,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:14px;display:flex}.witty-preferences{color:#1a1a1a;font-family:Lato,Arial,Helvetica,sans-serif;font-size:15px;line-height:1.5}.witty-preferences section+section{border-top:1px solid #e6e6e6;margin-top:1.6em;padding-top:1.2em}.witty-preferences h2{margin:0 0 .6em;font-size:17px}.witty-preferences label{margin-top:1.2em;margin-bottom:.3em;font-weight:600;display:block}.witty-preferences input[type=checkbox]{width:auto;margin:0}.witty-preferences label:has(input[type=checkbox]){align-items:center;margin-top:.5em;font-weight:400;display:flex}.witty-options-muted{color:#666;font-size:.92em}.witty-category-group{margin-top:1.4em}.witty-category-group h3{color:#4a4a4a;text-transform:uppercase;letter-spacing:.04em;margin:0 0 .4em;font-size:14px}.witty-category{align-items:center;gap:.7em;padding:.32em 0;display:flex}.witty-category-label{flex:1}.witty-category-level{color:#666;text-align:right;min-width:5.5em;font-size:.88em}.witty-category-toggle{cursor:pointer;background:#ccc;border:0;border-radius:11px;flex:none;width:46px;height:22px;padding:0;transition:background .12s ease-in-out;position:relative}.witty-category-toggle .witty-category-knob{background:#fff;border-radius:50%;width:16px;height:16px;transition:left .12s ease-in-out;position:absolute;top:3px;left:3px}.witty-category-toggle.is-on{background:#5fca7d}.witty-category-toggle.is-on .witty-category-knob{left:27px}.witty-category-toggle.is-middle{background:#a8dfb8}.witty-category-toggle.is-middle .witty-category-knob{left:15px}.witty-category-toggle.is-locked{cursor:not-allowed;opacity:.55}.witty-category-toggle:focus-visible{outline-offset:2px;outline:2px solid #55b8e9}.witty-format-field{margin-top:1.2em}.witty-format-field label{margin-top:0}.witty-format-field p{margin:.2em 0 .5em}.witty-format-field select{box-sizing:border-box;width:100%;font:inherit;background:#fff;border:1px solid #ccc;border-radius:4px;padding:8px 10px}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
3
|
+
var WittyEditor=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},c=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),l=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),f=e=>o.call(e,`module.exports`)?e[`module.exports`]:u(n({},`__esModule`,{value:!0}),e),p=Object.defineProperty,m=(e,t)=>{let n={};for(var r in e)p(n,r,{get:e[r],enumerable:!0});return t||p(n,Symbol.toStringTag,{value:`Module`}),n};function h(e){this.content=e}h.prototype={constructor:h,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 h(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 h(n)},addToStart:function(e,t){return new h([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new h(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 h(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=h.from(e),e.size?new h(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=h.from(e),e.size?new h(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=h.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}},h.from=function(e){if(e instanceof h)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new h(t)};function g(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&&y(e.charCodeAt(r-1))&&v(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=g(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function _(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&&y(e.charCodeAt(i-1))&&v(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=_(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function v(e){return e>=56320&&e<57344}function y(e){return e>=55296&&e<56320}var b=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 g(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return _(this,e,t,n)}findIndex(e){if(e==0)return S(0,e);if(e==this.size)return S(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?S(t+1,i):S(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)`:``))}};b.empty=new b([],0);var x={index:0,offset:0};function S(e,t){return x.index=e,x.offset=t,x}function C(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(!C(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!C(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var w=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&&C(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}};w.none=[];var T=class extends Error{},E=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=te(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(ee(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(b.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)}};E.empty=new E(b.empty,0,0);function ee(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(ee(a.content,t-i-1,n-i-1)))}function te(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=te(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 ne(e,t,n){if(n.openStart>e.depth)throw new T(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new T(`Inconsistent open depths`);return re(e,t,n,0)}function re(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=re(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return oe(a,ce(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return oe(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=le(n,e);return oe(a,se(e,i,o,t,r))}}function ie(e,t){if(!t.type.compatibleContent(e.type))throw new T(`Cannot join `+t.type.name+` onto `+e.type.name)}function ae(e,t,n){let r=e.node(n);return ie(r,t.node(n)),r}function D(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 O(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&&(D(e.nodeAfter,r),a++));for(let e=a;e<o;e++)D(i.child(e),r);t&&t.depth==n&&t.textOffset&&D(t.nodeBefore,r)}function oe(e,t){if(!e.type.validContent(t))throw new T(`Invalid content for node `+e.type.name);return e.copy(t)}function se(e,t,n,r,i){let a=e.depth>i&&ae(e,t,i+1),o=r.depth>i&&ae(n,r,i+1),s=[];return O(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(ie(a,o),D(oe(a,se(e,t,n,r,i+1)),s)):(a&&D(oe(a,ce(e,t,i+1)),s),O(t,n,i,s),o&&D(oe(o,ce(n,r,i+1)),s)),O(r,null,i,s),new b(s)}function ce(e,t,n){let r=[];return O(null,e,n,r),e.depth>n&&D(oe(ae(e,t,n+1),ce(e,t,n+1)),r),O(t,null,n,r),new b(r)}function le(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(b.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var ue=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 w.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 me(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=pe.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 pe.set(t,r=new de);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%fe,i}},de=class{constructor(){this.elts=[],this.i=0}},fe=12,pe=new WeakMap,me=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)}},he=Object.create(null),ge=class e{constructor(e,t,n,r=w.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||b.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&&C(this.attrs,t||e.defaultAttrs||he)&&w.sameSet(this.marks,n||w.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 E.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new E(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return ne(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 ue.resolveCached(this,e)}resolveNoCache(e){return ue.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()+`)`),ve(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=b.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),ye(this.type.attrs,this.attrs,`node`,this.type.name);let e=w.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];ye(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!w.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=b.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};ge.prototype.text=void 0;var _e=class e extends ge{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):ve(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 ve(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function ye(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 be=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new xe(t,n);if(r.next==null)return e.empty;let i=Se(r);r.next&&r.err(`Unexpected trailing text`);let a=Me(ke(i));return Ne(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 b.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(`
|
|
4
|
+
`)}};be.empty=new be(!0);var xe=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 Se(e){let t=[];do t.push(Ce(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Ce(e){let t=[];do t.push(we(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function we(e){let t=Oe(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Ee(e,t);else break;return t}function Te(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Ee(e,t){let n=Te(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Te(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function De(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 Oe(e){if(e.eat(`(`)){let t=Se(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=De(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 ke(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 Ae(e,t){return t-e}function je(e,t){let n=[];return r(t),n.sort(Ae);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 Me(e){let t=Object.create(null);return n(je(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]);je(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new be(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Ae);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Ne(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 Pe(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 Fe(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 Ie(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new ze(e,r,t[r]);return n}var Le=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=Ie(e,n.attrs),this.defaultAttrs=Pe(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==be.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:Fe(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new ge(this,this.computeAttrs(e),b.from(t),w.setFrom(n))}createChecked(e=null,t,n){return t=b.from(t),this.checkContent(t),new ge(this,this.computeAttrs(e),t,w.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=b.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(b.empty,!0);return i?new ge(this,e,t.append(i),w.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:w.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 Re(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 ze=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Re(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Be=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Ie(e,r.attrs),this.excluded=null;let i=Pe(this.attrs);this.instance=i?new w(this,i):null}create(e=null){return!e&&this.instance?this.instance:new w(this,Fe(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}},Ve=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=h.from(e.nodes),t.marks=h.from(e.marks||{}),this.nodes=Le.compile(this.spec.nodes,this),this.marks=Be.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]=be.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?He(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==``?[]:He(this,n.split(` `))}this.nodeFromJSON=e=>ge.fromJSON(this,e),this.markFromJSON=e=>w.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 Le))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 _e(n,n.defaultAttrs,e,w.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 He(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 Ue(e){return e.tag!=null}function We(e){return e.style!=null}var Ge=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Ue(e))this.tags.push(e);else if(We(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 et(this,t,!1);return n.addAll(e,w.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new et(this,t,!0);return n.addAll(e,w.none,t.from,t.to),E.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(nt(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=rt(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=rt(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)))}},Ke={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},qe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Je={ol:!0,ul:!0},Ye=1,Xe=2,Ze=4;function Qe(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Ye:0)|(t===`full`?Xe:0)}var $e=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=w.none,this.match=i||(a&Ze?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(b.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&Ye)){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=b.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(b.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&&!Ke.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},et=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=Qe(null,t.preserveWhitespace,0)|(n?Ze:0);i=r?new $e(r.type,r.attrs,w.none,!0,t.topMatch||r.type.contentMatch,a):n?new $e(null,null,w.none,!0,null,a):new $e(e.schema.topNodeType,null,w.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&Xe?`full`:this.localPreserveWS||(r.options&Ye)>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,`
|
|
5
|
+
`);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;Je.hasOwnProperty(a)&&this.parser.normalizeLists&&tt(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:qe.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(Ke.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(`
|
|
6
|
+
`),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=w.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):it(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=Qe(e,i,a.options);a.options&Ze&&a.content.length==0&&(o|=Ze);let s=w.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):it(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new $e(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|=Ye);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 tt(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Je.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function nt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function rt(e){let t={};for(let n in e)t[n]=e[n];return t}function it(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 at=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=st(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 st(t).createTextNode(e.text);let{dom:n,contentDOM:r}=dt(st(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&&dt(st(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:dt(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=ot(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return ot(e.marks)}};function ot(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function st(e){return e.document||window.document}var ct=new WeakMap;function lt(e){let t=ct.get(e);return t===void 0&&ct.set(e,t=ut(e)),t}function ut(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 dt(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=lt(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}=dt(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var ft=65535,pt=2**16;function mt(e,t){return e+t*pt}function ht(e){return e&ft}function gt(e){return(e-(e&ft))/pt}var _t=1,vt=2,yt=4,bt=8,xt=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&bt)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&yt)>0}},St=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=ht(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+gt(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:mt(o/3,e-s),f=e==s?vt:e==u?_t:yt;return(t<0?e!=s:e!=u)&&(f|=bt),new xt(a,f,d)}r+=l-c}return n?e+r:new xt(e+r,0,null)}touches(e,t){let n=0,r=ht(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])}};St.empty=new St([]);var Ct=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 xt(e,r,null)}},wt=Object.create(null),Tt=class{getMap(){return St.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=wt[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in wt)throw RangeError(`Duplicate use of step JSON ID `+e);return wt[e]=t,t.prototype.jsonID=e,t}},k=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 T)return e.fail(t.message);throw t}}};function Et(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Et(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return b.fromArray(r)}var Dt=class e extends Tt{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 E(Et(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 k.fromReplace(e,this.from,this.to,i)}invert(){return new Ot(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))}};Tt.jsonID(`addMark`,Dt);var Ot=class e extends Tt{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 E(Et(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return k.fromReplace(e,this.from,this.to,n)}invert(){return new Dt(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))}};Tt.jsonID(`removeMark`,Ot);var kt=class e extends Tt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return k.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return k.fromReplace(e,this.pos,this.pos+1,new E(b.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 At(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))}};Tt.jsonID(`addNodeMark`,kt);var At=class e extends Tt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return k.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return k.fromReplace(e,this.pos,this.pos+1,new E(b.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new kt(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))}};Tt.jsonID(`removeNodeMark`,At);var jt=class e extends Tt{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Nt(e,this.from,this.to)?k.fail(`Structure replace would overwrite content`):k.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new St([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?E.empty:new E(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?E.empty:new E(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,E.fromJSON(t,n.slice),!!n.structure)}};jt.MAP_BIAS=1,Tt.jsonID(`replace`,jt);var Mt=class e extends Tt{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&&(Nt(e,this.from,this.gapFrom)||Nt(e,this.gapTo,this.to)))return k.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return k.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?k.fromReplace(e,this.from,this.to,n):k.fail(`Content does not fit in gap`)}getMap(){return new St([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,E.fromJSON(t,n.slice),n.insert,!!n.structure)}};Tt.jsonID(`replaceAround`,Mt);function Nt(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 Pt(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 Ot(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Dt(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Ft(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 Be){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 Ot(t.from,t.to,t.style)))}function It(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 jt(s,l,E.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Ot(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 E(b.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new jt(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(b.empty,!0);e.replace(s,s,new E(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Lt(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Rt(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||!Lt(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function zt(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=b.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=b.from(r.node(e).copy(u)),d++):c--;let f=b.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=b.from(i.node(e).copy(f)),p++):l++;e.step(new Mt(c,l,o,s,new E(u.append(f),d,p),u.size-d,!0))}function Bt(e,t,n=null,r=e){let i=Ht(e,t),a=i&&Ut(r,t);return a?i.map(Vt).concat({type:t,attrs:n}).concat(a.map(Vt)):null}function Vt(e){return{type:e,attrs:null}}function Ht(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 Ut(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 Wt(e,t,n){let r=b.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=b.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Mt(i,a,i,a,new E(r,0,0),n.length,!0))}function Gt(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)&&Jt(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&&qt(e,t,n,a),It(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 Mt(c,l,c+1,l-1,new E(b.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Kt(e,t,n,a),!1}})}function Kt(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 qt(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(`
|
|
7
|
+
`))}})}function Jt(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Yt(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 Mt(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new E(b.from(o),0,0),1,!0))}function Xt(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 Zt(e,t,n=1,r){let i=e.doc.resolve(t),a=b.empty,o=b.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=b.from(i.node(e).copy(a));let t=r&&r[s];o=b.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new jt(t,t,new E(a.append(o),n,n),!0))}function Qt(e,t){let n=e.resolve(t),r=n.index();return en(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function $t(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 en(e,t){return!!(e&&t&&!e.isLeaf&&$t(e,t))}function tn(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&&en(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 nn(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);qt(e,r.node(),r.before(),s)}o.inlineContent&&It(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 jt(l,c.map(t+n,-1),E.empty,!0)),r===!0){let t=e.doc.resolve(l);Kt(e,t.node(),t.before(),e.steps.length)}return e}function rn(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 an(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 on(e,t,n=t,r=E.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return sn(i,a,r)?new jt(t,n,r):new cn(i,a,r).fit()}function sn(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var cn=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=b.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=b.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 E(i,a,o);return e>-1?new Mt(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new jt(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=dn(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(b.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 gn(e,-1)<=t?!1:(this.unplaced.size>1&&gn(e,1)>n&&n++,this.unplaced=new E(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=dn(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new E(ln(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new E(ln(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(fn(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=un(this.placed,t,b.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?E.empty:new E(ln(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new E(ln(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||!pn(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=pn(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=pn(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=un(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=un(this.placed,this.depth,b.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(b.empty,!0);e.childCount&&(this.placed=un(this.placed,this.frontier.length,e))}};function ln(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(ln(e.firstChild.content,t-1,n)))}function un(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(un(e.lastChild.content,t-1,n)))}function dn(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function fn(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,fn(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(b.empty,!0)))),e.copy(r)}function pn(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&&!mn(n,a.content,o)?s:null}function mn(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function hn(e){return e.spec.defining||e.spec.definingForContent}function gn(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 _n(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(sn(i,a,r))return e.step(new jt(t,n,r));let o=xn(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=hn(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 E(vn(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 vn(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(vn(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(b.empty,!0))}return e}function yn(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=rn(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new E(b.from(r),0,0))}function bn(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=xn(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 xn(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 Sn=class e extends Tt{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 k.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 k.fromReplace(e,this.pos,this.pos+1,new E(b.from(r),0,+!t.isLeaf))}getMap(){return St.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)}};Tt.jsonID(`attr`,Sn);var Cn=class e extends Tt{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 k.ok(n)}getMap(){return St.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)}};Tt.jsonID(`docAttr`,Cn);var wn=class extends Error{};wn=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},wn.prototype=Object.create(Error.prototype),wn.prototype.constructor=wn,wn.prototype.name=`TransformError`;var Tn=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ct}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new wn(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=E.empty){let r=on(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new E(b.from(n),0,0))}delete(e,t){return this.replace(e,t,E.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return _n(this,e,t,n),this}replaceRangeWith(e,t,n){return yn(this,e,t,n),this}deleteRange(e,t){return bn(this,e,t),this}lift(e,t){return zt(this,e,t),this}join(e,t=1){return nn(this,e,t),this}wrap(e,t){return Wt(this,e,t),this}setBlockType(e,t=e,n,r=null){return Gt(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Yt(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Sn(e,t,n)),this}setDocAttribute(e,t){return this.step(new Cn(e,t)),this}addNodeMark(e,t){return this.step(new kt(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof w)t.isInSet(n.marks)&&this.step(new At(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new At(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 Zt(this,e,t,n),this}addMark(e,t,n){return Pt(this,e,t,n),this}removeMark(e,t,n){return Ft(this,e,t,n),this}clearIncompatible(e,t,n){return It(this,e,t,n),this}},En=Object.create(null),A=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Dn(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=E.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?E.empty:t),o==0&&Fn(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),Fn(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new j(e):Pn(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?Pn(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Pn(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 Mn(e.node(0))}static atStart(e){return Pn(e,e,0,0,1)||new Mn(e)}static atEnd(e){return Pn(e,e,e.content.size,e.childCount,-1)||new Mn(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=En[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in En)throw RangeError(`Duplicate use of selection JSON ID `+e);return En[e]=t,t.prototype.jsonID=e,t}getBookmark(){return j.between(this.$anchor,this.$head).getBookmark()}};A.prototype.visible=!0;var Dn=class{constructor(e,t){this.$from=e,this.$to=t}},On=!1;function kn(e){!On&&!e.parent.inlineContent&&(On=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var j=class e extends A{constructor(e,t=e){kn(e),kn(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 A.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=E.empty){if(super.replace(e,t),t==E.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 An(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=A.findFrom(n,r,!0)||A.findFrom(n,-r,!0);if(e)n=e.$head;else return A.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(A.findFrom(t,-r,!0)||A.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};A.jsonID(`text`,j);var An=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 j.between(e.resolve(this.anchor),e.resolve(this.head))}},M=class e extends A{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?A.near(a):new e(a)}content(){return new E(b.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 jn(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}};M.prototype.visible=!1,A.jsonID(`node`,M);var jn=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new An(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&M.isSelectable(n)?new M(t):A.near(t)}},Mn=class e extends A{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=E.empty){if(t==E.empty){e.delete(0,e.doc.content.size);let t=A.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 Nn}};A.jsonID(`all`,Mn);var Nn={map(){return this},resolve(e){return new Mn(e)}};function Pn(e,t,n,r,i,a=!1){if(t.inlineContent)return j.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=Pn(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&M.isSelectable(r))return M.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Fn(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof jt||i instanceof Mt))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(A.near(e.doc.resolve(o),n))}var In=1,Ln=2,Rn=4,zn=class extends Tn{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|In)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&In)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ln,this}ensureMarks(e){return w.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&Ln)>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)||w.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(A.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|=Rn,this}get scrolledIntoView(){return(this.updated&Rn)>0}};function Bn(e,t){return!t||!e?e:e.bind(t)}var Vn=class{constructor(e,t,n){this.name=e,this.init=Bn(t.init,n),this.apply=Bn(t.apply,n)}},Hn=[new Vn(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Vn(`selection`,{init(e,t){return e.selection||A.atStart(t.doc)},apply(e){return e.selection}}),new Vn(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Vn(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Un=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Hn.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 Vn(e.key,e.spec.state,e))})}},Wn=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 zn(this)}static create(t){let n=new Un(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 Un(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 Un(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=ge.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=A.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 Gn(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Gn(i,t,{})),n[r]=i}return n}var Kn=class{constructor(e){this.spec=e,this.props={},e.props&&Gn(e.props,this,this.props),this.key=e.key?e.key.key:Jn(`plugin`)}getState(e){return e[this.key]}},qn=Object.create(null);function Jn(e){return e in qn?e+`$`+ ++qn[e]:(qn[e]=0,e+`$`)}var Yn=class{constructor(e=`key`){this.key=Jn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Xn=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Zn(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var Qn=(e,t,n)=>{let r=Zn(e,n);if(!r)return!1;let i=ir(r);if(!i){let n=r.blockRange(),i=n&&Rt(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(Sr(e,i,t,-1))return!0;if(r.parent.content.size==0&&(nr(a,`end`)||M.isSelectable(a)))for(let n=r.depth;;n--){let o=on(e.doc,r.before(n),r.after(n),E.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(nr(a,`end`)?A.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):M.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},$n=(e,t,n)=>{let r=Zn(e,n);if(!r)return!1;let i=ir(r);return i?tr(e,i,t):!1},er=(e,t,n)=>{let r=ar(e,n);if(!r)return!1;let i=cr(r);return i?tr(e,i,t):!1};function tr(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=on(e.doc,i,o,E.empty);if(!s||s.from!=i||s instanceof jt&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(j.create(t.doc,i)),n(t.scrollIntoView())}return!0}function nr(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 rr=(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=ir(r)}let o=a&&a.nodeBefore;return!o||!M.isSelectable(o)?!1:(t&&t(e.tr.setSelection(M.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function ir(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 ar(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var or=(e,t,n)=>{let r=ar(e,n);if(!r)return!1;let i=cr(r);if(!i)return!1;let a=i.nodeAfter;if(Sr(e,i,t,1))return!0;if(r.parent.content.size==0&&(nr(a,`start`)||M.isSelectable(a))){let n=on(e.doc,r.before(),r.after(),E.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(nr(a,`start`)?A.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):M.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},sr=(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=cr(r)}let o=a&&a.nodeAfter;return!o||!M.isSelectable(o)?!1:(t&&t(e.tr.setSelection(M.create(e.doc,a.pos)).scrollIntoView()),!0)};function cr(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 lr=(e,t)=>{let n=e.selection,r=n instanceof M,i;if(r){if(n.node.isTextblock||!Qt(e.doc,n.from))return!1;i=n.from}else if(i=tn(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(M.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},ur=(e,t)=>{let n=e.selection,r;if(n instanceof M){if(n.node.isTextblock||!Qt(e.doc,n.to))return!1;r=n.to}else if(r=tn(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},dr=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&Rt(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},fr=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
8
|
+
`).scrollIntoView()),!0)};function pr(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 mr=(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=pr(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(A.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},hr=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Mn||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=pr(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(j.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},gr=(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(Xt(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Rt(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function _r(e){return(t,n)=>{if(t.selection instanceof M&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!Xt(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 j||t.selection instanceof Mn)&&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=pr(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=Xt(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,Xt(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 vr=_r(),yr=(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(M.create(e.doc,i))),!0)},br=(e,t)=>(t&&t(e.tr.setSelection(new Mn(e.doc))),!0);function xr(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||Qt(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Sr(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&xr(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=b.empty;for(let e=o.length-1;e>=0;e--)s=b.from(o[e].create(null,s));s=b.from(i.copy(s));let c=e.tr.step(new Mt(t.pos-1,r,t.pos,r,new E(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Qt(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:A.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&Rt(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&nr(a,`start`,!0)&&nr(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=b.empty;for(let e=o.length-1;e>=0;e--)r=b.from(o[e].copy(r));n(e.tr.step(new Mt(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new E(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Cr(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(j.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var wr=Cr(-1),Tr=Cr(1);function Er(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&Bt(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Dr(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 Or(...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 kr=Or(Xn,Qn,rr),Ar=Or(Xn,or,sr),jr={Enter:Or(fr,hr,gr,vr),"Mod-Enter":mr,Backspace:kr,"Mod-Backspace":kr,"Shift-Backspace":kr,Delete:Ar,"Mod-Delete":Ar,"Mod-a":br},Mr={"Ctrl-h":jr.Backspace,"Alt-Backspace":jr[`Mod-Backspace`],"Ctrl-d":jr.Delete,"Ctrl-Alt-Backspace":jr[`Mod-Delete`],"Alt-Delete":jr[`Mod-Delete`],"Alt-d":jr[`Mod-Delete`],"Ctrl-a":wr,"Ctrl-e":Tr};for(let e in jr)Mr[e]=jr[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function Nr(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 Pr(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Pr(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 me(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new me(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=Bt(a,n,r,t);return s?(e&&Fr(e,t,s,i,n),!0):!1}function Fr(e,t,n,r,i){let a=b.empty;for(let e=n.length-1;e>=0;e--)a=b.from(n[e].type.create(n[e].attrs,a));e.step(new Mt(t.start-(r?2:0),t.end,t.start,t.end,new E(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&&Xt(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Ir(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?Lr(t,n,e,a):Rr(t,n,a):!0:!1}}function Lr(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Mt(a-1,o,a,o,new E(b.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new me(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=Rt(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Qt(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Rr(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?b.empty:b.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Mt(d-+!!s,f+ +!!c,d+1,f-1,new E((s?b.empty:b.from(i.copy(b.empty))).append(c?b.empty:b.from(i.copy(b.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function zr(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=b.from(r?e.create():null),o=new E(b.from(e.create(null,b.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Mt(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var Br=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Vr=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Hr=null,Ur=function(e,t,n){let r=Hr||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Wr=function(){Hr=null},Gr=function(e,t,n,r){return n&&(qr(e,t,n,r,-1)||qr(e,t,n,r,1))},Kr=/^(img|br|input|textarea|hr)$/i;function qr(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Jr(e))){let n=e.parentNode;if(!n||n.nodeType!=1||Qr(e)||Kr.test(e.nodeName)||e.contentEditable==`false`)return!1;t=Br(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?Jr(e):0}else return!1}}function Jr(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Yr(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=Jr(e)}else if(e.parentNode&&!Qr(e))t=Br(e),e=e.parentNode;else return null}}function Xr(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Qr(e))t=Br(e)+1,e=e.parentNode;else return null}}function Zr(e,t,n){for(let r=t==0,i=t==Jr(e);r||i;){if(e==n)return!0;let t=Br(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==Jr(e)}}function Qr(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 $r=function(e){return e.focusNode&&Gr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function ei(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function ti(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function ni(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Jr(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Jr(r.startContainer),r.startOffset)}}}var ri=typeof navigator<`u`?navigator:null,ii=typeof document<`u`?document:null,ai=ri&&ri.userAgent||``,oi=/Edge\/(\d+)/.exec(ai),si=/MSIE \d/.exec(ai),ci=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ai),li=!!(si||ci||oi),ui=si?document.documentMode:ci?+ci[1]:oi?+oi[1]:0,di=!li&&/gecko\/(\d+)/i.test(ai);di&&+(/Firefox\/(\d+)/.exec(ai)||[0,0])[1];var fi=!li&&/Chrome\/(\d+)/.exec(ai),pi=!!fi,mi=fi?+fi[1]:0,hi=!li&&!!ri&&/Apple Computer/.test(ri.vendor),gi=hi&&(/Mobile\/\w+/.test(ai)||!!ri&&ri.maxTouchPoints>2),_i=gi||(ri?/Mac/.test(ri.platform):!1),vi=ri?/Win/.test(ri.platform):!1,yi=/Android \d/.test(ai),bi=!!ii&&`webkitFontSmoothing`in ii.documentElement.style,xi=bi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Si(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 Ci(e,t){return typeof e==`number`?e:e[t]}function wi(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 Ti(e,t,n){if(!zi(t)&&t.left==0)return;let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=Vr(o);continue}let e=o,n=e==a.body,s=n?Si(a):wi(e),c=0,l=0;if(t.top<s.top+Ci(r,`top`)?l=-(s.top-t.top+Ci(i,`top`)):t.bottom>s.bottom-Ci(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Ci(i,`top`)-s.top:t.bottom-s.bottom+Ci(i,`bottom`)),t.left<s.left+Ci(r,`left`)?c=-(s.left-t.left+Ci(i,`left`)):t.right>s.right-Ci(r,`right`)&&(c=t.right-s.right+Ci(i,`right`)),c||l){if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:Vr(o)}}function Ei(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:Di(e.dom)}}function Di(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Vr(r));return t}function Oi({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ki(n,r==0?0:r-t)}function ki(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 Ai=null;function ji(e){if(e.setActive)return e.setActive();if(Ai)return e.focus(Ai);let t=Di(e);e.focus(Ai==null?{get preventScroll(){return Ai={preventScroll:!0},!0}}:void 0),Ai||(Ai=!1,ki(t,0))}function Mi(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=Ur(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?Ni(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:Mi(n,i)}function Ni(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=Bi(r,1);if(n.top!=n.bottom&&Pi(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Pi(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Fi(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Ii(e,t,n){let{node:r,offset:i}=Mi(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function Li(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function N(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Pi(t,i))return N(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function Ri(e,t){let n=e.dom.ownerDocument,r,i=0,a=ni(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!Pi(t,n)||(o=N(e.dom,t,n),!o))return null}if(hi)for(let e=o;r&&e;e=Vr(e))e.draggable&&(r=void 0);if(o=Fi(o,t),r){if(di&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;bi&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=Li(e,r,i,t))}s??=Ii(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function zi(e){return e.top<e.bottom||e.left<e.right}function Bi(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(zi(e))return e}return Array.prototype.find.call(n,zi)||e.getBoundingClientRect()}var Vi=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Hi(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=bi||di;if(r.nodeType==3){if(o&&(Vi.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=Bi(Ur(r,i,i),n);if(di&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=Bi(Ur(r,i-1,i-1),-1);if(t.top==e.top){let n=Bi(Ur(r,i,i+1),-1);if(n.top!=e.top)return Ui(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++,Ui(Bi(Ur(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==Jr(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return Wi(e.getBoundingClientRect(),!1)}if(a==null&&i<Jr(r)){let e=r.childNodes[i];if(e.nodeType==1)return Wi(e.getBoundingClientRect(),!0)}return Wi(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==Jr(r))){let e=r.childNodes[i-1],t=e.nodeType==3?Ur(e,Jr(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return Ui(Bi(t,1),!1)}if(a==null&&i<Jr(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?Ur(e,0,+!o):e.nodeType==1?e:null:null;if(t)return Ui(Bi(t,-1),!0)}return Ui(Bi(r.nodeType==3?Ur(r):r,-n),n>=0)}function Ui(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 Wi(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 Gi(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 Ki(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Gi(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=Hi(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=Ur(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 qi=/[\u0590-\u08ac]/;function Ji(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?!qi.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Gi(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var Yi=null,Xi=null,Zi=!1;function Qi(e,t,n){return Yi==t&&Xi==n?Zi:(Yi=t,Xi=n,Zi=n==`up`||n==`down`?Ki(e,t,n):Ji(e,t,n))}var $i=0,ea=1,ta=2,na=3,ra=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=$i,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>Br(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node)){if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof ua){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof ia&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Br(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?Br(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=Br(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=Br(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((di||hi)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
|
|
9
|
+
`),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:Br(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(di&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&hi)&&Gr(o.node,o.offset,l.anchorNode,l.anchorOffset)&&Gr(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&di)){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?ta:ea,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=na:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?ta:na}n=a}this.dirty=ta}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?ta:ea;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},ia=class extends ra{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.hasAttribute(`contenteditable`)||(a.contentEditable=`false`),a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==$i&&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}},aa=class extends ra{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}},oa=class e extends ra{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=at.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&na||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=na&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=$i){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=$i}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=Da(a,n,o,r)),t>0&&(a=Da(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()}},sa=class e extends ra{constructor(e,t,n,r,i,a,o){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=at.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=va(u,r,n),l?c=new da(t,n,r,i,u,d||null,f,l):n.isText?new la(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(t.preserveWhitespace=`full`),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>t.nodeType==1&&e.indexOf(t.parentNode)<0&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>b.empty}}return t}matchesNode(e,t,n){return this.dirty==$i&&e.eq(this.node)&&ya(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 xa(this,a&&a.node,e);wa(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?w.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==ta)&&(a&&this.protectLocalComposition(e,a),fa(this.contentDOM,this.children,e),gi&&Ta(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof j)||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=Ea(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 aa(this,i,t,r);e.input.compositionNodes.push(a),this.children=Da(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==na||!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=$i}updateOuterDeco(e){if(ya(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=ga(this.dom,this.nodeDOM,ha(this.outerDeco,this.node,t),ha(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function ca(e,t,n,r,i){va(r,t,e);let a=new sa(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var la=class e extends sa{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==na||this.dirty!=$i&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=$i||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=$i,!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=na)}get domAtom(){return!1}isText(e){return this.node.text==e}},ua=class extends ra{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==$i&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},da=class extends sa{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==na)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 fa(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=ba(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof oa){let t=r?r.previousSibling:e.lastChild;fa(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=ba(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var pa=function(e){e&&(this.nodeName=e)};pa.prototype=Object.create(null);var ma=[new pa];function ha(e,t,n){if(e.length==0)return ma;let r=n?ma[0]:new pa,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new pa(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new pa(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 ga(e,t,n,r){if(n==ma&&r==ma)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=ma[0],i=t)}_a(i,o||ma[0],a)}return i}function _a(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 va(e,t,n){return ga(e,e,ma,ha(t,n,e.nodeType!=1))}function ya(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 ba(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var xa=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Sa(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=$i,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 oa&&t.dirty!=na&&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=oa.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==na&&a.dom==a.contentDOM&&(a.dirty=ta),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 sa){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!=na&&ya(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=ta,u.updateChildren(r,a+1),u.dirty=$i),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)||!ya(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=sa.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=sa.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 ia(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 oa;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof la)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((hi||pi)&&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 ua(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function Sa(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 oa)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 Ca(e,t){return e.type.side-t.type.side}function wa(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(Ca);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 Ta(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 Ea(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 Da(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 Oa(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($r(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&M.isSelectable(e)&&i.parent&&!(e.isInline&&Zr(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new M(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=za(e,u,s,n)}return l}function ka(e){return e.editable?e.hasFocus():Va(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Aa(e,t=!1){let n=e.state.selection;if(La(e,n),!ka(e))return;let r=e.input.mouseDown;if(!t&&pi&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Gr(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Ia(e);else{let{anchor:r,head:i}=n,a,o;ja&&!(n instanceof j)&&(n.$from.parent.inlineContent||(a=Ma(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Ma(e,n.to))),e.docView.setSelection(r,i,e,t),ja&&(a&&Pa(a),o&&Pa(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Fa(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var ja=hi||pi&&mi<63;function Ma(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(hi&&i&&i.contentEditable==`false`)return Na(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Na(i);if(a)return Na(a)}}function Na(e){return e.contentEditable=`true`,hi&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Pa(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Fa(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(()=>{(!ka(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Ia(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,Br(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&li&&ui<=11&&(n.disabled=!0,n.disabled=!1)}function La(e,t){if(t instanceof M){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Ra(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Ra(e)}function Ra(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function za(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||j.between(t,n,r)}function Ba(e){return e.editable&&!e.hasFocus()?!1:Va(e)}function Va(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Ha(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Gr(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Ua(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&&A.findFrom(a,t)}function Wa(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ga(e,t,n){let r=e.state.selection;if(r instanceof j){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 Wa(e,new j(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=Ua(e.state,t);return n&&n instanceof M?Wa(e,n):!1}if(!(_i&&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?M.isSelectable(i)?Wa(e,new M(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):bi?Wa(e,new j(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof M&&r.node.isInline)return Wa(e,new j(t>0?r.$to:r.$from));else{let n=Ua(e.state,t);return n?Wa(e,n):!1}}function Ka(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function qa(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`):e.nodeType==1&&e.contentEditable==`false`}function Ja(e,t){return t<0?Ya(e):Xa(e)}function Ya(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(di&&n.nodeType==1&&r<Ka(n)&&qa(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(qa(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(Za(n))break;else{let t=n.previousSibling;for(;t&&qa(t,-1);)i=n.parentNode,a=Br(t),t=t.previousSibling;if(t)n=t,r=Ka(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?eo(e,n,r):i&&eo(e,i,a)}function Xa(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Ka(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(qa(e,1))a=n,o=++r;else break}else if(Za(n))break;else{let t=n.nextSibling;for(;t&&qa(t,1);)a=t.parentNode,o=Br(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=Ka(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&eo(e,a,o)}function Za(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Qa(e,t){for(;e&&t==e.childNodes.length&&!Qr(e);)t=Br(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function $a(e,t){for(;e&&!t&&!Qr(e);)t=Br(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function eo(e,t,n){if(t.nodeType!=3){let e,r;(r=Qa(t,n))?(t=r,n=0):(e=$a(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if($r(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&&Aa(e)},50)}function to(e,t){let n=e.state.doc.resolve(t);if(!(pi||vi)&&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 no(e,t,n){let r=e.state.selection;if(r instanceof j&&!r.empty||n.indexOf(`s`)>-1||_i&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=Ua(e.state,t);if(n&&n instanceof M)return Wa(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof Mn?A.near(n,t):A.findFrom(n,t);return o?Wa(e,o):!1}return!1}function ro(e,t){if(!(e.state.selection instanceof j))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 io(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ao(e){if(!hi||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;io(e,n,`true`),setTimeout(()=>io(e,n,`false`),20)}return!1}function oo(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function so(e,t){let n=t.keyCode,r=oo(t);if(n==8||_i&&n==72&&r==`c`)return ro(e,-1)||Ja(e,-1);if(n==46&&!t.shiftKey||_i&&n==68&&r==`c`)return ro(e,1)||Ja(e,1);if(n==13||n==27)return!0;if(n==37||_i&&n==66&&r==`c`){let t=n==37?to(e,e.state.selection.from)==`ltr`?-1:1:-1;return Ga(e,t,r)||Ja(e,t)}if(n==39||_i&&n==70&&r==`c`){let t=n==39?to(e,e.state.selection.from)==`ltr`?1:-1:1;return Ga(e,t,r)||Ja(e,t)}return n==38||_i&&n==80&&r==`c`?no(e,-1,r)||Ja(e,-1):n==40||_i&&n==78&&r==`c`?ao(e)||no(e,1,r)||Ja(e,1):!(r!=(_i?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function co(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`)||at.fromSchema(e.state.schema),s=vo(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=_o[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
|
|
10
|
+
|
|
11
|
+
`),slice:t}}function lo(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 E(b.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
12
|
+
`))),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=at.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=xo(n),bi&&So(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Ge.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!uo.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Co(P(s,+u[1],+u[2]),u[4]);else if(s=E.maxOpen(fo(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=P(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var uo=/^(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 fo(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&&mo(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=ho(a[a.length-1],i.length));let n=po(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return b.from(a)}return e}function po(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,b.from(e));return e}function mo(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=mo(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(b.from(po(n,e,i+1))))}}function ho(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,ho(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(b.empty,!0);return e.copy(n.append(r))}function go(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=go(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(b.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function P(e,t,n){return t<e.openStart&&(e=new E(go(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new E(go(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var _o={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 vo(){return document.implementation.createHTMLDocument(`title`)}var yo=null;function bo(e){let t=window.trustedTypes;if(!t)return e;if(!yo){if(yo=t.defaultPolicy)try{return yo.createHTML(e)}catch{}yo=t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e})}return yo.createHTML(e)}function xo(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=vo(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),a;if((a=i&&_o[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>`</`+e+`>`).reverse().join(``)),r.innerHTML=bo(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 So(e){let t=e.querySelectorAll(pi?`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 Co(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=b.from(t.create(r[e+1],i))}catch{break}a++,o++}return new E(i,a,o)}var wo={},To={},Eo={touchstart:!0,touchmove:!0},Do=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 Oo(e){for(let t in wo){let n=wo[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{No(e,t)&&!Mo(e,t)&&(e.editable||!(t.type in To))&&n(e,t)},Eo[t]?{passive:!0}:void 0)}hi&&e.dom.addEventListener(`input`,()=>null),jo(e)}function ko(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Ao(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 jo(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Mo(e,t))})}function Mo(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function No(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 Po(e,t){!Mo(e,t)&&wo[t.type]&&(e.editable||!(t.type in To))&&wo[t.type](e,t)}To.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Zo(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(yi&&pi&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),gi&&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,ei(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||so(e,n)?n.preventDefault():ko(e,`key`)}},To.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},To.keypress=(e,t)=>{let n=t;if(Zo(e)||!n.charCode||n.ctrlKey&&!n.altKey||_i&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof j)||!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 Fo(e){return{left:e.clientX,top:e.clientY}}function Io(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function Lo(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 Ro(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function zo(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&M.isSelectable(r)?(Ro(e,new M(n),`pointer`),!0):!1}function Bo(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof M&&(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(M.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&&(Ro(e,M.create(e.state.doc,i),`pointer`),!0)}function Vo(e,t,n,r,i){return Lo(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?Bo(e,n):zo(e,n))}function Ho(e,t,n,r){return Lo(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function Uo(e,t,n,r){return Lo(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||Wo(e,n,r)}function Wo(e,t,n){if(n.button!=0)return!1;let r=Go(e,t,!0),i=e.state.doc;return r?(Ro(e,r,`pointer`),r instanceof j&&i.eq(e.state.doc)&&(e.input.mouseDown=new Xo(e,r)),!0):!1}function Go(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?j.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 j.create(r,a+1,a+1+t.content.size);if(n&&M.isSelectable(t))return M.create(r,a)}return null}function Ko(e){return rs(e)}var qo=_i?`metaKey`:`ctrlKey`;wo.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Ko(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&Io(n,e.input.lastClick)&&!n[qo]&&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(Fo(n));o&&(a==`singleClick`?e.input.mouseDown=new Yo(e,o,n,!!r):(a==`doubleClick`?Ho:Uo)(e,o.pos,o.inside,n)?n.preventDefault():ko(e,`pointer`))};var Jo=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}},Yo=class extends Jo{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[qo],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof M&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!!(this.target&&di&&!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()),ko(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||Aa(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(Fo(e))),this.updateAllowDefault(e),this.allowDefault||!t?ko(this.view,`pointer`):Vo(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||hi&&this.mightDrag&&!this.mightDrag.node.isAtom||pi&&!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)?(Ro(this.view,A.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):ko(this.view,`pointer`)}move(e){this.updateAllowDefault(e),ko(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}},Xo=class extends Jo{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(),ko(this.view,`pointer`);let t=this.view.posAtCoords(Fo(e)),n=t&&Go(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];Ro(this.view,j.create(r,a,o),`pointer`)}};wo.touchstart=e=>{e.input.lastTouch=Date.now(),Ko(e),ko(e,`pointer`)},wo.touchmove=e=>{e.input.lastTouch=Date.now(),ko(e,`pointer`)},wo.contextmenu=e=>Ko(e);function Zo(e,t){return e.composing?!0:hi&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Qo=yi?5e3:-1;To.compositionstart=To.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof j&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||pi&&vi&&$o(e)))e.markCursor=e.state.storedMarks||n.marks(),rs(e,!0),e.markCursor=null;else if(rs(e,!t.selection.empty),di&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}es(e,Qo)};function $o(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}To.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++,es(e,20))};function es(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>rs(e),t))}function ts(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ns(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Yr(t.focusNode,t.focusOffset),r=Xr(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 rs(e,t=!1){if(!(yi&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ts(e),t||e.docView&&e.docView.dirty){let n=Oa(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 is(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 as=li&&ui<15||gi&&xi<604;wo.copy=To.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=as?null:n.clipboardData,{dom:o,text:s}=co(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):is(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function ss(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function cs(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?ls(e,r.value,null,i,t):ls(e,r.textContent,r.innerHTML,i,t)},50)}function ls(e,t,n,r,i){let a=lo(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||E.empty)))return!0;if(!a)return!1;let o=ss(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 us(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,` `):``}To.paste=(e,t)=>{let n=t;if(e.composing&&!yi)return;let r=as?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&ls(e,us(r),r.getData(`text/html`),i,n)?n.preventDefault():cs(e,n)};var ds=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},fs=_i?`altKey`:`ctrlKey`;function ps(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[fs]:!n}wo.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(Fo(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof M?i.to-1:i.to))){if(r&&r.mightDrag)o=M.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=M.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=co(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!pi||mi>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(as?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,as||n.dataTransfer.setData(`text/plain`,c),e.dragging=new ds(l,ps(e,n),o)},wo.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},To.dragover=To.dragenter=(e,t)=>t.preventDefault(),To.drop=(e,t)=>{try{ms(e,t,e.dragging)}finally{e.dragging=null}};function ms(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Fo(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=lo(e,us(t.dataTransfer),as?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&ps(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||E.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?an(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&&M.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new M(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(za(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}wo.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())&&Aa(e)},20))},wo.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)},wo.beforeinput=(e,t)=>{if(yi&&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,ei(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 To)wo[e]=To[e];function hs(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 gs=class e{constructor(e,t){this.toDOM=e,this.spec=t||xs,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 ys(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&&hs(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},_s=class e{constructor(e,t){this.attrs=e,this.spec=t||xs}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 ys(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&hs(this.attrs,t.attrs)&&hs(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},vs=class e{constructor(e,t){this.attrs=e,this.spec=t||xs}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 ys(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&&hs(this.attrs,t.attrs)&&hs(this.spec,t.spec)}destroy(){}},ys=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 gs(n,r))}static inline(t,n,r,i){return new e(t,n,new _s(r,i))}static node(t,n,r,i){return new e(t,n,new vs(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof _s}get widget(){return this.type instanceof gs}},bs=[],xs={},Ss=class e{constructor(e,t){this.local=e.length?e:bs,this.children=t.length?t:bs}static create(e,t){return t.length?As(t,e,0,xs):Cs}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==Cs||e.maps.length==0?this:this.mapInner(e,t,0,0,n||xs)}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?Ts(this.children,o||[],t,n,r,i,a):o?new e(o.sort(js),bs):Cs}add(t,n){return n.length?this==Cs?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=Os(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,As(s,e,o+1,xs)),a+=3}});let o=Es(a?ks(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(js):this.local,i||this.children)}remove(e){return e.length==0||this==Cs?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==Cs?(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):Cs}forChild(t,n){if(this==Cs)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 _s){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(js),bs);return r?new ws([t,r]):t}return r||Cs}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 Ms(this.localsInner(e))}localsInner(e){if(this==Cs)return bs;if(e.inlineContent||!this.local.some(_s.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof _s||t.push(this.local[e]);return t}forEachSet(e){e(this)}};Ss.empty=new Ss([],[]),Ss.removeOverlap=Ms;var Cs=Ss.empty,ws=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,xs));return e.from(r)}forChild(t,n){if(n.isLeaf)return Ss.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=Cs&&(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?Ms(n?t:t.sort(js)):bs}static from(t){switch(t.length){case 0:return Cs;case 1:return t[0];default:return new e(t.every(e=>e instanceof Ss)?t:t.reduce((e,t)=>e.concat(t instanceof Ss?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Ts(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==Cs?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=As(Ds(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 Ss(t.sort(js),s)}function Es(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 ys(i.from+t,i.to+t,i.type))}return n}function Ds(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 Os(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 ks(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function As(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=Os(e,t,o+n);if(s){a=!0;let e=As(s,t,n+o+1,r);e!=Cs&&i.push(o,o+t.nodeSize,e)}});let o=Es(a?ks(e):e,-n).sort(js);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 Ss(o,i):Cs}function js(e,t){return e.from-t.from||e.to-t.to}function Ms(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),Ns(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),Ns(t,i,r.copy(a.from,r.to)));break}}return t}function Ns(e,t,n){for(;t<e.length&&js(n,e[t])>0;)t++;e.splice(t,0,n)}function Ps(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=Cs&&t.push(r)}),e.cursorWrapper&&t.push(Ss.create(e.state.doc,[e.cursorWrapper.deco])),ws.from(t)}var Fs={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Is=li&&ui<=11,Ls=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}},Rs=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ls,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]);li&&ui<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():hi&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Is&&(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,Fs)),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(Ba(this.view)){if(this.suppressingSelectionUpdates)return Aa(this.view);if(li&&ui<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Gr(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=Vr(n))t.add(n);for(let r=e.anchorNode;r;r=Vr(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Ba(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||pi&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(di&&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||Ws(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&&$r(n)&&(c=Oa(e))&&c.eq(A.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Aa(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),Vs(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Gs(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Aa(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(li&&ui<=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?Br(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?Br(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})}},zs=new WeakMap,Bs=!1;function Vs(e){if(!zs.has(e)&&(zs.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=di,Bs)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.`),Bs=!0}}function Hs(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return Gr(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Us(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Hs(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?Hs(e,n):null}function Ws(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 Gs(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function Ks(e,t,n,r){let{node:i,fromOffset:a,toOffset:o,from:s,to:c}=e.docView.parseRange(t,n),l=e.domSelectionRange(),u,d=l.anchorNode;if(d&&e.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:l.anchorOffset}],$r(l)||u.push({node:l.focusNode,offset:l.focusOffset})),pi&&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`)||Ge.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:qs(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 qs=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName==`BR`&&t.parentNode){if(hi&&/^(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||hi&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==`IMG`&&t.getAttribute(`mark-placeholder`))return{ignore:!0};return null},Js=/^(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 Ys(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=Oa(e,t);if(n&&!e.state.selection.eq(n)){if(pi&&yi&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,ei(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=Ks(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=tc(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(gi&&e.input.lastIOSEnter>Date.now()-225||yi)&&i.some(e=>e.nodeType==1&&!Js.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,ei(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m){if(r&&c instanceof j&&!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=Xs(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 j&&(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)),li&&ui<=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((gi&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&$s(l.doc,h.pos,g.pos))&&e.someProp(`handleKeyDown`,t=>t(e,ei(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Qs(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,ei(8,`Backspace`)))){yi&&pi&&e.domObserver.suppressSelectionUpdates();return}pi&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),yi&&!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,ei(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=Xs(e,n.doc,l.sel);t&&!(pi&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||li&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v){if(h.pos==g.pos){li&&ui<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Aa(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=Zs(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 Xs(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:za(e,t.resolve(n.anchor),t.resolve(n.head))}function Zs(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(b.from(l).eq(e))return{mark:s,type:o}}function Qs(e,t,n,r,i){if(n-t<=i.pos-r.pos||ec(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(ec(a,!0,!0));return!o.parent.isTextblock||o.pos>n||ec(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function $s(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 ec(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 tc(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 nc=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 Do,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(lc),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=ac(this),ic(this),this.nodeViews=sc(this),this.docView=ca(this.state.doc,rc(this),Ps(this),this.dom,this),this.domObserver=new Rs(this,(e,t,n,r)=>Ys(this,e,t,n,r)),this.domObserver.start(),Oo(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&&jo(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(lc),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&&(ts(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=sc(this);cc(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&jo(this),this.editable=ac(this),ic(this);let o=Ps(this),s=rc(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&&Ei(this);if(i){this.domObserver.stop();let t=l&&(li||pi)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&oc(n.selection,e.selection);if(l){let n=pi?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ns(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=ca(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())&&Ha(this)&&i.delaySelUpdate())?Aa(this,t):(La(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&&Oi(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(e.nodeType==1?e:e.parentNode)&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof M){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Ti(this,t.getBoundingClientRect(),e)}else Ti(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 ds(e.slice,e.move,r<0?void 0:M.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(li){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&&ji(this.dom),Aa(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 Ri(this,e)}coordsAtPos(e,t=1){return Hi(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 Qi(this,t||this.state,e)}pasteHTML(e,t){return ls(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return ls(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return co(this,e)}destroy(){this.docView&&(Ao(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ps(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Wr())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Po(this,e)}domSelectionRange(){let e=this.domSelection();return e?hi&&this.root.nodeType===11&&ti(this.dom.ownerDocument)==this.dom&&Us(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};nc.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function rc(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`,[ys.node(0,e.state.doc.content.size,t)]}function ic(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:ys.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ac(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function oc(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 sc(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 cc(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 lc(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 uc={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:`'`},dc={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},fc=typeof navigator<`u`&&/Mac/.test(navigator.platform),pc=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mc=0;mc<10;mc++)uc[48+mc]=uc[96+mc]=String(mc);for(var mc=1;mc<=24;mc++)uc[mc+111]=`F`+mc;for(var mc=65;mc<=90;mc++)uc[mc]=String.fromCharCode(mc+32),dc[mc]=String.fromCharCode(mc);for(var hc in uc)dc.hasOwnProperty(hc)||(dc[hc]=uc[hc]);function gc(e){var t=!(fc&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||pc&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?dc:uc)[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 _c=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),vc=typeof navigator<`u`&&/Win/.test(navigator.platform);function yc(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))_c?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 bc(e){let t=Object.create(null);for(let n in e)t[yc(n)]=e[n];return t}function xc(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 Sc(e){return new Kn({props:{handleKeyDown:Cc(e)}})}function Cc(e){let t=bc(e);return function(e,n){let r=gc(n),i,a=t[xc(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[xc(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(vc&&n.ctrlKey&&n.altKey)&&(i=uc[n.keyCode])&&i!=r){let r=t[xc(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}function wc(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 Tc=class e{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if(n!==`then`)return n===`run`?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if(t!==`then`)return t===`chain`?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:wc({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}},Ec=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)==null||(n=n.getSelection())==null||n.removeAllRanges()}}),!0),Dc=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),Oc=()=>({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=Rt(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},kc=e=>t=>e(t),Ac=()=>({state:e,dispatch:t})=>hr(e,t),jc=(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 j(r.doc.resolve(Math.max(o-1,0)))),!0},Mc=()=>({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 Nc(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 Pc=e=>({tr:t,state:n,dispatch:r})=>{let i=Nc(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},Fc=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},Ic=e=>e.content?/^text(\*|\+)/.test(e.content):!1,Lc=(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 Ic(r)?n===`left`?e.start()-1:e.end()+1:e.pos},Rc=(e,t,n)=>({from:Lc(e,n,`left`),to:Lc(t,n,`right`)}),zc=()=>({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}=Rc(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.selection.empty||n.setSelection(j.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},Bc=()=>({commands:e})=>e.keyboardShortcut(`Enter`),Vc=()=>({state:e,dispatch:t})=>mr(e,t);function Hc(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function Uc(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:Hc(t[r])?t[r].test(e[r]):t[r]===e[r])}function Wc(e,t,n={}){return e.find(e=>e.type===t&&Uc(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function Gc(e,t,n={}){return!!Wc(e,t,n)}function Kc(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(!Wc([...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&&Gc([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&Gc([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function qc(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 Jc=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=qc(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=Kc(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=j.create(o,e.from,e.to);n.setSelection(t)}}return!0},Yc=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 Xc(e){return e instanceof j}function Zc(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Qc(e,t=null){if(!t)return null;let n=A.atStart(e),r=A.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?j.create(e,Zc(0,i,a),Zc(e.content.size,i,a)):j.create(e,Zc(t,i,a),Zc(t,i,a))}function $c(){return[`Android`].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function el(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function tl(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var nl=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(el()||$c())&&r.dom.focus(),tl()&&!el()&&!$c()&&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&&!Xc(n.state.selection))return o(),!0;let s=Qc(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},rl=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),il=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),al=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&&al(r)}return e};function ol(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 al(n)}function sl(e){return typeof e?.nodesBetween==`function`}function cl(e,t,n){if(sl(e))return e;let r=typeof e==`object`&&!!e;n={slice:!0,parseOptions:{},...n};let i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return b.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),cl(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new Ve({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?Ge.fromSchema(a).parseSlice(ol(e),n.parseOptions):Ge.fromSchema(a).parse(ol(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=Ge.fromSchema(t);return n.slice?r.parseSlice(ol(e),n.parseOptions).content:r.parse(ol(e),n.parseOptions)}return cl(``,t,n)}function ll(e){return!(`type`in e)}function ul(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof jt||i instanceof Mt))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(A.near(e.doc.resolve(o),n))}var dl=(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{cl(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=cl(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0,f=ll(i)?i.content:[i];if(f.forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let p;if(u)p=Array.isArray(t)?t.map(e=>e.text||``).join(``):sl(t)?f.map(e=>e.text??``).join(``):typeof t==`object`&&t&&t.text?t.text:t,r.insertText(p,c,l);else{p=b.from(f);let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,i=t.isText||t.isTextblock,a=t.content.size>0;n&&i&&a&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&ul(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:p}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:p})}return!0};function fl(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var pl=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{pos:i,attrs:a,content:o,updateSelection:s=!0}=e,c;c=typeof i==`number`?t.doc.resolve(i):i||t.selection.$from;let l=fl(c.parent.contentMatchAt(c.index()));if(!l)return!1;let u=Object.keys(l.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{},f;if(o){let e=cl(o,r.schema);f=l.createAndFill(d,e)}else f=l.createAndFill(d);return f?(n&&(t.insert(c.pos,f),s&&ul(t,t.steps.length-1,-1)),!0):!1},ml=()=>({state:e,dispatch:t})=>lr(e,t),hl=()=>({state:e,dispatch:t})=>ur(e,t),gl=()=>({state:e,dispatch:t})=>Qn(e,t),_l=()=>({state:e,dispatch:t})=>or(e,t),vl=()=>({state:e,dispatch:t,tr:n})=>{try{let r=tn(e.doc,e.selection.$from.pos,-1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},yl=()=>({state:e,dispatch:t,tr:n})=>{try{let r=tn(e.doc,e.selection.$from.pos,1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},bl=()=>({state:e,dispatch:t})=>$n(e,t),xl=()=>({state:e,dispatch:t})=>er(e,t);function Sl(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function Cl(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))el()||Sl()?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 wl=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=Cl(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 Tl(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?Nc(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=>Uc(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var El=(e,t={})=>({state:n,dispatch:r})=>Tl(n,Nc(e,n.schema),t)?dr(n,r):!1,Dl=()=>({state:e,dispatch:t})=>gr(e,t),Ol=e=>({state:t,dispatch:n})=>Ir(Nc(e,t.schema))(t,n),kl=()=>({state:e,dispatch:t})=>fr(e,t);function Al(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function jl(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 Ml=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Al(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Nc(e,r.schema)),s===`mark`&&(o=qc(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,jl(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(jl(a.attrs,t))))})})}),c},Nl=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Pl=()=>({tr:e,dispatch:t})=>{if(t){let t=new Mn(e.doc);e.setSelection(t)}return!0},Fl=()=>({state:e,dispatch:t})=>rr(e,t),Il=()=>({state:e,dispatch:t})=>sr(e,t),Ll=()=>({state:e,dispatch:t})=>yr(e,t),Rl=()=>({state:e,dispatch:t})=>Tr(e,t),zl=()=>({state:e,dispatch:t})=>wr(e,t);function Bl(e,t,n={},r={}){return cl(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Vl=(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=Bl(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});if(o){let e=ll(s)?s.content:[s];a.replaceWith(0,c.content.size,e).setMeta(`preventUpdate`,!n)}return!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function Hl(e,t){let n=qc(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 Ul(e,t){let n=new Tn(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function Wl(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function Gl(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 Kl(e){return t=>Gl(t.$from,e)}function F(e,t,n){return e.config[t]===void 0&&e.parent?F(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?F(e.parent,t,n):null}):e.config[t]}function I(e){return e.map(e=>{let t=F(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...I(t())]:e}).flat(10)}function ql(e,t){let n=at.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function L(e){return typeof e==`function`}function R(e,t=void 0,...n){return L(e)?t?e.bind(t)(...n):e(...n):e}function Jl(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Yl(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function Xl(e){let t=[],{nodeExtensions:n,markExtensions:r}=Yl(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=F(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=F(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 Zl(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 Ql(e){let t=[],n=Zl(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 $l(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(e===`__proto__`){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});return}if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...Ql(n[e]),...Ql(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function eu(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)=>$l(e,t),{})}function tu(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function nu(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):tu(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function ru(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&Jl(t)?!1:t!=null))}function iu(e){var t,n;let r={};return!(e!=null&&(t=e.attribute)!=null&&t.isRequired)&&`default`in(e?.attribute||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function au(e,t){let n=Xl(e),{nodeExtensions:r,markExtensions:i}=Yl(e),a=r.find(e=>F(e,`topNode`))?.name;return new Ve({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=ru({...e.reduce((e,t)=>{let n=F(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:R(F(r,`content`,a)),marks:R(F(r,`marks`,a)),group:R(F(r,`group`,a)),inline:R(F(r,`inline`,a)),atom:R(F(r,`atom`,a)),selectable:R(F(r,`selectable`,a)),draggable:R(F(r,`draggable`,a)),code:R(F(r,`code`,a)),whitespace:R(F(r,`whitespace`,a)),linebreakReplacement:R(F(r,`linebreakReplacement`,a)),defining:R(F(r,`defining`,a)),isolating:R(F(r,`isolating`,a)),attrs:Object.fromEntries(i.map(iu))}),s=R(F(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>nu(e,i)));let c=F(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:eu(e,i)}));let l=F(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=ru({...e.reduce((e,t)=>{let n=F(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:R(F(r,`inclusive`,a)),excludes:R(F(r,`excludes`,a)),group:R(F(r,`group`,a)),spanning:R(F(r,`spanning`,a)),code:R(F(r,`code`,a)),attrs:Object.fromEntries(i.map(iu))}),s=R(F(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>nu(e,i)));let c=F(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:eu(e,i)})),[r.name,o]}))})}function ou(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function su(e){return e.sort((e,t)=>{let n=F(e,`priority`)||100,r=F(t,`priority`)||100;return n>r?-1:+(n<r)})}function cu(e){let t=su(I(e)),n=ou(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 lu(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
|
13
|
+
|
|
14
|
+
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;if(e.isText){var d;s+=e==null||(d=e.text)==null?void 0:d.slice(Math.max(r,n)-n,i-n)}}),s}function uu(e,t){return lu(e,{from:0,to:e.content.size},t)}function du(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function fu(e,t){let n=Nc(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 pu(e,t){let n=Al(typeof t==`string`?t:t.name,e.schema);return n===`node`?fu(e,t):n===`mark`?Hl(e,t):{}}function mu(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 hu(e){let t=mu(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 gu(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}})})}),hu(r)}function _u(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=Kc(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 vu=(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]},yu=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return n===0?null:e.node(t).child(n-1)};function bu(e,t){return t.nodes[e]||t.marks[e]||null}function xu(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 Su=(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 Cu(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?qc(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>Uc(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=>Uc(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 wu(e,t,n={}){if(!t)return Tl(e,null,n)||Cu(e,null,n);let r=Al(t,e.schema);return r===`node`?Tl(e,t,n):r===`mark`&&Cu(e,t,n)}var Tu=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=Kl(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)},Eu=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Du(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Ou(e,t){let{nodeExtensions:n}=Yl(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=R(F(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function ku(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&&(ku(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function Au(e){return e instanceof M}var ju=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Mu(e,t){let n=t.mapping.mapResult(e.position);return{position:new ju(n.pos),mapResult:n}}function Nu(e){return new ju(e)}function Pu(e,t,n){let{selection:r}=t,i=null;if(Xc(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 Fu=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=qc(e,r.schema);if(i){if(o){let e=Hl(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 Pu(r,n,c)},Iu=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Lu=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=Nc(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>Dr(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>Dr(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},Ru=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=Zc(e,0,n.content.size),i=M.create(n,r);t.setSelection(i)}return!0},zu=(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},Bu=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=j.atStart(n).from,o=j.atEnd(n).to,s=Zc(r,a,o),c=Zc(i,a,o),l=j.create(n,s,c);t.setSelection(l)}return!0},Vu=e=>({state:t,dispatch:n})=>zr(Nc(e,t.schema))(t,n);function Hu(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 Uu=({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=xu(l,s.node().type.name,s.node().attrs);if(a instanceof M&&a.node.isBlock)return!s.parentOffset||!Xt(o,s.pos)?!1:(r&&(e&&Hu(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:fl(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=Xt(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&Xt(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 j&&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&&Hu(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},Wu=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=Nc(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=b.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=b.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={...xu(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(b.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new E(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(j.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...xu(d,u.type.name,u.attrs),...t},m={...xu(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(!Xt(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 Gu(e){return!e||e===`1`?null:e}function Ku(e,t){return Gu(e)===Gu(t)}var qu=(e,t)=>{let n=Kl(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&&Qt(e.doc,n.pos))||!Ku(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},Ju=(e,t)=>{let n=Kl(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&&Qt(e.doc,r))||!Ku(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function Yu(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return j.between(r,i)}var Xu=(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=Nc(e,o.schema),m=Nc(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=Kl(e=>Ou(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&Ou(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,ee=!!x&&y.depth>=1&&y.depth-x.depth<=1,te=!!T;if((ee||te)&&E){if(E.node.type===p)return S&&te?c().command(({tr:e,dispatch:t})=>{let n=Yu(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Ou(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>qu(a,p)).command(()=>Ju(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>qu(a,p)).command(()=>Ju(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(()=>qu(a,p)).command(()=>Ju(a,p)).run()},Zu=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=qc(e,r.schema);return Cu(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},Qu=(e,t,n={})=>({state:r,commands:i})=>{let a=Nc(e,r.schema),o=Nc(t,r.schema),s=Tl(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})},$u=(e,t={})=>({state:n,commands:r})=>{let i=Nc(e,n.schema);return Tl(n,i,t)?r.lift(i):r.wrapIn(i,t)},ed=()=>({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},td=(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},nd=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=qc(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=Kc(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},rd=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},id=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Al(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Nc(e,r.schema)),s===`mark`&&(o=qc(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},ad=new Yn(`__tiptap_decorations__`),od=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(ad,{type:`force`,name:e}),!0),sd=(e,t={})=>({state:n,dispatch:r})=>Er(Nc(e,n.schema),t)(n,r),cd=(e,t={})=>({state:n,dispatch:r})=>Nr(Nc(e,n.schema),t)(n,r),ld=m({blur:()=>Ec,clearContent:()=>Dc,clearNodes:()=>Oc,command:()=>kc,createParagraphNear:()=>Ac,cut:()=>jc,deleteCurrentNode:()=>Mc,deleteNode:()=>Pc,deleteRange:()=>Fc,deleteSelection:()=>zc,enter:()=>Bc,exitCode:()=>Vc,extendMarkRange:()=>Jc,first:()=>Yc,focus:()=>nl,forEach:()=>rl,insertContent:()=>il,insertContentAt:()=>dl,insertDefaultBlock:()=>pl,joinBackward:()=>gl,joinDown:()=>hl,joinForward:()=>_l,joinItemBackward:()=>vl,joinItemForward:()=>yl,joinTextblockBackward:()=>bl,joinTextblockForward:()=>xl,joinUp:()=>ml,keyboardShortcut:()=>wl,lift:()=>El,liftEmptyBlock:()=>Dl,liftListItem:()=>Ol,newlineInCode:()=>kl,resetAttributes:()=>Ml,scrollIntoView:()=>Nl,selectAll:()=>Pl,selectNodeBackward:()=>Fl,selectNodeForward:()=>Il,selectParentNode:()=>Ll,selectTextblockEnd:()=>Rl,selectTextblockStart:()=>zl,setContent:()=>Vl,setMark:()=>Fu,setMeta:()=>Iu,setNode:()=>Lu,setNodeSelection:()=>Ru,setTextDirection:()=>zu,setTextSelection:()=>Bu,sinkListItem:()=>Vu,splitBlock:()=>Uu,splitListItem:()=>Wu,toggleList:()=>Xu,toggleMark:()=>Zu,toggleNode:()=>Qu,toggleWrap:()=>$u,undoInputRule:()=>ed,unsetAllMarks:()=>td,unsetMark:()=>nd,unsetTextDirection:()=>rd,updateAttributes:()=>id,updateDecorations:()=>od,wrapIn:()=>sd,wrapInList:()=>cd}),ud=new WeakMap;function dd(e,t){ud.set(e,(ud.get(e)??0)+1);try{return t()}finally{let t=(ud.get(e)??1)-1;t>0?ud.set(e,t):ud.delete(e)}}function fd(e){return ud.has(e)}var pd=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={}}},md=typeof process<`u`&&!1;function hd(e){return e.kind===`widget`}function gd(e,t){let n=[],r=new Set;for(let i of e)i.kind===`widget`&&hd(i)&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function _d(e,t,n){let{decorations:r,widgetKeys:i}=gd(t,n);return{set:Ss.create(e,r),widgetKeys:i}}function vd({position:e,from:t,to:n,docSize:r}){return e<t?!1:e<n||e===n&&n===r}function yd({decorations:e,from:t,to:n,docSize:r,extensionName:i,warnedExtensions:a}){return e.filter(e=>vd({position:e.anchor,from:t,to:n,docSize:r})?!0:(e.anchor===n||a.has(i)||(a.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function bd(e){let t=e.spec?.key;return typeof t==`string`?t:void 0}function xd(e){let t=new Map,n=new Map;for(let r of e.find()){let e=bd(r);if(!e)continue;let i=r.spec.extensionName??`unknown`,a=t.get(e)??new Set;a.add(i),t.set(e,a),n.set(e,(n.get(e)??0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>(n.get(e)??0)>1)}function Sd(e){return e.jsonID===`attr`}function Cd(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||Sd(e))return!0;let n=e;return typeof n.from==`number`&&typeof n.to==`number`}function wd(e,t){let n=null,r=0,i=0;for(let a=0;a<e.childCount&&!(i>t.to);a+=1){let o=i+e.child(a).nodeSize;o>=t.from&&(n===null&&(n=i),r=o),i=o}return n===null?null:{from:n,to:r}}function Td(e,t){if(e.steps.some(e=>!Cd(e)))return{type:`full`};let n=gu(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!Sd(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=wd(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:`ranges`,ranges:i}}function Ed(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=e?.key;typeof t==`string`&&r.delete(t)}})}function Dd(e,t,n){let r=t.decorationSetsByExtension[e]??Ss.empty,i=new Set(t.widgetKeysByExtension[e]??[]);return{set:Ed(r,n.mapping,n.doc,i),widgetKeys:i}}function Od(e,t){let n=Object.values(t).flatMap(e=>e.find());return Ss.create(e,n)}function kd(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}function Ad(e,t){switch(t.update??`document`){case`document`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case`changedRanges`:if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case`manual`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function z(e,t,n){return n?!0:e.update===`manual`?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}var jd=new Set,Md=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=ad.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>Ad(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(`beforeTransaction`,this.handleBeforeTransaction)}destroy(){this.editor.off(`beforeTransaction`,this.handleBeforeTransaction)}liveWidgetKeys(){return ad.getState(this.editor.state)?.widgetKeys??jd}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new Kn({key:ad,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:a}of t){let{set:t,widgetKeys:o}=this.buildFullSet(e,a,n);r[e]=t,i[e]=o}let a={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:kd(i)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,i,a)=>{let o=n.getMeta(ad),s=o?.type===`force`&&!o.name,c=o?.type===`force`?o.name:void 0,l={},u={},d=new Set;return dd(e,()=>{for(let{name:o,spec:f}of t){let t=s||c===o;if(!z(f,{editor:e,tr:n,oldState:i,newState:a},t)){let e=Dd(o,r,n);l[o]=e.set,u[o]=e.widgetKeys}else if(f.update===`changedRanges`&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(o,f,r,n,a);l[o]=e.set,u[o]=e.widgetKeys,d.add(o)}else{let{set:e,widgetKeys:t}=this.buildFullSet(o,f,a);l[o]=e,u[o]=t,d.add(o)}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:l,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:l,recomputedNames:d}),widgetKeys:kd(u)}}},props:{decorations(e){return ad.getState(e)?.mergedDecorationSet??Ss.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let a=Td(r,i.doc);return a.type===`full`?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,a.ranges)}rebuildRanges(e,t,n,r,i,a){let o=n.decorationSetsByExtension[e]??Ss.empty,s=new Set(n.widgetKeysByExtension[e]??[]),c=Ed(o,r.mapping,r.doc,s),l=i.doc.content.size;for(let{from:n,to:r}of a){let a=c.find(n,r).filter(e=>vd({position:e.from,from:n,to:r,docSize:l}));for(let e of a){let t=bd(e);t&&s.delete(t)}c=c.remove(a);let{decorations:o,widgetKeys:u}=gd(yd({decorations:this.runCreate(e,`createInRange`,()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:l,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);c=c.add(i.doc,o);for(let e of u)s.add(e)}return{set:c,widgetKeys:s}}buildFullSet(e,t,n){let r=this.runCreate(e,`create`,()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return _d(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!md)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let t=xd(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(`, `);console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${n.size===1?``:`s`} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return n.length===1?t[n[0]]:Od(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return e.length===1?r[e[0].name]:i.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):Od(n.doc,r)}};function Nd(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof M){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 Pd(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 Fd(e){return typeof e==`number`}function Id(e){return Object.prototype.toString.call(e).slice(8,-1)}function Ld(e){return Id(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Rd(e,t,n){let r=e.split(`
|
|
15
|
+
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],u=e.match(t.itemPattern);if(!u){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}return}let d=t.extractItemData(u),{indentLevel:f,mainContent:p}=d;a=`${a}${e}\n`;let m=[p];for(o+=1;o<r.length;){var c;let e=r[o];if(e.trim()===``){var l;let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((((l=r[o+1+t].match(/^(\s*)/))==null||(l=l[1])==null?void 0:l.length)||0)>f){m.push(e),a=`${a}${e}\n`,o+=1;continue}break}if((((c=e.match(/^(\s*)/))==null||(c=c[1])==null?void 0:c.length)||0)>f)m.push(e),a=`${a}${e}\n`,o+=1;else break}let h,g=m.slice(1);if(g.length>0){let e=g.map(e=>e.slice(f+s)).join(`
|
|
16
|
+
`);e.trim()&&(h=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let _=t.createToken(d,h);i.push(_)}if(i.length!==0)return{items:i,raw:a}}var zd=4;function Bd(e){let t=0;for(let n of e)t=n===` `?t+zd-t%zd:t+1;return t}function Vd(e,t,n,r,i){if(!e||!Array.isArray(e.content))return``;let a=typeof n==`function`?n(r):n,[o,...s]=e.content,c=`${a}${t.renderChildren([o])}`;return s&&s.length>0&&s.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=e=>{if(!i?.alignNestedToPrefix)return t.indent(e);let n=t.indent(``),r=Bd(a);return(Bd(n)>=r?n:` `.repeat(r))+e},o=r.split(`
|
|
17
|
+
`).map(e=>n(e||``)).join(`
|
|
18
|
+
`);c+=e.type===`paragraph`?`\n\n${o}`:`\n${o}`}}),c}function Hd(e,t){let n={...e};return Ld(e)&&Ld(t)&&Object.keys(t).forEach(r=>{Ld(t[r])&&Ld(e[r])?n[r]=Hd(e[r],t[r]):n[r]=t[r]}),n}function Ud(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 B=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Wd=(e,t)=>{if(Hc(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 Gd(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=Su(c)+i;return a.forEach(e=>{if(l)return;let a=Wd(u,e.find);if(!a)return;let d=a[0].length-i.length;if(d>0){let e=c.parentOffset-d;if(e<0||c.parent.textBetween(e,c.parentOffset)!==a[0].slice(0,d))return}let f=s.state.tr,p=wc({state:s.state,transaction:f}),m={from:n-(a[0].length-i.length),to:r},{commands:h,chain:g,can:_}=new Tc({editor:t,state:p});e.handler({state:p,range:m,match:a,commands:h,chain:g,can:_})!==null&&f.steps.length&&(e.undoable&&f.setMeta(o,{transform:f,from:n,to:r,text:i}),s.dispatch(f),l=!0)}),l}function Kd(e){let{editor:t,rules:n}=e,r=new Kn({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:ql(b.from(e),a.schema);let{from:i}=s,o=i+e.length;Gd({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 Gd({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&Gd({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?Gd({editor:t,from:a.pos,to:a.pos,text:`
|
|
19
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var qd=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{...R(F(this,`addOptions`,{name:this.name}))}}get storage(){return{...R(F(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>Hd(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}},Jd=class e extends qd{constructor(...e){super(...e),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Yd=class{constructor(e){this.find=e.find,this.handler=e.handler}},Xd=(e,t,n)=>{if(Hc(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 Zd(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new Tc({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{var f;if((f=e.type)!=null&&(f=f.spec)!=null&&f.code||!(e.isText||e.isTextblock||e.isInline))return;let p=e.content?.size??e.nodeSize??0,m=Math.max(r,t),h=Math.min(i,t+p);m>=h||Xd(e.isText?e.text||``:e.textBetween(m-t,h-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=m+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var Qd=null,$d=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function ef(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=wc({state:e,transaction:c});if(Zd({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 Kn({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(Qd=t)},i=()=>{Qd&&=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=Qd;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:ql(b.from(t),r.schema);let{from:n}=d,i=n+t.length,a=$d(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(Fd(p)&&m&&p!==m.b)return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var tf=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=cu(e),this.schema=au(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=F(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:bu(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=su([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:bu(t.name,this.schema)},r=[],i=F(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&F(t,`exitable`,n)&&(a.ArrowRight=()=>Jd.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=Sc(a);r.push(o);let s=F(t,`addInputRules`,n);if(Du(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=Kd({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=F(t,`addPasteRules`,n);if(Du(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=ef({editor:e,rules:t});r.push(...n)}}let l=F(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;(e=this.decorationManager)==null||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=F(e,`addDecorations`,{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:bu(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new Md({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return Xl(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=Yl(this.extensions);return Object.fromEntries(t.filter(e=>!!F(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=F(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Nc(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=eu(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 su([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:bu(n.name,this.schema)},i=F(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return su([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:bu(n.name,this.schema)},i=F(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}=Yl(this.extensions);return Object.fromEntries(t.filter(e=>!!F(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=F(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:qc(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=eu(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{Ud(i,e,t)}})}]:[]}))}destroy(){var e;(e=this.decorationManager)==null||e.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:bu(e.name,this.schema)};e.type===`mark`&&((R(F(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(R(F(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=F(e,`onBeforeCreate`,t),r=F(e,`onCreate`,t),i=F(e,`onUpdate`,t),a=F(e,`onSelectionUpdate`,t),o=F(e,`onTransaction`,t),s=F(e,`onFocus`,t),c=F(e,`onBlur`,t),l=F(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)})}};tf.resolve=cu,tf.sort=su,tf.flatten=I;var nf=class e extends qd{constructor(...e){super(...e),this.type=`extension`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},rf=nf.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Kn({key:new Yn(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=du(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})=>lu(r,{from:e.pos,to:t.pos},s)).join(o??`
|
|
20
|
+
|
|
21
|
+
`)}}})]}}),af=nf.create({name:`commands`,addCommands(){return{...ld}}}),of=nf.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){var n;let r=()=>{var n,r;if(((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null||(r=n.filterTransaction)==null?void 0:r.call(n,e))??e.getMeta(`y-sync$`))return;let i=Ul(e.before,[e,...t]);gu(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter&&i.mapping.mapResult(t.oldRange.to).deletedBefore&&i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let a=r+n.nodeSize-2,o=t.oldRange.from<=r&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:r,to:a,newFrom:i.mapping.map(r),newTo:i.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:i})})});let a=i.mapping;i.steps.forEach((t,n)=>{if(t instanceof Ot){let r=a.slice(n).map(t.from,-1),o=a.slice(n).map(t.to),s=a.invert().map(r,-1),c=a.invert().map(o),l=r>0&&i.doc.nodeAt(r-1)?.marks.some(e=>e.eq(t.mark)),u=i.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:r,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:i})}})};((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null?void 0:n.async)??!0?setTimeout(r,0):r()}}),sf=nf.create({name:`drop`,addProseMirrorPlugins(){return[new Kn({key:new Yn(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),cf=nf.create({name:`editable`,addProseMirrorPlugins(){return[new Kn({key:new Yn(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),lf=new Yn(`focusEvents`),uf=nf.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new Kn({key:lf,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}}}})]}}),df=nf.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:A.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 el()||Sl()?i:r},addProseMirrorPlugins(){return[new Kn({key:new Yn(`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=A.atStart(t.doc).from,l=A.atEnd(t.doc).to;if(a||o!==c||s!==l||!ku(n.doc))return;let u=n.tr,d=wc({state:n,transaction:u}),{commands:f}=new Tc({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),ff=nf.create({name:`paste`,addProseMirrorPlugins(){return[new Kn({key:new Yn(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),pf=nf.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Kn({key:new Yn(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),mf=nf.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=Yl(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 Kn({key:new Yn(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),hf=!1;function gf(e){if(hf)return;hf=!0;let t;try{t=jt.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof b||console.warn(`[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.`)}var _f=class e{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e){if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r}r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},vf=`.ProseMirror {
|
|
22
|
+
position: relative;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ProseMirror {
|
|
26
|
+
word-wrap: break-word;
|
|
27
|
+
white-space: pre-wrap;
|
|
28
|
+
white-space: break-spaces;
|
|
29
|
+
-webkit-font-variant-ligatures: none;
|
|
30
|
+
font-variant-ligatures: none;
|
|
31
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ProseMirror [contenteditable="false"] {
|
|
35
|
+
white-space: normal;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
39
|
+
white-space: pre-wrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ProseMirror pre {
|
|
43
|
+
white-space: pre-wrap;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
img.ProseMirror-separator {
|
|
47
|
+
display: inline !important;
|
|
48
|
+
border: none !important;
|
|
49
|
+
margin: 0 !important;
|
|
50
|
+
width: 0 !important;
|
|
51
|
+
height: 0 !important;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ProseMirror-gapcursor {
|
|
55
|
+
display: none;
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
position: absolute;
|
|
58
|
+
margin: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ProseMirror-gapcursor:after {
|
|
62
|
+
content: "";
|
|
63
|
+
display: block;
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: -2px;
|
|
66
|
+
width: 20px;
|
|
67
|
+
border-top: 1px solid black;
|
|
68
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@keyframes ProseMirror-cursor-blink {
|
|
72
|
+
to {
|
|
73
|
+
visibility: hidden;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ProseMirror-hideselection *::selection {
|
|
78
|
+
background: transparent;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
82
|
+
background: transparent;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ProseMirror-hideselection * {
|
|
86
|
+
caret-color: transparent;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
90
|
+
display: block;
|
|
91
|
+
}`,yf=class extends pd{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Mu,createMappablePosition:Nu},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=Qc(t,this.options.autofocus);this.editorState=Wn.create({doc:t,schema:this.schema,selection:e||void 0})}gf(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Tc.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Tc.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=Pd(vf,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 md&&!this.hasWarnedStaleDecorationRead&&fd(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=L(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[cf,rf.configure({blockSeparator:(e=this.options.coreExtensionOptions)==null||(e=e.clipboardTextSerializer)==null?void 0:e.blockSeparator}),af,uf,df,pf.configure({value:(t=this.options.coreExtensionOptions)==null||(t=t.tabindex)==null?void 0:t.value}),sf,ff,of,mf.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 tf(n,this)}createCommandManager(){this.commandManager=new Tc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Bl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(e.message))throw e;let t=Bl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Wn.create({doc:t,schema:this.schema,selection:Qc(t,this.options.autofocus)||void 0}),this.emit(`contentError`,{editor:this,error:e,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),this.editorState.doc}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new nc(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 pu(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return wu(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ql(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
|
|
92
|
+
|
|
93
|
+
`,textSerializers:n={}}=e||{};return uu(this.state.doc,{blockSeparator:t,textSerializers:{...du(this.schema),...n}})}get isEmpty(){return ku(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new _f(t,this,!1,n)}get $doc(){return this.$pos(0)}};function bf(e){return new B({find:e.find,handler:({state:t,range:n,match:r})=>{let i=R(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(_u(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 xf(e){return new B({find:e.find,handler:({state:t,range:n,match:r})=>{let i=R(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 Sf(e){return new B({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=R(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 Cf(e){return new B({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=R(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&Bt(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&&Qt(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var wf=class e extends qd{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Tf(e){return new Yd({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=R(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(_u(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 Ef=new WeakSet,Df=new WeakSet;function Of(e){let t=e;return Ef.add(t),t}function kf(e){return Array.isArray(e)&&Ef.has(e)}function Af(e){return e.flatMap(e=>e==null?[]:Array.isArray(e)&&Df.has(e)&&!kf(e)?Af(e):[e])}function jf(e,t){if(e===`slot`)return 0;if(e instanceof Function){let n=e(t);return Array.isArray(n)&&!kf(n)&&!Df.has(n)?Of(n):n}let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);if(Array.isArray(n)){if(kf(n))return Of([e,r,n]);if(n.length===0)return Of([e,r]);let t=Af(n);return t.length===0?Of([e,r]):Of([e,r,...t])}return Of(n==null?[e,r]:[e,r,n])}var Mf=(e,t)=>jf(e,t),Nf=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new E(n,0,0);return e.replace(l,i.after(),r),e.setSelection(j.create(e.doc,l+n.size)),e.scrollIntoView(),t(e),!0})},Pf=/^\s*>\s$/,Ff=wf.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return Mf(`blockquote`,{...$l(this.options.HTMLAttributes,e),children:Mf(`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(`
|
|
94
|
+
`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
|
|
95
|
+
`))}),n.join(`
|
|
96
|
+
>
|
|
97
|
+
`)},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:()=>Nf(this.editor,this.type)}},addInputRules(){return[Cf({find:Pf,type:this.type})]}}),If=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Lf=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Rf=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,zf=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Bf=Jd.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 Mf(`strong`,{...$l(this.options.HTMLAttributes,e),children:Mf(`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[bf({find:If,type:this.type}),bf({find:Rf,type:this.type})]},addPasteRules(){return[Tf({find:Lf,type:this.type}),Tf({find:zf,type:this.type})]}}),Vf=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},Hf=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},Uf=Jd.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,$l(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[bf({find:Vf,type:this.type})]},addPasteRules(){return[Tf({find:Hf,type:this.type})]}}),Wf=4,Gf=/^```([a-z]+)?[\s\n]$/,Kf=/^~~~([a-z]+)?[\s\n]$/,qf=wf.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Wf,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`,$l(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(`
|
|
98
|
+
`):`\`\`\`${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??Wf,{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,`
|
|
99
|
+
`,`
|
|
100
|
+
`).split(`
|
|
101
|
+
`).map(e=>o+e).join(`
|
|
102
|
+
`);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??Wf,{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,`
|
|
103
|
+
`,`
|
|
104
|
+
`).split(`
|
|
105
|
+
`),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(j.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
|
|
106
|
+
`,`
|
|
107
|
+
`).split(`
|
|
108
|
+
`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
|
|
109
|
+
`);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(`
|
|
110
|
+
|
|
111
|
+
`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let a=r.before();return a>0?!1:e.commands.insertDefaultBlock({pos:a})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(A.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[Sf({find:Gf,type:this.type,getAttributes:e=>({language:e[1]})}),Sf({find:Kf,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Kn({key:new Yn(`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,`
|
|
112
|
+
`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(j.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),Jf=wf.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
113
|
+
|
|
114
|
+
`):``}),Yf=wf.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`,$l(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
115
|
+
`},renderMarkdown:()=>`
|
|
116
|
+
`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Xf=wf.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]}`,$l(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=>Sf({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),Zf=wf.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,$l(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!Nd(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return Au(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(j.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(M.create(t.doc,n.pos)):t.setSelection(j.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(j.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[xf({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Qf=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,$f=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,ep=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,tp=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,np=Jd.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`,$l(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[bf({find:Qf,type:this.type}),bf({find:ep,type:this.type})]},addPasteRules(){return[Tf({find:$f,type:this.type}),Tf({find:tp,type:this.type})]}}),rp=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,ip=`ελ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`,ap=`numeric`,op=`ascii`,sp=`alpha`,cp=`asciinumeric`,lp=`alphanumeric`,up=`domain`,dp=`emoji`,fp=`scheme`,pp=`slashscheme`,mp=`whitespace`;function hp(e,t){return e in t||(t[e]=[]),t[e]}function gp(e,t,n){t[ap]&&(t[cp]=!0,t[lp]=!0),t[op]&&(t[cp]=!0,t[sp]=!0),t[cp]&&(t[lp]=!0),t[sp]&&(t[lp]=!0),t[lp]&&(t[up]=!0),t[dp]&&(t[up]=!0);for(let r in t){let t=hp(r,n);t.indexOf(e)<0&&t.push(e)}}function _p(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function vp(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}vp.groups={},vp.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||=vp.groups;let i;return t&&t.j?i=t:(i=new vp(t),n&&r&&gp(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||=vp.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 vp,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new vp,a&&(r&&(o.t&&typeof o.t==`string`?gp(a,Object.assign(_p(o.t,r),n),r):n&&gp(a,n,r)),o.t=a),i.j[e]=o,o}};var V=(e,t,n,r,i)=>e.ta(t,n,r,i),yp=(e,t,n,r,i)=>e.tr(t,n,r,i),bp=(e,t,n,r,i)=>e.ts(t,n,r,i),H=(e,t,n,r,i)=>e.tt(t,n,r,i),xp=`WORD`,Sp=`UWORD`,Cp=`ASCIINUMERICAL`,wp=`ALPHANUMERICAL`,Tp=`LOCALHOST`,Ep=`TLD`,Dp=`UTLD`,Op=`SCHEME`,kp=`SLASH_SCHEME`,Ap=`NUM`,jp=`WS`,Mp=`NL`,Np=`OPENBRACE`,Pp=`CLOSEBRACE`,Fp=`OPENBRACKET`,Ip=`CLOSEBRACKET`,Lp=`OPENPAREN`,Rp=`CLOSEPAREN`,zp=`OPENANGLEBRACKET`,Bp=`CLOSEANGLEBRACKET`,Vp=`FULLWIDTHLEFTPAREN`,Hp=`FULLWIDTHRIGHTPAREN`,Up=`LEFTCORNERBRACKET`,Wp=`RIGHTCORNERBRACKET`,Gp=`LEFTWHITECORNERBRACKET`,Kp=`RIGHTWHITECORNERBRACKET`,qp=`FULLWIDTHLESSTHAN`,Jp=`FULLWIDTHGREATERTHAN`,Yp=`AMPERSAND`,Xp=`APOSTROPHE`,Zp=`ASTERISK`,Qp=`AT`,$p=`BACKSLASH`,em=`BACKTICK`,tm=`CARET`,nm=`COLON`,rm=`COMMA`,im=`DOLLAR`,am=`DOT`,om=`EQUALS`,sm=`EXCLAMATION`,cm=`HYPHEN`,lm=`PERCENT`,um=`PIPE`,dm=`PLUS`,fm=`POUND`,pm=`QUERY`,mm=`QUOTE`,hm=`FULLWIDTHMIDDLEDOT`,gm=`SEMI`,_m=`SLASH`,vm=`TILDE`,ym=`UNDERSCORE`,bm=`EMOJI`,xm=`SYM`,Sm=Object.freeze({__proto__:null,ALPHANUMERICAL:wp,AMPERSAND:Yp,APOSTROPHE:Xp,ASCIINUMERICAL:Cp,ASTERISK:Zp,AT:Qp,BACKSLASH:$p,BACKTICK:em,CARET:tm,CLOSEANGLEBRACKET:Bp,CLOSEBRACE:Pp,CLOSEBRACKET:Ip,CLOSEPAREN:Rp,COLON:nm,COMMA:rm,DOLLAR:im,DOT:am,EMOJI:bm,EQUALS:om,EXCLAMATION:sm,FULLWIDTHGREATERTHAN:Jp,FULLWIDTHLEFTPAREN:Vp,FULLWIDTHLESSTHAN:qp,FULLWIDTHMIDDLEDOT:hm,FULLWIDTHRIGHTPAREN:Hp,HYPHEN:cm,LEFTCORNERBRACKET:Up,LEFTWHITECORNERBRACKET:Gp,LOCALHOST:Tp,NL:Mp,NUM:Ap,OPENANGLEBRACKET:zp,OPENBRACE:Np,OPENBRACKET:Fp,OPENPAREN:Lp,PERCENT:lm,PIPE:um,PLUS:dm,POUND:fm,QUERY:pm,QUOTE:mm,RIGHTCORNERBRACKET:Wp,RIGHTWHITECORNERBRACKET:Kp,SCHEME:Op,SEMI:gm,SLASH:_m,SLASH_SCHEME:kp,SYM:xm,TILDE:vm,TLD:Ep,UNDERSCORE:ym,UTLD:Dp,UWORD:Sp,WORD:xp,WS:jp}),Cm=/[a-z]/,wm=/\p{L}/u,Tm=/\p{Emoji}/u,Em=/\d/,Dm=/\s/,Om=`\r`,km=`
|
|
117
|
+
`,Am=`️`,jm=``,Mm=``,Nm=null,Pm=null;function Fm(e=[]){let t={};vp.groups=t;let n=new vp;Nm??=zm(rp),Pm??=zm(ip),H(n,`'`,Xp),H(n,`{`,Np),H(n,`}`,Pp),H(n,`[`,Fp),H(n,`]`,Ip),H(n,`(`,Lp),H(n,`)`,Rp),H(n,`<`,zp),H(n,`>`,Bp),H(n,`(`,Vp),H(n,`)`,Hp),H(n,`「`,Up),H(n,`」`,Wp),H(n,`『`,Gp),H(n,`』`,Kp),H(n,`<`,qp),H(n,`>`,Jp),H(n,`&`,Yp),H(n,`*`,Zp),H(n,`@`,Qp),H(n,"`",em),H(n,`^`,tm),H(n,`:`,nm),H(n,`,`,rm),H(n,`$`,im),H(n,`.`,am),H(n,`=`,om),H(n,`!`,sm),H(n,`-`,cm),H(n,`%`,lm),H(n,`|`,um),H(n,`+`,dm),H(n,`#`,fm),H(n,`?`,pm),H(n,`"`,mm),H(n,`/`,_m),H(n,`;`,gm),H(n,`~`,vm),H(n,`_`,ym),H(n,`\\`,$p),H(n,`・`,hm);let r=yp(n,Em,Ap,{[ap]:!0});yp(r,Em,r);let i=yp(r,Cm,Cp,{[cp]:!0}),a=yp(r,wm,wp,{[lp]:!0}),o=yp(n,Cm,xp,{[op]:!0});yp(o,Em,i),yp(o,Cm,o),yp(i,Em,i),yp(i,Cm,i);let s=yp(n,wm,Sp,{[sp]:!0});yp(s,Cm),yp(s,Em,a),yp(s,wm,s),yp(a,Em,a),yp(a,Cm),yp(a,wm,a);let c=H(n,km,Mp,{[mp]:!0}),l=H(n,Om,jp,{[mp]:!0}),u=yp(n,Dm,jp,{[mp]:!0});H(n,Mm,u),H(l,km,c),H(l,Mm,u),yp(l,Dm,u),H(u,Om),H(u,km),yp(u,Dm,u),H(u,Mm,u);let d=yp(n,Tm,bm,{[dp]:!0});H(d,`#`),yp(d,Tm,d),H(d,Am,d);let f=H(d,jm);H(f,`#`),yp(f,Tm,d);let p=[[Cm,o],[Em,i]],m=[[Cm,null],[wm,s],[Em,a]];for(let e=0;e<Nm.length;e++)Rm(n,Nm[e],Ep,xp,p);for(let e=0;e<Pm.length;e++)Rm(n,Pm[e],Dp,Sp,m);gp(Ep,{tld:!0,ascii:!0},t),gp(Dp,{utld:!0,alpha:!0},t),Rm(n,`file`,Op,xp,p),Rm(n,`mailto`,Op,xp,p),Rm(n,`http`,kp,xp,p),Rm(n,`https`,kp,xp,p),Rm(n,`ftp`,kp,xp,p),Rm(n,`ftps`,kp,xp,p),gp(Op,{scheme:!0,ascii:!0},t),gp(kp,{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]?{[fp]:!0}:{[pp]:!0};r.indexOf(`-`)>=0?i[up]=!0:Cm.test(r)?Em.test(r)?i[cp]=!0:i[op]=!0:i[ap]=!0,bp(n,r,r,i)}return bp(n,`localhost`,Tp,{ascii:!0}),n.jd=new vp(xm),{start:n,tokens:Object.assign({groups:t},Sm)}}function Im(e,t){let n=Lm(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 Lm(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 Rm(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 vp(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new vp(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function zm(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 Bm={defaultProtocol:`http`,events:null,format:Hm,formatHref:Hm,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Vm(e,t=null){let n=Object.assign({},Bm);e&&(n=Object.assign(n,e instanceof Vm?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}Vm.prototype={o:Bm,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]:Bm[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 Hm(e){return e}function Um(e,t){this.t=`token`,this.v=e,this.tk=t}Um.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=Bm.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 Wm(e,t){class n extends Um{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 Gm=Wm(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),Km=Wm(`text`),qm=Wm(`nl`),Jm=Wm(`url`,{isLink:!0,toHref(e=Bm.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==Tp&&e[1].t===nm}}),Ym=e=>new vp(e);function Xm({groups:e}){let t=e.domain.concat([Yp,Zp,Qp,$p,em,tm,im,om,cm,Ap,lm,um,dm,fm,_m,xm,vm,ym]),n=[Xp,nm,rm,am,sm,lm,pm,mm,gm,zp,Bp,Np,Pp,Ip,Fp,Lp,Rp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp],r=[Yp,Xp,Zp,$p,em,tm,im,om,cm,Np,Pp,lm,um,dm,fm,pm,_m,xm,vm,ym],i=Ym(),a=H(i,vm);V(a,r,a),V(a,e.domain,a);let o=Ym(),s=Ym(),c=Ym();V(i,e.domain,o),V(i,e.scheme,s),V(i,e.slashscheme,c),V(o,r,a),V(o,e.domain,o);let l=H(o,Qp);H(a,Qp,l),H(s,Qp,l),H(c,Qp,l);let u=H(a,am);V(u,r,a),V(u,e.domain,a);let d=Ym();V(l,e.domain,d),V(d,e.domain,d);let f=H(d,am);V(f,e.domain,d);let p=Ym(Gm);V(f,e.tld,p),V(f,e.utld,p),H(l,Tp,p);let m=H(d,cm);H(m,cm,m),V(m,e.domain,d),V(p,e.domain,d),H(p,am,f),H(p,cm,m);let h=H(o,cm),g=H(o,am);H(h,cm,h),V(h,e.domain,o),V(g,r,a),V(g,e.domain,o);let _=Ym(Jm);V(g,e.tld,_),V(g,e.utld,_),V(_,e.domain,o),V(_,r,a),H(_,am,g),H(_,cm,h),H(_,Qp,l);let v=H(_,nm),y=Ym(Jm);V(v,e.numeric,y);let b=Ym(Jm),x=Ym();V(b,t,b),V(b,n,x),V(x,t,b),V(x,n,x),H(_,_m,b),H(y,_m,b);let S=H(s,nm),C=H(H(H(c,nm),_m),_m);V(s,e.domain,o),H(s,am,g),H(s,cm,h),V(c,e.domain,o),H(c,am,g),H(c,cm,h),V(S,e.domain,b),H(S,_m,b),H(S,pm,b),V(C,e.domain,b),V(C,t,b),H(C,_m,b);let w=[[Np,Pp],[Fp,Ip],[Lp,Rp],[zp,Bp],[Vp,Hp],[Up,Wp],[Gp,Kp],[qp,Jp]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=H(b,r);H(x,r,a);let o=Ym(Jm);V(a,t,o);let s=Ym();V(a,n,s),H(a,i,b),V(o,t,o),V(o,n,s),V(s,t,o),V(s,n,s),H(o,i,b),H(s,i,b)}return H(i,Tp,_),H(i,Mp,qm),{start:i,tokens:Sm}}function Zm(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(Qm(Km,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(Qm(e,t,r))}}return o.length>0&&a.push(Qm(Km,t,o)),a}function Qm(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var $m=typeof console<`u`&&console&&console.warn||(()=>{}),eh=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,th={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function nh(){return vp.groups={},th.scanner=null,th.parser=null,th.tokenQueue=[],th.pluginQueue=[],th.customSchemes=[],th.initialized=!1,th}function rh(e,t=!1){if(th.initialized&&$m(`linkifyjs: already initialized - will not register custom scheme "${e}" ${eh}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
|
|
118
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
119
|
+
2. Cannot start or end with "-"
|
|
120
|
+
3. "-" cannot repeat`);th.customSchemes.push([e,t])}function ih(){th.scanner=Fm(th.customSchemes);for(let e=0;e<th.tokenQueue.length;e++)th.tokenQueue[e][1]({scanner:th.scanner});th.parser=Xm(th.scanner.tokens);for(let e=0;e<th.pluginQueue.length;e++)th.pluginQueue[e][1]({scanner:th.scanner,parser:th.parser});return th.initialized=!0,th}function ah(e){return th.initialized||ih(),Zm(th.parser.start,e,Im(th.scanner.start,e))}ah.scan=Im;function oh(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 Vm(n),i=ah(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 sh=`[\0- \xA0 -\u2029 ]`,ch=new RegExp(sh),lh=RegExp(`${sh}$`),uh=new RegExp(sh,`g`);function dh(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function fh(e){return new Kn({key:new Yn(`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(gu(Ul(n.doc,[...t])).forEach(({newRange:t})=>{let n=Wl(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(!lh.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(ch).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=ah(n).map(t=>t.toObject(e.defaultProtocol));if(!dh(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=>{_u(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 ph(e){return new Kn({key:new Yn(`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=pu(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}var mh=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,hh=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function gh(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;--r)n+=1;return n%2==1}function _h(e,t){let n=0,r=0;for(;r<t;){if(e[r]!=="`"){r+=1;continue}if(n===0&&gh(e,r)){r+=1;continue}let i=0;for(;r<t&&e[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function vh(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||gh(e,t.index??0)||_h(e,t.index??0)?!1:!!r.trim()&&n(i)}function yh(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function bh(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function xh(e){return{href:e.data?.href,title:e.data?.title??null}}function Sh(e){let t=bf({find:t=>{let n=mh.exec(t);return!n||!vh(t,n,e.isAllowedHref)?null:yh(n)},type:e.type,getAttributes:xh});return new B({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function Ch(e){let t=Tf({find:t=>{let n=[];for(let r of t.matchAll(hh))vh(t,r,e.isAllowedHref)&&n.push(yh(r));let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>bh(t,e)));return[...n,...r]},type:e.type,getAttributes:xh});return new Yd({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.match.data?.markdown&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function wh(e){return new Kn({key:new Yn(`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=oh(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 Th(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(uh,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var Eh=Jd.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`){rh(e);return}rh(e.scheme,e.optionalSlashes)})},onDestroy(){nh()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!Th(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=>!!Th(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=>!!Th(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,$l(this.options.HTMLAttributes,e),0]:[`a`,$l(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=>!!Th(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=>!!Th(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addInputRules(){return this.options.markdownLinks?[Sh({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!Th(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let e=e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options;oh(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!Th(e,n),protocols:n,defaultProtocol:r})).forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t};return this.options.markdownLinks?[Ch({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!Th(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[Tf({find:e,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(fh({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!Th(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(ph({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(wh({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),Dh=`listItem`,Oh=`textStyle`,kh=/^\s*([-+*])\s$/,Ah=wf.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`,$l(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,`
|
|
121
|
+
`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Dh,this.editor.getAttributes(Oh)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Cf({find:kh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Cf({find:kh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Oh),editor:this.editor})),[e]}}),jh=(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}},Mh=(e,t,n,r)=>{let i=jh(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,b.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},Nh=(e,t,n)=>Mh(e.state,e.view.dispatch,t,n),Ph=(e,t)=>nf.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>Nh(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),Fh=[[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`]],Ih=`abcdefghijklmnopqrstuvwxyz`,Lh=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function Rh(e){let t=e,n=``;for(let[e,r]of Fh)for(;t>=e;)n+=r,t-=e;return n}function zh(e){return Rh(e).toUpperCase()}function Bh(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of Fh)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function Vh(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=Bh(e);return t<=0?!1:(e===e.toLowerCase()?Rh(t):zh(t))===e}function Hh(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 Uh(e){if(e<=26)return Ih[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?Ih[n]:Ih[t]+Ih[n]}function Wh(e){if(e&&!/^\d+$/.test(e)){if(Vh(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 Gh(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=Wh(e);if(t===`i`||t===`I`)return Bh(e);if(t===`a`||t===`A`){let t=Hh(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function Kh(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return Uh(t);case`A`:return Uh(t).toUpperCase();case`i`:return Rh(t);case`I`:return zh(t);default:return String(t)}}function qh(e){if(e.length===0)return!1;let t=Wh(e[0])??`numeric`,n=Gh(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=Kh(t,n+r);if(e[r]!==i)return!1}return!0}function Jh(e){return{type:Wh(e),start:Gh(e)}}function Yh(e){let{type:t,start:n}=Jh(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function Xh(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${Uh(r)}${n}`;case`A`:return`${Uh(r).toUpperCase()}${n}`;case`i`:return`${Rh(r)}${n}`;case`I`:return`${zh(r)}${n}`;default:return`${r}${n}`}}function Zh(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function Qh(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var $h=wf.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,$l(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(Zh(e))return{type:`listItem`,content:[{type:`paragraph`,content:Qh(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)=>Vd(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){var t,n;let r=((t=e.meta)==null||(t=t.parentAttrs)==null?void 0:t.start)||1;return Xh((n=e.meta)==null||(n=n.parentAttrs)==null?void 0:n.type,r-1+(e.index||0),`. `)}return`- `},n,{alignNestedToPrefix:n?.parentType===`orderedList`}),addExtensions(){return[Ph(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)}}}),eg=(e,t)=>{let{$from:n}=t.selection,r=Nc(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}},tg=(e,t)=>{let n=eg(e,t);if(!n)return!1;let[,r]=vu(t,e,n.$pos.pos+4);return r},ng=(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))},rg=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Tl(e.state,t)&&ng(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!Tl(e.state,t)||!Eu(e.state))return!1;let{$from:r}=e.state.selection,i=r.depth-1;return r.node(i).type!==e.schema.nodes[t]||r.index(i)!==0?!1:e.chain().liftListItem(t).run()},ig=(e,t)=>{let n=tg(e,t),r=eg(e,t);return!r||!n?!1:n>r.depth},ag=(e,t)=>{let n=tg(e,t),r=eg(e,t);return!r||!n?!1:n<r.depth},og=(e,t)=>{if(!Tl(e.state,t)||!Tu(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:ig(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():ag(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},sg=(e,t,n)=>{let{state:r}=e,{selection:i}=r;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0||!a.parent.isTextblock||Tl(r,t))return!1;let o=yu(a);if(!o||!n.includes(o.type.name))return!1;let s=o.lastChild;if(!s||s.type.name!==t)return!1;let c=a.parent;if(!s.canReplace(s.childCount,s.childCount,b.from(c)))return!1;let l=a.before(),u=a.after(),d=l-2;return e.commands.command(({tr:e,dispatch:t})=>(t&&(e.delete(l,u).insert(d,b.from(c)),e.setSelection(j.create(e.doc,d+1)),e.scrollIntoView()),!0))},cg=nf.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&&og(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&&og(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&&rg(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&&rg(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(let{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&sg(e,t,n))return!0;return!1}}}}),lg=RegExp(`^(\\s*)(${Lh})([.)])\\s+(.*)$`),ug=/^\s/,dg={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function fg(e){return lg.test(e.trimStart())}function pg(e){let t=e.trimStart();return dg.bulletItem.test(t)||fg(t)||dg.heading.test(t)||dg.thematicBreak.test(t)&&!t.startsWith(`-`)||/^>\s?/.test(t)||dg.codeFence.test(t)||dg.blockMath.test(t)}function mg(e){return Object.values(dg).some(t=>t.test(e))}function hg(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&&pg(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function gg(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(lg);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?Wh(s):void 0,p=isNaN(d)?Gh(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(lg))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(ug)){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(_||mg(t))break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(`
|
|
122
|
+
`).trim(),contentLines:m,raw:g.join(`
|
|
123
|
+
`)}),r=h,n=h}return[t,r]}var _g=RegExp(`^(${Lh})([.)])\\s+(.+)$`);function vg(e){let t=e.split(`
|
|
124
|
+
`).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(_g);if(!t)return null;n.push({marker:t[1],content:t[3]})}return qh(n.map(e=>e.marker))?{type:`orderedList`,attrs:Yh(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function yg(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=hg(a.contentLines),c=o.join(`
|
|
125
|
+
`).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`
|
|
126
|
+
`).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=yg(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(`
|
|
127
|
+
`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function bg(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 xg=`listItem`,Sg=`textStyle`,Cg=/^(\d+)\.\s$/;function wg(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 Tg=wf.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=wg(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=wg(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=$l(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?bg(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,`
|
|
128
|
+
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let r=e.split(`
|
|
129
|
+
`),[i,a]=gg(r);if(i.length===0)return;let o=yg(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(`
|
|
130
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(xg,this.editor.getAttributes(Sg)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new Kn({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=vg(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=Cf({find:Cg,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Cf({find:Cg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Sg)}),joinPredicate:e,editor:this.editor})),[t]}}),Eg=/^\s*(\[([( |x])?\])\s$/,Dg=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,Og=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)==null?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||`empty task item`}`},kg=wf.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>e.querySelector(`div`)??e}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,$l(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)=>Vd(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[Ph(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`);o.style.cssText=Dg;let l=e=>{let t=Og(e,e.attrs.checked,this.options.a11y);s.setAttribute(`aria-label`,t),o.textContent=t};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=eu(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[Cf({find:Eg,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),Ag=wf.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`,$l(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,`
|
|
131
|
+
`):``,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=Rd(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=Rd(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()}}});nf.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(Ah.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push($h.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(cg.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Tg.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(kg.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Ag.configure(this.options.taskList)),e}});var jg=` `,Mg=`\xA0`,Ng=wf.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,$l(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===jg||n[0].text===jg||n[0].raw===Mg||n[0].text===Mg)&&r.length===1&&r[0].type===`text`&&(r[0].text===jg||r[0].text===Mg)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){var i,a;let e=Array.isArray(n==null||(i=n.previousNode)==null?void 0:i.content)?n.previousNode.content:[];return(n==null||(a=n.previousNode)==null?void 0:a.type)===`paragraph`&&e.length===0?jg:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Pg=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Fg=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Ig=Jd.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`,$l(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[bf({find:Pg,type:this.type})]},addPasteRules(){return[Tf({find:Fg,type:this.type})]}}),Lg=wf.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),Rg=Jd.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`,$l(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 zg(e={}){return new Kn({view(t){return new Bg(t,e)}})}var Bg=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=an(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)}},Vg=class e extends A{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):A.near(r)}content(){return E.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 Hg(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Wg(e)||!Gg(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&&!M.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}}};Vg.prototype.visible=!1,Vg.findFrom=Vg.findGapCursorFrom,A.jsonID(`gapcursor`,Vg);var Hg=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 Vg.valid(t)?new Vg(t):A.near(t)}};function Ug(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Wg(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||Ug(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Gg(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||Ug(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Kg(){return new Kn({props:{decorations:Zg,createSelectionBetween(e,t,n){return t.pos==n.pos&&Vg.valid(n)?new Vg(n):null},handleClick:Yg,handleKeyDown:qg,handleDOMEvents:{beforeinput:Xg}}})}var qg=Cc({ArrowLeft:Jg(`horiz`,-1),ArrowRight:Jg(`horiz`,1),ArrowUp:Jg(`vert`,-1),ArrowDown:Jg(`vert`,1)});function Jg(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 j){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=Vg.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new Vg(c))),!0):!1}}function Yg(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Vg.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&M.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Vg(r))),!0)}function Xg(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof Vg))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=b.empty;for(let e=r.length-1;e>=0;e--)i=b.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new E(i,0,0));return a.setSelection(j.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function Zg(e){if(!(e.selection instanceof Vg))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,Ss.create(e.doc,[ys.widget(e.selection.head,t,{key:`gapcursor`})])}var Qg=200,$g=function(){};$g.prototype.append=function(e){return e.length?(e=$g.from(e),!this.length&&e||e.length<Qg&&this.leafAppend(e)||this.length<Qg&&e.leafPrepend(this)||this.appendInner(e)):this},$g.prototype.prepend=function(e){return e.length?$g.from(e).append(this):this},$g.prototype.appendInner=function(e){return new t_(this,e)},$g.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?$g.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},$g.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},$g.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)},$g.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},$g.from=function(e){return e instanceof $g?e:e&&e.length?new e_(e):$g.empty};var e_=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<=Qg)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Qg)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}($g);$g.empty=new e_([]);var t_=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}($g),n_=500,r_=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 a_(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 a_(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 a_(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>s_&&(s=i_(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Ct;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 a_(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new a_(i,o,l))}else r.push(new a_(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new a_(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>n_&&(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 a_(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($g.from(i.reverse()),a)}};r_.empty=new r_($g.empty,0);function i_(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var a_=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)}}},o_=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},s_=20;function c_(e,t,n,r){let i=n.getMeta(g_),a;if(i)return i.historyState;n.getMeta(__)&&(e=new o_(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(g_))return o.getMeta(g_).redo?new o_(e.done.addTransform(n,void 0,r,h_(t)),e.undone,u_(n.mapping.maps),e.prevTime,e.prevComposition):new o_(e.done,e.undone.addTransform(n,void 0,r,h_(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||!l_(n,e.prevRanges)),s=o?d_(e.prevRanges,n.mapping):u_(n.mapping.maps);return new o_(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,h_(t)),r_.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new o_(e.done.rebased(n,a),e.undone.rebased(n,a),d_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new o_(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),d_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function l_(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 u_(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 d_(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 f_(e,t,n){let r=h_(t),i=g_.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 o_(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(g_,{redo:n,historyState:c})}var p_=!1,m_=null;function h_(e){let t=e.plugins;if(m_!=t){p_=!1,m_=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){p_=!0;break}}return p_}var g_=new Yn(`history`),__=new Yn(`closeHistory`);function v_(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Kn({key:g_,state:{init(){return new o_(r_.empty,r_.empty,null,0,-1)},apply(t,n,r){return c_(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?b_:n==`historyRedo`?x_:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function y_(e,t){return(n,r)=>{let i=g_.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=f_(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var b_=y_(!1,!0),x_=y_(!0,!0);nf.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 Kn({key:new Yn(`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 S_=nf.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[zg(this.options)]}});nf.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new Kn({key:new Yn(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return Ss.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(ys.node(t,t+e.nodeSize,{class:this.options.className}))}),Ss.create(e,a)}}})]}});var C_=nf.create({name:`gapCursor`,addProseMirrorPlugins(){return[Kg()]},extendNodeSchema(e){return{allowGapCursor:R(F(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),w_=`placeholder`,T_=new Yn(`tiptap__placeholder`);function E_(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),ys.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function D_(e,t){return typeof e==`function`?e(t):e}function O_({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&&ku(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(E_({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:D_(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function k_({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&&ku(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(E_({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:D_(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...O_({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return Ss.create(r,o)}function A_(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 j_(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function M_(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 N_(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 P_(e,t){let n=M_(e,t.from,t.to);return n.push(j_(e,A_(e,t.from))),t.to>t.from?n.push(j_(e,A_(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(j_(e,A_(e,Math.min(t.from+1,e.content.size)))),n}function F_(e,t,n){let r=[];if(e.docChanged){let t=gu(e);for(let e of t)r.push(...P_(n.doc,e.newRange))}return e.selectionSet&&(r.push(j_(n.doc,A_(n.doc,e.mapping.map(t.selection.anchor)))),r.push(j_(n.doc,A_(n.doc,n.selection.anchor)))),N_(r)}function I_(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 L_({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}=I_(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=O_({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function R_({editor:e,options:t,dataAttribute:n}){return{init(r,i){return k_({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??Ss.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:L_({decorations:i.map(r.mapping,r.doc),ranges:F_(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function z_(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function B_({editor:e,options:t}){let n=t.dataAttribute?`data-${z_(t.dataAttribute)}`:`data-${w_}`,r=t.showOnlyCurrent&&!t.includeChildren;return new Kn({key:T_,...r?{}:{state:R_({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>k_({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?Ss.empty:T_.getState(n)??Ss.empty}})}nf.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:w_,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[B_({editor:this.editor,options:this.options})]}});function V_(e,t){return!e.selection.empty&&!Au(e.selection)&&t.isEditable}function H_(e,t){return V_(e,t)&&!t.isFocused&&!t.view.dragging}function U_(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function W_(e){e.focus()}nf.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new Kn({key:new Yn(`selection`),props:{decorations(n){return H_(n,e)?Ss.create(n.doc,[ys.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return V_(t.state,e)&&U_(),!1},focus(t){return V_(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&W_(t)}),!1}}}})]}});function G_({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var K_=nf.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new Yn(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 Kn({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!G_({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!G_({node:r,types:n})}}})]}}),q_=nf.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>b_(e,t),redo:()=>({state:e,dispatch:t})=>x_(e,t)}},addProseMirrorPlugins(){return[v_(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()}}}),J_=nf.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(Bf.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(Ff.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(Ah.configure(this.options.bulletList)),this.options.code!==!1&&e.push(Uf.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(qf.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Jf.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(S_.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(C_.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Yf.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Xf.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(q_.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Zf.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(np.configure(this.options.italic)),this.options.listItem!==!1&&e.push($h.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(cg.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(Eh.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(Tg.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Ng.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(Ig.configure(this.options.strike)),this.options.text!==!1&&e.push(Lg.configure(this.options.text)),this.options.underline!==!1&&e.push(Rg.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(K_.configure(this.options?.trailingNode)),e}}),Y_={DISABLED_SITES:[`cloud.microsoft`,`deepl.com`,`productboard.com`,`openai.com`,`chatgpt.com`],CHROME_AND_FIREFOX_SITES:[`chrome:`,`chrome-extension:`,`about:`,`moz-extension:`],EXPOSE_WITTY_ID_ALLOW_LIST:{dev:[`lndo.site`,`platformsh.site`,`witty.works`],prod:[`witty.works`]},BASE_URLS:{Prod:{api:`https://default.api.witty.works/`,dashboard:`https://dashboard.witty.works/`,posthog_url:`https://eu.posthog.com`,posthog_key:`phc_i1tlvuh1iecIOSEr0QmTEIklrsSJGhULpUwUlf8fkkl`,oauth_client_id:``},Dev:{api:`https://dev-54ta5gq-jyeciedibdzvq.fr-4.platformsh.site/`,dashboard:`https://dev-54ta5gq-56xlfiudba6c2.fr-4.platformsh.site/`,posthog_url:`https://app.posthog.com`,posthog_key:`phc_QiISRw0yFAsndXqYD0HmfGvHaOBMxb57ZRIxlimvR64`,oauth_client_id:``},Local:{api:`http://127.0.0.1:8000/`,dashboard:`https://dashboard.lndo.site/`,posthog_url:`https://app.posthog.com`,posthog_key:`phc_QiISRw0yFAsndXqYD0HmfGvHaOBMxb57ZRIxlimvR64`,oauth_client_id:`1`}},ORTHOGRAPHY:!0,SENTRY_DSN:``,SENTRY_SAMPLE_RATE:0,SENTRY_TRACE_RATE:0,API_DELAY:2e3,REPHRASE_ENABLED:!1,MAX_CHAR_LENGTH_REQUEST:2e3,MAX_CHAR_LENGTH_TOTAL:2e3,MIN_CHAR_LENGTH:50,MAX_POSTHOG_LOG_EVENTS:5e3,POSTHOG_ENABLED:!1},X_=`2.0.0`,Z_={...Y_.BASE_URLS},Q_=Object.keys(Z_);Q_.includes(`Prod`)||Q_[0];var $_=`https://www.witty.works/en/help/`;`${$_}`,`${$_}`,`${$_}`,`${$_}`,`${$_}`;var ev=[`gendered_roles_format`,`german_gender_ending`,`french_gender_separator`],tv=function(e){return e[e.Off=0]=`Off`,e[e.Basic=1]=`Basic`,e[e.Advanced=2]=`Advanced`,e}({}),nv=(e,t,n)=>n.includes(e)?0:t&&n.includes(t)?1:t?2:1,rv=(e,t,n,r)=>{let i=r.filter(n=>n!==e&&n!==t);return n===0?(i.push(e),t&&i.push(t)):n===1&&t&&i.push(t),i},iv={inclusive:{hover:`#BCD485`,default:`#D3E4AC`,highlight:`#BCD485`},corporate:{hover:`#6f9FED`,default:`#A1BEED`,highlight:`#6f9FED`},style:{hover:`#F6EC6B`,default:`#FFFFD3`,highlight:`#F6EC6B`},bias:{hover:`#EB9F46`,default:`#F8E7CB`,highlight:`#EB9F46`},severe:{hover:`#E6635A`,default:`#F7D4D4`,highlight:`#E6635A`}},av=(e,t)=>t===`corporate_rules`?`corporate`:e?e<1.5?`severe`:e>2.5?`style`:`bias`:`inclusive`,ov=(e,t)=>iv[av(e,t)];Y_.EXPOSE_WITTY_ID_ALLOW_LIST?.prod;var U=e=>typeof e==`string`,sv=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},cv=e=>e==null?``:String(e),lv=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},uv=/###/g,dv=e=>e&&e.includes(`###`)?e.replace(uv,`.`):e,fv=e=>!e||U(e),pv=(e,t,n)=>{let r=U(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(fv(e))return{};let t=dv(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return fv(e)?{}:{obj:e,k:dv(r[i])}},mv=(e,t,n)=>{let{obj:r,k:i}=pv(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=pv(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=pv(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},hv=(e,t,n,r)=>{let{obj:i,k:a}=pv(e,t,Object);i[a]=i[a]||[],i[a].push(n)},gv=(e,t)=>{let{obj:n,k:r}=pv(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},_v=(e,t,n)=>{let r=gv(e,n);return r===void 0?gv(t,n):r},vv=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(Object.prototype.hasOwnProperty.call(e,r)?U(e[r])||e[r]instanceof String||U(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):vv(e[r],t[r],n):e[r]=t[r]);return e},yv=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),bv={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},xv=e=>U(e)?e.replace(/[&<>"'\/]/g,e=>bv[e]):e,Sv=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},Cv=[` `,`,`,`?`,`!`,`;`],wv=new Sv(20),Tv=(e,t,n)=>{t||=``,n||=``;let r=Cv.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=wv.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},Ev=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},Dv=e=>e?.replace(/_/g,`-`),Ov={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},kv=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Ov,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>U(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),U(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},Av=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},jv=class extends Av{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):U(n)&&i?o.push(...n.split(i)):o.push(n)));let s=gv(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!U(n)?s:Ev(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),mv(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(U(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=gv(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?vv(s,n,i):s={...s,...n},mv(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},Mv={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},Nv=Symbol(`i18next/PATH_KEY`);function Pv(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Nv?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Fv(e,t){let{[Nv]:n}=e(Pv()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var Iv=e=>!U(e)&&typeof e!=`boolean`&&typeof e!=`number`,Lv=class e extends Av{constructor(e,t={}){super(),lv([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=kv.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=Iv(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Tv(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:U(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:U(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Fv(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Fv(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!U(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let ee=Iv(E),te=Object.prototype.toString.apply(E);if(y&&E&&ee&&!_.includes(te)&&!(U(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;t[e]=x&&!m?this.translate(r,{...i,defaultValue:Iv(T)?T[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&U(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,b&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=U(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!U(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=U(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Mv.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return U(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Fv(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!U(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(U(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!U(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r={...r,count:e.count}),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},Rv=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=kv.create(`languageUtils`)}getScriptPartFromCode(e){if(e=Dv(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=Dv(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(U(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),U(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return U(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):U(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||i(this.formatLanguageCode(e))}),r}},zv={zero:0,one:1,two:2,few:3,many:4,other:5},Bv={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Vv=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=kv.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=Dv(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),Bv;if(!e.match(/-|_/))return Bv;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>zv[e]-zv[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},Hv=(e,t,n,r=`.`,i=!0)=>{let a=_v(e,t,n);return!a&&i&&U(n)&&(a=Ev(e,n,r),a===void 0&&(a=Ev(t,n,r))),a},Uv=e=>e.replace(/\$/g,`$$$$`),Wv=class{constructor(e={}){this.logger=kv.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?xv:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?yv(i):a||`{{`,this.suffix=o?yv(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?yv(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?yv(l):``,this.nestingPrefix=d?yv(d):f||yv(`$t(`),this.nestingSuffix=p?yv(p):m||yv(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=Hv(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Hv(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e):e}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0){if(typeof l==`function`){let t=l(e,i,r);a=U(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``}else!U(a)&&!this.useRawValueToEscape&&(a=cv(a));let s=t.safeValue(a);if(e=e.replace(i[0],Uv(s)),u?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${yv(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!U(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/s.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!U(i))return i;U(i)||(i=cv(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Gv=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Kv=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(Dv(r),i),t[o]=s),s(n)}},qv=e=>(t,n,r)=>e(Dv(n),r)(t),Jv=class{constructor(e={}){this.logger=kv.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Kv:qv;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Kv(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator),a=[];for(let e=0;e<i.length;e++){let t=i[e];for(;t.indexOf(`(`)>-1&&!t.includes(`)`)&&e+1<i.length;)t=`${t}${this.formatSeparator}${i[++e]}`;a.push(t)}return a.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Gv(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}},Yv=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Xv=class extends Av{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=kv.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{hv(n.loaded,[i],a),Yv(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();U(e)&&(e=this.languageUtils.toResolveHierarchy(e)),U(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(n!=null&&n!==``){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}},Zv=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),U(e[1])&&(t.defaultValue=e[1]),U(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Qv=e=>(U(e.ns)&&(e.ns=[e.ns]),U(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),U(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),$v=()=>{},ey=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},ty=class e extends Av{constructor(e={},t){if(super(),this.options=Qv(e),this.services={},this.logger=kv,this.modules={external:[]},ey(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(U(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=Zv();this.options={...n,...this.options,...Qv(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?kv.init(r(this.modules.logger),this.options):kv.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Jv;let t=new Rv(this.options);this.store=new jv(this.options.resources,this.options);let n=this.services;n.logger=kv,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new Vv(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Wv(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new Xv(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new Lv(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=$v,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=sv(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=$v){let n=t,r=U(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=sv();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=$v,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&Mv.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=sv();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=U(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(U(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n,r){let i=r?.scopeNs,a=(e,t,...r)=>{let o;o=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(r)),o.lng=o.lng||a.lng,o.lngs=o.lngs||a.lngs;let s=o.ns!==void 0&&o.ns!==null;o.ns=o.ns||a.ns,o.keyPrefix!==``&&(o.keyPrefix=o.keyPrefix||n||a.keyPrefix);let c={...this.options,...o};Array.isArray(i)&&!s&&(c.ns=i),typeof o.keyPrefix==`function`&&(o.keyPrefix=Fv(o.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return o.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=Fv(e,c)),`${o.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=Fv(e,c)),u=o.keyPrefix?`${o.keyPrefix}${l}${e}`:e),this.t(u,o)};return U(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=sv();return this.options.ns?(U(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=sv();U(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new Rv(Zv());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=$v){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new jv(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Zv().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Wv(n)}return a.translator=new Lv(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();ty.createInstance,ty.dir,ty.init,ty.loadResources,ty.reloadResources,ty.use,ty.changeLanguage,ty.getFixedT,ty.t,ty.exists,ty.setDefaultNamespace,ty.hasLoadedNamespace,ty.loadNamespaces,ty.loadLanguages;var ny=c((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function ae(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function D(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,D(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),D(o,r,i,``,function(e){return e})):o!=null&&(te(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ie(a,u),c+=D(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ie(a,u++),c+=D(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return D(ae(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function O(e,t,n){if(e==null)return e;var r=[],i=0;return D(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function oe(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var se=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ce={map:O,forEach:function(e,t,n){O(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return O(e,function(){t++}),t},toArray:function(e){return O(e,function(e){return e})||[]},only:function(e){if(!te(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ce,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=te,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:oe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,se)}catch(e){se(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),ry=c(((e,t)=>{t.exports=ny()})),iy=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);dy(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},ay={},oy=(e,t,n,r)=>{dy(n)&&ay[n]||(dy(n)&&(ay[n]=new Date),iy(e,t,n,r))},sy=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},cy=(e,t,n)=>{e.loadNamespaces(t,sy(e,n))},ly=(e,t,n,r)=>{if(dy(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return cy(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,sy(e,r))},uy=(e,t,n={})=>!t.languages||!t.languages.length?(oy(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),dy=e=>typeof e==`string`,fy=e=>typeof e==`object`&&!!e,py=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,my={"&":`&`,"&":`&`,"<":`<`,"<":`<`,">":`>`,">":`>`,"'":`'`,"'":`'`,""":`"`,""":`"`," ":` `," ":` `,"©":`©`,"©":`©`,"®":`®`,"®":`®`,"…":`…`,"…":`…`,"/":`/`,"/":`/`},hy=e=>my[e],gy={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(py,hy),transDefaultProps:void 0},_y=(e={})=>{gy={...gy,...e}},vy=()=>gy,yy,by=e=>{yy=e},xy=()=>yy,Sy={type:`3rdParty`,init(e){_y(e.options.react),by(e)}},W=d(ry()),Cy=(0,W.createContext)(),wy=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},Ty=c((e=>{var t=ry();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Ey=c(((e,t)=>{t.exports=Ty()}))(),Dy={t:(e,t)=>{if(dy(t))return t;if(fy(t)&&dy(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},Oy=()=>()=>{},ky=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=(0,W.useContext)(Cy)||{},a=n||r||xy();a&&!a.reportNamespaces&&(a.reportNamespaces=new wy),a||oy(a,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.`);let o=(0,W.useMemo)(()=>({...vy(),...a?.options?.react,...t}),[a,t]),{useSuspense:s,keyPrefix:c}=o,l=e||i||a?.options?.defaultNS,u=dy(l)?[l]:l||[`translation`],d=(0,W.useMemo)(()=>u,u);a?.reportNamespaces?.addUsedNamespaces?.(d);let f=(0,W.useRef)(0),p=(0,W.useCallback)(e=>{if(!a)return Oy;let{bindI18n:t,bindI18nStore:n}=o,r=()=>{f.current+=1,e()};return t&&a.on(t,r),n&&a.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>a.off(e,r)),n&&n.split(` `).forEach(e=>a.store.off(e,r))}},[a,o]),m=(0,W.useRef)(),h=(0,W.useCallback)(()=>{if(!a)return Dy;let e=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(e=>uy(e,a,o)),n=t.lng||a.language,r=f.current,i=m.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===c&&i.revision===r)return i;let s={t:a.getFixedT(n,o.nsMode===`fallback`?d:d[0],c,{scopeNs:d}),ready:e,lng:n,keyPrefix:c,revision:r};return m.current=s,s},[a,d,c,o,t.lng]),[g,_]=(0,W.useState)(0),{t:v,ready:y}=(0,Ey.useSyncExternalStore)(p,h,h);(0,W.useEffect)(()=>{if(a&&!y&&!s){let e=()=>_(e=>e+1);t.lng?ly(a,t.lng,d,e):cy(a,d,e)}},[a,t.lng,d,y,s,g]);let b=a||{},x=(0,W.useRef)(null),S=(0,W.useRef)(),C=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},w=(0,W.useMemo)(()=>{let e=b,t=e?.language,n=e;e&&(x.current&&x.current.__original===e&&S.current===t?n=x.current:(n=C(e),x.current=n,S.current=t));let r=!y&&!s?(...e)=>(oy(a,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),v(...e)):v,i=[r,n,y];return i.t=r,i.i18n=n,i.ready=y,i},[v,b,y,b.resolvedLanguage,b.language,b.languages]);if(a&&s&&!y){let e=!1;try{e=!1}catch{}throw e&&oy(a,`SUSPENDED_WHILE_LOADING`,`useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook`),new Promise(e=>{let n=()=>e();t.lng?ly(a,t.lng,d,n):cy(a,d,n)})}return w},{slice:Ay,forEach:jy}=[];function My(e){return jy.call(Ay.call(arguments,1),t=>{if(t)for(let n in t)e[n]===void 0&&(e[n]=t[n])}),e}function Ny(e){return typeof e==`string`&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(e))}var Py=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Fy=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:`/`},r=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){let e=n.maxAge-0;if(Number.isNaN(e))throw Error(`maxAge should be a Number`);r+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!Py.test(n.domain))throw TypeError(`option domain is invalid`);r+=`; Domain=${n.domain}`}if(n.path){if(!Py.test(n.path))throw TypeError(`option path is invalid`);r+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!=`function`)throw TypeError(`option expires is invalid`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite)switch(typeof n.sameSite==`string`?n.sameSite.toLowerCase():n.sameSite){case!0:r+=`; SameSite=Strict`;break;case`lax`:r+=`; SameSite=Lax`;break;case`strict`:r+=`; SameSite=Strict`;break;case`none`:r+=`; SameSite=None`;break;default:throw TypeError(`option sameSite is invalid`)}return n.partitioned&&(r+=`; Partitioned`),r},Iy={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:`/`,sameSite:`strict`};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Fy(e,t,i)},read(e){let t=`${e}=`,n=document.cookie.split(`;`);for(let e=0;e<n.length;e++){let r=n[e];for(;r.charAt(0)===` `;)r=r.substring(1,r.length);if(r.indexOf(t)===0)return r.substring(t.length,r.length)}return null},remove(e,t){this.create(e,``,-1,t)}},Ly={name:`cookie`,lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<`u`)return Iy.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:a}=t;n&&typeof document<`u`&&Iy.create(n,e,r,i,a)}},Ry={name:`querystring`,lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<`u`){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf(`?`)>-1&&(e=window.location.hash.substring(window.location.hash.indexOf(`?`)));let r=e.substring(1).split(`&`);for(let e=0;e<r.length;e++){let i=r[e].indexOf(`=`);i>0&&r[e].substring(0,i)===t&&(n=r[e].substring(i+1))}}return n}},zy={name:`hash`,lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<`u`){let{hash:e}=window.location;if(e&&e.length>2){let i=e.substring(1);if(t){let e=i.split(`&`);for(let n=0;n<e.length;n++){let i=e[n].indexOf(`=`);i>0&&e[n].substring(0,i)===t&&(r=e[n].substring(i+1))}}if(r)return r;if(!r&&n>-1){let t=e.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof n==`number`?n:0]?.replace(`/`,``):void 0}}}return r}},By=null,Vy=()=>{if(By!==null)return By;try{if(By=typeof window<`u`&&window.localStorage!==null,!By)return!1;let e=`i18next.translate.boo`;window.localStorage.setItem(e,`foo`),window.localStorage.removeItem(e)}catch{By=!1}return By},Hy={name:`localStorage`,lookup(e){let{lookupLocalStorage:t}=e;if(t&&Vy())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Vy()&&window.localStorage.setItem(n,e)}},Uy=null,Wy=()=>{if(Uy!==null)return Uy;try{if(Uy=typeof window<`u`&&window.sessionStorage!==null,!Uy)return!1;let e=`i18next.translate.boo`;window.sessionStorage.setItem(e,`foo`),window.sessionStorage.removeItem(e)}catch{Uy=!1}return Uy},Gy={name:`sessionStorage`,lookup(e){let{lookupSessionStorage:t}=e;if(t&&Wy())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Wy()&&window.sessionStorage.setItem(n,e)}},Ky={name:`navigator`,lookup(e){let t=[];if(typeof navigator<`u`){let{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},qy={name:`htmlTag`,lookup(e){let{htmlTag:t}=e,n,r=t||(typeof document<`u`?document.documentElement:null);return r&&typeof r.getAttribute==`function`&&(n=r.getAttribute(`lang`)),n}},Jy={name:`path`,lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>`u`)return;let n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Array.isArray(n))return n[typeof t==`number`?t:0]?.replace(`/`,``)}},Yy={name:`subdomain`,lookup(e){let{lookupFromSubdomainIndex:t}=e,n=typeof t==`number`?t+1:1,r=typeof window<`u`&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}},Xy=!1;try{document.cookie,Xy=!0}catch{}var Zy=[`querystring`,`cookie`,`localStorage`,`sessionStorage`,`navigator`,`htmlTag`];Xy||Zy.splice(1,1);var Qy=()=>({order:Zy,lookupQuerystring:`lng`,lookupCookie:`i18next`,lookupLocalStorage:`i18nextLng`,lookupSessionStorage:`i18nextLng`,caches:[`localStorage`],excludeCacheFor:[`cimode`],convertDetectedLanguage:e=>e}),$y=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type=`languageDetector`,this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=My(t,this.options||{},Qy()),typeof this.options.convertDetectedLanguage==`string`&&this.options.convertDetectedLanguage.indexOf(`15897`)>-1&&(this.options.convertDetectedLanguage=e=>e.replace(`-`,`_`)),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Ly),this.addDetector(Ry),this.addDetector(Hy),this.addDetector(Gy),this.addDetector(Ky),this.addDetector(qy),this.addDetector(Jy),this.addDetector(Yy),this.addDetector(zy)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&typeof n==`string`&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>e!=null&&!Ny(e)).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}};$y.type=`languageDetector`;var eb={pages:{popup:`pages.popup`},common:`common`,popover:`popover`,errors:`errors`,iconController:`iconController`,notifications:`notifications`,options:`options`,editor:`editor`},tb={de:`de`,en:`en`,fr:`fr`},nb={[eb.editor]:{toolbar:`Formatierung`,bold:`Fett`,italic:`Kursiv`,underline:`Unterstrichen`,heading:`Überschrift`,bulletList:`Aufzählung`,orderedList:`Nummerierte Liste`,quote:`Zitat`,undo:`Rückgängig`,redo:`Wiederholen`,settings:`Witty-Einstellungen`,closeSettings:`Einstellungen schliessen`,settingsLoading:`Einstellungen werden geladen …`,statusChecking:`Witty prüft den Text …`,statusAlerts_one:`{{count}} Hinweis`,statusAlerts_other:`{{count}} Hinweise`,statusNoAlerts:`Keine Hinweise`,statusUnauthorized:`API-Schlüssel fehlt oder wurde nicht akzeptiert`,statusFailed:`Prüfung fehlgeschlagen`,shortcutHint:`Mit Alt+Umschalt+W öffnest du den Hinweis an der Cursorposition.`},[eb.options]:{languageHeadline:`Sprache und Gender-Formen`,genderedRolesFormat:`Generisches Maskulinum`,genderedRolesFormatHint:`Wie soll Witty mit dem generischen Maskulinum in gegenderten Sprachen umgehen?`,germanGenderEnding:`Deutsche Gender-Endung`,germanGenderEndingHint:`Witty empfiehlt den Gendestern.`,frenchGenderSeparator:`Französisches Gender-Trennzeichen`,frenchGenderSeparatorHint:`Witty empfiehlt den Point médian.`,useApiDefault:`Standard des Servers`,levelOff:`Aus`,levelBasic:`Basis`,levelAdvanced:`Erweitert`,levelLocked:`Immer aktiv`,categoriesFailed:`Kategorien konnten nicht geladen werden.`,helpOwnServer:`Eigenen Server einrichten`,helpWithoutDashboard:`Witty ohne Dashboard betreiben`,helpCentre:`Hilfe-Center`,settingsHeadline:`Witty Einstellungen`,connectionHeadline:`Verbindung`,modeAccount:`Konto (Anmeldung über Dashboard)`,modeApiKey:`API-Schlüssel (ohne Dashboard)`,apiKey:`API-Schlüssel`,apiKeyHint:`Wird als x-key an die NLP-API gesendet. Ein Dashboard wird nicht benötigt.`,apiKeyRequired:`API-Schlüssel ist erforderlich.`,customisationHeadline:`Anpassungen`,orthography:`Rechtschreibprüfung`,llmAlternatives:`KI-Vorschläge`,categoriesHeadline:`Kategorien`,categoriesIntro:`Abgewählte Kategorien werden nicht mehr hervorgehoben.`,orgOverrideNote:`Im Konto-Modus können diese Werte von den Vorgaben deiner Organisation überschrieben werden.`,endpointHeadline:`Eigener Server`,endpointIntro:`Zeigt Witty auf deine eigene Installation. Nur ändern, wenn du weisst, was du tust.`,endpointWarning:`Achtung: Der eingetragene Server erhält jeden Text, den du in Eingabefeldern schreibst. Trage nur eine Installation ein, der du vertraust.`,dashboardUrl:`Dashboard-URL`,apiUrl:`NLP-API-URL`,oauthClientId:`OAuth Client ID`,redirectUriHint:`Registriere diese Redirect-URI im OAuth-Client deines Dashboards:`,save:`Speichern und abmelden`,reset:`Auf Standard zurücksetzen`,saved:`Gespeichert. Du wurdest abgemeldet — bitte erneut anmelden.`,resetDone:`Auf Standard zurückgesetzt. Du wurdest abgemeldet.`,invalidUrl:`Bitte eine https-URL angeben (http nur für localhost).`,clientIdRequired:`OAuth Client ID ist erforderlich.`,signOutNotice:`Beim Wechsel des Servers wirst du abgemeldet: Tokens gelten immer nur für einen Server.`,currentEndpoint:`Aktuell verwendet`},[eb.common]:{buttons:{ok:`Akzeptieren`,cancel:`Abbrechen`},languages:{en_US:`Englisch (🇺🇸 USA)`,en_GB:`Englisch (🇬🇧 Vereinigtes Königreich)`,de_DE:`Deutsch (🇩🇪 Deutschland)`,de_AT:`Deutsch (🇦🇹 Österreich)`,de_CH:`Deutsch (🇨🇭 Schweiz)`,fr_FR:`Französisch (🇫🇷 Frankreich)`,fr_CH:`Französisch (🇨🇭 Schweiz)`}},[eb.pages.popup]:{helpCentre:`Hilfe-Center`,helpSignInFailed:`Hilfe zur Fehlersuche`,extensionSettings:`Erweiterungseinstellungen`,extensionSettingsHint:`Eigener Server, API-Schlüssel und Kategorien`,enableWitty:`Witty aktivieren`,websiteSettings:`Einstellungen für {{domain}}`,developmentSettings:`Entwicklungs-Einstellungen`,spellChecking:`Grammatik & Rechtschreibung`,thanks:`Danke für deinen Beitrag!`,noSupport:`Es tut uns leid! Witty unterstützt diese Webseite noch nicht offiziell.`,vote:`Stimme für diese Webseite ab`,editor:`Nutze stattdessen den Witty Editor`,goToDashboard:`Zum Witty Editor`,overrideRecomendedSites:`Witty hier dennoch aktivieren`,backToRecomendedSites:`Witty nur auf unterstützten Webseiten aktiv`,signedOutText:`Dir entgeht was`,loginToUnlock:`Jetzt anmelden!`,biasDetection:`Erkennung von über 30 Diversitätskategorieren`,inclusiveAlternatives:`Inklusive Alternativvorschläge`,teamFeatures:`Teamfunktionen, inkl. eines geteilten Wörterbuches`,signIn:`Anmelden`,signOut:`Abmelden`,haveAccount:`Hast du schon ein Konto?`,dontHaveAccount:`Hast du noch kein Konto?`,signUp:`Registrieren`,doesWittyWork:`Funktioniert Witty hier?`,doesWittyWorkExplanation:`Lass es uns wissen.`,tryAgain:`Erneut versuchen`,understood:`Verstanden`,websiteSettingsDeactivated:`Du hast uns mitgeteilt, dass Witty auf {{Domain}} nicht funktioniert.`,tryAgainOnThisWebsite:`Erneut auf dieser Website versuchen`,enableWittyFailed:`Currently unable to sync with the Witty Dashboard, try again later.`,lockedInfo:`Diese Funktion wurde von deiner*m Team-Admin gesetzt.`,loggedInTo:`Logged in to`,popupsBlocked:`Popups sind blockiert`,popupsBlockedText:`Um dich anzumelden, kopiere bitte den Link in die Adressleiste deines Browsers.`,copyLink:`Link kopieren`,copiedConfirmation:`URL Kopiert`,signInFailed:`Anmeldung fehlgeschlagen`,signInFailedText:`Die Anmeldung konnte nicht abgeschlossen werden. Bitte versuche es erneut.`,hrFeatures:`Job Ads Add-On`,beta:`Beta`,apiKeyConfiguredNotice:`API Key konfiguriert — keine Anmeldung erforderlich.`,apiKeyAuthFailed:`API Key Authentifizierung fehlgeschlagen ({{status}}): {{message}} — überprüfe den API Key oder Endpunkt.`},[eb.popover]:{insteadTry:`Wie wär's mit ...`,learnMore:`Warum`,leanrMoreExtendedText:`Warum das so ist`,ignoreTerm:`Weniger unterstreichen?`,visitSource:`Quelle`,alertOftotal:`von`,removeSpaces:`Extra Leerzeichen entfernen`,loginToUnlock:`Jetzt anmelden!`,signedOutText:`Dir entgeht was`,biasDetection:`Erkennung von über 30 Diversitätskategorieren`,inclusiveAlternatives:`Inklusive Alternativvorschläge`,teamFeatures:`Teamfunktionen, inkl. eines geteilten Wörterbuches`,signIn:`Anmelden`,haveAccount:`Hast du schon ein Konto?`,dontHaveAccount:`Hast du noch kein Konto?`,signUp:`Registrieren`,popupsBlocked:`Popups sind blockiert`,popupsBlockedText:`Um dich anzumelden, kopiere bitte den Link in die Adressleiste deines Browsers.`,copyLink:`Link kopieren`,copiedConfirmation:`URL Kopiert`,signInFailed:`Anmeldung fehlgeschlagen`,signInFailedText:`Die Anmeldung konnte nicht abgeschlossen werden. Bitte versuche es erneut.`,missingOut:`Du verpasst etwas`,bulletPointOne:`Warum ein Begriff unterstrichen wird`,bulletPointTwo:`Inklusive Alternativen`,inclusiveBulletPointOne:`Warum dieser Begriff inklusiv ist`,inclusiveBulletPointTwo:`Weitere inklusive Begriffe`,wittyLogo:`Witty`,new:`neu`,video:`Ein Erklärungsvideo ist verfügbar`,openNewWindow:`Öffnet in einem neuen Fenster`,next:`Nächstes Ergebnis`,previous:`Vorheriges Ergebnis`,close:`Witty schliessen`,suggestionsDialog:`Witty Vorschläge`,removeText:`Entfernen:`,ignoreOnce:`Einmal ignorieren`,ignorePermanently:`Für immer ignorieren`,failedRequestText:`Bitte erneut probieren`,apiKeyConfiguredNotice:`API Key konfiguriert — keine Anmeldung erforderlich.`,lockedByAdmin:``},[eb.iconController]:{totalMaxCharLengthReachedNotificationHeadline:`Lange Texte`,totalMaxCharLengthReachedNotificationText:`Witty prüft {{limit}} Zeichen auf einmal. Dein Text hat {{total}} Zeichen — markiere weitere Abschnitte, um sie zu prüfen.`},[eb.notifications]:{pinNotificationHeadline:`Pin Witty`,pinNotificationText:`Bitte Witty an die Symbolleiste pinnen.`,totalMaxCharLengthReachedNotificationHeadline:`Lange Texte`,totalMaxCharLengthReachedNotificationText:`Witty prüft {{limit}} Zeichen auf einmal. Dein Text hat {{total}} Zeichen — markiere weitere Abschnitte, um sie zu prüfen.`,updateNotificationHeadline:`Witty wurde aktualisiert`,updateNotificationText:`Witty wurde auf die neuste Version aktualisiert.`,updateNotificationButton:`Änderungen`,minVersionNotInstalledNotificationHeadline:`Du must Witty aktualisieren`,minVersionNotInstalledNotificationText:`Um Witty weiterhin nutzen zu können, müsst Du Witty auf eine neuere Version aktualisieren.`,minVersionNotInstalledNotificationButton:`Aktualisieren`}},rb={[eb.editor]:{toolbar:`Formatting`,bold:`Bold`,italic:`Italic`,underline:`Underline`,heading:`Heading`,bulletList:`Bulleted list`,orderedList:`Numbered list`,quote:`Quote`,undo:`Undo`,redo:`Redo`,settings:`Witty settings`,closeSettings:`Close settings`,settingsLoading:`Loading settings…`,statusChecking:`Witty is checking the text…`,statusAlerts_one:`{{count}} suggestion`,statusAlerts_other:`{{count}} suggestions`,statusNoAlerts:`No suggestions`,statusUnauthorized:`API key missing or not accepted`,statusFailed:`Checking failed`,shortcutHint:`Press Alt+Shift+W to open the suggestion at the cursor.`},[eb.options]:{languageHeadline:`Language and gender forms`,genderedRolesFormat:`Generic masculine`,genderedRolesFormatHint:`How should Witty handle the generic masculine in gendered languages like German or French?`,germanGenderEnding:`German gender ending`,germanGenderEndingHint:`Witty recommends the genderstar.`,frenchGenderSeparator:`French gender separator`,frenchGenderSeparatorHint:`Witty recommends the point médian.`,useApiDefault:`Server default`,levelOff:`Off`,levelBasic:`Basic`,levelAdvanced:`Advanced`,levelLocked:`Always on`,categoriesFailed:`Could not load categories.`,helpOwnServer:`Connect Witty to your own server`,helpWithoutDashboard:`Run Witty without the dashboard`,helpCentre:`Help Center`,settingsHeadline:`Witty settings`,connectionHeadline:`Connection`,modeAccount:`Account (sign in via dashboard)`,modeApiKey:`API key (no dashboard)`,apiKey:`API key`,apiKeyHint:`Sent as x-key to the NLP API. No dashboard required.`,apiKeyRequired:`An API key is required.`,customisationHeadline:`Customisation`,orthography:`Spell checking`,llmAlternatives:`AI suggestions`,categoriesHeadline:`Categories`,categoriesIntro:`Categories you switch off are no longer highlighted.`,orgOverrideNote:`In account mode your organisation settings may override these.`,endpointHeadline:`Custom server`,endpointIntro:`Point Witty at your own deployment. Only change this if you know what you are doing.`,endpointWarning:`Warning: the server you enter receives every text you write in input fields. Only enter a deployment you trust.`,dashboardUrl:`Dashboard URL`,apiUrl:`NLP API URL`,oauthClientId:`OAuth client ID`,redirectUriHint:`Register this redirect URI on your dashboard OAuth client:`,save:`Save and sign out`,reset:`Reset to default`,saved:`Saved. You have been signed out — please sign in again.`,resetDone:`Reset to default. You have been signed out.`,invalidUrl:`Enter an https URL (http is allowed for localhost only).`,clientIdRequired:`OAuth client ID is required.`,signOutNotice:`Changing server signs you out: tokens are only ever valid for one server.`,currentEndpoint:`Currently using`},[eb.common]:{buttons:{ok:`Ok`,cancel:`Cancel`},languages:{en_GB:`English (🇬🇧 Great Britain)`,en_US:`English (🇺🇸 USA)`,de_DE:`German (🇩🇪 Germany)`,de_AT:`German (🇦🇹 Austrian)`,de_CH:`German (🇨🇭 Switzerland)`,fr_FR:`French (🇫🇷 France)`,fr_CH:`French (🇨🇭 Switzerland)`}},[eb.pages.popup]:{helpCentre:`Help Center`,helpSignInFailed:`Troubleshooting help`,extensionSettings:`Extension settings`,extensionSettingsHint:`Custom server, API key and categories`,enableWitty:`Enable Witty`,websiteSettings:`Settings for {{domain}}`,developmentSettings:`Development Settings`,spellChecking:`Check grammar & spelling`,thanks:`Thanks for your feedback!`,noSupport:`We’re sorry! Witty doesn’t yet officially support this website.`,vote:`Vote for this website`,editor:`Use the Witty Editor instead`,goToDashboard:`Go to Witty Editor`,overrideRecomendedSites:`Try Witty here anyway`,backToRecomendedSites:`Use Witty only on supported websites`,loginToUnlock:`Log in now!`,signedOutText:`You are missing out`,biasDetection:`Bias detection in 30+ diversity dimensions`,inclusiveAlternatives:`Alternatives for inclusive writing`,teamFeatures:`Team features, incl. shared dictionaries`,signIn:`Sign In`,signOut:`Sign out`,haveAccount:`Already have an account?`,dontHaveAccount:`Don’t have an account?`,signUp:`Sign up`,doesWittyWork:`Does Witty work here?`,doesWittyWorkExplanation:`Please help us to find out.`,tryAgain:`Try again`,understood:`Understood`,websiteSettingsDeactivated:`You reported that Witty does not work on {{domain}}`,tryAgainOnThisWebsite:`Try again on this website`,enableWittyFailed:`Die Synchronisierung mit Witty Dashboard ist aktuell nicht möglich, versuchen Sie es später noch einmal.`,lockedInfo:`This feature has been locked by your team admin.`,loggedInTo:`Logged in to`,popupsBlocked:`Popups are blocked`,popupsBlockedText:`To log in, please copy and paste the link into your browser's URL bar.`,copyLink:`Copy Link`,copiedConfirmation:`link Copied`,signInFailed:`Sign-in failed`,signInFailedText:`We could not complete the sign-in. Please try again.`,hrFeatures:`Job Ads Add-On`,beta:`Beta`,apiKeyConfiguredNotice:`API key configured — no sign-in required.`,apiKeyAuthFailed:`API key authentication failed ({{status}}): {{message}} — check your API key or endpoint.`},[eb.popover]:{insteadTry:`Try instead ...`,learnMore:`Why`,leanrMoreExtendedText:`Dig deeper`,ignoreTerm:`Highlight less?`,visitSource:`Source`,alertOftotal:`of`,removeSpaces:`(Remove extra spaces)`,loginToUnlock:`Log in now!`,signedOutText:`You are missing out`,biasDetection:`Bias detection in 30+ diversity dimensions`,inclusiveAlternatives:`Alternatives for inclusive writing`,teamFeatures:`Team features, incl. shared dictionaries`,signIn:`Sign In`,haveAccount:`Already have an account?`,dontHaveAccount:`Don’t have an account?`,signUp:`Sign up`,popupsBlocked:`Popups are blocked`,popupsBlockedText:`Please copy and paste the link into your browser URL bar.`,copyLink:`Copy Link`,copiedConfirmation:`link Copied`,signInFailed:`Sign-in failed`,signInFailedText:`We could not complete the sign-in. Please try again.`,missingOut:`You are missing out`,bulletPointOne:`Why this term is biased`,bulletPointTwo:`Inclusive alternatives for this term`,inclusiveBulletPointOne:`Why this term is inclusive`,inclusiveBulletPointTwo:`More inclusive terms`,wittyLogo:`Witty`,new:`new`,video:`A video is available for more learning`,openNewWindow:`Opens in a new window`,next:`Next result`,previous:`Previous result`,close:`Close Witty`,suggestionsDialog:`Witty suggestions`,removeText:`Remove:`,ignoreOnce:`Ignore once`,ignorePermanently:`Ignore permanently`,failedRequestText:`Failed, please try again`,apiKeyConfiguredNotice:`API key configured — no sign-in required.`,lockedByAdmin:``},[eb.errors]:{errorMessageGenericTitle:`Ouch! Something went wrong!`,reloadWebsite:`Please reload the website`},[eb.iconController]:{totalMaxCharLengthReachedNotificationHeadline:`Long texts`,totalMaxCharLengthReachedNotificationText:`Witty checks {{limit}} characters at a time. Your text has {{total}} characters — select further sections to check them.`},[eb.notifications]:{pinNotificationHeadline:`Pin Witty`,pinNotificationText:`Remember to pin Witty to your browser toolbar.`,totalMaxCharLengthReachedNotificationHeadline:`Long texts`,totalMaxCharLengthReachedNotificationText:`Witty checks {{limit}} characters at a time. Your text has {{total}} characters — select further sections to check them.`,updateNotificationHeadline:`Witty was updated`,updateNotificationText:`Witty was updated to the latest version.`,updateNotificationButton:`View changes`,minVersionNotInstalledNotificationHeadline:`You need to update Witty`,minVersionNotInstalledNotificationText:`In order to continue using Witty, you need to update Witty to a newer version.`,minVersionNotInstalledNotificationButton:`How to update`}},ib={[eb.editor]:{toolbar:`Mise en forme`,bold:`Gras`,italic:`Italique`,underline:`Souligné`,heading:`Titre`,bulletList:`Liste à puces`,orderedList:`Liste numérotée`,quote:`Citation`,undo:`Annuler`,redo:`Rétablir`,settings:`Paramètres Witty`,closeSettings:`Fermer les paramètres`,settingsLoading:`Chargement des paramètres…`,statusChecking:`Witty vérifie le texte…`,statusAlerts_one:`{{count}} suggestion`,statusAlerts_other:`{{count}} suggestions`,statusNoAlerts:`Aucune suggestion`,statusUnauthorized:`Clé API manquante ou refusée`,statusFailed:`La vérification a échoué`,shortcutHint:`Appuyez sur Alt+Maj+W pour ouvrir la suggestion à la position du curseur.`},[eb.options]:{languageHeadline:`Langue et formes de genre`,genderedRolesFormat:`Masculin générique`,genderedRolesFormatHint:`Comment Witty doit-il traiter le masculin générique dans les langues genrées ?`,germanGenderEnding:`Terminaison de genre allemande`,germanGenderEndingHint:`Witty recommande le genderstar.`,frenchGenderSeparator:`Séparateur de genre français`,frenchGenderSeparatorHint:`Witty recommande le point médian.`,useApiDefault:`Valeur par défaut du serveur`,levelOff:`Désactivé`,levelBasic:`Base`,levelAdvanced:`Avancé`,levelLocked:`Toujours actif`,categoriesFailed:`Impossible de charger les catégories.`,helpOwnServer:`Connecter Witty à votre propre serveur`,helpWithoutDashboard:`Utiliser Witty sans tableau de bord`,helpCentre:`Centre d’aide`,settingsHeadline:`Paramètres Witty`,connectionHeadline:`Connexion`,modeAccount:`Compte (connexion via le tableau de bord)`,modeApiKey:`Clé API (sans tableau de bord)`,apiKey:`Clé API`,apiKeyHint:`Envoyée comme x-key à l'API NLP. Aucun tableau de bord requis.`,apiKeyRequired:`Une clé API est requise.`,customisationHeadline:`Personnalisation`,orthography:`Correction orthographique`,llmAlternatives:`Suggestions IA`,categoriesHeadline:`Catégories`,categoriesIntro:`Les catégories désactivées ne sont plus mises en évidence.`,orgOverrideNote:`En mode compte, les paramètres de votre organisation peuvent les remplacer.`,endpointHeadline:`Serveur personnalisé`,endpointIntro:`Pointez Witty vers votre propre installation. Ne modifiez ceci que si vous savez ce que vous faites.`,endpointWarning:`Attention : le serveur indiqué reçoit tout texte que vous saisissez dans les champs. N'indiquez qu'une installation de confiance.`,dashboardUrl:`URL du tableau de bord`,apiUrl:`URL de l'API NLP`,oauthClientId:`ID client OAuth`,redirectUriHint:`Enregistrez cette URI de redirection sur le client OAuth de votre tableau de bord :`,save:`Enregistrer et se déconnecter`,reset:`Réinitialiser`,saved:`Enregistré. Vous avez été déconnecté·e — veuillez vous reconnecter.`,resetDone:`Réinitialisé. Vous avez été déconnecté·e.`,invalidUrl:`Indiquez une URL https (http uniquement pour localhost).`,clientIdRequired:`L'ID client OAuth est requis.`,signOutNotice:`Changer de serveur vous déconnecte : les jetons ne sont valables que pour un seul serveur.`,currentEndpoint:`Actuellement utilisé`},[eb.common]:{buttons:{ok:`Ok`,cancel:`Annuler`},languages:{en_US:`Anglais (🇺🇸 USA)`,en_GB:`Anglais (🇬🇧 Royaume-Uni)`,de_DE:`Allemand (🇩🇪 Allemagne)`,de_AT:`Allemand (🇦🇹 Autriche)`,de_CH:`Allemand (🇨🇭 Suisse)`,fr_FR:`Français (🇫🇷 France)`,fr_CH:`Français (🇨🇭 Suisse)`}},[eb.pages.popup]:{helpCentre:`Centre d’aide`,helpSignInFailed:`Aide au dépannage`,extensionSettings:`Paramètres de l’extension`,extensionSettingsHint:`Serveur personnalisé, clé API et catégories`,enableWitty:`Activer Witty`,websiteSettings:`Paramètres pour {{domain}}`,developmentSettings:`Paramètres de développement`,spellChecking:`Vérifier la grammaire et l'orthographe`,thanks:`Merci pour votre retour !`,noSupport:`Nous sommes désolés ! Witty ne prend pas encore officiellement en charge ce site web.`,vote:`Votez pour ce site web`,editor:`Utiliser l'éditeur Witty à la place`,goToDashboard:`Aller à l'éditeur Witty`,overrideRecomendedSites:`Essayer Witty ici quand même`,backToRecomendedSites:`Utiliser Witty uniquement sur les sites pris en charge`,loginToUnlock:`Connectez-vous maintenant !`,signedOutText:`Vous manquez quelque chose`,biasDetection:`Détection des biais dans plus de 30 dimensions de diversité`,inclusiveAlternatives:`Alternatives pour une écriture inclusive`,teamFeatures:`Fonctionnalités d'équipe, y compris des dictionnaires partagés`,signIn:`Se connecter`,signOut:`Se déconnecter`,haveAccount:`Vous avez déjà un compte ?`,dontHaveAccount:`Vous n'avez pas de compte ?`,signUp:`S'inscrire`,doesWittyWork:`Witty fonctionne-t-il ici ?`,doesWittyWorkExplanation:`Aidez-nous à le découvrir, s'il vous plaît.`,tryAgain:`Réessayer`,understood:`Compris`,websiteSettingsDeactivated:`Vous avez signalé que Witty ne fonctionne pas sur {{domain}}`,tryAgainOnThisWebsite:`Réessayez sur ce site web`,enableWittyFailed:`La synchronisation avec le tableau de bord Witty est actuellement impossible, veuillez réessayer plus tard.`,lockedInfo:`Cette fonctionnalité a été verrouillée par votre·e administrateur·trice d'équipe.`,loggedInTo:`Connecté·e à`,popupsBlocked:`Les pop-ups sont bloqués`,popupsBlockedText:`Pour vous connecter, veuillez copier et coller le lien dans la barre d'URL de votre navigateur.`,copyLink:`Copier le lien`,copiedConfirmation:`Lien copié`,signInFailed:`Échec de la connexion`,signInFailedText:`La connexion n'a pas pu aboutir. Veuillez réessayer.`,hrFeatures:`Add-on pour les offres d'emploi`,beta:`Bêta`,apiKeyConfiguredNotice:`Clé API configurée — aucune connexion requise.`,apiKeyAuthFailed:`Échec de l'authentification de la clé API ({{status}}) : {{message}} — vérifiez votre clé API ou le point de terminaison.`},[eb.popover]:{insteadTry:`Essayez plutôt ...`,learnMore:`Pourquoi`,leanrMoreExtendedText:`En savoir plus`,ignoreTerm:`Mettre moins en évidence ?`,visitSource:`Source`,alertOftotal:`de`,removeSpaces:`(Retirer les espaces supplémentaires)`,loginToUnlock:`Connectez-vous maintenant !`,signedOutText:`Vous manquez quelque chose`,biasDetection:`Détection des biais dans plus de 30 dimensions de diversité`,inclusiveAlternatives:`Alternatives pour une écriture inclusive`,teamFeatures:`Fonctionnalités d'équipe, y compris des dictionnaires partagés`,signIn:`Se connecter`,haveAccount:`Vous avez déjà un compte ?`,dontHaveAccount:`Vous n'avez pas de compte ?`,signUp:`S'inscrire`,popupsBlocked:`Les pop-ups sont bloqués`,popupsBlockedText:`Veuillez copier et coller le lien dans la barre d'URL de votre navigateur.`,copyLink:`Copier le lien`,copiedConfirmation:`Lien copié`,signInFailed:`Échec de la connexion`,signInFailedText:`La connexion n'a pas pu aboutir. Veuillez réessayer.`,missingOut:`Vous manquez quelque chose`,bulletPointOne:`Pourquoi ce terme est biaisé`,bulletPointTwo:`Alternatives inclusives pour ce terme`,inclusiveBulletPointOne:`Pourquoi ce terme est inclusif`,inclusiveBulletPointTwo:`Termes plus inclusifs`,wittyLogo:`Witty`,new:`nouveau·elle`,video:`Une vidéo d'explication est disponible`,openNewWindow:`Ouverture dans une nouvelle fenêtre`,next:`Résultat suivant`,previous:`Résultat précédent`,close:`Fermer Witty`,suggestionsDialog:`Suggestions Witty`,removeText:`Supprimer :`,ignoreOnce:`Ignorer une fois`,ignorePermanently:`Ignorer définitivement`,failedRequestText:`Échec, veuillez réessayer`,apiKeyConfiguredNotice:`Clé API configurée — aucune connexion requise.`,lockedByAdmin:``},[eb.errors]:{errorMessageGenericTitle:`Oups ! Quelque chose a mal tourné !`,reloadWebsite:`Veuillez recharger le site web`},[eb.iconController]:{totalMaxCharLengthReachedNotificationHeadline:`Textes longs`,totalMaxCharLengthReachedNotificationText:`Witty vérifie {{limit}} caractères à la fois. Votre texte compte {{total}} caractères — sélectionnez d'autres sections pour les vérifier.`},[eb.notifications]:{pinNotificationHeadline:`Épingler Witty`,pinNotificationText:`N'oubliez pas d'épingler Witty dans la barre d'outils de votre navigateur.`,totalMaxCharLengthReachedNotificationHeadline:`Textes longs`,totalMaxCharLengthReachedNotificationText:`Witty vérifie {{limit}} caractères à la fois. Votre texte compte {{total}} caractères — sélectionnez d'autres sections pour les vérifier.`,updateNotificationHeadline:`Witty a été mis à jour`,updateNotificationText:`Witty a été mis à jour vers la dernière version.`,updateNotificationButton:`Voir les changements`,minVersionNotInstalledNotificationHeadline:`Vous devez mettre à jour Witty`,minVersionNotInstalledNotificationText:`Pour continuer à utiliser Witty, vous devez mettre à jour Witty vers une version plus récente.`,minVersionNotInstalledNotificationButton:`Comment mettre à jour`}},ab={[tb.en]:rb,[tb.de]:nb,[tb.fr]:ib};delete ab.fr;var ob=()=>{ty.isInitialized||ty.use($y).use(Sy).init({detection:{order:[`navigator`]},resources:ab,fallbackLng:`en`})},sb=`v2.4/check`,cb=`v1.0/rephrase`,lb=`v2.0/config-options`,ub=e=>`v2.0/categories?locale=${encodeURIComponent(e)}`,db={Accept:`application/json`,"Content-Type":`application/json`},fb=e=>e.apiKey?{"x-key":e.apiKey}:e.token?{Authorization:`Bearer ${e.token}`}:{},pb=e=>{let{text:t,lang:n=`auto`,id:r,client:i,config:a}=e;return{text:t,lang:n,id:r,client:i,...a===void 0?{}:{config:a},...e.configHash===void 0?{}:{config_hash:e.configHash},...e.organizationConfigHash===void 0?{}:{organization_config_hash:e.organizationConfigHash}}},mb=(e,t)=>({sentence:e.raw,text:t.data.text,start:t.absOffset-e.range[0],gender_separator:t.data.gender_separator,alternatives:t.data.alternatives.filter(e=>!e.remove),lang:t.data.language||`en`}),hb=3e3,gb=e=>{if(!e)return;let t=Object.entries(e).filter(([,e])=>e!==void 0);return t.length?Object.fromEntries(t):void 0},_b=(e,t)=>{if(e?.startsWith(`de`))return t?.german_gender_ending;if(e?.startsWith(`fr`))return t?.french_gender_separator},vb=class extends Error{status;constructor(e,t){super(`check failed: HTTP ${e}${t?`: ${t}`:``}`),this.status=e,this.name=`CheckHttpError`}},yb=async e=>{try{let{detail:t}=await e.json();if(typeof t==`string`)return t;if(Array.isArray(t))return t.map(({loc:e,msg:t})=>[e?.slice(1).join(`.`),t].filter(Boolean).join(`: `)).join(`; `)}catch{}},bb=({endpoint:e,headers:t,lang:n=`auto`,client:r=`witty-editor:${X_}`,id:i=`witty-editor`,config:a})=>async(o,s)=>{let c=gb(a?.()),l=await fetch(`${e}${sb}`,{method:`POST`,signal:s,headers:{...db,...t?await t():{}},body:JSON.stringify(pb({text:o,lang:n,id:i,client:r,config:c}))});if(!l.ok)throw new vb(l.status,await yb(l));return await l.json()};function xb(e){if(e.type===`Sentence`)return e;if(`children`in e&&Array.isArray(e.children))return e.children.find(e=>e.type===`Sentence`)}var Sb=(e,t,n,r)=>`${e}-${t}-${n}-${r}`,Cb=(e,t)=>{if(e===` `)return{text:``,scope:`alert`};let n=e.replace(/\(\(/g,`[`).replace(/\)\)/g,`]`),r=t?.get(n);return r?{text:r,scope:`sentence`}:{text:n,scope:`alert`}},wb;(function(e){e.Document=`Document`,e.DocumentExit=`Document:exit`,e.Paragraph=`Paragraph`,e.ParagraphExit=`Paragraph:exit`,e.BlockQuote=`BlockQuote`,e.BlockQuoteExit=`BlockQuote:exit`,e.ListItem=`ListItem`,e.ListItemExit=`ListItem:exit`,e.List=`List`,e.ListExit=`List:exit`,e.Header=`Header`,e.HeaderExit=`Header:exit`,e.CodeBlock=`CodeBlock`,e.CodeBlockExit=`CodeBlock:exit`,e.HtmlBlock=`HtmlBlock`,e.HtmlBlockExit=`HtmlBlock:exit`,e.HorizontalRule=`HorizontalRule`,e.HorizontalRuleExit=`HorizontalRule:exit`,e.Comment=`Comment`,e.CommentExit=`Comment:exit`,e.ReferenceDef=`ReferenceDef`,e.ReferenceDefExit=`ReferenceDef:exit`,e.Str=`Str`,e.StrExit=`Str:exit`,e.Break=`Break`,e.BreakExit=`Break:exit`,e.Emphasis=`Emphasis`,e.EmphasisExit=`Emphasis:exit`,e.Strong=`Strong`,e.StrongExit=`Strong:exit`,e.Html=`Html`,e.HtmlExit=`Html:exit`,e.Link=`Link`,e.LinkExit=`Link:exit`,e.Image=`Image`,e.ImageExit=`Image:exit`,e.Code=`Code`,e.CodeExit=`Code:exit`,e.Delete=`Delete`,e.DeleteExit=`Delete:exit`,e.Table=`Table`,e.TableExit=`Table:exit`,e.TableRow=`TableRow`,e.TableRowExit=`TableRow:exit`,e.TableCell=`TableCell`,e.TableCellExit=`TableCell:exit`})(wb||={});var Tb=c((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.binarySearch=e.upperBound=e.lowerBound=e.compare=void 0;function t(e,t){return e<t}e.compare=t;function n(e,n,r=t){let i=e.length,a=0;for(;i;){let t=i>>>1,o=a+t;r(n,e[o])?i=t:(a=o+1,i-=t+1)}return a}e.upperBound=n;function r(e,n,r=t){let i=e.length,a=0;for(;i;){let t=i>>>1,o=a+t;r(e[o],n)?(a=o+1,i-=t+1):i=t}return a}e.lowerBound=r;function i(e,n,i=t){let a=r(e,n,i);return a!==e.length&&!i(n,e[a])}e.binarySearch=i})),Eb=c((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StructuredSource=void 0;var t=Tb();e.StructuredSource=class{constructor(e){this.indice=[0];let t=/[\r\n\u2028\u2029]/g,n=e.length;for(t.lastIndex=0;;){let r=t.exec(e);if(!r)break;let i=r.index;e.charCodeAt(i)===13&&e.charCodeAt(i+1)===10&&(i+=1);let a=i+1;if(n<a)break;this.indice.push(a),t.lastIndex=a}}get line(){return this.indice.length}locationToRange(e){return[this.positionToIndex(e.start),this.positionToIndex(e.end)]}rangeToLocation(e){return{start:this.indexToPosition(e[0]),end:this.indexToPosition(e[1])}}positionToIndex(e){return this.indice[e.line-1]+e.column}indexToPosition(e){let n=(0,t.upperBound)(this.indice,e);return{line:n,column:e-this.indice[n-1]}}}}))(),Db=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return n;return-1},Ob=class{index=0;source;textCharacters;sourceNode;contexts=[];consumedContexts=[];contextRanges=[];firstChildPadding;startOffset;constructor(e){if(typeof e==`string`)this.textCharacters=e.split(``),this.source=new Eb.StructuredSource(e),this.startOffset=0,this.firstChildPadding=0;else{this.sourceNode=e,this.startOffset=this.sourceNode.range[0],this.index=this.startOffset;let t=Array.from(Array(this.sourceNode.loc.start.line-1)).fill(`
|
|
132
|
+
`),n=Array.from(Array(this.startOffset-t.length)).fill(`∯`),r=e.raw.split(``);this.textCharacters=[...t,...n,...r],this.source=new Eb.StructuredSource(this.textCharacters.join(``)),this.firstChildPadding=this.sourceNode.children[0]?this.sourceNode.children[0].range[0]-this.startOffset:0}}get length(){return this.textCharacters.length}markContextRange(e){this.contextRanges.push(e)}isInContextRange(){let e=this.offset;return this.contextRanges.some(t=>t[0]<=e&&e<t[1])}enterContext(e){this.contexts.push([e,this.index])}isInContext(e){return e?this.contexts.some(t=>t[0].key===e.key):this.contexts.length>0}leaveContext(e){let t=Db(this.contexts,t=>t[0].key===e.key);if(t!==-1){let e=this.contexts[t];this.contexts.splice(t,1);let n=[e[1],this.index];this.consumedContexts.push({pairMark:e[0],range:[e[1],this.index],loc:this.source.rangeToLocation(n)})}}get offset(){return this.index+this.firstChildPadding}now(){let e=this.offset,t=this.source.indexToPosition(e);return{line:t.line,column:t.column,offset:e}}get hasEnd(){return this.read()===!1}read(e=0){let t=this.offset+e;return t<this.startOffset?!1:0<=t&&t<this.textCharacters.length&&this.textCharacters[t]}readNode(e=0){if(!this.sourceNode)return!1;let t=this.offset+e;if(t<this.startOffset)return!1;let n=this.sourceNode.children.filter(e=>e.range[0]<=t&&t<e.range[1]);return n.length>0&&n[n.length-1]}peek(){this.index+=1}peekNode(e){this.index+=e.range[1]-e.range[0]}seekNext(e){let t=this.now();e.seek(this);let n=this.now();return{value:this.sliceRange(t.offset,n.offset),startPosition:t,endPosition:n}}sliceRange(e,t){return this.textCharacters.slice(e,t).join(``)}},kb=class{test(e){let t=e.read();return t?/[\r\n]/.test(t):!1}seek(e){for(;this.test(e);)e.peek()}},Ab=class{test(e){let t=e.read();return t?/[^\S\n\r]/.test(t):!1}seek(e){for(;this.test(e);)e.peek()}},jb={separatorCharacters:[`.`,`.`,`。`,`?`,`!`,`?`,`!`]},Mb=class{options;separatorCharacters;constructor(e){this.options=e,this.separatorCharacters=e&&e.separatorCharacters?e.separatorCharacters:jb.separatorCharacters}test(e){if(e.isInContext()||e.isInContextRange())return!1;let t=e.read(),n=e.read(1);return!t||!this.separatorCharacters.includes(t)?!1:t!==`.`||!n||/[\s\t\r\n]/.test(n)}seek(e){for(;this.test(e);)e.peek()}},Nb=typeof process==`object`&&process?.env?.DEBUG===`sentence-splitter`;function Pb(e,t){Nb&&console.log(`sentence-splitter: `+e,t)}function Fb(...e){Nb&&console.log(`sentence-splitter: `,...e.map(e=>typeof e==`string`?e.replace(/\n/g,`\\n`):e))}var Ib=class{parsers;markers;constructor(e){this.parsers=e.parsers,this.markers=e.markers}test(e){return!e.hasEnd&&this.parsers.every(t=>!t.test(e))}seek(e){let t=e.readNode();if(!t){for(;this.test(e);)this.markers.forEach(t=>t.mark(e)),e.peek();return}let n=()=>{let n=e.offset;return t.range[0]<=n&&n<t.range[1]};for(;n()&&this.test(e);)Pb(e.offset,e.read()),this.markers.forEach(t=>t.mark(e)),e.peek()}},Lb={ABBREVIATIONS:`Adj.,Adm.,Adv.,Al.,Ala.,Alta.,Apr.,Arc.,Ariz.,Ark.,Art.,Assn.,Asst.,Attys.,Aug.,Ave.,Bart.,Bld.,Bldg.,Blvd.,Brig.,Bros.,Btw.,Cal.,Calif.,Capt.,Cl.,Cmdr.,Co.,Col.,Colo.,Comdr.,Con.,Conn.,Corp.,Cpl.,Cres.,Ct.,D.phil.,Dak.,Dec.,Del.,Dept.,Det.,Dist.,Dr.,Dr.phil.,Dr.philos.,Drs.,E.g.,Ens.,Esp.,Esq.,Etc.,Exp.,Expy.,Ext.,Feb.,Fed.,Fla.,Ft.,Fwy.,Fy.,Ga.,Gen.,Gov.,Hon.,Hosp.,Hr.,Hway.,Hwy.,I.e.,Ia.,Id.,Ida.,Ill.,Inc.,Ind.,Ing.,Insp.,Is.,Jan.,Jr.,Jul.,Jun.,Kan.,Kans.,Ken.,Ky.,La.,Lt.,Ltd.,Maj.,Man.,Mar.,Mass.,May.,Md.,Me.,Med.,Messrs.,Mex.,Mfg.,Mich.,Min.,Minn.,Miss.,Mlle.,Mm.,Mme.,Mo.,Mont.,Mr.,Mrs.,Ms.,Msgr.,Mssrs.,Mt.,Mtn.,Neb.,Nebr.,Nev.,No.,Nos.,Nov.,Nr.,Oct.,Ok.,Okla.,Ont.,Op.,Ord.,Ore.,P.,Pa.,Pd.,Pde.,Penn.,Penna.,Pfc.,Ph.,Ph.d.,Pl.,Plz.,Pp.,Prof.,Pvt.,Que.,Rd.,Rs.,Ref.,Rep.,Reps.,Res.,Rev.,Rt.,Sask.,Sec.,Sen.,Sens.,Sep.,Sept.,Sfc.,Sgt.,Sr.,St.,Supt.,Surg.,Tce.,Tenn.,Tex.,Univ.,Usafa.,U.S.,Ut.,Va.,V.,Ver.,Vs.,Vt.,Wash.,Wis.,Wisc.,Wy.,Wyo.,Yuk.`.split(`,`),PREPOSITIVE_ABBREVIATIONS:`Adm.,Attys.,Brig.,Capt.,Cmdr.,Col.,Cpl.,Det.,Dr.,Gen.,Gov.,Ing.,Lt.,Maj.,Mr.,Mrs.,Ms.,Mt.,Messrs.,Mssrs.,Prof.,Ph.,Rep.,Reps.,Rev.,Sen.,Sens.,Sgt.,St.,Supt.,V.,Vs.`.split(`,`),EXCLAMATION_WORDS:[`!Xũ`,`!Kung`,`ǃʼOǃKung`,`!Xuun`,`!Kung-Ekoka`,`ǃHu`,`ǃKhung`,`ǃKu`,`ǃung`,`ǃXo`,`ǃXû`,`ǃXung`,`ǃXũ`,`!Xun`,`Yahoo!`,`Y!J`,`Yum!`]},Rb=e=>!e||e.length===0?!1:/^\p{Uppercase_Letter}/u.test(e),zb=(e,t)=>e.toLowerCase()===t.toLowerCase(),Bb=e=>/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u.test(e),Vb={language:Lb},Hb=class{options;lang;constructor(e){this.options=e,this.lang=e&&e.language?e.language:Vb.language}getWord(e,t=0){let n=/\s/,r=e.read(-1);if(r&&!n.test(r)&&!Bb(r))return``;let i=``,a=t,o=``;for(;(o=e.read(a))&&!(n.test(o)||Bb(o));)i+=o,a++;return i}getPrevWord(e){let t=/\s/,n=-1,r=``;for(;(r=e.read(n))&&t.test(r);)n--;for(;(r=e.read(n))&&!t.test(r);)n--;return this.getWord(e,n+1)}mark(e){if(e.isInContextRange())return;let t=this.getWord(e);if(t.length===0)return;if(/^([a-zA-Z]\.){3,}$/.test(t)||this.lang.EXCLAMATION_WORDS.some(e=>zb(e,t)))return e.markContextRange([e.offset,e.offset+t.length]);let n=this.lang.PREPOSITIVE_ABBREVIATIONS.some(e=>zb(e,t)),r=/^\d+\.$/.test(t);if(n||r)return e.markContextRange([e.offset,e.offset+t.length]);let i=this.lang.ABBREVIATIONS.some(e=>zb(e,t)),a=this.getPrevWord(e),o=this.getWord(e,t.length+1);(Rb(a)&&/^\p{Uppercase_Letter}\./u.test(t)&&Rb(o)||i&&!Rb(o))&&e.markContextRange([e.offset,e.offset+t.length])}},Ub=[{key:`double quote`,start:`"`,end:`"`},{key:`angled bracket`,start:`[`,end:`]`},{key:`round bracket`,start:`(`,end:`)`},{key:`curly brace`,start:`{`,end:`}`},{key:`かぎ括弧`,start:`「`,end:`」`},{key:`丸括弧`,start:`(`,end:`)`},{key:`二重かぎ括弧`,start:`『`,end:`』`},{key:`波括弧`,start:`{`,end:`}`},{key:`角括弧`,start:`[`,end:`]`},{key:`重角括弧`,start:`〚`,end:`〛`},{key:`隅付き括弧`,start:`【`,end:`】`},{key:`二重隅付き括弧`,start:`《`,end:`》`}],Wb=class{PAIR_MARKS_KEY_Map=new Map(Ub.flatMap(e=>[[e.start,e],[e.end,e]]));mark(e){let t=e.read();if(!t)return;let n=this.PAIR_MARKS_KEY_Map.get(t);n&&(e.isInContext(n)?n.end===t&&(Fb(`PairMaker -> leaveContext: ${t} `),e.leaveContext(n)):n.start===t&&(Fb(`PairMaker -> enterContext: ${t} `),e.enterContext(n)))}},Gb={WhiteSpace:`WhiteSpace`,Punctuation:`Punctuation`,Sentence:`Sentence`,Str:`Str`,PairMark:`PairMark`},Kb=class{sentenceNodeList=[];results=[];source;constructor(e){this.source=new Ob(e)}get current(){return this.sentenceNodeList[this.sentenceNodeList.length-1]}pushNodeToCurrent(e){let t=this.current;t?t.children.push(e):this.results.push(e)}open(e){this.sentenceNodeList.push(e)}isOpened(){return this.sentenceNodeList.length>0}nextLine(e){let{value:t,startPosition:n,endPosition:r}=this.source.seekNext(e);return this.pushNodeToCurrent(Yb(t,n,r)),r}nextSpace(e){let{value:t,startPosition:n,endPosition:r}=this.source.seekNext(e);this.pushNodeToCurrent(Yb(t,n,r))}nextValue(e){let{value:t,startPosition:n,endPosition:r}=this.source.seekNext(e);this.pushNodeToCurrent(Zb(t,n,r))}close(e){let{value:t,startPosition:n,endPosition:r}=this.source.seekNext(e);n.offset!==r.offset&&!/^\s+$/.test(t)&&this.pushNodeToCurrent(Xb(t,n,r));let i=this.sentenceNodeList.pop();if(!i||i.children.length===0)return;let a=i.children[0],o=this.source.now(),s=this.source.sliceRange(a.range[0],o.offset),c=this.source.consumedContexts.sort((e,t)=>e.range[0]-t.range[0]).map(e=>({type:`PairMark`,pairMark:e.pairMark,range:e.range,loc:e.loc}));this.results.push({...i,loc:{start:a.loc.start,end:{line:o.line,column:o.column}},range:[a.range[0],o.offset],raw:s,contexts:c})}toList(){return this.results}},qb=(e={})=>{let t=new kb,n=new Ab,r=new Mb(e.SeparatorParser),i=new Hb(e.AbbrMarker),a=new Wb;return{newLine:t,space:n,separator:r,abbrMarker:i,anyValueParser:new Ib({parsers:[t,r],markers:[i,a]})}};function Jb(e,t){let{newLine:n,space:r,separator:i,anyValueParser:a}=qb(t),o=new Kb(e),s=o.source;for(;!s.hasEnd;)n.test(s)?o.nextLine(n):r.test(s)?o.nextSpace(r):i.test(s)?o.close(i):(o.isOpened()||o.open(Qb()),o.nextValue(a));return o.close(r),o.toList()}function Yb(e,t,n){return{type:Gb.WhiteSpace,raw:e,value:e,loc:{start:{line:t.line,column:t.column},end:{line:n.line,column:n.column}},range:[t.offset,n.offset]}}function Xb(e,t,n){return{type:Gb.Punctuation,raw:e,value:e,loc:{start:{line:t.line,column:t.column},end:{line:n.line,column:n.column}},range:[t.offset,n.offset]}}function Zb(e,t,n){return{type:Gb.Str,raw:e,value:e,loc:{start:{line:t.line,column:t.column},end:{line:n.line,column:n.column}},range:[t.offset,n.offset]}}function Qb(){return{type:Gb.Sentence,raw:``,loc:{start:{column:NaN,line:NaN},end:{column:NaN,line:NaN}},range:[NaN,NaN],children:[],contexts:[]}}var $b=(e,t)=>{let{results:n}=e,r=Jb(t).filter(e=>e.type===Gb.Sentence),i=[];return r.forEach(t=>{let r=t.range[0],a=t.range[1],o=[];n.forEach(n=>{if(n.start>=r&&n.end<=a){let r=n.start-t.range[0],i=n.end-t.range[0],a=xb(t);a&&o.push({id:Sb(n.text,n.category,n.start,n.end),startOffset:r,absOffset:n.start,endOffset:i,popOverIsOpen:!1,data:{language:e.language,gender_separator:e.gender_separator,category:n.category,subcategory:n.subcategory,context:n.context,fullSentence:a,text:n.text,text_id:n.text_id,label:n.label,explanation:n.explanation,alternatives:n.alternatives,gravity:n.gravity,limit_reached:n.limit_reached,source:n.source}})}}),i.push({sentence:t.raw,alerts:o})}),i},ex=`
|
|
133
|
+
|
|
134
|
+
`,tx=`
|
|
135
|
+
`,nx=``,rx=new Set([`codeBlock`]),ix=new Set([`code`]),ax=e=>{let t=``,n=[],r=!1,i=(e,r)=>{if(e){if(r!==null){let i=n[n.length-1];i&&i.textEnd===t.length&&i.pos+(i.textEnd-i.textStart)===r?i.textEnd+=e.length:n.push({textStart:t.length,textEnd:t.length+e.length,pos:r})}t+=e}},a=()=>{t.endsWith(nx)||i(nx,null)};return e.descendants((e,t)=>rx.has(e.type.name)?!1:e.isTextblock?(r&&i(ex,null),r=!0,!0):e.isText?(e.marks.some(e=>ix.has(e.type.name))?a():i(e.text??``,t),!1):e.type.name===`hardBreak`?(i(tx,null),!1):e.isInline&&e.isAtom?(a(),!1):!0),{text:t,segments:n}},ox=(e,t)=>{let n=0,r=e.segments.length-1;for(;n<=r;){let i=n+r>>1,a=e.segments[i];if(t<a.textStart)r=i-1;else if(t>=a.textEnd)n=i+1;else return a}},sx=(e,t,n)=>{if(t<0||n<=t||n>e.text.length)return null;let r=ox(e,t);return!r||n>r.textEnd?null:{from:r.pos+(t-r.textStart),to:r.pos+(n-r.textStart)}},cx=new Yn(`wittyCheck`),lx=({data:e},t,n)=>`${e.category}:${e.text}:${t}:${n}`,ux=({data:e},t)=>[`witty-alert`,`witty-alert--${av(e.gravity,e.subcategory)}`,e.category===`orthography`&&`witty-alert--dotted`,t&&`witty-alert--selected`].filter(Boolean).join(` `),dx=(e,t)=>ys.inline(e.from,e.to,{class:ux(e.detail,e.id===t),"data-alert-id":e.id},{alert:e}),fx=e=>({...e.spec.alert,from:e.from,to:e.to}),px=(e,t,n)=>Ss.create(t,e.find().map(e=>dx(fx(e),n))),mx=e=>(cx.getState(e)?.decorations.find()??[]).map(fx),hx=e=>{let t=[];return e.mapping.maps.forEach((n,r)=>{let i=e.mapping.slice(r+1);n.forEach((e,n,r,a)=>{t.push([i.map(r,-1),i.map(a,1)])})}),t},gx=0,_x=(e,t,n,r,i)=>{let a=new Map;for(let e of r.find()){let t=e.spec.alert;a.set(lx(t.detail,e.from,e.to),t.id)}let o=[];for(let r of e){let e=t.map(r.from,1),s=t.map(r.to,-1);if(n.textBetween(e,s)!==r.detail.data.text)continue;let c=lx(r.detail,e,s),l=a.get(c)??`alert-${gx+=1}`;o.push(dx({...r,id:l,from:e,to:s},i))}return Ss.create(n,o)},vx=(e,t)=>{let n=e.getMeta(cx);if(n?.type===`recheck`)return{...t,recheckRequests:t.recheckRequests+1};if(n?.type===`select`)return{...t,selectedId:n.id,decorations:px(t.decorations,e.doc,n.id)};if(n?.type===`dismiss`)return{...t,decorations:t.decorations.remove(t.decorations.find().filter(e=>fx(e).detail.data.text===n.text))};if(n?.type===`start`)return{...t,pending:{id:n.id,mapping:new Ct}};if(n?.type===`results`)return t.pending?.id===n.id?{...t,decorations:_x(n.alerts,t.pending.mapping,e.doc,t.decorations,t.selectedId),pending:null}:t;if(!e.docChanged)return t;let r=t.decorations.map(e.mapping,e.doc);for(let[t,n]of hx(e)){let e=r.find(t,n).filter(e=>e.from<n&&e.to>t);e.length&&(r=r.remove(e))}return{...t,decorations:r,pending:t.pending&&{id:t.pending.id,mapping:new Ct([...t.pending.mapping.maps,...e.mapping.maps])}}},yx=class{view;options;timer;inFlight;checkId=0;deferredByComposition=!1;destroyed=!1;constructor(e,t){this.view=e,this.options=t,this.schedule()}update(e,t){(e.state.doc!==t.doc||cx.getState(e.state)?.recheckRequests!==cx.getState(t)?.recheckRequests)&&this.schedule()}compositionEnded(){this.deferredByComposition&&(this.deferredByComposition=!1,this.schedule())}schedule(){clearTimeout(this.timer),this.timer=setTimeout(()=>this.run(),this.options.delay)}run(){if(this.destroyed)return;if(this.view.composing){this.deferredByComposition=!0;return}this.inFlight?.abort();let e=new AbortController;this.inFlight=e;let t=this.checkId+=1,{doc:n}=this.view.state,r=ax(n);this.view.dispatch(this.view.state.tr.setMeta(cx,{type:`start`,id:t}).setMeta(`addToHistory`,!1)),(r.text?this.options.check(r.text,e.signal):Promise.resolve({results:[]})).then(n=>{if(e.signal.aborted||this.destroyed)return;let i=[];for(let{alerts:e}of $b(n,r.text))for(let t of e){if(this.options.isIgnored?.(t))continue;let e=t.absOffset,n=e+t.data.text.length,a=sx(r,e,n),o={...t,startOffset:e,endOffset:n};a&&i.push({...a,detail:o})}this.view.dispatch(this.view.state.tr.setMeta(cx,{type:`results`,id:t,alerts:i}).setMeta(`addToHistory`,!1))}).catch(t=>{e.signal.aborted||this.destroyed||this.options.onError?.(t)})}destroy(){this.destroyed=!0,clearTimeout(this.timer),this.inFlight?.abort()}},bx=e=>{let t;return new Kn({key:cx,state:{init:()=>({decorations:Ss.empty,pending:null,recheckRequests:0,selectedId:null}),apply:vx},props:{decorations:e=>cx.getState(e)?.decorations,handleDOMEvents:{compositionend:()=>(setTimeout(()=>t?.compositionEnded()),!1)}},view:n=>(t=new yx(n,e),t)})},xx=e=>e.dispatch(e.state.tr.setMeta(cx,{type:`recheck`}).setMeta(`addToHistory`,!1)),Sx=(e,t)=>e.dispatch(e.state.tr.setMeta(cx,{type:`select`,id:t}).setMeta(`addToHistory`,!1)),Cx=(e,t)=>e.dispatch(e.state.tr.setMeta(cx,{type:`dismiss`,text:t}).setMeta(`addToHistory`,!1)),wx=nf.create({name:`wittyCheck`,addOptions(){return{check:()=>Promise.reject(Error(`WittyCheck: no checker`)),delay:500}},addProseMirrorPlugins(){return[bx(this.options)]}}),Tx=c((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,te());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(ee)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=ee,te=function(){re.postMessage(null)}}else te=function(){_(ee,0)};function ie(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Ex=c(((e,t)=>{t.exports=Tx()})),Dx=c((e=>{var t=ry();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),Ox=c(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Dx()})),kx=c((e=>{var t=Ex(),n=ry(),r=Ox();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.iterator;function ne(e){return typeof e!=`object`||!e?null:(e=te&&e[te]||e[`@@iterator`],typeof e==`function`?e:null)}var re=Symbol.for(`react.client.reference`);function ie(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],ce=-1;function le(e){return{current:e}}function ue(e){0>ce||(e.current=se[ce],se[ce]=null,ce--)}function de(e,t){ce++,se[ce]=e.current,e.current=t}var fe=le(null),pe=le(null),me=le(null),he=le(null);function ge(e,t){switch(de(me,t),de(pe,e),de(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Qd(t),e=$d(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ue(fe),de(fe,e)}function _e(){ue(fe),ue(pe),ue(me)}function ve(e){e.memoizedState!==null&&de(he,e);var t=fe.current,n=$d(t,e.type);t!==n&&(de(pe,e),de(fe,n))}function ye(e){pe.current===e&&(ue(fe),ue(pe)),he.current===e&&(ue(he),lp._currentValue=oe)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
|
|
136
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
137
|
+
`+be+e+xe}var Ce=!1;function we(e,t){if(!e||Ce)return``;Ce=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
138
|
+
`),l=s.split(`
|
|
139
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
140
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
141
|
+
Error generating stack: `+e.message+`
|
|
142
|
+
`+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-We(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&at(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function at(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ot(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function st(e,t){var n=t&-t;return n=n&42?1:ct(n),(n&(e.suspendedLanes|t))===0?n:0}function ct(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function lt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ut(){var e=O.p;return e===0?(e=window.event,e===void 0?32:Cp(e.type)):e}function dt(e,t){var n=O.p;try{return O.p=e,t()}finally{O.p=n}}var ft=Math.random().toString(36).slice(2),pt=`__reactFiber$`+ft,mt=`__reactProps$`+ft,ht=`__reactContainer$`+ft,gt=`__reactEvents$`+ft,_t=`__reactListeners$`+ft,vt=`__reactHandles$`+ft,yt=`__reactResources$`+ft,bt=`__reactMarker$`+ft;function xt(e){delete e[pt],delete e[mt],delete e[gt],delete e[_t],delete e[vt]}function St(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ht]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sf(e);e!==null;){if(n=e[pt])return n;e=Sf(e)}return t}e=n,n=e.parentNode}return null}function Ct(e){if(e=e[pt]||e[ht]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Tt(e){var t=e[yt];return t||=e[yt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function k(e){e[bt]=!0}var Et=new Set,Dt={};function Ot(e,t){kt(e,t),kt(e+`Capture`,t)}function kt(e,t){for(Dt[e]=t,e=0;e<t.length;e++)Et.add(t[e])}var At=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),jt={},Mt={};function Nt(e){return De.call(Mt,e)?!0:De.call(jt,e)?!1:At.test(e)?Mt[e]=!0:(jt[e]=!0,!1)}function Pt(e,t,n){if(Nt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function Ft(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function It(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Lt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Rt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function zt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bt(e){if(!e._valueTracker){var t=Rt(e)?`checked`:`value`;e._valueTracker=zt(e,t,``+e[t])}}function Vt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Rt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Ht(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ut=/[\n"\\]/g;function Wt(e){return e.replace(Ut,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Gt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Lt(t)):e.value!==``+Lt(t)&&(e.value=``+Lt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):qt(e,o,Lt(n)):qt(e,o,Lt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Lt(s):e.removeAttribute(`name`)}function Kt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Bt(e);return}n=n==null?``:``+Lt(n),t=t==null?n:``+Lt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Bt(e)}function qt(e,t,n){t===`number`&&Ht(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Jt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Lt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Yt(e,t,n){if(t!=null&&(t=``+Lt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Lt(n)}function Xt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ae(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Lt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Bt(e)}function Zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qt=new Set(`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 MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function $t(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function en(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&$t(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&$t(e,o,t[o])}function tn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var nn=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`]]),rn=/^[\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;function an(e){return rn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function on(){}var sn=null;function cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ln=null,un=null;function dn(e){var t=Ct(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Gt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Wt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[mt]||null;if(!a)throw Error(i(90));Gt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Vt(r)}break a;case`textarea`:Yt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Jt(e,!!n.multiple,t,!1)}}}var fn=!1;function pn(e,t,n){if(fn)return e(t,n);fn=!0;try{return e(t)}finally{if(fn=!1,(ln!==null||un!==null)&&(Au(),ln&&(t=ln,e=un,un=ln=null,dn(t),e)))for(t=0;t<e.length;t++)dn(e[t])}}function mn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[mt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var hn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,gn=!1;if(hn)try{var _n={};Object.defineProperty(_n,"passive",{get:function(){gn=!0}}),window.addEventListener(`test`,_n,_n),window.removeEventListener(`test`,_n,_n)}catch{gn=!1}var vn=null,yn=null,bn=null;function xn(){if(bn)return bn;var e,t=yn,n=t.length,r,i=`value`in vn?vn.value:vn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return bn=i.slice(e,1<r?1-r:void 0)}function Sn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Cn(){return!0}function wn(){return!1}function Tn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Cn:wn,this.isPropagationStopped=wn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Cn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Cn)},persist:function(){},isPersistent:Cn}),t}var En={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},A=Tn(En),Dn=f({},En,{view:0,detail:0}),On=Tn(Dn),kn,j,An,M=f({},Dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==An&&(An&&e.type===`mousemove`?(kn=e.screenX-An.screenX,j=e.screenY-An.screenY):j=kn=0,An=e),kn)},movementY:function(e){return`movementY`in e?e.movementY:j}}),jn=Tn(M),Mn=Tn(f({},M,{dataTransfer:0})),Nn=Tn(f({},Dn,{relatedTarget:0})),Pn=Tn(f({},En,{animationName:0,elapsedTime:0,pseudoElement:0})),Fn=Tn(f({},En,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),In=Tn(f({},En,{data:0})),Ln={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Rn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Bn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zn[e])?!!t[e]:!1}function Vn(){return Bn}var Hn=Tn(f({},Dn,{key:function(e){if(e.key){var t=Ln[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Sn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Rn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vn,charCode:function(e){return e.type===`keypress`?Sn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Sn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Un=Tn(f({},M,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Wn=Tn(f({},Dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vn})),Gn=Tn(f({},En,{propertyName:0,elapsedTime:0,pseudoElement:0})),Kn=Tn(f({},M,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),qn=Tn(f({},En,{newState:0,oldState:0})),Jn=[9,13,27,32],Yn=hn&&`CompositionEvent`in window,Xn=null;hn&&`documentMode`in document&&(Xn=document.documentMode);var Zn=hn&&`TextEvent`in window&&!Xn,Qn=hn&&(!Yn||Xn&&8<Xn&&11>=Xn),$n=` `,er=!1;function tr(e,t){switch(e){case`keyup`:return Jn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function nr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var rr=!1;function ir(e,t){switch(e){case`compositionend`:return nr(t);case`keypress`:return t.which===32?(er=!0,$n):null;case`textInput`:return e=t.data,e===$n&&er?null:e;default:return null}}function ar(e,t){if(rr)return e===`compositionend`||!Yn&&tr(e,t)?(e=xn(),bn=yn=vn=null,rr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Qn&&t.locale!==`ko`?null:t.data;default:return null}}var or={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!or[e.type]:t===`textarea`}function cr(e,t,n,r){ln?un?un.push(r):un=[r]:ln=r,t=Ld(t,`onChange`),0<t.length&&(n=new A(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var lr=null,ur=null;function dr(e){Ad(e,0)}function fr(e){if(Vt(wt(e)))return e}function pr(e,t){if(e===`change`)return t}var mr=!1;if(hn){var hr;if(hn){var gr=`oninput`in document;if(!gr){var _r=document.createElement(`div`);_r.setAttribute(`oninput`,`return;`),gr=typeof _r.oninput==`function`}hr=gr}else hr=!1;mr=hr&&(!document.documentMode||9<document.documentMode)}function vr(){lr&&(lr.detachEvent(`onpropertychange`,yr),ur=lr=null)}function yr(e){if(e.propertyName===`value`&&fr(ur)){var t=[];cr(t,ur,e,cn(e)),pn(dr,t)}}function br(e,t,n){e===`focusin`?(vr(),lr=t,ur=n,lr.attachEvent(`onpropertychange`,yr)):e===`focusout`&&vr()}function xr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return fr(ur)}function Sr(e,t){if(e===`click`)return fr(t)}function Cr(e,t){if(e===`input`||e===`change`)return fr(t)}function wr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Tr=typeof Object.is==`function`?Object.is:wr;function Er(e,t){if(Tr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!De.call(t,i)||!Tr(e[i],t[i]))return!1}return!0}function Dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Or(e,t){var n=Dr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Dr(n)}}function kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ar(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ht(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ht(e.document)}return t}function jr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Mr=hn&&`documentMode`in document&&11>=document.documentMode,Nr=null,Pr=null,Fr=null,Ir=!1;function Lr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ir||Nr==null||Nr!==Ht(r)||(r=Nr,`selectionStart`in r&&jr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fr&&Er(Fr,r)||(Fr=r,r=Ld(Pr,`onSelect`),0<r.length&&(t=new A(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Nr)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var zr={animationend:Rr(`Animation`,`AnimationEnd`),animationiteration:Rr(`Animation`,`AnimationIteration`),animationstart:Rr(`Animation`,`AnimationStart`),transitionrun:Rr(`Transition`,`TransitionRun`),transitionstart:Rr(`Transition`,`TransitionStart`),transitioncancel:Rr(`Transition`,`TransitionCancel`),transitionend:Rr(`Transition`,`TransitionEnd`)},Br={},Vr={};hn&&(Vr=document.createElement(`div`).style,`AnimationEvent`in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),`TransitionEvent`in window||delete zr.transitionend.transition);function Hr(e){if(Br[e])return Br[e];if(!zr[e])return e;var t=zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vr)return Br[e]=t[n];return e}var Ur=Hr(`animationend`),Wr=Hr(`animationiteration`),Gr=Hr(`animationstart`),Kr=Hr(`transitionrun`),qr=Hr(`transitionstart`),Jr=Hr(`transitioncancel`),Yr=Hr(`transitionend`),Xr=new Map,Zr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Zr.push(`scrollEnd`);function Qr(e,t){Xr.set(e,t),Ot(t,[e])}var $r=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ei=[],ti=0,ni=0;function ri(){for(var e=ti,t=ni=ti=0;t<e;){var n=ei[t];ei[t++]=null;var r=ei[t];ei[t++]=null;var i=ei[t];ei[t++]=null;var a=ei[t];if(ei[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&si(n,i,a)}}function ii(e,t,n,r){ei[ti++]=e,ei[ti++]=t,ei[ti++]=n,ei[ti++]=r,ni|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ai(e,t,n,r){return ii(e,t,n,r),ci(e)}function oi(e,t){return ii(e,null,null,t),ci(e)}function si(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ci(e){if(50<xu)throw xu=0,Su=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var li={};function ui(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function di(e,t,n,r){return new ui(e,t,n,r)}function fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pi(e,t){var n=e.alternate;return n===null?(n=di(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function mi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function hi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)fi(e)&&(s=1);else if(typeof e==`string`)s=ep(e,n,fe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=di(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return gi(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=di(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=di(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=di(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=di(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function gi(e,t,n,r){return e=di(7,e,r,t),e.lanes=n,e}function _i(e,t,n){return e=di(6,e,null,t),e.lanes=n,e}function vi(e){var t=di(18,null,null,0);return t.stateNode=e,t}function yi(e,t,n){return t=di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bi=new WeakMap;function xi(e,t){if(typeof e==`object`&&e){var n=bi.get(e);return n===void 0?(t={value:e,source:t,stack:Ee(t)},bi.set(e,t),t):n}return{value:e,source:t,stack:Ee(t)}}var Si=[],Ci=0,wi=null,Ti=0,Ei=[],Di=0,Oi=null,ki=1,Ai=``;function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=wi,wi=e,Ti=t}function Mi(e,t,n){Ei[Di++]=ki,Ei[Di++]=Ai,Ei[Di++]=Oi,Oi=e;var r=ki;e=Ai;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ki=1<<32-We(t)+i|n<<i|r,Ai=a+e}else ki=1<<a|n<<i|r,Ai=e}function Ni(e){e.return!==null&&(ji(e,1),Mi(e,1,0))}function Pi(e){for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null;for(;e===Oi;)Oi=Ei[--Di],Ei[Di]=null,Ai=Ei[--Di],Ei[Di]=null,ki=Ei[--Di],Ei[Di]=null}function Fi(e,t){Ei[Di++]=ki,Ei[Di++]=Ai,Ei[Di++]=Oi,ki=t.id,Ai=t.overflow,Oi=e}var Ii=null,Li=null,N=!1,Ri=null,zi=!1,Bi=Error(i(519));function Vi(e){throw qi(xi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Bi}function Hi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:z(`cancel`,t),z(`close`,t);break;case`iframe`:case`object`:case`embed`:z(`load`,t);break;case`video`:case`audio`:for(n=0;n<Od.length;n++)z(Od[n],t);break;case`source`:z(`error`,t);break;case`img`:case`image`:case`link`:z(`error`,t),z(`load`,t);break;case`details`:z(`toggle`,t);break;case`input`:z(`invalid`,t),Kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:z(`invalid`,t);break;case`textarea`:z(`invalid`,t),Xt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ud(t.textContent,n)?(r.popover!=null&&(z(`beforetoggle`,t),z(`toggle`,t)),r.onScroll!=null&&z(`scroll`,t),r.onScrollEnd!=null&&z(`scrollend`,t),r.onClick!=null&&(t.onclick=on),t=!0):t=!1,t||Vi(e,!0)}function Ui(e){for(Ii=e.return;Ii;)switch(Ii.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Ii=Ii.return}}function Wi(e){if(e!==Ii)return!1;if(!N)return Ui(e),N=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||ef(e.type,e.memoizedProps)),n=!n),n&&Li&&Vi(e),Ui(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=xf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=xf(e)}else t===27?(t=Li,lf(e.type)?(e=bf,bf=null,Li=e):Li=t):Li=Ii?yf(e.stateNode.nextSibling):null;return!0}function Gi(){Li=Ii=null,N=!1}function Ki(){var e=Ri;return e!==null&&(su===null?su=e:su.push.apply(su,e),Ri=null),e}function qi(e){Ri===null?Ri=[e]:Ri.push(e)}var Ji=le(null),Yi=null,Xi=null;function Zi(e,t,n){de(Ji,t._currentValue),t._currentValue=n}function Qi(e){e._currentValue=Ji.current,ue(Ji)}function $i(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ea(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),$i(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),$i(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ta(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Tr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===he.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[lp]:e.push(lp))}a=a.return}e!==null&&ea(t,e,n,r),t.flags|=262144}function na(e){for(e=e.firstContext;e!==null;){if(!Tr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){Yi=e,Xi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ia(e){return oa(Yi,e)}function aa(e,t){return Yi===null&&ra(e),oa(e,t)}function oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xi===null){if(e===null)throw Error(i(308));Xi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xi=Xi.next=t;return n}var sa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ca=t.unstable_scheduleCallback,la=t.unstable_NormalPriority,ua={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function da(){return{controller:new sa,data:new Map,refCount:0}}function fa(e){e.refCount--,e.refCount===0&&ca(la,function(){e.controller.abort()})}var pa=null,ma=0,ha=0,ga=null;function _a(e,t){if(pa===null){var n=pa=[];ma=0,ha=Sd(),ga={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ma++,t.then(va,va),t}function va(){if(--ma===0&&pa!==null){ga!==null&&(ga.status=`fulfilled`);var e=pa;pa=null,ha=0,ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ya(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ba=D.S;D.S=function(e,t){uu=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&_a(e,t),ba!==null&&ba(e,t)};var xa=le(null);function Sa(){var e=xa.current;return e===null?ql.pooledCache:e}function Ca(e,t){t===null?de(xa,xa.current):de(xa,t.pool)}function wa(){var e=Sa();return e===null?null:{parent:ua._currentValue,pool:e}}var Ta=Error(i(460)),Ea=Error(i(474)),Da=Error(i(542)),Oa={then:function(){}};function ka(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Aa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(on,on),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Pa(e),e;default:if(typeof t.status==`string`)t.then(on,on);else{if(e=ql,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Pa(e),e}throw Ma=t,Ta}}function ja(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ma=e,Ta):e}}var Ma=null;function Na(){if(Ma===null)throw Error(i(459));var e=Ma;return Ma=null,e}function Pa(e){if(e===Ta||e===Da)throw Error(i(483))}var Fa=null,Ia=0;function La(e){var t=Ia;return Ia+=1,Fa===null&&(Fa=[]),Aa(Fa,e,t)}function Ra(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function za(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ba(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=pi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=_i(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&ja(i)===t.type)?(t=a(t,n.props),Ra(t,n),t.return=e,t):(t=hi(n.type,n.key,n.props,null,e.mode,r),Ra(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=yi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=gi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=_i(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=hi(t.type,t.key,t.props,null,e.mode,n),Ra(n,t),n.return=e,n;case h:return t=yi(t,e.mode,n),t.return=e,t;case T:return t=ja(t),f(e,t,n)}if(ae(t)||ne(t))return t=gi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,La(t),n);if(t.$$typeof===b)return f(e,aa(e,t),n);za(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=ja(n),p(e,t,n,r)}if(ae(n)||ne(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,La(n),r);if(n.$$typeof===b)return p(e,t,aa(e,n),r);za(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=ja(r),_(e,t,n,r,i)}if(ae(r)||ne(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,La(r),i);if(r.$$typeof===b)return _(e,t,n,aa(t,r),i);za(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),N&&ji(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return N&&ji(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),N&&ji(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),N&&ji(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return N&&ji(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),N&&ji(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&ja(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ra(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===g?(c=gi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=hi(o.type,o.key,o.props,null,e.mode,c),Ra(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=yi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=ja(o),x(e,r,o,c)}if(ae(o))return v(e,r,o,c);if(ne(o)){if(l=ne(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,La(o),c);if(o.$$typeof===b)return x(e,r,aa(e,o),c);za(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=_i(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ia=0;var i=x(e,t,n,r);return Fa=null,i}catch(t){if(t===Ta||t===Da)throw t;var a=di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Va=Ba(!0),Ha=Ba(!1),Ua=!1;function Wa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ga(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,I&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ci(e),si(e,null,n),t}return ii(e,r,t,n),ci(e)}function Ja(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}function Ya(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xa=!1;function Za(){if(Xa){var e=ga;if(e!==null)throw e}}function Qa(e,t,n,r){Xa=!1;var i=e.updateQueue;Ua=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(R&p)===p:(r&p)===p){p!==0&&p===ha&&(Xa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ua=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),tu|=o,e.lanes=o,e.memoizedState=d}}function $a(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)$a(n[e],t)}var to=le(null),no=le(0);function ro(e,t){e=$l,de(no,e),de(to,t),$l=e|t.baseLanes}function io(){de(no,$l),de(to,to.current)}function ao(){$l=no.current,ue(to),ue(no)}var oo=le(null),so=null;function co(e){var t=e.alternate;de(mo,mo.current&1),de(oo,e),so===null&&(t===null||to.current!==null||t.memoizedState!==null)&&(so=e)}function lo(e){de(mo,mo.current),de(oo,e),so===null&&(so=e)}function uo(e){e.tag===22?(de(mo,mo.current),de(oo,e),so===null&&(so=e)):fo(e)}function fo(){de(mo,mo.current),de(oo,oo.current)}function po(e){ue(oo),so===e&&(so=null),ue(mo)}var mo=le(0);function ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gf(n)||_f(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var go=0,P=null,_o=null,vo=null,yo=!1,bo=!1,xo=!1,So=0,Co=0,wo=null,To=0;function Eo(){throw Error(i(321))}function Do(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tr(e[n],t[n]))return!1;return!0}function Oo(e,t,n,r,i,a){return go=a,P=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?Ks:qs,xo=!1,a=n(r,i),xo=!1,bo&&(a=Ao(t,n,r,i)),ko(e),a}function ko(e){D.H=Gs;var t=_o!==null&&_o.next!==null;if(go=0,vo=_o=P=null,yo=!1,Co=0,wo=null,t)throw Error(i(300));e===null||uc||(e=e.dependencies,e!==null&&na(e)&&(uc=!0))}function Ao(e,t,n,r){P=e;var a=0;do{if(bo&&(wo=null),Co=0,bo=!1,25<=a)throw Error(i(301));if(a+=1,vo=_o=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}D.H=Js,o=t(n,r)}while(bo);return o}function jo(){var e=D.H,t=e.useState()[0];return t=typeof t.then==`function`?Ro(t):t,e=e.useState()[0],(_o===null?null:_o.memoizedState)!==e&&(P.flags|=1024),t}function Mo(){var e=So!==0;return So=0,e}function No(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Po(e){if(yo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}yo=!1}go=0,vo=_o=P=null,bo=!1,Co=So=0,wo=null}function Fo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vo===null?P.memoizedState=vo=e:vo=vo.next=e,vo}function Io(){if(_o===null){var e=P.alternate;e=e===null?null:e.memoizedState}else e=_o.next;var t=vo===null?P.memoizedState:vo.next;if(t!==null)vo=t,_o=e;else{if(e===null)throw P.alternate===null?Error(i(467)):Error(i(310));_o=e,e={memoizedState:_o.memoizedState,baseState:_o.baseState,baseQueue:_o.baseQueue,queue:_o.queue,next:null},vo===null?P.memoizedState=vo=e:vo=vo.next=e}return vo}function Lo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ro(e){var t=Co;return Co+=1,wo===null&&(wo=[]),e=Aa(wo,e,t),t=P,(vo===null?t.memoizedState:vo.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?Ks:qs),e}function zo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ro(e);if(e.$$typeof===b)return ia(e)}throw Error(i(438,String(e)))}function Bo(e){var t=null,n=P.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=P.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Lo(),P.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ee;return t.index++,n}function Vo(e,t){return typeof t==`function`?t(e):t}function Ho(e){return Uo(Io(),_o,e)}function Uo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(go&f)===f:(R&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ha&&(d=!0);else if((go&p)===p){u=u.next,p===ha&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,P.lanes|=p,tu|=p;f=u.action,xo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,P.lanes|=f,tu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Tr(o,e.memoizedState)&&(uc=!0,d&&(n=ga,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Wo(e){var t=Io(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Tr(o,t.memoizedState)||(uc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Go(e,t,n){var r=P,a=Io(),o=N;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Tr((_o||a).memoizedState,n);if(s&&(a.memoizedState=n,uc=!0),a=a.queue,_s(Jo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||vo!==null&&vo.memoizedState.tag&1){if(r.flags|=2048,fs(9,{destroy:void 0},qo.bind(null,r,a,n,t),null),ql===null)throw Error(i(349));o||go&127||Ko(r,t,n)}return n}function Ko(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=P.updateQueue,t===null?(t=Lo(),P.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qo(e,t,n,r){t.value=n,t.getSnapshot=r,Yo(t)&&Xo(e)}function Jo(e,t,n){return n(function(){Yo(t)&&Xo(e)})}function Yo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tr(e,n)}catch{return!0}}function Xo(e){var t=oi(e,2);t!==null&&Tu(t,e,2)}function Zo(e){var t=Fo();if(typeof e==`function`){var n=e;if(e=n(),xo){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:e},t}function Qo(e,t,n,r){return e.baseState=n,Uo(e,_o,typeof r==`function`?r:Vo)}function $o(e,t,n,r,a){if(Hs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};D.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=D.T,o={};D.T=o;try{var s=n(i,r),c=D.S;c!==null&&c(o,s),ts(e,t,s)}catch(n){rs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),D.T=a}}else try{a=n(i,r),ts(e,t,a)}catch(n){rs(e,t,n)}}function ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ns(e,t,n)},function(n){return rs(e,t,n)}):ns(e,t,n)}function ns(e,t,n){t.status=`fulfilled`,t.value=n,is(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,es(e,n)))}function rs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,is(t),t=t.next;while(t!==r)}e.action=null}function is(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function as(e,t){return t}function ss(e,t){if(N){var n=ql.formState;if(n!==null){a:{var r=P;if(N){if(Li){b:{for(var i=Li,a=zi;i.nodeType!==8;){if(!a){i=null;break b}if(i=yf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Li=yf(i.nextSibling),r=i.data===`F!`;break a}}Vi(r)}r=!1}r&&(t=n[0])}}return n=Fo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:t},n.queue=r,n=zs.bind(null,P,r),r.dispatch=n,r=Zo(!1),a=Vs.bind(null,P,!1,r.queue),r=Fo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=$o.bind(null,P,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function cs(e){return ls(Io(),_o,e)}function ls(e,t,n){if(t=Uo(e,t,as)[0],e=Ho(Vo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ro(t)}catch(e){throw e===Ta?Da:e}else r=t;t=Io();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(P.flags|=2048,fs(9,{destroy:void 0},us.bind(null,i,n),null)),[r,a,e]}function us(e,t){e.action=t}function ds(e){var t=Io(),n=_o;if(n!==null)return ls(t,n,e);Io(),t=t.memoizedState,n=Io();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=P.updateQueue,t===null&&(t=Lo(),P.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ps(){return Io().memoizedState}function ms(e,t,n,r){var i=Fo();P.flags|=e,i.memoizedState=fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function hs(e,t,n,r){var i=Io();r=r===void 0?null:r;var a=i.memoizedState.inst;_o!==null&&r!==null&&Do(r,_o.memoizedState.deps)?i.memoizedState=fs(t,a,n,r):(P.flags|=e,i.memoizedState=fs(1|t,a,n,r))}function gs(e,t){ms(8390656,8,e,t)}function _s(e,t){hs(2048,8,e,t)}function vs(e){P.flags|=4;var t=P.updateQueue;if(t===null)t=Lo(),P.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ys(e){var t=Io().memoizedState;return vs({ref:t,nextImpl:e}),function(){if(I&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function bs(e,t){return hs(4,2,e,t)}function xs(e,t){return hs(4,4,e,t)}function Ss(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Cs(e,t,n){n=n==null?null:n.concat([e]),hs(4,4,Ss.bind(null,t,e),n)}function ws(){}function Ts(e,t){var n=Io();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Do(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Es(e,t){var n=Io();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Do(t,r[1]))return r[0];if(r=e(),xo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function Ds(e,t,n){return n===void 0||go&1073741824&&!(R&261930)?e.memoizedState=t:(e.memoizedState=n,e=wu(),P.lanes|=e,tu|=e,n)}function Os(e,t,n,r){return Tr(n,t)?n:to.current===null?!(go&42)||go&1073741824&&!(R&261930)?(uc=!0,e.memoizedState=n):(e=wu(),P.lanes|=e,tu|=e,t):(e=Ds(e,n,r),Tr(e,t)||(uc=!0),e)}function ks(e,t,n,r,i){var a=O.p;O.p=a!==0&&8>a?a:8;var o=D.T,s={};D.T=s,Vs(e,!1,t,n);try{var c=i(),l=D.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Bs(e,t,ya(c,r),Cu(e)):Bs(e,t,r,Cu(e))}catch(n){Bs(e,t,{then:function(){},status:`rejected`,reason:n},Cu())}finally{O.p=a,o!==null&&s.types!==null&&(o.types=s.types),D.T=o}}function As(){}function js(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ms(e).queue;ks(e,a,t,oe,n===null?As:function(){return Ns(e),n(r)})}function Ms(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ns(e){var t=Ms(e);t.next===null&&(t=e.alternate.memoizedState),Bs(e,t.next.queue,{},Cu())}function Ps(){return ia(lp)}function Fs(){return Io().memoizedState}function Is(){return Io().memoizedState}function Ls(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cu();e=Ka(n);var r=qa(t,e,n);r!==null&&(Tu(r,t,n),Ja(r,t,n)),t={cache:da()},e.payload=t;return}t=t.return}}function Rs(e,t,n){var r=Cu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Hs(e)?Us(t,n):(n=ai(e,t,n,r),n!==null&&(Tu(n,e,r),Ws(n,t,r)))}function zs(e,t,n){Bs(e,t,n,Cu())}function Bs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Hs(e))Us(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Tr(s,o))return ii(e,t,i,0),ql===null&&ri(),!1}catch{}if(n=ai(e,t,i,r),n!==null)return Tu(n,e,r),Ws(n,t,r),!0}return!1}function Vs(e,t,n,r){if(r={lane:2,revertLane:Sd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Hs(e)){if(t)throw Error(i(479))}else t=ai(e,n,r,2),t!==null&&Tu(t,e,2)}function Hs(e){var t=e.alternate;return e===P||t!==null&&t===P}function Us(e,t){bo=yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ws(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Gs={readContext:ia,use:zo,useCallback:Eo,useContext:Eo,useEffect:Eo,useImperativeHandle:Eo,useLayoutEffect:Eo,useInsertionEffect:Eo,useMemo:Eo,useReducer:Eo,useRef:Eo,useState:Eo,useDebugValue:Eo,useDeferredValue:Eo,useTransition:Eo,useSyncExternalStore:Eo,useId:Eo,useHostTransitionStatus:Eo,useFormState:Eo,useActionState:Eo,useOptimistic:Eo,useMemoCache:Eo,useCacheRefresh:Eo};Gs.useEffectEvent=Eo;var Ks={readContext:ia,use:zo,useCallback:function(e,t){return Fo().memoizedState=[e,t===void 0?null:t],e},useContext:ia,useEffect:gs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ms(4194308,4,Ss.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ms(4194308,4,e,t)},useInsertionEffect:function(e,t){ms(4,2,e,t)},useMemo:function(e,t){var n=Fo();t=t===void 0?null:t;var r=e();if(xo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Fo();if(n!==void 0){var i=n(t);if(xo){Ue(!0);try{n(t)}finally{Ue(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Rs.bind(null,P,e),[r.memoizedState,e]},useRef:function(e){var t=Fo();return e={current:e},t.memoizedState=e},useState:function(e){e=Zo(e);var t=e.queue,n=zs.bind(null,P,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ws,useDeferredValue:function(e,t){return Ds(Fo(),e,t)},useTransition:function(){var e=Zo(!1);return e=ks.bind(null,P,e.queue,!0,!1),Fo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=P,a=Fo();if(N){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ql===null)throw Error(i(349));R&127||Ko(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,gs(Jo.bind(null,r,o,e),[e]),r.flags|=2048,fs(9,{destroy:void 0},qo.bind(null,r,o,n,t),null),n},useId:function(){var e=Fo(),t=ql.identifierPrefix;if(N){var n=Ai,r=ki;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=So++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=To++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ps,useFormState:ss,useActionState:ss,useOptimistic:function(e){var t=Fo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Vs.bind(null,P,!0,n),n.dispatch=t,[e,t]},useMemoCache:Bo,useCacheRefresh:function(){return Fo().memoizedState=Ls.bind(null,P)},useEffectEvent:function(e){var t=Fo(),n={impl:e};return t.memoizedState=n,function(){if(I&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},qs={readContext:ia,use:zo,useCallback:Ts,useContext:ia,useEffect:_s,useImperativeHandle:Cs,useInsertionEffect:bs,useLayoutEffect:xs,useMemo:Es,useReducer:Ho,useRef:ps,useState:function(){return Ho(Vo)},useDebugValue:ws,useDeferredValue:function(e,t){return Os(Io(),_o.memoizedState,e,t)},useTransition:function(){var e=Ho(Vo)[0],t=Io().memoizedState;return[typeof e==`boolean`?e:Ro(e),t]},useSyncExternalStore:Go,useId:Fs,useHostTransitionStatus:Ps,useFormState:cs,useActionState:cs,useOptimistic:function(e,t){return Qo(Io(),_o,e,t)},useMemoCache:Bo,useCacheRefresh:Is};qs.useEffectEvent=ys;var Js={readContext:ia,use:zo,useCallback:Ts,useContext:ia,useEffect:_s,useImperativeHandle:Cs,useInsertionEffect:bs,useLayoutEffect:xs,useMemo:Es,useReducer:Wo,useRef:ps,useState:function(){return Wo(Vo)},useDebugValue:ws,useDeferredValue:function(e,t){var n=Io();return _o===null?Ds(n,e,t):Os(n,_o.memoizedState,e,t)},useTransition:function(){var e=Wo(Vo)[0],t=Io().memoizedState;return[typeof e==`boolean`?e:Ro(e),t]},useSyncExternalStore:Go,useId:Fs,useHostTransitionStatus:Ps,useFormState:ds,useActionState:ds,useOptimistic:function(e,t){var n=Io();return _o===null?(n.baseState=e,[e,n.queue.dispatch]):Qo(n,_o,e,t)},useMemoCache:Bo,useCacheRefresh:Is};Js.useEffectEvent=ys;function Ys(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Ka(r);i.payload=t,n!=null&&(i.callback=n),t=qa(e,i,r),t!==null&&(Tu(t,e,r),Ja(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Ka(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=qa(e,i,r),t!==null&&(Tu(t,e,r),Ja(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Cu(),r=Ka(n);r.tag=2,t!=null&&(r.callback=t),t=qa(e,r,n),t!==null&&(Tu(t,e,n),Ja(t,e,n))}};function Zs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Er(n,r)||!Er(i,a):!0}function Qs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Xs.enqueueReplaceState(t,t.state,null)}function $s(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function ec(e){$r(e)}function tc(e){console.error(e)}function nc(e){$r(e)}function rc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function ic(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ac(e,t,n){return n=Ka(n),n.tag=3,n.payload={element:null},n.callback=function(){rc(e,t)},n}function oc(e){return e=Ka(e),e.tag=3,e}function sc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){ic(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){ic(t,n,r),typeof i!=`function`&&(pu===null?pu=new Set([this]):pu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function cc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ta(t,n,a,!0),n=oo.current,n!==null){switch(n.tag){case 31:case 13:return so===null?Lu():n.alternate===null&&eu===0&&(eu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Oa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),nd(e,r,a)),!1;case 22:return n.flags|=65536,r===Oa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),nd(e,r,a)),!1}throw Error(i(435,n.tag))}return nd(e,r,a),Lu(),!1}if(N)return t=oo.current,t===null?(r!==Bi&&(t=Error(i(423),{cause:r}),qi(xi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=xi(r,n),a=ac(e.stateNode,r,a),Ya(e,a),eu!==4&&(eu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Bi&&(e=Error(i(422),{cause:r}),qi(xi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=xi(o,n),ou===null?ou=[o]:ou.push(o),eu!==4&&(eu=2),t===null)return!0;r=xi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ac(n.stateNode,r,e),Ya(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(pu===null||!pu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=oc(a),sc(a,e,n,r),Ya(n,a),!1}n=n.return}while(n!==null);return!1}var lc=Error(i(461)),uc=!1;function dc(e,t,n,r){t.child=e===null?Ha(t,null,n,r):Va(t,e.child,n,r)}function fc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ra(t),r=Oo(e,t,n,o,a,i),s=Mo(),e!==null&&!uc?(No(e,t,i),Ic(e,t,i)):(N&&s&&Ni(t),t.flags|=1,dc(e,t,r,i),t.child)}function pc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,mc(e,t,a,r,i)):(e=hi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Lc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Er:n,n(o,r)&&e.ref===t.ref)return Ic(e,t,i)}return t.flags|=1,e=pi(a,r),e.ref=t.ref,e.return=t,t.child=e}function mc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Er(a,r)&&e.ref===t.ref){if(uc=!1,t.pendingProps=r=a,Lc(e,i))e.flags&131072&&(uc=!0);else return t.lanes=e.lanes,Ic(e,t,i)}}return Sc(e,t,n,r,i)}function hc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return _c(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ca(t,a===null?null:a.cachePool),a===null?io():ro(t,a),uo(t);else return r=t.lanes=536870912,_c(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ca(t,null),io(),fo(t)):(Ca(t,a.cachePool),ro(t,a),fo(t),t.memoizedState=null);return dc(e,t,i,n),t.child}function gc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function _c(e,t,n,r,i){var a=Sa();return a=a===null?null:{parent:ua._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ca(t,null),io(),uo(t),e!==null&&ta(e,t,r,!0),t.childLanes=i,null}function vc(e,t){return t=jc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function yc(e,t,n){return Va(t,e.child,null,n),e=vc(t,t.pendingProps),e.flags|=2,po(t),t.memoizedState=null,e}function bc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(N){if(r.mode===`hidden`)return e=vc(t,r),t.lanes=536870912,gc(null,e);if(lo(t),(e=Li)?(e=hf(e,zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oi===null?null:{id:ki,overflow:Ai},retryLane:536870912,hydrationErrors:null},n=vi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Vi(t);return t.lanes=536870912,null}return vc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(lo(t),a){if(t.flags&256)t.flags&=-257,t=yc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(uc||ta(e,t,n,!1),a=(n&e.childLanes)!==0,uc||a){if(r=ql,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,oi(e,s),Tu(r,e,s),lc;Lu(),t=yc(e,t,n)}else e=o.treeContext,Li=yf(s.nextSibling),Ii=t,N=!0,Ri=null,zi=!1,e!==null&&Fi(t,e),t=vc(t,r),t.flags|=4096;return t}return e=pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Sc(e,t,n,r,i){return ra(t),n=Oo(e,t,n,r,void 0,i),r=Mo(),e!==null&&!uc?(No(e,t,i),Ic(e,t,i)):(N&&r&&Ni(t),t.flags|=1,dc(e,t,n,i),t.child)}function Cc(e,t,n,r,i,a){return ra(t),t.updateQueue=null,n=Ao(t,r,n,i),ko(e),r=Mo(),e!==null&&!uc?(No(e,t,a),Ic(e,t,a)):(N&&r&&Ni(t),t.flags|=1,dc(e,t,n,a),t.child)}function wc(e,t,n,r,i){if(ra(t),t.stateNode===null){var a=li,o=n.contextType;typeof o==`object`&&o&&(a=ia(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Xs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Wa(t),o=n.contextType,a.context=typeof o==`object`&&o?ia(o):li,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ys(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Xs.enqueueReplaceState(a,a.state,null),Qa(t,r,a,i),Za(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=$s(n,s);a.props=c;var l=a.context,u=n.contextType;o=li,typeof u==`object`&&u&&(o=ia(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Qs(t,a,r,o),Ua=!1;var f=t.memoizedState;a.state=f,Qa(t,r,a,i),Za(),l=t.memoizedState,s||f!==l||Ua?(typeof d==`function`&&(Ys(t,n,d,r),l=t.memoizedState),(c=Ua||Zs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ga(e,t),o=t.memoizedProps,u=$s(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=li,typeof l==`object`&&l&&(c=ia(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Qs(t,a,r,c),Ua=!1,f=t.memoizedState,a.state=f,Qa(t,r,a,i),Za();var p=t.memoizedState;o!==d||f!==p||Ua||e!==null&&e.dependencies!==null&&na(e.dependencies)?(typeof s==`function`&&(Ys(t,n,s,r),p=t.memoizedState),(u=Ua||Zs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&na(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,xc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Va(t,e.child,null,i),t.child=Va(t,null,n,i)):dc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ic(e,t,i),e}function Tc(e,t,n,r){return Gi(),t.flags|=256,dc(e,t,n,r),t.child}var Ec={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dc(e){return{baseLanes:e,cachePool:wa()}}function Oc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=iu),e}function kc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(mo.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(N){if(a?co(t):fo(t),(e=Li)?(e=hf(e,zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oi===null?null:{id:ki,overflow:Ai},retryLane:536870912,hydrationErrors:null},n=vi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Vi(t);return _f(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(fo(t),a=t.mode,c=jc({mode:`hidden`,children:c},a),r=gi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Dc(n),r.childLanes=Oc(e,s,n),t.memoizedState=Ec,gc(null,r)):(co(t),Ac(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(co(t),t.flags&=-257,t=Mc(e,t,n)):t.memoizedState===null?(fo(t),c=r.fallback,a=t.mode,r=jc({mode:`visible`,children:r.children},a),c=gi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Va(t,e.child,null,n),r=t.child,r.memoizedState=Dc(n),r.childLanes=Oc(e,s,n),t.memoizedState=Ec,t=gc(null,r)):(fo(t),t.child=e.child,t.flags|=128,t=null);else if(co(t),_f(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,qi({value:r,source:null,stack:null}),t=Mc(e,t,n)}else if(uc||ta(e,t,n,!1),s=(n&e.childLanes)!==0,uc||s){if(s=ql,s!==null&&(r=st(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,oi(e,r),Tu(s,e,r),lc;gf(c)||Lu(),t=Mc(e,t,n)}else gf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Li=yf(c.nextSibling),Ii=t,N=!0,Ri=null,zi=!1,e!==null&&Fi(t,e),t=Ac(t,r.children),t.flags|=4096);return t}return a?(fo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=pi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=gi(c,a,n,null),c.flags|=2):c=pi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,gc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Dc(n):(a=c.cachePool,a===null?a=wa():(l=ua._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Oc(e,s,n),t.memoizedState=Ec,gc(e.child,r)):(co(t),n=e.child,e=n.sibling,n=pi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Ac(e,t){return t=jc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function jc(e,t){return e=di(22,e,null,t),e.lanes=0,e}function Mc(e,t,n){return Va(t,e.child,null,n),e=Ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Nc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$i(e.return,t,n)}function Pc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Fc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=mo.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,de(mo,o),dc(e,t,r,n),r=N?Ti:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nc(e,n,t);else if(e.tag===19)Nc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ho(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Pc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Pc(t,!0,n,null,a,r);break;case`together`:Pc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ic(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),tu|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Lc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&na(e)))}function Rc(e,t,n){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Zi(t,ua,e.memoizedState.cache),Gi();break;case 27:case 5:ve(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:Zi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,lo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(co(t),e=Ic(e,t,n),e===null?null:e.sibling):kc(e,t,n):(co(t),t.flags|=128,null);co(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Fc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),de(mo,mo.current),r)break;return null;case 22:return t.lanes=0,hc(e,t,n,t.pendingProps);case 24:Zi(t,ua,e.memoizedState.cache)}return Ic(e,t,n)}function zc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)uc=!0;else{if(!Lc(e,n)&&!(t.flags&128))return uc=!1,Rc(e,t,n);uc=!!(e.flags&131072)}}else uc=!1,N&&t.flags&1048576&&Mi(t,Ti,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ja(t.elementType),t.type=e,typeof e==`function`)fi(e)?(r=$s(e,r),t.tag=1,t=wc(null,t,e,r,n)):(t.tag=0,t=Sc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=fc(null,t,e,r,n);break a}if(a===w){t.tag=14,t=pc(null,t,e,r,n);break a}}throw t=ie(e)||e,Error(i(306,t,``))}}return t;case 0:return Sc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=$s(r,t.pendingProps),wc(e,t,r,a,n);case 3:a:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ga(e,t),Qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Zi(t,ua,r),r!==o.cache&&ea(t,[ua],n,!0),Za(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Tc(e,t,r,n);break a}if(r!==a){a=xi(Error(i(424)),t),qi(a),t=Tc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Li=yf(e.firstChild),Ii=t,N=!0,Ri=null,zi=!0,n=Ha(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Gi(),r===a){t=Ic(e,t,n);break a}dc(e,t,r,n)}t=t.child}return t;case 26:return xc(e,t),e===null?(n=Bf(t.type,null,t.pendingProps,null))?t.memoizedState=n:N||(n=t.type,e=t.pendingProps,r=Zd(me.current).createElement(n),r[pt]=t,r[mt]=e,Gd(r,n,e),k(r),t.stateNode=r):t.memoizedState=Bf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&N&&(r=t.stateNode=Cf(t.type,t.pendingProps,me.current),Ii=t,zi=!0,a=Li,lf(t.type)?(bf=a,Li=yf(r.firstChild)):Li=a),dc(e,t,t.pendingProps.children,n),xc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&N&&((a=r=Li)&&(r=pf(r,t.type,t.pendingProps,zi),r===null?a=!1:(t.stateNode=r,Ii=t,Li=yf(r.firstChild),zi=!1,a=!0)),a||Vi(t)),ve(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,ef(a,o)?r=null:s!==null&&ef(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Oo(e,t,jo,null,null,n),lp._currentValue=a),xc(e,t),dc(e,t,r,n),t.child;case 6:return e===null&&N&&((e=n=Li)&&(n=mf(n,t.pendingProps,zi),n===null?e=!1:(t.stateNode=n,Ii=t,Li=null,e=!0)),e||Vi(t)),null;case 13:return kc(e,t,n);case 4:return ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Va(t,null,r,n):dc(e,t,r,n),t.child;case 11:return fc(e,t,t.type,t.pendingProps,n);case 7:return dc(e,t,t.pendingProps,n),t.child;case 8:return dc(e,t,t.pendingProps.children,n),t.child;case 12:return dc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Zi(t,t.type,r.value),dc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ra(t),a=ia(a),r=r(a),t.flags|=1,dc(e,t,r,n),t.child;case 14:return pc(e,t,t.type,t.pendingProps,n);case 15:return mc(e,t,t.type,t.pendingProps,n);case 19:return Fc(e,t,n);case 31:return bc(e,t,n);case 22:return hc(e,t,n,t.pendingProps);case 24:return ra(t),r=ia(ua),e===null?(a=Sa(),a===null&&(a=ql,o=da(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Wa(t),Zi(t,ua,a)):((e.lanes&n)!==0&&(Ga(e,t),Qa(t,null,null,n),Za()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Zi(t,ua,r),r!==a.cache&&ea(t,[ua],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Zi(t,ua,r))),dc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Bc(e){e.flags|=4}function Vc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Pu())e.flags|=8192;else throw Ma=Oa,Ea}}else e.flags&=-16777217}function Hc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!tp(t)){if(Pu())e.flags|=8192;else throw Ma=Oa,Ea}}function Uc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,au|=t)}function Wc(e,t){if(!N)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Gc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Kc(e,t,n){var r=t.pendingProps;switch(Pi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gc(t),null;case 1:return Gc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qi(ua),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?Bc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ki())),Gc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Bc(t),o===null?(Gc(t),Vc(t,a,null,r,n)):(Gc(t),Hc(t,o))):o?o===e.memoizedState?(Gc(t),t.flags&=-16777217):(Bc(t),Gc(t),Hc(t,o)):(e=e.memoizedProps,e!==r&&Bc(t),Gc(t),Vc(t,a,e,r,n)),null;case 27:if(ye(t),n=me.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Bc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Gc(t),null}e=fe.current,Wi(t)?Hi(t,e):(e=Cf(a,r,n),t.stateNode=e,Bc(t))}return Gc(t),null;case 5:if(ye(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Bc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Gc(t),null}if(o=fe.current,Wi(t))Hi(t,o);else{var s=Zd(me.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[pt]=t,o[mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Gd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Bc(t)}}return Gc(t),Vc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Bc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=me.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ii,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ud(e.nodeValue,n)),e||Vi(t,!0)}else e=Zd(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Gc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[pt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Gc(t),e=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(po(t),t):(po(t),null);if(t.flags&128)throw Error(i(558))}return Gc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Wi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[pt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Gc(t),a=!1}else a=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(po(t),t):(po(t),null)}return po(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Uc(t,t.updateQueue),Gc(t),null);case 4:return _e(),e===null&&Nd(t.stateNode.containerInfo),Gc(t),null;case 10:return Qi(t.type),Gc(t),null;case 19:if(ue(mo),r=t.memoizedState,r===null)return Gc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Wc(r,!1);else{if(eu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ho(e),o!==null){for(t.flags|=128,Wc(r,!1),e=o.updateQueue,t.updateQueue=e,Uc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)mi(n,e),n=n.sibling;return de(mo,mo.current&1|2),N&&ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>du&&(t.flags|=128,a=!0,Wc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Uc(t,e),Wc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!N)return Gc(t),null}else 2*Me()-r.renderingStartTime>du&&n!==536870912&&(t.flags|=128,a=!0,Wc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Gc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=mo.current,de(mo,a?n&1|2:n&1),N&&ji(t,r.treeForkCount),e);case 22:case 23:return po(t),ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Gc(t),t.subtreeFlags&6&&(t.flags|=8192)):Gc(t),n=t.updateQueue,n!==null&&Uc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ue(xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qi(ua),Gc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function qc(e,t){switch(Pi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qi(ua),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(po(t),t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(mo),null;case 4:return _e(),null;case 10:return Qi(t.type),null;case 22:case 23:return po(t),ao(),e!==null&&ue(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qi(ua),null;case 25:return null;default:return null}}function Jc(e,t){switch(Pi(t),t.tag){case 3:Qi(ua),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&po(t);break;case 13:po(t);break;case 19:ue(mo);break;case 10:Qi(t.type);break;case 22:case 23:po(t),ao(),e!==null&&ue(xa);break;case 24:Qi(ua)}}function Yc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){td(t,t.return,e)}}function Xc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){td(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){td(t,t.return,e)}}function Zc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{eo(t,n)}catch(t){td(e,e.return,t)}}}function Qc(e,t,n){n.props=$s(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){td(e,t,n)}}function $c(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){td(e,t,n)}}function el(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){td(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){td(e,t,n)}else n.current=null}}function tl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){td(e,e.return,t)}}function nl(e,t,n){try{var r=e.stateNode;Kd(r,e.type,n,t),r[mt]=t}catch(t){td(e,e.return,t)}}function rl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&lf(e.type)||e.tag===4}function il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||rl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&lf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function al(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=on));else if(r!==4&&(r===27&&lf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(al(e,t,n),e=e.sibling;e!==null;)al(e,t,n),e=e.sibling}function ol(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&lf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ol(e,t,n),e=e.sibling;e!==null;)ol(e,t,n),e=e.sibling}function sl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Gd(t,r,n),t[pt]=e,t[mt]=n}catch(t){td(e,e.return,t)}}var cl=!1,ll=!1,ul=!1,dl=typeof WeakSet==`function`?WeakSet:Set,fl=null;function pl(e,t){if(e=e.containerInfo,Yd=vp,e=Ar(e),jr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Xd={focusedElem:e,selectionRange:n},vp=!1,fl=t;fl!==null;)if(t=fl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,fl=e;else for(;fl!==null;){switch(t=fl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=$s(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){td(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ff(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ff(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,fl=e;break}fl=t.return}}function ml(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:kl(e,n),r&4&&Yc(5,n);break;case 1:if(kl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){td(n,n.return,e)}else{var i=$s(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){td(n,n.return,e)}}}r&64&&Zc(n),r&512&&$c(n,n.return);break;case 3:if(kl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{eo(e,t)}catch(e){td(n,n.return,e)}}break;case 27:t===null&&r&4&&sl(n);case 26:case 5:kl(e,n),t===null&&r&4&&tl(n),r&512&&$c(n,n.return);break;case 12:kl(e,n);break;case 31:kl(e,n),r&4&&bl(e,n);break;case 13:kl(e,n),r&4&&xl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ad.bind(null,n),vf(e,n))));break;case 22:if(r=n.memoizedState!==null||cl,!r){t=t!==null&&t.memoizedState!==null||ll,i=cl;var a=ll;cl=r,(ll=t)&&!a?jl(e,n,!!(n.subtreeFlags&8772)):kl(e,n),cl=i,ll=a}break;case 30:break;default:kl(e,n)}}function hl(e){var t=e.alternate;t!==null&&(e.alternate=null,hl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var gl=null,_l=!1;function vl(e,t,n){for(n=n.child;n!==null;)yl(e,t,n),n=n.sibling}function yl(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(Ve,n)}catch{}switch(n.tag){case 26:ll||el(n,t),vl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ll||el(n,t);var r=gl,i=_l;lf(n.type)&&(gl=n.stateNode,_l=!1),vl(e,t,n),wf(n.stateNode),gl=r,_l=i;break;case 5:ll||el(n,t);case 6:if(r=gl,i=_l,gl=null,vl(e,t,n),gl=r,_l=i,gl!==null){if(_l)try{(gl.nodeType===9?gl.body:gl.nodeName===`HTML`?gl.ownerDocument.body:gl).removeChild(n.stateNode)}catch(e){td(n,t,e)}else try{gl.removeChild(n.stateNode)}catch(e){td(n,t,e)}}break;case 18:gl!==null&&(_l?(e=gl,uf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hp(e)):uf(gl,n.stateNode));break;case 4:r=gl,i=_l,gl=n.stateNode.containerInfo,_l=!0,vl(e,t,n),gl=r,_l=i;break;case 0:case 11:case 14:case 15:Xc(2,n,t),ll||Xc(4,n,t),vl(e,t,n);break;case 1:ll||(el(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Qc(n,t,r)),vl(e,t,n);break;case 21:vl(e,t,n);break;case 22:ll=(r=ll)||n.memoizedState!==null,vl(e,t,n),ll=r;break;default:vl(e,t,n)}}function bl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hp(e)}catch(e){td(t,t.return,e)}}}function xl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hp(e)}catch(e){td(t,t.return,e)}}function Sl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new dl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new dl),t;default:throw Error(i(435,e.tag))}}function Cl(e,t){var n=Sl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=od.bind(null,e,t);t.then(r,r)}})}function wl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(lf(c.type)){gl=c.stateNode,_l=!1;break a}break;case 5:gl=c.stateNode,_l=!1;break a;case 3:case 4:gl=c.stateNode.containerInfo,_l=!0;break a}c=c.return}if(gl===null)throw Error(i(160));yl(o,s,a),gl=null,_l=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)El(t,e),t=t.sibling}var Tl=null;function El(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:wl(t,e),Dl(e),r&4&&(Xc(3,e,e.return),Yc(3,e),Xc(5,e,e.return));break;case 1:wl(t,e),Dl(e),r&512&&(ll||n===null||el(n,n.return)),r&64&&cl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=Tl;if(wl(t,e),Dl(e),r&512&&(ll||n===null||el(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[bt]||o[pt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Gd(o,r,n),o[pt]=e,k(o),r=o;break a;case`link`:var s=Qf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Gd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Qf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Gd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[pt]=e,k(o),r=o}e.stateNode=r}else $f(a,e.type,e.stateNode)}else e.stateNode=qf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&nl(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?$f(a,e.type,e.stateNode):qf(a,r,e.memoizedProps))}break;case 27:wl(t,e),Dl(e),r&512&&(ll||n===null||el(n,n.return)),n!==null&&r&4&&nl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(wl(t,e),Dl(e),r&512&&(ll||n===null||el(n,n.return)),e.flags&32){a=e.stateNode;try{Zt(a,``)}catch(t){td(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,nl(e,a,n===null?a:n.memoizedProps)),r&1024&&(ul=!0);break;case 6:if(wl(t,e),Dl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){td(e,e.return,t)}}break;case 3:if(Zf=null,a=Tl,Tl=Df(t.containerInfo),wl(t,e),Tl=a,Dl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Hp(t.containerInfo)}catch(t){td(e,e.return,t)}ul&&(ul=!1,Ol(e));break;case 4:r=Tl,Tl=Df(e.stateNode.containerInfo),wl(t,e),Dl(e),Tl=r;break;case 12:wl(t,e),Dl(e);break;case 31:wl(t,e),Dl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 13:wl(t,e),Dl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(lu=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=cl,d=ll;if(cl=u||a,ll=d||l,wl(t,e),ll=d,cl=u,Dl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||cl||ll||Al(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){td(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){td(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?df(m,!0):df(l.stateNode,!1)}catch(e){td(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Cl(e,n))));break;case 19:wl(t,e),Dl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Cl(e,r)));break;case 30:break;case 21:break;default:wl(t,e),Dl(e)}}function Dl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(rl(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;ol(e,il(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Zt(o,``),n.flags&=-33),ol(e,il(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;al(e,il(e),s);break;default:throw Error(i(161))}}catch(t){td(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ol(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ol(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function kl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ml(e,t.alternate,t),t=t.sibling}function Al(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Xc(4,t,t.return),Al(t);break;case 1:el(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Qc(t,t.return,n),Al(t);break;case 27:wf(t.stateNode);case 26:case 5:el(t,t.return),Al(t);break;case 22:t.memoizedState===null&&Al(t);break;case 30:Al(t);break;default:Al(t)}e=e.sibling}}function jl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:jl(i,a,n),Yc(4,a);break;case 1:if(jl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){td(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)$a(c[i],s)}catch(e){td(r,r.return,e)}}n&&o&64&&Zc(a),$c(a,a.return);break;case 27:sl(a);case 26:case 5:jl(i,a,n),n&&r===null&&o&4&&tl(a),$c(a,a.return);break;case 12:jl(i,a,n);break;case 31:jl(i,a,n),n&&o&4&&bl(i,a);break;case 13:jl(i,a,n),n&&o&4&&xl(i,a);break;case 22:a.memoizedState===null&&jl(i,a,n),$c(a,a.return);break;case 30:break;default:jl(i,a,n)}t=t.sibling}}function Ml(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&fa(n))}function Nl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e))}function Pl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fl(e,t,n,r),t=t.sibling}function Fl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Pl(e,t,n,r),i&2048&&Yc(9,t);break;case 1:Pl(e,t,n,r);break;case 3:Pl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e)));break;case 12:if(i&2048){Pl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){td(t,t.return,e)}}else Pl(e,t,n,r);break;case 31:Pl(e,t,n,r);break;case 13:Pl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Pl(e,t,n,r):(a._visibility|=2,Il(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Pl(e,t,n,r):Ll(e,t),i&2048&&Ml(o,t);break;case 24:Pl(e,t,n,r),i&2048&&Nl(t.alternate,t);break;default:Pl(e,t,n,r)}}function Il(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Il(a,o,s,c,i),Yc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Il(a,o,s,c,i)):u._visibility&2?Il(a,o,s,c,i):Ll(a,o),i&&l&2048&&Ml(o.alternate,o);break;case 24:Il(a,o,s,c,i),i&&l&2048&&Nl(o.alternate,o);break;default:Il(a,o,s,c,i)}t=t.sibling}}function Ll(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ll(n,r),i&2048&&Ml(r.alternate,r);break;case 24:Ll(n,r),i&2048&&Nl(r.alternate,r);break;default:Ll(n,r)}t=t.sibling}}var Rl=8192;function zl(e,t,n){if(e.subtreeFlags&Rl)for(e=e.child;e!==null;)Bl(e,t,n),e=e.sibling}function Bl(e,t,n){switch(e.tag){case 26:zl(e,t,n),e.flags&Rl&&e.memoizedState!==null&&np(n,Tl,e.memoizedState,e.memoizedProps);break;case 5:zl(e,t,n);break;case 3:case 4:var r=Tl;Tl=Df(e.stateNode.containerInfo),zl(e,t,n),Tl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Rl,Rl=16777216,zl(e,t,n),Rl=r):zl(e,t,n));break;default:zl(e,t,n)}}function Vl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Hl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fl=r,Gl(r,e)}Vl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ul(e),e=e.sibling}function Ul(e){switch(e.tag){case 0:case 11:case 15:Hl(e),e.flags&2048&&Xc(9,e,e.return);break;case 3:Hl(e);break;case 12:Hl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wl(e)):Hl(e);break;default:Hl(e)}}function Wl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fl=r,Gl(r,e)}Vl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Xc(8,t,t.return),Wl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wl(t));break;default:Wl(t)}e=e.sibling}}function Gl(e,t){for(;fl!==null;){var n=fl;switch(n.tag){case 0:case 11:case 15:Xc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,fl=r;else a:for(n=e;fl!==null;){r=fl;var i=r.sibling,a=r.return;if(hl(r),r===n){fl=null;break a}if(i!==null){i.return=a,fl=i;break a}fl=a}}}var Kl={getCacheForType:function(e){var t=ia(ua),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ia(ua).controller.signal}},F=typeof WeakMap==`function`?WeakMap:Map,I=0,ql=null,L=null,R=0,Jl=0,Yl=null,Xl=!1,Zl=!1,Ql=!1,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=null,su=null,cu=!1,lu=0,uu=0,du=1/0,fu=null,pu=null,mu=0,hu=null,gu=null,_u=0,vu=0,yu=null,bu=null,xu=0,Su=null;function Cu(){return I&2&&R!==0?R&-R:D.T===null?ut():Sd()}function wu(){if(iu===0){if(!(R&536870912)||N){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),iu=e}else iu=536870912}return e=oo.current,e!==null&&(e.flags|=32),iu}function Tu(e,t,n){(e===ql&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)&&(Mu(e,0),ku(e,R,iu,!1)),rt(e,n),(!(I&2)||e!==ql)&&(e===ql&&(!(I&2)&&(nu|=n),eu===4&&ku(e,R,iu,!1)),md(e))}function Eu(e,t,n){if(I&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||$e(e,t),a=r?Bu(e,t):Ru(e,t,!0),o=r;do{if(a===0){Zl&&!r&&ku(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ou(n)){a=Ru(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ou;var l=c.current.memoizedState.isDehydrated;if(l&&(Mu(c,s).flags|=256),s=Ru(c,s,!1),s!==2){if(Ql&&!l){c.errorRecoveryDisabledLanes|=o,nu|=o,a=4;break a}o=su,su=a,o!==null&&(su===null?su=o:su.push.apply(su,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Mu(e,0),ku(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:ku(r,t,iu,!Xl);break a;case 2:su=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=lu+300-Me(),10<a)){if(ku(r,t,iu,!Xl),Qe(r,0,!0)!==0)break a;_u=t,r.timeoutHandle=rf(Du.bind(null,r,n,su,fu,cu,t,iu,nu,au,Xl,o,`Throttled`,-0,0),a);break a}Du(r,n,su,fu,cu,t,iu,nu,au,Xl,o,null,-0,0)}break}while(1);md(e)}function Du(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:on},Bl(t,a,d);var m=(a&62914560)===a?lu-Me():(a&4194048)===a?uu-Me():0;if(m=ip(d,m),m!==null){_u=a,e.cancelPendingCommit=m(qu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),ku(e,a,o,!l);return}}qu(e,t,a,n,r,i,o,s,c)}function Ou(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Tr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ku(e,t,n,r){t&=~ru,t&=~nu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&at(e,n,t)}function Au(){return I&6?!0:(hd(0,!1),!1)}function ju(){if(L!==null){if(Jl===0)var e=L.return;else e=L,Xi=Yi=null,Po(e),Fa=null,Ia=0,e=L;for(;e!==null;)Jc(e.alternate,e),e=e.return;L=null}}function Mu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,af(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),_u=0,ju(),ql=e,L=n=pi(e.current,null),R=t,Jl=0,Yl=null,Xl=!1,Zl=$e(e,t),Ql=!1,au=iu=ru=nu=tu=eu=0,su=ou=null,cu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-We(r),a=1<<i;t|=e[i],r&=~a}return $l=t,ri(),n}function Nu(e,t){P=null,D.H=Gs,t===Ta||t===Da?(t=Na(),Jl=3):t===Ea?(t=Na(),Jl=4):Jl=t===lc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Yl=t,L===null&&(eu=1,rc(e,xi(t,e.current)))}function Pu(){var e=oo.current;return e===null?!0:(R&4194048)===R?so===null:(R&62914560)===R||R&536870912?e===so:!1}function Fu(){var e=D.H;return D.H=Gs,e===null?Gs:e}function Iu(){var e=D.A;return D.A=Kl,e}function Lu(){eu=4,Xl||(R&4194048)!==R&&oo.current!==null||(Zl=!0),!(tu&134217727)&&!(nu&134217727)||ql===null||ku(ql,R,iu,!1)}function Ru(e,t,n){var r=I;I|=2;var i=Fu(),a=Iu();(ql!==e||R!==t)&&(fu=null,Mu(e,t)),t=!1;var o=eu;a:do try{if(Jl!==0&&L!==null){var s=L,c=Yl;switch(Jl){case 8:ju(),o=6;break a;case 3:case 2:case 9:case 6:oo.current===null&&(t=!0);var l=Jl;if(Jl=0,Yl=null,Wu(e,s,c,l),n&&Zl){o=0;break a}break;default:l=Jl,Jl=0,Yl=null,Wu(e,s,c,l)}}zu(),o=eu;break}catch(t){Nu(e,t)}while(1);return t&&e.shellSuspendCounter++,Xi=Yi=null,I=r,D.H=i,D.A=a,L===null&&(ql=null,R=0,ri()),o}function zu(){for(;L!==null;)Hu(L)}function Bu(e,t){var n=I;I|=2;var r=Fu(),a=Iu();ql!==e||R!==t?(fu=null,du=Me()+500,Mu(e,t)):Zl=$e(e,t);a:do try{if(Jl!==0&&L!==null){t=L;var o=Yl;b:switch(Jl){case 1:Jl=0,Yl=null,Wu(e,t,o,1);break;case 2:case 9:if(ka(o)){Jl=0,Yl=null,Uu(t);break}t=function(){Jl!==2&&Jl!==9||ql!==e||(Jl=7),md(e)},o.then(t,t);break a;case 3:Jl=7;break a;case 4:Jl=5;break a;case 7:ka(o)?(Jl=0,Yl=null,Uu(t)):(Jl=0,Yl=null,Wu(e,t,o,7));break;case 5:var s=null;switch(L.tag){case 26:s=L.memoizedState;case 5:case 27:var c=L;if(s?tp(s):c.stateNode.complete){Jl=0,Yl=null;var l=c.sibling;if(l!==null)L=l;else{var u=c.return;u===null?L=null:(L=u,Gu(u))}break b}}Jl=0,Yl=null,Wu(e,t,o,5);break;case 6:Jl=0,Yl=null,Wu(e,t,o,6);break;case 8:ju(),eu=6;break a;default:throw Error(i(462))}}Vu();break}catch(t){Nu(e,t)}while(1);return Xi=Yi=null,D.H=r,D.A=a,I=n,L===null?(ql=null,R=0,ri(),eu):0}function Vu(){for(;L!==null&&!Ae();)Hu(L)}function Hu(e){var t=zc(e.alternate,e,$l);e.memoizedProps=e.pendingProps,t===null?Gu(e):L=t}function Uu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Cc(n,t,t.pendingProps,t.type,void 0,R);break;case 11:t=Cc(n,t,t.pendingProps,t.type.render,t.ref,R);break;case 5:Po(t);default:Jc(n,t),t=L=mi(t,$l),t=zc(n,t,$l)}e.memoizedProps=e.pendingProps,t===null?Gu(e):L=t}function Wu(e,t,n,r){Xi=Yi=null,Po(t),Fa=null,Ia=0;var i=t.return;try{if(cc(e,i,t,n,R)){eu=1,rc(e,xi(n,e.current)),L=null;return}}catch(t){if(i!==null)throw L=i,t;eu=1,rc(e,xi(n,e.current)),L=null;return}t.flags&32768?(N||r===1?e=!0:Zl||R&536870912?e=!1:(Xl=e=!0,(r===2||r===9||r===3||r===6)&&(r=oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ku(t,e)):Gu(t)}function Gu(e){var t=e;do{if(t.flags&32768){Ku(t,Xl);return}e=t.return;var n=Kc(t.alternate,t,$l);if(n!==null){L=n;return}if(t=t.sibling,t!==null){L=t;return}L=t=e}while(t!==null);eu===0&&(eu=5)}function Ku(e,t){do{var n=qc(e.alternate,e);if(n!==null){n.flags&=32767,L=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){L=e;return}L=e=n}while(e!==null);eu=6,L=null}function qu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Qu();while(mu!==0);if(I&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ni,it(e,n,o,s,c,l),e===ql&&(L=ql=null,R=0),gu=t,hu=e,_u=n,vu=o,yu=a,bu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,sd(Ie,function(){return $u(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=D.T,D.T=null,a=O.p,O.p=2,s=I,I|=4;try{pl(e,t,n)}finally{I=s,O.p=a,D.T=r}}mu=1,Ju(),Yu(),Xu()}}function Ju(){if(mu===1){mu=0;var e=hu,t=gu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=D.T,D.T=null;var r=O.p;O.p=2;var i=I;I|=4;try{El(t,e);var a=Xd,o=Ar(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&kr(s.ownerDocument.documentElement,s)){if(c!==null&&jr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Or(s,h),v=Or(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}vp=!!Yd,Xd=Yd=null}finally{I=i,O.p=r,D.T=n}}e.current=t,mu=2}}function Yu(){if(mu===2){mu=0;var e=hu,t=gu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=D.T,D.T=null;var r=O.p;O.p=2;var i=I;I|=4;try{ml(e,t.alternate,t)}finally{I=i,O.p=r,D.T=n}}mu=3}}function Xu(){if(mu===4||mu===3){mu=0,je();var e=hu,t=gu,n=_u,r=bu;t.subtreeFlags&10256||t.flags&10256?mu=5:(mu=0,gu=hu=null,Zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(pu=null),lt(n),t=t.stateNode,He&&typeof He.onCommitFiberRoot==`function`)try{He.onCommitFiberRoot(Ve,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=D.T,i=O.p,O.p=2,D.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{D.T=t,O.p=i}}_u&3&&Qu(),md(e),i=e.pendingLanes,n&261930&&i&42?e===Su?xu++:(xu=0,Su=e):xu=0,hd(0,!1)}}function Zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fa(t)))}function Qu(){return Ju(),Yu(),Xu(),$u()}function $u(){if(mu!==5)return!1;var e=hu,t=vu;vu=0;var n=lt(_u),r=D.T,a=O.p;try{O.p=32>n?32:n,D.T=null,n=yu,yu=null;var o=hu,s=_u;if(mu=0,gu=hu=null,_u=0,I&6)throw Error(i(331));var c=I;if(I|=4,Ul(o.current),Fl(o,o.current,s,n),I=c,hd(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{O.p=a,D.T=r,Zu(e,t)}}function ed(e,t,n){t=xi(n,t),t=ac(e.stateNode,t,2),e=qa(e,t,2),e!==null&&(rt(e,2),md(e))}function td(e,t,n){if(e.tag===3)ed(e,e,n);else for(;t!==null;){if(t.tag===3){ed(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(pu===null||!pu.has(r))){e=xi(n,e),n=oc(2),r=qa(t,n,2),r!==null&&(sc(n,r,t,e),rt(r,2),md(r));break}}t=t.return}}function nd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new F;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ql=!0,i.add(n),e=rd.bind(null,e,t,n),t.then(e,e))}function rd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ql===e&&(R&n)===n&&(eu===4||eu===3&&(R&62914560)===R&&300>Me()-lu?!(I&2)&&Mu(e,0):ru|=n,au===R&&(au=0)),md(e)}function id(e,t){t===0&&(t=tt()),e=oi(e,t),e!==null&&(rt(e,t),md(e))}function ad(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),id(e,n)}function od(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),id(e,n)}function sd(e,t){return Oe(e,t)}var cd=null,ld=null,ud=!1,dd=!1,fd=!1,pd=0;function md(e){e!==ld&&e.next===null&&(ld===null?cd=ld=e:ld=ld.next=e),dd=!0,ud||(ud=!0,xd())}function hd(e,t){if(!fd&&dd){fd=!0;do for(var n=!1,r=cd;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,bd(r,a))}else a=R,a=Qe(r,r===ql?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,bd(r,a))}r=r.next}while(n);fd=!1}}function gd(){_d()}function _d(){dd=ud=!1;var e=0;pd!==0&&nf()&&(e=pd);for(var t=Me(),n=null,r=cd;r!==null;){var i=r.next,a=vd(r,t);a===0?(r.next=null,n===null?cd=i:n.next=i,i===null&&(ld=n)):(n=r,(e!==0||a&3)&&(dd=!0)),r=i}mu!==0&&mu!==5||hd(e,!1),pd!==0&&(pd=0)}function vd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ql,n=R,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ke(r),lt(n)){case 2:case 8:n=Fe;break;case 32:n=Ie;break;case 268435456:n=Re;break;default:n=Ie}return r=yd.bind(null,e),n=Oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ke(r),e.callbackPriority=2,e.callbackNode=null,2}function yd(e,t){if(mu!==0&&mu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Qu()&&e.callbackNode!==n)return null;var r=R;return r=Qe(e,e===ql?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Eu(e,r,t),vd(e,Me()),e.callbackNode!=null&&e.callbackNode===n?yd.bind(null,e):null)}function bd(e,t){if(Qu())return null;Eu(e,t,!0)}function xd(){sf(function(){I&6?Oe(Pe,gd):_d()})}function Sd(){if(pd===0){var e=ha;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),pd=e}return pd}function Cd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:an(``+e)}function wd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Td(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Cd((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?Cd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new A(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(pd!==0){var e=o?wd(i,o):new FormData(i);js(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?wd(i,o):new FormData(i),js(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ed=0;Ed<Zr.length;Ed++){var Dd=Zr[Ed];Qr(Dd.toLowerCase(),`on`+(Dd[0].toUpperCase()+Dd.slice(1)))}Qr(Ur,`onAnimationEnd`),Qr(Wr,`onAnimationIteration`),Qr(Gr,`onAnimationStart`),Qr(`dblclick`,`onDoubleClick`),Qr(`focusin`,`onFocus`),Qr(`focusout`,`onBlur`),Qr(Kr,`onTransitionRun`),Qr(qr,`onTransitionStart`),Qr(Jr,`onTransitionCancel`),Qr(Yr,`onTransitionEnd`),kt(`onMouseEnter`,[`mouseout`,`mouseover`]),kt(`onMouseLeave`,[`mouseout`,`mouseover`]),kt(`onPointerEnter`,[`pointerout`,`pointerover`]),kt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ot(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ot(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ot(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ot(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ot(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ot(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Od=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),kd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Od));function Ad(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){$r(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){$r(e)}i.currentTarget=null,a=c}}}}function z(e,t){var n=t[gt];n===void 0&&(n=t[gt]=new Set);var r=e+`__bubble`;n.has(r)||(Pd(t,e,2,!1),n.add(r))}function jd(e,t,n){var r=0;t&&(r|=4),Pd(n,e,r,t)}var Md=`_reactListening`+Math.random().toString(36).slice(2);function Nd(e){if(!e[Md]){e[Md]=!0,Et.forEach(function(t){t!==`selectionchange`&&(kd.has(t)||jd(t,!1,e),jd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Md]||(t[Md]=!0,jd(`selectionchange`,!1,t))}}function Pd(e,t,n,r){switch(Cp(t)){case 2:var i=V;break;case 8:i=yp;break;default:i=bp}n=i.bind(null,t,n,e),i=void 0,!gn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Fd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=St(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}pn(function(){var r=a,i=cn(n),s=[];a:{var c=Xr.get(e);if(c!==void 0){var l=A,u=e;switch(e){case`keypress`:if(Sn(n)===0)break a;case`keydown`:case`keyup`:l=Hn;break;case`focusin`:u=`focus`,l=Nn;break;case`focusout`:u=`blur`,l=Nn;break;case`beforeblur`:case`afterblur`:l=Nn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Mn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Wn;break;case Ur:case Wr:case Gr:l=Pn;break;case Yr:l=Gn;break;case`scroll`:case`scrollend`:l=On;break;case`wheel`:l=Kn;break;case`copy`:case`cut`:case`paste`:l=Fn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Un;break;case`toggle`:case`beforetoggle`:l=qn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=mn(m,p),g!=null&&d.push(Id(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==sn&&(u=n.relatedTarget||n.fromElement)&&(St(u)||u[ht]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?St(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=jn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Un,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:wt(l),h=u==null?c:wt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,St(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Rd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&zd(s,c,l,d,!1),u!==null&&f!==null&&zd(s,f,u,d,!0)}}a:{if(c=r?wt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=pr;else if(sr(c)){if(mr)v=Cr;else{v=xr;var y=br}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&tn(r.elementType)&&(v=pr):v=Sr;if(v&&=v(e,r)){cr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&qt(c,`number`,c.value)}switch(y=r?wt(r):window,e){case`focusin`:(sr(y)||y.contentEditable===`true`)&&(Nr=y,Pr=r,Fr=null);break;case`focusout`:Fr=Pr=Nr=null;break;case`mousedown`:Ir=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ir=!1,Lr(s,n,i);break;case`selectionchange`:if(Mr)break;case`keydown`:case`keyup`:Lr(s,n,i)}var b;if(Yn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else rr?tr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Qn&&n.locale!==`ko`&&(rr||x!==`onCompositionStart`?x===`onCompositionEnd`&&rr&&(b=xn()):(vn=i,yn=`value`in vn?vn.value:vn.textContent,rr=!0)),y=Ld(r,x),0<y.length&&(x=new In(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=nr(n),b!==null&&(x.data=b)))),(b=Zn?ir(e,n):ar(e,n))&&(x=Ld(r,`onBeforeInput`),0<x.length&&(y=new In(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Td(s,e,r,n,i)}Ad(s,t)})}function Id(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ld(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=mn(e,n),i!=null&&r.unshift(Id(e,i,a)),i=mn(e,t),i!=null&&r.push(Id(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Rd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=mn(n,a),l!=null&&o.unshift(Id(n,l,c))):i||(l=mn(n,a),l!=null&&o.push(Id(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Bd=/\r\n?/g,Vd=/\u0000|\uFFFD/g;function Hd(e){return(typeof e==`string`?e:``+e).replace(Bd,`
|
|
143
|
+
`).replace(Vd,``)}function Ud(e,t){return t=Hd(t),Hd(e)===t}function B(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Zt(e,``+r);break;case`className`:Ft(e,`class`,r);break;case`tabIndex`:Ft(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ft(e,n,r);break;case`style`:en(e,r,o);break;case`data`:if(t!==`object`){Ft(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&B(e,t,`name`,a.name,a,null),B(e,t,`formEncType`,a.formEncType,a,null),B(e,t,`formMethod`,a.formMethod,a,null),B(e,t,`formTarget`,a.formTarget,a,null)):(B(e,t,`encType`,a.encType,a,null),B(e,t,`method`,a.method,a,null),B(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=on);break;case`onScroll`:r!=null&&z(`scroll`,e);break;case`onScrollEnd`:r!=null&&z(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=an(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:z(`beforetoggle`,e),z(`toggle`,e),Pt(e,`popover`,r);break;case`xlinkActuate`:It(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:It(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:It(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:It(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Pt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=nn.get(n)||n,Pt(e,n,r))}}function Wd(e,t,n,r,a,o){switch(n){case`style`:en(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Zt(e,``+r);break;case`onScroll`:r!=null&&z(`scroll`,e);break;case`onScrollEnd`:r!=null&&z(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=on);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Dt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[mt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Pt(e,n,r)}}}function Gd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:z(`error`,e),z(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:B(e,t,o,s,n,null)}}a&&B(e,t,`srcSet`,n.srcSet,n,null),r&&B(e,t,`src`,n.src,n,null);return;case`input`:z(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:B(e,t,r,d,n,null)}}Kt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in z(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:B(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Jt(e,!!r,n,!0):Jt(e,!!r,t,!1);return;case`textarea`:for(s in z(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:B(e,t,s,c,n,null)}Xt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:B(e,t,l,r,n,null)}return;case`dialog`:z(`beforetoggle`,e),z(`toggle`,e),z(`cancel`,e),z(`close`,e);break;case`iframe`:case`object`:z(`load`,e);break;case`video`:case`audio`:for(r=0;r<Od.length;r++)z(Od[r],e);break;case`image`:z(`error`,e),z(`load`,e);break;case`details`:z(`toggle`,e);break;case`embed`:case`source`:case`link`:z(`error`,e),z(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:B(e,t,u,r,n,null)}return;default:if(tn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Wd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&B(e,t,c,r,n,null))}function Kd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||B(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&B(e,t,p,m,r,f)}}Gt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||B(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&B(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Jt(e,!!n,n?[]:``,!1):Jt(e,!!n,t,!0)):Jt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:B(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&B(e,t,s,a,r,o)}Yt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:B(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:B(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&B(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:B(e,t,u,p,r,m)}return;default:if(tn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Wd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Wd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&B(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||B(e,t,f,p,r,m)}function qd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Jd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&qd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&qd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Yd=null,Xd=null;function Zd(e){return e.nodeType===9?e:e.ownerDocument}function Qd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function $d(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function ef(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tf=null;function nf(){var e=window.event;return e&&e.type===`popstate`?e!==tf&&(tf=e,!0):(tf=null,!1)}var rf=typeof setTimeout==`function`?setTimeout:void 0,af=typeof clearTimeout==`function`?clearTimeout:void 0,of=typeof Promise==`function`?Promise:void 0,sf=typeof queueMicrotask==`function`?queueMicrotask:of===void 0?rf:function(e){return of.resolve(null).then(e).catch(cf)};function cf(e){setTimeout(function(){throw e})}function lf(e){return e===`head`}function uf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wf(e.ownerDocument.body)}n=i}while(n);Hp(t)}function df(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function ff(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ff(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function pf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[bt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=yf(e.nextSibling),e===null)break}return null}function mf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=yf(e.nextSibling),e===null))return null;return e}function hf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=yf(e.nextSibling),e===null))return null;return e}function gf(e){return e.data===`$?`||e.data===`$~`}function _f(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function vf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function yf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var bf=null;function xf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return yf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Sf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Cf(e,t,n){switch(t=Zd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function wf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var Tf=new Map,Ef=new Set;function Df(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Of=O.d;O.d={f:kf,r:Af,D:Nf,C:Pf,L:Ff,m:If,X:Rf,S:Lf,M:zf};function kf(){var e=Of.f(),t=Au();return e||t}function Af(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?Ns(t):Of.r(e)}var jf=typeof document>`u`?null:document;function Mf(e,t,n){var r=jf;if(r&&typeof t==`string`&&t){var i=Wt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Ef.has(i)||(Ef.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Gd(t,`link`,e),k(t),r.head.appendChild(t)))}}function Nf(e){Of.D(e),Mf(`dns-prefetch`,e,null)}function Pf(e,t){Of.C(e,t),Mf(`preconnect`,e,t)}function Ff(e,t,n){Of.L(e,t,n);var r=jf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Wt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Wt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Wt(n.imageSizes)+`"]`)):i+=`[href="`+Wt(e)+`"]`;var a=i;switch(t){case`style`:a=Vf(e);break;case`script`:a=Gf(e)}Tf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hf(a))||t===`script`&&r.querySelector(Kf(a))||(t=r.createElement(`link`),Gd(t,`link`,e),k(t),r.head.appendChild(t)))}}function If(e,t){Of.m(e,t);var n=jf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Wt(r)+`"][href="`+Wt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gf(e)}if(!Tf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),Tf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Kf(a)))return}r=n.createElement(`link`),Gd(r,`link`,e),k(r),n.head.appendChild(r)}}}function Lf(e,t,n){Of.S(e,t,n);var r=jf;if(r&&e){var i=Tt(r).hoistableStyles,a=Vf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tf.get(a))&&Yf(e,n);var c=o=r.createElement(`link`);k(c),Gd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Jf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rf(e,t){Of.X(e,t);var n=jf;if(n&&e){var r=Tt(n).hoistableScripts,i=Gf(e),a=r.get(i);a||(a=n.querySelector(Kf(i)),a||(e=f({src:e,async:!0},t),(t=Tf.get(i))&&Xf(e,t),a=n.createElement(`script`),k(a),Gd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zf(e,t){Of.M(e,t);var n=jf;if(n&&e){var r=Tt(n).hoistableScripts,i=Gf(e),a=r.get(i);a||(a=n.querySelector(Kf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=Tf.get(i))&&Xf(e,t),a=n.createElement(`script`),k(a),Gd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t,n,r){var a=(a=me.current)?Df(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Vf(n.href),n=Tt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Vf(n.href);var o=Tt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Hf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Tf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Tf.set(e,n),o||Wf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Gf(n),n=Tt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Vf(e){return`href="`+Wt(e)+`"`}function Hf(e){return`link[rel="stylesheet"][`+e+`]`}function Uf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Wf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Gd(t,`link`,n),k(t),e.head.appendChild(t))}function Gf(e){return`[src="`+Wt(e)+`"]`}function Kf(e){return`script[async]`+e}function qf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Wt(n.href)+`"]`);if(r)return t.instance=r,k(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),k(r),Gd(r,`style`,a),Jf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vf(n.href);var o=e.querySelector(Hf(a));if(o)return t.state.loading|=4,t.instance=o,k(o),o;r=Uf(n),(a=Tf.get(a))&&Yf(r,a),o=(e.ownerDocument||e).createElement(`link`),k(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Gd(o,`link`,r),t.state.loading|=4,Jf(o,n.precedence,e),t.instance=o;case`script`:return o=Gf(n.src),(a=e.querySelector(Kf(o)))?(t.instance=a,k(a),a):(r=n,(a=Tf.get(o))&&(r=f({},n),Xf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),k(a),Gd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Jf(r,n.precedence,e));return t.instance}function Jf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Yf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zf=null;function Qf(e,t,n){if(Zf===null){var r=new Map,i=Zf=new Map;i.set(n,r)}else i=Zf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[bt]||a[pt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function $f(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function ep(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function tp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function np(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Vf(r.href),a=t.querySelector(Hf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ap.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,k(a);return}a=t.ownerDocument||t,r=Uf(r),(i=Tf.get(i))&&Yf(r,i),a=a.createElement(`link`),k(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Gd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ap.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var rp=0;function ip(e,t){return e.stylesheets&&e.count===0&&sp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&rp===0&&(rp=62500*Jd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>rp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ap(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var op=null;function sp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,op=new Map,t.forEach(cp,e),op=null,ap.call(e))}function cp(e,t){if(!(t.state.loading&4)){var n=op.get(e);if(n)var r=n.get(null);else{n=new Map,op.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ap.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var lp={$$typeof:b,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function up(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function dp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new up(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=di(3,null,null,t),e.current=a,a.stateNode=e,t=da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Wa(a),e}function fp(e){return e?(e=li,e):li}function pp(e,t,n,r,i,a){i=fp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ka(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=qa(e,r,t),n!==null&&(Tu(n,e,t),Ja(n,e,t))}function mp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hp(e,t){mp(e,t),(e=e.alternate)&&mp(e,t)}function gp(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&Tu(t,e,67108864),hp(e,67108864)}}function _p(e){if(e.tag===13||e.tag===31){var t=Cu();t=ct(t);var n=oi(e,t);n!==null&&Tu(n,e,t),hp(e,t)}}var vp=!0;function V(e,t,n,r){var i=D.T;D.T=null;var a=O.p;try{O.p=2,bp(e,t,n,r)}finally{O.p=a,D.T=i}}function yp(e,t,n,r){var i=D.T;D.T=null;var a=O.p;try{O.p=8,bp(e,t,n,r)}finally{O.p=a,D.T=i}}function bp(e,t,n,r){if(vp){var i=H(r);if(i===null)Fd(e,t,r,xp,n),Mp(e,r);else if(Pp(i,e,t,n,r))r.stopPropagation();else if(Mp(e,r),t&4&&-1<jp.indexOf(e)){for(;i!==null;){var a=Ct(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}md(a),!(I&6)&&(du=Me()+500,hd(0,!1))}}break;case 31:case 13:s=oi(a,2),s!==null&&Tu(s,a,2),Au(),hp(a,2)}if(a=H(r),a===null&&Fd(e,t,r,xp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Fd(e,t,r,null,n)}}function H(e){return e=cn(e),Sp(e)}var xp=null;function Sp(e){if(xp=null,e=St(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xp=e,null}function Cp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ne()){case Pe:return 2;case Fe:return 8;case Ie:case Le:return 32;case Re:return 268435456;default:return 32}default:return 32}}var wp=!1,Tp=null,Ep=null,Dp=null,Op=new Map,kp=new Map,Ap=[],jp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mp(e,t){switch(e){case`focusin`:case`focusout`:Tp=null;break;case`dragenter`:case`dragleave`:Ep=null;break;case`mouseover`:case`mouseout`:Dp=null;break;case`pointerover`:case`pointerout`:Op.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kp.delete(t.pointerId)}}function Np(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ct(t),t!==null&&gp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Pp(e,t,n,r,i){switch(t){case`focusin`:return Tp=Np(Tp,e,t,n,r,i),!0;case`dragenter`:return Ep=Np(Ep,e,t,n,r,i),!0;case`mouseover`:return Dp=Np(Dp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Op.set(a,Np(Op.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kp.set(a,Np(kp.get(a)||null,e,t,n,r,i)),!0}return!1}function Fp(e){var t=St(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,dt(e.priority,function(){_p(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){_p(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ip(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=H(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);sn=r,n.target.dispatchEvent(r),sn=null}else return t=Ct(n),t!==null&&gp(t),e.blockedOn=n,!1;t.shift()}return!0}function Lp(e,t,n){Ip(e)&&n.delete(t)}function Rp(){wp=!1,Tp!==null&&Ip(Tp)&&(Tp=null),Ep!==null&&Ip(Ep)&&(Ep=null),Dp!==null&&Ip(Dp)&&(Dp=null),Op.forEach(Lp),kp.forEach(Lp)}function zp(e,n){e.blockedOn===n&&(e.blockedOn=null,wp||(wp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rp)))}var Bp=null;function Vp(e){Bp!==e&&(Bp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bp===e&&(Bp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sp(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,js(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hp(e){function t(t){return zp(t,e)}Tp!==null&&zp(Tp,e),Ep!==null&&zp(Ep,e),Dp!==null&&zp(Dp,e),Op.forEach(t),kp.forEach(t);for(var n=0;n<Ap.length;n++){var r=Ap[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ap.length&&(n=Ap[0],n.blockedOn===null);)Fp(n),n.blockedOn===null&&Ap.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[mt]||null;if(typeof a==`function`)o||Vp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(Sp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vp(n)}}}function Up(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wp(e){this._internalRoot=e}Gp.prototype.render=Wp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;pp(n,Cu(),e,t,null,null)},Gp.prototype.unmount=Wp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pp(e.current,2,null,e,null,null),Au(),t[ht]=null}};function Gp(e){this._internalRoot=e}Gp.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ap.length&&t!==0&&t<Ap[n].priority;n++);Ap.splice(n,0,e),n===0&&Fp(e)}};var Kp=n.version;if(Kp!==`19.2.8`)throw Error(i(527,Kp,`19.2.8`));O.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var qp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:D,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jp.isDisabled&&Jp.supportsFiber)try{Ve=Jp.inject(qp),He=Jp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=ec,s=tc,c=nc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=dp(e,1,!1,null,null,n,r,null,o,s,c,Up),e[ht]=t.current,Nd(e),new Wp(t)}})),Ax=c(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=kx()}))(),jx=Math.min,Mx=Math.max,Nx=Math.round,Px=e=>({x:e,y:e}),Fx={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ix(e,t,n){return Mx(e,jx(t,n))}function Lx(e,t){return typeof e==`function`?e(t):e}function Rx(e){return e.split(`-`)[0]}function zx(e){return e.split(`-`)[1]}function Bx(e){return e===`x`?`y`:`x`}function Vx(e){return e===`y`?`height`:`width`}function Hx(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ux(e){return Bx(Hx(e))}function Wx(e,t,n){n===void 0&&(n=!1);let r=zx(e),i=Ux(e),a=Vx(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=$x(o)),[o,$x(o)]}function Gx(e){let t=$x(e);return[Kx(e),t,Kx(t)]}function Kx(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var qx=[`left`,`right`],Jx=[`right`,`left`],Yx=[`top`,`bottom`],Xx=[`bottom`,`top`];function Zx(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Jx:qx:t?qx:Jx;case`left`:case`right`:return t?Yx:Xx;default:return[]}}function Qx(e,t,n,r){let i=zx(e),a=Zx(Rx(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Kx)))),a}function $x(e){let t=Rx(e);return Fx[t]+e.slice(t.length)}function eS(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function tS(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:eS(e)}function nS(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function rS(e,t,n){let{reference:r,floating:i}=e,a=Hx(t),o=Ux(t),s=Vx(o),c=Rx(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=zx(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function iS(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Lx(t,e),p=tS(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=nS(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=nS(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var aS=50,oS=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:iS},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=rS(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<aS&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=rS(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},sS=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Lx(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Rx(r),_=Hx(o),v=Rx(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[$x(o)]:Gx(o)),x=p!==`none`;!d&&x&&b.push(...Qx(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Wx(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Hx(t)||T.every(e=>Hx(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Hx(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},cS=new Set([`left`,`top`]);async function lS(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Rx(n),s=zx(n),c=Hx(n)===`y`,l=cS.has(o)?-1:1,u=a&&c?-1:1,d=Lx(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var uS=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await lS(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},dS=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Lx(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Hx(i),p=Bx(f),m=u[p],h=u[f],g=(e,t)=>Ix(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}};function fS(){return typeof window<`u`}function pS(e){return gS(e)?(e.nodeName||``).toLowerCase():`#document`}function mS(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hS(e){return((gS(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function gS(e){return fS()?e instanceof Node||e instanceof mS(e).Node:!1}function _S(e){return fS()?e instanceof Element||e instanceof mS(e).Element:!1}function vS(e){return fS()?e instanceof HTMLElement||e instanceof mS(e).HTMLElement:!1}function yS(e){return!fS()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof mS(e).ShadowRoot}function bS(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=jS(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function xS(e){return/^(table|td|th)$/.test(pS(e))}function SS(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var CS=/transform|translate|scale|rotate|perspective|filter/,wS=/paint|layout|strict|content/,TS=e=>!!e&&e!==`none`,ES;function DS(e){let t=_S(e)?jS(e):e;return TS(t.transform)||TS(t.translate)||TS(t.scale)||TS(t.rotate)||TS(t.perspective)||!kS()&&(TS(t.backdropFilter)||TS(t.filter))||CS.test(t.willChange||``)||wS.test(t.contain||``)}function OS(e){let t=NS(e);for(;vS(t)&&!AS(t);){if(DS(t))return t;if(SS(t))return null;t=NS(t)}return null}function kS(){return ES??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ES}function AS(e){return/^(html|body|#document)$/.test(pS(e))}function jS(e){return mS(e).getComputedStyle(e)}function MS(e){return _S(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function NS(e){if(pS(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||yS(e)&&e.host||hS(e);return yS(t)?t.host:t}function PS(e){let t=NS(e);return AS(t)?(e.ownerDocument||e).body:vS(t)&&bS(t)?t:PS(t)}function FS(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=PS(e),i=r===e.ownerDocument?.body,a=mS(r);if(i){let e=IS(a);return t.concat(a,a.visualViewport||[],bS(r)?r:[],e&&n?FS(e):[])}return t.concat(r,FS(r,[],n))}function IS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function LS(e){let t=jS(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=vS(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Nx(n)!==a||Nx(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function RS(e){return _S(e)?e:e.contextElement}function zS(e){let t=RS(e);if(!vS(t))return Px(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=LS(t),o=(a?Nx(n.width):n.width)/r,s=(a?Nx(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var BS=Px(0);function VS(e){let t=mS(e);return!kS()||!t.visualViewport?BS:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function HS(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===mS(e)}function US(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=RS(e),o=Px(1);t&&(r?_S(r)&&(o=zS(r)):o=zS(e));let s=HS(a,n,r)?VS(a):Px(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=mS(a),t=_S(r)?mS(r):r,n=e,i=IS(n);for(;i&&t!==n;){let e=zS(i),t=i.getBoundingClientRect(),r=jS(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=mS(i),i=IS(n)}}return nS({width:u,height:d,x:c,y:l})}function WS(e,t){let n=MS(e).scrollLeft;return t?t.left+n:US(hS(e)).left+n}function GS(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-WS(e,n),y:n.top+t.scrollTop}}function KS(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=hS(r),s=t?SS(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Px(1),u=Px(0),d=vS(r);if((d||!a)&&((pS(r)!==`body`||bS(o))&&(c=MS(r)),d)){let e=US(r);l=zS(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?GS(o,c):Px(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function qS(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function JS(e){let t=MS(e),n=e.ownerDocument.body,r=Mx(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Mx(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+WS(e),o=-t.scrollTop;return jS(n).direction===`rtl`&&(a+=Mx(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var YS=25;function XS(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=mS(e),a=hS(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!kS()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(WS(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=YS&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ZS(e,t){let n=US(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=zS(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function QS(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=XS(e,n,t);else if(t===`document`)r=JS(hS(e));else if(_S(t))r=ZS(t,n);else{let n=VS(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return nS(r)}function $S(e,t){let n=t.get(e);if(n)return n;let r=FS(e,[],!1).filter(e=>_S(e)&&pS(e)!==`body`),i=null,a=jS(e).position===`fixed`,o=a?NS(e):e;for(;_S(o)&&!AS(o);){let e=jS(o),t=DS(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=NS(o)}return t.set(e,r),r}function eC(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?SS(t)?[]:$S(t,this._c):[].concat(n),r],o=QS(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=QS(t,a[e],i);s=Mx(n.top,s),c=jx(n.right,c),l=jx(n.bottom,l),u=Mx(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function tC(e){let{width:t,height:n}=LS(e);return{width:t,height:n}}function nC(e,t,n){let r=vS(t),i=hS(t),a=n===`fixed`,o=US(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Px(0);if((r||!a)&&((pS(t)!==`body`||bS(i))&&(s=MS(t)),r)){let e=US(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=WS(i));let l=i&&!r&&!a?GS(i,s):Px(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function rC(e){return jS(e).position===`static`}function iC(e,t){if(!vS(e)||jS(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return hS(e)===n&&(n=n.ownerDocument.body),n}function aC(e,t){let n=mS(e);if(SS(e))return n;if(!vS(e)){let t=NS(e);for(;t&&!AS(t);){if(_S(t)&&!rC(t))return t;t=NS(t)}return n}let r=iC(e,t);for(;r&&xS(r)&&rC(r);)r=iC(r,t);return r&&AS(r)&&rC(r)&&!DS(r)?n:r||OS(e)||n}var oC=async function(e){let t=this.getOffsetParent||aC,n=this.getDimensions,r=await n(e.floating);return{reference:nC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sC(e){return jS(e).direction===`rtl`}var cC={convertOffsetParentRelativeRectToViewportRelativeRect:KS,getDocumentElement:hS,getClippingRect:eC,getOffsetParent:aC,getElementRects:oC,getClientRects:qS,getDimensions:tC,getScale:zS,isElement:_S,isRTL:sC},lC=uS,uC=dS,dC=sS,fC=(e,t,n)=>{let r=new Map,i=n??{},a={...cC,...i.platform,_c:r};return oS(e,t,{...i,platform:a})},pC=d(Ox(),1),mC=typeof document<`u`?W.useLayoutEffect:function(){};function hC(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!hC(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!hC(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function gC(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _C(e,t){let n=gC(e);return Math.round(t*n)/n}function vC(e){let t=W.useRef(e);return mC(()=>{t.current=e}),t}function yC(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=W.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=W.useState(r);hC(f,r)||p(r);let[m,h]=W.useState(null),[g,_]=W.useState(null),v=W.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=W.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=W.useRef(null),C=W.useRef(null),w=W.useRef(u),T=c!=null,E=vC(c),ee=vC(i),te=vC(l),ne=W.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),fC(S.current,C.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};re.current&&!hC(w.current,t)&&(w.current=t,pC.flushSync(()=>{d(t)}))})},[f,t,n,ee,te]);mC(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let re=W.useRef(!1);mC(()=>(re.current=!0,()=>{re.current=!1}),[]),mC(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ne);ne()}},[b,x,ne,E,T]);let ie=W.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),ae=W.useMemo(()=>({reference:b,floating:x}),[b,x]),D=W.useMemo(()=>{let e={position:n,left:0,top:0};if(!ae.floating)return e;let t=_C(ae.floating,u.x),r=_C(ae.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...gC(ae.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ae.floating,u.x,u.y]);return W.useMemo(()=>({...u,update:ne,refs:ie,elements:ae,floatingStyles:D}),[u,ne,ie,ae,D])}var bC=(e,t)=>{let n=lC(e);return{name:n.name,fn:n.fn,options:[e,t]}},xC=(e,t)=>{let n=uC(e);return{name:n.name,fn:n.fn,options:[e,t]}},SC=(e,t)=>{let n=dC(e);return{name:n.name,fn:n.fn,options:[e,t]}},CC=e=>{let[t,n]=W.useState(e),r=W.useRef(t);return[t,W.useCallback(function(e){r.current=typeof e==`function`?e(r.current):e,n(r.current)},[]),r]},wC=({analytics:e,element:t,data:n,prevData:r,hide:i,updateTextWithAlternative:a,addIgnoredTerm:o,movePopoverNextOrPrev:s,setLLMSuggestionsRequest:c,getLLMSuggestions:l,llmAlternativesEnabled:u,ignoreTermPermanently:d,onAlternativeAccepted:f})=>{let[p,m]=(0,W.useState)(null),[h,g,_]=CC(!1),[v,y]=(0,W.useState)(``),[b,x]=(0,W.useState)(``),[S,C]=(0,W.useState)(``),w=(0,W.useRef)(null);(0,W.useEffect)(()=>()=>{w.current!==null&&clearTimeout(w.current)},[]);let T=l({alert:n.alert}),E=(0,W.useRef)(null);(0,W.useEffect)(()=>{r&&r.alert.id===n.alert.id||E.current!==n.alert.id&&(E.current=n.alert.id,e.popoverLogs(n.alert,`popover_open`))},[n.alert.id]),(0,W.useEffect)(()=>{u&&n.alert.data.alternatives.length>0&&c({alert:n.alert})},[n.alert.id,u]);let ee=(t=!1)=>{t&&e.popoverLogs(n.alert,`popover_close`),g(!1),i();let r=window.document.getElementsByTagName(`ww-popover`);Array.from(r).forEach(e=>{e.remove()})},te=(t,r)=>{t.preventDefault(),t.stopImmediatePropagation(),e.alternativeLog(n.alert,r),f(),a(r)};return{analytics:e,alternativeHovered:p,setAlternativeHovered:m,showLearningBite:h,setShowLearningBite:g,showLearningBiteRef:_,isLoading:v,isSuccess:b,isFailure:S,llmAlternativesResponse:T,hidePopover:ee,clickAlternative:te,alternativeKeyDown:e=>n=>{(n.key===`Enter`||n.key===` `)&&(t.focus?.(),te(n.nativeEvent,e))},handleIgnoreClick:r=>()=>{e.ignoreLog(n.alert),r===`ignore_once`?(o(n.alert.data?.text),ee()):r===`ignore_permanently`&&(y(r),x(``),C(``),d(n.alert.data?.text).then(()=>{y(``),o(n.alert.data?.text),x(r),w.current=window.setTimeout(()=>{let e=!!document.getElementById(`witty-works-ext-popover`)?.contains(document.activeElement);ee(),e&&t.focus?.()},1e3)}).catch(()=>{y(``),C(r)}))},goToAdjacentAlert:e=>{s(e),g(!1)}}},TC=c((e=>{var t=Symbol.for(`react.transitional.element`);function n(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.jsx=n,e.jsxs=n})),G=c(((e,t)=>{t.exports=TC()}))(),EC=e=>(0,G.jsx)(`svg`,{width:15,height:14,viewBox:`0 0 15 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,G.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.6103 8.89864C7.80556 8.70338 8.12214 8.70338 8.31741 8.89864L13.1493 13.7305C13.3445 13.9258 13.6611 13.9258 13.8564 13.7305L14.5352 13.0517C14.7304 12.8565 14.7304 12.5399 14.5352 12.3446L9.7033 7.51275C9.50804 7.31749 9.50804 7.0009 9.7033 6.80564L14.8536 1.65535C15.0488 1.46009 15.0488 1.14351 14.8536 0.948248L14.1748 0.269463C13.9795 0.074201 13.663 0.0742007 13.4677 0.269463L8.31741 5.41975C8.12214 5.61501 7.80556 5.61501 7.6103 5.41975L2.46001 0.269463C2.26475 0.0742007 1.94817 0.074201 1.7529 0.269463L1.07412 0.948248C0.878858 1.14351 0.878858 1.46009 1.07412 1.65535L6.22441 6.80564C6.41967 7.0009 6.41967 7.31749 6.22441 7.51275L1.39254 12.3446C1.19727 12.5399 1.19727 12.8565 1.39254 13.0517L2.07132 13.7305C2.26658 13.9258 2.58317 13.9258 2.77843 13.7305L7.6103 8.89864Z`,fill:`#656565`})}),DC=e=>(0,G.jsxs)(`svg`,{width:25,height:14,viewBox:`0 0 25 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,...e,children:[(0,G.jsx)(`rect`,{width:25,height:14,fill:`url(#pattern0)`}),(0,G.jsxs)(`defs`,{children:[(0,G.jsx)(`pattern`,{id:`pattern0`,patternContentUnits:`objectBoundingBox`,width:1,height:1,children:(0,G.jsx)(`use`,{xlinkHref:`#image0_554_760`,transform:`translate(0 -0.0197228) scale(0.0149254 0.0266525)`})}),(0,G.jsx)(`image`,{id:`image0_554_760`,width:67,height:39,xlinkHref:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEMAAAAnCAYAAABUr/U/AAAOXUlEQVRoBb1aaVBbV5bm3yx/OlM9NTM1P8bT1VVdNVM1mUnVVCbVhnhh8R5vsbHTsUN3XJlkpivt6p6qTjpO4thG7LsQAsRqwDbesI3BNhixb1rfE0JIbxF670GMtycksZmEb+oKRIQiEWzcoeqW3t3P+d75Luec+6KiQv6mUqgT3mSqz5tMyeGKT2Ga9qYaZrxphhlfun7Gl6Gf8WbpZyZzBmbduQOzT/P6Zh8X9M5OFPTMTSi75ybU3XMTxR1zYlGvxOUPHgjZbk3VmkLHtTIVI5eoGVmlZuSCYkbOK2XlLA0rp5excmoFJ+eWsrqCEkabU8Jos0tZbUY5r00v57WKSl57tprXnjnPa7+s4bWnLji1n1505vz+yuhrETfHOeMGn8I87lNQWLWkmOBL18OXpYc3exDenAF48vowWdALd2EP5KIuyMWdkEu0kMvaIFe0Qq66B7nmDp7W3AVb1F8SUYiQjqtKfkOlyjFdWsSgSM2gQM0it4RFVimLjDIOqRUckqsWfwuKV/alVXBQVHE4V83jq/M8vqzl8fkFJ/50yYk/Xnbidw2j+N0N162T152vrNgWp02v+JLN06uCsASSN9mMqUwdvNkD8Ob2w5PfC4+SANEFt7oT7pIOyKVayOVteFpxD3I1AaIZ7rrbcF9qxJNLjbAV9/7bCgEiVGpVDqNGxUBdxKBQzSKvmEV2KYtMDYfvlOWQU8L6SzBIBIizBIgaHl/WOXEqAES9Ex83uPDbm6P47U0X/vemk1qx/ZSCMq4FiOUx6Xp48/rhKSBAdGNS1YXJ4g64iTVolqyh8h7k83ch196GfLERk/W3MHm5AZPXri14Gq7VrxAgTKW+0B5dpmJQUsRApWaQX7yksIZFejmHlMrFt55WvggGASJ9yVqCgfiCAHHxO4v4uGEUHzW68FHjKP6n0YUPG0fx4W1Xrl+ERXr8ADVCqONVmOHJ74GnsBvuok5MlnRgslQLd9l9uCtaIFfdhbvmjh8I96VbcF++AffVawveG1fmPTcufzt5+7rwtL7+J2EwWG6qUjnGA/RQLtEjW7OSHmerOb+lZBGAgmhDLOJ0DY8AEJ/6qTGKkw2j+O8m11IhzwI+aHLhg6ZROYnQZUpBn1p+4yuUNs/7kik5XJlUULI7e9AnF/TMycruOVndNfdU3T73pFT77JGm7dmj8vvPHlW2Pnt4vuXZk0uN85PXr857Gi5/6228Outtangy1XLb5WtpOr6sechDnZI5SehRHESPnCV6ZGhYObWckxVVnJxSyTkzStn2tHK2PaWCbT9bzfvL6fN8++d1zvZTF5ztn1xytn9S72z/v6vO9hNNLt37zaPjJ5pdOHFH8Jf3m134zR0XkprFzVE+Ba0NBwaxmBAZX6gqX7/wz96blxc8jde83rs3H0y1NrFT7Xep6e62K5EWrFQ55AA9yMFIzgRCg2wNr400Z63tHzQxP//1XQG/ubdYku66kHRPwLstrtNR3mTz9XBgTCVTJ9a6wQ+N8zY3FPru3RKn2+7Ypjpb9b6ejvap/s7bXl3X5tC51YV2DaEHOTT99CCHpoZFZhm3kKnh1/2CkprFnUT591oFvNci4FirgGP3BbyjFZKips+ZE8OB4VVQ3lBBX7Q+2XLzjSntPXqqo7VvqrezZXqgu2Fa31c7azb+PnRNTaFjfpEeS4emnx4sMkvY66FjX6R+vEWQjrW6/CC8e1/Er9oEvNMm4JBW+g//ej6FeT4cID4FpXmRDcPNmepqL5/p72ia1vVenjMNVkzTJuXskDlthh9eftuVhcx1Qg+/TxHsN2jY+XBrPm/b8Vbhc6L8YhH9IBzRCkhsF8zLaxGlI4Dx7cxLOjt8g52xPn1/3SxlKJmlTTkzw5Zz84z9k1nOEUcEqVXyG0qLmIUAPQI+BXGu0kvZ/GVhX/Dh6K3xvz163+U5qhVxtE3AEa2II+0CDncIONgp7FuxLKFFOEC8KXTfioHrqMwMGc/MWan0ecb2xSxv/8Mzp+PDOdH1LsbH/7pCxWjD0SNdw8nr2HJ56tE2oZIon9gh4rAfBBGHOgXs7xI7lwcFHnznTCfDgqGg8DTVGh0Yt57fGSsVO8/YP511Oj6eGeXfnxsTEr958GB3910hcZkeQS438R0yypwn17Mnmbu/Y/xfDhMQOgQc6hSJJeBgp4QD3SLe6h0LH6NMKcxMKCCTKRQepVCP1isQmQ+G+YtnTuajb1z88W/Gxw/MT0xsg2diY3UZy32PHosu9/jL2PftdpfpYJcAUg50iTjQI2Ffj4Q9vUJtxPXnki2vepOphQAgHgUFOYXG41QaUhq17jdENn72QPyvbx482DP/+PFWPH78+q2ro2cIPYJd7swllzu1yrVuizzUKSTt75awv1vA/h4Re3sk7O0lQIie6C7330QEg3R4lpwwr4LCZAqNJ6k0HqbRkFLpuVUnrrETovhX8w/HYyDLr816PL8oVTNy2Ii0nDeucclVh+3tESeIFeztEfwgvNUrYk+fhB19YuqqE0kniWA9Cmqe0ONpKo1HqTS+9lsGDT7NcucHF1jDALgf/GzG7f5ZbZXzj2Ej0nJu4Vzt+h2s/Z1CEVH+rV4JARB29YnYOSBKaxBzcchjBZ3iXqLHRJoFY2k0hHQ/GAt85vqFBPCXAH5SrHLMB9PDH3CVcyAJmTULG2FgbOvE3+/pk6Z294nY3SeB/O7ql7CjX0TsoLg9wrTwzRNptEzoMZ5KQ0yjMZpuAZthwXDmkDX8jOdrVasYDaFHaESaUv5yHKzd3ULL7n4Ju/pF7BqQiDVgu05CwqA48HySRkVFfZ1O73xAzoo0Gq50C/gMCxwEjIwhmLKGdz73gkETNEp+Q3ERsxBI2AQiUpKbOFvJrdvr3d0rxe7sJ3SQsJ2AMChh26CIBP0YYgekXwSJsvZHV6rFSqzCmW4Bk2HBSMYQhjIJGNZ1OUJFakZL6BGcqiMJG0Ul91LioZ39oo0AQEqCTvSXeL2EWMNYxdq1DxlJzgdnmmWBy7DAnjkEa+YQLJlWAga6s60pIcPXVC0s5KKLipgFQg+/yx2UsDlTvX4Ha0eP8IcEPwgStukkxOtExBkkxBrHfK/bPD9dk5CRBg2nW64TetgyCBBDoLKsMGRb0ZdjndfmhCRTIy0S1K4qZpjCQBpvKSIl9Eiu4tbt2O0cfPgPCTrhKbGCQIk1jGGrQcIWo3QmSIwXf7RmDM0TetBZVhizrNBlD6MvZxhtubbnOvUL1M7E0IiUuNz+fGbd+h2sHQOumnj9oiXEGccQa5Cw1TiGTQaRe3HtQ2YasoZPEqswZ1mhz7aiP2cYPTnDaM+xLbTmjrwaMjxitVDNyMv0CEr3n6vmmYiT1tgRpxt9LUEvzMQZRL8lEBC2GCVsNo0hhg6JSte4ZsRhhqzhR4Qeg9nD6M0ZRmeODdpcG5ry7WtSJL+YO7nsUwTRI6WSW/jsJThY23Su3niDgFiD6Adhi2kMm00Sos1Sd0SlXrSjK9caHaBHN7GKXBvu59lwL28EV5UjPxi3KIuZ6eBLoEA2+3TN9x2sfSbtK0nGniPv9Q9+ekjfsmoWneizQ8cfjze4EGcUsNVvDRLeNEmIocYQY/z6X19U51XndeXa+gg9OpasoiVvBHfyR9CQb1/1X2JuCadZQY+lS6BzVdx8qFX4gdB3Pjxm6sCvTN14xzgwe6zTtm01wbYZnc44owtbjQK2EBDMi0D8khpb8+3dauuH7etR8hs6cmwLhB6teTbczR/B7fwR3My340KhPayzpFTyG5RqZj5wCRSISMmh+cV5/ntzkga7rySZ2/AdGH04MmiaCCtQVFTUdr0rJcHkRKzJhS1mAW+aRURTY9holmZepR78XaR5L6W9OW9E05a7SI/m/BHcyrfjeoEd9UrHAkndhW6Sr2G1wfQI3JGerebDRsG/1nfbgsE4auxDolGHgwPD6aFrbzQ++scEE+eJNzmx1eTCJkpEDC1hIz2GNyzSZ6Hj/yz15rwRL6FHY/4IbuTbcbXAjktKB0jqLnhDpYbfoCxmFwL5TP8dKfE0qzh8VhfewUrq02mCwThCwDDp8LbBPL9PK6+4JN5uYG8kmDjEmZ3YYnbhTVpEtEXCL4fGbMFy/FmfyYEZoMe1AjsuKx24UOhAjYpBYTG3nJDJ1bBMgB6BiJTQ46saflV3/j1913SAJotg6PG2yYi9OmtjQLF4I/ef280s4s0cYiknNlEuxFgWwdhoGUsMjPtRfq8WOFwNBXZcUTpwUelAXaED1eRKUM36U3VZpc7E0Ig08AnBqdrRVQO9pF7DyWUwTP04bNTjoMmI/UYau3X214mCO8wOxzYzizgzh820E2/SLsQMidg4JK2wzh8FjLpiLvpygX2hfskqzqsYVKoYkDvSwmJmWlnM+OmxGJGyIC63opIj30msyS95Vz849o6pG0eCwTBReMs0NLWDGnm8nbIjgWIRS3HYRMCwCIihXbPRRunffxQAQjepLmK0hB61hQ5UqRiUB31CEBqREnqcreYX/lTHr8ljPaQ3Rx819Cz4wTAtWsY+E4U95iHsNA9jG2VHPM1iC81hk4WAMYoYmq8JlfFHq1dUOF85r3LMEXpUqBgE35GGRqT+Q/Oi87lM+JDO2Jpo7sdhkx4HTEYQMHaZh7DDPIwEyoG4JTA20zwB5OsfTfFIG6nL2URCD/JhSbhLIEIPYhWna1c/NCOt/7bJ8OgQAcNsxF4CBmXFdmoRjHiaQSyxDJqbixlyruqYRVr/pbfnlrKJKjUzFyki/bKWs56ueP5wnwgap7f+034zPbSfgGEOBoPQhMEWmp3cbHU+X07zpSMQZsH0Mj4/Q8OyqeWs/2OSr87zfZ/Vrz8094NiGH5jO2W7v42yjSXQdjGOYnSxNJsWRowXbvp/SRXI2cTQoJkAAAAASUVORK5CYII=`})]})]}),OC=e=>(0,G.jsx)(`svg`,{width:10,height:16,viewBox:`0 0 10 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,G.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.09928 8L0.795978 1.6967L2.21019 0.282485L9.92771 8L2.21019 15.7175L0.795978 14.3033L7.09928 8Z`,fill:`#656565`})}),kC=e=>(0,G.jsx)(`svg`,{width:10,height:16,viewBox:`0 0 10 16`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,G.jsx)(`path`,{fillRule:`nonzero`,clipRule:`nonzero`,d:`M2.88607 8L9.18937 1.6967L7.77516 0.282485L0.057645 8L7.77516 15.7175L9.18937 14.3033L2.88607 8Z`,fill:`#656565`})}),AC=e=>(0,G.jsx)(`svg`,{width:21,height:14,viewBox:`0 0 21 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,G.jsx)(`path`,{d:`M20.7821 1.17019C20.6468 1.09075 20.4797 1.08765 20.3417 1.16226L15.5234 3.77075V2.20562C15.522 0.988049 14.5268 0.00137851 13.2988 0H2.22458C0.996541 0.00137851 0.00139036 0.988049 0 2.20562V10.9144C0.00139036 12.1319 0.996541 13.1186 2.22458 13.12H13.2988C14.5268 13.1186 15.522 12.1319 15.5234 10.9144V9.37768L20.3418 11.9862C20.4797 12.0608 20.647 12.0579 20.7821 11.9784C20.9173 11.8988 21 11.7546 21 11.599V1.54945C21 1.39368 20.9171 1.24962 20.7821 1.17019ZM14.6332 10.9146C14.6325 11.6452 14.0353 12.2371 13.2984 12.2379H2.22458C1.48769 12.2371 0.8907 11.6452 0.889831 10.9146V2.20562C0.8907 1.47518 1.48769 0.88311 2.22458 0.882248H13.2988C14.0355 0.88311 14.6327 1.47518 14.6335 2.20562L14.6332 10.9146ZM20.1102 10.8556L15.5234 8.37257V4.77586L20.1102 2.29298V10.8556Z`,fill:`#F06464`})}),jC=e=>(0,G.jsx)(`svg`,{width:14.5,height:14.5,viewBox:`0 0 50 50`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,G.jsx)(`path`,{d:`m37.5 22.5416c-.5526 0-1.0825.2195-1.4732.6102s-.6102.9206-.6102 1.4732v14.9583c0 .5525-.2195 1.0824-.6102 1.4731s-.9206.6102-1.4731.6102h-22.9167c-.55251 0-1.08241-.2195-1.47311-.6102s-.6102-.9206-.6102-1.4731v-22.9167c0-.5525.2195-1.0824.6102-1.4731s.9206-.6102 1.47311-.6102h14.9584c.5525 0 1.0824-.2195 1.4731-.6102s.6102-.9206.6102-1.4731c0-.5526-.2195-1.0825-.6102-1.4732s-.9206-.6102-1.4731-.6102h-14.9584c-1.65758 0-3.24729.6585-4.41939 1.8306s-1.83058 2.7618-1.83058 4.4194v22.9167c0 1.6576.65848 3.2473 1.83058 4.4194s2.76181 1.8306 4.41939 1.8306h22.9167c1.6576 0 3.2473-.6585 4.4194-1.8306s1.8306-2.7618 1.8306-4.4194v-14.9583c0-.5526-.2195-1.0825-.6102-1.4732s-.9206-.6102-1.4731-.6102zm8.1666-17.08331c-.2114-.50906-.6159-.91359-1.125-1.125-.2504-.10675-.5194-.16337-.7916-.16666h-12.5c-.5526 0-1.0825.21949-1.4732.61019s-.6102.9206-.6102 1.47314c0 .55253.2195 1.08244.6102 1.47314s.9206.61019 1.4732.61019h7.4791l-21.4583 21.43751c-.1953.1937-.3503.4241-.456.678-.1058.2538-.1603.5261-.1603.8012 0 .275.0545.5473.1603.8012.1057.2538.2607.4843.456.6779.1937.1953.4241.3503.678.456.2538.1058.5261.1603.8012.1603.275 0 .5473-.0545.8012-.1603.2538-.1057.4843-.2607.6779-.456l21.4375-21.4583v7.4792c0 .5525.2195 1.0824.6102 1.4731s.9206.6102 1.4732.6102c.5525 0 1.0824-.2195 1.4731-.6102s.6102-.9206.6102-1.4731v-12.50004c-.0033-.27225-.0599-.5412-.1667-.79167z`,fill:`#ffffff`})}),MC=e=>(0,G.jsx)(`svg`,{width:14.5,height:14.5,viewBox:`0 0 50 50`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,G.jsx)(`path`,{d:`m37.5 22.5416c-.5526 0-1.0825.2195-1.4732.6102s-.6102.9206-.6102 1.4732v14.9583c0 .5525-.2195 1.0824-.6102 1.4731s-.9206.6102-1.4731.6102h-22.9167c-.55251 0-1.08241-.2195-1.47311-.6102s-.6102-.9206-.6102-1.4731v-22.9167c0-.5525.2195-1.0824.6102-1.4731s.9206-.6102 1.47311-.6102h14.9584c.5525 0 1.0824-.2195 1.4731-.6102s.6102-.9206.6102-1.4731c0-.5526-.2195-1.0825-.6102-1.4732s-.9206-.6102-1.4731-.6102h-14.9584c-1.65758 0-3.24729.6585-4.41939 1.8306s-1.83058 2.7618-1.83058 4.4194v22.9167c0 1.6576.65848 3.2473 1.83058 4.4194s2.76181 1.8306 4.41939 1.8306h22.9167c1.6576 0 3.2473-.6585 4.4194-1.8306s1.8306-2.7618 1.8306-4.4194v-14.9583c0-.5526-.2195-1.0825-.6102-1.4732s-.9206-.6102-1.4731-.6102zm8.1666-17.08331c-.2114-.50906-.6159-.91359-1.125-1.125-.2504-.10675-.5194-.16337-.7916-.16666h-12.5c-.5526 0-1.0825.21949-1.4732.61019s-.6102.9206-.6102 1.47314c0 .55253.2195 1.08244.6102 1.47314s.9206.61019 1.4732.61019h7.4791l-21.4583 21.43751c-.1953.1937-.3503.4241-.456.678-.1058.2538-.1603.5261-.1603.8012 0 .275.0545.5473.1603.8012.1057.2538.2607.4843.456.6779.1937.1953.4241.3503.678.456.2538.1058.5261.1603.8012.1603.275 0 .5473-.0545.8012-.1603.2538-.1057.4843-.2607.6779-.456l21.4375-21.4583v7.4792c0 .5525.2195 1.0824.6102 1.4731s.9206.6102 1.4732.6102c.5525 0 1.0824-.2195 1.4731-.6102s.6102-.9206.6102-1.4731v-12.50004c-.0033-.27225-.0599-.5412-.1667-.79167z`,fill:`#656565`})}),NC=e=>(0,G.jsx)(`svg`,{width:16,height:10,viewBox:`0 0 16 10`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,G.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.79599 2.82817L13.996 9.23311L15.433 7.84208L7.84197 0.00011482L8.50898e-06 7.59114L1.39104 9.02816L7.79599 2.82817Z`,fill:`#f06464`})}),PC=e=>(0,G.jsx)(`svg`,{width:16,height:10,viewBox:`0 0 16 10`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,G.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.71753 6.60685L1.41423 0.303546L1.3929e-05 1.71776L7.71753 9.43527L15.435 1.71776L14.0208 0.303546L7.71753 6.60685Z`,fill:`#f06464`})}),FC=Object.defineProperty,IC=(e,t)=>{let n={};for(var r in e)FC(n,r,{get:e[r],enumerable:!0});return t||FC(n,Symbol.toStringTag,{value:`Module`}),n},LC=$C(),K=e=>JC(e,LC),RC=$C();K.write=e=>JC(e,RC);var zC=$C();K.onStart=e=>JC(e,zC);var BC=$C();K.onFrame=e=>JC(e,BC);var VC=$C();K.onFinish=e=>JC(e,VC);var HC=[];K.setTimeout=(e,t)=>{let n=K.now()+t,r=()=>{let e=HC.findIndex(e=>e.cancel==r);~e&&HC.splice(e,1),KC-=+!!~e},i={time:n,handler:e,cancel:r};return HC.splice(UC(n),0,i),KC+=1,YC(),i};var UC=e=>~(~HC.findIndex(t=>t.time>e)||~HC.length);K.cancel=e=>{zC.delete(e),BC.delete(e),VC.delete(e),LC.delete(e),RC.delete(e)},K.sync=e=>{qC=!0,K.batchedUpdates(e),qC=!1},K.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,K.onStart(n)}return r.handler=e,r.cancel=()=>{zC.delete(n),t=null},r};var WC=typeof window<`u`?window.requestAnimationFrame:()=>{};K.use=e=>WC=e,K.now=typeof performance<`u`?()=>performance.now():Date.now,K.batchedUpdates=e=>e(),K.catch=console.error,K.frameLoop=`always`,K.onDemand=()=>{},K.advance=()=>{K.frameLoop===`demand`?QC():console.warn(`Cannot call the manual advancement of rafz whilst frameLoop is not set as demand`)};var GC=-1,KC=0,qC=!1;function JC(e,t){qC?(t.delete(e),e(0)):(t.add(e),YC(),K.frameLoop===`demand`&&K.onDemand())}function YC(){GC<0&&(GC=0,K.frameLoop!==`demand`&&WC(ZC))}function XC(){GC=-1}function ZC(){~GC&&(WC(ZC),K.batchedUpdates(QC))}function QC(){let e=GC;GC=K.now();let t=UC(GC);if(t&&(ew(HC.splice(0,t),e=>e.handler()),KC-=t),!KC){XC();return}zC.flush(),LC.flush(e?Math.min(64,GC-e):16.667),BC.flush(),RC.flush(),VC.flush(),K.frameLoop===`demand`&&KC>0&&K.onDemand()}function $C(){let e=new Set,t=e;return{add(n){KC+=+(t==e&&!e.has(n)),e.add(n)},delete(n){return KC-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,KC-=t.size,ew(t,t=>t(n)&&e.add(t)),KC+=e.size,t=e)}}}function ew(e,t){e.forEach(e=>{try{t(e)}catch(e){K.catch(e)}})}function tw(){}var nw=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),q={arr:Array.isArray,obj:e=>!!e&&e.constructor.name===`Object`,fun:(e=>typeof e==`function`),str:e=>typeof e==`string`,num:e=>typeof e==`number`,und:e=>e===void 0};function rw(e,t){if(q.arr(e)){if(!q.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var J=(e,t)=>e.forEach(t);function iw(e,t,n){if(q.arr(e)){for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);return}for(let r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var aw=e=>q.und(e)?[]:q.arr(e)?e:[e];function ow(e,t){if(e.size){let n=Array.from(e);e.clear(),J(n,t)}}var sw=(e,...t)=>ow(e,e=>e(...t)),cw=()=>typeof window>`u`||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),lw=IC({assign:()=>hw,colors:()=>fw,createStringInterpolator:()=>uw,skipAnimation:()=>pw,to:()=>dw,willAdvance:()=>mw}),uw,dw,fw=null,pw=!1,mw=tw,hw=e=>{e.to&&(dw=e.to),e.now&&(K.now=e.now),e.colors!==void 0&&(fw=e.colors),e.skipAnimation!=null&&(pw=e.skipAnimation),e.createStringInterpolator&&(uw=e.createStringInterpolator),e.requestAnimationFrame&&K.use(e.requestAnimationFrame),e.batchedUpdates&&(K.batchedUpdates=e.batchedUpdates),e.willAdvance&&(mw=e.willAdvance),e.frameLoop&&(K.frameLoop=e.frameLoop),e.onDemand&&(K.onDemand=e.onDemand)},gw=new Set,_w=[],vw=[],yw=0,bw={get idle(){return!gw.size&&!_w.length},start(e){yw>e.priority?(gw.add(e),K.onStart(xw)):(Sw(e),K(ww))},advance:ww,sort(e){if(yw)K.onFrame(()=>bw.sort(e));else{let t=_w.indexOf(e);~t&&(_w.splice(t,1),Cw(e))}},clear(){_w=[],gw.clear()}};function xw(){gw.forEach(Sw),gw.clear(),K(ww)}function Sw(e){_w.includes(e)||Cw(e)}function Cw(e){_w.splice(Tw(_w,t=>t.priority>e.priority),0,e)}function ww(e){let t=vw;for(let n=0;n<_w.length;n++){let r=_w[n];yw=r.priority,r.idle||(mw(r),r.advance(e),r.idle||t.push(r))}return yw=0,vw=_w,vw.length=0,_w=t,_w.length>0}function Tw(e,t){let n=e.findIndex(t);return n<0?e.length:n}var Ew=(e,t,n)=>Math.min(Math.max(n,e),t),Dw={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Ow=`[-+]?\\d*\\.?\\d+`,kw=`[-+]?\\d*\\.?\\d+%`;function Aw(...e){return`\\(\\s*(`+e.join(`)\\s*,\\s*(`)+`)\\s*\\)`}var jw=RegExp(`rgb`+Aw(Ow,Ow,Ow)),Mw=RegExp(`rgba`+Aw(Ow,Ow,Ow,Ow)),Nw=RegExp(`hsl`+Aw(Ow,kw,kw)),Pw=RegExp(`hsla`+Aw(Ow,kw,kw,Ow)),Fw=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Iw=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Lw=/^#([0-9a-fA-F]{6})$/,Rw=/^#([0-9a-fA-F]{8})$/;function zw(e){let t;return typeof e==`number`?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Lw.exec(e))?parseInt(t[1]+`ff`,16)>>>0:fw&&fw[e]!==void 0?fw[e]:(t=jw.exec(e))?(Hw(t[1])<<24|Hw(t[2])<<16|Hw(t[3])<<8|255)>>>0:(t=Mw.exec(e))?(Hw(t[1])<<24|Hw(t[2])<<16|Hw(t[3])<<8|Ww(t[4]))>>>0:(t=Fw.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+`ff`,16)>>>0:(t=Rw.exec(e))?parseInt(t[1],16)>>>0:(t=Iw.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Nw.exec(e))?(Vw(Uw(t[1]),Gw(t[2]),Gw(t[3]))|255)>>>0:(t=Pw.exec(e))?(Vw(Uw(t[1]),Gw(t[2]),Gw(t[3]))|Ww(t[4]))>>>0:null}function Bw(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Vw(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,a=Bw(i,r,e+1/3),o=Bw(i,r,e),s=Bw(i,r,e-1/3);return Math.round(a*255)<<24|Math.round(o*255)<<16|Math.round(s*255)<<8}function Hw(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function Uw(e){return(parseFloat(e)%360+360)%360/360}function Ww(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Gw(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function Kw(e){let t=zw(e);return t===null?e:(t||=0,`rgba(${(t&4278190080)>>>24}, ${(t&16711680)>>>16}, ${(t&65280)>>>8}, ${(t&255)/255})`)}var qw=(e,t,n)=>{if(q.fun(e))return e;if(q.arr(e))return qw({range:e,output:t,extrapolate:n});if(q.str(e.output[0]))return uw(e);let r=e,i=r.output,a=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||`extend`,s=r.extrapolateRight||r.extrapolate||`extend`,c=r.easing||(e=>e);return e=>{let t=Yw(e,a);return Jw(e,a[t],a[t+1],i[t],i[t+1],c,o,s,r.map)}};function Jw(e,t,n,r,i,a,o,s,c){let l=c?c(e):e;if(l<t){if(o===`identity`)return l;o===`clamp`&&(l=t)}if(l>n){if(s===`identity`)return l;s===`clamp`&&(l=n)}return r===i?r:t===n?e<=t?r:i:(t===-1/0?l=-l:n===1/0?l-=t:l=(l-t)/(n-t),l=a(l),r===-1/0?l=-l:i===1/0?l+=r:l=l*(i-r)+r,l)}function Yw(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var Xw=(e,t=`end`)=>n=>{n=t===`end`?Math.min(n,.999):Math.max(n,.001);let r=n*e;return Ew(0,1,(t===`end`?Math.floor(r):Math.ceil(r))/e)},Zw=1.70158,Qw=Zw*1.525,$w=2.70158,eT=2*Math.PI/3,tT=2*Math.PI/4.5,nT=e=>{let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},rT={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-(-2*e+2)**2/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-(1-e)**3,easeInOutCubic:e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-(1-e)**4,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-(-2*e+2)**4/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-(1-e)**5,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-(-2*e+2)**5/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:2**(10*e-10),easeOutExpo:e=>e===1?1:1-2**(-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-e**2),easeOutCirc:e=>Math.sqrt(1-(e-1)**2),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2,easeInBack:e=>$w*e*e*e-Zw*e*e,easeOutBack:e=>1+$w*(e-1)**3+Zw*(e-1)**2,easeInOutBack:e=>e<.5?(2*e)**2*(7.189819*e-Qw)/2:((2*e-2)**2*(3.5949095*(e*2-2)+Qw)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*eT),easeOutElastic:e=>e===0?0:e===1?1:2**(-10*e)*Math.sin((e*10-.75)*eT)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*tT))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*tT)/2+1,easeInBounce:e=>1-nT(1-e),easeOutBounce:nT,easeInOutBounce:e=>e<.5?(1-nT(1-2*e))/2:(1+nT(2*e-1))/2,steps:Xw},iT=Symbol.for(`FluidValue.get`),aT=Symbol.for(`FluidValue.observers`),oT=e=>!!(e&&e[iT]),sT=e=>e&&e[iT]?e[iT]():e,cT=e=>e[aT]||null;function lT(e,t){e.eventObserved?e.eventObserved(t):e(t)}function uT(e,t){let n=e[aT];n&&n.forEach(e=>{lT(e,t)})}var dT=class{constructor(e){if(!e&&!(e=this.get))throw Error(`Unknown getter`);fT(this,e)}},fT=(e,t)=>hT(e,iT,t);function pT(e,t){if(e[iT]){let n=e[aT];n||hT(e,aT,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function mT(e,t){let n=e[aT];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[aT]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var hT=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),gT=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_T=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,vT=RegExp(`(${gT.source})(%|[a-z]+)`,`i`),yT=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,bT=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,xT=e=>{let[t,n]=ST(e);if(!t||cw())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r?r.trim():n&&n.startsWith(`--`)?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&bT.test(n)?xT(n):n||e},ST=e=>{let t=bT.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},CT,wT=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,TT=e=>e.match(gT)??[],ET=e=>{CT||=fw?RegExp(`(${Object.keys(fw).join(`|`)})(?!\\w)`,`g`):/^\b$/;let t=e.output.map(e=>sT(e).replace(bT,xT).replace(_T,Kw).replace(CT,Kw)),n=t.map(e=>TT(e).map(Number)),r=n[0].map((e,t)=>n.map(e=>{if(!(t in e))throw Error(`The arity of each "output" value must be equal`);return e[t]})).map(t=>qw({...e,output:t})),i=e.range||[0,1],a=t.map(e=>TT(e)),o=a[0].map((e,t)=>{let n=a.map(e=>{let n=e[t],r=n.indexOf(`.`);return r===-1?0:n.length-r-1});return n.every(e=>e===n[0])&&n[0]>0?n[0]:null});return e=>{let n=i.indexOf(e);if(n!==-1)return t[n];let a=!vT.test(t[0])&&t.find(e=>vT.test(e))?.replace(gT,``),s=0;return t[0].replace(gT,()=>{let t=s++,n=r[t](e),i=o[t];return`${i==null?n:n.toFixed(i)}${a||``}`}).replace(yT,wT)}},DT=`react-spring: `,OT=e=>{let t=e,n=!1;if(typeof t!=`function`)throw TypeError(`${DT}once requires a function parameter`);return(...e)=>{n||=(t(...e),!0)}},kT=OT(console.warn);function AT(){kT(`${DT}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var jT=OT(console.warn);function MT(){jT(`${DT}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function NT(e){return q.str(e)&&(e[0]==`#`||/\d/.test(e)||!cw()&&bT.test(e)||e in(fw||{}))}var PT=cw()?W.useEffect:W.useLayoutEffect,FT=()=>{let e=(0,W.useRef)(!1);return PT(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function IT(){let e=(0,W.useState)()[1],t=FT();return()=>{t.current&&e(Math.random())}}var LT=e=>(0,W.useEffect)(e,RT),RT=[];function zT(e){let t=(0,W.useRef)(void 0);return(0,W.useEffect)(()=>{t.current=e}),t.current}var BT=Symbol.for(`Animated:node`),VT=e=>!!e&&e[BT]===e,HT=e=>e&&e[BT],UT=(e,t)=>nw(e,BT,t),WT=e=>e&&e[BT]&&e[BT].getPayload(),GT=class{constructor(){UT(this,this)}getPayload(){return this.payload||[]}},KT=class e extends GT{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,q.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new e(t)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return q.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,q.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},qT=class e extends KT{constructor(e){super(0),this._string=null,this._toString=qw({output:[e,e]})}static create(t){return new e(t)}getValue(){return this._string??=this._toString(this._value)}setValue(e){if(q.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=qw({output:[this.getValue(),e]})),this._value=0,super.reset()}},JT={dependencies:null},YT=class extends GT{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return iw(this.source,(n,r)=>{VT(n)?t[r]=n.getValue(e):oT(n)?t[r]=sT(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&J(this.payload,e=>e.reset())}_makePayload(e){if(e){let t=new Set;return iw(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){JT.dependencies&&oT(e)&&JT.dependencies.add(e);let t=WT(e);t&&J(t,e=>this.add(e))}},XT=class e extends YT{constructor(e){super(e)}static create(t){return new e(t)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){let t=this.getPayload();return e.length==t.length?t.map((t,n)=>t.setValue(e[n])).some(Boolean):(super.setValue(e.map(ZT)),!0)}};function ZT(e){return(NT(e)?qT:KT).create(e)}function QT(e){let t=HT(e);return t?t.constructor:q.arr(e)?XT:NT(e)?qT:KT}var $T=(e,t)=>{let n=!q.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,W.forwardRef)((r,i)=>{let a=(0,W.useRef)(null),o=n&&(0,W.useCallback)(e=>{a.current=nE(i,e)},[i]),[s,c]=tE(r,t),l=IT(),u=()=>{let e=a.current;(!n||e)&&(e?t.applyAnimatedValues(e,s.getValue(!0)):!1)===!1&&l()},d=new eE(u,c),f=(0,W.useRef)(void 0);PT(()=>(f.current=d,J(c,e=>pT(e,d)),()=>{f.current&&(J(f.current.deps,e=>mT(e,f.current)),K.cancel(f.current.update))})),(0,W.useEffect)(u,[]),LT(()=>()=>{let e=f.current;J(e.deps,t=>mT(t,e))});let p=t.getComponentProps(s.getValue());return W.createElement(e,{...p,ref:o})})},eE=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type==`change`&&K.write(this.update)}};function tE(e,t){let n=new Set;return JT.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new YT(e),JT.dependencies=null,[e,n]}function nE(e,t){return e&&(q.fun(e)?e(t):e.current=t),t}var rE=Symbol.for(`AnimatedComponent`),iE=new WeakMap,aE=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=e=>new YT(e),getComponentProps:r=e=>e}={})=>{let i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},a=e=>{let t=oE(e)||`Anonymous`;if(q.str(e))e=a[e]||(a[e]=$T(e,i));else{let t=e[rE]??iE.get(e);if(!t){t=$T(e,i);try{e[rE]=t}catch{}iE.set(e,t)}e=t}return e.displayName=`Animated(${t})`,e};return iw(e,(t,n)=>{q.arr(e)&&(n=oE(t)),a[n]=a(t)}),{animated:a}},oE=e=>q.str(e)?e:e&&q.str(e.displayName)?e.displayName:q.fun(e)&&e.name||null;function sE(e,...t){return q.fun(e)?e(...t):e}var cE=(e,t)=>e===!0||!!(t&&e&&(q.fun(e)?e(t):aw(e).includes(t))),lE=(e,t)=>q.obj(e)?t&&e[t]:e,uE=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,dE=e=>e,fE=(e,t=dE)=>{let n=pE;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));let r={};for(let i of n){let n=t(e[i],i);q.und(n)||(r[i]=n)}return r},pE=[`config`,`onProps`,`onStart`,`onChange`,`onPause`,`onResume`,`onRest`],mE={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function hE(e){let t={},n=0;if(iw(e,(e,r)=>{mE[r]||(t[r]=e,n++)}),n)return t}function gE(e){let t=hE(e);if(t){let n={to:t};return iw(e,(e,r)=>r in t||(n[r]=e)),n}return{...e}}function _E(e){let t=sT(e);return q.arr(t)?t.map(_E):NT(t)?lw.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function vE(e){for(let t in e)return!0;return!1}function yE(e){return q.fun(e)||q.arr(e)&&q.obj(e[0])}function bE(e,t){e.ref?.delete(e),t?.delete(e)}function xE(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var SE={...{default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}}.default,mass:1,damping:1,easing:rT.linear,clamp:!1},CE=class{constructor(){this.velocity=0,Object.assign(this,SE)}};function wE(e,t,n){n&&(n={...n},TE(n,t),t={...n,...t}),TE(e,t),Object.assign(e,t);for(let t in SE)e[t]??(e[t]=SE[t]);let{frequency:r,damping:i}=e,{mass:a}=e;return q.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=(2*Math.PI/r)**2*a,e.friction=4*Math.PI*i*a/r),e}function TE(e,t){if(!q.und(t.decay))e.duration=void 0;else{let n=!q.und(t.tension)||!q.und(t.friction);(n||!q.und(t.frequency)||!q.und(t.damping)||!q.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var EE=[],DE=class{constructor(){this.changed=!1,this.values=EE,this.toValues=null,this.fromValues=EE,this.config=new CE,this.immediate=!1}};function OE(e,{key:t,props:n,defaultProps:r,state:i,actions:a}){return new Promise((o,s)=>{let c,l,u=cE(n.cancel??r?.cancel,t);if(u)p();else{q.und(n.pause)||(i.paused=cE(n.pause,t));let e=r?.pause;e!==!0&&(e=i.paused||cE(e,t)),c=sE(n.delay||0,t),e?(i.resumeQueue.add(f),a.pause()):(a.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(l),l.cancel(),c=l.time-K.now()}function f(){c>0&&!lw.skipAnimation?(i.delayed=!0,l=K.setTimeout(p,c),i.pauseQueue.add(d),i.timeouts.add(l)):p()}function p(){i.delayed&&=!1,i.pauseQueue.delete(d),i.timeouts.delete(l),e<=(i.cancelId||0)&&(u=!0);try{a.start({...n,callId:e,cancel:u},o)}catch(e){s(e)}}})}var kE=(e,t)=>t.length==1?t[0]:t.some(e=>e.cancelled)?ME(e.get()):t.every(e=>e.noop)?AE(e.get()):jE(e.get(),t.every(e=>e.finished)),AE=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),jE=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ME=e=>({value:e,cancelled:!0,finished:!1});function NE(e,t,n,r){let{callId:i,parentId:a,onRest:o}=t,{asyncTo:s,promise:c}=n;return!a&&e===s&&!t.reset?c:n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;let l=fE(t,(e,t)=>t===`onRest`?void 0:e),u,d,f=new Promise((e,t)=>(u=e,d=t)),p=e=>{let t=i<=(n.cancelId||0)&&ME(r)||i!==n.asyncId&&jE(r,!1);if(t)throw e.result=t,d(e),e},m=0,h=(e,t)=>{let a=new FE,o=new IE;return(async()=>{p(a);let s=q.obj(e)?{...e}:{...t,to:e};if(s.parentId=i,iw(l,(e,t)=>{q.und(s[t])&&(s[t]=e)}),lw.skipAnimation){if(++m>1024)throw PE(n),o.result=jE(r,!1),d(o),o;return s.immediate=!0,await r.start(s)}let c=await r.start(s);return p(a),n.paused&&await new Promise(e=>{n.resumeQueue.add(e)}),c})()},g;try{let t;t=q.arr(e)?(async e=>{for(let t of e)await h(t)})(e):Promise.resolve(e(h,r.stop.bind(r))),await Promise.all([t.then(u),f]),g=jE(r.get(),!0,!1)}catch(e){if(e instanceof FE)g=e.result;else if(e instanceof IE)g=e.result;else throw e}finally{i==n.asyncId&&(n.asyncId=a,n.asyncTo=a?s:void 0,n.promise=a?c:void 0)}return q.fun(o)&&K.batchedUpdates(()=>{o(g,r,r.item)}),g})()}function PE(e,t){ow(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var FE=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},IE=class extends Error{constructor(){super(`SkipAnimationSignal`)}},LE=e=>e instanceof zE,RE=1,zE=class extends dT{constructor(...e){super(...e),this.id=RE++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=HT(this);return e&&e.getValue()}to(...e){return lw.to(this,e)}interpolate(...e){return AT(),lw.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){uT(this,{type:`change`,parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||bw.sort(this),uT(this,{type:`priority`,parent:this,priority:e})}},BE=Symbol.for(`SpringPhase`),VE=1,HE=2,UE=4,WE=e=>(e[BE]&VE)>0,GE=e=>(e[BE]&HE)>0,KE=e=>(e[BE]&UE)>0,qE=(e,t)=>t?e[BE]|=3:e[BE]&=-3,JE=(e,t)=>t?e[BE]|=UE:e[BE]&=-5,YE=class extends zE{constructor(e,t){if(super(),this.animation=new DE,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!q.und(e)||!q.und(t)){let n=q.obj(e)?{...e}:{...t,from:e};q.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(GE(this)||this._state.asyncTo)||KE(this)}get goal(){return sT(this.animation.to)}get velocity(){let e=HT(this);return e instanceof KT?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return WE(this)}get isAnimating(){return GE(this)}get isPaused(){return KE(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{toValues:i}=r,{config:a}=r,o=WT(r.to);!o&&oT(r.to)&&(i=aw(sT(r.to))),r.values.forEach((s,c)=>{if(s.done)return;let l=s.constructor==qT?1:o?o[c].lastPosition:i[c],u=r.immediate,d=l;if(!u){if(d=s.lastPosition,a.tension<=0){s.done=!0;return}let t=s.elapsedTime+=e,n=r.fromValues[c],i=s.v0==null?s.v0=q.arr(a.velocity)?a.velocity[c]:a.velocity:s.v0,o,f=a.precision||(n==l?.005:Math.max(Math.max(Math.abs(l),Math.abs(n),1)*2**-52,Math.min(1,Math.abs(l-n)*.001)));if(!q.und(a.duration)){let r=1;a.duration>0&&(this._memoizedDuration!==a.duration&&(this._memoizedDuration=a.duration,s.durationProgress>0&&(s.elapsedTime=a.duration*s.durationProgress,t=s.elapsedTime+=e)),r=(a.progress||0)+t/this._memoizedDuration,r=r>1?1:r<0?0:r,s.durationProgress=r),d=n+a.easing(r)*(l-n),o=(d-s.lastPosition)/e,u=r==1}else if(a.decay){let e=a.decay===!0?.998:a.decay,r=Math.exp(-(1-e)*t);d=n+i/(1-e)*(1-r),u=Math.abs(s.lastPosition-d)<=f,o=i*r}else{o=s.lastVelocity==null?i:s.lastVelocity;let t=a.restVelocity||f/10,r=a.clamp?0:a.bounce,c=!q.und(r),p=n==l?s.v0>0:n<l,m,h=!1,g=Math.ceil(e/1);for(let e=0;e<g&&(m=Math.abs(o)>t,!(!m&&(u=Math.abs(l-d)<=f,u)));++e){c&&(h=d==l||d>l==p,h&&(o=-o*r,d=l));let e=(-a.tension*1e-6*(d-l)+-a.friction*.001*o)/a.mass;o+=e*1,d+=o*1}}s.lastVelocity=o,Number.isNaN(d)&&(console.warn(`Got NaN while animating:`,this),u=!0)}o&&!o[c].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,a.round)&&(n=!0)});let s=HT(this),c=s.getValue();if(t){let e=sT(r.to);(c!==e||n)&&!a.decay?(s.setValue(e),this._onChange(e)):n&&a.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(e){return K.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(GE(this)){let{to:e,config:t}=this.animation;K.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||=[]).push(e),this}start(e,t){let n;return q.und(e)?(n=this.queue||[],this.queue=[]):n=[q.obj(e)?e:{...t,to:e}],Promise.all(n.map(e=>this._update(e))).then(e=>kE(this,e))}stop(e){let{to:t}=this.animation;return q.und(t)||this._focus(this.get()),PE(this._state,e&&this._lastCallId),K.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type==`change`?this._start():e.type==`priority`&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||``,{to:n,from:r}=e;n=q.obj(n)?n[t]:n,(n==null||yE(n))&&(n=void 0),r=q.obj(r)?r[t]:r,r??=void 0;let i={to:n,from:r};return WE(this)||(e.reverse&&([n,r]=[r,n]),r=sT(r),q.und(r)?HT(this)||this._set(n):this._set(r)),i}_update({...e},t){let{key:n,defaultProps:r}=this;e.default&&Object.assign(r,fE(e,(e,t)=>/^on/.test(t)?lE(e,n):e)),tD(this,e,`onProps`),nD(this,`onProps`,e,this);let i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return OE(++this._lastCallId,{key:n,props:e,defaultProps:r,state:a,actions:{pause:()=>{KE(this)||(JE(this,!0),sw(a.pauseQueue),nD(this,`onPause`,jE(this,XE(this,this.animation.to)),this))},resume:()=>{KE(this)&&(JE(this,!1),GE(this)&&this._resume(),sw(a.resumeQueue),nD(this,`onResume`,jE(this,XE(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(n=>{if(e.loop&&n.finished&&!(t&&n.noop)){let t=ZE(e);if(t)return this._update(t,!0)}return n})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(ME(this));let r=!q.und(e.to),i=!q.und(e.from);if(r||i){if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(ME(this))}let{key:a,defaultProps:o,animation:s}=this,{to:c,from:l}=s,{to:u=c,from:d=l}=e;i&&!r&&(!t.default||q.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let f=!rw(d,l);f&&(s.from=d),d=sT(d);let p=!rw(u,c);p&&this._focus(u);let m=yE(t.to),{config:h}=s,{decay:g,velocity:_}=h;(r||i)&&!h.decay&&(h.velocity=0),t.config&&!m&&wE(h,sE(t.config,a),t.config===o.config?void 0:sE(o.config,a));let v=HT(this);if(!v||q.und(u))return n(jE(this,!0));let y=q.und(t.reset)?i&&!t.default:!q.und(d)&&cE(t.reset,a),b=y?d:this.get(),x=_E(u),S=q.num(x)||q.arr(x)||NT(x),C=!m&&(!S||cE(o.immediate||t.immediate,a));if(p){let e=QT(u);if(e!==v.constructor){if(C)v=this._set(x);else throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`)}}let w=v.constructor,T=oT(u),E=!1;if(!T){let e=y||!WE(this)&&f;(p||e)&&(E=rw(_E(b),x),T=!E),(!rw(s.immediate,C)&&!C||!rw(h.decay,g)||!rw(h.velocity,_))&&(T=!0)}if(E&&GE(this)&&(s.changed&&!y?T=!0:T||this._stop(c)),!m&&((T||oT(c))&&(s.values=v.getPayload(),s.toValues=oT(u)?null:w==qT?[1]:aw(x)),s.immediate!=C&&(s.immediate=C,!C&&!y&&this._set(c)),T)){let{onRest:e}=s;J(eD,e=>tD(this,t,e));let r=jE(this,XE(this,c));sw(this._pendingCalls,r),this._pendingCalls.add(n),s.changed&&K.batchedUpdates(()=>{s.changed=!y,e?.(r,this),y?sE(o.onRest,r):s.onStart?.(r,this)})}y&&this._set(b),m?n(NE(t.to,t,this._state,this)):T?this._start():GE(this)&&!p?this._pendingCalls.add(n):n(AE(b))}_focus(e){let t=this.animation;e!==t.to&&(cT(this)&&this._detach(),t.to=e,cT(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;oT(t)&&(pT(t,this),LE(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;oT(e)&&mT(e,this)}_set(e,t=!0){let n=sT(e);if(!q.und(n)){let e=HT(this);if(!e||!rw(n,e.getValue())){let r=QT(n);!e||e.constructor!=r?UT(this,r.create(n)):e.setValue(n),e&&K.batchedUpdates(()=>{this._onChange(n,t)})}}return HT(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,nD(this,`onStart`,jE(this,XE(this,e.to)),this))}_onChange(e,t){let n=jE(e,!1);t||(this._onStart(),sE(this.animation.onChange,n,this)),sE(this.defaultProps.onChange,n,this),super._onChange(e,t)}_start(){let e=this.animation;HT(this).reset(sT(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),GE(this)||(qE(this,!0),KE(this)||this._resume())}_resume(){lw.skipAnimation?this.finish():bw.start(this)}_stop(e,t){if(GE(this)){qE(this,!1);let n=this.animation;J(n.values,e=>{e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),uT(this,{type:`idle`,parent:this});let r=t?ME(this.get()):jE(this.get(),XE(this,e??n.to));sw(this._pendingCalls,r),n.changed=!1,nD(this,`onRest`,r,this)}}};function XE(e,t){let n=_E(t);return rw(_E(e.get()),n)}function ZE(e,t=e.loop,n=e.to){let r=sE(t);if(r){let i=r!==!0&&gE(r),a=(i||e).reverse,o=!i||i.reset;return QE({...e,loop:t,default:!1,pause:void 0,to:!a||yE(n)?n:void 0,from:o?e.from:void 0,reset:o,...i})}}function QE(e){let{to:t,from:n}=e=gE(e),r=new Set;return q.obj(t)&&$E(t,r),q.obj(n)&&$E(n,r),e.keys=r.size?Array.from(r):null,e}function $E(e,t){iw(e,(e,n)=>e!=null&&t.add(n))}var eD=[`onStart`,`onRest`,`onChange`,`onPause`,`onResume`];function tD(e,t,n){e.animation[n]=t[n]===uE(t,n)?void 0:lE(t[n],e.key)}function nD(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var rD=[`onStart`,`onChange`,`onRest`],iD=1,aD=class{constructor(e,t){this.id=iD++,this.springs={},this.queue=[],this._lastAsyncId=0,this._lastLoopId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(let t in e){let n=e[t];q.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(QE(e)),this}start(e){let{queue:t}=this;return e?t=aw(e).map(QE):this.queue=[],this._flush?this._flush(this,t):(fD(this,t),oD(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;J(aw(t),t=>n[t].stop(!!e))}else PE(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if(q.und(e))this.start({pause:!0});else{let t=this.springs;J(aw(e),e=>t[e].pause())}return this}resume(e){if(q.und(e))this.start({pause:!1});else{let t=this.springs;J(aw(e),e=>t[e].resume())}return this}each(e){iw(this.springs,e)}onLoopReset(e){let t=this._onLoopReset??=new Set;return t.add(e),()=>{t.delete(e)}}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,i=this._changed.size>0;(r&&!this._started||i&&!this._started)&&(this._started=!0,ow(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));let a=!r&&this._started,o=i||a&&n.size?this.get():null;i&&t.size&&ow(t,([e,t])=>{t.value=o,e(t,this,this._item)}),a&&(this._started=!1,ow(n,([e,t])=>{t.value=o,e(t,this,this._item)}))}eventObserved(e){if(e.type==`change`)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type==`idle`)this._active.delete(e.parent);else return;K.onFrame(this._onFrame)}};function oD(e,t){return Promise.all(t.map(t=>sD(e,t))).then(t=>kE(e,t))}async function sD(e,t,n){let{keys:r,to:i,from:a,loop:o,onRest:s,onResolve:c}=t,l=q.obj(t.default)&&t.default;o&&(t.loop=!1);let u=t,d=!n&&!u.parentId&&`loop`in t?++e._lastLoopId:n?u.loopId:e._lastLoopId;i===!1&&(t.to=null),a===!1&&(t.from=null);let f=q.arr(i)||q.fun(i)?i:void 0;f?(t.to=void 0,t.onRest=void 0,l&&(l.onRest=void 0)):J(rD,n=>{let r=t[n];if(q.fun(r)){let i=e._events[n];t[n]=(({finished:e,cancelled:t})=>{let n=i.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):i.set(r,{value:null,finished:e||!1,cancelled:t||!1})}),l&&(l[n]=t[n])}});let p=e._state;t.pause===!p.paused?(p.paused=t.pause,sw(t.pause?p.pauseQueue:p.resumeQueue)):p.paused&&(t.pause=!0);let m=(r||Object.keys(e.springs)).map(n=>e.springs[n].start(t)),h=t.cancel===!0||uE(t,`cancel`)===!0;(f||h&&p.asyncId)&&m.push(OE(++e._lastAsyncId,{props:t,state:p,actions:{pause:tw,resume:tw,start(t,n){h?(PE(p,e._lastAsyncId),n(ME(e))):(t.onRest=s,n(NE(f,t,p,e)))}}})),p.paused&&await new Promise(e=>{p.resumeQueue.add(e)});let g=kE(e,await Promise.all(m));if(o&&g.finished&&!(n&&g.noop)&&d===e._lastLoopId){let n=ZE(t,o,i);if(n)return n.loopId=d,e._onLoopReset?.forEach(e=>e()),fD(e,[n]),sD(e,n,!0)}return c&&K.batchedUpdates(()=>c(g,e,e.item)),g}function cD(e,t){let n={...e.springs};return t&&J(aw(t),e=>{q.und(e.keys)&&(e=QE(e)),q.obj(e.to)||(e={...e,to:void 0}),dD(n,e,e=>uD(e))}),lD(e,n),n}function lD(e,t){iw(t,(t,n)=>{e.springs[n]||(e.springs[n]=t,pT(t,e))})}function uD(e,t){let n=new YE;return n.key=e,t&&pT(n,t),n}function dD(e,t,n){t.keys&&J(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function fD(e,t){J(t,t=>{dD(e.springs,t,t=>uD(t,e))})}var pD=W.createContext({pause:!1,immediate:!1}),mD=()=>{let e=[],t=function(t){MT();let r=[];return J(e,(e,i)=>{if(q.und(t))r.push(e.start());else{let a=n(t,e,i);a&&r.push(e.start(a))}}),r};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return J(e,e=>e.pause(...arguments)),this},t.resume=function(){return J(e,e=>e.resume(...arguments)),this},t.set=function(t){J(e,(e,n)=>{let r=q.fun(t)?t(n,e):t;r&&e.set(r)})},t.start=function(t){let n=[];return J(e,(e,r)=>{if(q.und(t))n.push(e.start());else{let i=this._getProps(t,e,r);i&&n.push(e.start(i))}}),n},t.stop=function(){return J(e,e=>e.stop(...arguments)),this},t.update=function(t){return J(e,(e,n)=>e.update(this._getProps(t,e,n))),this};let n=function(e,t,n){return q.fun(e)?e(n,t):e};return t._getProps=n,t};function hD(e,t,n){let r=q.fun(t)&&t,{reset:i,sort:a,trail:o=0,reverse:s=!1,expires:c=!0,exitBeforeEnter:l=!1,onDestroyed:u,ref:d,config:f}=r?r():t,p=(0,W.useMemo)(()=>r||arguments.length==3?mD():void 0,[]),m=aw(e),h=[],g=(0,W.useRef)(null),_=i?null:g.current;PT(()=>{g.current=h}),LT(()=>(J(h,e=>{p?.add(e.ctrl),e.ctrl.ref=void 0}),()=>{J(g.current,e=>{e.expired&&clearTimeout(e.expirationId),bE(e.ctrl,p),e.ctrl.stop(!0)})}));let v=_D(m,r?r():t,_),y=i&&g.current||[];PT(()=>J(y,({ctrl:e,item:t,key:n})=>{bE(e,p),sE(u,t,n)}));let b=[];if(_&&J(_,(e,t)=>{e.expired?(clearTimeout(e.expirationId),y.push(e)):(t=b[t]=v.indexOf(e.key),~t&&(h[t]=e))}),J(m,(e,t)=>{h[t]||(h[t]={key:v[t],item:e,phase:`mount`,ctrl:new aD},h[t].ctrl.item=e)}),b.length){let e=-1,{leave:n}=r?r():t;J(b,(t,r)=>{let i=_[r];~t?(e=h.indexOf(i),h[e]={...i,item:m[t]}):n&&h.splice(++e,0,i)})}q.fun(a)&&h.sort((e,t)=>a(e.item,t.item));let x=-o,S=[],C=IT(),w=fE(t),T=new Map,E=(0,W.useRef)(new Map),ee=(0,W.useRef)(!1);if(J(h,(e,n)=>{let i=e.key,a=e.phase,s=r?r():t,u,p,m=sE(s.delay||0,i);if(a==`mount`)u=s.enter,p=`enter`;else{let e=v.indexOf(i)<0;if(a!=`leave`){if(e)u=s.leave,p=`leave`;else if(u=s.update)p=`update`;else return}else if(!e)u=s.enter,p=`enter`;else return}if(u=sE(u,e.item,n),u=q.obj(u)?gE(u):{to:u},!u.config){let t=f||w.config;u.config=sE(t,e.item,n,p)}x+=o;let h={...w,delay:m+x,ref:d,immediate:s.immediate,reset:!1,...u};if(p==`enter`&&q.und(h.from)){let i=r?r():t;h.from=sE(q.und(i.initial)||_?i.from:i.initial,e.item,n)}let{onResolve:y}=h;h.onResolve=e=>{sE(y,e);let t=g.current,n=t.find(e=>e.key===i);if(n&&!(e.cancelled&&n.phase!=`update`)&&n.ctrl.idle){let e=t.every(e=>e.ctrl.idle);if(n.phase==`leave`){E.current.delete(n);let t=sE(c,n.item);if(t!==!1){let r=t===!0?0:t;if(n.expired=!0,!e&&r>0){r<=2147483647&&(n.expirationId=setTimeout(C,r));return}}}e&&t.some(e=>e.expired)&&(l&&(ee.current=!0),C())}};let b=cD(e.ctrl,h);S.push({payload:h,propsDelay:m}),p===`leave`&&l?E.current.set(e,{phase:p,springs:b,payload:h}):T.set(e,{phase:p,springs:b,payload:h})}),s&&o){let e=S.length;J(S,({payload:t,propsDelay:n},r)=>{t.delay=n+(e-1-r)*o})}let te=(0,W.useContext)(pD),ne=te!==zT(te)&&vE(te);PT(()=>{ne&&J(h,e=>{e.ctrl.start({default:te})})},[te]),J(T,(e,t)=>{if(E.current.size){let e=h.findIndex(e=>e.key===t.key);h.splice(e,1)}}),PT(()=>{J(E.current.size?E.current:T,({phase:e,payload:t},n)=>{let{ctrl:r}=n;n.phase=e,p?.add(r),ne&&e==`enter`&&r.start({default:te}),t&&(xE(r,t.ref),r.ref&&!ee.current?r.update(t):(r.start(t),ee.current&&=!1))})},i?void 0:n);let re=e=>W.createElement(W.Fragment,null,h.map((t,n)=>{let r=T.get(t)||E.current.get(t),{springs:i}=r||t.ctrl,a=r?{...t,phase:r.phase}:t,o=e({...i},t.item,a,n),s=q.str(t.key)||q.num(t.key)?t.key:t.ctrl.id,c=o?.props??{},l=c?.ref;return o&&o.type?W.createElement(o.type,{...c,key:s,ref:l}):o}));return p?[re,p]:re}var gD=1;function _D(e,{key:t,keys:n=t},r){if(n===null){let t=new Set;return e.map(e=>{let n=r&&r.find(n=>n.item===e&&n.phase!==`leave`&&!t.has(n));return n?(t.add(n),n.key):gD++})}return q.und(n)?e:q.fun(n)?e.map(n):aw(n)}var vD=class extends zE{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=qw(...t);let n=this._get(),r=QT(n);UT(this,r.create(n))}advance(e){let t=this._get();rw(t,this.get())||(HT(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&bD(this._active)&&xD(this)}_get(){let e=q.arr(this.source)?this.source.map(sT):aw(sT(this.source));return this.calc(...e)}_start(){this.idle&&!bD(this._active)&&(this.idle=!1,J(WT(this),e=>{e.done=!1}),lw.skipAnimation?(K.batchedUpdates(()=>this.advance()),xD(this)):bw.start(this))}_attach(){let e=1;J(aw(this.source),t=>{oT(t)&&pT(t,this),LE(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){J(aw(this.source),e=>{oT(e)&&mT(e,this)}),this._active.clear(),xD(this)}eventObserved(e){e.type==`change`?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type==`idle`?this._active.delete(e.parent):e.type==`priority`&&(this.priority=aw(this.source).reduce((e,t)=>Math.max(e,(LE(t)?t.priority:0)+1),0))}};function yD(e){return e.idle!==!1}function bD(e){return!e.size||Array.from(e).every(yD)}function xD(e){e.idle||(e.idle=!0,J(WT(e),e=>{e.done=!0}),uT(e,{type:`idle`,parent:e}))}lw.assign({createStringInterpolator:ET,to:(e,t)=>new vD(e,t)}),bw.advance;var SD=/^--/;function CD(e,t){return t==null||typeof t==`boolean`||t===``?``:typeof t==`number`&&t!==0&&!SD.test(e)&&!(ED.hasOwnProperty(e)&&ED[e])?t+`px`:(``+t).trim()}var wD={};function TD(e,t){if(!e.nodeType||!e.setAttribute||!e.removeAttribute)return!1;let n=e.nodeName===`filter`||e.parentNode&&e.parentNode.nodeName===`filter`,{className:r,style:i,children:a,scrollTop:o,scrollLeft:s,viewBox:c,...l}=t,u=Object.values(l),d=Object.keys(l).map(t=>n||e.hasAttribute(t)?t:wD[t]||(wD[t]=t.replace(/([A-Z])/g,e=>`-`+e.toLowerCase())));t.hasOwnProperty(`children`)&&(e.textContent=a);for(let t in i)if(i.hasOwnProperty(t)){let n=CD(t,i[t]);SD.test(t)?e.style.setProperty(t,n):e.style[t]=n}d.forEach((t,n)=>{let r=u[n];r===void 0?e.removeAttribute(t):e.setAttribute(t,r)}),t.hasOwnProperty(`className`)&&(r===void 0?e.removeAttribute(`class`):e.className=r),o!==void 0&&(e.scrollTop=o),s!==void 0&&(e.scrollLeft=s),t.hasOwnProperty(`viewBox`)&&(c===void 0?e.removeAttribute(`viewBox`):e.setAttribute(`viewBox`,c))}var ED={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},DD=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),OD=[`Webkit`,`Ms`,`Moz`,`O`];ED=Object.keys(ED).reduce((e,t)=>(OD.forEach(n=>e[DD(n,t)]=e[t]),e),ED);var kD=/^(matrix3d|matrix|translate3d|translate[XYZ]?|scale3d|scale[XYZ]?|rotate3d|rotate[XYZ]?|skew[XY]?)$/,AD=/^(translate)/,jD=/^(rotate|skew)/,MD=(e,t)=>q.num(e)&&e!==0?e+t:e,ND=(e,t)=>q.arr(e)?e.every(e=>ND(e,t)):q.num(e)?e===t:parseFloat(e)===t,PD=class extends YT{constructor({x:e,y:t,z:n,...r}){let i=[],a=[];(e||t||n)&&(i.push([e||0,t||0,n||0]),a.push(e=>[`translate3d(${e.map(e=>MD(e,`px`)).join(`,`)})`,ND(e,0)])),iw(r,(e,t)=>{if(t===`transform`)i.push([e||``]),a.push(e=>[e,e===``]);else if(kD.test(t)){if(delete r[t],q.und(e))return;let n=AD.test(t)?`px`:jD.test(t)?`deg`:``;i.push(aw(e)),a.push(t===`rotate3d`?([e,t,r,i])=>[`rotate3d(${e},${t},${r},${MD(i,n)})`,ND(i,0)]:e=>[`${t}(${e.map(e=>MD(e,n)).join(`,`)})`,ND(e,+!!t.startsWith(`scale`))])}}),i.length&&(r.transform=new FD(i,a)),super(r)}},FD=class extends dT{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||=this._get()}_get(){let e=``,t=!0;return J(this.inputs,(n,r)=>{let i=sT(n[0]),[a,o]=this.transforms[r](q.arr(i)?i:n.map(sT));e+=` `+a,t&&=o}),t?`none`:e}observerAdded(e){e==1&&J(this.inputs,e=>J(e,e=>oT(e)&&pT(e,this)))}observerRemoved(e){e==0&&J(this.inputs,e=>J(e,e=>oT(e)&&mT(e,this)))}eventObserved(e){e.type==`change`&&(this._value=null),uT(this,e)}},ID=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.big.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.keygen.label.legend.li.link.main.map.mark.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr.circle.clipPath.defs.ellipse.foreignObject.g.image.line.linearGradient.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.svg.text.tspan`.split(`.`);lw.assign({batchedUpdates:pC.unstable_batchedUpdates,createStringInterpolator:ET,colors:Dw});var LD=aE(ID,{applyAnimatedValues:TD,createAnimatedStyle:e=>new PD(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}).animated,RD=e=>(0,G.jsx)(`svg`,{width:25,height:21,viewBox:`0 0 25 21`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,G.jsx)(`path`,{d:`M11.079 4.41595C10.7681 3.56076 10.0151 3 9.17787 3V4.7747C9.17787 4.7747 9.51518 4.89365 9.58114 5.07505L10.5101 7.62978C10.6755 8.0848 11.145 8.30612 11.5586 8.12411C11.9722 7.94211 12.1734 7.4257 12.008 6.97068L11.079 4.41595Z`,fill:`#9489DB`})}),zD=e=>(0,G.jsxs)(`svg`,{width:25,height:21,viewBox:`0 0 25 21`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,G.jsx)(`path`,{d:`M9.17787 3H4.05053V4.7747H9.17787V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M4.05053 3C2.49311 3 1.50583 4.83684 2.25638 6.33803L3.66995 5.48277C3.51074 5.16433 3.72017 4.7747 4.05053 4.7747V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M11.079 4.41595C10.7681 3.56076 10.0151 3 9.17787 3V4.7747C9.17787 4.7747 9.51518 4.89365 9.58114 5.07505L10.5101 7.62978C10.6755 8.0848 11.145 8.30612 11.5586 8.12411C11.9722 7.94211 12.1734 7.4257 12.008 6.97068L11.079 4.41595Z`,fill:`#9489DB`})]}),BD=e=>(0,G.jsxs)(`svg`,{width:25,height:21,viewBox:`0 0 25 21`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,G.jsx)(`path`,{d:`M8.34416 14.8317L3.66995 5.48277L2.25638 6.33803L6.93059 15.687L8.34416 14.8317Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M11.079 4.41595C10.7681 3.56076 10.0151 3 9.17787 3V4.7747C9.17787 4.7747 9.51518 4.89365 9.58114 5.07505L10.5101 7.62978C10.6755 8.0848 11.145 8.30612 11.5586 8.12411C11.9722 7.94211 12.1734 7.4257 12.008 6.97068L11.079 4.41595Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M9.17787 3H4.05053V4.7747H9.17787V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2.25638 6.33803C1.50583 4.83684 2.49311 3 4.05053 3V4.7747C3.72017 4.7747 3.51074 5.16433 3.66995 5.48277L2.25638 6.33803Z`,fill:`#9489DB`})]}),VD=e=>(0,G.jsxs)(`svg`,{width:25,height:21,viewBox:`0 0 25 21`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,G.jsx)(`path`,{d:`M9.11322 14.8151C8.95664 15.1596 8.51289 15.1692 8.34416 14.8317L6.93059 15.687C7.71306 17.252 9.75015 17.2339 10.519 15.687L9.11322 14.8151Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M11.079 4.41595C10.7681 3.56076 10.0151 3 9.17787 3V4.7747C9.17787 4.7747 9.51518 4.89365 9.58114 5.07505L10.5101 7.62978C10.6755 8.0848 11.145 8.30612 11.5586 8.12411C11.9722 7.94211 12.1734 7.4257 12.008 6.97068L11.079 4.41595Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M9.17787 3H4.05053V4.7747H9.17787V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M4.05053 3C2.49311 3 1.50583 4.83684 2.25638 6.33803L3.66995 5.48277C3.51074 5.16433 3.72017 4.7747 4.05053 4.7747V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M8.34416 14.8317L3.66995 5.48277L2.25638 6.33803L6.93059 15.687L8.34416 14.8317Z`,fill:`#9489DB`})]}),HD=e=>(0,G.jsxs)(`svg`,{width:25,height:21,viewBox:`0 0 25 21`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,G.jsx)(`path`,{d:`M13.9175 4.24516L9.11322 14.8151L10.519 15.687C10.5317 15.6613 10.5441 15.6353 10.5562 15.6088L15.3604 5.03882L13.9175 4.24516Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M11.079 4.41595C10.7681 3.56076 10.0151 3 9.17787 3V4.7747C9.17787 4.7747 9.51518 4.89365 9.58114 5.07505L10.5101 7.62978C10.6755 8.0848 11.145 8.30612 11.5586 8.12411C11.9722 7.94211 12.1734 7.4257 12.008 6.97068L11.079 4.41595Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M9.17787 3H4.05053V4.7747H9.17787V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M8.34416 14.8317L3.66995 5.48277L2.25638 6.33803L6.93059 15.687L8.34416 14.8317Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M4.05053 3C2.49311 3 1.50583 4.83684 2.25638 6.33803L3.66995 5.48277C3.51074 5.16433 3.72017 4.7747 4.05053 4.7747V3ZM8.34416 14.8317L6.93059 15.687C7.71306 17.252 9.75015 17.2339 10.519 15.687L9.11322 14.8151C8.95664 15.1596 8.51289 15.1692 8.34416 14.8317Z`,fill:`#9489DB`})]}),UD=e=>(0,G.jsxs)(`svg`,{width:25,height:21,viewBox:`0 0 25 21`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,G.jsx)(`path`,{d:`M15.7489 3C14.9733 3 14.2643 3.48204 13.9175 4.24516L15.3604 5.03882C15.434 4.87695 15.5844 4.7747 15.7489 4.7747V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M20.9495 4.7747H15.7489V3H20.9495C22.5069 3 23.4942 4.83684 22.7436 6.33803L21.3301 5.48277C21.4893 5.16433 21.2798 4.7747 20.9495 4.7747Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M11.079 4.41595C10.7681 3.56076 10.0151 3 9.17787 3V4.7747C9.17787 4.7747 9.51518 4.89365 9.58114 5.07505L10.5101 7.62978C10.6755 8.0848 11.145 8.30612 11.5586 8.12411C11.9722 7.94211 12.1734 7.4257 12.008 6.97068L11.079 4.41595Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M9.17787 3H4.05053V4.7747H9.17787V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M4.05053 3C2.49311 3 1.50583 4.83684 2.25638 6.33803L3.66995 5.48277C3.51074 5.16433 3.72017 4.7747 4.05053 4.7747V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M8.34416 14.8317L3.66995 5.48277L2.25638 6.33803L6.93059 15.687L8.34416 14.8317Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M9.11322 14.8151C8.95664 15.1596 8.51289 15.1692 8.34416 14.8317L6.93059 15.687C7.71306 17.252 9.75015 17.2339 10.519 15.687L9.11322 14.8151Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M13.9175 4.24516L9.11322 14.8151L10.519 15.687C10.5317 15.6613 10.5441 15.6353 10.5562 15.6088L15.3604 5.03882L13.9175 4.24516Z`,fill:`#9489DB`})]}),WD=e=>(0,G.jsxs)(`svg`,{width:25,height:21,viewBox:`0 0 25 21`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,G.jsx)(`path`,{d:`M17.9964 15.833L22.7436 6.33803L21.3301 5.48277L16.5828 14.9778L17.9964 15.833Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M11.079 4.41595C10.7681 3.56076 10.0151 3 9.17787 3V4.7747C9.17787 4.7747 9.51518 4.89365 9.58114 5.07505L10.5101 7.62978C10.6755 8.0848 11.145 8.30612 11.5586 8.12411C11.9722 7.94211 12.1734 7.4257 12.008 6.97068L11.079 4.41595Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M9.17787 3H4.05053V4.7747H9.17787V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M8.34416 14.8317L3.66995 5.48277L2.25638 6.33803L6.93059 15.687L8.34416 14.8317Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M13.9175 4.24516L9.11322 14.8151L10.519 15.687C10.5317 15.6613 10.5441 15.6353 10.5562 15.6088L15.3604 5.03882L13.9175 4.24516Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2.25638 6.33803C1.50583 4.83684 2.49311 3 4.05053 3V4.7747C3.72017 4.7747 3.51074 5.16433 3.66995 5.48277L2.25638 6.33803ZM6.93059 15.687L8.34416 14.8317C8.51289 15.1692 8.95664 15.1596 9.11322 14.8151L10.519 15.687C9.75015 17.2339 7.71306 17.252 6.93059 15.687ZM15.3604 5.03882C15.434 4.87695 15.5844 4.7747 15.7489 4.7747H20.9495C21.2798 4.7747 21.4893 5.16433 21.3301 5.48277L22.7436 6.33803C23.4942 4.83684 22.5069 3 20.9495 3H15.7489C14.9733 3 14.2643 3.48204 13.9175 4.24516L15.3604 5.03882Z`,fill:`#9489DB`})]}),GD=e=>(0,G.jsxs)(`svg`,{width:25,height:21,viewBox:`0 0 25 21`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,G.jsx)(`path`,{d:`M14.4244 15.865C15.2179 17.3926 17.2257 17.3746 17.9964 15.833L16.5828 14.9778C16.4193 15.3047 15.9934 15.3086 15.8251 14.9846L14.4244 15.865Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M13.0406 13.2011L14.4244 15.865L15.8251 14.9846L14.4413 12.3206L13.0406 13.2011Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M13.3408 11.9904C12.954 12.2335 12.8196 12.7756 13.0406 13.2011L14.4413 12.3206C14.2203 11.8951 13.7276 11.7473 13.3408 11.9904Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M11.079 4.41595C10.7681 3.56076 10.0151 3 9.17787 3V4.7747C9.17787 4.7747 9.51518 4.89365 9.58114 5.07505L10.5101 7.62978C10.6755 8.0848 11.145 8.30612 11.5586 8.12411C11.9722 7.94211 12.1734 7.4257 12.008 6.97068L11.079 4.41595Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M9.17787 3H4.05053V4.7747H9.17787V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M4.05053 3C2.49311 3 1.50583 4.83684 2.25638 6.33803L3.66995 5.48277C3.51074 5.16433 3.72017 4.7747 4.05053 4.7747V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M8.34416 14.8317L3.66995 5.48277L2.25638 6.33803L6.93059 15.687L8.34416 14.8317Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M9.11322 14.8151C8.95664 15.1596 8.51289 15.1692 8.34416 14.8317L6.93059 15.687C7.71306 17.252 9.75015 17.2339 10.519 15.687L9.11322 14.8151Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M13.9175 4.24516L9.11322 14.8151L10.519 15.687C10.5317 15.6613 10.5441 15.6353 10.5562 15.6088L15.3604 5.03882L13.9175 4.24516Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M15.7489 3C14.9733 3 14.2643 3.48204 13.9175 4.24516L15.3604 5.03882C15.434 4.87695 15.5844 4.7747 15.7489 4.7747V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M20.9495 3H15.7489V4.7747H20.9495V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M22.7436 6.33803C23.4942 4.83684 22.5069 3 20.9495 3V4.7747C21.2798 4.7747 21.4893 5.16433 21.3301 5.48277L22.7436 6.33803Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M17.9964 15.833L22.7436 6.33803L21.3301 5.48277L16.5828 14.9778L17.9964 15.833Z`,fill:`#9489DB`})]}),KD=()=>{let e=[W.createElement(RD,null),W.createElement(zD,null),W.createElement(BD,null),W.createElement(VD,null),W.createElement(HD,null),W.createElement(UD,null),W.createElement(WD,null),W.createElement(GD,null)],[t,n]=(0,W.useState)(!0),[r,i]=(0,W.useState)(!0);(0,W.useEffect)(()=>()=>{i(!1)},[]);let a=hD(e,{loop:t,from:{opacity:0},enter:{opacity:1},trail:100,config:{duration:1500},onRest:()=>r&&n(!t)})((e,t)=>W.createElement(LD.div,{style:{...e,gridRowStart:1,gridColumnStart:1}},t));return W.createElement(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr`}},a)},qD=e=>(0,G.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,G.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM18.8485 9.24853C19.3172 8.7799 19.3172 8.0201 18.8485 7.55147C18.3799 7.08284 17.6201 7.08284 17.1515 7.55147L9.6 15.1029L6.84853 12.3515C6.3799 11.8828 5.6201 11.8828 5.15147 12.3515C4.68284 12.8201 4.68284 13.5799 5.15147 14.0485L9.6 18.4971L18.8485 9.24853Z`,fill:`#5FCA7D`})}),JD=e=>(0,G.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,G.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21.4286 12C21.4286 17.2073 17.2073 21.4286 12 21.4286C6.79274 21.4286 2.57143 17.2073 2.57143 12C2.57143 6.79274 6.79274 2.57143 12 2.57143C17.2073 2.57143 21.4286 6.79274 21.4286 12ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12ZM7.37141 8.66656L10.7049 12.0001L7.37144 15.3336L8.58362 16.5458L11.9171 13.2123L15.2506 16.5458L16.4628 15.3336L13.1293 12.0001L16.4628 8.66656L15.2506 7.45438L11.9171 10.7879L8.58359 7.45438L7.37141 8.66656Z`,fill:`#E6635A`})}),YD=e=>(0,G.jsx)(`svg`,{width:14,height:14,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,G.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.5 7C12.5 10.0376 10.0376 12.5 7 12.5C3.96243 12.5 1.5 10.0376 1.5 7C1.5 3.96243 3.96243 1.5 7 1.5C10.0376 1.5 12.5 3.96243 12.5 7ZM14 7C14 10.866 10.866 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7ZM4.3 5.05546L6.24455 7.00002L4.30002 8.94455L5.00712 9.65166L6.95166 7.70712L8.89619 9.65166L9.6033 8.94455L7.65877 7.00002L9.60332 5.05546L8.89621 4.34836L6.95166 6.29291L5.00711 4.34836L4.3 5.05546Z`,fill:`#E6635A`})}),XD=document,ZD=()=>XD,{min:QD,max:$D}=Math,eO=(e,t=0,n=1)=>QD($D(t,e),n),tO=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=eO(e[t],0,255)):t===3&&(e[t]=eO(e[t],0,1));return e},nO={};for(let e of[`Boolean`,`Number`,`String`,`Function`,`Array`,`Date`,`RegExp`,`Undefined`,`Null`])nO[`[object ${e}]`]=e.toLowerCase();function Y(e){return nO[Object.prototype.toString.call(e)]||`object`}var X=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):Y(e[0])==`object`&&t?t.split(``).filter(t=>e[0][t]!==void 0).map(t=>e[0][t]):e[0].slice(0),rO=e=>{if(e.length<2)return null;let t=e.length-1;return Y(e[t])==`string`?e[t].toLowerCase():null},{PI:iO,min:aO,max:oO}=Math,sO=e=>Math.round(e*100)/100,cO=e=>Math.round(e*100)/100,lO=iO*2,uO=iO/3,dO=iO/180,fO=180/iO;function pO(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}var Z={format:{},autodetect:[]},Q=class{constructor(...e){let t=this;if(Y(e[0])===`object`&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let n=rO(e),r=!1;if(!n){r=!0,Z.sorted||=(Z.autodetect=Z.autodetect.sort((e,t)=>t.p-e.p),!0);for(let t of Z.autodetect)if(n=t.test(...e),n)break}if(Z.format[n])t._rgb=tO(Z.format[n].apply(null,r?e:e.slice(0,-1)));else throw Error(`unknown format: `+e);t._rgb.length===3&&t._rgb.push(1)}toString(){return Y(this.hex)==`function`?this.hex():`[${this._rgb.join(`,`)}]`}},mO=`3.2.0`,$=(...e)=>new Q(...e);$.version=mO;var hO={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,laserlemon:`#ffff54`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrod:`#fafad2`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,maroon2:`#7f0000`,maroon3:`#b03060`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,purple2:`#7f007f`,purple3:`#a020f0`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`},gO=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,_O=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,vO=e=>{if(e.match(gO)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(``),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let t=parseInt(e,16);return[t>>16,t>>8&255,t&255,1]}if(e.match(_O)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(``),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);let t=parseInt(e,16);return[t>>24&255,t>>16&255,t>>8&255,Math.round((t&255)/255*100)/100]}throw Error(`unknown hex color: ${e}`)},{round:yO}=Math,bO=(...e)=>{let[t,n,r,i]=X(e,`rgba`),a=rO(e)||`auto`;i===void 0&&(i=1),a===`auto`&&(a=i<1?`rgba`:`rgb`),t=yO(t),n=yO(n),r=yO(r);let o=`000000`+(t<<16|n<<8|r).toString(16);o=o.substr(o.length-6);let s=`0`+yO(i*255).toString(16);switch(s=s.substr(s.length-2),a.toLowerCase()){case`rgba`:return`#${o}${s}`;case`argb`:return`#${s}${o}`;default:return`#${o}`}};Q.prototype.name=function(){let e=bO(this._rgb,`rgb`);for(let t of Object.keys(hO))if(hO[t]===e)return t.toLowerCase();return e},Z.format.named=e=>{if(e=e.toLowerCase(),hO[e])return vO(hO[e]);throw Error(`unknown color name: `+e)},Z.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Y(e)===`string`&&hO[e.toLowerCase()])return`named`}}),Q.prototype.alpha=function(e,t=!1){return e!==void 0&&Y(e)===`number`?t?(this._rgb[3]=e,this):new Q([this._rgb[0],this._rgb[1],this._rgb[2],e],`rgb`):this._rgb[3]},Q.prototype.clipped=function(){return this._rgb._clipped||!1};var xO={Kn:18,labWhitePoint:`d65`,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},SO=new Map([[`a`,[1.0985,.35585]],[`b`,[1.0985,.35585]],[`c`,[.98074,1.18232]],[`d50`,[.96422,.82521]],[`d55`,[.95682,.92149]],[`d65`,[.95047,1.08883]],[`e`,[1,1,1]],[`f2`,[.99186,.67393]],[`f7`,[.95041,1.08747]],[`f11`,[1.00962,.6435]],[`icc`,[.96422,.82521]]]);function CO(e){let t=SO.get(String(e).toLowerCase());if(!t)throw Error(`unknown Lab illuminant `+e);xO.labWhitePoint=e,xO.Xn=t[0],xO.Zn=t[1]}function wO(){return xO.labWhitePoint}var TO=(...e)=>{e=X(e,`lab`);let[t,n,r]=e,[i,a,o]=EO(t,n,r),[s,c,l]=OO(i,a,o);return[s,c,l,e.length>3?e[3]:1]},EO=(e,t,n)=>{let{kE:r,kK:i,kKE:a,Xn:o,Yn:s,Zn:c}=xO,l=(e+16)/116,u=.002*t+l,d=l-.005*n,f=u*u*u,p=d*d*d,m=f>r?f:(116*u-16)/i,h=e>a?((e+16)/116)**3:e/i,g=p>r?p:(116*d-16)/i;return[m*o,h*s,g*c]},DO=e=>{let t=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055)*t},OO=(e,t,n)=>{let{MtxAdaptMa:r,MtxAdaptMaI:i,MtxXYZ2RGB:a,RefWhiteRGB:o,Xn:s,Yn:c,Zn:l}=xO,u=s*r.m00+c*r.m10+l*r.m20,d=s*r.m01+c*r.m11+l*r.m21,f=s*r.m02+c*r.m12+l*r.m22,p=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,m=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,h=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,g=(e*r.m00+t*r.m10+n*r.m20)*(p/u),_=(e*r.m01+t*r.m11+n*r.m21)*(m/d),v=(e*r.m02+t*r.m12+n*r.m22)*(h/f),y=g*i.m00+_*i.m10+v*i.m20,b=g*i.m01+_*i.m11+v*i.m21,x=g*i.m02+_*i.m12+v*i.m22,S=DO(y*a.m00+b*a.m10+x*a.m20),C=DO(y*a.m01+b*a.m11+x*a.m21),w=DO(y*a.m02+b*a.m12+x*a.m22);return[S*255,C*255,w*255]},kO=(...e)=>{let[t,n,r,...i]=X(e,`rgb`),[a,o,s]=MO(t,n,r),[c,l,u]=AO(a,o,s);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]};function AO(e,t,n){let{Xn:r,Yn:i,Zn:a,kE:o,kK:s}=xO,c=e/r,l=t/i,u=n/a,d=c>o?c**(1/3):(s*c+16)/116,f=l>o?l**(1/3):(s*l+16)/116,p=u>o?u**(1/3):(s*u+16)/116;return[116*f-16,500*(d-f),200*(f-p)]}function jO(e){let t=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:((e+.055)/1.055)**2.4)*t}var MO=(e,t,n)=>{e=jO(e/255),t=jO(t/255),n=jO(n/255);let{MtxRGB2XYZ:r,MtxAdaptMa:i,MtxAdaptMaI:a,Xn:o,Yn:s,Zn:c,As:l,Bs:u,Cs:d}=xO,f=e*r.m00+t*r.m10+n*r.m20,p=e*r.m01+t*r.m11+n*r.m21,m=e*r.m02+t*r.m12+n*r.m22,h=o*i.m00+s*i.m10+c*i.m20,g=o*i.m01+s*i.m11+c*i.m21,_=o*i.m02+s*i.m12+c*i.m22,v=f*i.m00+p*i.m10+m*i.m20,y=f*i.m01+p*i.m11+m*i.m21,b=f*i.m02+p*i.m12+m*i.m22;return v*=h/l,y*=g/u,b*=_/d,f=v*a.m00+y*a.m10+b*a.m20,p=v*a.m01+y*a.m11+b*a.m21,m=v*a.m02+y*a.m12+b*a.m22,[f,p,m]};Q.prototype.lab=function(){return kO(this._rgb)},Object.assign($,{lab:(...e)=>new Q(...e,`lab`),getLabWhitePoint:wO,setLabWhitePoint:CO}),Z.format.lab=TO,Z.autodetect.push({p:2,test:(...e)=>{if(e=X(e,`lab`),Y(e)===`array`&&e.length===3)return`lab`}}),Q.prototype.darken=function(e=1){let t=this,n=t.lab();return n[0]-=xO.Kn*e,new Q(n,`lab`).alpha(t.alpha(),!0)},Q.prototype.brighten=function(e=1){return this.darken(-e)},Q.prototype.darker=Q.prototype.darken,Q.prototype.brighter=Q.prototype.brighten,Q.prototype.get=function(e){let[t,n]=e.split(`.`),r=this[t]();if(n){let e=t.indexOf(n)-(t.substr(0,2)===`ok`?2:0);if(e>-1)return r[e];throw Error(`unknown channel ${n} in mode ${t}`)}return r};var{pow:NO}=Math,PO=1e-7,FO=20;Q.prototype.luminance=function(e,t=`rgb`){if(e!==void 0&&Y(e)===`number`){if(e===0)return new Q([0,0,0,this._rgb[3]],`rgb`);if(e===1)return new Q([255,255,255,this._rgb[3]],`rgb`);let n=this.luminance(),r=FO,i=(n,a)=>{let o=n.interpolate(a,.5,t),s=o.luminance();return Math.abs(e-s)<PO||!r--?o:s>e?i(n,o):i(o,a)};return new Q([...(n>e?i(new Q([0,0,0]),this):i(this,new Q([255,255,255]))).rgb(),this._rgb[3]])}return IO(...this._rgb.slice(0,3))};var IO=(e,t,n)=>(e=LO(e),t=LO(t),n=LO(n),.2126*e+.7152*t+.0722*n),LO=e=>(e/=255,e<=.03928?e/12.92:NO((e+.055)/1.055,2.4)),RO={},zO=(e,t,n=.5,...r)=>{let i=r[0]||`lrgb`;if(!RO[i]&&!r.length&&(i=Object.keys(RO)[0]),!RO[i])throw Error(`interpolation mode ${i} is not defined`);return Y(e)!==`object`&&(e=new Q(e)),Y(t)!==`object`&&(t=new Q(t)),RO[i](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};Q.prototype.mix=Q.prototype.interpolate=function(e,t=.5,...n){return zO(this,e,t,...n)},Q.prototype.premultiply=function(e=!1){let t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new Q([t[0]*n,t[1]*n,t[2]*n,n],`rgb`)};var{sin:BO,cos:VO}=Math,HO=(...e)=>{let[t,n,r]=X(e,`lch`);return isNaN(r)&&(r=0),r*=dO,[t,VO(r)*n,BO(r)*n]},UO=(...e)=>{e=X(e,`lch`);let[t,n,r]=e,[i,a,o]=HO(t,n,r),[s,c,l]=TO(i,a,o);return[s,c,l,e.length>3?e[3]:1]},WO=(...e)=>UO(...pO(X(e,`hcl`))),{sqrt:GO,atan2:KO,round:qO}=Math,JO=(...e)=>{let[t,n,r]=X(e,`lab`),i=GO(n*n+r*r),a=(KO(r,n)*fO+360)%360;return qO(i*1e4)===0&&(a=NaN),[t,i,a]},YO=(...e)=>{let[t,n,r,...i]=X(e,`rgb`),[a,o,s]=kO(t,n,r),[c,l,u]=JO(a,o,s);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]};Q.prototype.lch=function(){return YO(this._rgb)},Q.prototype.hcl=function(){return pO(YO(this._rgb))},Object.assign($,{lch:(...e)=>new Q(...e,`lch`),hcl:(...e)=>new Q(...e,`hcl`)}),Z.format.lch=UO,Z.format.hcl=WO,[`lch`,`hcl`].forEach(e=>Z.autodetect.push({p:2,test:(...t)=>{if(t=X(t,e),Y(t)===`array`&&t.length===3)return e}})),Q.prototype.saturate=function(e=1){let t=this,n=t.lch();return n[1]+=xO.Kn*e,n[1]<0&&(n[1]=0),new Q(n,`lch`).alpha(t.alpha(),!0)},Q.prototype.desaturate=function(e=1){return this.saturate(-e)},Q.prototype.set=function(e,t,n=!1){let[r,i]=e.split(`.`),a=this[r]();if(i){let e=r.indexOf(i)-(r.substr(0,2)===`ok`?2:0);if(e>-1){if(Y(t)==`string`)switch(t.charAt(0)){case`+`:a[e]+=+t;break;case`-`:a[e]+=+t;break;case`*`:a[e]*=+t.substr(1);break;case`/`:a[e]/=+t.substr(1);break;default:a[e]=+t}else if(Y(t)===`number`)a[e]=t;else throw Error(`unsupported value for Color.set`);let i=new Q(a,r);return n?(this._rgb=i._rgb,this):i}throw Error(`unknown channel ${i} in mode ${r}`)}return a},Q.prototype.tint=function(e=.5,...t){return zO(this,`white`,e,...t)},Q.prototype.shade=function(e=.5,...t){return zO(this,`black`,e,...t)},RO.rgb=(e,t,n)=>{let r=e._rgb,i=t._rgb;return new Q(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`rgb`)};var{sqrt:XO,pow:ZO}=Math;RO.lrgb=(e,t,n)=>{let[r,i,a]=e._rgb,[o,s,c]=t._rgb;return new Q(XO(ZO(r,2)*(1-n)+ZO(o,2)*n),XO(ZO(i,2)*(1-n)+ZO(s,2)*n),XO(ZO(a,2)*(1-n)+ZO(c,2)*n),`rgb`)},RO.lab=(e,t,n)=>{let r=e.lab(),i=t.lab();return new Q(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`lab`)};var QO=(e,t,n,r)=>{let i,a;r===`hsl`?(i=e.hsl(),a=t.hsl()):r===`hsv`?(i=e.hsv(),a=t.hsv()):r===`hcg`?(i=e.hcg(),a=t.hcg()):r===`hsi`?(i=e.hsi(),a=t.hsi()):r===`lch`||r===`hcl`?(r=`hcl`,i=e.hcl(),a=t.hcl()):r===`oklch`&&(i=e.oklch().reverse(),a=t.oklch().reverse());let o,s,c,l,u,d;(r.substr(0,1)===`h`||r===`oklch`)&&([o,c,u]=i,[s,l,d]=a);let f,p,m,h;return!isNaN(o)&&!isNaN(s)?(h=s>o&&s-o>180?s-(o+360):s<o&&o-s>180?s+360-o:s-o,p=o+n*h):isNaN(o)?isNaN(s)?p=NaN:(p=s,(u==1||u==0)&&r!=`hsv`&&(f=l)):(p=o,(d==1||d==0)&&r!=`hsv`&&(f=c)),f===void 0&&(f=c+n*(l-c)),m=u+n*(d-u),r===`oklch`?new Q([m,f,p],r):new Q([p,f,m],r)},$O=(e,t,n)=>QO(e,t,n,`lch`);RO.lch=$O,RO.hcl=$O;var ek=e=>{if(Y(e)==`number`&&e>=0&&e<=16777215)return[e>>16,e>>8&255,e&255,1];throw Error(`unknown num color: `+e)},tk=(...e)=>{let[t,n,r]=X(e,`rgb`);return(t<<16)+(n<<8)+r};Q.prototype.num=function(){return tk(this._rgb)},Object.assign($,{num:(...e)=>new Q(...e,`num`)}),Z.format.num=ek,Z.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&Y(e[0])===`number`&&e[0]>=0&&e[0]<=16777215)return`num`}}),RO.num=(e,t,n)=>{let r=e.num();return new Q(r+n*(t.num()-r),`num`)};var{floor:nk}=Math,rk=(...e)=>{e=X(e,`hcg`);let[t,n,r]=e,i,a,o;r*=255;let s=n*255;if(n===0)i=a=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let e=nk(t),c=t-e,l=r*(1-n),u=l+s*(1-c),d=l+s*c,f=l+s;switch(e){case 0:[i,a,o]=[f,d,l];break;case 1:[i,a,o]=[u,f,l];break;case 2:[i,a,o]=[l,f,d];break;case 3:[i,a,o]=[l,u,f];break;case 4:[i,a,o]=[d,l,f];break;case 5:[i,a,o]=[f,l,u]}}return[i,a,o,e.length>3?e[3]:1]},ik=(...e)=>{let[t,n,r]=X(e,`rgb`),i=aO(t,n,r),a=oO(t,n,r),o=a-i,s=o*100/255,c=i/(255-o)*100,l;return o===0?l=NaN:(t===a&&(l=(n-r)/o),n===a&&(l=2+(r-t)/o),r===a&&(l=4+(t-n)/o),l*=60,l<0&&(l+=360)),[l,s,c]};Q.prototype.hcg=function(){return ik(this._rgb)},$.hcg=(...e)=>new Q(...e,`hcg`),Z.format.hcg=rk,Z.autodetect.push({p:1,test:(...e)=>{if(e=X(e,`hcg`),Y(e)===`array`&&e.length===3)return`hcg`}}),RO.hcg=(e,t,n)=>QO(e,t,n,`hcg`);var{cos:ak}=Math,ok=(...e)=>{e=X(e,`hsi`);let[t,n,r]=e,i,a,o;return isNaN(t)&&(t=0),isNaN(n)&&(n=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(o=(1-n)/3,i=(1+n*ak(lO*t)/ak(uO-lO*t))/3,a=1-(o+i)):t<2/3?(t-=1/3,i=(1-n)/3,a=(1+n*ak(lO*t)/ak(uO-lO*t))/3,o=1-(i+a)):(t-=2/3,a=(1-n)/3,o=(1+n*ak(lO*t)/ak(uO-lO*t))/3,i=1-(a+o)),i=eO(r*i*3),a=eO(r*a*3),o=eO(r*o*3),[i*255,a*255,o*255,e.length>3?e[3]:1]},{min:sk,sqrt:ck,acos:lk}=Math,uk=(...e)=>{let[t,n,r]=X(e,`rgb`);t/=255,n/=255,r/=255;let i,a=sk(t,n,r),o=(t+n+r)/3,s=o>0?1-a/o:0;return s===0?i=NaN:(i=(t-n+(t-r))/2,i/=ck((t-n)*(t-n)+(t-r)*(n-r)),i=lk(i),r>n&&(i=lO-i),i/=lO),[i*360,s,o]};Q.prototype.hsi=function(){return uk(this._rgb)},$.hsi=(...e)=>new Q(...e,`hsi`),Z.format.hsi=ok,Z.autodetect.push({p:2,test:(...e)=>{if(e=X(e,`hsi`),Y(e)===`array`&&e.length===3)return`hsi`}}),RO.hsi=(e,t,n)=>QO(e,t,n,`hsi`);var dk=(...e)=>{e=X(e,`hsl`);let[t,n,r]=e,i,a,o;if(n===0)i=a=o=r*255;else{let e=[0,0,0],s=[0,0,0],c=r<.5?r*(1+n):r+n-r*n,l=2*r-c,u=t/360;e[0]=u+1/3,e[1]=u,e[2]=u-1/3;for(let t=0;t<3;t++)e[t]<0&&(e[t]+=1),e[t]>1&&--e[t],6*e[t]<1?s[t]=l+(c-l)*6*e[t]:2*e[t]<1?s[t]=c:3*e[t]<2?s[t]=l+(c-l)*(2/3-e[t])*6:s[t]=l;[i,a,o]=[s[0]*255,s[1]*255,s[2]*255]}return e.length>3?[i,a,o,e[3]]:[i,a,o,1]},fk=(...e)=>{e=X(e,`rgba`);let[t,n,r]=e;t/=255,n/=255,r/=255;let i=aO(t,n,r),a=oO(t,n,r),o=(a+i)/2,s,c;return a===i?(s=0,c=NaN):s=o<.5?(a-i)/(a+i):(a-i)/(2-a-i),t==a?c=(n-r)/(a-i):n==a?c=2+(r-t)/(a-i):r==a&&(c=4+(t-n)/(a-i)),c*=60,c<0&&(c+=360),e.length>3&&e[3]!==void 0?[c,s,o,e[3]]:[c,s,o]};Q.prototype.hsl=function(){return fk(this._rgb)},$.hsl=(...e)=>new Q(...e,`hsl`),Z.format.hsl=dk,Z.autodetect.push({p:2,test:(...e)=>{if(e=X(e,`hsl`),Y(e)===`array`&&e.length===3)return`hsl`}}),RO.hsl=(e,t,n)=>QO(e,t,n,`hsl`);var{floor:pk}=Math,mk=(...e)=>{e=X(e,`hsv`);let[t,n,r]=e,i,a,o;if(r*=255,n===0)i=a=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let e=pk(t),s=t-e,c=r*(1-n),l=r*(1-n*s),u=r*(1-n*(1-s));switch(e){case 0:[i,a,o]=[r,u,c];break;case 1:[i,a,o]=[l,r,c];break;case 2:[i,a,o]=[c,r,u];break;case 3:[i,a,o]=[c,l,r];break;case 4:[i,a,o]=[u,c,r];break;case 5:[i,a,o]=[r,c,l]}}return[i,a,o,e.length>3?e[3]:1]},{min:hk,max:gk}=Math,_k=(...e)=>{e=X(e,`rgb`);let[t,n,r]=e,i=hk(t,n,r),a=gk(t,n,r),o=a-i,s,c,l;return l=a/255,a===0?(s=NaN,c=0):(c=o/a,t===a&&(s=(n-r)/o),n===a&&(s=2+(r-t)/o),r===a&&(s=4+(t-n)/o),s*=60,s<0&&(s+=360)),[s,c,l]};Q.prototype.hsv=function(){return _k(this._rgb)},$.hsv=(...e)=>new Q(...e,`hsv`),Z.format.hsv=mk,Z.autodetect.push({p:2,test:(...e)=>{if(e=X(e,`hsv`),Y(e)===`array`&&e.length===3)return`hsv`}}),RO.hsv=(e,t,n)=>QO(e,t,n,`hsv`);function vk(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(e=>[e]));let r=t[0].length,i=t[0].map((e,n)=>t.map(e=>e[n])),a=e.map(e=>i.map(t=>Array.isArray(e)?e.reduce((e,n,r)=>e+n*(t[r]||0),0):t.reduce((t,n)=>t+n*e,0)));return n===1&&(a=a[0]),r===1?a.map(e=>e[0]):a}var yk=(...e)=>{e=X(e,`lab`);let[t,n,r,...i]=e,[a,o,s]=bk([t,n,r]),[c,l,u]=OO(a,o,s);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]};function bk(e){return vk([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],vk([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],e).map(e=>e**3))}var xk=(...e)=>{let[t,n,r,...i]=X(e,`rgb`);return[...Sk(MO(t,n,r)),...i.length>0&&i[0]<1?[i[0]]:[]]};function Sk(e){return vk([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],vk([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],e).map(e=>Math.cbrt(e)))}Q.prototype.oklab=function(){return xk(this._rgb)},Object.assign($,{oklab:(...e)=>new Q(...e,`oklab`)}),Z.format.oklab=yk,Z.autodetect.push({p:2,test:(...e)=>{if(e=X(e,`oklab`),Y(e)===`array`&&e.length===3)return`oklab`}}),RO.oklab=(e,t,n)=>{let r=e.oklab(),i=t.oklab();return new Q(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`oklab`)},RO.oklch=(e,t,n)=>QO(e,t,n,`oklch`);var{pow:Ck,sqrt:wk,PI:Tk,cos:Ek,sin:Dk,atan2:Ok}=Math,kk=(e,t=`lrgb`,n=null)=>{let r=e.length;n||=Array.from(Array(r)).map(()=>1);let i=r/n.reduce(function(e,t){return e+t});if(n.forEach((e,t)=>{n[t]*=i}),e=e.map(e=>new Q(e)),t===`lrgb`)return Ak(e,n);let a=e.shift(),o=a.get(t),s=[],c=0,l=0;for(let e=0;e<o.length;e++)if(o[e]=(o[e]||0)*n[0],s.push(isNaN(o[e])?0:n[0]),t.charAt(e)===`h`&&!isNaN(o[e])){let t=o[e]/180*Tk;c+=Ek(t)*n[0],l+=Dk(t)*n[0]}let u=a.alpha()*n[0];e.forEach((e,r)=>{let i=e.get(t);u+=e.alpha()*n[r+1];for(let e=0;e<o.length;e++)if(!isNaN(i[e])){if(s[e]+=n[r+1],t.charAt(e)===`h`){let t=i[e]/180*Tk;c+=Ek(t)*n[r+1],l+=Dk(t)*n[r+1]}else o[e]+=i[e]*n[r+1]}});for(let e=0;e<o.length;e++)if(t.charAt(e)===`h`){let t=Ok(l/s[e],c/s[e])/Tk*180;for(;t<0;)t+=360;for(;t>=360;)t-=360;o[e]=t}else o[e]=o[e]/s[e];return u/=r,new Q(o,t).alpha(u>.99999?1:u,!0)},Ak=(e,t)=>{let n=e.length,r=[0,0,0,0];for(let i=0;i<e.length;i++){let a=e[i],o=t[i]/n,s=a._rgb;r[0]+=Ck(s[0],2)*o,r[1]+=Ck(s[1],2)*o,r[2]+=Ck(s[2],2)*o,r[3]+=s[3]*o}return r[0]=wk(r[0]),r[1]=wk(r[1]),r[2]=wk(r[2]),r[3]>.9999999&&(r[3]=1),new Q(tO(r))},{pow:jk}=Math;function Mk(e){let t=`rgb`,n=$(`#ccc`),r=0,i=[0,1],a=[0,1],o=[],s=[0,0],c=!1,l=[],u=!1,d=0,f=1,p=!1,m={},h=!0,g=1,_=function(e){if(e||=[`#fff`,`#000`],e&&Y(e)===`string`&&$.brewer&&$.brewer[e.toLowerCase()]&&(e=$.brewer[e.toLowerCase()]),Y(e)===`array`){e.length===1&&(e=[e[0],e[0]]),e=e.slice(0);for(let t=0;t<e.length;t++)e[t]=$(e[t]);o.length=0;for(let t=0;t<e.length;t++)o.push(t/(e.length-1))}return S(),l=e},v=function(e){if(c!=null){let t=c.length-1,n=0;for(;n<t&&e>=c[n];)n++;return n-1}return 0},y=e=>e,b=e=>e,x=function(e,r){let i,a;if(r??=!1,isNaN(e)||e===null)return n;a=r?e:c&&c.length>2?v(e)/(c.length-2):f===d?1:(e-d)/(f-d),a=b(a),r||(a=y(a)),g!==1&&(a=jk(a,g)),a=s[0]+a*(1-s[0]-s[1]),a=eO(a,0,1);let u=Math.floor(a*1e4);if(h&&m[u])i=m[u];else{if(Y(l)===`array`)for(let e=0;e<o.length;e++){let n=o[e];if(a<=n){i=l[e];break}if(a>=n&&e===o.length-1){i=l[e];break}if(a>n&&a<o[e+1]){a=(a-n)/(o[e+1]-n),i=$.interpolate(l[e],l[e+1],a,t);break}}else Y(l)===`function`&&(i=l(a));h&&(m[u]=i)}return i};var S=()=>m={};_(e);let C=function(e){let t=$(x(e));return u&&t[u]?t[u]():t};return C.classes=function(e){if(e!=null){if(Y(e)===`array`)c=e,i=[e[0],e[e.length-1]];else{let t=$.analyze(i);c=e===0?[t.min,t.max]:$.limits(t,`e`,e)}return C}return c},C.domain=function(e){if(!arguments.length)return a;a=e.slice(0),d=e[0],f=e[e.length-1],o=[];let t=l.length;if(e.length===t&&d!==f)for(let t of Array.from(e))o.push((t-d)/(f-d));else{for(let e=0;e<t;e++)o.push(e/(t-1));if(e.length>2){let t=e.map((t,n)=>n/(e.length-1)),n=e.map(e=>(e-d)/(f-d));n.every((e,n)=>t[n]===e)||(b=e=>{if(e<=0||e>=1)return e;let r=0;for(;e>=n[r+1];)r++;let i=(e-n[r])/(n[r+1]-n[r]);return t[r]+i*(t[r+1]-t[r])})}}return i=[d,f],C},C.mode=function(e){return arguments.length?(t=e,S(),C):t},C.range=function(e,t){return _(e,t),C},C.out=function(e){return u=e,C},C.spread=function(e){return arguments.length?(r=e,C):r},C.correctLightness=function(e){return e??=!0,p=e,S(),y=p?function(e){let t=x(0,!0).lab()[0],n=x(1,!0).lab()[0],r=t>n,i=x(e,!0).lab()[0],a=t+(n-t)*e,o=i-a,s=0,c=1,l=20;for(;Math.abs(o)>.01&&l-->0;)(function(){return r&&(o*=-1),o<0?(s=e,e+=(c-e)*.5):(c=e,e+=(s-e)*.5),i=x(e,!0).lab()[0],o=i-a})();return e}:e=>e,C},C.padding=function(e){return e==null?s:(Y(e)===`number`&&(e=[e,e]),s=e,C)},C.colors=function(t,n){arguments.length<2&&(n=`hex`);let r=[];if(arguments.length===0)r=l.slice(0);else if(t===1)r=[C(.5)];else if(t>1){let e=i[0],n=i[1]-e;r=Nk(0,t,!1).map(r=>C(e+r/(t-1)*n))}else{e=[];let t=[];if(c&&c.length>2)for(let e=1,n=c.length,r=1<=n;r?e<n:e>n;r?e++:e--)t.push((c[e-1]+c[e])*.5);else t=i;r=t.map(e=>C(e))}return $[n]&&(r=r.map(e=>e[n]())),r},C.cache=function(e){return e==null?h:(h=e,C)},C.gamma=function(e){return e==null?g:(g=e,C)},C.nodata=function(e){return e==null?n:(n=$(e),C)},C}function Nk(e,t,n){let r=[],i=e<t,a=n?i?t+1:t-1:t;for(let t=e;i?t<a:t>a;i?t++:t--)r.push(t);return r}var Pk=function(e){let t=[1,1];for(let n=1;n<e;n++){let e=[1];for(let n=1;n<=t.length;n++)e[n]=(t[n]||0)+t[n-1];t=e}return t},Fk=function(e){let t,n,r,i;if(e=e.map(e=>new Q(e)),e.length===2)[n,r]=e.map(e=>e.lab()),t=function(e){return new Q([0,1,2].map(t=>n[t]+e*(r[t]-n[t])),`lab`)};else if(e.length===3)[n,r,i]=e.map(e=>e.lab()),t=function(e){return new Q([0,1,2].map(t=>(1-e)*(1-e)*n[t]+2*(1-e)*e*r[t]+e*e*i[t]),`lab`)};else if(e.length===4){let a;[n,r,i,a]=e.map(e=>e.lab()),t=function(e){return new Q([0,1,2].map(t=>(1-e)*(1-e)*(1-e)*n[t]+3*(1-e)*(1-e)*e*r[t]+3*(1-e)*e*e*i[t]+e*e*e*a[t]),`lab`)}}else if(e.length>=5){let n,r,i;n=e.map(e=>e.lab()),i=e.length-1,r=Pk(i),t=function(e){let t=1-e;return new Q([0,1,2].map(a=>n.reduce((n,o,s)=>n+r[s]*t**(i-s)*e**s*o[a],0)),`lab`)}}else throw RangeError(`No point in running bezier with only one color.`);return t},Ik=e=>{let t=Fk(e);return t.scale=()=>Mk(t),t},{round:Lk}=Math;Q.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Lk)},Q.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:Lk(t):t)},Object.assign($,{rgb:(...e)=>new Q(...e,`rgb`)}),Z.format.rgb=(...e)=>{let t=X(e,`rgba`);return t[3]===void 0&&(t[3]=1),t},Z.autodetect.push({p:3,test:(...e)=>{if(e=X(e,`rgba`),Y(e)===`array`&&(e.length===3||e.length===4&&Y(e[3])==`number`&&e[3]>=0&&e[3]<=1))return`rgb`}});var Rk=(e,t,n)=>{if(!Rk[n])throw Error(`unknown blend mode `+n);return Rk[n](e,t)},zk=e=>(t,n)=>{let r=$(n).rgb(),i=$(t).rgb();return $.rgb(e(r,i))},Bk=e=>(t,n)=>{let r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r};Rk.normal=zk(Bk(e=>e)),Rk.multiply=zk(Bk((e,t)=>e*t/255)),Rk.screen=zk(Bk((e,t)=>255*(1-(1-e/255)*(1-t/255)))),Rk.overlay=zk(Bk((e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)))),Rk.darken=zk(Bk((e,t)=>e>t?t:e)),Rk.lighten=zk(Bk((e,t)=>e>t?e:t)),Rk.dodge=zk(Bk((e,t)=>e===255?255:(e=t/255*255/(1-e/255),e>255?255:e))),Rk.burn=zk(Bk((e,t)=>255*(1-(1-t/255)/(e/255))));var{pow:Vk,sin:Hk,cos:Uk}=Math;function Wk(e=300,t=-1.5,n=1,r=1,i=[0,1]){let a=0,o;Y(i)===`array`?o=i[1]-i[0]:(o=0,i=[i,i]);let s=function(s){let c=lO*((e+120)/360+t*s),l=Vk(i[0]+o*s,r),u=(a===0?n:n[0]+s*a)*l*(1-l)/2,d=Uk(c),f=Hk(c),p=l+u*(-.14861*d+1.78277*f),m=l+u*(-.29227*d-.90649*f),h=l+1.97294*d*u;return $(tO([p*255,m*255,h*255,1]))};return s.start=function(t){return t==null?e:(e=t,s)},s.rotations=function(e){return e==null?t:(t=e,s)},s.gamma=function(e){return e==null?r:(r=e,s)},s.hue=function(e){return e==null?n:(n=e,Y(n)===`array`?(a=n[1]-n[0],a===0&&(n=n[1])):a=0,s)},s.lightness=function(e){return e==null?i:(Y(e)===`array`?(i=e,o=e[1]-e[0]):(i=[e,e],o=0),s)},s.scale=()=>$.scale(s),s.hue(n),s}var Gk=`0123456789abcdef`,{floor:Kk,random:qk}=Math,Jk=(e=qk)=>{let t=`#`;for(let n=0;n<6;n++)t+=Gk.charAt(Kk(e()*16));return new Q(t,`hex`)},{log:Yk,pow:Xk,floor:Zk,abs:Qk}=Math;function $k(e,t=null){let n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Y(e)===`object`&&(e=Object.values(e)),e.forEach(e=>{t&&Y(e)===`object`&&(e=e[t]),e!=null&&!isNaN(e)&&(n.values.push(e),n.sum+=e,e<n.min&&(n.min=e),e>n.max&&(n.max=e),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(e,t)=>eA(n,e,t),n}function eA(e,t=`equal`,n=7){Y(e)==`array`&&(e=$k(e));let{min:r,max:i}=e,a=e.values.sort((e,t)=>e-t);if(n===1)return[r,i];let o=[];if(t.substr(0,1)===`c`&&(o.push(r),o.push(i)),t.substr(0,1)===`e`){o.push(r);for(let e=1;e<n;e++)o.push(r+e/n*(i-r));o.push(i)}else if(t.substr(0,1)===`l`){if(r<=0)throw Error(`Logarithmic scales are only possible for values > 0`);let e=Math.LOG10E*Yk(r),t=Math.LOG10E*Yk(i);o.push(r);for(let r=1;r<n;r++)o.push(Xk(10,e+r/n*(t-e)));o.push(i)}else if(t.substr(0,1)===`q`){o.push(r);for(let e=1;e<n;e++){let t=(a.length-1)*e/n,r=Zk(t);if(r===t)o.push(a[r]);else{let e=t-r;o.push(a[r]*(1-e)+a[r+1]*e)}}o.push(i)}else if(t.substr(0,1)===`k`){let e,t=a.length,s=Array(t),c=Array(n),l=!0,u=0,d=null;d=[],d.push(r);for(let e=1;e<n;e++)d.push(r+e/n*(i-r));for(d.push(i);l;){for(let e=0;e<n;e++)c[e]=0;for(let e=0;e<t;e++){let t=a[e],r=Number.MAX_VALUE,i;for(let a=0;a<n;a++){let n=Qk(d[a]-t);n<r&&(r=n,i=a),c[i]++,s[e]=i}}let r=Array(n);for(let e=0;e<n;e++)r[e]=null;for(let n=0;n<t;n++)e=s[n],r[e]===null?r[e]=a[n]:r[e]+=a[n];for(let e=0;e<n;e++)r[e]*=1/c[e];l=!1;for(let e=0;e<n;e++)if(r[e]!==d[e]){l=!0;break}d=r,u++,u>200&&(l=!1)}let f={};for(let e=0;e<n;e++)f[e]=[];for(let n=0;n<t;n++)e=s[n],f[e].push(a[n]);let p=[];for(let e=0;e<n;e++)p.push(f[e][0]),p.push(f[e][f[e].length-1]);p=p.sort((e,t)=>e-t),o.push(p[0]);for(let e=1;e<p.length;e+=2){let t=p[e];!isNaN(t)&&o.indexOf(t)===-1&&o.push(t)}}return o}var tA=(e,t)=>{e=new Q(e),t=new Q(t);let n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},nA=.027,rA=5e-4,iA=.1,aA=1.14,oA=.022,sA=1.414,cA=(e,t)=>{e=new Q(e),t=new Q(t),e.alpha()<1&&(e=zO(t,e,e.alpha(),`rgb`));let n=lA(...e.rgb()),r=lA(...t.rgb()),i=n>=oA?n:n+(oA-n)**+sA,a=r>=oA?r:r+(oA-r)**+sA,o=a**.56-i**.57,s=a**.65-i**.62,c=Math.abs(a-i)<rA?0:i<a?o*aA:s*aA;return(Math.abs(c)<iA?0:c>0?c-nA:c+nA)*100};function lA(e,t,n){return .2126729*(e/255)**2.4+.7151522*(t/255)**2.4+.072175*(n/255)**2.4}var{sqrt:uA,pow:dA,min:fA,max:pA,atan2:mA,abs:hA,cos:gA,sin:_A,exp:vA,PI:yA}=Math;function bA(e,t,n=1,r=1,i=1){var a=function(e){return 360*e/(2*yA)},o=function(e){return 2*yA*e/360};e=new Q(e),t=new Q(t);let[s,c,l]=Array.from(e.lab()),[u,d,f]=Array.from(t.lab()),p=(s+u)/2,m=(uA(dA(c,2)+dA(l,2))+uA(dA(d,2)+dA(f,2)))/2,h=.5*(1-uA(dA(m,7)/(dA(m,7)+dA(25,7)))),g=c*(1+h),_=d*(1+h),v=uA(dA(g,2)+dA(l,2)),y=uA(dA(_,2)+dA(f,2)),b=(v+y)/2,x=a(mA(l,g)),S=a(mA(f,_)),C=x>=0?x:x+360,w=S>=0?S:S+360,T=hA(C-w)>180?(C+w+360)/2:(C+w)/2,E=1-.17*gA(o(T-30))+.24*gA(o(2*T))+.32*gA(o(3*T+6))-.2*gA(o(4*T-63)),ee=w-C;ee=hA(ee)<=180?ee:w<=C?ee+360:ee-360,ee=2*uA(v*y)*_A(o(ee)/2);let te=u-s,ne=y-v,re=1+.015*dA(p-50,2)/uA(20+dA(p-50,2)),ie=1+.045*b,ae=1+.015*b*E,D=30*vA(-dA((T-275)/25,2)),O=-(2*uA(dA(b,7)/(dA(b,7)+dA(25,7))))*_A(2*o(D));return pA(0,fA(100,uA(dA(te/(n*re),2)+dA(ne/(r*ie),2)+dA(ee/(i*ae),2)+O*(ne/(r*ie))*(ee/(i*ae)))))}function xA(e,t,n=`lab`){e=new Q(e),t=new Q(t);let r=e.get(n),i=t.get(n),a=0;for(let e in r){let t=(r[e]||0)-(i[e]||0);a+=t*t}return Math.sqrt(a)}var SA=(...e)=>{try{return new Q(...e),!0}catch{return!1}},CA={cool(){return Mk([$.hsl(180,1,.9),$.hsl(250,.7,.4)])},hot(){return Mk([`#000`,`#f00`,`#ff0`,`#fff`],[0,.25,.75,1]).mode(`rgb`)}},wA={OrRd:[`#fff7ec`,`#fee8c8`,`#fdd49e`,`#fdbb84`,`#fc8d59`,`#ef6548`,`#d7301f`,`#b30000`,`#7f0000`],PuBu:[`#fff7fb`,`#ece7f2`,`#d0d1e6`,`#a6bddb`,`#74a9cf`,`#3690c0`,`#0570b0`,`#045a8d`,`#023858`],BuPu:[`#f7fcfd`,`#e0ecf4`,`#bfd3e6`,`#9ebcda`,`#8c96c6`,`#8c6bb1`,`#88419d`,`#810f7c`,`#4d004b`],Oranges:[`#fff5eb`,`#fee6ce`,`#fdd0a2`,`#fdae6b`,`#fd8d3c`,`#f16913`,`#d94801`,`#a63603`,`#7f2704`],BuGn:[`#f7fcfd`,`#e5f5f9`,`#ccece6`,`#99d8c9`,`#66c2a4`,`#41ae76`,`#238b45`,`#006d2c`,`#00441b`],YlOrBr:[`#ffffe5`,`#fff7bc`,`#fee391`,`#fec44f`,`#fe9929`,`#ec7014`,`#cc4c02`,`#993404`,`#662506`],YlGn:[`#ffffe5`,`#f7fcb9`,`#d9f0a3`,`#addd8e`,`#78c679`,`#41ab5d`,`#238443`,`#006837`,`#004529`],Reds:[`#fff5f0`,`#fee0d2`,`#fcbba1`,`#fc9272`,`#fb6a4a`,`#ef3b2c`,`#cb181d`,`#a50f15`,`#67000d`],RdPu:[`#fff7f3`,`#fde0dd`,`#fcc5c0`,`#fa9fb5`,`#f768a1`,`#dd3497`,`#ae017e`,`#7a0177`,`#49006a`],Greens:[`#f7fcf5`,`#e5f5e0`,`#c7e9c0`,`#a1d99b`,`#74c476`,`#41ab5d`,`#238b45`,`#006d2c`,`#00441b`],YlGnBu:[`#ffffd9`,`#edf8b1`,`#c7e9b4`,`#7fcdbb`,`#41b6c4`,`#1d91c0`,`#225ea8`,`#253494`,`#081d58`],Purples:[`#fcfbfd`,`#efedf5`,`#dadaeb`,`#bcbddc`,`#9e9ac8`,`#807dba`,`#6a51a3`,`#54278f`,`#3f007d`],GnBu:[`#f7fcf0`,`#e0f3db`,`#ccebc5`,`#a8ddb5`,`#7bccc4`,`#4eb3d3`,`#2b8cbe`,`#0868ac`,`#084081`],Greys:[`#ffffff`,`#f0f0f0`,`#d9d9d9`,`#bdbdbd`,`#969696`,`#737373`,`#525252`,`#252525`,`#000000`],YlOrRd:[`#ffffcc`,`#ffeda0`,`#fed976`,`#feb24c`,`#fd8d3c`,`#fc4e2a`,`#e31a1c`,`#bd0026`,`#800026`],PuRd:[`#f7f4f9`,`#e7e1ef`,`#d4b9da`,`#c994c7`,`#df65b0`,`#e7298a`,`#ce1256`,`#980043`,`#67001f`],Blues:[`#f7fbff`,`#deebf7`,`#c6dbef`,`#9ecae1`,`#6baed6`,`#4292c6`,`#2171b5`,`#08519c`,`#08306b`],PuBuGn:[`#fff7fb`,`#ece2f0`,`#d0d1e6`,`#a6bddb`,`#67a9cf`,`#3690c0`,`#02818a`,`#016c59`,`#014636`],Viridis:[`#440154`,`#482777`,`#3f4a8a`,`#31678e`,`#26838f`,`#1f9d8a`,`#6cce5a`,`#b6de2b`,`#fee825`],Spectral:[`#9e0142`,`#d53e4f`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#e6f598`,`#abdda4`,`#66c2a5`,`#3288bd`,`#5e4fa2`],RdYlGn:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#d9ef8b`,`#a6d96a`,`#66bd63`,`#1a9850`,`#006837`],RdBu:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#f7f7f7`,`#d1e5f0`,`#92c5de`,`#4393c3`,`#2166ac`,`#053061`],PiYG:[`#8e0152`,`#c51b7d`,`#de77ae`,`#f1b6da`,`#fde0ef`,`#f7f7f7`,`#e6f5d0`,`#b8e186`,`#7fbc41`,`#4d9221`,`#276419`],PRGn:[`#40004b`,`#762a83`,`#9970ab`,`#c2a5cf`,`#e7d4e8`,`#f7f7f7`,`#d9f0d3`,`#a6dba0`,`#5aae61`,`#1b7837`,`#00441b`],RdYlBu:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee090`,`#ffffbf`,`#e0f3f8`,`#abd9e9`,`#74add1`,`#4575b4`,`#313695`],BrBG:[`#543005`,`#8c510a`,`#bf812d`,`#dfc27d`,`#f6e8c3`,`#f5f5f5`,`#c7eae5`,`#80cdc1`,`#35978f`,`#01665e`,`#003c30`],RdGy:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#ffffff`,`#e0e0e0`,`#bababa`,`#878787`,`#4d4d4d`,`#1a1a1a`],PuOr:[`#7f3b08`,`#b35806`,`#e08214`,`#fdb863`,`#fee0b6`,`#f7f7f7`,`#d8daeb`,`#b2abd2`,`#8073ac`,`#542788`,`#2d004b`],Set2:[`#66c2a5`,`#fc8d62`,`#8da0cb`,`#e78ac3`,`#a6d854`,`#ffd92f`,`#e5c494`,`#b3b3b3`],Accent:[`#7fc97f`,`#beaed4`,`#fdc086`,`#ffff99`,`#386cb0`,`#f0027f`,`#bf5b17`,`#666666`],Set1:[`#e41a1c`,`#377eb8`,`#4daf4a`,`#984ea3`,`#ff7f00`,`#ffff33`,`#a65628`,`#f781bf`,`#999999`],Set3:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`,`#b3de69`,`#fccde5`,`#d9d9d9`,`#bc80bd`,`#ccebc5`,`#ffed6f`],Dark2:[`#1b9e77`,`#d95f02`,`#7570b3`,`#e7298a`,`#66a61e`,`#e6ab02`,`#a6761d`,`#666666`],Paired:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`,`#fdbf6f`,`#ff7f00`,`#cab2d6`,`#6a3d9a`,`#ffff99`,`#b15928`],Pastel2:[`#b3e2cd`,`#fdcdac`,`#cbd5e8`,`#f4cae4`,`#e6f5c9`,`#fff2ae`,`#f1e2cc`,`#cccccc`],Pastel1:[`#fbb4ae`,`#b3cde3`,`#ccebc5`,`#decbe4`,`#fed9a6`,`#ffffcc`,`#e5d8bd`,`#fddaec`,`#f2f2f2`]},TA=Object.keys(wA),EA=new Map(TA.map(e=>[e.toLowerCase(),e])),DA=typeof Proxy==`function`?new Proxy(wA,{get(e,t){let n=t.toLowerCase();if(EA.has(n))return e[EA.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(TA)}}):wA,OA=(...e)=>{e=X(e,`cmyk`);let[t,n,r,i]=e,a=e.length>4?e[4]:1;return i===1?[0,0,0,a]:[t>=1?0:255*(1-t)*(1-i),n>=1?0:255*(1-n)*(1-i),r>=1?0:255*(1-r)*(1-i),a]},{max:kA}=Math,AA=(...e)=>{let[t,n,r]=X(e,`rgb`);t/=255,n/=255,r/=255;let i=1-kA(t,kA(n,r)),a=i<1?1/(1-i):0;return[(1-t-i)*a,(1-n-i)*a,(1-r-i)*a,i]};Q.prototype.cmyk=function(){return AA(this._rgb)},Object.assign($,{cmyk:(...e)=>new Q(...e,`cmyk`)}),Z.format.cmyk=OA,Z.autodetect.push({p:2,test:(...e)=>{if(e=X(e,`cmyk`),Y(e)===`array`&&e.length===4)return`cmyk`}});var jA=(...e)=>{let t=X(e,`hsla`),n=rO(e)||`lsa`;return t[0]=sO(t[0]||0)+`deg`,t[1]=sO(t[1]*100)+`%`,t[2]=sO(t[2]*100)+`%`,n===`hsla`||t.length>3&&t[3]<1?(t[3]=`/ `+(t.length>3?t[3]:1),n=`hsla`):t.length=3,`${n.substr(0,3)}(${t.join(` `)})`},MA=(...e)=>{let t=X(e,`lab`),n=rO(e)||`lab`;return t[0]=sO(t[0])+`%`,t[1]=sO(t[1]),t[2]=sO(t[2]),n===`laba`||t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(` `)})`},NA=(...e)=>{let t=X(e,`lch`),n=rO(e)||`lab`;return t[0]=sO(t[0])+`%`,t[1]=sO(t[1]),t[2]=isNaN(t[2])?`none`:sO(t[2])+`deg`,n===`lcha`||t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(` `)})`},PA=(...e)=>{let t=X(e,`lab`);return t[0]=sO(t[0]*100)+`%`,t[1]=cO(t[1]),t[2]=cO(t[2]),t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(` `)})`},FA=(...e)=>{let[t,n,r,...i]=X(e,`rgb`),[a,o,s]=xk(t,n,r),[c,l,u]=JO(a,o,s);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]},IA=(...e)=>{let t=X(e,`lch`);return t[0]=sO(t[0]*100)+`%`,t[1]=cO(t[1]),t[2]=isNaN(t[2])?`none`:sO(t[2])+`deg`,t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(` `)})`},{round:LA}=Math,RA=(...e)=>{let t=X(e,`rgba`),n=rO(e)||`rgb`;if(n.substr(0,3)===`hsl`)return jA(fk(t),n);if(n.substr(0,3)===`lab`){let e=wO();CO(`d50`);let r=MA(kO(t),n);return CO(e),r}if(n.substr(0,3)===`lch`){let e=wO();CO(`d50`);let r=NA(YO(t),n);return CO(e),r}return n.substr(0,5)===`oklab`?PA(xk(t)):n.substr(0,5)===`oklch`?IA(FA(t)):(t[0]=LA(t[0]),t[1]=LA(t[1]),t[2]=LA(t[2]),(n===`rgba`||t.length>3&&t[3]<1)&&(t[3]=`/ `+(t.length>3?t[3]:1),n=`rgba`),`${n.substr(0,3)}(${t.slice(0,n===`rgb`?3:4).join(` `)})`)},zA=(...e)=>{e=X(e,`lch`);let[t,n,r,...i]=e,[a,o,s]=HO(t,n,r),[c,l,u]=yk(a,o,s);return[c,l,u,...i.length>0&&i[0]<1?[i[0]]:[]]},BA=`((?:-?\\d+)|(?:-?\\d+(?:\\.\\d+)?)%|none)`,VA=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%?)|none)`,HA=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%)|none)`,UA=`\\s*`,WA=`\\s+`,GA=`\\s*,\\s*`,KA=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:deg)?)|none)`,qA=`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?`,JA=RegExp(`^rgba?\\(`+UA+[BA,BA,BA].join(WA)+qA+`\\)$`),YA=RegExp(`^rgb\\(`+UA+[BA,BA,BA].join(GA)+UA+`\\)$`),XA=RegExp(`^rgba\\(`+UA+[BA,BA,BA,VA].join(GA)+UA+`\\)$`),ZA=RegExp(`^hsla?\\(`+UA+[KA,HA,HA].join(WA)+qA+`\\)$`),QA=RegExp(`^hsl?\\(`+UA+[KA,HA,HA].join(GA)+UA+`\\)$`),$A=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ej=RegExp(`^lab\\(`+UA+[VA,VA,VA].join(WA)+qA+`\\)$`),tj=RegExp(`^lch\\(`+UA+[VA,VA,KA].join(WA)+qA+`\\)$`),nj=RegExp(`^oklab\\(`+UA+[VA,VA,VA].join(WA)+qA+`\\)$`),rj=RegExp(`^oklch\\(`+UA+[VA,VA,KA].join(WA)+qA+`\\)$`),{round:ij}=Math,aj=e=>e.map((e,t)=>t<=2?eO(ij(e),0,255):e),oj=(e,t=0,n=100,r=!1)=>(typeof e==`string`&&e.endsWith(`%`)&&(e=parseFloat(e.substring(0,e.length-1))/100,e=r?t+(e+1)*.5*(n-t):t+e*(n-t)),+e),sj=(e,t)=>e===`none`?t:e,cj=e=>{if(e=e.toLowerCase().trim(),e===`transparent`)return[0,0,0,0];let t;if(Z.format.named)try{return Z.format.named(e)}catch{}if((t=e.match(JA))||(t=e.match(YA))){let e=t.slice(1,4);for(let t=0;t<3;t++)e[t]=+oj(sj(e[t],0),0,255);e=aj(e);let n=t[4]===void 0?1:+oj(t[4],0,1);return e[3]=n,e}if(t=e.match(XA)){let e=t.slice(1,5);for(let t=0;t<4;t++)e[t]=+oj(e[t],0,255);return e}if((t=e.match(ZA))||(t=e.match(QA))){let e=t.slice(1,4);e[0]=+sj(e[0].replace(`deg`,``),0),e[1]=oj(sj(e[1],0),0,100)*.01,e[2]=oj(sj(e[2],0),0,100)*.01;let n=aj(dk(e));return n[3]=t[4]===void 0?1:+oj(t[4],0,1),n}if(t=e.match($A)){let e=t.slice(1,4);e[1]*=.01,e[2]*=.01;let n=dk(e);for(let e=0;e<3;e++)n[e]=ij(n[e]);return n[3]=+t[4],n}if(t=e.match(ej)){let e=t.slice(1,4);e[0]=oj(sj(e[0],0),0,100),e[1]=oj(sj(e[1],0),-125,125,!0),e[2]=oj(sj(e[2],0),-125,125,!0);let n=wO();CO(`d50`);let r=aj(TO(e));return CO(n),r[3]=t[4]===void 0?1:+oj(t[4],0,1),r}if(t=e.match(tj)){let e=t.slice(1,4);e[0]=oj(e[0],0,100),e[1]=oj(sj(e[1],0),0,150,!1),e[2]=+sj(e[2].replace(`deg`,``),0);let n=wO();CO(`d50`);let r=aj(UO(e));return CO(n),r[3]=t[4]===void 0?1:+oj(t[4],0,1),r}if(t=e.match(nj)){let e=t.slice(1,4);e[0]=oj(sj(e[0],0),0,1),e[1]=oj(sj(e[1],0),-.4,.4,!0),e[2]=oj(sj(e[2],0),-.4,.4,!0);let n=aj(yk(e));return n[3]=t[4]===void 0?1:+oj(t[4],0,1),n}if(t=e.match(rj)){let e=t.slice(1,4);e[0]=oj(sj(e[0],0),0,1),e[1]=oj(sj(e[1],0),0,.4,!1),e[2]=+sj(e[2].replace(`deg`,``),0);let n=aj(zA(e));return n[3]=t[4]===void 0?1:+oj(t[4],0,1),n}};cj.test=e=>JA.test(e)||ZA.test(e)||ej.test(e)||tj.test(e)||nj.test(e)||rj.test(e)||YA.test(e)||XA.test(e)||QA.test(e)||$A.test(e)||e===`transparent`,Q.prototype.css=function(e){return RA(this._rgb,e)},$.css=(...e)=>new Q(...e,`css`),Z.format.css=cj,Z.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Y(e)===`string`&&cj.test(e))return`css`}}),Z.format.gl=(...e)=>{let t=X(e,`rgba`);return t[0]*=255,t[1]*=255,t[2]*=255,t},$.gl=(...e)=>new Q(...e,`gl`),Q.prototype.gl=function(){let e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},Q.prototype.hex=function(e){return bO(this._rgb,e)},$.hex=(...e)=>new Q(...e,`hex`),Z.format.hex=vO,Z.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&Y(e)===`string`&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return`hex`}});var{log:lj}=Math,uj=e=>{let t=e/100,n,r,i;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*lj(r),i=t<20?0:-254.76935184120902+.8274096064007395*(i=t-10)+115.67994401066147*lj(i)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*lj(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*lj(r),i=255),[n,r,i,1]},{round:dj}=Math,fj=(...e)=>{let t=X(e,`rgb`),n=t[0],r=t[2],i=1e3,a=4e4,o;for(;a-i>.4;){o=(a+i)*.5;let e=uj(o);e[2]/e[0]>=r/n?a=o:i=o}return dj(o)};Q.prototype.temp=Q.prototype.kelvin=Q.prototype.temperature=function(){return fj(this._rgb)};var pj=(...e)=>new Q(...e,`temp`);Object.assign($,{temp:pj,kelvin:pj,temperature:pj}),Z.format.temp=Z.format.kelvin=Z.format.temperature=uj,Q.prototype.oklch=function(){return FA(this._rgb)},Object.assign($,{oklch:(...e)=>new Q(...e,`oklch`)}),Z.format.oklch=zA,Z.autodetect.push({p:2,test:(...e)=>{if(e=X(e,`oklch`),Y(e)===`array`&&e.length===3)return`oklch`}}),Object.assign($,{analyze:$k,average:kk,bezier:Ik,blend:Rk,brewer:DA,Color:Q,colors:hO,contrast:tA,contrastAPCA:cA,cubehelix:Wk,deltaE:bA,distance:xA,input:Z,interpolate:zO,limits:eA,mix:zO,random:Jk,scale:Mk,scales:CA,valid:SA});var mj=()=>window.location.hostname.includes(`greenhouse`),hj=()=>window.location.hostname.includes(`typo3`),gj=e=>hj()||mj()||_j(e),_j=e=>!!e.ownerDocument.defaultView?.frameElement,vj=e=>{let t=getComputedStyle(e),n=t.position===`absolute`,r=/(auto|scroll)/;if(t.position===`fixed`)return document.body;for(let i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position===`static`)&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.body},yj=c((e=>{e.CASE_SENSITIVE_TAG_NAMES_MAP=`animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.linearGradient.radialGradient.textPath`.split(`.`).reduce((e,t)=>(e[t.toLowerCase()]=t,e),{})}));function bj(e){return e.type===xj.Tag||e.type===xj.Script||e.type===xj.Style}var xj,Sj=s((()=>{(function(e){e.Root=`root`,e.Text=`text`,e.Directive=`directive`,e.Comment=`comment`,e.Script=`script`,e.Style=`style`,e.Tag=`tag`,e.CDATA=`cdata`,e.Doctype=`doctype`})(xj||={}),xj.Root,xj.Text,xj.Directive,xj.Comment,xj.Script,xj.Style,xj.Tag,xj.CDATA,xj.Doctype}));function Cj(e){return bj(e)}function wj(e){return e.type===xj.CDATA}function Tj(e){return e.type===xj.Text}function Ej(e){return e.type===xj.Comment}function Dj(e){return e.type===xj.Directive}function Oj(e){return e.type===xj.Root}function kj(e){return Object.hasOwn(e,`children`)}function Aj(e,t=!1){let n;if(Tj(e))n=new Pj(e.data);else if(Ej(e))n=new Fj(e.data);else if(Cj(e)){let r=t?jj(e.children):[],i=new Bj(e.name,{...e.attribs},r);for(let e of r)e.parent=i;e.namespace!=null&&(i.namespace=e.namespace),e[`x-attribsNamespace`]&&(i[`x-attribsNamespace`]={...e[`x-attribsNamespace`]}),e[`x-attribsPrefix`]&&(i[`x-attribsPrefix`]={...e[`x-attribsPrefix`]}),n=i}else if(wj(e)){let r=t?jj(e.children):[],i=new Rj(r);for(let e of r)e.parent=i;n=i}else if(Oj(e)){let r=t?jj(e.children):[],i=new zj(r);for(let e of r)e.parent=i;e[`x-mode`]&&(i[`x-mode`]=e[`x-mode`]),n=i}else if(Dj(e)){let t=new Ij(e.name,e.data);e[`x-name`]!=null&&(t[`x-name`]=e[`x-name`],t[`x-publicId`]=e[`x-publicId`],t[`x-systemId`]=e[`x-systemId`]),n=t}else throw Error(`Not implemented yet: ${e.type}`);return n.startIndex=e.startIndex,n.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function jj(e){let t=e.map(e=>Aj(e,!0));for(let e=1;e<t.length;e++)t[e].prev=t[e-1],t[e-1].next=t[e];return t}var Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj,Bj,Vj=s((()=>{Sj(),Mj=class{parent=null;prev=null;next=null;startIndex=null;endIndex=null;get parentNode(){return this.parent}set parentNode(e){this.parent=e}get previousSibling(){return this.prev}set previousSibling(e){this.prev=e}get nextSibling(){return this.next}set nextSibling(e){this.next=e}cloneNode(e=!1){return Aj(this,e)}},Nj=class extends Mj{data;constructor(e){super(),this.data=e}get nodeValue(){return this.data}set nodeValue(e){this.data=e}},Pj=class extends Nj{type=xj.Text;get nodeType(){return 3}},Fj=class extends Nj{type=xj.Comment;get nodeType(){return 8}},Ij=class extends Nj{type=xj.Directive;name;constructor(e,t){super(t),this.name=e}get nodeType(){return 1}"x-name";"x-publicId";"x-systemId"},Lj=class extends Mj{children;constructor(e){super(),this.children=e}get firstChild(){return this.children[0]??null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(e){this.children=e}},Rj=class extends Lj{type=xj.CDATA;get nodeType(){return 4}},zj=class extends Lj{type=xj.Root;get nodeType(){return 9}},Bj=class extends Lj{name;attribs;type;constructor(e,t,n=[],r=e===`script`?xj.Script:e===`style`?xj.Style:xj.Tag){super(n),this.name=e,this.attribs=t,this.type=r}get nodeType(){return 1}get tagName(){return this.name}set tagName(e){this.name=e}get attributes(){return Object.keys(this.attribs).map(e=>({name:e,value:this.attribs[e],namespace:this[`x-attribsNamespace`]?.[e],prefix:this[`x-attribsPrefix`]?.[e]}))}namespace;"x-attribsNamespace";"x-attribsPrefix"}})),Hj=l({CDATA:()=>Rj,Comment:()=>Fj,DataNode:()=>Nj,Document:()=>zj,DomHandler:()=>Wj,Element:()=>Bj,Node:()=>Mj,NodeWithChildren:()=>Lj,ProcessingInstruction:()=>Ij,Text:()=>Pj,cloneNode:()=>Aj,default:()=>Wj,hasChildren:()=>kj,isCDATA:()=>wj,isComment:()=>Ej,isDirective:()=>Dj,isDocument:()=>Oj,isTag:()=>Cj,isText:()=>Tj}),Uj,Wj,Gj=s((()=>{Sj(),Vj(),Vj(),Uj={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},Wj=class{dom=[];root=new zj(this.dom);callback;options;elementCB;done=!1;tagStack=[this.root];lastNode=null;parser=null;constructor(e,t,n){typeof t==`function`&&(n=t,t=Uj),typeof e==`object`&&(t=e,e=void 0),this.callback=e??null,this.options=t??Uj,this.elementCB=n??null}onparserinit(e){this.parser=e}onreset(){this.dom=[],this.root=new zj(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(e){this.handleCallback(e)}onclosetag(){this.lastNode=null;let e=this.tagStack.pop();this.options.withEndIndices&&this.parser&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)}onopentag(e,t){let n=this.options.xmlMode?xj.Tag:void 0,r=new Bj(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)}ontext(e){let{lastNode:t}=this;if(t&&t.type===xj.Text)t.data+=e,this.options.withEndIndices&&this.parser&&(t.endIndex=this.parser.endIndex);else{let t=new Pj(e);this.addNode(t),this.lastNode=t}}oncomment(e){if(this.lastNode&&this.lastNode.type===xj.Comment){this.lastNode.data+=e;return}let t=new Fj(e);this.addNode(t),this.lastNode=t}oncommentend(){this.lastNode=null}oncdatastart(){let e=new Pj(``),t=new Rj([e]);this.addNode(t),e.parent=t,this.lastNode=e}oncdataend(){this.lastNode=null}onprocessinginstruction(e,t){let n=new Ij(e,t);this.addNode(n)}handleCallback(e){if(typeof this.callback==`function`)this.callback(e,this.dom);else if(e)throw e}addNode(e){let t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&this.parser&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&this.parser&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null}}})),Kj=c((e=>{var t=yj(),n=(Gj(),f(Hj)),r=`\r`,i=new RegExp(r,`g`),a=`__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_${Date.now().toString()}__`,o=new RegExp(a,`g`);function s(e){return t.CASE_SENSITIVE_TAG_NAMES_MAP[e]}function c(e){let t={},n=0,r=e.length;for(;n<r;n++){let r=e[n];t[r.name]=r.value}return t}function l(e){return e=e.toLowerCase(),s(e)||e}function u(e,t){let n=`<`+t,r=e.toLowerCase().indexOf(n);if(r===-1)return!1;let i=e[r+n.length];return i===`>`||i===` `||i===` `||i===`
|
|
144
|
+
`||i===`\r`||i===`/`}function d(e){return e.replace(i,a)}function p(e){return e.replace(o,r)}function m(e,t=null,r){let i=[],a,o=0,s=e.length;for(;o<s;o++){let r=e[o];switch(r.nodeType){case 1:{let e=l(r.nodeName);a=new n.Element(e,c(r.attributes)),a.children=m(e===`template`?r.content.childNodes:r.childNodes,a);break}case 3:a=new n.Text(p(r.nodeValue??``));break;case 8:a=new n.Comment(r.nodeValue??``);break;default:continue}let s=i[o-1]??null;s&&(s.next=a),a.parent=t,a.prev=s,a.next=null,i.push(a)}return r&&(a=new n.ProcessingInstruction(r.substring(0,r.indexOf(` `)).toLowerCase(),r),a.next=i[0]??null,a.parent=t,i.unshift(a),i[1]&&(i[1].prev=i[0])),i}e.escapeSpecialCharacters=d,e.formatDOM=m,e.hasOpenTag=u})),qj=c((e=>{var t=Kj(),n=`html`,r=`head`,i=`body`,a=/<([a-zA-Z]+[0-9]?)/;function o(e,t){return t?t.createHTML(e):e}var s=(e,t,n)=>{throw Error("This browser does not support `document.implementation.createHTMLDocument`")},c=(e,t,n)=>{throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},l=typeof window==`object`&&window.DOMParser;if(typeof l==`function`){let e=new l;c=(t,n,r)=>(n&&(t=`<${n}>${t}</${n}>`),e.parseFromString(t,`text/html`)),s=c}if(typeof document==`object`&&document.implementation){let e=document.implementation.createHTMLDocument();s=function(t,n,r){if(n){let i=e.documentElement.querySelector(n);return i&&(i.innerHTML=o(t,r)),e}return e.documentElement.innerHTML=o(t,r),e}}var u=typeof document==`object`&&document.createElement(`template`),d;u&&u.content&&(d=(e,t)=>(u.innerHTML=o(e,t),u.content.childNodes));var f=()=>document.createDocumentFragment().childNodes;function p(e,o){e=t.escapeSpecialCharacters(e);let l=a.exec(e)?.[1]?.toLowerCase();switch(l){case n:{let a=c(e);if(!t.hasOpenTag(e,r)){let e=a.querySelector(r);e?.parentNode?.removeChild(e)}if(!t.hasOpenTag(e,i)){let e=a.querySelector(i);e?.parentNode?.removeChild(e)}return a.querySelectorAll(n)}case r:case i:{let n=s(e,void 0,o).querySelectorAll(l);return t.hasOpenTag(e,i)&&t.hasOpenTag(e,r)?n[0].parentNode?.childNodes??f():n}default:return d?d(e,o):s(e,i,o).querySelector(i)?.childNodes??f()}}e.default=p})),Jj=c((e=>{Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Kj(),n=qj(),r=/<(![a-zA-Z\s]+)>/;function i(e,i){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];let a=r.exec(e),o=a?a[1]:void 0;return t.formatDOM(n.default(e,i?.trustedTypePolicy),null,o)}e.default=i})),Yj=c((e=>{e.SAME=0,e.CAMELCASE=1,e.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":`acceptCharset`,accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:`className`,classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:`htmlFor`,form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":`httpEquiv`,icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":`accentHeight`,accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":`alignmentBaseline`,allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":`arabicForm`,ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":`baselineShift`,baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":`capHeight`,clip:0,clipPath:1,"clip-path":`clipPath`,clipPathUnits:1,clipRule:1,"clip-rule":`clipRule`,color:0,colorInterpolation:1,"color-interpolation":`colorInterpolation`,colorInterpolationFilters:1,"color-interpolation-filters":`colorInterpolationFilters`,colorProfile:1,"color-profile":`colorProfile`,colorRendering:1,"color-rendering":`colorRendering`,contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":`dominantBaseline`,dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":`enableBackground`,end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":`fillOpacity`,fillRule:1,"fill-rule":`fillRule`,filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":`floodOpacity`,floodColor:1,"flood-color":`floodColor`,focusable:0,fontFamily:1,"font-family":`fontFamily`,fontSize:1,"font-size":`fontSize`,fontSizeAdjust:1,"font-size-adjust":`fontSizeAdjust`,fontStretch:1,"font-stretch":`fontStretch`,fontStyle:1,"font-style":`fontStyle`,fontVariant:1,"font-variant":`fontVariant`,fontWeight:1,"font-weight":`fontWeight`,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":`glyphName`,glyphOrientationHorizontal:1,"glyph-orientation-horizontal":`glyphOrientationHorizontal`,glyphOrientationVertical:1,"glyph-orientation-vertical":`glyphOrientationVertical`,glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":`horizAdvX`,horizOriginX:1,"horiz-origin-x":`horizOriginX`,ideographic:0,imageRendering:1,"image-rendering":`imageRendering`,in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":`letterSpacing`,lightingColor:1,"lighting-color":`lightingColor`,limitingConeAngle:1,local:0,markerEnd:1,"marker-end":`markerEnd`,markerHeight:1,markerMid:1,"marker-mid":`markerMid`,markerStart:1,"marker-start":`markerStart`,markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":`overlinePosition`,overlineThickness:1,"overline-thickness":`overlineThickness`,paintOrder:1,"paint-order":`paintOrder`,panose1:0,"panose-1":`panose1`,pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":`pointerEvents`,points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":`renderingIntent`,repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":`shapeRendering`,slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":`stopColor`,stopOpacity:1,"stop-opacity":`stopOpacity`,strikethroughPosition:1,"strikethrough-position":`strikethroughPosition`,strikethroughThickness:1,"strikethrough-thickness":`strikethroughThickness`,string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":`strokeDasharray`,strokeDashoffset:1,"stroke-dashoffset":`strokeDashoffset`,strokeLinecap:1,"stroke-linecap":`strokeLinecap`,strokeLinejoin:1,"stroke-linejoin":`strokeLinejoin`,strokeMiterlimit:1,"stroke-miterlimit":`strokeMiterlimit`,strokeWidth:1,"stroke-width":`strokeWidth`,strokeOpacity:1,"stroke-opacity":`strokeOpacity`,suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":`textAnchor`,textDecoration:1,"text-decoration":`textDecoration`,textLength:1,textRendering:1,"text-rendering":`textRendering`,to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":`underlinePosition`,underlineThickness:1,"underline-thickness":`underlineThickness`,unicode:0,unicodeBidi:1,"unicode-bidi":`unicodeBidi`,unicodeRange:1,"unicode-range":`unicodeRange`,unitsPerEm:1,"units-per-em":`unitsPerEm`,unselectable:0,vAlphabetic:1,"v-alphabetic":`vAlphabetic`,values:0,vectorEffect:1,"vector-effect":`vectorEffect`,version:0,vertAdvY:1,"vert-adv-y":`vertAdvY`,vertOriginX:1,"vert-origin-x":`vertOriginX`,vertOriginY:1,"vert-origin-y":`vertOriginY`,vHanging:1,"v-hanging":`vHanging`,vIdeographic:1,"v-ideographic":`vIdeographic`,viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":`vMathematical`,vocab:0,widths:0,wordSpacing:1,"word-spacing":`wordSpacing`,writingMode:1,"writing-mode":`writingMode`,x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":`xHeight`,xlinkActuate:1,"xlink:actuate":`xlinkActuate`,xlinkArcrole:1,"xlink:arcrole":`xlinkArcrole`,xlinkHref:1,"xlink:href":`xlinkHref`,xlinkRole:1,"xlink:role":`xlinkRole`,xlinkShow:1,"xlink:show":`xlinkShow`,xlinkTitle:1,"xlink:title":`xlinkTitle`,xlinkType:1,"xlink:type":`xlinkType`,xmlBase:1,"xml:base":`xmlBase`,xmlLang:1,"xml:lang":`xmlLang`,xmlns:0,"xml:space":`xmlSpace`,xmlnsXlink:1,"xmlns:xlink":`xmlnsXlink`,xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}})),Xj=c((e=>{var t=0,n=1,r=2,i=3,a=4,o=5,s=6;function c(e){return u.hasOwnProperty(e)?u[e]:null}function l(e,t,n,o,s,c,l){this.acceptsBooleans=t===r||t===i||t===a,this.attributeName=o,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=l}var u={};[`children`,`dangerouslySetInnerHTML`,`defaultValue`,`defaultChecked`,`innerHTML`,`suppressContentEditableWarning`,`suppressHydrationWarning`,`style`].forEach(e=>{u[e]=new l(e,t,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(([e,t])=>{u[e]=new l(e,n,!1,t,null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(e=>{u[e]=new l(e,r,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(e=>{u[e]=new l(e,r,!1,e,null,!1,!1)}),[`allowFullScreen`,`async`,`autoFocus`,`autoPlay`,`controls`,`default`,`defer`,`disabled`,`disablePictureInPicture`,`disableRemotePlayback`,`formNoValidate`,`hidden`,`loop`,`noModule`,`noValidate`,`open`,`playsInline`,`readOnly`,`required`,`reversed`,`scoped`,`seamless`,`itemScope`].forEach(e=>{u[e]=new l(e,i,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(e=>{u[e]=new l(e,i,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(e=>{u[e]=new l(e,a,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(e=>{u[e]=new l(e,s,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(e=>{u[e]=new l(e,o,!1,e.toLowerCase(),null,!1,!1)});var d=/[\-\:]([a-z])/g,f=e=>e[1].toUpperCase();`accent-height.alignment-baseline.arabic-form.baseline-shift.cap-height.clip-path.clip-rule.color-interpolation.color-interpolation-filters.color-profile.color-rendering.dominant-baseline.enable-background.fill-opacity.fill-rule.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.glyph-name.glyph-orientation-horizontal.glyph-orientation-vertical.horiz-adv-x.horiz-origin-x.image-rendering.letter-spacing.lighting-color.marker-end.marker-mid.marker-start.overline-position.overline-thickness.paint-order.panose-1.pointer-events.rendering-intent.shape-rendering.stop-color.stop-opacity.strikethrough-position.strikethrough-thickness.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.text-anchor.text-decoration.text-rendering.underline-position.underline-thickness.unicode-bidi.unicode-range.units-per-em.v-alphabetic.v-hanging.v-ideographic.v-mathematical.vector-effect.vert-adv-y.vert-origin-x.vert-origin-y.word-spacing.writing-mode.xmlns:xlink.x-height`.split(`.`).forEach(e=>{let t=e.replace(d,f);u[t]=new l(t,n,!1,e,null,!1,!1)}),[`xlink:actuate`,`xlink:arcrole`,`xlink:role`,`xlink:show`,`xlink:title`,`xlink:type`].forEach(e=>{let t=e.replace(d,f);u[t]=new l(t,n,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(e=>{let t=e.replace(d,f);u[t]=new l(t,n,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(e=>{u[e]=new l(e,n,!1,e.toLowerCase(),null,!1,!1)});var p=`xlinkHref`;u[p]=new l(`xlinkHref`,n,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(e=>{u[e]=new l(e,n,!1,e.toLowerCase(),null,!0,!0)});var{CAMELCASE:m,SAME:h,possibleStandardNames:g}=Yj(),_=RegExp.prototype.test.bind(RegExp(`^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`)),v=Object.keys(g).reduce((e,t)=>{let n=g[t];return n===h?e[t]=t:n===m?e[t.toLowerCase()]=t:e[t]=n,e},{});e.BOOLEAN=i,e.BOOLEANISH_STRING=r,e.NUMERIC=o,e.OVERLOADED_BOOLEAN=a,e.POSITIVE_NUMERIC=s,e.RESERVED=t,e.STRING=n,e.getPropertyInfo=c,e.isCustomAttribute=_,e.possibleStandardNames=v})),Zj=c(((e,t)=>{var n=/\/\*(?:[^*]|\*(?!\/))*\*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,c=/^[;\s]*/;function l(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function d(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
145
|
+
`);u=~n?e.length-n:u+e.length}function f(){var e={line:l,column:u};return function(t){return t.position=new p(e),g(),t}}function p(e){this.start=e,this.end={line:l,column:u},this.source=t.source}p.prototype.content=e;function m(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function h(t){var n=t.exec(e);if(n){var r=n[0];return d(r),e=e.slice(r.length),n}}function g(){h(i)}function _(e){for(var t;t=v();)e.push(t);return e}function v(){var t=f();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return m(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,d(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function y(){var e=f(),t=h(a);if(t){if(v(),!h(o))return m(`property missing ':'`);var r=h(s),i=e({type:`declaration`,property:t[0].replace(n,``).trim(),value:r?r[0].replace(n,``).trim():``});return h(c),i}}function b(){var e=[];_(e);for(var t;t=y();)e.push(t),_(e);return e}return g(),b()}t.exports=l})),Qj=c(((e,t)=>{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e},l=(e,t,i)=>(i=e==null?{}:n(o(e)),c(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),u=Zj();u=l(u);function d(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,u.default)(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}t.exports=d})),$j=c(((e,t)=>{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e},l=(e,t,i)=>(i=e==null?{}:n(o(e)),c(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),u=Qj();u=l(u);var d=/^--[a-zA-Z0-9_-]+$/,f=/-([a-z])/g,p=/^[^-]+$/,m=/^-(webkit|moz|ms|o|khtml)-/,h=/^-(ms)-/,g=e=>!e||p.test(e)||d.test(e),_=(e,t)=>t.toUpperCase(),v=(e,t)=>`${t}-`,y=(e,t={})=>g(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(h,v):e.replace(m,v),e.replace(f,_));function b(e,t){let n={};return!e||typeof e!=`string`||(0,u.default)(e,(e,r)=>{e&&r&&(n[y(e,t)]=r)}),n}t.exports=b})),eM=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=a,e.setStyleProp=s;var n=ry(),r=t($j()),i=new Set([`annotation-xml`,`color-profile`,`font-face`,`font-face-src`,`font-face-uri`,`font-face-format`,`font-face-name`,`missing-glyph`]);function a(e,t){return e.includes(`-`)?!i.has(e):!!(t&&typeof t.is==`string`)}var o={reactCompat:!0};function s(e,t){if(typeof e==`string`){if(!e.trim()){t.style={};return}try{t.style=(0,r.default)(e,o)}catch{t.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(`.`)[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set([`tr`,`tbody`,`thead`,`tfoot`,`colgroup`,`table`,`head`,`html`,`frameset`]),e.canTextBeChildOfNode=t=>!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(t.name),e.returnFirstArg=e=>e})),tM=c((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var t=Xj(),n=eM(),r=[`checked`,`value`],i=[`input`,`select`,`textarea`],a={reset:!0,submit:!0};function o(e={},o){let c={},l=!!(e.type&&a[e.type]);for(let a in e){let u=e[a];if((0,t.isCustomAttribute)(a)){c[a]=u;continue}let d=a.toLowerCase(),f=s(d);if(f){let e=(0,t.getPropertyInfo)(f);switch(r.includes(f)&&i.includes(o)&&!l&&(f=s(`default`+d)),c[f]=u,e?.type){case t.BOOLEAN:c[f]=!0;break;case t.OVERLOADED_BOOLEAN:u===``&&(c[f]=!0)}continue}n.PRESERVE_CUSTOM_ATTRIBUTES&&(c[a]=u)}return(0,n.setStyleProp)(e.style,c),c}function s(e){return t.possibleStandardNames[e]}}));function nM(e){return e.type===rM.Tag||e.type===rM.Script||e.type===rM.Style}var rM,iM=s((()=>{(function(e){e.Root=`root`,e.Text=`text`,e.Directive=`directive`,e.Comment=`comment`,e.Script=`script`,e.Style=`style`,e.Tag=`tag`,e.CDATA=`cdata`,e.Doctype=`doctype`})(rM||={}),rM.Root,rM.Text,rM.Directive,rM.Comment,rM.Script,rM.Style,rM.Tag,rM.CDATA,rM.Doctype}));function aM(e){return nM(e)}function oM(e){return e.type===rM.CDATA}function sM(e){return e.type===rM.Text}function cM(e){return e.type===rM.Comment}function lM(e){return e.type===rM.Directive}function uM(e){return e.type===rM.Root}function dM(e){return Object.hasOwn(e,`children`)}function fM(e,t=!1){let n;if(sM(e))n=new gM(e.data);else if(cM(e))n=new _M(e.data);else if(aM(e)){let r=t?pM(e.children):[],i=new SM(e.name,{...e.attribs},r);for(let e of r)e.parent=i;e.namespace!=null&&(i.namespace=e.namespace),e[`x-attribsNamespace`]&&(i[`x-attribsNamespace`]={...e[`x-attribsNamespace`]}),e[`x-attribsPrefix`]&&(i[`x-attribsPrefix`]={...e[`x-attribsPrefix`]}),n=i}else if(oM(e)){let r=t?pM(e.children):[],i=new bM(r);for(let e of r)e.parent=i;n=i}else if(uM(e)){let r=t?pM(e.children):[],i=new xM(r);for(let e of r)e.parent=i;e[`x-mode`]&&(i[`x-mode`]=e[`x-mode`]),n=i}else if(lM(e)){let t=new vM(e.name,e.data);e[`x-name`]!=null&&(t[`x-name`]=e[`x-name`],t[`x-publicId`]=e[`x-publicId`],t[`x-systemId`]=e[`x-systemId`]),n=t}else throw Error(`Not implemented yet: ${e.type}`);return n.startIndex=e.startIndex,n.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function pM(e){let t=e.map(e=>fM(e,!0));for(let e=1;e<t.length;e++)t[e].prev=t[e-1],t[e-1].next=t[e];return t}var mM,hM,gM,_M,vM,yM,bM,xM,SM,CM=s((()=>{iM(),mM=class{parent=null;prev=null;next=null;startIndex=null;endIndex=null;get parentNode(){return this.parent}set parentNode(e){this.parent=e}get previousSibling(){return this.prev}set previousSibling(e){this.prev=e}get nextSibling(){return this.next}set nextSibling(e){this.next=e}cloneNode(e=!1){return fM(this,e)}},hM=class extends mM{data;constructor(e){super(),this.data=e}get nodeValue(){return this.data}set nodeValue(e){this.data=e}},gM=class extends hM{type=rM.Text;get nodeType(){return 3}},_M=class extends hM{type=rM.Comment;get nodeType(){return 8}},vM=class extends hM{type=rM.Directive;name;constructor(e,t){super(t),this.name=e}get nodeType(){return 1}"x-name";"x-publicId";"x-systemId"},yM=class extends mM{children;constructor(e){super(),this.children=e}get firstChild(){return this.children[0]??null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(e){this.children=e}},bM=class extends yM{type=rM.CDATA;get nodeType(){return 4}},xM=class extends yM{type=rM.Root;get nodeType(){return 9}},SM=class extends yM{name;attribs;type;constructor(e,t,n=[],r=e===`script`?rM.Script:e===`style`?rM.Style:rM.Tag){super(n),this.name=e,this.attribs=t,this.type=r}get nodeType(){return 1}get tagName(){return this.name}set tagName(e){this.name=e}get attributes(){return Object.keys(this.attribs).map(e=>({name:e,value:this.attribs[e],namespace:this[`x-attribsNamespace`]?.[e],prefix:this[`x-attribsPrefix`]?.[e]}))}namespace;"x-attribsNamespace";"x-attribsPrefix"}})),wM=l({CDATA:()=>bM,Comment:()=>_M,DataNode:()=>hM,Document:()=>xM,DomHandler:()=>EM,Element:()=>SM,Node:()=>mM,NodeWithChildren:()=>yM,ProcessingInstruction:()=>vM,Text:()=>gM,cloneNode:()=>fM,default:()=>EM,hasChildren:()=>dM,isCDATA:()=>oM,isComment:()=>cM,isDirective:()=>lM,isDocument:()=>uM,isTag:()=>aM,isText:()=>sM}),TM,EM,DM=s((()=>{iM(),CM(),CM(),TM={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},EM=class{dom=[];root=new xM(this.dom);callback;options;elementCB;done=!1;tagStack=[this.root];lastNode=null;parser=null;constructor(e,t,n){typeof t==`function`&&(n=t,t=TM),typeof e==`object`&&(t=e,e=void 0),this.callback=e??null,this.options=t??TM,this.elementCB=n??null}onparserinit(e){this.parser=e}onreset(){this.dom=[],this.root=new xM(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(e){this.handleCallback(e)}onclosetag(){this.lastNode=null;let e=this.tagStack.pop();this.options.withEndIndices&&this.parser&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)}onopentag(e,t){let n=this.options.xmlMode?rM.Tag:void 0,r=new SM(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)}ontext(e){let{lastNode:t}=this;if(t&&t.type===rM.Text)t.data+=e,this.options.withEndIndices&&this.parser&&(t.endIndex=this.parser.endIndex);else{let t=new gM(e);this.addNode(t),this.lastNode=t}}oncomment(e){if(this.lastNode&&this.lastNode.type===rM.Comment){this.lastNode.data+=e;return}let t=new _M(e);this.addNode(t),this.lastNode=t}oncommentend(){this.lastNode=null}oncdatastart(){let e=new gM(``),t=new bM([e]);this.addNode(t),e.parent=t,this.lastNode=e}oncdataend(){this.lastNode=null}onprocessinginstruction(e,t){let n=new vM(e,t);this.addNode(n)}handleCallback(e){if(typeof this.callback==`function`)this.callback(e,this.dom);else if(e)throw e}addNode(e){let t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&this.parser&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&this.parser&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null}}})),OM=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var n=(DM(),f(wM)),r=ry(),i=t(tM()),a=eM(),o={cloneElement:r.cloneElement,createElement:r.createElement,isValidElement:r.isValidElement};function s(e,t={}){let n=[],r=typeof t.replace==`function`,u=t.transform??a.returnFirstArg,{cloneElement:d,createElement:f,isValidElement:p}=t.library??o,m=e.length;c(e);for(let o=0;o<m;o++){let c=e[o];if(r){let e=t.replace?.call(t,c,o);if(p(e)){m>1&&(e=d(e,{key:e.key??o})),n.push(u(e,c,o));continue}}if(c.type===`text`){let e=!c.data.trim().length;if(e&&c.parent&&!(0,a.canTextBeChildOfNode)(c.parent)||t.trim&&e)continue;n.push(u(c.data,c,o));continue}let h=c,g={};l(h)?((0,a.setStyleProp)(h.attribs.style,h.attribs),g=h.attribs):h.attribs&&(g=(0,i.default)(h.attribs,h.name));let _;switch(c.type){case`script`:case`style`:c.children[0]&&(g.dangerouslySetInnerHTML={__html:c.children[0].data});break;case`tag`:c.name===`textarea`&&c.children[0]?g.defaultValue=c.children[0].data:c.children?.length&&(_=s(c.children,t));break;default:continue}m>1&&(g.key=o),n.push(u(f(c.name,g,_),c,o))}return n.length===1?n[0]:n}function c(e){for(let t of e)(t.type===`tag`||t.type===`script`||t.type===`style`)&&(Object.setPrototypeOf(t,n.Element.prototype),c(t.children))}function l(e){return a.PRESERVE_CUSTOM_ATTRIBUTES&&e.type===`tag`&&(0,a.isCustomComponent)(e.name,e.attribs)}})),kM=d(c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=o;var n=t(Jj());e.htmlToDOM=n.default,e.attributesToProps=t(tM()).default;var r=t(OM());e.domToReact=r.default;var i=(DM(),f(wM));Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return i.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return i.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return i.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return i.Text}});var a={lowerCaseAttributeNames:!1};function o(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];let i=Object.assign(Object.assign({},t?.htmlparser2??a),{trustedTypePolicy:t?.trustedTypePolicy});return(0,r.default)((0,n.default)(e,i),t)}}))(),1),AM=kM.default.default||kM.default,jM=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends jM{};function MM(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function NM(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function PM(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function FM(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function IM(e,t){return PM(e,t,``)}function LM(e,t){return FM(e,t,``)}function RM(e,t){return t.slice(0,zM(e,t))}function zM(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function BM(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function VM(e,t){if(t)return UM(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function HM(e,t){if(t)return UM(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function UM(e,t){if(!t)return[HM(e),VM(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=BM(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var WM=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,GM=RegExp(`[${WM}]+|\\s+|[^${WM}]`,`ug`),KM=new class extends jM{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=BM(e,r)}else n=e.match(GM)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&JM(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&JM(n,i,r,null,t.intlSegmenter),e}};function qM(e,t,n){return n?.ignoreWhitespace!=null&&!n.ignoreWhitespace?XM(e,t,n):KM.diff(e,t,n)}function JM(e,t,n,r,i){if(t&&n){let[a,o]=UM(t.value,i),[s,c]=UM(n.value,i);if(e){let r=MM(a,s);e.value=FM(e.value,s,r),t.value=IM(t.value,r),n.value=IM(n.value,r)}if(r){let e=NM(o,c);r.value=PM(r.value,c,e),t.value=LM(t.value,e),n.value=LM(n.value,e)}}else if(n){if(e){let e=HM(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=HM(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=HM(r.value,i),[a,o]=UM(t.value,i),s=MM(n,a);t.value=IM(t.value,s);let c=NM(IM(n,s),o);t.value=LM(t.value,c),r.value=PM(r.value,n,c),e.value=FM(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=HM(r.value,i),n=RM(VM(t.value,i),e);t.value=LM(t.value,n)}else if(e){let n=RM(VM(e.value,i),HM(t.value,i));t.value=IM(t.value,n)}}var YM=new class extends jM{tokenize(e){let t=RegExp(`(\\r?\\n)|[${WM}]+|[^\\S\\n\\r]+|[^${WM}]`,`ug`);return e.match(t)||[]}};function XM(e,t,n){return YM.diff(e,t,n)}new class extends jM{constructor(){super(...arguments),this.tokenize=ZM}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
146
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
147
|
+
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
148
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
149
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function ZM(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
150
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function QM(e){return e==`.`||e==`!`||e==`?`}new class extends jM{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(QM(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends jM{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends jM{constructor(){super(...arguments),this.tokenize=ZM}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify($M(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function $M(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=$M(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=$M(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends jM{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var eN=e=>(new DOMParser().parseFromString(e,`text/html`).body.textContent??``).trim(),tN={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},nN=e=>e.replace(/[&<>"']/g,e=>tN[e]),rN=(e,t,n)=>{let r=qM(t,n,{intlSegmenter:new Intl.Segmenter(e,{granularity:`word`})}),i,a=``,o=``,s=0,c=r.length-1;for(let e=0;e<r.length;e++)i=r[e],i.added||i.removed?(a===``?s=e:(a.endsWith(`</ins>`)||a.endsWith(`</del>`))&&(a+=` `),c=e,o=i.added?`ins`:`del`,i.value!==`undefined`&&(a+=`<${o}>${nN(i.value)}</${o}>`)):a!==``&&e<r.length-1&&(a+=nN(i.value));let l=120-eN(a).length;if(l>0){let e=``;if(s>0&&(e=r[0].value.substring(Math.max(0,r[0].value.length-Math.min(50,l)),r[0].value.length),e!=r[0].value&&(e=e.slice(e.indexOf(` `)),e=`...`+e),a=nN(e)+a),l-=e.length,c<r.length-1&&l){let e=r[r.length-1].value.substring(0,Math.min(50,l));e!=r[r.length-1].value&&(e=e.substring(0,e.lastIndexOf(` `)),e+=`...`),a+=nN(e)}}return a},iN=({analytics:e,element:t,data:n,prevData:r,hide:i,updateTextWithAlternative:a,addIgnoredTerm:o,movePopoverNextOrPrev:s,setLLMSuggestionsRequest:c,getLLMSuggestions:l,focusOnOpen:u,llmAlternativesEnabled:d,dashboardAvailable:f,ignoreTermPermanently:p,onAlternativeAccepted:m})=>{let h=document.documentElement||document.body,{t:g,i18n:_}=ky(eb.popover),{analytics:v,alternativeHovered:y,setAlternativeHovered:b,showLearningBite:x,setShowLearningBite:S,showLearningBiteRef:C,isLoading:w,isSuccess:T,isFailure:E,llmAlternativesResponse:ee,hidePopover:te,clickAlternative:ne,alternativeKeyDown:re,handleIgnoreClick:ie,goToAdjacentAlert:ae}=wC({analytics:e,element:t,data:n,prevData:r,hide:i,updateTextWithAlternative:a,addIgnoredTerm:o,movePopoverNextOrPrev:s,setLLMSuggestionsRequest:c,getLLMSuggestions:l,llmAlternativesEnabled:d,ignoreTermPermanently:p,onAlternativeAccepted:m});(0,W.useEffect)(()=>{_.changeLanguage(n.alert.data?.language)},[n.alert.data?.language]);let{x:D,y:O,strategy:oe,refs:se}=yC({placement:`bottom-start`,middleware:[(e=>({name:`elementCords`,options:e,fn:({placement:n,rects:r})=>{let i={top:0,left:0,bottom:0,right:0};if(gj(t)){let t=document.getElementsByTagName(`iframe`),n=Array.from(t).find(t=>{try{return(t.contentDocument||t.contentWindow?.document)?.contains(e.node)}catch(e){return console.error(`Failed to access iframe content: `,e),!1}});try{n?.getBoundingClientRect()&&(i=n?.getBoundingClientRect())}catch(e){console.error(`Failed to get iframe bounding rect: `,e)}}let a=e.position.x+i.left+h.scrollLeft,o=n.includes(`bottom`)?e.position.y+e.position.height+i.top+h.scrollTop:e.position.y-r.floating.height+i.top+h.scrollTop;return{x:C.current?a/2:a,y:o}}}))(n),SC(),bC(4),xC()]});(0,W.useEffect)(()=>{se.setReference(t),C.current=x},[se.setReference,x]),(0,W.useEffect)(()=>(vj(t)?.addEventListener(`scroll`,ce),t?.addEventListener(`scroll`,ce),document?.addEventListener(`click`,le),document?.addEventListener(`input`,le),ZD()?.addEventListener(`click`,le),ZD()?.addEventListener(`input`,le),()=>{document.removeEventListener(`click`,le),document.removeEventListener(`input`,le),vj(t)?.removeEventListener(`scroll`,ce),t.removeEventListener(`scroll`,ce),ZD().removeEventListener(`click`,le),ZD().removeEventListener(`input`,le)}),[se.floating.current]),(0,W.useEffect)(()=>{u&&se.floating.current?.focus()},[n.alert.id,u,se.floating.current]),(0,W.useEffect)(()=>{let e=ZD(),n=e=>{if(e.key!==`Escape`)return;e.preventDefault(),e.stopPropagation();let n=se.floating.current?.contains(document.activeElement);te(!0),n&&t.focus?.()};return document.addEventListener(`keydown`,n,!0),e!==document&&e?.addEventListener(`keydown`,n,!0),()=>{document.removeEventListener(`keydown`,n,!0),e!==document&&e?.removeEventListener(`keydown`,n,!0)}},[se.floating.current]);let ce=()=>{te()},le=e=>{let t=!se.floating.current?.contains(e.target),r=ZD().documentElement||ZD().body,i=e.pageX+r.scrollLeft,a=e.pageY-r.scrollTop,o=i>=n.position.x&&i<=n.position.x+n.position.width&&a>=n.position.y&&a<=n.position.y+n.position.height;t&&!o&&te()},ue=e=>{let t=(e=!0)=>W.createElement(`div`,{key:`default-expl-${e?`visible`:`hidden`}`,style:{visibility:e?`visible`:`hidden`,gridArea:`1 / 1`}},n.alert.data?.explanation?.text,n.alert.data?.explanation?.context&&` (`+n.alert.data?.explanation?.context+`)`);if(!ee||ee.loading)return t(!0);let r=n.alert.data.alternatives.map((n,r)=>{let i=de(n);return W.createElement(`div`,{key:`explanation-${r}-${n.text||`alt`}`,style:{position:`relative`,top:0,gridArea:`1 / 1`,visibility:e&&e.text===n.text?`visible`:`hidden`}},i||t(!0))});return r.push(t(e===null)),r},de=e=>{let t=ee?.data?.results?.get(e.text);if(!t){let r=n.alert.startOffset-n.alert.data.fullSentence.range[0],i=n.alert.endOffset-n.alert.data.fullSentence.range[0];t=n.alert.data.fullSentence.raw.substring(0,r)+e.text+n.alert.data.fullSentence.raw.substring(i)}return W.createElement(`div`,{dangerouslySetInnerHTML:{__html:rN(n.alert.data.language,n.alert.data.fullSentence.raw,t)}})},fe=e=>{if(e&&e.text===``)return W.createElement(`i`,null,g(`removeSpaces`));{let t=/\(\((.*?)\)\)/;if(RegExp(t).exec(e.text)){let n=e.text.split(t);return W.createElement(`span`,null,n[0],`\xA0`,`[`,W.createElement(`i`,null,n[1]),`]`,`\xA0`,n[2])}return e.text.length>25&&e.context?e.text.substring(0,25)+`...`:e.text.length>35?e.text.substring(0,35)+`...`:e.text}};return W.createElement(`div`,{id:`witty-works-ext-popover`,ref:se.setFloating,role:`dialog`,"aria-label":g(`suggestionsDialog`),tabIndex:-1,style:{position:oe,top:`${O}px`,left:`${D}px`,maxWidth:`min(${x?850:350}px, calc(100vw - 16px))`},onMouseDown:e=>e.preventDefault()},W.createElement(`div`,{id:`witty-works-ext-popover-content`,className:`witty-works-ext-lato-popover-text`},W.createElement(`div`,{className:`witty-works-ext-section witty-works-ext-wittyworks-container witty-works-ext-container-row witty-works-ext-justify-space-between`},W.createElement(`a`,{className:`witty-works-ext-margin-right witty-works-ext-cursor-pointer`,href:`https://www.witty.works/`,target:`_blank`,rel:`noreferrer`,"aria-label":g(`wittyLogo`)},W.createElement(DC,{"aria-hidden":`true`})),W.createElement(`div`,{className:`witty-works-ext-container-row`},W.createElement(`button`,{className:`witty-works-ext-margin-right witty-works-ext-lato-popover-text-gray witty-works-ext-cursor-pointer witty-works-ext-margin-auto witty-works-button`,style:n.index===1?{display:`none`}:{},onClick:()=>{n.index!==1&&ae(`previous`)},"aria-label":g(`previous`),title:g(`previous`)},W.createElement(kC,{alt:g(`previous`)})),W.createElement(`div`,{className:`witty-works-ext-margin-right witty-works-ext-lato-popover-text-gray witty-works-ext-margin-right`,role:`status`,"aria-live":`polite`,"aria-label":`${n.index} ${g(`alertOftotal`)} ${n.totalAlerts}`},`${n.index} ${g(`alertOftotal`)} ${n.totalAlerts}`),W.createElement(`button`,{className:`witty-works-ext-margin-right witty-works-ext-lato-popover-text-gray witty-works-ext-cursor-pointer witty-works-ext-margin-auto witty-works-button`,style:n.index===n.totalAlerts?{display:`none`}:{},onClick:()=>{n.index!==n.totalAlerts&&ae(`next`)},"aria-label":g(`next`),title:g(`next`)},W.createElement(OC,{alt:g(`next`)}))),W.createElement(`button`,{className:`witty-works-ext-lato-popover-text-gray witty-works-ext-cursor-pointer witty-works-button`,onClick:()=>{te(!0)},"aria-label":g(`close`),title:g(`close`)},W.createElement(EC,{alt:g(`close`)}))),n.alert.data?.explanation?.text&&W.createElement(W.Fragment,null,W.createElement(`div`,{className:`witty-works-ext-separator`}),W.createElement(`div`,{className:`witty-works-ext-wittyworks-container witty-works-ext-container-rounded witty-works-ext-container-column witty-works-ext-full-padding witty-works-ext-justify-start witty-works-ext-margin-top`,style:{backgroundColor:ov(n.alert.data?.gravity,n.alert.data?.subcategory).default}},W.createElement(`div`,{className:`witty-works-ext-lato-popover-text witty-works-ext-justify-space-between`,style:{display:`flex`,flexDirection:x?`row`:`column`,alignItems:x?`center`:`flex-start`}},W.createElement(`div`,{className:`witty-works-ext-container-row witty-works-ext-justify-start`,style:{flex:1}},W.createElement(`div`,{style:{fontSize:`2em`,marginRight:`0.5em`,flexShrink:0,height:`100%`}},n.alert.data?.explanation?.icon_image?W.createElement(`img`,{src:n.alert.data?.explanation?.icon_image,alt:``,style:{width:`50px`}}):W.createElement(`span`,null,n.alert.data?.explanation?.icon)),W.createElement(`div`,{className:`witty-works-ext-rephrasing`,style:{flex:`0 1 252px`,minWidth:0,height:`100%`}},W.createElement(`b`,null,n.alert.data?.label.split(`:`).pop()),W.createElement(`br`,null),W.createElement(`div`,{style:{position:`relative`,display:`grid`}},ue(y)))),n.alert.data?.explanation?.url&&W.createElement(`div`,{className:`witty-works-ext-container-row witty-works-ext-justify-end witty-works-ext-lato-popover-text-gray witty-works-ext-cursor-pointer`,style:{marginTop:x?`0em`:`1em`}},W.createElement(`button`,{type:`button`,className:`witty-works-ext-dropdown-select witty-works-ext-container-row`,onClick:()=>{v.popoverLogs(n.alert,`learning_bites`),S(!x)},style:{cursor:n.alert.data?.explanation?.url?`pointer`:`default`},"aria-expanded":x,"aria-label":g(`leanrMoreExtendedText`),title:g(`leanrMoreExtendedText`)},g(`learnMore`),n.alert.data?.explanation?.content===`video`&&W.createElement(AC,{className:`witty-works-ext-margin-left`,style:{marginTop:`0.2em`},alt:g(`video`)}),W.createElement(`div`,{className:`witty-works-ext-margin-left`,style:{pointerEvents:`none`}},x?W.createElement(NC,null):W.createElement(PC,null))),n.alert.data?.source?.url&&W.createElement(`a`,{className:`witty-works-ext-dropdown-select witty-works-ext-container-row`,href:n.alert.data.source.url,target:`_new`,"aria-label":g(`visitSource`),title:g(`visitSource`)},g(`visitSource`),W.createElement(MC,{className:`witty-works-ext-margin-left`,alt:g(`openNewWindow`)})))))),W.createElement(`div`,{style:{display:x?`flex`:`none`}},W.createElement(`div`,{className:`witty-works-ext-learning-bite-dig-deeper`},W.createElement(`div`,null,W.createElement(`div`,null,AM(n.alert.data?.explanation?.long_text??``)),W.createElement(`div`,null,n.alert.data?.explanation?.url&&W.createElement(`a`,{className:`witty-works-dig-deeper witty-works-ext-container-row`,href:n.alert.data.explanation.url,target:`_new`,"aria-label":g(`leanrMoreExtendedText`),title:g(`leanrMoreExtendedText`)},g(`leanrMoreExtendedText`),W.createElement(jC,{className:`witty-works-ext-margin-left`,alt:g(`openNewWindow`)})))),n.alert.data?.explanation?.video_url&&W.createElement(`video`,{width:`500`,style:{maxWidth:`100%`},controls:!0},W.createElement(`source`,{src:n.alert.data?.explanation?.video_url,type:`video/mp4`}),`Your browser does not support the video tag.`),!n.alert.data?.explanation?.video_url&&n.alert.data?.explanation?.image_url&&W.createElement(`img`,{style:{width:`500px`,maxWidth:`100%`},src:n.alert.data?.explanation?.image_url?.src,alt:n.alert.data?.explanation?.image_url?.alt}))),W.createElement(`div`,{className:`witty-works-ext-separator`,style:{marginBottom:`1em`,marginTop:`1em`}}),n.alert.data?.alternatives?.length>0&&!x&&W.createElement(`div`,{className:`witty-works-ext-wittyworks-popover-row`},W.createElement(`div`,{className:`witty-works-ext-wittyworks-popover-alternative-btn-container`},g(`insteadTry`)),W.createElement(`div`,null,n.alert.data?.alternatives.map((e,t)=>e.remove?W.createElement(`div`,{className:`witty-works-ext-wittyworks-popover-alternative-btn-container`,onMouseEnter:()=>{b(e)},onMouseLeave:()=>{b(null)},key:`${t}-${e.text||`alt`}-container`},W.createElement(`button`,{type:`button`,className:`witty-works-ext-wittyworks-popover-alternative-btn witty-works-ext-lato-popover-text-green witty-works-ext-remove-text witty-works-ext-margin-right`,key:`${t}-${e.text||`alt`}-remove-it`,onPointerDown:e=>ne(e.nativeEvent,` `),onKeyDown:re(` `),"aria-label":`${g(`removeText`)} ${n.alert.data?.text}`,title:g(`removeText`)},n.alert.data?.text),e.context&&W.createElement(`div`,{className:`witty-works-ext-wittyworks-popover-alternative-context`},e.context)):W.createElement(`div`,{className:`witty-works-ext-wittyworks-popover-alternative-btn-container`,key:`${t}-${e.text||`alt`}-container`,onMouseEnter:()=>{b(e)},onMouseLeave:()=>{b(null)}},W.createElement(`button`,{type:`button`,className:`witty-works-ext-wittyworks-popover-alternative-btn witty-works-ext-lato-popover-text-green witty-works-ext-margin-right`,onPointerDown:e=>ne(e.nativeEvent,n.alert.data?.alternatives[t]?.text),onKeyDown:re(n.alert.data?.alternatives[t]?.text),"aria-label":n.alert.data?.alternatives[t]?.text,title:n.alert.data?.alternatives[t]?.text},fe(e)),e&&e.context&&W.createElement(`div`,{className:`witty-works-ext-wittyworks-popover-alternative-context`,style:{color:`black`}},e.url?W.createElement(W.Fragment,null,e.context.startsWith(`💡`)?W.createElement(W.Fragment,null,W.createElement(`span`,{style:{whiteSpace:`nowrap`}},W.createElement(`span`,null,e.context.substring(0,3)),W.createElement(`a`,{href:e.url,target:`_blank`,style:{textDecoration:`underline`,color:`black`},rel:`noopener noreferrer`,"aria-label":e.context,title:e.context},e.context.substring(3)))):W.createElement(`a`,{href:e.url,target:`_blank`,style:{textDecoration:`underline`,color:`black`,whiteSpace:`nowrap`},rel:`noopener noreferrer`,"aria-label":e.context,title:e.context},e.context)):W.createElement(`span`,{style:{color:`black`,whiteSpace:`nowrap`}},e.context))))))),!x&&W.createElement(`div`,{className:`witty-works-ext-container-row`},W.createElement(`button`,{onClick:ie(`ignore_once`),className:`witty-works-ext-ignore-section witty-works-ext-ignore-color-transformer witty-works-ext-margin-top witty-works-button`,"aria-label":g(`ignoreOnce`),title:g(`ignoreOnce`)},W.createElement(`span`,{className:`witty-works-ext-margin-right witty-works-ext-cursor-pointer`},W.createElement(YD,{alt:g(`ignoreOnce`)})),W.createElement(`span`,{className:`witty-works-ext-lato-popover-text-gray`},g(`ignoreOnce`))),f&&n?.alert?.data?.text.length<=50&&W.createElement(`button`,{onClick:ie(`ignore_permanently`),className:`witty-works-ext-ignore-section witty-works-ext-ignore-color-transformer witty-works-ext-margin-top witty-works-button`,"aria-label":g(`ignorePermanently`),title:g(`ignorePermanently`)},W.createElement(`span`,{className:`witty-works-ext-margin-right witty-works-ext-cursor-pointer`},W.createElement(YD,{alt:g(`ignorePermanently`)})),W.createElement(`span`,{className:`witty-works-ext-lato-popover-text-gray witty-works-ext-margin-right`},g(`ignorePermanently`)),w===`ignore_permanently`&&W.createElement(KD,null),T===`ignore_permanently`&&W.createElement(qD,null),E===`ignore_permanently`&&W.createElement(W.Fragment,null,W.createElement(JD,null),` `,W.createElement(`span`,{className:`witty-works-ext-margin-left`},g(`failedRequestText`))))))},aN=e=>{let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t&=t}return t.toString()},oN=()=>({data:null,error:null,loading:!0}),sN=e=>`${aN(e.alert.data.fullSentence.raw)}::${e.alert.data.text}`,cN=(e,t)=>({data:e?{...e,results:new Map(Object.entries(e.results))}:null,error:t||null,loading:!1}),lN=(e,t,n,r)=>{let i=Cb(n,r),{from:a,to:o}=t;if(i.scope===`sentence`){let{detail:r}=t,s=r.data.fullSentence,c=t.from-(r.absOffset-s.range[0]),l=c+s.raw.length;c>=0&&l<=e.content.size&&e.textBetween(c,l)===s.raw?(a=c,o=l):i=Cb(n,null)}return n===` `&&a>0&&e.textBetween(a-1,a)===` `&&--a,{from:a,to:o,text:i.text}},uN={popoverLogs:()=>void 0,alternativeLog:()=>void 0,ignoreLog:()=>void 0},dN=class{view;options;container;root;openId=null;focusOnOpen=!1;prevData=null;llmCache=new Map;rewriteGeneration=0;destroyed=!1;constructor(e,t){this.view=e,this.options=t,this.container=document.createElement(`div`),this.container.className=`witty-editor-popover`,document.body.append(this.container),this.root=(0,Ax.createRoot)(this.container)}get isOpen(){return this.openId!==null}open(e,{viaKeyboard:t=!1}={}){this.destroyed||(this.focusOnOpen=t,this.openId=e,Sx(this.view,e),this.render())}openAtSelection(){let{from:e}=this.view.state.selection,t=mx(this.view.state).find(t=>t.from<=e&&e<=t.to);return t?(this.open(t.id,{viaKeyboard:!0}),!0):!1}close(){this.openId!==null&&(this.openId=null,this.prevData=null,Sx(this.view,null),this.root.render(null))}update(){if(this.openId!==null){if(!this.current()){this.close();return}this.render()}}resetRewrites(){this.llmCache.clear(),this.rewriteGeneration+=1}destroy(){this.destroyed=!0,this.openId=null,this.root.unmount(),this.container.remove()}current(){return mx(this.view.state).find(e=>e.id===this.openId)}render(){if(this.destroyed)return;let e=mx(this.view.state),t=e.findIndex(e=>e.id===this.openId),n=e[t];if(!n){this.close();return}let r=this.view.coordsAtPos(n.from),i=this.view.coordsAtPos(n.to),a={index:t+1,totalAlerts:e.length,alert:n.detail,position:new DOMRect(r.left,r.top,Math.max(i.right-r.left,1),r.bottom-r.top),node:this.view.domAtPos(n.from).node};this.root.render(W.createElement(iN,{analytics:uN,element:this.view.dom,data:a,prevData:this.prevData,hide:()=>this.close(),updateTextWithAlternative:e=>this.apply(n,e),addIgnoredTerm:e=>{this.options.ignored.add(e),Cx(this.view,e)},movePopoverNextOrPrev:e=>this.move(t,e),setLLMSuggestionsRequest:e=>this.requestRewrites(e),getLLMSuggestions:e=>this.llmCache.get(sN(e)),focusOnOpen:this.focusOnOpen,llmAlternativesEnabled:this.options.llmAlternatives(),dashboardAvailable:!1,ignoreTermPermanently:()=>Promise.reject(Error(`no dashboard to persist ignores to`)),onAlternativeAccepted:()=>void 0})),this.prevData=a}move(e,t){let n=mx(this.view.state)[e+(t===`previous`?-1:1)];n&&this.open(n.id,{viaKeyboard:this.focusOnOpen})}apply(e,t){this.close();let{state:n}=this.view,{from:r,to:i,text:a}=lN(n.doc,e,t,this.llmCache.get(sN({alert:e.detail}))?.data?.results),o=a?n.tr.insertText(a,r,i):n.tr.delete(r,i);this.view.dispatch(o.scrollIntoView()),this.view.focus()}rewriteBody(e){let t=mb(e.alert.data.fullSentence,e.alert),n=_b(e.alert.data.language,this.options.config());return n?{...t,gender_separator:n}:t}requestRewrites(e){let t=sN(e),n=this.llmCache.get(t);if(n&&!n.error)return;let r=this.rewriteGeneration;this.llmCache.set(t,oN()),this.render(),fetch(`${this.options.endpoint}${cb}`,{method:`POST`,headers:{...db,...this.options.headers()},body:JSON.stringify(this.rewriteBody(e)),signal:AbortSignal.timeout(this.options.llmTimeoutMs)}).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return cN(await e.json(),null)}).catch(e=>cN(null,{message:String(e)})).then(e=>{this.destroyed||r!==this.rewriteGeneration||(this.llmCache.set(t,e),this.openId!==null&&this.render())})}},fN=e=>{let t=e,n=new Set;return{get:()=>t,set(e){t={...t,...e},n.forEach(e=>e())},subscribe(e){return n.add(e),()=>{n.delete(e)}}}},pN=e=>fN(e),mN=e=>{let t={};for(let n of[`gendered_roles_format`,`german_gender_ending`,`french_gender_separator`]){let r=e[n];r&&(t[n]=r)}return t},hN=(e,t,n)=>{let r={...e};return n?r[t]=n:delete r[t],r},gN=(e,t,n)=>({...e,disabled_categories:rv(t.key,t.advanced_key,n,e.disabled_categories??[])}),_N=({categoryKey:e,label:t,value:n,hasAdvanced:r,locked:i=!1,onChange:a})=>{let{t:o}=ky(eb.options),s=[o(`levelOff`),o(`levelBasic`),o(`levelAdvanced`)][n];return W.createElement(`div`,{className:`witty-category`},W.createElement(`button`,{type:`button`,className:[`witty-category-toggle`,n>tv.Off?`is-on`:``,n===tv.Basic?`is-middle`:``,i?`is-locked`:``].filter(Boolean).join(` `),"data-category":e,"data-level":n,"aria-label":`${t}: ${s}`,"aria-disabled":i,title:i?o(`levelLocked`):s,onClick:()=>{i||a(n>=(r?tv.Advanced:tv.Basic)?tv.Off:n+1)}},W.createElement(`span`,{className:`witty-category-knob`})),W.createElement(`span`,{className:`witty-category-label`},t),W.createElement(`span`,{className:`witty-category-level`},s))},vN={gendered_roles_format:`genderedRolesFormat`,german_gender_ending:`germanGenderEnding`,french_gender_separator:`frenchGenderSeparator`},yN=({orthography:e,onOrthographyChange:t,llmAlternatives:n,onLlmAlternativesChange:r,configOptions:i,languageFormat:a,onFormatFieldChange:o,categories:s,categoryGroups:c,disabledCategories:l,onCategoryLevelChange:u,categoriesError:d=!1,idPrefix:f=``})=>{let{t:p}=ky(eb.options),m=(e,t)=>i[e]?.labels?.[t]||t;return W.createElement(W.Fragment,null,W.createElement(`section`,null,W.createElement(`h2`,null,p(`customisationHeadline`)),W.createElement(`p`,{className:`witty-options-muted`},p(`orgOverrideNote`)),W.createElement(`label`,null,W.createElement(`input`,{type:`checkbox`,id:`${f}opt-orthography`,checked:e,onChange:e=>t(e.target.checked)}),`\xA0`,p(`orthography`)),W.createElement(`label`,null,W.createElement(`input`,{type:`checkbox`,id:`${f}opt-llm-alternatives`,checked:n,onChange:e=>r(e.target.checked)}),`\xA0`,p(`llmAlternatives`))),Object.keys(i).length>0&&W.createElement(`section`,{id:`${f}language-format-section`},W.createElement(`h2`,null,p(`languageHeadline`)),W.createElement(`p`,{className:`witty-options-muted`},p(`orgOverrideNote`)),ev.filter(e=>i[e]).map(e=>{let t=i[e],n=vN[e];return W.createElement(`div`,{className:`witty-format-field`,key:e},W.createElement(`label`,{htmlFor:`${f}opt-${e}`},p(n)),W.createElement(`p`,{className:`witty-options-muted`},p(`${n}Hint`)),W.createElement(`select`,{id:`${f}opt-${e}`,"data-field":e,value:a[e]||``,onChange:t=>o(e,t.target.value)},W.createElement(`option`,{value:``},p(`useApiDefault`),t.default?` (${t.default})`:``),t.values.map(t=>W.createElement(`option`,{value:t,key:t},m(e,t)))))})),s.length>0&&W.createElement(`section`,{id:`${f}categories-section`},W.createElement(`h2`,null,p(`categoriesHeadline`)),W.createElement(`p`,{className:`witty-options-muted`},p(`categoriesIntro`)),c.map(e=>{let t=s.filter(t=>t.parent===e.key);return t.length?W.createElement(`div`,{className:`witty-category-group`,key:e.key},W.createElement(`h3`,null,e.label||e.key),t.map(e=>W.createElement(_N,{key:e.key,categoryKey:e.key,label:e.label||e.key,hasAdvanced:!!e.advanced_key,locked:e.proficiency_level===`openly_discriminating`,value:nv(e.key,e.advanced_key,l),onChange:t=>u(e,t)}))):null})),d&&W.createElement(`p`,{className:`witty-options-muted`},p(`categoriesFailed`)))},bN=e=>(0,G.jsxs)(`svg`,{width:25,height:21,viewBox:`0 0 25 21`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,G.jsx)(`path`,{d:`M14.4244 15.865C15.2179 17.3926 17.2257 17.3746 17.9964 15.833L16.5828 14.9778C16.4193 15.3047 15.9934 15.3086 15.8251 14.9846L14.4244 15.865Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M13.0406 13.2011L14.4244 15.865L15.8251 14.9846L14.4413 12.3206L13.0406 13.2011Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M13.3408 11.9904C12.954 12.2335 12.8196 12.7756 13.0406 13.2011L14.4413 12.3206C14.2203 11.8951 13.7276 11.7473 13.3408 11.9904Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M11.079 4.41595C10.7681 3.56076 10.0151 3 9.17787 3V4.7747C9.17787 4.7747 9.51518 4.89365 9.58114 5.07505L10.5101 7.62978C10.6755 8.0848 11.145 8.30612 11.5586 8.12411C11.9722 7.94211 12.1734 7.4257 12.008 6.97068L11.079 4.41595Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M9.17787 3H4.05053V4.7747H9.17787V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M4.05053 3C2.49311 3 1.50583 4.83684 2.25638 6.33803L3.66995 5.48277C3.51074 5.16433 3.72017 4.7747 4.05053 4.7747V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M8.34416 14.8317L3.66995 5.48277L2.25638 6.33803L6.93059 15.687L8.34416 14.8317Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M9.11322 14.8151C8.95664 15.1596 8.51289 15.1692 8.34416 14.8317L6.93059 15.687C7.71306 17.252 9.75015 17.2339 10.519 15.687L9.11322 14.8151Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M13.9175 4.24516L9.11322 14.8151L10.519 15.687C10.5317 15.6613 10.5441 15.6353 10.5562 15.6088L15.3604 5.03882L13.9175 4.24516Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M15.7489 3C14.9733 3 14.2643 3.48204 13.9175 4.24516L15.3604 5.03882C15.434 4.87695 15.5844 4.7747 15.7489 4.7747V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M20.9495 3H15.7489V4.7747H20.9495V3Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M22.7436 6.33803C23.4942 4.83684 22.5069 3 20.9495 3V4.7747C21.2798 4.7747 21.4893 5.16433 21.3301 5.48277L22.7436 6.33803Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M17.9964 15.833L22.7436 6.33803L21.3301 5.48277L16.5828 14.9778L17.9964 15.833Z`,fill:`#9489DB`})]}),xN=e=>(0,G.jsxs)(`svg`,{width:25,height:24,viewBox:`0 0 25 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,G.jsx)(`path`,{d:`M14.4244 18.865C15.2179 20.3926 17.2257 20.3746 17.9964 18.833L16.5828 17.9778C16.4193 18.3047 15.9934 18.3086 15.8251 17.9846L14.4244 18.865Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M13.0406 16.2011L14.4244 18.865L15.8251 17.9846L14.4413 15.3206L13.0406 16.2011Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M13.3408 14.9904C12.954 15.2335 12.8196 15.7756 13.0406 16.2011L14.4413 15.3206C14.2203 14.8951 13.7276 14.7473 13.3408 14.9904Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M11.079 7.41595C10.7681 6.56076 10.0151 6 9.17787 6V7.7747C9.17787 7.7747 9.51518 7.89365 9.58114 8.07505L10.5101 10.6298C10.6755 11.0848 11.145 11.3061 11.5586 11.1241C11.9722 10.9421 12.1734 10.4257 12.008 9.97068L11.079 7.41595Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M9.17787 6H4.05053V7.7747H9.17787V6Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M4.05053 6C2.49311 6 1.50583 7.83684 2.25638 9.33803L3.66995 8.48277C3.51074 8.16433 3.72017 7.7747 4.05053 7.7747V6Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M8.34416 17.8317L3.66995 8.48277L2.25638 9.33803L6.93059 18.687L8.34416 17.8317Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M9.11322 17.8151C8.95664 18.1596 8.51289 18.1692 8.34416 17.8317L6.93059 18.687C7.71306 20.252 9.75014 20.2339 10.519 18.687L9.11322 17.8151Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M13.9175 7.24516L9.11322 17.8151L10.519 18.687C10.5317 18.6613 10.5441 18.6353 10.5562 18.6088L15.3604 8.03882L13.9175 7.24516Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M15.7489 6C14.9733 6 14.2643 6.48204 13.9175 7.24516L15.3604 8.03882C15.434 7.87695 15.5844 7.7747 15.7489 7.7747V6Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M20.9495 6H15.7489V7.7747H20.9495V6Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M22.7436 9.33803C23.4942 7.83684 22.5069 6 20.9495 6V7.7747C21.2798 7.7747 21.4893 8.16433 21.33 8.48277L22.7436 9.33803Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M17.9964 18.833L22.7436 9.33803L21.33 8.48277L16.5828 17.9778L17.9964 18.833Z`,fill:`#9489DB`}),(0,G.jsx)(`path`,{d:`M6.38 5.43V11.15C6.38 11.7633 6.34333 12.3733 6.27 12.98C6.19667 13.58 6.1 14.1933 5.98 14.82H3.88C3.76 14.1933 3.66333 13.58 3.59 12.98C3.51667 12.3733 3.48 11.7633 3.48 11.15V5.43H6.38ZM3.14 18.43C3.14 18.19 3.18333 17.9667 3.27 17.76C3.36333 17.5533 3.48667 17.3733 3.64 17.22C3.8 17.0667 3.98667 16.9467 4.2 16.86C4.41333 16.7667 4.64667 16.72 4.9 16.72C5.14667 16.72 5.37667 16.7667 5.59 16.86C5.80333 16.9467 5.99 17.0667 6.15 17.22C6.31 17.3733 6.43333 17.5533 6.52 17.76C6.61333 17.9667 6.66 18.19 6.66 18.43C6.66 18.67 6.61333 18.8967 6.52 19.11C6.43333 19.3167 6.31 19.4967 6.15 19.65C5.99 19.8033 5.80333 19.9233 5.59 20.01C5.37667 20.0967 5.14667 20.14 4.9 20.14C4.64667 20.14 4.41333 20.0967 4.2 20.01C3.98667 19.9233 3.8 19.8033 3.64 19.65C3.48667 19.4967 3.36333 19.3167 3.27 19.11C3.18333 18.8967 3.14 18.67 3.14 18.43Z`,fill:`#F06464`})]}),SN=e=>{let t=(0,W.useRef)(0),n=(0,W.useCallback)(n=>{let r=()=>{t.current+=1,n()};return e.on(`transaction`,r),()=>{e.off(`transaction`,r)}},[e]);return(0,W.useSyncExternalStore)(n,()=>t.current)},CN=e=>(0,W.useSyncExternalStore)(e.subscribe,e.get),wN=async e=>{let t=async t=>{let n=await fetch(`${e.endpoint}${t}`,{headers:{...db,...e.headers()}});if(!n.ok)throw Error(String(n.status));return n.json()},[n,r]=await Promise.allSettled([t(ub(navigator.language||`en-US`)),t(lb)]),i=n.status===`fulfilled`?n.value:void 0;return{categories:i?.categories||[],categoryGroups:i?.groups||[],categoriesError:!i,configOptions:r.status===`fulfilled`&&r.value.options||{}}},TN=e=>{let[t,n]=(0,W.useState)(null);return(0,W.useEffect)(()=>{let t=!0;return e().then(e=>{t&&n(e)}),()=>{t=!1}},[e]),t},EN=({id:e,store:t,loadOptions:n,onClose:r})=>{let{t:i}=ky(eb.editor),a=CN(t),o=TN(n),{config:s}=a;return W.createElement(`div`,{id:e,className:`witty-editor-settings witty-preferences`,role:`region`,"aria-label":i(`settings`),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),r())}},W.createElement(`button`,{type:`button`,className:`witty-editor-settings-close`,"aria-label":i(`closeSettings`),title:i(`closeSettings`),onClick:r},`×`),!o&&W.createElement(`p`,{"aria-live":`polite`},i(`settingsLoading`)),W.createElement(yN,{idPrefix:`${e}-`,orthography:a.orthography,onOrthographyChange:e=>t.set({orthography:e}),llmAlternatives:a.llmAlternatives,onLlmAlternativesChange:e=>t.set({llmAlternatives:e}),configOptions:o?.configOptions??{},languageFormat:mN(s),onFormatFieldChange:(e,n)=>t.set({config:hN(s,e,n)}),categories:o?.categories??[],categoryGroups:o?.categoryGroups??[],disabledCategories:s.disabled_categories??[],onCategoryLevelChange:(e,n)=>t.set({config:gN(s,e,n)}),categoriesError:o?.categoriesError}))},DN=e=>{let{t}=ky(eb.editor);switch(e.state){case`checking`:return{text:t(`statusChecking`),announce:``};case`idle`:{let n=e.alerts?t(`statusAlerts`,{count:e.alerts}):t(`statusNoAlerts`);return{text:n,announce:n}}case`unauthorized`:return{text:t(`statusUnauthorized`),announce:t(`statusUnauthorized`)};default:return{text:t(`statusFailed`),announce:t(`statusFailed`)}}},ON=()=>typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,kN=({status:e})=>e.state===`checking`?ON()?W.createElement(bN,{"aria-hidden":`true`,style:{opacity:.5}}):W.createElement(KD,null):e.state===`idle`?W.createElement(bN,{"aria-hidden":`true`}):W.createElement(xN,{"aria-hidden":`true`}),AN=({editor:e,store:t,status:n,loadOptions:r})=>{let{t:i}=ky(eb.editor);SN(e);let{status:a}=(0,W.useSyncExternalStore)(n.subscribe,n.get),o=DN(a),[s,c]=(0,W.useState)(0),[l,u]=(0,W.useState)(!1),d=(0,W.useRef)([]),f=(0,W.useId)(),p=()=>e.chain().focus(),m=[{key:`bold`,label:i(`bold`),glyph:`B`,run:()=>p().toggleBold().run(),active:e.isActive(`bold`),enabled:e.can().toggleBold()},{key:`italic`,label:i(`italic`),glyph:`I`,run:()=>p().toggleItalic().run(),active:e.isActive(`italic`),enabled:e.can().toggleItalic()},{key:`underline`,label:i(`underline`),glyph:`U`,run:()=>p().toggleUnderline().run(),active:e.isActive(`underline`),enabled:e.can().toggleUnderline()},{key:`heading`,label:i(`heading`),glyph:`H`,run:()=>p().toggleHeading({level:2}).run(),active:e.isActive(`heading`,{level:2}),enabled:e.can().toggleHeading({level:2})},{key:`bulletList`,label:i(`bulletList`),glyph:`•`,run:()=>p().toggleBulletList().run(),active:e.isActive(`bulletList`),enabled:e.can().toggleBulletList()},{key:`orderedList`,label:i(`orderedList`),glyph:`1.`,run:()=>p().toggleOrderedList().run(),active:e.isActive(`orderedList`),enabled:e.can().toggleOrderedList()},{key:`quote`,label:i(`quote`),glyph:`❝`,run:()=>p().toggleBlockquote().run(),active:e.isActive(`blockquote`),enabled:e.can().toggleBlockquote()},{key:`undo`,label:i(`undo`),glyph:`↶`,run:()=>p().undo().run(),enabled:e.can().undo()},{key:`redo`,label:i(`redo`),glyph:`↷`,run:()=>p().redo().run(),enabled:e.can().redo()}],h=m.length+1,g=e=>{let t=(e+h)%h;c(t),d.current[t]?.focus()};return W.createElement(W.Fragment,null,W.createElement(`div`,{className:`witty-editor-toolbar`,role:`toolbar`,"aria-label":i(`toolbar`),onKeyDown:e=>{let t={ArrowRight:s+1,ArrowLeft:s-1,Home:0,End:h-1};e.key in t&&(e.preventDefault(),g(t[e.key]))}},m.map((e,t)=>W.createElement(`button`,{key:e.key,ref:e=>{d.current[t]=e},type:`button`,className:`witty-editor-tool witty-editor-tool--${e.key}`,"aria-label":e.label,title:e.label,"aria-pressed":e.active,"aria-disabled":!e.enabled,tabIndex:t===s?0:-1,onFocus:()=>c(t),onMouseDown:e=>e.preventDefault(),onClick:()=>e.enabled&&e.run()},e.glyph)),W.createElement(`button`,{ref:e=>{d.current[h-1]=e},type:`button`,className:`witty-editor-tool witty-editor-tool--settings is-${a.state}`,"aria-label":i(`settings`),title:`${i(`settings`)} · ${o.text}`,"aria-expanded":l,"aria-controls":f,tabIndex:s===h-1?0:-1,onFocus:()=>c(h-1),onClick:()=>u(e=>!e)},W.createElement(kN,{status:a}))),W.createElement(`span`,{className:`witty-editor-sr-only`,role:`status`,"aria-live":`polite`},o.announce),l&&W.createElement(EN,{id:f,store:t,loadOptions:r,onClose:()=>{u(!1),d.current[h-1]?.focus()}}))},jN=`
|
|
151
|
+
.witty-editor-toolbar {
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-wrap: wrap;
|
|
154
|
+
gap: 2px;
|
|
155
|
+
padding: 4px 0;
|
|
156
|
+
border-bottom: 1px solid #e6e6e6;
|
|
157
|
+
}
|
|
158
|
+
.witty-editor-tool {
|
|
159
|
+
min-width: 2rem;
|
|
160
|
+
height: 2rem;
|
|
161
|
+
padding: 0 0.4rem;
|
|
162
|
+
border: 1px solid transparent;
|
|
163
|
+
border-radius: 4px;
|
|
164
|
+
background: none;
|
|
165
|
+
font: inherit;
|
|
166
|
+
font-weight: 600;
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
}
|
|
169
|
+
.witty-editor-tool--italic { font-style: italic; }
|
|
170
|
+
.witty-editor-tool--underline { text-decoration: underline; }
|
|
171
|
+
.witty-editor-tool--settings {
|
|
172
|
+
margin-left: auto;
|
|
173
|
+
display: inline-flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
}
|
|
177
|
+
.witty-editor-tool--settings svg { display: block; }
|
|
178
|
+
.witty-editor-tool:hover { background: #f2f2f2; }
|
|
179
|
+
.witty-editor-tool[aria-pressed='true'] { background: #e8eefb; border-color: #9fb8ea; }
|
|
180
|
+
.witty-editor-tool[aria-disabled='true'] { opacity: 0.4; cursor: default; }
|
|
181
|
+
.witty-editor-tool:focus-visible { outline: 2px solid #55b8e9; outline-offset: 1px; }
|
|
182
|
+
.witty-editor-settings {
|
|
183
|
+
position: relative;
|
|
184
|
+
padding: 0.75rem 2.5rem 0.75rem 0.25rem;
|
|
185
|
+
border-bottom: 1px solid #e6e6e6;
|
|
186
|
+
max-height: 60vh;
|
|
187
|
+
overflow: auto;
|
|
188
|
+
}
|
|
189
|
+
.witty-editor-settings-close {
|
|
190
|
+
position: absolute;
|
|
191
|
+
top: 0.5rem;
|
|
192
|
+
right: 0.25rem;
|
|
193
|
+
width: 2rem;
|
|
194
|
+
height: 2rem;
|
|
195
|
+
border: 0;
|
|
196
|
+
background: none;
|
|
197
|
+
font-size: 1.25rem;
|
|
198
|
+
cursor: pointer;
|
|
199
|
+
}
|
|
200
|
+
`,MN=(e,t)=>{let n,r=()=>(n??=wN(t.api).then(e=>(e.categoriesError&&(n=void 0),e)),n),i=(0,Ax.createRoot)(e);return i.render(W.createElement(AN,{editor:t.editor,store:t.store,status:t.status,loadOptions:r})),{destroy:()=>i.unmount()}},NN=()=>[`.witty-editor .ProseMirror { outline: none; min-height: 8rem; }`,`.witty-editor .ProseMirror:focus-visible { outline: 2px solid #55b8e9; outline-offset: 2px; border-radius: 2px; }`,`.witty-editor-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }`,jN,`.witty-alert { border-bottom: 2px solid transparent; cursor: pointer; }`,`.witty-alert--dotted { border-bottom-style: dotted; border-bottom-width: 3px; }`,`.witty-alert--selected { background-color: var(--witty-alert-fill); border-radius: 4px; }`,...Object.entries(iv).map(([e,t])=>`.witty-alert--${e} { border-bottom-color: ${t.hover}; --witty-alert-fill: ${t.highlight}33; }`)].join(`
|
|
201
|
+
`),PN=`witty-editor-styles`,FN=()=>{if(document.getElementById(PN))return;let e=document.createElement(`style`);e.id=PN,e.textContent=NN(),document.head.append(e)},IN=e=>nf.create({name:`wittyPopoverTriggers`,addKeyboardShortcuts(){return{"Alt-Shift-w":()=>e()?.openAtSelection()??!1}},addProseMirrorPlugins(){return[new Kn({props:{handleClick:(t,n)=>{let r=mx(t.state).find(e=>e.from<=n&&n<e.to);return r&&setTimeout(()=>e()?.open(r.id)),!1}}})]}}),LN=0;return e.mount=(e,{endpoint:t=`${location.origin}/`,apiKey:n=``,lang:r=`auto`,config:i,content:a=``,toolbar:o=!0,onSettingsChange:s,label:c=`Text to check`,delay:l=500,llmAlternatives:u=!1,llmTimeoutMs:d=hb,onStatus:f}={})=>{ob(),FN(),e.classList.add(`witty-editor`);let p=n,m=pN({config:i??{},llmAlternatives:u,orthography:!0}),h=()=>fb({apiKey:p}),g=bb({endpoint:t,headers:h,lang:r,config:()=>m.get().config}),_=document.createElement(`span`);_.id=`witty-editor-hint-${LN+=1}`,_.className=`witty-editor-sr-only`,_.textContent=ty.t(`shortcutHint`,{ns:eb.editor});let v=()=>({role:`textbox`,"aria-multiline":`true`,"aria-label":c,"aria-describedby":_.id,spellcheck:m.get().orthography?`false`:`true`}),y=document.createElement(`div`),b=document.createElement(`div`);e.append(...o?[y]:[],b,_);let x=fN({status:{state:`idle`,alerts:0}}),S=new Set,C={},w=new yf({element:b,extensions:[J_,wx.configure({check:g,delay:l,isIgnored:e=>S.has(e.data.text),onError:e=>{let t=e instanceof vb&&(e.status===401||e.status===403)?{state:`unauthorized`}:{state:`error`,message:e instanceof Error?e.message:String(e)};x.set({status:t}),f?.(t)}}),IN(()=>C.current)],content:a,editorProps:{attributes:v()},onTransaction:({editor:e,transaction:t})=>{C.current?.update();let n=t.getMeta(cx)?.type;if(n===`start`&&x.set({status:{state:`checking`}}),t.docChanged||n===`results`||n===`dismiss`){let t={state:`idle`,alerts:mx(e.state).length};(n!==void 0||x.get().status.state!==`checking`)&&x.set({status:t}),f?.(t)}}}),T=new dN(w.view,{endpoint:t,headers:h,llmAlternatives:()=>m.get().llmAlternatives,llmTimeoutMs:d,ignored:S,config:()=>m.get().config});C.current=T;let E=m.get(),ee=m.subscribe(()=>{let e=m.get();(e.config!==E.config||e.llmAlternatives!==E.llmAlternatives)&&T.resetRewrites(),e.config!==E.config&&xx(w.view),e.orthography!==E.orthography&&w.setOptions({editorProps:{attributes:v()}}),E=e}),te=o?MN(y,{editor:w,store:{...m,set:e=>{m.set(e),s?.(m.get())}},api:{endpoint:t,headers:h},status:x}):void 0;return{editor:w,setApiKey(e){p=e,T.resetRewrites(),xx(w.view)},setConfig(e){m.set({config:e})},getText:()=>w.getText(),destroy:()=>{ee(),te?.destroy(),T.destroy(),w.destroy(),y.remove(),b.remove(),_.remove()}}},e})({});
|