@witty-works/editor 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*! @witty-works/editor 2.0.0 (eb5d21fe) | MIT | https://witty.works */
1
+ /*! @witty-works/editor 2.0.1 (e7fdf99b) | MIT | https://witty.works | third-party licenses: witty-editor.js.LICENSE.txt */
2
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
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
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,`
@@ -128,7 +128,7 @@ img.ProseMirror-separator {
128
128
  `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let r=e.split(`
129
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
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=`&nbsp;`,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={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},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={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},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(`
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=`&nbsp;`,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.1`,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={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},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={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},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
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
133
 
134
134
  `,tx=`