PageSourceSearch

https://netcompany.com/_nuxt/BkabUvrQ.js

js netcompany.com collected 2026-10-02 04:23:26 UTC 1,604,320 bytes, 196 lines download raw bytes

vendor: 6,145 bytes, lines 1-2
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BUmIa8-8.js","./dXa1V3sB.js","./Krv1aknh.js","./S2c5z4i1.js","./Ml21UgGA.js","./index.T2txjSYy.css","./PostCard.BfiVBYx-.css","./BCHwVCTg.js","./CdabGNV5.js","./DNETjoAQ.js","./jD8QcAEh.js","./C8_HF5Qe.js","./CDr_RXzk.js","./index.C4wrnUMx.css","./c8NbPK12.js","./Cpfz1nDj.js","./C031ebJK.js","./ManualContent.B7uzv2BL.css","./Dtk7WA-g.js","./a3sj5zmn.js","./ZEeXGbGc.js","./CN7sIcvM.js"])))=>i.map(i=>d[i]);
2(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function cw(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Tt={},uc=[],ss=()=>{},wM=()=>!1,Ff=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),uw=t=>t.startsWith("onUpdate:"),Xt=Object.assign,dw=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},SI=Object.prototype.hasOwnProperty,wt=(t,e)=>SI.call(t,e),$e=Array.isArray,dc=t=>gu(t)==="[object Map]",mu=t=>gu(t)==="[object Set]",zx=t=>gu(t)==="[object Date]",MI=t=>gu(t)==="[object RegExp]",ze=t=>typeof t=="function",Lt=t=>typeof t=="string",No=t=>typeof t=="symbol",xt=t=>t!==null&&typeof t=="object",cg=t=>(xt(t)||ze(t))&&ze(t.then)&&ze(t.catch),kM=Object.prototype.toString,gu=t=>kM.call(t),TI=t=>gu(t).slice(8,-1),xM=t=>gu(t)==="[object Object]",ug=t=>Lt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ga=cw(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),dg=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},EI=/-\w/g,lo=dg(t=>t.replace(EI,e=>e.slice(1).toUpperCase())),AI=/\B([A-Z])/g,Nl=dg(t=>t.replace(AI,"-$1").toLowerCase()),fg=dg(t=>t.charAt(0).toUpperCase()+t.slice(1)),T0=dg(t=>t?`on${fg(t)}`:""),Ki=(t,e)=>!Object.is(t,e),fc=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},CM=(t,e,n,r=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:r,value:n})},hg=t=>{const e=parseFloat(t);return isNaN(e)?t:e},_M=t=>{const e=Lt(t)?Number(t):NaN;return isNaN(e)?t:e};let Vx;const pg=()=>Vx||(Vx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function xn(t){if($e(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],o=Lt(r)?LI(r):xn(r);if(o)for(const s in o)e[s]=o[s]}return e}else if(Lt(t)||xt(t))return t}const OI=/;(?![^(]*\))/g,II=/:([^]+)/,NI=/\/\*[^]*?\*\//g;function LI(t){const e={};return t.replace(NI,"").split(OI).forEach(n=>{if(n){const r=n.split(II);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function H(t){let e="";if(Lt(t))e=t;else if($e(t))for(let n=0;n<t.length;n++){const r=H(t[n]);r&&(e+=r+" ")}else if(xt(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const RI="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",$I=cw(RI);function SM(t){return!!t||t===""}function DI(t,e){if(t.length!==e.length)return!1;let n=!0;for(let r=0;n&&r<t.length;r++)n=hl(t[r],e[r]);return n}function hl(t,e){if(t===e)return!0;let n=zx(t),r=zx(e);if(n||r)return n&&r?t.getTime()===e.getTime():!1;if(n=No(t),r=No(e),n||r)return t===e;if(n=$e(t),r=$e(e),n||r)return n&&r?DI(t,e):!1;if(n=xt(t),r=xt(e),n||r){if(!n||!r)return!1;const o=Object.keys(t).length,s=Object.keys(e).length;if(o!==s)return!1;for(const i in t){const a=t.hasOwnProperty(i),l=e.hasOwnProperty(i);if(a&&!l||!a&&l||!hl(t[i],e[i]))return!1}}return String(t)===String(e)}function fw(t,e){return t.findIndex(n=>hl(n,e))}const MM=t=>!!(t&&t.__v_isRef===!0),ve=t=>Lt(t)?t:t==null?"":$e(t)||xt(t)&&(t.toString===kM||!ze(t.toString))?MM(t)?ve(t.value):JSON.stringify(t,TM,2):String(t),TM=(t,e)=>MM(e)?TM(t,e.value):dc(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,o],s)=>(n[E0(r,s)+" =>"]=o,n),{})}:mu(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>E0(n))}:No(e)?E0(e):xt(e)&&!$e(e)&&!xM(e)?String(e):e,E0=(t,e="")=>{var n;return No(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};let Ln;class EM{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Ln,!e&&Ln&&(this.index=(Ln.scopes||(Ln.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=Ln;try{return Ln=this,e()}finally{Ln=n}}}on(){++this._on===1&&(this.prevScope=Ln,Ln=this)}off(){this._on>0&&--this._on===0&&(Ln=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function hw(t){return new EM(t)}function mg(){return Ln}function AM(t,e=!1){Ln&&Ln.cleanups.push(t)}let Et;const A0=new WeakSet;class OM{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler
vendor: 14,406 bytes, line 2
2=void 0,Ln&&Ln.active&&Ln.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,A0.has(this)&&(A0.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||NM(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ux(this),LM(this);const e=Et,n=Oo;Et=this,Oo=!0;try{return this.fn()}finally{RM(this),Et=e,Oo=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)gw(e);this.deps=this.depsTail=void 0,Ux(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?A0.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){A1(this)&&this.run()}get dirty(){return A1(this)}}let IM=0,kd,xd;function NM(t,e=!1){if(t.flags|=8,e){t.next=xd,xd=t;return}t.next=kd,kd=t}function pw(){IM++}function mw(){if(--IM>0)return;if(xd){let e=xd;for(xd=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;kd;){let e=kd;for(kd=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){t||(t=r)}e=n}}if(t)throw t}function LM(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function RM(t){let e,n=t.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),gw(r),PI(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}t.deps=e,t.depsTail=n}function A1(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&($M(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function $M(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===rf)||(t.globalVersion=rf,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!A1(t))))return;t.flags|=2;const e=t.dep,n=Et,r=Oo;Et=t,Oo=!0;try{LM(t);const o=t.fn(t._value);(e.version===0||Ki(o,t._value))&&(t.flags|=128,t._value=o,e.version++)}catch(o){throw e.version++,o}finally{Et=n,Oo=r,RM(t),t.flags&=-3}}function gw(t,e=!1){const{dep:n,prevSub:r,nextSub:o}=t;if(r&&(r.nextSub=o,t.prevSub=void 0),o&&(o.prevSub=r,t.nextSub=void 0),n.subs===t&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)gw(s,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function PI(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let Oo=!0;const DM=[];function Qs(){DM.push(Oo),Oo=!1}function ei(){const t=DM.pop();Oo=t===void 0?!0:t}function Ux(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=Et;Et=void 0;try{e()}finally{Et=n}}}let rf=0;class HI{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class gg{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Et||!Oo||Et===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Et)n=this.activeLink=new HI(Et,this),Et.deps?(n.prevDep=Et.depsTail,Et.depsTail.nextDep=n,Et.depsTail=n):Et.deps=Et.depsTail=n,PM(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Et.depsTail,n.nextDep=void 0,Et.depsTail.nextDep=n,Et.depsTail=n,Et.deps===n&&(Et.deps=r)}return n}trigger(e){this.version++,rf++,this.notify(e)}notify(e){pw();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{mw()}}}function PM(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)PM(r)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Fp=new WeakMap,Ja=Symbol(""),O1=Symbol(""),of=Symbol("");function Hn(t,e,n){if(Oo&&Et){let r=Fp.get(t);r||Fp.set(t,r=new Map);let o=r.get(n);o||(r.set(n,o=new gg),o.map=r,o.key=n),o.track()}}function Hs(t,e,n,r,o,s){const i=Fp.get(t);if(!i){rf++;return}const a=l=>{l&&l.trigger()};if(pw(),e==="clear")i.forEach(a);else{const l=$e(t),c=l&&ug(n);if(l&&n==="length"){const u=Number(r);i.forEach((d,f)=>{(f==="length"||f===of||!No(f)&&f>=u)&&a(d)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),c&&a(i.get(of)),e){case"add":l?c&&a(i.get("length")):(a(i.get(Ja)),dc(t)&&a(i.get(O1)));break;case"delete":l||(a(i.get(Ja)),dc(t)&&a(i.get(O1)));break;case"set":dc(t)&&a(i.get(Ja));break}}mw()}function BI(t,e){const n=Fp.get(t);return n&&n.get(e)}function Dl(t){const e=ut(t);return e===t?e:(Hn(e,"iterate",of),Dr(t)?e:e.map(Lo))}function yg(t){return Hn(t=ut(t),"iterate",of),t}function Si(t,e){return hs(t)?Ac(is(t)?Lo(e):e):Lo(e)}const FI={__proto__:null,[Symbol.iterator](){return O0(this,Symbol.iterator,t=>Si(this,t))},concat(...t){return Dl(this).concat(...t.map(e=>$e(e)?Dl(e):e))},entries(){return O0(this,"entries",t=>(t[1]=Si(this,t[1]),t))},every(t,e){return Is(this,"every",t,e,void 0,arguments)},filter(t,e){return Is(this,"filter",t,e,n=>n.map(r=>Si(this,r)),arguments)},find(t,e){return Is(this,"find",t,e,n=>Si(this,n),arguments)},findIndex(t,e){return Is(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Is(this,"findLast",t,e,n=>Si(this,n),arguments)},findLastIndex(t,e){return Is(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Is(this,"forEach",t,e,void 0,arguments)},includes(...t){return I0(this,"includes",t)},indexOf(...t){return I0(this,"indexOf",t)},join(t){return Dl(this).join(t)},lastIndexOf(...t){return I0(this,"lastIndexOf",t)},map(t,e){return Is(this,"map",t,e,void 0,arguments)},pop(){return Du(this,"pop")},push(...t){return Du(this,"push",t)},reduce(t,...e){return qx(this,"reduce",t,e)},reduceRight(t,...e){return qx(this,"reduceRight",t,e)},shift(){return Du(this,"shift")},some(t,e){return Is(this,"some",t,e,void 0,arguments)},splice(...t){return Du(this,"splice",t)},toReversed(){return Dl(this).toReversed()},toSorted(t){return Dl(this).toSorted(t)},toSpliced(...t){return Dl(this).toSpliced(...t)},unshift(...t){return Du(this,"unshift",t)},values(){return O0(this,"values",t=>Si(this,t))}};function O0(t,e,n){const r=yg(t),o=r[e]();return r!==t&&!Dr(t)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const jI=Array.prototype;function Is(t,e,n,r,o,s){const i=yg(t),a=i!==t&&!Dr(t),l=i[e];if(l!==jI[e]){const d=l.apply(t,s);return a?Lo(d):d}let c=n;i!==t&&(a?c=function(d,f){return n.call(this,Si(t,d),f,t)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,t)}));const u=l.call(i,c,r);return a&&o?o(u):u}function qx(t,e,n,r){const o=yg(t);let s=n;return o!==t&&(Dr(t)?n.length>3&&(s=function(i,a,l){return n.call(this,i,a,l,t)}):s=function(i,a,l){return n.call(this,i,Si(t,a),l,t)}),o[e](s,...r)}function I0(t,e,n){const r=ut(t);Hn(r,"iterate",of);const o=r[e](...n);return(o===-1||o===!1)&&vg(n[0])?(n[0]=ut(n[0]),r[e](...n)):o}function Du(t,e,n=[]){Qs(),pw();const r=ut(t)[e].apply(t,n);return mw(),ei(),r}const zI=cw("__proto__,__v_isRef,__isVue"),HM=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(No));function VI(t){No(t)||(t=String(t));const e=ut(this);return Hn(e,"has",t),e.hasOwnProperty(t)}class BM{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,r){if(n==="__v_skip")return e.__v_skip;const o=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(o?s?QI:VM:s?zM:jM).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const i=$e(e);if(!o){let l;if(i&&(l=FI[n]))return l;if(n==="hasOwnProperty")return VI}const a=Reflect.get(e,n,kt(e)?e:r);if((No(n)?HM.has(n):zI(n))||(o||Hn(e,"get",n),s))return a;if(kt(a)){const l=i&&ug(n)?a:a.value;return o&&xt(l)?N1(l):l}return xt(a)?o?N1(a):or(a):a}}class FM extends BM{constructor(e=!1){super(!1,e)}set(e,n,r,o){let s=e[n];const i=$e(e)&&ug(n);if(!this._isShallow){const c=hs(s);if(!Dr(r)&&!hs(r)&&(s=ut(s),r=ut(r)),!i&&kt(s)&&!kt(r))return c||(s.value=r),!0}const a=i?Number(n)<e.length:wt(e,n),l=Reflect.set(e,n,r,kt(e)?e:o);return e===ut(o)&&(a?Ki(r,s)&&Hs(e,"set",n,r):Hs(e,"add",n,r)),l}deleteProperty(e,n){const r=wt(e,n);e[n];const o=Reflect.deleteProperty(e,n);return o&&r&&Hs(e,"delete",n,void 0),o}has(e,n){const r=Reflect.has(e,n);return(!No(n)||!HM.has(n))&&Hn(e,"has",n),r}ownKeys(e){return Hn(e,"iterate",$e(e)?"length":Ja),Reflect.ownKeys(e)}}class UI extends BM{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const qI=new FM,WI=new UI,KI=new FM(!0);const I1=t=>t,yh=t=>Reflect.getPrototypeOf(t);function GI(t,e,n){return function(...r){const o=this.__v_raw,s=ut(o),i=dc(s),a=t==="entries"||t===Symbol.iterator&&i,l=t==="keys"&&i,c=o[t](...r),u=n?I1:e?Ac:Lo;return!e&&Hn(s,"iterate",l?O1:Ja),Xt(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:a?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function vh(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function JI(t,e){const n={get(o){const s=this.__v_raw,i=ut(s),a=ut(o);t||(Ki(o,a)&&Hn(i,"get",o),Hn(i,"get",a));const{has:l}=yh(i),c=e?I1:t?Ac:Lo;if(l.call(i,o))return c(s.get(o));if(l.call(i,a))return c(s.get(a));s!==i&&s.get(o)},get size(){const o=this.__v_raw;return!t&&Hn(ut(o),"iterate",Ja),o.size},has(o){const s=this.__v_raw,i=ut(s),a=ut(o);return t||(Ki(o,a)&&Hn(i,"has",o),Hn(i,"has",a)),o===a?s.has(o):s.has(o)||s.has(a)},forEach(o,s){const i=this,a=i.__v_raw,l=ut(a),c=e?I1:t?Ac:Lo;return!t&&Hn(l,"iterate",Ja),a.forEach((u,d)=>o.call(s,c(u),c(d),i))}};return Xt(n,t?{add:vh("add"),set:vh("set"),delete:vh("delete"),clear:vh("clear")}:{add(o){!e&&!Dr(o)&&!hs(o)&&(o=ut(o));const s=ut(this);return yh(s).has.call(s,o)||(s.add(o),Hs(s,"add",o,o)),this},set(o,s){!e&&!Dr(s)&&!hs(s)&&(s=ut(s));const i=ut(this),{has:a,get:l}=yh(i);let c=a.call(i,o);c||(o=ut(o),c=a.call(i,o));const u=l.call(i,o);return i.set(o,s),c?Ki(s,u)&&Hs(i,"set",o,s):Hs(i,"add",o,s),this},delete(o){const s=ut(this),{has:i,get:a}=yh(s);let l=i.call(s,o);l||(o=ut(o),l=i.call(s,o)),a&&a.call(s,o);const c=s.delete(o);return l&&Hs(s,"delete",o,void 0),c},clear(){const o=ut(this),s=o.size!==0,i=o.clear();return s&&Hs(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=GI(o,t,e)}),n}function yw(t,e){const n=JI(t,e);return(r,o,s)=>o==="__v_isReactive"?!t:o==="__v_isReadonly"?t:o==="__v_raw"?r:Reflect.get(wt(n,o)&&o in r?n:r,o,s)}const YI={get:yw(!1,!1)},XI={get:yw(!1,!0)},ZI={get:yw(!0,!1)};const jM=new WeakMap,zM=new WeakMap,VM=new WeakMap,QI=new WeakMap;function eN(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function tN(t){return t.__v_skip||!Object.isExtensible(t)?0:eN(TI(t))}function or(t){return hs(t)?t:vw(t,!1,qI,YI,jM)}function es(t){return vw(t,!1,KI,XI,zM)}function N1(t){return vw(t,!0,WI,ZI,VM)}function vw(t,e,n,r,o){if(!xt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=tN(t);if(s===0)return t;const i=o.get(t);if(i)return i;const a=new Proxy(t,s===2?r:n);return o.set(t,a),a}function is(t){return hs(t)?is(t.__v_raw):!!(t&&t.__v_isReactive)}function hs(t){return!!(t&&t.__v_isReadonly)}function Dr(t){return!!(t&&t.__v_isShallow)}function vg(t){return t?!!t.__v_raw:!1}function ut(t){const e=t&&t.__v_raw;return e?ut(e):t}function jf(t){return!wt(t,"__v_skip")&&Object.isExtensible(t)&&CM(t,"__v_skip",!0),t}const Lo=t=>xt(t)?or(t):t,Ac=t=>xt(t)?N1(t):t;function kt(t){return t?t.__v_isRef===!0:!1}function pe(t){return UM(t,!1)}function Ro(t){return UM(t,!0)}function UM(t,e){return kt(t)?t:new nN(t,e)}class nN{constructor(e,n){this.dep=new gg,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:ut(e),this._value=n?e:Lo(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,r=this.__v_isShallow||Dr(e)||hs(e);e=r?e:ut(e),Ki(e,n)&&(this._rawValue=e,this._value=r?e:Lo(e),this.dep.trigger())}}function b(t){return kt(t)?t.value:t}function qM(t){return ze(t)?t():b(t)}const rN={get:(t,e,n)=>e==="__v_raw"?t:b(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const o=t[e];return kt(o)&&!kt(n)?(o.value=n,!0):Reflect.set(t,e,n,r)}};function WM(t){return is(t)?t:new Proxy(t,rN)}class oN{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new gg,{get:r,set:o}=e(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=o}get value(){return this._value=this._get()}set value(e){this._set(e)}}function KM(t){return new oN(t)}function sN(t){const e=$e(t)?new Array(t.length):{};for(const n in t)e[n]=JM(t,n);return e}class iN{constructor(e,n,r){this._object=e,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._raw=ut(e);let o=!0,s=e;if(!$e(e)||!ug(String(n)))do o=!vg(s)||Dr(s);while(o&&(s=s.__v_raw));this._shallow=o}get value(){let e=this._object[this._key];return this._shallow&&(e=b(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&kt(this._raw[this._key])){const n=this._object[this._key];if(kt(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return BI(this._raw,this._key)}}class aN{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function GM(t,e,n){return kt(t)?t:ze(t)?new aN(t):xt(t)&&arguments.length>1?JM(t,e,n):pe(t)}function JM(t,e,n){return new iN(t,e,n)}class lN{constructor(e,n,r){this.fn=e,this.setter=n,this._value=void 0,this.dep=new gg(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=rf-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Et!==this)return NM(this,!0),!0}get value(){const e=this.dep.track();return $M(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function cN(t,e,n=!1){let r,o;return ze(t)?r=t:(r=t.get,o=t.set),new lN(r,o,n)}const bh={},jp=new WeakMap;let Aa;function uN(t,e=!1,n=Aa){if(n){let r=jp.get(n);r||jp.set(n,r=[]),r.push(t)}}function dN(t,e,n=Tt){const{immediate:r,deep:o,once:s,scheduler:i,augmentJob:a,call:l}=n,c=v=>o?v:Dr(v)||o===!1||o===0?Bs(v,1):Bs(v);let u,d,f,h,p=!1,g=!1;if(kt(t)?(d=()=>t.value,p=Dr(t)):is(t)?(d=()=>c(t),p=!0):$e(t)?(g=!0,p=t.some(v=>is(v)||Dr(v)),d=()=>t.map(v=>{if(kt(v))return v.value;if(is(v))return c(v);if(ze(v))return l?l(v,2):v()})):ze(t)?e?d=l?()=>l(t,2):t:d=()=>
vendor: 35,157 bytes, lines 2-4
2{if(f){Qs();try{f()}finally{ei()}}const v=Aa;Aa=u;try{return l?l(t,3,[h]):t(h)}finally{Aa=v}}:d=ss,e&&o){const v=d,S=o===!0?1/0:o;d=()=>Bs(v(),S)}const y=mg(),w=()=>{u.stop(),y&&y.active&&dw(y.effects,u)};if(s&&e){const v=e;e=(...S)=>{v(...S),w()}}let x=g?new Array(t.length).fill(bh):bh;const C=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(e){const S=u.run();if(o||p||(g?S.some((E,M)=>Ki(E,x[M])):Ki(S,x))){f&&f();const E=Aa;Aa=u;try{const M=[S,x===bh?void 0:g&&x[0]===bh?[]:x,h];x=S,l?l(e,3,M):e(...M)}finally{Aa=E}}}else u.run()};return a&&a(C),u=new OM(d),u.scheduler=i?()=>i(C,!1):C,h=v=>uN(v,!1,u),f=u.onStop=()=>{const v=jp.get(u);if(v){if(l)l(v,4);else for(const S of v)S();jp.delete(u)}},e?r?C(!0):x=u.run():i?i(C.bind(null,!0),!0):u.run(),w.pause=u.pause.bind(u),w.resume=u.resume.bind(u),w.stop=w,w}function Bs(t,e=1/0,n){if(e<=0||!xt(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,kt(t))Bs(t.value,e,n);else if($e(t))for(let r=0;r<t.length;r++)Bs(t[r],e,n);else if(mu(t)||dc(t))t.forEach(r=>{Bs(r,e,n)});else if(xM(t)){for(const r in t)Bs(t[r],e,n);for(const r of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,r)&&Bs(t[r],e,n)}return t}function zf(t,e,n,r){try{return r?t(...r):t()}catch(o){yu(o,e,n)}}function $o(t,e,n,r){if(ze(t)){const o=zf(t,e,n,r);return o&&cg(o)&&o.catch(s=>{yu(s,e,n)}),o}if($e(t)){const o=[];for(let s=0;s<t.length;s++)o.push($o(t[s],e,n,r));return o}}function yu(t,e,n,r=!0){const o=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:i}=e&&e.appContext.config||Tt;if(e){let a=e.parent;const l=e.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](t,l,c)===!1)return}a=a.parent}if(s){Qs(),zf(s,null,10,[t,l,c]),ei();return}}fN(t,n,o,r,i)}function fN(t,e,n,r=!0,o=!1){if(o)throw t;console.error(t)}const tr=[];let Wo=-1;const hc=[];let Mi=null,ql=0;const YM=Promise.resolve();let zp=null;function mn(t){const e=zp||YM;return t?e.then(this?t.bind(this):t):e}function hN(t){let e=Wo+1,n=tr.length;for(;e<n;){const r=e+n>>>1,o=tr[r],s=sf(o);s<t||s===t&&o.flags&2?e=r+1:n=r}return e}function bw(t){if(!(t.flags&1)){const e=sf(t),n=tr[tr.length-1];!n||!(t.flags&2)&&e>=sf(n)?tr.push(t):tr.splice(hN(e),0,t),t.flags|=1,XM()}}function XM(){zp||(zp=YM.then(ZM))}function L1(t){$e(t)?hc.push(...t):Mi&&t.id===-1?Mi.splice(ql+1,0,t):t.flags&1||(hc.push(t),t.flags|=1),XM()}function Wx(t,e,n=Wo+1){for(;n<tr.length;n++){const r=tr[n];if(r&&r.flags&2){if(t&&r.id!==t.uid)continue;tr.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Vp(t){if(hc.length){const e=[...new Set(hc)].sort((n,r)=>sf(n)-sf(r));if(hc.length=0,Mi){Mi.push(...e);return}for(Mi=e,ql=0;ql<Mi.length;ql++){const n=Mi[ql];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Mi=null,ql=0}}const sf=t=>t.id==null?t.flags&2?-1:1/0:t.id;function ZM(t){try{for(Wo=0;Wo<tr.length;Wo++){const e=tr[Wo];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),zf(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Wo<tr.length;Wo++){const e=tr[Wo];e&&(e.flags&=-2)}Wo=-1,tr.length=0,Vp(),zp=null,(tr.length||hc.length)&&ZM()}}let An=null,QM=null;function Up(t){const e=An;return An=t,QM=t&&t.type.__scopeId||null,e}function qe(t,e=An,n){if(!e||t._n)return t;const r=(...o)=>{r._d&&Jp(-1);const s=Up(e);let i;try{i=t(...o)}finally{Up(s),r._d&&Jp(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Ie(t,e){if(An===null)return t;const n=xg(An),r=t.dirs||(t.dirs=[]);for(let o=0;o<e.length;o++){let[s,i,a,l=Tt]=e[o];s&&(ze(s)&&(s={mounted:s,updated:s}),s.deep&&Bs(i),r.push({dir:s,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return t}function Go(t,e,n,r){const o=t.dirs,s=e&&e.dirs;for(let i=0;i<o.length;i++){const a=o[i];s&&(a.oldValue=s[i].value);let l=a.dir[r];l&&(Qs(),$o(l,n,8,[t.el,a,t,e]),ei())}}function Ks(t,e){if(En){let n=En.provides;const r=En.parent&&En.parent.provides;r===n&&(n=En.provides=Object.create(r)),n[t]=e}}function un(t,e,n=!1){const r=go();if(r||Ya){let o=Ya?Ya._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&t in o)return o[t];if(arguments.length>1)return n&&ze(e)?e.call(r&&r.proxy):e}}function Vf(){return!!(go()||Ya)}const pN=Symbol.for("v-scx"),mN=()=>un(pN);function ww(t,e){return kw(t,null,e)}function Ye(t,e,n){return kw(t,e,n)}function kw(t,e,n=Tt){const{immediate:r,deep:o,flush:s,once:i}=n,a=Xt({},n),l=e&&r||!e&&s!=="post";let c;if(Ic){if(s==="sync"){const h=mN();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=ss,h.resume=ss,h.pause=ss,h}}const u=En;a.call=(h,p,g)=>$o(h,u,p,g);let d=!1;s==="post"?a.scheduler=h=>{Jt(h,u&&u.suspense)}:s!=="sync"&&(d=!0,a.scheduler=(h,p)=>{p?h():bw(h)}),a.augmentJob=h=>{e&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=dN(t,e,a);return Ic&&(c?c.push(f):l&&f()),f}function gN(t,e,n){const r=this.proxy,o=Lt(t)?t.includes(".")?eT(r,t):()=>r[t]:t.bind(r,r);let s;ze(e)?s=e:(s=e.handler,n=e);const i=gl(this),a=kw(o,s.bind(r),n);return i(),a}function eT(t,e){const n=e.split(".");return()=>{let r=t;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const tT=Symbol("_vte"),nT=t=>t.__isTeleport,Cd=t=>t&&(t.disabled||t.disabled===""),Kx=t=>t&&(t.defer||t.defer===""),Gx=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Jx=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,R1=(t,e)=>{const n=t&&t.to;return Lt(n)?e?e(n):null:n},rT={name:"Teleport",__isTeleport:!0,process(t,e,n,r,o,s,i,a,l,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:g,createComment:y}}=c,w=Cd(e.props);let{shapeFlag:x,children:C,dynamicChildren:v}=e;if(t==null){const S=e.el=g(""),E=e.anchor=g("");h(S,n,r),h(E,n,r);const M=(A,N)=>{x&16&&u(C,A,N,o,s,i,a,l)},T=()=>{const A=e.target=R1(e.props,p),N=oT(A,e,g,h);A&&(i!=="svg"&&Gx(A)?i="svg":i!=="mathml"&&Jx(A)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(A),w||(M(A,N),sp(e,!1)))};w&&(M(n,E),sp(e,!0)),Kx(e.props)?(e.el.__isMounted=!1,Jt(()=>{T(),delete e.el.__isMounted},s)):T()}else{if(Kx(e.props)&&t.el.__isMounted===!1){Jt(()=>{rT.process(t,e,n,r,o,s,i,a,l,c)},s);return}e.el=t.el,e.targetStart=t.targetStart;const S=e.anchor=t.anchor,E=e.target=t.target,M=e.targetAnchor=t.targetAnchor,T=Cd(t.props),A=T?n:E,N=T?S:M;if(i==="svg"||Gx(E)?i="svg":(i==="mathml"||Jx(E))&&(i="mathml"),v?(f(t.dynamicChildren,v,A,o,s,i,a),Aw(t,e,!0)):l||d(t,e,A,N,o,s,i,a,!1),w)T?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):wh(e,n,S,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const D=e.target=R1(e.props,p);D&&wh(e,D,null,c,0)}else T&&wh(e,E,M,c,1);sp(e,w)}},remove(t,e,n,{um:r,o:{remove:o}},s){const{shapeFlag:i,children:a,anchor:l,targetStart:c,targetAnchor:u,target:d,props:f}=t;if(d&&(o(c),o(u)),s&&o(l),i&16){const h=s||!Cd(f);for(let p=0;p<a.length;p++){const g=a[p];r(g,e,n,h,!!g.dynamicChildren)}}},move:wh,hydrate:yN};function wh(t,e,n,{o:{insert:r},m:o},s=2){s===0&&r(t.targetAnchor,e,n);const{el:i,anchor:a,shapeFlag:l,children:c,props:u}=t,d=s===2;if(d&&r(i,e,n),(!d||Cd(u))&&l&16)for(let f=0;f<c.length;f++)o(c[f],e,n,2);d&&r(a,e,n)}function yN(t,e,n,r,o,s,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:c,createText:u}},d){function f(g,y,w,x){y.anchor=d(i(g),y,a(g),n,r,o,s),y.targetStart=w,y.targetAnchor=x}const h=e.target=R1(e.props,l),p=Cd(e.props);if(h){const g=h._lpa||h.firstChild;if(e.shapeFlag&16)if(p)f(t,e,g,g&&i(g));else{e.anchor=i(t);let y=g;for(;y;){if(y&&y.nodeType===8){if(y.data==="teleport start anchor")e.targetStart=y;else if(y.data==="teleport anchor"){e.targetAnchor=y,h._lpa=e.targetAnchor&&i(e.targetAnchor);break}}y=i(y)}e.targetAnchor||oT(h,e,u,c),d(g&&i(g),e,h,n,r,o,s)}sp(e,p)}else p&&e.shapeFlag&16&&f(t,e,t,i(t));return e.anchor&&i(e.anchor)}const xw=rT;function sp(t,e){const n=t.ctx;if(n&&n.ut){let r,o;for(e?(r=t.el,o=t.anchor):(r=t.targetStart,o=t.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function oT(t,e,n,r){const o=e.targetStart=n(""),s=e.targetAnchor=n("");return o[tT]=s,t&&(r(o,t),r(s,t)),s}const Ds=Symbol("_leaveCb"),kh=Symbol("_enterCb");function sT(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Zt(()=>{t.isMounted=!0}),Fo(()=>{t.isUnmounting=!0}),t}const qr=[Function,Array],iT={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:qr,onEnter:qr,onAfterEnter:qr,onEnterCancelled:qr,onBeforeLeave:qr,onLeave:qr,onAfterLeave:qr,onLeaveCancelled:qr,onBeforeAppear:qr,onAppear:qr,onAfterAppear:qr,onAppearCancelled:qr},aT=t=>{const e=t.subTree;return e.component?aT(e.component):e},vN={name:"BaseTransition",props:iT,setup(t,{slots:e}){const n=go(),r=sT();return()=>{const o=e.default&&Cw(e.default(),!0);if(!o||!o.length)return;const s=lT(o),i=ut(t),{mode:a}=i;if(r.isLeaving)return N0(s);const l=Yx(s);if(!l)return N0(s);let c=af(l,i,r,n,d=>c=d);l.type!==Yt&&sa(l,c);let u=n.subTree&&Yx(n.subTree);if(u&&u.type!==Yt&&!So(u,l)&&aT(n).type!==Yt){let d=af(u,i,r,n);if(sa(u,d),a==="out-in"&&l.type!==Yt)return r.isLeaving=!0,d.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},N0(s);a==="in-out"&&l.type!==Yt?d.delayLeave=(f,h,p)=>{const g=cT(r,u);g[String(u.key)]=u,f[Ds]=()=>{h(),f[Ds]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return s}}};function lT(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==Yt){e=n;break}}return e}const bN=vN;function cT(t,e){const{leavingVNodes:n}=t;let r=n.get(e.type);return r||(r=Object.create(null),n.set(e.type,r)),r}function af(t,e,n,r,o){const{appear:s,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:g,onBeforeAppear:y,onAppear:w,onAfterAppear:x,onAppearCancelled:C}=e,v=String(t.key),S=cT(n,t),E=(A,N)=>{A&&$o(A,r,9,N)},M=(A,N)=>{const D=N[1];E(A,N),$e(A)?A.every($=>$.length<=1)&&D():A.length<=1&&D()},T={mode:i,persisted:a,beforeEnter(A){let N=l;if(!n.isMounted)if(s)N=y||l;else return;A[Ds]&&A[Ds](!0);const D=S[v];D&&So(t,D)&&D.el[Ds]&&D.el[Ds](),E(N,[A])},enter(A){let N=c,D=u,$=d;if(!n.isMounted)if(s)N=w||c,D=x||u,$=C||d;else return;let W=!1;const me=A[kh]=V=>{W||(W=!0,V?E($,[A]):E(D,[A]),T.delayedLeave&&T.delayedLeave(),A[kh]=void 0)};N?M(N,[A,me]):me()},leave(A,N){const D=String(t.key);if(A[kh]&&A[kh](!0),n.isUnmounting)return N();E(f,[A]);let $=!1;const W=A[Ds]=me=>{$||($=!0,N(),me?E(g,[A]):E(p,[A]),A[Ds]=void 0,S[D]===t&&delete S[D])};S[D]=t,h?M(h,[A,W]):W()},clone(A){const N=af(A,e,n,r,o);return o&&o(N),N}};return T}function N0(t){if(Uf(t))return t=Pr(t),t.children=null,t}function Yx(t){if(!Uf(t))return nT(t.type)&&t.children?lT(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&ze(n.default))return n.default()}}function sa(t,e){t.shapeFlag&6&&t.component?(t.transition=e,sa(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function Cw(t,e=!1,n){let r=[],o=0;for(let s=0;s<t.length;s++){let i=t[s];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:s);i.type===ce?(i.patchFlag&128&&o++,r=r.concat(Cw(i.children,e,a))):(e||i.type!==Yt)&&r.push(a!=null?Pr(i,{key:a}):i)}if(o>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function Ne(t,e){return ze(t)?Xt({name:t.name},e,{setup:t}):t}function _w(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}const qp=new WeakMap;function pc(t,e,n,r,o=!1){if($e(t)){t.forEach((p,g)=>pc(p,e&&($e(e)?e[g]:e),n,r,o));return}if(Gs(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&pc(t,e,n,r.component.subTree);return}const s=r.shapeFlag&4?xg(r.component):r.el,i=o?null:s,{i:a,r:l}=t,c=e&&e.r,u=a.refs===Tt?a.refs={}:a.refs,d=a.setupState,f=ut(d),h=d===Tt?wM:p=>wt(f,p);if(c!=null&&c!==l){if(Xx(e),Lt(c))u[c]=null,h(c)&&(d[c]=null);else if(kt(c)){c.value=null;const p=e;p.k&&(u[p.k]=null)}}if(ze(l))zf(l,a,12,[i,u]);else{const p=Lt(l),g=kt(l);if(p||g){const y=()=>{if(t.f){const w=p?h(l)?d[l]:u[l]:l.value;if(o)$e(w)&&dw(w,s);else if($e(w))w.includes(s)||w.push(s);else if(p)u[l]=[s],h(l)&&(d[l]=u[l]);else{const x=[s];l.value=x,t.k&&(u[t.k]=x)}}else p?(u[l]=i,h(l)&&(d[l]=i)):g&&(l.value=i,t.k&&(u[t.k]=i))};if(i){const w=()=>{y(),qp.delete(t)};w.id=-1,qp.set(t,w),Jt(w,n)}else Xx(t),y()}}}function Xx(t){const e=qp.get(t);e&&(e.flags|=8,qp.delete(t))}let Zx=!1;const Pl=()=>{Zx||(console.error("Hydration completed but contains mismatches."),Zx=!0)},wN=t=>t.namespaceURI.includes("svg")&&t.tagName!=="foreignObject",kN=t=>t.namespaceURI.includes("MathML"),xh=t=>{if(t.nodeType===1){if(wN(t))return"svg";if(kN(t))return"mathml"}},ic=t=>t.nodeType===8;function xN(t){const{mt:e,p:n,o:{patchProp:r,createText:o,nextSibling:s,parentNode:i,remove:a,insert:l,createComment:c}}=t,u=(C,v)=>{if(!v.hasChildNodes()){n(null,C,v),Vp(),v._vnode=C;return}d(v.firstChild,C,null,null,null),Vp(),v._vnode=C},d=(C,v,S,E,M,T=!1)=>{T=T||!!v.dynamicChildren;const A=ic(C)&&C.data==="[",N=()=>g(C,v,S,E,M,A),{type:D,ref:$,shapeFlag:W,patchFlag:me}=v;let V=C.nodeType;v.el=C,me===-2&&(T=!1,v.dynamicChildren=null);let B=null;switch(D){case Xa:V!==3?v.children===""?(l(v.el=o(""),i(C),C),B=C):B=N():(C.data!==v.children&&(Pl(),C.data=v.children),B=s(C));break;case Yt:x(C)?(B=s(C),w(v.el=C.content.firstChild,C,S)):V!==8||A?B=N():B=s(C);break;case Sd:if(A&&(C=s(C),V=C.nodeType),V===1||V===3){B=C;const Y=!v.children.length;for(let j=0;j<v.staticCount;j++)Y&&(v.children+=B.nodeType===1?B.outerHTML:B.data),j===v.staticCount-1&&(v.anchor=B),B=s(B);return A?s(B):B}else N();break;case ce:A?B=p(C,v,S,E,M,T):B=N();break;default:if(W&1)(V!==1||v.type.toLowerCase()!==C.tagName.toLowerCase())&&!x(C)?B=N():B=f(C,v,S,E,M,T);else if(W&6){v.slotScopeIds=M;const Y=i(C);if(A?B=y(C):ic(C)&&C.data==="teleport start"?B=y(C,C.data,"teleport end"):B=s(C),e(v,Y,null,S,E,xh(Y),T),Gs(v)&&!v.type.__asyncResolved){let j;A?(j=Z(ce),j.anchor=B?B.previousSibling:Y.lastChild):j=C.nodeType===3?Le(""):Z("div"),j.el=C,v.component.subTree=j}}else W&64?V!==8?B=N():B=v.type.hydrate(C,v,S,E,M,T,t,h):W&128&&(B=v.type.hydrate(C,v,S,E,xh(i(C)),M,T,t,d))}return $!=null&&pc($,null,E,v),B},f=(C,v,S,E,M,T)=>{T=T||!!v.dynamicChildren;const{type:A,props:N,patchFlag:D,shapeFlag:$,dirs:W,transition:me}=v,V=A==="input"||A==="option";if(V||D!==-1){W&&Go(v,null,S,"created");let B=!1;if(x(C)){B=IT(null,me)&&S&&S.vnode.props&&S.vnode.props.appear;const j=C.content.firstChild;if(B){const P=j.getAttribute("class");P&&(j.$cls=P),me.beforeEnter(j)}w(j,C,S),v.el=C=j}if($&16&&!(N&&(N.innerHTML||N.textContent))){let j=h(C.firstChild,v,C,S,E,M,T);for(;j;){Ch(C,1)||Pl();const P=j;j=j.nextSibling,a(P)}}else if($&8){let j=v.children;j[0]===`
3`&&(C.tagName==="PRE"||C.tagName==="TEXTAREA")&&(j=j.slice(1));const{textContent:P}=C;P!==j&&P!==j.replace(/\r\n|\r/g,`
4`)&&(Ch(C,0)||Pl(),C.textContent=v.children)}if(N){if(V||!T||D&48){const j=C.tagName.includes("-");for(const P in N)(V&&(P.endsWith("value")||P==="indeterminate")||Ff(P)&&!Ga(P)||P[0]==="."||j&&!Ga(P))&&r(C,P,null,N[P],void 0,S)}else if(N.onClick)r(C,"onClick",null,N.onClick,void 0,S);else if(D&4&&is(N.style))for(const j in N.style)N.style[j]}let Y;(Y=N&&N.onVnodeBeforeMount)&&hr(Y,S,v),W&&Go(v,null,S,"beforeMount"),((Y=N&&N.onVnodeMounted)||W||B)&&$T(()=>{Y&&hr(Y,S,v),B&&me.enter(C),W&&Go(v,null,S,"mounted")},E)}return C.nextSibling},h=(C,v,S,E,M,T,A)=>{A=A||!!v.dynamicChildren;const N=v.children,D=N.length;for(let $=0;$<D;$++){const W=A?N[$]:N[$]=Lr(N[$]),me=W.type===Xa;C?(me&&!A&&$+1<D&&Lr(N[$+1]).type===Xa&&(l(o(C.data.slice(W.children.length)),S,s(C)),C.data=W.children),C=d(C,W,E,M,T,A)):me&&!W.children?l(W.el=o(""),S):(Ch(S,1)||Pl(),n(null,W,S,null,E,M,xh(S),T))}return C},p=(C,v,S,E,M,T)=>{const{slotScopeIds:A}=v;A&&(M=M?M.concat(A):A);const N=i(C),D=h(s(C),v,N,S,E,M,T);return D&&ic(D)&&D.data==="]"?s(v.anchor=D):(Pl(),l(v.anchor=c("]"),N,D),D)},g=(C,v,S,E,M,T)=>{if(Ch(C.parentElement,1)||Pl(),v.el=null,T){const D=y(C);for(;;){const $=s(C);if($&&$!==D)a($);else break}}const A=s(C),N=i(C);return a(C),n(null,v,N,A,S,E,xh(N),M),S&&(S.vnode.el=v.el,kg(S,v.el)),A},y=(C,v="[",S="]")=>{let E=0;for(;C;)if(C=s(C),C&&ic(C)&&(C.data===v&&E++,C.data===S)){if(E===0)return s(C);E--}return C},w=(C,v,S)=>{const E=v.parentNode;E&&E.replaceChild(C,v);let M=S;for(;M;)M.vnode.el===v&&(M.vnode.el=M.subTree.el=C),M=M.parent},x=C=>C.nodeType===1&&C.tagName==="TEMPLATE";return[u,d]}const Qx="data-allow-mismatch",CN={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Ch(t,e){if(e===0||e===1)for(;t&&!t.hasAttribute(Qx);)t=t.parentElement;const n=t&&t.getAttribute(Qx);if(n==null)return!1;if(n==="")return!0;{const r=n.split(",");return e===0&&r.includes("children")?!0:r.includes(CN[e])}}pg().requestIdleCallback;pg().cancelIdleCallback;function _N(t,e){if(ic(t)&&t.data==="["){let n=1,r=t.nextSibling;for(;r;){if(r.nodeType===1){if(e(r)===!1)break}else if(ic(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else e(t)}const Gs=t=>!!t.type.__asyncLoader;function SN(t){ze(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:s,timeout:i,suspensible:a=!0,onError:l}=t;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=e().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),l)return new Promise((y,w)=>{l(g,()=>y(f()),()=>w(g),d+1)});throw g}).then(g=>p!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return Ne({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,g,y){let w=!1;(g.bu||(g.bu=[])).push(()=>w=!0);const x=()=>{w||y()},C=s?()=>{const v=s(x,S=>_N(p,S));v&&(g.bum||(g.bum=[])).push(v)}:x;u?C():h().then(()=>!g.isUnmounted&&C())},get __asyncResolved(){return u},setup(){const p=En;if(_w(p),u)return()=>_h(u,p);const g=C=>{c=null,yu(C,p,13,!r)};if(a&&p.suspense||Ic)return h().then(C=>()=>_h(C,p)).catch(C=>(g(C),()=>r?Z(r,{error:C}):null));const y=pe(!1),w=pe(),x=pe(!!o);return o&&setTimeout(()=>{x.value=!1},o),i!=null&&setTimeout(()=>{if(!y.value&&!w.value){const C=new Error(`Async component timed out after ${i}ms.`);g(C),w.value=C}},i),h().then(()=>{y.value=!0,p.parent&&Uf(p.parent.vnode)&&p.parent.update()}).catch(C=>{g(C),w.value=C}),()=>{if(y.value&&u)return _h(u,p);if(w.value&&r)return Z(r,{error:w.value});if(n&&!x.value)return _h(n,p)}}})}function _h(t,e){const{ref:n,props:r,children:o,ce:s}=e.vnode,i=Z(t,r,o);return i.ref=n,i.ce=s,delete e.vnode.ce,i}const Uf=t=>t.type.__isKeepAlive,MN={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:e}){const n=go(),r=n.ctx;if(!r.renderer)return()=>{const x=e.default&&e.default();return x&&x.length===1?x[0]:x};const o=new Map,s=new Set;let i=null;const a=n.suspense,{renderer:{p:l,m:c,um:u,o:{createElement:d}}}=r,f=d("div");r.activate=(x,C,v,S,E)=>{const M=x.component;c(x,C,v,0,a),l(M.vnode,x,C,v,M,a,S,x.slotScopeIds,E),Jt(()=>{M.isDeactivated=!1,M.a&&fc(M.a);const T=x.props&&x.props.onVnodeMounted;T&&hr(T,M.parent,x)},a)},r.deactivate=x=>{const C=x.component;Kp(C.m),Kp(C.a),c(x,f,null,1,a),Jt(()=>{C.da&&fc(C.da);const v=x.props&&x.props.onVnodeUnmounted;v&&hr(v,C.parent,x),C.isDeactivated=!0},a)};function h(x){L0(x),u(x,n,a,!0)}function p(x){o.forEach((C,v)=>{const S=V1(Gs(C)?C.type.__asyncResolved||{}:C.type);S&&!x(S)&&g(v)})}function g(x){const C=o.get(x);C&&(!i||!So(C,i))?h(C):i&&L0(i),o.delete(x),s.delete(x)}Ye(()=>[t.include,t.exclude],([x,C])=>{x&&p(v=>Zu(x,v)),C&&p(v=>!Zu(C,v))},{flush:"post",deep:!0});let y=null;const w=()=>{y!=null&&(Gp(n.subTree.type)?Jt(()=>{o.set(y,Sh(n.subTree))},n.subTree.suspense):o.set(y,Sh(n.subTree)))};return Zt(w),Mw(w),Fo(()=>{o.forEach(x=>{const{subTree:C,suspense:v}=n,S=Sh(C);if(x.type===S.type&&x.key===S.key){L0(S);const E=S.component.da;E&&Jt(E,v);return}h(x)})}),()=>{if(y=null,!e.default)return i=null;const x=e.default(),C=x[0];if(x.length>1)return i=null,x;if(!ml(C)||!(C.shapeFlag&4)&&!(C.shapeFlag&128))return i=null,C;let v=Sh(C);if(v.type===Yt)return i=null,v;const S=v.type,E=V1(Gs(v)?v.type.__asyncResolved||{}:S),{include:M,exclude:T,max:A}=t;if(M&&(!E||!Zu(M,E))||T&&E&&Zu(T,E))return v.shapeFlag&=-257,i=v,C;const N=v.key==null?S:v.key,D=o.get(N);return v.el&&(v=Pr(v),C.shapeFlag&128&&(C.ssContent=v)),y=N,D?(v.el=D.el,v.component=D.component,v.transition&&sa(v,v.transition),v.shapeFlag|=512,s.delete(N),s.add(N)):(s.add(N),A&&s.size>parseInt(A,10)&&g(s.values().next().value)),v.shapeFlag|=256,i=v,Gp(C.type)?C:v}}},TN=MN;function Zu(t,e){return $e(t)?t.some(n=>Zu(n,e)):Lt(t)?t.split(",").includes(e):MI(t)?(t.lastIndex=0,t.test(e)):!1}function uT(t,e){fT(t,"a",e)}function dT(t,e){fT(t,"da",e)}function fT(t,e,n=En){const r=t.__wdc||(t.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return t()});if(bg(e,r,n),n){let o=n.parent;for(;o&&o.parent;)Uf(o.parent.vnode)&&EN(r,e,n,o),o=o.parent}}function EN(t,e,n,r){const o=bg(e,t,r,!0);pl(()=>{dw(r[e],o)},n)}function L0(t){t.shapeFlag&=-257,t.shapeFlag&=-513}function Sh(t){return t.shapeFlag&128?t.ssContent:t}function bg(t,e,n=En,r=!1){if(n){const o=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...i)=>{Qs();const a=gl(n),l=$o(e,n,t,i);return a(),ei(),l});return r?o.unshift(s):o.push(s),s}}const ai=t=>(e,n=En)=>{(!Ic||t==="sp")&&bg(t,(...r)=>e(...r),n)},Sw=ai("bm"),Zt=ai("m"),AN=ai("bu"),Mw=ai("u"),Fo=ai("bum"),pl=ai("um"),ON=ai("sp"),IN=ai("rtg"),NN=ai("rtc");function hT(t,e=En){bg("ec",t,e)}const pT="components";function lf(t,e){return gT(pT,t,!0,e)||t}const mT=Symbol.for("v-ndc");function LN(t){return Lt(t)?gT(pT,t,!1)||t:t||mT}function gT(t,e,n=!0,r=!1){const o=An||En;if(o){const s=o.type;{const a=V1(s,!1);if(a&&(a===e||a===lo(e)||a===fg(lo(e))))return s}const i=e5(o[t]||s[t],e)||e5(o.appContext[t],e);return!i&&r?s:i}}function e5(t,e){return t&&(t[e]||t[lo(e)]||t[fg(lo(e))])}function Oe(t,e,n,r){let o;const s=n,i=$e(t);if(i||Lt(t)){const a=i&&is(t);let l=!1,c=!1;a&&(l=!Dr(t),c=hs(t),t=yg(t)),o=new Array(t.length);for(let u=0,d=t.length;u<d;u++)o[u]=e(l?c?Ac(Lo(t[u])):Lo(t[u]):t[u],u,void 0,s)}else if(typeof t=="number"){o=new Array(t);for(let a=0;a<t;a++)o[a]=e(a+1,a,void 0,s)}else if(xt(t))if(t[Symbol.iterator])o=Array.from(t,(a,l)=>e(a,l,void 0,s));else{const a=Object.keys(t);o=new Array(a.length);for(let l=0,c=a.length;l<c;l++){const u=a[l];o[l]=e(t[u],u,l,s)}}else o=[];return o}function Ot(t,e,n={},r,o){if(An.ce||An.parent&&Gs(An.parent)&&An.parent.ce){const c=Object.keys(n).length>0;return k(),xe(ce,null,[Z("slot",n,r&&r())],c?-2:64)}let s=t[e];s&&s._c&&(s._d=!1),k();const i=s&&yT(s(n)),a=n.key||i&&i.key,l=xe(ce,{key:(a&&!No(a)?a:`_${e}`)+(!i&&r?"_fb":"")},i||(r?r():[]),i&&t._===1?64:-2);return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function yT(t){return t.some(e=>ml(e)?!(e.type===Yt||e.type===ce&&!yT(e.children)):!0)?t:null}const $1=t=>t?FT(t)?xg(t):$1(t.parent):null,_d=Xt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>$1(t.parent),$root:t=>$1(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>bT(t),$forceUpdate:t=>t.f||(t.f=()=>{bw(t.update)}),$nextTick:t=>t.n||(t.n=mn.bind(t.proxy)),$watch:t=>gN.bind(t)}),R0=(t,e)=>t!==Tt&&!t.__isScriptSetup&&wt(t,e),RN={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:r,data:o,props:s,accessCache:i,type:a,appContext:l}=t;if(e[0]!=="$"){const f=i[e];if(f!==void 0)switch(f){case 1:return r[e];case 2:return o[e];case 4:return n[e];case 3:return s[e]}else{if(R0(r,e))return i[e]=1,r[e];if(o!==Tt&&wt(o,e))return i[e]=2,o[e];if(wt(s,e))return i[e]=3,s[e];if(n!==Tt&&wt(n,e))return i[e]=4,n[e];D1&&(i[e]=0)}}const c=_d[e];let u,d;if(c)return e==="$attrs"&&Hn(t.attrs,"get",""),c(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(n!==Tt&&wt(n,e))return i[e]=4,n[e];if(d=l.config.globalProperties,wt(d,e))return d[e]},set({_:t},e,n){const{data:r,setupState:o,ctx:s}=t;return R0(o,e)?(o[e]=n,!0):r!==Tt&&wt(r,e)?(r[e]=n,!0):wt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:o,props:s,type:i}},a){let l;return!!(n[a]||t!==Tt&&a[0]!=="$"&&wt(t,a)||R0(e,a)||wt(s,a)||wt(r,a)||wt(_d,a)||wt(o.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:wt(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function t5(t){return $e(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function n5(t){const e=go();let n=t();return j1(),cg(n)&&(n=n.catch(r=>{throw gl(e),r})),[n,()=>gl(e)]}let D1=!0;function $N(t){const e=bT(t),n=t.proxy,r=t.ctx;D1=!1,e.beforeCreate&&r5(e.beforeCreate,t,"bc");const{data:o,computed:s,methods:i,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:g,deactivated:y,beforeDestroy:w,beforeUnmount:x,destroyed:C,unmounted:v,render:S,renderTracked:E,renderTriggered:M,errorCaptured:T,serverPrefetch:A,expose:N,inheritAttrs:D,components:$,directives:W,filters:me}=e;if(c&&DN(c,r,null),i)for(const Y in i){const j=i[Y];ze(j)&&(r[Y]=j.bind(n))}if(o){const Y=o.call(n,n);xt(Y)&&(t.data=or(Y))}if(D1=!0,s)for(const Y in s){const j=s[Y],P=ze(j)?j.bind(n,n):ze(j.get)?j.get.bind(n,n):ss,Q=!ze(j)&&ze(j.set)?j.set.bind(n):ss,J=U({get:P,set:Q});Object.defineProperty(r,Y,{enumerable:!0,configurable:!0,get:()=>J.value,set:ke=>J.value=ke})}if(a)for(const Y in a)vT(a[Y],r,n,Y);if(l){const Y=ze(l)?l.call(n):l;Reflect.ownKeys(Y).forEach(j=>{Ks(j,Y[j])})}u&&r5(u,t,"c");function B(Y,j){$e(j)?j.forEach(P=>Y(P.bind(n))):j&&Y(j.bind(n))}if(B(Sw,d),B(Zt,f),B(AN,h),B(Mw,p),B(uT,g),B(dT,y),B(hT,T),B(NN,E),B(IN,M),B(Fo,x),B(pl,v),B(ON,A),$e(N))if(N.length){const Y=t.exposed||(t.exposed={});N.forEach(j=>{Object.defineProperty(Y,j,{get:()=>n[j],set:P=>n[j]=P,enumerable:!0})})}else t.exposed||(t.exposed={});S&&t.render===ss&&(t.render=S),D!=null&&(t.inheritAttrs=D),$&&(t.components=$),W&&(t.directives=W),A&&_w(t)}function DN(t,e,n=ss){$e(t)&&(t=P1(t));for(const r in t){const o=t[r];let s;xt(o)?"default"in o?s=un(o.from||r,o.default,!0):s=un(o.from||r):s=un(o),kt(s)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:i=>s.value=i}):e[r]=s}}function r5(t,e,n){$o($e(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,n)}function vT(t,e,n,r){let o=r.includes(".")?eT(n,r):()=>n[r];if(Lt(t)){const s=e[t];ze(s)&&Ye(o,s)}else if(ze(t))Ye(o,t.bind(n));else if(xt(t))if($e(t))t.forEach(s=>vT(s,e,n,r));else{const s=ze(t.handler)?t.handler.bind(n):e[t.handler];ze(s)&&Ye(o,s,t)}}function bT(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:o,optionsCache:s,config:{optionMergeStrategies:i}}=t.appContext,a=s.get(e);let l;return a?l=a:!o.length&&!n&&!r?l=e:(l={},o.length&&o.forEach(c=>Wp(l,c,i,!0)),Wp(l,e,i)),xt(e)&&s.set(e,l),l}function Wp(t,e,n,r=!1){const{mixins:o,extends:s}=e;s&&Wp(t,s,n,!0),o&&o.forEach(i=>Wp(t,i,n,!0));for(const i in e)if(!(r&&i==="expose")){const a=PN[i]||n&&n[i];t[i]=a?a(t[i],e[i]):e[i]}return t}const PN={data:o5,props:s5,emits:s5,methods:Qu,computed:Qu,beforeCreate:Xn,created:Xn,beforeMount:Xn,mounted:Xn,beforeUpdate:Xn,updated:Xn,beforeDestroy:Xn,beforeUnmount:Xn,destroyed:Xn,unmounted:Xn,activated:Xn,deactivated:Xn,errorCaptured:Xn,serverPrefetch:Xn,components:Qu,directives:Qu,watch:BN,provide:o5,inject:HN};function o5(t,e){return e?t?function(){return Xt(ze(t)?t.call(this,this):t,ze(e)?e.call(this,this):e)}:e:t}function HN(t,e){return Qu(P1(t),P1(e))}function P1(t){if($e(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Xn(t,e){return t?[...new Set([].concat(t,e))]:e}function Qu(t,e){return t?Xt(Object.create(null),t,e):e}function s5(t,e){return t?$e(t)&&$e(e)?[...new Set([...t,...e])]:Xt(Object.create(null),t5(t),t5(e??{})):e}function BN(t,e){if(!t)return e;if(!e)return t;const n=Xt(Object.create(null),t);for(const r in e)n[r]=Xn(t[r],e[r]);return n}function wT(){return{app:null,config:{isNativeTag:wM,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let FN=0;function jN(t,e){return function(r,o=null){ze(r)||(r=Xt({},r)),o!=null&&!xt(o)&&(o=null);const s=wT(),i=new WeakSet,a=[];let l=!1;const c=s.app={_uid:FN++,_component:r,_props:o,_container:null,_context:s,_instance:null,version:wL,get config(){return s.config},set config(u){},use(u,...d){return i.has(u)||(u&&ze(u.install)?(i.add(u),u.install(c,...d)):ze(u)&&(i.add(u),u(c,...d))),c},mixin(u){return s.mixins.includes(u)||s.mixins.push(u),c},component(u,d){return d?(s.components[u]=d,c):s.components[u]},directive(u,d){return d?(s.directives[u]=d,c):s.directives[u]},mount(u,d,f){if(!l){const h=c._ceVNode||Z(r,o);return h.appContext=s,f===!0?f="svg":f===!1&&(f=void 0),d&&e?e(h,u):t(h,u,f),l=!0,c._container=u,u.__vue_app__=c,xg(h.component)}},onUnmount(u){a.push(u)},unmount(){l&&($o(a,c._instance,16),t(null,c._container),delete c._container.__vue_app__)},provide(u,d){return s.provides[u]=d,c},runWithContext(u){const d=Ya;Ya=c;try{return u()}finally{Ya=d}}};return c}}let Ya=null;const zN=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${lo(e)}Modifiers`]||t[`${Nl(e)}Modifiers`];function VN(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||Tt;let o=n;const s=e.startsWith("update:"),i=s&&zN(r,e.slice(7));i&&(i.trim&&(o=n.map(u=>Lt(u)?u.trim():u)),i.number&&(o=n.map(hg)));let a,l=r[a=T0(e)]||r[a=T0(lo(e))];!l&&s&&(l=r[a=T0(Nl(e))]),l&&$o(l,t,6,o);const c=r[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,$o(c,t,6,o)}}const UN=new WeakMap;function kT(t,e,n=!1){const r=n?UN:e.emitsCache,o=r.get(t);if(o!==void 0)return o;const s=t.emits;let i={},a=!1;if(!ze(t)){const l=c=>{const u=kT(c,e,!0);u&&(a=!0,Xt(i,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!s&&!a?(xt(t)&&r.set(t,null),null):($e(s)?s.forEach(l=>i[l]=null):Xt(i,s),xt(t)&&r.set(t,i),i)}function wg(t,e){return!t||!Ff(e)?!1:(e=e.slice(2).replace(/Once$/,""),wt(t,e[0].toLowerCase()+e.slice(1))||wt(t,Nl(e))||wt(t,e))}function $0(t){const{type:e,vnode:n,proxy:r,withProxy:o,propsOptions:[s],slots:i,attrs:a,emit:l,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:g}=t,y=Up(t);let w,x;try{if(n.shapeFlag&4){const v=o||r,S=v;w=Lr(c.call(S,v,u,d,h,f,p)),x=a}else{const v=e;w=Lr(v.length>1?v(d,{attrs:a,slots:i,emit:l}):v(d,null)),x=e.props?a:WN(a)}}catch(v){Md.length=0,yu(v,t,1),w=Z(Yt)}let C=w;if(x&&g!==!1){const v=Object.keys(x),{shapeFlag:S}=C;v.length&&S&7&&(s&&v.some(uw)&&(x=KN(x,s)),C=Pr(C,x,!1,!0))}return n.dirs&&(C=Pr(C,null,!1,!0),C.dirs=C.dirs?C.dirs.concat(n.dirs):n.dirs),n.transition&&sa(C,n.transition),w=C,Up(y),w}function qN(t,e=!0){let n;for(let r=0;r<t.length;r++){const o=t[r];if(ml(o)){if(o.type!==Yt||o.children==="v-if"){if(n)return;n=o}}else return}return n}const WN=t=>{let e;for(const n in t)(n==="class"||n==="style"||Ff(n))&&((e||(e={}))[n]=t[n]);return e},KN=(t,e)=>{const n={};for(const r in t)(!uw(r)||!(r.slice(9)in e))&&(n[r]=t[r]);return n};function GN(t,e,n){const{props:r,children:o,component:s}=t,{props:i,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?i5(r,i,c):!!i;if(l&8){const u=e.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(i[f]!==r[f]&&!wg(c,f))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?i5(r,i,c):!0:!!i;return!1}function i5(t,e,n){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!0;for(let o=0;o<r.length;o++){const s=r[o];if(e[s]!==t[s]&&!wg(n,s))return!0}return!1}function kg({vnode:t,parent:e},n){for(;e;){const r=e.subTree;if(r.suspense&&r.suspense.activeBranch===t&&(r.el=t.el),r===t)(t=e.vnode).el=n,e=e.parent;else break}}const xT={},CT=()=>Object.create(xT),_T=t=>Object.getPrototypeOf(t)===xT;function JN(t,e,n,r=!1){const o={},s=CT();t.propsDefaults=Object.create(null),ST(t,e,o,s);for(const i in t.propsOptions[0])i in o||(o[i]=void 0);n?t.props=r?o:es(o):t.type.props?t.props=o:t.props=s,t.attrs=s}function YN(t,e,n,r){const{props:o,attrs:s,vnode:{patchFlag:i}}=t,a=ut(o),[l]=t.propsOptions;let c=!1;if((r||i>0)&&!(i&16)){if(i&8){const u=t.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(wg(t.emitsOptions,f))continue;const h=e[f];if(l)if(wt(s,f))h!==s[f]&&(s[f]=h,c=!0);else{const p=lo(f);o[p]=H1(l,a,p,h,t,!1)}else h!==s[f]&&(s[f]=h,c=!0)}}}else{ST(t,e,o,s)&&(c=!0);let u;for(const d in a)(!e||!wt(e,d)&&((u=Nl(d))===d||!wt(e,u)))&&(l?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=H1(l,a,d,void 0,t,!0)):delete o[d]);if(s!==a)for(const d in s)(!e||!wt(e,d))&&(delete s[d],c=!0)}c&&Hs(t.attrs,"set","")}function ST(t,e,n,r){const[o,s]=t.propsOptions;let i=!1,a;if(e)for(let l in e){if(Ga(l))continue;const c=e[l];let u;o&&wt(o,u=lo(l))?!s||!s.includes(u)?n[u]=c:(a||(a={}))[u]=c:wg(t.emitsOptions,l)||(!(l in r)||c!==r[l])&&(r[l]=c,i=!0)}if(s){const l=ut(n),c=a||Tt;for(let u=0;u<s.length;u++){const d=s[u];n[d]=H1(o,l,d,c[d],t,!wt(c,d))}}return i}function H1(t,e,n,r,o,s){const i=t[n];if(i!=null){const a=wt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&ze(l)){const{propsDefaults:c}=o;if(n in c)r=c[n];else{const u=gl(o);r=c[n]=l.call(null,e),u()}}else r=l;o.ce&&o.ce._setProp(n,r)}i[0]&&(s&&!a?r=!1:i[1]&&(r===""||r===Nl(n))&&(r=!0))}return r}const XN=new WeakMap;function MT(t,e,n=!1){const r=n?XN:e.propsCache,o=r.get(t);if(o)return o;const s=t.props,i={},a=[];let l=!1;if(!ze(t)){const u=d=>{l=!0;const[f,h]=MT(d,e,!0);Xt(i,f),h&&a.push(...h)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!s&&!l)return xt(t)&&r.set(t,uc),uc;if($e(s))for(let u=0;u<s.length;u++){const d=lo(s[u]);a5(d)&&(i[d]=Tt)}else if(s)for(const u in s){const d=lo(u);if(a5(d)){const f=s[u],h=i[d]=$e(f)||ze(f)?{type:f}:Xt({},f),p=h.type;let g=!1,y=!0;if($e(p))for(let w=0;w<p.length;++w){const x=p[w],C=ze(x)&&x.name;if(C==="Boolean"){g=!0;break}else C==="String"&&(y=!1)}else g=ze(p)&&p.name==="Boolean";h[0]=g,h[1]=y,(g||wt(h,"default"))&&a.push(d)}}const c=[i,a];return xt(t)&&r.set(t,c),c}function a5(t){return t[0]!=="$"&&!Ga(t)}const Tw=t=>t==="_"||t==="_ctx"||t==="$stable",Ew=t=>$e(t)?t.map(Lr):[Lr(t)],ZN=(t,e,n)=>{if(e._n)return e;const r=qe((...o)=>Ew(e(...o)),n);return r._c=!1,r},TT=(t,e,n)=>{const r=t._ctx;for(const o in t){if(Tw(o))continue;const s=t[o];if(ze(s))e[o]=ZN(o,s,r);else if(s!=null){const i=Ew(s);e[o]=()=>i}}},ET=(t,e)=>{const n=Ew(e);t.slots.default=()=>n},AT=(t,e,n)=>{for(const r in e)(n||!Tw(r))&&(t[r]=e[r])},QN=(t,e,n)=>{const r=t.slots=CT();if(t.vnode.shapeFlag&32){const o=e._;o?(AT(r,e,n),n&&CM(r,"_",o,!0)):TT(e,r)}else e&&ET(t,e)},eL=(t,e,n)=>
vendor: 4,513 bytes, line 4
4{const{vnode:r,slots:o}=t;let s=!0,i=Tt;if(r.shapeFlag&32){const a=e._;a?n&&a===1?s=!1:AT(o,e,n):(s=!e.$stable,TT(e,o)),i=e}else e&&(ET(t,e),i={default:1});if(s)for(const a in o)!Tw(a)&&i[a]==null&&delete o[a]},Jt=$T;function tL(t){return OT(t)}function nL(t){return OT(t,xN)}function OT(t,e){const n=pg();n.__VUE__=!0;const{insert:r,remove:o,patchProp:s,createElement:i,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=ss,insertStaticContent:p}=t,g=(I,O,z,K=null,G=null,re=null,he=void 0,le=null,ae=!!O.dynamicChildren)=>{if(I===O)return;I&&!So(I,O)&&(K=F(I),ke(I,G,re,!0),I=null),O.patchFlag===-2&&(ae=!1,O.dynamicChildren=null);const{type:te,ref:Me,shapeFlag:ge}=O;switch(te){case Xa:y(I,O,z,K);break;case Yt:w(I,O,z,K);break;case Sd:I==null&&x(O,z,K,he);break;case ce:$(I,O,z,K,G,re,he,le,ae);break;default:ge&1?S(I,O,z,K,G,re,he,le,ae):ge&6?W(I,O,z,K,G,re,he,le,ae):(ge&64||ge&128)&&te.process(I,O,z,K,G,re,he,le,ae,de)}Me!=null&&G?pc(Me,I&&I.ref,re,O||I,!O):Me==null&&I&&I.ref!=null&&pc(I.ref,null,re,I,!0)},y=(I,O,z,K)=>{if(I==null)r(O.el=a(O.children),z,K);else{const G=O.el=I.el;O.children!==I.children&&c(G,O.children)}},w=(I,O,z,K)=>{I==null?r(O.el=l(O.children||""),z,K):O.el=I.el},x=(I,O,z,K)=>{[I.el,I.anchor]=p(I.children,O,z,K,I.el,I.anchor)},C=({el:I,anchor:O},z,K)=>{let G;for(;I&&I!==O;)G=f(I),r(I,z,K),I=G;r(O,z,K)},v=({el:I,anchor:O})=>{let z;for(;I&&I!==O;)z=f(I),o(I),I=z;o(O)},S=(I,O,z,K,G,re,he,le,ae)=>{if(O.type==="svg"?he="svg":O.type==="math"&&(he="mathml"),I==null)E(O,z,K,G,re,he,le,ae);else{const te=I.el&&I.el._isVueCE?I.el:null;try{te&&te._beginPatch(),A(I,O,G,re,he,le,ae)}finally{te&&te._endPatch()}}},E=(I,O,z,K,G,re,he,le)=>{let ae,te;const{props:Me,shapeFlag:ge,transition:Te,dirs:De}=I;if(ae=I.el=i(I.type,re,Me&&Me.is,Me),ge&8?u(ae,I.children):ge&16&&T(I.children,ae,null,K,G,D0(I,re),he,le),De&&Go(I,null,K,"created"),M(ae,I,I.scopeId,he,K),Me){for(const it in Me)it!=="value"&&!Ga(it)&&s(ae,it,null,Me[it],re,K);"value"in Me&&s(ae,"value",null,Me.value,re),(te=Me.onVnodeBeforeMount)&&hr(te,K,I)}De&&Go(I,null,K,"beforeMount");const Je=IT(G,Te);Je&&Te.beforeEnter(ae),r(ae,O,z),((te=Me&&Me.onVnodeMounted)||Je||De)&&Jt(()=>{te&&hr(te,K,I),Je&&Te.enter(ae),De&&Go(I,null,K,"mounted")},G)},M=(I,O,z,K,G)=>{if(z&&h(I,z),K)for(let re=0;re<K.length;re++)h(I,K[re]);if(G){let re=G.subTree;if(O===re||Gp(re.type)&&(re.ssContent===O||re.ssFallback===O)){const he=G.vnode;M(I,he,he.scopeId,he.slotScopeIds,G.parent)}}},T=(I,O,z,K,G,re,he,le,ae=0)=>{for(let te=ae;te<I.length;te++){const Me=I[te]=le?Ti(I[te]):Lr(I[te]);g(null,Me,O,z,K,G,re,he,le)}},A=(I,O,z,K,G,re,he)=>{const le=O.el=I.el;let{patchFlag:ae,dynamicChildren:te,dirs:Me}=O;ae|=I.patchFlag&16;const ge=I.props||Tt,Te=O.props||Tt;let De;if(z&&_a(z,!1),(De=Te.onVnodeBeforeUpdate)&&hr(De,z,O,I),Me&&Go(O,I,z,"beforeUpdate"),z&&_a(z,!0),(ge.innerHTML&&Te.innerHTML==null||ge.textContent&&Te.textContent==null)&&u(le,""),te?N(I.dynamicChildren,te,le,z,K,D0(O,G),re):he||j(I,O,le,null,z,K,D0(O,G),re,!1),ae>0){if(ae&16)D(le,ge,Te,z,G);else if(ae&2&&ge.class!==Te.class&&s(le,"class",null,Te.class,G),ae&4&&s(le,"style",ge.style,Te.style,G),ae&8){const Je=O.dynamicProps;for(let it=0;it<Je.length;it++){const ht=Je[it],ln=ge[ht],Kt=Te[ht];(Kt!==ln||ht==="value")&&s(le,ht,ln,Kt,G,z)}}ae&1&&I.children!==O.children&&u(le,O.children)}else!he&&te==null&&D(le,ge,Te,z,G);((De=Te.onVnodeUpdated)||Me)&&Jt(()=>{De&&hr(De,z,O,I),Me&&Go(O,I,z,"updated")},K)},N=(I,O,z,K,G,re,he)=>{for(let le=0;le<O.length;le++){const ae=I[le],te=O[le],Me=ae.el&&(ae.type===ce||!So(ae,te)||ae.shapeFlag&198)?d(ae.el):z;g(ae,te,Me,null,K,G,re,he,!0)}},D=(I,O,z,K,G)=>{if(O!==z){if(O!==Tt)for(const re in O)!Ga(re)&&!(re in z)&&s(I,re,O[re],null,G,K);for(const re in z){if(Ga(re))continue;const he=z[re],le=O[re];he!==le&&re!=="value"&&s(I,re,le,he,G,K)}"value"in z&&s(I,"value",O.value,z.value,G)}},$=(I,O,z,K,G,re,he,le,ae)=>{const te=O.el=I?I.el:a(""),Me=O.anchor=I?I.anchor:a("");let{patchFlag:ge,dynamicChildren:Te,slotScopeIds:De}=O;De&&(le=le?le.concat(De):De),I==null?(r(te,z,K),r(Me,z,K),T(O.children||[],z,Me,G,re,he,le,ae)):ge>0&&ge&64&&Te&&I.dynamicChildren&&I.dynamicChildren.length===Te.length?(N(I.dynamicChildren,Te,z,G,re,he,le),(O.key!=null||G&&O===G.subTree)&&Aw(I,O,!0)):j(I,O,z,Me,G,re,he,le,ae)},W=(I,O,z,K,G,re,he,le,ae)=>{O.slotScopeIds=le,I==null?O.shapeFlag&512?G.ctx.activate(O,z,K,he,ae):me(O,z,K,G,re,he,ae):V(I,O,ae)},me=(I,O,z,K,G,re,he)=>{const le=I.component=pL(I,K,G);
vendor: 5,493 bytes, line 4
4if(Uf(I)&&(le.ctx.renderer=de),mL(le,!1,he),le.asyncDep){if(G&&G.registerDep(le,B,he),!I.el){const ae=le.subTree=Z(Yt);w(null,ae,O,z),I.placeholder=ae.el}}else B(le,I,O,z,G,re,he)},V=(I,O,z)=>{const K=O.component=I.component;if(GN(I,O,z))if(K.asyncDep&&!K.asyncResolved){Y(K,O,z);return}else K.next=O,K.update();else O.el=I.el,K.vnode=O},B=(I,O,z,K,G,re,he)=>{const le=()=>{if(I.isMounted){let{next:ge,bu:Te,u:De,parent:Je,vnode:it}=I;{const bn=NT(I);if(bn){ge&&(ge.el=it.el,Y(I,ge,he)),bn.asyncDep.then(()=>{I.isUnmounted||le()});return}}let ht=ge,ln;_a(I,!1),ge?(ge.el=it.el,Y(I,ge,he)):ge=it,Te&&fc(Te),(ln=ge.props&&ge.props.onVnodeBeforeUpdate)&&hr(ln,Je,ge,it),_a(I,!0);const Kt=$0(I),Jn=I.subTree;I.subTree=Kt,g(Jn,Kt,d(Jn.el),F(Jn),I,G,re),ge.el=Kt.el,ht===null&&kg(I,Kt.el),De&&Jt(De,G),(ln=ge.props&&ge.props.onVnodeUpdated)&&Jt(()=>hr(ln,Je,ge,it),G)}else{let ge;const{el:Te,props:De}=O,{bm:Je,m:it,parent:ht,root:ln,type:Kt}=I,Jn=Gs(O);if(_a(I,!1),Je&&fc(Je),!Jn&&(ge=De&&De.onVnodeBeforeMount)&&hr(ge,ht,O),_a(I,!0),Te&&ot){const bn=()=>{I.subTree=$0(I),ot(Te,I.subTree,I,G,null)};Jn&&Kt.__asyncHydrate?Kt.__asyncHydrate(Te,I,bn):bn()}else{ln.ce&&ln.ce._def.shadowRoot!==!1&&ln.ce._injectChildStyle(Kt);const bn=I.subTree=$0(I);g(null,bn,z,K,I,G,re),O.el=bn.el}if(it&&Jt(it,G),!Jn&&(ge=De&&De.onVnodeMounted)){const bn=O;Jt(()=>hr(ge,ht,bn),G)}(O.shapeFlag&256||ht&&Gs(ht.vnode)&&ht.vnode.shapeFlag&256)&&I.a&&Jt(I.a,G),I.isMounted=!0,O=z=K=null}};I.scope.on();const ae=I.effect=new OM(le);I.scope.off();const te=I.update=ae.run.bind(ae),Me=I.job=ae.runIfDirty.bind(ae);Me.i=I,Me.id=I.uid,ae.scheduler=()=>bw(Me),_a(I,!0),te()},Y=(I,O,z)=>{O.component=I;const K=I.vnode.props;I.vnode=O,I.next=null,YN(I,O.props,K,z),eL(I,O.children,z),Qs(),Wx(I),ei()},j=(I,O,z,K,G,re,he,le,ae=!1)=>{const te=I&&I.children,Me=I?I.shapeFlag:0,ge=O.children,{patchFlag:Te,shapeFlag:De}=O;if(Te>0){if(Te&128){Q(te,ge,z,K,G,re,he,le,ae);return}else if(Te&256){P(te,ge,z,K,G,re,he,le,ae);return}}De&8?(Me&16&&Re(te,G,re),ge!==te&&u(z,ge)):Me&16?De&16?Q(te,ge,z,K,G,re,he,le,ae):Re(te,G,re,!0):(Me&8&&u(z,""),De&16&&T(ge,z,K,G,re,he,le,ae))},P=(I,O,z,K,G,re,he,le,ae)=>{I=I||uc,O=O||uc;const te=I.length,Me=O.length,ge=Math.min(te,Me);let Te;for(Te=0;Te<ge;Te++){const De=O[Te]=ae?Ti(O[Te]):Lr(O[Te]);g(I[Te],De,z,null,G,re,he,le,ae)}te>Me?Re(I,G,re,!0,!1,ge):T(O,z,K,G,re,he,le,ae,ge)},Q=(I,O,z,K,G,re,he,le,ae)=>{let te=0;const Me=O.length;let ge=I.length-1,Te=Me-1;for(;te<=ge&&te<=Te;){const De=I[te],Je=O[te]=ae?Ti(O[te]):Lr(O[te]);if(So(De,Je))g(De,Je,z,null,G,re,he,le,ae);else break;te++}for(;te<=ge&&te<=Te;){const De=I[ge],Je=O[Te]=ae?Ti(O[Te]):Lr(O[Te]);if(So(De,Je))g(De,Je,z,null,G,re,he,le,ae);else break;ge--,Te--}if(te>ge){if(te<=Te){const De=Te+1,Je=De<Me?O[De].el:K;for(;te<=Te;)g(null,O[te]=ae?Ti(O[te]):Lr(O[te]),z,Je,G,re,he,le,ae),te++}}else if(te>Te)for(;te<=ge;)ke(I[te],G,re,!0),te++;else{const De=te,Je=te,it=new Map;for(te=Je;te<=Te;te++){const oe=O[te]=ae?Ti(O[te]):Lr(O[te]);oe.key!=null&&it.set(oe.key,te)}let ht,ln=0;const Kt=Te-Je+1;let Jn=!1,bn=0;const R=new Array(Kt);for(te=0;te<Kt;te++)R[te]=0;for(te=De;te<=ge;te++){const oe=I[te];if(ln>=Kt){ke(oe,G,re,!0);continue}let Ce;if(oe.key!=null)Ce=it.get(oe.key);else for(ht=Je;ht<=Te;ht++)if(R[ht-Je]===0&&So(oe,O[ht])){Ce=ht;break}Ce===void 0?ke(oe,G,re,!0):(R[Ce-Je]=te+1,Ce>=bn?bn=Ce:Jn=!0,g(oe,O[Ce],z,null,G,re,he,le,ae),ln++)}const X=Jn?rL(R):uc;for(ht=X.length-1,te=Kt-1;te>=0;te--){const oe=Je+te,Ce=O[oe],_e=O[oe+1],ct=oe+1<Me?_e.el||LT(_e):K;R[te]===0?g(null,Ce,z,ct,G,re,he,le,ae):Jn&&(ht<0||te!==X[ht]?J(Ce,z,ct,2):ht--)}}},J=(I,O,z,K,G=null)=>{const{el:re,type:he,transition:le,children:ae,shapeFlag:te}=I;if(te&6){J(I.component.subTree,O,z,K);return}if(te&128){I.suspense.move(O,z,K);return}if(te&64){he.move(I,O,z,de);return}if(he===ce){r(re,O,z);for(let ge=0;ge<ae.length;ge++)J(ae[ge],O,z,K);r(I.anchor,O,z);return}if(he===Sd){C(I,O,z);return}if(K!==2&&te&1&&le)if(K===0)le.beforeEnter(re),r(re,O,z),Jt(()=>le.enter(re),G);else{const{leave:ge,delayLeave:Te,afterLeave:De}=le,Je=()=>{I.ctx.isUnmounted?o(re):r(re,O,z)},it=()=>{re._isLeaving&&re[Ds](!0),ge(re,()=>{Je(),De&&De()})};Te?Te(re,Je,it):it()}else r(re,O,z)},ke=(I,O,z,K=!1,G=!1)=>{const{type:re,props:he,ref:le,children:ae,dynamicChildren:te,shapeFlag:Me,patchFlag:ge,dirs:Te,cacheIndex:De}=I;if(ge===-2&&(G=!1),le!=null&&(Qs(),pc(le,null,z,I,!0),ei()),De!=null&&(O.renderCache[De]=void 0),Me&256){O.ctx.deactivate(I);return}const Je=Me&1&&Te,it=!Gs(I);let ht;if(it&&(ht=he&&he.onVnodeBeforeUnmount)&&hr(ht,O,I),Me&6)se(I.component,z,K);else{if(Me&128){I.suspense.unmount(z,K);return}Je&&Go(I,null,O,"beforeUnmount"),Me&64?I.type.remove(I,O,z,de,K):te&&!te.hasOnce&&(re!==ce||ge>0&&ge&64)?Re(te,O,z,!1,!0):(re===ce&&ge&384||!G&&Me&16)&&Re(ae,O,z),K&&Se(I)}(it&&(ht=he&&he.onVnodeUnmounted)||Je)&&Jt(()=>{ht&&hr(ht,O,I),Je&&Go(I,null,O,"unmounted")},z)},Se=I=>{const{type:O,el:z,anchor:K,transition:G}=I;if(O===ce){ee(z,K);return}if(O===Sd){v(I);return}const re=()=>{o(z),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(I.shapeFlag&1&&G&&!G.persisted){const{leave:he,delayLeave:le}=G,ae=()=>he(z,re);le?le(I.el,re,ae):ae()}else re()},ee=(I,O)=>{let z;for(;I!==O;)z=f(I),o(I),I=z;o(O)},se=(I,O,z)=>{const{bum:K,scope:G,job:re,subTree:he,um:le,m:ae,a:te}=I;Kp(ae),Kp(te),K&&fc(K),G.stop(),re&&(re.flags|=8,ke(he,I,O,z)),le&&Jt(le,O),Jt(()=>{I.isUnmounted=!0},O)},Re=(I,O,z,K=!1,G=!1,re=0)=>{for(let he=re;he<I.length;he++)ke(I[he],O,z,K,G)},F=I=>
vendor: 5,030 bytes, line 4
4{if(I.shapeFlag&6)return F(I.component.subTree);if(I.shapeFlag&128)return I.suspense.next();const O=f(I.anchor||I.el),z=O&&O[tT];return z?f(z):O};let q=!1;const ne=(I,O,z)=>{let K;I==null?O._vnode&&(ke(O._vnode,null,null,!0),K=O._vnode.component):g(O._vnode||null,I,O,null,null,null,z),O._vnode=I,q||(q=!0,Wx(K),Vp(),q=!1)},de={p:g,um:ke,m:J,r:Se,mt:me,mc:T,pc:j,pbc:N,n:F,o:t};let Pe,ot;return e&&([Pe,ot]=e(de)),{render:ne,hydrate:Pe,createApp:jN(ne,Pe)}}function D0({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function _a({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function IT(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Aw(t,e,n=!1){const r=t.children,o=e.children;if($e(r)&&$e(o))for(let s=0;s<r.length;s++){const i=r[s];let a=o[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[s]=Ti(o[s]),a.el=i.el),!n&&a.patchFlag!==-2&&Aw(i,a)),a.type===Xa&&(a.patchFlag!==-1?a.el=i.el:a.__elIndex=s+(t.type===ce?1:0)),a.type===Yt&&!a.el&&(a.el=i.el)}}function rL(t){const e=t.slice(),n=[0];let r,o,s,i,a;const l=t.length;for(r=0;r<l;r++){const c=t[r];if(c!==0){if(o=n[n.length-1],t[o]<c){e[r]=o,n.push(r);continue}for(s=0,i=n.length-1;s<i;)a=s+i>>1,t[n[a]]<c?s=a+1:i=a;c<t[n[s]]&&(s>0&&(e[r]=n[s-1]),n[s]=r)}}for(s=n.length,i=n[s-1];s-- >0;)n[s]=i,i=e[i];return n}function NT(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:NT(e)}function Kp(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function LT(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?LT(e.subTree):null}const Gp=t=>t.__isSuspense;let B1=0;const oL={name:"Suspense",__isSuspense:!0,process(t,e,n,r,o,s,i,a,l,c){if(t==null)sL(e,n,r,o,s,i,a,l,c);else{if(s&&s.deps>0&&!t.suspense.isInFallback){e.suspense=t.suspense,e.suspense.vnode=e,e.el=t.el;return}iL(t,e,n,r,o,i,a,l,c)}},hydrate:aL,normalize:lL},Ow=oL;function cf(t,e){const n=t.props&&t.props[e];ze(n)&&n()}function sL(t,e,n,r,o,s,i,a,l){const{p:c,o:{createElement:u}}=l,d=u("div"),f=t.suspense=RT(t,o,r,e,d,n,s,i,a,l);c(null,f.pendingBranch=t.ssContent,d,null,r,f,s,i),f.deps>0?(cf(t,"onPending"),cf(t,"onFallback"),c(null,t.ssFallback,e,n,r,null,s,i),mc(f,t.ssFallback)):f.resolve(!1,!0)}function iL(t,e,n,r,o,s,i,a,{p:l,um:c,o:{createElement:u}}){const d=e.suspense=t.suspense;d.vnode=e,e.el=t.el;const f=e.ssContent,h=e.ssFallback,{activeBranch:p,pendingBranch:g,isInFallback:y,isHydrating:w}=d;if(g)d.pendingBranch=f,So(g,f)?(l(g,f,d.hiddenContainer,null,o,d,s,i,a),d.deps<=0?d.resolve():y&&(w||(l(p,h,n,r,o,null,s,i,a),mc(d,h)))):(d.pendingId=B1++,w?(d.isHydrating=!1,d.activeBranch=g):c(g,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),y?(l(null,f,d.hiddenContainer,null,o,d,s,i,a),d.deps<=0?d.resolve():(l(p,h,n,r,o,null,s,i,a),mc(d,h))):p&&So(p,f)?(l(p,f,n,r,o,d,s,i,a),d.resolve(!0)):(l(null,f,d.hiddenContainer,null,o,d,s,i,a),d.deps<=0&&d.resolve()));else if(p&&So(p,f))l(p,f,n,r,o,d,s,i,a),mc(d,f);else if(cf(e,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=B1++,l(null,f,d.hiddenContainer,null,o,d,s,i,a),d.deps<=0)d.resolve();else{const{timeout:x,pendingId:C}=d;x>0?setTimeout(()=>{d.pendingId===C&&d.fallback(h)},x):x===0&&d.fallback(h)}}function RT(t,e,n,r,o,s,i,a,l,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:g,remove:y}}=c;let w;const x=cL(t);x&&e&&e.pendingBranch&&(w=e.pendingId,e.deps++);const C=t.props?_M(t.props.timeout):void 0,v=s,S={vnode:t,parent:e,parentComponent:n,namespace:i,container:r,hiddenContainer:o,deps:0,pendingId:B1++,timeout:typeof C=="number"?C:-1,activeBranch:null,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(E=!1,M=!1){const{vnode:T,activeBranch:A,pendingBranch:N,pendingId:D,effects:$,parentComponent:W,container:me,isInFallback:V}=S;let B=!1;S.isHydrating?S.isHydrating=!1:E||(B=A&&N.transition&&N.transition.mode==="out-in",B&&(A.transition.afterLeave=()=>{D===S.pendingId&&(f(N,me,s===v?p(A):s,0),L1($),V&&T.ssFallback&&(T.ssFallback.el=null))}),A&&(g(A.el)===me&&(s=p(A)),h(A,W,S,!0),!B&&V&&T.ssFallback&&Jt(()=>T.ssFallback.el=null,S)),B||f(N,me,s,0)),mc(S,N),S.pendingBranch=null,S.isInFallback=!1;let Y=S.parent,j=!1;for(;Y;){if(Y.pendingBranch){Y.effects.push(...$),j=!0;break}Y=Y.parent}!j&&!B&&L1($),S.effects=[],x&&e&&e.pendingBranch&&w===e.pendingId&&(e.deps--,e.deps===0&&!M&&e.resolve()),cf(T,"onResolve")},fallback(E){if(!S.pendingBranch)return;const{vnode:M,activeBranch:T,parentComponent:A,container:N,namespace:D}=S;cf(M,"onFallback");const $=p(T),W=()=>{S.isInFallback&&(d(null,E,N,$,A,null,D,a,l),mc(S,E))},me=E.transition&&E.transition.mode==="out-in";me&&(T.transition.afterLeave=W),S.isInFallback=!0,h(T,A,null,!0),me||W()},move(E,M,T){S.activeBranch&&f(S.activeBranch,E,M,T),S.container=E},next(){return S.activeBranch&&p(S.activeBranch)},registerDep(E,M,T){const A=!!S.pendingBranch;A&&S.deps++;const N=E.vnode.el;
vendor: 4,637 bytes, line 4
4E.asyncDep.catch(D=>{yu(D,E,0)}).then(D=>{if(E.isUnmounted||S.isUnmounted||S.pendingId!==E.suspenseId)return;E.asyncResolved=!0;const{vnode:$}=E;z1(E,D),N&&($.el=N);const W=!N&&E.subTree.el;M(E,$,g(N||E.subTree.el),N?null:p(E.subTree),S,i,T),W&&($.placeholder=null,y(W)),kg(E,$.el),A&&--S.deps===0&&S.resolve()})},unmount(E,M){S.isUnmounted=!0,S.activeBranch&&h(S.activeBranch,n,E,M),S.pendingBranch&&h(S.pendingBranch,n,E,M)}};return S}function aL(t,e,n,r,o,s,i,a,l){const c=e.suspense=RT(e,r,n,t.parentNode,document.createElement("div"),null,o,s,i,a,!0),u=l(t,c.pendingBranch=e.ssContent,n,c,s,i);return c.deps===0&&c.resolve(!1,!0),u}function lL(t){const{shapeFlag:e,children:n}=t,r=e&32;t.ssContent=l5(r?n.default:n),t.ssFallback=r?l5(n.fallback):Z(Yt)}function l5(t){let e;if(ze(t)){const n=Oc&&t._c;n&&(t._d=!1,k()),t=t(),n&&(t._d=!0,e=pr,DT())}return $e(t)&&(t=qN(t)),t=Lr(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(n=>n!==t)),t}function $T(t,e){e&&e.pendingBranch?$e(t)?e.effects.push(...t):e.effects.push(t):L1(t)}function mc(t,e){t.activeBranch=e;const{vnode:n,parentComponent:r}=t;let o=e.el;for(;!o&&e.component;)e=e.component.subTree,o=e.el;n.el=o,r&&r.subTree===n&&(r.vnode.el=o,kg(r,o))}function cL(t){const e=t.props&&t.props.suspensible;return e!=null&&e!==!1}const ce=Symbol.for("v-fgt"),Xa=Symbol.for("v-txt"),Yt=Symbol.for("v-cmt"),Sd=Symbol.for("v-stc"),Md=[];let pr=null;function k(t=!1){Md.push(pr=t?null:[])}function DT(){Md.pop(),pr=Md[Md.length-1]||null}let Oc=1;function Jp(t,e=!1){Oc+=t,t<0&&pr&&e&&(pr.hasOnce=!0)}function PT(t){return t.dynamicChildren=Oc>0?pr||uc:null,DT(),Oc>0&&pr&&pr.push(t),t}function _(t,e,n,r,o,s){return PT(m(t,e,n,r,o,s,!0))}function xe(t,e,n,r,o){return PT(Z(t,e,n,r,o,!0))}function ml(t){return t?t.__v_isVNode===!0:!1}function So(t,e){return t.type===e.type&&t.key===e.key}const HT=({key:t})=>t??null,ip=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Lt(t)||kt(t)||ze(t)?{i:An,r:t,k:e,f:!!n}:t:null);function m(t,e=null,n=null,r=0,o=null,s=t===ce?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&HT(e),ref:e&&ip(e),scopeId:QM,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:An};return a?(Iw(l,n),s&128&&t.normalize(l)):n&&(l.shapeFlag|=Lt(n)?8:16),Oc>0&&!i&&pr&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&pr.push(l),l}const Z=uL;function uL(t,e=null,n=null,r=0,o=null,s=!1){if((!t||t===mT)&&(t=Yt),ml(t)){const a=Pr(t,e,!0);return n&&Iw(a,n),Oc>0&&!s&&pr&&(a.shapeFlag&6?pr[pr.indexOf(t)]=a:pr.push(a)),a.patchFlag=-2,a}if(bL(t)&&(t=t.__vccOpts),e){e=dL(e);let{class:a,style:l}=e;a&&!Lt(a)&&(e.class=H(a)),xt(l)&&(vg(l)&&!$e(l)&&(l=Xt({},l)),e.style=xn(l))}const i=Lt(t)?1:Gp(t)?128:nT(t)?64:xt(t)?4:ze(t)?2:0;return m(t,e,n,r,o,i,s,!0)}function dL(t){return t?vg(t)||_T(t)?Xt({},t):t:null}function Pr(t,e,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:a,transition:l}=t,c=e?BT(o||{},e):o,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&HT(c),ref:e&&e.ref?n&&s?$e(s)?s.concat(ip(e)):[s,ip(e)]:ip(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==ce?i===-1?16:i|16:i,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Pr(t.ssContent),ssFallback:t.ssFallback&&Pr(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&r&&sa(u,l.clone(u)),u}function Le(t=" ",e=0){return Z(Xa,null,t,e)}function ps(t,e){const n=Z(Sd,null,t);return n.staticCount=e,n}function L(t="",e=!1){return e?(k(),xe(Yt,null,t)):Z(Yt,null,t)}function Lr(t){return t==null||typeof t=="boolean"?Z(Yt):$e(t)?Z(ce,null,t.slice()):ml(t)?Ti(t):Z(Xa,null,String(t))}function Ti(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Pr(t)}function Iw(t,e){let n=0;const{shapeFlag:r}=t;if(e==null)e=null;else if($e(e))n=16;else if(typeof e=="object")if(r&65){const o=e.default;o&&(o._c&&(o._d=!1),Iw(t,o()),o._c&&(o._d=!0));return}else{n=32;const o=e._;!o&&!_T(e)?e._ctx=An:o===3&&An&&(An.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else ze(e)?(e={default:e,_ctx:An},n=32):(e=String(e),r&64?(n=16,e=[Le(e)]):n=8);t.children=e,t.shapeFlag|=n}function BT(...t){const e={};for(let n=0;n<t.length;n++){const r=t[n];
vendor: 4,579 bytes, line 4
4for(const o in r)if(o==="class")e.class!==r.class&&(e.class=H([e.class,r.class]));else if(o==="style")e.style=xn([e.style,r.style]);else if(Ff(o)){const s=e[o],i=r[o];i&&s!==i&&!($e(s)&&s.includes(i))&&(e[o]=s?[].concat(s,i):i)}else o!==""&&(e[o]=r[o])}return e}function hr(t,e,n,r=null){$o(t,e,7,[n,r])}const fL=wT();let hL=0;function pL(t,e,n){const r=t.type,o=(e?e.appContext:t.appContext)||fL,s={uid:hL++,vnode:t,type:r,parent:e,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new EM(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(o.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:MT(r,o),emitsOptions:kT(r,o),emit:null,emitted:null,propsDefaults:Tt,inheritAttrs:r.inheritAttrs,ctx:Tt,data:Tt,props:Tt,attrs:Tt,slots:Tt,refs:Tt,setupState:Tt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=e?e.root:s,s.emit=VN.bind(null,s),t.ce&&t.ce(s),s}let En=null;const go=()=>En||An;let Yp,F1;{const t=pg(),e=(n,r)=>{let o;return(o=t[n])||(o=t[n]=[]),o.push(r),s=>{o.length>1?o.forEach(i=>i(s)):o[0](s)}};Yp=e("__VUE_INSTANCE_SETTERS__",n=>En=n),F1=e("__VUE_SSR_SETTERS__",n=>Ic=n)}const gl=t=>{const e=En;return Yp(t),t.scope.on(),()=>{t.scope.off(),Yp(e)}},j1=()=>{En&&En.scope.off(),Yp(null)};function FT(t){return t.vnode.shapeFlag&4}let Ic=!1;function mL(t,e=!1,n=!1){e&&F1(e);const{props:r,children:o}=t.vnode,s=FT(t);JN(t,r,s,e),QN(t,o,n||e);const i=s?gL(t,e):void 0;return e&&F1(!1),i}function gL(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,RN);const{setup:r}=n;if(r){Qs();const o=t.setupContext=r.length>1?vL(t):null,s=gl(t),i=zf(r,t,0,[t.props,o]),a=cg(i);if(ei(),s(),(a||t.sp)&&!Gs(t)&&_w(t),a){if(i.then(j1,j1),e)return i.then(l=>{z1(t,l)}).catch(l=>{yu(l,t,0)});t.asyncDep=i}else z1(t,i)}else jT(t)}function z1(t,e,n){ze(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:xt(e)&&(t.setupState=WM(e)),jT(t)}function jT(t,e,n){const r=t.type;t.render||(t.render=r.render||ss);{const o=gl(t);Qs();try{$N(t)}finally{ei(),o()}}}const yL={get(t,e){return Hn(t,"get",""),t[e]}};function vL(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,yL),slots:t.slots,emit:t.emit,expose:e}}function xg(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(WM(jf(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in _d)return _d[n](t)},has(e,n){return n in e||n in _d}})):t.proxy}function V1(t,e=!0){return ze(t)?t.displayName||t.name:t.name||e&&t.__name}function bL(t){return ze(t)&&"__vccOpts"in t}const U=(t,e)=>cN(t,e,Ic);function mt(t,e,n){try{Jp(-1);const r=arguments.length;return r===2?xt(e)&&!$e(e)?ml(e)?Z(t,null,[e]):Z(t,e):Z(t,null,e):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ml(n)&&(n=[n]),Z(t,e,n))}finally{Jp(1)}}const wL="3.5.27";let U1;const c5=typeof window<"u"&&window.trustedTypes;if(c5)try{U1=c5.createPolicy("vue",{createHTML:t=>t})}catch{}const zT=U1?t=>U1.createHTML(t):t=>t,kL="http://www.w3.org/2000/svg",xL="http://www.w3.org/1998/Math/MathML",Ls=typeof document<"u"?document:null,u5=Ls&&Ls.createElement("template"),CL={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const o=e==="svg"?Ls.createElementNS(kL,t):e==="mathml"?Ls.createElementNS(xL,t):n?Ls.createElement(t,{is:n}):Ls.createElement(t);return t==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:t=>Ls.createTextNode(t),createComment:t=>Ls.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Ls.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,o,s){const i=n?n.previousSibling:e.lastChild;if(o&&(o===s||o.nextSibling))for(;e.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{u5.innerHTML=zT(r==="svg"?`<svg>${t}</svg>`:r==="mathml"?`<math>${t}</math>`:t);const a=u5.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[i?i.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},pi="transition",Pu="animation",Nc=Symbol("_vtc"),VT={name:String,type:String,css:{type:Boolean,default:!0}
vendor: 8,800 bytes, line 4
4,duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},UT=Xt({},iT,VT),_L=t=>(t.displayName="Transition",t.props=UT,t),qT=_L((t,{slots:e})=>mt(bN,WT(t),e)),Sa=(t,e=[])=>{$e(t)?t.forEach(n=>n(...e)):t&&t(...e)},d5=t=>t?$e(t)?t.some(e=>e.length>1):t.length>1:!1;function WT(t){const e={};for(const $ in t)$ in VT||(e[$]=t[$]);if(t.css===!1)return e;const{name:n="v",type:r,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:c=i,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=t,p=SL(o),g=p&&p[0],y=p&&p[1],{onBeforeEnter:w,onEnter:x,onEnterCancelled:C,onLeave:v,onLeaveCancelled:S,onBeforeAppear:E=w,onAppear:M=x,onAppearCancelled:T=C}=e,A=($,W,me,V)=>{$._enterCancelled=V,wi($,W?u:a),wi($,W?c:i),me&&me()},N=($,W)=>{$._isLeaving=!1,wi($,d),wi($,h),wi($,f),W&&W()},D=$=>(W,me)=>{const V=$?M:x,B=()=>A(W,$,me);Sa(V,[W,B]),f5(()=>{wi(W,$?l:s),qo(W,$?u:a),d5(V)||h5(W,r,g,B)})};return Xt(e,{onBeforeEnter($){Sa(w,[$]),qo($,s),qo($,i)},onBeforeAppear($){Sa(E,[$]),qo($,l),qo($,c)},onEnter:D(!1),onAppear:D(!0),onLeave($,W){$._isLeaving=!0;const me=()=>N($,W);qo($,d),$._enterCancelled?(qo($,f),q1($)):(q1($),qo($,f)),f5(()=>{$._isLeaving&&(wi($,d),qo($,h),d5(v)||h5($,r,y,me))}),Sa(v,[$,me])},onEnterCancelled($){A($,!1,void 0,!0),Sa(C,[$])},onAppearCancelled($){A($,!0,void 0,!0),Sa(T,[$])},onLeaveCancelled($){N($),Sa(S,[$])}})}function SL(t){if(t==null)return null;if(xt(t))return[P0(t.enter),P0(t.leave)];{const e=P0(t);return[e,e]}}function P0(t){return _M(t)}function qo(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[Nc]||(t[Nc]=new Set)).add(e)}function wi(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const n=t[Nc];n&&(n.delete(e),n.size||(t[Nc]=void 0))}function f5(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let ML=0;function h5(t,e,n,r){const o=t._endId=++ML,s=()=>{o===t._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:i,timeout:a,propCount:l}=KT(t,e);if(!i)return r();const c=i+"end";let u=0;const d=()=>{t.removeEventListener(c,f),s()},f=h=>{h.target===t&&++u>=l&&d()};setTimeout(()=>{u<l&&d()},a+1),t.addEventListener(c,f)}function KT(t,e){const n=window.getComputedStyle(t),r=p=>(n[p]||"").split(", "),o=r(`${pi}Delay`),s=r(`${pi}Duration`),i=p5(o,s),a=r(`${Pu}Delay`),l=r(`${Pu}Duration`),c=p5(a,l);let u=null,d=0,f=0;e===pi?i>0&&(u=pi,d=i,f=s.length):e===Pu?c>0&&(u=Pu,d=c,f=l.length):(d=Math.max(i,c),u=d>0?i>c?pi:Pu:null,f=u?u===pi?s.length:l.length:0);const h=u===pi&&/\b(?:transform|all)(?:,|$)/.test(r(`${pi}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function p5(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,r)=>m5(n)+m5(t[r])))}function m5(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function q1(t){return(t?t.ownerDocument:document).body.offsetHeight}function TL(t,e,n){const r=t[Nc];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const Xp=Symbol("_vod"),GT=Symbol("_vsh"),Pn={name:"show",beforeMount(t,{value:e},{transition:n}){t[Xp]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):Hu(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:r}){!e!=!n&&(r?e?(r.beforeEnter(t),Hu(t,!0),r.enter(t)):r.leave(t,()=>{Hu(t,!1)}):Hu(t,e))},beforeUnmount(t,{value:e}){Hu(t,e)}};function Hu(t,e){t.style.display=e?t[Xp]:"none",t[GT]=!e}const EL=Symbol(""),AL=/(?:^|;)\s*display\s*:/;function OL(t,e,n){const r=t.style,o=Lt(n);let s=!1;if(n&&!o){if(e)if(Lt(e))for(const i of e.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&ap(r,a,"")}else for(const i in e)n[i]==null&&ap(r,i,"");for(const i in n)i==="display"&&(s=!0),ap(r,i,n[i])}else if(o){if(e!==n){const i=r[EL];i&&(n+=";"+i),r.cssText=n,s=AL.test(n)}}else e&&t.removeAttribute("style");Xp in t&&(t[Xp]=s?r.display:"",t[GT]&&(r.display="none"))}const g5=/\s*!important$/;function ap(t,e,n){if($e(n))n.forEach(r=>ap(t,e,r));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const r=IL(t,e);g5.test(n)?t.setProperty(Nl(r),n.replace(g5,""),"important"):t[r]=n}}const y5=["Webkit","Moz","ms"],H0={};function IL(t,e){const n=H0[e];if(n)return n;let r=lo(e);if(r!=="filter"&&r in t)return H0[e]=r;r=fg(r);for(let o=0;o<y5.length;o++){const s=y5[o]+r;if(s in t)return H0[e]=s}return e}const v5="http://www.w3.org/1999/xlink";function b5(t,e,n,r,o,s=$I(e)){r&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(v5,e.slice(6,e.length)):t.setAttributeNS(v5,e,n):n==null||s&&!SM(n)?t.removeAttribute(e):t.setAttribute(e,s?"":No(n)?String(n):n)}function w5(t,e,n,r,o){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?zT(n):n);return}const s=t.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?t.getAttribute("value")||"":t.value,l=n==null?t.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in t))&&(t.value=l),n==null&&t.removeAttribute(e),t._value=n;return}let i=!1;if(n===""||n==null){const a=typeof t[e];a==="boolean"?n=SM(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{t[e]=n}catch{}i&&t.removeAttribute(o||e)}function Fs(t,e,n,r){t.addEventListener(e,n,r)}function NL(t,e,n,r){t.removeEventListener(e,n,r)}const k5=Symbol("_vei");function LL(t,e,n,r,o=null){const s=t[k5]||(t[k5]={}),i=s[e];if(r&&i)i.value=r;else{const[a,l]=RL(e);if(r){const c=s[e]=PL(r,o);Fs(t,a,c,l)}else i&&(NL(t,a,i,l),s[e]=void 0)}}const x5=/(?:Once|Passive|Capture)$/;function RL(t){let e;if(x5.test(t)){e={};let r;for(;r=t.match(x5);)t=t.slice(0,t.length-r[0].length),e[r[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Nl(t.slice(2)),e]}let B0=0;const $L=Promise.resolve(),DL=()=>B0||($L.then(()=>B0=0),B0=Date.now());function PL(t,e){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;$o(HL(r,n.value),e,5,[r])};return n.value=t,n.attached=DL(),n}function HL(t,e){if($e(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(r=>o=>!o._stopped&&r&&r(o))}else return e}const C5=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,BL=(t,e,n,r,o,s)=>{const i=o==="svg";e==="class"?TL(t,r,i):e==="style"?OL(t,n,r):Ff(e)?uw(e)||LL(t,e,n,r,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):FL(t,e,r,i))?(w5(t,e,r),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&b5(t,e,r,i,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!Lt(r))?w5(t,lo(e),r,s,e):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),b5(t,e,r,i))};function FL(t,e,n,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in t&&C5(e)&&ze(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const o=t.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return C5(e)&&Lt(n)?!1:e in t}const JT=new WeakMap,YT=new WeakMap,Zp=Symbol("_moveCb"),_5=Symbol("_enterCb"),jL=t=>(delete t.props.mode,t),zL=jL({name:"TransitionGroup",props:Xt({},UT,{tag:String,moveClass:String}),setup(t,{slots:e}){const n=go(),r=sT();let o,s;return Mw(()=>{if(!o.length)return;const i=t.moveClass||`${t.name||"v"}-move`;if(!KL(o[0].el,n.vnode.el,i)){o=[];return}o.forEach(UL),o.forEach(qL);const a=o.filter(WL);q1(n.vnode.el),a.forEach(l=>{const c=l.el,u=c.style;qo(c,i),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[Zp]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[Zp]=null,wi(c,i))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const i=ut(t),a=WT(i);let l=i.tag||ce;if(o=[],s)for(let c=0;c<s.length;c++){const u=s[c];u.el&&u.el instanceof Element&&(o.push(u),sa(u,af(u,a,r,n)),JT.set(u,{left:u.el.offsetLeft,top:u.el.offsetTop}))}s=e.default?Cw(e.default()):[];for(let c=0;c<s.length;c++){const u=s[c];u.key!=null&&sa(u,af(u,a,r,n))}return Z(l,null,s)}}}),VL=zL;function UL(t){const e=t.el;e[Zp]&&e[Zp](),e[_5]&&e[_5]()}function qL(t){YT.set(t,{left:t.el.offsetLeft,top:t.el.offsetTop})}function WL(t){const e=JT.get(t),n=YT.get(t),r=e.left-n.left,o=e.top-n.top;if(r||o){const s=t.el.style;return s.transform=s.webkitTransform=`translate(${r}px,${o}px)`,s.transitionDuration="0s",t}}function KL(t,e,n){const r=t.cloneNode(),o=t[Nc];o&&o.forEach(a=>
4{a.split(/\s+/).forEach(l=>l&&r.classList.remove(l))}),n.split(/\s+/).forEach(a=>a&&r.classList.add(a)),r.style.display="none";const s=e.nodeType===1?e:e.parentNode;s.appendChild(r);const{hasTransform:i}=KT(r);return s.removeChild(r),i}const ia=t=>{const e=t.props["onUpdate:modelValue"]||!1;return $e(e)?n=>fc(e,n):e};function GL(t){t.target.composing=!0}function S5(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const no=Symbol("_assign");function M5(t,e,n){return e&&(t=t.trim()),n&&(t=hg(t)),t}const cn={created(t,{modifiers:{lazy:e,trim:n,number:r}},o){t[no]=ia(o);const s=r||o.props&&o.props.type==="number";Fs(t,e?"change":"input",i=>{i.target.composing||t[no](M5(t.value,n,s))}),(n||s)&&Fs(t,"change",()=>{t.value=M5(t.value,n,s)}),e||(Fs(t,"compositionstart",GL),Fs(t,"compositionend",S5),Fs(t,"change",S5))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:r,trim:o,number:s}},i){if(t[no]=ia(i),t.composing)return;const a=(s||t.type==="number")&&!/^0\d/.test(t.value)?hg(t.value):t.value,l=e??"";a!==l&&(document.activeElement===t&&t.type!=="range"&&(r&&e===n||o&&t.value.trim()===l)||(t.value=l))}},yl={deep:!0,created(t,e,n){t[no]=ia(n),Fs(t,"change",()=>{const r=t._modelValue,o=Lc(t),s=t.checked,i=t[no];if($e(r)){const a=fw(r,o),l=a!==-1;if(s&&!l)i(r.concat(o));else if(!s&&l){const c=[...r];c.splice(a,1),i(c)}}else if(mu(r)){const a=new Set(r);s?a.add(o):a.delete(o),i(a)}else i(XT(t,s))})},mounted:T5,beforeUpdate(t,e,n){t[no]=ia(n),T5(t,e,n)}};function T5(t,{value:e,oldValue:n},r){t._modelValue=e;let o;if($e(e))o=fw(e,r.props.value)>-1;else if(mu(e))o=e.has(r.props.value);else{if(e===n)return;o=hl(e,XT(t,!0))}t.checked!==o&&(t.checked=o)}const zs={created(t,{value:e},n){t.checked=hl(e,n.props.value),t[no]=ia(n),Fs(t,"change",()=>{t[no](Lc(t))})},beforeUpdate(t,{value:e,oldValue:n},r){t[no]=ia(r),e!==n&&(t.checked=hl(e,r.props.value))}},co={deep:!0,created(t,{value:e,modifiers:{number:n}},r){const o=mu(e);Fs(t,"change",()=>{const s=Array.prototype.filter.call(t.options,i=>i.selected).map(i=>n?hg(Lc(i)):Lc(i));t[no](t.multiple?o?new Set(s):s:s[0]),t._assigning=!0,mn(()=>{t._assigning=!1})}),t[no]=ia(r)},mounted(t,{value:e}){E5(t,e)},beforeUpdate(t,e,n){t[no]=ia(n)},updated(t,{value:e}){t._assigning||E5(t,e)}};function E5(t,e){const n=t.multiple,r=$e(e);if(!(n&&!r&&!mu(e))){for(let o=0,s=t.options.length;o<s;o++){const i=t.options[o],a=Lc(i);if(n)if(r){const l=typeof a;l==="string"||l==="number"?i.selected=e.some(c=>String(c)===String(a)):i.selected=fw(e,a)>-1}else i.selected=e.has(a);else if(hl(Lc(i),e)){t.selectedIndex!==o&&(t.selectedIndex=o);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Lc(t){return"_value"in t?t._value:t.value}function XT(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const ZT={created(t,e,n){Mh(t,e,n,null,"created")},mounted(t,e,n){Mh(t,e,n,null,"mounted")},beforeUpdate(t,e,n,r){Mh(t,e,n,r,"beforeUpdate")},updated(t,e,n,r){Mh(t,e,n,r,"updated")}};function JL(t,e){switch(t){case"SELECT":return co;case"TEXTAREA":return cn;default:switch(e){case"checkbox":return yl;case"radio":return zs;default:return cn}}}function Mh(t,e,n,r,o){const i=JL(t.tagName,n.props&&n.props.type)[o];i&&i(t,e,n,r)}const YL=["ctrl","shift","alt","meta"],XL={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>YL.some(n=>t[`${n}Key`]&&!e.includes(n))},nt=(t,e)=>{const n=t._withMods||(t._withMods={}),r=e.join(".");return n[r]||(n[r]=((o,...s)=>{for(let i=0;i<e.length;i++){const a=XL[e[i]];if(a&&a(o,e))return}return t(o,...s)}))},QT=Xt({patchProp:BL},CL);let Td,A5=!1;function ZL(){return Td||(Td=tL(QT))}function QL(){return Td=A5?Td:nL(QT),A5=!0,Td}const eR=((...t)=>{const e=ZL().createApp(...t),{mount:n}=e;return e.mount=r=>{const o=t3(r);if(!o)return;const s=e._component;!ze(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,e3(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},e}),tR=((...t)=>{const e=QL().createApp(...t),{mount:n}=e;return e.mount=r=>{const o=t3(r);if(o)return n(o,!0,e3(o))},e});function e3(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function t3(t){return Lt(t)?document.querySelector(t):t}const nR=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,rR=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,oR=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function sR(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){iR(t);return}return e}function iR(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function Qp(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const n=t.trim();if(n.length<=9)switch(n.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!oR.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(nR.test(t)||rR.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,sR)}return JSON.parse(t)}catch(r){if(e.strict)throw r;return t}}const aR=/#/g,lR=/&/g,cR=/\//g,uR=/=/g,Nw=/\+/g,dR=/%5e/gi,fR=/%60/gi,hR=/%7c/gi,pR=/%20/gi;function mR(t){return encodeURI(""+t).replace(hR,"|")}function W1(t){return mR(typeof t=="string"?t:JSON.stringify(t)).replace(Nw,"%2B").replace(pR,"+").replace(aR,"%23").replace(lR,"%26").replace(fR,"`").replace(dR,"^").replace(cR,"%2F")}function F0(t){return W1(t).replace(uR,"%3D")}function em(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function gR(t){return em(t.replace(Nw," "))}function yR(t){return em(t.replace(Nw," "))}function Lw(t=""){const e=Object.create(null);t[0]==="?"&&(t=t.slice(1));for(const n of t.split("&")){const r=n.match(/([^=]+)=?(.*)/)||[];if(r.length<2)continue;const o=gR(r[1]);if(o==="__proto__"||o==="constructor")continue;const s=yR(r[2]||"");e[o]===void 0?e[o]=s:Array.isArray(e[o])?e[o].push(s):e[o]=[e[o],s]}return e}function vR(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(n=>`${F0(t)}=${W1(n)}`).join("&"):`${F0(t)}=${W1(e)}`:F0(t)}function bR(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>
4vR(e,t[e])).filter(Boolean).join("&")}const wR=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,n3=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,kR=/^([/\\]\s*){2,}[^/\\]/,xR=/^[\s\0]*(blob|data|javascript|vbscript):$/i,CR=/\/$|\/\?|\/#/,_R=/^\.?\//;function xs(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?wR.test(t):n3.test(t)||(e.acceptRelative?kR.test(t):!1)}function SR(t){return!!t&&xR.test(t)}function K1(t="",e){return e?CR.test(t):t.endsWith("/")}function uf(t="",e){if(!e)return(K1(t)?t.slice(0,-1):t)||"/";if(!K1(t,!0))return t||"/";let n=t,r="";const o=t.indexOf("#");o!==-1&&(n=t.slice(0,o),r=t.slice(o));const[s,...i]=n.split("?");return((s.endsWith("/")?s.slice(0,-1):s)||"/")+(i.length>0?`?${i.join("?")}`:"")+r}function r3(t="",e){if(!e)return t.endsWith("/")?t:t+"/";if(K1(t,!0))return t||"/";let n=t,r="";const o=t.indexOf("#");if(o!==-1&&(n=t.slice(0,o),r=t.slice(o),!n))return r;const[s,...i]=n.split("?");return s+"/"+(i.length>0?`?${i.join("?")}`:"")+r}function MR(t,e){if(s3(e)||xs(t))return t;const n=uf(e);if(t.startsWith(n)){const r=t[n.length];if(!r||r==="/"||r==="?")return t}return Cg(n,t)}function O5(t,e){if(s3(e))return t;const n=uf(e);if(!t.startsWith(n))return t;const r=t[n.length];if(r&&r!=="/"&&r!=="?")return t;const o=t.slice(n.length);return o[0]==="/"?o:"/"+o}function o3(t,e){const n=l3(t),r={...Lw(n.search),...e};return n.search=bR(r),IR(n)}function s3(t){return!t||t==="/"}function TR(t){return t&&t!=="/"}function Cg(t,...e){let n=t||"";for(const r of e.filter(o=>TR(o)))if(n){const o=r.replace(_R,"");n=r3(n)+o}else n=r;return n}function i3(...t){const e=/\/(?!\/)/,n=t.filter(Boolean),r=[];let o=0;for(const i of n)if(!(!i||i==="/")){for(const[a,l]of i.split(e).entries())if(!(!l||l===".")){if(l===".."){if(r.length===1&&xs(r[0]))continue;r.pop(),o--;continue}if(a===1&&r[r.length-1]?.endsWith(":/")){r[r.length-1]+="/"+l;continue}r.push(l),o++}}let s=r.join("/");return o>=0?n[0]?.startsWith("/")&&!s.startsWith("/")?s="/"+s:n[0]?.startsWith("./")&&!s.startsWith("./")&&(s="./"+s):s="../".repeat(-1*o)+s,n[n.length-1]?.endsWith("/")&&!s.endsWith("/")&&(s+="/"),s}function ER(t){return AR(t,"https://")}function AR(t,e){let n=t.match(n3);return n||(n=t.match(/^\/{2,}/)),n?e+t.slice(n[0].length):e+t}function OR(t,e){return em(uf(t))===em(uf(e))}const a3=Symbol.for("ufo:protocolRelative");function l3(t="",e){const n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){const[,d,f=""]=n;return{protocol:d.toLowerCase(),pathname:f,href:d+f,auth:"",host:"",search:"",hash:""}}if(!xs(t,{acceptRelative:!0}))return I5(t);const[,r="",o,s=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,i="",a=""]=s.match(/([^#/?]*)(.*)?/)||[];r==="file:"&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:l,search:c,hash:u}=I5(a);return{protocol:r.toLowerCase(),auth:o?o.slice(0,Math.max(0,o.length-1)):"",host:i,pathname:l,search:c,hash:u,[a3]:!r}}function I5(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}function IR(t){const e=t.pathname||"",n=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",r=t.hash||"",o=t.auth?t.auth+"@":"",s=t.host||"";return(t.protocol||t[a3]?(t.protocol||"")+"//":"")+o+s+e+n+r}class NR extends Error{constructor(e,n){super(e,n),this.name="FetchError",n?.cause&&!this.cause&&(this.cause=n.cause)}}function LR(t){const e=t.error?.message||t.error?.toString()||"",n=t.request?.method||t.options?.method||"GET",r=t.request?.url||String(t.request)||"/",o=`[${n}] ${JSON.stringify(r)}`,s=t.response?`${t.response.status} ${t.response.statusText}`:"<no response>",i=`${o}: ${s}${e?` ${e}`:""}`,a=new NR(i,t.error?{cause:t.error}:void 0);for(const l of["request","options","response"])Object.defineProperty(a,l,{get(){return t[l]}});for(const[l,c]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(a,l,{get(){return t.response&&t.response[c]}});return a}const RR=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function N5(t="GET"){return RR.has(t.toUpperCase())}function $R(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer||t instanceof FormData||t instanceof URLSearchParams?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const DR=new Set(["image/svg","application/xml","application/xhtml","application/html"]),PR=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function HR(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return PR.test(e)?"json":e==="text/event-stream"?"stream":DR.has(e)||e.startsWith("text/")?"text":"blob"}function BR(t,e,n,r){const o=FR(e?.headers??t?.headers,n?.headers,r);let s;return(n?.query||n?.params||e?.params||e?.query)&&(s={...n?.params,...n?.query,...e?.params,...e?.query}),{...n,...e,query:s,params:s,headers:o}}function FR(t,e,n){if(!e)return new n(t);const r=new n(e);if(t)for(const[o,s]of Symbol.iterator in t||Array.isArray(t)?t:new n(t))r.set(o,s);return r}async function Th(t,e){if(e)if(Array.isArray(e))for(const n of e)await n(t);else await e(t)}const jR=new Set([408,409,425,429,500,502,503,504]),zR=new Set([101,204,205,304]);function c3(t={}){const{fetch:e=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=t;async function o(a){const l=a.error&&a.error.name==="AbortError"&&!a.options.timeout||!1;if(a.options.retry!==!1&&!l){let u;typeof a.options.retry=="number"?u=a.options.retry:u=N5(a.options.method)?0:1;const d=a.response&&a.response.status||500;if(u>0&&(Array.isArray(a.options.retryStatusCodes)?a.options.retryStatusCodes.includes(d):jR.has(d))){const f=typeof a.options.retryDelay=="function"?a.options.retryDelay(a):a.options.retryDelay||0;return f>0&&await new Promise(h=>setTimeout(h,f)),s(a.request,{...a.options,retry:u-1})}}const c=LR(a);throw Error.captureStackTrace&&Error.captureStackTrace(c,s),c}const s=async function(l,c={}){const u={request:l,options:BR(l,c,t.defaults,n),response:void 0,error:void 0};if(u.options.method&&(u.options.method=u.options.method.toUpperCase()),u.options.onRequest&&(await Th(u,u.options.onRequest),u.options.headers instanceof n||(u.options.headers=new n(u.options.headers||{}))),typeof u.request=="string"&&(u.options.baseURL&&(u.request=MR(u.request,u.options.baseURL)),u.options.query&&(u.request=o3(u.request,u.options.query),delete u.options.query),"query"in u.options&&delete u.options.query,"params"in u.options&&delete u.options.params),u.options.body&&N5(u.options.method))if($R(u.options.body)){const h=u.options.headers.get("content-type");typeof u.options.body!="string"&&(u.options.body=h==="application/x-www-form-urlencoded"?new URLSearchParams(u.options.body).toString():JSON.stringify(u.options.body)),h||u.options.headers.set("content-type","application/json"),u.o
4ptions.headers.has("accept")||u.options.headers.set("accept","application/json")}else("pipeTo"in u.options.body&&typeof u.options.body.pipeTo=="function"||typeof u.options.body.pipe=="function")&&("duplex"in u.options||(u.options.duplex="half"));let d;if(!u.options.signal&&u.options.timeout){const h=new r;d=setTimeout(()=>{const p=new Error("[TimeoutError]: The operation was aborted due to timeout");p.name="TimeoutError",p.code=23,h.abort(p)},u.options.timeout),u.options.signal=h.signal}try{u.response=await e(u.request,u.options)}catch(h){return u.error=h,u.options.onRequestError&&await Th(u,u.options.onRequestError),await o(u)}finally{d&&clearTimeout(d)}if((u.response.body||u.response._bodyInit)&&!zR.has(u.response.status)&&u.options.method!=="HEAD"){const h=(u.options.parseResponse?"json":u.options.responseType)||HR(u.response.headers.get("content-type")||"");switch(h){case"json":{const p=await u.response.text(),g=u.options.parseResponse||Qp;u.response._data=g(p);break}case"stream":{u.response._data=u.response.body||u.response._bodyInit;break}default:u.response._data=await u.response[h]()}}return u.options.onResponse&&await Th(u,u.options.onResponse),!u.options.ignoreResponseError&&u.response.status>=400&&u.response.status<600?(u.options.onResponseError&&await Th(u,u.options.onResponseError),await o(u)):u.response},i=async function(l,c){return(await s(l,c))._data};return i.raw=s,i.native=(...a)=>e(...a),i.create=(a={},l={})=>c3({...t,...l,defaults:{...t.defaults,...l.defaults,...a}}),i}const tm=(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")})(),VR=tm.fetch?(...t)=>tm.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),UR=tm.Headers,qR=tm.AbortController,WR=c3({fetch:VR,Headers:UR,AbortController:qR}),KR=WR,GR=()=>window?.__NUXT__?.config||{},Rw=()=>GR().app,JR=()=>Rw().baseURL,YR=()=>Rw().buildAssetsDir,$w=(...t)=>i3(u3(),YR(),...t),u3=(...t)=>{const e=Rw(),n=e.cdnURL||e.baseURL;return t.length?i3(n,...t):n};globalThis.__buildAssetsURL=$w,globalThis.__publicAssetsURL=u3;globalThis.$fetch||(globalThis.$fetch=KR.create({baseURL:JR()}));"global"in globalThis||(globalThis.global=globalThis);function G1(t,e={},n){for(const r in t){const o=t[r],s=n?`${n}:${r}`:r;typeof o=="object"&&o!==null?G1(o,e,s):typeof o=="function"&&(e[s]=o)}return e}const XR={run:t=>t()},ZR=()=>XR,d3=typeof console.createTask<"u"?console.createTask:ZR;function QR(t,e){const n=e.shift(),r=d3(n);return t.reduce((o,s)=>o.then(()=>r.run(()=>s(...e))),Promise.resolve())}function e$(t,e){const n=e.shift(),r=d3(n);return Promise.all(t.map(o=>r.run(()=>o(...e))))}function j0(t,e){for(const n of[...t])n(e)}let t$=class{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,n,r={}){if(!e||typeof n!="function")return()=>{};const o=e;let s;for(;this._deprecatedHooks[e];)s=this._deprecatedHooks[e],e=s.to;if(s&&!r.allowDeprecated){let i=s.message;i||(i=`${o} hook has been deprecated`+(s.to?`, please use ${s.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!n.name)try{Object.defineProperty(n,"name",{get:()=>"_"+e.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(n),()=>{n&&(this.removeHook(e,n),n=void 0)}}hookOnce(e,n){let r,o=(...s)=>(typeof r=="function"&&r(),r=void 0,o=void 0,n(...s));return r=this.hook(e,o),r}removeHook(e,n){if(this._hooks[e]){const r=this._hooks[e].indexOf(n);r!==-1&&this._hooks[e].splice(r,1),this._hooks[e].length===0&&delete this._hooks[e]}}deprecateHook(e,n){this._deprecatedHooks[e]=typeof n=="string"?{to:n}:n;const r=this._hooks[e]||[];delete this._hooks[e];for(const o of r)this.hook(e,o)}deprecateHooks(e){Object.assign(this._deprecatedHooks,e);for(const n in e)this.deprecateHook(n,e[n])}addHooks(e){const n=G1(e),r=Object.keys(n).map(o=>this.hook(o,n[o]));return()=>{for(const o of r.splice(0,r.length))o()}}removeHooks(e){const n=G1(e);for(const r in n)this.removeHook(r,n[r])}removeAllHooks(){for(const e in this._hooks)delete this._hooks[e]}callHook(e,...n){return n.unshift(e),this.callHookWith(QR,e,...n)}callHookParallel(e,...n){return n.unshift(e),this.callHookWith(e$,e,...n)}callHookWith(e,n,...r){const o=this._before||this._after?{name:n,args:r,context:{}}:void 0;this._before&&j0(this._before,o);const s=e(n in this._hooks?[...this._hooks[n]]:[],r);return s instanceof Promise?s.finally(()=>{this._after&&o&&j0(this._after,o)}):(this._after&&o&&j0(this._after,o),s)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){const n=this._before.indexOf(e);n!==-1&&this._before.splice(n,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){const n=this._after.indexOf(e);n!==-1&&this._after.splice(n,1)}}}};function n$(){return new t$}function r$(t={}){let e,n=!1;const r=i=>{if(e&&e!==i)throw new Error("Context conflict")};let o;if(t.asyncContext){const i=t.AsyncLocalStorage||globalThis.AsyncLocalStorage;i?o=new i:console.warn("[unctx] `AsyncLocalStorage` is not provided.")}const s=()=>
4{if(o){const i=o.getStore();if(i!==void 0)return i}return e};return{use:()=>{const i=s();if(i===void 0)throw new Error("Context is not available");return i},tryUse:()=>s(),set:(i,a)=>{a||r(i),e=i,n=!0},unset:()=>{e=void 0,n=!1},call:(i,a)=>{r(i),e=i;try{return o?o.run(i,a):a()}finally{n||(e=void 0)}},async callAsync(i,a){e=i;const l=()=>{e=i},c=()=>e===i?l:void 0;J1.add(c);try{const u=o?o.run(i,a):a();return n||(e=void 0),await u}finally{J1.delete(c)}}}}function o$(t={}){const e={};return{get(n,r={}){return e[n]||(e[n]=r$({...t,...r})),e[n]}}}const nm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:typeof window<"u"?window:{},L5="__unctx__",s$=nm[L5]||(nm[L5]=o$()),i$=(t,e={})=>s$.get(t,e),R5="__unctx_async_handlers__",J1=nm[R5]||(nm[R5]=new Set);function Za(t){const e=[];for(const o of J1){const s=o();s&&e.push(s)}const n=()=>{for(const o of e)o()};let r=t();return r&&typeof r=="object"&&"catch"in r&&(r=r.catch(o=>{throw n(),o})),[r,n]}const $5={name:"page",mode:"out-in"},a$=!1,l$=!1,c$={componentName:"NuxtLink",prefetch:!0,prefetchOn:{visibility:!0}},vTe={value:null,errorValue:null,deep:!0},u$=null,bTe={},d$="#__nuxt",f3="nuxt-app",D5=36e5,f$="vite:preloadError";function h3(t=f3){return i$(t,{asyncContext:!1})}const h$="__nuxt_plugin";function p$(t){let e=0;const n={_id:t.id||f3||"nuxt-app",_scope:hw(),provide:void 0,globalName:"nuxt",versions:{get nuxt(){return"3.20.2"},get vue(){return n.vueApp.version}},payload:es({...t.ssrContext?.payload||{},data:es({}),state:or({}),once:new Set,_errors:es({})}),static:{data:{}},runWithContext(o){return n._scope.active&&!mg()?n._scope.run(()=>P5(n,o)):P5(n,o)},isHydrating:!0,deferHydration(){if(!n.isHydrating)return()=>{};e++;let o=!1;return()=>{if(!o&&(o=!0,e--,e===0))return n.isHydrating=!1,n.callHook("app:suspense:resolve")}},_asyncDataPromises:{},_asyncData:es({}),_payloadRevivers:{},...t};{const o=window.__NUXT__;if(o)for(const s in o)switch(s){case"data":case"state":case"_errors":Object.assign(n.payload[s],o[s]);break;default:n.payload[s]=o[s]}}n.hooks=n$(),n.hook=n.hooks.hook,n.callHook=n.hooks.callHook,n.provide=(o,s)=>{const i="$"+o;Eh(n,i,s),Eh(n.vueApp.config.globalProperties,i,s)},Eh(n.vueApp,"$nuxt",n),Eh(n.vueApp.config.globalProperties,"$nuxt",n);{window.addEventListener(f$,s=>{n.callHook("app:chunkError",{error:s.payload}),s.payload.message.includes("Unable to preload CSS")&&s.preventDefault()}),window.useNuxtApp||=vt;const o=n.hook("app:error",(...s)=>{console.error("[nuxt] error caught during app initialization",...s)});n.hook("app:mounted",o)}const r=n.payload.config;return n.provide("config",r),n}function m$(t,e){e.hooks&&t.hooks.addHooks(e.hooks)}async function g$(t,e){if(typeof e=="function"){const{provide:n}=await t.runWithContext(()=>e(t))||{};if(n&&typeof n=="object")for(const r in n)t.provide(r,n[r])}}async function y$(t,e){const n=new Set,r=[],o=[];let s,i=0;async function a(l){const c=l.dependsOn?.filter(u=>e.some(d=>d._name===u)&&!n.has(u))??[];if(c.length>0)r.push([new Set(c),l]);else{const u=g$(t,l).then(async()=>{l._name&&(n.add(l._name),await Promise.all(r.map(async([d,f])=>{d.has(l._name)&&(d.delete(l._name),d.size===0&&(i++,await a(f)))})))}).catch(d=>{if(!l.parallel&&!t.payload.error)throw d;s||=d});l.parallel?o.push(u):await u}}for(const l of e)m$(t,l);for(const l of e)await a(l);if(await Promise.all(o),i)for(let l=0;l<i;l++)await Promise.all(o);if(s)throw t.payload.error||s}function In(t){if(typeof t=="function")return t;const e=t._name||t.name;return delete t.name,Object.assign(t.setup||(()=>{}),t,{[h$]:!0,_name:e})}const v$=In;function P5(t,e,n){const r=()=>e();return h3(t._id).set(t),t.vueApp.runWithContext(r)}function p3(t){let e;return Vf()&&(e=go()?.appContext.app.$nuxt),e||=h3(t).tryUse(),e||null}function vt(t){const e=p3(t);if(!e)throw new Error("[nuxt] instance unavailable");return e}function yo(t){return vt().$config}function Eh(t,e,n){Object.defineProperty(t,e,{get:()=>n})}function b$(t,e){return{ctx:{table:t},matchAll:n=>g3(n,t)}}function m3(t){const e={};for(const n in t)e[n]=n==="dynamic"?new Map(Object.entries(t[n]).map(([r,o])=>[r,m3(o)])):new Map(Object.entries(t[n]));return e}function w$(t){return b$(m3(t))}
4function g3(t,e,n){t.endsWith("/")&&(t=t.slice(0,-1)||"/");const r=[];for(const[s,i]of H5(e.wildcard))(t===s||t.startsWith(s+"/"))&&r.push(i);for(const[s,i]of H5(e.dynamic))if(t.startsWith(s+"/")){const a="/"+t.slice(s.length).split("/").splice(2).join("/");r.push(...g3(a,i))}const o=e.static.get(t);return o&&r.push(o),r.filter(Boolean)}function H5(t){return[...t.entries()].sort((e,n)=>e[0].length-n[0].length)}function z0(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Y1(t,e,n=".",r){if(!z0(e))return Y1(t,{},n,r);const o=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const i=t[s];i!=null&&(r&&r(o,s,i,n)||(Array.isArray(i)&&Array.isArray(o[s])?o[s]=[...i,...o[s]]:z0(i)&&z0(o[s])?o[s]=Y1(i,o[s],(n?`${n}.`:"")+s.toString(),r):o[s]=i))}return o}function k$(t){return(...e)=>e.reduce((n,r)=>Y1(n,r,"",t),{})}const y3=k$();function x$(t,e){try{return e in t}catch{return!1}}class B5 extends Error{static __h3_error__=!0;statusCode=500;fatal=!1;unhandled=!1;statusMessage;data;cause;constructor(e,n={}){super(e,n),n.cause&&!this.cause&&(this.cause=n.cause)}toJSON(){const e={message:this.message,statusCode:X1(this.statusCode,500)};return this.statusMessage&&(e.statusMessage=v3(this.statusMessage)),this.data!==void 0&&(e.data=this.data),e}}function C$(t){if(typeof t=="string")return new B5(t);if(_$(t))return t;const e=new B5(t.message??t.statusMessage??"",{cause:t.cause||t});if(x$(t,"stack"))try{Object.defineProperty(e,"stack",{get(){return t.stack}})}catch{try{e.stack=t.stack}catch{}}if(t.data&&(e.data=t.data),t.statusCode?e.statusCode=X1(t.statusCode,e.statusCode):t.status&&(e.statusCode=X1(t.status,e.statusCode)),t.statusMessage?e.statusMessage=t.statusMessage:t.statusText&&(e.statusMessage=t.statusText),e.statusMessage){const n=e.statusMessage;v3(e.statusMessage)!==n&&console.warn("[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default.")}return t.fatal!==void 0&&(e.fatal=t.fatal),t.unhandled!==void 0&&(e.unhandled=t.unhandled),e}function _$(t){return t?.constructor?.__h3_error__===!0}const S$=/[^\u0009\u0020-\u007E]/g;function v3(t=""){return t.replace(S$,"")}function X1(t,e=200){return!t||(typeof t=="string"&&(t=Number.parseInt(t,10)),t<100||t>999)?e:t}const b3=Symbol("layout-meta"),vl=Symbol("route");import.meta.url.replace(/\/app\/.*$/,"/");const gn=()=>vt()?.$router,Cs=()=>Vf()?un(vl,vt()._route):vt()._route;const M$=()=>{try{if(vt()._processingMiddleware)return!0}catch{return!1}return!1},Rc=(t,e)=>{t||="/";const n=typeof t=="string"?t:"path"in t?Z1(t):gn().resolve(t).href;if(e?.open){const{target:l="_blank",windowFeatures:c={}}=e.open,u=[];for(const[d,f]of Object.entries(c))f!==void 0&&u.push(`${d.toLowerCase()}=${f}`);return open(n,l,u.join(", ")),Promise.resolve()}const r=xs(n,{acceptRelative:!0}),o=e?.external||r;if(o){if(!e?.external)throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");const{protocol:l}=new URL(n,window.location.href);if(l&&SR(l))throw new Error(`Cannot navigate to a URL with '${l}' protocol.`)}const s=M$();if(!o&&s){if(e?.replace){if(typeof t=="string"){const{pathname:l,search:c,hash:u}=l3(t);return{path:l,...c&&{query:Lw(c)},...u&&{hash:u},replace:!0}}return{...t,replace:!0}}return t}const i=gn(),a=vt();return o?(a._scope.stop(),e?.replace?location.replace(n):location.href=n,s?a.isHydrating?new Promise(()=>{}):!1:Promise.resolve()):e?.replace?i.replace(t):i.push(t)};function Z1(t){return o3(t.path||"",t.query||{})+(t.hash||"")}const w3="__nuxt_error",_g=()=>GM(vt().payload,"error"),Oa=t=>{const e=Qa(t);try{const n=_g();vt().hooks.callHook("app:error",e),n.value||=e}catch{throw e}return e},k3=async(t={})=>{const e=vt(),n=_g();e.callHook("app:error:cleared",t),t.redirect&&await gn().replace(t.redirect),n.value=u$},x3=t=>!!t&&typeof t=="object"&&w3 in t,Qa=t=>{const e=C$(t);return Object.defineProperty(e,w3,{value:!0,configurable:!1,writable:!1}),e};let C3;const qf=t=>C3=t,_3=Symbol();function Q1(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var Ed;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(Ed||(Ed={}));function T$(){const t=hw(!0),e=t.run(()=>pe({}));let n=[],r=[];const o=jf({install(s){qf(o),o._a=s,s.provide(_3,o),s.config.globalProperties.$pinia=o,r.forEach(i=>
4n.push(i)),r=[]},use(s){return this._a?n.push(s):r.push(s),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return o}const S3=()=>{};function F5(t,e,n,r=S3){t.add(e);const o=()=>{t.delete(e)&&r()};return!n&&mg()&&AM(o),o}function Hl(t,...e){t.forEach(n=>{n(...e)})}const E$=t=>t(),j5=Symbol(),V0=Symbol();function ev(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,r)=>t.set(r,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n],o=t[n];Q1(o)&&Q1(r)&&t.hasOwnProperty(n)&&!kt(r)&&!is(r)?t[n]=ev(o,r):t[n]=r}return t}const A$=Symbol();function O$(t){return!Q1(t)||!Object.prototype.hasOwnProperty.call(t,A$)}const{assign:ki}=Object;function I$(t){return!!(kt(t)&&t.effect)}function N$(t,e,n,r){const{state:o,actions:s,getters:i}=e,a=n.state.value[t];let l;function c(){a||(n.state.value[t]=o?o():{});const u=sN(n.state.value[t]);return ki(u,s,Object.keys(i||{}).reduce((d,f)=>(d[f]=jf(U(()=>{qf(n);const h=n._s.get(t);return i[f].call(h,h)})),d),{}))}return l=M3(t,c,e,n,r,!0),l}function M3(t,e,n={},r,o,s){let i;const a=ki({actions:{}},n),l={deep:!0};let c,u,d=new Set,f=new Set,h;const p=r.state.value[t];!s&&!p&&(r.state.value[t]={});let g;function y(T){let A;c=u=!1,typeof T=="function"?(T(r.state.value[t]),A={type:Ed.patchFunction,storeId:t,events:h}):(ev(r.state.value[t],T),A={type:Ed.patchObject,payload:T,storeId:t,events:h});const N=g=Symbol();mn().then(()=>{g===N&&(c=!0)}),u=!0,Hl(d,A,r.state.value[t])}const w=s?function(){const{state:A}=n,N=A?A():{};this.$patch(D=>{ki(D,N)})}:S3;function x(){i.stop(),d.clear(),f.clear(),r._s.delete(t)}const C=(T,A="")=>{if(j5 in T)return T[V0]=A,T;const N=function(){qf(r);const D=Array.from(arguments),$=new Set,W=new Set;function me(Y){$.add(Y)}function V(Y){W.add(Y)}Hl(f,{args:D,name:N[V0],store:S,after:me,onError:V});let B;try{B=T.apply(this&&this.$id===t?this:S,D)}catch(Y){throw Hl(W,Y),Y}return B instanceof Promise?B.then(Y=>(Hl($,Y),Y)).catch(Y=>(Hl(W,Y),Promise.reject(Y))):(Hl($,B),B)};return N[j5]=!0,N[V0]=A,N},v={_p:r,$id:t,$onAction:F5.bind(null,f),$patch:y,$reset:w,$subscribe(T,A={}){const N=F5(d,T,A.detached,()=>D()),D=i.run(()=>Ye(()=>r.state.value[t],$=>{(A.flush==="sync"?u:c)&&T({storeId:t,type:Ed.direct,events:h},$)},ki({},l,A)));return N},$dispose:x},S=or(v);r._s.set(t,S);const M=(r._a&&r._a.runWithContext||E$)(()=>r._e.run(()=>(i=hw()).run(()=>e({action:C}))));for(const T in M){const A=M[T];if(kt(A)&&!I$(A)||is(A))s||(p&&O$(A)&&(kt(A)?A.value=p[T]:ev(A,p[T])),r.state.value[t][T]=A);else if(typeof A=="function"){const N=C(A,T);M[T]=N,a.actions[T]=A}}return ki(S,M),ki(ut(S),M),Object.defineProperty(S,"$state",{get:()=>r.state.value[t],set:T=>{y(A=>{ki(A,T)})}}),r._p.forEach(T=>{ki(S,i.run(()=>T({store:S,app:r._a,pinia:r,options:a})))}),p&&s&&n.hydrate&&n.hydrate(S.$state,p),c=!0,u=!0,S}function dr(t,e,n){let r;const o=typeof e=="function";r=o?n:e;function s(i,a){const l=Vf();return i=i||(l?un(_3,null):null),i&&qf(i),i=C3,i._s.has(t)||(o?M3(t,e,r,i):N$(t,r,i)),i._s.get(t)}return s.$id=t,s}function L$(t){const e=$$(t),n=new ArrayBuffer(e.length),r=new DataView(n);for(let o=0;o<n.byteLength;o++)r.setUint8(o,e.charCodeAt(o));return n}const R$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function $$(t){t.length%4===0&&(t=t.replace(/==?$/,""));let e="",n=0,r=0;for(let o=0;o<t.length;o++)n<<=6,n|=R$.indexOf(t[o]),r+=6,r===24&&(e+=String.fromCharCode((n&16711680)>>16),e+=String.fromCharCode((n&65280)>>8),e+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,e+=String.fromCharCode(n)):r===18&&(n>>=2,e+=String.fromCharCode((n&65280)>>8),e+=String.fromCharCode(n&255)),e}const D$=-1,P$=-2,H$=-3,B$=-4,F$=-5,j$=-6,z$=-7;function V$(t,e){return U$(JSON.parse(t),e)}function U$(t,e){if(typeof t=="number")return s(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const n=t,r=Array(n.length);let o=null;function s(i,a=!1){if(i===D$)return;if(i===H$)return NaN;if(i===B$)return 1/0;if(i===F$)return-1/0;if(i===j$)return-0;if(a||typeof i!="number")throw new Error("Invalid input");if(i in r)return r[i];const l=n[i];if(!l||typeof l!="object")r[i]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const c=l[0],u=e&&Object.hasOwn(e,c)?e[c]:void 0;if(u){let d=l[1];
4if(typeof d!="number"&&(d=n.push(l[1])-1),o??=new Set,o.has(d))throw new Error("Invalid circular reference");return o.add(d),r[i]=u(s(d)),o.delete(d),r[i]}switch(c){case"Date":r[i]=new Date(l[1]);break;case"Set":const d=new Set;r[i]=d;for(let g=1;g<l.length;g+=1)d.add(s(l[g]));break;case"Map":const f=new Map;r[i]=f;for(let g=1;g<l.length;g+=2)f.set(s(l[g]),s(l[g+1]));break;case"RegExp":r[i]=new RegExp(l[1],l[2]);break;case"Object":const h=Object(l[1]);if(Object.hasOwn(h,"__proto__"))throw new Error("Cannot parse an object with a `__proto__` property");r[i]=h;break;case"BigInt":r[i]=BigInt(l[1]);break;case"null":const p=Object.create(null);r[i]=p;for(let g=1;g<l.length;g+=2){if(l[g]==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");p[l[g]]=s(l[g+1])}break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{if(n[l[1]][0]!=="ArrayBuffer")throw new Error("Invalid data");const g=globalThis[c],y=s(l[1]),w=new g(y);r[i]=l[2]!==void 0?w.subarray(l[2],l[3]):w;break}case"ArrayBuffer":{const g=l[1];if(typeof g!="string")throw new Error("Invalid ArrayBuffer encoding");const y=L$(g);r[i]=y;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const g=c.slice(9);r[i]=Temporal[g].from(l[1]);break}case"URL":{const g=new URL(l[1]);r[i]=g;break}case"URLSearchParams":{const g=new URLSearchParams(l[1]);r[i]=g;break}default:throw new Error(`Unknown type ${c}`)}}else if(l[0]===z$){const c=l[1];if(!Number.isInteger(c)||c<0)throw new Error("Invalid input");const u=new Array(c);r[i]=u;for(let d=2;d<l.length;d+=2){const f=l[d];if(!Number.isInteger(f)||f<0||f>=c)throw new Error("Invalid input");u[f]=s(l[d+1])}}else{const c=new Array(l.length);r[i]=c;for(let u=0;u<l.length;u+=1){const d=l[u];d!==P$&&(c[u]=s(d))}}else{const c={};r[i]=c;
4for(const u of Object.keys(l)){if(u==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const d=l[u];c[u]=s(d)}}return r[i]}return s(0)}const q$=new Set(["link","style","script","noscript"]),W$=new Set(["title","titleTemplate","script","style","noscript"]),tv=new Set(["base","meta","link","style","script","noscript"]),K$=new Set(["title","base","htmlAttrs","bodyAttrs","meta","link","style","script","noscript"]),G$=new Set(["base","title","titleTemplate","bodyAttrs","htmlAttrs","templateParams"]),J$=new Set(["key","tagPosition","tagPriority","tagDuplicateStrategy","innerHTML","textContent","processTemplateParams"]),Y$=new Set(["templateParams","htmlAttrs","bodyAttrs"]),X$=new Set(["theme-color","google-site-verification","og","article","book","profile","twitter","author"]);function nv(t,e={},n){for(const r in t){const o=t[r],s=n?`${n}:${r}`:r;typeof o=="object"&&o!==null?nv(o,e,s):typeof o=="function"&&(e[s]=o)}return e}const T3=(()=>{if(console.createTask)return console.createTask;const t={run:e=>e()};return()=>t})();function E3(t,e,n,r){for(let o=n;o<t.length;o+=1)try{const s=r?r.run(()=>t[o](...e)):t[o](...e);if(s instanceof Promise)return s.then(()=>E3(t,e,o+1,r))}catch(s){return Promise.reject(s)}}function Z$(t,e,n){if(t.length>0)return E3(t,e,0,T3(n))}function Q$(t,e,n){if(t.length>0){const r=T3(n);return Promise.all(t.map(o=>r.run(()=>o(...e))))}}function U0(t,e){for(const n of[...t])n(e)}var eD=class{_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,e,n={}){if(!t||typeof e!="function")return()=>{};const r=t;let o;for(;this._deprecatedHooks[t];)o=this._deprecatedHooks[t],t=o.to;if(o&&!n.allowDeprecated){let s=o.message;s||(s=`${r} hook has been deprecated`+(o.to?`, please use ${o.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(s)||(console.warn(s),this._deprecatedMessages.add(s))}if(!e.name)try{Object.defineProperty(e,"name",{get:()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)}}hookOnce(t,e){let n,r=(...o)=>(typeof n=="function"&&n(),n=void 0,r=void 0,e(...o));return n=this.hook(t,r),n}removeHook(t,e){const n=this._hooks[t];if(n){const r=n.indexOf(e);r!==-1&&n.splice(r,1),n.length===0&&(this._hooks[t]=void 0)}}clearHook(t){this._hooks[t]=void 0}deprecateHook(t,e){this._deprecatedHooks[t]=typeof e=="string"?{to:e}:e;const n=this._hooks[t]||[];this._hooks[t]=void 0;for(const r of n)this.hook(t,r)}deprecateHooks(t){for(const e in t)this.deprecateHook(e,t[e])}addHooks(t){const e=nv(t),n=Object.keys(e).map(r=>this.hook(r,e[r]));return()=>{for(const r of n)r();n.length=0}}removeHooks(t){const e=nv(t);for(const n in e)this.removeHook(n,e[n])}removeAllHooks(){this._hooks={}}callHook(t,...e){return this.callHookWith(Z$,t,e)}callHookParallel(t,...e){return this.callHookWith(Q$,t,e)}callHookWith(t,e,n){const r=this._before||this._after?{name:e,args:n,context:{}}:void 0;this._before&&U0(this._before,r);const o=t(this._hooks[e]?[...this._hooks[e]]:[],n,e);return o instanceof Promise?o.finally(()=>{this._after&&r&&U0(this._after,r)}):(this._after&&r&&U0(this._after,r),o)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const e=this._before.indexOf(t);e!==-1&&this._before.splice(e,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const e=this._after.indexOf(t);e!==-1&&this._after.splice(e,1)}}}};function tD(){return new eD}const nD=["name","property","http-equiv"],rD=new Set(["viewport","description","keywords","robots"]);function A3(t){const e=t.split(":");return e.length?X$.has(e[1]):!1}function rv(t){const{props:e,tag:n}=t;if(G$.has(n))return n;if(n==="link"&&e.rel==="canonical")return"canonical";if(n==="link"&&e.rel==="alternate"){const r=e.hreflang||e.type;if(r)return`alternate:${r}`}if(e.charset)return"charset";if(t.tag==="meta"){for(const r of nD)if(e[r]!==void 0){const o=e[r],s=o&&typeof o=="str
4ing"&&o.includes(":"),i=o&&rD.has(o),l=!(s||i)&&t.key?`:key:${t.key}`:"";return`${n}:${o}${l}`}}if(t.key)return`${n}:key:${t.key}`;if(e.id)return`${n}:id:${e.id}`;if(n==="link"&&e.rel==="alternate")return`alternate:${e.href||""}`;if(W$.has(n)){const r=t.textContent||t.innerHTML;if(r)return`${n}:content:${r}`}}function O3(t){const e=t._h||t._d;if(e)return e;const n=t.textContent||t.innerHTML;return n||`${t.tag}:${Object.entries(t.props).map(([r,o])=>`${r}:${String(o)}`).join(",")}`}function rm(t,e,n){typeof t==="function"&&(!n||n!=="titleTemplate"&&!(n[0]==="o"&&n[1]==="n"))&&(t=t());const o=e?e(n,t):t;if(Array.isArray(o))return o.map(s=>rm(s,e));if(o?.constructor===Object){const s={};for(const i of Object.keys(o))s[i]=rm(o[i],e,i);return s}return o}function oD(t,e){const n=t==="style"?new Map:new Set;function r(o){if(o==null||o===void 0)return;const s=String(o).trim();if(s)if(t==="style"){const[i,...a]=s.split(":").map(l=>l?l.trim():"");i&&a.length&&n.set(i,a.join(":"))}else s.split(" ").filter(Boolean).forEach(i=>n.add(i))}return typeof e=="string"?t==="style"?e.split(";").forEach(r):r(e):Array.isArray(e)?e.forEach(o=>r(o)):e&&typeof e=="object"&&Object.entries(e).forEach(([o,s])=>{s&&s!=="false"&&(t==="style"?n.set(String(o).trim(),String(s)):r(o))}),n}function I3(t,e){if(t.props=t.props||{},!e)return t;if(t.tag==="templateParams")return t.props=e,t;const n=tv.has(t.tag)||t.tag==="htmlAttrs"||t.tag==="bodyAttrs";return Object.entries(e).forEach(([r,o])=>{if(r==="__proto__"||r==="constructor"||r==="prototype")return;if(o===null){t.props[r]=null;return}if(r==="class"||r==="style"){t.props[r]=oD(r,o);return}if(J$.has(r)){if((r==="textContent"||r==="innerHTML")&&typeof o=="object"){let c=e.type;if(e.type||(c="application/json"),!c?.endsWith("json")&&c!=="speculationrules")return;e.type=c,t.props.type=c,t[r]=JSON.stringify(o)}else t[r]=o;return}const s=r.startsWith("data-"),i=n&&!s?r.toLowerCase():r,a=String(o),l=t.tag==="meta"&&i==="content";a==="true"||a===""?t.props[i]=s||l?a:!0:!o&&s&&a==="false"?t.props[i]="false":o!==void 0&&(t.props[i]=o)}),t}function sD(t,e){const n=typeof e=="object"&&typeof e!="function"?e:{[t==="script"||t==="noscript"||t==="style"?"innerHTML":"textContent"]:e},r=I3({tag:t,props:{}},n);return r.key&&q$.has(r.tag)&&(r.props["data-hid"]=r._h=r.key),r.tag==="script"&&typeof r.innerHTML=="object"&&(r.innerHTML=JSON.stringify(r.innerHTML),r.props.type=r.props.type||"application/json"),Array.isArray(r.props.content)?r.props.content.map(o=>({...r,props:{...r.props,content:o}})):r}function iD(t,e){if(!t)return[];typeof t=="function"&&(t=t());const n=(o,s)=>{for(let i=0;i<e.length;i++)s=e[i](o,s);return s};t=n(void 0,t);const r=[];return t=rm(t,n),Object.entries(t||{}).forEach(([o,s])=>{if(s!==void 0)for(const i of Array.isArray(s)?s:[s])r.push(sD(o,i))}),r.flat()}const ov=(t,e)=>t._w===e._w?t._p-e._p:t._w-e._w,z5={base:-10,title:10},aD={critical:-8,high:-1,low:2},V5={meta:{"content-security-policy":-30,charset:-20,viewport:-15},link:{preconnect:20,stylesheet:60,preload:70,modulepreload:70,prefetch:90,"dns-prefetch":90,prerender:90},script:{async:30,defer:80,sync:50},style:{imported:40,sync:60}},lD=/@import/,Bu=t=>t===""||t===!0;function cD(t,e){if(typeof e.tagPriority=="number")return e.tagPriority;let n=100;const r=aD[e.tagPriority]||0,o=t.resolvedOptions.disableCapoSorting?{link:{},script:{},style:{}}:V5;if(e.tag in z5)n=z5[e.tag];else if(e.tag==="meta"){const s=e.props["http-equiv"]==="content-security-policy"?"content-security-policy":e.props.charset?"charset":e.props.name==="viewport"?"viewport":null;s&&(n=V5.meta[s])}else if(e.tag==="link"&&e.props.rel)n=o.link[e.props.rel];else if(e.tag==="script"){const s=String(e.props.type);Bu(e.props.async)?n=o.script.async:e.props.src&&!Bu(e.props.defer)&&!Bu(e.props.async)&&s!=="module"&&!s.endsWith("json")||e.innerHTML&&!s.endsWith("json")?n=o.script.sync:(Bu(e.props.defer)&&e.props.src&&!Bu(e.props.async)||s==="module")&&(n=o.script.defer)}else e.tag==="style"&&(n=e.innerHTML&&lD.test(e.innerHTML)?o.style.imported:o.style.sync);return(n||100)+r}function U5(t,e){const n=typeof e=="function"?e(t):e,r=n.key||String(t.plugins.size+1);t.plugins.get(r)||(t.plugins.set(r,n),t.hooks.addHooks(n.hooks||{}))}function uD(t={}){const e=tD();e.addHooks(t.hooks||{});const n=!t.document,r=new Map,o=new Map,s=new Set,i={_entryCount:1,plugins:o,dirty:!1,resolvedOptions:t,hooks:e,ssr:n,entries:r,headEntries(){return[...r.values()]},use:a=>U5(i,a),push(a,l){const c={...l||{}};delete c.head;const u=c._index??i._entryCount++,d={_i:u,input:a,options:c},f={_poll(h=!1){i.dirty=!0,!h&&s.add(u),e.callHook("entries:updated",i)},dispose(){r.delete(u)&&i.invalidate()},patch(h){(!c.mode||c.mode==="server"&&n||c.mode==="client"&&!n)&&(d.input=h,r.set(u,d),f._poll())}};return f.patch(a),f},async resolveTags(){const a={tagMap:new Map,tags:[],entries:[...i.entries.values()]};for(await e.callHook("entries:resolve",a);s.size;){const f=s.values().next().value;s.delete(f);const h=r.get(f);if(h){const p={tags:iD(h.input,t.propResolvers||[]).map(g=>Object.assign(g,h.options)),entry:h};await e.callHook("entries:normalize",p),h._tags=p.tags.map((g,y)=>(g._w=cD(i,g),g._p=(h._i<<10)+y,g._d=rv(g),g._d||(g._h=O3(g)),g))}}let l=!1;a.entries.flatMap(f=>(f._tags||[]).map(h=>({...h,props:{...h.props}}))).sort(ov).reduce((f,h)=>{const p=h._d||h._h;if(!f.has(p))return f.set(p,h);const g=f.get(p);if((h?.tagDuplicateStrategy||(Y$.has(h.tag)?"merge":null)||(h.key&&h.key===g.key?"merge":null))==="merge"){const w={...g.props};
4Object.entries(h.props).forEach(([x,C])=>w[x]=x==="style"?new Map([...g.props.style||new Map,...C]):x==="class"?new Set([...g.props.class||new Set,...C]):C),f.set(p,{...h,props:w})}else h._p>>10===g._p>>10&&h.tag==="meta"&&A3(p)?(f.set(p,Object.assign([...Array.isArray(g)?g:[g],h],h)),l=!0):(h._w===g._w?h._p>g._p:h?._w<g?._w)&&f.set(p,h);return f},a.tagMap);const c=a.tagMap.get("title"),u=a.tagMap.get("titleTemplate");if(i._title=c?.textContent,u){const f=u?.textContent;if(i._titleTemplate=f,f){let h=typeof f=="function"?f(c?.textContent):f;typeof h=="string"&&!i.plugins.has("template-params")&&(h=h.replace("%s",c?.textContent||"")),c?h===null?a.tagMap.delete("title"):a.tagMap.set("title",{...c,textContent:h}):(u.tag="title",u.textContent=h)}}a.tags=Array.from(a.tagMap.values()),l&&(a.tags=a.tags.flat().sort(ov)),await e.callHook("tags:beforeResolve",a),await e.callHook("tags:resolve",a),await e.callHook("tags:afterResolve",a);const d=[];for(const f of a.tags){const{innerHTML:h,tag:p,props:g}=f;if(K$.has(p)&&!(Object.keys(g).length===0&&!f.innerHTML&&!f.textContent)&&!(p==="meta"&&!g.content&&!g["http-equiv"]&&!g.charset)){if(p==="script"&&h){if(String(g.type).endsWith("json")){const y=typeof h=="string"?h:JSON.stringify(h);f.innerHTML=y.replace(/</g,"\\u003C")}else typeof h=="string"&&(f.innerHTML=h.replace(new RegExp(`</${p}`,"g"),`<\\/${p}`));f._d=rv(f)}d.push(f)}}return d},invalidate(){for(const a of r.values())s.add(a._i);i.dirty=!0,e.callHook("entries:updated",i)}};return(t?.plugins||[]).forEach(a=>U5(i,a)),i.hooks.callHook("init",i),t.init?.forEach(a=>a&&i.push(a)),i}const q0="%separator";function dD(t,e,n=!1){let r;if(e==="s"||e==="pageTitle")r=t.pageTitle;else if(e.includes(".")){const o=e.indexOf(".");r=t[e.substring(0,o)]?.[e.substring(o+1)]}else r=t[e];if(r!==void 0)return n?(r||"").replace(/\\/g,"\\\\").replace(/</g,"\\u003C").replace(/"/g,'\\"'):r||""}function Ah(t,e,n,r=!1){if(typeof t!="string"||!t.includes("%"))return t;let o=t;try{o=decodeURI(t)}catch{}const s=o.match(/%\w+(?:\.\w+)?/g);if(!s)return t;const i=t.includes(q0);return t=t.replace(/%\w+(?:\.\w+)?/g,a=>{if(a===q0||!s.includes(a))return a;const l=dD(e,a.slice(1),r);return l!==void 0?l:a}).trim(),i&&(t=t.split(q0).map(a=>a.trim()).filter(a=>a!=="").join(n?` ${n} `:" ")),t}const q5=t=>t.includes(":key")?t:t.split(":").join(":key:"),fD={key:"aliasSorting",hooks:{"tags:resolve":t=>{let e=!1;for(const n of t.tags){const r=n.tagPriority;if(!r)continue;const o=String(r);if(o.startsWith("before:")){const s=q5(o.slice(7)),i=t.tagMap.get(s);i&&(typeof i.tagPriority=="number"&&(n.tagPriority=i.tagPriority),n._p=i._p-1,e=!0)}else if(o.startsWith("after:")){const s=q5(o.slice(6)),i=t.tagMap.get(s);i&&(typeof i.tagPriority=="number"&&(n.tagPriority=i.tagPriority),n._p=i._p+1,e=!0)}}e&&(t.tags=t.tags.sort(ov))}}},hD={key:"deprecations",hooks:{"entries:normalize":({tags:t})=>{for(const e of t)e.props.children&&(e.innerHTML=e.props.children,delete e.props.children),e.props.hid&&(e.key=e.props.hid,delete e.props.hid),e.props.vmid&&(e.key=e.props.vmid,delete e.props.vmid),e.props.body&&(e.tagPosition="bodyClose",delete e.props.body)}}};async function sv(t){if(typeof t==="function")return t;if(t instanceof Promise)return await t;if(Array.isArray(t))return await Promise.all(t.map(n=>sv(n)));if(t?.constructor===Object){const n={};for(const r of Object.keys(t))n[r]=await sv(t[r]);return n}return t}const pD={key:"promises",hooks:{"entries:resolve":async t=>{const e=[];for(const n in t.entries)t.entries[n]._promisesProcessed||e.push(sv(t.entries[n].input).then(r=>{t.entries[n].input=r,t.entries[n]._promisesProcessed=!0}));await Promise.all(e)}}},mD={meta:"content",link:"href",htmlAttrs:"lang"},gD=["innerHTML","textContent"],yD=t=>({key:"template-params",hooks:{"entries:normalize":e=>{const n=e.tags.filter(r=>r.tag==="templateParams"&&r.mode==="server")?.[0]?.props||{};Object.keys(n).length&&(t._ssrPayload={templateParams:{...t._ssrPayload?.templateParams||{},...n}})},"tags:resolve":({tagMap:e,tags:n})=>{const r=e.get("templateParams")?.props||{},o=r.separator||"|";delete r.separator,r.pageTitle=Ah(r.pageTitle||t._title||"",r,o);for(const s of n){if(s.processTemplateParams===!1)continue;const i=mD[s.tag];if(i&&typeof s.props[i]=="string")s.props[i]=Ah(s.props[i],r,o);else if(s.processTemplateParams||s.tag==="titleTemplate"||s.tag==="title")for(const a of gD)typeof s[a]=="string"&&(s[a]=Ah(s[a],r,o,s.tag==="script"&&s.props.type.endsWith("json")))}t._templateParams=r,t._separator=o},"tags:afterResolve":({tagMap:e})=>{const n=e.get("title");n?.textContent&&n.processTemplateParams!==!1&&(n.textContent=Ah(n.textContent,t._templateParams,t._separator))}}}),vD=(t,e)=>kt(e)?qM(e):e,Dw="usehead";function bD(t){return{install(n){n.config.globalProperties.$unhead=t,n.config.globalProperties.$head=t,n.provide(Dw,t)}}.install}function wD(){if(Vf()){const t=un(Dw);if(t)return t}throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.")}function kD(t,e={}){const n=e.head||wD();return n.ssr?n.push(t||{},e):xD(n,t,e)}function xD(t,e,n={}){const r=pe(!1);let o;return ww(()=>{const i=r.value?{}:rm(e,vD);o?o.patch(i):o=t.push(i,n)}),go()&&(Fo(()=>{o.dispose()}),dT(()=>{r.value=!0}),uT(()=>{r.value=!1})),o}function Pw(t){const e=t||p3();return e?.ssrContext?.head||e?.runWithContext(()=>{if(Vf())return un(Dw)})}function CD(t,e={}){const n=Pw(e.nuxt);if(n)return kD(t,{head:n,...e})}function _D(t,e={}){if(Pw(e.nuxt))return!1}let lp,cp;function SD(){return lp=$fetch($w(`builds/meta/${yo().app.buildId}.json`),{responseType:"json"}),lp.then(t=>{cp=w$(t.matcher)}).catch(t=>{console.error("[nuxt] Error fetching app manifest.",t)}),lp}function Sg(){return lp||SD()}async function Hw(t){const e=typeof t=="string"?t:t.path;if(await Sg(),!cp)return console.error("[nuxt] Error creating app manifest matcher.",cp),{};try{return y3({},...cp.matchAll(e).reverse())}catch(n){return console.error("[nuxt] Error matching route rules.",n),{}}}async function W5(t,e={}){if(!await L3(t))return null;const r=await TD(t,e);return await N3(r)||null}const MD="_payload.json";async function TD(t,e={}){const n=new URL(t,"http://localhost");if(n.host!=="localhost"||xs(n.pathname,{acceptRelative:!0}))throw new Error("Payload URL must not include hostname: "+t);const r=yo(),o=e.hash||(e.fresh?Date.now():r.app.buildId),s=r.app.cdnURL,i=s&&await L3(t)?s:r.app.baseURL;return Cg(i,n.pathname,MD+(o?`?${o}`:""))}async function N3(t){const e=fetch(t,{cache:"force-cache"}).then(n=>n.text().then(R3));try{return await e}catch(n){console.warn("[nuxt] Cannot load payload ",t,n)}return null}async function L3(t=Cs().path){const e=vt();return t=t==="/"?t:t.replace(/\/$/,""),(await Sg()).prerendered.includes(t)?!0:e.runWithContext(async()=>{const r=await Hw({path:t});return!!r.prerender&&!r.redirect})}let Ma=null;async function ED(){if(Ma)return Ma;const t=document.getElementById("__NUXT_DATA__");if(!t)return{};const e=await R3(t.textContent||""),n=t.dataset.src?await N3(t.dataset.src):void 0;return Ma={...e,...n,...window.__NUXT__},Ma.config?.public&&(Ma.config.public=or(Ma.config.public)),Ma}async function R3(t){return await V$(t,vt()._payloadRevivers)}function $3(t,e){vt()._payloadRevivers[t]=e}const AD=v$(()=>{$3("skipHydrate",t=>{})}),OD=[["NuxtError",t=>Qa(t)],["EmptyShallowRef",t=>Ro(t==="_"?void 0:t==="0n"?BigInt(0):Qp(t))],["EmptyRef",t=>pe(t==="_"?void 0:t==="0n"?BigInt(0):Qp(t))],["ShallowRef",t=>Ro(t)],["ShallowReactive",t=>es(t)],["Ref",t=>pe(t)],["Reactive",t=>or(t)]],ID=In({name:"nuxt:revive-payload:client",order:-30,async setup(t){let e,n;for(const[r,o]of OD)$3(r,o);Object.assign(t.payload,([e,n]=Za(()=>t.runWithContext(ED)),e=await e,n(),e)),window.__NUXT__=t.payload}});async function Bw(t,e={}){const n=e.document||t.resolvedOptions.document;if(!n||!t.dirty)return;const r={shouldRender:!0,tags:[]};if(await t.hooks.callHook("dom:beforeRender",r),!!r.shouldRender)return t._domUpdatePromise||(t._domUpdatePromise=new Promise(async o=>{const s=new Map,i=new Promise(h=>{t.resolveTags().then(p=>{h(p.map(g=>{const y=s.get(g._d)||0,w={tag:g,id:(y?`${g._d}:${y}`:g._d)||g._h,shouldRender:!0};return g._d&&A3(g._d)&&s.set(g._d,y+1),w}))})});let a=t._dom;if(!a){a={title:n.title,elMap:new Map().set("htmlAttrs",n.documentElement).set("bodyAttrs",n.body)};for(const h of["body","head"]){const p=n[h]?.children;for(const g of p){const y=g.tagName.toLowerCase();if(!tv.has(y))continue;const w=I3({tag:y,props:{}},{innerHTML:g.innerHTML,...g.getAttributeNames().reduce((x,C)=>(x[C]=g.getAttribute(C),x),{})||{}});if(w.key=g.getAttribute("data-hid")||void 0,w._d=rv(w)||O3(w),a.elMap.has(w._d)){let x=1,C=w._d;for(;a.elMap.has(C);)C=`${w._d}:${x++}`;a.elMap.set(C,g)}else a.elMap.set(w._d,g)}}}a.pendingSideEffects={...a.sideEffects},a.sideEffects={};function l(h,p,g){const y=`${h}:${p}`;a.sideEffects[y]=g,delete a.pendingSideEffects[y]}function c({id:h,$el:p,tag:g}){const y=g.tag.endsWith("Attrs");a.elMap.set(h,p),y||(g.textContent&&g.textContent!==p.textContent&&(p.textContent=g.textContent),g.innerHTML&&g.innerHTML!==p.innerHTML&&(p.innerHTML=g.innerHTML),l(h,"el",()=>{p?.remove(),a.elMap.delete(h)}));for(const w in g.props){if(!Object.prototype.hasOwnProperty.call(g.props,w))continue;const x=g.props[w];if(w.startsWith("on")&&typeof x=="function"){const v=p?.dataset;if(v&&v[`${w}fired`]){const S=w.slice(0,-5);x.call(p,new Event(S.substring(2)))}p.getAttribute(`data-${w}`)!==""&&((g.tag==="bodyAttrs"?n.defaultView:p).addEventListener(w.substring(2),x.bind(p)),p.setAttribute(`data-${w}`,""));continue}const C=`attr:${w}`;if(w==="class"){if(!x)continue;for(const v of x)y&&l(h,`${C}:${v}`,()=>p.classList.remove(v)),!p.classList.contains(v)&&p.classList.add(v)}else if(w==="style"){if(!x)continue;for(const[v,S]of x)l(h,`${C}:${v}`,()=>{p.style.removeProperty(v)}),p.style.setProperty(v,S)}else x!==!1&&x!==null&&(p.getAttribute(w)!==x&&p.setAttribute(w,x===!0?"":String(x)),y&&l(h,C,()=>p.removeAttribute(w)))}}const u=[],d={bodyClose:void 0,bodyOpen:void 0,head:void 0},f=await i;for(const h of f){const{tag:p,shouldRender:g,id:y}=h;if(g){if(p.tag==="title"){n.title=p.textContent,l("title","",()=>n.title=a.title);continue}h.$el=h.$el||a.elMap.get(y),h.$el?c(h):tv.has(p.tag)&&u.push(h)}}for(const h of u){const p=h.tag.tagPosition||"head";h.$el=n.createElement(h.tag.tag),c(h),d[p]=d[p]||n.createDocumentFragment(),d[p].appendChild(h.$el)}for(const h of f)await t.hooks.callHook("dom:renderTag",h,n,l);d.head&&n.head.appendChild(d.head),d.bodyOpen&&n.body.insertBefore(d.bodyOpen,n.body.firstChild),d.bodyClose&&n.body.appendChild(d.bodyClose);for(const h in a.pendingSideEffects)a.pendingSideEffects[h]();t._dom=a,await t.hooks.callHook("dom:rendered",{renders:f}),o()}).finally(()=>{t._domUpdatePromise=void 0,t.dirty=!1})),t._domUpdatePromise}function ND(t={}){const e=t.domOptions?.render||Bw;t.document=t.document||(typeof window<"u"?document:void 0);const n=t.document?.head.querySelector('script[id="unhead:payload"]')?.innerHTML||!1;return uD({...t,plugins:[...t.plugins||[],{key:"client",hooks:{"entries:updated":e}}],init:[n?JSON.parse(n):!1,...t.init||[]]})}function LD(t,e){let n=0;return()=>{const r=++n;e(()=>{n===r&&t()})}}function RD(t={}){const e=ND({domOptions:{render:LD(()=>Bw(e),n=>setTimeout(n,0))},...t});return e.install=bD(e),e}const $D={disableDefaults:!0,disableCapoSorting:!1,plugins:[hD,pD,yD,fD]},DD=In({name:"nuxt:head",enforce:"pre",setup(t){const e=RD($D);t.vueApp.use(e);{let n=!0;const r=async()=>{n=!1,await Bw(e)};e.hooks.hook("dom:beforeRender",o=>{o.shouldRender=!n}),t.hooks.hook("page:start",()=>{n=!0}),t.hooks.hook("page:finish",()=>{t.isHydrating||r()}),t.hooks.hook("app:error",r),t.hooks.hook("app:suspense:resolve",r)}}});const Wl=typeof document<"u";function D3(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function PD(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&D3(t.default)}const bt=Object.assign;function W0(t,e){const n={};for(const r in e){const o=e[r];n[r]=Do(o)?o.map(t):t(o)}return n}const Ad=()=>{},Do=Array.isArray;function K5(t,e){const n={};for(const r in t)n[r]=r in e?e[r]:t[r];return n}const P3=/#/g,HD=/&/g,BD=/\//g,FD=/=/g,jD=/\?/g,H3=/\+/g,zD=/%5B/g,VD=/%5D/g,B3=/%5E/g,UD=/%60/g,F3=/%7B/g,qD=/%7C/g,j3=/%7D/g,WD=/%20/g;function Fw(t){return t==null?"":encodeURI(""+t).replace(qD,"|").replace(zD,"[").replace(VD,"]")}function KD(t){return Fw(t).replace(F3,"{").replace(j3,"}").replace(B3,"^")}function iv(t){return Fw(t).replace(H3,"%2B").replace(WD,"+").replace(P3,"%23").replace(HD,"%26").replace(UD,"`").replace(F3,"{").replace(j3,"}").replace(B3,"^")}function GD(t){return iv(t).replace(FD,"%3D")}function JD(t){return Fw(t).replace(P3,"%23").replace(jD,"%3F")}function YD(t){return JD(t).replace(BD,"%2F")}function df(t){if(t==null)return null;try{return decodeURIComponent(""+t)}catch{}return""+t}const XD=/\/$/,ZD=t=>t.replace(XD,"");function K0(t,e,n="/"){let r,o={},s="",i="";const a=e.indexOf("#");let l=e.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=e.slice(0,l),s=e.slice(l,a>0?a:e.length),o=t(s.slice(1))),a>=0&&(r=r||e.slice(0,a),i=e.slice(a,e.length)),r=nP(r??e,n),{fullPath:r+s+i,path:r,query:o,hash:df(i)}}function QD(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function G5(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function eP(t,e,n){const r=e.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&$c(e.matched[r],n.matched[o])&&z3(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function $c(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function z3(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!tP(t[n],e[n]))return!1;return!0}function tP(t,e){return Do(t)?J5(t,e):Do(e)?J5(e,t):t?.valueOf()===e?.valueOf()}function J5(t,e){return Do(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t.length===1&&t[0]===e}function nP(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),r=t.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let s=n.length-1,i,a;for(i=0;i<r.length;
vendor: 21,231 bytes, line 4
4i++)if(a=r[i],a!==".")if(a==="..")s>1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(i).join("/")}const Kr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let av=(function(t){return t.pop="pop",t.push="push",t})({}),G0=(function(t){return t.back="back",t.forward="forward",t.unknown="",t})({});function rP(t){if(!t)if(Wl){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),ZD(t)}const oP=/^[^#]+#/;function sP(t,e){return t.replace(oP,"#")+e}function iP(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{behavior:e.behavior,left:r.left-n.left-(e.left||0),top:r.top-n.top-(e.top||0)}}const Mg=()=>({left:window.scrollX,top:window.scrollY});function aP(t){let e;if("el"in t){const n=t.el,r=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;e=iP(o,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function Y5(t,e){return(history.state?history.state.position-e:-1)+t}const lv=new Map;function lP(t,e){lv.set(t,e)}function cP(t){const e=lv.get(t);return lv.delete(t),e}function uP(t){return typeof t=="string"||t&&typeof t=="object"}function V3(t){return typeof t=="string"||typeof t=="symbol"}let Ht=(function(t){return t[t.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",t[t.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",t[t.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",t[t.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",t[t.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",t})({});const U3=Symbol("");Ht.MATCHER_NOT_FOUND+"",Ht.NAVIGATION_GUARD_REDIRECT+"",Ht.NAVIGATION_ABORTED+"",Ht.NAVIGATION_CANCELLED+"",Ht.NAVIGATION_DUPLICATED+"";function Dc(t,e){return bt(new Error,{type:t,[U3]:!0},e)}function Ns(t,e){return t instanceof Error&&U3 in t&&(e==null||!!(t.type&e))}const dP=["params","query","hash"];function fP(t){if(typeof t=="string")return t;if(t.path!=null)return t.path;const e={};for(const n of dP)n in t&&(e[n]=t[n]);return JSON.stringify(e,null,2)}function hP(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let r=0;r<n.length;++r){const o=n[r].replace(H3," "),s=o.indexOf("="),i=df(s<0?o:o.slice(0,s)),a=s<0?null:df(o.slice(s+1));if(i in e){let l=e[i];Do(l)||(l=e[i]=[l]),l.push(a)}else e[i]=a}return e}function X5(t){let e="";for(let n in t){const r=t[n];if(n=GD(n),r==null){r!==void 0&&(e+=(e.length?"&":"")+n);continue}(Do(r)?r.map(o=>o&&iv(o)):[r&&iv(r)]).forEach(o=>{o!==void 0&&(e+=(e.length?"&":"")+n,o!=null&&(e+="="+o))})}return e}function pP(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=Do(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return e}const mP=Symbol(""),Z5=Symbol(""),jw=Symbol(""),zw=Symbol(""),cv=Symbol("");function Fu(){let t=[];function e(r){return t.push(r),()=>{const o=t.indexOf(r);o>-1&&t.splice(o,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function Ei(t,e,n,r,o,s=i=>i()){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((a,l)=>{const c=f=>{f===!1?l(Dc(Ht.NAVIGATION_ABORTED,{from:n,to:e})):f instanceof Error?l(f):uP(f)?l(Dc(Ht.NAVIGATION_GUARD_REDIRECT,{from:e,to:f})):(i&&r.enterCallbacks[o]===i&&typeof f=="function"&&i.push(f),a())},u=s(()=>t.call(r&&r.instances[o],e,n,c));let d=Promise.resolve(u);t.length<3&&(d=d.then(c)),d.catch(f=>l(f))})}function J0(t,e,n,r,o=s=>s()){const s=[];for(const i of t)for(const a in i.components){let l=i.components[a];if(!(e!=="beforeRouteEnter"&&!i.instances[a]))if(D3(l)){const c=(l.__vccOpts||l)[e];c&&s.push(Ei(c,n,r,i,a,o))}else{let c=l();s.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const d=PD(u)?u.default:u;i.mods[a]=u,i.components[a]=d;const f=(d.__vccOpts||d)[e];return f&&Ei(f,n,r,i,a,o)()}))}}return s}function gP(t,e){const n=[],r=[],o=[],s=Math.max(e.matched.length,t.matched.length);for(let i=0;i<s;i++){const a=e.matched[i];a&&(t.matched.find(c=>$c(c,a))?r.push(a):n.push(a));const l=t.matched[i];l&&(e.matched.find(c=>$c(c,l))||o.push(l))}return[n,r,o]}let yP=()=>location.protocol+"//"+location.host;function q3(t,e){const{pathname:n,search:r,hash:o}=e,s=t.indexOf("#");if(s>-1){let i=o.includes(t.slice(s))?t.slice(s).length:1,a=o.slice(i);return a[0]!=="/"&&(a="/"+a),G5(a,"")}return G5(n,t)+r+o}function vP(t,e,n,r){let o=[],s=[],i=null;const a=({state:f})=>{const h=q3(t,location),p=n.value,g=e.value;let y=0;if(f){if(n.value=h,e.value=f,i&&i===p){i=null;return}y=g?f.position-g.position:0}else r(h);o.forEach(w=>{w(n.value,p,{delta:y,type:av.pop,direction:y?y>0?G0.forward:G0.back:G0.unknown})})};function l(){i=n.value}function c(f){o.push(f);const h=()=>{const p=o.indexOf(f);p>-1&&o.splice(p,1)};return s.push(h),h}function u(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(bt({},f.state,{scroll:Mg()}),"")}}function d(){for(const f of s)f();s=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:c,destroy:d}}function Q5(t,e,n,r=!1,o=!1){return{back:t,current:e,forward:n,replaced:r,position:window.history.length,scroll:o?Mg():null}}function bP(t){const{history:e,location:n}=window,r={value:q3(t,n)},o={value:e.state};o.value||s(r.value,{back:null,current:r.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function s(l,c,u){const d=t.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?t:t.slice(d))+l:yP()+t+l;try{e[u?"replaceState":"pushState"](c,"",f),o.value=c}catch(h){console.error(h),n[u?"replace":"assign"](f)}}function i(l,c){s(l,bt({},e.state,Q5(o.value.back,l,o.value.forward,!0),c,{position:o.value.position}),!0),r.value=l}function a(l,c){const u=bt({},o.value,e.state,{forward:l,scroll:Mg()});s(u.current,u,!0),s(l,bt({},Q5(r.value,l,null),{position:u.position+1},c),!1),r.value=l}return{location:r,state:o,push:a,replace:i}}function wP(t){t=rP(t);const e=bP(t),n=vP(t,e.state,e.location,e.replace);function r(s,i=!0){i||n.pauseListeners(),history.go(s)}const o=bt({location:"",base:t,go:r,createHref:sP.bind(null,t)},e,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>e.state.value}),o}let za=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t})({});var nn=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.ParamRegExp=2]="ParamRegExp",t[t.ParamRegExpEnd=3]="ParamRegExpEnd",t[t.EscapeNext=4]="EscapeNext",t})(nn||{});const kP={type:za.Static,value:""},xP=/[a-zA-Z0-9_]/;function CP(t){if(!t)return[[]];if(t==="/")return[[kP]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(h){throw new Error(`ERR (${n})/"${c}": ${h}`)}let n=nn.Static,r=n;const o=[];let s;function i(){s&&o.push(s),s=[]}let a=0,l,c="",u="";function d(){c&&(n===nn.Static?s.push({type:za.Static,value:c}):n===nn.Param||n===nn.ParamRegExp||n===nn.ParamRegExpEnd?(s.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),s.push({type:za.Param,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function f(){c+=l}for(;a<t.length;){if(l=t[a++],l==="\\"&&n!==nn.ParamRegExp){r=n,n=nn.EscapeNext;continue}switch(n){case nn.Static:l==="/"?(c&&d(),i()):l===":"?(d(),n=nn.Param):f();break;case nn.EscapeNext:f(),n=r;break;case nn.Param:l==="("?n=nn.ParamRegExp:xP.test(l)?f():(d(),n=nn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case nn.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=nn.ParamRegExpEnd:u+=l;break;case nn.ParamRegExpEnd:d(),n=nn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:e("Unknown state");break}}return n===nn.ParamRegExp&&e(`Unfinished custom RegExp for param "${c}"`),d(),i(),o}const eC="[^/]+?",_P={sensitive:!1,strict:!1,start:!0,end:!0};var er=(function(t){return t[t._multiplier=10]="_multiplier",t[t.Root=90]="Root",t[t.Segment=40]="Segment",t[t.SubSegment=30]="SubSegment",t[t.Static=40]="Static",t[t.Dynamic=20]="Dynamic",t[t.BonusCustomRegExp=10]="BonusCustomRegExp",t[t.BonusWildcard=-50]="BonusWildcard",t[t.BonusRepeatable=-20]="BonusRepeatable",t[t.BonusOptional=-8]="BonusOptional",t[t.BonusStrict=.7000000000000001]="BonusStrict",t[t.BonusCaseSensitive=.25]="BonusCaseSensitive",t})(er||{});const SP=/[.+*?^${}()[\]/\\]/g;function MP(t,e){const n=bt({},_P,e),r=[];let o=n.start?"^":"";const s=[];for(const c of t){const u=c.length?[]:[er.Root];n.strict&&!c.length&&(o+="/");for(let d=0;d<c.length;d++){const f=c[d];let h=er.Segment+(n.sensitive?er.BonusCaseSensitive:0);if(f.type===za.Static)d||(o+="/"),o+=f.value.replace(SP,"\\$&"),h+=er.Static;else if(f.type===za.Param){const{value:p,repeatable:g,optional:y,regexp:w}=f;s.push({name:p,repeatable:g,optional:y});const x=w||eC;if(x!==eC){h+=er.BonusCustomRegExp;try{`${x}`}catch(v){throw new Error(`Invalid custom RegExp for param "${p}" (${x}): `+v.message)}}let C=g?`((?:${x})(?:/(?:${x}))*)`:`(${x})`;d||(C=y&&c.length<2?`(?:/${C})`:"/"+C),y&&(C+="?"),o+=C,h+=er.Dynamic,y&&(h+=er.BonusOptional),g&&(h+=er.BonusRepeatable),x===".*"&&(h+=er.BonusWildcard)}u.push(h)}r.push(u)}if(n.strict&&n.end){const c=r.length-1;r[c][r[c].length-1]+=er.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function a(c){const u=c.match(i),d={};if(!u)return null;for(let f=1;f<u.length;f++){const h=u[f]||"",p=s[f-1];d[p.name]=h&&p.repeatable?h.split("/"):h}return d}function l(c){let u="",d=!1;for(const f of t){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const h of f)if(h.type===za.Static)u+=h.value;else if(h.type===za.Param){const{value:p,repeatable:g,optional:y}=h,w=p in c?c[p]:"";if(Do(w)&&!g)throw new Error(`Provided param "${p}" is an array but it is not repeatable (* or + modifiers)`);const x=Do(w)?w.join("/"):w;if(!x)if(y)f.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${p}"`);u+=x}}return u||"/"}return{re:i,score:r,keys:s,parse:a,stringify:l}}function TP(t,e){let n=0;for(;n<t.length&&n<e.length;){const r=e[n]-t[n];if(r)return r;n++}return t.length<e.length?t.length===1&&t[0]===er.Static+er.Segment?-1:1:t.length>e.length?e.length===1&&e[0]===er.Static+er.Segment?1:-1:0}function W3(t,e){let n=0;const r=t.score,o=e.score;for(;n<r.length&&n<o.length;){const s=TP(r[n],o[n]);if(s)return s;n++}if(Math.abs(o.length-r.length)===1){if(tC(r))return 1;if(tC(o))return-1}return o.length-r.length}function tC(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const EP={strict:!1,end:!0,sensitive:!1};function AP(t,e,n){const r=MP(CP(t.path),n),o=bt(r,{record:t,parent:e,children:[],alias:[]});return e&&!o.record.aliasOf==!e.record.aliasOf&&e.children.push(o),o}function OP(t,e){const n=[],r=new Map;e=K5(EP,e);function o(d){return r.get(d)}function s(d,f,h){const p=!h,g=rC(d);g.aliasOf=h&&h.record;const y=K5(e,d),w=[g];if("alias"in d){const v=typeof d.alias=="string"?[d.alias]:d.alias;for(const S of v)w.push(rC(bt({},g,{components:h?h.record.components:g.components,path:S,aliasOf:h?h.record:g})))}let x,C;for(const v of w){const{path:S}=v;if(f&&S[0]!=="/"){const E=f.record.path,M=E[E.length-1]==="/"?"":"/";v.path=f.record.path+(S&&M+S)}if(x=AP(v,f,y),h?h.alias.push(x):(C=C||x,C!==x&&C.alias.push(x),p&&d.name&&!oC(x)&&i(d.name)),K3(x)&&l(x),g.children){const E=g.children;for(let M=0;M<E.length;M++)s(E[M],x,h&&h.children[M])}h=h||x}return C?()=>{i(C)}:Ad}function i(d){if(V3(d)){const f=r.get(d);f&&(r.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(i),f.alias.forEach(i))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&r.delete(d.record.name),d.children.forEach(i),d.alias.forEach(i))}}function a(){return n}function l(d){const f=LP(d,n);n.splice(f,0,d),d.record.name&&!oC(d)&&r.set(d.record.name,d)}function c(d,f){let h,p={},g,y;if("name"in d&&d.name){if(h=r.get(d.name),!h)throw Dc(Ht.MATCHER_NOT_FOUND,{location:d});y=h.record.name,p=bt(nC(f.params,h.keys.filter(C=>!C.optional).concat(h.parent?h.parent.keys.filter(C=>C.optional):[]).map(C=>C.name)),d.params&&nC(d.params,h.keys.map(C=>C.name))),g=h.stringify(p)}else if(d.path!=null)g=d.path,h=n.find(C=>C.re.test(g)),h&&(p=h.parse(g),y=h.record.name);else{if(h=f.name?r.get(f.name):n.find(C=>C.re.test(f.path)),!h)throw Dc(Ht.MATCHER_NOT_FOUND,{location:d,currentLocation:f});y=h.record.name,p=bt({},f.params,d.params),g=h.stringify(p)}const w=[];let x=h;for(;x;)w.unshift(x.record),x=x.parent;return{name:y,path:g,params:p,matched:w,meta:NP(w)}}t.forEach(d=>s(d));function u(){n.length=0,r.clear()}return{addRoute:s,resolve:c,removeRoute:i,clearRoutes:u,getRoutes:a,getRecordMatcher:o}}function nC(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function rC(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:IP(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function IP(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const r in t.components)e[r]=typeof n=="object"?n[r]:n;return e}function oC(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function NP(t){return t.reduce((e,n)=>bt(e,n.meta),{})}function LP(t,e){let n=0,r=e.length;for(;n!==r;){const s=n+r>>1;W3(t,e[s])<0?r=s:n=s+1}const o=RP(t);return o&&(r=e.lastIndexOf(o,r-1)),r}function RP(t){let e=t;for(;e=e.parent;)if(K3(e)&&W3(t,e)===0)return e}function K3({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function sC(t){const e=un(jw),n=un(zw),r=U(()=>{const l=b(t.to);return e.resolve(l)}),o=U(()=>{const{matched:l}=r.value,{length:c}=l,u=l[c-1],d=n.matched;if(!u||!d.length)return-1;const f=d.findIndex($c.bind(null,u));if(f>-1)return f;const h=iC(l[c-2]);return c>1&&iC(u)===h&&d[d.length-1].path!==h?d.findIndex($c.bind(null,l[c-2])):f}),s=U(()=>o.value>-1&&BP(n.params,r.value.params)),i=U(()=>o.value>-1&&o.value===n.matched.length-1&&z3(n.params,r.value.params));function a(l={}){if(HP(l)){const c=e[b(t.replace)?"replace":"push"](b(t.to)).catch(Ad);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:r,href:U(()=>r.value.href),isActive:s,isExactActive:i,navigate:a}}function $P(t){return t.length===1?t[0]:t}const DP=Ne({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:sC,setup(t,{slots:e}){const n=or(sC(t)),{options:r}=un(jw),o=U(()=>({[aC(t.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[aC(t.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const s=e.default&&$P(e.default(n));return t.custom?s:mt("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},s)}}}),PP=DP;function HP(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function BP(t,e){for(const n in e){const r=e[n],o=t[n];if(typeof r=="string"){if(r!==o)return!1}else if(!Do(o)||o.length!==r.length||r.some((s,i)=>s.valueOf()!==o[i].valueOf()))return!1}return!0}function iC(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const aC=(t,e,n)=>t??e??n,FP=Ne({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const r=un(cv),o=U(()=>t.route||r.value),s=un(Z5,0),i=U(()=>{let c=b(s);const{matched:u}=o.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=U(()=>o.value.matched[i.value]);Ks(Z5,U(()=>i.value+1)),Ks(mP,a),Ks(cv,o);const l=pe();return Ye(()=>[l.value,a.value,t.name],([c,u,d],[f,h,p])=>{u&&(u.instances[d]=c,h&&h!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!$c(u,h)||!f)&&(u.enterCallbacks[d]||[]).forEach(g=>g(c))},{flush:"post"}),()=>{const c=o.value,u=t.name,d=a.value,f=d&&d.components[u];if(!f)return lC(n.default,{Component:f,route:c});const h=d.props[u],p=h?h===!0?c.params:typeof h=="function"?h(c):h:null,y=mt(f,bt({},p,e,{onVnodeUnmounted:w=>{w.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return lC(n.default,{Component:y,route:c})||y}}});function lC(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const G3=FP;function jP(t){const e=OP(t.routes,t),n=t.parseQuery||hP,r=t.stringifyQuery||X5,o=t.history,s=Fu(),i=Fu(),a=Fu(),l=Ro(Kr);let c=Kr;Wl&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=W0.bind(null,F=>""+F),d=W0.bind(null,YD),f=W0.bind(null,df);function h(F,q){let ne,de;return V3(F)?(ne=e.getRecordMatcher(F),de=q):de=F,e.addRoute(de,ne)}function p(F){const q=e.getRecordMatcher(F);q&&e.removeRoute(q)}function g(){return e.getRoutes().map(F=>F.record)}function y(F){return!!e.getRecordMatcher(F)}function w(F,q){if(q=bt({},q||l.value),typeof F=="string"){const O=K0(n,F,q.path),z=e.resolve({path:O.path},q),K=o.createHref(O.fullPath);return bt(O,z,{params:f(z.params),hash:df(O.hash),redirectedFrom:void 0,href:K})}let ne;if(F.path!=null)ne=bt({},F,{path:K0(n,F.path,q.path).path});else{const O=bt({},F.params);for(const z in O)O[z]==null&&delete O[z];ne=bt({},F,{params:d(O)}),q.params=d(q.params)}const de=e.resolve(ne,q),Pe=F.hash||"";de.params=u(f(de.params));const ot=QD(r,bt({},F,{hash:KD(Pe),path:de.path})),I=o.createHref(ot);return bt({fullPath:ot,hash:Pe,query:r===X5?pP(F.query):F.query||{}},de,{redirectedFrom:void 0,href:I})}function x(F){return typeof F=="string"?K0(n,F,l.value.path):bt({},F)}function C(F,q){if(c!==F)return Dc(Ht.NAVIGATION_CANCELLED,{from:q,to:F})}function v(F){return M(F)}function S(F){return v(bt(x(F),{replace:!0}))}function E(F,q){const ne=F.matched[F.matched.length-1];if(ne&&ne.redirect){const{redirect:de}=ne;let Pe=typeof de=="function"?de(F,q):de;return typeof Pe=="string"&&(Pe=Pe.includes("?")||Pe.includes("#")?Pe=x(Pe):{path:Pe},Pe.params={}),bt({query:F.query,hash:F.hash,params:Pe.path!=null?{}:F.params},Pe)}}function M(F,q){const ne=c=w(F),de=l.value,Pe=F.state,ot=F.force,I=F.replace===!0,O=E(ne,de);if(O)return M(bt(x(O),{state:typeof O=="object"?bt({},Pe,O.state):Pe,force:ot,replace:I}),q||ne);const z=ne;z.redirectedFrom=q;let K;return!ot&&eP(r,de,ne)&&(K=Dc(Ht.NAVIGATION_DUPLICATED,{to:z,from:de}),J(de,de,!0,!1)),(K?Promise.resolve(K):N(z,de)).catch(G=>Ns(G)?Ns(G,Ht.NAVIGATION_GUARD_REDIRECT)?G:Q(G):j(G,z,de)).then(G=>{if(G){if(Ns(G,Ht.NAVIGATION_GUARD_REDIRECT))return M(bt({replace:I},x(G.to),{state:typeof G.to=="object"?bt({},Pe,G.to.state):Pe,force:ot}),q||z)}else G=$(z,de,!0,I,Pe);return D(z,de,G),G})}function T(F,q){const ne=C(F,q);return ne?Promise.reject(ne):Promise.resolve()}function A(F){const q=ee.values().next().value;return q&&typeof q.runWithContext=="function"?q.runWithContext(F):F()}function N(F,q){let ne;const[de,Pe,ot]=gP(F,q);ne=J0(de.reverse(),"beforeRouteLeave",F,q);for(const O of de)O.leaveGuards.forEach(z=>{ne.push(Ei(z,F,q))});const I=T.bind(null,F,q);return ne.push(I),Re(ne).then(()=>{ne=[];for(const O of s.list())ne.push(Ei(O,F,q));return ne.push(I),Re(ne)}).then(()=>{ne=J0(Pe,"beforeRouteUpdate",F,q);for(const O of Pe)O.updateGuards.forEach(z=>{ne.push(Ei(z,F,q))});return ne.push(I),Re(ne)}).then(()=>{ne=[];for(const O of ot)if(O.beforeEnter)if(Do(O.beforeEnter))for(const z of O.beforeEnter)ne.push(Ei(z,F,q));else ne.push(Ei(O.beforeEnter,F,q));return ne.push(I),Re(ne)}).then(()=>(F.matched.forEach(O=>O.enterCallbacks={}),ne=J0(ot,"beforeRouteEnter",F,q,A),ne.push(I),Re(ne))).then(()=>{ne=[];for(const O of i.list())ne.push(Ei(O,F,q));return ne.push(I),Re(ne)}).catch(O=>Ns(O,Ht.NAVIGATION_CANCELLED)?O:Promise.reject(O))}function D(F,q,ne){a.list().forEach(de=>A(()=>de(F,q,ne)))}function $(F,q,ne,de,Pe){const ot=C(F,q);if(ot)return ot;const I=q===Kr,O=Wl?history.state:{};ne&&(de||I?o.replace(F.fullPath,bt({scroll:I&&O&&O.scroll},Pe)):o.push(F.fullPath,Pe)),l.value=F,J(F,q,ne,I),Q()}let W;function me(){W||(W=o.listen((F,q,ne)=>{if(!se.listening)return;const de=w(F),Pe=E(de,se.currentRoute.value);if(Pe){M(bt(Pe,{replace:!0,force:!0}),de).catch(Ad);return}c=de;const ot=l.value;
4Wl&&lP(Y5(ot.fullPath,ne.delta),Mg()),N(de,ot).catch(I=>Ns(I,Ht.NAVIGATION_ABORTED|Ht.NAVIGATION_CANCELLED)?I:Ns(I,Ht.NAVIGATION_GUARD_REDIRECT)?(M(bt(x(I.to),{force:!0}),de).then(O=>{Ns(O,Ht.NAVIGATION_ABORTED|Ht.NAVIGATION_DUPLICATED)&&!ne.delta&&ne.type===av.pop&&o.go(-1,!1)}).catch(Ad),Promise.reject()):(ne.delta&&o.go(-ne.delta,!1),j(I,de,ot))).then(I=>{I=I||$(de,ot,!1),I&&(ne.delta&&!Ns(I,Ht.NAVIGATION_CANCELLED)?o.go(-ne.delta,!1):ne.type===av.pop&&Ns(I,Ht.NAVIGATION_ABORTED|Ht.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),D(de,ot,I)}).catch(Ad)}))}let V=Fu(),B=Fu(),Y;function j(F,q,ne){Q(F);const de=B.list();return de.length?de.forEach(Pe=>Pe(F,q,ne)):console.error(F),Promise.reject(F)}function P(){return Y&&l.value!==Kr?Promise.resolve():new Promise((F,q)=>{V.add([F,q])})}function Q(F){return Y||(Y=!F,me(),V.list().forEach(([q,ne])=>F?ne(F):q()),V.reset()),F}function J(F,q,ne,de){const{scrollBehavior:Pe}=t;if(!Wl||!Pe)return Promise.resolve();const ot=!ne&&cP(Y5(F.fullPath,0))||(de||!ne)&&history.state&&history.state.scroll||null;return mn().then(()=>Pe(F,q,ot)).then(I=>I&&aP(I)).catch(I=>j(I,F,q))}const ke=F=>o.go(F);let Se;const ee=new Set,se={currentRoute:l,listening:!0,addRoute:h,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:y,getRoutes:g,resolve:w,options:t,push:v,replace:S,go:ke,back:()=>ke(-1),forward:()=>ke(1),beforeEach:s.add,beforeResolve:i.add,afterEach:a.add,onError:B.add,isReady:P,install(F){F.component("RouterLink",PP),F.component("RouterView",G3),F.config.globalProperties.$router=se,Object.defineProperty(F.config.globalProperties,"$route",{enumerable:!0,get:()=>b(l)}),Wl&&!Se&&l.value===Kr&&(Se=!0,v(o.location).catch(de=>{}));const q={};for(const de in Kr)Object.defineProperty(q,de,{get:()=>l.value[de],enumerable:!0});F.provide(jw,se),F.provide(zw,es(q)),F.provide(cv,l);const ne=F.unmount;ee.add(F),F.unmount=function(){ee.delete(F),ee.size<1&&(c=Kr,W&&W(),W=null,l.value=Kr,Se=!1,Y=!1),ne()}}};function Re(F){return F.reduce((q,ne)=>q.then(()=>A(ne)),Promise.resolve())}return se}function J3(t){return un(zw)}const zP=/(:\w+)\([^)]+\)/g,VP=/(:\w+)[?+*]/g,UP=/:\w+/g,qP=(t,e)=>e.path.replace(zP,"$1").replace(VP,"$1").replace(UP,n=>t.params[n.slice(1)]?.toString()||""),uv=(t,e)=>{const n=t.route.matched.find(o=>o.components?.default===t.Component.type),r=e??n?.meta.key??(n&&qP(t.route,n));return typeof r=="function"?r(t.route):r},WP=(t,e)=>({default:()=>t?mt(TN,t===!0?{}:t,e):e});function Vw(t){return Array.isArray(t)?t:[t]}const KP="modulepreload",GP=function(t,e){return new URL(t,e).href},cC={},Wt=function(e,n,r){let o=Promise.resolve();if(n&&n.length>0){let c=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const i=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");o=c(n.map(u=>{if(u=GP(u,r),u in cC)return;cC[u]=!0;const d=u.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(r)for(let p=i.length-1;p>=0;p--){const g=i[p];if(g.href===u&&(!d||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${f}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":KP,d||(h.as="script"),h.crossOrigin="",h.href=u,l&&h.setAttribute("nonce",l),document.head.appendChild(h),d)return new Promise((p,g)=>{h.addEventListener("load",p),h.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})},JP={pageTransition:{name:"page"}},YP={pageTransition:{name:"page"}},XP={pageTransition:{name:"page"}},ZP={layout:!1},Y0=[{name:"search",path:"/search",meta:JP||{},component:()=>Wt(()=>import("./BUmIa8-8.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)},{name:"slug",path:"/:slug(.*)*",meta:YP||{},component:()=>Wt(()=>import("./BCHwVCTg.js").then(t=>t.i),__vite__mapDeps([7,8,2,3,4,5,9,10,11,12,13]),import.meta.url)}
4,{name:"job-slug",path:"/job/:slug(.*)*",meta:XP||{},component:()=>Wt(()=>import("./c8NbPK12.js"),__vite__mapDeps([14,8,15,16,9,2,3,4,5,1,6,17]),import.meta.url)},{name:"preview-interactive-model",path:"/preview/interactive-model",meta:ZP||{},component:()=>Wt(()=>import("./Dtk7WA-g.js"),__vite__mapDeps([18,19,11,4]),import.meta.url)}],Y3=(t,e)=>({default:()=>t?mt(qT,t===!0?{}:t,e):e.default?.()}),QP=/(:\w+)\([^)]+\)/g,eH=/(:\w+)[?+*]/g,tH=/:\w+/g;function uC(t){const e=t?.meta.key??t.path.replace(QP,"$1").replace(eH,"$1").replace(tH,n=>t.params[n.slice(1)]?.toString()||"");return typeof e=="function"?e(t):e}function nH(t,e){return t===e||e===Kr?!1:uC(t)!==uC(e)?!0:!t.matched.every((r,o)=>r.components&&r.components.default===e.matched[o]?.components?.default)}function rH(t,e=!1){if(t){if(t.nodeName==="#comment"&&t.nodeValue==="[")return X3(t,[],e);if(e){const n=t.cloneNode(!0);return n.querySelectorAll("[data-island-slot]").forEach(r=>{r.innerHTML=""}),[n.outerHTML]}return[t.outerHTML]}}function X3(t,e=[],n=!1){if(t&&t.nodeName){if(sH(t))return e;if(!oH(t)){const r=t.cloneNode(!0);n&&r.querySelectorAll?.("[data-island-slot]").forEach(o=>{o.innerHTML=""}),e.push(r.outerHTML)}X3(t.nextSibling,e,n)}return e}function X0(t,e){const n=t?rH(t):[e];return n?ps(n.join(""),n.length):mt("div")}function oH(t){return t.nodeName==="#comment"&&t.nodeValue==="["}function sH(t){return t.nodeName==="#comment"&&t.nodeValue==="]"}const iH={scrollBehavior(t,e,n){const r=vt(),o=gn().options?.scrollBehaviorType??"auto";if(t.path.replace(/\/$/,"")===e.path.replace(/\/$/,""))return e.hash&&!t.hash?{left:0,top:0}:t.hash?{el:t.hash,top:Z3(t.hash),behavior:o}:!1;if((typeof t.meta.scrollToTop=="function"?t.meta.scrollToTop(t,e):t.meta.scrollToTop)===!1)return!1;const i=r._runningTransition?"page:transition:finish":"page:loading:end";return new Promise(a=>{if(e===Kr){a(dC(t,e,n,o));return}r.hooks.hookOnce(i,()=>{requestAnimationFrame(()=>a(dC(t,e,n,o)))})})}};function Z3(t){try{const e=document.querySelector(t);if(e)return(Number.parseFloat(getComputedStyle(e).scrollMarginTop)||0)+(Number.parseFloat(getComputedStyle(document.documentElement).scrollPaddingTop)||0)}catch{}return 0}function dC(t,e,n,r){if(n)return n;const o=nH(t,e);return t.hash?{el:t.hash,top:Z3(t.hash),behavior:o?r:"instant"}:{left:0,top:0}}const aH={hashMode:!1,scrollBehaviorType:"auto"},mi={...aH,...iH},lH=async(t,e)=>{let n,r;if(!t.meta?.validate)return;const o=([n,r]=Za(()=>Promise.resolve(t.meta.validate(t))),n=await n,r(),n);if(o===!0)return;const s=Qa({fatal:!0,statusCode:o&&o.statusCode||404,statusMessage:o&&o.statusMessage||`Page Not Found: ${t.fullPath}`,data:{path:t.fullPath}});return typeof window<"u"&&window.history.pushState({},"",e.fullPath),s},cH="$s";function Q3(...t){const e=typeof t[t.length-1]=="string"?t.pop():void 0;typeof t[0]!="string"&&t.unshift(e);const[n,r]=t;if(!n||typeof n!="string")throw new TypeError("[nuxt] [useState] key must be a string: "+n);if(r!==void 0&&typeof r!="function")throw new Error("[nuxt] [useState] init must be a function: "+r);const o=cH+n,s=vt(),i=GM(s.payload.state,o);if(i.value===void 0&&r){const a=r();if(kt(a))return s.payload.state[o]=a,a;i.value=a}return i}const uH=()=>{const t=Q3("redirects-cache",()=>[]),e=async()=>{if(t.value.length>0)return t.value;try{const o=await $fetch("/api/redirects/");t.value=Array.isArray(o)?o:[]}catch(o){console.error("Failed to fetch redirects:",o)}return t.value},n=async o=>{const s=await e();if(!s||s.length===0)return null;const i=fC(o),a=s.find(l=>fC(l.source_url)===i);return a?a.target_url:null};return{fetchRedirects:e,checkRedirect:n,performRedirect:async o=>{const s=Cs(),i=gn(),a=o||s.fullPath,l=await n(a);l&&(l.startsWith("http://")||l.startsWith("https://")?await Rc(l,{external:!0}):await i.push(l))}}};function fC(t){if(!t)return"";const e=t.split("?")[0],n=e?e.split("#")[0]:"";if(!n)return"/";let r=n.replace(/\/+$/,"");return!r.startsWith("/")&&!r.match(/^https?:\/\//)&&(r="/"+r),r===""&&(r="/"),r}const dH=async t=>{let e,n;const{checkRedirect:r}=uH(),o=([e,n]=Za(()=>r(t.fullPath)),e=await e,n(),e);if(o)return o.startsWith("http://")||o.startsWith("https://")?Rc(o,{external:!0}):Rc(o)},fH=(t,e)=>{},hH=async t=>{let e,n;const r=([e,n]=Za(()=>Hw({path:t.path})),e=await e,n(),e);if(r.redirect){const o=r.redirect.includes("#")?r.redirect:r.redirect+t.hash;return xs(o,{acceptRelative:!0})?(window.location.href=o,!1):o}},pH=[lH,dH,fH,hH],dv={};function mH(t,e,n){const{pathname:r,search:o,hash:s}=e,i=t.indexOf("#");if(i>-1){const c=s.includes(t.slice(i))?t.slice(i).length:1;let u=s.slice(c);return u[0]!=="/"&&(u="/"+u),O5(u,"")}const a=O5(r,t),l=!n||OR(a,n)?a:n;
4return l+(l.includes("?")?"":o)+s}const gH=In({name:"nuxt:router",enforce:"pre",async setup(t){let e,n,r=yo().app.baseURL;const o=mi.history?.(r)??wP(r),s=mi.routes?([e,n]=Za(()=>mi.routes(Y0)),e=await e,n(),e??Y0):Y0;let i;const a=jP({...mi,scrollBehavior:(y,w,x)=>{if(w===Kr){i=x;return}if(mi.scrollBehavior){if(a.options.scrollBehavior=mi.scrollBehavior,"scrollRestoration"in window.history){const C=a.beforeEach(()=>{C(),window.history.scrollRestoration="manual"})}return mi.scrollBehavior(y,Kr,i||x)}},history:o,routes:s});"scrollRestoration"in window.history&&(window.history.scrollRestoration="auto"),t.vueApp.use(a);const l=Ro(a.currentRoute.value);a.afterEach((y,w)=>{l.value=w}),Object.defineProperty(t.vueApp.config.globalProperties,"previousRoute",{get:()=>l.value});const c=mH(r,window.location,t.payload.path),u=Ro(a.currentRoute.value),d=()=>{u.value=a.currentRoute.value};a.afterEach((y,w)=>{y.matched.at(-1)?.components?.default===w.matched.at(-1)?.components?.default&&d()});const f={sync:d};for(const y in u.value)Object.defineProperty(f,y,{get:()=>u.value[y],enumerable:!0});t._route=es(f),t._middleware||={global:[],named:{}};const h=_g();a.afterEach(async(y,w,x)=>{delete t._processingMiddleware,!t.isHydrating&&h.value&&await t.runWithContext(k3),x&&await t.callHook("page:loading:end")});try{[e,n]=Za(()=>a.isReady()),await e,n()}catch(y){[e,n]=Za(()=>t.runWithContext(()=>Oa(y))),await e,n()}const p=c!==a.currentRoute.value.fullPath?a.resolve(c):a.currentRoute.value;d();const g=t.payload.state._layout;return a.beforeEach(async(y,w)=>{await t.callHook("page:loading:start"),y.meta=or(y.meta),t.isHydrating&&g&&!hs(y.meta.layout)&&(y.meta.layout=g),t._processingMiddleware=!0;{const x=new Set([...pH,...t._middleware.global]);for(const C of y.matched){const v=C.meta.middleware;if(v)for(const S of Vw(v))x.add(S)}{const C=await t.runWithContext(()=>Hw({path:y.path}));if(C.appMiddleware)for(const v in C.appMiddleware)C.appMiddleware[v]?x.add(v):x.delete(v)}for(const C of x){const v=typeof C=="string"?t._middleware.named[C]||await dv[C]?.().then(S=>S.default||S):C;if(!v)throw new Error(`Unknown route middleware: '${C}'.`);try{const S=await t.runWithContext(()=>v(y,w));if(!t.payload.serverRendered&&t.isHydrating&&(S===!1||S instanceof Error)){const E=S||Qa({statusCode:404,statusMessage:`Page Not Found: ${c}`});return await t.runWithContext(()=>Oa(E)),!1}if(S===!0)continue;if(S===!1)return S;if(S)return x3(S)&&S.fatal&&await t.runWithContext(()=>Oa(S)),S}catch(S){const E=Qa(S);return E.fatal&&await t.runWithContext(()=>Oa(E)),E}}}}),a.onError(async()=>{delete t._processingMiddleware,await t.callHook("page:loading:end")}),a.afterEach(y=>{if(y.matched.length===0)return t.runWithContext(()=>Oa(Qa({statusCode:404,fatal:!1,statusMessage:`Page not found: ${y.fullPath}`,data:{path:y.fullPath}})))}),t.hooks.hookOnce("app:created",async()=>{try{"name"in p&&(p.name=void 0),await a.replace({...p,force:!0}),a.options.scrollBehavior=mi.scrollBehavior}catch(y){await t.runWithContext(()=>Oa(y))}}),{provide:{router:a}}}}),yH=Symbol.for("nuxt:client-only"),Oh="<div></div>",wTe=Ne({name:"ClientOnly",inheritAttrs:!1,props:["fallback","placeholder","placeholderTag","fallbackTag"],setup(t,{slots:e,attrs:n}){const r=Ro(!1);Zt(()=>{r.value=!0});const o=go();return o&&(o._nuxtClientOnly=!0),Ks(yH,!0),()=>{if(r.value){const l=e.default?.();return l&&l.length===1?[Pr(l[0],n)]:l}const s=e.fallback||e.placeholder;if(s)return mt(s);const i=t.fallback||t.placeholder||"",a=t.fallbackTag||t.placeholderTag||"span";return _(a,n,i)}}}),Z0=new WeakMap;function vH(t){if(Z0.has(t))return Z0.get(t);const e={...t};return e.render?e.render=(n,r,o,s,i,a)=>{if(s.mounted$??n.mounted$){const l=t.render?.bind(n)(n,r,o,s,i,a);return l.children===null||typeof l.children=="string"?Pr(l):mt(l)}return X0(n._.vnode.el,Oh)}:e.template&&=`
5      <template v-if="mounted$">${t.template}</template>
6      <template v-else>${Oh}</template>
7    `,e.setup=(n,r)=>{const o=vt(),s=Ro(o.isHydrating===!1),i=go();if(o.isHydrating){const l={...i.attrs},c=bH(i);for(const u in l)delete i.attrs[u];Zt(()=>{Object.assign(i.attrs,l),i.vnode.dirs=c})}Zt(()=>{s.value=!0});const a=t.setup?.(n,r)||{};return cg(a)?Promise.resolve(a).then(l=>typeof l!="function"?(l||={},l.mounted$=s,l):(...c)=>{if(s.value||!o.isHydrating){const u=l(...c);return u.children===null||typeof u.children=="string"?Pr(u):mt(u)}return X0(i?.vnode.el,Oh)}):typeof a=="function"?(...l)=>{if(s.value){const c=a(...l),u=e.inheritAttrs!==!1?r.attrs:void 0;return c.children===null||typeof c.children=="string"?Pr(c,u):mt(c,u)}return X0(i?.vnode.el,Oh)}:Object.assign(a,{mounted$:s})},Z0.set(t,e),e}function bH(t){if(!t||!t.vnode.dirs)return null;const e=t.vnode.dirs;return t.vnode.dirs=null,e}const fv=globalThis.requestIdleCallback||(t=>{const e=Date.now(),n={didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-e))};return setTimeout(()=>{t(n)}
7,1)}),wH=globalThis.cancelIdleCallback||(t=>{clearTimeout(t)}),Tg=t=>{const e=vt();e.isHydrating?e.hooks.hookOnce("app:suspense:resolve",()=>{fv(()=>t())}):fv(()=>t())};function kH(t){if(t?.__asyncLoader&&!t.__asyncResolved)return t.__asyncLoader()}async function e6(t,e=gn()){const{path:n,matched:r}=e.resolve(t);if(!r.length||(e._routePreloaded||=new Set,e._routePreloaded.has(n)))return;const o=e._preloadPromises||=[];if(o.length>4)return Promise.all(o).then(()=>e6(t,e));e._routePreloaded.add(n);for(const s of r){const i=s.components?.default;if(typeof i!="function")continue;const a=Promise.resolve(i()).catch(()=>{}).finally(()=>o.splice(o.indexOf(a)));o.push(a)}await Promise.all(o)}function xH(t={}){const e=t.path||window.location.pathname;let n={};try{n=Qp(sessionStorage.getItem("nuxt:reload")||"{}")}catch{}if(t.force||n?.path!==e||n?.expires<Date.now()){try{sessionStorage.setItem("nuxt:reload",JSON.stringify({path:e,expires:Date.now()+(t.ttl??1e4)}))}catch{}if(t.persistState)try{sessionStorage.setItem("nuxt:reload:state",JSON.stringify({state:vt().payload.state}))}catch{}window.location.pathname!==e?window.location.href=e:window.location.reload()}}function CH(t={}){const e=Ro(""),n=Ro(t.politeness||"polite"),r=Pw();function o(c="",u="polite"){e.value=c,n.value=u}function s(c){return o(c,"polite")}function i(c){return o(c,"assertive")}function a(){o(document?.title?.trim(),n.value)}function l(){r?.hooks?.removeHook("dom:rendered",a)}return a(),r?.hooks?.hook("dom:rendered",()=>{a()}),{_cleanup:l,message:e,politeness:n,set:o,polite:s,assertive:i}}function _H(t={}){const e=vt(),n=e._routeAnnouncer||=CH(t);return t.politeness!==n.politeness.value&&(n.politeness.value=t.politeness||"polite"),mg()&&(e._routeAnnouncerDeps||=0,e._routeAnnouncerDeps++,AM(()=>{e._routeAnnouncerDeps--,e._routeAnnouncerDeps===0&&(n._cleanup(),delete e._routeAnnouncer)})),n}const SH=(...t)=>t.find(e=>e!==void 0);function MH(t){const e=t.componentName||"NuxtLink";function n(s){return typeof s=="string"&&s.startsWith("#")}function r(s,i,a){const l=a??t.trailingSlash;if(!s||l!=="append"&&l!=="remove")return s;if(typeof s=="string")return Ih(s,l);const c="path"in s&&s.path!==void 0?s.path:i(s).path;return{...s,name:void 0,path:Ih(c,l)}}function o(s){const i=gn(),a=yo(),l=U(()=>!!s.target&&s.target!=="_self"),c=U(()=>{const y=s.to||s.href||"";return typeof y=="string"&&xs(y,{acceptRelative:!0})}),u=lf("RouterLink"),d=u&&typeof u!="string"?u.useLink:void 0,f=U(()=>{if(s.external)return!0;const y=s.to||s.href||"";return typeof y=="object"?!1:y===""||c.value}),h=U(()=>{const y=s.to||s.href||"";return f.value?y:r(y,i.resolve,s.trailingSlash)}),p=f.value?void 0:d?.({...s,to:h}),g=U(()=>{const y=s.trailingSlash??t.trailingSlash;if(!h.value||c.value||n(h.value))return h.value;if(f.value){const w=typeof h.value=="object"&&"path"in h.value?Z1(h.value):h.value,x=typeof w=="object"?i.resolve(w).href:w;return Ih(x,y)}return typeof h.value=="object"?i.resolve(h.value)?.href??null:Ih(Cg(a.app.baseURL,h.value),y)});return{to:h,hasTarget:l,isAbsoluteUrl:c,isExternal:f,href:g,isActive:p?.isActive??U(()=>h.value===i.currentRoute.value.path),isExactActive:p?.isExactActive??U(()=>h.value===i.currentRoute.value.path),route:p?.route??U(()=>i.resolve(h.value)),async navigate(y){await Rc(g.value,{replace:s.replace,external:f.value||l.value})}}}return Ne({name:e,props:{to:{type:[String,Object],default:void 0,required:!1},href:{type:[String,Object],default:void 0,required:!1},target:{type:String,default:void 0,required:!1},rel:{type:String,default:void 0,required:!1},noRel:{type:Boolean,default:void 0,required:!1},prefetch:{type:Boolean,default:void 0,required:!1},prefetchOn:{type:[String,Object],default:void 0,required:!1},noPrefetch:{type:Boolean,default:void 0,required:!1},activeClass:{type:String,default:void 0,required:!1},exactActiveClass:{type:String,default:void 0,required:!1},prefetchedClass:{type:String,default:void 0,required:!1},replace:{type:Boolean,default:void 0,required:!1},ariaCurrentValue:{type:String,default:void 0,required:!1},external:{type:Boolean,default:void 0,required:!1},custom:{type:Boolean,default:void 0,required:!1},trailingSlash:{type:String,default:void 0,required:!1}},useLink:o,setup(s,{slots:i}){const a=gn(),{to:l,href:c,navigate:u,isExternal:d,hasTarget:f,isAbsoluteUrl:h}=o(s),p=Ro(!1),g=pe(null),y=C=>{g.value=s.custom?C?.$el?.nextElementSibling:C?.$el};function w(C){return!p.value&&(typeof s.prefetchOn=="string"?s.prefetchOn===C:s.prefetchOn?.[C]??t.prefetchOn?.[C])&&(s.prefetch??t.prefetch)!==!1&&s.noPrefetch!==!0&&s.target!=="_blank"&&!AH()}async function x(C=vt()){if(p.value)return;p.value=!0;const v=typeof l.value=="string"?l.value:d.value?Z1(l.value):a.resolve(l.value).fullPath,S=d.value?new URL(v,window.location.href).href:v;await Promise.all([C.hooks.callHook("link:prefetch",S).catch(()=>{}),!d.value&&!f.value&&e6(l.value,a).catch(()=>{})])}if(w("visibility")){const C=vt();let v,S=null;Zt(()=>{const E=TH();Tg(()=>{v=fv(()=>{g?.value?.tagName&&(S=E.observe(g.value,async()=>{S?.(),S=null,await x(C)}))})})}),Fo(()=>{v&&wH(v),S?.(),S=null})}return()=>{if(!d.value&&!f.value&&!n(l.value)){const S={ref:y,to:l.value,activeClass:s.activeClass||t.activeClass,exactActiveClass:s.exactActiveClass||t.exactActiveClass,replace:s.replace,ariaCurrentValue:s.ariaCurrentValue,custom:s.custom};
7return s.custom||(w("interaction")&&(S.onPointerenter=x.bind(null,void 0),S.onFocus=x.bind(null,void 0)),p.value&&(S.class=s.prefetchedClass||t.prefetchedClass),S.rel=s.rel||void 0),mt(lf("RouterLink"),S,i.default)}const C=s.target||null,v=SH(s.noRel?"":s.rel,t.externalRelAttribute,h.value||f.value?"noopener noreferrer":"")||null;return s.custom?i.default?i.default({href:c.value,navigate:u,prefetch:x,get route(){if(!c.value)return;const S=new URL(c.value,window.location.href);return{path:S.pathname,fullPath:S.pathname,get query(){return Lw(S.search)},hash:S.hash,params:{},name:void 0,matched:[],redirectedFrom:void 0,meta:{},href:c.value}},rel:v,target:C,isExternal:d.value||f.value,isActive:!1,isExactActive:!1}):null:mt("a",{ref:g,href:c.value||null,rel:v,target:C,onClick:S=>{if(!(d.value||f.value))return S.preventDefault(),s.replace?a.replace(c.value):a.push(c.value)}},i.default?.())}}})}const fa=MH(c$);function Ih(t,e){const n=e==="append"?r3:uf;return xs(t)&&!t.startsWith("http")?t:n(t,!0)}function TH(){const t=vt();if(t._observer)return t._observer;let e=null;const n=new Map,r=(s,i)=>(e||=new IntersectionObserver(a=>{for(const l of a){const c=n.get(l.target);(l.isIntersecting||l.intersectionRatio>0)&&c&&c()}}),n.set(s,i),e.observe(s),()=>{n.delete(s),e?.unobserve(s),n.size===0&&(e?.disconnect(),e=null)});return t._observer={observe:r}}const EH=/2g/;function AH(){const t=navigator.connection;return!!(t&&(t.saveData||EH.test(t.effectiveType)))}function OH(t){typeof t.indexable<"u"&&(t.indexable=String(t.indexable)!=="false"),typeof t.trailingSlash<"u"&&!t.trailingSlash&&(t.trailingSlash=String(t.trailingSlash)!=="false"),t.url&&!xs(String(t.url),{acceptRelative:!0,strict:!1})&&(t.url=ER(String(t.url)));const e=Object.keys(t).sort((r,o)=>r.localeCompare(o)),n={};for(const r of e)n[r]=t[r];return n}function IH(t){const n=[];function r(s){if(!s||typeof s!="object"||Object.keys(s).length===0)return()=>{};s._context;const i={};for(const a in s){const l=s[a];typeof l<"u"&&l!==""&&(i[a]=l)}return Object.keys(i).filter(a=>!a.startsWith("_")).length===0?()=>{}:(n.push(i),()=>{const a=n.indexOf(i);a!==-1&&n.splice(a,1)})}function o(s){const i={};s?.debug&&(i._context={}),i._priority={};for(const a in n.sort((l,c)=>(l._priority||0)-(c._priority||0)))for(const l in n[a]){const c=l,u=s?.resolveRefs?qM(n[a][l]):n[a][l];!l.startsWith("_")&&typeof u<"u"&&u!==""&&(i[l]=u,typeof n[a]._priority<"u"&&n[a]._priority!==-1&&(i._priority[c]=n[a]._priority),s?.debug&&(i._context[c]=n[a]._context?.[c]||n[a]._context||"anonymous"))}return s?.skipNormalize?i:OH(i)}return{stack:n,push:r,get:o}}const NH=In({name:"nuxt-site-config:init",enforce:"pre",async setup(t){const e=IH(),n=Q3("site-config");{const r=n.value||window.__NUXT_SITE_CONFIG__||{};for(const o in r)o[0]!=="_"&&e.push({[o]:r[o],_priority:r._priority?.[o]||-1})}return{provide:{nuxtSiteConfig:e}}}}),LH=In({name:"nuxt:payload",setup(t){const e=new Set;gn().beforeResolve(async(n,r)=>{if(n.path===r.path)return;const o=await W5(n.path);if(o){for(const s of e)delete t.static.data[s];for(const s in o.data)s in t.static.data||e.add(s),t.static.data[s]=o.data[s]}}),Tg(()=>{t.hooks.hook("link:prefetch",async n=>{const{hostname:r}=new URL(n,window.location.href);r===window.location.hostname&&await W5(n).catch(()=>{console.warn("[nuxt] Error preloading payload for",n)})}),navigator.connection?.effectiveType!=="slow-2g"&&setTimeout(Sg,1e3)})}}),RH=In(()=>{const t=gn();Tg(()=>{t.beforeResolve(async()=>{await new Promise(e=>{setTimeout(e,100),requestAnimationFrame(()=>{setTimeout(e,0)})})})})}),$H=In(t=>{let e;async function n(){let r;try{r=await Sg()}catch(o){const s=o;if(!("status"in s&&(s.status===404||s.status===403)))throw s}e&&clearTimeout(e),e=setTimeout(n,D5);try{const o=await $fetch($w("builds/latest.json")+`?${Date.now()}`);o.id!==r?.id&&(t.hooks.callHook("app:manifest:update",o),e&&clearTimeout(e))}catch{}}Tg(()=>{e=setTimeout(n,D5)})}),DH=In({name:"nuxt:chunk-reload",setup(t){const e=gn(),n=yo(),r=new Set;e.beforeEach(()=>{r.clear()}),t.hook("app:chunkError",({error:s})=>{r.add(s)});function o(s){const i=Cg(n.app.baseURL,s.fullPath);xH({path:i,persistState:!0})}t.hook("app:manifest:update",()=>{e.beforeResolve(o)}),e.onError((s,i)=>{r.has(s)&&o(i)})}}),PH=In({name:"pinia",setup(t){const e=T$();return t.vueApp.use(e),qf(e),t.payload&&t.payload.pinia&&(e.state.value=t.payload.pinia),{provide:{pinia:e}}}}),HH=In({name:"nuxt:global-components"}),Hi={default:SN(()=>Wt(()=>import("./ZEeXGbGc.js"),__vite__mapDeps([20,21,8,3,12]),import.meta.url).then(t=>t.default||t))},BH=In({name:"nuxt:prefetch",setup(t){const e=gn();t.hooks.hook("app:mounted",()=>{e.beforeEach(async n=>{const r=n?.meta?.layout;r&&typeof Hi[r]=="function"&&await Hi[r]()})}),t.hooks.hook("link:prefetch",n=>{if(xs(n))return;const r=e.resolve(n);if(!r)return;const o=r.meta.layout;let s=Vw(r.meta.middleware);s=s.filter(i=>typeof i=="string");for(const i of s)typeof dv[i]=="function"&&dv[i]();
7typeof o=="string"&&o in Hi&&kH(Hi[o])})}}),FH="AppCookiebotConsentBanner",jH=t=>`https://consent.cookiebot.com/uc.js?cbid=${t.cookieBotId}${t?.culture?`&culture=${t.culture}`:""}${t?.blockingMode?`&blockingmode=${t.blockingMode}`:""}`;function zH(){const t={info:"\x1B[44m",warn:"\x1B[43m",error:"\x1B[41m",success:"\x1B[42m",transparent:"\x1B[0m"};function e(a,l){return`- ${t[a]} Cookiebot plugin ${a}: ${t.transparent} ${l}`}function n(a,...l){console.error(e("error",a),...l)}function r(a,...l){console.info(e("info",a),...l)}function o(a,...l){console.log(e("success",a),...l)}function s(a,...l){console.warn(e("warn",a),...l)}function i(a,l){s(`"${a}" is deprecated and will be removed in future release. Please use "${l}" instead.`)}return{deprecationNotice:i,info:r,error:n,success:o,warn:s}}const VH=!0,UH="48d2eed9-73d6-4328-92a9-7e0565c389d0",qH=Object.freeze(Object.defineProperty({__proto__:null,autoConsentBanner:VH,cookieBotId:UH},Symbol.toStringTag,{value:"Module"})),WH=In(t=>{const e="$i18n"in t&&"locale"in t.$i18n?t.$i18n.locale.value:void 0,n=gn(),{error:r}=zH(),{autoConsentBanner:o,cookieBotId:s,culture:i=e,...a}=qH;if(!s?.length)return r("No Cookiebot ID given. Aborting...");o&&_D({script:[{id:FH,src:jH({cookieBotId:s,culture:i,...a})}]},{}),n.afterEach(()=>{window instanceof Window&&"Cookiebot"in window&&window.requestAnimationFrame(()=>{window.Cookiebot.runScripts()})})});function t6(t={}){const{useProxy:e=!0}=t,n=yo(),r=n.public.backendUrl,o=n.public.apiProxyUrl!==void 0&&n.public.apiProxyUrl!==null?n.public.apiProxyUrl:!1;let s=r+"/wp-json";return e&&o!==!1&&(s=o+"/wp-json"),{admin:r,api:s,apiProxy:o,backendRewriteUrls:n.public.backendRewriteUrls,cacheKey:null}}function hC(t,e={}){const n=["pdf","xlsx","xls","xlsm","doc","docx","ppt","pptx","zip"],{admin:r,backendRewriteUrls:o}=t6();new URL(r);let s="",i,a="",l=!1;if(t&&t!=="#")if(t.startsWith("#"))i=null,s=t;else if(t.startsWith("/")){const d=typeof window<"u"?window.location.origin:r;i=new URL(t,d),s=t}else try{i=new URL(t),s=t}catch{i=null,s=t}else i=null;let c=!1,u=o.split(",");return u.includes(r)||u.push(r),typeof window<"u"&&!u.includes(window.location.origin)&&u.push(window.location.origin),i&&o&&u.forEach(d=>{if(d.indexOf("localhost")===0)i&&i.host==="localhost"&&(c=!0,s=i.pathname,i.search&&(s+=i.search));else{const f=new URL(d);i&&i.host===f.host&&(c=!0,s=i.pathname,i.search&&(s+=i.search))}}
7),s&&(a=s.split("/").pop(),n.forEach(d=>{a=a.replace("."+d,"")}),l=n.some(function(d){return s.indexOf("."+d)!==-1})),{path:s,url:i,isInternal:c,isDownloadFile:l,fileTitle:a}}function KH(t){const e=yo(),n=new URL(t);let r=t;const o=e.public.assetProxyUrl!==void 0&&e.public.assetProxyUrl!==null?e.public.assetProxyUrl:!1;return o&&(r=o+n.pathname.replace("/wp-content/uploads/","/")),{url:r,isProxy:o!==!1}}const GH=In(t=>{const e=t6();function n(a){let l=e.api;return a&&(l=l+a),l}function r(a,l=!1){let c;l?c=a:a.hasOwnProperty("url")&&(c=a.url);const{isInternal:u,path:d}=hC(c);return u?d:""}function o(a){let l=a;a&&a.hasOwnProperty("url")&&(l=a.url);const{isInternal:c}=hC(l);return c}const s=(a,l=!1)=>{let c=[],u;return l?u=a.settings.spacer_2:u=a.settings,!u.hide_spacer_at||u.hide_spacer_at.length===0?"":(u.hide_spacer_at.includes("mobile")&&c.push("max-sm:hidden"),u.hide_spacer_at.includes("tablet")&&c.push("sm:max-md:hidden"),u.hide_spacer_at.includes("small-desk")&&c.push("md:max-lg:hidden"),u.hide_spacer_at.includes("desktop")&&c.push("lg:max-xl:hidden"),u.hide_spacer_at.includes("large")&&c.push("xl:max-3xl:hidden"),u.hide_spacer_at.includes("xlarge")&&c.push("3xl:max-4xl:hidden"),u.hide_spacer_at.includes("xxlarge")&&c.push("4xl:hidden"),c.join(" "))},i=async(a,l)=>{if(!a||!l)return;const{url:c}=KH(l);try{const u=await fetch(c);if(u.status!==200)throw new Error(`Unable to download file. HTTP status: ${u.status}`);const d=await u.blob(),f=document.createElement("a");f.href=URL.createObjectURL(d),f.setAttribute("target","_blank"),f.download=a,document.body.appendChild(f),f.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),setTimeout(()=>{URL.revokeObjectURL(f.href),document.body.removeChild(f)},100)}catch(u){console.error("Error downloading the file:",u.message)}};return{provide:{apiReqUrl:(a,l)=>n(a),visibilityClasses:(a,l)=>s(a,l),getInternalPath:(a,l=!1)=>r(a,l),isInternalLink:a=>o(a),downloadFile:(a,l)=>i(a,l)}}});var om={},JH=Object.defineProperty,YH=(t,e,n)=>e in t?JH(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Rn=(t,e,n)=>(YH(t,typeof e!="symbol"?e+"":e,n),n);const lt=dr("flowstore",{state:()=>({context:{},revision:{},editorOptions:[],options:{backend:"https://checkmate-theme.staging-test.dk",frontend:"http://localhost:5173",backendDriver:"wordpress",availableBlocks:null},loading:!1,preLoading:!0,flexPopupOpen:!1,mediaPopupOpen:!1,editMode:!0,backdrop:!1,currentPath:"#/",collaborationStopped:!1,shareActive:!1,shareId:0}),getters:{getShareActive(t){return t.shareActive},getShareId(t){return t.shareId},pageContext(t){return t.context},revisionContext(t){return t.revision},getEditMode(t){return t.editMode},getOptions(t){return t.options},getAvailableBlocks(t){return t.options.availableBlocks},getLoading(t){return t.loading},getPreloading(t){return t.preLoading},getFlexPopupOpen(t){return t.flexPopupOpen},getMediaPopupOpen(t){return t.mediaPopupOpen},getBackdrop(t){return t.backdrop},getCurrentPath(t){return t.currentPath},isErrorPage(t){return t.currentPath==="#/404"||t.collaborationStopped},getCollaborationStopped(t){return t.collaborationStopped},getLoadingClass(){return"fm-opacity-50 fm-pointer-events-none"},getBreadcrumbs(t){if(!t.context.yoast_head_json)return[];const e=t.context.yoast_head_json.schema["@graph"].find(n=>n["@type"]==="BreadcrumbList");return e?e.itemListElement:[]}},actions:{setContext(t){this.context=t},setRevision(t){this.revision=t},setLoading(t){this.loading=t},setShareActive(t){this.shareActive=t},setShareId(t){this.shareId=t},isBlockAvailable(t){return this.options.availableBlocks?this.options.availableBlocks.split(",").includes(t):!0},setCollaborationStopped(t){this.collaborationStopped=t},resetRevision(){this.revision={}},setPreloading(t){this.preLoading=t},setOptions(t){this.options=t},unsetContext(){this.context={}},toggleFlexPopup(){this.flexPopupOpen=!this.flexPopupOpen},toggleMediaPopup(){this.mediaPopupOpen=!this.mediaPopupOpen},setBackdrop(t){this.backdrop=t},setCurrentPath(t){this.currentPath=t},removeBlock(t){this.context.acf.content.splice(t,1),document.dispatchEvent(new CustomEvent("flowmate-block-removed",{}))},addFlexBlock(t,e){e&&e.data_models[t]&&(this.context.acf.content||(this.context.acf.content=[]),this.context.acf.content.push(JSON.parse(JSON.stringify(e.data_models[t]))),this.flexPopupOpen&&(this.flexPopupOpen=!1),document.dispatchEvent(new CustomEvent("flowmate-block-added",{})))},async savePage(){if(this.loading=!0,console.log("savePage"),this.options.backend){const t=this.options.backend+"/wp-json/flowmate/v1/content/"+this.context.
7id;await fetch(t,{method:"PUT",body:JSON.stringify(this.context),headers:{"Content-Type":"application/json"}}).then(e=>{console.log(e)})}else console.log("No backend url set");this.loading=!1}}}),li=dr("navigationStore",{state:()=>({menues:["organizer","revisions"],openStatus:{left:{main:!0,organizer:!1,revisions:!1},right:{status:!0,options:!1,seo:!1},debugger:!1,user:!1}}),getters:{getOpenStatuses(t){return t.openStatus},getLeftOpenStatus(t){return t.openStatus.left.main},getRightOpenStatus(t){return t.openStatus.right},getUserMenuOpenStatus(t){return t.openStatus.user},getCollaborateOpenStatus(t){return t.openStatus.left.collaborate},getDebuggerOpenStatus(t){return t.openStatus.debugger}},actions:{getOpenStatus(t,e){return t?this.openStatus[t][e]:this.openStatus[e]},toggleNavigation(t,e){t?(this.menues.includes(e)&&this.menues.forEach(n=>{n!==e&&(this.openStatus[t][n]=!1,typeof window<"u"&&localStorage.setItem(t+"-"+n+"-open","false"))}),this.openStatus[t][e]=!this.openStatus[t][e],typeof window<"u"&&localStorage.setItem(t+"-"+e+"-open",this.openStatus[t][e])):(this.openStatus[e]=!this.openStatus[e],typeof window<"u"&&localStorage.setItem(e+"-open",this.openStatus[e]))},setStatesFromLocalStorage(){if(typeof window<"u")for(const t in this.openStatus)if(t==="left"||t==="right")for(const e in this.openStatus[t])localStorage.getItem(t+"-"+e+"-open")&&(this.openStatus[t][e]=localStorage.getItem(t+"-"+e+"-open")==="true");else localStorage.getItem(t+"-open")&&(this.openStatus[t]=localStorage.getItem(t+"-open")==="true")}}}),vu=dr("collaborateStore",{state:()=>({collaborateMode:!1,currentMessage:"",messages:[],chatOpen:!1,unreadMessages:0,collaborationID:null,collaborationGuests:[],notificationsOn:!0,guestColors:[{bg:"fm-bg-green-500",border:"fm-border-green-500",ring:"fm-ring-green-500",hex:"green"},{bg:"fm-bg-blue-500",border:"fm-border-blue-500",ring:"fm-ring-blue-500",hex:"blue"},{bg:"fm-bg-red-500",border:"fm-border-red-500",ring:"fm-ring-red-500",hex:"red"},{bg:"fm-bg-indigo-500",border:"fm-border-indigo-500",ring:"fm-ring-indigo-500",hex:"indigo"},{bg:"fm-bg-pink-500",border:"fm-border-pink-500",ring:"fm-ring-pink-500",hex:"pink"},{bg:"fm-bg-purple-500",border:"fm-border-purple-500",ring:"fm-ring-purple-500",hex:"purple"},{bg:"fm-bg-yellow-500",border:"fm-border-yellow-500",ring:"fm-ring-yellow-500",hex:"yellow"}],firebaseUser:null}),getters:{getCollaborateMode(t){return t.collaborateMode},getCurrentMessage(t){return t.currentMessage},getMessages(t){return t.messages},getChatOpen(t){return t.chatOpen},getNotificationsOn(t){return t.notificationsOn},getUnreadMessageCount(t){return t.unreadMessages},getCollaborationID(t){return t.collaborationID},getCollaborationGuests(t){return t.collaborationGuests},getGuestColor:t=>e=>{const n=Object.keys(t.collaborationGuests).findIndex(r=>t.collaborationGuests[r].uid===e.uid);return t.guestColors[n%t.guestColors.length]},getGuestInitials:t=>e=>{var n,r;let o=new RegExp(/(\p{L}{1})\p{L}+/,"gu"),s=[...e.name.matchAll(o)];return((((n=s.shift())==null?void 0:n[1])||"")+(((r=s.pop())==null?void 0:r[1])||"")).toUpperCase()},getFirebaseUser(t){return t.firebaseUser}},actions:{setCollaborateMode(t){this.collaborateMode=t},setUnreadMessageCount(t){this.unreadMessages=t},setMessages(t){t.length!==this.messages.length&&(this.messages=t)},clearCurrentMessage(){this.currentMessage=""},resetCollaboration(){this.collaborationID=null,this.collaborationGuests=[],this.collaborateMode=!1},setCollaborationID(t){this.collaborationID=t},toggleChat(){this.chatOpen=!this.chatOpen},setCollaborationGuests(t){this.collaborationGuests=t},setFirebaseUser(t){this.firebaseUser=t}}});var XH=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ZH(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function QH(t,e,n){return n={path:e,exports:{},require:function(r,o){return eB(r,o??n.path)}},t(n,n.exports),n.exports}function eB(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var tB=QH(function(t,e){(function(n,r){t.exports=r()})(XH,function(){return(function(n){var r={};function o(s){if(r[s])return r[s].exports;var i=r[s]={i:s,l:!1,exports:{}};return n[s].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=n,o.c=r,o.d=function(s,i,a){o.o(s,i)||Object.defineProperty(s,i,{enumerable:!0,get:a})},o.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})}
7,o.t=function(s,i){if(i&1&&(s=o(s)),i&8||i&4&&typeof s=="object"&&s&&s.__esModule)return s;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:s}),i&2&&typeof s!="string")for(var l in s)o.d(a,l,(function(c){return s[c]}).bind(null,l));return a},o.n=function(s){var i=s&&s.__esModule?(function(){return s.default}):(function(){return s});return o.d(i,"a",i),i},o.o=function(s,i){return Object.prototype.hasOwnProperty.call(s,i)},o.p="",o(o.s=6)})([function(n,r){function o(s){var i;if(s.nodeName==="SELECT")s.focus(),i=s.value;else if(s.nodeName==="INPUT"||s.nodeName==="TEXTAREA"){var a=s.hasAttribute("readonly");a||s.setAttribute("readonly",""),s.select(),s.setSelectionRange(0,s.value.length),a||s.removeAttribute("readonly"),i=s.value}else{s.hasAttribute("contenteditable")&&s.focus();var l=window.getSelection(),c=document.createRange();c.selectNodeContents(s),l.removeAllRanges(),l.addRange(c),i=l.toString()}return i}n.exports=o},function(n,r){function o(){}o.prototype={on:function(s,i,a){var l=this.e||(this.e={});return(l[s]||(l[s]=[])).push({fn:i,ctx:a}),this},once:function(s,i,a){var l=this;function c(){l.off(s,c),i.apply(a,arguments)}return c._=i,this.on(s,c,a)},emit:function(s){var i=[].slice.call(arguments,1),a=((this.e||(this.e={}))[s]||[]).slice(),l=0,c=a.length;for(l;l<c;l++)a[l].fn.apply(a[l].ctx,i);return this},off:function(s,i){var a=this.e||(this.e={}),l=a[s],c=[];if(l&&i)for(var u=0,d=l.length;u<d;u++)l[u].fn!==i&&l[u].fn._!==i&&c.push(l[u]);return c.length?a[s]=c:delete a[s],this}},n.exports=o,n.exports.TinyEmitter=o},function(n,r,o){var s=o(3),i=o(4);function a(d,f,h){if(!d&&!f&&!h)throw new Error("Missing required arguments");if(!s.string(f))throw new TypeError("Second argument must be a String");if(!s.fn(h))throw new TypeError("Third argument must be a Function");if(s.node(d))return l(d,f,h);if(s.nodeList(d))return c(d,f,h);if(s.string(d))return u(d,f,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function l(d,f,h){return d.addEventListener(f,h),{destroy:function(){d.removeEventListener(f,h)}}}function c(d,f,h){return Array.prototype.forEach.call(d,function(p){p.addEventListener(f,h)}),{destroy:function(){Array.prototype.forEach.call(d,function(p){p.removeEventListener(f,h)})}}}function u(d,f,h){return i(document.body,d,f,h)}n.exports=a},function(n,r){r.node=function(o){return o!==void 0&&o instanceof HTMLElement&&o.nodeType===1},r.nodeList=function(o){var s=Object.prototype.toString.call(o);return o!==void 0&&(s==="[object NodeList]"||s==="[object HTMLCollection]")&&"length"in o&&(o.length===0||r.node(o[0]))},r.string=function(o){return typeof o=="string"||o instanceof String},r.fn=function(o){var s=Object.prototype.toString.call(o);return s==="[object Function]"}},function(n,r,o){var s=o(5);function i(c,u,d,f,h){var p=l.apply(this,arguments);return c.addEventListener(d,p,h),{destroy:function(){c.removeEventListener(d,p,h)}}}function a(c,u,d,f,h){return typeof c.addEventListener=="function"?i.apply(null,arguments):typeof d=="function"?i.bind(null,document).apply(null,arguments):(typeof c=="string"&&(c=document.querySelectorAll(c)),Array.prototype.map.call(c,function(p){return i(p,u,d,f,h)}))}function l(c,u,d,f){return function(h){h.delegateTarget=s(h.target,u),h.delegateTarget&&f.call(c,h)}}n.exports=a},function(n,r){var o=9;if(typeof Element<"u"&&!Element.prototype.matches){var s=Element.prototype;s.matches=s.matchesSelector||s.mozMatchesSelector||s.msMatchesSelector||s.oMatchesSelector||s.webkitMatchesSelector}function i(a,l){for(;a&&a.nodeType!==o;){if(typeof a.matches=="function"&&a.matches(l))return a;a=a.parentNode}}n.exports=i},function(n,r,o){o.r(r);var s=o(0),i=o.n(s),a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},l=(function(){function M(T,A){for(var N=0;N<A.length;N++){var D=A[N];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(T,D.key,D)}}return function(T,A,N){return A&&M(T.prototype,A),N&&M(T,N),T}})();function c(M,T){if(!(M instanceof T))throw new TypeError("Cannot call a class as a function")}var u=(function(){function M(T){c(this,M),this.resolveOptions(T),this.initSelection()}return l(M,[{key:"resolveOptions",value:function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=T.action,this.container=T.container,this.emitter=T.emitter,this.target=T.target,this.text=T.text,this.trigger=T.trigger,this.selectedText=""}}
7,{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var T=this,A=document.documentElement.getAttribute("dir")=="rtl";this.removeFake(),this.fakeHandlerCallback=function(){return T.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[A?"right":"left"]="-9999px";var N=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=N+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=i()(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=i()(this.target),this.copyText()}},{key:"copyText",value:function(){var T=void 0;try{T=document.execCommand(this.action)}catch{T=!1}this.handleResult(T)}},{key:"handleResult",value:function(T){this.emitter.emit(T?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"copy";if(this._action=T,this._action!=="copy"&&this._action!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(T){if(T!==void 0)if(T&&(typeof T>"u"?"undefined":a(T))==="object"&&T.nodeType===1){if(this.action==="copy"&&T.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(this.action==="cut"&&(T.hasAttribute("readonly")||T.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);this._target=T}else throw new Error('Invalid "target" value, use a valid Element')},get:function(){return this._target}}]),M})(),d=u,f=o(1),h=o.n(f),p=o(2),g=o.n(p),y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},w=(function(){function M(T,A){for(var N=0;N<A.length;N++){var D=A[N];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(T,D.key,D)}}return function(T,A,N){return A&&M(T.prototype,A),N&&M(T,N),T}})();function x(M,T){if(!(M instanceof T))throw new TypeError("Cannot call a class as a function")}function C(M,T){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:M}function v(M,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);M.prototype=Object.create(T&&T.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(M,T):M.__proto__=T)}var S=(function(M){v(T,M);function T(A,N){x(this,T);var D=C(this,(T.__proto__||Object.getPrototypeOf(T)).call(this));return D.resolveOptions(N),D.listenClick(A),D}return w(T,[{key:"resolveOptions",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof A.action=="function"?A.action:this.defaultAction,this.target=typeof A.target=="function"?A.target:this.defaultTarget,this.text=typeof A.text=="function"?A.text:this.defaultText,this.container=y(A.container)==="object"?A.container:document.body}},{key:"listenClick",value:function(A){var N=this;this.listener=g()(A,"click",function(D){return N.onClick(D)})}},{key:"onClick",value:function(A){var N=A.delegateTarget||A.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new d({action:this.action(N),target:this.target(N),text:this.text(N),container:this.container,trigger:N,emitter:this})}},{key:"defaultAction",value:function(A){return E("action",A)}},{key:"defaultTarget",value:function(A){var N=E("target",A);if(N)return document.querySelector(N)}},{key:"defaultText",value:function(A){return E("text",A)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],N=typeof A=="string"?[A]:A,D=!!document.queryCommandSupported;
7return N.forEach(function($){D=D&&!!document.queryCommandSupported($)}),D}}]),T})(h.a);function E(M,T){var A="data-clipboard-"+M;if(T.hasAttribute(A))return T.getAttribute(A)}r.default=S}]).default})}),nB=ZH(tB);const n6=(t,e="copy")=>new Promise((n,r)=>{const o=document.createElement("button"),s=new nB(o,{text:()=>t,action:()=>e});s.on("success",i=>{s.destroy(),n(i)}),s.on("error",i=>{s.destroy(),r(i)}),document.body.appendChild(o),o.click(),document.body.removeChild(o)});let Eg=class{constructor(e){Rn(this,"name"),Rn(this,"features"),this.name=e.name,this.features=e.features}hasFeature(e){return this.features.some(n=>n.name===e)}getFeature(e){return this.hasFeature(e)?this.getFeatures().find(n=>n.name===e):[]}getFeatures(){return this.features}},bu=class{constructor({name:e,value:n,defaultValue:r,permissions:o}){Rn(this,"name"),Rn(this,"defaultValue"),Rn(this,"permissions"),Rn(this,"enabled"),this.name=e,this.enabled=n,this.defaultValue=r,this.permissions=o}get isEnabled(){return this.enabled}get isDisabled(){return!this.enabled}resetFeature(){this.enabled=this.defaultValue}setValue(e){this.enabled=e}withPermisions(e){const n=[];return e.forEach(r=>{var o;(o=this.permissions)!=null&&o.includes(r)&&n.push(r)}),this.permissions=n,this}asEnabled(){return this.enabled=!0,this}asDisabled(){return this.enabled=!1,this}toJSON(){return{...this}}};const rB=()=>new bu({name:"dashboard",value:!0,defaultValue:!0}),Ag=()=>new bu({name:"design",value:!0,defaultValue:!0,permissions:["create","read","update","delete","publish","share"]}),Uw=()=>new bu({name:"revisions",value:!0,defaultValue:!0,permissions:["create","read","update","delete","share"]}),Og=()=>new bu({name:"collaborate",value:!0,defaultValue:!0,permissions:["create","read","update","delete","chat"]}),r6=()=>new bu({name:"content",value:!0,defaultValue:!0,permissions:["read"]}),Ig=()=>new bu({name:"ui",value:!0,defaultValue:!0,permissions:["navbar","navbar.editToggle","navbar.collaborateToggle","navigation","navigationRight","navigationLeft","share","editor"]}),oB=new Eg({name:"default",features:[r6(),rB(),Uw(),Ag(),Og(),Ig()]}),sB=new Eg({name:"guest",features:[Ag().asEnabled().withPermisions(["read"]),Og().asEnabled().withPermisions(["read","update"]),Uw().asDisabled(),Ig()]}),iB=new Eg({name:"collaborator",features:[Ag().withPermisions(["read","update"]),Og().withPermisions(["read","update","chat"]),Ig()]}),pC=new Eg({name:"visitor",features:[Uw().asDisabled(),Og().asDisabled(),Ag().asDisabled(),r6().withPermisions(["read"]),Ig().withPermisions(["editor"])]}),_s=dr("featureStore",{state:()=>({currentRole:"visitor",guestRole:"guest",roles:[sB,iB,oB,pC],features:[...pC.getFeatures()],contextualFilters:{}}),getters:{getContextualFilters(t){return t.contextualFilters},getGuestRole(t){return t.guestRole},getCurrentRole(t){return t.currentRole},getRoles(t){return t.roles},getRole:t=>e=>t.roles.find(n=>n.name===e),getFeatures(t){return t.features},getFeature:t=>e=>t.features.find(n=>n.name===e)},actions:{resetContextualFilters(){this.contextualFilters={}},setContextualFilter(t,e){this.contextualFilters[t]=e},setGuestRole(t){this.guestRole=t},setFeatures(t){this.features=t},setCurrentRole(t){const e=this.getRole(t);
7e!==void 0?(this.currentRole=t,this.setFeatures(e.getFeatures())):console.error("Role not found")}}}),as=dr("userStore",{state:()=>({user:null,role:"guest",token:null,loginRedirectUri:"#/",allowGuestLogin:!1}),getters:{getUser(t){if(typeof window<"u"){let e=localStorage.getItem("fm-user");if(e)try{t.user=JSON.parse(atob(e))}catch{}}return t.user},getToken(t){if(typeof window<"u"){let e=localStorage.getItem("fm-token");e&&(t.token=e)}return t.token},getUserRole(t){if(typeof window<"u"&&window.localStorage){let e=window.localStorage.getItem("fm-user-role");e&&(t.role=e)}return t.role},getLoginRedirectUri(t){return t.loginRedirectUri},isGuestLoginAllowed(t){return t.allowGuestLogin}},actions:{signOut(){this.setUser(null),this.setToken(null),this.setUserRole(null)},setUser(t){typeof window<"u"&&(t?localStorage.setItem("fm-user",btoa(JSON.stringify(t))):localStorage.removeItem("fm-user")),this.user=t},setToken(t){typeof window<"u"&&(t?localStorage.setItem("fm-token",t):localStorage.removeItem("fm-token")),this.token=t},setUserRole(t){const{setCurrentRole:e}=_s();typeof window<"u"&&window.localStorage&&(t?window.localStorage.setItem("fm-user-role",t):window.localStorage.removeItem("fm-user-role")),e(t)},setLoginRedirectUri(t){this.loginRedirectUri=t},enableGuestLogin(){this.allowGuestLogin=!0},disableGuestLogin(){this.allowGuestLogin=!1}}}),Qt=()=>{const t=as(),e=_s(),n=()=>t.getUser,r=()=>n()?n().id:null,o=p=>{t.setUser(p)},s=p=>{t.setToken(p)},i=()=>t.getToken,a=()=>n()?n().avatar:null,l=()=>n()?n().name:null,c=()=>t.getUserRole,u=p=>{t.setUserRole(p)},d=U(()=>!!n()),f=U(()=>d?l():null),h=U(()=>d?a():null);return{getUser:n,setUser:o,setToken:s,getAuthToken:i,getAvatar:a,getUserId:r,getUsername:l,getUserRole:c,setRole:u,initUser:()=>{const p=n(),g=i(),y=c();return p?(g?e.setCurrentRole("default"):(y==="collaborator"||y==="guest")&&e.setCurrentRole(y),u(e.getCurrentRole),e.getCurrentRole):!1},signOut:()=>{t.signOut(),e.setCurrentRole("guest")},isUserLoggedIn:d,userName:f,userAvatar:h}},o6=dr("messageStore",{state:()=>({messages:[]}),getters:{getMessages(t){return t.messages}},actions:{writeMessage(t,e,n,r=!1,o){const s={message:t,errorCode:e,type:n,clickToClose:r,timestamp:o};this.messages.unshift(s)},removeMessage(t){const e=this.messages.findIndex(n=>n.timestamp===t);e!==-1&&this.messages.splice(e,1)}}}),ro=()=>{const t=o6();return{writeMessage:(e,n,r,o=!1,s=5)=>{const i=Date.now();t.writeMessage(e,n,r,o,i),o||setTimeout(()=>{t.removeMessage(i)},s*1e3)},removeMessage:e=>{t.removeMessage(e)}}},aB=t=>{const e="revisions",n=as();return{name:e,getItem:async(r,o)=>{n.getToken;const s=t+"/wp-json/flowmate/v1/revision/"+r,i={"Content-Type":"application/json"};return o!==void 0&&o.requestToken!==void 0&&(i.Authorization="Bearer "+o.requestToken),await fetch(s,{method:"GET",headers:i}).then(a=>a.json())},getAll:async(r,o=20,s)=>{console.log("GET ALL REVISIONS VIA API",r,o);const i=t+"/wp-json/flowmate/v1/content/"+r+"/revisions",a={"Content-Type":"application/json"};return s!==void 0&&s.requestToken!==void 0&&(a.Authorization="Bearer "+s.requestToken),await fetch(i,{method:"GET",headers:a}).then(l=>l.json())},updateItem:async(r,o,s)=>{const{writeMessage:i}=ro(),a=t+"/wp-json/flowmate/v1/revision/"+r,l={"Content-Type":"application/json"};s!==void 0&&s.requestToken!==void 0&&(l.Authorization="Bearer "+s.requestToken);let c=await fetch(a,{method:"PUT",body:JSON.stringify(o),headers:l}).then(u=>u.json());if(c.id)return i("Revision updated",null,"success"),c;c.data&&c.data.status&&c.data.status>299&&i(c.message,c.data.status,"error",!0)},updateStatus:async(r,o,s)=>{const i=t+"/wp-json/flowmate/v1/revision/"+r+"/status",a={"Content-Type":"application/json"};return s!==void 0&&s.requestToken!==void 0&&(a.Authorization="Bearer "+s.requestToken),await fetch(i,{method:"PUT",body:JSON.stringify({status:o}),headers:a}).then(l=>l.json())},deleteItem:async(r,o)=>{const{writeMessage:s}=ro(),i=t+"/wp-json/flowmate/v1/revision/"+r,a={"Content-Type":"application/json"};o!==void 0&&o.requestToken!==void 0&&(a.Authorization="Bearer "+o.requestToken);let l=await fetch(i,{method:"DELETE",headers:a}).then(c=>c.json());if(l.message)return s(l.message,null,"success"),l;l.data&&l.data.status&&l.data.status>299&&s(l.message,l.data.status,"error",!0)},createItem:async(r,o)=>{const{writeMessage:s}=ro(),i=t+"/wp-json/flowmate/v1/revisions",a={"Content-Type":"application/json"};o!==void 0&&o.requestToken!==void 0&&(a.Authorization="Bearer "+o.requestToken);let l=await fetch(i,{method:"POST",body:JSON.stringify(r),headers:a}).then(c=>c.json());
7if(console.log("RES RES",l),l.id)return s("Revision created",null,"success"),l;l.data&&l.data.status&&l.data.status>299&&s(l.message,l.data.status,"error",!0)},getByShareId:async(r,o)=>{const s=t+"/wp-json/flowmate/v1/revision/share/"+r;return o!==void 0&&o.requestToken!==void 0&&""+o.requestToken,await fetch(s,{method:"GET"}).then(i=>i.json())}}},lB=t=>({name:"content",getItem:async(e,n)=>{const r=t+"/wp-json/wp/v2/pages?lazy=true&acf_format=standard&acf_content=true&id="+e,o={"Content-Type":"application/json"};return n!==void 0&&n.requestToken!==void 0&&(o.Authorization="Bearer "+n.requestToken),await fetch(r,{method:"GET",headers:o}).then(s=>s.json())},getAll:async(e=1,n=20,r)=>{let o=t+"/wp-json/flowmate/v1/content?per_page="+n+"&page="+e;const s={"Content-Type":"application/json"};return r!==void 0&&r.requestToken!==void 0&&(s.Authorization="Bearer "+r.requestToken),await fetch(o,{method:"GET",headers:s}).then(i=>i.json())},updateItem:async(e,n)=>{},createItem:async e=>{},deleteItem:async e=>{}}),cB=t=>({name:"config",getItem:async(e,n)=>{let r=t+"/wp-json/flowmate/v1/content/config/";const o={"Content-Type":"application/json"};return n!==void 0&&n.requestToken!==void 0&&(o.Authorization="Bearer "+n.requestToken),await fetch(r,{method:"GET",headers:o}).then(s=>s.json())},getAll:async(e,n=20,r)=>{console.log("GET ALL REVISIONS VIA API",e,n)},updateItem:async(e,n,r)=>{},createItem:async(e,n)=>{},deleteItem:async(e,n)=>{}}),uB=t=>(as(),{name:"auth",login:async(n,r)=>{const o=t+"/wp-json/flowmate/v1/auth";return await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:n,pass:r})}).then(s=>s.json())},renewToken:async n=>{let r=t+"/wp-json/flowmate/v1/auth/renew";return await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}}).then(o=>o.json())},validateToken:async n=>{const r=t+"/wp-json/flowmate/v1/auth/validate";return await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}}).then(o=>o.json())}}),dB=t=>({services:()=>[aB(t),lB(t),uB(t),cB(t)]}),jo=()=>{const t=lt(),e=t.options.backendDriver?t.options.backendDriver:"wordpress",n=t.options.backend,r=()=>{switch(e){case"wordpress":default:return dB(n);case"laravel":break}},o=()=>r().services(),s=a=>!!o().find(l=>l.name===a),i=a=>o().find(l=>l.name===a)??!1;return{getService:i,hasService:s,auth:()=>i("auth"),revisions:()=>i("revisions"),content:()=>i("content"),config:()=>i("config")}},Pc=()=>{console.log("useAuth()");const t=as(),e=jo(),n=Qt(),r=async(c,u)=>{const{writeMessage:d}=ro(),f=await e.auth().login(c,u);return f.token&&f.user?(n.setToken(f.token),n.setUser(f.user),n.setRole("default")):d(f.message,"Error","error"),f},o=async(c,u)=>{n.setUser({name:c}),n.setRole(u)},s=async(c,u)=>{const{writeMessage:d}=ro();return parseInt(c)===l(u)?(n.setUser({name:"visitor"}),n.setRole("visitor"),!0):(d("Try again...","Wrong password","error"),!1)},i=async c=>await e.auth().validateToken(c),a=async c=>{const u=await e.auth().renewToken(c);return t.setToken(u.token),t.setUser(u.user),u},l=(c,u=0)=>{let d=3735928559^u,f=1103547991^u;for(let h=0,p;h<c.length;h++)p=c.charCodeAt(h),d=Math.imul(d^p,2654435761),f=Math.imul(f^p,1597334677);return d=Math.imul(d^d>>>16,2246822507)^Math.imul(f^f>>>13,3266489909),f=Math.imul(f^f>>>16,2246822507)^Math.imul(d^d>>>13,3266489909),4294967296*(2097151&f)+(d>>>0)};return{auth:r,authGuest:o,authVisitor:s,validate:i,renew:a,generateHash:l}},fB=()=>{const{validate:t}=Pc();lt();const e=_s(),n=as();return{path:"#/redirect/wp-edit",callback:async r=>{const o=r.params.get("auth"),s=JSON.parse(atob(o));if(!n.getToken){console.log("WE ARE NOT LOGGED IN");const i=await t(s.token);if(!i)return{redirectUrl:"#/login"};n.setToken(i.token),n.setUser(i.user),e.setCurrentRole("default")}return{redirectUrl:"#/design/"+s.id}}}},Hr=()=>{const t=lt(),e=s=>{console.log("SET CONTEXT",s),t.setContext(s)},n=()=>t.pageContext,r=U(()=>n().id),o=U(()=>n());return{setContext:e,getContext:n,context:o,contextId:r}},He=(t,e)=>{const n=_s();let r="",o=t;if(t.includes(".")){const l=t.split(".");o=l[0],r=l[1]}const s=n.getFeature(o),i=l=>!a(),a=l=>{const c=n.getContextualFilters;return s?c[t]!==void 0?c[t]:s.enabled&&r?s.permissions!==void 0?s.permissions.includes(r):!1:s.enabled:!1};return{asDisabled:l=>{n.setContextualFilter(t,!1)},asEnabled:l=>{n.setContextualFilter(t,!0)},isDisabled:i,isEnabled:a}},$r=t=>{const e=lt(),n=pe(!0),r=pe(null),o=Qt(),s=jo(),i=async(y,w=!0)=>{const{redirect:x}=_r(),C=await u(y);C.context?e.setRevision(C):x("#/404"),C.context&&w&&e.setContext(C.
7context)},a=()=>Object.keys(e.revisionContext).length===0&&e.revisionContext.constructor===Object?!1:e.revisionContext,l=()=>e.revisionContext.hasOwnProperty("id")?e.revisionContext.id:!1,c=async(y,w)=>{n.value=!0;const x=await s.revisions().getAll(y,50,{...w,requestToken:o.getAuthToken()});n.value=!1,r.value=x},u=async y=>await s.getService("revisions").getItem(y,{requestToken:o.getAuthToken()}),d=async(y,w)=>{const x=await s.revisions().updateItem(y,w,{requestToken:o.getAuthToken()});return e.setRevision(x),e.setContext(x.context),x},f=async y=>await s.revisions().deleteItem(y,{requestToken:o.getAuthToken()}),h=async y=>{const w=await s.revisions().createItem(y,{requestToken:o.getAuthToken()});return e.setRevision(w),e.setContext(w.context),w},p=async(y,w)=>{const x=await s.revisions().updateStatus(y,w,{requestToken:o.getAuthToken()});return e.setRevision(x),x},g=()=>{e.resetRevision()};return t&&c(t),{getRevision:u,getRevisions:c,getCurrentRevision:a,getCurrentRevisionId:l,deleteRevision:f,updateRevision:d,createRevision:h,updateStatus:p,setRevision:i,resetRevision:g,loading:n,revisions:r}},zr=dr("useEditableStore",{state:()=>({blockContext:{},blockIndex:null,fieldName:null,layoutName:null,activeMediaType:null,activeFieldType:null,activeParent:null,isSetting:!1,updatedAt:null,mediaUpdatedAt:null,postsUpdatedAt:null,config:{layouts:!1},options:{backend:"https://checkmate-theme.staging-test.dk"},editMode:!0,darkMode:!1}),getters:{getUpdatedAt(t){return t.updatedAt},getMediaUpdatedAt(t){return t.mediaUpdatedAt},getPostsUpdatedAt(t){return t.postsUpdatedAt},getIsSetting(t){return t.isSetting},getBlockContext(t){return t.blockContext},getBlockIndex(t){return t.blockIndex},getFieldName(t){return t.fieldName},getActiveParent(t){return t.activeParent},getLayoutName(t){return t.layoutName},getActiveFieldType(t){return t.activeFieldType},getActiveMediaTypes(t){return t.activeMediaType},getConfig(t){return t.config},getOptions(t){return t.options},getEditMode(t){return t.editMode},getDarkMode(t){return t.darkMode}},actions:{setValues(t,e,n,r,o,s,i,a,l){console.log("setValues",t,e,n,r,o,s,i,a),this.blockContext=t,this.blockIndex=e,this.fieldName=n,this.layoutName=i,this.activeMediaType=r,this.activeFieldType=o,this.isSetting=a,this.activeParent=l,s==="media"?this.mediaUpdatedAt=Date.now():s==="posts"&&(this.postsUpdatedAt=Date.now())},setOptions(t){this.options=t},setEditMode(t){this.editMode=t,typeof window<"u"&&localStorage.setItem("edit-mode",this.editMode.toString())},setDarkMode(t){this.darkMode=t,typeof window<"u"&&localStorage.setItem("dark-mode",this.darkMode.toString())},setConfig(t){t.hasOwnProperty("layouts")||(t.layouts=t.data_models),this.config=t},setStatesFromLocalStorage(){typeof window<"u"&&(localStorage.getItem("edit-mode")&&(this.editMode=localStorage.getItem("edit-mode")==="true"),localStorage.getItem("dark-mode")&&(this.darkMode=localStorage.getItem("dark-mode")==="true"))}}}),hB=()=>{const t=lt(),e=jo(),n=Qt(),r=zr();return{path:"#/design/:id",callback:async o=>{_r();const s=o.uriSegments[2];if(!n.isUserLoggedIn.value||!He("design").isEnabled())return{redirectUrl:"#/login?redirect="+o.path};{const i=await e.content().getItem(s,{requestToken:n.getAuthToken()});if(He("revisions").isEnabled()&&$r().resetRevision(),i.length===0)return{redirectUrl:He("content.read").isEnabled()?"/#/content":"/#/404"};console.log("RESPONSE",i),r.setEditMode(!0),Hr().setContext(i[0])}t.setPreloading(!1)}}},s6=dr("pluginStore",{state:()=>({pluginDefinitions:[]}),getters:{getPluginDefinitions(t){return t.pluginDefinitions},getPluginDefinition(t){return e=>t.pluginDefinitions.find(n=>n.name===e)||null},getPluginConfig(t){return e=>{const n=t.pluginDefinitions.find(r=>r.name===e);return n?n.config:null}}},actions:{addPluginDefinition(t){if(this.pluginDefinitions.find(e=>e.name===t.name))throw new Error("Plugin already exists");this.pluginDefinitions.push(t)},removePluginDefinition(t){const e=this.pluginDefinitions.findIndex(n=>n.name===t);e>-1&&this.pluginDefinitions.splice(e,1)},setPluginDefinitions(t){this.pluginDefinitions=t}}});var mC;const pB=typeof window<"u",gC=()=>{};pB&&(mC=window?.navigator)!=null&&mC.userAgent&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function yC(t){return typeof t=="function"?t():b(t)}function mB(t,e){function n(...r){return new Promise((o,s)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(o).catch(s)})}return n}const gB=t=>t();function yB(t,e={}){let n,r,o=gC;const s=i=>{clearTimeout(i),o(),o=gC};return i=>{const a=yC(t),l=yC(e.maxWait);return n&&s(n),a<=0||l!==void 0&&l<=0?(r&&(s(r),r=null),Promise.resolve(i())):new Promise((c,u)=>{o=e.rejectOnCancel?u:c,l&&!r&&(r=setTimeout(()=>{n&&s(n),r=null,c(i())},l)),n=setTimeout(()=>{r&&s(r),r=null,c(i())},a)})}}var vC=Object.getOwnPropertySymbols,vB=Object.prototype.hasOwnProperty,bB=Object.prototype.propertyIsEnumerable,wB=(t,e)=>{var n={};for(var r in t)vB.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&vC)for(var r of vC(t))e.indexOf(r)<0&&bB.call(t,r)&&(n[r]=t[r]);return n};function kB(t,e,n={}){const r=n,{eventFilter:o=gB}=r,s=wB(r,["eventFilter"]);return Ye(t,mB(o,e),s)}var xB=Object.defineProperty,CB=Object.defineProperties,_B=Object.getOwnPropertyDescriptors,sm=Object.getOwnPropertySymbols,i6=Object.prototype.hasOwnProperty,a6=Object.prototype.propertyIsEnumerable,bC=(t,e,n)=>e in t?xB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,SB=(t,e)=>{for(var n in e||(e={}))i6.call(e,n)&&bC(t,n,e[n]);if(sm)for(var n of sm(e))a6.call(e,n)&&bC(t,n,e[n]);return t},MB=(t,e)=>CB(t,_B(e)),TB=(t,e)=>{var n={};for(var r in t)i6.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&sm)for(var r of sm(t))e.indexOf(r)<0&&a6.call(t,r)&&(n[r]=t[r]);return n};function EB(t,e,n={}){const r=n,{debounce:o=0,maxWait:s=void 0}=r,i=TB(r,["debounce","maxWait"]);
7return kB(t,e,MB(SB({},i),{eventFilter:yB(o,{maxWait:s})}))}const l6={NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};const fe=function(t,e){if(!t)throw wu(e)},wu=function(t){return new Error("Firebase Database ("+l6.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)};const c6=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let o=t.charCodeAt(r);o<128?e[n++]=o:o<2048?(e[n++]=o>>6|192,e[n++]=o&63|128):(o&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(o=65536+((o&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=o>>18|240,e[n++]=o>>12&63|128,e[n++]=o>>6&63|128,e[n++]=o&63|128):(e[n++]=o>>12|224,e[n++]=o>>6&63|128,e[n++]=o&63|128)}return e},AB=function(t){const e=[];let n=0,r=0;for(;n<t.length;){const o=t[n++];if(o<128)e[r++]=String.fromCharCode(o);else if(o>191&&o<224){const s=t[n++];e[r++]=String.fromCharCode((o&31)<<6|s&63)}else if(o>239&&o<365){const s=t[n++],i=t[n++],a=t[n++],l=((o&7)<<18|(s&63)<<12|(i&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(l>>10)),e[r++]=String.fromCharCode(56320+(l&1023))}else{const s=t[n++],i=t[n++];e[r++]=String.fromCharCode((o&15)<<12|(s&63)<<6|i&63)}}return e.join("")},qw={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let o=0;o<t.length;o+=3){const s=t[o],i=o+1<t.length,a=i?t[o+1]:0,l=o+2<t.length,c=l?t[o+2]:0,u=s>>2,d=(s&3)<<4|a>>4;let f=(a&15)<<2|c>>6,h=c&63;l||(h=64,i||(f=64)),r.push(n[u],n[d],n[f],n[h])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(c6(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):AB(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let o=0;o<t.length;){const s=n[t.charAt(o++)],i=o<t.length?n[t.charAt(o)]:0;++o;const a=o<t.length?n[t.charAt(o)]:64;++o;const l=o<t.length?n[t.charAt(o)]:64;if(++o,s==null||i==null||a==null||l==null)throw new OB;const c=s<<2|i>>4;if(r.push(c),a!==64){const u=i<<4&240|a>>2;if(r.push(u),l!==64){const d=a<<6&192|l;r.push(d)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class OB extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const u6=function(t){const e=c6(t);return qw.encodeByteArray(e,!0)},im=function(t){return u6(t).replace(/\./g,"")},am=function(t){try{return qw.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function IB(t){return d6(void 0,t)}function d6(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:const n=e;return new Date(n.getTime());case Object:t===void 0&&(t={});break;case Array:t=[];break;default:return e}for(const n in e)!e.hasOwnProperty(n)||!NB(n)||(t[n]=d6(t[n],e[n]));return t}function NB(t){return t!=="__proto__"}function LB(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}const RB=()=>LB().__FIREBASE_DEFAULTS__,$B=()=>{if(typeof process>"u"||typeof om>"u")return;const t=om.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},DB=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;
7]+)/)}catch{return}const e=t&&am(t[1]);return e&&JSON.parse(e)},Ww=()=>{try{return RB()||$B()||DB()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},f6=t=>{var e,n;return(n=(e=Ww())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},PB=t=>{const e=f6(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},h6=()=>{var t;return(t=Ww())===null||t===void 0?void 0:t.config},p6=t=>{var e;return(e=Ww())===null||e===void 0?void 0:e[`_${t}`]};let Wf=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}};function HB(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",o=t.iat||0,s=t.sub||t.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:o,exp:o+3600,auth_time:o,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},t);return[im(JSON.stringify(n)),im(JSON.stringify(i)),""].join(".")}function zn(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Kw(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(zn())}function BB(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function m6(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function FB(){const t=zn();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function jB(){return l6.NODE_ADMIN===!0}function zB(){try{return typeof indexedDB=="object"}catch{return!1}}function VB(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(r);o.onsuccess=()=>{o.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},o.onupgradeneeded=()=>{n=!1},o.onerror=()=>{var s;e(((s=o.error)===null||s===void 0?void 0:s.message)||"")}}catch(n){e(n)}})}const UB="FirebaseError";class ha extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=UB,Object.setPrototypeOf(this,ha.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Kf.prototype.create)}}let Kf=class{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},o=`${this.service}/${e}`,s=this.errors[e],i=s?qB(s,r):"Error",a=`${this.serviceName}: ${i} (${o}).`;return new ha(o,a,r)}};function qB(t,e){return t.replace(WB,(n,r)=>{const o=e[r];return o!=null?String(o):`<${r}?>`})}const WB=/\{\$([^}]+)}/g;function ff(t){return JSON.parse(t)}function sn(t){return JSON.stringify(t)}const g6=function(t){let e={},n={},r={},o="";try{const s=t.split(".");e=ff(am(s[0])||""),n=ff(am(s[1])||""),o=s[2],r=n.d||{},delete n.d}catch{}return{header:e,claims:n,data:r,signature:o}},KB=function(t){const e=g6(t),n=e.claims;return!!n&&typeof n=="object"&&n.hasOwnProperty("iat")},GB=function(t){const e=g6(t).claims;return typeof e=="object"&&e.admin===!0};function Ss(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Hc(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function hv(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function lm(t,e,n){const r={};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=e.call(n,t[o],o,t));return r}function cm(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const o of n){if(!r.includes(o))return!1;const s=t[o],i=e[o];if(wC(s)&&wC(i)){if(!cm(s,i))return!1}else if(s!==i)return!1}for(const o of r)if(!n.includes(o))return!1;return!0}function wC(t){return t!==null&&typeof t=="object"}function ku(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(o=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(o))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}class JB{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=512/8,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,n){n||(n=0);const r=this.W_;if(typeof e=="string")for(let d=0;d<16;d++)r[d]=e.charCodeAt(n)<<24|e.charCodeAt(n+1)<<16|e.charCodeAt(n+2)<<8|e.charCodeAt(n+3),n+=4;else for(let d=0;d<16;d++)r[d]=e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3],n+=4;for(let d=16;d<80;d++){const f=r[d-3]^r[d-8]^r[d-14]^r[d-16];r[d]=(f<<1|f>>>31)&4294967295}let o=this.chain_[0],s=this.chain_[1],i=this.chain_[2],a=this.chain_[3],l=this.chain_[4],c,u;for(let d=0;d<80;d++){d<40?d<20?(c=a^s&(i^a),u=1518500249):(c=s^i^a,u=1859775393):d<60?(c=s&i|a&(s|i),u=2400959708):(c=s^i^a,u=3395469782);const f=(o<<5|o>>>27)+c+l+u+r[d]&4294967295;l=a,a=i,i=(s<<30|s>>>2)&4294967295,s=o,o=f}this.chain_[0]=this.chain_[0]+o&4294967295,this.chain_[1]=this.chain_[1]+s&4294967295,this.chain_[2]=this.chain_[2]+i&4294967295,this.chain_[3]=this.chain_[3]+a&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295}update(e,n){if(e==null)return;n===void 0&&(n=e.length);const r=n-this.blockSize;let o=0;const s=this.buf_;let i=this.inbuf_;for(;o<n;){if(i===0)for(;o<=r;)this.compress_(e,o),o+=this.blockSize;if(typeof e=="string"){for(;o<n;)if(s[i]=e.charCodeAt(o),++i,++o,i===this.blockSize){this.compress_(s),i=0;break}}else for(;o<n;)if(s[i]=e[o],++i,++o,i===this.blockSize){this.compress_(s),i=0;break}}this.inbuf_=i,this.total_+=n}
7digest(){const e=[];let n=this.total_*8;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let o=this.blockSize-1;o>=56;o--)this.buf_[o]=n&255,n/=256;this.compress_(this.buf_);let r=0;for(let o=0;o<5;o++)for(let s=24;s>=0;s-=8)e[r]=this.chain_[o]>>s&255,++r;return e}}function YB(t,e){const n=new XB(t,e);return n.subscribe.bind(n)}class XB{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let o;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");ZB(e,["next","error","complete"])?o=e:o={next:e,error:n,complete:r},o.next===void 0&&(o.next=Q0),o.error===void 0&&(o.error=Q0),o.complete===void 0&&(o.complete=Q0);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?o.error(this.finalError):o.complete()}catch{}}),this.observers.push(o),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function ZB(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function Q0(){}function Ng(t,e){return`${t} failed: ${e} argument `}const QB=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let o=t.charCodeAt(r);if(o>=55296&&o<=56319){const s=o-55296;r++,fe(r<t.length,"Surrogate pair missing trail surrogate.");const i=t.charCodeAt(r)-56320;o=65536+(s<<10)+i}o<128?e[n++]=o:o<2048?(e[n++]=o>>6|192,e[n++]=o&63|128):o<65536?(e[n++]=o>>12|224,e[n++]=o>>6&63|128,e[n++]=o&63|128):(e[n++]=o>>18|240,e[n++]=o>>12&63|128,e[n++]=o>>6&63|128,e[n++]=o&63|128)}return e},Lg=function(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,n++):e+=3}return e};function vo(t){return t&&t._delegate?t._delegate:t}let bl=class{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};const Ia="[DEFAULT]";class eF{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new Wf;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const o=this.getOrInitializeService({instanceIdentifier:n});o&&r.resolve(o)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const r=this.normalizeInstanceIdentifier(e?.identifier),o=(n=e?.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(o)return null;throw s}else{if(o)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(nF(e))try{this.getOrInitializeService({instanceIdentifier:Ia})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(n);try{const s=this.getOrInitializeService({instanceIdentifier:o});r.resolve(s)}catch{}}}}clearInstance(e=Ia){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=Ia){return this.instances.has(e)}getOptions(e=Ia){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const o=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[s,i]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(s);r===a&&i.resolve(o)}return o}onInit(e,n){var r;const o=this.normalizeInstanceIdentifier(n),s=(r=this.onInitCallbacks.get(o))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(o,s);const i=this.instances.get(o);return i&&e(i,o),()=>{s.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const o of r)try{o(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:tF(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=Ia){return this.component?this.component.multipleInstances?e:Ia:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function tF(t){return t===Ia?void 0:t}function nF(t){return t.instantiationMode==="EAGER"}class rF{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new eF(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}var Ct;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(Ct||(Ct={}));const oF={debug:Ct.DEBUG,verbose:Ct.VERBOSE,info:Ct.INFO,warn:Ct.WARN,error:Ct.ERROR,silent:Ct.SILENT},sF=Ct.INFO,iF={[Ct.DEBUG]:"log",[Ct.VERBOSE]:"log",[Ct.INFO]:"info",[Ct.WARN]:"warn",[Ct.ERROR]:"error"}
7,aF=(t,e,...n)=>{if(e<t.logLevel)return;const r=new Date().toISOString(),o=iF[e];if(o)console[o](`[${r}]  ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};let Gw=class{constructor(e){this.name=e,this._logLevel=sF,this._logHandler=aF,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Ct))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?oF[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,Ct.DEBUG,...e),this._logHandler(this,Ct.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Ct.VERBOSE,...e),this._logHandler(this,Ct.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Ct.INFO,...e),this._logHandler(this,Ct.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Ct.WARN,...e),this._logHandler(this,Ct.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Ct.ERROR,...e),this._logHandler(this,Ct.ERROR,...e)}};const lF=(t,e)=>e.some(n=>t instanceof n);let kC,xC;function cF(){return kC||(kC=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function uF(){return xC||(xC=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const y6=new WeakMap,pv=new WeakMap,v6=new WeakMap,ey=new WeakMap,Jw=new WeakMap;function dF(t){const e=new Promise((n,r)=>{const o=()=>{t.removeEventListener("success",s),t.removeEventListener("error",i)},s=()=>{n(Gi(t.result)),o()},i=()=>{r(t.error),o()};t.addEventListener("success",s),t.addEventListener("error",i)});return e.then(n=>{n instanceof IDBCursor&&y6.set(n,t)}).catch(()=>{}),Jw.set(e,t),e}function fF(t){if(pv.has(t))return;const e=new Promise((n,r)=>{const o=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",i),t.removeEventListener("abort",i)},s=()=>{n(),o()},i=()=>{r(t.error||new DOMException("AbortError","AbortError")),o()};t.addEventListener("complete",s),t.addEventListener("error",i),t.addEventListener("abort",i)});pv.set(t,e)}let mv={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return pv.get(t);if(e==="objectStoreNames")return t.objectStoreNames||v6.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Gi(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function hF(t){mv=t(mv)}function pF(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(ty(this),e,...n);return v6.set(r,e.sort?e.sort():[e]),Gi(r)}:uF().includes(t)?function(...e){return t.apply(ty(this),e),Gi(y6.get(this))}:function(...e){return Gi(t.apply(ty(this),e))}}function mF(t){return typeof t=="function"?pF(t):(t instanceof IDBTransaction&&fF(t),lF(t,cF())?new Proxy(t,mv):t)}function Gi(t){if(t instanceof IDBRequest)return dF(t);if(ey.has(t))return ey.get(t);const e=mF(t);return e!==t&&(ey.set(t,e),Jw.set(e,t)),e}const ty=t=>Jw.get(t);function gF(t,e,{blocked:n,upgrade:r,blocking:o,terminated:s}={}){const i=indexedDB.open(t,e),a=Gi(i);return r&&i.addEventListener("upgradeneeded",l=>{r(Gi(i.result),l.oldVersion,l.newVersion,Gi(i.transaction),l)}),n&&i.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{s&&l.addEventListener("close",()=>s()),o&&l.addEventListener("versionchange",c=>o(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const yF=["get","getKey","getAll","getAllKeys","count"],vF=["put","add","delete","clear"],ny=new Map;function CC(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(ny.get(e))return ny.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,o=vF.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(o||yF.includes(n)))return;const s=async function(i,...a){const l=this.transaction(i,o?"readwrite":"readonly");let c=l.store;
7return r&&(c=c.index(a.shift())),(await Promise.all([c[n](...a),o&&l.done]))[0]};return ny.set(e,s),s}hF(t=>({...t,get:(e,n,r)=>CC(e,n)||t.get(e,n,r),has:(e,n)=>!!CC(e,n)||t.has(e,n)}));class bF{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(wF(e)){const n=e.getImmediate();return`${n.library}/${n.version}`}else return null}).filter(e=>e).join(" ")}}function wF(t){const e=t.getComponent();return e?.type==="VERSION"}const gv="@firebase/app",_C="0.9.13";const wl=new Gw("@firebase/app"),kF="@firebase/app-compat",xF="@firebase/analytics-compat",CF="@firebase/analytics",_F="@firebase/app-check-compat",SF="@firebase/app-check",MF="@firebase/auth",TF="@firebase/auth-compat",EF="@firebase/database",AF="@firebase/database-compat",OF="@firebase/functions",IF="@firebase/functions-compat",NF="@firebase/installations",LF="@firebase/installations-compat",RF="@firebase/messaging",$F="@firebase/messaging-compat",DF="@firebase/performance",PF="@firebase/performance-compat",HF="@firebase/remote-config",BF="@firebase/remote-config-compat",FF="@firebase/storage",jF="@firebase/storage-compat",zF="@firebase/firestore",VF="@firebase/firestore-compat",UF="firebase",qF="9.23.0";const yv="[DEFAULT]",WF={[gv]:"fire-core",[kF]:"fire-core-compat",[CF]:"fire-analytics",[xF]:"fire-analytics-compat",[SF]:"fire-app-check",[_F]:"fire-app-check-compat",[MF]:"fire-auth",[TF]:"fire-auth-compat",[EF]:"fire-rtdb",[AF]:"fire-rtdb-compat",[OF]:"fire-fn",[IF]:"fire-fn-compat",[NF]:"fire-iid",[LF]:"fire-iid-compat",[RF]:"fire-fcm",[$F]:"fire-fcm-compat",[DF]:"fire-perf",[PF]:"fire-perf-compat",[HF]:"fire-rc",[BF]:"fire-rc-compat",[FF]:"fire-gcs",[jF]:"fire-gcs-compat",[zF]:"fire-fst",[VF]:"fire-fst-compat","fire-js":"fire-js",[UF]:"fire-js-all"};const um=new Map,vv=new Map;function KF(t,e){try{t.container.addComponent(e)}catch(n){wl.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Bc(t){const e=t.name;if(vv.has(e))return wl.debug(`There were multiple attempts to register component ${e}.`),!1;vv.set(e,t);for(const n of um.values())KF(n,t);return!0}function Yw(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}const GF={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
7d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},Ji=new Kf("app","Firebase",GF);class JF{constructor(e,n,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new bl("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Ji.create("app-deleted",{appName:this._name})}}const xu=qF;function b6(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r=Object.assign({name:yv,automaticDataCollectionEnabled:!1},e),o=r.name;if(typeof o!="string"||!o)throw Ji.create("bad-app-name",{appName:String(o)});if(n||(n=h6()),!n)throw Ji.create("no-options");const s=um.get(o);if(s){if(cm(n,s.options)&&cm(r,s.config))return s;throw Ji.create("duplicate-app",{appName:o})}const i=new rF(o);for(const l of vv.values())i.addComponent(l);const a=new JF(n,r,i);return um.set(o,a),a}function w6(t=yv){const e=um.get(t);if(!e&&t===yv&&h6())return b6();if(!e)throw Ji.create("no-app",{appName:t});return e}function Yi(t,e,n){var r;let o=(r=WF[t])!==null&&r!==void 0?r:t;n&&(o+=`-${n}`);const s=o.match(/\s|\//),i=e.match(/\s|\//);if(s||i){const a=[`Unable to register library "${o}" with version "${e}":`];s&&a.push(`library name "${o}" contains illegal characters (whitespace or "/")`),s&&i&&a.push("and"),i&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),wl.warn(a.join(" "));return}Bc(new bl(`${o}-version`,()=>({library:o,version:e}),"VERSION"))}const YF="firebase-heartbeat-database",XF=1,hf="firebase-heartbeat-store";let ry=null;
7function k6(){return ry||(ry=gF(YF,XF,{upgrade:(t,e)=>{e===0&&t.createObjectStore(hf)}}).catch(t=>{throw Ji.create("idb-open",{originalErrorMessage:t.message})})),ry}async function ZF(t){try{return await(await k6()).transaction(hf).objectStore(hf).get(x6(t))}catch(e){if(e instanceof ha)wl.warn(e.message);else{const n=Ji.create("idb-get",{originalErrorMessage:e?.message});wl.warn(n.message)}}}async function SC(t,e){try{const n=(await k6()).transaction(hf,"readwrite");await n.objectStore(hf).put(e,x6(t)),await n.done}catch(n){if(n instanceof ha)wl.warn(n.message);else{const r=Ji.create("idb-set",{originalErrorMessage:n?.message});wl.warn(r.message)}}}function x6(t){return`${t.name}!${t.options.appId}`}const QF=1024,ej=720*60*60*1e3;class tj{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new rj(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){const e=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),n=MC();if(this._heartbeatsCache===null&&(this._heartbeatsCache=await this._heartbeatsCachePromise),!(this._heartbeatsCache.lastSentHeartbeatDate===n||this._heartbeatsCache.heartbeats.some(r=>r.date===n)))return this._heartbeatsCache.heartbeats.push({date:n,agent:e}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(r=>{const o=new Date(r.date).valueOf();return Date.now()-o<=ej}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache===null||this._heartbeatsCache.heartbeats.length===0)return"";const e=MC(),{heartbeatsToSend:n,unsentEntries:r}=nj(this._heartbeatsCache.heartbeats),o=im(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}}function MC(){return new Date().toISOString().substring(0,10)}function nj(t,e=QF){const n=[];let r=t.slice();for(const o of t){const s=n.find(i=>i.agent===o.agent);if(s){if(s.dates.push(o.date),TC(n)>e){s.dates.pop();break}}else if(n.push({agent:o.agent,dates:[o.date]}),TC(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class rj{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return zB()?VB().then(()=>!0).catch(()=>!1):!1}async read(){return await this._canUseIndexedDBPromise?await ZF(this.app)||{heartbeats:[]}:{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const r=await this.read();return SC(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const r=await this.read();return SC(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function TC(t){return im(JSON.stringify({version:2,heartbeats:t})).length}function oj(t){Bc(new bl("platform-logger",e=>new bF(e),"PRIVATE")),Bc(new bl("heartbeat",e=>new tj(e),"PRIVATE")),Yi(gv,_C,t),Yi(gv,_C,"esm2017"),Yi("fire-js","")}oj("");var sj="firebase",ij="9.23.0";Yi(sj,ij,"app");const EC="@firebase/database",AC="0.14.4";let C6="";function aj(t){C6=t}class lj{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,n){n==null?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),sn(n))}get(e){const n=this.domStorage_.getItem(this.prefixedName_(e));return n==null?null:ff(n)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}}class cj{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,n){n==null?delete this.cache_[e]:this.cache_[e]=n}get(e){return Ss(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}}const _6=function(t){try{if(typeof window<"u"&&typeof window[t]<"u"){const e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new lj(e)}}catch{}return new cj},Va=_6("localStorage"),uj=_6("sessionStorage");const gc=new Gw("@firebase/database"),dj=(function(){let t=1;return function(){return t++}})(),S6=function(t){const e=QB(t),n=new JB;n.update(e);const r=n.digest();return qw.encodeByteArray(r)},Gf=function(...t){let e="";for(let n=0;n<t.length;n++){const r=t[n];Array.isArray(r)||r&&typeof r=="object"&&typeof r.length=="number"?e+=Gf.apply(null,r):typeof r=="object"?e+=sn(r):e+=r,e+=" "}return e};let Od=null,OC=!0;const fj=function(t,e){fe(!e,"Can't turn on custom loggers persistently."),gc.logLevel=Ct.VERBOSE,Od=gc.log.bind(gc)},Sn=function(...t){if(OC===!0&&(OC=!1,Od===null&&uj.get("logging_enabled")===!0&&fj()),Od){const e=Gf.apply(null,t);Od(e)}},Jf=function(t){return function(...e){Sn(t,...e)}},bv=function(...t){const e="FIREBASE INTERNAL ERROR: "+Gf(...t);gc.error(e)},ti=function(...t){const e=`FIREBASE FATAL ERROR: ${Gf(...t)}`;throw gc.error(e),new Error(e)},rr=function(...t){const e="FIREBASE WARNING: "+Gf(...t);gc.warn(e)},hj=function(){typeof window<"u"&&window.location&&window.location.protocol&&window.location.protocol.indexOf("https:")!==-1&&rr("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},Xw=function(t){return typeof t=="number"&&(t!==t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY)}
7,pj=function(t){if(document.readyState==="complete")t();else{let e=!1;const n=function(){if(!document.body){setTimeout(n,Math.floor(10));return}e||(e=!0,t())};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&n()}),window.attachEvent("onload",n))}},Fc="[MIN_NAME]",kl="[MAX_NAME]",Ll=function(t,e){if(t===e)return 0;if(t===Fc||e===kl)return-1;if(e===Fc||t===kl)return 1;{const n=IC(t),r=IC(e);return n!==null?r!==null?n-r===0?t.length-e.length:n-r:-1:r!==null?1:t<e?-1:1}},mj=function(t,e){return t===e?0:t<e?-1:1},ju=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+sn(e))},Zw=function(t){if(typeof t!="object"||t===null)return sn(t);const e=[];for(const r in t)e.push(r);e.sort();let n="{";for(let r=0;r<e.length;r++)r!==0&&(n+=","),n+=sn(e[r]),n+=":",n+=Zw(t[e[r]]);return n+="}",n},M6=function(t,e){const n=t.length;if(n<=e)return[t];const r=[];for(let o=0;o<n;o+=e)o+e>n?r.push(t.substring(o,n)):r.push(t.substring(o,o+e));return r};function On(t,e){for(const n in t)t.hasOwnProperty(n)&&e(n,t[n])}const T6=function(t){fe(!Xw(t),"Invalid JSON number");const e=11,n=52,r=(1<<e-1)-1;let o,s,i,a,l;t===0?(s=0,i=0,o=1/t===-1/0?1:0):(o=t<0,t=Math.abs(t),t>=Math.pow(2,1-r)?(a=Math.min(Math.floor(Math.log(t)/Math.LN2),r),s=a+r,i=Math.round(t*Math.pow(2,n-a)-Math.pow(2,n))):(s=0,i=Math.round(t/Math.pow(2,1-r-n))));const c=[];for(l=n;l;l-=1)c.push(i%2?1:0),i=Math.floor(i/2);for(l=e;l;l-=1)c.push(s%2?1:0),s=Math.floor(s/2);c.push(o?1:0),c.reverse();const u=c.join("");let d="";for(l=0;l<64;l+=8){let f=parseInt(u.substr(l,8),2).toString(16);f.length===1&&(f="0"+f),d=d+f}return d.toLowerCase()},gj=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},yj=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function vj(t,e){let n="Unknown Error";t==="too_big"?n="The data requested exceeds the maximum size that can be accessed with a single request.":t==="permission_denied"?n="Client doesn't have permission to access the desired data.":t==="unavailable"&&(n="The service is unavailable");const r=new Error(t+" at "+e._path.toString()+": "+n);return r.code=t.toUpperCase(),r}const bj=new RegExp("^-?(0*)\\d{1,10}$"),wj=-2147483648,kj=2147483647,IC=function(t){if(bj.test(t)){const e=Number(t);if(e>=wj&&e<=kj)return e}return null},Cu=function(t){try{t()}catch(e){setTimeout(()=>{const n=e.stack||"";throw rr("Exception was thrown by user callback.",n),e},Math.floor(0))}},xj=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},Id=function(t,e){const n=setTimeout(t,e);return typeof n=="number"&&typeof Deno<"u"&&Deno.unrefTimer?Deno.unrefTimer(n):typeof n=="object"&&n.unref&&n.unref(),n};class Cj{constructor(e,n){this.appName_=e,this.appCheckProvider=n,this.appCheck=n?.getImmediate({optional:!0}),this.appCheck||n==null||n.get().then(r=>this.appCheck=r)}getToken(e){return this.appCheck?this.appCheck.getToken(e):new Promise((n,r)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(n,r):n(null)},0)})}addTokenChangeListener(e){var n;(n=this.appCheckProvider)===null||n===void 0||n.get().then(r=>r.addTokenListener(e))}notifyForInvalidToken(){rr(`Provided AppCheck credentials for the app named "${this.appName_}" are invalid. This usually indicates your app was not initialized correctly.`)}}class _j{constructor(e,n,r){this.appName_=e,this.firebaseOptions_=n,this.authProvider_=r,this.auth_=null,this.auth_=r.getImmediate({optional:!0}),this.auth_||r.onInit(o=>this.auth_=o)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(n=>n&&n.code==="auth/token-not-initialized"?(Sn("Got auth/token-not-initialized error.  Treating as null token."),null):Promise.reject(n)):new Promise((n,r)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(n,r):n(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(n=>n.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(n=>n.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',rr(e)}}let up=class{constructor(e){this.accessToken=e}getToken(e){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(e){e(this.accessToken)}removeTokenChangeListener(e){}notifyForInvalidToken(){}};up.OWNER="owner";const Qw="5",E6="v",A6="s",O6="r",I6="f",N6=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,L6="ls",R6="p",wv="ac",$6="websocket",D6="long_polling";class P6{constructor(e,n,r,o,s=!1,i="",a=!1,l=!1){this.secure=n,this.namespace=r,this.webSocketOnly=o,this.nodeAdmin=s,this.persistenceKey=i,this.includeNamespaceInQueryParams=a,this.isUsingEmulator=l,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=Va.get("host:"+e)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)==="s-"}isCustomHost(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&Va.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){const e=this.secure?"https://":"http://",n=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${n}`}}function Sj(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams}function H6(t,e,n){fe(typeof e=="string","typeof type must == string"),fe(typeof n=="object","typeof params must == object");let r;if(e===$6)r=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else if(e===D6)r=(t.secure?"https://":"http://")+t.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);Sj(t)&&(n.ns=t.namespace);const o=[];return On(n,(s,i)=>{o.push(s+"="+i)}),r+o.join("&")}class Mj{constructor(){this.counters_={}}incrementCounter(e,n=1){Ss(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=n}get(){return IB(this.counters_)}}const oy={},sy={};function ek(t){const e=t.toString();return oy[e]||(oy[e]=new Mj),oy[e]}function Tj(t,e){const n=t.toString();return sy[n]||(sy[n]=e()),sy[n]}class Ej{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,n){this.closeAfterResponse=e,this.onClose=n,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(e,n){for(this.pendingResponses[e]=n;this.pendingResponses[this.currentResponseNum];){const r=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let o=0;o<r.length;++o)r[o]&&Cu(()=>{this.onMessage_(r[o])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}}const NC="start",Aj="close",Oj="pLPCommand",Ij="pRTLPCB",B6="id",F6="pw",j6="ser",Nj="cb",Lj="seg",Rj="ts",$j="d",Dj="dframe",z6=1870,V6=30,Pj=z6-V6,Hj=25e3,Bj=3e4;let Fj=class ed{constructor(e,n,r,o,s,i,a){this.connId=e,this.repoInfo=n,this.applicationId=r,this.appCheckToken=o,this.authToken=s,this.transportSessionId=i,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=Jf(e),this.stats_=ek(n),this.urlFn=l=>(this.appCheckToken&&(l[wv]=this.appCheckToken),H6(n,D6,l))}open(e,n){this.curSegmentNum=0,this.onDisconnect_=n,this.myPacketOrderer=new Ej(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(Bj)),pj(()=>
7{if(this.isClosed_)return;this.scriptTagHolder=new jj((...s)=>{const[i,a,l,c,u]=s;if(this.incrementIncomingBytes_(s),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,i===NC)this.id=a,this.password=l;else if(i===Aj)a?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(a,()=>{this.onClosed_()})):this.onClosed_();else throw new Error("Unrecognized command received: "+i)},(...s)=>{const[i,a]=s;this.incrementIncomingBytes_(s),this.myPacketOrderer.handleResponse(i,a)},()=>{this.onClosed_()},this.urlFn);const r={};r[NC]="t",r[j6]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(r[Nj]=this.scriptTagHolder.uniqueCallbackIdentifier),r[E6]=Qw,this.transportSessionId&&(r[A6]=this.transportSessionId),this.lastSessionId&&(r[L6]=this.lastSessionId),this.applicationId&&(r[R6]=this.applicationId),this.appCheckToken&&(r[wv]=this.appCheckToken),typeof location<"u"&&location.hostname&&N6.test(location.hostname)&&(r[O6]=I6);const o=this.urlFn(r);this.log_("Connecting via long-poll to "+o),this.scriptTagHolder.addTag(o,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){ed.forceAllow_=!0}static forceDisallow(){ed.forceDisallow_=!0}static isAvailable(){return ed.forceAllow_?!0:!ed.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!gj()&&!yj()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const n=sn(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);const r=u6(n),o=M6(r,Pj);for(let s=0;s<o.length;s++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,o.length,o[s]),this.curSegmentNum++}addDisconnectPingFrame(e,n){this.myDisconnFrame=document.createElement("iframe");const r={};r[Dj]="t",r[B6]=e,r[F6]=n,this.myDisconnFrame.src=this.urlFn(r),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){const n=sn(e).length;this.bytesReceived+=n,this.stats_.incrementCounter("bytes_received",n)}},jj=class U6{constructor(e,n,r,o){this.onDisconnect=r,this.urlFn=o,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(Math.random()*1e8),this.sendNewPolls=!0;{this.uniqueCallbackIdentifier=dj(),window[Oj+this.uniqueCallbackIdentifier]=e,window[Ij+this.uniqueCallbackIdentifier]=n,this.myIFrame=U6.createIFrame_();let s="";this.myIFrame.src&&this.myIFrame.src.substr(0,11)==="javascript:"&&(s='<script>document.domain="'+document.domain+'";<\/script>');const i="<html><body>"+s+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(i),this.myIFrame.doc.close()}catch(a){Sn("frame writing exception"),a.stack&&Sn(a.stack),Sn(a)}}}static createIFrame_(){const e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||Sn("No IE domain setting required")}catch{const n=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+n+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));const e=this.onDisconnect;e&&(this.onDisconnect=null,e())}
7startLongPoll(e,n){for(this.myID=e,this.myPW=n,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const e={};e[B6]=this.myID,e[F6]=this.myPW,e[j6]=this.currentSerial;let n=this.urlFn(e),r="",o=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+V6+r.length<=z6;){const s=this.pendingSegs.shift();r=r+"&"+Lj+o+"="+s.seg+"&"+Rj+o+"="+s.ts+"&"+$j+o+"="+s.d,o++}return n=n+r,this.addLongPollTag_(n,this.currentSerial),!0}else return!1}enqueueSegment(e,n,r){this.pendingSegs.push({seg:e,ts:n,d:r}),this.alive&&this.newRequest_()}addLongPollTag_(e,n){this.outstandingRequests.add(n);const r=()=>{this.outstandingRequests.delete(n),this.newRequest_()},o=setTimeout(r,Math.floor(Hj)),s=()=>{clearTimeout(o),r()};this.addTag(e,s)}addTag(e,n){setTimeout(()=>{try{if(!this.sendNewPolls)return;const r=this.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){const o=r.readyState;(!o||o==="loaded"||o==="complete")&&(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),n())},r.onerror=()=>{Sn("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(r)}catch{}},Math.floor(1))}};const zj=16384,Vj=45e3;let dm=null;typeof MozWebSocket<"u"?dm=MozWebSocket:typeof WebSocket<"u"&&(dm=WebSocket);let Pa=class dp{constructor(e,n,r,o,s,i,a){this.connId=e,this.applicationId=r,this.appCheckToken=o,this.authToken=s,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=Jf(this.connId),this.stats_=ek(n),this.connURL=dp.connectionURL_(n,i,a,o,r),this.nodeAdmin=n.nodeAdmin}static connectionURL_(e,n,r,o,s){const i={};return i[E6]=Qw,typeof location<"u"&&location.hostname&&N6.test(location.hostname)&&(i[O6]=I6),n&&(i[A6]=n),r&&(i[L6]=r),o&&(i[wv]=o),s&&(i[R6]=s),H6(e,$6,i)}open(e,n){this.onDisconnect=n,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,Va.set("previous_websocket_failure",!0);try{let r;jB(),this.mySock=new dm(this.connURL,[],r)}catch(r){this.log_("Error instantiating WebSocket.");const o=r.message||r.data;o&&this.log_(o),this.onClosed_();return}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=r=>{this.handleIncomingFrame(r)},this.mySock.onerror=r=>{this.log_("WebSocket error.  Closing connection.");const o=r.message||r.data;o&&this.log_(o),this.onClosed_()}}start(){}static forceDisallow(){dp.forceDisallow_=!0}static isAvailable(){let e=!1;if(typeof navigator<"u"&&navigator.userAgent){const n=/Android ([0-9]{0,}\.[0-9]{0,})/,r=navigator.userAgent.match(n);r&&r.length>1&&parseFloat(r[1])<4.4&&(e=!0)}return!e&&dm!==null&&!dp.forceDisallow_}static previouslyFailed(){return Va.isInMemoryStorage||Va.get("previous_websocket_failure")===!0}markConnectionHealthy(){Va.remove("previous_websocket_failure")}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){const n=this.frames.join("");this.frames=null;const r=ff(n);this.onMessage(r)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if(fe(this.frames===null,"We already have a frame buffer"),e.length<=6){const n=Number(e);if(!isNaN(n))return this.handleNewFrameCount_(n),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(this.mySock===null)return;const n=e.data;if(this.bytesReceived+=n.length,this.stats_.incrementCounter("bytes_received",n.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(n);else{const r=this.extractFrameCount_(n);r!==null&&this.appendFrame_(r)}}send(e){this.resetKeepAlive();const n=sn(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);const r=M6(n,zj);r.length>1&&this.sendString_(String(r.length));for(let o=0;o<r.length;o++)this.sendString_(r[o])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(Vj))}sendString_(e){try{this.mySock.send(e)}
7catch(n){this.log_("Exception thrown from WebSocket.send():",n.message||n.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}};Pa.responsesRequiredToBeHealthy=2;Pa.healthyTimeout=3e4;let q6=class kv{constructor(e){this.initTransports_(e)}static get ALL_TRANSPORTS(){return[Fj,Pa]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}initTransports_(e){const n=Pa&&Pa.isAvailable();let r=n&&!Pa.previouslyFailed();if(e.webSocketOnly&&(n||rr("wss:// URL used, but browser isn't known to support websockets.  Trying anyway."),r=!0),r)this.transports_=[Pa];else{const o=this.transports_=[];for(const s of kv.ALL_TRANSPORTS)s&&s.isAvailable()&&o.push(s);kv.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}};q6.globalTransportInitialized_=!1;const Uj=6e4,qj=5e3,Wj=10*1024,Kj=100*1024,iy="t",LC="d",Gj="s",RC="r",Jj="e",$C="o",DC="a",PC="n",HC="p",Yj="h";class Xj{constructor(e,n,r,o,s,i,a,l,c,u){this.id=e,this.repoInfo_=n,this.applicationId_=r,this.appCheckToken_=o,this.authToken_=s,this.onMessage_=i,this.onReady_=a,this.onDisconnect_=l,this.onKill_=c,this.lastSessionId=u,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=Jf("c:"+this.id+":"),this.transportManager_=new q6(n),this.log_("Connection created"),this.start_()}start_(){const e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(n,r)},Math.floor(0));const o=e.healthyTimeout||0;o>0&&(this.healthyTimeout_=Id(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>Kj?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes.  Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>Wj?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes.  Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(o)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return n=>{e===this.conn_?this.onConnectionLost_(n):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return n=>{this.state_!==2&&(e===this.rx_?this.onPrimaryMessageReceived_(n):e===this.secondaryConn_?this.onSecondaryMessageReceived_(n):this.log_("message on old connection"))}}sendRequest(e){const n={t:"d",d:e};this.sendData_(n)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if(iy in e){const n=e[iy];n===DC?this.upgradeIfSecondaryHealthy_():n===RC?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):n===$C&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){const n=ju("t",e),r=ju("d",e);if(n==="c")this.onSecondaryControl_(r);else if(n==="d")this.pendingDataMessages.push(r);else throw new Error("Unknown protocol layer: "+n)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t
vendor: 17,715 bytes, lines 7-8
7:"c",d:{t:HC,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:DC,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:PC,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){const n=ju("t",e),r=ju("d",e);n==="c"?this.onControl_(r):n==="d"&&this.onDataMessage_(r)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){const n=ju(iy,e);if(LC in e){const r=e[LC];if(n===Yj){const o=Object.assign({},r);this.repoInfo_.isUsingEmulator&&(o.h=this.repoInfo_.host),this.onHandshake_(o)}else if(n===PC){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let o=0;o<this.pendingDataMessages.length;++o)this.onDataMessage_(this.pendingDataMessages[o]);this.pendingDataMessages=[],this.tryCleanupConnection()}else n===Gj?this.onConnectionShutdown_(r):n===RC?this.onReset_(r):n===Jj?bv("Server Error: "+r):n===$C?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):bv("Unknown control packet command: "+n)}}onHandshake_(e){const n=e.ts,r=e.v,o=e.h;this.sessionId=e.s,this.repoInfo_.host=o,this.state_===0&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,n),Qw!==r&&rr("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){const e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),Id(()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(Uj))}onReset_(e){this.log_("Reset packet received.  New host: "+e),this.repoInfo_.host=e,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,n){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(n,this.sessionId),this.onReady_=null),this.primaryResponsesRequired_===0?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):Id(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(qj))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:HC,d:{}}}))}onSecondaryConnectionLost_(){const e=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===e||this.rx_===e)&&this.close()}onConnectionLost_(e){this.conn_=null,!e&&this.state_===0?(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(Va.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_("Realtime connection lost."),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(this.state_!==1)throw"Connection is not connected";this.tx_.send(e)}close(){this.state_!==2&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}}let W6=class{put(e,n,r,o){}merge(e,n,r,o){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,n,r){}onDisconnectMerge(e,n,r){}onDisconnectCancel(e,n){}reportStats(e){}};let K6=class{constructor(e){this.allowedEvents_=e,this.listeners_={},fe(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...n){if(Array.isArray(this.listeners_[e])){const r=[...this.listeners_[e]];for(let o=0;o<r.length;o++)r[o].callback.apply(r[o].context,n)}}on(e,n,r){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:n,context:r});const o=this.getInitialEvent(e);o&&n.apply(r,o)}off(e,n,r){this.validateEventType_(e);const o=this.listeners_[e]||[];for(let s=0;s<o.length;s++)if(o[s].callback===n&&(!r||r===o[s].context)){o.splice(s,1);return}}validateEventType_(e){fe(this.allowedEvents_.find(n=>n===e),"Unknown event: "+e)}};let BC=class G6 extends K6{constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!Kw()&&(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}static getInstance(){return new G6}getInitialEvent(e){return fe(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}};const FC=32,jC=768;class Mt{constructor(e,n){if(n===void 0){this.pieces_=e.split("/");let r=0;for(let o=0;o<this.pieces_.length;o++)this.pieces_[o].length>0&&(this.pieces_[r]=this.pieces_[o],r++);this.pieces_.length=r,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=n}toString(){let e="";for(let n=this.pieceNum_;n<this.pieces_.length;n++)this.pieces_[n]!==""&&(e+="/"+this.pieces_[n]);return e||"/"}}function gt(){return new Mt("")}function rt(t){return t.pieceNum_>=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function aa(t){return t.pieces_.length-t.pieceNum_}function At(t){let e=t.pieceNum_;return e<t.pieces_.length&&e++,new Mt(t.pieces_,e)}function tk(t){return t.pieceNum_<t.pieces_.length?t.pieces_[t.pieces_.length-1]:null}function Zj(t){let e="";for(let n=t.pieceNum_;n<t.pieces_.length;n++)t.pieces_[n]!==""&&(e+="/"+encodeURIComponent(String(t.pieces_[n])));return e||"/"}function pf(t,e=0){return t.pieces_.slice(t.pieceNum_+e)}function J6(t){if(t.pieceNum_>=t.pieces_.length)return null;const e=[];for(let n=t.pieceNum_;n<t.pieces_.length-1;n++)e.push(t.pieces_[n]);return new Mt(e,0)}function Ut(t,e){const n=[];for(let r=t.pieceNum_;r<t.pieces_.length;r++)n.push(t.pieces_[r]);if(e instanceof Mt)for(let r=e.pieceNum_;r<e.pieces_.length;r++)n.push(e.pieces_[r]);else{const r=e.split("/");for(let o=0;o<r.length;o++)r[o].length>0&&n.push(r[o])}return new Mt(n,0)}function st(t){return t.pieceNum_>=t.pieces_.length}function nr(t,e){const n=rt(t),r=rt(e);if(n===null)return e;if(n===r)return nr(At(t),At(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function Qj(t,e){const n=pf(t,0),r=pf(e,0);for(let o=0;o<n.length&&o<r.length;o++){const s=Ll(n[o],r[o]);if(s!==0)return s}return n.length===r.length?0:n.length<r.length?-1:1}function nk(t,e){if(aa(t)!==aa(e))return!1;for(let n=t.pieceNum_,r=e.pieceNum_;n<=t.pieces_.length;n++,r++)if(t.pieces_[n]!==e.pieces_[r])return!1;return!0}function to(t,e){let n=t.pieceNum_,r=e.pieceNum_;if(aa(t)>aa(e))return!1;for(;n<t.pieces_.length;){if(t.pieces_[n]!==e.pieces_[r])return!1;++n,++r}return!0}class ez{constructor(e,n){this.errorPrefix_=n,this.parts_=pf(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let r=0;r<this.parts_.length;r++)this.byteLength_+=Lg(this.parts_[r]);Y6(this)}}function tz(t,e){t.parts_.length>0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=Lg(e),Y6(t)}function nz(t){const e=t.parts_.pop();t.byteLength_-=Lg(e),t.parts_.length>0&&(t.byteLength_-=1)}function Y6(t){if(t.byteLength_>jC)throw new Error(t.errorPrefix_+"has a key path longer than "+jC+" bytes ("+t.byteLength_+").");if(t.parts_.length>FC)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+FC+") or object contains a cycle "+Na(t))}function Na(t){return t.parts_.length===0?"":"in property '"+t.parts_.join(".")+"'"}let rz=class X6 extends K6{constructor(){super(["visible"]);let e,n;typeof document<"u"&&typeof document.addEventListener<"u"&&(typeof document.hidden<"u"?(n="visibilitychange",e="hidden"):typeof document.mozHidden<"u"?(n="mozvisibilitychange",e="mozHidden"):typeof document.msHidden<"u"?(n="msvisibilitychange",e="msHidden"):typeof document.webkitHidden<"u"&&(n="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,n&&document.addEventListener(n,()=>{const r=!document[e];r!==this.visible_&&(this.visible_=r,this.trigger("visible",r))},!1)}static getInstance(){return new X6}getInitialEvent(e){return fe(e==="visible","Unknown event type: "+e),[this.visible_]}};const zu=1e3,oz=300*1e3,zC=30*1e3,sz=1.3,iz=3e4,az="server_kill",VC=3;let Yf=class fp extends W6{constructor(e,n,r,o,s,i,a,l){if(super(),this.repoInfo_=e,this.applicationId_=n,this.onDataUpdate_=r,this.onConnectStatus_=o,this.onServerInfoUpdate_=s,this.authTokenProvider_=i,this.appCheckTokenProvider_=a,this.authOverride_=l,this.id=fp.nextPersistentConnectionId_++,this.log_=Jf("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=zu,this.maxReconnectDelay_=oz,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,l&&!0)throw new Error("Auth override specified in options, but not supported on non Node.js platforms");rz.getInstance().on("visible",this.onVisible_,this),e.host.indexOf("fblocal")===-1&&BC.getInstance().on("online",this.onOnline_,this)}sendRequest(e,n,r){const o=++this.requestNumber_,s={r:o,a:e,b:n};this.log_(sn(s)),fe(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(s),r&&(this.requestCBHash_[o]=r)}get(e){this.initConnection_();const n=new Wf,r={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:s=>{const i=s.d;s.s==="ok"?n.resolve(i):n.reject(i)}};this.outstandingGets_.push(r),this.outstandingGetCount_++;const o=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(o),n.promise}listen(e,n,r,o){this.initConnection_();const s=e._queryIdentifier,i=e._path.toString();this.log_("Listen called for "+i+" "+s),this.listens.has(i)||this.listens.set(i,new Map),fe(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),fe(!this.listens.get(i).has(s),"listen() called twice for same path/queryId.");const a={onComplete:o,hashFn:n,query:e,tag:r};this.listens.get(i).set(s,a),this.connected_&&this.sendListen_(a)}sendGet_(e){const n=this.outstandingGets_[e];this.sendRequest("g",n.request,r=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),n.onComplete&&n.onComplete(r)})}sendListen_(e){const n=e.query,r=n._path.toString(),o=n._queryIdentifier;this.log_("Listen on "+r+" for "+o);const s={p:r},i="q";e.tag&&(s.q=n._queryObject,s.t=e.tag),s.h=e.hashFn(),this.sendRequest(i,s,a=>{const l=a.d,c=a.s;fp.warnOnListenWarnings_(l,n),(this.listens.get(r)&&this.listens.get(r).get(o))===e&&(this.log_("listen response",a),c!=="ok"&&this.removeListen_(r,o),e.onComplete&&e.onComplete(c,l))})}static warnOnListenWarnings_(e,n){if(e&&typeof e=="object"&&Ss(e,"w")){const r=Hc(e,"w");if(Array.isArray(r)&&~r.indexOf("no_index")){const o='".indexOn": "'+n._queryParams.getIndex().toString()+'"',s=n._path.toString();rr(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${o} at ${s} to your security rules for better performance.`)}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&e.length===40||GB(e))&&(this.log_("Admin auth credential detected.  Reducing max reconnect time."),this.maxReconnectDelay_=zC)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,n=KB(e)?"auth":"gauth",r={cred:e};this.authOverride_===null?r.noauth=!0:typeof this.authOverride_=="object"&&(r.authvar=this.authOverride_),this.sendRequest(n,r,o=>{const s=o.s,i=o.d||"error";this.authToken_===e&&(s==="ok"?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(s,i))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},e=>{const n=e.s,r=e.d||"error";n==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(n,r)})}unlisten(e,n){const r=e._path.toString(),o=e._queryIdentifier;this.log_("Unlisten called for "+r+" "+o),fe(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(r,o)&&this.connected_&&this.sendUnlisten_(r,o,e._queryObject,n)}sendUnlisten_(e,n,r,o){this.log_("Unlisten on "+e+" for "+n);const s={p:e},i="n";o&&(s.q=r,s.t=o),this.sendRequest(i,s)}onDisconnectPut(e,n,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,n,r):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:n,onComplete:r})}onDisconnectMerge(e,n,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,n,r):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:n,onComplete:r})}onDisconnectCancel(e,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:n})}sendOnDisconnect_(e,n,r,o){const s={p:n,d:r};this.log_("onDisconnect "+e,s),this.sendRequest(e,s,i=>{o&&setTimeout(()=>{o(i.s,i.d)},Math.floor(0))})}put(e,n,r,o){this.putInternal("p",e,n,r,o)}merge(e,n,r,o){this.putInternal("m",e,n,r,o)}putInternal(e,n,r,o,s){this.initConnection_();const i={p:n,d:r};s!==void 0&&(i.h=s),this.outstandingPuts_.push({action:e,request:i,onComplete:o}),this.outstandingPutCount_++;const a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+n)}sendPut_(e){const n=this.outstandingPuts_[e].action,r=this.outstandingPuts_[e].request,o=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(n,r,s=>{this.log_(n+" response",s),delete this.outstandingPuts_[e],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),o&&o(s.s,s.d)})}reportStats(e){if(this.connected_){const n={c:e};this.log_("reportStats",n),this.sendRequest("s",n,r=>{if(r.s!=="ok"){const o=r.d;this.log_("reportStats","Error sending stats: "+o)}})}}onDataMessage_(e){if("r"in e){this.log_("from server: "+sn(e));const n=e.r,r=this.requestCBHash_[n];r&&(delete this.requestCBHash_[n],r(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,n){this.log_("handleServerMessage",e,n),e==="d"?this.onDataUpdate_(n.p,n.d,!1,n.t):e==="m"?this.onDataUpdate_(n.p,n.d,!0,n.t):e==="c"?this.onListenRevoked_(n.p,n.q):e==="ac"?this.onAuthRevoked_(n.s,n.d):e==="apc"?this.onAppCheckRevoked_(n.s,n.d):e==="sd"?this.onSecurityDebugPacket_(n):bv("Unrecognized action received from server: "+sn(e)+`
8Are you using the latest client?`)}onReady_(e,n){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(e),this.lastSessionId=n,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){fe(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible.  Reducing delay."),this.reconnectDelay_=zu,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=zu,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline.  Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&(new Date().getTime()-this.lastConnectionEstablishedTime_>iz&&(this.reconnectDelay_=zu),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible.  Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime());const e=new Date().getTime()-this.lastConnectionAttemptTime_;let n=Math.max(0,this.reconnectDelay_-e);
8n=Math.random()*n,this.log_("Trying to reconnect in "+n+"ms"),this.scheduleConnect_(n),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*sz)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),o=this.id+":"+fp.nextConnectionId_++,s=this.lastSessionId;let i=!1,a=null;const l=function(){a?a.close():(i=!0,r())},c=function(d){fe(a,"sendRequest call when we're not connected not allowed."),a.sendRequest(d)};this.realtime_={close:l,sendRequest:c};const u=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[d,f]=await Promise.all([this.authTokenProvider_.getToken(u),this.appCheckTokenProvider_.getToken(u)]);i?Sn("getToken() completed but was canceled"):(Sn("getToken() completed. Creating connection."),this.authToken_=d&&d.accessToken,this.appCheckToken_=f&&f.token,a=new Xj(o,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,n,r,h=>{rr(h+" ("+this.repoInfo_.toString()+")"),this.interrupt(az)},s))}catch(d){this.log_("Failed to get token: "+d),i||(this.repoInfo_.nodeAdmin&&rr(d),l())}}}interrupt(e){Sn("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){Sn("Resuming connection for reason: "+e),delete this.interruptReasons_[e],hv(this.interruptReasons_)&&(this.reconnectDelay_=zu,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const n=e-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:n})}cancelSentTransactions_(){for(let e=0;e<this.outstandingPuts_.length;e++){const n=this.outstandingPuts_[e];n&&"h"in n.request&&n.queued&&(n.onComplete&&n.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}this.outstandingPutCount_===0&&(this.outstandingPuts_=[])}onListenRevoked_(e,n){let r;n?r=n.map(s=>Zw(s)).join("$"):r="default";const o=this.removeListen_(e,r);o&&o.onComplete&&o.onComplete("permission_denied")}removeListen_(e,n){const r=new Mt(e).toString();let o;if(this.listens.has(r)){const s=this.listens.get(r);o=s.get(n),s.delete(n),s.size===0&&this.listens.delete(r)}else o=void 0;return o}onAuthRevoked_(e,n){Sn("Auth token revoked: "+e+"/"+n),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(e==="invalid_token"||e==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=VC&&(this.reconnectDelay_=zC,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,n){Sn("App check token revoked: "+e+"/"+n),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(e==="invalid_token"||e==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=VC&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace(`
9`,`
10FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const n of e.values())this.sendListen_(n);for(let e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){const e=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(e.action,e.pathString,e.data,e.onComplete)}for(let e=0;e<this.outstandingGets_.length;e++)this.outstandingGets_[e]&&this.sendGet_(e)}sendConnectStats_(){const e={};let n="js";e["sdk."+n+"."+C6.replace(/\./g,"-")]=1,Kw()?e["framework.cordova"]=1:m6()&&(e["framework.reactnative"]=1),this.reportStats(e)}shouldReconnect_(){const e=BC.getInstance().currentlyOnline();return hv(this.interruptReasons_)&&e}};Yf.nextPersistentConnectionId_=0;Yf.nextConnectionId_=0;let at=class Z6{constructor(e,n){this.name=e,this.node=n}static Wrap(e,n){return new Z6(e,n)}};let Rg=class{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,n){const r=new at(Fc,e),o=new at(Fc,n);return this.compare(r,o)!==0}
vendor: 4,046 bytes, line 10
10minPost(){return at.MIN}};let Nh,Q6=class extends Rg{static get __EMPTY_NODE(){return Nh}static set __EMPTY_NODE(e){Nh=e}compare(e,n){return Ll(e.name,n.name)}isDefinedOn(e){throw wu("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(e,n){return!1}minPost(){return at.MIN}maxPost(){return new at(kl,Nh)}makePost(e,n){return fe(typeof e=="string","KeyIndex indexValue must always be a string."),new at(e,Nh)}toString(){return".key"}};const yc=new Q6;let Lh=class{constructor(e,n,r,o,s=null){this.isReverse_=o,this.resultGenerator_=s,this.nodeStack_=[];let i=1;for(;!e.isEmpty();)if(e=e,i=n?r(e.key,n):1,o&&(i*=-1),i<0)this.isReverse_?e=e.left:e=e.right;else if(i===0){this.nodeStack_.push(e);break}else this.nodeStack_.push(e),this.isReverse_?e=e.right:e=e.left}getNext(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_.pop(),n;if(this.resultGenerator_?n=this.resultGenerator_(e.key,e.value):n={key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return n}hasNext(){return this.nodeStack_.length>0}peek(){if(this.nodeStack_.length===0)return null;const e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}},Nr=class td{constructor(e,n,r,o,s){this.key=e,this.value=n,this.color=r??td.RED,this.left=o??ts.EMPTY_NODE,this.right=s??ts.EMPTY_NODE}copy(e,n,r,o,s){return new td(e??this.key,n??this.value,r??this.color,o??this.left,s??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let o=this;const s=r(e,o.key);return s<0?o=o.copy(null,null,null,o.left.insert(e,n,r),null):s===0?o=o.copy(null,n,null,null,null):o=o.copy(null,null,null,null,o.right.insert(e,n,r)),o.fixUp_()}removeMin_(){if(this.left.isEmpty())return ts.EMPTY_NODE;let e=this;return!e.left.isRed_()&&!e.left.left.isRed_()&&(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,n){let r,o;if(r=this,n(e,r.key)<0)!r.left.isEmpty()&&!r.left.isRed_()&&!r.left.left.isRed_()&&(r=r.moveRedLeft_()),r=r.copy(null,null,null,r.left.remove(e,n),null);else{if(r.left.isRed_()&&(r=r.rotateRight_()),!r.right.isEmpty()&&!r.right.isRed_()&&!r.right.left.isRed_()&&(r=r.moveRedRight_()),n(e,r.key)===0){if(r.right.isEmpty())return ts.EMPTY_NODE;o=r.right.min_(),r=r.copy(o.key,o.value,null,null,r.right.removeMin_())}r=r.copy(null,null,null,null,r.right.remove(e,n))}return r.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){const e=this.copy(null,null,td.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight_(){const e=this.copy(null,null,td.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip_(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth_(){const e=this.check_();return Math.pow(2,e)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");
10if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)}};Nr.RED=!0;Nr.BLACK=!1;class lz{copy(e,n,r,o,s){return this}insert(e,n,r){return new Nr(e,n,null)}remove(e,n){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}}let ts=class hp{constructor(e,n=hp.EMPTY_NODE){this.comparator_=e,this.root_=n}insert(e,n){return new hp(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,Nr.BLACK,null,null))}remove(e){return new hp(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,Nr.BLACK,null,null))}get(e){let n,r=this.root_;for(;!r.isEmpty();){if(n=this.comparator_(e,r.key),n===0)return r.value;n<0?r=r.left:n>0&&(r=r.right)}return null}getPredecessorKey(e){let n,r=this.root_,o=null;for(;!r.isEmpty();)if(n=this.comparator_(e,r.key),n===0){if(r.left.isEmpty())return o?o.key:null;for(r=r.left;!r.right.isEmpty();)r=r.right;return r.key}else n<0?r=r.left:n>0&&(o=r,r=r.right);throw new Error("Attempted to find predecessor key for a nonexistent key.  What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new Lh(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,n){return new Lh(this.root_,e,this.comparator_,!1,n)}getReverseIteratorFrom(e,n){return new Lh(this.root_,e,this.comparator_,!0,n)}getReverseIterator(e){return new Lh(this.root_,null,this.comparator_,!0,e)}};ts.EMPTY_NODE=new lz;function cz(t,e){return Ll(t.name,e.name)}function rk(t,e){return Ll(t,e)}let xv;function uz(t){xv=t}const eE=function(t){return typeof t=="number"?"number:"+T6(t):"string:"+t},tE=function(t){if(t.isLeafNode()){const e=t.val();fe(typeof e=="string"||typeof e=="number"||typeof e=="object"&&Ss(e,".sv"),"Priority must be a string or number.")}else fe(t===xv||t.isEmpty(),"priority of unexpected type.");fe(t===xv||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};let UC,xl=class wo{constructor(e,n=wo.__childrenNodeConstructor.EMPTY_NODE){this.value_=e,this.priorityNode_=n,this.lazyHash_=null,fe(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),tE(this.priorityNode_)}static set __childrenNodeConstructor(e){UC=e}static get __childrenNodeConstructor(){return UC}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new wo(this.value_,e)}getImmediateChild(e){return e===".priority"?this.priorityNode_:wo.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return st(e)?this:rt(e)===".priority"?this.priorityNode_:wo.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,n){return null}updateImmediateChild(e,n){return e===".priority"?this.updatePriority(n):n.isEmpty()&&e!==".priority"?this:wo.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)}updateChild(e,n){const r=rt(e);return r===null?n:n.isEmpty()&&r!==".priority"?this:(fe(r!==".priority"||aa(e)===1,".priority must be the last token in a path"),this.updateImmediateChild(r,wo.__childrenNodeConstructor.EMPTY_NODE.updateChild(At(e),n)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,n){return!1}val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let e="";this.priorityNode_.isEmpty()||(e+="priority:"+eE(this.priorityNode_.val())+":");const n=typeof this.value_;e+=n+":",n==="number"?e+=T6(this.value_):e+=this.value_,this.lazyHash_=S6(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(e){return e===wo.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof wo.__childrenNodeConstructor?-1:(fe(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))}compareToLeafNode_(e){const n=typeof e.value_,r=typeof this.value_,o=wo.VALUE_TYPE_ORDER.indexOf(n),s=wo.VALUE_TYPE_ORDER.indexOf(r);return fe(o>=0,"Unknown leaf type: "+n),fe(s>=0,"Unknown leaf type: "+r),o===s?r==="object"?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:s-o}withIndex(){return this}isIndexed(){return!0}equals(e){if(e===this)return!0;
10if(e.isLeafNode()){const n=e;return this.value_===n.value_&&this.priorityNode_.equals(n.priorityNode_)}else return!1}};xl.VALUE_TYPE_ORDER=["object","boolean","number","string"];let nE,rE;function dz(t){nE=t}function fz(t){rE=t}class hz extends Rg{compare(e,n){const r=e.node.getPriority(),o=n.node.getPriority(),s=r.compareTo(o);return s===0?Ll(e.name,n.name):s}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,n){return!e.getPriority().equals(n.getPriority())}minPost(){return at.MIN}maxPost(){return new at(kl,new xl("[PRIORITY-POST]",rE))}makePost(e,n){const r=nE(e);return new at(n,new xl("[PRIORITY-POST]",r))}toString(){return".priority"}}const qt=new hz;const pz=Math.log(2);let mz=class{constructor(e){const n=s=>parseInt(Math.log(s)/pz,10),r=s=>parseInt(Array(s+1).join("1"),2);this.count=n(e+1),this.current_=this.count-1;const o=r(this.count);this.bits_=e+1&o}nextBitIsOne(){const e=!(this.bits_&1<<this.current_);return this.current_--,e}};const fm=function(t,e,n,r){t.sort(e);const o=function(l,c){const u=c-l;let d,f;if(u===0)return null;if(u===1)return d=t[l],f=n?n(d):d,new Nr(f,d.node,Nr.BLACK,null,null);{const h=parseInt(u/2,10)+l,p=o(l,h),g=o(h+1,c);return d=t[h],f=n?n(d):d,new Nr(f,d.node,Nr.BLACK,p,g)}},s=function(l){let c=null,u=null,d=t.length;const f=function(p,g){const y=d-p,w=d;d-=p;const x=o(y+1,w),C=t[y],v=n?n(C):C;h(new Nr(v,C.node,g,null,x))},h=function(p){c?(c.left=p,c=p):(u=p,c=p)};for(let p=0;p<l.count;++p){const g=l.nextBitIsOne(),y=Math.pow(2,l.count-(p+1));g?f(y,Nr.BLACK):(f(y,Nr.BLACK),f(y,Nr.RED))}return u},i=new mz(t.length),a=s(i);return new ts(r||e,a)};let ay;const Bl={};let hm=class nd{constructor(e,n){this.indexes_=e,this.indexSet_=n}static get Default(){return fe(Bl&&qt,"ChildrenNode.ts has not been loaded"),ay=ay||new nd({".priority":Bl},{".priority":qt}),ay}get(e){const n=Hc(this.indexes_,e);if(!n)throw new Error("No index defined for "+e);return n instanceof ts?n:null}hasIndex(e){return Ss(this.indexSet_,e.toString())}addIndex(e,n){fe(e!==yc,"KeyIndex always exists and isn't meant to be added to the IndexMap.");const r=[];let o=!1;const s=n.getIterator(at.Wrap);let i=s.getNext();for(;i;)o=o||e.isDefinedOn(i.node),r.push(i),i=s.getNext();let a;o?a=fm(r,e.getCompare()):a=Bl;const l=e.toString(),c=Object.assign({},this.indexSet_);c[l]=e;const u=Object.assign({},this.indexes_);return u[l]=a,new nd(u,c)}addToIndexes(e,n){const r=lm(this.indexes_,(o,s)=>{const i=Hc(this.indexSet_,s);if(fe(i,"Missing index implementation for "+s),o===Bl)if(i.isDefinedOn(e.node)){const a=[],l=n.getIterator(at.Wrap);let c=l.getNext();for(;c;)c.name!==e.name&&a.push(c),c=l.getNext();return a.push(e),fm(a,i.getCompare())}else return Bl;else{const a=n.get(e.name);let l=o;return a&&(l=l.remove(new at(e.name,a))),l.insert(e,e.node)}});return new nd(r,this.indexSet_)}removeFromIndexes(e,n){const r=lm(this.indexes_,o=>{if(o===Bl)return o;{const s=n.get(e.name);return s?o.remove(new at(e.name,s)):o}});return new nd(r,this.indexSet_)}};let Vu,Ze=class Kl{constructor(e,n,r){this.children_=e,this.priorityNode_=n,this.indexMap_=r,this.lazyHash_=null,this.priorityNode_&&tE(this.priorityNode_),this.children_.isEmpty()&&fe(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}static get EMPTY_NODE(){return Vu||(Vu=new Kl(new ts(rk),null,hm.Default))}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Vu}updatePriority(e){return this.children_.isEmpty()?this:new Kl(this.children_,e,this.indexMap_)}getImmediateChild(e){if(e===".priority")return this.getPriority();{const n=this.children_.get(e);return n===null?Vu:n}}getChild(e){const n=rt(e);return n===null?this:this.getImmediateChild(n).getChild(At(e))}hasChild(e){return this.children_.get(e)!==null}updateImmediateChild(e,n){if(fe(n,"We should always be passing snapshot nodes"),e===".priority")return this.updatePriority(n);{const r=new at(e,n);let o,s;n.isEmpty()?(o=this.children_.remove(e),s=this.indexMap_.removeFromIndexes(r,this.children_)):(o=this.children_.insert(e,n),s=this.indexMap_.addToIndexes(r,this.children_));const i=o.isEmpty()?Vu:this.priorityNode_;return new Kl(o,i,s)}}updateChild(e,n){const r=rt(e);if(r===null)return n;{fe(rt(e)!==".priority"||aa(e)===1,".priority must be the last token in a path");const o=this.getImmediateChild(r).updateChild(At(e),n);return this.updateImmediateChild(r,o)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(e){if(this.isEmpty())return null;const n={};let r=0,o=0,s=!0;if(this.forEachChild(qt,(i,a)=>{n[i]=a.val(e),r++,s&&Kl.INTEGER_REGEXP_.test(i)?o=Math.max(o,Number(i)):s=!1}),!e&&s&&o<2*r){const i=[];for(const a in n)i[a]=n[a];return i}
10else return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n}hash(){if(this.lazyHash_===null){let e="";this.getPriority().isEmpty()||(e+="priority:"+eE(this.getPriority().val())+":"),this.forEachChild(qt,(n,r)=>{const o=r.hash();o!==""&&(e+=":"+n+":"+o)}),this.lazyHash_=e===""?"":S6(e)}return this.lazyHash_}getPredecessorChildName(e,n,r){const o=this.resolveIndex_(r);if(o){const s=o.getPredecessorKey(new at(e,n));return s?s.name:null}else return this.children_.getPredecessorKey(e)}getFirstChildName(e){const n=this.resolveIndex_(e);if(n){const r=n.minKey();return r&&r.name}else return this.children_.minKey()}getFirstChild(e){const n=this.getFirstChildName(e);return n?new at(n,this.children_.get(n)):null}getLastChildName(e){const n=this.resolveIndex_(e);if(n){const r=n.maxKey();return r&&r.name}else return this.children_.maxKey()}getLastChild(e){const n=this.getLastChildName(e);return n?new at(n,this.children_.get(n)):null}forEachChild(e,n){const r=this.resolveIndex_(e);return r?r.inorderTraversal(o=>n(o.name,o.node)):this.children_.inorderTraversal(n)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,n){const r=this.resolveIndex_(n);if(r)return r.getIteratorFrom(e,o=>o);{const o=this.children_.getIteratorFrom(e.name,at.Wrap);let s=o.peek();for(;s!=null&&n.compare(s,e)<0;)o.getNext(),s=o.peek();return o}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,n){const r=this.resolveIndex_(n);if(r)return r.getReverseIteratorFrom(e,o=>o);{const o=this.children_.getReverseIteratorFrom(e.name,at.Wrap);let s=o.peek();for(;s!=null&&n.compare(s,e)>0;)o.getNext(),s=o.peek();return o}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===Xf?-1:0}withIndex(e){if(e===yc||this.indexMap_.hasIndex(e))return this;{const n=this.indexMap_.addIndex(e,this.children_);return new Kl(this.children_,this.priorityNode_,n)}}isIndexed(e){return e===yc||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;if(e.isLeafNode())return!1;{const n=e;if(this.getPriority().equals(n.getPriority()))if(this.children_.count()===n.children_.count()){const r=this.getIterator(qt),o=n.getIterator(qt);let s=r.getNext(),i=o.getNext();for(;s&&i;){if(s.name!==i.name||!s.node.equals(i.node))return!1;s=r.getNext(),i=o.getNext()}return s===null&&i===null}else return!1;else return!1}}resolveIndex_(e){return e===yc?null:this.indexMap_.get(e.toString())}};Ze.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;let gz=class extends Ze{constructor(){super(new ts(rk),Ze.EMPTY_NODE,hm.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return Ze.EMPTY_NODE}isEmpty(){return!1}};const Xf=new gz;Object.defineProperties(at,{MIN:{value:new at(Fc,Ze.EMPTY_NODE)},MAX:{value:new at(kl,Xf)}});Q6.__EMPTY_NODE=Ze.EMPTY_NODE;xl.__childrenNodeConstructor=Ze;uz(Xf);fz(Xf);const yz=!0;function on(t,e=null){if(t===null)return Ze.EMPTY_NODE;if(typeof t=="object"&&".priority"in t&&(e=t[".priority"]),fe(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof t=="object"&&".value"in t&&t[".value"]!==null&&(t=t[".value"]),typeof t!="object"||".sv"in t){const n=t;return new xl(n,on(e))}if(!(t instanceof Array)&&yz){const n=[];let r=!1;if(On(t,(s,i)=>{if(s.substring(0,1)!=="."){const a=on(i);a.isEmpty()||(r=r||!a.getPriority().isEmpty(),n.push(new at(s,a)))}}),n.length===0)return Ze.EMPTY_NODE;const o=fm(n,cz,s=>s.name,rk);if(r){const s=fm(n,qt.getCompare());return new Ze(o,on(e),new hm({".priority":s},{".priority":qt}))}else return new Ze(o,on(e),hm.Default)}else{let n=Ze.EMPTY_NODE;return On(t,(r,o)=>{if(Ss(t,r)&&r.substring(0,1)!=="."){const s=on(o);(s.isLeafNode()||!s.isEmpty())&&(n=n.updateImmediateChild(r,s))}}),n.updatePriority(on(e))}}dz(on);let vz=class extends Rg{constructor(e){super(),this.indexPath_=e,fe(!st(e)&&rt(e)!==".priority","Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,n){const r=this.extractChild(e.node),o=this.extractChild(n.node),s=r.compareTo(o);return s===0?Ll(e.name,n.name):s}makePost(e,n){const r=on(e),o=Ze.EMPTY_NODE.updateChild(this.indexPath_,r);return new at(n,o)}maxPost(){const e=Ze.EMPTY_NODE.updateChild(this.indexPath_,Xf);return new at(kl,e)}toString(){return pf(this.indexPath_,0).join("/")}};let bz=class extends Rg{compare(e,n){const r=e.node.compareTo(n.node);return r===0?Ll(e.name,n.name):r}isDefinedOn(e){return!0}indexedValueChanged(e,n){return!e.equals(n)}
10minPost(){return at.MIN}maxPost(){return at.MAX}makePost(e,n){const r=on(e);return new at(n,r)}toString(){return".value"}};const wz=new bz;function oE(t){return{type:"value",snapshotNode:t}}function jc(t,e){return{type:"child_added",snapshotNode:e,childName:t}}function mf(t,e){return{type:"child_removed",snapshotNode:e,childName:t}}function gf(t,e,n){return{type:"child_changed",snapshotNode:e,childName:t,oldSnap:n}}function kz(t,e){return{type:"child_moved",snapshotNode:e,childName:t}}let ok=class{constructor(e){this.index_=e}updateChild(e,n,r,o,s,i){fe(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");const a=e.getImmediateChild(n);return a.getChild(o).equals(r.getChild(o))&&a.isEmpty()===r.isEmpty()||(i!=null&&(r.isEmpty()?e.hasChild(n)?i.trackChildChange(mf(n,a)):fe(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?i.trackChildChange(jc(n,r)):i.trackChildChange(gf(n,r,a))),e.isLeafNode()&&r.isEmpty())?e:e.updateImmediateChild(n,r).withIndex(this.index_)}updateFullNode(e,n,r){return r!=null&&(e.isLeafNode()||e.forEachChild(qt,(o,s)=>{n.hasChild(o)||r.trackChildChange(mf(o,s))}),n.isLeafNode()||n.forEachChild(qt,(o,s)=>{if(e.hasChild(o)){const i=e.getImmediateChild(o);i.equals(s)||r.trackChildChange(gf(o,s,i))}else r.trackChildChange(jc(o,s))})),n.withIndex(this.index_)}
10updatePriority(e,n){return e.isEmpty()?Ze.EMPTY_NODE:e.updatePriority(n)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}};let sE=class Cv{constructor(e){this.indexedFilter_=new ok(e.getIndex()),this.index_=e.getIndex(),this.startPost_=Cv.getStartPost_(e),this.endPost_=Cv.getEndPost_(e),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){const n=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,r=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return n&&r}updateChild(e,n,r,o,s,i){return this.matches(new at(n,r))||(r=Ze.EMPTY_NODE),this.indexedFilter_.updateChild(e,n,r,o,s,i)}updateFullNode(e,n,r){n.isLeafNode()&&(n=Ze.EMPTY_NODE);let o=n.withIndex(this.index_);o=o.updatePriority(Ze.EMPTY_NODE);const s=this;return n.forEachChild(qt,(i,a)=>{s.matches(new at(i,a))||(o=o.updateImmediateChild(i,Ze.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,o,r)}
vendor: 2,306 bytes, line 10
10updatePriority(e,n){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){const n=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),n)}else return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){const n=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),n)}else return e.getIndex().maxPost()}};let xz=class{constructor(e){this.withinDirectionalStart=n=>this.reverse_?this.withinEndPost(n):this.withinStartPost(n),this.withinDirectionalEnd=n=>this.reverse_?this.withinStartPost(n):this.withinEndPost(n),this.withinStartPost=n=>{const r=this.index_.compare(this.rangedFilter_.getStartPost(),n);return this.startIsInclusive_?r<=0:r<0},this.withinEndPost=n=>{const r=this.index_.compare(n,this.rangedFilter_.getEndPost());return this.endIsInclusive_?r<=0:r<0},this.rangedFilter_=new sE(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,n,r,o,s,i){return this.rangedFilter_.matches(new at(n,r))||(r=Ze.EMPTY_NODE),e.getImmediateChild(n).equals(r)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,n,r,o,s,i):this.fullLimitUpdateChild_(e,n,r,s,i)}updateFullNode(e,n,r){let o;if(n.isLeafNode()||n.isEmpty())o=Ze.EMPTY_NODE.withIndex(this.index_);else if(this.limit_*2<n.numChildren()&&n.isIndexed(this.index_)){o=Ze.EMPTY_NODE.withIndex(this.index_);let s;this.reverse_?s=n.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):s=n.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);let i=0;for(;s.hasNext()&&i<this.limit_;){const a=s.getNext();if(this.withinDirectionalStart(a))if(this.withinDirectionalEnd(a))o=o.updateImmediateChild(a.name,a.node),i++;else break;else continue}}else{o=n.withIndex(this.index_),o=o.updatePriority(Ze.EMPTY_NODE);let s;this.reverse_?s=o.getReverseIterator(this.index_):s=o.getIterator(this.index_);let i=0;for(;s.hasNext();){const a=s.getNext();i<this.limit_&&this.withinDirectionalStart(a)&&this.withinDirectionalEnd(a)?i++:o=o.updateImmediateChild(a.name,Ze.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,o,r)}
10updatePriority(e,n){return e}filtersNodes(){return!0}getIndexedFilter(){return this.rangedFilter_.getIndexedFilter()}getIndex(){return this.index_}fullLimitUpdateChild_(e,n,r,o,s){let i;if(this.reverse_){const d=this.index_.getCompare();i=(f,h)=>d(h,f)}else i=this.index_.getCompare();const a=e;fe(a.numChildren()===this.limit_,"");const l=new at(n,r),c=this.reverse_?a.getFirstChild(this.index_):a.getLastChild(this.index_),u=this.rangedFilter_.matches(l);if(a.hasChild(n)){const d=a.getImmediateChild(n);let f=o.getChildAfterChild(this.index_,c,this.reverse_);for(;f!=null&&(f.name===n||a.hasChild(f.name));)f=o.getChildAfterChild(this.index_,f,this.reverse_);const h=f==null?1:i(f,l);if(u&&!r.isEmpty()&&h>=0)return s?.trackChildChange(gf(n,r,d)),a.updateImmediateChild(n,r);{s?.trackChildChange(mf(n,d));const p=a.updateImmediateChild(n,Ze.EMPTY_NODE);return f!=null&&this.rangedFilter_.matches(f)?(s?.trackChildChange(jc(f.name,f.node)),p.updateImmediateChild(f.name,f.node)):p}}else return r.isEmpty()?e:u&&i(c,l)>=0?(s!=null&&(s.trackChildChange(mf(c.name,c.node)),s.trackChildChange(jc(n,r))),a.updateImmediateChild(n,r).updateImmediateChild(c.name,Ze.EMPTY_NODE)):e}};let Cz=class iE{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=qt}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return fe(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return fe(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:Fc}hasEnd(){return this.endSet_}getIndexEndValue(){return fe(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return fe(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:kl}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return fe(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===qt}copy(){const e=new iE;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}};function _z(t){return t.loadsAllData()?new ok(t.getIndex()):t.hasLimit()?new xz(t):new sE(t)}function qC(t){const e={};if(t.isDefault())return e;let n;if(t.index_===qt?n="$priority":t.index_===wz?n="$value":t.index_===yc?n="$key":(fe(t.index_ instanceof vz,"Unrecognized index type!"),n=t.index_.toString()),e.orderBy=sn(n),t.startSet_){const r=t.startAfterSet_?"startAfter":"startAt";e[r]=sn(t.indexStartValue_),t.startNameSet_&&(e[r]+=","+sn(t.indexStartName_))}if(t.endSet_){const r=t.endBeforeSet_?"endBefore":"endAt";e[r]=sn(t.indexEndValue_),t.endNameSet_&&(e[r]+=","+sn(t.indexEndName_))}return t.limitSet_&&(t.isViewFromLeft()?e.limitToFirst=t.limit_:e.limitToLast=t.limit_),e}function WC(t){const e={};if(t.startSet_&&(e.sp=t.indexStartValue_,t.startNameSet_&&(e.sn=t.indexStartName_),e.sin=!t.startAfterSet_),t.endSet_&&(e.ep=t.indexEndValue_,t.endNameSet_&&(e.en=t.indexEndName_),e.ein=!t.endBeforeSet_),t.limitSet_){e.l=t.limit_;let n=t.viewFrom_;n===""&&(t.isViewFromLeft()?n="l":n="r"),e.vf=n}return t.index_!==qt&&(e.i=t.index_.toString()),e}let Sz=class _v extends W6{constructor(e,n,r,o){super(),this.repoInfo_=e,this.onDataUpdate_=n,this.authTokenProvider_=r,this.appCheckTokenProvider_=o,this.log_=Jf("p:rest:"),this.listens_={}}reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,n){return n!==void 0?"tag$"+n:(fe(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}listen(e,n,r,o){const s=e._path.toString();this.log_("Listen called for "+s+" "+e._queryIdentifier);const i=_v.getListenId_(e,r),a={};this.listens_[i]=a;const l=qC(e._queryParams);this.restRequest_(s+".json",l,(c,u)=>{let d=u;if(c===404&&(d=null,c=null),c===null&&this.onDataUpdate_(s,d,!1,r),Hc(this.listens_,i)===a){let f;c?c===401?f="permission_denied":f="rest_error:"+c:f="ok",o(f,null)}})}unlisten(e,n){const r=_v.getListenId_(e,n);delete this.listens_[r]}get(e){const n=qC(e._queryParams),r=e._path.toString(),o=new Wf;return this.restRequest_(r+".json",n,(s,i)=>{let a=i;
10s===404&&(a=null,s=null),s===null?(this.onDataUpdate_(r,a,!1,null),o.resolve(a)):o.reject(new Error(a))}),o.promise}refreshAuthToken(e){}restRequest_(e,n={},r){return n.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([o,s])=>{o&&o.accessToken&&(n.auth=o.accessToken),s&&s.token&&(n.ac=s.token);const i=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+ku(n);this.log_("Sending REST request for "+i);const a=new XMLHttpRequest;a.onreadystatechange=()=>{if(r&&a.readyState===4){this.log_("REST Response for "+i+" received. status:",a.status,"response:",a.responseText);let l=null;if(a.status>=200&&a.status<300){try{l=ff(a.responseText)}catch{rr("Failed to parse JSON response for "+i+": "+a.responseText)}r(null,l)}else a.status!==401&&a.status!==404&&rr("Got unsuccessful REST response for "+i+" Status: "+a.status),r(a.status);r=null}},a.open("GET",i,!0),a.send()})}};let Mz=class{constructor(){this.rootNode_=Ze.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,n){this.rootNode_=this.rootNode_.updateChild(e,n)}};function pm(){return{value:null,children:new Map}}function aE(t,e,n){if(st(e))t.value=n,t.children.clear();else if(t.value!==null)t.value=t.value.updateChild(e,n);else{const r=rt(e);t.children.has(r)||t.children.set(r,pm());const o=t.children.get(r);e=At(e),aE(o,e,n)}}function Sv(t,e,n){t.value!==null?n(e,t.value):Tz(t,(r,o)=>{const s=new Mt(e.toString()+"/"+r);Sv(o,s,n)})}function Tz(t,e){t.children.forEach((n,r)=>{e(r,n)})}let Ez=class{constructor(e){this.collection_=e,this.last_=null}get(){const e=this.collection_.get(),n=Object.assign({},e);return this.last_&&On(this.last_,(r,o)=>{n[r]=n[r]-o}),this.last_=e,n}};const KC=10*1e3,Az=30*1e3,Oz=300*1e3;let Iz=class{constructor(e,n){this.server_=n,this.statsToReport_={},this.statsListener_=new Ez(e);const r=KC+(Az-KC)*Math.random();Id(this.reportStats_.bind(this),Math.floor(r))}reportStats_(){const e=this.statsListener_.get(),n={};let r=!1;On(e,(o,s)=>{s>0&&Ss(this.statsToReport_,o)&&(n[o]=s,r=!0)}),r&&this.server_.reportStats(n),Id(this.reportStats_.bind(this),Math.floor(Math.random()*2*Oz))}};var To;(function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"})(To||(To={}));function sk(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function ik(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function ak(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}let Nz=class Mv{constructor(e,n,r){this.path=e,this.affectedTree=n,this.revert=r,this.type=To.ACK_USER_WRITE,this.source=sk()}operationForChild(e){if(st(this.path)){if(this.affectedTree.value!=null)return fe(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const n=this.affectedTree.subtree(new Mt(e));return new Mv(gt(),n,this.revert)}}else return fe(rt(this.path)===e,"operationForChild called for unrelated child."),new Mv(At(this.path),this.affectedTree,this.revert)}};let lE=class Tv{constructor(e,n){this.source=e,this.path=n,this.type=To.LISTEN_COMPLETE}operationForChild(e){return st(this.path)?new Tv(this.source,gt()):new Tv(this.source,At(this.path))}};let $g=class Ev{constructor(e,n,r){this.source=e,this.path=n,this.snap=r,this.type=To.OVERWRITE}operationForChild(e){return st(this.path)?new Ev(this.source,gt(),this.snap.getImmediateChild(e)):new Ev(this.source,At(this.path),this.snap)}};let lk=class Av{constructor(e,n,r){this.source=e,this.path=n,this.children=r,this.type=To.MERGE}operationForChild(e){if(st(this.path)){const n=this.children.subtree(new Mt(e));return n.isEmpty()?null:n.value?new $g(this.source,gt(),n.value):new Av(this.source,gt(),n)}else return fe(rt(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new Av(this.source,At(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}};let la=class{constructor(e,n,r){this.node_=e,this.fullyInitialized_=n,this.filtered_=r}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(st(e))return this.isFullyInitialized()&&!this.filtered_;const n=rt(e);return this.isCompleteForChild(n)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}};let Lz=class{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}};function Rz(t,e,n,r){const o=[],s=[];return e.forEach(i=>
10{i.type==="child_changed"&&t.index_.indexedValueChanged(i.oldSnap,i.snapshotNode)&&s.push(kz(i.childName,i.snapshotNode))}),Uu(t,o,"child_removed",e,r,n),Uu(t,o,"child_added",e,r,n),Uu(t,o,"child_moved",s,r,n),Uu(t,o,"child_changed",e,r,n),Uu(t,o,"value",e,r,n),o}function Uu(t,e,n,r,o,s){const i=r.filter(a=>a.type===n);i.sort((a,l)=>Dz(t,a,l)),i.forEach(a=>{const l=$z(t,a,s);o.forEach(c=>{c.respondsTo(a.type)&&e.push(c.createEvent(l,t.query_))})})}function $z(t,e,n){return e.type==="value"||e.type==="child_removed"||(e.prevName=n.getPredecessorChildName(e.childName,e.snapshotNode,t.index_)),e}function Dz(t,e,n){if(e.childName==null||n.childName==null)throw wu("Should only compare child_ events.");const r=new at(e.childName,e.snapshotNode),o=new at(n.childName,n.snapshotNode);return t.index_.compare(r,o)}function Dg(t,e){return{eventCache:t,serverCache:e}}function Nd(t,e,n,r){return Dg(new la(e,n,r),t.serverCache)}function cE(t,e,n,r){return Dg(t.eventCache,new la(e,n,r))}function mm(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function Cl(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null}let ly;const Pz=()=>(ly||(ly=new ts(mj)),ly);let Br=class Ar{constructor(e,n=Pz()){this.value=e,this.children=n}static fromObject(e){let n=new Ar(null);return On(e,(r,o)=>{n=n.set(new Mt(r),o)}),n}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,n){if(this.value!=null&&n(this.value))return{path:gt(),value:this.value};if(st(e))return null;{const r=rt(e),o=this.children.get(r);if(o!==null){const s=o.findRootMostMatchingPathAndValue(At(e),n);return s!=null?{path:Ut(new Mt(r),s.path),value:s.value}:null}else return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(st(e))return this;{const n=rt(e),r=this.children.get(n);return r!==null?r.subtree(At(e)):new Ar(null)}}set(e,n){if(st(e))return new Ar(n,this.children);{const r=rt(e),o=(this.children.get(r)||new Ar(null)).set(At(e),n),s=this.children.insert(r,o);return new Ar(this.value,s)}}remove(e){if(st(e))return this.children.isEmpty()?new Ar(null):new Ar(null,this.children);{const n=rt(e),r=this.children.get(n);if(r){const o=r.remove(At(e));let s;return o.isEmpty()?s=this.children.remove(n):s=this.children.insert(n,o),this.value===null&&s.isEmpty()?new Ar(null):new Ar(this.value,s)}else return this}}get(e){if(st(e))return this.value;{const n=rt(e),r=this.children.get(n);return r?r.get(At(e)):null}}setTree(e,n){if(st(e))return n;{const r=rt(e),o=(this.children.get(r)||new Ar(null)).setTree(At(e),n);let s;return o.isEmpty()?s=this.children.remove(r):s=this.children.insert(r,o),new Ar(this.value,s)}}fold(e){return this.fold_(gt(),e)}fold_(e,n){const r={};return this.children.inorderTraversal((o,s)=>{r[o]=s.fold_(Ut(e,o),n)}),n(e,this.value,r)}findOnPath(e,n){return this.findOnPath_(e,gt(),n)}findOnPath_(e,n,r){const o=this.value?r(n,this.value):!1;if(o)return o;if(st(e))return null;{const s=rt(e),i=this.children.get(s);return i?i.findOnPath_(At(e),Ut(n,s),r):null}}foreachOnPath(e,n){return this.foreachOnPath_(e,gt(),n)}foreachOnPath_(e,n,r){if(st(e))return this;{this.value&&r(n,this.value);const o=rt(e),s=this.children.get(o);return s?s.foreachOnPath_(At(e),Ut(n,o),r):new Ar(null)}}foreach(e){this.foreach_(gt(),e)}foreach_(e,n){this.children.inorderTraversal((r,o)=>{o.foreach_(Ut(e,r),n)}),this.value&&n(e,this.value)}foreachChild(e){this.children.inorderTraversal((n,r)=>{r.value&&e(n,r.value)})}};let Js=class uE{constructor(e){this.writeTree_=e}static empty(){return new uE(new Br(null))}};function Ld(t,e,n){if(st(e))return new Js(new Br(n));{const r=t.writeTree_.findRootMostValueAndPath(e);if(r!=null){const o=r.path;let s=r.value;const i=nr(o,e);return s=s.updateChild(i,n),new Js(t.writeTree_.set(o,s))}else{const o=new Br(n),s=t.writeTree_.setTree(e,o);return new Js(s)}}}function Ov(t,e,n){let r=t;return On(n,(o,s)=>{r=Ld(r,Ut(e,o),s)}),r}function GC(t,e){if(st(e))return Js.empty();{const n=t.writeTree_.setTree(e,new Br(null));return new Js(n)}}function Iv(t,e){return Rl(t,e)!=null}function Rl(t,e){const n=t.writeTree_.findRootMostValueAndPath(e);return n!=null?t.writeTree_.get(n.path).getChild(nr(n.path,e)):null}function JC(t){const e=[],n=t.writeTree_.value;
10return n!=null?n.isLeafNode()||n.forEachChild(qt,(r,o)=>{e.push(new at(r,o))}):t.writeTree_.children.inorderTraversal((r,o)=>{o.value!=null&&e.push(new at(r,o.value))}),e}function Xi(t,e){if(st(e))return t;{const n=Rl(t,e);return n!=null?new Js(new Br(n)):new Js(t.writeTree_.subtree(e))}}function Nv(t){return t.writeTree_.isEmpty()}function zc(t,e){return dE(gt(),t.writeTree_,e)}function dE(t,e,n){if(e.value!=null)return n.updateChild(t,e.value);{let r=null;return e.children.inorderTraversal((o,s)=>{o===".priority"?(fe(s.value!==null,"Priority writes must always be leaf nodes"),r=s.value):n=dE(Ut(t,o),s,n)}),!n.getChild(t).isEmpty()&&r!==null&&(n=n.updateChild(Ut(t,".priority"),r)),n}}function Pg(t,e){return mE(e,t)}function Hz(t,e,n,r,o){fe(r>t.lastWriteId,"Stacking an older write on top of newer ones"),o===void 0&&(o=!0),t.allWrites.push({path:e,snap:n,writeId:r,visible:o}),o&&(t.visibleWrites=Ld(t.visibleWrites,e,n)),t.lastWriteId=r}function Bz(t,e,n,r){fe(r>t.lastWriteId,"Stacking an older merge on top of newer ones"),t.allWrites.push({path:e,children:n,writeId:r,visible:!0}),t.visibleWrites=Ov(t.visibleWrites,e,n),t.lastWriteId=r}function Fz(t,e){for(let n=0;n<t.allWrites.length;n++){const r=t.allWrites[n];if(r.writeId===e)return r}return null}function jz(t,e){const n=t.allWrites.findIndex(a=>a.writeId===e);fe(n>=0,"removeWrite called with nonexistent writeId.");const r=t.allWrites[n];t.allWrites.splice(n,1);let o=r.visible,s=!1,i=t.allWrites.length-1;for(;o&&i>=0;){const a=t.allWrites[i];a.visible&&(i>=n&&zz(a,r.path)?o=!1:to(r.path,a.path)&&(s=!0)),i--}if(o){if(s)return Vz(t),!0;if(r.snap)t.visibleWrites=GC(t.visibleWrites,r.path);else{const a=r.children;On(a,l=>{t.visibleWrites=GC(t.visibleWrites,Ut(r.path,l))})}return!0}else return!1}function zz(t,e){if(t.snap)return to(t.path,e);for(const n in t.children)if(t.children.hasOwnProperty(n)&&to(Ut(t.path,n),e))return!0;return!1}function Vz(t){t.visibleWrites=fE(t.allWrites,Uz,gt()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}function Uz(t){return t.visible}function fE(t,e,n){let r=Js.empty();for(let o=0;o<t.length;++o){const s=t[o];if(e(s)){const i=s.path;let a;if(s.snap)to(n,i)?(a=nr(n,i),r=Ld(r,a,s.snap)):to(i,n)&&(a=nr(i,n),r=Ld(r,gt(),s.snap.getChild(a)));else if(s.children){if(to(n,i))a=nr(n,i),r=Ov(r,a,s.children);else if(to(i,n))if(a=nr(i,n),st(a))r=Ov(r,gt(),s.children);else{const l=Hc(s.children,rt(a));if(l){const c=l.getChild(At(a));r=Ld(r,gt(),c)}}}else throw wu("WriteRecord should have .snap or .children")}}return r}function hE(t,e,n,r,o){if(!r&&!o){const s=Rl(t.visibleWrites,e);if(s!=null)return s;{const i=Xi(t.visibleWrites,e);if(Nv(i))return n;if(n==null&&!Iv(i,gt()))return null;{const a=n||Ze.EMPTY_NODE;return zc(i,a)}}}else{const s=Xi(t.visibleWrites,e);if(!o&&Nv(s))return n;if(!o&&n==null&&!Iv(s,gt()))return null;{const i=function(c){return(c.visible||o)&&(!r||!~r.indexOf(c.writeId))&&(to(c.path,e)||to(e,c.path))},a=fE(t.allWrites,i,e),l=n||Ze.EMPTY_NODE;return zc(a,l)}}}function qz(t,e,n){let r=Ze.EMPTY_NODE;const o=Rl(t.visibleWrites,e);if(o)return o.isLeafNode()||o.forEachChild(qt,(s,i)=>{r=r.updateImmediateChild(s,i)}),r;if(n){const s=Xi(t.visibleWrites,e);return n.forEachChild(qt,(i,a)=>{const l=zc(Xi(s,new Mt(i)),a);r=r.updateImmediateChild(i,l)}),JC(s).forEach(i=>{r=r.updateImmediateChild(i.name,i.node)}),r}else{const s=Xi(t.visibleWrites,e);return JC(s).forEach(i=>{r=r.updateImmediateChild(i.name,i.node)}),r}}function Wz(t,e,n,r,o){fe(r||o,"Either existingEventSnap or existingServerSnap must exist");const s=Ut(e,n);if(Iv(t.visibleWrites,s))return null;{const i=Xi(t.visibleWrites,s);return Nv(i)?o.getChild(n):zc(i,o.getChild(n))}}function Kz(t,e,n,r){const o=Ut(e,n),s=Rl(t.visibleWrites,o);if(s!=null)return s;if(r.isCompleteForChild(n)){const i=Xi(t.visibleWrites,o);return zc(i,r.getNode().getImmediateChild(n))}else return null}function Gz(t,e){return Rl(t.visibleWrites,e)}function Jz(t,e,n,r,o,s,i){let a;const l=Xi(t.visibleWrites,e),c=Rl(l,gt());if(c!=null)a=c;else if(n!=null)a=zc(l,n);else return[];if(a=a.withIndex(i),!a.isEmpty()&&!a.isLeafNode()){const u=[],d=i.getCompare(),f=s?a.getReverseIteratorFrom(r,i):a.getIteratorFrom(r,i);let h=f.getNext();for(;h&&u.length<o;)d(h,r)!==0&&u.push(h),h=f.getNext();return u}else return[]}function Yz(){return{visibleWrites:Js.empty(),allWrites:[],lastWriteId:-1}}function gm(t,e,n,r){return hE(t.writeTree,t.treePath,e,n,r)}function ck(t,e){return qz(t.writeTree,t.treePath,e)}function YC(t,e,n,r){return Wz(t.writeTree,t.treePath,e,n,r)}function ym(t,e){return Gz(t.writeTree,Ut(t.treePath,e))}function Xz(t,e,n,r,o,s){return Jz(t.writeTree,t.treePath,e,n,r,o,s)}function uk(t,e,n){return Kz(t.writeTree,t.treePath,e,n)}function pE(t,e){return mE(Ut(t.treePath,e),t.writeTree)}function mE(t,e){return{treePath:t,writeTree:e}}let Zz=class{constructor(){this.changeMap=new Map}trackChildChange(e){const n=e.type,r=e.childName;fe(n==="child_added"||n==="child_changed"||n==="child_removed","Only child changes supported for tracking"),fe(r!==".priority","Only non-priority child changes can be tracked.");const o=this.changeMap.get(r);if(o){const s=o.type;if(n==="child_added"&&s==="child_removed")this.changeMap.set(r,gf(r,e.snapshotNode,o.snapshotNode));else if(n==="child_removed"&&s==="child_added")this.changeMap.delete(r);else if(n==="child_removed"&&s==="child_changed")this.changeMap.set(r,mf(r,o.oldSnap));else if(n==="child_changed"&&s==="child_added")this.changeMap.set(r,jc(r,e.snapshotNode));else if(n==="child_changed"&&s==="child_changed")this.changeMap.set(r,gf(r,e.snapshotNode,o.oldSnap));else throw wu("Illegal combination of changes: "+e+" occurred after "+o)}else this.changeMap.set(r,e)}getChanges(){return Array.from(this.changeMap.values())}};let Qz=class{getCompleteChild(e){return null}getChildAfterChild(e,n,r){return null}};const gE=new Qz;let dk=class{constructor(e,n,r=null){this.writes_=e,this.viewCache_=n,this.optCompleteServerCache_=r}getCompleteChild(e){const n=this.viewCache_.eventCache;if(n.isCompleteForChild(e))return n.getNode().getImmediateChild(e);{const r=this.optCompleteServerCache_!=null?new la(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return uk(this.writes_,e,r)}}getChildAfterChild(e,n,r){const o=this.optCompleteServerCache_!=null?this.optCompleteServerCache_:Cl(this.viewCache_),s=Xz(this.writes_,o,n,1,r,e);return s.length===0?null:s[0]}};function eV(t){return{filter:t}}function tV(t,e){fe(e.eventCache.getNode().isIndexed(t.filter.getIndex()),"Event snap not indexed"),fe(e.serverCache.getNode().isIndexed(t.filter.getIndex()),"Server snap not indexed")}function nV(t,e,n,r,o){const s=new Zz;let i,a;if(n.type===To.OVERWRITE){const c=n;c.source.fromUser?i=Lv(t,e,c.path,c.snap,r,o,s):(fe(c.source.fromServer,"Unknown source."),a=c.source.tagged||e.serverCache.isFiltered()&&!st(c.path),i=vm(t,e,c.path,c.snap,r,o,a,s))}else if(n.type===To.MERGE){const c=n;c.source.fromUser?i=oV(t,e,c.path,c.children,r,o,s):(fe(c.source.fromServer,"Unknown source."),a=c.source.tagged||e.serverCache.isFiltered(),i=Rv(t,e,c.path,c.children,r,o,a,s))}else if(n.type===To.ACK_USER_WRITE){const c=n;c.revert?i=aV(t,e,c.path,r,o,s):i=sV(t,e,c.path,c.affectedTree,r,o,s)}else if(n.type===To.LISTEN_COMPLETE)i=iV(t,e,n.path,r,s);else throw wu("Unknown operation type: "+n.type);const l=s.getChanges();return rV(e,i,l),{viewCache:i,changes:l}}function rV(t,e,n){const r=e.eventCache;if(r.isFullyInitialized()){const o=r.getNode().isLeafNode()||r.getNode().isEmpty(),s=mm(t);(n.length>0||!t.eventCache.isFullyInitialized()||o&&!r.getNode().equals(s)||!r.getNode().getPriority().equals(s.getPri
10ority()))&&n.push(oE(mm(e)))}}function yE(t,e,n,r,o,s){const i=e.eventCache;if(ym(r,n)!=null)return e;{let a,l;if(st(n))if(fe(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){const c=Cl(e),u=c instanceof Ze?c:Ze.EMPTY_NODE,d=ck(r,u);a=t.filter.updateFullNode(e.eventCache.getNode(),d,s)}else{const c=gm(r,Cl(e));a=t.filter.updateFullNode(e.eventCache.getNode(),c,s)}else{const c=rt(n);if(c===".priority"){fe(aa(n)===1,"Can't have a priority with additional path components");const u=i.getNode();l=e.serverCache.getNode();const d=YC(r,n,u,l);d!=null?a=t.filter.updatePriority(u,d):a=i.getNode()}else{const u=At(n);let d;if(i.isCompleteForChild(c)){l=e.serverCache.getNode();const f=YC(r,n,i.getNode(),l);f!=null?d=i.getNode().getImmediateChild(c).updateChild(u,f):d=i.getNode().getImmediateChild(c)}else d=uk(r,c,e.serverCache);d!=null?a=t.filter.updateChild(i.getNode(),c,d,u,o,s):a=i.getNode()}}return Nd(e,a,i.isFullyInitialized()||st(n),t.filter.filtersNodes())}}function vm(t,e,n,r,o,s,i,a){const l=e.serverCache;let c;const u=i?t.filter:t.filter.getIndexedFilter();if(st(n))c=u.updateFullNode(l.getNode(),r,null);else if(u.filtersNodes()&&!l.isFiltered()){const h=l.getNode().updateChild(n,r);c=u.updateFullNode(l.getNode(),h,null)}else{const h=rt(n);if(!l.isCompleteForPath(n)&&aa(n)>1)return e;const p=At(n),g=l.getNode().getImmediateChild(h).updateChild(p,r);h===".priority"?c=u.updatePriority(l.getNode(),g):c=u.updateChild(l.getNode(),h,g,p,gE,null)}const d=cE(e,c,l.isFullyInitialized()||st(n),u.filtersNodes()),f=new dk(o,d,s);return yE(t,d,n,o,f,a)}function Lv(t,e,n,r,o,s,i){const a=e.eventCache;let l,c;const u=new dk(o,e,s);if(st(n))c=t.filter.updateFullNode(e.eventCache.getNode(),r,i),l=Nd(e,c,!0,t.filter.filtersNodes());else{const d=rt(n);if(d===".priority")c=t.filter.updatePriority(e.eventCache.getNode(),r),l=Nd(e,c,a.isFullyInitialized(),a.isFiltered());else{const f=At(n),h=a.getNode().getImmediateChild(d);let p;if(st(f))p=r;else{const g=u.getCompleteChild(d);g!=null?tk(f)===".priority"&&g.getChild(J6(f)).isEmpty()?p=g:p=g.updateChild(f,r):p=Ze.EMPTY_NODE}if(h.equals(p))l=e;else{const g=t.filter.updateChild(a.getNode(),d,p,f,u,i);l=Nd(e,g,a.isFullyInitialized(),t.filter.filtersNodes())}}}return l}function XC(t,e){return t.eventCache.isCompleteForChild(e)}function oV(t,e,n,r,o,s,i){let a=e;return r.foreach((l,c)=>{const u=Ut(n,l);XC(e,rt(u))&&(a=Lv(t,a,u,c,o,s,i))}),r.foreach((l,c)=>{const u=Ut(n,l);XC(e,rt(u))||(a=Lv(t,a,u,c,o,s,i))}),a}function ZC(t,e,n){return n.foreach((r,o)=>{e=e.updateChild(r,o)}),e}function Rv(t,e,n,r,o,s,i,a){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let l=e,c;st(n)?c=r:c=new Br(null).setTree(n,r);const u=e.serverCache.getNode();return c.children.inorderTraversal((d,f)=>{if(u.hasChild(d)){const h=e.serverCache.getNode().getImmediateChild(d),p=ZC(t,h,f);l=vm(t,l,new Mt(d),p,o,s,i,a)}}),c.children.inorderTraversal((d,f)=>{const h=!e.serverCache.isCompleteForChild(d)&&f.value===null;if(!u.hasChild(d)&&!h){const p=e.serverCache.getNode().getImmediateChild(d),g=ZC(t,p,f);l=vm(t,l,new Mt(d),g,o,s,i,a)}}),l}function sV(t,e,n,r,o,s,i){if(ym(o,n)!=null)return e;const a=e.serverCache.isFiltered(),l=e.serverCache;if(r.value!=null){if(st(n)&&l.isFullyInitialized()||l.isCompleteForPath(n))return vm(t,e,n,l.getNode().getChild(n),o,s,a,i);if(st(n)){let c=new Br(null);return l.getNode().forEachChild(yc,(u,d)=>{c=c.set(new Mt(u),d)}),Rv(t,e,n,c,o,s,a,i)}else return e}else{let c=new Br(null);return r.foreach((u,d)=>{const f=Ut(n,u);l.isCompleteForPath(f)&&(c=c.set(u,l.getNode().getChild(f)))}),Rv(t,e,n,c,o,s,a,i)}}function iV(t,e,n,r,o){const s=e.serverCache,i=cE(e,s.getNode(),s.isFullyInitialized()||st(n),s.isFiltered());return yE(t,i,n,r,gE,o)}function aV(t,e,n,r,o,s){let i;if(ym(r,n)!=null)return e;{const a=new dk(r,e,o),l=e.eventCache.getNode();let c;if(st(n)||rt(n)===".priority"){let u;if(e.serverCache.isFullyInitialized())u=gm(r,Cl(e));else{const d=e.serverCache.getNode();fe(d instanceof Ze,"serverChildren would be complete if leaf node"),u=ck(r,d)}u=u,c=t.filter.updateFullNode(l,u,s)}else{const u=rt(n);let d=uk(r,u,e.serverCache);d==null&&e.serverCache.isCompleteForChild(u)&&(d=l.getImmediateChild(u)),d!=null?c=t.filter.updateChild(l,u,d,At(n),a,s):e.eventCache.getNode().hasChild(u)?c=t.filter.updateChild(l,u,Ze.EMPTY_NODE,At(n),a,s):c=l,c.isEmpty()&&e.serverCache.isFullyInitialized()&&(i=gm(r,Cl(e)),i.isLeafNode()&&(c=t.filter.updateFullNode(c,i,s)))}return i=e.serverCache.isFullyInitialized()||ym(r,gt())!=null,Nd(e,c,i,t.filter.filtersNodes())}}let lV=class{constructor(e,n){this.query_=e,this.eventRegistrations_=[];const r=this.query_._queryParams,o=new ok(r.getIndex()),s=_z(r);this.processor_=eV(s);const i=n.serverCache,a=n.eventCache,l=o.updateFullNode(Ze.EMPTY_NODE,i.getNode(),null),c=s.updateFullNode(Ze.EMPTY_NODE,a.getNode(),null),u=new la(l,i.isFullyInitialized(),o.filtersNodes()),d=new la(c,a.isFullyInitialized(),s.filtersNodes());this.viewCache_=Dg(d,u),this.eventGenerator_=new Lz(this.query_)}get query(){return this.query_}};function cV(t){return t.viewCache_.serverCache.getNode()}function uV(t){return mm(t.viewCache_)}function dV(t,e){const n=Cl(t.viewCache_);return n&&(t.query._queryParams.loadsAllData()||!st(e)&&!n.getImmediateChild(rt(e)).isEmpty())?n.getChild(e):null}function QC(t){return t.eventRegistrations_.length===0}function fV(t,e){t.eventRegistrations_.push(e)}function e_(t,e,n){const r=[];if(n){fe(e==null,"A cancel should cancel all event registrations.");const o=t.query._path;t.eventRegistrations_.forEach(s=>{const i=s.createCancelEvent(n,o);i&&r.push(i)})}if(e){let o=[];for(let s=0;s<t.eventRegistrations_.length;++s){const i=t.eventRegistrations_[s];if(!i.matches(e))o.push(i);else if(e.hasAnyCallback()){o=o.concat(t.eventRegistrations_.slice(s+1));break}}t.eventRegistrations_=o}else t.eventRegistrations_=[];return r}function t_(t,e,n,r){e.type===To.MERGE&&e.source.queryId!==null&&(fe(Cl(t.viewCache_),"We should always have a full c
10ache before handling merges"),fe(mm(t.viewCache_),"Missing event cache, even though we have a server cache"));const o=t.viewCache_,s=nV(t.processor_,o,e,n,r);return tV(t.processor_,s.viewCache),fe(s.viewCache.serverCache.isFullyInitialized()||!o.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),t.viewCache_=s.viewCache,vE(t,s.changes,s.viewCache.eventCache.getNode(),null)}function hV(t,e){const n=t.viewCache_.eventCache,r=[];return n.getNode().isLeafNode()||n.getNode().forEachChild(qt,(o,s)=>{r.push(jc(o,s))}),n.isFullyInitialized()&&r.push(oE(n.getNode())),vE(t,r,n.getNode(),e)}function vE(t,e,n,r){const o=r?[r]:t.eventRegistrations_;return Rz(t.eventGenerator_,e,n,o)}let bm,bE=class{constructor(){this.views=new Map}};function pV(t){fe(!bm,"__referenceConstructor has already been defined"),bm=t}function mV(){return fe(bm,"Reference.ts has not been loaded"),bm}function gV(t){return t.views.size===0}function fk(t,e,n,r){const o=e.source.queryId;if(o!==null){const s=t.views.get(o);return fe(s!=null,"SyncTree gave us an op for an invalid query."),t_(s,e,n,r)}else{let s=[];for(const i of t.views.values())s=s.concat(t_(i,e,n,r));return s}}function wE(t,e,n,r,o){const s=e._queryIdentifier,i=t.views.get(s);if(!i){let a=gm(n,o?r:null),l=!1;a?l=!0:r instanceof Ze?(a=ck(n,r),l=!1):(a=Ze.EMPTY_NODE,l=!1);const c=Dg(new la(a,l,!1),new la(r,o,!1));return new lV(e,c)}return i}function yV(t,e,n,r,o,s){const i=wE(t,e,r,o,s);return t.views.has(e._queryIdentifier)||t.views.set(e._queryIdentifier,i),fV(i,n),hV(i,n)}function vV(t,e,n,r){const o=e._queryIdentifier,s=[];let i=[];const a=ca(t);if(o==="default")for(const[l,c]of t.views.entries())i=i.concat(e_(c,n,r)),QC(c)&&(t.views.delete(l),c.query._queryParams.loadsAllData()||s.push(c.query));else{const l=t.views.get(o);l&&(i=i.concat(e_(l,n,r)),QC(l)&&(t.views.delete(o),l.query._queryParams.loadsAllData()||s.push(l.query)))}return a&&!ca(t)&&s.push(new(mV())(e._repo,e._path)),{removed:s,events:i}}function kE(t){const e=[];for(const n of t.views.values())n.query._queryParams.loadsAllData()||e.push(n);return e}function Zi(t,e){let n=null;for(const r of t.views.values())n=n||dV(r,e);return n}function xE(t,e){if(e._queryParams.loadsAllData())return Hg(t);{const n=e._queryIdentifier;return t.views.get(n)}}function CE(t,e){return xE(t,e)!=null}function ca(t){return Hg(t)!=null}function Hg(t){for(const e of t.views.values())if(e.query._queryParams.loadsAllData())return e;return null}let wm;function bV(t){fe(!wm,"__referenceConstructor has already been defined"),wm=t}function wV(){return fe(wm,"Reference.ts has not been loaded"),wm}let kV=1,n_=class{constructor(e){this.listenProvider_=e,this.syncPointTree_=new Br(null),this.pendingWriteTree_=Yz(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}};function _E(t,e,n,r,o){return Hz(t.pendingWriteTree_,e,n,r,o),o?_u(t,new $g(sk(),e,n)):[]}function xV(t,e,n,r){Bz(t.pendingWriteTree_,e,n,r);const o=Br.fromObject(n);return _u(t,new lk(sk(),e,o))}function Bi(t,e,n=!1){const r=Fz(t.pendingWriteTree_,e);if(jz(t.pendingWriteTree_,e)){let o=new Br(null);return r.snap!=null?o=o.set(gt(),!0):On(r.children,s=>{o=o.set(new Mt(s),!0)}),_u(t,new Nz(r.path,o,n))}else return[]}function Zf(t,e,n){return _u(t,new $g(ik(),e,n))}function CV(t,e,n){const r=Br.fromObject(n);return _u(t,new lk(ik(),e,r))}function _V(t,e){return _u(t,new lE(ik(),e))}function SV(t,e,n){const r=pk(t,n);if(r){const o=mk(r),s=o.path,i=o.queryId,a=nr(s,e),l=new lE(ak(i),a);return gk(t,s,l)}else return[]}function km(t,e,n,r,o=!1){const s=e._path,i=t.syncPointTree_.get(s);let a=[];if(i&&(e._queryIdentifier==="default"||CE(i,e))){const l=vV(i,e,n,r);gV(i)&&(t.syncPointTree_=t.syncPointTree_.remove(s));const c=l.removed;if(a=l.events,!o){const u=c.findIndex(f=>f._queryParams.loadsAllData())!==-1,d=t.syncPointTree_.findOnPath(s,(f,h)=>ca(h));if(u&&!d){const f=t.syncPointTree_.subtree(s);if(!f.isEmpty()){const h=EV(f);for(let p=0;p<h.length;++p){const g=h[p],y=g.query,w=EE(t,g);t.listenProvider_.startListening(Rd(y),yf(t,y),w.hashFn,w.onComplete)}}}!d&&c.length>
100&&!r&&(u?t.listenProvider_.stopListening(Rd(e),null):c.forEach(f=>{const h=t.queryToTagMap.get(Bg(f));t.listenProvider_.stopListening(Rd(f),h)}))}AV(t,c)}return a}function SE(t,e,n,r){const o=pk(t,r);if(o!=null){const s=mk(o),i=s.path,a=s.queryId,l=nr(i,e),c=new $g(ak(a),l,n);return gk(t,i,c)}else return[]}function MV(t,e,n,r){const o=pk(t,r);if(o){const s=mk(o),i=s.path,a=s.queryId,l=nr(i,e),c=Br.fromObject(n),u=new lk(ak(a),l,c);return gk(t,i,u)}else return[]}function $v(t,e,n,r=!1){const o=e._path;let s=null,i=!1;t.syncPointTree_.foreachOnPath(o,(f,h)=>{const p=nr(f,o);s=s||Zi(h,p),i=i||ca(h)});let a=t.syncPointTree_.get(o);a?(i=i||ca(a),s=s||Zi(a,gt())):(a=new bE,t.syncPointTree_=t.syncPointTree_.set(o,a));let l;s!=null?l=!0:(l=!1,s=Ze.EMPTY_NODE,t.syncPointTree_.subtree(o).foreachChild((f,h)=>{const p=Zi(h,gt());p&&(s=s.updateImmediateChild(f,p))}));const c=CE(a,e);if(!c&&!e._queryParams.loadsAllData()){const f=Bg(e);fe(!t.queryToTagMap.has(f),"View does not exist, but we have a tag");const h=OV();t.queryToTagMap.set(f,h),t.tagToQueryMap.set(h,f)}const u=Pg(t.pendingWriteTree_,o);let d=yV(a,e,n,u,s,l);if(!c&&!i&&!r){const f=xE(a,e);d=d.concat(IV(t,e,f))}return d}function hk(t,e,n){const r=t.pendingWriteTree_,o=t.syncPointTree_.findOnPath(e,(s,i)=>{const a=nr(s,e),l=Zi(i,a);if(l)return l});return hE(r,e,o,n,!0)}function TV(t,e){const n=e._path;let r=null;t.syncPointTree_.foreachOnPath(n,(c,u)=>{const d=nr(c,n);r=r||Zi(u,d)});let o=t.syncPointTree_.get(n);o?r=r||Zi(o,gt()):(o=new bE,t.syncPointTree_=t.syncPointTree_.set(n,o));const s=r!=null,i=s?new la(r,!0,!1):null,a=Pg(t.pendingWriteTree_,e._path),l=wE(o,e,a,s?i.getNode():Ze.EMPTY_NODE,s);return uV(l)}function _u(t,e){return ME(e,t.syncPointTree_,null,Pg(t.pendingWriteTree_,gt()))}function ME(t,e,n,r){if(st(t.path))return TE(t,e,n,r);{const o=e.get(gt());n==null&&o!=null&&(n=Zi(o,gt()));let s=[];const i=rt(t.path),a=t.operationForChild(i),l=e.children.get(i);if(l&&a){const c=n?n.getImmediateChild(i):null,u=pE(r,i);s=s.concat(ME(a,l,c,u))}return o&&(s=s.concat(fk(o,t,r,n))),s}}function TE(t,e,n,r){const o=e.get(gt());n==null&&o!=null&&(n=Zi(o,gt()));let s=[];return e.children.inorderTraversal((i,a)=>{const l=n?n.getImmediateChild(i):null,c=pE(r,i),u=t.operationForChild(i);u&&(s=s.concat(TE(u,a,l,c)))}),o&&(s=s.concat(fk(o,t,r,n))),s}function EE(t,e){const n=e.query,r=yf(t,n);return{hashFn:()=>(cV(e)||Ze.EMPTY_NODE).hash(),onComplete:o=>{if(o==="ok")return r?SV(t,n._path,r):_V(t,n._path);{const s=vj(o,n);return km(t,n,null,s)}}}}function yf(t,e){const n=Bg(e);return t.queryToTagMap.get(n)}function Bg(t){return t._path.toString()+"$"+t._queryIdentifier}function pk(t,e){return t.tagToQueryMap.get(e)}function mk(t){const e=t.indexOf("$");return fe(e!==-1&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new Mt(t.substr(0,e))}}function gk(t,e,n){const r=t.syncPointTree_.get(e);fe(r,"Missing sync point for query tag that we're tracking");const o=Pg(t.pendingWriteTree_,e);return fk(r,n,o,null)}function EV(t){return t.fold((e,n,r)=>{if(n&&ca(n))return[Hg(n)];{let o=[];return n&&(o=kE(n)),On(r,(s,i)=>{o=o.concat(i)}),o}})}
10function Rd(t){return t._queryParams.loadsAllData()&&!t._queryParams.isDefault()?new(wV())(t._repo,t._path):t}function AV(t,e){for(let n=0;n<e.length;++n){const r=e[n];if(!r._queryParams.loadsAllData()){const o=Bg(r),s=t.queryToTagMap.get(o);t.queryToTagMap.delete(o),t.tagToQueryMap.delete(s)}}}function OV(){return kV++}function IV(t,e,n){const r=e._path,o=yf(t,e),s=EE(t,n),i=t.listenProvider_.startListening(Rd(e),o,s.hashFn,s.onComplete),a=t.syncPointTree_.subtree(r);if(o)fe(!ca(a.value),"If we're adding a query, it shouldn't be shadowed");else{const l=a.fold((c,u,d)=>{if(!st(c)&&u&&ca(u))return[Hg(u).query];{let f=[];return u&&(f=f.concat(kE(u).map(h=>h.query))),On(d,(h,p)=>{f=f.concat(p)}),f}});for(let c=0;c<l.length;++c){const u=l[c];t.listenProvider_.stopListening(Rd(u),yf(t,u))}}return i}let NV=class AE{constructor(e){this.node_=e}getImmediateChild(e){const n=this.node_.getImmediateChild(e);return new AE(n)}node(){return this.node_}},LV=class OE{constructor(e,n){this.syncTree_=e,this.path_=n}getImmediateChild(e){const n=Ut(this.path_,e);return new OE(this.syncTree_,n)}node(){return hk(this.syncTree_,this.path_)}};const RV=function(t){return t=t||{},t.timestamp=t.timestamp||new Date().getTime(),t},r_=function(t,e,n){if(!t||typeof t!="object")return t;if(fe(".sv"in t,"Unexpected leaf node or priority contents"),typeof t[".sv"]=="string")return $V(t[".sv"],e,n);if(typeof t[".sv"]=="object")return DV(t[".sv"],e);fe(!1,"Unexpected server value: "+JSON.stringify(t,null,2))},$V=function(t,e,n){if(t==="timestamp")return n.timestamp;fe(!1,"Unexpected server value: "+t)},DV=function(t,e,n){t.hasOwnProperty("increment")||fe(!1,"Unexpected server value: "+JSON.stringify(t,null,2));const r=t.increment;typeof r!="number"&&fe(!1,"Unexpected increment value: "+r);const o=e.node();if(fe(o!==null&&typeof o<"u","Expected ChildrenNode.EMPTY_NODE for nulls"),!o.isLeafNode())return r;const s=o.getValue();return typeof s!="number"?r:s+r},IE=function(t,e,n,r){return yk(e,new LV(n,t),r)},NE=function(t,e,n){return yk(t,new NV(e),n)};function yk(t,e,n){const r=t.getPriority().val(),o=r_(r,e.getImmediateChild(".priority"),n);let s;if(t.isLeafNode()){const i=t,a=r_(i.getValue(),e,n);return a!==i.getValue()||o!==i.getPriority().val()?new xl(a,on(o)):t}else{const i=t;return s=i,o!==i.getPriority().val()&&(s=s.updatePriority(new xl(o))),i.forEachChild(qt,(a,l)=>{const c=yk(l,e.getImmediateChild(a),n);c!==l&&(s=s.updateImmediateChild(a,c))}),s}}let vk=class{constructor(e="",n=null,r={children:{},childCount:0}){this.name=e,this.parent=n,this.node=r}};function bk(t,e){let n=e instanceof Mt?e:new Mt(e),r=t,o=rt(n);for(;o!==null;){const s=Hc(r.node.children,o)||{children:{},childCount:0};r=new vk(o,r,s),n=At(n),o=rt(n)}return r}function Su(t){return t.node.value}function LE(t,e){t.node.value=e,Dv(t)}function RE(t){return t.node.childCount>0}function PV(t){return Su(t)===void 0&&!RE(t)}function Fg(t,e){On(t.node.children,(n,r)=>{e(new vk(n,t,r))})}function $E(t,e,n,r){n&&e(t),Fg(t,o=>{$E(o,e,!0)})}function HV(t,e,n){let r=t.parent;for(;r!==null;){if(e(r))return!0;r=r.parent}return!1}function Qf(t){return new Mt(t.parent===null?t.name:Qf(t.parent)+"/"+t.name)}function Dv(t){t.parent!==null&&BV(t.parent,t.name,t)}function BV(t,e,n){const r=PV(n),o=Ss(t.node.children,e);r&&o?(delete t.node.children[e],t.node.childCount--,Dv(t)):!r&&!o&&(t.node.children[e]=n.node,t.node.childCount++,Dv(t))}const FV=/[\[\].#$\/\u0000-\u001F\u007F]/,jV=/[\[\].#$\u0000-\u001F\u007F]/,cy=10*1024*1024,wk=function(t){return typeof t=="string"&&t.length!==0&&!FV.test(t)},DE=function(t){return typeof t=="string"&&t.length!==0&&!jV.test(t)},zV=function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),DE(t)},VV=function(t){return t===null||typeof t=="string"||typeof t=="number"&&!Xw(t)||t&&typeof t=="object"&&Ss(t,".sv")},UV=function(t,e,n,r){jg(Ng(t,"value"),e,n)},jg=function(t,e,n){const r=n instanceof Mt?new ez(n,t):n;if(e===void 0)throw new Error(t+"contains undefined "+Na(r));if(typeof e=="function")throw new Error(t+"contains a function "+Na(r)+" with contents = "+e.toString());if(Xw(e))throw new Error(t+"contains "+e.toString()+" "+Na(r));if(typeof e=="string"&&e.length>cy/3&&Lg(e)>cy)throw new Error(t+"contains a string greater than "+cy+" utf8 bytes "+Na(r)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let o=!1,s=!1;if(On(e,(i,a)=>
10{if(i===".value")o=!0;else if(i!==".priority"&&i!==".sv"&&(s=!0,!wk(i)))throw new Error(t+" contains an invalid key ("+i+") "+Na(r)+`.  Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);tz(r,i),jg(t,a,r),nz(r)}),o&&s)throw new Error(t+' contains ".value" child '+Na(r)+" in addition to actual children.")}},qV=function(t,e){let n,r;for(n=0;n<e.length;n++){r=e[n];const s=pf(r);for(let i=0;i<s.length;i++)if(!(s[i]===".priority"&&i===s.length-1)&&!wk(s[i]))throw new Error(t+"contains an invalid key ("+s[i]+") in path "+r.toString()+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`)}e.sort(Qj);let o=null;for(n=0;n<e.length;n++){if(r=e[n],o!==null&&to(o,r))throw new Error(t+"contains a path "+o.toString()+" that is ancestor of another path "+r.toString());o=r}},WV=function(t,e,n,r){const o=Ng(t,"values");if(!(e&&typeof e=="object")||Array.isArray(e))throw new Error(o+" must be an object containing the children to replace.");const s=[];On(e,(i,a)=>{const l=new Mt(i);if(jg(o,a,Ut(n,l)),tk(l)===".priority"&&!VV(a))throw new Error(o+"contains an invalid value for '"+l.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");s.push(l)}),qV(o,s)},PE=function(t,e,n,r){if(!DE(n))throw new Error(Ng(t,e)+'was an invalid path = "'+n+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},KV=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),PE(t,e,n)},HE=function(t,e){if(rt(e)===".info")throw new Error(t+" failed = Can't modify data under /.info/")},GV=function(t,e){const n=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!wk(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||n.length!==0&&!zV(n))throw new Error(Ng(t,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};class JV{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function zg(t,e){let n=null;for(let r=0;r<e.length;r++){const o=e[r],s=o.getPath();n!==null&&!nk(s,n.path)&&(t.eventLists_.push(n),n=null),n===null&&(n={events:[],path:s}),n.events.push(o)}n&&t.eventLists_.push(n)}function BE(t,e,n){zg(t,n),FE(t,r=>nk(r,e))}function uo(t,e,n){zg(t,n),FE(t,r=>to(r,e)||to(e,r))}function FE(t,e){t.recursionDepth_++;let n=!0;for(let r=0;r<t.eventLists_.length;r++){const o=t.eventLists_[r];if(o){const s=o.path;e(s)?(YV(t.eventLists_[r]),t.eventLists_[r]=null):n=!1}}n&&(t.eventLists_=[]),t.recursionDepth_--}function YV(t){for(let e=0;e<t.events.length;e++){const n=t.events[e];if(n!==null){t.events[e]=null;const r=n.getEventRunner();Od&&Sn("event: "+n.toString()),Cu(r)}}}const XV="repo_interrupt",ZV=25;class QV{constructor(e,n,r,o){this.repoInfo_=e,this.forceRestClient_=n,this.authTokenProvider_=r,this.appCheckProvider_=o,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new JV,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=pm(),this.transactionQueueTree_=new vk,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}}function eU(t,e,n){if(t.stats_=ek(t.repoInfo_),t.forceRestClient_||xj())t.server_=new Sz(t.repoInfo_,(r,o,s,i)=>{o_(t,r,o,s,i)},t.authTokenProvider_,t.appCheckProvider_),setTimeout(()=>s_(t,!0),0);else{if(typeof n<"u"&&n!==null){if(typeof n!="object")throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{sn(n)}catch(r){throw new Error("Invalid authOverride provided: "+r)}}t.persistentConnection_=new Yf(t.repoInfo_,e,(r,o,s,i)=>{o_(t,r,o,s,i)},r=>{s_(t,r)},r=>{nU(t,r)},t.authTokenProvider_,t.appCheckProvider_,n),t.server_=t.persistentConnection_}t.authTokenProvider_.addTokenChangeListener(r=>{t.server_.refreshAuthToken(r)}),t.appCheckProvider_.addTokenChangeListener(r=>{t.server_.refreshAppCheckToken(r.token)}),t.statsReporter_=Tj(t.repoInfo_,()=>new Iz(t.stats_,t.server_)),t.infoData_=new Mz,t.infoSyncTree_=new n_({startListening:(r,o,s,i)=>{let a=[];const l=t.infoData_.getNode(r._path);return l.isEmpty()||(a=Zf(t.infoSyncTree_,r._path,l),setTimeout(()=>{i("ok")},0)),a},stopListening:()=>{}}),kk(t,"connected",!1),t.serverSyncTree_=new n_({startListening:(r,o,s,i)=>(t.server_.listen(r,s,o,(a,l)=>{const c=i(a,l);uo(t.eventQueue_,r._path,c)}),[]),stopListening:(r,o)=>{t.server_.unlisten(r,o)}})}function tU(t){const e=t.infoData_.getNode(new Mt(".info/serverTimeOffset")).val()||0;return new Date().getTime()+e}function Vg(t){return RV({timestamp:tU(t)})}function o_(t,e,n,r,o){t.dataUpdateCount++;const s=new Mt(e);
10n=t.interceptServerDataCallback_?t.interceptServerDataCallback_(e,n):n;let i=[];if(o)if(r){const l=lm(n,c=>on(c));i=MV(t.serverSyncTree_,s,l,o)}else{const l=on(n);i=SE(t.serverSyncTree_,s,l,o)}else if(r){const l=lm(n,c=>on(c));i=CV(t.serverSyncTree_,s,l)}else{const l=on(n);i=Zf(t.serverSyncTree_,s,l)}let a=s;i.length>0&&(a=Vc(t,s)),uo(t.eventQueue_,a,i)}function s_(t,e){kk(t,"connected",e),e===!1&&iU(t)}function nU(t,e){On(e,(n,r)=>{kk(t,n,r)})}function kk(t,e,n){const r=new Mt("/.info/"+e),o=on(n);t.infoData_.updateSnapshot(r,o);const s=Zf(t.infoSyncTree_,r,o);uo(t.eventQueue_,r,s)}function xk(t){return t.nextWriteId_++}function rU(t,e,n){const r=TV(t.serverSyncTree_,e);return r!=null?Promise.resolve(r):t.server_.get(e).then(o=>{const s=on(o).withIndex(e._queryParams.getIndex());$v(t.serverSyncTree_,e,n,!0);let i;if(e._queryParams.loadsAllData())i=Zf(t.serverSyncTree_,e._path,s);else{const a=yf(t.serverSyncTree_,e);i=SE(t.serverSyncTree_,e._path,s,a)}return uo(t.eventQueue_,e._path,i),km(t.serverSyncTree_,e,n,null,!0),s},o=>(eh(t,"get for query "+sn(e)+" failed: "+o),Promise.reject(new Error(o))))}function oU(t,e,n,r,o){eh(t,"set",{path:e.toString(),value:n,priority:r});const s=Vg(t),i=on(n,r),a=hk(t.serverSyncTree_,e),l=NE(i,a,s),c=xk(t),u=_E(t.serverSyncTree_,e,l,c,!0);zg(t.eventQueue_,u),t.server_.put(e.toString(),i.val(!0),(f,h)=>{const p=f==="ok";p||rr("set at "+e+" failed: "+f);const g=Bi(t.serverSyncTree_,c,!p);uo(t.eventQueue_,e,g),Pv(t,o,f,h)});const d=_k(t,e);Vc(t,d),uo(t.eventQueue_,d,[])}function sU(t,e,n,r){eh(t,"update",{path:e.toString(),value:n});let o=!0;const s=Vg(t),i={};if(On(n,(a,l)=>{o=!1,i[a]=IE(Ut(e,a),on(l),t.serverSyncTree_,s)}),o)Sn("update() called with empty data.  Don't do anything."),Pv(t,r,"ok",void 0);else{const a=xk(t),l=xV(t.serverSyncTree_,e,i,a);zg(t.eventQueue_,l),t.server_.merge(e.toString(),n,(c,u)=>{const d=c==="ok";d||rr("update at "+e+" failed: "+c);const f=Bi(t.serverSyncTree_,a,!d),h=f.length>0?Vc(t,e):e;uo(t.eventQueue_,h,f),Pv(t,r,c,u)}),On(n,c=>{const u=_k(t,Ut(e,c));Vc(t,u)}),uo(t.eventQueue_,e,[])}}function iU(t){eh(t,"onDisconnectEvents");const e=Vg(t),n=pm();Sv(t.onDisconnect_,gt(),(o,s)=>{const i=IE(o,s,t.serverSyncTree_,e);aE(n,o,i)});let r=[];Sv(n,gt(),(o,s)=>{r=r.concat(Zf(t.serverSyncTree_,o,s));const i=_k(t,o);Vc(t,i)}),t.onDisconnect_=pm(),uo(t.eventQueue_,gt(),r)}function aU(t,e,n){let r;rt(e._path)===".info"?r=$v(t.infoSyncTree_,e,n):r=$v(t.serverSyncTree_,e,n),BE(t.eventQueue_,e._path,r)}function lU(t,e,n){let r;rt(e._path)===".info"?r=km(t.infoSyncTree_,e,n):r=km(t.serverSyncTree_,e,n),BE(t.eventQueue_,e._path,r)}function cU(t){t.persistentConnection_&&t.persistentConnection_.interrupt(XV)}function eh(t,...e){let n="";t.persistentConnection_&&(n=t.persistentConnection_.id+":"),Sn(n,...e)}function Pv(t,e,n,r){e&&Cu(()=>{if(n==="ok")e(null);else{const o=(n||"error").toUpperCase();let s=o;r&&(s+=": "+r);const i=new Error(s);i.code=o,e(i)}})}function jE(t,e,n){return hk(t.serverSyncTree_,e,n)||Ze.EMPTY_NODE}function Ck(t,e=t.transactionQueueTree_){if(e||Ug(t,e),Su(e)){const n=VE(t,e);fe(n.length>0,"Sending zero length transaction queue"),n.every(r=>r.status===0)&&uU(t,Qf(e),n)}else RE(e)&&Fg(e,n=>{Ck(t,n)})}function uU(t,e,n){const r=n.map(c=>c.currentWriteId),o=jE(t,e,r);let s=o;const i=o.hash();for(let c=0;c<n.length;c++){const u=n[c];fe(u.status===0,"tryToSendTransactionQueue_: items in queue should all be run."),u.status=1,u.retryCount++;const d=nr(e,u.path);s=s.updateChild(d,u.currentOutputSnapshotRaw)}const a=s.val(!0),l=e;t.server_.put(l.toString(),a,c=>{eh(t,"transaction put response",{path:l.toString(),status:c});let u=[];if(c==="ok"){const d=[];for(let f=0;f<n.length;f++)n[f].status=2,u=u.concat(Bi(t.serverSyncTree_,n[f].currentWriteId)),n[f].onComplete&&d.push(()=>n[f].onComplete(null,!0,n[f].currentOutputSnapshotResolved)),n[f].unwatcher();Ug(t,bk(t.transactionQueueTree_,e)),Ck(t,t.transactionQueueTree_),uo(t.eventQueue_,e,u);for(let f=0;f<d.length;f++)Cu(d[f])}else{if(c==="datastale")for(let d=0;d<n.length;d++)n[d].status===3?n[d].status=4:n[d].status=0;else{rr("transaction at "+l.toString()+" failed: "+c);for(let d=0;d<n.length;d++)n[d].status=4,n[d].abortReason=c}Vc(t,e)}},i)}function Vc(t,e){const n=zE(t,e),r=Qf(n),o=VE(t,n);return dU(t,o,r),r}function dU(t,e,n){if(e.length===0)return;const r=[];let o=[];const s=e.filter(i=>i.status===0).map(i=>i.currentWriteId);for(let i=0;i<e.length;i++){const a=e[i],l=nr(n,a.path);let c=!1,u;if(fe(l!==null,"rerunTransactionsUnderNode_: relativePath should not be null."),a.status===4)c=!0,u=a.abortReason,o=o.concat(Bi(t.serverSyncTree_,a.currentWriteId,!0));else if(a.status===0)if(a.retryCount>=ZV)c=!0,u="maxretry",o=o.concat(Bi(t.serverSyncTree_,a.currentWriteId,!0));else{const d=jE(t,a.path,s);a.currentInputSnapshot=d;const f=e[i].update(d.val());if(f!==void 0){jg("transaction failed: Data returned ",f,a.path);let h=on(f);typeof f=="object"&&f!=null&&Ss(f,".priority")||(h=h.updatePriority(d.getPriority()));const p=a.currentWriteId,g=Vg(t),y=NE(h,d,g);a.currentOutputSnapshotRaw=h,a.currentOutputSnapshotResolved=y,a.currentWriteId=xk(t),s.splice(s.indexOf(p),1),o=o.concat(_E(t.serverSyncTree_,a.path,y,a.currentWriteId,a.applyLocally)),o=o.concat(Bi(t.serverSyncTree_,p,!0))}else c=!0,u="nodata",o=o.concat(Bi(t.serverSyncTree_,a.currentWriteId,!0))}uo(t.eventQueue_,n,o),o=[],c&&(e[i].status=2,(function(d){setTimeout(d,Math.floor(0))})(e[i].unwatcher),e[i].onComplete&&(u==="nodata"?r.push(()=>e[i].onComplete(null,!1,e[i].currentInputSnapshot)):r.push(()=>e[i].onComplete(new Error(u),!1,null))))}Ug(t,t.transactionQueueTree_);for(let i=0;i<r.length;i++)Cu(r[i]);Ck(t,t.transactionQueueTree_)}function zE(t,e){let n,r=t.transactionQueueTree_;
10for(n=rt(e);n!==null&&Su(r)===void 0;)r=bk(r,n),e=At(e),n=rt(e);return r}function VE(t,e){const n=[];return UE(t,e,n),n.sort((r,o)=>r.order-o.order),n}function UE(t,e,n){const r=Su(e);if(r)for(let o=0;o<r.length;o++)n.push(r[o]);Fg(e,o=>{UE(t,o,n)})}function Ug(t,e){const n=Su(e);if(n){let r=0;for(let o=0;o<n.length;o++)n[o].status!==2&&(n[r]=n[o],r++);n.length=r,LE(e,n.length>0?n:void 0)}Fg(e,r=>{Ug(t,r)})}function _k(t,e){const n=Qf(zE(t,e)),r=bk(t.transactionQueueTree_,e);return HV(r,o=>{uy(t,o)}),uy(t,r),$E(r,o=>{uy(t,o)}),n}function uy(t,e){const n=Su(e);if(n){const r=[];let o=[],s=-1;for(let i=0;i<n.length;i++)n[i].status===3||(n[i].status===1?(fe(s===i-1,"All SENT items should be at beginning of queue."),s=i,n[i].status=3,n[i].abortReason="set"):(fe(n[i].status===0,"Unexpected transaction status in abort"),n[i].unwatcher(),o=o.concat(Bi(t.serverSyncTree_,n[i].currentWriteId,!0)),n[i].onComplete&&r.push(n[i].onComplete.bind(null,new Error("set"),!1,null))));s===-1?LE(e,void 0):n.length=s+1,uo(t.eventQueue_,Qf(e),o);for(let i=0;i<r.length;i++)Cu(r[i])}}function fU(t){let e="";const n=t.split("/");for(let r=0;r<n.length;r++)if(n[r].length>0){let o=n[r];try{o=decodeURIComponent(o.replace(/\+/g," "))}catch{}e+="/"+o}return e}function hU(t){const e={};t.charAt(0)==="?"&&(t=t.substring(1));for(const n of t.split("&")){if(n.length===0)continue;const r=n.split("=");r.length===2?e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]):rr(`Invalid query segment '${n}' in query '${t}'`)}return e}const i_=function(t,e){const n=pU(t),r=n.namespace;n.domain==="firebase.com"&&ti(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),(!r||r==="undefined")&&n.domain!=="localhost"&&ti("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||hj();const o=n.scheme==="ws"||n.scheme==="wss";return{repoInfo:new P6(n.host,n.secure,r,o,e,"",r!==n.subdomain),path:new Mt(n.pathString)}},pU=function(t){let e="",n="",r="",o="",s="",i=!0,a="https",l=443;if(typeof t=="string"){let c=t.indexOf("//");c>=0&&(a=t.substring(0,c-1),t=t.substring(c+2));let u=t.indexOf("/");u===-1&&(u=t.length);let d=t.indexOf("?");d===-1&&(d=t.length),e=t.substring(0,Math.min(u,d)),u<d&&(o=fU(t.substring(u,d)));const f=hU(t.substring(Math.min(t.length,d)));c=e.indexOf(":"),c>=0?(i=a==="https"||a==="wss",l=parseInt(e.substring(c+1),10)):c=e.length;const h=e.slice(0,c);if(h.toLowerCase()==="localhost")n="localhost";else if(h.split(".").length<=2)n=h;else{const p=e.indexOf(".");r=e.substring(0,p).toLowerCase(),n=e.substring(p+1),s=r}"ns"in f&&(s=f.ns)}return{host:e,port:l,domain:n,subdomain:r,secure:i,scheme:a,pathString:o,namespace:s}};let mU=class{constructor(e,n,r,o){this.eventType=e,this.eventRegistration=n,this.snapshot=r,this.prevName=o}getPath(){const e=this.snapshot.ref;return this.eventType==="value"?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+sn(this.snapshot.exportVal())}},gU=class{constructor(e,n,r){this.eventRegistration=e,this.error=n,this.path=r}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}};let qE=class{constructor(e,n){this.snapshotCallback=e,this.cancelCallback=n}onValue(e,n){this.snapshotCallback.call(null,e,n)}onCancel(e){return fe(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||this.snapshotCallback.userCallback!==void 0&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}};let yU=class WE{constructor(e,n,r,o){this._repo=e,this._path=n,this._queryParams=r,this._orderByCalled=o}get key(){return st(this._path)?null:tk(this._path)}get ref(){return new ci(this._repo,this._path)}get _queryIdentifier(){const e=WC(this._queryParams),n=Zw(e);return n==="{}"?"default":n}
10get _queryObject(){return WC(this._queryParams)}isEqual(e){if(e=vo(e),!(e instanceof WE))return!1;const n=this._repo===e._repo,r=nk(this._path,e._path),o=this._queryIdentifier===e._queryIdentifier;return n&&r&&o}toJSON(){return this.toString()}toString(){return this._repo.toString()+Zj(this._path)}};class ci extends yU{constructor(e,n){super(e,n,new Cz,!1)}get parent(){const e=J6(this._path);return e===null?null:new ci(this._repo,e)}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}}let KE=class Hv{constructor(e,n,r){this._node=e,this.ref=n,this._index=r}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){const n=new Mt(e),r=Ps(this.ref,e);return new Hv(this._node.getChild(n),r,qt)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){return this._node.isLeafNode()?!1:!!this._node.forEachChild(this._index,(n,r)=>e(new Hv(r,Ps(this.ref,n),qt)))}hasChild(e){const n=new Mt(e);return!this._node.getChild(n).isEmpty()}hasChildren(){return this._node.isLeafNode()?!1:!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}};function wn(t,e){return t=vo(t),t._checkNotDeleted("ref"),e!==void 0?Ps(t._root,e):t._root}function Ps(t,e){return t=vo(t),rt(t._path)===null?KV("child","path",e):PE("child","path",e),new ci(t._repo,Ut(t._path,e))}function a_(t){return HE("remove",t._path),GE(t,null)}function GE(t,e){t=vo(t),HE("set",t._path),UV("set",e,t._path);const n=new Wf;return oU(t._repo,t._path,e,null,n.wrapCallback(()=>{})),n.promise}function qu(t,e){WV("update",e,t._path);const n=new Wf;return sU(t._repo,t._path,e,n.wrapCallback(()=>{})),n.promise}function Fl(t){t=vo(t);const e=new qE(()=>{}),n=new JE(e);return rU(t._repo,t,n).then(r=>new KE(r,new ci(t._repo,t._path),t._queryParams.getIndex()))}let JE=class YE{constructor(e){this.callbackContext=e}respondsTo(e){return e==="value"}createEvent(e,n){const r=n._queryParams.getIndex();return new mU("value",this,new KE(e.snapshotNode,new ci(n._repo,n._path),r))}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,n){return this.callbackContext.hasCancelCallback?new gU(this,e,n):null}matches(e){return e instanceof YE?!e.callbackContext||!this.callbackContext?!0:e.callbackContext.matches(this.callbackContext):!1}hasAnyCallback(){return this.callbackContext!==null}};function vU(t,e,n,r,o){const s=new qE(n,void 0),i=new JE(s);return aU(t._repo,t,i),()=>lU(t._repo,t,i)}function dy(t,e,n,r){return vU(t,"value",e)}pV(ci);bV(ci);const bU="FIREBASE_DATABASE_EMULATOR_HOST",Bv={};let wU=!1;function kU(t,e,n,r){t.repoInfo_=new P6(`${e}:${n}`,!1,t.repoInfo_.namespace,t.repoInfo_.webSocketOnly,t.repoInfo_.nodeAdmin,t.repoInfo_.persistenceKey,t.repoInfo_.includeNamespaceInQueryParams,!0),r&&(t.authTokenProvider_=r)}function xU(t,e,n,r,o){let s=r||t.options.databaseURL;s===void 0&&(t.options.projectId||ti("Can't determine Firebase Database URL. Be sure to include  a Project ID when calling firebase.initializeApp()."),Sn("Using default host for project ",t.options.projectId),s=`${t.options.projectId}-default-rtdb.firebaseio.com`);let i=i_(s,o),a=i.repoInfo,l;typeof process<"u"&&om&&(l=om[bU]),l?(s=`http://${l}?ns=${a.namespace}`,i=i_(s,o),a=i.repoInfo):i.repoInfo.secure;const c=new _j(t.name,t.options,e);GV("Invalid Firebase Database URL",i),st(i.path)||ti("Database URL must point to the root of a Firebase Database (not including a child path).");const u=_U(a,t,c,new Cj(t.name,n));return new SU(u,t)}function CU(t,e){const n=Bv[e];(!n||n[t.key]!==t)&&ti(`Database ${e}(${t.repoInfo_}) has already been deleted.`),cU(t),delete n[t.key]}function _U(t,e,n,r){let o=Bv[e.name];o||(o={},Bv[e.name]=o);let s=o[t.toURLString()];return s&&ti("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),s=new QV(t,wU,n,r),o[t.toURLString()]=s,s}class SU{constructor(e,n){this._repoInternal=e,this.app=n,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(eU(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new ci(this._repo,gt())),this._rootInternal}_delete(){return this._rootInternal!==null&&(CU(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&ti("Cannot call "+e+" on a deleted database.")}}function MU(t=w6(),e){const n=Yw(t,"database").getImmediate({identifier:e});if(!n._instanceStarted){const r=PB("database");r&&TU(n,...r)}return n}function TU(t,e,n,r={}){t=vo(t),t._checkNotDeleted("useEmulator"),t._instanceStarted&&ti("Cannot call useEmulator() after instance has already been initialized.");const o=t._repoInternal;let s;if(o.repoInfo_.nodeAdmin)r.mockUserToken&&ti('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),s=new up(up.OWNER);else if(r.mockUserToken){const i=typeof r.mockUserToken=="string"?r.mockUserToken:HB(r.mockUserToken,t.app.options.projectId);s=new up(i)}kU(o,e,n,s)}function EU(t){aj(xu),Bc(new bl("database",(e,{instanceIdentifier:n})=>{const r=e.getProvider("app").getImmediate(),o=e.getProvider("auth-internal"),s=e.getProvider("app-check-internal");return xU(r,o,s,n)},"PUBLIC").setMultipleInstances(!0)),Yi(EC,AC,t),Yi(EC,AC,"esm2017")}Yf.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)};Yf.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};EU();function Sk(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function XE(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const AU=XE,ZE=new Kf("auth","Firebase",XE());const xm=new Gw("@firebase/auth");function OU(t,...e){xm.logLevel<=Ct.WARN&&xm.warn(`Auth (${xu}): ${t}`,...e)}function pp(t,...e){xm.logLevel<=Ct.ERROR&&xm.error(`Auth (${xu}): ${t}`,...e)}function ni(t,...e){throw Mk(t,...e)}function ls(t,...e){return Mk(t,...e)}function IU(t,e,n){const r=Object.assign(Object.assign({},AU()),{[e]:n});return new Kf("auth","Firebase",r).create(e,{appName:t.name})}function Mk(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return ZE.create(t,...e)}function Xe(t,e,...n){if(!t)throw Mk(e,...n)}function Vs(t){const e="INTERNAL ASSERTION FAILED: "+t;throw pp(e),new Error(e)}function ri(t,e){t||Vs(e)}function Fv(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.href)||""}function NU(){return l_()==="http:"||l_()==="https:"}function l_(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.protocol)||null}function LU(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(NU()||BB()||"connection"in navigator)?navigator.onLine:!0}function RU(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}let th=class{constructor(e,n){this.shortDelay=e,this.longDelay=n,ri(n>
10e,"Short delay should be less than long delay!"),this.isMobile=Kw()||m6()}get(){return LU()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}};function Tk(t,e){ri(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}let QE=class{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;Vs("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;Vs("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;Vs("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}};const $U={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};const DU=new th(3e4,6e4);function Ek(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function nh(t,e,n,r,o={}){return e8(t,o,async()=>{let s={},i={};r&&(e==="GET"?i=r:s={body:JSON.stringify(r)});const a=ku(Object.assign({key:t.config.apiKey},i)).slice(1),l=await t._getAdditionalHeaders();return l["Content-Type"]="application/json",t.languageCode&&(l["X-Firebase-Locale"]=t.languageCode),QE.fetch()(n8(t,t.config.apiHost,n,a),Object.assign({method:e,headers:l,referrerPolicy:"no-referrer"},s))})}async function e8(t,e,n){t._canInitEmulator=!1;const r=Object.assign(Object.assign({},$U),e);try{const o=new PU(t),s=await Promise.race([n(),o.promise]);o.clearNetworkTimeout();const i=await s.json();if("needConfirmation"in i)throw Rh(t,"account-exists-with-different-credential",i);if(s.ok&&!("errorMessage"in i))return i;{const a=s.ok?i.errorMessage:i.error.message,[l,c]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw Rh(t,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw Rh(t,"email-already-in-use",i);if(l==="USER_DISABLED")throw Rh(t,"user-disabled",i);const u=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw IU(t,u,c);ni(t,u)}}catch(o){if(o instanceof ha)throw o;ni(t,"network-request-failed",{message:String(o)})}}async function t8(t,e,n,r,o={}){const s=await nh(t,e,n,r,o);return"mfaPendingCredential"in s&&ni(t,"multi-factor-auth-required",{_serverResponse:s}),s}function n8(t,e,n,r){const o=`${e}${n}?${r}`;return t.config.emulator?Tk(t.config,o):`${t.config.apiScheme}://${o}`}class PU{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(ls(this.auth,"network-request-failed")),DU.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function Rh(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const o=ls(t,e,r);return o.customData._tokenResponse=n,o}async function HU(t,e){return nh(t,"POST","/v1/accounts:delete",e)}
10async function BU(t,e){return nh(t,"POST","/v1/accounts:lookup",e)}function $d(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function FU(t,e=!1){const n=vo(t),r=await n.getIdToken(e),o=Ak(r);Xe(o&&o.exp&&o.auth_time&&o.iat,n.auth,"internal-error");const s=typeof o.firebase=="object"?o.firebase:void 0,i=s?.sign_in_provider;return{claims:o,token:r,authTime:$d(fy(o.auth_time)),issuedAtTime:$d(fy(o.iat)),expirationTime:$d(fy(o.exp)),signInProvider:i||null,signInSecondFactor:s?.sign_in_second_factor||null}}function fy(t){return Number(t)*1e3}function Ak(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return pp("JWT malformed, contained fewer than 3 sections"),null;try{const o=am(n);return o?JSON.parse(o):(pp("Failed to decode base64 JWT payload"),null)}catch(o){return pp("Caught error parsing JWT payload as JSON",o?.toString()),null}}function jU(t){const e=Ak(t);return Xe(e,"internal-error"),Xe(typeof e.exp<"u","internal-error"),Xe(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}async function vf(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof ha&&zU(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function zU({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}class VU{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var n;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const r=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}let r8=class{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=$d(this.lastLoginAt),this.creationTime=$d(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}};async function Cm(t){var e;const n=t.auth,r=await t.getIdToken(),o=await vf(t,BU(n,{idToken:r}));Xe(o?.users.length,n,"internal-error");const s=o.users[0];t._notifyReloadListener(s);const i=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?WU(s.providerUserInfo):[],a=qU(t.providerData,i),l=t.isAnonymous,c=!(t.email&&s.passwordHash)&&!(a!=null&&a.length),u=l?c:!1,d={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new r8(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(t,d)}async function UU(t){const e=vo(t);await Cm(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function qU(t,e){return[...t.filter(n=>!e.some(r=>r.providerId===n.providerId)),...e]}function WU(t){return t.map(e=>{var{providerId:n}=e,r=Sk(e,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}async function KU(t,e){const n=await e8(t,{},async()=>{const r=ku({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:o,apiKey:s}=t.config,i=n8(t,o,"/v1/token",`key=${s}`),a=await t._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",QE.fetch()(i,{method:"POST",headers:a,body:r})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}let c_=class jv{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Xe(e.idToken,"internal-error"),Xe(typeof e.idToken<"u","internal-error"),Xe(typeof e.refreshToken<"u","internal-error");
10const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):jU(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}async getToken(e,n=!1){return Xe(!this.accessToken||this.refreshToken,e,"user-token-expired"),!n&&this.accessToken&&!this.isExpired?this.accessToken:this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:o,expiresIn:s}=await KU(e,n);this.updateTokensAndExpiration(r,o,Number(s))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:o,expirationTime:s}=n,i=new jv;return r&&(Xe(typeof r=="string","internal-error",{appName:e}),i.refreshToken=r),o&&(Xe(typeof o=="string","internal-error",{appName:e}),i.accessToken=o),s&&(Xe(typeof s=="number","internal-error",{appName:e}),i.expirationTime=s),i}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new jv,this.toJSON())}_performRefresh(){return Vs("not implemented")}};function gi(t,e){Xe(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}let zv=class mp{constructor(e){var{uid:n,auth:r,stsTokenManager:o}=e,s=Sk(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new VU(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=o,this.accessToken=o.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new r8(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const n=await vf(this,this.stsTokenManager.getToken(this.auth,e));return Xe(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return FU(this,e)}reload(){return UU(this)}_assign(e){this!==e&&(Xe(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new mp(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){Xe(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await Cm(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await vf(this,HU(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){var r,o,s,i,a,l,c,u;const d=(r=n.displayName)!==null&&r!==void 0?r:void 0,f=(o=n.email)!==null&&o!==void 0?o:void 0,h=(s=n.phoneNumber)!==null&&s!==void 0?s:void 0,p=(i=n.photoURL)!==null&&i!==void 0?i:void 0,g=(a=n.tenantId)!==null&&a!==void 0?a:void 0,y=(l=n._redirectEventId)!==null&&l!==void 0?l:void 0,w=(c=n.createdAt)!==null&&c!==void 0?c:void 0,x=(u=n.lastLoginAt)!==null&&u!==void 0?u:void 0,{uid:C,emailVerified:v,isAnonymous:S,providerData:E,stsTokenManager:M}=n;Xe(C&&M,e,"internal-error");const T=c_.fromJSON(this.name,M);Xe(typeof C=="string",e,"internal-error"),gi(d,e.name),gi(f,e.name),Xe(typeof v=="boolean",e,"internal-error"),Xe(typeof S=="boolean",e,"internal-error"),gi(h,e.name),gi(p,e.name),gi(g,e.name),gi(y,e.name),gi(w,e.name),gi(x,e.name);const A=new mp({uid:C,auth:e,email:f,emailVerified:v,displayName:d,isAnonymous:S,photoURL:p,phoneNumber:h,tenantId:g,stsTokenManager:T,createdAt:w,lastLoginAt:x});return E&&Array.isArray(E)&&(A.providerData=E.map(N=>Object.assign({},N))),y&&(A._redirectEventId=y),A}static async _fromIdTokenResponse(e,n,r=!1){const o=new c_;o.updateFromServerResponse(n);const s=new mp({uid:n.localId,auth:e,stsTokenManager:o,isAnonymous:r});return await Cm(s),s}};const u_=new Map;function Us(t){ri(t instanceof Function,"Expected a class definition");let e=u_.get(t);return e?(ri(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,u_.set(t,e),e)}let o8=class{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}};o8.type="NONE";const d_=o8;function gp(t,e,n){return`firebase:${t}:${e}:${n}`}let f_=class yp{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:o,name:s}=this.auth;this.fullUserKey=gp(this.userKey,o.apiKey,s),this.fullPersistenceKey=gp("persistence",o.apiKey,s),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?zv._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new yp(Us(d_),e,r);const o=(await Promise.all(n.map(async c=>{if(await c._isAvailable())return c}))).filter(c=>c);let s=o[0]||Us(d_);const i=gp(r,e.config.apiKey,e.name);let a=null;for(const c of n)try{const u=await c._get(i);if(u){const d=zv._fromJSON(e,u);c!==s&&(a=d),s=c;break}}catch{}const l=o.filter(c=>c._shouldAllowMigration);return!s._shouldAllowMigration||!l.length?new yp(s,e,r):(s=l[0],a&&await s._set(i,a.toJSON()),await Promise.all(n.map(async c=>{if(c!==s)try{await c._remove(i)}catch{}})),new yp(s,e,r))}};function h_(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(a8(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(s8(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(c8(e))return"Blackberry";if(u8(e))return"Webos";if(Ok(e))return"Safari";if((e.includes("chrome/")||i8(e))&&!e.includes("edge/"))return"Chrome";if(l8(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if(r?.length===2)return r[1]}return"Other"}function s8(t=zn()){return/firefox\//i.test(t)}function Ok(t=zn()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function i8(t=zn()){return/crios\//i.test(t)}function a8(t=zn()){return/iemobile/i.test(t)}function l8(t=zn()){return/android/i.test(t)}function c8(t=zn()){return/blackberry/i.test(t)}function u8(t=zn()){return/webos/i.test(t)}function qg(t=zn()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function GU(t=zn()){var e;return qg(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function JU(){return FB()&&document.documentMode===10}function d8(t=zn()){return qg(t)||l8(t)||u8(t)||c8(t)||/windows phone/i.test(t)||a8(t)}function YU(){try{return!!(window&&window!==window.top)}catch{return!1}}function f8(t,e=[]){let n;switch(t){case"Browser":n=h_(zn());break;case"Worker":n=`${h_(zn())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${xu}/${r}`}async function h8(t,e){return nh(t,"GET","/v2/recaptchaConfig",Ek(t,e))}function p_(t){return t!==void 0&&t.enterprise!==void 0}let p8=class{constructor(e){if(this.siteKey="",this.emailPasswordEnabled=!1,e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.emailPasswordEnabled=e.recaptchaEnforcementState.some(n=>n.provider==="EMAIL_PASSWORD_PROVIDER"&&n.enforcementState!=="OFF")}};function XU(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}
10function m8(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=o=>{const s=ls("internal-error");s.customData=o,n(s)},r.type="text/javascript",r.charset="UTF-8",XU().appendChild(r)})}function ZU(t){return`__${t}${Math.floor(Math.random()*1e6)}`}const QU="https://www.google.com/recaptcha/enterprise.js?render=",eq="recaptcha-enterprise",tq="NO_RECAPTCHA";class nq{constructor(e){this.type=eq,this.auth=rh(e)}async verify(e="verify",n=!1){async function r(s){if(!n){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(i,a)=>{h8(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(l=>{if(l.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const c=new p8(l);return s.tenantId==null?s._agentRecaptchaConfig=c:s._tenantRecaptchaConfigs[s.tenantId]=c,i(c.siteKey)}}).catch(l=>{a(l)})})}function o(s,i,a){const l=window.grecaptcha;p_(l)?l.enterprise.ready(()=>{l.enterprise.execute(s,{action:e}).then(c=>{i(c)}).catch(()=>{i(tq)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,i)=>{r(this.auth).then(a=>{if(!n&&p_(window.grecaptcha))o(a,s,i);else{if(typeof window>"u"){i(new Error("RecaptchaVerifier is only supported in browser"));return}m8(QU+a).then(()=>{o(a,s,i)}).catch(l=>{i(l)})}}).catch(a=>{i(a)})})}}class rq{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=s=>new Promise((i,a)=>{try{const l=e(s);i(l)}catch(l){a(l)}});r.onAbort=n,this.queue.push(r);const o=this.queue.length-1;return()=>{this.queue[o]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const o of n)try{o()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}}}class oq{constructor(e,n,r,o){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=o,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new m_(this),this.idTokenSubscription=new m_(this),this.beforeStateQueue=new rq(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=ZE,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=o.sdkClientVersion}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=Us(n)),this._initializationPromise=this.queue(async()=>{var r,o;if(!this._deleted&&(this.persistenceManager=await f_.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((o=this.currentUser)===null||o===void 0?void 0:o.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUser(e){var n;const r=await this.assertedPersistence.getCurrentUser();let o=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,a=o?._redirectEventId,l=await this.tryRedirectSignIn(e);(!i||i===a)&&l!=null&&l.user&&(o=l.user,s=!0)}if(!o)return this.directlySetCurrentUser(null);
10if(!o._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(o)}catch(i){o=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return o?this.reloadAndSetCurrentUserOrClear(o):this.directlySetCurrentUser(null)}return Xe(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===o._redirectEventId?this.directlySetCurrentUser(o):this.reloadAndSetCurrentUserOrClear(o)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await Cm(e)}catch(n){if(n?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=RU()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const n=e?vo(e):null;return n&&Xe(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&Xe(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue(async()=>{await this.assertedPersistence.setPersistence(Us(e))})}async initializeRecaptchaConfig(){const e=await h8(this,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),n=new p8(e);this.tenantId==null?this._agentRecaptchaConfig=n:this._tenantRecaptchaConfigs[this.tenantId]=n,n.emailPasswordEnabled&&new nq(this).verify()}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new Kf("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&Us(e)||this._popupRedirectResolver;Xe(n,this,"argument-error"),this.redirectPersistenceManager=await f_.create(this,[Us(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,o){if(this._deleted)return()=>{};const s=typeof n=="function"?n:n.next.bind(n),i=this._isInitialized?Promise.resolve():this._initializationPromise;return Xe(i,this,"internal-error"),i.then(()=>s(this.currentUser)),typeof n=="function"?e.addObserver(n,r,o):e.addObserver(n)}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Xe(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=f8(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const o=await this._getAppCheckToken();return o&&(n["X-Firebase-AppCheck"]=o),n}async _getAppCheckToken(){var e;const n=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return n!=null&&n.error&&OU(`Error while retrieving App Check token: ${n.error}`),n?.token}}function rh(t){return vo(t)}let m_=class{constructor(e){this.auth=e,this.observer=null,this.addObserver=YB(n=>this.observer=n)}get next(){return Xe(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}};function sq(t,e){const n=Yw(t,"auth");if(n.isInitialized()){const r=n.getImmediate(),o=n.getOptions();if(cm(o,e??{}))return r;ni(r,"already-initialized")}return n.initialize({options:e})}function iq(t,e){const n=e?.persistence||[],r=(Array.isArray(n)?n:[n]).map(Us);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e?.popupRedirectResolver)}function aq(t,e,n){const r=rh(t);Xe(r._canInitEmulator,r,"emulator-config-failed"),Xe(/^https?:\/\//.test(e),r,"invali
10d-emulator-scheme");const o=!1,s=g8(e),{host:i,port:a}=lq(e),l=a===null?"":`:${a}`;r.config.emulator={url:`${s}//${i}${l}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:i,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:o})}),cq()}function g8(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function lq(t){const e=g8(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",o=/^(\[[^\]]+\])(:|$)/.exec(r);if(o){const s=o[1];return{host:s,port:g_(r.substr(s.length+1))}}else{const[s,i]=r.split(":");return{host:s,port:g_(i)}}}function g_(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function cq(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}let y8=class{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return Vs("not implemented")}_getIdTokenResponse(e){return Vs("not implemented")}_linkToIdToken(e,n){return Vs("not implemented")}_getReauthenticationResolver(e){return Vs("not implemented")}};async function vc(t,e){return t8(t,"POST","/v1/accounts:signInWithIdp",Ek(t,e))}const uq="http://localhost";let Wg=class Vv extends y8{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new Vv(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):ni("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
10once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:o}=n,s=Sk(n,["providerId","signInMethod"]);if(!r||!o)return null;const i=new Vv(r,o);return i.idToken=s.idToken||void 0,i.accessToken=s.accessToken||void 0,i.secret=s.secret,i.nonce=s.nonce,i.pendingToken=s.pendingToken||null,i}_getIdTokenResponse(e){const n=this.buildRequest();return vc(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,vc(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,vc(e,n)}buildRequest(){const e={requestUri:uq,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=ku(n)}return e}};let v8=class{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}};let oh=class extends v8{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}};let b8=class Gl extends oh{constructor(){super("facebook.com")}static credential(e){return Wg._fromParams({providerId:Gl.PROVIDER_ID,signInMethod:Gl.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Gl.credentialFromTaggedObject(e)}static credentialFromError(e){return Gl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Gl.credential(e.oauthAccessToken)}catch{return null}}};b8.FACEBOOK_SIGN_IN_METHOD="facebook.com";b8.PROVIDER_ID="facebook.com";let w8=class Jl extends oh{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return Wg._fromParams({providerId:Jl.PROVIDER_ID,signInMethod:Jl.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return Jl.credentialFromTaggedObject(e)}static credentialFromError(e){return Jl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return Jl.credential(n,r)}catch{return null}}};w8.GOOGLE_SIGN_IN_METHOD="google.com";w8.PROVIDER_ID="google.com";class Ni extends oh{constructor(){super("github.com")}static credential(e){return Wg._fromParams({providerId:Ni.PROVIDER_ID,signInMethod:Ni.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Ni.credentialFromTaggedObject(e)}static credentialFromError(e){return Ni.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Ni.credential(e.oauthAccessToken)}catch{return null}}}Ni.GITHUB_SIGN_IN_METHOD="github.com";Ni.PROVIDER_ID="github.com";let k8=class Yl extends oh{constructor(){super("twitter.com")}static credential(e,n){return Wg._fromParams({providerId:Yl.PROVIDER_ID,signInMethod:Yl.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return Yl.credentialFromTaggedObject(e)}static credentialFromError(e){return Yl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return Yl.credential(n,r)}catch{return null}}};k8.TWITTER_SIGN_IN_METHOD="twitter.com";k8.PROVIDER_ID="twitter.com";async function dq(t,e){return t8(t,"POST","/v1/accounts:signUp",Ek(t,e))}let bf=class Uv{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,o=!1){const s=await zv._fromIdTokenResponse(e,r,o),i=y_(r);return new Uv({user:s,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const o=y_(r);return new Uv({user:e,providerId:o,_tokenResponse:r,operationType:n})}};function y_(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}async function fq(t){var e;const n=rh(t);if(await n._initializationPromise,!((e=n.currentUser)===null||e===void 0)&&e.isAnonymous)return new bf({user:n.currentUser,providerId:null,operationType:"signIn"});const r=await dq(n,{returnSecureToken:!0}),o=await bf._fromIdTokenResponse(n,"signIn",r,!0);return await n._updateCurrentUser(o.user),o}let hq=class qv extends ha{constructor(e,n,r,o){var s;super(n.code,n.message),this.operationType=r,this.user=o,Object.setPrototypeOf(this,qv.prototype),this.customData={appName:e.n
10ame,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,o){return new qv(e,n,r,o)}};function x8(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?hq._fromErrorAndOperation(t,o,e,r):o})}async function pq(t,e,n=!1){const r=await vf(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return bf._forOperation(t,"link",r)}async function mq(t,e,n=!1){const{auth:r}=t,o="reauthenticate";try{const s=await vf(t,x8(r,o,e,t),n);Xe(s.idToken,r,"internal-error");const i=Ak(s.idToken);Xe(i,r,"internal-error");const{sub:a}=i;return Xe(t.uid===a,r,"user-mismatch"),bf._forOperation(t,o,s)}catch(s){throw s?.code==="auth/user-not-found"&&ni(r,"user-mismatch"),s}}async function gq(t,e,n=!1){const r="signIn",o=await x8(t,r,e),s=await bf._fromIdTokenResponse(t,r,o);return n||await t._updateCurrentUser(s.user),s}function yq(t,e,n,r){return vo(t).onIdTokenChanged(e,n,r)}function vq(t,e,n){return vo(t).beforeAuthStateChanged(e,n)}const _m="__sak";let C8=class{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(_m,"1"),this.storage.removeItem(_m),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}};function bq(){const t=zn();return Ok(t)||qg(t)}const wq=1e3,kq=10;let _8=class extends C8{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=bq()&&YU(),this.fallbackToPolling=d8(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),o=this.localCache[n];r!==o&&e(n,o,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((i,a,l)=>{this.notifyListeners(i,l)});return}const r=e.key;if(n?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const i=this.storage.getItem(r);if(e.newValue!==i)e.newValue!==null?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!n)return}const o=()=>{const i=this.storage.getItem(r);!n&&this.localCache[r]===i||this.notifyListeners(r,i)},s=this.storage.getItem(r);JU()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(o,kq):o()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const o of Array.from(r))o(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},wq)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
10ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}};_8.type="LOCAL";const xq=_8;let S8=class extends C8{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}};S8.type="SESSION";const M8=S8;function Cq(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}let T8=class E8{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(o=>o.isListeningto(e));if(n)return n;const r=new E8(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:o,data:s}=n.data,i=this.handlersMap[o];if(!(i!=null&&i.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:o});const a=Array.from(i).map(async c=>c(n.origin,s)),l=await Cq(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:o,response:l})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}};T8.receivers=[];function Ik(t="",e=10){let n="";for(let r=0;r<e;r++)n+=Math.floor(Math.random()*10);return t+n}class _q{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,n,r=50){const o=typeof MessageChannel<"u"?new MessageChannel:null;if(!o)throw new Error("connection_unavailable");let s,i;return new Promise((a,l)=>{const c=Ik("",20);o.port1.start();const u=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:o,onMessage(d){const f=d;if(f.data.eventId===c)switch(f.data.status){case"ack":clearTimeout(u),s=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),a(f.data.response);break;default:clearTimeout(u),clearTimeout(s),l(new Error("invalid_response"));break}}},this.handlers.add(i),o.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:e,eventId:c,data:n},[o.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}function cs(){return window}function Sq(t){cs().location.href=t}function A8(){return typeof cs().WorkerGlobalScope<"u"&&typeof cs().importScripts=="function"}async function Mq(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Tq(){var t;return((t=navigator?.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function Eq(){return A8()?self:null}const O8="firebaseLocalStorageDb",Aq=1,Sm="firebaseLocalStorage",I8="fbase_key";let sh=class{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}};function Kg(t,e){return t.transaction([Sm],e?"readwrite":"readonly").objectStore(Sm)}function Oq(){const t=indexedDB.deleteDatabase(O8);return new sh(t).toPromise()}function Wv(){const t=indexedDB.open(O8,Aq);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(Sm,{keyPath:I8})}catch(o){n(o)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(Sm)?e(r):(r.close(),await Oq(),e(await Wv()))})})}async function v_(t,e,n){const r=Kg(t,!0).put({[I8]:e,value:n});
10return new sh(r).toPromise()}async function Iq(t,e){const n=Kg(t,!1).get(e),r=await new sh(n).toPromise();return r===void 0?null:r.value}function b_(t,e){const n=Kg(t,!0).delete(e);return new sh(n).toPromise()}const Nq=800,Lq=3;let N8=class{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Wv(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>Lq)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return A8()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=T8._getInstance(Eq()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)}
10)),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var e,n;if(this.activeServiceWorker=await Mq(),!this.activeServiceWorker)return;this.sender=new _q(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Tq()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Wv();return await v_(e,_m,"1"),await b_(e,_m),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>v_(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>Iq(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>b_(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(o=>{const s=Kg(o,!1).getAll();return new sh(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;for(const{fbase_key:o,value:s}of e)r.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(s)&&(this.notifyListeners(o,s),n.push(o));for(const o of Object.keys(this.localCache))this.localCache[o]&&!r.has(o)&&(this.notifyListeners(o,null),n.push(o));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const o of Array.from(r))o(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Nq)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
10ject.keys(this.listeners).length===0&&this.stopPolling()}};N8.type="LOCAL";const Rq=N8;new th(3e4,6e4);function $q(t,e){return e?Us(e):(Xe(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}let Nk=class extends y8{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return vc(e,this._buildIdpRequest())}_linkToIdToken(e,n){return vc(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return vc(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}};function Dq(t){return gq(t.auth,new Nk(t),t.bypassAuthState)}function Pq(t){const{auth:e,user:n}=t;return Xe(n,e,"internal-error"),mq(n,new Nk(t),t.bypassAuthState)}async function Hq(t){const{auth:e,user:n}=t;return Xe(n,e,"internal-error"),pq(n,new Nk(t),t.bypassAuthState)}let L8=class{constructor(e,n,r,o,s=!1){this.auth=e,this.resolver=r,this.user=o,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:o,tenantId:s,error:i,type:a}=e;if(i){this.reject(i);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:s||void 0,postBody:o||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Dq;case"linkViaPopup":case"linkViaRedirect":return Hq;case"reauthViaPopup":case"reauthViaRedirect":return Pq;default:ni(this.auth,"internal-error")}}resolve(e){ri(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){ri(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}};const Bq=new th(2e3,1e4);let Fq=class rd extends L8{constructor(e,n,r,o,s){super(e,n,o,s),this.provider=r,this.authWindow=null,this.pollId=null,rd.currentPopupAction&&rd.currentPopupAction.cancel(),rd.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Xe(e,this.auth,"internal-error"),e}async onExecution(){ri(this.filter.length===1,"Popup operations only handle one event");const e=Ik();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(ls(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(ls(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,rd.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(ls(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Bq.get())};e()}};Fq.currentPopupAction=null;const jq="pendingRedirect",vp=new Map;class zq extends L8{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=vp.get(this.auth._key());if(!e){try{const n=await Vq(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(n)}catch(n){e=()=>Promise.reject(n)}vp.set(this.auth._key(),e)}return this.bypassAuthState||vp.set(this.auth._key(),()=>Promise.resolve(null)),e()}
10async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function Vq(t,e){const n=Wq(e),r=qq(t);if(!await r._isAvailable())return!1;const o=await r._get(n)==="true";return await r._remove(n),o}function Uq(t,e){vp.set(t._key(),e)}function qq(t){return Us(t._redirectPersistence)}function Wq(t){return gp(jq,t.config.apiKey,t.name)}async function Kq(t,e,n=!1){const r=rh(t),o=$q(r,e),s=await new zq(r,o,n).execute();return s&&!n&&(delete s.user._redirectEventId,await r._persistUserIfCurrent(s.user),await r._setRedirectUser(null,e)),s}const Gq=600*1e3;class Jq{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Yq(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!R8(e)){const o=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(ls(this.auth,o))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Gq&&this.cachedEventUids.clear(),this.cachedEventUids.has(w_(e))}saveEventToCache(e){this.cachedEventUids.add(w_(e)),this.lastProcessedEventTime=Date.now()}}function w_(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function R8({type:t,error:e}){return t==="unknown"&&e?.code==="auth/no-auth-event"}function Yq(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return R8(t);default:return!1}}async function Xq(t,e={}){return nh(t,"GET","/v1/projects",e)}const Zq=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Qq=/^https?/;async function eW(t){if(t.config.emulator)return;const{authorizedDomains:e}=await Xq(t);for(const n of e)try{if(tW(n))return}catch{}ni(t,"unauthorized-domain")}function tW(t){const e=Fv(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const s=new URL(t);return s.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&s.hostname===r}if(!Qq.test(n))return!1;if(Zq.test(t))return r===t;const o=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+o+"|"+o+")$","i").test(r)}const nW=new th(3e4,6e4);function k_(){const t=cs().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n<t.CP.length;n++)t.CP[n]=null}}function rW(t){return new Promise((e,n)=>{var r,o,s;function i(){k_(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{k_(),n(ls(t,"network-request-failed"))},timeout:nW.get()})}if(!((o=(r=cs().gapi)===null||r===void 0?void 0:r.iframes)===null||o===void 0)&&o.Iframe)e(gapi.iframes.getContext());else if(!((s=cs().gapi)===null||s===void 0)&&s.load)i();else{const a=ZU("iframefcb");return cs()[a]=()=>{gapi.load?i():n(ls(t,"network-request-failed"))},m8(`https://apis.google.com/js/api.js?onload=${a}`).catch(l=>n(l))}}).catch(e=>{throw bp=null,e})}let bp=null;function oW(t){return bp=bp||rW(t),bp}const sW=new th(5e3,15e3),iW="__/auth/iframe",aW="emulator/auth/iframe",lW={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},cW=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function uW(t){const e=t.config;Xe(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?Tk(e,aW):`https://${t.config.authDomain}/${iW}`,r={apiKey:e.apiKey,appName:t.name,v:xu},o=cW.get(t.config.apiHost);o&&(r.eid=o);const s=t._getFrameworks();return s.length&&(r.fw=s.join(",")),`${n}?${ku(r).slice(1)}`}async function dW(t){const e=await oW(t),n=cs().gapi;return Xe(n,t,"internal-error"),e.open({where:document.body,url:uW(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:lW,dontclear:!0},r=>new Promise(async(o,s)=>{await r.restyle({setHideOnLeave:!1});const i=ls(t,"network-request-failed"),a=cs().setTimeout(()=>{s(i)},sW.get());function l(){cs().clearTimeout(a),o(r)}r.ping(l).then(l,()=>{s(i)})}))}const fW={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},hW=500,pW=600,mW="_blank",gW="http://localhost";let x_=class{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}};function yW(t,e,n,r=hW,o=pW){const s=Math.max((window.screen.availHeight-o)/2,0).toString(),i=Math.max((window.screen.availWi
10dth-r)/2,0).toString();let a="";const l=Object.assign(Object.assign({},fW),{width:r.toString(),height:o.toString(),top:s,left:i}),c=zn().toLowerCase();n&&(a=i8(c)?mW:n),s8(c)&&(e=e||gW,l.scrollbars="yes");const u=Object.entries(l).reduce((f,[h,p])=>`${f}${h}=${p},`,"");if(GU(c)&&a!=="_self")return vW(e||"",a),new x_(null);const d=window.open(e||"",a,u);Xe(d,t,"popup-blocked");try{d.focus()}catch{}return new x_(d)}function vW(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}const bW="__/auth/handler",wW="emulator/auth/handler",kW=encodeURIComponent("fac");async function C_(t,e,n,r,o,s){Xe(t.config.authDomain,t,"auth-domain-config-required"),Xe(t.config.apiKey,t,"invalid-api-key");const i={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:xu,eventId:o};if(e instanceof v8){e.setDefaultLanguage(t.languageCode),i.providerId=e.providerId||"",hv(e.getCustomParameters())||(i.customParameters=JSON.stringify(e.getCustomParameters()));for(const[u,d]of Object.entries({}))i[u]=d}if(e instanceof oh){const u=e.getScopes().filter(d=>d!=="");u.length>0&&(i.scopes=u.join(","))}t.tenantId&&(i.tid=t.tenantId);const a=i;for(const u of Object.keys(a))a[u]===void 0&&delete a[u];const l=await t._getAppCheckToken(),c=l?`#${kW}=${encodeURIComponent(l)}`:"";return`${xW(t)}?${ku(a).slice(1)}${c}`}function xW({config:t}){return t.emulator?Tk(t,wW):`https://${t.authDomain}/${bW}`}const hy="webStorageSupport";class CW{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=M8,this._completeRedirectFn=Kq,this._overrideRedirectResult=Uq}async _openPopup(e,n,r,o){var s;ri((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const i=await C_(e,n,r,Fv(),o);return yW(e,i,Ik())}async _openRedirect(e,n,r,o){await this._originValidation(e);const s=await C_(e,n,r,Fv(),o);return Sq(s),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:o,promise:s}=this.eventManagers[n];return o?Promise.resolve(o):(ri(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await dW(e),r=new Jq(e);return n.register("authEvent",o=>(Xe(o?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(o.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(hy,{type:hy},r=>{var o;const s=(o=r?.[0])===null||o===void 0?void 0:o[hy];s!==void 0&&n(!!s),ni(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=eW(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return d8()||Ok()||qg()}}const _W=CW;var __="@firebase/auth",S_="0.23.2";class SW{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){Xe(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}function MW(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}function TW(t){Bc(new bl("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),o=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:i,authDomain:a}=r.options;Xe(i&&!i.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:i,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:f8(t)},c=new oq(r,o,s,l);return iq(c,n),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),Bc(new bl("auth-internal",e=>{const n=rh(e.getProvider("auth").getImmediate());return(r=>new SW(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),Yi(__,S_,MW(t)),Yi(__,S_,"esm2017")}const EW=300,AW=p6("authIdTokenMaxAge")||EW;let M_=null;const OW=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>AW)return;const o=n?.token;M_!==o&&(M_=o,await fetch(t,{method:o?"POST":"DELETE",headers:o?{Authorization:`Bearer ${o}`}:{}}))};function T_(t=w6()){const e=Yw(t,"auth");if(e.isInitialized())return e.getImmediate();const n=sq(t,{popupRedirectResolver:_W,persistence:[Rq,xq,M8]}),r=p6("authTokenSyncURL");if(r){const s=OW(r);vq(n,s,()=>s(n.currentUser)),yq(n,i=>s(i))}const o=f6("auth");return o&&aq(n,`http://${o}`),n}TW("Browser");class IW{constructor(e){Rn(this,"name"),Rn(this,"email"),Rn(this,"avatar"),Rn(this,"id"),Rn(this,"uid"),Rn(this,"roles"),Rn(this,"x",0),Rn(this,"y",0),Rn(this,"idle",!0),Rn(this,"screen"),this.name=e.name,this.id=e.hasOwnProperty("id")?e.id:0,this.uid=e.uid,e.hasOwnProperty("email")&&(this.email=e.email),e.hasOwnProperty("avatar")&&(this.avatar=e.avatar),e.hasOwnProperty("roles")&&(this.roles=e.roles),e.screen&&(this.screen={height:e.screen.height,width:e.screen.width})}getRoles(){return this.roles}asAuthor(){return{name:this.name,email:this.email,avatar:this.avatar,id:this.id,uid:this.uid}}asCollaborator(){return{name:this.name,email:this.email?this.email:"",avatar:this.avatar?this.avatar:"",id:this.id,uid:this.uid,x:this.x,y:this.y,screen:this.screen,idle:this.idle}}}const $l=()=>{const{context:t}=Hr(),e=s6(),n=vu(),r=lt(),o=()=>{const j=e.getPluginConfig("firebase");return b6(j)},s=async()=>{const j=o(),P=T_(j);if(!n.getFirebaseUser){const Q=T_(j),J=await fq(Q);n.setFirebaseUser(J.user)}return P.currentUser},i=()=>{const j=o();return MU(j)},a=j=>{const{generateHash:P}=Pc(),Q=j.context.link.split("/")[2];return P(Q+"/"+j.post_id+"/"+j.id)},l=async()=>{const j=as(),P=await s(),Q=new IW({...j.getUser,uid:P?.uid,screen:{width:window.innerWidth,height:window.innerHeight}});return console.log("currentCollaborator",Q),Q},c=async j=>{const{redirect:P}=_r(),{updateStatus:Q}=$r(),J=as(),ke=await s(),Se=await l();if(console.log("START COLLABORATION",j,ke,J.getUser),j.status!=="collaborate"){let se=await Q(j.id,"collaborate");j.status=se.status}if(!await C(j)){const se=a(j);await GE(wn(i(),"collaboration/"+se),{author:Se.asAuthor(),context:j.context,id:j.post_id,revisionId:j.id,guests:{},chat:!1})}const ee=S(j);P(ee)},u=async j=>{const{createRevision:P}=$r();j.revision_status="collaborate";const Q=await P(j);await c(Q)},d=async j=>{const{writeMessage:P}=ro(),{updateRevision:Q}=$r(),{redirect:J}=_r(),{context:ke}=Hr();await s();const Se=j.id,ee=j.post_id,se=a(j);await Q(Se,ke.value),n.resetCollaboration(),await a_(wn(i(),"collaboration/"+se)),J("#/design/"+ee+"/revisions/"+Se),P("Collaboration has stopped",null,"success")},f=async j=>{const P=i(),Q=wn(P);await s();const J=await l();
10return new Promise(ke=>{Fl(Ps(Q,"collaboration/"+n.getCollaborationID+"/guests")).then(Se=>{Se.exists()&&JSON.parse(JSON.stringify(Se.val())).hasOwnProperty(J.uid)&&qu(wn(P,"collaboration/"+n.getCollaborationID+"/guests/"+J.uid),{idle:j?new Date().getTime():!1}).then(()=>{ke(!0)})}).catch(Se=>{console.error(Se)})})},h=async()=>{await s();const j=await l();await y(n.getCollaborationID,j),n.resetCollaboration()},p=async j=>{const{writeMessage:P}=ro(),{setRevision:Q}=$r(),{getUsername:J}=Qt(),ke=i();await s();const Se=await l(),ee=await v(j);if(console.log("INIT COLLABORATION MODE",Se,j,ee),!ee){r.setCollaborationStopped(!0);return}if(!ee.revisionId){P("No revision ID found",null,"error",!0);return}Q(ee.revisionId,!1),n.setCollaborationID(j),n.setCollaborateMode(!0);const se=J();console.log("COLLABORATION",se),(se||Se)&&await w(j,Se),P("Collaboration started",null,"success");const Re=wn(ke,"collaboration/"+j+"/context");dy(Re,ne=>{if(T()){const de=ne.val();de===null?(n.resetCollaboration(),r.setCollaborationStopped(!0)):Hr().setContext(de)}});const F=wn(ke,"collaboration/"+j+"/guests");dy(F,ne=>{const de=ne.val();n.setCollaborationGuests(de)});const q=wn(ke,"collaboration/"+j+"/chat");dy(q,ne=>{const de=ne.val();de?n.setMessages(de):n.setMessages([])}),E()},g=(j,P)=>{const Q=i();qu(wn(Q,"collaboration/"+n.getCollaborationID),{context:P})},y=async(j,P)=>{const Q=i(),J=wn(Q);return await s(),console.log("REMOVING GUEST",j,P),new Promise(ke=>{Fl(Ps(J,"collaboration/"+j+"/guests")).then(Se=>{Se.exists()&&JSON.parse(JSON.stringify(Se.val())).hasOwnProperty(P.uid)&&a_(wn(Q,"collaboration/"+j+"/guests/"+P.uid)).then(()=>{ke(!0)})}).catch(Se=>{console.error(Se)})})},w=async(j,P)=>{const Q=i(),J=wn(Q);return new Promise(ke=>{""+j+P.uid,Fl(Ps(J,"collaboration/"+j+"/guests")).then(Se=>{const ee={...P.asCollaborator(),x:0,y:0,activeContextID:null,activeBlockIndex:null,idle:!1};qu(wn(Q,"collaboration/"+j+"/guests/"+P.uid),{...ee}).then(()=>{ke(!0)})}).catch(Se=>{console.error(Se)})})},x=async(j,P,Q,J)=>{const ke=i(),Se=wn(ke);await s();const ee=await l();return new Promise(se=>{Fl(Ps(Se,"collaboration/"+j+"/guests")).then(Re=>{Re.exists()&&Re.val().hasOwnProperty(ee.uid)&&qu(wn(ke,"collaboration/"+j+"/guests/"+ee.uid),{activeContextID:Q,activeBlockIndex:J}).then(()=>{se(!0)})}).catch(Re=>{console.error(Re)})})},C=async j=>{const P=wn(i()),Q=a(j);return await s(),console.log("hasCollaboration",Q),await Fl(Ps(P,"collaboration/"+Q)).then(J=>!!J.exists())},v=async j=>{const P=wn(i());return await Fl(Ps(P,"collaboration/"+j)).then(Q=>Q.exists()?Q.val():null)},S=j=>(Pc(),"#/collaborate/"+a(j)),E=()=>{const{writeMessage:j}=ro();if(He("collaborate").isEnabled()){EB(t,(J,ke)=>{console.log("UPDATING CTX",t),T()?g(J.id,J):console.log("SHOULD NOT WRITE DATA")},{debounce:250,maxWait:5e3,deep:!0});const P=U(()=>n.getMessages);Ye(P,(J,ke)=>{if(J.length>0){if(!(ke.length===0&&J.length>1||ke.length===0&&J.length===0)&&!n.getChatOpen){let Se=n.getUnreadMessageCount;if(n.setUnreadMessageCount(Se+1),n.notificationsOn){let ee;J[J.length-1].message.length>65?ee=J[J.length-1].message.substring(0,65)+"...":ee=J[J.length-1].message,j(ee,J[J.length-1].from.name,"message")}}setTimeout(()=>{var Se=document.getElementById("chat-container");Se&&(Se.scrollTop=Se.scrollHeight)},10)}});const Q=U(()=>n.getChatOpen);Ye(Q,(J,ke)=>{Q&&(n.setUnreadMessageCount(0),setTimeout(()=>{var Se=document.getElementById("chat-container");Se&&(Se.scrollTop=Se.scrollHeight)},1))})}},M=async()=>{const j=as(),P=i();if(await s(),n.currentMessage){const Q={from:j.getUser?j.getUser:null,message:n.currentMessage,timestamp:Date.now()};let J=n.getMessages?[...n.getMessages,Q]:[Q];console.log("CHAT",J),qu(wn(P,"collaboration/"+n.getCollaborationID+"/chat"),{...J}),n.clearCurrentMessage()}},T=()=>n.getCollaborateMode??!1,A=U(()=>T()),N=()=>n.getCollaborationID??!1,D=U(()=>N()),$=()=>(Qt().getUserId(),n.getCollaborationID??!1);U(()=>$());const W=()=>n.getCollaborationGuests??!1,me=U(()=>W()),V=U(()=>n.getChatOpen),B=()=>{n.toggleChat()},Y=U(()=>n.getNotificationsOn);return{initCollaborationMode:p,exitCollaborationMode:h,hasCollaboration:C,stopCollaboration:d,startCollaboration:c,startCollaborationFromContext:u,getCollaborationUrl:S,setUserIdleStatus:f,isCollaborateMode:A,collaborationID:D,collaborationGuests:me,initWatcher:E,sendMessage:M,toggleChat:B,chatIsOpen:V,notificationsOn:Y,updateGuestActiveBlock:x}},NW=()=>{const t=lt(),e=jo(),n="#/design/:post_id/revisions/:id",r=Qt(),{getCollaborationUrl:o,hasCollaboration:s}=$l(),{setRevision:i,getCurrentRevision:a}=$r();return{path:n,callback:async l=>{l.uriSegments[2];
10const c=l.uriSegments[4];await i(c);const u=a();if(u&&u.share_id&&t.setShareId(u.share_id),He("collaborate").isEnabled()){if(!u)return;if(u.status==="collaborate")if(!await s(u))await e.revisions().updateStatus(u.id,"draft",{requestToken:r.getAuthToken()});else{const d=o(u);if(d!==!1)return{redirectUrl:d}}}t.setPreloading(!1)}}},LW=()=>{const t="#/collaborate/:id",e=lt(),n=as(),r=_s();jo();const o=Qt(),{initCollaborationMode:s,exitCollaborationMode:i,isCollaborateMode:a,collaborationID:l}=$l();return $r(),{path:t,callback:async c=>{const u=c.uriSegments[2];if(n.enableGuestLogin(),r.setGuestRole("collaborator"),!o.isUserLoggedIn.value||!He("collaborate").isEnabled())return{redirectUrl:"#/login?redirect="+c.path};await s(u),e.setPreloading(!1)},exitCallback:async c=>{a.value&&l.value&&await i()}}},RW=()=>{const t="#/login",e=lt();return{path:t,callback:async n=>{let r=n.path;return n.params.forEach((o,s)=>{r.indexOf("?")===-1?r+="?":r+="&",r+=s+"="+o}),e.setPreloading(!1),{redirectUrl:r}}}},$8=()=>{const t=lt(),e=jo(),n=c=>{const{generateHash:u}=Pc(),d=c.context.link.split("/")[2];return u(d+"/"+c.post_id+"/"+c.id+"/share")},r=async(c="")=>{console.log("START SHARE",c);const{goTo:u}=_r(),{generateHash:d}=Pc(),{context:f}=Hr(),{getCurrentRevision:h,createRevision:p,updateRevision:g}=$r();let y=h();y||(y=await p(f.value),y.hasOwnProperty("id")&&u(`#/design/${y.post_id}/revisions/${y.id}`));const w=n(y);return console.log("SHARE ID",w),w&&(f.value.share_id=w,c.length>0?f.value.share_token=d(c):f.value.share_token=0,await g(y.id,f.value),t.setShareId(w)),t.setShareActive(!0),!0},o=async()=>{const{context:c}=Hr(),{getCurrentRevision:u,updateRevision:d}=$r();let f=u();return c.value.share_id=0,c.value.share_token=0,await d(f.id,c.value),t.setShareActive(!1),t.setShareId(0),!0},s=async c=>{console.log("INIT SHARE MODE",c);let u=await i(c);return u&&u.length>0&&(u=u[0],t.setRevision(u),u.context&&t.setContext(u.context)),u},i=async c=>await e.revisions().getByShareId(c),a=()=>t.getShareActive??!1,l=U(()=>a());return{generateShareId:n,isShareActive:l,startShare:r,stopShare:o,shareId:U(()=>t.getShareId),initShareMode:s}},$W=()=>{const t="#/share/:id",e=lt(),n=zr(),{initShareMode:r}=$8(),o=_s(),s=Qt();return{path:t,callback:async i=>{const a=i.uriSegments[2],l=await r(a);l.id&&(l.context.share_token||(s.setUser({name:"visitor"}),s.setRole("visitor")),n.setEditMode(!1),o.setCurrentRole("visitor"),e.setShareActive(!0)),e.setPreloading(!1)}}},DW=dr("contentStore",{state:()=>({content:[],totalPages:0,totalContent:0,currentPage:0}),getters:{getContent(t){return t.content},getTotalPages(t){return t.totalPages},getTotalContent(t){return t.totalContent},getCurrentPage(t){return t.currentPage}},actions:{setContent(t){this.content=t},setTotalPages(t){this.totalPages=t},setTotalContent(t){this.totalContent=t},setCurrentPage(t){this.currentPage=t}}}),Lk=(t=1,e=20)=>{const n=DW(),r=pe(!0),o=jo(),s=Qt();t&&n.setCurrentPage(t);const i=()=>n.getContent,a=async(f=1,h=20)=>{r.value=!0;const p=o.content();console.log("LOAD CONTENT",f,h);const g=await p.getAll(f,h,{requestToken:s.getAuthToken()});r.value=!1,n.setContent(g.data),n.setTotalPages(g?.pages||1),n.setTotalContent(g?.total||0),n.setCurrentPage(f)},l=U(()=>i()),c=U(()=>n.getTotalPages),u=U(()=>n.getTotalContent),d=U(()=>n.getCurrentPage);return{loadContent:a,getContent:i,loading:r,content:l,totalPages:c,totalContent:u,currentPage:d}},PW=()=>{const t="#/content",e=lt();_s();const n=Lk();jo();
10const r=Qt();return{path:t,callback:async o=>{console.log("contentIndex",o),console.log("contentIndex",o?.params.get("page"));const s=o?.params.get("page")||1,i=o?.params.get("per_page")||20;if(e.unsetContext(),!r.isUserLoggedIn.value||!He("design.publish").isEnabled())return{redirectUrl:"#/login?redirect="+o.path};["collaborate","design.publish","ui.editor","design.share","ui.navigationRight","ui.navbar.editToggle","ui.navbar.collaborateToggle"].forEach(a=>{He(a).asDisabled()}),await n.loadContent(s,i),e.setPreloading(!1)}}},HW=()=>{const t="#/content/:id/view",e=lt(),n=zr(),r=jo(),o=Qt();return{path:t,callback:async s=>{const i=s.uriSegments[2];if(!o.isUserLoggedIn.value||!He("content.read").isEnabled())return{redirectUrl:"#/login?redirect="+s.path};{const a=await r.content().getItem(i,{requestToken:o.getAuthToken()});["collaborate","design.publish","design.share","ui.navigationRight","ui.navbar.editToggle","ui.navbar.collaborateToggle"].forEach(l=>{He(l).asDisabled()}),n.setEditMode(!1),Hr().setContext(a[0])}e.setPreloading(!1)}}},BW=()=>{const e=Qt();return{path:"#/",callback:async n=>!e.isUserLoggedIn.value||!He("content.read").isEnabled()?{redirectUrl:"#/login?redirect=#/"}:He("dashboard").isEnabled()?{redirectUrl:"#/dashboard"}:He("content.read").isEnabled()?{redirectUrl:"#/content"}:{redirectUrl:"#/404"}}},FW=()=>{const t="#/dashboard",e=lt();_s(),Lk(),jo();const n=Qt();return{path:t,callback:async r=>{if(e.unsetContext(),!n.isUserLoggedIn.value||!He("dashboard").isEnabled())return{redirectUrl:"#/login?redirect="+r.path};["design.publish","ui.editor","design.share","ui.navigationRight","ui.navbar.editToggle","ui.navbar.collaborateToggle"].forEach(o=>{He(o).asDisabled()}),e.setPreloading(!1)}}},jW=()=>({routes:[LW(),RW(),$W(),fB(),hB(),HW(),PW(),NW(),BW(),FW()]}),_r=()=>{const t=lt(),e=_s(),{routes:n}=jW(),r=h=>{t.setCurrentPath(h)},o=()=>t.currentPath,s=(h,p=!1)=>{p?window.history.replaceState({},"",h):window.history.pushState({},"",h),window.dispatchEvent(new HashChangeEvent("hashchange"))},i=h=>{s(h,!0)},a=h=>{const p=h.split("?")[1],g=new URLSearchParams(p),y=h.split("?")[0],w=y.split("/").filter(x=>x);return{path:y,params:g,uriSegments:w}},l=U(()=>a(o())),c=U(()=>o()),u=h=>{(h=="/"||h==""||h=="#/"||h=="#")&&(h="#/");let p=!1;return n.forEach(g=>{if(g.path==h)p=g;else if(g.path.includes(":")){const y=g.path.split(":")[0],w=h.split("/"),x=g.path.split("/");h.includes(y)&&w.length==x.length&&(p=g)}}),p},d=async h=>{const p=u(h.path);if(console.log("route object",p),e.resetContextualFilters(),p){const g=await p.callback(h);g!==void 0&&g.hasOwnProperty("redirectUrl")&&i(g.redirectUrl)}else i("#/404")},f=async h=>{const p=u(h.path);p&&p.hasOwnProperty("exitCallback")&&await p.exitCallback(h)};return{setCurrentPath:r,getCurrentPath:o,initRouter:async h=>{r(h),Ye(c,async(p,g)=>{const y=a(g),w=a(p);console.log("PATH CHANGED",y,w),await f(y),await d(w)}),window.addEventListener("hashchange",()=>{r(window.location.hash?window.location.hash:"/")}),await d(a(h))},goTo:s,redirect:i,currentRoute:l,currentPath:c}},Mu=()=>{const t=li();return{toggleNavigation:(e,n)=>{t.toggleNavigation(e,n)}}},zW={class:"fm-relative fm-inline-flex fm-items-center fm-justify-center fm-w-8 fm-h-8 fm-overflow-hidden fm-bg-gray-100 fm-rounded-full dark:fm-bg-gray-600"},VW={key:0,class:"fm-absolute fm-w-full fm-h-full fm-text-gray-400 fm--left-1",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},UW=m("path",{"fill-rule":"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z","clip-rule":"evenodd"},null,-1),qW=[UW],WW=["src"],KW={key:2,class:"fm-font-medium fm-text-gray-600 dark:fm-text-gray-300 fm-uppercase"},GW=Ne({__name:"FlowmateAvatar",props:{name:{type:String,default:""},avatar:{type:String,default:""}},setup(t){const e=t,n=U(()=>e.avatar),r=U(()=>e.name&&!e.avatar),o=U(()=>!(e.avatar||e.name)),s=U(()=>{var i,a;if(e.name){let l=new RegExp(/(\p{L}{1})\p{L}+/,"gu"),c=[...e.name.matchAll(l)];return((((i=c.shift())==null?void 0:i[1])||"")+(((a=c.pop())==null?void 0:a[1])||"")).toUpperCase()}return""});return(i,a)=>(k(),_("div",zW,[o.value?(k(),_("svg",VW,qW)):n.value?(k(),_("img",{key:1,class:"fm-w-full fm-h-full fm-rounded-full",src:t.avatar,alt:"Rounded avatar"},null,8,WW)):r.value?(k(),_("span",KW,ve(s.value),1)):L("",!0)]))}}),JW={class:"fm-fixed fm-z-50 fm-top-10 fm-right-2 fm-w-48 fm-my-4 fm-text-base fm-list-none fm-bg-white fm-divide-y fm-divide-gray-100 fm-rounded fm-shadow dark:fm-bg-gray-700 dark:fm-divide-gray-600",id:"dropdown-user"},YW={class:"fm-px-4 fm-py-3",role:"none"},XW={class:"fm-text-sm fm-text-gray-900 dark:fm-text-white fm-font-bold",role:"none"},ZW={class:"fm-py-1",role:"none"},QW=Ne({__name:"FlowmateUserMenu",props:{name:{type:String,default:""}},setup(t){const e=t,{signOut:n}=Qt(),r=()=>{n()};return(o,s)=>(k(),_("div",JW,[m("div",YW,[m("p",XW,ve(e.name),1)]),m("ul",ZW,[m("li",null,[m("a",{onClick:s[0]||(s[0]=nt(i=>r(),["stop","prevent"])),href:"#",class:"fm-block fm-px-4 fm-py-2 fm-text-sm fm-text-gray-700 hover:fm-bg-gray-100 dark:fm-text-gray-300 dark:hover:fm-bg-gray-600 dark:hover:fm-text-white",role:"menuitem"},"Sign out")])])]))}}),eK={key:0,id:"defaultModal",tabindex:"-1","aria-hidden":"true",class:"fm-fixed fm-flex fm-items-center fm-justify-center fm-top-0 fm-left-0 fm-right-0 fm-z-50 fm-w-full fm-p-4 fm-overflow-x-hidden fm-overflow-y-auto md:fm-inset-0 fm-h-[calc(100%-1rem)] md:fm-h-full"},tK={class:"fm-relative fm-w-full fm-h-full fm-max-w-[80%] fm-max-h-[90%] md:fm-h-auto"},nK={class:"fm-relative fm-bg-white fm-rounded-lg fm-shadow dark:fm-bg-gray-700"},rK={key:0,class:"fm-flex fm-items-start fm-justify-between fm-p-4 fm-border-b fm-rounded-t dark:fm-border-gray-600"},oK=["innerHTML"],sK=m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),iK=m("span",{class:"fm-sr-only"},"Close modal",-1),aK=[sK,iK],lK={class:"fm-p-6 fm-space-y-4"},wf={__name:"FlowmateModal",props:["title","open","removeCloseButton"],setup(t){const e=t,n=pe(e.open),r=()=>{n.value=!n.value};return Ye(n,()=>{n.value?document.querySelector("body").style.overflow="hidden":document.querySelector("body").style.overflow="auto"}),(o,s)=>(k(),xe(xw,{to:"body"},[Z(qT,{name:"modal"},{default:qe(()=>
10[n.value?(k(),_("div",eK,[m("div",{class:"fm-bg-gray-900 fm-bg-opacity-50 dark:fm-bg-opacity-80 fm-fixed fm-inset-0",onClick:s[0]||(s[0]=i=>r())}),m("div",tK,[m("div",nK,[e.title&&!e.removeCloseButton?(k(),_("div",rK,[e.title?(k(),_("h3",{key:0,class:"fm-text-xl fm-font-semibold fm-text-gray-900 dark:fm-text-white",innerHTML:e.title},null,8,oK)):L("",!0),e.removeCloseButton?L("",!0):(k(),_("button",{key:1,type:"button",onClick:s[1]||(s[1]=i=>r()),class:"fm-text-gray-400 fm-bg-transparent hover:fm-bg-gray-200 hover:fm-text-gray-900 fm-rounded-lg fm-text-sm fm-p-1.5 fm-ml-auto fm-inline-flex fm-items-center dark:hover:fm-bg-gray-600 dark:hover:fm-text-white","data-modal-hide":"defaultModal"},aK))])):L("",!0),m("div",lK,[Ot(o.$slots,"default")])])])])):L("",!0)]),_:3})]))}},Rk=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},cK={},uK={"aria-hidden":"true",role:"status",class:"fm-w-5 fm-h-5 fm-animate-spin",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dK=m("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"#E5E7EB"},null,-1),fK=m("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentColor"},null,-1),hK=[dK,fK];function pK(t,e){return k(),_("svg",uK,hK)}const bc=Rk(cK,[["render",pK]]),mK={key:0,class:"fm-flex","aria-label":"Breadcrumb"},gK={class:"fm-inline-flex fm-items-center fm-space-x-1 md:fm-space-x-3"},yK={key:0,"aria-current":"page"},vK={class:"fm-flex fm-items-center"},bK={key:0,"aria-hidden":"true",class:"fm-w-6 fm-h-6 fm-text-gray-400",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},wK=m("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1),kK=[wK],xK={class:"fm-capitalize fm-ml-1 fm-text-sm fm-font-medium fm-text-gray-500 md:fm-ml-2 dark:fm-text-gray-400"},CK=Ne({__name:"FlowmateBreadcrumb",setup(t){const e=lt();return _r(),(n,r)=>b(e).pageContext&&b(e).pageContext.id?(k(),_("nav",mK,[m("ol",gK,[(k(!0),_(ce,null,Oe(b
10(e).getBreadcrumbs,(o,s)=>(k(),_(ce,null,[o.position!==1?(k(),_("li",yK,[m("div",vK,[s!==1?(k(),_("svg",bK,kK)):L("",!0),m("span",xK,ve(o.name),1)])])):L("",!0)],64))),256))])])):L("",!0)}}),_K={},SK={width:"392",height:"42",viewBox:"0 0 392 72",xmlns:"http://www.w3.org/2000/svg",class:"fm-self-center fm-text-xl fm-font-semibold sm:fm-text-2xl fm-whitespace-nowrap dark:fm-text-white fm-fill-black dark:fm-fill-white"},MK=ps('<path d="M10.3047 71V31.498H0.0996094V21H10.3047V14.0176C10.3047 5.47266 14.8457 0.980469 23.293 0.980469H56.7891V71H43.8008V11.8203H28.8105C24.2207 11.8203 23.293 12.748 23.293 17.2891V21H35.1094V31.498H23.293V71H10.3047Z"></path><path d="M60.3359 46C60.1406 31.1562 70.6387 19.8281 85.3359 20.0234C100.033 19.8281 110.531 31.1562 110.336 46C110.531 60.8438 100.033 72.1719 85.3359 71.9766C70.6387 72.1719 60.1406 60.8438 60.3359 46ZM84.9453 61.4785H85.7266C92.709 61.4785 97.25 55.7168 97.25 46C97.25 36.2832 92.709 30.5215 85.7266 30.5215H84.9453C77.9141 30.5215 73.4219 36.2832 73.4219 46C73.4219 55.7168 77.9141 61.4785 84.9453 61.4785Z"></path><path d="M170.67 21H183.268L168.961 71H154.361L145.523 36.0391L137.271 71H122.672L107.389 21H120.475L130.436 58.1094L138.59 21H152.457L161.197 57.8164L170.67 21Z"></path><path d="M184.764 71V21H197.752V28.0801C201.121 22.6602 206.688 20.0234 212.693 20.0234C219.773 20.0234 225.242 22.9531 227.977 28.6172C231.639 22.8066 237.791 20.0234 244.48 20.0234C250.633 20.0234 255.125 21.7812 257.957 25.3457C260.838 28.8613 262.254 33.5977 262.254 39.5059V71H249.266V41.0195C249.266 34.3789 246.873 31.0098 241.551 31.0098H240.77C234.764 31.0098 230.076 36.2344 230.076 43.2168V71H217.088V41.0195C217.088 34.3789 214.598 31.0098 209.275 31.0098H208.494C202.488 31.0098 197.752 36.2344 197.752 43.2168V71H184.764Z"></path><path d="M309.307 71H297.1C296.807 69.584 296.611 67.5332 296.514 64.8965C293.389 69.2422 288.115 71.9766 281.719 71.9766C272.734 72.0742 265.166 66.0684 265.312 57.2793C265.312 52.2012 267.021 48.2949 270.439 45.5605C273.857 42.8262 278.252 41.2637 283.623 40.8242L296.221 39.7012V38.4805C296.221 33.9883 292.998 30.5215 288.213 30.5215H287.383C282.695 30.5215 279.619 33.4512 279.326 36.4785H266.289C267.217 27.0547 275.615 19.9258 287.822 20.0234C300.42 20.0234 308.818 26.4688 308.818 37.9922V60.0137C308.818 64.9941 308.965 68.6562 309.307 71ZM296.221 50.5898V49.1738L285.381 50.2969C283.477 50.4434 281.768 51.0293 280.303 52.0547C278.838 53.0801 278.105 54.4961 278.105 56.4004C278.105 59.4766 280.742 61.4785 284.307 61.4785H285.088C290.996 61.4785 296.221 56.8887 296.221 50.5898Z"></path><path d="M319.738 58.0117V31.498H309.436V21H319.738V4.78906H332.727V21H343.908V31.498H332.727V54.4961C332.727 59.0859 333.654 60.0137 338.244 60.0137H345.422V71H332.727C324.279 71 319.738 66.459 319.738 58.0117Z"></path><path d="M344.867 46C344.721 31.0586 353.998 19.8281 368.646 20.0234C383.246 19.877 391.596 30.8145 391.449 45.4141C391.449 46.3906 391.4 47.9531 391.254 50.1016H357.465C357.953 56.791 363.324 61.4785 368.744 61.4785H369.574C374.262 61.4785 377.436 58.8418 378.363 55.1797H391.254C388.812 65.1406 380.902 71.9766 368.646 71.9766C356.098 72.1719 344.623 61.9668 344.867 46ZM357.465 40.0918H378.852C378.559 34.1836 374.018 30.5215 368.549 30.5215H367.768C362.299 30.5215 357.758 34.1836 357.465 40.0918Z"></path>',7),TK=[MK];function EK(t,e){return k(),_("svg",SK,TK)}const $k=Rk(_K,[["render",EK]]),AK=m("div",{class:"fm-tooltip-arrow","data-
10popper-arrow":""},null,-1),ko={__name:"FlowmateTooltip",props:{text:{type:String,required:!0},show:{type:Boolean,required:!0}},setup(t){const e=zr();return(n,r)=>(k(),_("div",{role:"tooltip",class:H(["-fm-bottom-10 fm-left-1/2 fm-transform fm--translate-x-1/2 fm-absolute fm-z-10 fm-px-3 fm-py-2 fm-text-sm fm-font-medium fm-border fm-border-gray-200 fm-rounded-lg fm-shadow-sm fm-w-max",t.show?"fm-visible":"fm-invisible",b(e).getDarkMode?"fm-bg-white fm-text-gray-900":"fm-bg-gray-900 fm-text-white"])},[Le(ve(t.text)+" ",1),AK],2))}};function xo(){const t=pe(!1);return{show:t,showTooltip:()=>{t.value=!0},hideTooltip:()=>{t.value=!1}}}const OK={class:"fm-fixed fm-top-0 f-h-[60px] fm-z-50 fm-w-full fm-bg-white fm-border-b fm-border-gray-200 dark:fm-bg-gray-800 dark:fm-border-gray-700"},IK={class:"fm-px-3 fm-py-3 lg:fm-px-5 lg:fm-pl-3"},NK={class:"fm-flex fm-items-center fm-justify-between"},LK={class:"fm-flex fm-items-center fm-justify-start"},RK=m("button",{"data-drawer-target":"logo-sidebar","data-drawer-toggle":"logo-sidebar","aria-controls":"logo-sidebar",type:"button",class:"fm-inline-flex fm-items-center fm-p-2 fm-text-sm fm-text-gray-500 fm-rounded-lg md:fm-hidden hover:fm-bg-gray-100 focus:fm-outline-none focus:fm-ring-2 focus:fm-ring-gray-200 dark:fm-text-gray-400 dark:hover:fm-bg-gray-700 dark:focus:fm-ring-gray-600"},[m("span",{class:"fm-sr-only"},"Open sidebar"),m("svg",{class:"fm-w-6 fm-h-6","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"clip-rule":"evenodd","fill-rule":"evenodd",d:"M2 4.75A.75.75 0 012.75 4h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 4.75zm0 10.5a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5a.75.75 0 01-.75-.75zM2 10a.75.75 0 01.75-.75h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 10z"})])],-1),$K={class:"fm-flex fm-pl-2 fm-pr-32 fm-w-64"},DK={class:"fm-flex fm-items-center"},PK={key:0,class:"fm-flex fm-items-center fm-gap-2 fm-mr-4"},HK={key:0,class:"fm-inline-flex fm-items-center fm-bg-green-100 fm-text-green-800 fm-text-xs fm-font-medium fm-px-2.5 fm-py-0.5 fm-rounded-full dark:fm-bg-green-900 dark:fm-text-green-300"},BK=m("span",{class:"fm-w-2 fm-h-2 fm-mr-1 fm-bg-green-500 fm-rounded-full"},null,-1),FK={key:1,class:"fm-inline-flex fm-items-center fm-bg-blue-100 fm-text-blue-800 fm-text-xs fm-font-medium fm-px-2.5 fm-py-0.5 fm-rounded-full dark:fm-bg-blue-900 dark:fm-text-blue-300"},jK=m("span",{class:"fm-w-2 fm-h-2 fm-mr-1 fm-bg-blue-500 fm-rounded-full"},null,-1),zK=m("p",{class:"fm-text-base dark:fm-text-white"},"Collaboration allows you to work together with your team or clients to create your new page or post quickly and efficiently, and then make any last-minute adjustments before publishing your work.",-1),VK=m("p",{class:"fm-text-base dark:fm-text-white"},"A collaboration is a temporary real-time work space, between you and one or more collaborators. Once you choose to end the session, chat history and other data is cleared from the system.",-1),UK={key:0},qK=m("p",{class:"fm-mb-2 dark:fm-text-white"},[m("strong",null,"Share the link, to collaborate in real time")],-1),WK={class:"fm-relative"},KK=m("div",{class:"fm-absolute fm-inset-y-0 fm-left-0 fm-flex fm-items-center fm-pl-3 fm-pointer-events-none"},[m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5 fm-text-gray-500 dark:fm-text-gray-400"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})])],-1),GK=["value"],JK={key:1,fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},YK=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1),XK=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"},null,-1),ZK=[YK,XK],QK={key:2,fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},eG=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1),tG=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9.563C9 9.252 9.252 9 9.563 9h4.874c.311 0 .563.252.563.563v4.874c0 .311-.252.563-.563.563H9.564A.562.562 0 019 14.437V9.564z"},null,-1),nG=[eG,tG],rG={key:1,class:"fm-flex fm-gap-2"},oG=["title"],sG=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"},null,-1),iG=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),aG=[sG,iG],lG=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125"},null,-1),cG=[lG],uG=m("span",{class:"fm-sr-only"},"Toggle edit mode",-1),dG=m("path",{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"},null,-1),fG=[dG],hG=m("path",{d:"M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z","fill-rule":"evenodd","clip-rule":"evenodd"},null,-1),pG=[hG],mG=m("span",{class:"fm-sr-only"},"Toggle dark/light mode",-1),gG=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-4 fm-h-4"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.217 10.9
1007a2.25 2.25 0 100 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186l9.566-5.314m-9.566 7.5l9.566 5.314m0 0a2.25 2.25 0 103.935 2.186 2.25 2.25 0 00-3.935-2.186zm0-12.814a2.25 2.25 0 103.933-2.185 2.25 2.25 0 00-3.933 2.185z"})],-1),yG=m("span",{class:"fm-sr-only"},"Share page",-1),vG=m("p",{class:"dark:fm-text-white"},`First, you'll need to choose if the link needs to be password protected or not. If yes, create a password for the link. Once you've done that, simply click on the "Generate link" button below. This will create a special link that you can share with others who you want to give access to the page. If you created a password, the password you picked won't be visible anymore, once the link has been generated.`,-1),bG={key:0},wG={class:"fm-relative"},kG=m("div",{class:"fm-absolute fm-inset-y-0 fm-left-0 fm-flex fm-items-center fm-pl-3 fm-pointer-events-none"},[m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5 fm-text-gray-500 dark:fm-text-gray-400"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})])],-1),xG=["value"],CG={key:0},_G={class:"fm-w-full fm-flex fm-gap-2 fm-mb-4"},SG=m("label",{for:"add-password-protection"},"Add password protection",-1),MG={key:0},TG=m("label",{for:"password",class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"Password",-1),EG={class:"fm-relative"},AG=m("div",{class:"fm-absolute fm-inset-y-0 fm-left-0 fm-flex fm-items-center fm-pl-3 fm-pointer-events-none"},[m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5 fm-text-gray-500 dark:fm-text-gray-400"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"})])],-1),OG={key:1,fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},IG=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1),NG=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"},null,-1),LG=[IG,NG],RG=m("span",null,"Generate link",-1),$G={key:1,fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},DG=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1),PG=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9.563C9 9.252 9.252 9 9.563 9h4.874c.311 0 .563.252.563.563v4.874c0 .311-.252.563-.563.563H9.564A.562.562 0 019 14.437V9.564z"},null,-1),HG=[DG,PG],BG=m("span",null,"Terminate link",-1),FG={key:2,class:"fm-text-xs"},jG={class:"fm-flex fm-items-center fm-ml-3 fm-relative"},zG=["onClick"],VG=m("span",{class:"fm-sr-only"},"Open user menu",-1),UG=Ne({__name:"FlowmateNavBar",setup(t){const e=vu(),{getCurrentRevision:n}=$r();Qt();const{isCollaborateMode:r,collaborationID:o,stopCollaboration:s,startCollaboration:i,startCollaborationFromContext:a,collaborationGuests:l}=$l(),{startShare:c,stopShare:u,shareId:d}=$8(),f=lt();li(),Mu();const h=zr(),{getUsername:p,getAvatar:g,isUserLoggedIn:y}=Qt(),{writeMessage:w}=ro();_r();const x=pe(!1),C=pe(!1),v=pe(""),S=pe(!1),E=U(()=>S),M=pe(!1),T=U(()=>M),A=()=>{x.value=!x.value},N=Re=>{n6(Re).then(()=>{w("Link was copied to your clipboard.",null,"success")})},D=pe(!1),$=async()=>{if(C.value=!0,parseInt(d.value)!==0)await u();else{if(D.value&&!v.value){w("Please enter a password.",null,"error"),C.value=!1;return}await c(v.value)}C.value=!1},W=async()=>{C.value=!0;const{context:Re}
10=Hr();let F=n();r.value?await s(F):F?await i(F):await a(Re.value),C.value=!1},{show:me,showTooltip:V,hideTooltip:B}=xo(),{show:Y,showTooltip:j,hideTooltip:P}=xo(),{show:Q,showTooltip:J,hideTooltip:ke}=xo(),{show:Se,showTooltip:ee,hideTooltip:se}=xo();return(Re,F)=>(k(),_("nav",OK,[m("div",IK,[m("div",NK,[m("div",LK,[RK,m("button",$K,[Z($k)]),Z(CK)]),m("div",DK,[b(He)("collaborate").isEnabled()?(k(),_("div",PK,[b(He)("ui.navbar.collaborateToggle").isEnabled()?(k(),_("div",{key:0,onClick:F[0]||(F[0]=q=>S.value=!S.value),class:"fm-cursor-pointer fm-relative",onMouseenter:F[1]||(F[1]=(...q)=>b(V)&&b(V)(...q)),onMouseleave:F[2]||(F[2]=(...q)=>b(B)&&b(B)(...q))},[Z(ko,{text:"Collaboration",show:b(me)},null,8,["show"]),b(r)?(k(),_("span",HK,[BK,Le(" Collaboration #"+ve(b(o)),1)])):(k(),_("span",FK,[jK,Le(" Collaboration ")]))],32)):L("",!0),Z(wf,{title:"Collaboration",open:E.value},{default:qe(()=>[zK,VK,b(r)&&b(o)?(k(),_("div",UK,[qK,m("div",WK,[KK,m("input",{type:"text",disabled:"",value:b(f).getOptions.frontend+"/#/collaborate/"+b(o),class:"fm-block fm-cursor-text fm-w-full fm-p-4 fm-pl-10 fm-text-sm fm-text-gray-500 fm-border fm-border-gray-300 fm-rounded-lg fm-bg-gray-50 focus:fm-ring-blue-500 focus:fm-border-blue-500 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},null,8,GK),m("button",{onClick:F[3]||(F[3]=q=>N(b(f).getOptions.frontend+"/#/collaborate/"+b(o))),class:"fm-text-white fm-absolute fm-right-2.5 fm-bottom-2.5 fm-bg-blue-700 hover:fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-px-4 fm-py-2 dark:fm-bg-blue-600 dark:hover:fm-bg-blue-700 dark:focus:fm-ring-blue-800"},"Copy link")])])):L("",!0),b(He)("collaborate.create").isEnabled()?(k(),_("button",{key:1,type:"button",onClick:F[4]||(F[4]=q=>W()),class:H([[b(r)?"!fm-bg-red-700 hover:!fm-bg-red-800":"!fm-bg-blue-700 hover:!fm-bg-blue-800",C.value?b(f).getLoadingClass:""],"fm-text-white focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"])},[C.value?(k(),xe(bc,{key:0})):L("",!0),!b(r)&&!C.value?(k(),_("svg",JK,ZK)):L("",!0),b(r)&&!C.value?(k(),_("svg",QK,nG)):L("",!0),m("span",null,ve(b(r)?"Stop":"Start")+" Collaboration",1)],2)):L("",!0)]),_:1}
10,8,["open"]),b(l)?(k(),_("div",rG,[(k(!0),_(ce,null,Oe(b(l),q=>(k(),_("div",{class:H(["fm-relative fm-inline-flex fm-items-center fm-justify-center fm-w-8 fm-h-8 fm-overflow-hidden fm-bg-gray-100 fm-rounded-full dark:fm-bg-gray-600 fm-border-4 fm-duration-500",[b(e).getGuestColor(q).border,q.idle?"fm-opacity-30":""]])},[m("span",{class:"fm-cursor-default fm-font-medium fm-text-gray-600 dark:fm-text-gray-300 fm-uppercase fm-text-sm",title:q.idle?q.name+" (idle)":q.name},ve(b(e).getGuestInitials(q)),9,oG)],2))),256))])):L("",!0)])):L("",!0),b(He)("ui.navbar.editToggle").isEnabled()&&b(He)("design").isEnabled()?(k(),_("button",{key:1,onClick:F[5]||(F[5]=q=>b(h).setEditMode(!b(h).getEditMode)),"data-tooltip-target":"default-mega-menu-example-toggle-dark-mode-tooltip",type:"button",class:"fm-flex fm-items-center fm-p-2 fm-mr-2 fm-text-xs fm-font-medium fm-text-gray-700 fm-bg-white fm-border fm-border-gray-200 fm-rounded-lg toggle-dark-state-example hover:fm-bg-gray-100 hover:fm-text-blue-700 focus:fm-z-10 focus:fm-ring-2 focus:fm-ring-gray-300 dark:focus:fm-ring-gray-500 dark:fm-bg-gray-800 focus:fm-outline-none dark:fm-text-gray-400 dark:fm-border-gray-600 dark:hover:fm-text-white dark:hover:fm-bg-gray-700 fm-relative",onMouseenter:F[6]||(F[6]=(...q)=>b(J)&&b(J)(...q)),onMouseleave:F[7]||(F[7]=(...q)=>b(ke)&&b(ke)(...q))},[Z(ko,{text:b(h).getEditMode?"Preview":"Edit",show:b(Q)},null,8,["text","show"]),(k(),_("svg",{"aria-hidden":"true",class:H([{"fm-hidden":!b(h).getEditMode},"fm-w-4 fm-h-4"]),fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},aG,2)),(k(),_("svg",{"aria-hidden":"true",class:H([{"fm-hidden":b(h).getEditMode},"fm-w-4 fm-h-4"]),fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},cG,2)),uG],32)):L("",!0),m("button",{onClick:F[8]||(F[8]=q=>b(h).setDarkMode(!b(h).getDarkMode)),"data-tooltip-target":"default-mega-menu-example-toggle-dark-mode-tooltip",type:"button",class:"fm-flex fm-items-center fm-p-2 fm-mr-2 fm-text-xs fm-font-medium fm-text-gray-700 fm-bg-white fm-border fm-border-gray-200 fm-rounded-lg toggle-dark-state-example hover:fm-bg-gray-100 hover:fm-text-blue-700 focus:fm-z-10 focus:fm-ring-2 focus:fm-ring-gray-300 dark:focus:fm-ring-gray-500 dark:fm-bg-gray-800 focus:fm-outline-none dark:fm-text-gray-400 dark:fm-border-gray-600 dark:hover:fm-text-white dark:hover:fm-bg-gray-700 fm-relative",onMouseenter:F[9]||(F[9]=(...q)=>b(j)&&b(j)(...q)),onMouseleave:F[10]||(F[10]=(...q)=>b(P)&&b(P)(...q))},[Z(ko,{text:b(h).getDarkMode?"Light Mode":"Dark Mode",show:b(Y)},null,8,["text","show"]),(k(),_("svg",{"aria-hidden":"true","data-toggle-icon":"moon",class:H([{"fm-hidden":b(h).getDarkMode},"fm-w-4 fm-h-4"]),fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},fG,2)),(k(),_("svg",{"aria-hidden":"true","data-toggle-icon":"sun",class:H([{"fm-hidden":!b(h).getDarkMode},"fm-w-4 fm-h-4"]),fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},pG,2)),mG],32),b(He)("design.share").isEnabled()?(k(),_("button",{key:2,onClick:F[11]||(F[11]=q=>M.value=!M.value),"data-tooltip-target":"default-mega-menu-example-toggle-dark-mode-tooltip",type:"button",class:"fm-flex fm-items-center fm-p-2 fm-mr-2 fm-text-xs fm-font-medium fm-text-gray-700 fm-bg-white fm-border fm-border-gray-200 fm-rounded-lg toggle-dark-state-example hover:fm-bg-gray-100 hover:fm-text-blue-700 focus:fm-z-10 focus:fm-ring-2 focus:fm-ring-gray-300 dark:focus:fm-ring-gray-500 dark:fm-bg-gray-800 focus:fm-outline-none dark:fm-text-gray-400 dark:fm-border-gray-600 dark:hover:fm-text-white dark:hover:fm-bg-gray-700 fm-relative",onMouseenter:F[12]||(F[12]=(...q)=>b(ee)&&b(ee)(...q)),onMouseleave:F[13]||(F[13]=(...q)=>b(se)&&b(se)(...q))},[Z(ko,{text:"Share",show:b(Se)},null,8,["show"]),gG,yG],32)):L("",!0),b(He)("design.share").isEnabled()?(k(),xe(wf,{key:3,title:"Share page",open:T.value},{default:qe(()=>[vG,parseInt(b(d))!==0?(k(),_("div",bG,[m("div",wG,[kG,m("input",{type:"text",disabled:"",value:b(f).getOptions.frontend+"/#/share/"+b(d),class:"fm-block fm-cursor-text fm-w-full fm-p-4 fm-pl-10 fm-text-sm fm-text-gray-500 fm-border fm-border-gray-300 fm-rounded-lg fm-bg-gray-50 focus:fm-ring-blue-500 focus:fm-border-blue-500 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},null,8,xG),m("button",{onClick:F[14]||(F[14]=nt(q=>N(b(f).getOptions.frontend+"/#/share/"+b(d)),["prevent"])),class:"fm-text-white fm-absolute fm-right-2.5 fm-bottom-2.5 fm-bg-blue-700 hover:fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-px-4 fm-py-2 dark:fm-bg-blue-600 dar
10k:hover:fm-bg-blue-700 dark:focus:fm-ring-blue-800"},"Copy link")])])):L("",!0),m("form",null,[parseInt(b(d))===0?(k(),_("div",CG,[m("div",_G,[Ie(m("input",{type:"checkbox",id:"add-password-protection",name:"add-password-protection","onUpdate:modelValue":F[15]||(F[15]=q=>D.value=q)},null,512),[[yl,D.value]]),SG]),D.value?(k(),_("div",MG,[TG,m("div",EG,[AG,Ie(m("input",{type:"text",id:"password",maxlength:"30",placeholder:"Password","onUpdate:modelValue":F[16]||(F[16]=q=>v.value=q),class:"fm-block fm-cursor-text fm-w-full fm-p-4 fm-pl-10 fm-text-sm fm-text-gray-500 fm-border fm-border-gray-300 fm-rounded-lg fm-bg-gray-50 focus:fm-ring-blue-500 focus:fm-border-blue-500 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},null,512),[[cn,v.value]])])])):L("",!0),m("button",{type:"submit",onClick:F[17]||(F[17]=nt(q=>$(),["prevent"])),class:H([[C.value?b(f).getLoadingClass:""],"!fm-bg-blue-700 hover:!fm-bg-blue-800 fm-text-white fm-mt-4 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"])},[C.value?(k(),xe(bc,{key:0})):L("",!0),C.value?L("",!0):(k(),_("svg",OG,LG)),RG],2)])):L("",!0)]),parseInt(b(d))!==0?(k(),_("button",{key:1,type:"submit",onClick:F[18]||(F[18]=nt(q=>$(),["prevent"])),class:H([[C.value?b(f).getLoadingClass:""],"!fm-bg-red-700 hover:!fm-bg-red-800 fm-text-white fm-mt-4 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"])},[C.value?(k(),xe(bc,{key:0})):L("",!0),C.value?L("",!0):(k(),_("svg",$G,HG)),BG],2)):L("",!0),parseInt(b(d))!==0?(k(),_("p",FG,"To change the password, please regenerate the link, by terminating it, and generating it, with a different password.")):L("",!0)]),_:1},8,["open"])):L("",!0),m("div",jG,[m("button",{onClick:nt(A,["stop"]),type:"button",class:"fm-flex fm-text-sm fm-rounded-full focus:fm-ring-4 focus:fm-ring-gray-300 dark:focus:fm-ring-gray-600","aria-expanded":"false","data-dropdown-toggle":"dropdown-user"},[VG,Z(GW,{name:b(p)(),avatar:b(g)()},null,8,["name","avatar"])],8,zG),x.value&&b(y)?(k(),xe(QW,{key:0,name:b(p)()},null,8,["name"])):L("",!0)])])])])]))}}),Dk=dr("mediastore",{state:()=>({mediaPopupOpen:!1,activeBlockIndex:null,activeBlockContext:{},activeMediaType:null,activeFieldName:null,activeFieldType:null,selectedImageID:null,selectedImage:null,selectedImages:[],selectedImageIDs:[]}),getters:{getActiveBlockContext(t){return t.activeBlockContext},getActiveBlockIndex(t){return t.activeBlockIndex},getActiveFieldName(t){return t.activeFieldName},getActiveFieldType(t){return t.activeFieldType},getAcceptedMediaTypes(t){return t.activeMediaType},getMediaPopupOpen(t){return t.mediaPopupOpen},getSelectedImage(t){return t.selectedImage},getSelectedImageID(t){return t.selectedImageID},getSelectedImages(t){return t.selectedImages},getSelectedImageIDs(t){return t.selectedImageIDs}},actions:{toggleMediaPopup(){this.mediaPopupOpen=!this.mediaPopupOpen},setContext(t,e,n,r,o){this.activeBlockContext=t,this.activeBlockIndex=e,this.activeFieldName=n,this.activeMediaType=r,this.activeFieldType=o},clearContext(){this.activeBlockIndex=null,this.activeFieldName=null,this.activeMediaType=null,this.activeFieldType=null},setSelectedImage(t){this.selectedImage=t},setSelectedImageID(t){this.selectedImageID=t},setSelectedImages(t){this.selectedImages=t},setSelectedImageIDs(t){this.selectedImageIDs=t},moveImage(t,e){let n=this.selectedImages,r=1;const o=n.splice(t,r)[0];r=0,n.splice(e,r,o),this.setSelectedImages(n),this.setSelectedImageIDs(n.map(s=>s.id))}}}),ih=()=>{const t=lt(),e=Dk(),n=(l,c,u,d=null,f=null)=>{if(e.setContext(l,c,u,d,f),f=="gallery"){let h=t.pageContext.acf.content[c][u];h&&h.length>0&&(e.setSelectedImages(h),e.setSelectedImageIDs(h.map(p=>p.id)))}e.toggleMediaPopup()},r=async l=>{const{writeMessage:c}=ro(),u=lt(),d=l.target.files[0];if(d){console.log("FILE",d);const f=u.options.backend+"/wp-json/flowmate/v1/upload-files";let h=new FormData;h.append("file",d);let p=await fetch(f,{method:"POST",body:h}).then(g=>g.json());return console.log("RESPONSE",p),p&&p.length>
100?(p.forEach(g=>{c(g.file.name+" uploaded successfully",null,"success")}),p):(p.data&&p.data.status&&p.data.status>299&&c(p.message,p.data.status,"error",!0),p)}else return"No file"},o=(l,c)=>c.findIndex(u=>u.id===l.id),s=()=>{e.setSelectedImages([]),e.setSelectedImageIDs([]),a(!1)},i=l=>{if(l==null)e.getActiveFieldType==="gallery"||(e.setSelectedImage(null),e.setSelectedImageID(null));else if(e.getActiveFieldType==="gallery"){let c=e.getSelectedImages,u=o(l,c);u>-1?c.splice(u,1):c.push(l),e.setSelectedImageIDs(c.map(d=>d.id))}else{let c=e.getSelectedImage;c&&c.id==l.id?(e.setSelectedImage(null),e.setSelectedImageID(null)):(e.setSelectedImage(l),e.setSelectedImageID(l.id))}},a=(l=!0)=>{let c=e.getActiveBlockIndex,u=e.getActiveFieldName,d=e.getActiveBlockContext;if(e.getActiveFieldType==="gallery"){let f=e.getSelectedImages,h=e.getSelectedImageIDs;if(console.log("SAVE IMAGE",h),f&&h){if(c!=null&&u!=null){console.log("FOR FIELD",c);let p=[];f.forEach(g=>{let y=h.findIndex(w=>w===g.id);g.ID=y,p.push(g)}),console.log("GALLERY CONTEXT UPDATE",d),d[u]=p,l&&e.toggleMediaPopup(),console.log("New val",t.pageContext.acf.content[c])}else if(u!==null){t.pageContext[u]=h;let p=[];f.forEach(g=>{let y=g.media_details&&g.media_details.sizes.full?g.media_details.sizes.full.source_url:g.source_url;p.push(y)}),t.pageContext["preview_images_"+u]=p,l&&e.toggleMediaPopup()}}}else{let f=e.getSelectedImage,h=e.getSelectedImageID;console.log("SAVE IMAGE",h),f&&h&&(c!=null&&u!=null?(console.log("FOR FIELD",c),console.log(e.getActiveFieldType),console.log("NOT GALLERY CONTEXT",d),f.ID=h,d[u]=f,l&&e.toggleMediaPopup(),console.log("New val",t.pageContext.acf.content[c])):(console.log("Not gallery and no block index"),u!==null&&(t.pageContext[u]=h,t.pageContext["preview_image_"+u]=f.media_details&&f.media_details.sizes.full?f.media_details.sizes.full.source_url:f.source_url,l&&e.toggleMediaPopup())))}};return{uploadImage:r,initMediaLibrary:n,selectImage:i,saveSelectedImage:a,clearSelectedImages:s}};async function qG(t,e,n){const r=lt(),o=pe(null),s=pe(null);let i=0,a=r.options.backend+"/wp-json/wp/v2/media?page="+t+"&per_page="+e;return n&&(a+="&search="+n),await fetch(a).then(l=>(i=l.headers.get("x-wp-totalpages")?l.headers.get("x-wp-totalpages"):1,l.json())).then(l=>o.value=l).catch(l=>s.value=l),{media:o,total:i,error:s}}const WG={},KG={"aria-hidden":"true",class:"fm-w-14 fm-h-14 fm-text-gray-200 fm-animate-spin dark:fm-text-gray-600 fm-fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},GG=m("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),JG=m("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1),YG=[GG,JG];function XG(t,e){return k(),_("svg",KG,YG)}const Gg=Rk(WG,[["render",XG]]),ZG={class:"fm-relative fm-left-1/2 fm-top-1/2 -fm-translate-x-1/2 -fm-translate-y-1/2 fm-w-full fm-h-full fm-max-w-[90%] fm-max-h-[90%] md:fm-h-auto fm-z-10"},QG={class:"fm-relative fm-bg-white fm-rounded-lg fm-shadow dark:fm-bg-gray-700 fm-w-full fm-h-full"},eJ={class:"fm-flex fm-items-start fm-justify-between fm-p-4 fm-border-b fm-rounded-t dark:fm-border-gray-600"},tJ=m("h3",{class:"fm-text-xl fm-font-semibold fm-text-gray-900 dark:fm-text-white"}," Media library ",-1),nJ=m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),rJ=m("span",{class:"fm-sr-only"},"Close modal",-1),oJ=[nJ,rJ],sJ={class:"fm-flex fm-justify-between fm-border-b fm-border-gray-200 dark:fm-border-gray-700 dark:fm-text-gray-400 fm-px-4"}
10,iJ={class:"fm-py-2 fm-self-center"},aJ={for:"dropzone-file",class:"fm-text-white fm-cursor-pointer !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},lJ=m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5 fm-text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})],-1),cJ=m("span",null,"Upload file",-1),uJ={class:"fm-py-2"},dJ=m("label",{for:"default-search",class:"fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 fm-sr-only dark:fm-text-white"},"Search",-1),fJ={class:"fm-relative"},hJ=m("div",{class:"fm-absolute fm-inset-y-0 fm-left-0 fm-flex fm-items-center fm-pl-3 fm-pointer-events-none"},[m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5 fm-text-gray-500 dark:fm-text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})])],-1),pJ=m("button",{type:"submit",class:"fm-text-white fm-absolute fm-right-[8px] fm-bottom-[8px] fm-bg-blue-700 hover:fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-px-4 fm-py-2 dark:fm-bg-blue-600 dark:hover:fm-bg-blue-700 dark:focus:fm-ring-blue-800"}," Search ",-1),mJ=m("svg",{"aria-hidden":"true",class:"fm-w-3 fm-h-3",fill:"white",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),gJ=m("span",{class:"fm-sr-only"},"Close modal",-1),yJ=[mJ,gJ],vJ={class:"fm-p-6 fm-space-y-6 fm-max-h-[65vh] fm-overflow-auto"},bJ={class:"relative"},wJ={key:0,class:"fm-absolute fm-top-1/2 fm-left-1/2 -fm-translate-x-1/2 -fm-translate-y-1/2"},kJ={class:"fm-flex fm-gap-4"},xJ={key:0,class:"fm-grid fm-grid-cols-12 fm-gap-4 fm-duration-200"},CJ={key:0,class:"fm-col-span-12"},_J={key:0},SJ={class:"fm-font-bold"},MJ=["onClick"],TJ={key:0,class:"fm-absolute fm-group fm-duration-100 fm-rounded-full fm-bg-blue-700 fm-text-white fm-z-50 fm-top-0 fm-right-0 fm-translate-y-1/2 -fm-translate-x-1/2 fm-w-8 fm-h-8 fm-p-1 fm-text-center fm-pointer-events-none"},EJ={key:0,class:"fm-absolute fm-top-0 fm-left-0 fm-h-full fm-w-full fm-object-contain fm-duration-100 fm-rounded-lg"},AJ=["src"],OJ={key:1,class:"fm-absolute fm-w-full fm-h-full fm-top-0 fm-left-0 fm-flex fm-items-center fm-justify-center"},IJ=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-z-10 fm-stroke-white fm-w-10 fm-h-10"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 01-1.125-1.125M3.375 19.5h1.5C5.496 19.5 6 18.996 6 18.375m-3.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-1.5A1.125 1.125 0 0118 18.375M20.625 4.5H3.375m17.25 0c.621 0 1.125.504 1.125 1.125M20.625 4.5h-1.5C18.504 4.5 18 5.004 18 5.625m3.75 0v1.5c0 .621-.504 1.125-1.125 1.125M3.375 4.5c-.621 0-1.125.504-1.125 1.125M3.375 4.5h1.5C5.496 4.5 6 5.004 6 5.625m-3.75 0v1.5c0 .621.504 1.125 1.125 1.125m0 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m1.5-3.75C5.496 8.25 6 7.746 6 7.125v-1.5M4.875 8.25C5.496 8.25 6 8.754 6 9.375v1.5m0-5.25v5.25m0-5.25C6 5.004 6.504 4.5 7.125 4.5h9.75c.621 0 1.125.504 1.125 1.125m1.125 2.625h1.5m-1.5 0A1.125 1.125 0 0118 7.125v-1.5m1.125 2.625c-.621 0-1.125.504-1.125 1.125v1.5m2.625-2.625c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125M18 5.625v5.25M7.125 12h9.75m-9.75 0A1.125 1.125 0 016 10.875M7.125 12C6.504 12 6 12.504 6 13.125m0-2.25C6 11.496 5.496 12 4.875 12M18 10.875c0 .621-.504 1.125-1.125 1.125M18 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m-12 5.25v-5.25m0 5.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125m-12 0v-1.5c0-.621-.504-1.125-1.125-1.125M18 18.375v
10-5.25m0 5.25v-1.5c0-.621.504-1.125 1.125-1.125M18 13.125v1.5c0 .621.504 1.125 1.125 1.125M18 13.125c0-.621.504-1.125 1.125-1.125M6 13.125v1.5c0 .621-.504 1.125-1.125 1.125M6 13.125C6 12.504 5.496 12 4.875 12m-1.5 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M19.125 12h1.5m0 0c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h1.5m14.25 0h1.5"})],-1),NJ=["src"],LJ={key:2},RJ=m("svg",{fill:"none",stroke:"black","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-stroke-black dark:fm-stroke-white fm-absolute fm-top-[45%] fm-left-1/2 -fm-translate-y-1/2 -fm-translate-x-1/2 fm-w-12 fm-h-auto"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})],-1),$J=["innerHTML"],DJ={key:0,class:"fm-grid fm-grid-cols-12 fm-gap-x-4 fm-gap-y-12"},PJ=["onClick"],HJ={key:0,class:"fm-absolute fm-group fm-duration-100 fm-rounded-full fm-bg-blue-700 fm-text-white fm-z-50 fm-top-full fm-left-1/2 -fm-translate-y-1/2 -fm-translate-x-1/2 fm-w-8 fm-h-8 fm-p-1 fm-text-center hover:fm-w-10 hover:fm-h-10 hover:fm-p-2"},BJ=["onClick"],FJ=["onClick"],jJ={key:0,class:"fm-absolute fm-top-0 fm-left-0 fm-h-full fm-w-full fm-object-contain fm-duration-100 fm-rounded-lg"},zJ=["src"],VJ={key:1,class:"fm-absolute fm-w-full fm-h-full fm-top-0 fm-left-0 fm-flex fm-items-center fm-justify-center"},UJ=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-z-10 fm-stroke-white fm-w-10 fm-h-10"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 01-1.125-1.125M3.375 19.5h1.5C5.496 19.5 6 18.996 6 18.375m-3.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-1.5A1.125 1.125 0 0118 18.375M20.625 4.5H3.375m17.25 0c.621 0 1.125.504 1.125 1.125M20.625 4.5h-1.5C18.504 4.5 18 5.004 18 5.625m3.75 0v1.5c0 .621-.504 1.125-1.125 1.125M3.375 4.5c-.621 0-1.125.504-1.125 1.125M3.375 4.5h1.5C5.496 4.5 6 5.004 6 5.625m-3.75 0v1.5c0 .621.504 1.125 1.125 1.125m0 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m1.5-3.75C5.496 8.25 6 7.746 6 7.125v-1.5M4.875 8.25C5.496 8.25 6 8.754 6 9.375v1.5m0-5.25v5.25m0-5.25C6 5.004 6.504 4.5 7.125 4.5h9.75c.621 0 1.125.504 1.125 1.125m1.125 2.625h1.5m-1.5 0A1.125 1.125 0 0118 7.125v-1.5m1.125 2.625c-.621 0-1.125.504-1.125 1.125v1.5m2.625-2.625c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125M18 5.625v5.25M7.125 12h9.75m-9.75 0A1.125 1.125 0 016 10.875M7.125 12C6.504 12 6 12.504 6 13.125m0-2.25C6 11.496 5.496 12 4.875 12M18 10.875c0 .621-.504 1.125-1.125 1.125M18 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m-12 5.25v-5.25m0 5.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125m-12 0v-1.5c0-.621-.504-1.125-1.125-1.125M18 18.375v-5.25m0 5.25v-1.5c0-.621.504-1.125 1.125-1.125M18 13.125v1.5c0 .621.504 1.125 1.125 1.125M18 13.125c0-.621.504-1.125 1.125-1.125M6 13.125v1.5c0 .621-.504 1.125-1.125 1.125M6 13.125C6 12.504 5.496 12 4.875 12m-1.5 0h1.5m-1.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M19.125 12h1.5m0 0c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h1.5m14.25 0h1.5"})],-1),qJ=["src"],WJ={key:2},KJ=m("svg",{fill:"none",stroke:"black","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-stroke-black dark:fm-stroke-white fm-absolute fm-top-[45%] fm-left-1/2 -fm-translate-y-1/2 -fm-translate-x-1/2 fm-w-12 fm-h-auto"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})],-1),GJ=["innerHTML"],JJ={key:1},YJ={key:0,class:"fm-pt-[80%] fm-relative fm-bg-gray-100 dark:fm-bg-gray-800 fm-border-2 fm-border-gray-100 dark:fm-border-gray-700 fm-rounded-lg fm-overflow-hidden"},XJ={key:0},ZJ={key:0,class:"fm-absolute fm-top-0 fm-left-0 fm-h-full fm-w-full fm-object-contain fm-duration-100 fm-rounded-lg"},QJ=["src"],eY={key:1,class:"fm-absolute fm-top-0 fm-left-0 fm-h-full fm-w-full fm-object-contain fm-duration-100"},tY=["src"],nY={key:2,class:"fm-absolute fm-top-0 fm-left-0 fm-h-full fm-w-full fm-object-contain fm-duration-100"},rY=m("svg",{fill:"none",stroke:"black","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-absolute fm-top-1/2 fm-left-1/2 -fm-translate-y-1/2 -fm-translate-x-1/2 fm-w-16 fm-h-auto fm-stroke-black dark:fm-stroke-white"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})],-1),oY=[rY],sY={key:1,class:"fm-flex fm-flex-col fm-gap-2 fm-p-2 fm-w-full fm-overflow-auto"},iY={class:"fm-text-xs fm-text-gray-800 dark:fm-text-white"},aY=m("strong",null,"File name ",-1),lY=m("br",null,null,-1),cY=["innerHTML"],uY={class:"fm-text-xs fm-text-gray-800 dark:fm-text-white"},dY=m("strong",null,"File type ",-1),fY=m("br",null,null,-1),hY=["innerHTML"],pY={class:"fm-text-xs fm-text-gray-800 dark:fm-text-white"}
10,mY=m("strong",null,"File size ",-1),gY=m("br",null,null,-1),yY=["innerHTML"],vY={key:0,class:"fm-text-xs fm-text-gray-800 dark:fm-text-white"},bY=m("strong",null,"Dimensions ",-1),wY=m("br",null,null,-1),kY=["innerHTML"],xY=["innerHTML"],CY={class:"fm-text-xs fm-text-gray-800 dark:fm-text-white"},_Y=m("strong",null,"Uploaded by ",-1),SY=m("br",null,null,-1),MY=["innerHTML"],TY={class:"fm-text-xs fm-text-gray-800 dark:fm-text-white"},EY=m("strong",null,"Upload date ",-1),AY=m("br",null,null,-1),OY=["innerHTML"],IY={class:"fm-text-xs fm-text-gray-800 dark:fm-text-white"},NY=m("strong",null,"File link ",-1),LY=m("br",null,null,-1),RY=["innerHTML"],$Y={class:"fm-flex fm-gap-4 fm-px-4 fm-py-2 fm-border-t dark:fm-border-gray-600"},DY={"aria-label":"Page navigation example ",class:"fm-flex-auto"},PY={key:0,class:"fm-inline-flex fm-items-center fm--space-x-px"},HY=m("button",{class:"fm-block fm-rounded-l-md fm-px-3 fm-py-2 fm-ml-0 fm-leading-tight fm-text-gray-500 fm-bg-white fm-border fm-border-gray-200 hover:fm-bg-gray-100 hover:fm-text-gray-700 dark:fm-bg-gray-800 dark:fm-border-gray-700 dark:fm-text-gray-400 dark:hover:fm-bg-gray-700 dark:hover:fm-text-white"},[m("span",{class:"fm-sr-only"},"Previous"),m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1),BY=[HY],FY={key:0,class:"fm-disabled fm-pointer-events-none"},jY=m("button",{class:"fm-w-[45px] fm-relative fm-px-3 fm-py-2 fm-leading-tight fm-border fm-duration-200 fm-text-gray-500 fm-bg-white hover:fm-bg-gray-100 hover:fm-text-gray-700 dark:fm-bg-gray-800 dark:fm-border-gray-700 dark:fm-text-gray-400 dark:hover:fm-bg-gray-700 dark:hover:fm-text-white"},"...",-1),zY=[jY],VY=["onClick"],UY={key:1,class:"fm-disabled fm-pointer-events-none"},qY=m("button",{class:"fm-w-[45px] fm-relative fm-px-3 fm-py-2 fm-leading-tight fm-border fm-duration-200 fm-text-gray-500 fm-bg-white hover:fm-bg-gray-100 hover:fm-text-gray-700 dark:fm-bg-gray-800 dark:fm-border-gray-700 dark:fm-text-gray-400 dark:hover:fm-bg-gray-700 dark:hover:fm-text-white"},"...",-1),WY=[qY],KY=["onClick"],GY=m("button",{class:"fm-block fm-rounded-r-md fm-px-3 fm-py-2 fm-leading-tight fm-text-gray-500 fm-bg-white fm-border fm-border-gray-200 hover:fm-bg-gray-100 hover:fm-text-gray-700 dark:fm-bg-gray-800 dark:fm-border-gray-700 dark:fm-text-gray-400 dark:hover:fm-bg-gray-700 dark:hover:fm-text-white"},[m("span",{class:"fm-sr-only"},"Next"),m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"})])],-1),JY=[GY],YY={key:0},XY=Ne({__name:"FlowmateMediaPopup",setup(t){const e=Dk();let n=pe([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),r=pe(1),o=pe(1),s=pe(!1),i=pe(""),a=pe(""),l=pe(!1);const{uploadImage:c,selectImage:u,saveSelectedImage:d,clearSelectedImages:f}=ih(),h=U(()=>{let S=[];return o.value>4&&o.value<r.value-2?(S.push(o.value-1),S.push(o.value),S.push(o.value+1),(o.value<4||o.value>=r.value-3)&&S.push(o.value+2)):o.value>4&&o.value>=r.value-2?(S.push(r.value-4),S.push(r.value-3),S.push(r.value-2),S.push(r.value-1),S.push(r.value)):(S.push(2),S.push(3),S.push(4),S.push(5)),S}),p=S=>{o.value=S,v(o.value)};function g(S){return e.getSelectedImageIDs.findIndex(E=>E==S)+1}async function y(S){s.value=!0,u(null),l.value=!0,await c(S),await v(1)}const w=S=>S.split("/").pop(),x=S=>e.getAcceptedMediaTypes==="any"?!0:e.getAcceptedMediaTypes&&e.getAcceptedMediaTypes.length>0?e.getAcceptedMediaTypes.some(E=>S.includes(E)):!1,C=S=>S.every(E=>x(E.mime_type)),v=async S=>{u(null),a=i.value,s.value=!0;const{media:E,total:M,error:T}=await qG(S,24,i.value);E&&(n.value=E.value,l.value&&(u(n.value[0]),l.value=!1)),M&&(r.value=parseInt(M),console.log(r.value)),o.value=S,s.value=!1};return Ye(()=>e.mediaPopupOpen,S=>{S&&(v(1),u(null))}),(S,E)=>(k(),_("div",{class:H(["fm-fixed fm-w-screen fm-h-screen fm-z-[999] fm-top-0 fm-left-0 fm-duration-300",b(e).getMediaPopupOpen?"fm-opacity-100 fm-pointer-events-all":"fm-opacity-0 fm-pointer-events-none"])},[m("div",ZG,[m("div",QG,[m("div",eJ,[tJ,m("button",{type:"button",class:"fm-text-gray-400 fm-bg-transparent hover:fm-bg-gray-200 hover:fm-text-gray-900 fm-rounded-lg fm-text-sm fm-p-1.5 fm-ml-auto fm-inline-flex fm-items-center dark:hover:fm-bg-gray-600 dark:hover:fm-text-white",onClick:E[0]||(E[0]=M=>b(e).toggleMediaPopup())},oJ)]),m("div",sJ,[m("div",iJ,[m("label",aJ,[lJ,cJ,m("input",{id:"dropzone-file",type:"file",onChange:E[1]||(E[1]=M=>y(M)),class:"fm-hidden"},null,32)])]),m("div",uJ,[m("form",{onSubmit:E[4]||(E[4]=nt(M=>v(1),["prevent"])),class:"fm-w-[400px]"},[dJ,m("div",fJ,[hJ,Ie(m("input",{type:"search","onUpdate:modelValue":E[2]||(E[2]=M=>kt(i)?i.value=M:i=M),id:"default-search",class:"fm-block fm-w-full fm-p-4 fm-pl-10 fm-text-sm fm-text-gray-900 focus-visible:fm-outline-blue-700 fm-outline-gray-300 fm-outline-1 fm-outline fm-rounded-lg fm-bg-gray-50 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white",placeholder:"Search media library"}
10,null,512),[[cn,b(i)]]),pJ,b(a)?(k(),_("button",{key:0,type:"button",onClick:E[3]||(E[3]=M=>(kt(i)?i.value="":i="",v(1))),class:"fm-absolute fm-right-[5.8rem] fm-top-1/2 -fm-translate-y-1/2 fm-right-24 fm-text-gray-400 fm-bg-red-600 hover:fm-bg-red-500 hover:fm-text-white fm-rounded-lg fm-text-sm fm-p-1 fm-ml-auto fm-inline-flex fm-items-center dark:hover:fm-bg-gray-600 dark:hover:fm-text-white"},yJ)):L("",!0)])],32)])]),m("div",vJ,[m("div",bJ,[b(s)?(k(),_("div",wJ,[Z(Gg)])):L("",!0),m("div",kJ,[m("div",{class:H([b(e).getSelectedImageID?"fm-w-[80%]":"fm-w-full","fm-duration-300"])},[b(n)?(k(),_("div",xJ,[!b(s)&&(!b(n)||b(n).length===0)?(k(),_("div",CJ,[m("p",null,[Le("Ingen resultater "),b(a)?(k(),_("span",_J,[Le("for søgeordet "),m("span",SJ,'"'+ve(b(a))+'"',1)])):L("",!0)])])):L("",!0),(k(!0),_(ce,null,Oe(b(n),(M,T)=>(k(),_("div",{class:H(["fm-col-span-6 md:fm-col-span-3 lg:fm-col-span-2 fm-pt-[80%] fm-relative active fm-border-2 fm-rounded-lg fm-overflow-hidden fm-cursor-pointer",[b(s)?"fm-border-transparent":"fm-bg-gray-100 dark:fm-bg-gray-800",b(e).getSelectedImageID&&b(e).getSelectedImageID===M.id||b(e).selectedImageIDs.includes(M.id)?"fm-border-blue-600 dark:fm-border-blue-500":"fm-border-transparent"]]),onClick:A=>b(u)(M),key:"image-"+T},[b(e).getSelectedImageIDs.length>0&&b(e).selectedImageIDs.includes(M.id)?(k(),_("div",TJ,ve(g(M.id))+" ",1)):L("",!0),M&&M.mime_type?(k(),_("div",{key:1,class:H(x(M.mime_type)?"":"fm-opacity-30")},[M.mime_type.includes("image")&&!b(s)?(k(),_("div",EJ,[m("img",{src:M.media_details.sizes&&M.media_details.sizes.medium?M.media_details.sizes.medium.source_url:M.source_url,class:"fm-absolute fm-top-0 fm-left-0 fm-h-full fm-w-full fm-object-contain fm-duration-100 fm-rounded-lg"},null,8,AJ)])):M.mime_type.includes("video")&&!b(s)?(k(),_("div",OJ,[IJ,m("video",{src:M.source_url,class:"fm-absolute fm-top-1/2 -fm-translate-y-1/2"},null,8,NJ)])):M.mime_type.includes("application")&&!b(s)?(k(),_("div",LJ,[RJ,m("span",{innerHTML:w(M.source_url),class:"fm-text-xs fm-absolute fm-bottom-0 fm-left-0 fm-bg-white dark:fm-bg-gray-700 dark:fm-text-white fm-w-full fm-text-center fm-p-1"},null,8,$J)])):L("",!0)],2)):L("",!0)],10,MJ))),128))])):L("",!0)],2),m("div",{class:H([b(e).getSelectedImageID||b(e).getSelectedImageIDs.length>0?"fm-w-[20%]":"fm-w-0","fm-duration-300"])},[b(e).getActiveFieldType=="gallery"?(k(),_("div",DJ,[(k(!0),_(ce,null,Oe(b
10(e).getSelectedImages,(M,T)=>(k(),_("div",{class:H(["fm-col-span-6 fm-pt-[80%] fm-relative active fm-border-2 fm-rounded-lg fm-cursor-pointer",[b(e).getSelectedImageID&&b(e).getSelectedImageID===M.id||b(e).selectedImageIDs.includes(M.id)?"fm-border-blue-600 dark:fm-border-blue-500":"fm-border-transparent"]]),key:"image-"+T},[m("button",{onClick:A=>b(u)(M),class:"fm-absolute fm-group fm-duration-100 fm-rounded-full fm-bg-red-500 fm-text-white fm-z-50 -fm-top-2 -fm-right-2 hover:-fm-top-3 hover:-fm-right-3 fm-w-6 fm-h-6 fm-pt-0 fm-text-center hover:fm-w-8 hover:fm-h-8 hover:fm-pt-0 fm-text-xs"}," ✕ ",8,PJ),b(e).getSelectedImageIDs.length>0&&b(e).selectedImageIDs.includes(M.id)?(k(),_("div",HJ,[g(M.id)>1?(k(),_("button",{key:0,onClick:nt(A=>b(e).moveImage(g(M.id)-1,g(M.id)-2),["stop"]),class:"fm-absolute fm-group fm-duration-100 fm-rounded-full fm-bg-blue-700 fm-text-white fm-z-50 fm-top-1/2 fm-left-0 -fm-translate-y-1/2 -fm-translate-x-full fm-w-6 fm-h-6 fm-p-0 fm-text-center hover:fm-w-8 hover:fm-h-8 hover:fm-p-1"}," - ",8,BJ)):L("",!0),Le(" "+ve(g(M.id))+" ",1),g(M.id)<b(e).getSelectedImageIDs.length?(k(),_("button",{key:1,onClick:nt(A=>b(e).moveImage(g(M.id)-1,g(M.id)),["stop"]),class:"fm-absolute fm-group fm-duration-100 fm-rounded-full fm-bg-blue-700 fm-text-white fm-z-50 fm-top-1/2 fm-right-0 -fm-translate-y-1/2 fm-translate-x-full fm-w-6 fm-h-6 fm-p-0 fm-text-center hover:fm-w-8 hover:fm-h-8 hover:fm-p-1"}," + ",8,FJ)):L("",!0)])):L("",!0),M&&M.mime_type?(k(),_("div",{key:1,class:H(x(M.mime_type)?"":"fm-opacity-30")},[M.mime_type.includes("image")?(k(),_("div",jJ,[m("img",{src:M.media_details.sizes&&M.media_details.sizes.medium?M.media_details.sizes.medium.source_url:M.source_url,class:"fm-absolute fm-top-0 fm-left-0 fm-h-full fm-w-full fm-object-contain fm-duration-100 fm-rounded-lg"},null,8,zJ)])):M.mime_type.includes("video")&&!b(s)?(k(),_("div",VJ,[UJ,m("video",{src:M.source_url,class:"fm-absolute fm-top-1/2 -fm-translate-y-1/2"},null,8,qJ)])):M.mime_type.includes("application")&&!b(s)?(k(),_("div",WJ,[KJ,m("span",{innerHTML:w(M.source_url),class:"fm-text-xs fm-absolute fm-bottom-0 fm-left-0 fm-bg-white dark:fm-bg-gray-700 dark:fm-text-white fm-w-full fm-text-center fm-p-1"},null,8,GJ)])):L("",!0)],2)):L("",!0)],2))),128))])):(k(),_("div",JJ,[b(e).getSelectedImageID?(k(),_("div",YJ,[b(e).getSelectedImage?(k(),_("div",XJ,[b(e).getSelectedImage.mime_type.includes("image")&&!b(s)?(k(),_("div",ZJ,[m("img",{src:b(e).getSelectedImage.media_details.sizes&&b(e).getSelectedImage.media_details.sizes.medium?b(e).getSelectedImage.media_details.sizes.medium.source_url:b(e).getSelectedImage.source_url,class:"fm-absolute fm-top-0 fm-left-0 fm-h-full fm-w-full fm-object-contain fm-duration-100 fm-rounded-lg"},null,8,QJ)])):b(e).getSelectedImage.mime_type.includes("video")?(k(),_("div",eY,[m("video",{controls:"",src:b(e).getSelectedImage.source_url,class:"fm-absolute fm-top-1/2 -fm-translate-y-1/2"},null,8,tY)])):b(e).getSelectedImage.mime_type.includes("application")?(k(),_("div",nY,oY)):L("",!0)])):L("",!0)])):L("",!0),b(e).getSelectedImageID&&b(e).getSelectedImage!==null&&b(e).getSelectedImage.media_details?(k(),_("div",sY,[m("p",iY,[aY,lY,m("span",{innerHTML:w(b(e).getSelectedImage.source_url)},null,8,cY)]),m("p",uY,[dY,fY,m("span",{innerHTML:b(e).getSelectedImage.mime_type},null,8,hY)]),m("p",pY,[mY,gY,m("span",{innerHTML:b(e).getSelectedImage.media_details.filesize/1e6<1?Math.floor(b(e).getSelectedImage.media_details.filesize/1e3)+" KB":(b(e).getSelectedImage.media_details.filesize/1e6).toFixed(2)+" MB"},null,8,yY)]),b(e).getSelectedImage.media_details.width&&b(e).getSelectedImage.media_details.height?(k(),_("p",vY,[bY,wY,m("span",{innerHTML:b(e).getSelectedImage.media_details.width},null,8,kY),Le(" x "),m("span",{innerHTML:b(e).getSelectedImage.media_details.height},null,8,xY),Le(" pixels")])):L("",!0),m("p",CY,[_Y,SY,m("span",{innerHTML:b(e).getSelectedImage.author},null,8,MY)]),m("p",TY,[EY,AY,m("span",{innerHTML:b(e).getSelectedImage.date},null,8,OY)]),m("p",IY,[NY,LY,m("span",{innerHTML:b(e).getSelectedImage.source_url},null,8,RY)])])):L("",!0)]))],2)])])]),m("div",$Y,[m("nav",DY,[b(r)>0?(k(),_("ul",PY,[m("li",{class:H(["fm-duration-200",b(o)>1?"":"fm-disabled fm-opacity-30 fm-pointer-events-none"]),onClick:E[5]||(E[5]=nt(M=>p(b(o)-1),["stop"]))},BY,2),b(r)>6?(k(),_(ce,{key:0},[(k(),_("li",{key:"page-1",onClick:E[6]||(E[6]=nt(M=>
10p(1),["stop"])),class:H(b(o)===1?"fm-pointer-events-none":"")},[m("button",{class:H(["fm-w-[45px] fm-relative fm-px-3 fm-py-2 fm-leading-tight fm-border fm-duration-200",b(o)===1?"fm-z-10 fm-text-blue-600 fm-border-blue-300 fm-bg-blue-50 hover:fm-bg-blue-100 hover:fm-text-blue-700 dark:fm-border-gray-700 dark:fm-bg-gray-700 dark:fm-text-white":"fm-text-gray-500 fm-bg-white hover:fm-bg-gray-100 hover:fm-text-gray-700 dark:fm-bg-gray-800 dark:fm-border-gray-700 dark:fm-text-gray-400 dark:hover:fm-bg-gray-700 dark:hover:fm-text-white"])},"1",2)],2)),b(o)>4?(k(),_("li",FY,zY)):L("",!0),(k(!0),_(ce,null,Oe(h.value,M=>(k(),_("li",{key:"page-"+M,onClick:nt(T=>p(M),["stop"]),class:H(M===b(o)?"fm-pointer-events-none":"")},[m("button",{class:H(["fm-w-[45px] fm-relative fm-px-3 fm-py-2 fm-leading-tight fm-border fm-duration-200",M===b(o)?"fm-z-10 fm-text-blue-600 fm-border-blue-300 fm-bg-blue-50 hover:fm-bg-blue-100 hover:fm-text-blue-700 dark:fm-border-gray-700 dark:fm-bg-gray-700 dark:fm-text-white":"fm-text-gray-500 fm-bg-white hover:fm-bg-gray-100 hover:fm-text-gray-700 dark:fm-bg-gray-800 dark:fm-border-gray-700 dark:fm-text-gray-400 dark:hover:fm-bg-gray-700 dark:hover:fm-text-white"])},ve(M),3)],10,VY))),128)),b(r)-b(o)>3?(k(),_("li",UY,WY)):L("",!0),h.value.includes(b(r))?L("",!0):(k(),_("li",{key:"page-"+b(r),onClick:E[7]||(E[7]=nt(M=>p(b(r)),["stop"])),class:H(b(r)===b(o)?"fm-pointer-events-none":"")},[m("button",{class:H(["fm-w-[45px] fm-relative fm-px-3 fm-py-2 fm-leading-tight fm-border fm-duration-200",b(r)===b(o)?"fm-z-10 fm-text-blue-600 fm-border-blue-300 fm-bg-blue-50 hover:fm-bg-blue-100 hover:fm-text-blue-700 dark:fm-border-gray-700 dark:fm-bg-gray-700 dark:fm-text-white":"fm-text-gray-500 fm-bg-white hover:fm-bg-gray-100 hover:fm-text-gray-700 dark:fm-bg-gray-800 dark:fm-border-gray-700 dark:fm-text-gray-400 dark:hover:fm-bg-gray-700 dark:hover:fm-text-white"])},ve(b(r)),3)],2))],64)):(k(!0),_(ce,{key:1},Oe(b(r),M=>(k(),_("li",{key:"page-"+M,onClick:nt(T=>p(M),["stop"]),class:H(M===b(o)?"fm-pointer-events-none":"")},[m("button",{class:H(["fm-relative fm-px-3 fm-py-2 fm-leading-tight fm-border fm-duration-200",M===b(o)?"fm-z-10 fm-text-blue-600 fm-border-blue-300 fm-bg-blue-50 hover:fm-bg-blue-100 hover:fm-text-blue-700 dark:fm-border-gray-700 dark:fm-bg-gray-700 dark:fm-text-white":"fm-text-gray-500 fm-bg-white hover:fm-bg-gray-100 hover:fm-text-gray-700 dark:fm-bg-gray-800 dark:fm-border-gray-700 dark:fm-text-gray-400 dark:hover:fm-bg-gray-700 dark:hover:fm-text-white"])},ve(M),3)],10,KY))),128)),m("li",{class:H(["fm-duration-200",b(o)<b(r)?"":"fm-disabled fm-opacity-30 fm-pointer-events-none"]),onClick:E[8]||(E[8]=nt(M=>p(b(o)+1),["stop"]))},JY,2)])):L("",!0)]),b(e).getActiveBlockIndex||b(e).getActiveFieldName?(k(),_("div",YY,[b(e).getSelectedImage&&x(b(e).getSelectedImage.mime_type)||b(e).getSelectedImages&&C(b(e).getSelectedImages)?(k(),_(ce,{key:0},[b(e).getActiveFieldType=="gallery"?(k(),_("button",{key:0,type:"button",class:H(["fm-text-white fm-mr-2 !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-px-5 fm-py-2.5 dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 focus:fm-outline-none dark:focus:fm-ring-blue-800",b(e).getSelectedImage||b(e).getSelectedImages.length>0?"":"fm-disabled fm-opacity-30 fm-pointer-events-none"]),onClick:E[9]||(E[9]=nt(M=>b(f)(),["stop"]))},"Clear selection ",2)):L("",!0),m("button",{type:"button",class:H(["fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-px-5 fm-py-2.5 dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 focus:fm-outline-none dark:focus:fm-ring-blue-800",b(e).getSelectedImage||b(e).getSelectedImages.length>0?"":"fm-disabled fm-opacity-30 fm-pointer-events-none"]),onClick:E[10]||(E[10]=nt(M=>b(d)(),["stop"]))},"Select file ",2)],64)):L("",!0)])):L("",!0)])])]),m("div",{class:"fm-bg-black fm-opacity-30 fm-absolute fm-top-0 fm-left-0 fm-w-full fm-h-full",onClick:E[11]||(E[11]=M=>b(e).toggleMediaPopup())})],2))}});function E_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function ms(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
vendor: 6,085 bytes, line 10
10e%2?E_(Object(n),!0).forEach(function(r){ZY(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):E_(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function wp(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wp=function(e){return typeof e}:wp=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wp(t)}function ZY(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oi(){return oi=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},oi.apply(this,arguments)}function QY(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,s;for(s=0;s<r.length;s++)o=r[s],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function eX(t,e){if(t==null)return{};var n=QY(t,e),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(o=0;o<s.length;o++)r=s[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}var tX="1.14.0";function Ys(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var ui=Ys(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ah=Ys(/Edge/i),A_=Ys(/firefox/i),Dd=Ys(/safari/i)&&!Ys(/chrome/i)&&!Ys(/android/i),D8=Ys(/iP(ad|od|hone)/i),nX=Ys(/chrome/i)&&Ys(/android/i),P8={capture:!1,passive:!1};function yt(t,e,n){t.addEventListener(e,n,!ui&&P8)}function pt(t,e,n){t.removeEventListener(e,n,!ui&&P8)}function Mm(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function rX(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Jo(t,e,n,r){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&Mm(t,e):Mm(t,e))||r&&t===n)return t;if(t===n)break}while(t=rX(t))}return null}var O_=/\s+/g;function Or(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(O_," ").replace(" "+e+" "," ");t.className=(r+(n?" "+e:"")).replace(O_," ")}}function Ve(t,e,n){var r=t&&t.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=n+(typeof n=="string"?"":"px")}}function wc(t,e){var n="";if(typeof t=="string")n=t;else do{var r=Ve(t,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!e&&(t=t.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function H8(t,e,n){if(t){var r=t.getElementsByTagName(e),o=0,s=r.length;if(n)for(;o<s;o++)n(r[o],o);return r}return[]}function us(){var t=document.scrollingElement;return t||document.documentElement}function rn(t,e,n,r,o){if(!(!t.getBoundingClientRect&&t!==window)){var s,i,a,l,c,u,d;if(t!==window&&t.parentNode&&t!==us()?(s=t.getBoundingClientRect(),i=s.top,a=s.left,l=s.bottom,c=s.right,u=s.height,d=s.width):(i=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(e||n)&&t!==window&&(o=o||t.parentNode,!ui))do if(o&&o.getBoundingClientRect&&(Ve(o,"transform")!=="none"||n&&Ve(o,"position")!=="static")){var f=o.getBoundingClientRect();i-=f.top+parseInt(Ve(o,"border-top-width")),a-=f.left+parseInt(Ve(o,"border-left-width")),l=i+s.height,c=a+s.width;break}while(o=o.parentNode);if(r&&t!==window){var h=wc(o||t),p=h&&h.a,g=h&&h.d;h&&(i/=g,a/=p,d/=p,u/=g,l=i+u,c=a+d)}return{top:i,left:a,bottom:l,right:c,width:d,height:u}}}function I_(t,e,n){for(var r=Fi(t,!0),o=rn(t)[e];r;){var s=rn(r)[n],i=void 0;if(i=o>=s,!i)return r;if(r===us())break;r=Fi(r,!1)}return!1}function Uc(t,e,n,r){for(var o=0,s=0,i=t.children;s<i.length;){if(i[s].style.display!=="none"&&i[s]!==Ue.ghost&&(r||i[s]!==Ue.dragged)&&Jo(i[s],n.draggable,t,!1)){if(o===e)return i[s];o++}s++}return null}function Pk(t,e){for(var n=t.lastElementChild;n&&(n===Ue.ghost||Ve(n,"display")==="none"||e&&!Mm(n,e));)n=n.previousElementSibling;return n||null}function Wr(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==Ue.clone&&(!e||Mm(t,e))&&n++;return n}function N_(t){var e=0,n=0,r=us();if(t)do{var o=wc(t),s=o.a,i=o.d;e+=t.scrollLeft*s,n+=t.scrollTop*i}while(t!==r&&(t=t.parentNode));return[e,n]}function oX(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===t[n][r])return Number(n)}return-1}function Fi(t,e){if(!t||!t.getBoundingClientRect)return us();var n=t,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=Ve(n);if(n.clientWidth<n.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return us();if(r||e)return n;r=!0}}while(n=n.parentNode);return us()}function sX(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function py(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var Pd;function B8(t,e){return function(){if(!Pd){var n=arguments,r=this;n.length===1?t.call(r,n[0]):t.apply(r,n),Pd=setTimeout(function(){Pd=void 0},e)}}}function iX(){clearTimeout(Pd),Pd=void 0}function F8(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function j8(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}var Rr="Sortable"+new Date().getTime();function aX(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var n=[].slice.call(this.el.children);
vendor: 5,043 bytes, line 10
10n.forEach(function(r){if(!(Ve(r,"display")==="none"||r===Ue.ghost)){t.push({target:r,rect:rn(r)});var o=ms({},t[t.length-1].rect);if(r.thisAnimationDuration){var s=wc(r,!0);s&&(o.top-=s.f,o.left-=s.e)}r.fromRect=o}})}},addAnimationState:function(n){t.push(n)},removeAnimationState:function(n){t.splice(oX(t,{target:n}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var o=!1,s=0;t.forEach(function(i){var a=0,l=i.target,c=l.fromRect,u=rn(l),d=l.prevFromRect,f=l.prevToRect,h=i.rect,p=wc(l,!0);p&&(u.top-=p.f,u.left-=p.e),l.toRect=u,l.thisAnimationDuration&&py(d,u)&&!py(c,u)&&(h.top-u.top)/(h.left-u.left)===(c.top-u.top)/(c.left-u.left)&&(a=cX(h,d,f,r.options)),py(u,c)||(l.prevFromRect=c,l.prevToRect=u,a||(a=r.options.animation),r.animate(l,h,u,a)),a&&(o=!0,s=Math.max(s,a),clearTimeout(l.animationResetTimer),l.animationResetTimer=setTimeout(function(){l.animationTime=0,l.prevFromRect=null,l.fromRect=null,l.prevToRect=null,l.thisAnimationDuration=null},a),l.thisAnimationDuration=a)}),clearTimeout(e),o?e=setTimeout(function(){typeof n=="function"&&n()},s):typeof n=="function"&&n(),t=[]},animate:function(n,r,o,s){if(s){Ve(n,"transition",""),Ve(n,"transform","");var i=wc(this.el),a=i&&i.a,l=i&&i.d,c=(r.left-o.left)/(a||1),u=(r.top-o.top)/(l||1);n.animatingX=!!c,n.animatingY=!!u,Ve(n,"transform","translate3d("+c+"px,"+u+"px,0)"),this.forRepaintDummy=lX(n),Ve(n,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),Ve(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){Ve(n,"transition",""),Ve(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},s)}}}}function lX(t){return t.offsetWidth}function cX(t,e,n,r){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*r.animation}var jl=[],my={initializeByDefault:!0},lh={mount:function(t){for(var e in my)my.hasOwnProperty(e)&&!(e in t)&&(t[e]=my[e]);jl.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),jl.push(t)},pluginEvent:function(t,e,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var o=t+"Global";jl.forEach(function(s){e[s.pluginName]&&(e[s.pluginName][o]&&e[s.pluginName][o](ms({sortable:e},n)),e.options[s.pluginName]&&e[s.pluginName][t]&&e[s.pluginName][t](ms({sortable:e},n)))})},initializePlugins:function(t,e,n,r){jl.forEach(function(i){var a=i.pluginName;if(!(!t.options[a]&&!i.initializeByDefault)){var l=new i(t,e,t.options);l.sortable=t,l.options=t.options,t[a]=l,oi(n,l.defaults)}});for(var o in t.options)if(t.options.hasOwnProperty(o)){var s=this.modifyOption(t,o,t.options[o]);typeof s<"u"&&(t.options[o]=s)}},getEventProperties:function(t,e){var n={};return jl.forEach(function(r){typeof r.eventProperties=="function"&&oi(n,r.eventProperties.call(e[r.pluginName],t))}),n},modifyOption:function(t,e,n){var r;return jl.forEach(function(o){t[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[e]=="function"&&(r=o.optionListeners[e].call(t[o.pluginName],n))}),r}};function uX(t){var e=t.sortable,n=t.rootEl,r=t.name,o=t.targetEl,s=t.cloneEl,i=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,f=t.originalEvent,h=t.putSortable,p=t.extraEventProperties;if(e=e||n&&n[Rr],!!e){var g,y=e.options,w="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!ui&&!ah?g=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(r,!0,!0)),g.to=i||n,g.from=a||n,g.item=o||n,g.clone=s,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=d,g.originalEvent=f,g.pullMode=h?h.lastPutMode:void 0;var x=ms(ms({},p),lh.getEventProperties(r,e));for(var C in x)g[C]=x[C];n&&n.dispatchEvent(g),y[w]&&y[w].call(e,g)}}var dX=["evt"],fr=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,o=eX(n,dX);lh.pluginEvent.bind(Ue)(t,e,ms({dragEl:ye,parentEl:Dt,ghostEl:Qe,rootEl:Nt,nextEl:La,lastDownEl:kp,cloneEl:Pt,cloneHidden:Li,dragStarted:od,putSortable:kn,activeSortable:Ue.active,originalEvent:r,oldIndex:ac,oldDraggableIndex:Hd,newIndex:Ir,newDraggableIndex:Ai,hideGhostForTarget:q8,unhideGhostForTarget:W8,cloneNowHidden:function(){Li=!0},cloneNowShown:function(){Li=!1},dispatchSortableEvent:function(s){Zn({sortable:e,name:s,originalEvent:r})}},o))};function Zn(t){uX(ms({putSortable:kn,cloneEl:Pt,targetEl:ye,rootEl:Nt,oldIndex:ac,oldDraggableIndex:Hd,newIndex:Ir,newDraggableIndex:Ai},t))}var ye,Dt,Qe,Nt,La,kp,Pt,Li,ac,Ir,Hd,Ai,$h,kn,Xl=!1,Tm=!1,Em=[],Ta,bo,gy,yy,L_,R_,od,zl,Bd,Fd=!1,Dh=!1,xp,Nn,vy=[],Kv=!1,Am=[],Jg=typeof document<"u",Ph=D8,$_=ah||ui?"cssFloat":"float",fX=Jg&&!nX&&!D8&&"draggable"in document.createElement("div"),z8=(function(){if(Jg){if(ui)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}
vendor: 13,896 bytes, line 10
10)(),V8=function(t,e){var n=Ve(t),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Uc(t,0,e),s=Uc(t,1,e),i=o&&Ve(o),a=s&&Ve(s),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+rn(o).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+rn(s).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&i.float&&i.float!=="none"){var u=i.float==="left"?"left":"right";return s&&(a.clear==="both"||a.clear===u)?"vertical":"horizontal"}return o&&(i.display==="block"||i.display==="flex"||i.display==="table"||i.display==="grid"||l>=r&&n[$_]==="none"||s&&n[$_]==="none"&&l+c>r)?"vertical":"horizontal"},hX=function(t,e,n){var r=n?t.left:t.top,o=n?t.right:t.bottom,s=n?t.width:t.height,i=n?e.left:e.top,a=n?e.right:e.bottom,l=n?e.width:e.height;return r===i||o===a||r+s/2===i+l/2},pX=function(t,e){var n;return Em.some(function(r){var o=r[Rr].options.emptyInsertThreshold;if(!(!o||Pk(r))){var s=rn(r),i=t>=s.left-o&&t<=s.right+o,a=e>=s.top-o&&e<=s.bottom+o;if(i&&a)return n=r}}),n},U8=function(t){function e(o,s){return function(i,a,l,c){var u=i.options.group.name&&a.options.group.name&&i.options.group.name===a.options.group.name;if(o==null&&(s||u))return!0;if(o==null||o===!1)return!1;if(s&&o==="clone")return o;if(typeof o=="function")return e(o(i,a,l,c),s)(i,a,l,c);var d=(s?i:a).options.group.name;return o===!0||typeof o=="string"&&o===d||o.join&&o.indexOf(d)>-1}}var n={},r=t.group;(!r||wp(r)!="object")&&(r={name:r}),n.name=r.name,n.checkPull=e(r.pull,!0),n.checkPut=e(r.put),n.revertClone=r.revertClone,t.group=n},q8=function(){!z8&&Qe&&Ve(Qe,"display","none")},W8=function(){!z8&&Qe&&Ve(Qe,"display","")};Jg&&document.addEventListener("click",function(t){if(Tm)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Tm=!1,!1},!0);var Ea=function(t){if(ye){t=t.touches?t.touches[0]:t;var e=pX(t.clientX,t.clientY);if(e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[Rr]._onDragOver(n)}}},mX=function(t){ye&&ye.parentNode[Rr]._isOutsideThisEl(t.target)};function Ue(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=oi({},e),t[Rr]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return V8(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,i){s.setData("Text",i.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Ue.supportPointer!==!1&&"PointerEvent"in window&&!Dd,emptyInsertThreshold:5};lh.initializePlugins(this,t,n);for(var r in n)!(r in e)&&(e[r]=n[r]);U8(e);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=e.forceFallback?!1:fX,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?yt(t,"pointerdown",this._onTapStart):(yt(t,"mousedown",this._onTapStart),yt(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(yt(t,"dragover",this),yt(t,"dragenter",this)),Em.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),oi(this,aX())}Ue.prototype={constructor:Ue,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(zl=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,ye):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,r=this.options,o=r.preventOnFilter,s=t.type,i=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,a=(i||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=r.filter;if(CX(n),!ye&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||r.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&Dd&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=Jo(a,r.draggable,n,!1),!(a&&a.animated)&&kp!==a)){if(ac=Wr(a),Hd=Wr(a,r.draggable),typeof c=="function"){if(c.call(this,t,a,this)){Zn({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),fr("filter",e,{evt:t}),o&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(u){if(u=Jo(l,u.trim(),n,!1),u)return Zn({sortable:e,rootEl:u,name:"filter",targetEl:a,fromEl:n,toEl:n}),fr("filter",e,{evt:t}),!0}),c)){o&&t.cancelable&&t.preventDefault();return}r.handle&&!Jo(l,r.handle,n,!1)||this._prepareDragStart(t,i,a)}}},_prepareDragStart:function(t,e,n){var r=this,o=r.el,s=r.options,i=o.ownerDocument,a;if(n&&!ye&&n.parentNode===o){var l=rn(n);if(Nt=o,ye=n,Dt=ye.parentNode,La=ye.nextSibling,kp=n,$h=s.group,Ue.dragged=ye,Ta={target:ye,clientX:(e||t).clientX,clientY:(e||t).clientY},L_=Ta.clientX-l.left,R_=Ta.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,ye.style["will-change"]="all",a=function(){if(fr("delayEnded",r,{evt:t}),Ue.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!A_&&r.nativeDraggable&&(ye.draggable=!0),r._triggerDragStart(t,e),Zn({sortable:r,name:"choose",originalEvent:t}),Or(ye,s.chosenClass,!0)},s.ignore.split(",").forEach(function(c){H8(ye,c.trim(),by)}),yt(i,"dragover",Ea),yt(i,"mousemove",Ea),yt(i,"touchmove",Ea),yt(i,"mouseup",r._onDrop),yt(i,"touchend",r._onDrop),yt(i,"touchcancel",r._onDrop),A_&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ye.draggable=!0),fr("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(ah||ui))){if(Ue.eventCanceled){this._onDrop();return}yt(i,"mouseup",r._disableDelayedDrag),yt(i,"touchend",r._disableDelayedDrag),yt(i,"touchcancel",r._disableDelayedDrag),yt(i,"mousemove",r._delayedDragTouchMoveHandler),yt(i,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&yt(i,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(a,s.delay)}else a()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ye&&by(ye),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;pt(t,"mouseup",this._disableDelayedDrag),pt(t,"touchend",this._disableDelayedDrag),pt(t,"touchcancel",this._disableDelayedDrag),pt(t,"mousemove",this._delayedDragTouchMoveHandler),pt(t,"touchmove",this._delayedDragTouchMoveHandler),pt(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?yt(document,"pointermove",this._onTouchMove):e?yt(document,"touchmove",this._onTouchMove):yt(document,"mousemove",this._onTouchMove):(yt(ye,"dragend",this),yt(Nt,"dragstart",this._onDragStart));try{document.selection?Cp(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Xl=!1,Nt&&ye){fr("dragStarted",this,{evt:e}),this.nativeDraggable&&yt(document,"dragover",mX);var n=this.options;!t&&Or(ye,n.dragClass,!1),Or(ye,n.ghostClass,!0),Ue.active=this,t&&this._appendGhost(),Zn({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(bo){this._lastX=bo.clientX,this._lastY=bo.clientY,q8();for(var t=document.elementFromPoint(bo.clientX,bo.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(bo.clientX,bo.clientY),t!==e);)e=t;if(ye.parentNode[Rr]._isOutsideThisEl(t),e)do{if(e[Rr]){var n=void 0;if(n=e[Rr]._onDragOver({clientX:bo.clientX,clientY:bo.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);W8()}},_onTouchMove:function(t){if(Ta){var e=this.options,n=e.fallbackTolerance,r=e.fallbackOffset,o=t.touches?t.touches[0]:t,s=Qe&&wc(Qe,!0),i=Qe&&s&&s.a,a=Qe&&s&&s.d,l=Ph&&Nn&&N_(Nn),c=(o.clientX-Ta.clientX+r.x)/(i||1)+(l?l[0]-vy[0]:0)/(i||1),u=(o.clientY-Ta.clientY+r.y)/(a||1)+(l?l[1]-vy[1]:0)/(a||1);if(!Ue.active&&!Xl){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(Qe){s?(s.e+=c-(gy||0),s.f+=u-(yy||0)):s={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");Ve(Qe,"webkitTransform",d),Ve(Qe,"mozTransform",d),Ve(Qe,"msTransform",d),Ve(Qe,"transform",d),gy=c,yy=u,bo=o}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Qe){var t=this.options.fallbackOnBody?document.body:Nt,e=rn(ye,!0,Ph,!0,t),n=this.options;if(Ph){for(Nn=t;Ve(Nn,"position")==="static"&&Ve(Nn,"transform")==="none"&&Nn!==document;)Nn=Nn.parentNode;Nn!==document.body&&Nn!==document.documentElement?(Nn===document&&(Nn=us()),e.top+=Nn.scrollTop,e.left+=Nn.scrollLeft):Nn=us(),vy=N_(Nn)}Qe=ye.cloneNode(!0),Or(Qe,n.ghostClass,!1),Or(Qe,n.fallbackClass,!0),Or(Qe,n.dragClass,!0),Ve(Qe,"transition",""),Ve(Qe,"transform",""),Ve(Qe,"box-sizing","border-box"),Ve(Qe,"margin",0),Ve(Qe,"top",e.top),Ve(Qe,"left",e.left),Ve(Qe,"width",e.width),Ve(Qe,"height",e.height),Ve(Qe,"opacity","0.8"),Ve(Qe,"position",Ph?"absolute":"fixed"),Ve(Qe,"zIndex","100000"),Ve(Qe,"pointerEvents","none"),Ue.ghost=Qe,t.appendChild(Qe),Ve(Qe,"transform-origin",L_/parseInt(Qe.style.width)*100+"% "+R_/parseInt(Qe.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,r=t.dataTransfer,o=n.options;if(fr("dragStart",this,{evt:t}),Ue.eventCanceled){this._onDrop();return}fr("setupClone",this),Ue.eventCanceled||(Pt=j8(ye),Pt.draggable=!1,Pt.style["will-change"]="",this._hideClone(),Or(Pt,this.options.chosenClass,!1),Ue.clone=Pt),n.cloneId=Cp(function(){fr("clone",n),!Ue.eventCanceled&&(n.options.removeCloneOnHide||Nt.insertBefore(Pt,ye),n._hideClone(),Zn({sortable:n,name:"clone"}))}),!e&&Or(ye,o.dragClass,!0),e?(Tm=!0,n._loopId=setInterval(n._emulateDragOver,50)):(pt(document,"mouseup",n._onDrop),pt(document,"touchend",n._onDrop),pt(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",o.setData&&o.setData.call(n,r,ye)),yt(document,"drop",n),Ve(ye,"transform","translateZ(0)")),Xl=!0,n._dragStartId=Cp(n._dragStarted.bind(n,e,t)),yt(document,"selectstart",n),od=!0,Dd&&Ve(document.body,"user-select","none")},_onDragOver:function(t){var e=this.el,n=t.target,r,o,s,i=this.options,a=i.group,l=Ue.active,c=$h===a,u=i.sort,d=kn||l,f,h=this,p=!1;if(Kv)return;function g(Y,j){fr(Y,h,ms({evt:t,isOwner:c,axis:f?"vertical":"horizontal",revert:s,dragRect:r,targetRect:o,canSort:u,fromSortable:d,target:n,completed:w,onMove:function(P,Q){return Hh(Nt,e,ye,r,P,rn(P),t,Q)},changed:x},j))}function y(){g("dragOverAnimationCapture"),h.captureAnimationState(),h!==d&&d.captureAnimationState()}function w(Y){return g("dragOverCompleted",{insertion:Y}),Y&&(c?l._hideClone():l._showClone(h),h!==d&&(Or(ye,kn?kn.options.ghostClass:l.options.ghostClass,!1),Or(ye,i.ghostClass,!0)),kn!==h&&h!==Ue.active?kn=h:h===Ue.active&&kn&&(kn=null),d===h&&(h._ignoreWhileAnimating=n),h.animateAll(function(){g("dragOverAnimationComplete"),h._ignoreWhileAnimating=null}),h!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===ye&&!ye.animated||n===e&&!n.animated)&&(zl=null),!i.dragoverBubble&&!t.rootEl&&n!==document&&(ye.parentNode[Rr]._isOutsideThisEl(t.target),!Y&&Ea(t)),!i.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),p=!0}function x(){Ir=Wr(ye),Ai=Wr(ye,i.draggable),Zn({sortable:h,name:"change",toEl:e,newIndex:Ir,newDraggableIndex:Ai,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=Jo(n,i.draggable,e,!0),g("dragOver"),Ue.eventCanceled)return p;if(ye.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||h._ignoreWhileAnimating===n)return w(!1);if(Tm=!1,l&&!i.disabled&&(c?u||(s=Dt!==Nt):kn===this||(this.lastPutMode=$h.checkPull(this,l,ye,t))&&a.checkPut(this,l,ye,t))){if(f=this._getDirection(t,n)==="vertical",r=rn(ye),g("dragOverValid"),Ue.eventCanceled)return p;if(s)return Dt=Nt,y(),this._hideClone(),g("revert"),Ue.eventCanceled||(La?Nt.insertBefore(ye,La):Nt.appendChild(ye)),w(!0);var C=Pk(e,i.draggable);if(!C||bX(t,f,this)&&!C.animated){if(C===ye)return w(!1);if(C&&e===t.target&&(n=C),n&&(o=rn(n)),Hh(Nt,e,ye,r,n,o,t,!!n)!==!1)return y(),e.appendChild(ye),Dt=e,x(),w(!0)}else if(C&&vX(t,f,this)){var v=Uc(e,0,i,!0);if(v===ye)return w(!1);if(n=v,o=rn(n),Hh(Nt,e,ye,r,n,o,t,!1)!==!1)return y(),e.insertBefore(ye,v),Dt=e,x(),w(!0)}else if(n.parentNode===e){o=rn(n);var S=0,E,M=ye.parentNode!==e,T=!hX(ye.animated&&ye.toRect||r,n.animated&&n.toRect||o,f),A=f?"top":"left",N=I_(n,"top","top")||I_(ye,"top","top"),D=N?N.scrollTop:void 0;zl!==n&&(E=o[A],Fd=!1,Dh=!T&&i.invertSwap||M),S=wX(t,n,o,f,T?1:i.swapThreshold,i.invertedSwapThreshold==null?i.swapThreshold:i.invertedSwapThreshold,Dh,zl===n);var $;if(S!==0){var W=Wr(ye);do W-=S,$=Dt.children[W];while($&&(Ve($,"display")==="none"||$===Qe))}if(S===0||$===n)return w(!1);zl=n,Bd=S;var me=n.nextElementSibling,V=!1;V=S===1;var B=Hh(Nt,e,ye,r,n,o,t,V);if(B!==!1)return(B===1||B===-1)&&(V=B===1),Kv=!0,setTimeout(yX,30),y(),V&&!me?e.appendChild(ye):n.parentNode.insertBefore(ye,V?me:n),N&&F8(N,
vendor: 4,828 bytes, line 10
100,D-N.scrollTop),Dt=ye.parentNode,E!==void 0&&!Dh&&(xp=Math.abs(E-rn(n)[A])),x(),w(!0)}if(e.contains(ye))return w(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){pt(document,"mousemove",this._onTouchMove),pt(document,"touchmove",this._onTouchMove),pt(document,"pointermove",this._onTouchMove),pt(document,"dragover",Ea),pt(document,"mousemove",Ea),pt(document,"touchmove",Ea)},_offUpEvents:function(){var t=this.el.ownerDocument;pt(t,"mouseup",this._onDrop),pt(t,"touchend",this._onDrop),pt(t,"pointerup",this._onDrop),pt(t,"touchcancel",this._onDrop),pt(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;if(Ir=Wr(ye),Ai=Wr(ye,n.draggable),fr("drop",this,{evt:t}),Dt=ye&&ye.parentNode,Ir=Wr(ye),Ai=Wr(ye,n.draggable),Ue.eventCanceled){this._nulling();return}Xl=!1,Dh=!1,Fd=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Gv(this.cloneId),Gv(this._dragStartId),this.nativeDraggable&&(pt(document,"drop",this),pt(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Dd&&Ve(document.body,"user-select",""),Ve(ye,"transform",""),t&&(od&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Qe&&Qe.parentNode&&Qe.parentNode.removeChild(Qe),(Nt===Dt||kn&&kn.lastPutMode!=="clone")&&Pt&&Pt.parentNode&&Pt.parentNode.removeChild(Pt),ye&&(this.nativeDraggable&&pt(ye,"dragend",this),by(ye),ye.style["will-change"]="",od&&!Xl&&Or(ye,kn?kn.options.ghostClass:this.options.ghostClass,!1),Or(ye,this.options.chosenClass,!1),Zn({sortable:this,name:"unchoose",toEl:Dt,newIndex:null,newDraggableIndex:null,originalEvent:t}),Nt!==Dt?(Ir>=0&&(Zn({rootEl:Dt,name:"add",toEl:Dt,fromEl:Nt,originalEvent:t}),Zn({sortable:this,name:"remove",toEl:Dt,originalEvent:t}),Zn({rootEl:Dt,name:"sort",toEl:Dt,fromEl:Nt,originalEvent:t}),Zn({sortable:this,name:"sort",toEl:Dt,originalEvent:t})),kn&&kn.save()):Ir!==ac&&Ir>=0&&(Zn({sortable:this,name:"update",toEl:Dt,originalEvent:t}),Zn({sortable:this,name:"sort",toEl:Dt,originalEvent:t})),Ue.active&&((Ir==null||Ir===-1)&&(Ir=ac,Ai=Hd),Zn({sortable:this,name:"end",toEl:Dt,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){fr("nulling",this),Nt=ye=Dt=Qe=La=Pt=kp=Li=Ta=bo=od=Ir=Ai=ac=Hd=zl=Bd=kn=$h=Ue.dragged=Ue.ghost=Ue.clone=Ue.active=null,Am.forEach(function(t){t.checked=!0}),Am.length=gy=yy=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ye&&(this._onDragOver(t),gX(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,n=this.el.children,r=0,o=n.length,s=this.options;r<o;r++)e=n[r],Jo(e,s.draggable,this.el,!1)&&t.push(e.getAttribute(s.dataIdAttr)||xX(e));return t},sort:function(t,e){var n={},r=this.el;this.toArray().forEach(function(o,s){var i=r.children[s];Jo(i,this.options.draggable,r,!1)&&(n[o]=i)},this),e&&this.captureAnimationState(),t.forEach(function(o){n[o]&&(r.removeChild(n[o]),r.appendChild(n[o]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return Jo(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(e===void 0)return n[t];var r=lh.modifyOption(this,t,e);typeof r<"u"?n[t]=r:n[t]=e,t==="group"&&U8(n)},destroy:function(){fr("destroy",this);var t=this.el;t[Rr]=null,pt(t,"mousedown",this._onTapStart),pt(t,"touchstart",this._onTapStart),pt(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(pt(t,"dragover",this),pt(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Em.splice(Em.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Li){if(fr("hideClone",this),Ue.eventCanceled)return;Ve(Pt,"display","none"),this.options.removeCloneOnHide&&Pt.parentNode&&Pt.parentNode.removeChild(Pt),Li=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Li){if(fr("showClone",this),Ue.eventCanceled)return;ye.parentNode==Nt&&!this.options.group.revertClone?Nt.insertBefore(Pt,ye):La?Nt.insertBefore(Pt,La):Nt.appendChild(Pt),this.options.group.revertClone&&this.animate(ye,Pt),Ve(Pt,"display",""),Li=!1}}};function gX(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Hh(t,e,n,r,o,s,i,a){var l,c=t[Rr],u=c.options.onMove,d;return window.CustomEvent&&!ui&&!ah?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=t,l.dragged=n,l.draggedRect=r,l.related=o||e,l.relatedRect=s||rn(e),l.willInsertAfter=a,l.originalEvent=i,t.dispatchEvent(l),u&&(d=u.call(c,l,i)),d}function by(t){t.draggable=!1}function yX(){Kv=!1}function vX(t,e,n){var r=rn(Uc(n.el,0,n.options,!0)),o=10;
10return e?t.clientX<r.left-o||t.clientY<r.top&&t.clientX<r.right:t.clientY<r.top-o||t.clientY<r.bottom&&t.clientX<r.left}function bX(t,e,n){var r=rn(Pk(n.el,n.options.draggable)),o=10;return e?t.clientX>r.right+o||t.clientX<=r.right&&t.clientY>r.bottom&&t.clientX>=r.left:t.clientX>r.right&&t.clientY>r.top||t.clientX<=r.right&&t.clientY>r.bottom+o}function wX(t,e,n,r,o,s,i,a){var l=r?t.clientY:t.clientX,c=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!i){if(a&&xp<c*o){if(!Fd&&(Bd===1?l>u+c*s/2:l<d-c*s/2)&&(Fd=!0),Fd)f=!0;else if(Bd===1?l<u+xp:l>d-xp)return-Bd}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return kX(e)}return f=f||i,f&&(l<u+c*s/2||l>d-c*s/2)?l>u+c/2?1:-1:0}function kX(t){return Wr(ye)<Wr(t)?1:-1}function xX(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,r=0;n--;)r+=e.charCodeAt(n);return r.toString(36)}function CX(t){Am.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var r=e[n];r.checked&&Am.push(r)}}function Cp(t){return setTimeout(t,0)}function Gv(t){return clearTimeout(t)}Jg&&yt(document,"touchmove",function(t){(Ue.active||Xl)&&t.cancelable&&t.preventDefault()});Ue.utils={on:yt,off:pt,css:Ve,find:H8,is:function(t,e){return!!Jo(t,e,t,!1)},extend:sX,throttle:B8,closest:Jo,toggleClass:Or,clone:j8,index:Wr,nextTick:Cp,cancelNextTick:Gv,detectDirection:V8,getChild:Uc};Ue.get=function(t){return t[Rr]};Ue.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(Ue.utils=ms(ms({},Ue.utils),r.utils)),lh.mount(r)})};Ue.create=function(t,e){return new Ue(t,e)};Ue.version=tX;var Gt=[],sd,Jv,Yv=!1,wy,ky,Om,id;function _X(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(e){var n=e.originalEvent;this.sortable.nativeDraggable?yt(document,"dragover",this._handleAutoScroll):this.options.supportPointer?yt(document,"pointermove",this._handleFallbackAutoScroll):n.touches?yt(document,"touchmove",this._handleFallbackAutoScroll):yt(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var n=e.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?pt(document,"dragover",this._handleAutoScroll):(pt(document,"pointermove",this._handleFallbackAutoScroll),pt(document,"touchmove",this._handleFallbackAutoScroll),pt(document,"mousemove",this._handleFallbackAutoScroll)),D_(),_p(),iX()},nulling:function(){Om=Jv=sd=Yv=id=wy=ky=null,Gt.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,n){var r=this,o=(e.touches?e.touches[0]:e).clientX,s=(e.touches?e.touches[0]:e).clientY,i=document.elementFromPoint(o,s);if(Om=e,n||this.options.forceAutoScrollFallback||ah||ui||Dd){xy(e,this.options,i,n);var a=Fi(i,!0);Yv&&(!id||o!==wy||s!==ky)&&(id&&D_(),id=setInterval(function(){var l=Fi(document.elementFromPoint(o,s),!0);l!==a&&(a=l,_p()),xy(e,r.options,l,n)},10),wy=o,ky=s)}else{if(!this.options.bubbleScroll||Fi(i,!0)===us()){_p();return}xy(e,this.options,Fi(i,!1),!1)}}},oi(t,{pluginName:"scroll",initializeByDefault:!0})}function _p(){Gt.forEach(function(t){clearInterval(t.pid)}),Gt=[]}function D_(){clearInterval(id)}var xy=B8(function(t,e,n,r){if(e.scroll){var o=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,i=e.scrollSensitivity,a=e.scrollSpeed,l=us(),c=!1,u;Jv!==n&&(Jv=n,_p(),sd=e.scroll,u=e.scrollFn,sd===!0&&(sd=Fi(n,!0)));var d=0,f=sd;do{var h=f,p=rn(h),g=p.top,y=p.bottom,w=p.left,x=p.right,C=p.width,v=p.height,S=void 0,E=void 0,M=h.scrollWidth,T=h.scrollHeight,A=Ve(h),N=h.scrollLeft,D=h.scrollTop;h===l?(S=C<M&&(A.overflowX==="auto"||A.overflowX==="scroll"||A.overflowX==="visible"),E=v<T&&(A.overflowY==="auto"||A.overflowY==="scroll"||A.overflowY==="visible")):(S=C<M&&(A.overflowX==="auto"||A.overflowX==="scroll"),E=v<T&&(A.overflowY==="auto"||A.overflowY==="scroll"));var $=S&&(Math.abs(x-o)<=i&&N+C<M)-(Math.abs(w-o)<=i&&!!N),W=E&&(Math.abs(y-s)<=i&&D+v<T)-(Math.abs(g-s)<=i&&!!D);if(!Gt[d])for(var me=0;me<=d;me++)Gt[me]||(Gt[me]={});(Gt[d].vx!=$||Gt[d].vy!=W||Gt[d].el!==h)&&(Gt[d].el=h,Gt[d].vx=$,Gt[d].vy=W,clearInterval(Gt[d].pid),($!=0||W!=0)&&(c=!0,Gt[d].pid=setInterval((function(){r&&this.layer===0&&Ue.active._onTouchMove(Om);var V=Gt[this.layer].vy?Gt[this.layer].vy*a:0,B=Gt[this.layer].vx?Gt[this.layer].vx*a:0;typeof u=="function"&&u.call(Ue.dragged.parentNode[Rr],B,V,t,Om,Gt[this.layer].el)!=="continue"||F8(Gt[this.layer].el,B,V)}).bind({layer:d}),24))),d++}while(e.bubbleScroll&&f!==l&&(f=Fi(f,!1)));Yv=c}},30),K8=function(t){var e=t.originalEvent,n=t.putSortable,r=t.dragEl,o=t.activeSortable,s=t.dispatchSortableEvent,i=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var l=n||o;i();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,u=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(u)&&(s("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function Hk(){}Hk.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=Uc(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(e,r):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:K8};oi(Hk,{pluginName:"revertOnSpill"});function Bk(){}Bk.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable,r=n||this.sortable;r.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),r.animateAll()},drop:K8};oi(Bk,{pluginName:"removeOnSpill"});Ue.mount(new _X);Ue.mount(Bk,Hk);function SX(){return typeof window<"u"?window.console:global.console}const MX=SX();function TX(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const EX=/-(\w)/g,P_=TX(t=>t.replace(EX,(e,n)=>n?n.toUpperCase():""));function Cy(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function H_(t,e,n){const r=n===0?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,r)}function AX(t,e){return Object.values(t).indexOf(e)}function OX(t,e,n,r){if(!t)return[];const o=Object.values(t),s=e.length-r;return[...e].map((i,a)=>a>=s?o.length:o.indexOf(i))}function G8(t,e){this.$nextTick(()=>this.$emit(t.toLowerCase(),e))}function IX(t){return e=>{this.realList!==null&&this["onDrag"+t](e),G8.call(this,t,e)}}function NX(t){return["transition-group","TransitionGroup"].includes(t)}function LX(t){if(!t||t.length!==1)return!1;const[{type:e}]=t;return e?NX(e.name):!1}function RX(t,e){return e?{...e.props,...e.attrs}:t}const Xv=["Start","Add","Remove","Update","End"],Zv=["Choose","Unchoose","Sort","Filter","Clone"],$X=["Move",...Xv,...Zv].map(t=>"on"+t);let _y=null;const DX={options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:t=>t},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},Qv=Ne({name:"VueDraggableNext",inheritAttrs:!1,emits:["update:modelValue","move","change",...Xv.map(t=>t.toLowerCase()),...Zv.map(t=>t.toLowerCase())],props:DX,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}},render(){const t=this.$slots.default?this.$slots.default():null,e=RX(this.$attrs,this.componentData);return t?(this.transitionMode=LX(t),mt(this.getTag(),e,t)):mt(this.getTag(),e,[])},created(){this.list!==null&&this.modelValue!==null&&MX.error("list props are mutually exclusive! Please set one.")}
10,mounted(){const t={};Xv.forEach(o=>{t["on"+o]=IX.call(this,o)}),Zv.forEach(o=>{t["on"+o]=G8.bind(this,o)});const e=Object.keys(this.$attrs).reduce((o,s)=>(o[P_(s)]=this.$attrs[s],o),{}),n=Object.assign({},e,t,{onMove:(o,s)=>this.onDragMove(o,s)});!("draggable"in n)&&(n.draggable=">*");const r=this.$el.nodeType===1?this.$el:this.$el.parentElement;this._sortable=new Ue(r,n),r.__draggable_component__=this,this.computeIndexes()},beforeUnmount(){try{this._sortable!==void 0&&this._sortable.destroy()}catch{}},computed:{realList(){return this.list?this.list:this.modelValue}},watch:{$attrs:{handler(t){this.updateOptions(t)},deep:!0},realList(){this.computeIndexes()}},methods:{getTag(){return this.component?lf(this.component):this.tag},updateOptions(t){for(var e in t){const n=P_(e);$X.indexOf(n)===-1&&this._sortable.option(n,t[e])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick(()=>{this.visibleIndexes=OX(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)})},getUnderlyingVm(t){const e=AX(this.getChildrenNodes()||[],t);if(e===-1)return null;const n=this.realList[e];return{index:e,element:n}},emitChanges(t){this.$nextTick(()=>{this.$emit("change",t)})},alterList(t){if(this.list){t(this.list);return}const e=[...this.modelValue];t(e),this.$emit("update:modelValue",e)},spliceList(){const t=e=>e.splice(...arguments);this.alterList(t)},updatePosition(t,e){const n=r=>r.splice(e,0,r.splice(t,1)[0]);this.alterList(n)},getVmIndex(t){const e=this.visibleIndexes,n=e.length;return t>n-1?n:e[t]},getComponent(){return this.$slots.default?this.$slots.default()[0].componentInstance:null},resetTransitionData(t){if(!this.noTransitionOnDrag||!this.transitionMode)return;var e=this.getChildrenNodes();e[t].data=null;const n=this.getComponent();n.children=[],n.kept=void 0},onDragStart(t){this.computeIndexes(),this.context=this.getUnderlyingVm(t.item),this.context&&(t.item._underlying_vm_=this.clone(this.context.element),_y=t.item)},onDragAdd(t){const e=t.item._underlying_vm_;if(e===void 0)return;Cy(t.item);const n=this.getVmIndex(t.newIndex);this.spliceList(n,0,e),this.computeIndexes();const r={element:e,newIndex:n};this.emitChanges({added:r})},onDragRemove(t){if(H_(this.$el,t.item,t.oldIndex),t.pullMode==="clone"){Cy(t.clone);return}if(!this.context)return;const e=this.context.index;this.spliceList(e,1);const n={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:n})},onDragUpdate(t){Cy(t.item),H_(t.from,t.item,t.oldIndex);const e=this.context.index,n=this.getVmIndex(t.newIndex);this.updatePosition(e,n);const r={element:this.context.element,oldIndex:e,newIndex:n};this.emitChanges({moved:r})},updateProperty(t,e){t.hasOwnProperty(e)&&(t[e]+=this.headerOffset)},onDragMove(t,e){const n=this.move;if(!n||!this.realList)return!0;const r=this.getRelatedContextFromMoveEvent(t),o=this.context,s=this.computeFutureIndex(r,t);Object.assign(o,{futureIndex:s});const i=Object.assign({},t,{relatedContext:r,draggedContext:o});return n(i,e)},onDragEnd(){this.computeIndexes(),_y=null},getTrargetedComponent(t){return t.__draggable_component__},getRelatedContextFromMoveEvent({to:t,related:e}){const n=this.getTrargetedComponent(t);if(!n)return{component:n};const r=n.realList,o={list:r,component:n};if(t!==e&&r&&n.getUnderlyingVm){const s=n.getUnderlyingVm(e);if(s)return Object.assign(s,o)}return o},computeFutureIndex(t,e){const n=[...e.to.children].filter(s=>s.style.display!=="none");if(n.length===0)return 0;const r=n.indexOf(e.related),o=t.component.getVmIndex(r);return n.indexOf(_y)!==-1||!e.willInsertAfter?o:o+1}}}),J8=dr("poststore",{state:()=>({postsPopupOpen:!1,postLibrary:[],activeBlockIndex:null,activeFieldName:null,activeLayout:null,activeParent:null,activeIsSetting:!1,selectedPosts:[],postLibraryLoading:!1}),getters:{getActiveBlockIndex(t){return t.activeBlockIndex},getActiveFieldName(t){return t.activeFieldName},getActiveLayout(t){return t.activeLayout},getActiveParent(t){return t.activeParent},getActiveIsSetting(t){return t.activeIsSetting},getSelectedPosts(t){return t.selectedPosts},getPostLibrary(t){return t.postLibrary},getPostsPopupOpen(t){return t.postsPopupOpen},getPostLibraryLoading(t){return t.postLibraryLoading}},actions:{setPostLibraryLoading(t){this.postLibraryLoading=t},togglePostsPopup(){this.postsPopupOpen=!this.postsPopupOpen,this.postsPopupOpen||this.clearContext()},setContext(t,e,n,r,o){this.activeBlockIndex=t,this.activeFieldName=e,this.activeLayout=n,this.activeParent=o,this.activeIsSetting=r},clearContext(){this.postLibrary=[],this.activeBlockIndex=null,this.activeFieldName=null,this.activeLayout=null,this.activeIsSetting=!1},setSelectedPosts(t){this.selectedPosts=t},clearSelectedPosts(){this.selectedPosts=[]},setPostLibrary(t){this.postLibrary=t}}}),PX={class:"fm-relative fm-left-1/2 fm-top-1/2 -fm-translate-x-1/2 -fm-translate-y-1/2 fm-w-full fm-h-full fm-max-w-[50%] fm-max-h-[90%] md:fm-h-auto fm-z-10"},HX={class:"fm-relative fm-bg-white fm-rounded-lg fm-shadow dark:fm-bg-gray-700 fm-w-full fm-h-full"},BX={class:"fm-flex fm-items-start fm-justify-between fm-p-4 fm-border-b fm-rounded-t dark:fm-border-gray-600"},FX={class:"fm-relative fm-w-full fm-max-w-[350px]"},jX=m("div",{class:"fm-absolute fm-inset-y-0 fm-left-0 fm-flex fm-items-center fm-pl-3 fm-pointer-events-none"},[m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5 fm-text-gray-500 dark:fm-text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})])],-1),zX=m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),VX=m("span",{class:"fm-sr-only"},"Close modal",-1),UX=[zX,VX],qX={class:"fm-space-y-6"},WX={class:"relative"},KX={class:"fm-flex fm-flex-col fm-gap-4 fm-text-gray-700 dark:fm-text-gray-200 fm-text-sm"},GX={key:0},JX={key:0,class:"fm-p-6 fm-pb-2"},YX=m("div",{class:"fm-w-full fm-mb-2 fm-font-bold"},"Selected",-1),XX={class:"fm-bg-blue-100 fm-text-blue-800 fm-text-xs fm-font-medium fm-pr-5 fm-pl-1 fm-py-0.5 fm-rounded dark:fm-bg-blue-900 dark:fm-text-blue-300 fm-relative"},ZX=["innerHTML"],QX=["onClick"],eZ=m("svg",{"aria-hidden":"true",class:"fm-absolute fm-w-3 fm-h-3 fm-top-1/2 fm-right-1 -fm-translate-y-1/2",fill:"
10currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),tZ=[eZ],nZ={class:"fm-bg-blue-100 fm-text-blue-800 fm-text-xs fm-font-medium fm-pr-5 fm-pl-1 fm-py-0.5 fm-rounded dark:fm-bg-blue-900 dark:fm-text-blue-300 fm-relative"},rZ=["innerHTML"],oZ=["onClick"],sZ=m("svg",{"aria-hidden":"true",class:"fm-absolute fm-w-3 fm-h-3 fm-top-1/2 fm-right-1 -fm-translate-y-1/2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),iZ=[sZ],aZ={key:2,class:"fm-flex fm-gap-2 fm-flex-wrap"},lZ={class:"fm-cursor-grab"},cZ={class:"fm-bg-blue-100 fm-text-blue-800 fm-text-xs fm-font-medium fm-pr-5 fm-pl-1 fm-py-0.5 fm-rounded dark:fm-bg-blue-900 dark:fm-text-blue-300 fm-relative"},uZ=["innerHTML"],dZ=m("svg",{"aria-hidden":"true",class:"fm-absolute fm-w-3 fm-h-3 fm-top-1/2 fm-right-1 -fm-translate-y-1/2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),fZ=[dZ],hZ={class:"fm-w-full fm-min-h-[100px] fm-max-h-[50vh] fm-overflow-auto fm-p-6 fm-pt-2 fm-relative"},pZ={key:0,class:"fm-absolute fm-top-1/2 fm-left-1/2 -fm-translate-x-1/2 -fm-translate-y-1/2"},mZ={class:"fm-text-sm fm-text-gray-700 dark:fm-text-gray-200 fm-flex fm-flex-col fm-gap-4"},gZ={class:"fm-w-full fm-mb-2 fm-font-bold"},yZ={key:0,class:"fm-flex fm-items-center fm-pl-3"},vZ=["id","onChange","value","checked"],bZ=["for"],wZ={key:1,class:"fm-flex fm-items-center fm-pl-3"},kZ=["id","onChange","value","checked"],xZ=["for"],CZ=Ne({__name:"FlowmatePostsPopup",setup(t){const e=J8(),n=lt(),r=zr(),o=pe([]),s=pe(""),i=U(()=>e.getPostsPopupOpen);Ye(i,E=>{E&&(s.value="",o.value=[])});const a=U(()=>e.getActiveLayout),l=U(()=>e.getActiveFieldName),c=U(()=>e.getActiveBlockIndex),u=U(()=>e.getActiveIsSetting),d=U(()=>{let E=r.getConfig.config[a.value][l.value];return u.value&&(E=r.getConfig.config[a.value].settings[l.value]),E.type==="taxonomy"?!0:E.return_format==="id"}),f=U(()=>{let E=r.getConfig.config[a.value][l.value];return u.value&&(E=r.getConfig.config[a.value].settings[l.value]),E.type==="relationship"?!0:E.multiple===1}),h=U(()=>{let E=r.getConfig.config[a.value][l.value];return u.value&&(E=r.getConfig.config[a.value].settings[l.value]),E.type==="taxonomy"}),p=U(()=>{let E=r.getConfig.config[a.value][l.value];if(u.value&&(E=r.getConfig.config[a.value].settings[l.value]),E.type==="relationship"){const M=parseInt(E.max);return M>0&&M<=n.pageContext.acf.content[c.value][l.value].length}return!1}),g=U(()=>u.value?n.pageContext.acf.content[c.value].settings[l.value]:n.pageContext.acf.content[c.value][l.value]),y=U(()=>{const E=e.getPostLibrary;let M=[];for(const T of E){let A,N;T.is_tax?(N=M.findIndex(D=>D.name===T.taxonomy_plural),N==-1&&M.push({name:T.taxonomy_plural,items:[]}),A=M.findIndex(D=>D.name===T.taxonomy_plural)):(N=M.findIndex(D=>D.name===T.post_type_plural),N==-1&&M.push({name:T.post_type_plural,items:[]}),A=M.findIndex(D=>D.name===T.post_type_plural)),M[A].items.push(T)}return M.filter(T=>o.value.length>0?o.value.includes(T.name):!0)}),w=U(()=>{if(y.value&&y.value.length>0){let E=JSON.parse(JSON.stringify(y.value));return E=E.filter(M=>{let T=M.items.filter(A=>A.is_tax?A.name.toLowerCase().includes(s.value.toLowerCase()):A.post_title.toLowerCase().includes(s.value.toLowerCase()));return M.items=T,T.length>0}),E}return[]}),x=E=>{let M;E.is_tax?M="term_id":M="ID";let T=n.pageContext.acf.content[c.value][l.value];return u.value&&(T=n.pageContext.acf.content[c.value].settings[l.value]),T?f.value?d.value?T.some(A=>A===E[M]):T.some(A=>A[M]===E[M]):d.value?T===E[M]:T[M]===E[M]:!1},C=E=>{let M;E.is_tax?M="term_id":M="ID";let T=n.pageContext.acf.content[c.value][l.value];if(u.value&&(T=n.pageContext.acf.content[c.value].settings[l.value]),f.value){T||(T=[]);let A;d.value?A=T.findIndex(N=>N===E[M]):A=T.findIndex(N=>N[M]===E[M]),A>-1?T.splice(A,1):d.value?T.push(E[M]):T.push(E)}else d.value?T===E[M]?T=!1:T=E[M]:T&&T[M]===E[M]?T=!1:T=E;T.length===0&&(T=!1),u.value?n.pageContext.acf.content[c.value].settings[l.value]=T:n.pageContext.acf.content[c.value][l.value]=T},v=E=>{let M;E.is_tax?M="term_id":M="ID";let T=n.pageContext.acf.content[c.value][l.value];if(u.value&&(T=n.pageContext.acf.content[c.value].settings[l.value]),f.value){T||(T=[]);let A;d.value?A=T.findIndex(N=>N===E):A=T.findIndex(N=>N[M]===E[M]),A>-1&&T.splice(A,1)}else T=[];T.length===0&&(T=!1),u.value?n.pageContext.acf.content[c.value].settings[l.value]=T:n.pageContext.acf.content[c.value][l.value]=T},S=E=>h.value?e.getPostLibrary.find(M=>M.term_id===E).name:e.getPostLibrary.find(M=>M.ID===E).post_title;return(E,M)=>(k(),_("div",{class:H(["fm-fixed fm-w-screen fm-h-screen fm-z-[999] fm-top-0 fm-left-0 fm-duration-300",b(e).getPostsPopupOpen?"fm-opacity-100 fm-pointer-events-all":"fm-opacity-0 fm-pointer-events-none"])},[m("div",PX,[m("div",HX,[m("div",BX,[m("div",FX,[jX,Ie(m("input",{type:"search",id:"search-dropdown","onUpdate:modelValue":M[0]||(M[0]=T
10=>s.value=T),class:"fm-block fm-p-2.5 !fm-pl-[40px] fm-w-full fm-z-20 fm-text-sm fm-text-gray-900 fm-bg-gray-50 fm-rounded-lg border-l-gray-100 fm-border fm-border-gray-300 focus:fm-ring-blue-500 focus:fm-border-blue-500 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-border-blue-500",placeholder:"Search",required:""},null,512),[[cn,s.value]])]),m("button",{type:"button",class:"fm-text-gray-400 fm-bg-transparent hover:fm-bg-gray-200 hover:fm-text-gray-900 fm-rounded-lg fm-text-sm fm-p-1.5 fm-ml-auto fm-inline-flex fm-items-center dark:hover:fm-bg-gray-600 dark:hover:fm-text-white",onClick:M[1]||(M[1]=T=>b(e).togglePostsPopup())},UX)]),m("div",qX,[m("div",WX,[m("div",KX,[w.value&&w.value.length>0?(k(),_("div",GX,[g.value?(k(),_("div",JX,[YX,g.value.length>0&&u.value?(k(),xe(b(Qv),{key:0,modelValue:b(n).pageContext.acf.content[c.value].settings[l.value],"onUpdate:modelValue":M[2]||(M[2]=T=>b(n).pageContext.acf.content[c.value].settings[l.value]=T),class:"fm-flex fm-gap-2 fm-flex-wrap"},{default:qe(()=>[(k(!0),_(ce,null,Oe(g.value,T=>(k(),_("div",{key:"selected-post-"+T.ID,class:"fm-cursor-grab"},[m("div",XX,[m("span",{innerHTML:d.value?S(T):T.post_title},null,8,ZX),m("button",{onClick:A=>v(T)},tZ,8,QX)])]))),128))]),_:1},8,["modelValue"])):g.value.length>0&&!u.value?(k(),xe(b(Qv),{key:1,modelValue:b(n).pageContext.acf.content[c.value][l.value],"onUpdate:modelValue":M[3]||(M[3]=T=>b(n).pageContext.acf.content[c.value][l.value]=T),class:"fm-flex fm-gap-2 fm-flex-wrap"},{default:qe(()=>[(k(!0),_(ce,null,Oe(g.value,T=>(k(),_("div",{key:"selected-post-"+T.ID,class:"fm-cursor-grab"},[m("div",nZ,[m("span",{innerHTML:d.value?S(T):T.post_title},null,8,rZ),m("button",{onClick:A=>v(T)},iZ,8,oZ)])]))),128))]),_:1},8,["modelValue"])):(k(),_("div",aZ,[m("div",lZ,[m("div",cZ,[m("span",{innerHTML:d.value?S(g.value):g.value.post_title},null,8,uZ),m("button",{onClick:M[4]||(M[4]=T=>v(g.value))},fZ)])])]))])):L("",!0)])):L("",!0),m("div",hZ,[b(e).getPostLibraryLoading?(k(),_("div",pZ,[Z(Gg)])):L("",!0),m("ul",mZ,[(k(!0),_(ce,null,Oe(w.value,T=>(k(),_("li",{key:"post-type-"+T.name,class:"fm-w-full"},[m("div",gZ,ve(T.name),1),m("ul",null,[(k(!0),_(ce,null,Oe(T.items,A=>(k(),_("li",{key:"post-"+A.ID,class:H(["fm-w-full fm-border-b fm-border-gray-200 dark:fm-border-gray-600 fm-cursor-pointer hover:fm-bg-blue-100/50",[x(A)?"fm-bg-blue-100/30":"",p.value&&!x(A)?"fm-opacity-50 fm-pointer-events-none":""]])},[A.is_tax?(k(),_("div",yZ,[m("input",{type:"checkbox",id:A.name+"-"+A.taxonomy,onChange:N=>C(A),value:A.term_id,checked:x(A),class:"fm-w-4 fm-h-4 fm-cursor-pointer fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded focus:fm-ring-blue-500 dark:fm-focus:ring-blue-600 dark:fm-ring-offset-gray-700 dark:focus:fm-ring-offset-gray-700 focus:fm-ring-2 dark:fm-bg-gray-600 dark:fm-border-gray-500"},null,40,vZ),m("label",{for:A.name+"-"+A.taxonomy,class:"fm-w-full fm-cursor-pointer fm-py-3 fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300"},ve(A.name),9,bZ)])):(k(),_("div",wZ,[m("input",{type:"checkbox",id:A.post_name+"-"+A.post_type,onChange:N=>C(A),value:A.ID,checked:x(A),class:"fm-w-4 fm-h-4 fm-cursor-pointer fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded focus:fm-ring-blue-500 dark:fm-focus:ring-blue-600 dark:fm-ring-offset-gray-700 dark:focus:fm-ring-offset-gray-700 focus:fm-ring-2 dark:fm-bg-gray-600 dark:fm-border-gray-500"},null,40,kZ),m("label",{for:A.post_name+"-"+A.post_type,class:"fm-w-full fm-cursor-pointer fm-py-3 fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300"},ve(A.post_title),9,xZ)]))],2))),128))])]))),128))])])])])])])]),m("div",{class:"fm-bg-black fm-opacity-30 fm-absolute fm-top-0 fm-left-0 fm-w-full fm-h-full",onClick:M[5]||(M[5]=T=>b(e).togglePostsPopup())})],2))}}),_Z="0.5.3",Y8={__name:"FlowmateEditablesVersion",setup(t){return(e,n)=>(k(),_("span",null,ve(b(_Z)),1))}},SZ="0.4.9",X8={__name:"FlowmateVersion",setup(t){return(e,n)=>(k(),_("span",null,ve(b(SZ)),1))}},MZ={class:"fm-flex fm-flex-row fm-justify-between"},TZ={class:"fm-flex fm-flex-col fm-pb-3"},EZ=m("p",{class:"fm-text-xs fm-font-bold fm-text-gray-500 dark:fm-text-gray-400"}
10,"Flowmate Debugger",-1),AZ={key:0,class:"fm-text-xs fm-font-bold fm-text-gray-700 dark:fm-text-gray-300"},OZ={class:"fm-text-xs"},IZ=m("span",null,"Flowmate v. ",-1),NZ={class:"fm-text-xs"},LZ=m("span",null,"Flowmate Editables v. ",-1),RZ={key:0},$Z={key:1},DZ={class:"fm-flex fm-flex-col fm-h-72"},PZ={class:"fm-flex fm-flex-row fm-justify-between"},HZ={key:0,class:"fm-flex fm-flex-col fm-w-1/4"},BZ=m("p",{class:"fm-text-xs fm-font-bold fm-text-gray-500 dark:fm-text-gray-400"},"Full context:",-1),FZ={class:"fm-flex fm-flex-col fm-h-64 fm-overflow-y-scroll"},jZ={class:"fm-text-xs fm-text-gray-700 dark:fm-text-gray-300"},zZ={key:1,class:"fm-flex fm-flex-col fm-w-1/4"},VZ=m("p",{class:"fm-text-xs fm-font-bold fm-text-gray-500 dark:fm-text-gray-400"},"Flex content:",-1),UZ={class:"fm-flex fm-flex-col fm-h-64 fm-overflow-y-scroll"},qZ={class:"fm-text-xs fm-text-gray-700 dark:fm-text-gray-300"},WZ={class:"fm-flex fm-flex-col fm-w-1/4"},KZ=m("p",{class:"fm-text-xs fm-font-bold fm-text-gray-500 dark:fm-text-gray-400"},"Options:",-1),GZ={class:"fm-flex fm-flex-col fm-h-64 fm-overflow-y-scroll"},JZ={class:"fm-text-xs fm-text-gray-700 dark:fm-text-gray-300"},YZ={class:"fm-flex fm-flex-col fm-w-1/4"},XZ=m("p",{class:"fm-text-xs fm-font-bold fm-text-gray-500 dark:fm-text-gray-400"},"Config:",-1),ZZ={class:"fm-flex fm-flex-col fm-h-64 fm-overflow-y-scroll"},QZ={class:"fm-text-xs fm-text-gray-700 dark:fm-text-gray-300"},eQ=Ne({__name:"FlowmateDebugger",setup(t){const e=zr();$l(),vu();const n=li(),{toggleNavigation:r}=Mu(),o=lt();return(s,i)=>(k(),_("div",{key:0,class:H(["fm-fixed fm-bottom-0 fm-right-0 fm-flex fm-flex-col fm-justify-between fm-w-full fm-p-4 fm-bg-gray-100 dark:fm-bg-gray-800 fm-shadow-lg fm-z-50",b(n).getOpenStatus("","debugger")?"fm-h-96":"fm-h-14"])},[m("div",MZ,[m("div",TZ,[EZ,b(n).getOpenStatus("","debugger")?(k(),_("p",AZ,[m("div",OZ,[IZ,Z(X8)]),m("div",NZ,[LZ,Z(Y8)])])):L("",!0)]),m("div",{class:"fm-text-xs fm-font-bold fm-text-gray-700 dark:fm-text-gray-300 focus:fm-outline-none fm-cursor-pointer fm-inline",onClick:i[0]||(i[0]=a=>b(r)(null,"debugger"))},[b(n).getOpenStatus("","debugger")?(k(),_("span",RZ,"Hide")):(k(),_("span",$Z,"Show"))])]),m("div",DZ,[m("div",PZ,[b(o).pageContext&&b(o).pageContext.id?(k(),_("div",HZ,[BZ,m("div",FZ,[m("pre",jZ,"              "+ve(b(o).pageContext)+`
11            `,1)])])):L("",!0),b(o).pageContext&&b(o).pageContext.id?(k(),_("div",zZ,[VZ,m("div",UZ,[m("pre",qZ,"              "+ve(b(o).pageContext.acf.content)+`
12            `,1)])])):L("",!0),m("div",WZ,[KZ,m("div",GZ,[m("pre",JZ,"              "+ve(b(o).getOptions)+`
13            `,1)])]),m("div",YZ,[XZ,m("div",ZZ,[m("pre",QZ,"              "+ve(b(e).getConfig)+`
14            `,1)])])])])],2))}}),tQ={class:"fm-top-0 fm-p-4 fm-left-64 fm-bg-gray-100 fm-h-full fm-min-w-[250px] fm-z-10 dark:fm-bg-gray-900 dark:fm-border-gray-700 fm-overflow-scroll"},nQ={key:0},rQ=["onClick"],oQ=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1),sQ=[oQ],iQ={class:"fm-p-3 fm-py-4 fm-w-fill fm-w-fill-moz"},aQ=["src"],lQ=["innerHTML"],cQ={class:"fm-p-6 fm-text-center"},uQ=m("svg",{"aria-hidden":"true",class:"fm-mx-auto fm-mb-4 fm-text-gray-400 fm-w-14 fm-h-14 dark:fm-text-gray-200",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),dQ=m("h3",{class:"fm-mb-5 fm-text-lg fm-font-normal fm-text-gray-500 dark:fm-text-gray-400"},"Are you sure you want to remove this block?",-1),fQ={class:"fm-flex fm-flex-col fm-gap-2"},hQ=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),pQ=m("span",null,"Add block",-1),mQ=[hQ,pQ],gQ={class:"fm-flex fm-gap-4 fm-flex-wrap"},yQ=["onClick"],vQ=["src"],bQ=["innerHTML"],wQ=Ne({__name:"FlowmateFlexOrganizer",setup(t){ih();const e=zr(),n=lt();Dk();const r=pe(null),o=pe(!1),s=U(()=>o),i=pe(!1),a=U(()=>i),l=u=>{r.value=u,u!==null&&(o.value=!0)},c=(u,d,f)=>{const h=e.getConfig;return h&&h[d]&&h[d][u.acf_fc_layout]?h[d][u.acf_fc_layout][f]:u.acf_fc_layout};return(u,d)=>(k(),_("div",null,[m("div",tQ,[b(n).pageContext&&b(n).pageContext.
14id?(k(),_("div",nQ,[Z(b(Qv),{modelValue:b(n).pageContext.acf.content,"onUpdate:modelValue":d[0]||(d[0]=f=>b(n).pageContext.acf.content=f),"ghost-class":"fm-bg-gray-300"},{default:qe(()=>[(k(!0),_(ce,null,Oe(b(n).pageContext.acf.content,(f,h)=>(k(),_("div",{class:"fm-mb-2 fm-text-center fm-gap-2 fm-flex fm-relative fm-justify-between fm-cursor-grab fm-rounded-lg fm-bg-white dark:fm-bg-gray-800 dark:fm-text-white",key:"flex-"+h},[(k(),_("svg",{onClick:p=>l(h),"aria-label":"Delete block",title:"Delete block",fill:"none",class:"fm-absolute fm-top-2 fm-right-2 fm-w-4 fm-h-4 fm-cursor-pointer",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},sQ,8,rQ)),m("div",iQ,[m("img",{class:"fm-max-w-[250px]",src:c(f,"config","preview"),alt:""},null,8,aQ),m("p",{class:"fm-text-base fm-font-bold",innerHTML:c(f,"data_models","acf_fc_label")},null,8,lQ)])]))),128))]),_:1},8,["modelValue"]),Z(wf,{removeCloseButton:!0,open:s.value},{default:qe(()=>[m("div",cQ,[uQ,dQ,m("button",{onClick:d[1]||(d[1]=f=>(b(n).removeBlock(r.value),o.value=!1)),type:"button",class:"fm-text-base fm-text-white fm-bg-red-600 hover:fm-bg-red-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-red-300 dark:focus:fm-ring-red-800 fm-font-medium fm-rounded-lg fm-text-sm fm-inline-flex fm-items-center fm-px-5 fm-py-2.5 fm-text-center fm-mr-2"}," Yes, I'm sure "),m("button",{onClick:d[2]||(d[2]=f=>o.value=!1),type:"button",class:"fm-text-base fm-text-gray-500 fm-bg-white hover:fm-bg-gray-100 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-gray-200 fm-rounded-lg fm-border fm-border-gray-200 fm-text-sm fm-font-medium fm-px-5 fm-py-2.5 hover:fm-text-gray-900 focus:fm-z-10 dark:fm-bg-gray-700 dark:fm-text-gray-300 dark:fm-border-gray-500 dark:hover:fm-text-white dark:hover:fm-bg-gray-600 dark:focus:fm-ring-gray-600"},"No, cancel")])]),_:1},8,["open"])])):L("",!0),m("div",fQ,[b(e).getConfig.data_models?(k(),_("button",{key:0,onClick:d[3]||(d[3]=f=>i.value=!i.value),type:"button",class:"fm-mt-4 fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},mQ)):L("",!0)])]),Z(wf,{title:"Available blocks",open:a.value},{default:qe(()=>
14[m("div",gQ,[(k(!0),_(ce,null,Oe(b(e).getConfig.config,f=>(k(),_("div",{onClick:h=>(b(n).addFlexBlock(f.acf_fc_layout,b(e).getConfig),i.value=!1),class:H([[f.preview?"":"fm-py-8 !fm-pb-8",b(n).isBlockAvailable(f.acf_fc_layout)?"":"fm-opacity-30 fm-pointer-events-none"],"fm-w-[calc(25%-0.75rem)] fm-gap-2 fm-p-2 fm-bg-white fm-rounded-xl fm-flex fm-flex-col fm-justify-center fm-items-center fm-pb-4 fm-cursor-pointer fm-duration-200 fm-border-2 hover:fm-border-gray-400"])},[f.preview?(k(),_("img",{key:0,src:f.preview},null,8,vQ)):L("",!0),m("span",{innerHTML:f.acf_fc_label},null,8,bQ)],10,yQ))),256))])]),_:1},8,["open"])]))}}),kQ=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.53 16.122a3 3 0 00-5.78 1.128 2.25 2.25 0 01-2.4 2.245 4.5 4.5 0 008.4-2.245c0-.399-.078-.78-.22-1.128zm0 0a15.998 15.998 0 003.388-1.62m-5.043-.025a15.994 15.994 0 011.622-3.395m3.42 3.42a15.995 15.995 0 004.764-4.648l3.876-5.814a1.151 1.151 0 00-1.597-1.597L14.146 6.32a15.996 15.996 0 00-4.649 4.763m3.42 3.42a6.776 6.776 0 00-3.42-3.42"},null,-1),xQ=[kQ],CQ=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1),_Q=[CQ],SQ=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"},null,-1),MQ=[SQ],TQ=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"},null,-1),EQ=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),AQ=[TQ,EQ],OQ=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z"},null,-1),IQ=[OQ],NQ=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 16.5V9.75m0 0l3 3m-3-3l-3 3M6.75 19.5a4.5 4.5 0 01-1.41-8.775 5.25 5.25 0 0110.233-2.33 3 3 0 013.758 3.848A3.752 3.752 0 0118 19.5H6.75z"},null,-1),LQ=[NQ],RQ=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"},null,-1),$Q=[RQ],DQ=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.217 10.9
1407a2.25 2.25 0 100 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186l9.566-5.314m-9.566 7.5l9.566 5.314m0 0a2.25 2.25 0 103.935 2.186 2.25 2.25 0 00-3.935-2.186zm0-12.814a2.25 2.25 0 103.933-2.185 2.25 2.25 0 00-3.933 2.185z"},null,-1),PQ=[DQ],HQ={key:8,class:"-fm-top-1 fm-left-8 fm-absolute fm-w-3.5 fm-h-3.5 fm-bg-green-400 fm-border-2 fm-border-white dark:fm-border-gray-800 fm-rounded-full"},BQ={class:"fm-sr-only"},jd=Ne({__name:"FlowmateIconButton",props:{size:{type:String,default:"md",validator:t=>["sm","md","lg"].includes(t)},type:{type:String,default:"primary",validator:t=>["primary","secondary","alert","warning","active"].includes(t)},icon:{type:String,required:!0,validator:t=>["trash","paint-brush","pencil-square","eye","collaborate","search","upload","share"].includes(t)},active:{type:Boolean,default:!1},description:{type:String,default:""}},setup(t){const e=t,n=U(()=>({"fm-w-4 fm-h-4":e.size==="sm","fm-w-5 fm-h-5":e.size==="md","fm-w-6 fm-h-6":e.size==="lg"})),r=U(()=>({"fm-p-2":e.size==="sm","fm-p-2.5":e.size==="md","fm-p-3":e.size==="lg","fm-bg-blue-700 hover:fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 dark:fm-bg-blue-600 dark:hover:fm-bg-blue-700 dark:focus:fm-ring-blue-800":e.type==="primary","fm-text-gray-900 focus:fm-outline-none fm-bg-white fm-rounded-lg fm-border fm-border-gray-200 hover:fm-bg-gray-100 hover:fm-text-blue-700 focus:fm-z-10 focus:fm-ring-4 focus:fm-ring-gray-200 dark:focus:fm-ring-gray-700 dark:fm-bg-gray-800 dark:fm-text-gray-400 dark:fm-border-gray-600 dark:hover:fm-text-white dark:hover:fm-bg-gray-700":e.type==="secondary","fm-bg-red-600 hover:fm-bg-red-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-red-300 dark:fm-bg-red-600 dark:hover:fm-bg-red-700 dark:focus:fm-ring-red-800":e.type==="alert","fm-bg-yellow-400 hover:fm-bg-yellow-500 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-yellow-300 dark:fm-bg-yellow-500 dark:hover:fm-bg-yellow-600 dark:focus:fm-ring-yellow-800":e.type==="warning"})),o=U(()=>e.description),{show:s,showTooltip:i,hideTooltip:a}=xo();return(l,c)=>(k(),_("button",{type:"button",class:H(["fm-text-white fm-font-medium fm-rounded-lg fm-text-sm fm-text-center fm-inline-flex fm-items-center fm-relative",r.value]),onMouseenter:c[0]||(c[0]=(...u)=>b(i)&&b(i)(...u)),onMouseleave:c[1]||(c[1]=(...u)=>b(a)&&b(a)(...u))},[t.icon==="paint-brush"?(k(),_("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:H(n.value)},xQ,2)):L("",!0),t.icon==="trash"?(k(),_("svg",{key:1,"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:H(n.value)},_Q,2)):L("",!0),t.icon==="pencil-square"?(k(),_("svg",{key:2,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:H(n.value)},MQ,2)):L("",!0),t.icon==="eye"?(k(),_("svg",{key:3,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:H(n.value)},AQ,2)):L("",!0),t.icon==="collaborate"?(k(),_("svg",{key:4,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:H(n.value)},IQ,2)):L("",!0),t.icon==="upload"?(k(),_("svg",{key:5,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:H(n.value)},LQ,2)):L("",!0),t.icon==="search"?(k(),_("svg",{key:6,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:H(n.value)},$Q,2)):L("",!0),t.icon==="share"?(k(),_("svg",{key:7,fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:H(n.value)},PQ,2)):L("",!0),t.active?(k(),_("span",HQ)):L("",!0),m("span",BQ,ve(t.description),1),Z(ko,{text:o.value,show:b(s)},null,8,["text","show"])],34))}}),FQ={class:"fm-top-0 fm-px-4 fm-pt-4 fm-left-64 fm-bg-gray-100 fm-h-full fm-w-[750px] fm-overflow-y-scroll fm-z-10 dark:fm-bg-gray-900 dark:fm-border-gray-700"},jQ={class:"fm-relative"},zQ={key:0,class:"fm-absolute fm-w-full fm-h-full fm-min-h-[80vh] fm-flex fm-items-center fm-justify-center"},VQ={key:1,class:"fm-w-full fm-text-sm fm-text-left fm-text-gray-500 dark:fm-text-gray-400"},UQ=m("thead",{class:"fm-text-xs fm-text-gray-700 fm-uppercase fm-bg-gray-50 dark:fm-bg-gray-700 dark:fm-text-gray-400"},[m("tr",null,[m("th",{scope:"col",class:"fm-px-6 fm-py-3"}," ID "),m("th",{scope:"col",class:"fm-px-6 fm-py-3"}," Updated "),m("th",{scope:"col",class:"fm-px-6 fm-py-3"}," Author "),m("th",{scope:"col",class:"fm-px-6 fm-py-3"}," Collaboration "),m("th",{scope:"col",class:"fm-px-6 fm-py-3 fm-text-right"}," Actions ")])],-1),qQ={scope:"row",class:"fm-px-6 fm-py-4 fm-font-medium fm-text-gray-900 fm-whitespace-nowrap dark:fm-text-white"},WQ={class:"fm-px-6 fm-py-4"},KQ={class:"fm-px-6 fm-py-4"},GQ={class:"fm-px-6 fm-py-4"},JQ={key:0,class:"fm-inline-flex fm-items-center fm-bg-green-100 fm-text-green-800 fm-text-xs fm-font-medium fm-px-2.5 fm-py-0.5 fm-rounded-full dark:fm-bg-green-900 dark:fm-text-green-300"},YQ=m("span",{class:"fm-w-2 fm-h-2 fm-mr-1 fm-bg-green-500 fm-rounded-full"},null,-1),XQ={key:1,class:"fm-inline-flex fm-items-center fm-bg-red-100 fm-text-red-800 fm-text-xs fm-font-medium fm-px-2.5 fm-py-0.5 fm-rounded-full dark:fm-bg-red-900 dark:fm-text-red-300"},ZQ=m("span",{class:"fm-w-2 fm-h-2 fm-mr-1 fm-bg-red-500 fm-rounded-full"},null,-1),QQ={class:"fm-px-6 fm-py-4 fm-flex fm-justify-end fm-gap-2"},eee={class:"fm-p-6 fm-text-center"},tee=m("svg",{"aria-hidden":"true",class:"fm-mx-auto fm-mb-4 fm-text-gray-400 fm-w-14 fm-h-14 dark:fm-text-gray-200",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),nee=m("h3",{class:"fm-mb-5 fm-text-lg fm-font-normal fm-text-gray-500 dark:fm-text-gray-400"},"Are you sure you want to delete this revision?",-1),ree=Ne({__name:"FlowmateRevisionManager",props:["contextId"],setup(t){const e=t,n=pe(null),r=pe(!1),o=U(()=>r),{writeMessage:s}=ro(),i=C=>{n.value=C,C!==null&&(r.value=!0)},{revisions:a,loading:l,deleteRevision:c,getCurrentRevisionId:u}=$r(e.contextId),{toggleNavigation:d}=Mu(),f=_r(),h=lt(),p=He("revisions.delete").isEnabled(),g=He("revisions.read").isEnabled();U(()=>h.getBackdrop);const y=C=>{n6(C).then(()=>{s("Link was copied to your clipboard.",null,"success")})},w=async C=>{await c(C),a.value.forEach((v,S)=>{v.id===C&&a.value.splice(S,1)})},x=async(C,v)=>{console.log("showing revision ... "+C," for post "+v);const S="#/design/"+v+"/revisions/"+C;f.goTo(S),d("left","revisions")};return(C,v)=>(k(),_("div",FQ,[m("div",jQ,[b(l)?(k(),_("div",zQ,[Z(Gg)])):L("",!0),b(l)?L("",!0):(k(),_("table",VQ,[UQ,m("tbody",null,[(k(!0),_(ce,null,Oe(b
14(a),(S,E)=>(k(),_("tr",{key:"revision-"+E,class:"fm-bg-white fm-border-b dark:fm-bg-gray-800 dark:fm-border-gray-700"},[m("th",qQ,ve(S.id),1),m("td",WQ,ve(S.updated_at),1),m("td",KQ,ve(S.user_id),1),m("td",GQ,[S.status==="collaborate"?(k(),_("span",JQ,[YQ,Le(" Active ")])):(k(),_("span",XQ,[ZQ,Le(" Inactive ")]))]),m("td",QQ,[parseInt(S.share_id)!==0?(k(),xe(jd,{key:0,onClick:nt(M=>y(b(h).getOptions.frontend+"/#/share/"+S.share_id),["stop","prevent"]),icon:"share",size:"md",type:"primary",description:"Share revision"},null,8,["onClick"])):L("",!0),b(p)?(k(),xe(jd,{key:1,onClick:nt(M=>i(S.id),["stop","prevent"]),icon:"trash",size:"md",type:"alert",description:"Delete revision #"+S.id},null,8,["onClick","description"])):L("",!0),b(g)?(k(),xe(jd,{key:2,onClick:nt(M=>x(S.id,S.post_id),["stop"]),icon:"eye",size:"md",active:S.id===b(u)(),type:"warning",description:"Show revision #"+S.id},null,8,["onClick","active","description"])):L("",!0)])]))),128))])])),Z(wf,{removeCloseButton:!0,open:o.value},{default:qe(()=>[m("div",eee,[tee,nee,m("button",{onClick:v[0]||(v[0]=S=>(w(n.value),r.value=!1)),type:"button",class:"fm-text-white fm-bg-red-600 hover:fm-bg-red-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-red-300 dark:focus:fm-ring-red-800 fm-font-medium fm-rounded-lg fm-text-sm fm-inline-flex fm-items-center fm-px-5 fm-py-2.5 fm-text-center fm-mr-2"}," Yes, I'm sure "),m("button",{onClick:v[1]||(v[1]=S=>r.value=!1),type:"button",class:"fm-text-gray-500 fm-bg-white hover:fm-bg-gray-100 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-gray-200 fm-rounded-lg fm-border fm-border-gray-200 fm-text-sm fm-font-medium fm-px-5 fm-py-2.5 hover:fm-text-gray-900 focus:fm-z-10 dark:fm-bg-gray-700 dark:fm-text-gray-300 dark:fm-border-gray-500 dark:hover:fm-text-white dark:hover:fm-bg-gray-600 dark:focus:fm-ring-gray-600"},"No, cancel")])]),_:1},8,["open"])])]))}}),oee={key:0,id:"logo-sidebar",class:"fm-flex flex-row fm-fixed fm-top-0 fm-left-0 fm-z-40 fm-h-screen fm-pt-[59px] fm-transition-transform fm--translate-x-full fm-bg-white fm-border-r fm-border-gray-200 sm:fm-translate-x-0 dark:fm-bg-gray-800 dark:fm-border-gray-700","aria-label":"Sidebar"},see=ps('<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="fm-w-4 fm-h-4"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5L8.25 12l7.5-7.5"></path></svg><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="fm-w-4 fm-h-4"><path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5"></path></svg><span class="fm-sr-only">Collapse / Expand sidebar</span>',3),iee={class:"fm-space-y-2"},aee={key:0},lee=m("svg",{"aria-hidden":"true",class:"fm-w-6 fm-h-6 fm-text-gray-500 fm-transition fm-duration-75 dark:fm-text-gray-400 group-hover:fm-text-gray-900 dark:group-hover:fm-text-white",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{d:"M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"}),m("path",{d:"M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"})],-1),cee={key:1},uee=m("svg",{"aria-hidden":"true",class:"fm-w-6 fm-h-6 fm-text-gray-500 fm-transition fm-duration-75 dark:fm-text-gray-400 group-hover:fm-text-gray-900 dark:group-hover:fm-text-white",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[m("path",{d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z","stroke-linecap":"round","stroke-linejoin":"round"})],-1),dee={key:2},fee=m("svg",{xmlns:"http://www.w3.org/2000/svg",class:"fm-w-6 fm-h-6 fm-text-gray-500 fm-transition fm-duration-75 dark:fm-text-gray-400 group-hover:fm-text-gray-900 dark:group-hover:fm-text-white",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"})],-1),hee={key:3},pee=m("svg",{xmlns:"http://www.w3.org/2000/svg",class:"fm-w-6 fm-h-6 fm-text-gray-500 fm-transition fm-duration-75 dark:fm-text-gray-400 group-hover:fm-text-gray-900 dark:group-hover:fm-text-white",f
14ill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"})],-1),mee=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.827 6.175A2.31 2.31 0 015.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 00-1.134-.175 2.31 2.31 0 01-1.64-1.055l-.822-1.316a2.192 2.192 0 00-1.736-1.039 48.774 48.774 0 00-5.232 0 2.192 2.192 0 00-1.736 1.039l-.821 1.316z"}),m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 12.75a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0zM18.75 10.5h.008v.008h-.008V10.5z"})],-1),gee={class:"fm-text-xs"},yee=m("span",null,"Flowmate v. ",-1),vee={class:"fm-text-xs"},bee=m("span",null,"Flowmate Editables v. ",-1),wee=Ne({__name:"FlowmateNavigation",setup(t){const e=li();vu();const{toggleNavigation:n}=Mu(),r=lt(),{goTo:o,currentRoute:s}=_r(),{contextId:i}=Hr(),{initMediaLibrary:a}=ih();Ye(()=>e.getOpenStatuses,N=>{(N.left.organizer||N.left.revisions)&&r.setBackdrop(!0),!N.left.organizer&&!N.left.revisions&&r.setBackdrop(!1)},{deep:!0}),Ye(()=>r.getBackdrop,N=>{N||(e.getOpenStatuses.left.organizer&&n("left","organizer"),e.getOpenStatuses.left.revisions&&n("left","revisions"))});const{show:l,showTooltip:c,hideTooltip:u}=xo(),{show:d,showTooltip:f,hideTooltip:h}=xo(),{show:p,showTooltip:g,hideTooltip:y}=xo(),{show:w,showTooltip:x,hideTooltip:C}=xo(),{show:v,showTooltip:S,hideTooltip:E}=xo(),{show:M,showTooltip:T,hideTooltip:A}=xo();return(N,D)=>b(He)("revisions").isEnabled()||b(He)("design").isEnabled()||b(He)("collaborate").isEnabled()?(k(),_("aside",oee,[m("div",{class:H([{"fm-w-64":b(e).getOpenStatus("left","main")},"fm-h-full fm-relative fm-z-40 fm-pt-4 fm-px-3 fm-pb-4 fm-overflow-visible fm-bg-white dark:fm-bg-gray-800 fm-relative"])},[m("button",{onClick:D[0]||(D[0]=nt($=>b(n)("left","main"),["stop"])),type:"button",class:"fm-absolute fm-right-[-13px] fm-w-[26px] fm-top-6 fm-flex fm-items-center fm-p-1 fm-text-xs fm-font-medium fm-text-gray-700 fm-bg-white fm-border fm-border-gray-200 fm-rounded-full hover:fm-bg-gray-100 hover:fm-text-blue-700 focus:fm-z-10 focus:fm-ring-2 focus:fm-ring-gray-300 dark:focus:fm-ring-gray-500 dark:fm-bg-gray-800 focus:fm-outline-none dark:fm-text-gray-400 dark:fm-border-gray-600 dark:hover:fm-text-white dark:hover:fm-bg-gray-700",onMouseenter:D[1]||(D[1]=(...$)=>b(T)&&b(T)(...$)),onMouseleave:D[2]||(D[2]=(...$)=>b(A)&&b(A)(...$))},[see,Z(ko,{text:b(e).getOpenStatus("left","main")?"Collapse sidebar":"Expand Sidebar",show:b(M)},null,8,["text","show"])],32),m("ul",iee,[b(He)("dashboard").isEnabled()?(k(),_("li",aee,[m("a",{onClick:D[3]||(D[3]=nt($=>b(o)("#/dashboard"),["stop","prevent"])),href:"#/dashboard",class:"fm-flex fm-items-center fm-cursor-pointer fm-p-2 fm-text-base fm-font-normal fm-text-gray-900 fm-rounded-lg dark:fm-text-white hover:fm-bg-gray-100 dark:hover:fm-bg-gray-700 fm-relative",onMouseenter:D[4]||(D[4]=(...$)=>b(c)&&b(c)(...$)),onMouseleave:D[5]||(D[5]=(...$)=>b(u)&&b(u)(...$))},[lee,m("span",{class:H([{"fm-hidden":!b(e).getOpenStatus("left","main")},"fm-ml-3 fm"])},"Dashboard",2),Z(ko,{text:"Dashboard",show:b(l)},null,8,["show"])],32)])):L("",!0),b(He)("content").isEnabled()?(k(),_("li",cee,[m("a",{onClick:D[6]||(D[6]=nt($=>b(o)("#/content"),["stop","prevent"])),class:"fm-flex fm-items-center fm-cursor-pointer fm-p-2 fm-text-base fm-font-normal fm-text-gray-900 fm-rounded-lg dark:fm-text-white hover:fm-bg-gray-100 dark:hover:fm-bg-gray-700 fm-relative",onMouseenter:D[7]||(D[7]=(...$)=>b(f)&&b(f)(...$)),onMouseleave:D[8]||(D[8]=(...$)=>b(h)&&b(h)(...$))},[uee,m("span",{class:H([{"fm-hidden":!b(e).getOpenStatus("left","main")},"fm-ml-3 fm"])},"Content",2),Z(ko,{text:"Content",show:b(d)},null,8,["show"])],32)])):L("",!0),b(He)("design").isEnabled()&&(b(s).path.includes("#/design")||b(s).path.includes("#/collaborate"))?(k(),_("li",dee,[m("a",{onClick:D[9]||(D[9]=nt($=>b(n)("left","organizer"),["stop","prevent"])),href:"#",class:H([{"fm-bg-gray-100 dark:fm-bg-gray-700":b(e).getOpenStatus("left","organizer")},"fm-flex fm-items-center fm-p-2 fm-text-base fm-font-normal fm-text-gray-900 fm-rounded-lg dark:fm-text-white hover:fm-bg-gray-100 dark:hover:fm-bg-gray-700 fm-relative"]),onMouseenter:D[10]||(D[10]=(...$)=>b(g)&&b(g)(...$)),onMouseleave:D[11]||(D[11]=(...$)=>b(y)&&b(y)(...$))},[fee,m("span",{class:H([{"fm-hidden":!b(e).getOpenStatus("left","main")},"fm-ml-3"])},"Design",2),Z(ko,{text:"Design",show:b(p)},null,8,["show"])],34)])):L("",!0),b(He)("revisions").isEnabled()&&b(s).path.includes("#/design")?(k(),_("li",hee,[m("a",{onClick:D[12]||(D[12]=nt($=>b(n)("left","revisions"),["stop","prevent"])),href:"#",class:H([{"fm-bg-gray-100 dark:fm-bg-gray-700":b(e).getOpenStatus("left","revisions")},"fm-flex fm-items-center fm-p-2 fm-text-base fm-font-normal fm-text-gray-900 fm-rounded-lg dark:fm-text-white hover:fm-bg-gray-100 dark:hover:fm-bg-gray-700 fm-relative"]),onMouseenter:D[13]||(D[13]=(...$)=>b(x)&&b(x)(...$)),onMouseleave:D[14]||(D[14]=(...$)=>b(C)&&b(C)(...$))},[pee,m("span",{class:H([{"fm-hidden":!b(e).getOpenStatus("left","main")},"fm-ml-3"])},"Revisions",2),Z(ko,{text:"Revision",show:b(w)},null,8,["show"])],34)])):L("",!0),m("li",null,[m("a",{onClick:D[15]||(D[15]=nt($=>b(a)(null,null,null,"any"),["stop","prevent"])),href:"#",class:H([{"fm-bg-gray-100 dark:fm-bg-gray-700":b(e).getOpenStatus("left","revisions")},"fm-flex fm-items-center fm-p-2 fm-text-base fm-font-normal fm-text-gray-900 fm-rounded-lg dark:fm-text-white hover:fm-bg-gray-100 dark:hover:fm-bg-gray-700 fm-relative"]),onMouseenter:D[16]||(D[16]=(...$)=>b(S)&&b(S)(...$)),onMouseleave:D[17]||(D[17]=(...$)=>b(E)&&b(E)(...$))},[mee,m("span",{class:H(["fm-ml-3",{"fm-hidden":!b(e).getOpenStatus("left","main")}])},"Media library",2),Z(ko,{text:"Media Library",show:b(v)},null,8,["show"])],34)])]),m("div",{class:H(["fm-absolute fm-bottom-3 fm-left-3",{"fm-hidden":!b(e).getOpenStatus("left","main")}])}
14,[m("div",gee,[yee,Z(X8)]),m("div",vee,[bee,Z(Y8)])],2)],2),Ie(Z(wQ,null,null,512),[[Pn,b(e).getOpenStatus("left","organizer")]]),b(e).getOpenStatus("left","revisions")&&b(i)?(k(),xe(ree,{key:0,"context-id":b(i)},null,8,["context-id"])):L("",!0)])):L("",!0)}}),kee={class:"fm-fixed fm-flex fm-items-center fm-w-full fm-h-[100%] fm-z-50 fm-bg-white"},xee={key:0,class:"fm-w-1/4 fm-mx-auto fm-p-4"},Cee=m("h3",{class:"fm-mb-4 fm-text-2xl fm-text-gray-900 dark:fm-text-white"},"Sign in",-1),_ee={class:"fm-mb-6"},See=m("label",{for:"email",class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"Your email or username.",-1),Mee={class:"fm-mb-6"},Tee=m("label",{for:"password",class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"Your password",-1),Eee={key:0,class:"fm-mt-8"},Aee=m("div",{class:"fm-mb-6"},[m("hr",{class:"fm-mb-6 fm-mx-1"}),m("h3",null,"Or sign in as guest by providing your name")],-1),Oee={class:"fm-mb-6"},Iee=m("label",{for:"guest",class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"Your name",-1),Nee=["onClick","disabled"],Lee={key:1,fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},Ree=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0012 15.75a7.488 7.488 0 00-5.982 2.975m11.963 0a9 9 0 10-11.963 0m11.963 0A8.966 8.966 0 0112 21a8.966 8.966 0 01-5.982-2.275M15 9.75a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),$ee=[Ree],Dee=m("span",null,"Login",-1),Pee={key:1,class:"fm-w-1/4 fm-mx-auto fm-p-4"},Hee={class:"fm-mb-6"},Bee=m("label",{for:"password",class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"Password",-1),Fee=["onClick","disabled"],jee={key:1,fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},zee=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0012 15.75a7.488 7.488 0 00-5.982 2.975m11.963 0a9 9 0 10-11.963 0m11.963 0A8.966 8.966 0 0112 21a8.966 8.966 0 01-5.982-2.275M15 9.75a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),Vee=[zee],Uee=m("span",null,"Login",-1),qee=Ne({__name:"FlowmateLogin",setup(t){Qt();const{getCurrentRevision:e}=$r(),{currentRoute:n,redirect:r}=_r(),o=lt(),s=as(),i=_s(),{auth:a,authGuest:l,authVisitor:c}=Pc(),u=pe({email:"",password:"",guest:""}),d=pe(!1),f=U(()=>n.value.hasOwnProperty("params")&&n.value.params.get("redirect")?n.value.params.get("redirect"):null),h=async()=>{const y=e();await c(y.share_token,u.value.password)},p=async()=>{if(d.value=!0,console.log("redirectUri",f.value),u.value.guest&&!u.value.email&&!u.value.password){await l(u.value.guest,i.getGuestRole),f.value&&r(f.value),d.value=!1;return}else{await a(u.value.email,u.value.password),f.value&&r(f.value),d.value=!1;return}},g=U(()=>s.isGuestLoginAllowed);return(y,w)=>(k(),_("div",kee,[b(o).getShareActive?b(e).share_token?(k(),_("div",Pee,[m("form",null,[m("div",Hee,[Bee,Ie(m("input",{"onUpdate:modelValue":w[3]||(w[3]=x=>u.value.password=x),type:"password",id:"password",class:"fm-shadow-sm fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500 dark:shadow-sm-light",required:""},null,512),[[cn,u.value.password]])]),m("button",{onClick:nt(h,["stop","prevent"]),disabled:d.value,class:H([d.value?b(o).getLoadingClass:"","fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"]),type:"submit"},[d.value?(k(),xe(bc,{key:0})):(k(),_("svg",jee,Vee)),Uee],10,Fee)])])):L("",!0):(k(),_("div",xee,[Cee,m("form",null,[m("div",_ee,[See,Ie(m("input",{"onUpdate:modelValue":w[0]||(w[0]=x=>u.value.email=x),type:"text",id:"text",class:"fm-shadow-sm fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500 dark:shadow-sm-light",placeholder:"[email protected]",required:""},null,512),[[cn,u.value.email]])]),m("div",Mee,[Tee,Ie(m("input",{"onUpdate:modelValue":w[1]||(w[1]=x=>u.value.password=x),type:"password",id:"password",class:"fm-shadow-sm fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500 dark:shadow-sm-light",required:""},null,512),[[cn,u.value.password]])]),g.value?(k(),_("div",Eee,[Aee,m("div",Oee,[Iee,Ie(m("input",{"onUpdate:modelValue":w[2]||(w[2]=x=>u.value.guest=x),type:"text",id:"guest",class:"fm-shadow-sm fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500 dark:shadow-sm-light",placeholder:"Your name"},null,512),[[cn,u.value.guest]])])])):L("",!0),m("button",{onClick:nt(p,["stop","prevent"]),disabled:d.value,class:H([d.value?b(o).getLoadingClass:"","fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dar
14k:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"]),type:"submit"},[d.value?(k(),xe(bc,{key:0})):(k(),_("svg",Lee,$ee)),Dee],10,Nee)])]))]))}}),Wee={class:"fm-flex fm-items-center fm-justify-center"},Kee=m("div",{class:"fm-inline-block fm-h-52 fm-w-52 fm-bg-gray-50 fm-absolute fm-rounded-full fm-border-2 fm-border-solid fm-border-transparent fm-border-r-blue-800 fm-align-[-0.125em] fm-animate-[spin_1.1s_linear_infinite]",role:"status"},null,-1),Gee={__name:"FlowmateLoader",setup(t){const e=lt();return Zt(()=>{document.querySelector("html").classList.add("fm-overflow-hidden"),Ye(()=>e.getPreloading,n=>{n?document.querySelector("html").classList.add("fm-overflow-hidden"):document.querySelector("html").classList.remove("fm-overflow-hidden")})}),(n,r)=>(k(),_("div",{class:H(["fm-bg-white fm-fixed fm-inset-0 fm-z-[10000] fm-flex fm-items-center fm-justify-center fm-duration-700",b(e).getPreloading?"":"fm-scale-150 fm-opacity-0 fm-pointer-events-none"])},[m("div",Wee,[Z($k,{class:"fm-z-10 fm-relative fm-w-32"}),Kee])],2))}},Jee={class:"fm-px-3 fm-py-3 lg:fm-px-5 lg:fm-pl-3 fm-h-[58px] fm-flex fm-items-center"},Yee={class:"fm-flex fm-flex-col fm-gap-6 fm-items-center fm-justify-center fm-h-screen -fm-mt-14 fm-text-center"},Xee=["textContent"],Zee={key:0},Qee=m("br",null,null,-1),ete=["href"],tte=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15M12 9l-3 3m0 0l3 3m-3-3h12.75"})],-1),nte=m("span",null,"Go to control panel",-1),rte=[tte,nte],ote={__name:"Error",setup(t){const e=lt(),{goTo:n}=_r();return Zt(()=>{e.setPreloading(!1)}),(r,o)=>(k(),_(ce,null,[m("div",Jee,[m("a",{href:"/#",onClick:o[0]||(o[0]=nt(s=>b(n)("#/dashboard"),["stop","prevent"])),class:"fm-flex fm-pl-2 fm-pr-32 fm-w-64"},[Z($k)])]),m("div",Yee,[m("h1",{class:"fm-text-4xl fm-font-bold",textContent:ve(b(e).getCollaborationStopped?"Collaboration has stopped":"An error occurred")},null,8,Xee),b(e).getCollaborationStopped?(k(),_("p",Zee,[Le("The collaboration has been stopped by the author."),Qee,Le("Please ask the author, to re-initiate a collaboration session, if you wish to continue.")])):L("",!0),m("a",{href:b(e).getOptions.backend+"/wp-admin/",type:"button",class:"fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},rte,8,ete)])],64))}},ste=()=>{const t=li(),e=zr();return{setStatesFromLocalStorage:()=>{t.setStatesFromLocalStorage(),e.setStatesFromLocalStorage()}}},ite={class:"fm-flex fm-flex-col fm-gap-2 fm-mt-4"},ate=m("h3",{class:"fm-text-sm dark:fm-text-white fm-font-bold"},"Publish",-1),lte={class:"fm-flex fm-gap-2 fm-flex-col fm-mt-2"},cte={class:"fm-text-sm dark:fm-text-white"},ute=m("span",{class:"fm-font-bold"},"Live version updated: ",-1),dte=m("br",null,null,-1),fte={key:0},hte={class:"fm-text-sm dark:fm-text-white"},pte={class:"fm-font-bold"},mte={class:"fm-text-sm dark:fm-text-white"},gte=m("span",{class:"fm-font-bold"},"Updated:",-1),yte={key:0,class:"fm-flex fm-gap-2 fm-flex-col fm-mt-2"},vte={class:"fm-flex fm-gap-2 fm-flex-col"},bte=m("label",{for:"status",class:"fm-text-sm dark:fm-text-white fm-font-bold"},"Publishing status: ",-1),wte=m("option",{value:"draft"},"Draft",-1),kte=m("option",{value:"publish"},"Publish",-1),xte=[wte,kte],Cte={key:1,class:"fm-inline-flex fm-rounded-md fm-shadow-sm fm-relative fm-w-full fm-mt-2",role:"group"},_te={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"fm-w-5 fm-h-5"},Ste=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.7
145"},null,-1),Mte=[Ste],Tte={key:2,fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},Ete=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"},null,-1),Ate=[Ete],Ote={key:3,fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},Ite=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"},null,-1),Nte=[Ite],Lte={key:4},Rte={key:0},$te={key:1},Dte={key:2},Pte=["innerHTML"],Hte=["onClick"],Bte=m("svg",{class:"fm-w-4 fm-h-4 fm-l-2 fm-r-2","aria-hidden":"true",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1),Fte=[Bte],jte={class:"fm-py-2 fm-text-sm fm-text-gray-700 dark:fm-text-gray-200","aria-labelledby":"dropdownHoverButton"},zte={key:0},Vte=["onClick"],Ute=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5 fm-mr-2"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"})],-1),qte={key:1},Wte=["onClick"],Kte=m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"fm-w-5 fm-h-5 fm-mr-2"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75"})],-1),Gte=m("span",null,"Save new revision",-1),Jte=[Kte,Gte],Yte={key:2},Xte=["onClick"],Zte=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5 fm-mr-2"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})],-1),Qte=m("span",null,"Publish",-1),ene=[Zte,Qte],tne=Ne({__name:"FlowmatePublisher",setup(t){li();const e=lt(),{context:n}=Hr();Mu();const{createRevision:r,updateRevision:o,getCurrentRevision:s,getCurrentRevisionId:i}=$r(),{goTo:a}=_r(),l=pe(!1),c=pe(!1),u=pe(!1),d=pe(!1),f=U(()=>He("revisions.create").isEnabled()),h=U(()=>He("revisions.update").isEnabled()&&s().hasOwnProperty("id")),p=U(()=>He("design.publish").isEnabled()),g=U(()=>He("revisions.create").isEnabled()||He("revisions.update").isEnabled()||He("design.publish").isEnabled()),y=U(()=>h.value?"update":f.value?"create":p.value?"publish":!1),w=U(()=>h.value?"Update revision":f.value?"Save new revision":p.value?"Publish":!1),x=N=>new Date(N).toLocaleString(),C=async()=>{c.value=!0,e.setLoading(!0),await o(i(),n.value),c.value=!1,e.setLoading(!1),T()},v=async()=>{u.value=!0,e.setLoading(!0);const N=await r(n.value);u.value=!1,e.setLoading(!1),T(),N.hasOwnProperty("id")&&a(`#/design/${N.post_id}/revisions/${N.id}`)},S=async()=>{d.value=!0,e.setLoading(!0),await e.savePage(),d.value=!1,e.setLoading(!1),T()},E=async()=>{y.value==="update"?await C():y.value==="create"?await v():y.value==="publish"&&await S()},M=()=>{l.value=!l.value},T=()=>{l.value=!1};Zt(()=>{typeof window<"u"&&window.addEventListener("keydown",A)}),pl(()=>{typeof window<"u"&&window.removeEventListener("keydown",A)});const A=N=>{N.metaKey&&N.key==="s"&&(N.preventDefault(),E())};return(N,D)=>(k(),_("div",ite,[ate,m("div",lte,[m("p",cte,[ute,dte,Le(ve(b(e).pageContext.hasOwnProperty("modified")?x(b(e).pageContext.modified):""),1)]),b(e).revisionContext.hasOwnProperty("id")?(k(),_("div",fte,[m("p",hte,[m("span",pte,"Revision #"+ve(b(e).revisionContext.hasOwnProperty("id")?b(e).revisionContext.id:""),1)]),m("p",mte,[gte,Le(" "+ve(b(e).revisionContext.updated_at),1)])])):L("",!0)]),b(He)("design.publish").isEnabled()?(k(),_("div",yte,[m("div",vte,[bte,Ie(m("select",{"onUpdate:modelValue":D[0]||(D[0]=$=>b(e).pageContext.status=$),class:"fm-text-sm fm-text-gray-900 fm-border fm-border-gray-200 fm-rounded-lg fm-p-2 fm-w-full dark:fm-border-gray-600 dark:fm-text-white dark:fm-bg-gray-800 dark:focus:fm-ring-gray-700 dark:focus:fm-ring-offset-gray-800 dark:focus:fm-outline-none dark:!bg-gray-800"},xte,512),[[co,b(e).pageContext.status]])])])):L("",!0),g.value?(k(),_("div",Cte,[m("button",{type:"button",onClick:E,class:H([b(e).getLoading?"fm-opacity-30 fm-pointer-events-none":"","fm-p-3 fm-w-full fm-text-sm fm-font-medium fm-text-gray-900 focus:fm-outline-none !bg-white fm-rounded-l-lg fm-border fm-border-gray-200 hover:!bg-gray-100 hover:fm-text-blue-700 focus:fm-z-10 focus:fm-ring-4 focus:fm-ring-gray-200 dark:focus:fm-ring-gray-700 dark:!bg-gray-800 dark:fm-text-gray-400 dark:fm-border-gray-600 dark:hover:fm-text-white dark:hover:!bg-gray-700 fm-flex fm-justify-center fm-gap-2"])},[b(e).getLoading?(k(),xe(bc,{key:0})):L("",!0),y.value==="create"&&!b(e).getLoading?(k(),_("svg",_te,Mte)):L("",!0),y.value==="update"&&!b(e).getLoading?(k(),_("svg",Tte,Ate)):L("",!0),y.value==="publish"&&!b(e).getLoading?(k(),_("svg",Ote,Nte)):L("",!0),b(e).getLoading?(k(),_("span",Lte,[u.value?(k(),_("span",Rte,"Saving...")):L("",!0),d.value?(k(),_("span",$te,"Publishing...")):L("",!0),c.value?(k(),_("span",Dte,"Updating...")):L("",!0)])):(k(),_("span",{key:5,innerHTML:w.value},null,8,Pte))],2),m("button",{onClick:nt(M,["stop","prevent"]),class:"fm-p-3 fm-w-[50px] fm-text-center fm-text-sm fm-font-medium fm-text-gray-900 focus:fm-outline-none !bg-white fm-rounded-r-md fm-border fm-border-gray-200 fm-rounded-r-md hover:!bg-gray-100 hover:fm-text-blue-700 focus:fm-z-10 focus:fm-ring-4 focus:fm-ring-gray-200 dark:focus:fm-ring-gray-700 dark:!bg-gray-800 dark:fm-text-gray-400 dark:fm-border-gray-600 dark:hover:fm-text-white dark:hover:!bg-gray-700 fm-flex fm-justify-center fm-gap-2",type:"button"},Fte,8,Hte),m("div",{class:H([{"fm-hidden":!l.value},"fm-z-10 fm-bg-white fm-divide-y fm-divide-gray-100 fm-rounded-lg fm-shadow dark:fm-bg-gray-700 fm-w-full fm-absolute fm-top-14"])},[m("ul",jte,[h.value?(k(),_("li",zte,[m("a",{href:"#",onClick:nt(C,["stop","prevent"]),class:"fm-flex fm-px-4 fm-py-2 hover:fm-bg-gray-100 dark:hover:fm-bg-gray-600 dark:hover:fm-text-white"},[Ute,Le(" Update revision ")],8,Vte)])):L("",!0),f.value?(k(),_("li",qte,[m("a",{href:"#",onClick:nt(v,["stop","prevent"]),class:"fm-flex fm-px-4 fm-py-2 hover:fm-bg-gray-100 dark:hover:fm-bg-gray-600 dark:hover:fm-text-white"},Jte,8,Wte)])):L("",!0),p.value?(k(),_("li",Yte,[m("a",{href:"#",onClick:nt(S,["stop","prevent"]),class:"fm-flex fm-flex-row fm-px-4 fm-py-2 hover:fm-bg-gray-100 dark:hover:fm-bg-gray-600 dark:hover:fm-text-white"},ene,8,Xte)])):L("",!0)])],2)])):L("",!0)]))}}),nne={key:0,class:"fm-mt-4 fm-flex fm-flex-col fm-gap-4"},rne=m("label",{for:"page_title",class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"Title",-1),one=m("label",{for:"page_slug",class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"Slug",-1),sne=m("label",{for:"page_excerpt",class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"Excerpt",-1),ine=m("label",{class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"Featured image",-1),ane={key:0,class:"fm-pt-[80%] fm-relative fm-bg-gray-100 dark:fm-bg-gray-800 fm-border-2 fm-border-gray-100 dark:fm-border-gray-700 fm-rounded-lg fm-overflow-hidden fm-mb-2"},lne=["src"],cne=m("svg",{"aria-hidden":"true",class:"fm-w-4 fm-h-4",fill:"white",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),une=m("span",{class:"fm-sr-only"},"Close modal",-1),dne=[cne,une],fne=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.827 6.175A2.31 2.31 0 015.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 00-1.134-.175 2.31 2.31 0 01-1.64-1.055l-.822-1.316a2.192 2.192 0 00-1.736-1.039 48.774 48.774 0 00-5.232 0 2.192 2.192 0 00-1.736 1.039l-.821 1.316z"}),m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 12.75a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0zM18.75 10.5h.008v.008h-.008V10.5z"}
14)],-1),hne=["innerHTML"],pne=Ne({__name:"FlowmatePageOptions",setup(t){const e=lt(),{initMediaLibrary:n}=ih(),{context:r,contextId:o}=Hr(),s=()=>{e.pageContext.preview_image_featured_media=!1,e.pageContext.featured_image_object=!1,e.pageContext.featured_media=0,console.log("removeFeaturedImage")};return(i,a)=>(k(),_("div",null,[b(o)?(k(),_("div",nne,[m("div",null,[rne,Ie(m("input",{type:"text",id:"page_title","onUpdate:modelValue":a[0]||(a[0]=l=>b(r).title.rendered=l),class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500",placeholder:"Title",required:""},null,512),[[cn,b(r).title.rendered]])]),m("div",null,[one,Ie(m("input",{type:"text",id:"page_slug","onUpdate:modelValue":a[1]||(a[1]=l=>b(r).slug=l),class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500",placeholder:"Slug",required:""},null,512),[[cn,b(r).slug]])]),m("div",null,[sne,Ie(m("textarea",{id:"page_excerpt",rows:"6","onUpdate:modelValue":a[2]||(a[2]=l=>b(r).excerpt.rendered=l),class:"fm-block fm-p-2.5 fm-w-full fm-text-sm fm-text-gray-900 fm-bg-gray-50 fm-rounded-lg fm-border fm-border-gray-300 focus:fm-ring-blue-500 focus:fm-border-blue-500 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500",placeholder:"Excerpt"},null,512),[[cn,b(r).excerpt.rendered]])]),m("div",null,[ine,b(r).preview_image_featured_media||b(r).featured_image_object?(k(),_("div",ane,[m("img",{src:b(r).preview_image_featured_media?b(r).preview_image_featured_media:b(r).featured_image_object?b(r).featured_image_object.url:"",class:"fm-absolute fm-top-0 fm-left-0 fm-h-full fm-w-full fm-object-contain fm-duration-100"},null,8,lne),m("button",{type:"button",onClick:a[3]||(a[3]=l=>s()),class:"fm-absolute fm-top-1 fm-right-1 fm-text-gray-400 fm-bg-red-600 hover:fm-bg-red-500 hover:fm-text-white fm-rounded-lg fm-text-sm fm-p-1.5 fm-ml-auto fm-inline-flex fm-items-center dark:hover:fm-bg-gray-600 dark:hover:fm-text-white"},dne)])):L("",!0),m("button",{onClick:a[4]||(a[4]=l=>b(n)(null,null,"featured_media",["jpg","jpeg","png","gif"])),type:"button",class:"fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},[fne,m("span",null,[m("span",{innerHTML:b(r).preview_image_featured_media||b(r).featured_image_object?"Update":"Add"},null,8,hne),Le(" featured image")])])])])):L("",!0)]))}}),mne={key:0,class:"fm-mt-4 fm-flex fm-flex-col fm-gap-4"},gne=m("label",{for:"page_title",class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"SEO Title",-1),yne=m("label",{for:"meta_description",class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"Meta description",-1),vne=m("label",{for:"indexable",class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"Allow search engines to show this page in search results?",-1),bne=m("option",{value:"index"},"Yes (index)",-1),wne=m("option",{value:"noindex"},"No (noindex)",-1),kne=[bne,wne],xne=m("label",{for:"follow_links",class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white"},"Should search engines follow links on this page?",-1),Cne=m("option",{value:"follow"},"Yes (follow)",-1),_ne=m("option",{value:"nofollow"},"No (nofollow)",-1),Sne=[Cne,_ne],Mne=Ne({__name:"FlowmatePageSeo",setup(t){const{context:e,contextId:n}=Hr();return(r,o)=>(k(),_("div",null,[b(n)&&b(e).yoast_head_json?(k(),_("div",mne,[m("div",null,[gne,Ie(m("input",{type:"text",id:"page_title","onUpdate:modelValue":o[0]||(o[0]=s=>b(e).yoast_head_json.title=s),class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500",placeholder:"SEO Title",required:""},null,512),[[cn,b(e).yoast_head_json.title]])]),m("div",null,[yne,Ie(m("textarea",{id:"meta_description",rows:"6","onUpdate:modelValue":o[1]||(o[1]=s=>b(e).yoast_head_json.description=s),class:"fm-block fm-p-2.5 fm-w-full fm-text-sm fm-text-gray-900 fm-bg-gray-50 fm-rounded-lg fm-border fm-border-gray-300 focus:fm-ring-blue-500 focus:fm-border-blue-500 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500",placeholder:"Meta description"},null,512),[[cn,b(e).yoast_head_json.description]])]),m("div",null,[vne,Ie(m("select",{id:"indexable","onUpdate:modelValue":o[2]||(o[2]=s=>b(e).yoast_head_json.robots.index=s),class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},kne,512),[[co,b(e).yoast_head_json.robots.index]])]),m("div",null,[xne,Ie(m("select",{id:"follow_links","onUpdate:modelValue":o[3]||(o[3]=s=>b(e).yoast_head_json.robots.follow=s),class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},Sne,512),[[co,b(e).yoast_head_json.robots.follow]])])])):L("",!0)]))}}),Tne={class:"fm-block fm-p-6 fm-bg-white fm-border fm-border-gray-200 fm-rounded-lg fm-shadow dark:fm-bg-gray-800 dark:fm-border-gray-700"},Ene=["innerHTML"],Sy={__name:"FlowmateCard",props:["title","parent","menu"],setup(t){const e=t,n=li(),{toggleNavigation:r}=Mu();return(o,s)=>(k(),_("div",Tne,[e.title?(k(),_("div",{key:0,onClick:s[0]||(s[0]=i=>b(r)(e.parent,e.menu)),class:"fm-cursor-pointer"},[m("h4",{class:H(["fm-font-bold fm-text-lg dark:fm-text-white",b(n).getOpenStatus(e.parent,e.menu)?"fm-mb-2":""]),innerHTML:e.title},null,10,Ene),Ie(m("hr",null,null,512),[[Pn,b(n).getOpenStatus(e.parent,e.menu)]])])):L("",!0),Ie(m("div",null,[Ot(o.$slots,"default")],512),[[Pn,b(n).getOpenStatus(e.parent,e.menu)]])]))}},Ane={key:0},One={key:0,class:"fm-block fm-bg-white fm-border fm-border-gray-200 fm-rounded-lg fm-overflow-hidden fm-shadow dark:fm-bg-gray-800 dark:fm-border-gray-700"},Ine={class:"fm-h-[400px] fm-bg-white dark:fm-bg-gray-700 fm-relative"},Nne={class:"fm-absolute fm-bg-blue-600 fm-top-0 fm-w-full fm-h-10 fm-z-10 fm-text-white fm-flex fm-items-center fm-justify-between fm-px-3 fm-text-sm fm-font-bold fm-cursor-pointer"},Lne=m("span",null,"Chat",-1),Rne={class:"fm-relative fm-inline-flex fm-items-center fm-cursor-pointer fm-z-10",title:"Notifications on/off"},$ne=m("div",{class:"fm-w-9 fm-h-5 fm-bg-gray-200 peer-focus:fm-outline-none fm-rounded-full peer dark:fm-bg-gray-700 peer-checked:after:fm-translate-x-full peer-checked:after:fm-border-white after:content-[''] after:fm-absolute after:fm-top-[2px] after:fm-left-[2px] after:fm-bg-white after:fm-border-gray-300 after:fm-border after:fm-rounded-full after:fm-h-4 after:fm-w-4 after:fm-transition-all dark:fm-border-gray-600 peer-checked:fm-bg-green-600"},null,-1),Dne={class:"fm-overflow-scroll fm-h-[334px] fm-p-3 fm-pt-10",id:"chat-container"},Pne={key:0,class:"fm-text-xs fm-text-center fm-opacity-50 dark:fm-text-white fm-mt-4"},Hne={class:"fm-p-1"},Bne={key:0,class:"fm-mb-1 fm-pl-3 fm-text-[10px] fm-opacity-50 fm-text-gray-900 dark:fm-text-white"},Fne=["innerHTML"],jne=["innerHTML"],zne={class:"fm-text-sm fm-font-normal"},Vne=["innerHTML"],Une=["innerHTML"],qne=m("label",{for:"chat",class:"fm-sr-only"},"Your message",-1),Wne={class:"fm-flex fm-items-start fm-rounded-lg fm-p-3"},Kne=m("button",{type:"submit",class:"fm-inline-flex fm-justify-center fm-p-2 fm-text-blue-600 fm-rounded-full fm-cursor-pointer hover:fm-bg-blue-100 dar
14k:fm-text-blue-500 dark:hover:fm-bg-gray-600"},[m("svg",{"aria-hidden":"true",class:"fm-w-6 fm-h-6 fm-rotate-90",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{d:"M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z"})]),m("span",{class:"fm-sr-only"},"Send message")],-1),Gne=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z"})],-1),Jne=m("span",null,"Chat",-1),Yne={key:0,class:"fm-absolute fm-inline-flex fm-items-center fm-justify-center fm-w-6 fm-h-6 fm-text-xs fm-font-bold fm-text-white fm-bg-red-500 fm-border-2 fm-border-white fm-rounded-full fm--top-2 fm--right-2 dark:fm-border-gray-900"},Xne=Ne({__name:"FlowmateChat",setup(t){const e=vu(),{getUsername:n}=Qt(),{isCollaborateMode:r,collaborationID:o,sendMessage:s,toggleChat:i,chatIsOpen:a}=$l(),l=pe(),c=d=>d.from.name===n(),u=d=>{const f=new Date(d);let h=f.getHours(),p=f.getMinutes(),g,y;return h<10?g="0"+h:g=h.toString(),p<10?y="0"+p:y=p.toString(),g+":"+y};return Ye(a,()=>{a&&mn(()=>{l.value&&l.value.focus()})}),(d,f)=>b(r)&&b(o)?(k(),_("div",Ane,[b(a)?(k(),_("div",One,[m("div",Ine,[m("div",Nne,[m("div",{onClick:f[0]||(f[0]=h=>b(i)()),class:"fm-absolute fm-top-0 fm-w-full fm-h-10 fm-z-[5]"}),Lne,m("label",Rne,[Ie(m("input",{type:"checkbox","onUpdate:modelValue":f[1]||(f[1]=h=>b(e).notificationsOn=h),class:"fm-sr-only fm-peer"},null,512),[[yl,b(e).notificationsOn]]),$ne])]),m("div",Dne,[b(e).messages.length===0?(k(),_("p",Pne,"Chat is empty")):L("",!0),(k(!0),_(ce,null,Oe(b
14(e).messages,h=>(k(),_("div",Hne,[c(h)?L("",!0):(k(),_("div",Bne,[m("span",{innerHTML:h.from.name},null,8,Fne),Le(" - "),m("span",{innerHTML:u(h.timestamp)},null,8,jne)])),m("div",{id:"toast-message-cta",class:H([c(h)?"fm-bg-blue-600 fm-text-white fm-ml-auto":"fm-bg-gray-50 fm-text-gray-800 dark:fm-bg-gray-800 dark:fm-text-gray-400","fm-p-2 fm-relative fm-px-3 fm-max-w-[75%] fm-w-fit fm-rounded-[1.1rem]"]),role:"alert"},[m("div",{class:H(["fm-flex",c(h)?"fm-justify-end":""])},[m("div",zne,[m("div",{class:"fm-text-sm fm-font-normal",innerHTML:h.message},null,8,Vne)])],2),c(h)?(k(),_("div",{key:0,class:"fm-text-[10px] fm-absolute fm-top-1/2 fm-opacity-50 -fm-translate-y-1/2 fm-text-gray-900 dark:fm-text-white -fm-left-8",innerHTML:u(h.timestamp)},null,8,Une)):L("",!0)],2)]))),256))]),m("form",{onSubmit:f[3]||(f[3]=nt(h=>b(s)(),["prevent"])),class:"fm-absolute fm-w-full fm-bottom-0 fm-left-0 fm-h-[66px]"},[qne,m("div",Wne,[Ie(m("input",{type:"text",id:"chat",ref_key:"input",ref:l,"onUpdate:modelValue":f[2]||(f[2]=h=>b(e).currentMessage=h),class:"fm-block fm-mr-2 fm-p-2.5 fm-w-full fm-text-sm fm-text-gray-900 fm-bg-white fm-rounded-lg fm-border fm-border-gray-300 focus:fm-ring-blue-500 focus:fm-border-blue-500 dark:fm-bg-gray-800 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500",placeholder:"Aa"},null,512),[[cn,b(e).currentMessage]]),Kne])],32)])])):L("",!0),m("button",{type:"button",onClick:f[4]||(f[4]=h=>b(i)()),class:"fm-text-white fm-mr-2 fm-float-right fm-mt-2 fm-relative !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-pr-5 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},[Gne,Jne,b(e).getUnreadMessageCount!==0?(k(),_("div",Yne,ve(b(e).getUnreadMessageCount),1)):L("",!0)])])):L("",!0)}}),Zne={class:"fm-flex flex-row fm-fixed fm-top-0 fm-right-0 fm-z-10 fm-h-screen fm-pt-[59px] fm-transition-transform fm--translate-x-full sm:fm-translate-x-0","aria-label":"Sidebar"},Qne={key:0,class:"fm-flex fm-flex-col fm-gap-4"},ere=Ne({__name:"FlowmateNavigationRight",setup(t){const e=zr();return li(),lt(),(n,r)=>(k(),_("aside",Zne,[m("div",{class:H(["fm-w-80 fm-h-full fm-relative fm-p-3 fm-overflow-visible fm-flex fm-flex-col fm-gap-4 fm-overflow-scroll",b(e).getEditMode?"fm-justify-between":"fm-justify-end"])},[b(e).getEditMode?(k(),_("div",Qne,[b(He)("design.publish").isEnabled()?(k(),xe(Sy,{key:0,title:"Status",parent:"right",menu:"status"},{default:qe(()=>[Z(tne)]),_:1})):L("",!0),b(He)("design").isEnabled()?(k(),xe(Sy,{key:1,title:"Page options",parent:"right",menu:"options"},{default:qe(()=>[Z(pne)]),_:1})):L("",!0),b(He)("design").isEnabled()?(k(),xe(Sy,{key:2,title:"SEO",parent:"right",menu:"seo"},{default:qe(()=>[Z(Mne)]),_:1})):L("",!0)])):L("",!0),b(He)("collaborate.chat").isEnabled()?(k(),xe(Xne,{key:1})):L("",!0)],2)]))}}),tre={key:0,class:"fm-inline-flex fm-items-center fm-justify-center fm-flex-shrink-0 fm-w-8 fm-h-8 fm-text-orange-500 fm-bg-orange-100 fm-rounded-lg dark:fm-bg-orange-700 dark:fm-text-orange-200"},nre=m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1),rre=m("span",{class:"fm-sr-only"},"Warning icon",-1),ore=[nre,rre],sre={key:1,class:"fm-inline-flex fm-items-center fm-justify-center fm-flex-shrink-0 fm-w-8 fm-h-8 text-blue-500 bg-blue-100 rounded-lg dark:bg-blue-800 dark:text-blue-200"},ire=m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5 fm-text-blue-600 dark:fm-text-blue-500",focusable:"false","data-prefix":"fas","data-icon":"paper-plane",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[m("path",{fill:"currentColor",d:"M511.6 36.86l-64 415.1c-1.5 9.734-7.375 18.22-15.97 23.05c-4.844 2.719-10.27 4.097-15.68 4.097c-4.188 0-8.319-.8154-12.29-2.472l-122.6-51.1l-50.86 76.29C226.3 508.5 219.8 512 212.8 512C201.3 512 192 502.7 192 491.2v-96.18c0-7.115 2.372-14.03 6.742-19.64L416 96l-293.7 264.3L19.69 317.5C8.438 312.8 .8
14125 302.2 .0625 289.1s5.469-23.72 16.06-29.77l448-255.1c10.69-6.109 23.88-5.547 34 1.406S513.5 24.72 511.6 36.86z"})],-1),are=m("span",{class:"fm-sr-only"},"Message icon",-1),lre=[ire,are],cre={key:2,class:"fm-inline-flex fm-items-center fm-justify-center fm-flex-shrink-0 fm-w-8 fm-h-8 fm-text-red-500 fm-bg-red-100 fm-rounded-lg dark:fm-bg-red-800 dark:fm-text-red-200"},ure=m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),dre=m("span",{class:"fm-sr-only"},"Error icon",-1),fre=[ure,dre],hre={key:3,class:"fm-inline-flex fm-items-center fm-justify-center fm-flex-shrink-0 fm-w-8 fm-h-8 fm-text-green-500 fm-bg-green-100 fm-rounded-lg dark:fm-bg-green-800 dark:fm-text-green-200"},pre=m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1),mre=m("span",{class:"fm-sr-only"},"Check icon",-1),gre=[pre,mre],yre={class:"fm-pl-4 fm-text-sm fm-font-normal"},vre=["innerHTML"],bre=["innerHTML"],wre=["onClick"],kre=m("span",{class:"fm-sr-only"},"Close",-1),xre=m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),Cre=[kre,xre],B_=Ne({__name:"FlowmateMessages",setup(t){const{isCollaborateMode:e,collaborationID:n}=$l(),r=o6(),{removeMessage:o}=ro();return(s,i)=>(k(),xe(VL,{name:"list",tag:"div",class:H(["fm-fixed fm-z-[1000] fm-right-3 fm-flex fm-flex-col fm-gap-3 fm-items-end",b(e)&&b(n)?"fm-bottom-[4.5rem]":"fm-bottom-3"])},{default:qe(()=>
14[(k(!0),_(ce,null,Oe(b(r).getMessages,a=>(k(),_("div",{key:a.timestamp,id:"toast-simple",class:"fm-flex fm-w-fit fm-items-center fm-w-auto fm-max-w-xs fm-p-4 fm-space-x-4 fm-text-gray-500 fm-bg-white fm-divide-x fm-divide-gray-200 fm-rounded-lg fm-shadow dark:fm-text-gray-400 dark:fm-divide-gray-700 space-x dark:fm-bg-gray-800",role:"alert"},[a.type==="warning"?(k(),_("div",tre,ore)):L("",!0),a.type==="message"?(k(),_("div",sre,lre)):L("",!0),a.type==="error"?(k(),_("div",cre,fre)):L("",!0),a.type==="success"?(k(),_("div",hre,gre)):L("",!0),m("div",yre,[a.errorCode?(k(),_("h3",{key:0,class:"fm-font-bold",innerHTML:a.errorCode},null,8,vre)):L("",!0),m("div",{innerHTML:a.message},null,8,bre)]),m("button",{type:"button",onClick:l=>b(o)(a.timestamp),class:"fm-ml-auto fm-border-none fm--mx-1.5 fm--my-1.5 fm-bg-white fm-text-gray-400 hover:fm-text-gray-900 fm-rounded-lg focus:fm-ring-2 focus:fm-ring-gray-300 fm-p-1.5 hover:fm-bg-gray-100 fm-inline-flex fm-h-8 fm-w-8 dark:fm-text-gray-500 dark:hover:fm-text-white dark:fm-bg-gray-800 dark:hover:fm-bg-gray-700","data-dismiss-target":"#toast-warning","aria-label":"Close"},Cre,8,wre)]))),128))]),_:1},8,["class"]))}}),_re=["onClick"],Sre=Ne({__name:"FlowmateBackdrop",setup(t){const e=lt(),n=()=>{e.setBackdrop(!e.getBackdrop)};return(r,o)=>(k(),_("div",{onClick:nt(n,["stop"]),class:"fm-bg-gray-900 fm-bg-opacity-50 dark:fm-bg-opacity-80 fm-fixed fm-inset-0 fm-z-20"},null,8,_re))}}),Mre=()=>{const t=lt(),e=J8(),n=zr(),r=async(c,u,d,f,h)=>{e.setPostLibrary([]),e.setContext(c,u,d,f,h),e.togglePostsPopup(),await l()},o=(c,u)=>u.findIndex(d=>d.id===c.id),s=()=>{e.setSelectedPosts([])},i=c=>{let u=e.getSelectedPosts,d=o(c,u);d>-1?u.splice(d,1):u.push(c)},a=()=>{let c=e.getActiveBlockIndex,u=e.getActiveFieldName,d=e.getSelectedPosts;d&&c!=null&&u!=null&&(t.pageContext.acf.content[c][u]=d)};async function l(){e.setPostLibraryLoading(!0);const c=pe(null),u=pe(null),d=e.getActiveLayout,f=e.getActiveFieldName,h=e.getActiveIsSetting,p=e.getActiveParent;let g;
14h?g=n.getConfig.config[d].settings[f]:p?g=n.getConfig.config[d][p][f]:g=n.getConfig.config[d][f],console.log("FIELD CONFIG",g),console.log("LAYOUT",d),console.log("FIELD NAME",f),console.log("IS SETTING",h),console.log("PARENT",p);let y;g&&g.type==="taxonomy"?y=t.options.backend+"/wp-json/flowmate/v1/taxonomy/"+g.taxonomy:(y=t.options.backend+"/wp-json/flowmate/v1/posts",g.post_types&&(y+="?types="+g.post_types.join(","))),await fetch(y).then(w=>(w.headers.get("x-wp-totalpages")&&w.headers.get("x-wp-totalpages"),w.json())).then(w=>c.value=w).catch(w=>u.value=w),console.log("POSTS",c.value),e.setPostLibrary(c.value),e.setPostLibraryLoading(!1)}return{initPostLibrary:r,clearSelectedPosts:s,selectPost:i,saveSelectedPosts:a}},Tre=()=>{const t=zr();lt();const e=jo(),n=()=>t;return{getEditableStore:n,getEditMode:()=>n().getEditMode,initFlowmate:async()=>{const r=await e.config().getItem();r&&n().setConfig(r)}}},Ere={key:0},Are={class:"fm-opacity-50"},Ore={key:1},Ire=["placeholder"],Nre=Ne({__name:"FmText",props:{block:{type:Object,required:!0},field:{type:String,required:!1,default:"default"},fieldName:{type:String,required:!0},label:{type:String,required:!0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t;let n=pe(!1);const r=pe(e.block[e.fieldName]),o=i=>{console.log("KEYUP"),(i.key==="Escape"||i.key==="Enter")&&r.value.blur()},s=()=>{console.log("TOGGLE EDIT"),n.value=!n.value,n.value?mn(()=>{r.value.focus()}):document.dispatchEvent(new CustomEvent("flowmate-input-updated",{}))};return(i,a)=>(k(),_("div",null,[e.editMode?(k(),_("div",Ere,[b(n)?(k(),_("span",Ore,[Ie(m("input",{onKeyup:o,onFocusout:s,ref_key:"input",ref:r,"onUpdate:modelValue":a[0]||(a[0]=l=>e.block[e.fieldName]=l),type:"text",class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500",placeholder:e.label},null,40,Ire),[[cn,e.block[e.fieldName]]])])):(k(),_("span",{key:0,onClick:s,class:"fm-cursor-pointer"},[Ot(i.$slots,"default",{},()=>[m("span",Are,ve(e.label)+": Click to add ",1)])]))])):Ot(i.$slots,"default",{key:1})]))}});function Cn(t){this.content=t}Cn.prototype={constructor:Cn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),s=r.content.slice();return o==-1?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new Cn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Cn(n)},addToStart:function(t,e){return new Cn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Cn(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),s=r.find(t);return o.splice(s==-1?o.length:s,0,e,n),new Cn(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Cn.from(t),t.size?new Cn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Cn.from(t),t.size?new Cn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Cn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Cn.from=function(t){if(t instanceof Cn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Cn(e)};function Z8(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),s=e.child(r);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(let i=0;o.text[i]==s.text[i];i++)n++;return n}if(o.content.size||s.content.size){let i=Z8(o.content,s.content,n+1);if(i!=null)return i}n+=o.nodeSize}}function Q8(t,e,n,r){for(let o=t.childCount,s=e.childCount;;){if(o==0||s==0)return o==s?null:{a:n,b:r};let i=t.child(--o),a=e.child(--s),l=i.nodeSize;if(i==a){n-=l,r-=l;continue}if(!i.sameMarkup(a))return{a:n,b:r};if(i.isText&&i.text!=a.text){let c=0,u=Math.min(i.text.length,a.text.length);for(;c<u&&i.text[i.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(i.content.size||a.content.size){let c=Q8(i.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}let ue=class Qn{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,s){for(let i=0,a=0;a<n;i++){let l=this.content[i],c=a+l.nodeSize;if(c>e&&r(l,o+a,s||null,i)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}
vendor: 11,307 bytes, line 14
14textBetween(e,n,r,o){let s="",i=!0;return this.nodesBetween(e,n,(a,l)=>{a.isText?(s+=a.text.slice(Math.max(e,l)-l,n-l),i=!r):a.isLeaf?(o?s+=typeof o=="function"?o(a):o:a.type.spec.leafText&&(s+=a.type.spec.leafText(a)),i=!r):!i&&a.isBlock&&(s+=r,i=!0)},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)o.push(e.content[s]);return new Qn(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let s=0,i=0;i<n;s++){let a=this.content[s],l=i+a.nodeSize;l>e&&((i<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-i),Math.min(a.text.length,n-i)):a=a.cut(Math.max(0,e-i-1),Math.min(a.content.size,n-i-1))),r.push(a),o+=a.nodeSize),i=l}return new Qn(r,o)}cutByIndex(e,n){return e==n?Qn.empty:e==0&&n==this.content.length?this:new Qn(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new Qn(o,s)}addToStart(e){return new Qn([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Qn(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))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 n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return Z8(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Q8(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Bh(0,e);if(e==this.size)return Bh(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let s=this.child(r),i=o+s.nodeSize;if(i>=e)return i==e||n>0?Bh(r+1,i):Bh(r,o);o=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Qn.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Qn(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Qn.empty;let n,r=0;for(let o=0;o<e.length;o++){let s=e[o];r+=s.nodeSize,o&&s.isText&&e[o-1].sameMarkup(s)?(n||(n=e.slice(0,o)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new Qn(n||e,r)}static from(e){if(!e)return Qn.empty;if(e instanceof Qn)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Qn([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};ue.empty=new ue([],0);const My={index:0,offset:0};function Bh(t,e){return My.index=t,My.offset=e,My}function Im(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Im(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Im(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let _t=class eb{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let s=e[o];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,o));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Im(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return eb.none;if(e instanceof eb)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};_t.none=[];let Nm=class extends Error{};class be{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=t7(this.content,e+this.openStart,n);return r&&new be(r,this.openStart,this.openEnd)}removeBetween(e,n){return new be(e7(this.content,e+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(e,n){if(!n)return be.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new be(ue.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new be(e,r,o)}}be.empty=new be(ue.empty,0,0);function e7(t,e,n){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r),{index:i,offset:a}=t.findIndex(n);if(o==e||s.isText){if(a!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(e7(s.content,e-o-1,n-o-1)))}function t7(t,e,n,r){let{index:o,offset:s}=t.findIndex(e),i=t.maybeChild(o);if(s==e||i.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=t7(i.content,e-s-1,n);return a&&t.replaceChild(o,i.copy(a))}function Lre(t,e,n){if(n.openStart>t.depth)throw new Nm("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Nm("Inconsistent open depths");return n7(t,e,n,0)}function n7(t,e,n,r){let o=t.index(r),s=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let i=n7(t,e,n,r+1);return s.copy(s.content.replaceChild(o,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let i=t.parent,a=i.content;return tl(i,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:i,end:a}=Rre(n,t);return tl(s,o7(t,i,a,e,r))}else return tl(s,Lm(t,e,r))}function r7(t,e){if(!e.type.compatibleContent(t.type))throw new Nm("Cannot join "+e.type.name+" onto "+t.type.name)}function tb(t,e,n){let r=t.node(n);return r7(r,e.node(n)),r}function el(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function zd(t,e,n,r){let o=(e||t).node(n),s=0,i=e?e.index(n):o.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(el(t.nodeAfter,r),s++));for(let a=s;a<i;a++)el(o.child(a),r);e&&e.depth==n&&e.textOffset&&el(e.nodeBefore,r)}function tl(t,e){return t.type.checkContent(e),t.copy(e)}function o7(t,e,n,r,o){let s=t.depth>o&&tb(t,e,o+1),i=r.depth>o&&tb(n,r,o+1),a=[];return zd(null,t,o,a),s&&i&&e.index(o)==n.index(o)?(r7(s,i),el(tl(s,o7(t,e,n,r,o+1)),a)):(s&&el(tl(s,Lm(t,e,o+1)),a),zd(e,n,o,a),i&&el(tl(i,Lm(n,r,o+1)),a)),zd(r,null,o,a),new ue(a)}function Lm(t,e,n){let r=[];if(zd(null,t,n,r),t.depth>n){let o=tb(t,e,n+1);el(tl(o,Lm(t,e,n+1)),r)}return zd(e,null,n,r),new ue(r)}function Rre(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)r=e.node(o).copy(ue.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}let F_=class nb{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)o+=r.child(s).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return _t.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let s=r.marks;for(var i=0;i<s.length;i++)s[i].type.spec.inclusive===!1&&(!o||!s[i].isInSet(o.marks))&&(s=s[i--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!o||!r[s].isInSet(o.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Rm(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,s=n;for(let i=e;;){let{index:a,offset:l}=i.content.findIndex(s),c=s-l;if(r.push(i,a,o+l),!c||(i=i.child(a),i.isText))break;s=c-1,o+=l+1}return new nb(n,r,s)}
vendor: 4,174 bytes, line 14
14static resolveCached(e,n){for(let o=0;o<Ty.length;o++){let s=Ty[o];if(s.pos==n&&s.doc==e)return s}let r=Ty[Ey]=nb.resolve(e,n);return Ey=(Ey+1)%$re,r}},Ty=[],Ey=0,$re=12,Rm=class{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};const Dre=Object.create(null);let nl=class rb{constructor(e,n,r,o=_t.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||ue.empty}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,n,r,o=0){this.content.nodesBetween(e,n,r,o,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,n,r,o){return this.content.textBetween(e,n,r,o)}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,n,r){return this.type==e&&Im(this.attrs,n||e.defaultAttrs||Dre)&&_t.sameSet(this.marks,r||_t.none)}copy(e=null){return e==this.content?this:new rb(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new rb(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return be.empty;let o=this.resolve(e),s=this.resolve(n),i=r?0:o.sharedDepth(n),a=o.start(i),l=o.node(i).content.cut(o.pos-a,s.pos-a);return new be(l,o.depth-i,s.depth-i)}replace(e,n,r){return Lre(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return F_.resolveCached(this,e)}resolveNoCache(e){return F_.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(o=!0),!o)),o}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()+")"),s7(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=ue.empty,o=0,s=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,o,s),a=i&&i.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let s=this.contentMatchAt(e).matchType(r),i=s&&s.matchFragment(this.content,n);return i?i.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);let e=_t.none;for(let n=0;n<this.marks.length;n++)e=this.marks[n].addToSet(e);if(!_t.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}
14`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=ue.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,o,r)}};nl.prototype.text=void 0;let Pre=class ob extends nl{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):s7(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}
vendor: 11,405 bytes, lines 14-15
14mark(e){return e==this.marks?this:new ob(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ob(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function s7(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}let kf=class i7{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Hre(e,n);if(r.next==null)return i7.empty;let o=a7(r);r.next&&r.err("Unexpected trailing text");let s=qre(Ure(o));return Wre(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let s=n;o&&s<r;s++)o=o.matchType(e.child(s).type);return o}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:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function s(i,a){let l=i.matchFragment(e,r);if(l&&(!n||l.validEnd))return ue.from(a.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:u,next:d}=i.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=s(d,a.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),s=o.match;if(s.matchType(e)){let i=[];for(let a=o;a.type;a=a.via)i.push(a.type);return i.reverse()}for(let i=0;i<s.next.length;i++){let{type:a,next:l}=s.next[i];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let s=o+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)s+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return s}).join(`
15`)}};kf.empty=new kf(!0);class Hre{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function a7(t){let e=[];do e.push(Bre(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Bre(t){let e=[];do e.push(Fre(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Fre(t){let e=Vre(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=jre(t,e);else break;return e}function j_(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function jre(t,e){let n=j_(t),r=n;return t.eat(",")&&(t.next!="}"?r=j_(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function zre(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let s in n){let i=n[s];i.groups.indexOf(e)>-1&&o.push(i)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function Vre(t){if(t.eat("(")){let e=a7(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=zre(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Ure(t){let e=[[]];return o(s(t,0),n()),e;function n(){return e.push([])-1}function r(i,a,l){let c={term:l,to:a};return e[i].push(c),c}function o(i,a){i.forEach(l=>l.to=a)}function s(i,a){if(i.type=="choice")return i.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(i.type=="seq")for(let l=0;;l++){let c=s(i.exprs[l],a);if(l==i.exprs.length-1)return c;o(c,a=n())}else if(i.type=="star"){let l=n();return r(a,l),o(s(i.expr,l),l),[r(l)]}else if(i.type=="plus"){let l=n();return o(s(i.expr,a),l),o(s(i.expr,l),l),[r(l)]}else{if(i.type=="opt")return[r(a)].concat(s(i.expr,a));if(i.type=="range"){let l=a;for(let c=0;c<i.min;c++){let u=n();o(s(i.expr,l),u),l=u}if(i.max==-1)o(s(i.expr,l),l);else for(let c=i.min;c<i.max;c++){let u=n();r(l,u),o(s(i.expr,l),u),l=u}return[r(l)]}else{if(i.type=="name")return[r(a,void 0,i.value)];throw new Error("Unknown expr type")}}}}function l7(t,e){return e-t}function z_(t,e){let n=[];return r(e),n.sort(l7);function r(o){let s=t[o];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(o);for(let i=0;i<s.length;i++){let{term:a,to:l}=s[i];!a&&n.indexOf(l)==-1&&r(l)}}}function qre(t){let e=Object.create(null);return n(z_(t,0));function n(r){let o=[];r.forEach(i=>{t[i].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);z_(t,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new kf(r.indexOf(t.length-1)>-1);for(let i=0;i<o.length;i++){let a=o[i][1].sort(l7);s.next.push({type:o[i][0],next:e[a.join(",")]||n(a)})}return s}}function Wre(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],s=!o.validEnd,i=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];i.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function c7(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function u7(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let s=t[r];if(s.hasDefault)o=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function d7(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new Kre(t[n]);return e}let V_=class f7{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=d7(r.attrs),this.defaultAttrs=c7(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==kf.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}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:u7(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new nl(this,this.computeAttrs(e),ue.from(n),_t.setFrom(r))}createChecked(e=null,n,r){return n=ue.from(n),this.checkContent(n),new nl(this,this.computeAttrs(e),n,_t.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=ue.from(n),n.size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(ue.empty,!0);return s?new nl(this,e,n.append(s),_t.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:_t.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,i)=>r[s]=new f7(s,n,i));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Kre{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}let h7=class p7{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=d7(o.attrs),this.excluded=null;let s=c7(this.attrs);this.instance=s?new _t(this,s):null}create(e=null){return!e&&this.instance?this.instance:new _t(this,u7(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((s,i)=>r[s]=new p7(s,o++,n,i)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}excludes(e){return this.excluded.indexOf(e)>-1}};class Gre{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=Cn.from(e.nodes),n.marks=Cn.from(e.marks||{}),this.nodes=V_.compile(this.spec.nodes,this),this.marks=h7.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],i=s.spec.content||"",a=s.spec.marks;s.contentMatch=r[i]||(r[i]=kf.parse(i,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.markSet=a=="_"?null:a?U_(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],i=s.spec.excludes;s.excluded=i==null?[s]:i==""?[]:U_(this,i.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof V_){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new Pre(r,r.defaultAttrs,e,_t.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return nl.fromJSON(this,e)}markFromJSON(e){return _t.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function U_(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],s=t.marks[o],i=s;
15if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(i=l)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}let Fk=class sb{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=e.nodes[r.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new W_(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new W_(this,n,!0);return r.addAll(e,n.from,n.to),be.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let s=this.tags[o];if(Xre(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let i=s.getAttrs(e);if(i===!1)continue;s.attrs=i||void 0}return s}}}matchStyle(e,n,r,o){for(let s=o?this.styles.indexOf(o)+1:0;s<this.styles.length;s++){let i=this.styles[s],a=i.style;if(!(a.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||a.length>
15e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(i.getAttrs){let l=i.getAttrs(n);if(l===!1)continue;i.attrs=l||void 0}return i}}}static schemaRules(e){let n=[];function r(o){let s=o.priority==null?50:o.priority,i=0;for(;i<n.length;i++){let a=n[i];if((a.priority==null?50:a.priority)<s)break}n.splice(i,0,o)}for(let o in e.marks){let s=e.marks[o].spec.parseDOM;s&&s.forEach(i=>{r(i=K_(i)),i.mark||i.ignore||i.clearMark||(i.mark=o)})}for(let o in e.nodes){let s=e.nodes[o].spec.parseDOM;s&&s.forEach(i=>{r(i=K_(i)),i.node||i.ignore||i.mark||(i.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new sb(e,sb.schemaRules(e)))}};const m7={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Jre={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},g7={ol:!0,ul:!0},$m=1,Dm=2,Vd=4;function q_(t,e,n){return e!=null?(e?$m:0)|(e==="full"?Dm:0):t&&t.whitespace=="pre"?$m|Dm:n&~Vd}let Fh=class{constructor(e,n,r,o,s,i,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=s,this.options=a,this.content=[],this.activeMarks=_t.none,this.stashMarks=[],this.match=i||(a&Vd?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ue.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&$m)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=ue.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ue.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let o=r[n];(this.type?this.type.allowsMarkType(o.type):Qre(o.type,e))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!m7.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},W_=class{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,s,i=q_(null,n.preserveWhitespace,0)|(r?Vd:0);o?s=new Fh(o.type,o.attrs,_t.none,_t.none,!0,n.topMatch||o.type.contentMatch,i):r?s=new Fh(null,null,_t.none,_t.none,!0,null,i):s=new Fh(e.schema.topNodeType,null,_t.none,_t.none,!0,null,i),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(e.nodeType==3)this.addTextNode(e);else if(e.nodeType==1){let n=e.getAttribute("style");if(!n)this.addElement(e);else{let r=this.readStyles(Zre(n));if(!r)return;let[o,s]=r,i=this.top;for(let a=0;a<s.length;a++)this.removePendingMark(s[a],i);for(let a=0;a<o.length;a++)this.addPendingMark(o[a]);this.addElement(e);for(let a=0;a<o.length;a++)this.removePendingMark(o[a],i);for(let a=0;a<s.length;a++)this.addPendingMark(s[a])}}}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&Dm||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&$m)r.options&Dm?n=n.replace(/\r\n?/g,`
16`):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=r.content[r.content.length-1],s=e.previousSibling;(!o||s&&s.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(e)}else this.findInside(e)}addElement(e,n){let r=e.nodeName.toLowerCase(),o;g7.hasOwnProperty(r)&&this.parser.normalizeLists&&Yre(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));if(s?s.ignore:Jre.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let i,a=this.top,l=this.needsBlock;if(m7.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),i=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}this.addAll(e),i&&this.sync(a),this.needsBlock=l}else this.addElementByRule(e,s,s.consuming===!1?o:void 0)}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
17`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}
17readStyles(e){let n=_t.none,r=_t.none;for(let o=0;o<e.length;o+=2)for(let s=void 0;;){let i=this.parser.matchStyle(e[o],e[o+1],this,s);if(!i)break;if(i.ignore)return null;if(i.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(a=>{i.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(n),i.consuming===!1)s=i;else break}return[n,r]}addElementByRule(e,n,r){let o,s,i;n.node?(s=this.parser.schema.nodes[n.node],s.isLeaf?this.insertNode(s.create(n.attrs))||this.leafFallback(e):o=this.enter(s,n.attrs||null,n.preserveWhitespace)):(i=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(i));let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,i&&this.removePendingMark(i,a)}addAll(e,n,r){let o=n||0;for(let s=n?e.childNodes[n]:e.firstChild,i=r==null?null:e.childNodes[r];s!=i;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s);this.findAtPoint(e,o)}findPlace(e){let n,r;for(let o=this.open;o>=0;o--){let s=this.nodes[o],i=s.findWrapping(e);if(i&&(!n||n.length>i.length)&&(n=i,r=s,!i.length)||s.solid)break}if(!n)return!1;this.sync(r);for(let o=0;o<n.length;o++)this.enterInner(n[o],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let o=0;o<e.marks.length;o++)(!n.type||n.type.allowsMarkType(e.marks[o].type))&&(r=e.marks[o].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let o=this.findPlace(e.create(n));return o&&this.enterInner(e,n,!0,r),o}enterInner(e,n=null,r=!1,o){this.closeExtra();let s=this.top;s.applyPending(e),s.match=s.match&&s.match.matchType(e);let i=q_(e,o,s.options);s.options&Vd&&s.content.length==0&&(i|=Vd),this.nodes.push(new Fh(e,n,s.activeMarks,s.pendingMarks,r,null,i)),this.open++}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(o?0:1),i=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(i(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return i(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;
17if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=eoe(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(e)>-1)o.pendingMarks=e.removeFromSet(o.pendingMarks);else{o.activeMarks=e.removeFromSet(o.activeMarks);let s=o.popFromStashMark(e);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==n)break}}};function Yre(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&g7.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Xre(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Zre(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function K_(t){let e={};for(let n in t)e[n]=t[n];return e}function Qre(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let s=[],i=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||s.indexOf(u)<0&&i(u))return!0}};if(i(o.contentMatch))return!0}}function eoe(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}let ch=class ad{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ay(n).createDocumentFragment());let o=r,s=[];return e.forEach(i=>{if(s.length||i.marks.length){let a=0,l=0;for(;a<s.length&&l<i.marks.length;){let c=i.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)o=s.pop()[1];for(;l<i.marks.length;){let c=i.marks[l++],u=this.serializeMark(c,i.isInline,n);u&&(s.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(i,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=ad.renderSpec(Ay(n),this.nodes[e.type.name](e));if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let s=this.serializeMark(e.marks[o],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&ad.renderSpec(Ay(r),o(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let o=n[0],s=o.indexOf(" ");s>0&&(r=o.slice(0,s),o=o.slice(s+1));let i,a=r?e.createElementNS(r,o):e.createElement(o),l=n[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;u<n.length;u++){let d=n[u];if(d===0){if(u<n.length-1||u>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:h}=ad.renderSpec(e,d,r);if(a.appendChild(f),h){if(i)throw new RangeError("Multiple content holes");i=h}}}return{dom:a,contentDOM:i}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ad(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=G_(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return G_(e.marks)}};function G_(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ay(t){return t.document||window.document}const y7=65535,v7=Math.pow(2,16);function toe(t,e){return t+e*v7}function J_(t){return t&y7}function noe(t){return(t-(t&y7))/v7}const b7=1,w7=2,Sp=4,k7=8;class ib{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&k7)>0}get deletedBefore(){return(this.delInfo&(b7|Sp))>0}get deletedAfter(){return(this.delInfo&(w7|Sp))>0}get deletedAcross(){return(this.delInfo&Sp)>0}}let qc=class Zl{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Zl.empty)return Zl.empty}recover(e){let n=0,r=J_(e);
vendor: 56,616 bytes, lines 17-18
17if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+noe(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,s=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>e)break;let c=this.ranges[a+s],u=this.ranges[a+i],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:n:n,h=l+o+(f<0?0:u);if(r)return h;let p=e==(n<0?l:d)?null:toe(a/3,e-l),g=e==l?w7:e==d?b7:Sp;return(n<0?e!=l:e!=d)&&(g|=k7),new ib(h,g,p)}o+=u-c}return r?e+o:new ib(e+o,0,null)}touches(e,n){let r=0,o=J_(n),s=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+s],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+i]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,s=0;o<this.ranges.length;o+=3){let i=this.ranges[o],a=i-(this.inverted?s:0),l=i+(this.inverted?0:s),c=this.ranges[o+n],u=this.ranges[o+r];e(a,a+c,l,l+u),s+=u-c}}invert(){return new Zl(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Zl.empty:new Zl(e<0?[0,-e,0]:[0,0,e])}};qc.empty=new qc([]);let x7=class Mp{constructor(e=[],n,r=0,o=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=o}slice(e=0,n=this.maps.length){return new Mp(this.maps,this.mirror,e,n)}copy(){return new Mp(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let o=e.getMirror(n);this.appendMap(e.maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new Mp;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let s=this.from;s<this.to;s++){let i=this.maps[s],a=i.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this.maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new ib(e,o,null)}};const Oy=Object.create(null);let Sr=class{getMap(){return qc.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Oy[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Oy)throw new RangeError("Duplicate use of step JSON ID "+e);return Oy[e]=n,n.prototype.jsonID=e,n}},mr=class ld{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new ld(e,null)}static fail(e){return new ld(null,e)}static fromReplace(e,n,r,o){try{return ld.ok(e.replace(n,r,o))}catch(s){if(s instanceof Nm)return ld.fail(s.message);throw s}}};function jk(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let s=t.child(o);s.content.size&&(s=s.copy(jk(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return ue.fromArray(r)}class ji extends Sr{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),s=new be(jk(n.content,(i,a)=>!i.isAtom||!a.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),o),n.openStart,n.openEnd);return mr.fromReplace(e,this.from,this.to,s)}invert(){return new uh(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ji(n.pos,r.pos,this.mark)}merge(e){return e instanceof ji&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ji(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ji(n.from,n.to,e.markFromJSON(n.mark))}}Sr.jsonID("addMark",ji);let uh=class cd extends Sr{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new be(jk(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return mr.fromReplace(e,this.from,this.to,r)}invert(){return new ji(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new cd(n.pos,r.pos,this.mark)}merge(e){return e instanceof cd&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new cd(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new cd(n.from,n.to,e.markFromJSON(n.mark))}};Sr.jsonID("removeMark",uh);class zi extends Sr{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return mr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return mr.fromReplace(e,this.pos,this.pos+1,new be(ue.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new zi(this.pos,n.marks[o]);return new zi(this.pos,this.mark)}}return new zk(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new zi(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new zi(n.pos,e.markFromJSON(n.mark))}}Sr.jsonID("addNodeMark",zi);let zk=class ab extends Sr{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return mr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return mr.fromReplace(e,this.pos,this.pos+1,new be(ue.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new zi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ab(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ab(n.pos,e.markFromJSON(n.mark))}};Sr.jsonID("removeNodeMark",zk);let di=class Ra extends Sr{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&lb(e,this.from,this.to)?mr.fail("Structure replace would overwrite content"):mr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new qc([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ra(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Ra(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Ra)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?be.empty:new be(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ra(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?be.empty:new be(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ra(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ra(n.from,n.to,be.fromJSON(e,n.slice),!!n.structure)}};Sr.jsonID("replace",di);class dn extends Sr{constructor(e,n,r,o,s,i,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=s,this.insert=i,this.structure=a}apply(e){if(this.structure&&(lb(e,this.from,this.gapFrom)||lb(e,this.gapTo,this.to)))return mr.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return mr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?mr.fromReplace(e,this.from,this.to,r):mr.fail("Content does not fit in gap")}getMap(){return new qc([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new dn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),s=e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||s>r.pos?null:new dn(n.pos,r.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new dn(n.from,n.to,n.gapFrom,n.gapTo,be.fromJSON(e,n.slice),n.insert,!!n.structure)}}Sr.jsonID("replaceAround",dn);function lb(t,e,n){let r=t.resolve(e),o=n-e,s=r.depth;for(;o>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,o--;if(o>0){let i=r.node(s).maybeChild(r.indexAfter(s));for(;o>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,o--}}return!1}function roe(t,e,n,r){let o=[],s=[],i,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+l.nodeSize,n),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(i&&i.to==f&&i.mark.eq(d[g])?i.to=h:o.push(i=new uh(f,h,d[g])));a&&a.to==f?a.to=h:s.push(a=new ji(f,h,r))}}),o.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function ooe(t,e,n,r){let o=[],s=0;t.doc.nodesBetween(e,n,(i,a)=>{if(!i.isInline)return;s++;let l=null;if(r instanceof h7){let c=i.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(i.marks)&&(l=[r]):l=i.marks;if(l&&l.length){let c=Math.min(a+i.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],f;for(let h=0;h<o.length;h++){let p=o[h];p.step==s-1&&d.eq(o[h].style)&&(f=p)}f?(f.to=c,f.step=s):o.push({style:d,from:Math.max(a,e),to:c,step:s})}}}),o.forEach(i=>t.step(new uh(i.from,i.to,i.style)))}function soe(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),s=[],i=e+1;for(let a=0;a<o.childCount;a++){let l=o.child(a),c=i+l.nodeSize,u=r.matchType(l.type);if(!u)s.push(new di(i,c,be.empty));else{r=u;for(let d=0;d<l.marks.length;d++)n.allowsMarkType(l.marks[d].type)||t.step(new uh(i,c,l.marks[d]))}i=c}if(!r.validEnd){let a=r.fillBefore(ue.empty,!0);t.replace(i,i,new be(a,0,0))}for(let a=s.length-1;a>=0;a--)t.step(s[a])}function ioe(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Tu(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),s=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,s,e))return n;if(n==0||r.type.spec.isolating||!ioe(r,o,s))break}return null}function aoe(t,e,n){let{$from:r,$to:o,depth:s}=e,i=r.before(s+1),a=o.after(s+1),l=i,c=a,u=ue.empty,d=0;for(let p=s,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,u=ue.from(r.node(p).copy(u)),d++):l--;let f=ue.empty,h=0;for(let p=s,g=!1;p>n;p--)g||o.after(p+1)<o.end(p)?(g=!0,f=ue.from(o.node(p).copy(f)),h++):c++;t.step(new dn(l,c,i,a,new be(u.append(f),d,h),u.size-d,!0))}function Vk(t,e,n=null,r=t){let o=loe(t,e),s=o&&coe(r,e);return s?o.map(Y_).concat({type:e,attrs:n}).concat(s.map(Y_)):null}function Y_(t){return{type:t,attrs:null}}function loe(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let i=s.length?s[0]:e;return n.canReplaceWith(r,o,i)?s:null}function coe(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.child(r),i=e.contentMatch.findWrapping(s.type);if(!i)return null;let a=(i.length?i[i.length-1]:e).contentMatch;for(let l=r;a&&l<o;l++)a=a.matchType(n.child(l).type);return!a||!a.validEnd?null:i}function uoe(t,e,n){let r=ue.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let a=n[i].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ue.from(n[i].type.create(n[i].attrs,r))}let o=e.start,s=e.end;t.step(new dn(o,s,o,s,new be(r,0,0),n.length,!0))}function doe(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(i,a)=>{if(i.isTextblock&&!i.hasMarkup(r,o)&&foe(t.doc,t.mapping.slice(s).map(a),r)){t.clearIncompatible(t.mapping.slice(s).map(a,1),r);let l=t.mapping.slice(s),c=l.map(a,1),u=l.map(a+i.nodeSize,1);return t.step(new dn(c,u,c+1,u-1,new be(ue.from(r.create(o,null,i.marks)),0,0),1,!0)),!1}})}function foe(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function hoe(t,e,n,r,o){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let i=n.create(r,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,i);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new dn(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new be(ue.from(i),0,0),1,!0))}function kc(t,e,n=1,r){let o=t.resolve(e),s=o.depth-n,i=r&&r[r.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!i.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>s;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let a=o.indexAfter(s),l=r&&r[0];return o.node(s).canReplaceWith(a,a,l?l.type:o.node(s+1).type)}function poe(t,e,n=1,r){let o=t.doc.resolve(e),s=ue.empty,i=ue.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){s=ue.from(o.node(a).copy(s));let u=r&&r[c];i=ue.from(u?u.type.create(u.attrs,i):o.node(a).copy(i))}t.step(new di(e,e,new be(s.append(i),n,n),!0))}function pa(t,e){let n=t.resolve(e),r=n.index();return C7(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function C7(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function _7(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let s,i,a=r.index(o);if(o==r.depth?(s=r.nodeBefore,i=r.nodeAfter):n>0?(s=r.node(o+1),a++,i=r.node(o).maybeChild(a)):(s=r.node(o).maybeChild(a-1),i=r.node(o+1)),s&&!s.isTextblock&&C7(s,i)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function moe(t,e,n){let r=new di(e-n,e+n,be.empty,!0);t.step(r)}function goe(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let s=r.index(o);if(r.node(o).canReplaceWith(s,s,n))return r.before(o+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let s=r.indexAfter(o);if(r.node(o).canReplaceWith(s,s,n))return r.after(o+1);if(s<r.node(o).childCount)return null}return null}function S7(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let s=0;s<n.openStart;s++)o=o.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let i=r.depth;i>=0;i--){let a=i==r.depth?0:r.pos<=(r.start(i+1)+r.end(i+1))/2?-1:1,l=r.index(i)+(a>0?1:0),c=r.node(i),u=!1;if(s==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(i+1):r.after(i+1)}return null}function Uk(t,e,n=e,r=be.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),s=t.resolve(n);return M7(o,s,r)?new di(e,n,r):new yoe(o,s,r).fit()}function M7(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class yoe{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ue.empty;for(let o=0;o<=e.depth;o++){let s=e.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=ue.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let s=this.placed,i=r.depth,a=o.depth;for(;i&&a&&s.childCount==1;)s=s.firstChild.content,i--,a--;let l=new be(s,i,a);return e>-1?new dn(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new di(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(o=0),s.type.spec.isolating&&o<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,s=null;r?(s=Iy(this.unplaced.content,r-1).firstChild,o=s.content):o=this.unplaced.content;let i=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(i?c.matchType(i.type)||(d=c.fillBefore(ue.from(i),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:d};if(n==2&&i&&(u=c.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Iy(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new be(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Iy(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new be(ud(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new be(ud(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g<s.length;g++)this.openFrontierNode(s[g]);let i=this.unplaced,a=r?r.content:i.content,l=i.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));d=d.matchFragment(o)}let h=a.size+e-(i.content.size-i.openEnd);for(;c<a.childCount;){let g=a.child(c),y=d.matchType(g.type);if(!y)break;c++,(c>1||l==0||g.content.size)&&(d=y,u.push(T7(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?h:-1)))}let p=c==a.childCount;p||(h=-1),this.placed=dd(this.placed,n,ue.from(u)),this.frontier[n].match=d,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<h;g++){let w=y.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),y=w.content}this.unplaced=p?e==0?be.empty:new be(ud(i.content,e-1,1),e-1,h<0?i.openEnd:e-1):new be(ud(i.content,e,c),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Ny(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),i=Ny(e,n,o,r,s);if(i){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Ny(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:i,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=dd(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),s=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,s)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=dd(this.placed,this.depth,ue.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(ue.empty,!0);e.childCount&&(this.placed=dd(this.placed,this.frontier.length,e))}}function ud(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ud(t.firstChild.content,e-1,n)))}function dd(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(dd(t.lastChild.content,e-1,n)))}function Iy(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function T7(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,T7(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ue.empty,!0)))),t.copy(r)}function Ny(t,e,n,r,o){let s=t.node(e),i=o?t.indexAfter(e):t.index(e);if(i==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,i);return a&&!voe(n,s.content,i)?a:null}function voe(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function boe(t){return t.spec.defining||t.spec.definingForContent}function woe(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(M7(o,s,r))return t.step(new di(e,n,r));let i=A7(o,t.doc.resolve(n));i[i.length-1]==0&&i.pop();let a=-(o.depth+1);i.unshift(a);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let p=o.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;i.indexOf(f)>-1?a=f:o.before(f)==h&&i.splice(1,0,-f)}let l=i.indexOf(a),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==r.openStart)break;f=p.content}for(let f=u-1;f>=0;f--){let h=c[f].type,p=boe(h);if(p&&o.node(l).type!=h)u=f;else if(p||!h.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),p=c[h];if(p)for(let g=0;g<i.length;g++){let y=i[(g+l)%i.length],w=!0;y<0&&(w=!1,y=-y);let x=o.node(y-1),C=o.index(y-1);if(x.canReplaceWith(C,C,p.type,p.marks))return t.replace(o.before(y),w?s.after(y):n,new be(E7(r.content,0,r.openStart,h),h,r.openEnd))}}let d=t.steps.length;for(let f=i.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let h=i[f];h<0||(e=o.before(h),n=s.after(h))}}function E7(t,e,n,r,o){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(E7(s.content,e+1,n,r,s)))}if(e>r){let s=o.contentMatchAt(0),i=s.fillBefore(t).append(t);t=i.append(s.matchFragment(i).fillBefore(ue.empty,!0))}return t}function koe(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=goe(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new be(ue.from(r),0,0))}function xoe(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),s=A7(r,o);for(let i=0;i<s.length;i++){let a=s[i],l=i==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return t.delete(r.before(i),n);t.delete(e,n)}function A7(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let s=t.start(o);if(s<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(s==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==s-1)&&n.push(o)}return n}let O7=class Tp extends Sr{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return mr.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return mr.fromReplace(e,this.pos,this.pos+1,new be(ue.from(o),0,n.isLeaf?0:1))}getMap(){return qc.empty}invert(e){return new Tp(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Tp(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Tp(n.pos,n.attr,n.value)}};Sr.jsonID("attr",O7);let Wc=class extends Error{};Wc=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Wc.prototype=Object.create(Error.prototype);Wc.prototype.constructor=Wc;Wc.prototype.name="TransformError";class I7{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new x7}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Wc(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=be.empty){let o=Uk(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new be(ue.from(r),0,0))}delete(e,n){return this.replace(e,n,be.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return woe(this,e,n,r),this}replaceRangeWith(e,n,r){return koe(this,e,n,r),this}deleteRange(e,n){return xoe(this,e,n),this}lift(e,n){return aoe(this,e,n),this}join(e,n=1){return moe(this,e,n),this}wrap(e,n){return uoe(this,e,n),this}setBlockType(e,n=e,r,o=null){return doe(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return hoe(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new O7(e,n,r)),this}addNodeMark(e,n){return this.step(new zi(e,n)),this}removeNodeMark(e,n){if(!(n instanceof _t)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new zk(e,n)),this}split(e,n=1,r){return poe(this,e,n,r),this}addMark(e,n,r){return roe(this,e,n,r),this}removeMark(e,n,r){return ooe(this,e,n,r),this}clearIncompatible(e,n,r){return soe(this,e,n,r),this}}const Ly=Object.create(null);let Fe=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new N7(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=be.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let s=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:l,$to:c}=i[a],u=e.mapping.slice(s);e.replaceRange(u.map(l.pos),u.map(c.pos),a?be.empty:n),a==0&&Q_(e,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:i,$to:a}=o[s],l=e.mapping.slice(r),c=l.map(i.pos),u=l.map(a.pos);s?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),Q_(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new We(e):Ql(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let s=e.depth-1;s>=0;s--){let i=n<0?Ql(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Ql(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(i)return i}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new rl(e.node(0))}static atStart(e){return Ql(e,e,0,0,1)||new rl(e)}static atEnd(e){return Ql(e,e,e.content.size,e.childCount,-1)||new rl(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ly[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Ly)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ly[e]=n,n.prototype.jsonID=e,n}getBookmark(){return We.between(this.$anchor,this.$head).getBookmark()}};Fe.prototype.visible=!0;class N7{constructor(e,n){this.$from=e,this.$to=n}}let X_=!1;function Z_(t){!X_&&!t.parent.inlineContent&&(X_=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class We extends Fe{constructor(e,n=e){Z_(e),Z_(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Fe.near(r);let o=e.resolve(n.map(this.anchor));return new We(o.parent.inlineContent?o:r,r)}replace(e,n=be.empty){if(super.replace(e,n),n==be.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof We&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new L7(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new We(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let s=Fe.findFrom(n,r,!0)||Fe.findFrom(n,-r,!0);if(s)n=s.$head;else return Fe.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Fe.findFrom(e,-r,!0)||Fe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new We(e,n)}}Fe.jsonID("text",We);let L7=class R7{constructor(e,n){this.anchor=e,this.head=n}map(e){return new R7(e.map(this.anchor),e.map(this.head))}resolve(e){return We.between(e.resolve(this.anchor),e.resolve(this.head))}},Ge=class fd extends Fe{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),s=e.resolve(o);return r?Fe.near(s):new fd(s)}content(){return new be(ue.from(this.node),0,0)}eq(e){return e instanceof fd&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Coe(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new fd(e.resolve(n.anchor))}static create(e,n){return new fd(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};Ge.prototype.visible=!1;Fe.jsonID("node",Ge);let Coe=class $7{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new L7(r,r):new $7(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Ge.isSelectable(r)?new Ge(n):Fe.near(n)}},rl=class Ep extends Fe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=be.empty){if(n==be.empty){e.delete(0,e.doc.content.size);let r=Fe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ep(e)}map(e){return new Ep(e)}eq(e){return e instanceof Ep}getBookmark(){return _oe}};Fe.jsonID("all",rl);const _oe={map(){return this},resolve(t){return new rl(t)}};function Ql(t,e,n,r,o,s=!1){if(e.inlineContent)return We.create(t,n);for(let i=r-(o>0?0:1);o>0?i<e.childCount:i>=0;i+=o){let a=e.child(i);if(a.isAtom){if(!s&&Ge.isSelectable(a))return Ge.create(t,n-(o<0?a.nodeSize:0))}else{let l=Ql(t,a,n+o,o<0?a.childCount:0,o,s);if(l)return l}n+=a.nodeSize*o}return null}function Q_(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof di||o instanceof dn))return;let s=t.mapping.maps[r],i;s.forEach((a,l,c,u)=>{i==null&&(i=u)}),t.setSelection(Fe.near(t.doc.resolve(i),n))}const e2=1,jh=2,t2=4;class Soe extends I7{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|e2)&~jh,this.storedMarks=null,this}get selectionSet(){return(this.updated&e2)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=jh,this}ensureMarks(e){return _t.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&jh)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~jh,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||_t.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let i=this.doc.resolve(n);s=r==n?i.marks():i.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,s)),this.selection.empty||this.setSelection(Fe.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=t2,this}get scrolledIntoView(){return(this.updated&t2)>0}}function n2(t,e){return!e||!t?t:t.bind(e)}let hd=class{constructor(e,n,r){this.name=e,this.init=n2(n.init,r),this.apply=n2(n.apply,r)}};const Moe=[new hd("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new hd("selection",{init(t,e){return t.selection||Fe.atStart(e.doc)},apply(t){return t.selection}}),new hd("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new hd("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];let Ry=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Moe.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new hd(r.key,r.spec.state,r))})}},Toe=class pd{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let s=!1;for(let i=0;i<this.config.plugins.length;i++){let a=this.config.plugins[i];if(a.spec.appendTransaction){let l=o?o[i].n:0,c=o?o[i].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,i)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<i?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),s=!0}o&&(o[i]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new pd(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let s=r[o];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new Soe(this)}static create(e){let n=new Ry(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new pd(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new Ry(this.schema,e.plugins),r=n.fields,o=new pd(n);for(let s=0;s<r.length;s++){let i=r[s].name;o[i]=this.hasOwnProperty(i)?this[i]:r[s].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],s=o.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Ry(e.schema,e.plugins),s=new pd(o);return o.fields.forEach(i=>{if(i.name=="doc")s.doc=nl.fromJSON(e.schema,n.doc);else if(i.name=="selection")s.selection=Fe.fromJSON(s.doc,n.selection);else if(i.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==i.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[i.name]=c.fromJSON.call(l,e,n[a],s);return}}s[i.name]=i.init(e,s)}}),s}};function D7(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=D7(o,e,{})),n[r]=o}return n}class Kn{constructor(e){this.spec=e,this.props={},e.props&&D7(e.props,this,this.props),this.key=e.key?e.key.key:P7("plugin")}getState(e){return e[this.key]}}const $y=Object.create(null);function P7(t){return t in $y?t+"$"+ ++$y[t]:($y[t]=0,t+"$")}let Vr=class{constructor(e="key"){this.key=P7(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};const Yr=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},xf=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let r2=null;const Rs=function(t,e,n){let r=r2||(r2=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},_l=function(t,e,n,r){return n&&(o2(t,e,n,r,-1)||o2(t,e,n,r,1))},Eoe=/^(img|br|input|textarea|hr)$/i;function o2(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Zo(t))){let s=t.parentNode;if(!s||s.nodeType!=1||Ooe(t)||Eoe.test(t.nodeName)||t.contentEditable=="false")return!1;e=Yr(t)+(o<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?Zo(t):0}else return!1}}function Zo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Aoe(t,e,n){for(let r=e==0,o=e==Zo(t);r||o;){if(t==n)return!0;let s=Yr(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,o=o&&s==Zo(t)}}function Ooe(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Yg=function(t){return t.focusNode&&_l(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Ha(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Ioe(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Noe(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const gs=typeof navigator<"u"?navigator:null,s2=typeof document<"u"?document:null,ma=gs&&gs.userAgent||"",cb=/Edge\/(\d+)/.exec(ma),H7=/MSIE \d/.exec(ma),ub=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ma),yr=!!(H7||ub||cb),Qi=H7?document.documentMode:ub?+ub[1]:cb?+cb[1]:0,Po=!yr&&/gecko\/(\d+)/i.test(ma);Po&&+(/Firefox\/(\d+)/.exec(ma)||[0,0])[1];const db=!yr&&/Chrome\/(\d+)/.exec(ma),Fn=!!db,Loe=db?+db[1]:0,sr=!yr&&!!gs&&/Apple Computer/.test(gs.vendor),Kc=sr&&(/Mobile\/\w+/.test(ma)||!!gs&&gs.maxTouchPoints>2),Gr=Kc||(gs?/Mac/.test(gs.platform):!1),Roe=gs?/Win/.test(gs.platform):!1,Co=/Android \d/.test(ma),Xg=!!s2&&"webkitFontSmoothing"in s2.documentElement.style,$oe=Xg?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Doe(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function yi(t,e){return typeof t=="number"?t:t[e]}function Poe(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function i2(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let i=n||t.dom;i;i=xf(i)){if(i.nodeType!=1)continue;let a=i,l=a==s.body,c=l?Doe(s):Poe(a),u=0,d=0;if(e.top<c.top+yi(r,"top")?d=-(c.top-e.top+yi(o,"top")):e.bottom>c.bottom-yi(r,"bottom")&&(d=e.bottom-c.bottom+yi(o,"bottom")),e.left<c.left+yi(r,"left")?u=-(c.left-e.left+yi(o,"left")):e.right>c.right-yi(r,"right")&&(u=e.right-c.right+yi(o,"right")),u||d)if(l)s.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,h=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let p=a.scrollLeft-f,g=a.scrollTop-h;e={left:e.left-p,top:e.top-g,right:e.right-p,bottom:e.bottom-g}}if(l)break}}function Hoe(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let s=(e.left+e.right)/2,i=n+1;i<Math.min(innerHeight,e.bottom);i+=5){let a=t.root.elementFromPoint(s,i);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:B7(t.dom)}}function B7(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=xf(r));return e}function Boe({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;F7(n,r==0?0:r-e)}function F7(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:s}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Vl=null;function Foe(t){if(t.setActive)return t.setActive();if(Vl)return t.focus(Vl);let e=B7(t);t.focus(Vl==null?{get preventScroll(){return Vl={preventScroll:!0},!0}}:void 0),Vl||(Vl=!1,F7(e,0))}function j7(t,e){let n,r=2e8,o,s=0,i=e.top,a=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=Rs(u).getClientRects();else continue;for(let h=0;h<f.length;h++){let p=f[h];if(p.top<=i&&p.bottom>=a){i=Math.max(p.bottom,i),a=Math.min(p.top,a);let g=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(g<r){n=u,r=g,o=g&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,u.nodeType==1&&g&&(s=d+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?joe(n,o):!n||r&&n.nodeType==1?{node:t,offset:s}:j7(n,o)}function joe(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let s=xi(r,1);if(s.top!=s.bottom&&qk(e,s))return{node:t,offset:o+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function qk(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function zoe(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Voe(t,e,n){let{node:r,offset:o}=j7(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let i=r.getBoundingClientRect();s=i.left!=i.right&&n.left>(i.left+i.right)/2?1:-1}return t.docView.posFromDOM(r,o,s)}function Uoe(t,e,n,r){let o=-1;for(let s=e,i=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!i||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!i&&(i=!0,l.left>r.left||l.top>r.top?o=a.posBefore:(l.right<r.left||l.bottom<r.top)&&(o=a.posAfter)),!a.contentDOM&&o<0)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}s=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function z7(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=o;;){let i=t.childNodes[s];if(i.nodeType==1){let a=i.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(qk(e,c))return z7(i,e,c)}}if((s=(s+1)%r)==o)break}return t}function qoe(t,e){let n=t.dom.ownerDocument,r,o=0,s=Noe(n,e.left,e.top);s&&({node:r,offset:o}=s);let i=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!i||!t.dom.contains(i.nodeType!=1?i.parentNode:i)){let c=t.dom.getBoundingClientRect();if(!qk(e,c)||(i=z7(t.dom,e,c),!i))return null}if(sr)for(let c=i;r&&c;c=xf(c))c.draggable&&(r=void 0);if(i=zoe(i,e),r){if(Po&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let c=r.childNodes[o],u;c.nodeName=="IMG"&&(u=c.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&o++}r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=Uoe(t,r,o,e))}a==null&&(a=Voe(t,i,e));let l=t.docView.nearestDesc(i,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function a2(t){return t.top<t.bottom||t.left<t.right}function xi(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(a2(r))return r}return Array.prototype.find.call(n,a2)||t.getBoundingClientRect()}const Woe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function V7(t,e,n){let{node:r,offset:o,atom:s}=t.docView.domFromPos(e,n<0?-1:1),i=Xg||Po;if(r.nodeType==3)if(i&&(Woe.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let a=xi(Rs(r,o,o),n);if(Po&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let l=xi(Rs(r,o-1,o-1),-1);if(l.top==a.top){let c=xi(Rs(r,o,o+1),-1);if(c.top!=a.top)return Wu(c,c.left<l.left)}}return a}else{let a=o,l=o,c=n<0?1:-1;return n<0&&!o?(l++,c=-1):n>=0&&o==r.nodeValue.length?(a--,c=1):n<0?a--:l++,Wu(xi(Rs(r,a,l),c),c<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==Zo(r))){let a=r.childNodes[o-1];if(a.nodeType==1)return Dy(a.getBoundingClientRect(),!1)}if(s==null&&o<Zo(r)){let a=r.childNodes[o];if(a.nodeType==1)return Dy(a.getBoundingClientRect(),!0)}return Dy(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==Zo(r))){let a=r.childNodes[o-1],l=a.nodeType==3?Rs(a,Zo(a)-(i?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(l)return Wu(xi(l,1),!1)}if(s==null&&o<Zo(r)){let a=r.childNodes[o];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let l=a?a.nodeType==3?Rs(a,0,i?0:1):a.nodeType==1?a:null:null;if(l)return Wu(xi(l,-1),!0)}return Wu(xi(r.nodeType==3?Rs(r):r,-n),n>=0)}function Wu(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Dy(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function U7(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function Koe(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return U7(t,e,()=>{let{node:s}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let i=V7(t,o.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Rs(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?i.top-u.top>(u.bottom-i.top)*2:u.bottom-i.bottom>(i.bottom-u.top)*2))return!1}}return!0})}const Goe=/[\u0590-\u08ac]/;function Joe(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,s=!o,i=o==r.parent.content.size,a=t.domSelection();return!Goe.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:i:U7(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:g}=t.domSelectionRange(),y=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),y})}let l2=null,c2=null,u2=!1;function Yoe(t,e,n){return l2==e&&c2==n?u2:(l2=e,c2=n,u2=n=="up"||n=="down"?Koe(t,e,n):Joe(t,e,n))}const oo=0,d2=1,Ua=2,ys=3;class dh{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=oo,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,i;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(i)+i.size:this.posAtStart}else{let s,i;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(i):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>Yr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!1;break}if(s.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!0;break}if(s.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let s=this.getDesc(o),i;if(s&&(!n||s.node))if(r&&(i=s.nodeDOM)&&!(i.nodeType==1?i.contains(e.nodeType==1?e:e.parentNode):i==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let s=this.getDesc(o);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],s=r+o.size;if(r==e&&s!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(e<s)return o.descAt(e-r-o.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let s=0;r<this.children.length;r++){let i=this.children[r],a=s+i.size;if(a>e||i instanceof J7){o=e-s;break}s=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof q7&&s.side>=0;r--);if(n<=0){let s,i=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,i=!1);return s&&n&&i&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Yr(s.dom)+1:0}}else{let s,i=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,i=!1);return s&&i&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Yr(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,s=-1;for(let i=r,a=0;;a++){let l=this.children[a],c=i+l.size;if(o==-1&&e<=c){let u=i+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=i;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=Yr(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=Yr(d.dom);break}n+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let s=Math.min(e,n),i=Math.max(e,n);for(let f=0,h=0;f<this.children.length;f++){let p=this.children[f],g=h+p.size;if(s>h&&i<g)return p.setSelection(e-h-p.border,n-h-p.border,r,o);h=g}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.getSelection(),u=!1;if((Po||sr)&&e==n){let{node:f,offset:h}=a;if(f.nodeType==3)u=!!(h&&f.nodeValue[h-1]==`
18`);else{let p=f.childNodes[h-1];u=p&&(p.nodeName=="BR"||p.contentEditable=="false")}}if(Po&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let f=c.focusNode.childNodes[c.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||u&&sr)&&_l(a.node,a.offset,c.anchorNode,c.anchorOffset)&&_l(l.node,l.offset,c.focusNode,c.focusOffset))return;let d=!1;if((c.extend||e==n)&&!u){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(e>n){let h=a;a=l,l=h}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let s=this.children[o],i=r+s.size;if(r==i?e<=i&&n>=r:e<i&&n>r){let a=r+s.border,l=i-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==i?Ua:d2,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=ys:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Ua:ys}r=i}this.dirty=Ua}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ua:d2;n.dirty<r&&(n.dirty=r)}
18}get domAtom(){return!1}get ignoreForCoords(){return!1}}let q7=class extends dh{constructor(e,n,r,o){let s,i=n.type.toDOM;if(typeof i=="function"&&(i=i(r,()=>{if(!s)return o;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(i.nodeType!=1){let a=document.createElement("span");a.appendChild(i),i=a}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==oo&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}};class Xoe extends dh{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}let Pm=class fb extends dh{constructor(e,n,r,o){super(e,[],r,o),this.mark=n}static create(e,n,r,o){let s=o.nodeViews[n.type.name],i=s&&s(n,o,r);return(!i||!i.dom)&&(i=ch.renderSpec(document,n.type.spec.toDOM(n,r))),new fb(e,n,i.dom,i.contentDOM||i.dom)}parseRule(){return this.dirty&ys||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=ys&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=oo){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=oo}}slice(e,n,r){let o=fb.create(this.parent,this.mark,!0,r),s=this.children,i=this.size;n<i&&(s=mb(s,n,i,r)),e>0&&(s=mb(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=o;return o.children=s,o}},xc=class W7 extends dh{constructor(e,n,r,o,s,i,a,l,c){super(e,[],s,i),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,s,i){let a=s.nodeViews[n.type.name],l,c=a&&a(n,s,()=>{if(!l)return i;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=ch.renderSpec(document,n.type.spec.toDOM(n)));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Z7(u,r,n),c?l=new Zoe(e,n,r,o,u,d||null,f,c,s,i+1):n.isText?new K7(e,n,r,o,u,f,s):new W7(e,n,r,o,u,d||null,f,s,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ue.empty)}return e}matchesNode(e,n,r){return this.dirty==oo&&e.eq(this.node)&&pb(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}
vendor: 17,641 bytes, line 18
18updateChildren(e,n){let r=this.node.inlineContent,o=n,s=e.composing?this.localCompositionInfo(e,n):null,i=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new ese(this,i&&i.node,e);rse(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?_t.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,e);let h;l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(h=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(c,u,d,h,e)||l.updateNextNode(c,u,d,e,f,o)||l.addNode(c,u,d,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ua)&&(i&&this.protectLocalComposition(e,i),Y7(this.contentDOM,this.children,e),Kc&&ose(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof We)||r<n||o>n+this.node.content.size)return null;let s=e.domSelectionRange(),i=sse(s.focusNode,s.focusOffset);if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let a=i.nodeValue,l=ise(this.node.content,a,r-n,o-n);return l<0?null:{node:i,pos:l,text:a}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let i=new Xoe(this,s,n,o);e.input.compositionNodes.push(i),this.children=mb(this.children,r,r+o.length,e,i)}update(e,n,r,o){return this.dirty==ys||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=oo}updateOuterDeco(e){if(pb(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=X7(this.dom,this.nodeDOM,hb(this.outerDeco,this.node,n),hb(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}};function f2(t,e,n,r,o){Z7(r,e,t);let s=new xc(void 0,t,e,n,r,r,r,o,0);return s.contentDOM&&s.updateChildren(o,0),s}let K7=class G7 extends xc{constructor(e,n,r,o,s,i,a){super(e,n,r,o,s,null,i,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==ys||this.dirty!=oo&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=oo||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=oo,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),s=document.createTextNode(o.text);return new G7(this.parent,o,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ys)}get domAtom(){return!1}},J7=class extends dh{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==oo&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}};class Zoe extends xc{constructor(e,n,r,o,s,i,a,l,c,u){super(e,n,r,o,s,i,a,c,u),this.spec=l}update(e,n,r,o){if(this.dirty==ys)return!1;if(this.spec.update){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,o),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Y7(t,e,n){let r=t.firstChild,o=!1;for(let s=0;s<e.length;s++){let i=e[s],a=i.dom;if(a.parentNode==t){for(;a!=r;)r=h2(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(i instanceof Pm){let l=r?r.previousSibling:t.lastChild;Y7(i.contentDOM,i.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=h2(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Ud=function(t){t&&(this.nodeName=t)};Ud.prototype=Object.create(null);const qa=[new Ud];function hb(t,e,n){if(t.length==0)return qa;let r=n?qa[0]:new Ud,o=[r];for(let s=0;s<t.length;s++){let i=t[s].type.attrs;if(i){i.nodeName&&o.push(r=new Ud(i.nodeName));for(let a in i){let l=i[a];l!=null&&(n&&o.length==1&&o.push(r=new Ud(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function X7(t,e,n,r){if(n==qa&&r==qa)return e;let o=e;for(let s=0;s<r.length;s++){let i=r[s],a=n[s];if(s){let l;a&&a.nodeName==i.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==i.nodeName||(l=document.createElement(i.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=qa[0]),o=l}Qoe(o,a||qa[0],i)}return o}function Qoe(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)o.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<o.length;s++)r.indexOf(o[s])==-1&&t.classList.add(o[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function Z7(t,e,n){return X7(t,t,qa,hb(e,n,t.nodeType!=1))}function pb(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function h2(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class ese{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=tse(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,s=this.stack.length>>1,i=Math.min(s,e.length);for(;o<i&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=oo,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[s])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Pm.create(this.top,e[s],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,r,o){let s=-1,i;if(o>=this.preMatch.index&&(i=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&i.matchesNode(e,n,r))s=this.top.children.indexOf(i,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,o,s){let i=this.top.children[o];return i.dirty==ys&&i.dom==i.contentDOM&&(i.dirty=Ua),i.update(e,n,r,s)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,s,i){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof xc){let c=this.preMatch.matched.get(l);if(c!=null&&c!=s)return!1;let u=l.dom,d,f=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=ys&&pb(n,l.outerDeco));if(!f&&l.update(e,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,e,n,r,o,i)))return this.top.children[this.index]=d,d.dirty=Ua,d.updateChildren(o,i+1),d.dirty=oo,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,s,i){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let a=xc.create(this.top,n,r,o,s,i);if(!a.contentDOM)return null;a.children=e.children,e.children=[],e.destroy();for(let l of a.children)l.parent=a;return a}addNode(e,n,r,o,s){let i=xc.create(this.top,e,n,r,o,s);i.contentDOM&&i.updateChildren(o,s+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let s=new q7(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Pm;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof K7)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((sr||Fn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new J7(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function tse(t,e){let n=e,r=n.children.length,o=t.childCount,s=new Map,i=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof Pm)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,s.set(a,o),i.push(a)}}return{index:o,matched:s,matches:i.reverse()}}function nse(t,e){return t.type.side-e.type.side}function rse(t,e,n,r){let o=e.locals(t),s=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(s,u),c),s+=u.nodeSize}return}let i=0,a=[],l=null;for(let c=0;;){if(i<o.length&&o[i].to==s){let p=o[i++],g;for(;i<o.length&&o[i].to==s;)(g||(g=[p])).push(o[i++]);if(g){g.sort(nse);for(let y=0;y<g.length;y++)n(g[y],c,!!l)}else n(p,c,!!l)}let u,d;if(l)d=-1,u=l,l=null;else if(c<t.childCount)d=c,u=t.child(c++);else break;for(let p=0;p<a.length;p++)a[p].to<=s&&a.splice(p--,1);for(;i<o.length&&o[i].from<=s&&o[i].to>s;)a.push(o[i++]);let f=s+u.nodeSize;if(u.isText){let p=f;i<o.length&&o[i].from<p&&(p=o[i].from);for(let g=0;g<a.length;g++)a[g].to<p&&(p=a[g].to);p<f&&(l=u.cut(p-s),u=u.cut(0,p-s),f=p,d=-1)}let h=u.isInline&&!u.isLeaf?a.filter(p=>!p.inline):a.slice();r(u,h,e.forChild(s,u),d),s=f}}function ose(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function sse(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=Zo(t)}else if(t.nodeType==1&&e<t.childNodes.length)t=t.childNodes[e],e=0;else return null}}function ise(t,e,n,r){for(let o=0,s=0;o<t.childCount&&s<=r;){let i=t.child(o++),a=s;if(s+=i.nodeSize,!i.isText)continue;let l=i.text;for(;o<t.childCount;){let c=t.child(o++);if(s+=c.nodeSize,!c.isText)break;l+=c.text}if(s>=n){let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function mb(t,e,n,r,o){let s=[];for(let i=0,a=0;i<t.length;i++){let l=t[i],c=a,u=a+=l.size;c>=n||u<=e?s.push(l):(c<e&&s.push(l.slice(0,e-c,r)),o&&(s.push(o),o=void 0),u>n&&s.push(l.slice(n-c,l.size,r)))}return s}function Wk(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),s=o&&o.size==0,i=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(i<0)return null;let a=r.resolve(i),l,c;if(Yg(n)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&Ge.isSelectable(u)&&o.parent&&!(u.isInline&&Aoe(n.focusNode,n.focusOffset,o.dom))){let d=o.posBefore;c=new Ge(i==d?a:r.resolve(d))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!c){let u=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;c=Kk(t,l,a,u)}return c}function Q7(t){return t.editable?t.hasFocus():tA(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Xs(t,e=!1){let n=t.state.selection;if(eA(t,n),!!Q7(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Fn){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&_l(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)lse(t);else{let{anchor:r,head:o}=n,s,i;p2&&!(n instanceof We)&&(n.$from.parent.inlineContent||(s=m2(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(i=m2(t,n.to))),t.docView.setSelection(r,o,t.root,e),p2&&(s&&g2(s),i&&g2(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&ase(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const p2=sr||Fn&&Loe<63;function m2(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(sr&&o&&o.contentEditable=="false")return Py(o);if((!o||o.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(o)return Py(o);if(s)return Py(s)}}function Py(t){return t.contentEditable="true",sr&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function g2(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function ase(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Q7(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function lse(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,Yr(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&yr&&Qi<=11&&(r.disabled=!0,r.disabled=!1)}function eA(t,e){if(e instanceof Ge){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(y2(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else y2(t)}function y2(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Kk(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||We.between(e,n,r)}function v2(t){return t.editable&&!t.hasFocus()?!1:tA(t)}function tA(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function cse(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return _l(e.node,e.offset,n.anchorNode,n.anchorOffset)}function gb(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),s=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return s&&Fe.findFrom(s,e)}function Ba(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function b2(t,e,n){let r=t.state.selection;if(r instanceof We){if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let o=gb(t.state,e);return o&&o instanceof Ge?Ba(t,o):!1}else if(!(Gr&&n.indexOf("m")>-1)){let o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,i;if(!s||s.isText)return!1;let a=e<0?o.pos-s.nodeSize:o.pos;return s.isAtom||(i=t.docView.descAt(a))&&!i.contentDOM?Ge.isSelectable(s)?Ba(t,
vendor: 4,355 bytes, line 18
18new Ge(e<0?t.state.doc.resolve(o.pos-s.nodeSize):o)):Xg?Ba(t,new We(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else{if(r instanceof Ge&&r.node.isInline)return Ba(t,new We(e>0?r.$to:r.$from));{let o=gb(t.state,e);return o?Ba(t,o):!1}}}function Hm(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function qd(t){let e=t.pmViewDesc;return e&&e.size==0&&(t.nextSibling||t.nodeName!="BR")}function Ku(t,e){return e<0?use(t):nA(t)}function use(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,s,i=!1;for(Po&&n.nodeType==1&&r<Hm(n)&&qd(n.childNodes[r])&&(i=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(qd(a))o=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(rA(n))break;{let a=n.previousSibling;for(;a&&qd(a);)o=n.parentNode,s=Yr(a),a=a.previousSibling;if(a)n=a,r=Hm(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}i?yb(t,n,r):o&&yb(t,o,s)}function nA(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=Hm(n),s,i;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(qd(a))s=n,i=++r;else break}else{if(rA(n))break;{let a=n.nextSibling;for(;a&&qd(a);)s=a.parentNode,i=Yr(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=Hm(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}s&&yb(t,s,i)}function rA(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function yb(t,e,n){let r=t.domSelection();if(Yg(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Xs(t)},50)}function w2(t,e){let n=t.state.doc.resolve(e);if(!(Fn||Roe)&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(o.left-r.left)>1)return o.left<r.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(o.left-r.left)>1)return o.left>r.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function k2(t,e,n){let r=t.state.selection;if(r instanceof We&&!r.empty||n.indexOf("s")>-1||Gr&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let i=gb(t.state,e);if(i&&i instanceof Ge)return Ba(t,i)}if(!o.parent.inlineContent){let i=e<0?o:s,a=r instanceof rl?Fe.near(i,e):Fe.findFrom(i,e);return a?Ba(t,a):!1}return!1}function x2(t,e){if(!(t.state.selection instanceof We))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let i=t.state.tr;return e<0?i.delete(n.pos-s.nodeSize,n.pos):i.delete(n.pos,n.pos+s.nodeSize),t.dispatch(i),!0}return!1}function C2(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function dse(t){if(!sr||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;C2(t,r,"true"),setTimeout(()=>C2(t,r,"false"),20)}return!1}function fse(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function hse(t,e){let n=e.keyCode,r=fse(e);if(n==8||Gr&&n==72&&r=="c")return x2(t,-1)||Ku(t,-1);if(n==46||Gr&&n==68&&r=="c")return x2(t,1)||Ku(t,1);if(n==13||n==27)return!0;if(n==37||Gr&&n==66&&r=="c"){let o=n==37?w2(t,t.state.selection.from)=="ltr"?-1:1:-1;return b2(t,o,r)||Ku(t,o)}else if(n==39||Gr&&n==70&&r=="c"){let o=n==39?w2(t,t.state.selection.from)=="ltr"?1:-1:1;return b2(t,o,r)||Ku(t,o)}else{if(n==38||Gr&&n==80&&r=="c")return k2(t,-1,r)||Ku(t,-1);if(n==40||Gr&&n==78&&r=="c")return dse(t)||k2(t,1,r)||nA(t);if(r==(Gr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function oA(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:o,openEnd:s}=e;for(;o>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,s--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let i=t.someProp("clipboardSerializer")||ch.fromSchema(t.state.schema),a=uA(),l=a.createElement("div");l.appendChild(i.serializeFragment(r,{document:a}));
vendor: 4,172 bytes, lines 18-21
18let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=cA[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=a.createElement(u[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${s}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
19
20`);return{dom:l,text:f}}function sA(t,e,n,r,o){let s=o.parent.type.spec.code,i,a;if(!n&&!e)return null;let l=e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,s||r,t)}),s)return e?new be(ue.from(t.state.schema.text(e.replace(/\r\n?/g,`
21`))),0,0):be.empty;let d=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(d)a=d;else{let f=o.marks(),{schema:h}=t.state,p=ch.fromSchema(h);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=i.appendChild(document.createElement("p"));g&&y.appendChild(p.serializeNode(h.text(g,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),i=gse(n),Xg&&yse(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=i.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;i=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Fk.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!pse.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)a=vse(_2(a,+u[1],+u[2]),u[4]);else if(a=be.maxOpen(mse(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let h=a.content.firstChild;d<a.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=a.content.lastChild;f<a.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);a=_2(a,d,f)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const pse=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function mse(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(i=>{if(!s)return;let a=r.findWrapping(i.type),l;if(!a)return s=null;if(l=s.length&&o.length&&aA(a,o,i,s[s.length-1],0))s[s.length-1]=l;else{s.length&&(s[s.length-1]=lA(s[s.length-1],o.length));let c=iA(i,a);s.push(c),r=r.matchType(c.type),o=a}}),s)return ue.from(s)}return t}function iA(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ue.from(t));return t}function aA(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let s=aA(t,e,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(ue.from(iA(n,t,o+1))))}}function lA(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,lA(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(ue.empty,!0);return t.copy(n.append(r))}function vb(t,e,n,r,o,s){let i=e<0?t.firstChild:t.lastChild,a=i.content;return t.childCount>1&&(s=0),o<r-1&&(a=vb(a,e,n,r,o+1,s)),o>=n&&(a=e<0?i.contentMatchAt(0).fillBefore(a,s<=o).append(a):a.append(i.contentMatchAt(i.childCount).fillBefore(ue.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,i.copy(a))}function _2(t,e,n){return e<t.openStart&&(t=new be(vb(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new be(vb(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const cA={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let S2=null;function uA(){return S2||(S2=document.implementation.createHTMLDocument("title"))}function gse(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=uA().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&cA[r[1].toLowerCase()])&&(t=o.map(s=>"<"+s+">").join("")+t+o.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=t,o)for(let s=0;s<o.length;s++)n=n.querySelector(o[s])||n;return n}function yse(t){let e=t.querySelectorAll(Fn?"span:not([class]):not
21([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function vse(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:s,openEnd:i}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=ue.from(l.create(r[a+1],o)),s++,i++}return new be(o,s,i)}const ir={},ar={},bse={touchstart:!0,touchmove:!0};class wse{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function kse(t){for(let e in ir){let n=ir[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Cse(t,r)&&!Gk(t,r)&&(t.editable||!(r.type in ar))&&n(t,r)},bse[e]?{passive:!0}:void 0)}sr&&t.dom.addEventListener("input",()=>null),bb(t)}function Vi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function xse(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function bb(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Gk(t,r))})}function Gk(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Cse(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function _se(t,e){!Gk(t,e)&&ir[e.type]&&(t.editable||!(e.type in ar))&&ir[e.type](t,e)}ar.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!fA(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Co&&Fn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Kc&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,Ha(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||hse(t,n)?n.preventDefault():Vi(t,"key")};ar.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ar.keypress=(t,e)=>{let n=e;if(fA(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Gr&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof We)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function Zg(t){return{left:t.clientX,top:t.clientY}}function Sse(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Jk(t,e,n,r,o){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let i=s.depth+1;i>0;i--)if(t.someProp(e,a=>i>s.depth?a(t,n,s.nodeAfter,s.before(i),o,!0):a(t,n,s.node(i),s.before(i),o,!1)))return!0;return!1}function Cc(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Mse(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Ge.isSelectable(r)?(Cc(t,new Ge(n)),!0):!1}function Tse(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Ge&&(r=n.node);let s=t.state.doc.resolve(e);for(let i=s.depth+1;i>0;i--){let a=i>s.depth?s.nodeAfter:s.node(i);if(Ge.isSelectable(a)){r&&n.$from.depth>0&&i>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?o=s.before(n.$from.depth):o=s.before(i);break}}return o!=null?(Cc(t,Ge.create(t.state.doc,o)),!0):!1}function Ese(t,e,n,r,o){return Jk(t,"handleClickOn",e,n,r)||t.someProp("handleClick",
vendor: 4,836 bytes, line 21
21s=>s(t,e,r))||(o?Tse(t,n):Mse(t,n))}function Ase(t,e,n,r){return Jk(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function Ose(t,e,n,r){return Jk(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||Ise(t,n,r)}function Ise(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Cc(t,We.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let s=o.depth+1;s>0;s--){let i=s>o.depth?o.nodeAfter:o.node(s),a=o.before(s);if(i.inlineContent)Cc(t,We.create(r,a+1,a+1+i.content.size));else if(Ge.isSelectable(i))Cc(t,Ge.create(r,a));else continue;return!0}}function Yk(t){return Bm(t)}const dA=Gr?"metaKey":"ctrlKey";ir.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Yk(t),o=Date.now(),s="singleClick";o-t.input.lastClick.time<500&&Sse(n,t.input.lastClick)&&!n[dA]&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s};let i=t.posAtCoords(Zg(n));i&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Nse(t,i,n,!!r)):(s=="doubleClick"?Ase:Ose)(t,i.pos,i.inside,n)?n.preventDefault():Vi(t,"pointer"))};class Nse{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[dA],this.allowDefault=r.shiftKey;let s,i;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),i=n.inside;else{let u=e.state.doc.resolve(n.pos);s=u.parent,i=u.depth?u.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof Ge&&c.from<=i&&c.to>i)&&(this.mightDrag={node:s,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Po&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Vi(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Xs(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Zg(e))),this.updateAllowDefault(e),this.allowDefault||!n?Vi(this.view,"pointer"):Ese(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||sr&&this.mightDrag&&!this.mightDrag.node.isAtom||Fn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Cc(this.view,Fe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Vi(this.view,"pointer")}move(e){this.updateAllowDefault(e),Vi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}ir.touchstart=t=>{t.input.lastTouch=Date.now(),Yk(t),Vi(t,"pointer")};ir.touchmove=t=>{t.input.lastTouch=Date.now(),Vi(t,"pointer")};ir.contextmenu=t=>Yk(t);function fA(t,e){return t.composing?!0:sr&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Lse=Co?5e3:-1;ar.compositionstart=ar.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Bm(t,!0),t.markCursor=null;else if(Bm(t),Po&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,s=r.focusOffset;o&&o.nodeType==1&&s!=0;){let i=s<0?o.lastChild:o.childNodes[s-1];if(!i)break;if(i.nodeType==3){t.domSelection().collapse(i,i.nodeValue.length);break}else o=i,s=-1}}t.input.composing=!0}hA(t,Lse)};ar.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionID++,hA(t,20)
21)};function hA(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Bm(t),e))}function pA(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Rse());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Rse(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Bm(t,e=!1){if(!(Co&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),pA(t),e||t.docView&&t.docView.dirty){let n=Wk(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function $se(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Gc=yr&&Qi<15||Kc&&$oe<604;ir.copy=ar.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let s=Gc?null:n.clipboardData,i=r.content(),{dom:a,text:l}=oA(t,i);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):$se(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Dse(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Pse(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Cf(t,r.value,null,t.input.shiftKey,e):Cf(t,r.textContent,r.innerHTML,t.input.shiftKey,e)},50)}function Cf(t,e,n,r,o){let s=sA(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,s||be.empty)))return!0;if(!s)return!1;let i=Dse(s),a=i?t.state.tr.replaceSelectionWith(i,t.input.shiftKey):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}ar.paste=(t,e)=>{let n=e;if(t.composing&&!Co)return;let r=Gc?null:n.clipboardData;r&&Cf(t,r.getData("text/plain"),r.getData("text/html"),t.input.shiftKey,n)?n.preventDefault():Pse(t,n)};class Hse{constructor(e,n){this.slice=e,this.move=n}}const mA=Gr?"altKey":"ctrlKey";ir.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,s=o.empty?null:t.posAtCoords(Zg(n));if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof Ge?o.to-1:o.to))){if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Ge.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let c=t.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=t.docView&&t.dispatch(t.state.tr.setSelection(Ge.create(t.state.doc,c.posBefore)))}}let i=t.state.selection.content(),{dom:a,text:l}=oA(t,i);n.dataTransfer.clearData(),n.dataTransfer.setData(Gc?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Gc||n.dataTransfer.setData("text/plain",l),t.dragging=new Hse(i,!n[mA])};ir.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ar.dragover=ar.dragenter=(t,e)=>e.preventDefault();ar.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(Zg(n));if(!o)return;let s=t.state.doc.resolve(o.pos),i=r&&r.slice;i?t.someProp("transformPasted",p=>{i=p(i,t)}):i=sA(t,n.dataTransfer.getData(Gc?"Text":"text/plain"),Gc?null:n.dataTransfer.getData("text/html"),!1,s);let a=!!(r&&!n[mA]);if(t.someProp("handleDrop",p=>p(t,n,i||be.empty,a))){n.preventDefault();return}if(!i)return;n.preventDefault();let l=i?S7(t.state.doc,s.pos,i):s.pos;l==null&&(l=s.pos);let c=t.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,i.content.firstChild):c.replaceRange(u,u,i),c.doc.eq(f))return;let h=c.doc.resolve(u);if(d&&Ge.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new Ge(h));else{let p=c.mapping.map(l);
vendor: 42,137 bytes, lines 21-22
21c.mapping.maps[c.mapping.maps.length-1].forEach((g,y,w,x)=>p=x),c.setSelection(Kk(t,h,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};ir.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Xs(t)},20))};ir.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};ir.beforeinput=(t,e)=>{if(Fn&&Co&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Ha(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in ar)ir[t]=ar[t];function _f(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}let Bse=class gA{constructor(e,n){this.toDOM=e,this.spec=n||ol,this.side=this.spec.side||0}map(e,n,r,o){let{pos:s,deleted:i}=e.mapResult(n.from+o,this.side<0?-1:1);return i?null:new fi(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof gA&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&_f(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Wd=class wb{constructor(e,n){this.attrs=e,this.spec=n||ol}map(e,n,r,o){let s=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,i=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return s>=i?null:new fi(s,i,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof wb&&_f(this.attrs,e.attrs)&&_f(this.spec,e.spec)}static is(e){return e.type instanceof wb}destroy(){}},Fse=class yA{constructor(e,n){this.attrs=e,this.spec=n||ol}map(e,n,r,o){let s=e.mapResult(n.from+o,1);if(s.deleted)return null;let i=e.mapResult(n.to+o,-1);return i.deleted||i.pos<=s.pos?null:new fi(s.pos-r,i.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),s;return o==n.from&&!(s=e.child(r)).isText&&o+s.nodeSize==n.to}eq(e){return this==e||e instanceof yA&&_f(this.attrs,e.attrs)&&_f(this.spec,e.spec)}destroy(){}},fi=class md{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new md(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new md(e,e,new Bse(n,r))}static inline(e,n,r,o){return new md(e,n,new Wd(r,o))}static node(e,n,r,o){return new md(e,n,new Fse(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Wd}};const ec=[],ol={};let vr=class Ci{constructor(e,n){this.local=e.length?e:ec,this.children=n.length?n:ec}static create(e,n){return n.length?Fm(n,e,0,ol):$n}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,s){for(let i=0;i<this.local.length;i++){let a=this.local[i];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<n&&this.children[i+1]>e){let a=this.children[i]+1;this.children[i+2].findInner(e-a,n-a,r,o+a,s)}}map(e,n,r){return this==$n||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ol)}mapInner(e,n,r,o,s){let i;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,o);l&&l.type.valid(n,l)?(i||(i=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?jse(this.children,i||[],e,n,r,o,s):i?new Ci(i.sort(sl),ec):$n}add(e,n){return n.length?this==$n?Ci.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,s=0;e.forEach((a,l)=>{let c=l+r,u;if(u=bA(n,a,c)){for(o||(o=this.children.slice());s<o.length&&o[s]<l;)s+=3;o[s]==l?o[s+2]=o[s+2].addInner(a,u,c+1):o.splice(s,0,l,l+a.nodeSize,Fm(u,a,c+1,ol)),s+=3}});let i=vA(s?wA(n):n,-r);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||i.splice(a--,1);return new Ci(i.length?this.local.concat(i).sort(sl):this.local,o||this.children)}remove(e){return e.length==0||this==$n?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let s=0;s<r.length;s+=3){let i,a=r[s]+n,l=r[s+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>a&&d.to<l&&(e[u]=null,(i||(i=[])).push(d));if(!i)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(i,a+1);c!=$n?r[s+2]=c:(r.splice(s,3),s-=3)}if(o.length){for(let s=0,i;s<e.length;s++)if(i=e[s])for(let a=0;a<o.length;a++)o[a].eq(i,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new Ci(o,r):$n}forChild(e,n){if(this==$n)return this;if(n.isLeaf)return Ci.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,i=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<i&&l.to>s&&l.type instanceof Wd){let c=Math.max(s,l.from)-s,u=Math.min(i,l.to)-s;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new Ci(o.sort(sl),ec);return r?new Ri([a,r]):a}return r||$n}eq(e){if(this==e)return!0;if(!(e instanceof Ci)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Xk(this.localsInner(e))}localsInner(e){if(this==$n)return ec;if(e.inlineContent||!this.local.some(Wd.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Wd||n.push(this.local[r]);return n}};vr.empty=new vr([],[]);vr.removeOverlap=Xk;const $n=vr.empty;class Ri{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,ol));return Ri.from(r)}forChild(e,n){if(n.isLeaf)return vr.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(e,n);s!=$n&&(s instanceof Ri?r=r.concat(s.members):r.push(s))}return Ri.from(r)}eq(e){if(!(e instanceof Ri)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let s=this.members[o].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let i=0;i<s.length;i++)n.push(s[i])}}return n?Xk(r?n:n.sort(sl)):ec}static from(e){switch(e.length){case 0:return $n;case 1:return e[0];default:return new Ri(e.every(n=>n instanceof vr)?e:e.reduce((n,r)=>n.concat(r instanceof vr?r:r.members),[]))}}}function jse(t,e,n,r,o,s,i){let a=t.slice();for(let c=0,u=s;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,h,p,g)=>{let y=g-p-(h-f);for(let w=0;w<a.length;w+=3){let x=a[w+1];if(x<0||f>x+u-d)continue;let C=a[w]+u-d;h>=C?a[w+1]=f<=C?-2:-1:p>=o&&y&&(a[w]+=y,a[w+1]+=y)}d+=y}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+s),d=u-o;if(d<0||d>=r.content.size){l=!0;continue}let f=n.map(t[c+1]+s,-1),h=f-o,{index:p,offset:g}=r.content.findIndex(d),y=r.maybeChild(p);if(y&&g==d&&g+y.nodeSize==h){let w=a[c+2].mapInner(n,y,u+1,t[c]+s+1,i);w!=$n?(a[c]=d,a[c+1]=h,a[c+2]=w):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=zse(a,t,e,n,o,s,i),u=Fm(c,r,0,i);e=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let h=u.children[d];for(;f<a.length&&a[f]<h;)f+=3;a.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new vr(e.sort(sl),a)}function vA(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new fi(o.from+e,o.to+e,o.type))}return n}function zse(t,e,n,r,o,s,i){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,o,c);d?n.push(d):i.onRemove&&i.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function bA(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let s=0,i;s<t.length;s++)(i=t[s])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),t[s]=null);return o}function wA(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Fm(t,e,n,r){let o=[],s=!1;e.forEach((a,l)=>{let c=bA(t,a,l+n);if(c){s=!0;let u=Fm(c,a,n+l+1,r);u!=$n&&o.push(l,l+a.nodeSize,u)}});let i=vA(s?wA(t):t,-n).sort(sl);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||(r.onRemove&&r.onRemove(i[a].spec),i.splice(a--,1));return i.length||o.length?new vr(i,o):$n}function sl(t,e){return t.from-e.from||t.to-e.to}function Xk(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let s=e[o];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[o]=s.copy(s.from,r.to),M2(e,o+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),M2(e,o,r.copy(s.from,r.to)));break}}}return e}function M2(t,e,n){for(;e<t.length&&sl(n,t[e])>0;)e++;t.splice(e,0,n)}function Hy(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=$n&&e.push(r)}),t.cursorWrapper&&e.push(vr.create(t.state.doc,[t.cursorWrapper.deco])),Ri.from(e)}const Vse={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Use=yr&&Qi<=11;class qse{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Wse{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new qse,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);yr&&Qi<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),Use&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Vse)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(v2(this.view)){if(this.suppressingSelectionUpdates)return Xs(this.view);if(yr&&Qi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&_l(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=xf(s))n.add(s);for(let s=e.anchorNode;s;s=xf(s))if(n.has(s)){r=s;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.observer?this.observer.takeRecords():[];this.queue.length&&(n=this.queue.concat(n),this.queue.length=0);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&v2(e)&&!this.ignoreSelectionChange(r),s=-1,i=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(s=s<0?d.from:Math.min(d.from,s),i=i<0?d.to:Math.max(d.to,i),d.typeOver&&(a=!0))}if(Po&&l.length>1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;s<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Yg(r)&&(c=Wk(e))&&c.eq(Fe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Xs(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||o)&&(s>-1&&(e.docView.markDirty(s,i),Kse(e)),this.handleDOMChange(s,i,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Xs(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++)n.push(e.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,s=e.nextSibling;if(yr&&Qi<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let i=o&&o.parentNode==e.target?Yr(o)+1:0,a=r.localPosFromDOM(e.target,i,-1),l=s&&s.parentNode==e.target?Yr(s):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let T2=new WeakMap,E2=!1;function Kse(t){if(!T2.has(t)&&(T2.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Po,E2)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),E2=!0}}function Gse(t){let e;function n(l){l.preventDefault(),l.stopImmediatePropagation(),e=l.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0);let r=e.startContainer,o=e.startOffset,s=e.endContainer,i=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return _l(a.node,a.offset,s,i)&&([r,o,s,i]=[s,i,r,o]),{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:i}}function Jse(t,e,n){let{node:r,fromOffset:o,toOffset:s,from:i,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Yg(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Fn&&t.input.lastKeyCode===8)for(let y=s;y>o;y--){let w=r.childNodes[y-1],x=w.pmViewDesc;if(w.nodeName=="BR"&&!x){s=y;break}if(!x||x.size)break}let d=t.state.doc,f=t.someProp("domParser")||Fk.fromSchema(t.state.schema),h=d.resolve(i),p=null,g=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:Yse,context:h});if(c&&c[0].pos!=null){let y=c[0].pos,w=c[1]&&c[1].pos;w==null&&(w=y),p={anchor:y+i,head:w+i}}return{doc:g,sel:p,from:i,to:a}}function Yse(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(sr&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||sr&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Xse=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Zse(t,e,n,r,o){if(e<0){let T=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,A=Wk(t,T);if(A&&!t.state.selection.eq(A)){if(Fn&&Co&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",D=>D(t,Ha(13,"Enter"))))return;let N=t.state.tr.setSelection(A);T=="pointer"?N.setMeta("pointer",!0):T=="key"&&N.scrollIntoView(),t.composing&&N.setMeta("composition",t.input.compositionID),t.dispatch(N)}return}let s=t.state.doc.resolve(e),i=s.sharedDepth(n);e=s.before(i+1),n=t.state.doc.resolve(n).after(i+1);let a=t.state.selection,l=Jse(t,e,n),c=t.state.doc,u=c.slice(l.from,l.to),d,f;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(d=t.state.selection.to,f="end"):(d=t.state.selection.from,f="start"),t.input.lastKeyCode=null;let h=tie(u.content,l.doc.content,l.from,d,f);if((Kc&&t.input.lastIOSEnter>Date.now()-225||Co)&&o.some(T=>T.nodeType==1&&!Xse.test(T.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",T=>T(t,Ha(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&a instanceof We&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))h={start:a.from,endA:a.to,endB:a.to};else{if(l.sel){let T=A2(t,t.state.doc,l.sel);if(T&&!T.eq(t.state.selection)){let A=t.state.tr.setSelection(T);t.composing&&A.setMeta("composition",t.input.compositionID),t.dispatch(A)}}return}if(Fn&&t.cursorWrapper&&l.sel&&l.sel.anchor==t.cursorWrapper.deco.from&&l.sel.head==l.sel.anchor){let T=h.endB-h.start;l.sel={anchor:l.sel.anchor+T,head:l.sel.anchor+T}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof We&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=l.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=l.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),yr&&Qi<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>l.from&&l.doc.textBetween(h.start-l.from-1,h.start-l.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let p=l.doc.resolveNoCache(h.start-l.from),g=l.doc.resolveNoCache(h.endB-l.from),y=c.resolve(h.start),w=p.sameParent(g)&&p.parent.inlineContent&&y.end()>=h.endA,x;if((Kc&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(T=>T.nodeName=="DIV"||T.nodeName=="P"))||!w&&p.pos<l.doc.content.size&&(x=Fe.findFrom(l.doc.resolve(p.pos+1),1,!0))&&x.head==g.pos)&&t.someProp("handleKeyDown",T=>T(t,Ha(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&eie(c,h.start,h.endA,p,g)&&t.someProp("handleKeyDown",T=>T(t,Ha(8,"Backspace")))){Co&&Fn&&t.domObserver.suppressSelectionUpdates();return}Fn&&Co&&h.endB==h.start&&(t.input.lastAndroidDelete=Date.now()),Co&&!w&&p.start()!=g.start()&&g.parentOffset==0&&p.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==h.endA&&(h.endB-=2,g=l.doc.resolveNoCache(h.endB-l.from),setTimeout(()=>{t.someProp("handleKeyDown",function(T){return T(t,Ha(13,"Enter"))})},20));let C=h.start,v=h.endA,S,E,M;if(w){if(p.pos==g.pos)yr&&Qi<=11&&p.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Xs(t),20)),S=t.state.tr.delete(C,v),E=c.resolve(h.start).marksAcross(c.resolve(h.endA));else if(h.endA==h.endB&&(M=Qse(p.parent.content.cut(p.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start()))))S=t.state.tr,M.type=="add"?S.addMark(C,v,M.mark):S.removeMark(C,v,M.mark);else if(p.parent.child(p.index()).isText&&p.index()==g.index()-(g.textOffset?0:1)){let T=p.parent.textBetween(p.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",A=>A(t,C,v,T)))return;S=t.state.tr.insertText(T,C,v)}}if(S||(S=t.state.tr.replace(C,v,l.doc.slice(h.start-l.from,h.endB-l.from))),l.sel){let T=A2(t,S.doc,l.sel);T&&!(Fn&&Co&&t.composing&&T.empty&&(h.start!=h.endB||t.input.lastAndroidDelete<Date.now()-100)&&(T.head==C||T.head==S.mapping.map(v)-1)||yr&&T.empty&&T.head==C)&&S.setSelection(T)}E&&S.ensureMarks(E),t.composing&&S.setMeta("composition",t.input.compositionID),t.dispatch(S.scrollIntoView())}function A2(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Kk(t,e.resolve(n.anchor),e.resolve(n.head))}function Qse(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,s=r,i,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)s=n[u].removeFromSet(s);if(o.length==1&&s.length==0)a=o[0],i="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&s.length==1)a=s[0],i="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(ue.from(c).eq(t))return{mark:a,type:i}}function eie(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||By(r,!0,!1)<o.pos)return!1;let s=t.resolve(e);if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let i=t.resolve(By(s,!0,!0));return!i.parent.isTextblock||i.pos>n||By(i,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(i.parent.content)}function By(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,o++}return o}function tie(t,e,n,r,o){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:i,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,s-Math.min(i,a));r-=i+l-s}if(i<s&&t.size<e.size){let l=r<=s&&r>=i?s-r:0;s-=l,a=s+(a-i),i=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,i=s+(i-a),a=s}return{start:s,endA:i,endB:a}}class nie{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new wse,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(R2),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=N2(this),I2(this),this.nodeViews=L2(this),this.docView=f2(this.state.doc,O2(this),Hy(this),this.dom,this),this.domObserver=new Wse(this,(r,o,s,i)=>Zse(this,r,o,s,i)),this.domObserver.start(),kse(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&bb(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(R2),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){let r=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(pA(this),s=!0),this.state=e;let i=r.plugins!=e.plugins||this._props.plugins!=n.plugins;if(i||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=L2(this);oie(f,this.nodeViews)&&(this.nodeViews=f,o=!0)}(i||n.handleDOMEvents!=this._props.handleDOMEvents)&&bb(this),this.editable=N2(this),I2(this);let a=Hy(this),l=O2(this),c=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",u=o||!this.docView.matchesNode(e.doc,l,a);(u||!e.selection.eq(r.selection))&&(s=!0);let d=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Hoe(this);if(s){this.domObserver.stop();let f=u&&(yr||Fn)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&rie(r.selection,e.selection);if(u){let h=Fn?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(e.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=f2(e.doc,l,a,this.dom,this)),h&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&cse(this))?Xs(this,f):(eA(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&Boe(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Ge){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&i2(this,n.getBoundingClientRect(),e)}else i2(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let i=0;i<this.directPlugins.length;i++){let a=this.directPlugins[i].props[e];if(a!=null&&(o=n?n(a):a))return o}let s=this.state.plugins;if(s)for(let i=0;i<s.length;i++){let a=s[i].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(yr){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Foe(this.dom),Xs(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}posAtCoords(e){return qoe(this,e)}coordsAtPos(e,n=1){return V7(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return Yoe(this,n||this.state,e)}pasteHTML(e,n){return Cf(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Cf(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(xse(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Hy(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return _se(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return sr&&this.root.nodeType===11&&Ioe(this.dom.ownerDocument)==this.dom?Gse(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function O2(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[fi.node(0,t.state.doc.content.size,e)]}function I2(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:fi.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function N2(t){return!t.someProp("editable",e=>e(t.state)===!1)}function rie(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function L2(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function oie(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function R2(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var ua={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},jm={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},sie=typeof navigator<"u"&&/Mac/.test(navigator.platform),iie=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Mn=0;Mn<10;Mn++)ua[48+Mn]=ua[96+Mn]=String(Mn);for(var Mn=1;Mn<=24;Mn++)ua[Mn+111]="F"+Mn;for(var Mn=65;Mn<=90;Mn++)ua[Mn]=String.fromCharCode(Mn+32),jm[Mn]=String.fromCharCode(Mn);for(var Fy in ua)jm.hasOwnProperty(Fy)||(jm[Fy]=ua[Fy]);function aie(t){var e=sie&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||iie&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?jm:ua)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const lie=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function cie(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,s,i;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))lie?i=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),i&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function uie(t){let e=Object.create(null);for(let n in t)e[cie(n)]=t[n];return e}function jy(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function die(t){return new Kn({props:{handleKeyDown:Zk(t)}})}function Zk(t){let e=uie(t);return function(n,r){let o=aie(r),s,i=e[jy(o,r)];if(i&&i(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[jy(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(s=ua[r.keyCode])&&s!=o){let a=e[jy(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const fie=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function hie(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset>0?null:n}const pie=(t,e,n)=>{let r=hie(t);if(!r)return!1;let o=kA(r);if(!o){let i=r.blockRange(),a=i&&Tu(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}let s=o.nodeBefore;if(!s.type.spec.isolating&&_A(t,o,e))return!0;if(r.parent.content.size==0&&(Jc(s,"end")||Ge.isSelectable(s))){let i=Uk(t.doc,r.before(),r.after(),be.empty);if(i&&i.slice.size<i.to-i.from){if(e){let a=t.tr.step(i);a.setSelection(Jc(s,"end")?Fe.findFrom(a.doc.resolve(a.mapping.map(o.pos,-1)),-1):Ge.create(a.doc,o.pos-s.nodeSize)),e(a.scrollIntoView())}return!0}}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1};function Jc(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const mie=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(r.parentOffset>0)return!1;s=kA(r)}let i=s&&s.nodeBefore;return!i||!Ge.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Ge.create(t.doc,s.pos-i.nodeSize)).scrollIntoView()),!0)};function kA(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function gie(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset<n.parent.content.size?null:n}const yie=(t,e,n)=>{let r=gie(t);if(!r)return!1;let o=xA(r);if(!o)return!1;let s=o.nodeAfter;if(_A(t,o,e))return!0;if(r.parent.content.size==0&&(Jc(s,"start")||Ge.isSelectable(s))){let i=Uk(t.doc,r.before(),r.after(),be.empty);if(i&&i.slice.size<i.to-i.from){if(e){let a=t.tr.step(i);a.setSelection(Jc(s,"start")?Fe.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):Ge.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),!0):!1},vie=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(r.parentOffset<r.parent.content.size)return!1;s=xA(r)}let i=s&&s.nodeAfter;return!i||!Ge.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Ge.create(t.doc,s.pos)).scrollIntoView()),!0)};function xA(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const bie=(t,e)=>{let n=t.selection,r=n instanceof Ge,o;if(r){if(n.node.isTextblock||!pa(t.doc,n.from))return!1;o=n.from}else if(o=_7(t.doc,n.from,-1),o==null)return!1;if(e){let s=t.tr.join(o);r&&s.setSelection(Ge.create(s.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},wie=(t,e)=>{let n=t.selection,r;if(n instanceof Ge){if(n.node.isTextblock||!pa(t.doc,n.to))return!1;r=n.to}else if(r=_7(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},kie=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),s=o&&Tu(o);return s==null?!1:(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)},xie=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
22`).scrollIntoView()),!0)};function CA(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Cie=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),i=CA(o.contentMatchAt(s));if(!i||!o.canReplaceWith(s,s,i))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,i.createAndFill());l.setSelection(Fe.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},_ie=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof rl||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=CA(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let i=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(i,s.createAndFill());a.setSelection(We.create(a.doc,i+1)),e(a.scrollIntoView())}return!0},Sie=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(kc(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Tu(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},Mie=(t,e)=>{let{$from:n,to:r}=t.selection,o,s=n.sharedDepth(r);return s==0?!1:(o=n.before(s),e&&e(t.tr.setSelection(Ge.create(t.doc,o))),!0)};function Tie(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,s=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(o.isTextblock||pa(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function _A(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,s,i;if(r.type.spec.isolating||o.type.spec.isolating)return!1;if(Tie(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(s=(i=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&i.matchType(s[0]||o.type).validEnd){if(n){let d=e.pos+o.nodeSize,f=ue.empty;for(let g=s.length-1;g>=0;g--)f=ue.from(s[g].create(null,f));f=ue.from(r.copy(f));let h=t.tr.step(new dn(e.pos-1,d,e.pos,d,new be(f,1,0),s.length,!0)),p=d+2*s.length;pa(h.doc,p)&&h.join(p),n(h.scrollIntoView())}return!0}let l=Fe.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&Tu(c);if(u!=null&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&Jc(o,"start",!0)&&Jc(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let h=o,p=1;for(;!h.isTextblock;h=h.firstChild)p++;if(d.canReplace(d.childCount,d.childCount,h.content)){if(n){let g=ue.empty;for(let w=f.length-1;w>=0;w--)g=ue.from(f[w].copy(g));let y=t.tr.step(new dn(e.pos-f.length,e.pos+o.nodeSize,e.pos+p,e.pos+o.nodeSize-p,new be(g,f.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function SA(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(e.tr.setSelection(We.create(e.doc,t<0?o.start(s):o.end(s)))),!0):!1}}const Eie=SA(-1),Aie=SA(1);function Oie(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),a=i&&Vk(i,t,e);return a?(r&&r(n.tr.wrap(i,a).scrollIntoView()),!0):!1}}function $2(t,e=null){return function(n,r){let o=!1;for(let s=0;s<n.selection.ranges.length&&!o;s++){let{$from:{pos:i},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(i,a,(l,c)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let s=n.tr;for(let i=0;i<n.selection.ranges.length;i++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[i];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Iie(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),a=!1,l=i;if(!i)return!1;if(i.depth>=2&&o.node(i.depth-1).type.compatibleContent(t)&&i.startIndex==0){if(o.index(i.depth-1)==0)return!1;let u=n.doc.resolve(i.start-2);l=new Rm(u,u,i.depth),i.endIndex<i.parent.childCount&&(i=new Rm(o,n.doc.resolve(s.end(i.depth)),i.depth)),a=!0}let c=Vk(l,t,e,i);return c?(r&&r(Nie(n.tr,i,c,a,t).scrollIntoView()),!0):!1}}function Nie(t,e,n,r,o){let s=ue.empty;for(let u=n.length-1;u>=0;u--)s=ue.from(n[u].type.create(n[u].attrs,s));t.step(new dn(e.start-(r?2:0),e.end,e.start,e.end,new be(s,0,0),n.length,!0));let i=0;for(let u=0;u<n.length;u++)n[u].type==o&&(i=u+1);let a=n.length-i,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&kc(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function Lie(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,i=>i.childCount>0&&i.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?Rie(e,n,t,s):$ie(e,n,s):!0:!1}}function Rie(t,e,n,r){let o=t.tr,s=r.end,i=r.$to.end(r.depth);s<i&&(o.step(new dn(s-1,i,s,i,new be(ue.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Rm(o.doc.resolve(r.$from.pos),o.doc.resolve(i),r.depth));const a=Tu(r);if(a==null)return!1;o.lift(r,a);let l=o.mapping.map(s,-1)-1;return pa(o.doc,l)&&o.join(l),e(o.scrollIntoView()),!0}function $ie(t,e,n){let r=t.tr,o=n.parent;for(let h=n.end,p=n.endIndex-1,g=n.startIndex;p>g;p--)h-=o.child(p).nodeSize,r.delete(h-1,h+1);let s=r.doc.resolve(n.start),i=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(a?0:1),u+1,i.content.append(l?ue.empty:ue.from(o))))return!1;let d=s.pos,f=d+i.nodeSize;return r.step(new dn(d-(a?1:0),f+(l?1:0),d+1,f-1,new be((a?ue.empty:ue.from(o.copy(ue.empty))).append(l?ue.empty:ue.from(o.copy(ue.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Die(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let i=s.startIndex;if(i==0)return!1;let a=s.parent,l=a.child(i-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=ue.from(c?t.create():null),d=new be(ue.from(t.create(null,ue.from(a.type.create(null,u)))),c?3:1,0),f=s.start,h=s.end;n(e.tr.step(new dn(f-(c?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}function Qg(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:s}=n;
vendor: 4,977 bytes, line 22
22return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}let e0=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:s}=r,i=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>{const u=l(...c)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(s),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:s}=this,{view:i}=o,a=[],l=!!e,c=e||s.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(c),a.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...p)=>{const g=this.buildProps(c,n),y=h(...p)(g);return a.push(y),d}])),run:u};return d}createCan(e){const{rawCommands:n,state:r}=this,o=!1,s=e||r.tr,i=this.buildProps(s,o);return{...Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...c)=>l(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(s,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:s}=this,{view:i}=o;s.storedMarks&&e.setStoredMarks(s.storedMarks);const a={tr:e,editor:o,view:i,state:Qg({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}};class Pie{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function Ee(t,e,n){return t.config[e]===void 0&&t.parent?Ee(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Ee(t.parent,e,n):null}):t.config[e]}function t0(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function MA(t){const e=[],{nodeExtensions:n,markExtensions:r}=t0(t),o=[...n,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage},l=Ee(i,"addGlobalAttributes",a);l&&l().forEach(c=>{c.types.forEach(u=>{Object.entries(c.attributes).forEach(([d,f])=>{e.push({type:u,name:d,attribute:{...s,...f}})})})})}),o.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage},l=Ee(i,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,d])=>{const f={...s,...d};typeof f?.default=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&f?.default===void 0&&delete f.default,e.push({type:i.name,name:u,attribute:f})})}),e}function yn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Rt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,s])=>{if(!r[o]){r[o]=s;return}o==="class"?r[o]=[r[o],s].join(" "):o==="style"?r[o]=[r[o],s].join("; "):r[o]=s}),r},{})}function kb(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Rt(n,r),{})}function TA(t){return typeof t=="function"}function et(t,e=void 0,...n){return TA(t)?e?t.bind(e)(...n):t(...n):t}function Hie(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Bie(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function D2(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((s,i)=>{const a=i.attribute.parseHTML?i.attribute.parseHTML(n):Bie(n.getAttribute(i.name));return a==null?s:{...s,[i.name]:a}},{});return{...r,...o}}}}function P2(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&Hie(n)?!1:n!=null))}function Fie(t,e){var n;const r=MA(t),{nodeExtensions:o,markExtensions:s}=t0(t),i=(n=o.find(c=>Ee(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(o.map(c=>{const u=r.filter(w=>w.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((w,x)=>{const C=Ee(x,"extendNodeSchema",d);return{...w,...C?C(c):{}}
22},{}),h=P2({...f,content:et(Ee(c,"content",d)),marks:et(Ee(c,"marks",d)),group:et(Ee(c,"group",d)),inline:et(Ee(c,"inline",d)),atom:et(Ee(c,"atom",d)),selectable:et(Ee(c,"selectable",d)),draggable:et(Ee(c,"draggable",d)),code:et(Ee(c,"code",d)),defining:et(Ee(c,"defining",d)),isolating:et(Ee(c,"isolating",d)),attrs:Object.fromEntries(u.map(w=>{var x;return[w.name,{default:(x=w?.attribute)===null||x===void 0?void 0:x.default}]}))}),p=et(Ee(c,"parseHTML",d));p&&(h.parseDOM=p.map(w=>D2(w,u)));const g=Ee(c,"renderHTML",d);g&&(h.toDOM=w=>g({node:w,HTMLAttributes:kb(w,u)}));const y=Ee(c,"renderText",d);return y&&(h.toText=y),[c.name,h]})),l=Object.fromEntries(s.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,w)=>{const x=Ee(w,"extendMarkSchema",d);return{...y,...x?x(c):{}}},{}),h=P2({...f,inclusive:et(Ee(c,"inclusive",d)),excludes:et(Ee(c,"excludes",d)),group:et(Ee(c,"group",d)),spanning:et(Ee(c,"spanning",d)),code:et(Ee(c,"code",d)),attrs:Object.from
22Entries(u.map(y=>{var w;return[y.name,{default:(w=y?.attribute)===null||w===void 0?void 0:w.default}]}))}),p=et(Ee(c,"parseHTML",d));p&&(h.parseDOM=p.map(y=>D2(y,u)));const g=Ee(c,"renderHTML",d);return g&&(h.toDOM=y=>g({mark:y,HTMLAttributes:kb(y,u)})),[c.name,h]}));return new Gre({topNode:i,nodes:a,marks:l})}function zy(t,e){return e.nodes[t]||e.marks[t]||null}function H2(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const jie=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,i,a)=>{var l,c;const u=((c=(l=o.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:o,pos:s,parent:i,index:a}))||o.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-s))}),n};function Qk(t){return Object.prototype.toString.call(t)==="[object RegExp]"}let n0=class{constructor(e){this.find=e.find,this.handler=e.handler}};const zie=(t,e)=>{if(Qk(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Vy(t){var e;const{editor:n,from:r,to:o,text:s,rules:i,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=jie(c)+s;return i.forEach(f=>{if(u)return;const h=zie(d,f.find);if(!h)return;const p=l.state.tr,g=Qg({state:l.state,transaction:p}),y={from:r-(h[0].length-s.length),to:o},{commands:w,chain:x,can:C}=new e0({editor:n,state:g});f.handler({state:g,range:y,match:h,commands:w,chain:x,can:C})===null||!p.steps.length||(p.setMeta(a,{transform:p,from:r,to:o,text:s}),l.dispatch(p),u=!0)}),u}function Vie(t){const{editor:e,rules:n}=t,r=new Kn({state:{init(){return null},apply(o,s){return o.getMeta(r)||(o.selectionSet||o.docChanged?null:s)}},props:{handleTextInput(o,s,i,a){return Vy({editor:e,from:s,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:s}=o.state.selection;s&&Vy({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,s){if(s.key!=="Enter")return!1;const{$cursor:i}=o.state.selection;return i?Vy({editor:e,from:i.pos,to:i.pos,text:`
23`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Uie(t){return typeof t=="number"}class qie{constructor(e){this.find=e.find,this.handler=e.handler}}const Wie=(t,e)=>{if(Qk(e))return[...t.matchAll(e)];const n=e(t);return n?n.map(r=>{const o=[r.text];return o.index=r.index,o.input=t,o.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(r.replaceWith)),o}):[]};function Kie(t){const{editor:e,state:n,from:r,to:o,rule:s}=t,{commands:i,chain:a,can:l}=new e0({editor:e,state:n}),c=[];return n.doc.nodesBetween(r,o,(u,d)=>{if(!u.isTextblock||u.type.spec.code)return;const f=Math.max(r,d),h=Math.min(o,d+u.content.size),p=u.textBetween(f-d,h-d,void 0,"");Wie(p,s.find).forEach(g=>{if(g.index===void 0)return;const y=f+g.index+1,w=y+g[0].length,x={from:n.tr.mapping.map(y),to:n.tr.mapping.map(w)},C=s.handler({state:n,range:x,match:g,commands:i,chain:a,can:l});c.push(C)})}),c.every(u=>u!==null)}function Gie(t){const{editor:e,rules:n}=t;let r=null,o=!1,s=!1;return n.map(i=>new Kn({view(a){const l=c=>{var u;r=!((u=a.dom.parentElement)===null||u===void 0)&&u.contains(c.target)?a.dom.parentElement:null};return window.addEventListener("dragstart",l),{destroy(){window.removeEventListener("dragstart",l)}}},props:{handleDOMEvents:{drop:a=>(s=r===a.dom.parentElement,!1),paste:(a,l)=>{var c;const u=(c=l.clipboardData)===null||c===void 0?void 0:c.getData("text/html");return o=!!(u!=null&&u.includes("data-pm-slice")),!1}}},appendTransaction:(a,l,c)=>{const u=a[0],d=u.getMeta("uiEvent")==="paste"&&!o,f=u.getMeta("uiEvent")==="drop"&&!s;if(!d&&!f)return;const h=l.doc.content.findDiffStart(c.doc.content),p=l.doc.content.findDiffEnd(c.doc.content);if(!Uie(h)||!p||h===p.b)return;const g=c.tr,y=Qg({state:c,transaction:g});if(!(!Kie({editor:e,state:y,from:Math.max(h-1,0),to:p.b-1,rule:i})||!g.steps.length))return g}}))}function Jie(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}let Yie=class gd{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=gd.resolve(e),this.schema=Fie(this.extensions,n),this.extensions.forEach(r=>{var o;this.editor.extensionStorage[r.name]=r.storage;const s={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:zy(r.name,this.schema)};r.type==="mark"&&(!((o=et(Ee(r,"keepOnSplit",s)))!==null&&o!==void 0)||o)&&this.splittableMarks.push(r.name);const i=Ee(r,"onBeforeCreate",s);i&&this.editor.on("beforeCreate",i);const a=Ee(r,"onCreate",s);a&&this.editor.on("create",a);const l=Ee(r,"onUpdate",s);l&&this.editor.on("update",l);const c=Ee(r,"onSelectionUpdate",s);c&&this.editor.on("selectionUpdate",c);const u=Ee(r,"onTransaction",s);u&&this.editor.on("transaction",u);const d=Ee(r,"onFocus",s);d&&this.editor.on("focus",d);const f=Ee(r,"onBlur",s);f&&this.editor.on("blur",f);const h=Ee(r,"onDestroy",s);h&&this.editor.on("destroy",h)})}static resolve(e){const n=gd.sort(gd.flatten(e)),r=Jie(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=Ee(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(e){return e.sort((n,r)=>{const o=Ee(n,"priority")||100,s=Ee(r,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:zy(n.name,this.schema)},o=Ee(n,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,n=gd.sort([...this.extensions].reverse()),r=[],o=[],s=n.map(i=>{const a={name:i.name,options:i.options,storage:i.storage,editor:e,type:zy(i.name,this.schema)},l=[],c=Ee(i,"addKeyboardShortcuts",a);let u={};if(i.type==="mark"&&i.config.exitable&&(u.ArrowRight=()=>ya.handleExit({editor:e,mark:i})),c){const g=Object.fromEntries(Object.entries(c()).map(([y,w])=>[y,()=>w({editor:e})]));u={...u,...g}}const d=die(u);l.push(d);const f=Ee(i,"addInputRules",a);H2(i,e.options.enableInputRules)&&f&&r.push(...f());const h=Ee(i,"addPasteRules",a);H2(i,e.options.enablePasteRules)&&h&&o.push(...h());const p=Ee(i,"addProseMirrorPlugins",a);if(p){const g=p();l.push(...g)}return l}).flat();return[Vie({editor:e,rules:r}),...Gie({editor:e,rules:o}),...s]}get attributes(){return MA(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=t0(this.extensions);return Object.fromEntries(n.filter(r=>!!Ee(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:yn(r.name,this.schema)},i=Ee(r,"addNodeView",s);if(!i)return[];const a=(l,c,u,d)=>{const f=kb(l,o);return i()({editor:e,node:l,getPos:u,decorations:d,HTMLAttributes:f,extension:r})};return[r.name,a]}
23))}};function Xie(t){return Object.prototype.toString.call(t).slice(8,-1)}function Uy(t){return Xie(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function r0(t,e){const n={...t};return Uy(t)&&Uy(e)&&Object.keys(e).forEach(r=>{Uy(e[r])?r in t?n[r]=r0(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}class Vn{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=et(Ee(this,"addOptions",{name:this.name}))),this.storage=et(Ee(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Vn(e)}configure(e={}){const n=this.extend();return n.options=r0(this.options,e),n.storage=et(Ee(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Vn(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=et(Ee(n,"addOptions",{name:n.name})),n.storage=et(Ee(n,"addStorage",{name:n.name,options:n.options})),n}}function EA(t,e,n){const{from:r,to:o}=e,{blockSeparator:s=`
24
25`,textSerializers:i={}}=n||{};let a="",l=!0;return t.nodesBetween(r,o,(c,u,d,f)=>{var h;const p=i?.[c.type.name];p?(c.isBlock&&!l&&(a+=s,l=!0),d&&(a+=p({node:c,pos:u,parent:d,index:f,range:e}))):c.isText?(a+=(h=c?.text)===null||h===void 0?void 0:h.slice(Math.max(r,u)-u,o-u),l=!1):c.isBlock&&!l&&(a+=s,l=!0)}),a}function AA(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const Zie=Vn.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Kn({key:new Vr("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:s}=o,i=Math.min(...s.map(c=>c.$from.pos)),a=Math.max(...s.map(c=>c.$to.pos)),l=AA(n);return EA(r,{from:i,to:a},{textSerializers:l})}}})]}}),Qie=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),eae=(t=!1)=>({commands:e})=>e.setContent("",t),tae=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:s,$to:i})=>{t.doc.nodesBetween(s.pos,i.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),f=c.resolve(u.map(l+a.nodeSize)),h=d.blockRange(f);if(!h)return;const p=Tu(h);if(a.type.isTextblock){const{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(h.start,g)}(p||p===0)&&e.lift(h,p)})}),!0},nae=t=>e=>t(e),rae=()=>({state:t,dispatch:e})=>_ie(t,e),oae=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(e){const i=o.before(s),a=o.after(s);t.delete(i,a).scrollIntoView()}return!0}return!1},sae=t=>({tr:e,state:n,dispatch:r})=>{const o=yn(t,n.schema),s=e.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===o){if(r){const a=s.before(i),l=s.after(i);e.delete(a,l).scrollIntoView()}return!0}return!1},iae=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},aae=()=>({state:t,dispatch:e})=>fie(t,e),lae=()=>({commands:t})=>t.keyboardShortcut("Enter"),cae=()=>({state:t,dispatch:e})=>Cie(t,e);function zm(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Qk(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function xb(t,e,n={}){return t.find(r=>r.type===e&&zm(r.attrs,n))}function uae(t,e,n={}){return!!xb(t,e,n)}function ex(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=xb([...r.node.marks],e,n);if(!o)return;let s=r.index,i=t.start()+r.offset,a=s+1,l=i+r.node.nodeSize;
25for(xb([...r.node.marks],e,n);s>0&&o.isInSet(t.parent.child(s-1).marks);)s-=1,i-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&uae([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:i,to:l}}function ga(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const dae=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const s=ga(t,r.schema),{doc:i,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const d=ex(l,s,e);if(d&&d.from<=c&&d.to>=u){const f=We.create(i,d.from,d.to);n.setSelection(f)}}return!0},fae=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function tx(t){return t instanceof We}function qs(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function OA(t,e=null){if(!e)return null;const n=Fe.atStart(t),r=Fe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,s=r.to;return e==="all"?We.create(t,qs(0,o,s),qs(t.content.size,o,s)):We.create(t,qs(e,o,s),qs(e,o,s))}function nx(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const hae=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{nx()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!tx(n.state.selection))return i(),!0;const a=OA(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),i()),!0},pae=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),mae=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e);function B2(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function Vm(t,e,n){if(n={slice:!0,parseOptions:{},...n},typeof t=="object"&&t!==null)try{return Array.isArray(t)&&t.length>0?ue.fromArray(t.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Vm("",e,n)}if(typeof t=="string"){const r=Fk.fromSchema(e);return n.slice?r.parseSlice(B2(t),n.parseOptions).content:r.parse(B2(t),n.parseOptions)}return Vm("",e,n)}function gae(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof di||o instanceof dn))return;const s=t.mapping.maps[r];let i=0;s.forEach((a,l,c,u)=>{i===0&&(i=u)}),t.setSelection(Fe.near(t.doc.resolve(i),n))}const yae=t=>t.toString().startsWith("<"),vae=(t,e,n)=>({tr:r,dispatch:o,editor:s})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const i=Vm(e,s.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(i.toString()==="<>")return!0;let{from:a,to:l}=typeof t=="number"?{from:t,to:t}:t,c=!0,u=!0;if((yae(i)?i:[i]).forEach(d=>{d.check(),c=c?d.isText&&d.marks.length===0:!1,u=u?d.isBlock:!1}),a===l&&u){const{parent:d}=r.doc.resolve(a);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(a-=1,l+=1)}c?Array.isArray(e)?r.insertText(e.map(d=>d.text||"").join(""),a,l):typeof e=="object"&&e&&e.text?r.insertText(e.text,a,l):r.insertText(e,a,l):r.replaceWith(a,l,i),n.updateSelection&&gae(r,r.steps.length-1,-1)}return!0},bae=()=>({state:t,dispatch:e})=>bie(t,e),wae=()=>({state:t,dispatch:e})=>wie(t,e),kae=()=>({state:t,dispatch:e})=>pie(t,e),xae=()=>({state:t,dispatch:e})=>yie(t,e);function IA(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Cae(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,s,i;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))nx()||IA()?i=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),i&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const _ae=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const s=Cae(t).split(/-(?!$)/),i=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l?.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function Sf(t,e,n={}){const{from:r,to:o,empty:s}=t.selection,i=e?yn(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(u,d)=>{if(u.isText)return;const f=Math.max(r,d),h=Math.min(o,d+u.nodeSize);a.push({node:u,from:f,to:h})});const l=o-r,c=a.filter(u=>
vendor: 4,114 bytes, line 25
25i?i.name===u.node.type.name:!0).filter(u=>zm(u.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((u,d)=>u+d.to-d.from,0)>=l}const Sae=(t,e={})=>({state:n,dispatch:r})=>{const o=yn(t,n.schema);return Sf(n,o,e)?kie(n,r):!1},Mae=()=>({state:t,dispatch:e})=>Sie(t,e),Tae=t=>({state:e,dispatch:n})=>{const r=yn(t,e.schema);return Lie(r)(e,n)},Eae=()=>({state:t,dispatch:e})=>xie(t,e);function o0(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function F2(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const Aae=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const a=o0(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=yn(t,r.schema)),a==="mark"&&(i=ga(t,r.schema)),o&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{s&&s===c.type&&n.setNodeMarkup(u,void 0,F2(c.attrs,e)),i&&c.marks.length&&c.marks.forEach(d=>{i===d.type&&n.addMark(u,u+c.nodeSize,i.create(F2(d.attrs,e)))})})}),!0):!1},Oae=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Iae=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),Nae=()=>({state:t,dispatch:e})=>mie(t,e),Lae=()=>({state:t,dispatch:e})=>vie(t,e),Rae=()=>({state:t,dispatch:e})=>Mie(t,e),$ae=()=>({state:t,dispatch:e})=>Aie(t,e),Dae=()=>({state:t,dispatch:e})=>Eie(t,e);function NA(t,e,n={}){return Vm(t,e,{slice:!1,parseOptions:n})}const Pae=(t,e=!1,n={})=>({tr:r,editor:o,dispatch:s})=>{const{doc:i}=r,a=NA(t,o.schema,n);return s&&r.replaceWith(0,i.content.size,a).setMeta("preventUpdate",!e),!0};function Hae(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function LA(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function rx(t){return e=>LA(e.$from,t)}function Bae(t,e){const n=ch.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Fae(t,e){const n={from:0,to:t.content.size};return EA(t,n,e)}function s0(t,e){const n=ga(e,t.schema),{from:r,to:o,empty:s}=t.selection,i=[];s?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{i.push(...l.marks)});const a=i.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function jae(t,e){const n=yn(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,a=>{s.push(a)});const i=s.reverse().find(a=>a.type.name===n.name);return i?{...i.attrs}:{}}function zae(t,e){const n=o0(typeof e=="string"?e:e.name,t.schema);return n==="node"?jae(t,e):n==="mark"?s0(t,e):{}}function RA(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const s=n.resolve(t-1),i=ex(s,o.type);i&&r.push({mark:o,...i})}):n.nodesBetween(t,e,(o,s)=>{r.push(...o.marks.map(i=>({from:s,to:s+o.nodeSize,mark:i})))}),r}function Ap(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}function Cb(t,e,n={}){const{empty:r,ranges:o}=t.selection,s=e?ga(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>s?s.name===u.type.name:!0).find(u=>zm(u.attrs,n,{strict:!1}));let i=0;const a=[];if(o.forEach(({$from:u,$to:d})=>{const f=u.pos,h=d.pos;t.doc.nodesBetween(f,h,(p,g)=>{if(!p.isText&&!p.marks.length)return;const y=Math.max(f,g),w=Math.min(h,g+p.nodeSize),x=w-y;i+=x,a.push(...p.marks.map(C=>({mark:C,from:y,to:w})))})}),i===0)return!1;const l=a.filter(u=>s?s.name===u.mark.type.name:!0).filter(u=>zm(u.mark.attrs,n,{strict:!1})).reduce((u,d)=>u+d.to-d.from,0),c=a.filter(u=>s?u.mark.type!==s&&u.mark.type.excludes(s):!0).reduce((u,d)=>u+d.to-d.from,0);return(l>0?l+c:l)>=i}function Vae(t,e,n={}){if(!e)return Sf(t,null,n)||Cb(t,null,n);const r=o0(e,t.schema);return r==="node"?Sf(t,e,n):r==="mark"?Cb(t,e,n):!1}function j2(t,e){const{nodeExtensions:n}=t0(e),r=n.find(i=>i.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},s=et(Ee(r,"group",o));
25return typeof s!="string"?!1:s.split(" ").includes("list")}function Uae(t){var e;const n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function qae(t){return t instanceof Ge}function $A(t,e,n){const r=t.state.doc.content.size,o=qs(e,0,r),s=qs(n,0,r),i=t.coordsAtPos(o),a=t.coordsAtPos(s,-1),l=Math.min(i.top,a.top),c=Math.max(i.bottom,a.bottom),u=Math.min(i.left,a.left),d=Math.max(i.right,a.right),f=d-u,h=c-l,p={top:l,bottom:c,left:u,right:d,width:f,height:h,x:u,y:l};return{...p,toJSON:()=>p}}function Wae(t,e,n){var r;const{selection:o}=e;let s=null;if(tx(o)&&(s=o.$cursor),s){const a=(r=t.storedMarks)!==null&&r!==void 0?r:s.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:i}=o;return i.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(n),p=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=h&&p}return!c}),c})}const Kae=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:i,ranges:a}=s,l=ga(t,r.schema);if(o)if(i){const c=s0(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,h)=>{const p=Math.max(h,u),g=Math.min(h+f.nodeSize,d);f.marks.find(y=>y.type===l)?f.marks.forEach(y=>{l===y.type&&n.addMark(p,g,l.create({...y.attrs,...e}))}):n.addMark(p,g,l.create(e))})});return Wae(r,n,l)},Gae=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Jae=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const s=yn(t,n.schema);return s.isTextblock?o().command(({commands:i})=>$2(s,e)(n)?!0:i.clearNodes()).command(({state:i})=>$2(s,e)(i,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Yae=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=qs(t,0,r.content.size),s=Ge.create(r,o);e.setSelection(s)}return!0},Xae=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:s}=typeof t=="number"?{from:t,to:t}:t,i=We.atStart(r).from,a=We.atEnd(r).to,l=qs(o,i,a),c=qs(s,i,a),u=We.create(r,l,c);e.setSelection(u)}return!0},Zae=t=>({state:e,dispatch:n})=>{const r=yn(t,e.schema);return Die(r)(e,n)};function z2(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}}const Qae=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:i}=e,{$from:a,$to:l}=s,c=o.extensionManager.attributes,u=Ap(c,a.node().type.name,a.node().attrs);if(s instanceof Ge&&s.node.isBlock)return!a.parentOffset||!kc(i,a.pos)?!1:(r&&(t&&z2(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const d=l.parentOffset===l.parent.content.size;s instanceof We&&e.deleteSelection();const f=a.depth===0?void 0:Hae(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=d&&f?[{type:f,attrs:u}]:void 0,p=kc(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&kc(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(p=!0,h=f?[{type:f,attrs:u}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,h),f&&!d&&!a.parentOffset&&a.parent.type!==f)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&z2(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},ele=t=>({tr:e,state:n,dispatch:r,editor:o})=>{var s;const i=yn(t,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==i)return!1;const d=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==i||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let y=ue.empty;const w=a.index(-1)?1:a.index(-2)?2:3;for(let M=a.depth-w;M>=a.depth-3;M-=1)y=ue.from(a.node(M).copy(y));const x=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,C=Ap(d,a.node().type.name,a.node().attrs),v=((s=i.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(C))||void 0;y=y.append(ue.from(i.createAndFill(null,v)||void 0));const S=a.before(a.depth-(w-1));e.replace(S,a.after(-x),new be(y,4-w,0));let E=-1;e.doc.nodesBetween(S,e.doc.content.size,(M,T)=>{if(E>-1)return!1;M.isTextblock&&M.content.size===0&&(E=T+1)}),E>-1&&e.setSelection(We.near(e.doc.resolve(E))),e.scrollIntoView()}return!0}const f=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,h=Ap(d,u.type.name,u.attrs),p=Ap(d,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const g=f?[{type:i,attrs:h},{type:f,attrs:p}]:[{type:i,attrs:h}];if(!kc(e.doc,a.pos,2))return!1;if(r){const{selection:y,storedMarks:w}=n,{splittableMarks:x}=o.extensionManager,C=w||y.$to.parentOffset&&y.$from.marks();if(e.split(a.pos,2,g).scrollIntoView(),!C||!r)return!0;const v=C.filter(S=>x.includes(S.type.name));e.ensureMarks(v)}return!0},qy=(t,e)=>{const n=rx(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&pa(t.doc,n.pos)&&t.join(n.pos),!0},Wy=(t,e)=>{const n=rx(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&pa(t.doc,r)&&t.join(r),!0},tle=(t,e,n,r={})=>({editor:o,tr:s,state:i,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=o.extensionManager,h=yn(t,i.schema),p=yn(e,i.schema),{selection:g,storedMarks:y}=i,{$from:w,$to:x}=g,C=w.blockRange(x),v=y||g.$to.parentOffset&&g.$from.marks();if(!C)return!1;const S=rx(E=>j2(E.type.name,d))(g);if(C.depth>=1&&S&&C.depth-S.depth<=1){if(S.node.type===h)return c.liftListItem(p);
vendor: 5,148 bytes, line 25
25if(j2(S.node.type.name,d)&&h.validContent(S.node.content)&&a)return l().command(()=>(s.setNodeMarkup(S.pos,h),!0)).command(()=>qy(s,h)).command(()=>Wy(s,h)).run()}return!n||!v||!a?l().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>qy(s,h)).command(()=>Wy(s,h)).run():l().command(()=>{const E=u().wrapInList(h,r),M=v.filter(T=>f.includes(T.type.name));return s.ensureMarks(M),E?!0:c.clearNodes()}).wrapInList(h,r).command(()=>qy(s,h)).command(()=>Wy(s,h)).run()},nle=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,i=ga(t,r.schema);return Cb(r,i,e)?o.unsetMark(i,{extendEmptyMarkRange:s}):o.setMark(i,e)},rle=(t,e,n={})=>({state:r,commands:o})=>{const s=yn(t,r.schema),i=yn(e,r.schema);return Sf(r,s,n)?o.setNode(i):o.setNode(s,n)},ole=(t,e={})=>({state:n,commands:r})=>{const o=yn(t,n.schema);return Sf(n,o,e)?r.lift(o):r.wrapIn(o,e)},sle=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let s;if(o.spec.isInputRules&&(s=o.getState(t))){if(e){const i=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)i.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=i.doc.resolve(s.from).marks();i.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else i.delete(s.from,s.to)}return!0}}return!1},ile=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},ale=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=n,l=ga(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!o)return!0;if(u&&i){let{from:f,to:h}=a;const p=(s=c.marks().find(y=>y.type===l))===null||s===void 0?void 0:s.attrs,g=ex(c,l,p);g&&(f=g.from,h=g.to),n.removeMark(f,h,l)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},lle=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const a=o0(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=yn(t,r.schema)),a==="mark"&&(i=ga(t,r.schema)),o&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(d,f)=>{s&&s===d.type&&n.setNodeMarkup(f,void 0,{...d.attrs,...e}),i&&d.marks.length&&d.marks.forEach(h=>{if(i===h.type){const p=Math.max(f,c),g=Math.min(f+d.nodeSize,u);n.addMark(p,g,i.create({...h.attrs,...e}))}})})}),!0):!1},cle=(t,e={})=>({state:n,dispatch:r})=>{const o=yn(t,n.schema);return Oie(o,e)(n,r)},ule=(t,e={})=>({state:n,dispatch:r})=>{const o=yn(t,n.schema);return Iie(o,e)(n,r)};var dle=Object.freeze({__proto__:null,blur:Qie,clearContent:eae,clearNodes:tae,command:nae,createParagraphNear:rae,deleteCurrentNode:oae,deleteNode:sae,deleteRange:iae,deleteSelection:aae,enter:lae,exitCode:cae,extendMarkRange:dae,first:fae,focus:hae,forEach:pae,insertContent:mae,insertContentAt:vae,joinUp:bae,joinDown:wae,joinBackward:kae,joinForward:xae,keyboardShortcut:_ae,lift:Sae,liftEmptyBlock:Mae,liftListItem:Tae,newlineInCode:Eae,resetAttributes:Aae,scrollIntoView:Oae,selectAll:Iae,selectNodeBackward:Nae,selectNodeForward:Lae,selectParentNode:Rae,selectTextblockEnd:$ae,selectTextblockStart:Dae,setContent:Pae,setMark:Kae,setMeta:Gae,setNode:Jae,setNodeSelection:Yae,setTextSelection:Xae,sinkListItem:Zae,splitBlock:Qae,splitListItem:ele,toggleList:tle,toggleMark:nle,toggleNode:rle,toggleWrap:ole,undoInputRule:sle,unsetAllMarks:ile,unsetMark:ale,updateAttributes:lle,wrapIn:cle,wrapInList:ule});const fle=Vn.create({name:"commands",addCommands(){return{...dle}}}),hle=Vn.create({name:"editable",addProseMirrorPlugins(){return[new Kn({key:new Vr("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ple=Vn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Kn({key:new Vr("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),mle=Vn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:i})=>{const{selection:a,doc:l}=i,{empty:c,$anchor:u}=a,{pos:d,parent:f}=u,h=Fe.atStart(l).from===d;return!c||!h||!f.type.isTextblock||f.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return nx()||IA()?o:r}
25,addProseMirrorPlugins(){return[new Kn({key:new Vr("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(d=>d.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:r,from:o,to:s}=e.selection,i=Fe.atStart(e.doc).from,a=Fe.atEnd(e.doc).to;if(r||!(o===i&&s===a)||n.doc.textBetween(0,n.doc.content.size," "," ").length!==0)return;const l=n.tr,c=Qg({state:n,transaction:l}),{commands:u}=new e0({editor:this.editor,state:c});if(u.clearNodes(),!!l.steps.length)return l}})]}}),gle=Vn.create({name:"tabindex",addProseMirrorPlugins(){return[new Kn({key:new Vr("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var yle=Object.freeze({__proto__:null,ClipboardTextSerializer:Zie,Commands:fle,Editable:hle,FocusEvents:ple,Keymap:mle,Tabindex:gle});const vle=`.ProseMirror {
26  position: relative;
27}
28
29.ProseMirror {
30  word-wrap: break-word;
31  white-space: pre-wrap;
32  white-space: break-spaces;
33  -webkit-font-variant-ligatures: none;
34  font-variant-ligatures: none;
35  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
36}
37
38.ProseMirror [contenteditable="false"] {
39  white-space: normal;
40}
41
42.ProseMirror [contenteditable="false"] [contenteditable="true"] {
43  white-space: pre-wrap;
44}
45
46.ProseMirror pre {
47  white-space: pre-wrap;
48}
49
50img.ProseMirror-separator {
51  display: inline !important;
52  border: none !important;
53  margin: 0 !important;
54  width: 1px !important;
55  height: 1px !important;
56}
57
58.ProseMirror-gapcursor {
59  display: none;
60  pointer-events: none;
61  position: absolute;
62  margin: 0;
63}
64
65.ProseMirror-gapcursor:after {
66  content: "";
67  display: block;
68  position: absolute;
69  top: -2px;
70  width: 20px;
71  border-top: 1px solid black;
72  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
73}
74
75@keyframes ProseMirror-cursor-blink {
76  to {
77    visibility: hidden;
78  }
79}
80
81.ProseMirror-hideselection *::selection {
82  background: transparent;
83}
84
85.ProseMirror-hideselection *::-moz-selection {
86  background: transparent;
87}
88
89.ProseMirror-hideselection * {
90  caret-color: transparent;
91}
92
93.ProseMirror-focused .ProseMirror-gapcursor {
94  display: block;
95}
96
97.tippy-box[data-animation=fade][data-state=hidden] {
98  opacity: 0
99}`;function ble(t,e){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(r),r}let wle=class extends Pie{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=ble(vle,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}
99),e&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n=TA(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(t){if(this.isDestroyed)return;const e=typeof t=="string"?`${t}$`:t.key,n=this.state.reconfigure({plugins:this.state.plugins.filter(r=>!r.key.startsWith(e))});this.view.updateState(n)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(yle):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(e?.type));this.extensionManager=new Yie(t,this)}createCommandManager(){this.commandManager=new e0({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=NA(this.options.content,this.schema,this.options.parseOptions),e=OA(t,this.options.autofocus);this.view=new nie(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Toe.create({doc:t,selection:e||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(s=>{var i;return(i=this.capturedTransaction)===null||i===void 0?void 0:i.step(s)});return}const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const r=t.getMeta("focus"),o=t.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return zae(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return Vae(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Bae(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
100
101`,textSerializers:n={}}=t||{};return Fae(this.state.doc,{blockSeparator:e,textSerializers:{...AA(this.schema),...n}})}get isEmpty(){return Uae(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}};function Yc(t){return new n0({find:t.find,handler:({state:e,range:n,match:r})=>{const o=et(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:s}=e,i=r[r.length-1],a=r[0];let l=n.to;if(i){const c=a.search(/\S/),u=n.from+a.indexOf(i),d=u+i.length;if(RA(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===t.type&&h!==f.mark.type)).filter(f=>f.to>u).length)return null;d<n.to&&s.delete(d,n.to),u>n.from&&s.delete(n.from+c,u),l=n.from+c+i.length,s.addMark(n.from+c,l,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function kle(t){return new n0({find:t.find,handler:({state:e,range:n,match:r})=>{const o=et(t.getAttributes,void 0,r)||{},{tr:s}=e,i=n.from;let a=n.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);let c=i+l;c>a?c=a:a=c+r[1].length;const u=r[0][r[0].length-1];s.insertText(u,i+r[0].length-1),s.replaceWith(c,a,t.type.create(o))}else r[0]&&s.replaceWith(i,a,t.type.create(o))}})}function _b(t){return new n0({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),s=et(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function Mf(t){return new n0({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const s=et(t.getAttributes,void 0,r)||{},i=e.tr.delete(n.from,n.to),a=i.doc.resolve(n.from).blockRange(),l=a&&Vk(a,t.type,s);if(!l)return null;if(i.wrap(a,l),t.keepMarks&&t.editor){const{selection:u,storedMarks:d}=e,{splittableMarks:f}=t.editor.extensionManager,h=d||u.$to.parentOffset&&u.$from.marks();if(h){const p=h.filter(g=>f.includes(g.type.name));i.ensureMarks(p)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.n
101ame==="orderedList"?"listItem":"taskList";o().updateAttributes(u,s).run()}const c=i.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&pa(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&i.join(n.from-1)}})}let ya=class Sb{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=et(Ee(this,"addOptions",{name:this.name}))),this.storage=et(Ee(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Sb(e)}configure(e={}){const n=this.extend();return n.options=r0(this.options,e),n.storage=et(Ee(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Sb(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=et(Ee(n,"addOptions",{name:n.name})),n.storage=et(Ee(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!s.find(a=>a?.type.name===n.name))return!1;const i=s.find(a=>a?.type.name===n.name);return i&&r.removeStoredMark(i),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}};class en{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=et(Ee(this,"addOptions",{name:this.name}))),this.storage=et(Ee(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new en(e)}configure(e={}){const n=this.extend();return n.options=r0(this.options,e),n.storage=et(Ee(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new en(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=et(Ee(n,"addOptions",{name:n.name})),n.storage=et(Ee(n,"addStorage",{name:n.name,options:n.options})),n}}function Xc(t){return new qie({find:t.find,handler:({state:e,range:n,match:r})=>{const o=et(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:s}=e,i=r[r.length-1],a=r[0];let l=n.to;if(i){const c=a.search(/\S/),u=n.from+a.indexOf(i),d=u+i.length;if(RA(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===t.type&&h!==f.mark.type)).filter(f=>f.to>u).length)return null;d<n.to&&s.delete(d,n.to),u>n.from&&s.delete(n.from+c,u),l=n.from+c+i.length,s.addMark(n.from+c,l,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}const xle=/^\s*>\s$/,Cle=en.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Mf({find:xle,type:this.type})]}}),_le=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Sle=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Mle=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Tle=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Ele=ya.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
101,addInputRules(){return[Yc({find:_le,type:this.type}),Yc({find:Mle,type:this.type})]},addPasteRules(){return[Xc({find:Sle,type:this.type}),Xc({find:Tle,type:this.type})]}}),Ale=en.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Rt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),V2=ya.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Rt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=s0(t,this.type);return Object.entries(n).some(([,r])=>!!r)?!0:e.unsetMark(this.name)}}}}),U2=/^\s*([-+*])\s$/,Ole=en.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Rt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Ale.name,this.editor.getAttributes(V2.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Mf({find:U2,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mf({find:U2,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(V2.name),editor:this.editor})),[t]}}),Ile=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Nle=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Lle=ya.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Yc({find:Ile,type:this.type})]},addPasteRules(){return[Xc({find:Nle,type:this.type})]}}),Rle=/^```([a-z]+)?[\s\n]$/,$le=/^~~~([a-z]+)?[\s\n]$/,Dle=en.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;return[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(r=>r.startsWith(n)).map(r=>r.replace(n,""))[0]||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Rt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,i=r.parent.textContent.endsWith(`
102
103`);return!s||!i?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:s}=n;if(!s||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;const i=o.after();return i===void 0||r.nodeAt(i)?!1:t.commands.exitCode()}}}
vendor: 5,477 bytes, lines 103-104
103,addInputRules(){return[_b({find:Rle,type:this.type,getAttributes:t=>({language:t[1]})}),_b({find:$le,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Kn({key:new Vr("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,s=o?.mode;if(!n||!s)return!1;const{tr:i}=t.state;return i.replaceSelectionWith(this.type.create({language:s})),i.setSelection(We.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.insertText(n.replace(/\r\n?/g,`
104`)),i.setMeta("paste",!0),t.dispatch(i),!0}}})]}}),Ple=en.create({name:"doc",topNode:!0,content:"block+"});function Hle(t={}){return new Kn({view(e){return new Ble(e,t)}})}class Ble{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let s=i=>{this[o](i)};return e.dom.addEventListener(o,s),{name:o,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):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),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=a?u.bottom:u.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let s,i;if(!o||o==document.body&&getComputedStyle(o).position=="static")s=-pageXOffset,i=-pageYOffset;else{let a=o.getBoundingClientRect();s=a.left-o.scrollLeft,i=a.top-o.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-i+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,s=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!s){let i=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=S7(this.editorView.state.doc,i,this.editorView.dragging.slice);a!=null&&(i=a)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const Fle=Vn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Hle(this.options)]}});class Bt extends Fe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Bt.valid(r)?new Bt(r):Fe.near(r)}content(){return be.empty}eq(e){return e instanceof Bt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Bt(e.resolve(n.pos))}getBookmark(){return new jle(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!zle(e)||!Vle(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Bt.valid(e))return e;let o=e.pos,s=null;for(let i=e.depth;;i--){let a=e.node(i);if(n>0?e.indexAfter(i)<a.childCount:e.index(i)>0){s=a.child(n>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;o+=n;let l=e.doc.resolve(o);if(Bt.valid(l))return l}for(;;){let i=n>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!Ge.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=i,o+=n;let a=e.doc.resolve(o);if(Bt.valid(a))return a}return null}}}Bt.prototype.visible=!1;Bt.findFrom=Bt.findGapCursorFrom;Fe.jsonID("gapcursor",Bt);let jle=class DA{constructor(e){this.pos=e}map(e){return new DA(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Bt.valid(n)?new Bt(n):Fe.near(n)}};function zle(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;
vendor: 3,934 bytes, lines 104-105
104if(o.inlineContent)return!1}}return!0}function Vle(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function Ule(){return new Kn({props:{decorations:Gle,createSelectionBetween(t,e,n){return e.pos==n.pos&&Bt.valid(n)?new Bt(n):null},handleClick:Wle,handleKeyDown:qle,handleDOMEvents:{beforeinput:Kle}}})}const qle=Zk({ArrowLeft:zh("horiz",-1),ArrowRight:zh("horiz",1),ArrowUp:zh("vert",-1),ArrowDown:zh("vert",1)});function zh(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let i=r.selection,a=e>0?i.$to:i.$from,l=i.empty;if(i instanceof We){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=Bt.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new Bt(c))),!0):!1}}function Wle(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Bt.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Ge.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Bt(r))),!0)}function Kle(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Bt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=ue.empty;for(let i=r.length-1;i>=0;i--)o=ue.from(r[i].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new be(o,0,0));return s.setSelection(We.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function Gle(t){if(!(t.selection instanceof Bt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",vr.create(t.doc,[fi.widget(t.selection.head,e,{key:"gapcursor"})])}const Jle=Vn.create({name:"gapCursor",addProseMirrorPlugins(){return[Ule()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=et(Ee(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),Yle=en.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Rt(this.options.HTMLAttributes,t)]},renderText(){return`
105`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:a}=r.extensionManager,l=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&i){const d=l.filter(f=>a.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Xle=en.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Rt(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>_b({find:new RegExp(`^(#{1,${t}}
105)\\s$`),type:this.type,getAttributes:{level:t}}))}});var Um=200,fn=function(){};fn.prototype.append=function(t){return t.length?(t=fn.from(t),!this.length&&t||t.length<Um&&this.leafAppend(t)||this.length<Um&&t.leafPrepend(this)||this.appendInner(t)):this};fn.prototype.prepend=function(t){return t.length?fn.from(t).append(this):this};fn.prototype.appendInner=function(t){return new Zle(this,t)};fn.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?fn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))};fn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};fn.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)};fn.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(o,s){return r.push(t(o,s))},e,n),r};fn.from=function(t){return t instanceof fn?t:t&&t.length?new PA(t):fn.empty};var PA=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,s,i){for(var a=o;a<s;a++)if(r(this.values[a],i+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,i){for(var a=o-1;a>=s;a--)if(r(this.values[a],i+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Um)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Um)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(fn);fn.empty=new PA([]);var Zle=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,r,o,s){var i=this.left.length;if(r<i&&this.left.forEachInner(n,r,Math.min(o,i),s)===!1||o>i&&this.right.forEachInner(n,Math.max(r-i,0),Math.min(this.length,o)-i,s+i)===!1)return!1},e.prototype.forEachInvertedInner=function(n,r,o,s){var i=this.left.length;if(r>i&&this.right.forEachInvertedInner(n,r-i,Math.max(o,i)-i,s+i)===!1||o<i&&this.left.forEachInvertedInner(n,Math.min(r,i),o,s)===!1)return!1},e.prototype.sliceInner=function(n,r){if(n==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(n,r):n>=o?this.right.slice(n-o,r-o):this.left.slice(n,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new e(r,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(fn);const Qle=500;let Tf=class tc{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,s;n&&(o=this.remapping(r,this.items.length),s=o.maps.length);let i=e.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),s=o.maps.length),s--,u.push(d);return}if(o){u.push(new vi(d.map));let h=d.step.map(o.slice(s)),p;h&&i.maybeStep(h).doc&&(p=i.mapping.maps[i.mapping.maps.length-1],c.push(new vi(p,void 0,void 0,c.length+u.length))),s--,p&&o.appendMap(p,s)}else i.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(s)):d.selection,l=new tc(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:i,selection:a}}addTransform(e,n,r,o){let s=[],i=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new vi(e.mapping.maps[u],d,n),h;(h=l&&l.merge(f))&&(f=h,u?s.pop():a=a.slice(0,a.length-1)),s.push(f),n&&(i++,n=void 0),o||(l=f)}let c=i-r.depth;return c>tce&&(a=ece(a,c),i-=c),new tc(a.append(s),i)}remapping(e,n){let r=new x7;
vendor: 4,825 bytes, line 105
105return this.items.forEach((o,s)=>{let i=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,i)},e,n),r}addMaps(e){return this.eventCount==0?this:new tc(this.items.append(e.map(n=>new vi(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=n;this.items.forEach(f=>{let h=s.getMirror(--l);if(h==null)return;i=Math.min(i,h);let p=s.maps[h];if(f.step){let g=e.steps[h].invert(e.docs[h]),y=f.selection&&f.selection.map(s.slice(l+1,h));y&&a++,r.push(new vi(p,g,y))}else r.push(new vi(p))},o);let c=[];for(let f=n;f<i;f++)c.push(new vi(s.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new tc(u,a);return d.emptyItemCount()>Qle&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],s=0;return this.items.forEach((i,a)=>{if(a>=e)o.push(i),i.selection&&s++;else if(i.step){let l=i.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=i.selection&&i.selection.map(n.slice(r));u&&s++;let d=new vi(c.invert(),l,u),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else i.map&&r--},this.items.length,0),new tc(fn.from(o.reverse()),s)}};Tf.empty=new Tf(fn.empty,0);function ece(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}let vi=class HA{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new HA(n.getMap().invert(),n,this.selection)}}};class Oi{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const tce=20;function nce(t,e,n,r){let o=n.getMeta(ea),s;if(o)return o.historyState;n.getMeta(oce)&&(t=new Oi(t.done,t.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(i&&i.getMeta(ea))return i.getMeta(ea).redo?new Oi(t.done.addTransform(n,void 0,r,Op(e)),t.undone,q2(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new Oi(t.done,t.undone.addTransform(n,void 0,r,Op(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!i&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!rce(n,t.prevRanges)),c=i?Ky(t.prevRanges,n.mapping):q2(n.mapping.maps[n.steps.length-1]);return new Oi(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Op(e)),Tf.empty,c,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Oi(t.done.rebased(n,s),t.undone.rebased(n,s),Ky(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Oi(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Ky(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function rce(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(n=!0)}),n}function q2(t){let e=[];return t.forEach((n,r,o,s)=>e.push(o,s)),e}function Ky(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),s=e.map(t[r+1],-1);o<=s&&n.push(o,s)}return n}function BA(t,e,n,r){let o=Op(e),s=ea.get(e).spec.config,i=(r?t.undone:t.done).popEvent(e,o);if(!i)return;let a=i.selection.resolve(i.transform.doc),l=(r?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),s,o),c=new Oi(r?l:i.remaining,r?i.remaining:l,null,0,-1);n(i.transform.setSelection(a).setMeta(ea,{redo:r,historyState:c}).scrollIntoView())}let Gy=!1,W2=null;function Op(t){let e=t.plugins;if(W2!=e){Gy=!1,W2=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Gy=!0;break}}return Gy}const ea=new Vr("history"),oce=new Vr("closeHistory");function sce(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Kn({key:ea,state:{init(){return new Oi(Tf.empty,Tf.empty,null,0,-1)},apply(e,n,r){return nce(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?FA:r=="historyRedo"?jA:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}const FA=(t,e)=>{let n=ea.getState(t);return!n||n.done.eventCount==0?!1:(e&&BA(n,t,e,!1),!0)},jA=(t,e)=>{let n=ea.getState(t);return!n||n.undone.eventCount==0?!1:(e&&BA(n,t,e,!0),!0)},ice=Vn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>FA(t,e),redo:()=>({state:t,dispatch:e})=>jA(t,e)}},addProseMirrorPlugins(){return[sce(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>
105this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ace=en.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Rt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t})=>t().insertContent({type:this.name}).command(({tr:e,dispatch:n})=>{var r;if(n){const{$to:o}=e.selection,s=o.end();if(o.nodeAfter)e.setSelection(We.create(e.doc,o.pos));else{const i=(r=o.parent.type.contentMatch.defaultType)===null||r===void 0?void 0:r.create();i&&(e.insert(s,i),e.setSelection(We.create(e.doc,s)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[kle({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),lce=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,cce=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,uce=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,dce=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,fce=ya.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Yc({find:lce,type:this.type}),Yc({find:uce,type:this.type})]},addPasteRules(){return[Xc({find:cce,type:this.type}),Xc({find:dce,type:this.type})]}}),hce=en.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Rt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),pce=en.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Rt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),K2=ya.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Rt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=s0(t,this.type);return Object.entries(n).some(([,r])=>!!r)?!0:e.unsetMark(this.name)}}}}),G2=/^(\d+)\.\s$/,mce=en.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Rt(this.options.HTMLAttributes,n),0]:["ol",Rt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(pce.name,this.editor.getAttributes(K2.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Mf({find:G2,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mf({find:G2,type:this.t
105ype,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(K2.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),gce=en.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),yce=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,vce=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,bce=ya.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Yc({find:yce,type:this.type})]},addPasteRules(){return[Xc({find:vce,type:this.type})]}}),wce=en.create({name:"text",group:"inline"}),kce=Vn.create({name:"starterKit",addExtensions(){var t,e,n,r,o,s,i,a,l,c,u,d,f,h,p,g,y,w;const x=[];return this.options.blockquote!==!1&&x.push(Cle.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(Ele.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(Ole.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(Lle.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(Dle.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&x.push(Ple.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&x.push(Fle.configure((i=this.options)===null||i===void 0?void 0:i.dropcursor)),this.options.gapcursor!==!1&&x.push(Jle.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&x.push(Yle.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&x.push(Xle.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&x.push(ice.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(ace.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&x.push(fce.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&x.push(hce.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&x.push(mce.configure((p=this.options)===null||p===void 0?void 0:p.orderedList)),this.options.paragraph!==!1&&x.push(gce.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&x.push(bce.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&x.push(wce.configure((w=this.options)===null||w===void 0?void 0:w.text)),x}}),xce=ya.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Cce=Vn.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}}
vendor: 19,345 bytes, line 105
105,addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});var br="top",fo="bottom",ho="right",wr="left",ox="auto",fh=[br,fo,ho,wr],Zc="start",Ef="end",_ce="clippingParents",zA="viewport",Gu="popper",Sce="reference",J2=fh.reduce(function(t,e){return t.concat([e+"-"+Zc,e+"-"+Ef])},[]),VA=[].concat(fh,[ox]).reduce(function(t,e){return t.concat([e,e+"-"+Zc,e+"-"+Ef])},[]),Mce="beforeRead",Tce="read",Ece="afterRead",Ace="beforeMain",Oce="main",Ice="afterMain",Nce="beforeWrite",Lce="write",Rce="afterWrite",$ce=[Mce,Tce,Ece,Ace,Oce,Ice,Nce,Lce,Rce];function vs(t){return t?(t.nodeName||"").toLowerCase():null}function Fr(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Sl(t){var e=Fr(t).Element;return t instanceof e||t instanceof Element}function so(t){var e=Fr(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function sx(t){if(typeof ShadowRoot>"u")return!1;var e=Fr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Dce(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},s=e.elements[n];!so(s)||!vs(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var a=o[i];a===!1?s.removeAttribute(i):s.setAttribute(i,a===!0?"":a)}))})}function Pce(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],s=e.attributes[r]||{},i=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=i.reduce(function(l,c){return l[c]="",l},{});!so(o)||!vs(o)||(Object.assign(o.style,a),Object.keys(s).forEach(function(l){o.removeAttribute(l)}))})}}const UA={name:"applyStyles",enabled:!0,phase:"write",fn:Dce,effect:Pce,requires:["computeStyles"]};function ds(t){return t.split("-")[0]}var il=Math.max,qm=Math.min,Qc=Math.round;function Mb(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function qA(){return!/^((?!chrome|android).)*safari/i.test(Mb())}function eu(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,s=1;e&&so(t)&&(o=t.offsetWidth>0&&Qc(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Qc(r.height)/t.offsetHeight||1);var i=Sl(t)?Fr(t):window,a=i.visualViewport,l=!qA()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/s,d=r.width/o,f=r.height/s;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function ix(t){var e=eu(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function WA(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&sx(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function si(t){return Fr(t).getComputedStyle(t)}function Hce(t){return["table","td","th"].indexOf(vs(t))>=0}function va(t){return((Sl(t)?t.ownerDocument:t.document)||window.document).documentElement}function i0(t){return vs(t)==="html"?t:t.assignedSlot||t.parentNode||(sx(t)?t.host:null)||va(t)}function Y2(t){return!so(t)||si(t).position==="fixed"?null:t.offsetParent}function Bce(t){var e=/firefox/i.test(Mb()),n=/Trident/i.test(Mb());if(n&&so(t)){var r=si(t);if(r.position==="fixed")return null}var o=i0(t);for(sx(o)&&(o=o.host);so(o)&&["html","body"].indexOf(vs(o))<0;){var s=si(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function hh(t){for(var e=Fr(t),n=Y2(t);n&&Hce(n)&&si(n).position==="static";)n=Y2(n);return n&&(vs(n)==="html"||vs(n)==="body"&&si(n).position==="static")?e:n||Bce(t)||e}function ax(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Kd(t,e,n){return il(t,qm(e,n))}function Fce(t,e,n){var r=Kd(t,e,n);return r>n?n:r}function KA(){return{top:0,right:0,bottom:0,left:0}}function GA(t){return Object.assign({},KA(),t)}function JA(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var jce=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,GA(typeof t!="number"?t:JA(t,fh))};function zce(t){var e,n=t.state,r=t.name,o=t.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,a=ds(n.placement),l=ax(a),c=[wr,ho].indexOf(a)>=0,u=c?"height":"width";if(!(!s||!i)){var d=jce(o.padding,n),f=ix(s),h=l==="y"?br:wr,p=l==="y"?fo:ho,g=n.rects.reference[u]+n.rects.reference[l]-i[l]-n.rects.popper[u],y=i[l]-n.rects.reference[l],w=hh(s),x=w?l==="y"?w.clientHeight||0:w.clientWidth||0:0,C=g/2-y/2,v=d[h],S=x-f[u]-d[p],E=x/2-f[u]/2+C,M=Kd(v,E,S),T=l;n.modifiersData[r]=(e={},e[T]=M,e.centerOffset=M-E,e)}}function Vce(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||WA(e.elements.popper,o)&&(e.elements.arrow=o))}const Uce={name:"arrow",enabled:!0,phase:"main",fn:zce,effect:Vce,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function tu(t){return t.split("-")[1]}var qce={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wce(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:Qc(n*o)/o||0,y:Qc(r*o)/o||0}}function X2(t){var e,n=t.popper,r=t.popperRect,o=t.placement,s=t.variation,i=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=i.x,h=f===void 0?0:f,p=i.y,g=p===void 0?0:p,y=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=y.x,g=y.y;var w=i.hasOwnProperty("x"),x=i.hasOwnProperty("y"),C=wr,v=br,S=window;if(c){var E=hh(n),M="clientHeight",T="clientWidth";if(E===Fr(n)&&(E=va(n),si(E).position!=="static"&&a==="absolute"&&(M="scrollHeight",T="scrollWidth")),E=E,o===br||(o===wr||o===ho)&&s===Ef){v=fo;var A=d&&E===S&&S.visualViewport?S.visualViewport.height:E[M];g-=A-r.height,g*=l?1:-1}if(o===wr||(o===br||o===fo)&&s===Ef){C=ho;var N=d&&E===S&&S.visualViewport?S.visualViewport.width:E[T];h-=N-r.width,h*=l?1:-1}}var D=Object.assign({position:a},c&&qce),$=u===!0?Wce({x:h,y:g},Fr(n)):{x:h,y:g};if(h=$.x,g=$.y,l){var W;return Object.assign({},D,(W={},W[v]=x?"0":"",W[C]=w?"0":"",W.transform=(S.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",W))}return Object.assign({},D,(e={},e[v]=x?g+"px":"",e[C]=w?h+"px":"",e.transform="",e))}function Kce(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,i=s===void 0?!0:s,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:ds(e.placement),variation:tu(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,X2(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:i,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,X2(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Gce={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Kce,data:{}};var Vh={passive:!0};function Jce(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,a=i===void 0?!0:i,l=Fr(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",n.update,Vh)}),a&&l.addEventListener("resize",n.update,Vh),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Vh)}),a&&l.removeEventListener("resize",n.update,Vh)}}const Yce={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Jce,data:{}};var Xce={left:"right",right:"left",bottom:"top",top:"bottom"};function Ip(t){return t.replace(/left|right|bottom|top/g,function(e){return Xce[e]})}var Zce={start:"end",end:"start"};function Z2(t){return t.replace(/start|end/g,function(e){return Zce[e]})}function lx(t){var e=Fr(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function cx(t){return eu(va(t)).left+lx(t).scrollLeft}function Qce(t,e){var n=Fr(t),r=va(t),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;var c=qA();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a+cx(t),y:l}}function eue(t){var e,n=va(t),r=lx(t),o=(e=t.ownerDocument)==null?void 0:e.body,s=il(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=il(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+cx(t),l=-r.scrollTop;return si(o||n).direction==="rtl"&&(a+=il(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:a,y:l}}function ux(t){var e=si(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function YA(t){return["html","body","#document"].indexOf(vs(t))>=0?t.ownerDocument.body:so(t)&&ux(t)?t:YA(i0(t))}function Gd(t,e){var n;e===void 0&&(e=[]);var r=YA(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),s=Fr(r),i=o?[s].concat(s.visualViewport||[],ux(r)?r:[]):r,a=e.concat(i);return o?a:a.concat(Gd(i0(i)))}function Tb(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function tue(t,e){var n=eu(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Q2(t,e,n){return e===zA?Tb(Qce(t,n)):Sl(e)?tue(e,n):Tb(eue(va(t)))}function nue(t){var e=Gd(i0(t)),n=["absolute","fixed"].indexOf(si(t).position)>=0,r=n&&so(t)?hh(t):t;return Sl(r)?e.filter(function(o){return Sl(o)&&WA(o,r)&&vs(o)!=="body"}):[]}function rue(t,e,n,r){var o=e==="clippingParents"?nue(t):[].concat(e),s=[].concat(o,[n]),i=s[0],a=s.reduce(function(l,c){var u=Q2(t,c,r);return l.top=il(u.top,l.top),l.right=qm(u.right,l.right),l.bottom=qm(u.bottom,l.bottom),l.left=il(u.left,l.left),l},Q2(t,i,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function XA(t){var e=t.reference,n=t.element,r=t.placement,o=r?ds(r):null,s=r?tu(r):null,i=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case br:l={x:i,y:e.y-n.height};break;case fo:l={x:i,y:e.y+e.height};break;case ho:l={x:e.x+e.width,y:a};break;case wr:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?ax(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case Zc:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Ef:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function Af(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,s=n.strategy,i=s===void 0?t.strategy:s,a=n.boundary,l=a===void 0?_ce:a,c=n.rootBoundary,u=c===void 0?zA:c,d=n.elementContext,f=d===void 0?Gu:d,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,y=g===void 0?0:g,w=GA(typeof y!="number"?y:JA(y,fh)),x=f===Gu?Sce:Gu,C=t.rects.popper,v=t.elements[p?x:f],S=rue(Sl(v)?v:v.contextElement||va(t.elements.popper),l,u,i),E=eu(t.elements.reference),M=XA({reference:E,element:C,placement:o}),T=Tb(Object.assign({},C,M)),A=f===Gu?T:E,N={top:S.top-A.top+w.top,bottom:A.bottom-S.bottom+w.bottom,left:S.left-A.left+w.left,right:A.right-S.right+w.right},D=t.modifiersData.offset;if(f===Gu&&D){var $=D[o];Object.keys(N).forEach(function(W){var me=[ho,fo].indexOf(W)>=0?1:-1,V=[br,fo].indexOf(W)>=0?"y":"x";N[W]+=$[V]*me})}return N}function oue(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?VA:l,u=tu(r),d=u?a?J2:J2.filter(function(p){return tu(p)===u}):fh,f=d.filter(function(p){return c.indexOf(p)>=0});f.length===0&&(f=d);var h=f.reduce(function(p,g){return p[g]=Af(t,{placement:g,boundary:o,rootBoundary:s,padding:i})[ds(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function sue(t){if(ds(t)===ox)return[];var e=Ip(t);return[Z2(t),e,Z2(e)]}function iue(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,a=i===void 0?!0:i,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,y=e.options.placement,w=ds(y),x=w===y,C=l||(x||!p?[Ip(y)]:sue(y)),v=[y].concat(C).reduce(function(ee,se){return ee.concat(ds(se)===ox?oue(e,{placement:se,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):se)},[]),S=e.rects.reference,E=e.rects.popper,M=new Map,T=!0,A=v[0],N=0;N<v.length;N++){var D=v[N],$=ds(D),W=tu(D)===Zc,me=[br,fo].indexOf($)>=0,V=me?"width":"height",B=Af(e,{placement:D,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),Y=me?W?ho:wr:W?fo:br;S[V]>E[V]&&(Y=Ip(Y));var j=Ip(Y),P=[];if(s&&P.push(B[$]<=0),a&&P.push(B[Y]<=0,B[j]<=0),P.every(function(ee){return ee})){A=D,T=!1;break}M.set(D,P)}if(T)for(var Q=p?3:1,J=function(ee){var se=v.find(function(Re){var F=M.get(Re);if(F)return F.slice(0,ee).every(function(q){return q})});if(se)return A=se,"break"},ke=Q;ke>0;ke--){var Se=J(ke);if(Se==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const aue={name:"flip",enabled:!0,phase:"main",fn:iue,requiresIfExists:["offset"],data:{_skip:!1}};function eS(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function tS(t){return[br,ho,fo,wr].some(function(e){return t[e]>=0})}function lue(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,s=e.modifiersData.preventOverflow,i=Af(e,{elementContext:"reference"}),a=Af(e,{altBoundary:!0}),l=eS(i,r),c=eS(a,o,s),u=tS(l),d=tS(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const cue={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:lue};function uue(t,e,n){var r=ds(t),o=[wr,br].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,i=s[0],a=s[1];return i=i||0,a=(a||0)*o,[wr,ho].indexOf(r)>=0?{x:a,y:i}:{x:i,y:a}}function due(t){var e=t.state,n=t.options,r=t.name,o=n.offset,s=o===void 0?[0,0]:o,i=VA.reduce(function(u,d){return u[d]=uue(d,e.rects,s),u},{}),a=i[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=i}const fue={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:due};function hue(t){var e=t.state,n=t.name;e.modifiersData[n]=XA({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const pue={name:"popperOffsets",enabled:!0,phase:"read",fn:hue,data:{}};function mue(t){return t==="x"?"y":"x"}function gue(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,a=i===void 0?!1:i,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,p=n.tetherOffset,g=p===void 0?0:p,y=Af(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),w=ds(e.placement),x=tu(e.placement),C=!x,v=ax(w),S=mue(v),E=e.modifiersData.popperOffsets,M=e.rects.reference,T=e.rects.popper,A=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,N=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,$={x:0,y:0};if(E){if(s){var W,me=v==="y"?br:wr,V=v==="y"?fo:ho,B=v==="y"?"height":"width",Y=E[v],j=Y+y[me],P=Y-y[V],Q=h?-T[B]/2:0,J=x===Zc?M[B]:T[B],ke=x===Zc?-T[B]:-M[B],Se=e.elements.arrow,ee=h&&Se?ix(Se):{width:0,height:0},se=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:KA(),Re=se[me],F=se[V],q=Kd(0,M[B],ee[B]),ne=C?M[B]/2-Q-q-Re-N.mainAxis:J-q-Re-N.mainAxis,de=C?-M[B]/2+Q+q+F+N.mainAxis:ke+q+F+N.mainAxis,Pe=e.elements.arrow&&hh(e.elements.arrow),ot=Pe?v==="y"?Pe.clientTop||0:Pe.clientLeft||0:0,I=(W=D?.[v])!=null?W:0,O=Y+ne-I-ot,z=Y+de-I,K=Kd(h?qm(j,O):j,Y,h?il(P,z):P);E[v]=K,$[v]=K-Y}if(a){var G,re=v==="x"?br:wr,he=v==="x"?fo:ho,le=E[S],ae=S==="y"?"height":"width",te=le+y[re],Me=le-y[he],ge=[br,wr].indexOf(w)!==-1,Te=(G=D?.[S])!=null?G:0,De=ge?te:le-M[ae]-T[ae]-Te+N.altAxis,Je=ge?le+M[ae]+T[ae]-Te-N.altAxis:Me,it=h&&ge?Fce(De,le,Je):Kd(h?De:te,le,h?Je:Me);E[S]=it,$[S]=it-le}e.modifiersData[r]=$}}const yue={name:"preventOverflow",enabled:!0,phase:"main",fn:gue,requiresIfExists:["offset"]};function vue(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function bue(t){return t===Fr(t)||!so(t)?lx(t):vue(t)}function wue(t){var e=t.getBoundingClientRect(),n=Qc(e.width)/t.offsetWidth||1,r=Qc(e.height)/t.offsetHeight||1;return n!==1||r!==1}function kue(t,e,n){n===void 0&&(n=!1);var r=so(e),o=so(e)&&wue(e),s=va(e),i=eu(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((vs(e)!=="body"||ux(s))&&(a=bue(e)),so(e)?(l=eu(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=cx(s))),{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function xue(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function o(s){n.add(s.name);var i=[].concat(s.requires||[],s.requiresIfExists||[]);i.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||o(s)}),r}function Cue(t){var e=xue(t);return $ce.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function _ue(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Sue(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var nS={placement:"bottom",modifiers:[],strategy:"absolute"};function rS(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Mue(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,s=o===void 0?nS:o;return function(i,a,l){l===void 0&&(l=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},nS,s),modifiersData:{},elements:{reference:i,popper:a},attributes:{},styles:{}},u=[],d=!1,f={state:c,setOptions:function(g){var y=typeof g=="function"?g(c.options):g;p(),c.options=Object.assign({},s,c.options,y),c.scrollParents={reference:Sl(i)?Gd(i):i.contextElement?Gd(i.contextElement):[],popper:Gd(a)};
vendor: 8,860 bytes, line 105
105var w=Cue(Sue([].concat(r,c.options.modifiers)));return c.orderedModifiers=w.filter(function(x){return x.enabled}),h(),f.update()},forceUpdate:function(){if(!d){var g=c.elements,y=g.reference,w=g.popper;if(rS(y,w)){c.rects={reference:kue(y,hh(w),c.options.strategy==="fixed"),popper:ix(w)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(T){return c.modifiersData[T.name]=Object.assign({},T.data)});for(var x=0;x<c.orderedModifiers.length;x++){if(c.reset===!0){c.reset=!1,x=-1;continue}var C=c.orderedModifiers[x],v=C.fn,S=C.options,E=S===void 0?{}:S,M=C.name;typeof v=="function"&&(c=v({state:c,options:E,name:M,instance:f})||c)}}}},update:_ue(function(){return new Promise(function(g){f.forceUpdate(),g(c)})}),destroy:function(){p(),d=!0}};if(!rS(i,a))return f;f.setOptions(l).then(function(g){!d&&l.onFirstUpdate&&l.onFirstUpdate(g)});function h(){c.orderedModifiers.forEach(function(g){var y=g.name,w=g.options,x=w===void 0?{}:w,C=g.effect;if(typeof C=="function"){var v=C({state:c,name:y,instance:f,options:x}),S=function(){};u.push(v||S)}})}function p(){u.forEach(function(g){return g()}),u=[]}return f}}var Tue=[Yce,pue,Gce,UA,fue,aue,yue,Uce,cue],Eue=Mue({defaultModifiers:Tue}),Aue="tippy-box",ZA="tippy-content",Oue="tippy-backdrop",QA="tippy-arrow",e9="tippy-svg-arrow",$a={passive:!0,capture:!0},t9=function(){return document.body};function Jy(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function dx(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function n9(t,e){return typeof t=="function"?t.apply(void 0,e):t}function oS(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function Iue(t){return t.split(/\s+/).filter(Boolean)}function nc(t){return[].concat(t)}function sS(t,e){t.indexOf(e)===-1&&t.push(e)}function Nue(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function Lue(t){return t.split("-")[0]}function Wm(t){return[].slice.call(t)}function iS(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Jd(){return document.createElement("div")}function a0(t){return["Element","Fragment"].some(function(e){return dx(t,e)})}function Rue(t){return dx(t,"NodeList")}function $ue(t){return dx(t,"MouseEvent")}function Due(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function Pue(t){return a0(t)?[t]:Rue(t)?Wm(t):Array.isArray(t)?t:Wm(document.querySelectorAll(t))}function Yy(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function aS(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function Hue(t){var e,n=nc(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function Bue(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var s=o.popperRect,i=o.popperState,a=o.props,l=a.interactiveBorder,c=Lue(i.placement),u=i.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,p=c==="left"?u.right.x:0,g=s.top-r+d>l,y=r-s.bottom-f>l,w=s.left-n+h>l,x=n-s.right-p>l;return g||y||w||x})}function Xy(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function lS(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Yo={isTouch:!1},cS=0;function Fue(){Yo.isTouch||(Yo.isTouch=!0,window.performance&&document.addEventListener("mousemove",r9))}function r9(){var t=performance.now();t-cS<20&&(Yo.isTouch=!1,document.removeEventListener("mousemove",r9)),cS=t}function jue(){var t=document.activeElement;if(Due(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function zue(){document.addEventListener("touchstart",Fue,$a),window.addEventListener("blur",jue)}var Vue=typeof window<"u"&&typeof document<"u",Uue=Vue?!!window.msCrypto:!1,que={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Wue={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Eo=Object.assign({appendTo:t9,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},que,Wue),Kue=Object.keys(Eo),Gue=function(t){var e=Object.keys(t);e.forEach(function(n){Eo[n]=t[n]})};function o9(t){var e=t.plugins||[],n=e.reduce(function(r,o){var s=o.name,i=o.defaultValue;if(s){var a;r[s]=t[s]!==void 0?t[s]:(a=Eo[s])!=null?a:i}return r},{});return Object.assign({},t,n)}function Jue(t,e){var n=e?Object.keys(o9(Object.assign({},Eo,{plugins:e}))):Kue,r=n.reduce(function(o,s){var i=(t.getAttribute("data-tippy-"+s)||"").trim();if(!i)return o;if(s==="content")o[s]=i;else try{o[s]=JSON.parse(i)}catch{o[s]=i}return o},{});return r}function uS(t,e){var n=Object.assign({},e,{content:n9(e.content,[t])},e.ignoreAttributes?{}:Jue(t,e.plugins));return n.aria=Object.assign({},Eo.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var Yue=function(){return"innerHTML"};function Eb(t,e){t[Yue()]=e}function dS(t){var e=Jd();return t===!0?e.className=QA:(e.className=e9,a0(t)?e.appendChild(t):Eb(e,t)),e}function fS(t,e){a0(e.content)?(Eb(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Eb(t,e.content):t.textContent=e.content)}function Ab(t){var e=t.firstElementChild,n=Wm(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(ZA)}),arrow:n.find(function(r){return r.classList.contains(QA)||r.classList.contains(e9)}),backdrop:n.find(function(r){return r.classList.contains(Oue)})}}function s9(t){var e=Jd(),n=Jd();n.className=Aue,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Jd();r.className=ZA,r.setAttribute("data-state","hidden"),fS(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props);function o(s,i){var a=Ab(e),l=a.box,c=a.content,u=a.arrow;i.theme?l.setAttribute("data-theme",i.theme):l.removeAttribute("data-theme"),typeof i.animation=="string"?l.setAttribute("data-animation",i.animation):l.removeAttribute("data-animation"),i.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof i.maxWidth=="number"?i.maxWidth+"px":i.maxWidth,i.role?l.setAttribute("role",i.role):l.removeAttribute("role"),(s.content!==i.content||s.allowHTML!==i.allowHTML)&&fS(c,t.props),i.arrow?u?s.arrow!==i.arrow&&(l.removeChild(u),l.appendChild(dS(i.arrow))):l.appendChild(dS(i.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:o}}s9.$$tippy=!0;var Xue=1,Uh=[],Zy=[];function Zue(t,e){var n=uS(t,Object.assign({},Eo,o9(iS(e)))),r,o,s,i=!1,a=!1,l=!1,c=!1,u,d,f,h=[],p=oS(O,n.interactiveDebounce),g,y=Xue++,w=null,x=Nue(n.plugins),C={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:y,reference:t,popper:Jd(),popperInstance:w,props:n,state:C,plugins:x,clearDelayTimeouts:De,setProps:Je,setContent:it,show:ht,hide:ln,hideWithInteractivity:Kt,enable:ge,disable:Te,unmount:Jn,destroy:bn};if(!n.render)return v;var S=n.render(v),E=S.popper,M=S.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+v.id,v.popper=E,t._tippy=v,E._tippy=v;var T=x.map(function(R){return R.fn(v)}),A=t.hasAttribute("aria-expanded");return Pe(),Q(),Y(),j("onCreate",[v]),n.showOnCreate&&te(),E.addEventListener("mouseenter",function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()}),E.addEventListener("mouseleave",function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&me().addEventListener("mousemove",p)}),v;function N(){var R=v.props.touch;return Array.isArray(R)?R:[R,0]}function D(){return N()[0]==="hold"}function $(){var R;return!!((R=v.props.render)!=null&&R.$$tippy)}function W(){return g||t}function me(){var R=W().parentNode;return R?Hue(R):document}function V(){return Ab(E)}function B(R){return v.state.isMounted&&!v.state.isVisible||Yo.isTouch||u&&u.type==="focus"?0:Jy(v.props.delay,R?0:1,Eo.delay)}function Y(R){R===void 0&&(R=!1),E.style.pointerEvents=v.props.interactive&&!R?"":"none",E.style.zIndex=""+v.props.zIndex}function j(R,X,oe){if(oe===void 0&&(oe=!0),T.forEach(function(_e){_e[R]&&_e[R].apply(_e,X)}),oe){var Ce;(Ce=v.props)[R].apply(Ce,X)}}function P(){var R=v.props.aria;
vendor: 2,681 bytes, line 105
105if(R.content){var X="aria-"+R.content,oe=E.id,Ce=nc(v.props.triggerTarget||t);Ce.forEach(function(_e){var ct=_e.getAttribute(X);if(v.state.isVisible)_e.setAttribute(X,ct?ct+" "+oe:oe);else{var It=ct&&ct.replace(oe,"").trim();It?_e.setAttribute(X,It):_e.removeAttribute(X)}})}}function Q(){if(!(A||!v.props.aria.expanded)){var R=nc(v.props.triggerTarget||t);R.forEach(function(X){v.props.interactive?X.setAttribute("aria-expanded",v.state.isVisible&&X===W()?"true":"false"):X.removeAttribute("aria-expanded")})}}function J(){me().removeEventListener("mousemove",p),Uh=Uh.filter(function(R){return R!==p})}function ke(R){if(!(Yo.isTouch&&(l||R.type==="mousedown"))){var X=R.composedPath&&R.composedPath()[0]||R.target;if(!(v.props.interactive&&lS(E,X))){if(nc(v.props.triggerTarget||t).some(function(oe){return lS(oe,X)})){if(Yo.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[v,R]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),a=!0,setTimeout(function(){a=!1}),v.state.isMounted||Re())}}}function Se(){l=!0}function ee(){l=!1}function se(){var R=me();R.addEventListener("mousedown",ke,!0),R.addEventListener("touchend",ke,$a),R.addEventListener("touchstart",ee,$a),R.addEventListener("touchmove",Se,$a)}function Re(){var R=me();R.removeEventListener("mousedown",ke,!0),R.removeEventListener("touchend",ke,$a),R.removeEventListener("touchstart",ee,$a),R.removeEventListener("touchmove",Se,$a)}function F(R,X){ne(R,function(){!v.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&X()})}function q(R,X){ne(R,X)}function ne(R,X){var oe=V().box;function Ce(_e){_e.target===oe&&(Xy(oe,"remove",Ce),X())}if(R===0)return X();Xy(oe,"remove",d),Xy(oe,"add",Ce),d=Ce}function de(R,X,oe){oe===void 0&&(oe=!1);var Ce=nc(v.props.triggerTarget||t);Ce.forEach(function(_e){_e.addEventListener(R,X,oe),h.push({node:_e,eventType:R,handler:X,options:oe})})}function Pe(){D()&&(de("touchstart",I,{passive:!0}),de("touchend",z,{passive:!0})),Iue(v.props.trigger).forEach(function(R){if(R!=="manual")switch(de(R,I),R){case"mouseenter":de("mouseleave",z);break;case"focus":de(Uue?"focusout":"blur",K);break;case"focusin":de("focusout",K);break}})}function ot(){h.forEach(function(R){var X=R.node,oe=R.eventType,Ce=R.handler,_e=R.options;X.removeEventListener(oe,Ce,_e)}),h=[]}function I(R){var X,oe=!1;if(!(!v.state.isEnabled||G(R)||a)){var Ce=((X=u)==null?void 0:X.type)==="focus";u=R,g=R.currentTarget,Q(),!v.state.isVisible&&$ue(R)&&Uh.forEach(function(_e){return _e(R)}),R.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||i)&&v.props.hideOnClick!==!1&&v.state.isVisible?oe=!0:te(R),R.type==="click"&&(i=!oe),oe&&!Ce&&Me(R)}}
vendor: 3,540 bytes, line 105
105function O(R){var X=R.target,oe=W().contains(X)||E.contains(X);if(!(R.type==="mousemove"&&oe)){var Ce=ae().concat(E).map(function(_e){var ct,It=_e._tippy,Tr=(ct=It.popperInstance)==null?void 0:ct.state;return Tr?{popperRect:_e.getBoundingClientRect(),popperState:Tr,props:n}:null}).filter(Boolean);Bue(Ce,R)&&(J(),Me(R))}}function z(R){var X=G(R)||v.props.trigger.indexOf("click")>=0&&i;if(!X){if(v.props.interactive){v.hideWithInteractivity(R);return}Me(R)}}function K(R){v.props.trigger.indexOf("focusin")<0&&R.target!==W()||v.props.interactive&&R.relatedTarget&&E.contains(R.relatedTarget)||Me(R)}function G(R){return Yo.isTouch?D()!==R.type.indexOf("touch")>=0:!1}function re(){he();var R=v.props,X=R.popperOptions,oe=R.placement,Ce=R.offset,_e=R.getReferenceClientRect,ct=R.moveTransition,It=$()?Ab(E).arrow:null,Tr=_e?{getBoundingClientRect:_e,contextElement:_e.contextElement||W()}:t,Es={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(As){var Er=As.state;if($()){var M0=V(),Ca=M0.box;["placement","reference-hidden","escaped"].forEach(function(Os){Os==="placement"?Ca.setAttribute("data-placement",Er.placement):Er.attributes.popper["data-popper-"+Os]?Ca.setAttribute("data-"+Os,""):Ca.removeAttribute("data-"+Os)}),Er.attributes.popper={}}}},Yn=[{name:"offset",options:{offset:Ce}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ct}},Es];$()&&It&&Yn.push({name:"arrow",options:{element:It,padding:3}}),Yn.push.apply(Yn,X?.modifiers||[]),v.popperInstance=Eue(Tr,E,Object.assign({},X,{placement:oe,onFirstUpdate:f,modifiers:Yn}))}function he(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function le(){var R=v.props.appendTo,X,oe=W();v.props.interactive&&R===t9||R==="parent"?X=oe.parentNode:X=n9(R,[oe]),X.contains(E)||X.appendChild(E),v.state.isMounted=!0,re()}function ae(){return Wm(E.querySelectorAll("[data-tippy-root]"))}function te(R){v.clearDelayTimeouts(),R&&j("onTrigger",[v,R]),se();var X=B(!0),oe=N(),Ce=oe[0],_e=oe[1];Yo.isTouch&&Ce==="hold"&&_e&&(X=_e),X?r=setTimeout(function(){v.show()},X):v.show()}function Me(R){if(v.clearDelayTimeouts(),j("onUntrigger",[v,R]),!v.state.isVisible){Re();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(R.type)>=0&&i)){var X=B(!1);X?o=setTimeout(function(){v.state.isVisible&&v.hide()},X):s=requestAnimationFrame(function(){v.hide()})}}function ge(){v.state.isEnabled=!0}function Te(){v.hide(),v.state.isEnabled=!1}function De(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(s)}function Je(R){if(!v.state.isDestroyed){j("onBeforeUpdate",[v,R]),ot();var X=v.props,oe=uS(t,Object.assign({},X,iS(R),{ignoreAttributes:!0}));v.props=oe,Pe(),X.interactiveDebounce!==oe.interactiveDebounce&&(J(),p=oS(O,oe.interactiveDebounce)),X.triggerTarget&&!oe.triggerTarget?nc(X.triggerTarget).forEach(function(Ce){Ce.removeAttribute("aria-expanded")}):oe.triggerTarget&&t.removeAttribute("aria-expanded"),Q(),Y(),M&&M(X,oe),v.popperInstance&&(re(),ae().forEach(function(Ce){requestAnimationFrame(Ce._tippy.popperInstance.forceUpdate)})),j("onAfterUpdate",[v,R])}}function it(R){v.setProps({content:R})}function ht(){var R=v.state.isVisible,X=v.state.isDestroyed,oe=!v.state.isEnabled,Ce=Yo.isTouch&&!v.props.touch,_e=Jy(v.props.duration,0,Eo.duration);if(!(R||X||oe||Ce)&&!W().hasAttribute("disabled")&&(j("onShow",[v],!1),v.props.onShow(v)!==!1)){if
105(v.state.isVisible=!0,$()&&(E.style.visibility="visible"),Y(),se(),v.state.isMounted||(E.style.transition="none"),$()){var ct=V(),It=ct.box,Tr=ct.content;Yy([It,Tr],0)}f=function(){var Es;if(!(!v.state.isVisible||c)){if(c=!0,E.offsetHeight,E.style.transition=v.props.moveTransition,$()&&v.props.animation){var Yn=V(),As=Yn.box,Er=Yn.content;Yy([As,Er],_e),aS([As,Er],"visible")}P(),Q(),sS(Zy,v),(Es=v.popperInstance)==null||Es.forceUpdate(),j("onMount",[v]),v.props.animation&&$()&&q(_e,function(){v.state.isShown=!0,j("onShown",[v])})}},le()}}function ln(){var R=!v.state.isVisible,X=v.state.isDestroyed,oe=!v.state.isEnabled,Ce=Jy(v.props.duration,1,Eo.duration);if(!(R||X||oe)&&(j("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,c=!1,i=!1,$()&&(E.style.visibility="hidden"),J(),Re(),Y(!0),$()){var _e=V(),ct=_e.box,It=_e.content;v.props.animation&&(Yy([ct,It],Ce),aS([ct,It],"hidden"))}P(),Q(),v.props.animation?$()&&F(Ce,v.unmount):v.unmount()}}function Kt(R){me().addEventListener("mousemove",p),sS(Uh,p),p(R)}function Jn(){v.state.isVisible&&v.hide(),v.state.isMounted&&(he(),ae().forEach(function(R){R._tippy.unmount()}),E.parentNode&&E.parentNode.removeChild(E),Zy=Zy.filter(function(R){return R!==v}),v.state.isMounted=!1,j("onHidden",[v]))}function bn(){!v.state.isDestroyed&&(v.clearDelayTimeouts(),v.unmount(),ot(),delete t._tippy,v.state.isDestroyed=!0,j("onDestroy",[v]))}}function Eu(t,e){e===void 0&&(e={});var n=Eo.plugins.concat(e.plugins||[]);zue();var r=Object.assign({},e,{plugins:n}),o=Pue(t),s=o.reduce(function(i,a){var l=a&&Zue(a,r);return l&&i.push(l),i},[]);return a0(t)?s[0]:s}Eu.defaultProps=Eo;Eu.setDefaultProps=Gue;Eu.currentInput=Yo;Object.assign({},UA,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});Eu.setDefaultProps({render:s9});class Que{constructor({editor:e,element:n,view:r,tippyOptions:o={},updateDelay:s=250,shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:u})=>{const{doc:d,selection:f}=l,{empty:h}=f,p=!d.textBetween(c,u).length&&tx(l.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||h||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget)||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),u=!(l!=null&&l.doc.eq(a.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,u,l)},this.updateDelay))},this.updateHandler=(a,l,c,u)=>{var d,f,h;const{state:p,composing:g}=a,{selection:y}=p;if(g||!l&&!c)return;this.createTooltip();const{ranges:w}=y,x=Math.min(...w.map(v=>v.$from.pos)),C=Math.max(...w.map(v=>v.$to.pos));if(!(!((d=this.shouldShow)===null||d===void 0)&&d.call(this,{editor:this.editor,view:a,state:p,oldState:u,from:x,to:C}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(qae(p.selection)){let v=a.nodeDOM(x);const S=v.dataset.nodeViewWrapper?v:v.querySelector("[data-node-view-wrapper]");if(S&&(v=S.firstChild),v)return v.getBoundingClientRect()}return $A(a,x,C)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=s,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Eu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,o=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,n);return}const s=!(n!=null&&n.selection.eq(e.state.selection)),i=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,s,i,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const ede=t=>new Kn({key:typeof t.pluginKey=="string"?new Vr(t.pluginKey):t.pluginKey,view:e=>
105new Que({view:e,...t})});Vn.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ede({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class tde{constructor({editor:e,element:n,view:r,tippyOptions:o={},shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:i,state:a})=>{const{selection:l}=a,{$anchor:c,empty:u}=l,d=c.depth===1,f=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent;return!(!i.hasFocus()||!u||!d||!f||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:i})=>{var a;if(this.preventHide){this.preventHide=!1;return}i!=null&&i.relatedTarget&&!((a=this.element.parentNode)===null||a===void 0)&&a.contains(i.relatedTarget)||this.hide()},this.tippyBlurHandler=i=>{this.blurHandler({event:i})},this.editor=e,this.element=n,this.view=r,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Eu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,o,s;const{state:i}=e,{doc:a,selection:l}=i,{from:c,to:u}=l;if(!(n&&n.doc.eq(a)&&n.selection.eq(l))){if(this.createTooltip(),!(!((r=this.shouldShow)===null||r===void 0)&&r.call(this,{editor:this.editor,view:e,state:i,oldState:n}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:((s=this.tippyOptions)===null||s===void 0?void 0:s.getReferenceClientRect)||(()=>$A(e,c,u))}),this.show()}}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const nde=t=>new Kn({key:typeof t.pluginKey=="string"?new Vr(t.pluginKey):t.pluginKey,view:e=>new tde({view:e,...t})});Vn.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[nde({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});function hS(t){return KM((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class rde extends wle{constructor(e={}){return super(e),this.vueRenderers=or(new Map),this.contentComponent=null,this.reactiveState=hS(this.view.state),this.reactiveExtensionStorage=hS(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),jf(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){super.registerPlugin(e,n),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const ode=Ne({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=pe(),n=go();return ww(()=>{const r=t.editor;r&&r.options.element&&e.value&&mn(()=>
105{if(!e.value||!r.options.element.firstChild)return;const o=b(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:o}),r.createNodeViews()})}),Fo(()=>{const r=t.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const o=document.createElement("div");o.append(...r.options.element.childNodes),r.setOptions({element:o})}),{rootEl:e}},render(){const t=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const n=mt(xw,{to:e.teleportElement,key:e.id},mt(e.component,{ref:e.id,...e.props}));t.push(n)}),mt("div",{ref:e=>{this.rootEl=e}},...t)}});var Ob,Ib;if(typeof WeakMap<"u"){let t=new WeakMap;Ob=e=>t.get(e),Ib=(e,n)=>(t.set(e,n),n)}else{const t=[];let e=0;Ob=n=>{for(let r=0;r<t.length;r+=2)if(t[r]==n)return t[r+1]},Ib=(n,r)=>(e==10&&(e=0),t[e++]=n,t[e++]=r)}var zt=class{constructor(e,n,r,o){this.width=e,this.height=n,this.map=r,this.problems=o}findCell(e){for(let n=0;n<this.map.length;n++){const r=this.map[n];if(r!=e)continue;const o=n%this.width,s=n/this.width|0;let i=o+1,a=s+1;for(let l=1;i<this.width&&this.map[n+l]==r;l++)i++;for(let l=1;a<this.height&&this.map[n+this.width*l]==r;l++)a++;return{left:o,top:s,right:i,bottom:a}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let n=0;n<this.map.length;n++)if(this.map[n]==e)return n%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,n,r){const{left:o,right:s,top:i,bottom:a}=this.findCell(e);return n=="horiz"?(r<0?o==0:s==this.width)?null:this.map[i*this.width+(r<0?o-1:s)]:(r<0?i==0:a==this.height)?null:this.map[o+this.width*(r<0?i-1:a)]}rectBetween(e,n){const{left:r,right:o,top:s,bottom:i}=this.findCell(e),{left:a,right:l,top:c,bottom:u}=this.findCell(n);return{left:Math.min(r,a),top:Math.min(s,c),right:Math.max(o,l),bottom:Math.max(i,u)}}cellsInRect(e){const n=[],r={};for(let o=e.top;o<e.bottom;o++)for(let s=e.left;s<e.right;s++){const i=o*this.width+s,a=this.map[i];r[a]||(r[a]=!0,!(s==e.left&&s&&this.map[i-1]==a||o==e.top&&o&&this.map[i-this.width]==a)&&n.push(a))}return n}positionAt(e,n,r){for(let o=0,s=0;;o++){const i=s+r.child(o).nodeSize;if(o==e){let a=n+e*this.width;const l=(e+1)*this.width;for(;a<l&&this.map[a]<s;)a++;return a==l?i-1:this.map[a]}s=i}}static get(e){return Ob(e)||Ib(e,sde(e))}};function sde(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=ide(t),n=t.childCount,r=[];let o=0,s=null;const i=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const d=t.child(c);u++;for(let p=0;;p++){for(;o<r.length&&r[o]!=0;)o++;if(p==d.childCount)break;const g=d.child(p),{colspan:y,rowspan:w,colwidth:x}=g.attrs;for(let C=0;C<w;C++){if(C+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-C});break}const v=o+C*e;for(let S=0;S<y;S++){r[v+S]==0?r[v+S]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:y-S});const E=x&&x[S];if(E){const M=(v+S)%e*2,T=i[M];T==null||T!=E&&i[M+1]==1?(i[M]=E,i[M+1]=1):T==E&&i[M+1]++}}}o+=y,u+=g.nodeSize}const f=(c+1)*e;let h=0;for(;o<f;)r[o++]==0&&h++;h&&(s||(s=[])).push({type:"missing",row:c,n:h}),u++}const a=new zt(e,n,r,s);let l=!1;for(let c=0;!l&&c<i.length;c+=2)i[c]!=null&&i[c+1]<n&&(l=!0);return l&&ade(a,i,t),a}function ide(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let s=0;if(n)for(let i=0;i<r;i++){const a=t.child(i);for(let l=0;l<a.childCount;l++){const c=a.child(l);i+c.attrs.rowspan>r&&(s+=c.attrs.colspan)}}for(let i=0;i<o.childCount;i++){const a=o.child(i);s+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function ade(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const s=t.map[o];if(r[s])continue;r[s]=!0;const i=n.nodeAt(s);if(!i)throw new RangeError(`No cell with offset ${s} found`);let a=null;const l=i.attrs;for(let c=0;c<l.colspan;c++){const u=(o+c)%t.width,d=e[u*2];d!=null&&(!l.colwidth||l.colwidth[c]!=d)&&((a||(a=lde(l)))[c]=d)}a&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function lde(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Un(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};
105for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var $i=new Vr("selectingCells");function Au(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function cde(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function zo(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function l0(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Au(e.$head)||ude(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function ude(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Nb(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function dde(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function fx(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function i9(t,e,n){const r=t.node(-1),o=zt.get(r),s=t.start(-1),i=o.nextCell(t.pos-s,e,n);return i==null?null:t.node(0).resolve(s+i)}function Ml(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function a9(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function fde(t,e,n){const r=Un(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var dt=class extends Fe{constructor(e,n=e){const r=e.node(-1),o=zt.get(r),s=e.start(-1),i=o.rectBetween(e.pos-s,n.pos-s),a=e.node(0),l=o.cellsInRect(i).filter(u=>u!=n.pos-s);l.unshift(n.pos-s);const c=l.map(u=>{const d=r.nodeAt(u);if(!d)throw RangeError(`No cell with offset ${u} found`);const f=s+u+1;return new N7(a.resolve(f),a.resolve(f+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(Nb(r)&&Nb(o)&&fx(r,o)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?dt.rowSelection(r,o):s&&this.isColSelection()?dt.colSelection(r,o):new dt(r,o)}return We.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=zt.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},i=[];for(let l=o.top;l<o.bottom;l++){const c=[];for(let u=l*n.width+o.left,d=o.left;d<o.right;d++,u++){const f=n.map[u];if(s[f])continue;s[f]=!0;const h=n.findCell(f);let p=e.nodeAt(f);if(!p)throw RangeError(`No cell with offset ${f} found`);const g=o.left-h.left,y=h.right-o.right;if(g>0||y>0){let w=p.attrs;if(g>0&&(w=Ml(w,0,g)),y>0&&(w=Ml(w,w.colspan-y,y)),h.left<o.left){if(p=p.type.createAndFill(w),!p)throw RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(h.top<o.top||h.bottom>o.bottom){const w={...p.attrs,rowspan:Math.min(h.bottom,o.bottom)-Math.max(h.top,o.top)};h.top<o.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}i.push(e.child(l).copy(ue.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:i;return new be(ue.from(a),1,1)}replace(e,n=be.empty){const r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){const{$from:a,$to:l}=o[i],c=e.mapping.slice(r);e.replace(c.map(a.pos),c.map(l.pos),i?be.empty:n)}const s=Fe.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new be(ue.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=zt.get(n),o=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let i=0;i<s.length;i++)e(n.nodeAt(s[i]),o+s[i])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=zt.get(r),s=e.start(-1),i=o.findCell(e.pos-s),a=o.findCell(n.pos-s),l=e.node(0);return i.top<=a.top?(i.top>0&&(e=l.resolve(s+o.map[i.left])),a.bottom<o.height&&(n=l.resolve(s+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(s+o.map[a.left])),i.bottom<o.height&&(e=l.resolve(s+o.map[o.width*(o.height-1)+i.right-1]))),new dt(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=zt.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(o,s)>0)return!1;const i=o+this.$anchorCell.nodeAfter.attrs.colspan,a=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,a)==n.width}eq(e){return e instanceof dt&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=zt.get(r),s=e.start(-1),i=o.findCell(e.pos-s),a=o.findCell(n.pos-s),l=e.node(0);return i.left<=a.left?(i.left>0&&(e=l.resolve(s+o.map[i.top*o.width])),a.right<o.width&&(n=l.resolve(s+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(s+o.map[a.top*o.width])),i.right<o.width&&(e=l.resolve(s+o.map[o.width*(i.top+1)-1]))),new dt(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new dt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new dt(e.resolve(n),e.resolve(r))}getBookmark(){return new l9(this.$anchorCell.pos,this.$headCell.pos)}};dt.prototype.visible=!1;Fe.jsonID("cell",dt);var l9=class{constructor(e,n){this.anchor=e,this.head=n}map(e){return new l9(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&fx(n,r)?new dt(n,r):Fe.near(r,1)}};function hde(t){if(!(t.selection instanceof dt))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(fi.node(r,r+n.nodeSize,{class:"selectedCell"}))}),vr.create(t.doc,e)}function pde({$from:t,$to:e}){if(t.pos==e.pos||t.pos<t.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);
105return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function mde({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const s=t.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let o=e.depth;o>0;o--){const s=e.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function gde(t,e,n){const r=(e||t).selection,o=(e||t).doc;let s,i;if(r instanceof Ge&&(i=r.node.type.spec.tableRole)){if(i=="cell"||i=="header_cell")s=dt.create(o,r.from);else if(i=="row"){const a=o.resolve(r.from+1);s=dt.rowSelection(a,a)}else if(!n){const a=zt.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];s=dt.create(o,l+1,c)}}else r instanceof We&&pde(r)?s=We.create(o,r.from):r instanceof We&&mde(r)&&(s=We.create(o,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var yde=new Vr("fix-tables");function c9(t,e,n,r){const o=t.childCount,s=e.childCount;e:for(let i=0,a=0;i<s;i++){const l=e.child(i);for(let c=a,u=Math.min(o,i+3);c<u;c++)if(t.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<o&&t.child(a).sameMarkup(l)?c9(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function u9(t,e){let n;const r=(o,s)=>{o.type.spec.tableRole=="table"&&(n=vde(t,o,s,n))};return e?e.doc!=t.doc&&c9(e.doc,t.doc,0,r):t.doc.descendants(r),n}function vde(t,e,n,r){const o=zt.get(e);if(!o.problems)return r;r||(r=t.tr);const s=[];for(let l=0;l<o.height;l++)s.push(0);for(let l=0;l<o.problems.length;l++){const c=o.problems[l];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let f=0;f<d.rowspan;f++)s[c.row+f]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,Ml(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}}let i,a;for(let l=0;l<s.length;l++)s[l]&&(i==null&&(i=l),a=l);for(let l=0,c=n+1;l<o.height;l++){const u=e.child(l),d=c+u.nodeSize,f=s[l];if(f>0){let h="cell";u.firstChild&&(h=u.firstChild.type.spec.tableRole);const p=[];for(let y=0;y<f;y++){const w=Un(t.schema)[h].createAndFill();w&&p.push(w)}const g=(l==0||i==l-1)&&a==l?c+1:d-1;r.insert(r.mapping.map(g),p)}c=d}return r.setMeta(yde,{fixTables:!0})}function bde(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),s=o.type.spec.tableRole,i=o.type.schema,a=[];if(s=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const u=l?0:Math.max(0,n-1),d=l<e.childCount-1?0:Math.max(0,r-1);(u||d)&&(c=Lb(Un(i).row,new be(c,u,d)).content),a.push(c)}else if(s=="cell"||s=="header_cell")a.push(n||r?Lb(Un(i).row,new be(e,n,r)).content:e);else return null;return wde(i,a)}function wde(t,e){const n=[];for(let o=0;o<e.length;o++){const s=e[o];for(let i=s.childCount-1;i>=0;i--){const{rowspan:a,colspan:l}=s.child(i).attrs;for(let c=o;c<o+a;c++)n[c]=(n[c]||0)+l}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(ue.empty),n[o]<r){const s=Un(t).cell.createAndFill(),i=[];for(let a=n[o];a<r;a++)i.push(s);e[o]=e[o].append(ue.from(i))}return{height:e.length,width:r,rows:e}}function Lb(t,e){const n=t.createAndFill();return new I7(n).replace(0,n.content.size,e).doc}function kde({width:t,height:e,rows:n},r,o){if(t!=r){const s=[],i=[];for(let a=0;a<n.length;a++){const l=n[a],c=[];for(let u=s[a]||0,d=0;u<r;d++){let f=l.child(d%l.childCount);u+f.attrs.colspan>r&&(f=f.type.createChecked(Ml(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let h=1;h<f.attrs.rowspan;h++)s[a+h]=(s[a+h]||0)+f.attrs.colspan}i.push(ue.from(c))}n=i,t=r}if(e!=o){const s=[];for(let i=0,a=0;i<o;i++,a++){const l=[],c=n[a%e];for(let u=0;u<c.childCount;u++){let d=c.child(u);i+d.attrs.rowspan>o&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,o-d.attrs.rowspan)},d.content)),l.push(d)}s.push(ue.from(l))}n=s,e=o}return{width:t,height:e,rows:n}}function xde(t,e,n,r,o,s,i){const a=t.doc.type.schema,l=Un(a);let c,u;if(o>e.width)for(let d=0,f=0;
105d<e.height;d++){const h=n.child(d);f+=h.nodeSize;const p=[];let g;h.lastChild==null||h.lastChild.type==l.cell?g=c||(c=l.cell.createAndFill()):g=u||(u=l.header_cell.createAndFill());for(let y=e.width;y<o;y++)p.push(g);t.insert(t.mapping.slice(i).map(f-1+r),p)}if(s>e.height){const d=[];for(let p=0,g=(e.height-1)*e.width;p<Math.max(e.width,o);p++){const y=p>=e.width?!1:n.nodeAt(e.map[g+p]).type==l.header_cell;d.push(y?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const f=l.row.create(null,ue.from(d)),h=[];for(let p=e.height;p<s;p++)h.push(f);t.insert(t.mapping.slice(i).map(r+n.nodeSize-2),h)}return!!(c||u)}function pS(t,e,n,r,o,s,i,a){if(i==0||i==e.height)return!1;let l=!1;for(let c=o;c<s;c++){const u=i*e.width+c,d=e.map[u];if(e.map[u-e.width]==d){l=!0;const f=n.nodeAt(d),{top:h,left:p}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(a).map(d+r),null,{...f.attrs,rowspan:i-h}),t.insert(t.mapping.slice(a).map(e.positionAt(i,p,n)),f.type.createAndFill({...f.attrs,rowspan:h+f.attrs.rowspan-i})),c+=f.attrs.colspan-1}}return l}function mS(t,e,n,r,o,s,i,a){if(i==0||i==e.width)return!1;let l=!1;for(let c=o;c<s;c++){const u=c*e.width+i,d=e.map[u];if(e.map[u-1]==d){l=!0;const f=n.nodeAt(d),h=e.colCount(d),p=t.mapping.slice(a).map(d+r);t.setNodeMarkup(p,null,Ml(f.attrs,i-h,f.attrs.colspan-(i-h))),t.insert(p+f.nodeSize,f.type.createAndFill(Ml(f.attrs,0,i-h))),c+=f.attrs.rowspan-1}}return l}function gS(t,e,n,r,o){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let i=zt.get(s);const{top:a,left:l}=r,c=l+o.width,u=a+o.height,d=t.tr;let f=0;function h(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");i=zt.get(s),f=d.mapping.maps.length}xde(d,i,s,n,c,u,f)&&h(),pS(d,i,s,n,l,c,a,f)&&h(),pS(d,i,s,n,l,c,u,f)&&h(),mS(d,i,s,n,a,u,l,f)&&h(),mS(d,i,s,n,a,u,c,f)&&h();for(let p=a;p<u;p++){const g=i.positionAt(p,l,s),y=i.positionAt(p,c,s);d.replace(d.mapping.slice(f).map(g+n),d.mapping.slice(f).map(y+n),new be(o.rows[p-a],0,0))}h(),d.setSelection(new dt(d.doc.resolve(n+i.positionAt(a,l,s)),d.doc.resolve(n+i.positionAt(u-1,c-1,s)))),e(d)}var Cde=Zk({ArrowLeft:qh("horiz",-1),ArrowRight:qh("horiz",1),ArrowUp:qh("vert",-1),ArrowDown:qh("vert",1),"Shift-ArrowLeft":Wh("horiz",-1),"Shift-ArrowRight":Wh("horiz",1),"Shift-ArrowUp":Wh("vert",-1),"Shift-ArrowDown":Wh("vert",1),Backspace:Kh,"Mod-Backspace":Kh,Delete:Kh,"Mod-Delete":Kh});function Np(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function qh(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;if(s instanceof dt)return Np(n,r,Fe.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const i=d9(o,t,e);if(i==null)return!1;if(t=="horiz")return Np(n,r,Fe.near(n.doc.resolve(s.head+e),e));{const a=n.doc.resolve(i),l=i9(a,t,e);let c;return l?c=Fe.near(l,1):e<0?c=Fe.near(n.doc.resolve(a.before(-1)),-1):c=Fe.near(n.doc.resolve(a.after(-1)),1),Np(n,r,c)}}}function Wh(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;let i;if(s instanceof dt)i=s;else{const l=d9(o,t,e);if(l==null)return!1;i=new dt(n.doc.resolve(l))}const a=i9(i.$headCell,t,e);return a?Np(n,r,new dt(i.$anchorCell,a)):!1}}function Kh(t,e){const n=t.selection;if(!(n instanceof dt))return!1;if(e){const r=t.tr,o=Un(t.schema).cell.createAndFill().content;n.forEachCell((s,i)=>{s.content.eq(o)||r.replace(r.mapping.map(i+1),r.mapping.map(i+s.nodeSize-1),new be(o,0,0))}),r.docChanged&&e(r)}return!0}function _de(t,e){const n=t.state.doc,r=Au(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new dt(r))),!0):!1}function Sde(t,e,n){if(!zo(t.state))return!1;let r=bde(n);const o=t.state.selection;if(o instanceof dt){r||(r={width:1,height:1,rows:[ue.from(Lb(Un(t.state.schema).cell,n))]});const s=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),a=zt.get(s).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=kde(r,a.right-a.left,a.bottom-a.top),gS(t.state,t.dispatch,i,a,r),!0}else if(r){const s=l0(t.state),i=s.start(-1);return gS(t.state,t.dispatch,i,zt.get(s.node(-1)).findCell(s.pos-i),r),!0}else return!1}function Mde(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=yS(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof dt)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=Au(t.state.selection.$anchor))!=null&&((n=Qy(t,e))==null?void 0:n.pos)!=o.pos)s(o,e),e.preventDefault();else if(!r)return;function s(l,c){let u=Qy(t,c);const d=$i.getState(t.state)==null;if(!u||!fx(l,u))if(d)u=l;else return;const f=new dt(l,u);if(d||!t.state.selection.eq(f)){const h=t.state.tr.setSelection(f);d&&h.setMeta($i,l.pos),t.dispatch(h)}}function i(){t.root.removeEventListener("mouseup",i),t.root.removeEventListener("dragstart",i),t.root.removeEventListener("mousemove",a),$i.getState(t.state)!=null&&t.dis
105patch(t.state.tr.setMeta($i,-1))}function a(l){const c=l,u=$i.getState(t.state);let d;if(u!=null)d=t.state.doc.resolve(u);else if(yS(t,c.target)!=r&&(d=Qy(t,e),!d))return i();d&&s(d,c)}t.root.addEventListener("mouseup",i),t.root.addEventListener("dragstart",i),t.root.addEventListener("mousemove",a)}function d9(t,e,n){if(!(t.state.selection instanceof We))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const i=r.before(o),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?i:null}}return null}function yS(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Qy(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Au(t.state.doc.resolve(n.pos)):null}var Tde=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Rb(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Rb(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Rb(t,e,n,r,o,s){var i;let a=0,l=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;d<u.childCount;d++){const{colspan:h,colwidth:p}=u.child(d).attrs;for(let g=0;g<h;g++,f++){const y=o==f?s:p&&p[g],w=y?y+"px":"";a+=y||r,y||(l=!1),c?(c.style.width!=w&&(c.style.width=w),c=c.nextSibling):e.appendChild(document.createElement("col")).style.width=w}}for(;c;){const d=c.nextSibling;(i=c.parentNode)==null||i.removeChild(c),c=d}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var Xr=new Vr("tableColumnResizing");function Ede({handleWidth:t=5,cellMinWidth:e=25,View:n=Tde,lastColumnResizable:r=!0}={}){const o=new Kn({key:Xr,state:{init(s,i){return o.spec.props.nodeViews[Un(i.schema).table.name]=(a,l)=>new n(a,e,l),new Lp(-1,!1)},apply(s,i){return i.apply(s)}},props:{attributes:s=>{const i=Xr.getState(s);return i&&i.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,i)=>{Ade(s,i,t,e,r)},mouseleave:s=>{Ode(s)},mousedown:(s,i)=>{Ide(s,i,e)}},decorations:s=>{const i=Xr.getState(s);if(i&&i.activeHandle>-1)return Pde(s,i.activeHandle)},nodeViews:{}}});return o}var Lp=class{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(Xr);if(r&&r.setHandle!=null)return new Lp(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Lp(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return Nb(e.doc.resolve(o))||(o=-1),new Lp(o,n.dragging)}return n}};function Ade(t,e,n,r,o){const s=Xr.getState(t.state);if(s&&!s.dragging){const i=Lde(e.target);let a=-1;if(i){const{left:l,right:c}=i.getBoundingClientRect();e.clientX-l<=n?a=vS(t,e,"left"):c-e.clientX<=n&&(a=vS(t,e,"right"))}if(a!=s.activeHandle){if(!o&&a!==-1){const l=t.state.doc.resolve(a),c=l.node(-1),u=zt.get(c),d=l.start(-1);if(u.colCount(l.pos-d)+l.nodeAfter.attrs.colspan-1==u.width-1)return}f9(t,a)}}}function Ode(t){const e=Xr.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&f9(t,-1)}function Ide(t,e,n){const r=Xr.getState(t.state);if(!r||r.activeHandle==-1||r.dragging)return!1;const o=t.state.doc.nodeAt(r.activeHandle),s=Nde(t,r.activeHandle,o.attrs);t.dispatch(t.state.tr.setMeta(Xr,{setDragging:{startX:e.clientX,startWidth:s}}));function i(l){window.removeEventListener("mouseup",i),window.removeEventListener("mousemove",a);const c=Xr.getState(t.state);c!=null&&c.dragging&&(Rde(t,c.activeHandle,bS(c.dragging,l,n)),t.dispatch(t.state.tr.setMeta(Xr,{setDragging:null})))}function a(l){if(!l.which)return i(l);const c=Xr.getState(t.state);if(c&&c.dragging){const u=bS(c.dragging,l,n);$de(t,c.activeHandle,u,n)}}return window.addEventListener("mouseup",i),window.addEventListener("mousemove",a),e.preventDefault(),!0}function Nde(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const s=t.domAtPos(e);let i=s.node.childNodes[s.offset].offsetWidth,a=n;if(r)for(let l=0;l<n;l++)r[l]&&(i-=r[l],a--);return i/a}function Lde(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function vS(t,e,n){const r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return-1;const{pos:o}=r,s=Au(t.state.doc.resolve(o));if(!s)return-1;if(n=="right")return s.pos;const i=zt.get(s.node(-1)),a=s.start(-1),l=i.map.indexOf(s.pos-a);return l%i.width==0?-1:a+i.map[l-1]}function bS(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function f9(t,e){t.dispatch(t.state.tr.setMeta(Xr,{setHandle:e}))}function Rde(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),s=zt.get(o),i=r.start(-1),a=s.colCount(r.pos-i)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+a;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],f=o.nodeAt(d).attrs,h=f.colspan==1?0:a-s.colCount(d);if(f.colwidth&&f.colwidth[h]==n)continue;const p=f.colwidth?f.colwidth.slice():Dde(f.colspan);p[h]=n,l.setNodeMarkup(i+d,null,{...f,colwidth:p})}l.docChanged&&t.dispatch(l)}function $de(t,e,n,r){const o=t.state.doc.resolve(e),s=o.node(-1),i=o.start(-1),a=zt.get(s).colCount(o.pos-i)+o.nodeAfter.attrs.colspan-1;let l=t.domAtPos(o.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&Rb(s,l.firstChild,l,r,a,n)}function Dde(t){return Array(t).fill(0)}function Pde(t,e){const n=[],r=t.doc.resolve(e),o=r.node(-1);if(!o)return vr.empty;const s=zt.get(o),i=r.start(-1),a=s.colCount(r.pos-i)+r.nodeAfter.attrs.colspan;for(let l=0;l<s.height;l++){const c=a+l*s.width-1;
105if((a==s.width||s.map[c]!=s.map[c+1])&&(l==0||s.map[c-1]!=s.map[c-1-s.width])){const u=s.map[c],d=i+u+o.nodeAt(u).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",n.push(fi.widget(d,f))}}return vr.create(t.doc,n)}function Ms(t){const e=t.selection,n=l0(t),r=n.node(-1),o=n.start(-1),s=zt.get(r);return{...e instanceof dt?s.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):s.findCell(n.pos-o),tableStart:o,map:s,table:r}}function h9(t,{map:e,tableStart:n,table:r},o){let s=o>0?-1:0;fde(e,r,o+s)&&(s=o==0||o==e.width?null:0);for(let i=0;i<e.height;i++){const a=i*e.width+o;if(o>0&&o<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],c=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,a9(c.attrs,o-e.colCount(l))),i+=c.attrs.rowspan-1}else{const l=s==null?Un(r.type.schema).cell:r.nodeAt(e.map[a+s]).type,c=e.positionAt(i,o,r);t.insert(t.mapping.map(n+c),l.createAndFill())}}return t}function Hde(t,e){if(!zo(t))return!1;if(e){const n=Ms(t);e(h9(t.tr,n,n.left))}return!0}function Bde(t,e){if(!zo(t))return!1;if(e){const n=Ms(t);e(h9(t.tr,n,n.right))}return!0}function Fde(t,{map:e,table:n,tableStart:r},o){const s=t.mapping.maps.length;for(let i=0;i<e.height;){const a=i*e.width+o,l=e.map[a],c=n.nodeAt(l),u=c.attrs;if(o>0&&e.map[a-1]==l||o<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(s).map(r+l),null,Ml(u,o-e.colCount(l)));else{const d=t.mapping.slice(s).map(r+l);t.delete(d,d+c.nodeSize)}i+=u.rowspan}}function jde(t,e){if(!zo(t))return!1;if(e){const n=Ms(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;Fde(r,n,o),o!=n.left;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=zt.get(s)}e(r)}return!0}function zde(t,e,n){var r;const o=Un(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function p9(t,{map:e,tableStart:n,table:r},o){var s;let i=n;for(let c=0;c<o;c++)i+=r.child(c).nodeSize;const a=[];let l=o>0?-1:0;zde(e,r,o+l)&&(l=o==0||o==e.height?null:0);for(let c=0,u=e.width*o;c<e.width;c++,u++)if(o>0&&o<e.height&&e.map[u]==e.map[u-e.width]){const d=e.map[u],f=r.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...f,rowspan:f.rowspan+1}),c+=f.colspan-1}else{const d=l==null?Un(r.type.schema).cell:(s=r.nodeAt(e.map[u+l*e.width]))==null?void 0:s.type,f=d?.createAndFill();f&&a.push(f)}return t.insert(i,Un(r.type.schema).row.create(null,a)),t}function Vde(t,e){if(!zo(t))return!1;if(e){const n=Ms(t);e(p9(t.tr,n,n.top))}return!0}function Ude(t,e){if(!zo(t))return!1;if(e){const n=Ms(t);e(p9(t.tr,n,n.bottom))}return!0}function qde(t,{map:e,table:n,tableStart:r},o){let s=0;for(let l=0;l<o;l++)s+=n.child(l).nodeSize;const i=s+n.child(o).nodeSize,a=t.mapping.maps.length;t.delete(s+r,i+r);for(let l=0,c=o*e.width;l<e.width;l++,c++){const u=e.map[c];if(o>0&&u==e.map[c-e.width]){const d=n.nodeAt(u).attrs;t.setNodeMarkup(t.mapping.slice(a).map(u+r),null,{...d,rowspan:d.rowspan-1}),l+=d.colspan-1}else if(o<e.width&&u==e.map[c+e.width]){const d=n.nodeAt(u),f=d.attrs,h=d.type.create({...f,rowspan:d.attrs.rowspan-1},d.content),p=e.positionAt(o+1,l,n);t.insert(t.mapping.slice(a).map(r+p),h),l+=f.colspan-1}}}function Wde(t,e){if(!zo(t))return!1;if(e){const n=Ms(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;qde(r,n,o),o!=n.top;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=zt.get(n.table)}e(r)}return!0}function wS(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function Kde({width:t,height:e,map:n},r){let o=r.top*t+r.left,s=o,i=(r.bottom-1)*t+r.left,a=o+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[a]==n[a+1])return!0;s+=t,a+=t}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[i]==n[i+t])return!0;o++,i++}return!1}function kS(t,e){const n=t.selection;if(!(n instanceof dt)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Ms(t),{map:o}=r;if(Kde(o,r))return!1;if(e){const s=t.tr,i={};let a=ue.empty,l,c;for(let u=r.top;u<r.bottom;u++)for(let d=r.left;d<r.right;d++){const f=o.map[u*o.width+d],h=r.table.nodeAt(f);if(!(i[f]||!h))if(i[f]=!0,l==null)l=f,c=h;else{wS(h)||(a=a.append(h.content));const p=s.mapping.map(f+r.tableStart);s.delete(p,p+h.nodeSize)}}if(l==null||c==null)return!0;
105if(s.setNodeMarkup(l+r.tableStart,null,{...a9(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),a.size){const u=l+1+c.content.size,d=wS(c)?l+1:u;s.replaceWith(d+r.tableStart,u+r.tableStart,a)}s.setSelection(new dt(s.doc.resolve(l+r.tableStart))),e(s)}return!0}function xS(t,e){const n=Un(t.schema);return Gde(({node:r})=>n[r.type.spec.tableRole])(t,e)}function Gde(t){return(e,n)=>{var r;const o=e.selection;let s,i;if(o instanceof dt){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;s=o.$anchorCell.nodeAfter,i=o.$anchorCell.pos}else{if(s=cde(o.$from),!s)return!1;i=(r=Au(o.$from))==null?void 0:r.pos}if(s==null||i==null||s.attrs.colspan==1&&s.attrs.rowspan==1)return!1;if(n){let a=s.attrs;const l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const u=Ms(e),d=e.tr;for(let h=0;h<u.right-u.left;h++)l.push(c?{...a,colwidth:c&&c[h]?[c[h]]:null}:a);let f;for(let h=u.top;h<u.bottom;h++){let p=u.map.positionAt(h,u.left,u.table);h==u.top&&(p+=s.nodeSize);for(let g=u.left,y=0;g<u.right;g++,y++)g==u.left&&h==u.top||d.insert(f=d.mapping.map(p+u.tableStart,1),t({node:s,row:h,col:g}).createAndFill(l[y]))}d.setNodeMarkup(i,t({node:s,row:u.top,col:u.left}),l[0]),o instanceof dt&&d.setSelection(new dt(d.doc.resolve(o.$anchorCell.pos),f?d.doc.resolve(f):void 0)),n(d)}return!0}}function Jde(t,e){return function(n,r){if(!zo(n))return!1;const o=l0(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof dt?n.selection.forEachCell((i,a)=>{i.attrs[t]!==e&&s.setNodeMarkup(a,null,{...i.attrs,[t]:e})}):s.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function Yde(t){return function(e,n){if(!zo(e))return!1;if(n){const r=Un(e.schema),o=Ms(e),s=e.tr,i=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=i.map(l=>o.table.nodeAt(l));for(let l=0;l<i.length;l++)a[l].type==r.header_cell&&s.setNodeMarkup(o.tableStart+i[l],r.cell,a[l].attrs);if(s.steps.length==0)for(let l=0;l<i.length;l++)s.setNodeMarkup(o.tableStart+i[l],r.header_cell,a[l].attrs);n(s)}return!0}}function CS(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const s=e.table.nodeAt(r[o]);if(s&&s.type!==n.header_cell)return!1}return!0}function Of(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Yde(t):function(n,r){if(!zo(n))return!1;if(r){const o=Un(n.schema),s=Ms(n),i=n.tr,a=CS("row",s,o),l=CS("column",s,o),c=(t==="column"?a:t==="row"&&l)?1:0,u=t=="column"?{left:0,top:c,right:1,bottom:s.map.height}:t=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=t=="column"?l?o.cell:o.header_cell:t=="row"?a?o.cell:o.header_cell:o.cell;s.map.cellsInRect(u).forEach(f=>{const h=f+s.tableStart,p=i.doc.nodeAt(h);p&&i.setNodeMarkup(h,d,p.attrs)}),r(i)}return!0}}Of("row",{useDeprecatedLogic:!0});Of("column",{useDeprecatedLogic:!0});var Xde=Of("cell",{useDeprecatedLogic:!0});function Zde(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const s=t.node(-1).child(r),i=s.lastChild;if(i)return o-1-i.nodeSize;o-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return o+1;o+=s.nodeSize}}return null}function _S(t){return function(e,n){if(!zo(e))return!1;const r=Zde(l0(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(We.between(o,dde(o))).scrollIntoView())}return!0}}function Qde(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function efe({allowTableNodeSelection:t=!1}={}){return new Kn({key:$i,state:{init(){return null},apply(e,n){const r=e.getMeta($i);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:s}=e.mapping.mapResult(n);return o?null:s}},props:{decorations:hde,handleDOMEvents:{mousedown:Mde},createSelectionBetween(e){return $i.getState(e.state)!=null?e.state.selection:null},handleTripleClick:_de,handleKeyDown:Cde,handlePaste:Sde},appendTransaction(e,n,r){return gde(r,u9(r,n),t)}})}function SS(t,e,n,r,o,s){let i=0,a=!0,l=e.firstChild;const c=t.firstChild;for(let u=0,d=0;u<c.childCount;u+=1){const{colspan:f,colwidth:h}=c.child(u).attrs;for(let p=0;p<f;p+=1,d+=1){const g=o===d?s:h&&h[p],y=g?`${g}px`:"";i+=g||r,g||(a=!1),l?(l.style.width!==y&&(l.style.width=y),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=y}}for(;l;){const u=l.nextSibling;l.parentNode.removeChild(l),l=u}a?(n.style.width=`${i}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${i}px`)}class tfe{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),SS(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,SS(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function MS(t,e){return t.createAndFill()}function nfe(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};
105return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function rfe(t,e,n,r,o){const s=nfe(t),i=[],a=[];for(let c=0;c<n;c+=1){const u=MS(s.cell);if(u&&a.push(u),r){const d=MS(s.header_cell);d&&i.push(d)}}const l=[];for(let c=0;c<e;c+=1)l.push(s.row.createChecked(null,r&&c===0?i:a));return s.table.createChecked(null,l)}function ofe(t){return t instanceof dt}const Gh=({editor:t})=>{const{selection:e}=t.state;if(!ofe(e))return!1;let n=0;const r=LA(e.ranges[0].$from,o=>o.type.name==="table");return r?.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},sfe=en.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:tfe,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:t}){return["table",Rt(this.options.HTMLAttributes,t),["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:s})=>{const i=rfe(s.schema,t,e,n);if(o){const a=r.selection.anchor+1;r.replaceSelectionWith(i).scrollIntoView().setSelection(We.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Hde(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Bde(t,e),deleteColumn:()=>({state:t,dispatch:e})=>jde(t,e),addRowBefore:()=>({state:t,dispatch:e})=>Vde(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Ude(t,e),deleteRow:()=>({state:t,dispatch:e})=>Wde(t,e),deleteTable:()=>({state:t,dispatch:e})=>Qde(t,e),mergeCells:()=>({state:t,dispatch:e})=>kS(t,e),splitCell:()=>({state:t,dispatch:e})=>xS(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Of("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Of("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>Xde(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>kS(t,e)?!0:xS(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>Jde(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>_S(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>_S(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&u9(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=dt.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Gh,"Mod-Backspace":Gh,Delete:Gh,"Mod-Delete":Gh}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Ede({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],efe({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:et(Ee(t,"tableRole",e))}}}),ife=en.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",Rt(this.options.HTMLAttributes,t),0]}}),afe=en.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",Rt(this.options.HTMLAttributes,t),0]}}),lfe=en.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",Rt(this.options.HTMLAttributes,t),0]}}),cfe=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},ufe={components:{EditorContent:ode},props:{modelValue:{type:String,default:""}},emits:["update:modelValue","close"],data(){return{editor:null,tableOptionsOpen:!1,selectedClasses:"fm-p-2 fm-w-[36px] fm-h-[36px] fm-flex fm-items-center fm-justify-center dark:fm-text-gray-300 fm-rounded fm-cursor-pointer dark:hover:fm-text-gray-300 dark:fm-bg-gray-600 dark:hover:fm-bg-gray-500 fm-text-gray-300 hover:fm-text-white hover:fm-bg-gray-500 !fm-bg-gray-600",unSelectedClasses:"fm-p-2 fm-w-[36px] fm-h-[36px] fm-flex fm-items-center fm-justify-center fm-text-gray-500 fm-rounded fm-cursor-pointer hover:fm-text-gray-900 hover:fm-bg-gray-100 dark:fm-text-gray-400 dark:hover:fm-text-white dark:hover:fm-bg-gray-600",unSelectedClassesNoSize:"fm-p-2 fm-flex fm-items-center fm-justify-center fm-text-gray-500 fm-rounded fm-cursor-pointer hover:fm-text-gray-900 hover:fm-bg-gray-100 dark:fm-text-gray-400 dark:hover:fm-text-white dark:hover:fm-bg-gray-600"}},watch:{modelValue(t){this.editor.getHTML()!==t&&this.editor.commands.setContent(t,!1)}},methods:{toggleTableOptions(){this.tableOptionsOpen=!this.tableOptionsOpen}},mounted(){this.editor=new rde({extensions:[kce,xce,sfe.configure({resizable:!0}),lfe,afe,ife,Cce.configure({types:["heading","paragraph"],alignments:["left","center","right"]})],content:this.modelValue,onUpdate:()=>{this.$emit("update:modelValue",this.editor.getHTML())}}),this.editor.commands.focus("end")},beforeUnmount(){this.editor.destroy()}},dfe={class:"wysiwyg"},ffe={key:0,class:"fm-w-full fm-mb-4 fm-border fm-border-gray-200 fm-rounded-lg fm-bg-gray-50 dark:fm-bg-gray-700 dark:fm-border-gray-600"},hfe={class:"fm-flex fm-items-center fm-justify-between fm-px-3 fm-py-2 fm-border-b dark:fm-border-gray-600"},pfe={class:"fm-flex fm-flex-wrap fm-items-center fm-divide-gray-200 sm:fm-divide-x dark:fm-divide-gray-600"},mfe={class:"fm-flex fm-items-center fm-space-x-1 sm:fm-pr-4"},gfe=m("span",{class:"fm-sr-only"},"Heading 1",-1),yfe=m("span",{class:"fm-sr-only"},"Heading 2",-1),vfe=m("span",{class:"fm-sr-only"},"Heading 3",-1),bfe=m("span",{class:"fm-sr-only"}
105,"Heading 4",-1),wfe=m("span",{class:"fm-sr-only"},"Heading 5",-1),kfe=m("span",{class:"fm-sr-only"},"Heading 6",-1),xfe=m("span",{class:"fm-sr-only"},"Paragraph",-1),Cfe={class:"fm-flex fm-flex-wrap fm-items-center fm-space-x-1 sm:fm-px-4"},_fe=m("span",{class:"fm-sr-only"},"Bold",-1),Sfe=m("span",{class:"fm-sr-only"},"Italic",-1),Mfe=m("span",{class:"fm-sr-only"},"Underline",-1),Tfe=m("span",{class:"fm-sr-only"},"Strike through",-1),Efe={class:"fm-flex fm-flex-wrap fm-items-center fm-space-x-1 sm:fm-px-4"},Afe=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"})],-1),Ofe=m("span",{class:"fm-sr-only"},"Left align",-1),Ife=[Afe,Ofe],Nfe=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"fm-w-5 fm-h-5"},[m("path",{d:"M3.75 6.75H20.25M8 12H15.75M6.5 17.25H17.25","stroke-linecap":"round","stroke-linejoin":"round"})],-1),Lfe=m("span",{class:"fm-sr-only"},"Align center",-1),Rfe=[Nfe,Lfe],$fe=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6.75h16.5M3.75 12h16.5M12 17.25h8.25"})],-1),Dfe=m("span",{class:"fm-sr-only"},"Right align",-1),Pfe=[$fe,Dfe],Hfe={class:"fm-flex fm-flex-wrap fm-items-center fm-space-x-1 sm:fm-px-4"},Bfe=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zM3.75 12h.007v.008H3.75V12zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm-.375 5.25h.007v.008H3.75v-.008zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})],-1),Ffe=m("span",{class:"fm-sr-only"},"Unordered list",-1),jfe=[Bfe,Ffe],zfe=ps('<svg fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="fm-w-5 fm-h-5"><path d="M8.25 6.75H20.25M8.25 12H20.25M8.25 17.25H20.25" stroke-linecap="round" stroke-linejoin="round"></path><path d="M5.31374 4.45459V7.00004H4.77557V4.96542H4.76065L4.17773 5.33083V4.85356L4.80788 4.45459H5.31374Z" fill="currentColor"></path><path d="M4.20632 13V12.6123L5.11239 11.7733C5.18945 11.6987 5.25408 11.6316 5.30629 11.572C5.35932 11.5123 5.3995 11.4539 5.42685 11.3967C5.45419 11.3387 5.46786 11.2761 5.46786 11.209C5.46786 11.1345 5.45088 11.0702 5.4169 11.0164C5.38293 10.9617 5.33653 10.9198 5.2777 10.8908C5.21887 10.861 5.15217 10.8461 5.07759 10.8461C4.9997 10.8461 4.93176 10.8618 4.87376 10.8933C4.81576 10.9248 4.77101 10.97 4.73952 11.0288C4.70804 11.0876 4.69229 11.1577 4.69229 11.2389H4.18146C4.18146 11.0723 4.21916 10.9277 4.29457 10.8051C4.36997 10.6825 4.47562 10.5876 4.61151 10.5205C4.7474 10.4533 4.904 10.4198 5.08132 10.4198C5.26361 10.4198 5.42229 10.4521 5.55735 10.5167C5.69324 10.5805 5.79889 10.6692 5.87429 10.7827C5.94969 10.8962 5.98739 11.0263 5.98739 11.173C5.98739 11.2691 5.96834 11.364 5.93022 11.4576C5.89293 11.5512 5.82623 11.6552 5.73011 11.7696C5.634 11.8831 5.49852 12.0194 5.32369 12.1785L4.95206 12.5427V12.5601H6.02095V13H4.20632Z" fill="currentColor"></path><path d="M5.14719 19.0348C4.96159 19.0348 4.79628 19.0029 4.65128 18.9391C4.5071 18.8745 4.39317 18.7859 4.30948 18.6732C4.22662 18.5596 4.18395 18.4287 4.18146 18.2804H4.72337C4.72668 18.3426 4.74698 18.3972 4.78427 18.4445C4.82238 18.4909 4.87293 18.5269 4.9359 18.5526C4.99888 18.5783 5.06972 18.5911 5.14844 18.5911C5.23047 18.5911 5.30297 18.5766 5.36594 18.5476C5.42892 18.5186 5.47822 18.4784 5.51385 18.4271C5.54948 18.3757 5.56729 18.3165 5.56729 18.2493C5.56729 18.1814 5.54824 18.1213 5.51012 18.0691C5.47283 18.0161 5.41897 17.9747 5.34854 17.9448C5.27894 17.915 5.19608 17.9001 5.09996 17.9001H4.86257V17.5048H5.09996C5.18117 17.5048 5.25284 17.4908 5.31499 17.4626C5.37
105796 17.4344 5.42685 17.3955 5.46165 17.3457C5.49645 17.2952 5.51385 17.2364 5.51385 17.1693C5.51385 17.1055 5.49852 17.0495 5.46786 17.0015C5.43803 16.9526 5.39577 16.9145 5.34109 16.8871C5.28723 16.8598 5.22425 16.8461 5.15217 16.8461C5.07925 16.8461 5.01255 16.8594 4.95206 16.8859C4.89157 16.9116 4.8431 16.9484 4.80664 16.9965C4.77018 17.0446 4.75071 17.1009 4.74822 17.1655H4.23242C4.23491 17.0189 4.27675 16.8896 4.35795 16.7777C4.43916 16.6659 4.54853 16.5785 4.68608 16.5155C4.82446 16.4517 4.98065 16.4198 5.15465 16.4198C5.33031 16.4198 5.48402 16.4517 5.61577 16.5155C5.74751 16.5793 5.84985 16.6655 5.92276 16.774C5.99651 16.8817 6.03297 17.0027 6.03214 17.1369C6.03297 17.2795 5.98864 17.3984 5.89915 17.4937C5.81049 17.5889 5.6949 17.6494 5.55238 17.6751V17.695C5.73964 17.719 5.88216 17.7841 5.97994 17.8901C6.07854 17.9954 6.12743 18.1271 6.1266 18.2854C6.12743 18.4304 6.08558 18.5592 6.00107 18.6719C5.91738 18.7846 5.80179 18.8733 5.6543 18.9379C5.50681 19.0025 5.33777 19.0348 5.14719 19.0348Z" fill="currentColor"></path></svg><span class="fm-sr-only">Ordered list</span>',2),Vfe=[zfe],Ufe={class:"fm-flex fm-flex-wrap fm-items-center fm-space-x-1 sm:fm-pl-4"},qfe={class:"fm-relative"},Wfe=m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 01-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0112 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"})],-1),Kfe=[Wfe],Gfe={key:0,class:"fm-absolute fm-top-[40px] fm-left-0 fm-flex fm-flex-col fm-gap-1 fm-z-10 fm-w-[160px] fm-p-2 fm-bg-gray-50 fm-rounded-b-lg fm-max-h-[200px] fm-overflow-auto"},Jfe=m("svg",{"aria-hidden":"true",class:"fm-w-4 fm-h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),Yfe=m("span",{class:"fm-sr-only"},"Close wysiwyg",-1),Xfe=[Jfe,Yfe],Zfe=m("div",{id:"tooltip-fullscreen",role:"tooltip",class:"fm-absolute fm-z-10 fm-invisible fm-inline-block fm-px-3 fm-py-2 fm-text-sm fm-font-medium fm-text-white fm-transition-opacity fm-duration-300 fm-bg-gray-900 fm-rounded-lg fm-shadow-sm fm-opacity-0 tooltip dark:fm-bg-gray-700"},[Le(" Show full screen "),m("div",{class:"tooltip-arrow","data-
105popper-arrow":""})],-1),Qfe={class:"fm-p-2 fm-bg-white fm-rounded-b-lg dark:fm-bg-gray-800 dark:fm-text-white"};function ehe(t,e,n,r,o,s){const i=lf("editor-content");return k(),_("div",dfe,[o.editor?(k(),_("div",ffe,[m("div",hfe,[m("div",pfe,[m("div",mfe,[m("button",{onClick:e[0]||(e[0]=a=>o.editor.chain().focus().toggleHeading({level:1}).run()),type:"button",class:H(o.editor.isActive("heading",{level:1})?o.selectedClasses:o.unSelectedClasses)},[Le(" H1 "),gfe],2),m("button",{onClick:e[1]||(e[1]=a=>o.editor.chain().focus().toggleHeading({level:2}).run()),type:"button",class:H(o.editor.isActive("heading",{level:2})?o.selectedClasses:o.unSelectedClasses)},[Le(" H2 "),yfe],2),m("button",{onClick:e[2]||(e[2]=a=>o.editor.chain().focus().toggleHeading({level:3}).run()),type:"button",class:H(o.editor.isActive("heading",{level:3})?o.selectedClasses:o.unSelectedClasses)},[Le(" H3 "),vfe],2),m("button",{onClick:e[3]||(e[3]=a=>o.editor.chain().focus().toggleHeading({level:4}).run()),type:"button",class:H(o.editor.isActive("heading",{level:4})?o.selectedClasses:o.unSelectedClasses)},[Le(" H4 "),bfe],2),m("button",{onClick:e[4]||(e[4]=a=>o.editor.chain().focus().toggleHeading({level:5}).run()),type:"button",class:H(o.editor.isActive("heading",{level:5})?o.selectedClasses:o.unSelectedClasses)},[Le(" H5 "),wfe],2),m("button",{onClick:e[5]||(e[5]=a=>o.editor.chain().focus().toggleHeading({level:6}).run()),type:"button",class:H(o.editor.isActive("heading",{level:6})?o.selectedClasses:o.unSelectedClasses)},[Le(" H6 "),kfe],2),m("button",{onClick:e[6]||(e[6]=a=>o.editor.chain().focus().setParagraph().run()),type:"button",class:H(o.editor.isActive("paragraph")?o.selectedClasses:o.unSelectedClasses)},[Le(" P "),xfe],2)]),m("div",Cfe,[m("button",{onClick:e[7]||(e[7]=a=>o.editor.chain().focus().toggleBold().run()),type:"button",class:H(o.editor.isActive("bold")?o.selectedClasses:o.unSelectedClasses)},[Le(" B "),_fe],2),m("button",{onClick:e[8]||(e[8]=a=>o.editor.chain().focus().toggleItalic().run()),type:"button",class:H(o.editor.isActive("italic")?o.selectedClasses:o.unSelectedClasses)},[Le(" I "),Sfe],2),m("button",{onClick:e[9]||(e[9]=a=>o.editor.chain().focus().toggleUnderline().run()),type:"button",class:H(o.editor.isActive("underline")?o.selectedClasses:o.unSelectedClasses)},[Le(" U "),Mfe],2),m("button",{onClick:e[10]||(e[10]=a=>o.editor.chain().focus().toggleStrike().run()),type:"button",class:H(o.editor.isActive("strike")?o.selectedClasses:o.unSelectedClasses)},[Le(" S "),Tfe],2)]),m("div",Efe,[m("button",{onClick:e[11]||(e[11]=a=>o.editor.chain().focus().setTextAlign("left").run()),type:"button",class:H(o.editor.isActive({textAlign:"left"})?o.selectedClasses:o.unSelectedClasses)},Ife,2),m("button",{onClick:e[12]||(e[12]=a=>o.editor.chain().focus().setTextAlign("center").run()),type:"button",class:H(o.editor.isActive({textAlign:"center"})?o.selectedClasses:o.unSelectedClasses)},Rfe,2),m("button",{onClick:e[13]||(e[13]=a=>o.editor.chain().focus().setTextAlign("right").run()),type:"button",class:H(o.editor.isActive({textAlign:"right"})?o.selectedClasses:o.unSelectedClasses)},Pfe,2)]),m("div",Hfe,[m("button",{onClick:e[14]||(e[14]=a=>o.editor.chain().focus().toggleBulletList().run()),type:"button",class:H(o.editor.isActive("bulletList")?o.selectedClasses:o.unSelectedClasses)},jfe,2),m("button",{onClick:e[15]||(e[15]=a=>o.editor.chain().focus().toggleOrderedList().run()),type:"button",class:H(o.editor.isActive("orderedList")?o.selectedClasses:o.unSelectedClasses)},Vfe,2)]),m("div",Ufe,[m("div",qfe,[m("button",{type:"button",class:H(o.unSelectedClasses),onClick:e[16]||(e[16]=a=>s.toggleTableOptions())},Kfe,2),o.tableOptionsOpen?(k(),_("div",Gfe,[m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[17]||(e[17]=a=>(s.toggleTableOptions(),o.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()))},"Insert table",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[18]||(e[18]=a=>o.editor.chain().focus().addColumnBefore().run())},"Add column before",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[19]||(e[19]=a=>o.editor.chain().focus().addColumnAfter().run())},"Add column after",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[20]||(e[20]=a=>o.editor.chain().focus().addRowBefore().run())},"Add row before",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[21]||(e[21]=a=>o.editor.chain().focus().addRowAfter().run())},"Add row after",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[22]||(e[22]=a=>o.editor.chain().focus().deleteColumn().run())},"Delete column",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[23]||(e[23]=a=>o.editor.chain().focus().deleteRow().run())},"Delete row",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[24]||(e[24]=a=>(s.toggleTableOptions(),o.editor.chain().focus().deleteTable().run()))},"Delete table",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[25]||(e[25]=a=>o.editor.chain().focus().mergeCells().run())},"Merge cells",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[26]||(e[26]=a=>o.editor.chain().focus().splitCell().run())},"Split cells",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[27]||(e[27]=a=>o.editor.chain().focus().toggleHeaderColumn().run())},"Toggle header column",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[28]||(e[28]=a=>o.editor.chain().focus().toggleHeaderRow().run())},"Toggle header row",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[29]||(e[29]=a=>o.editor.chain().focus().toggleHeaderCell().run())},"Toggle header cell",2)])):L("",!0)])])]),m("button",{type:"button",onClick:e[30]||(e[30]=a=>t.$emit("close")),"data-tooltip-target":"tooltip-fullscreen",class:"fm-p-2 fm-text-gray-500 fm-rounded fm-cursor-pointer sm:fm-ml-auto hover:fm-text-gray-900 hover:fm-bg-gray-100 dark:fm-text-gray-400 dark:hover:fm-text-white dark:hover:fm-bg-gray-600"},Xfe),Zfe]),m("div",Qfe,[Z(i,{editor:o.editor},null,8,["editor"])])])):L("",!0)])}const the=cfe(ufe,[["render",ehe]]),nhe={key:0},rhe={class:"fm-opacity-50"},ohe={key:1},she=Ne({__name:"FmWysiwyg",props:{block:{type:Object,required:!0},fieldName:{type:String,required:!0},label:{type:String,required:!0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t;let n=pe(!1);const r=s=>{s.key==="Escape"&&(n.value=!1)},o=()=>{e.block[e.fieldName]&&e.block[e.fieldName].replace(/<\/?[^>]+(>|$)/g,"").length===0&&(e.block[e.fieldName]=null),n.value=!1,document.dispatchEvent(new CustomEvent("flowmate-input-updated",{}))};return(s,i)=>(k(),_("div",null,[e.editMode?(k(),_("div",nhe,[b(n)?(k(),_("span",ohe,[Z(the,{onKeyup:r,onClose:o,class:"fm-text-black",modelValue:e.block[e.fieldName],"onUpdate:modelValue":i[1]||(i[1]=a=>e.block[e.fieldName]=a)},null,8,["modelValue"])])):(k(),_("span",{key:0,onClick:i[0]||(i[0]=a=>kt(n)?n.value=!0:n=!0),class:"fm-cursor-pointer"},[Ot(s.$slots,"default",{},()=>[m("span",rhe,ve(e.label)+": Click to add",1)])]))])):Ot(s.$slots,"default",{key:1})]))}}),ihe={class:"fm-relative"},ahe=m("svg",{fill:"none",stroke:"currentColor",class:"fm-w-5 fm-h-5","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125"})],-1),lhe={class:"fm-sr-only"},che={key:1},uhe={key:2,class:"fm-w-full"},dhe=m("div",{class:"fm-flex fm-relative fm-items-center fm-justify-center fm-w-full fm-h-36 fm-bg-gray-300 fm-rounded dark:fm-bg-gray-700 fm-opacity-80"},[m("svg",{class:"fm-w-12 fm-h-12 fm-text-gray-200",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",fill:"
105currentColor",viewBox:"0 0 640 512"},[m("path",{d:"M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z"})])],-1),fhe=[dhe],hhe=Ne({__name:"FmImage",props:{block:{type:Object,required:!0},fieldName:{type:String,required:!0},blockIndex:{type:Number,required:!0,default:0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t;return(n,r)=>(k(),_("div",null,[m("div",ihe,[e.editMode&&e.configStore?(k(),_("button",{key:0,type:"button",onClick:r[0]||(r[0]=o=>e.configStore.setValues(e.block,e.blockIndex,e.fieldName,["jpg","jpeg","png","gif","webp","avif"],e.configStore.getActiveFieldType,"media",e.block.acf_fc_layout,!1)),"data-dial-toggle":"speed-dial-menu-dropdown","aria-controls":"speed-dial-menu-dropdown","aria-expanded":"false",class:"fm-flex fm-items-center fm-justify-center fm-ml-auto fm-text-white !fm-bg-blue-700 fm-rounded-full fm-w-10 fm-h-10 hover:!fm-bg-blue-800 dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 focus:fm-ring-4 focus:fm-ring-blue-300 focus:fm-outline-none dark:focus:fm-ring-blue-800 fm-z-20 fm-absolute fm-top-2 fm-right-2"},[ahe,m("span",lhe,"Edit "+ve(e.configStore.getActiveFieldType),1)])):L("",!0),e.block[e.fieldName]&&e.block[e.fieldName].ID?(k(),_("div",che,[Ot(n.$slots,"default")])):(k(),_("div",uhe,fhe))])]))}}),phe={class:"fm-relative"},mhe=m("svg",{fill:"none",stroke:"currentColor",class:"fm-w-5 fm-h-5","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125"})],-1),ghe=m("span",{class:"fm-sr-only"},"Edit gallery",-1),yhe=[mhe,ghe],vhe={key:1},bhe={key:2,class:"fm-w-full"},whe=m("div",{class:"fm-flex fm-relative fm-items-center fm-justify-center fm-w-full fm-h-36 fm-bg-gray-300 fm-rounded dark:fm-bg-gray-700 fm-opacity-80"},[m("svg",{class:"fm-w-12 fm-h-12 fm-text-gray-200",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 640 512"},[m("path",{d:"M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z"})])],-1),khe=[whe],xhe=Ne({__name:"FmGallery",props:{block:{type:Object,required:!0},fieldName:{type:String,required:!0},blockIndex:{type:Number,required:!0,default:0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t;return(n,r)=>(k(),_("div",null,[m("div",phe,[e.editMode&&e.configStore?(k(),_("button",{key:0,type:"button",onClick:r[0]||(r[0]=o=>e.configStore.setValues(e.block,e.blockIndex,e.fieldName,["jpg","jpeg","png","gif"],"gallery","media",e.block.acf_fc_layout,!1)),"data-dial-toggle":"speed-dial-menu-dropdown","aria-controls":"speed-dial-menu-dropdown","aria-expanded":"false",class:"fm-flex fm-items-center fm-justify-center fm-ml-auto fm-text-white !fm-bg-blue-700 fm-rounded-full fm-w-10 fm-h-10 hover:!fm-bg-blue-800 dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 focus:fm-ring-4 focus:fm-ring-blue-300 focus:fm-outline-none dark:focus:fm-ring-blue-800 fm-z-20 fm-absolute fm-top-2 fm-right-2"},yhe)):L("",!0),e.block[e.fieldName]&&e.block[e.fieldName].ID?(k(),_("div",vhe,[Ot(n.$slots,"default")])):(k(),_("div",bhe,khe))])]))}}),Che=m("svg",{"aria-hidden":"true",width:"20",height:"20",class:"fm-w-6 fm-h-6",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[m("path",{d:"M10 6C9.46957 6 8.96086 5.78929 8.58579 5.41421C8.21071 5.03914 8 4.53043 8 4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2C10.5304 2 11.0391 2.21071 11.4142 2.58579C11.7893 2.96086 12 3.46957 12 4C12 4.53043 11.7893 5.03914 11.4142 5.41421C11.0391 5.78929 10.5304 6 10 6ZM10 12C9.46957 12 8.96086 11.7893 8.58579 11.4142C8.21071 11.0391 8 10.5304 8 10C8 9.46957 8.21071 8.96086 8.58579 8.58579C8.96086 8.21071 9.46957 8 10 8C10.5304 8 11.0391 8.21071 11.4142 8.58579C11.7893 8.96086 12 9.46957 12 10C12 10.5304 11.7893 11.0391 11.4142 11.4142C11.0391 11.7893 10.5304 12 10 12ZM8 16C8 16.5304 8.21071 17.0391 8.58579 17.4142C8.96086 17.7893 9.46957 18 10 18C10.5304 18 11.0391 17.7893 11.4142 17.4142C11.7893 17.0391 12 16.5304 12 16C12 15.4696 11.7893 14.9609 11.4142 14.5858C11.0391 14.2107 10.5304 14 10 14C9.46957 14 8.96086 14.2107 8.58579 14.5858C8.21071 14.9609 8 15.4696 8 16Z",fill:"currentColor"}
105)],-1),_he=m("span",{class:"fm-sr-only"},"Open actions menu",-1),She=[Che,_he],Mhe=["innerHTML"],The={class:"fm-absolute fm-bottom-0 fm-right-2 fm-flex fm-gap-1"},Ehe={class:"fm-relative fm-inline-flex fm-items-center fm-justify-center fm-w-6 fm-h-6 fm-ml-1 fm-mt-1 fm-overflow-hidden fm-bg-gray-100 fm-rounded-full dark:fm-bg-gray-600"},Ahe=["title"],Ohe={class:"fm-flex fm-gap-2 fm-flex-col fm-justify-end fm-space-y-2"},Ihe={key:0},Nhe={key:0},Lhe=["for","innerHTML"],Rhe=["id","onUpdate:modelValue"],$he={key:0,value:""},Dhe=["value","innerHTML"],Phe={key:1,class:"fm-flex fm-items-center"},Hhe=["id","onChange","checked"],Bhe=["for","innerHTML"],Fhe={key:2,class:"fm-flex fm-flex-col"},jhe=["innerHTML"],zhe=["id","value","onUpdate:modelValue"],Vhe=["for","innerHTML"],Uhe={key:3,class:"fm-flex fm-flex-col"},qhe=["innerHTML"],Whe={key:0},Khe=["id","onUpdate:modelValue"],Ghe=["for"],Jhe=["id","value","onUpdate:modelValue"],Yhe=["for","innerHTML"],Xhe={key:4,class:"fm-flex fm-flex-col"},Zhe=["onClick"],Qhe={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"fm-w-6 fm-h-6"},epe=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z"},null,-1),tpe=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 6h.008v.008H6V6z"},null,-1),npe=[epe,tpe],rpe={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"fm-w-6 fm-h-6"},ope=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1),spe=[ope],ipe=["innerHTML"],ape={key:0},lpe={key:0},cpe=["for","innerHTML"],upe=["id","onUpdate:modelValue"],dpe={key:0,value:""},fpe=["value","innerHTML"],hpe={key:1,class:"fm-flex fm-items-center"},ppe=["id","onChange","checked"],mpe=["for","innerHTML"],gpe={key:2,class:"fm-flex fm-flex-col"},ype=["innerHTML"],vpe=["id","value","onUpdate:modelValue"],bpe=["for","innerHTML"],wpe={key:3,class:"fm-flex fm-flex-col"},kpe=["innerHTML"],xpe={key:0},Cpe=["id","onUpdate:modelValue"],_pe=["for"],Spe=["id","value","onUpdate:modelValue"],Mpe=["for","innerHTML"],Tpe={key:4,class:"fm-flex fm-flex-col"},Epe=["onClick"],Ape={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"fm-w-6 fm-h-6"},Ope=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z"},null,-1),Ipe=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 6h.008v.008H6V6z"},null,-1),Npe=[Ope,Ipe],Lpe={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"fm-w-6 fm-h-6"},Rpe=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1),$pe=[Rpe],Dpe=["innerHTML"],Ppe=Ne({__name:"FmSettings",props:{layout:{type:String,required:!0},block:{type:Object,required:!0},editMode:{type:Boolean,required:!0,default:!1},blockIndex:{type:Number,required:!0,default:0},configStore:{type:Object,required:!1,default:!1},collaborationsStore:{type:Object,required:!1,default:!1},additionalFields:{type:Array,required:!1}},setup(t){const e=t,n=pe(!1),r=e.configStore?e.configStore.getConfig:!1,o=Math.random().toString(36).substring(7),s=()=>{n.value=!n.value},i=(g,y,w)=>{g&&g.target&&g.target&&g.target instanceof HTMLInputElement&&(g.target.checked?w?e.block[y]=!0:e.block.settings[y]=!0:w?e.block[y]=!1:e.block.settings[y]=!1,h())},a=pe(),l=g=>{if(n.value){if(g.target!==a.value&&g.composedPath().includes(a.value))return;n.value=!1}};Zt(()=>{window.addEventListener("click",l)}),Fo(()=>{window.removeEventListener("click",l)});const c=U(()=>e.collaborationsStore&&e.collaborationsStore.getCollaborationGuests&&e.collaborationsStore.getCollaborationGuests.length>0?e.collaborationsStore.getCollaborationGuests.find(g=>g.activeBlockIndex===e.blockIndex):!1),u=U(()=>
105{if(c.value)return e.collaborationsStore.getGuestColor(c.value.name).border}),d=U(()=>{if(c.value)return e.collaborationsStore.getGuestColor(c.value.name).bg}),f=U(()=>e.collaborationsStore&&e.collaborationsStore.getCollaborationGuests&&e.collaborationsStore.getCollaborationGuests.length>0?e.collaborationsStore.getCollaborationGuests.filter(g=>g.activeBlockIndex===e.blockIndex):!1),h=()=>{document.dispatchEvent(new CustomEvent("flowmate-input-updated",{}))},p=U(()=>{var g;return(g=r.config[e.layout])==null?void 0:g.settings});return(g,y)=>e.editMode&&b(r)&&b(r).config?(k(),_("div",{key:0,ref_key:"fmSettings",ref:a,class:H(["fm-absolute fm-right-0 fm-bottom-0 fm-top-0 fm-left-0 fm-pointer-events-none group fm-settings",[n.value?"fm-z-40":"fm-z-10",u.value?u.value:"show-border"]])},[m("button",{type:"button",onClick:s,"aria-controls":"speed-dial-menu-dropdown","aria-expanded":"false",style:{"pointer-events":"all!important"},class:"fm-flex fm-absolute fm-top-4 fm-right-4 fm-items-center fm-justify-center fm-ml-auto fm-text-white !fm-bg-blue-700 fm-rounded-full fm-w-10 fm-h-10 hover:!fm-bg-blue-800 dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 focus:fm-ring-4 focus:fm-ring-blue-300 focus:fm-outline-none dark:focus:fm-ring-blue-800"},She),b(r).config[e.layout].acf_fc_label?(k(),_("span",{key:0,class:H(["fm-absolute fm-top-0 fm-left-0 fm-px-[8px] fm-py-[2px] fm-text-white fm-text-xs fm-layout-label fm-invisible",d.value?d.value:"!fm-bg-blue-700 dark:!fm-bg-blue-600"]),innerHTML:b(r).config[e.layout].acf_fc_label},null,10,Mhe)):L("",!0),m("div",The,[(k(!0),_(ce,null,Oe(f.value,(w,x)=>(k(),_("div",{class:H(["fm-relative fm-w-8 fm-h-8 fm-rounded-full fm-rounded-bl-none fm-rounded-br-none",t.collaborationsStore.getGuestColor(w.name).bg]),key:x},[m("div",Ehe,[m("span",{class:"fm-cursor-default fm-font-medium fm-text-gray-600 dark:fm-text-gray-300 fm-uppercase fm-text-sm",title:w.name},ve(t.collaborationsStore.getGuestInitials(w.name)),9,Ahe)])],2))),128))]),m("div",{style:{"pointer-events":"all!important"},class:H(["fm-pointer-events-all fm-absolute fm-right-4 fm-top-14 fm-w-[300px] fm-max-h-[400px] fm-overflow-auto fm-p-4 fm-mt-2 fm-bg-white fm-border fm-border-gray-100 fm-rounded-lg fm-shadow-sm dark:fm-border-gray-600 dark:fm-bg-gray-700",n.value?"":"fm-hidden"])},[m("div",Ohe,[(k(!0),_(ce,null,Oe(p.value.sub_fields,(w,x)=>(k(),_("div",null,[typeof w=="object"?(k(),_("div",Ihe,[w.type==="select"?(k(),_("div",Nhe,[m("label",{for:x+b(o),class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:w.label},null,8,Lhe),Ie(m("select",{id:x+b(o),"onUpdate:modelValue":C=>e.block.settings[x]=C,onChange:h,class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},[w.allow_null===1?(k(),_("option",$he,"- Select -")):L("",!0),(k(!0),_(ce,null,Oe(w.choices,(C,v)=>(k(),_("option",{value:v,innerHTML:C},null,8,Dhe))),256))],40,Rhe),[[co,e.block.settings[x]]])])):L("",!0),w.type==="true_false"?(k(),_("div",Phe,[m("input",{id:x+b(o),onChange:C=>i(C,x,!1),checked:e.block.settings[x]===!0,type:"checkbox",value:!0,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,Hhe),m("label",{for:x+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300",innerHTML:w.label},null,8,Bhe)])):L("",!0),w.type==="checkbox"?(k(),_("div",Fhe,[m("p",{class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:w.label},null,8,jhe),(k(!0),_(ce,null,Oe(w.choices,(C,v)=>(k(),_("div",null,[Ie(m("input",{id:v+x+b(o),value:v,type:"checkbox","onUpdate:modelValue":S=>e.block.settings[x]=S,onChange:h,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dar
105k:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,zhe),[[yl,e.block.settings[x]]]),m("label",{for:v+x+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300",innerHTML:C},null,8,Vhe)]))),256))])):L("",!0),w.type==="radio"?(k(),_("div",Uhe,[m("p",{class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:w.label},null,8,qhe),w.allow_null===1?(k(),_("div",Whe,[Ie(m("input",{id:"null_"+x+b(o),value:"",type:"radio","onUpdate:modelValue":C=>e.block.settings[x]=C,onChange:h,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,Khe),[[zs,e.block.settings[x]]]),m("label",{for:"null_"+x+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300"},"- None -",8,Ghe)])):L("",!0),(k(!0),_(ce,null,Oe(w.choices,(C,v)=>(k(),_("div",null,[Ie(m("input",{id:v+x+b(o),value:v,type:"radio","onUpdate:modelValue":S=>e.block.settings[x]=S,onChange:h,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,Jhe),[[zs,e.block.settings[x]]]),m("label",{for:v+x+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300",innerHTML:C},null,8,Yhe)]))),256))])):L("",!0),w.type==="taxonomy"||w.type==="post_object"||w.type==="relationship"?(k(),_("div",Xhe,[e.configStore?(k(),_("button",{key:0,onClick:C=>e.configStore.setValues(e.block,e.blockIndex,x,[],"","posts",e.layout,!0),type:"button",class:"fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},[w.type==="taxonomy"?(k(),_("svg",Qhe,npe)):(k(),_("svg",rpe,spe)),m("span",{innerHTML:w.label},null,8,ipe)],8,Zhe)):L("",!0)])):L("",!0)])):L("",!0)]))),256)),e.additionalFields&&e.additionalFields.length>0?(k(!0),_(ce,{key:0},Oe(e.additionalFields,w=>(k(),_("div",null,[typeof w=="string"&&typeof b(r).config[e.layout][w]=="object"?(k(),_("div",ape,[b(r).config[e.layout][w].type==="select"?(k(),_("div",lpe,[m("label",{for:w+b(o),class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:b(r).config[e.layout][w].label},null,8,cpe),Ie(m("select",{id:w+b(o),"onUpdate:modelValue":x=>e.block[w]=x,onChange:h,class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},[b(r).config[e.layout][w].allow_null===1?(k(),_("option",dpe,"- Select -")):L("",!0),(k(!0),_(ce,null,Oe(b
105(r).config[e.layout][w].choices,(x,C)=>(k(),_("option",{value:C,innerHTML:x},null,8,fpe))),256))],40,upe),[[co,e.block[w]]])])):L("",!0),b(r).config[e.layout][w].type==="true_false"?(k(),_("div",hpe,[m("input",{id:w+b(o),onChange:x=>i(x,w,!0),checked:e.block[w]===!0,type:"checkbox",value:!0,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,ppe),m("label",{for:w+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300",innerHTML:b(r).config[e.layout][w].label},null,8,mpe)])):L("",!0),b(r).config[e.layout][w].type==="checkbox"?(k(),_("div",gpe,[m("p",{class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:b(r).config[e.layout][w].label},null,8,ype),(k(!0),_(ce,null,Oe(b(r).config[e.layout][w].choices,(x,C)=>(k(),_("div",null,[Ie(m("input",{id:w+C+b(o),value:C,type:"checkbox","onUpdate:modelValue":v=>e.block[w]=v,onChange:h,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,vpe),[[yl,e.block[w]]]),m("label",{for:w+C+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300",innerHTML:x},null,8,bpe)]))),256))])):L("",!0),b(r).config[e.layout][w].type==="radio"?(k(),_("div",wpe,[m("p",{class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:b(r).config[e.layout][w].label},null,8,kpe),b(r).config[e.layout][w].allow_null===1?(k(),_("div",xpe,[Ie(m("input",{id:"null_"+w+b(o),value:"",type:"radio","onUpdate:modelValue":x=>e.block[w]=x,onChange:h,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,Cpe),[[zs,e.block[w]]]),m("label",{for:"null_"+w+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300"}
105,"- None -",8,_pe)])):L("",!0),(k(!0),_(ce,null,Oe(b(r).config[e.layout][w].choices,(x,C)=>(k(),_("div",null,[Ie(m("input",{id:w+C+b(o),value:C,type:"radio","onUpdate:modelValue":v=>e.block[w]=v,onChange:h,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,Spe),[[zs,e.block[w]]]),m("label",{for:w+C+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300",innerHTML:x},null,8,Mpe)]))),256))])):L("",!0),b(r).config[e.layout][w].type==="taxonomy"||b(r).config[e.layout][w].type==="post_object"||b(r).config[e.layout][w].type==="relationship"?(k(),_("div",Tpe,[e.configStore?(k(),_("button",{key:0,onClick:x=>e.configStore.setValues(e.block,e.blockIndex,w,[],"","posts",e.layout,!1),type:"button",class:"fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},[b(r).config[e.layout][w].type==="taxonomy"?(k(),_("svg",Ape,Npe)):(k(),_("svg",Lpe,$pe)),m("span",{innerHTML:b(r).config[e.layout][w].label},null,8,Dpe)],8,Epe)):L("",!0)])):L("",!0)])):L("",!0)]))),256)):L("",!0)])],2)],2)):L("",!0)}}),Hpe={key:0},Bpe={key:0,class:"fm-flex fm-gap-y-4 fm-gap-2 fm-flex-wrap fm-p-6 fm-bg-white fm-border fm-border-gray-200 fm-rounded-lg fm-shadow dark:fm-bg-gray-800 dark:fm-border-gray-700 fm-relative"},Fpe=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1),jpe=[Fpe],zpe={key:0},Vpe=["for","innerHTML"],Upe=["onUpdate:modelValue","type","id","placeholder"],qpe={key:1,class:"fm-flex fm-items-center"},Wpe=["id","onChange","checked"],Kpe=["for"],Gpe={key:1},Jpe=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),TS=Ne({__name:"FmLink",props:{block:{type:Object,required:!0},field:{type:Object,required:!0},label:{type:String,required:!0},fieldName:{type:String,required:!0},required:{type:Boolean,required:!0,default:!1},repeaterIndex:{type:Number,required:!1,default:0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t,n=Math.random().toString(36).substring(7);let r=or({title:"",url:"",target:""});const o=(a,l)=>{a&&a.target&&a.target&&a.target instanceof HTMLInputElement&&(console.log(a.target.checked),a.target.checked?e.field[l]="_blank":e.field[l]="")},s=()=>{console.log("ADD LINK"),e.block[e.fieldName]=r,r=or({title:"",url:"",target:""})},i=()=>{e.block[e.fieldName]=!1};return(a,l)=>(k(),_("div",null,[e.editMode?(k(),_("div",Hpe,[e.field?(k(),_("div",Bpe,[e.required?L("",!0):(k(),_("svg",{key:0,onClick:i,"aria-label":"Delete block",title:"Delete block",fill:"none",class:"fm-absolute fm-top-2 fm-right-2 fm-w-4 fm-h-4 fm-cursor-pointer",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"}
105,jpe)),(k(!0),_(ce,null,Oe(b(r),(c,u)=>(k(),_("div",{class:H(typeof u=="string"&&u==="target"?"fm-w-full":"fm-w-[calc(50%-0.25rem)]")},[typeof u=="string"&&u==="url"||typeof u=="string"&&u==="title"?(k(),_("div",zpe,[m("label",{for:b(n)+u,class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:u==="url"?"URL":u==="title"?"Title":u},null,8,Vpe),Ie(m("input",{"onUpdate:modelValue":d=>e.field[u]=d,type:u==="url"?"url":"text",id:b(n)+u,class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500",placeholder:u==="url"?"URL":u==="title"?"Title":u,required:""},null,8,Upe),[[ZT,e.field[u]]])])):L("",!0),typeof u=="string"&&u==="target"?(k(),_("div",qpe,[m("input",{id:b(n)+u+t.repeaterIndex,onChange:d=>o(d,u),checked:e.field[u]==="_blank",type:"checkbox",value:"_blank",class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,Wpe),m("label",{for:b(n)+u+t.repeaterIndex,class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300"},"Open in new tab",8,Kpe)])):L("",!0)],2))),256))])):(k(),_("div",Gpe,[m("button",{onClick:s,type:"button",class:"fm-mt-4 fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},[Jpe,m("span",null,"Add "+ve(e.label),1)])]))])):Ot(a.$slots,"default",{key:1})]))}}),Ype={key:0},Xpe=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),Zpe=Ne({__name:"FmRepeater",props:{block:{type:Object,required:!0},fieldName:{type:String,required:!0},label:{type:String,required:!0},layout:{type:String,required:!0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t,n=e.configStore?e.configStore.getConfig:!1,r=()=>{e.block[e.fieldName]||(e.block[e.fieldName]=[]),e.block[e.fieldName].push({});for(const s in n.config[e.layout][e.fieldName].sub_fields)n.config[e.layout][e.fieldName].sub_fields[s].type==="link"?e.block[e.fieldName][e.block[e.fieldName].length-1][s]={title:"Button text",url:"https://example.com",target:""}:n.config[e.layout][e.fieldName].sub_fields[s].choices?e.block[e.fieldName][e.block[e.fieldName].length-1][s]=Object.keys(n.config[e.layout][e.fieldName].sub_fields[s].choices)[0]:e.block[e.fieldName][e.block[e.fieldName].length-1][s]=""};Ye(n,(s,i)=>{console.log("CONFIG CHANGE FROM",i),console.log("CONFIG CHANGE TO",s)});const o=U(()=>{if(n&&n.config&&n.config[e.layout])if(n.config[e.layout][e.fieldName].max){if(!e.block[e.fieldName]||e.block[e.fieldName].length<n.config[e.layout][e.fieldName].max)return!0}else return!0;return!1});return(s,i)=>(k(),_("div",null,[e.editMode?(k(),_("div",Ype,[Ot(s.$slots,"default"),m("button",{onClick:r,type:"button",class:H([o.value?"":"fm-opacity-30 fm-pointer-events-none","fm-mt-4 fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"])},[Xpe,m("span",null,"Add "+ve(e.label),1)],2)])):Ot(s.$slots,"default",{key:1})]))}}),Qpe={key:0},eme=["value","innerHTML"],tme=["value","innerHTML"],ES=Ne({__name:"FmSelect",props:{layout:{type:String,required:!0},block:{type:Object,required:!0},fieldName:{type:String,required:!0},label:{type:String,required:!0},repeaterIndex:{type:Number,required:!1,default:0},parent:{type:String,required:!1},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t,n=U(()=>{const o=e.configStore?e.configStore.getConfig:!1;return o&&o.config&&o.config[e.layout]?e.parent?o.config[e.layout][e.parent].sub_fields[e.fieldName].choices:o.c
105onfig[e.layout][e.fieldName].choices:!1}),r=()=>{document.dispatchEvent(new CustomEvent("flowmate-input-updated",{}))};return(o,s)=>(k(),_("div",null,[e.editMode&&n.value?(k(),_("div",Qpe,[e.parent?Ie((k(),_("select",{key:0,"onUpdate:modelValue":s[0]||(s[0]=i=>e.block[e.parent][e.repeaterIndex][e.fieldName]=i),onChange:r,class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},[(k(!0),_(ce,null,Oe(n.value,(i,a)=>(k(),_("option",{value:a,innerHTML:i},null,8,eme))),256))],544)),[[co,e.block[e.parent][e.repeaterIndex][e.fieldName]]]):Ie((k(),_("select",{key:1,"onUpdate:modelValue":s[1]||(s[1]=i=>e.block[e.fieldName]=i),onChange:r,class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},[(k(!0),_(ce,null,Oe(n.value,(i,a)=>(k(),_("option",{value:a,innerHTML:i},null,8,tme))),256))],544)),[[co,e.block[e.fieldName]]])])):Ot(o.$slots,"default",{key:1})]))}}),nme={key:0},rme=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),ome=Ne({__name:"FmFile",props:{block:{type:Object,required:!0},fieldName:{type:String,required:!0},label:{type:String,required:!1,default:"file"},acceptedMediaTypes:{type:Array,required:!1,default:[]},blockIndex:{type:Number,required:!0,default:0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t;return(n,r)=>e.editMode&&e.configStore?(k(),_("div",nme,[m("button",{onClick:r[0]||(r[0]=o=>e.configStore.setValues(e.block,e.blockIndex,e.fieldName,e.acceptedMediaTypes,"file","media",e.block.acf_fc_layout,!1)),type:"button",class:"fm-mt-4 fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},[rme,m("span",null,"Add "+ve(e.label),1)])])):L("",!0)}}),sme={key:0},ime=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1),ame=[ime],lme=Ne({__name:"FmRemoveRepeaterIndexButton",props:{layout:{type:String,required:!0},block:{type:Object,required:!0},fieldName:{type:String,required:!0},repeaterIndex:{type:Number,required:!0,default:0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t,n=()=>{e.block[e.fieldName].length===1?e.block[e.fieldName]=!1:e.block[e.fieldName].splice(e.repeaterIndex,1)},r=U(()=>{const o=e.configStore?e.configStore.getConfig:!1;if(o&&o.config&&o.config[e.layout])if(o.config[e.layout][e.fieldName].min){if(e.block[e.fieldName].length>o.config[e.layout][e.fieldName].min)return!0}else return!0;return!1});return(o,s)=>e.editMode?(k(),_("div",sme,[(k(),_("svg",{onClick:s[0]||(s[0]=i=>n()),class:H([r.value?"":"fm-opacity-30 fm-pointer-events-none","fm-z-10 fm-absolute fm-top-2 fm-right-2 fm-w-4 fm-h-4 fm-cursor-pointer"]),"aria-label":"Delete block",title:"Delete block",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},ame,2))])):L("",!0)}}),cme={class:"fm-px-4 fm-pt-4 fm-left-64 fm-bg-gray-100 fm-h-full dark:fm-bg-gray-900 dark:fm-border-gray-700"},ume={class:"fm-relative"},dme={key:0,class:"fm-absolute fm-w-full fm-h-full fm-min-h-[80vh] fm-flex fm-items-center fm-justify-center"},fme={key:1,class:"fm-w-full fm-text-sm fm-text-left fm-text-gray-500 dark:fm-text-gray-400"},hme=m("thead",{class:"fm-text-xs fm-text-gray-700 fm-uppercase fm-bg-gray-50 dark:fm-bg-gray-700 dark:fm-text-gray-400"},[m("tr",null,[m("th",{scope:"col",class:"fm-px-6 fm-py-3 fm-w-10"},"Status"),m("th",{scope:"col",class:"fm-px-6 fm-py-3"},"ID"),m("th",{scope:"col",class:"fm-px-6 fm-py-3"},"Title"),m("th",{scope:"col",class:"fm-px-6 fm-py-3"},"Type"),m("th",{scope:"col",class:"fm-px-6 fm-py-3"},"Updated"),m("th",{scope:"col",class:"fm-px-6 fm-py-3"},"Publishing date"),m("th",{scope:"col",class:"fm-px-6 fm-py-3"},"Actions")])],-1),pme={class:"fm-px-6 fm-py-4 fm-capitalize"},mme={key:0,class:"fm-inline-flex fm-items-center fm-bg-green-100 fm-text-green-800 fm-text-xs fm-font-medium fm-px-2.5 fm-py-0.5 fm-rounded-full dark:fm-bg-green-900 dark:fm-text-green-300"},gme=m("span",{class:"fm-w-2 fm-h-2 fm-mr-1 fm-bg-green-500 fm-rounded-full"},null,-1),yme={key:1,class:"fm-inline-flex fm-items-center fm-bg-gray-100 fm-text-gray-800 fm-text-xs fm-font-medium fm-px-2.5 fm-py-0.5 fm-rounded-full dark:fm-bg-gray-900 dark:fm-text-gray-300"},vme=m("span",{class:"fm-w-2 fm-h-2 fm-mr-1 fm-bg-gray-500 fm-rounded-full"},null,-1),bme={key:2,class:"fm-inline-flex fm-items-center fm-bg-gray-100 fm-text-gray-800 fm-text-xs fm-font-medium fm-px-2.5 fm-py-0.5 fm-rounded-full dark:fm-bg-gray-900 dark:fm-text-gray-300"},wme=m("span",{class:"fm-w-2 fm-h-2 fm-mr-1 fm-bg-gray-500 fm-rounded-full"},null,-1),kme={class:"fm-px-6 fm-py-4"},xme={class:"fm-px-6 fm-py-4"},Cme={class:"fm-px-6 fm-py-4 fm-capitalize"},_me={class:"fm-px-6 fm-py-4"},Sme={class:"fm-px-6 fm-py-4"},Mme={class:"fm-px-6 fm-py-4 fm-flex fm-justify-end fm-gap-2"},Tme={class:"fm-flex fm-gap-4 fm-px-4 fm-py-2 fm-border-t dark:fm-border-gray-600"},Eme={"aria-label":"Page navigation example ",class:"fm-flex-auto"},Ame={key:0,class:"fm-inline-flex fm-items-center fm--space-x-px"},Ome=m("button",{class:"fm-block fm-px-3 fm-py-2 fm-ml-0 fm-leading-tight fm-text-gray-500 fm-bg-white fm-border fm-border-gray-300 fm-rounded-l-lg hover:fm-bg-gray-100 hover:fm-text-gray-700 dark:fm-bg-gray-800 dark:fm-border-gray-700 dark:fm-text-gray-400 dark:hover:fm-bg-gray-700 dark:hover:fm-text-white"},[m("span",{class:"fm-sr-only"},"Previous"),m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1),Ime=[Ome],Nme=["onClick"],Lme=m("button",{class:"fm-block fm-px-3 fm-py-2 fm-leading-tight fm-text-gray-500 fm-bg-white fm-border fm-border-gray-300 fm-rounded-r-lg hover:fm-bg-gray-100 hover:fm-text-gray-700 dark:fm-bg-gray-800 dark:fm-border-gray-700 dark:fm-text-gray-400 dark:hover:fm-bg-gray-700 dark:hover:fm-text-white"},[m("span",{class:"fm-sr-only"},"Next"),m("svg",{"aria-hidden":"true",class:"fm-w-5 fm-h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"})])],-1),Rme=[Lme],$me=Ne({__name:"FlowmateContentManager",setup(t){const e=pe(!1),{content:n,totalPages:r,currentPage:o}=Lk(),{goTo:s}=_r(),i=async c=>{s("#/content/"+c+"/view")},a=async c=>{s("#/design/"+c)},l=async c=>{console.log("SET CURRENT PAGE",c),s("#/content?page="+c)};return(c,u)=>(k(),_("div",cme,[m("div",ume,[e.value?(k(),_("div",dme,[Z(Gg)])):L("",!0),e.value?L("",!0):(k(),_("table",fme,[hme,m("tbody",null,[b(n)?(k(!0),_(ce,{key:0},Oe(b(n),(d,f)=>
105(k(),_("tr",{key:"content-"+f,class:"fm-bg-white fm-border-b dark:fm-bg-gray-800 dark:fm-border-gray-700"},[m("td",pme,[d.post_status=="publish"?(k(),_("span",mme,[gme,Le(" "+ve(d.post_status),1)])):d.post_status=="draft"?(k(),_("span",yme,[vme,Le(" "+ve(d.post_status),1)])):(k(),_("span",bme,[wme,Le(" "+ve(d.post_status),1)]))]),m("td",kme,ve(d.ID),1),m("td",xme,ve(d.post_title),1),m("td",Cme,ve(d.post_type),1),m("td",_me,ve(d.post_modified),1),m("td",Sme,ve(d.post_date),1),m("td",Mme,[b(He)("content.read").isEnabled()?(k(),xe(jd,{key:0,onClick:nt(h=>i(d.ID),["stop"]),icon:"eye",size:"md",type:"primary",description:"View the content"},null,8,["onClick"])):L("",!0),b(He)("design.read").isEnabled()?(k(),xe(jd,{key:1,onClick:nt(h=>a(d.ID),["stop"]),icon:"paint-brush",size:"md",type:"primary",description:"Design the content"},null,8,["onClick"])):L("",!0)])]))),128)):L("",!0)])])),m("div",Tme,[m("nav",Eme,[b(r)>1?(k(),_("ul",Ame,[m("li",{class:H(["fm-duration-200",b(o)>1?"":"fm-disabled fm-opacity-30 fm-pointer-events-none"]),onClick:u[0]||(u[0]=nt(d=>l(b(o)-1),["stop"]))}
105,Ime,2),(k(!0),_(ce,null,Oe(b(r),d=>(k(),_("li",{key:"page-"+d,onClick:nt(f=>l(d),["stop"]),class:H(d==b(o)?"fm-pointer-events-none":"")},[m("button",{class:H(["fm-relative fm-px-3 fm-py-2 fm-leading-tight fm-border fm-duration-200",d==b(o)?"fm-z-10 fm-text-blue-600 fm-border-blue-300 fm-bg-blue-50 hover:fm-bg-blue-100 hover:fm-text-blue-700 dark:fm-border-gray-700 dark:fm-bg-gray-700 dark:fm-text-white":"fm-text-gray-500 fm-bg-white hover:fm-bg-gray-100 hover:fm-text-gray-700 dark:fm-bg-gray-800 dark:fm-border-gray-700 dark:fm-text-gray-400 dark:hover:fm-bg-gray-700 dark:hover:fm-text-white"])},ve(d),3)],10,Nme))),128)),m("li",{class:H(["fm-duration-200",b(o)<b(r)?"":"fm-disabled fm-opacity-30 fm-pointer-events-none"]),onClick:u[1]||(u[1]=nt(d=>l(b(o)+1),["stop"]))},Rme,2)])):L("",!0)])])])]))}}),Dme={class:"fm-text-lg fm-font-medium dark:fm-text-white"},Pme=["onClick"],Hme={class:"fm-text-lg fm-font-medium dark:fm-text-white"},Bme=m("svg",{"data-accordion-icon":"",class:"fm-w-3 fm-h-3 fm-rotate-180 fm-shrink-0","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 10 6"},[m("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5 5 1 1 5"})],-1),Fme={class:"fm-mb-2 fm-text-gray-500 dark:fm-text-gray-400"},jme={__name:"FlowmateAccordion",props:{items:{type:Array,required:!0}},setup(t){const e=pe(null);function n(r){e.value=e.value===r?null:r}return(r,o)=>(k(!0),_(ce,null,Oe(t.items,(s,i)=>(k(),_("div",{id:"accordion-collapse","data-accordion":"collapse",key:i},[m("h6",Dme,[m("button",{type:"button",class:H(["fm-flex fm-items-center fm-justify-between fm-w-full fm-p-5 fm-font-medium fm-text-left fm-text-gray-500 fm-border fm-border-b-0 fm-border-gray-200 focus:fm-ring-4 focus:fm-ring-gray-200 dark:focus:fm-ring-gray-800 dark:fm-border-gray-700 dark:fm-text-gray-400 hover:fm-bg-gray-100 dark:hover:fm-bg-gray-800",{"fm-rounded-t-xl":i===0,"!fm-border-b":i===t.items.length-1,"fm-bg-gray-100":e.value===i}]),onClick:a=>n(i)},[m("span",Hme,ve(s.title),1),Bme],10,Pme)]),Ie(m("div",null,[m("div",{class:H(["fm-p-5 fm-border fm-border-b-0 fm-border-gray-200 dark:fm-border-gray-700 dark:fm-bg-gray-900",{"!fm-border-b":i===t.items.length-1}])},[m("p",Fme,ve(s.content),1)],2)],512),[[Pn,e.value===i]])]))),128))}},zme=[{title:"What is Flowmate?",content:"Flowmate is a practical content management tool that allows you to edit and update your website content directly on the live site, without requiring backend access. Its user-friendly interface and real-time editing capabilities make it easy to maintain and refresh your content, even without technical expertise. Flowmate seamlessly integrates with existing websites and offers collaborative editing features, simplifying content management for all users."},{title:"How can I edit content?",content:"Access your content by clicking on 'Content' in the left sidebar. Here, you'll find an overview of all your website's pages. Simply select the page you want, and click on the pen icon to edit or add new content."},{title:"Can I add images and videos to my content?",content:"Access your media library by clicking on 'Media Library' in the left sidebar. Upload your files here to conveniently access them when editing your content."},{title:"Can I modify the settings for my block?",content:"Yes, you can adjust the settings of your block by accessing the three dots icon located in the top-right corner. From there, you can select your desired option from the preset choices available."},{title:"How do I add more blocks onto my page?",content:"To add more blocks, simply navigate to the desired page and click on the 'Design' button located in the left navigation. From there, you can select your preferred block from the variety of preset choices available."},{title:"What happens if I make a mistake while editing?",content:"Revision shows your history edits of your page. You can access it by going on your selected page then click the 'Revision' button located in the left navigation. From there, you can see an overview of what changes have been made. You can either delete or view your change from there."},{title:"Can I schedule content updates to be published at a specific time?",content:"Yes, Flowmate provides a scheduling feature, allowing you to set specific dates and times for content updates to be automatically published on your website."},{title:"Can I preview how my edited content will appear on the live site?",content:"Certainly! Flowmate provides a real-time preview option, allowing you to see exactly how your content will look on the live site before publishing it. Simply click the eye icon on the right side of each content block to preview it."},{title:"Is there an autosave feature in the content editor?",content:"Yes, Flowmate has an autosave feature that automatically saves your changes at regular intervals."},{title:"Can I revert back to previous versions of my content?",content:"Revision shows your history edits of your page. You can access it by going on your selected page then click the 'Revision' button located in the left navigation. From there, you can see an overview of what changes have been made. You can either delete or view your change from there."},{title:"Can multiple team members collaborate on the same content simultaneously?",content:"Yes, Flowmate offers collaborative editing, allowing multiple users to work on the same content simultaneously."},{title:"How do I invite people for collaboration?",content:"Simply click on 'Collaboration Mode' then 'Start Collaboration Mode' and send the link to your collaborators. Once they click on the link, they will be able to edit the content."},{title:"Can I share my page with others for preview?",content:"Yes, you have the option to share your page with others for preview. To do so, simply click on the 'Share' icon and follow the provided instructions on how to share your page effectively."},{title:"Does Flowmate support multi-language content?",content:"No, unfortunately Flowmate does not support this feature at the moment."}],Vme=m("h3",{class:"fm-text-3xl fm-font-bold dark:fm-text-white fm-pt-8 fm-pb-4"},"FAQs",-1),Ume=Ne({__name:"FlowmateHelp",setup(t){return(e,n)=>(k(),_(ce,null,[Vme,Z(jme,{items:b(zme)},null,8,["items"])],64))}}),qme={class:"fm-px-4 fm-pt-4 fm-left-64 fm-bg-white fm-h-full dark:fm-bg-gray-900 dark:fm-border-gray-700"},Wme=m("h1",{class:"fm-text-5xl fm-font-extrabold dark:fm-text-white"},"Dashboard",-1),Kme=Ne({__name:"FlowmateDashboardManager",setup(t){return(e,n)=>(k(),_("div",qme,[Wme,Z(Ume)]))}}),Gme={key:0},Jme=["data-index"],Yme={class:"fm-absolute fm-top-0 fm-left-0 fm-justify-end fm-w-full fm-h-full fm-flex fm-gap-x-4"},Xme={class:"fm-w-full"},Zme={key:0,class:"fm-flex fm-justify-between fm-gap-4 fm-items-center fm-mb-2"},Qme={class:"fm-w-[20%]"},ege={class:"fm-text-lg"},tge=["innerHTML"],nge=["innerHTML"],rge={class:"fm-w-[78%]"},oge={key:0},sge={key:1},ige={class:"fm-mb-3 fm-p-4 fm-bg-white fm-rounded-xl fm-relative"},age={key:3,class:"fm-mt-96"},lge=Ne({__name:"FlowmateEditor",setup(t){const e=zr(),{initFlowmate:n}=Tre(),{setStatesFromLocalStorage:r}=ste(),o=U(()=>e.getMediaUpdatedAt),s=U(()=>e.getPostsUpdatedAt),{initMediaLibrary:i}=ih(),{initPostLibrary:a}=Mre();Ye(o,()=>{i(e.getBlockContext,e.getBlockIndex,e.getFieldName,e.getActiveMediaTypes,e.getActiveFieldType)}),Ye(s,()=>{a(e.getBlockIndex,e.getFieldName,e.getLayoutName,e.getIsSetting,e.getActiveParent)});const{setUserIdleStatus:l}=$l(),c=lt(),u=li();Ye(()=>c.getLoading,C=>{C?(document.body.classList.add("fm-overflow-hidden"),document.body.classList.add("fm-pointer-events-none")):(document.body.classList.remove("fm-overflow-hidden"),document.body.classList.remove("fm-pointer-events-none"))});const{contextId:d}=Hr(),{isUserLoggedIn:f}=Qt(),{initRouter:h,currentRoute:p}=_r(),g=vu(),y=(C,v,S)=>{if(v.startsWith("preview_image_")||v.startsWith("file_id_"))return null;const E=e.getConfig;if(E&&E.config&&E.config[C.acf_fc_layout]&&E.config[C.acf_fc_layout][v]&&E.config[C.acf_fc_layout][v][S])return E.config[C.acf_fc_layout][v][S]};Sw(async()=>{Qt().initUser(),await n(),typeof window<"u"&&(h(window.location.hash),r())});const w=C=>{if(C.acf_fc_layout==="block_selected_posts")return["custom_select","selected_posts","categories"];
105if(C.acf_fc_layout==="block_relationship")return["relationship_field"]};Zt(()=>{He("collaborate").isEnabled()&&document.addEventListener("visibilitychange",x)}),Fo(()=>{He("collaborate").isEnabled()&&document.removeEventListener("visibilitychange",x)});const x=async()=>{document.hidden?await l(!0):await l(!1)};return(C,v)=>{var S,E;return k(),_(ce,null,[b(f)?b(c).isErrorPage?L("",!0):(k(),_("div",{key:1,id:"flowmate-wrap",class:H({"fm-dark":b(e).getDarkMode})},[b(He)("ui.navbar").isEnabled()?(k(),xe(UG,{key:0})):L("",!0),b(He)("ui.navigationLeft").isEnabled()?(k(),xe(wee,{key:1})):L("",!0),Z(XY),Z(CZ),m("div",{class:H(["editor fm-w-screen fm-bg-transparent fm-pr-[320px]",[b(u).getLeftOpenStatus?"fm-pl-[272px]":"fm-pl-[80px]",b(e).getEditMode?"":"!fm-pr-0",b(He)("ui.navbar").isEnabled()?"fm-mt-[5rem]":"",b(He)("ui.navigationLeft").isDisabled()?"!fm-pl-0":""]])},[((S=b(p))==null?void 0:S.path)=="#/dashboard"?(k(),xe(Kme,{key:0})):L("",!0),((E=b(p))==null?void 0:E.path)=="#/content"?(k(),xe($me,{key:1})):L("",!0),b(He)("ui.editor").isEnabled()?Ot(C.$slots,"default",{key:2},()=>[b(d)&&b(e).getConfig&&b(He)("design").isEnabled()?(k(),_("div",Gme,[(k(!0),_(ce,null,Oe(b
105(c).pageContext.acf.content,(M,T)=>(k(),_("div",{class:H(["flex-section fm-mx-auto fm-py-12 fm-px-8 fm-relative fm-duration-300",[T%2?"fm-bg-blue-50":"fm-bg-blue-100"]]),"data-index":T},[m("div",Yme,[M.settings&&b(e).getConfig&&b(e).getConfig.config?(k(),xe(b(Ppe),{key:0,"additional-fields":w(M),layout:M.acf_fc_layout,block:M,blockIndex:T,"edit-mode":b(e).getEditMode,"config-store":b(e),"collaborations-store":b(g)},null,8,["additional-fields","layout","block","blockIndex","edit-mode","config-store","collaborations-store"])):L("",!0)]),m("div",Xme,[(k(!0),_(ce,null,Oe(M,(A,N)=>(k(),_(ce,null,[typeof N=="string"&&N!=="acf_fc_layout"&&N!=="acf_fc_label"&&y(M,N,"label")?(k(),_("div",Zme,[m("div",Qme,[m("h3",ege,[m("strong",{innerHTML:y(M,N,"label")+":"},null,8,tge)]),m("p",{class:"fm-text-xs fm-text-gray-500 fm-mt-1",innerHTML:y(M,N,"instructions")},null,8,nge)]),m("div",rge,[y(M,N,"type")==="image"?(k(),_("div",oge,[Z(b(hhe),{block:M,"block-index":T,"field-name":N,"edit-mode":b(e).getEditMode,"config-store":b(e)},null,8,["block","block-index","field-name","edit-mode","config-store"])])):L("",!0),y(M,N,"type")==="gallery"?(k(),_("div",sge,[Z(b(xhe),{block:M,"block-index":T,"field-name":N,"edit-mode":b(e).getEditMode,"config-store":b(e)},null,8,["block","block-index","field-name","edit-mode","config-store"])])):L("",!0),y(M,N,"type")==="file"?(k(),xe(b(ome),{key:2,"accepted-media-types":y(M,N,"label").toLowerCase().includes("video")?["mp4","mov"]:["pdf","zip"],block:M,"block-index":T,label:y(M,N,"label"),"field-name":N,"edit-mode":b(e).getEditMode,"config-store":b(e)},null,8,["accepted-media-types","block","block-index","label","field-name","edit-mode","config-store"])):L("",!0),y(M,N,"type")==="text"||y(M,N,"type")==="oembed"?(k(),xe(b(Nre),{key:3,block:M,"field-name":N,label:y(M,N,"label"),"edit-mode":b(e).getEditMode,"config-store":b(e)},null,8,["block","field-name","label","edit-mode","config-store"])):L("",!0),y(M,N,"type")==="select"?(k(),xe(b(ES),{key:4,"block-index":T,block:M,layout:M.acf_fc_layout,"field-name":N,label:y(M,N,"label"),"edit-mode":b(e).getEditMode,"config-store":b(e)},null,8,["block-index","block","layout","field-name","label","edit-mode","config-store"])):L("",!0),y(M,N,"type")==="wysiwyg"?(k(),xe(b(she),{key:5,block:M,"block-index":T,"field-name":N,label:y(M,N,"label"),"edit-mode":b(e).getEditMode,"config-store":b(e)},null,8,["block","block-index","field-name","label","edit-mode","config-store"])):L("",!0),y(M,N,"type")==="link"?(k(),xe(b(TS),{key:6,block:M,"block-index":T,field:M[N],"field-name":N,required:!1,label:y(M,N,"label"),"edit-mode":b(e).getEditMode,"config-store":b(e)},null,8,["block","block-index","field","field-name","label","edit-mode","config-store"])):L("",!0),N==="buttons"?(k(),xe(b(Zpe),{key:7,layout:M.acf_fc_layout,block:M,"block-index":T,"field-name":N,label:"button","edit-mode":b(e).getEditMode,"config-store":b(e)},{editable:qe(()=>[(k(!0),_(ce,null,Oe(M[N],(D,$)=>(k(),_("div",ige,[Z(b(lme),{block:M,layout:M.acf_fc_layout,"block-index":T,"repeater-index":$,"field-name":N,"edit-mode":b(e).getEditMode,"config-store":b(e)},null,8,["block","layout","block-index","repeater-index","field-name","edit-mode","config-store"]),Z(b(TS),{required:!0,"block-index":T,"repeater-index":$,block:M,field:M[N][$].link,"field-name":N,label:"Link","edit-mode":b(e).getEditMode,"config-store":b(e)},null,8,["block-index","repeater-index","block","field","field-name","edit-mode","config-store"]),Z(b(ES),{"block-index":T,"repeater-index":$,layout:M.acf_fc_layout,block:M,"field-name":"variant",label:"Variant",parent:"buttons","edit-mode":b(e).getEditMode,"config-store":b(e)},null,8,["block-index","repeater-index","layout","block","edit-mode","config-store"])]))),256))]),_:2},1032,["layout","block","block-index","field-name","edit-mode","config-store"])):L("",!0)])])):L("",!0)],64))),256))])],10,Jme))),256))])):L("",!0)]):L("",!0),Ie(Z(Sre,null,null,512),[[Pn,b(c).getBackdrop]])],2),b(He)("ui.navigationRight").isEnabled()?(k(),xe(ere,{key:2})):L("",!0),Z(B_),b(e).getEditMode?(k(),_("div",age,[Z(eQ)])):L("",!0)],2)):(k(),_("div",{key:0,id:"flowmate-wrap",class:H({"fm-dark":b(e).getDarkMode})},[Z(qee),Z(B_)],2)),b(c).isErrorPage?(k(),xe(ote,{key:2})):L("",!0),Z(Gee)],64)}}}),cge={install:(t,e,n)=>{n&&s6().setPluginDefinitions(n),lt().setOptions(e),t.component("flowmate-editor",lge)}},uge={key:0},dge={class:"fm-opacity-50"},fge={key:1},hge=["placeholder"],pge=Ne({__name:"FmText",props:{block:{type:Object,required:!0},field:{type:String,required:!1,default:"default"},fieldName:{type:String,required:!0},label:{type:String,required:!0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t;let n=pe(!1);const r=pe(e.block[e.fieldName]),o=i=>{console.log("KEYUP"),(i.key==="Escape"||i.key==="Enter")&&r.value.blur()},s=()=>
105{console.log("TOGGLE EDIT"),n.value=!n.value,n.value?mn(()=>{r.value.focus()}):document.dispatchEvent(new CustomEvent("flowmate-input-updated",{}))};return(i,a)=>(k(),_("div",null,[e.editMode?(k(),_("div",uge,[b(n)?(k(),_("span",fge,[Ie(m("input",{onKeyup:o,onFocusout:s,ref_key:"input",ref:r,"onUpdate:modelValue":a[0]||(a[0]=l=>e.block[e.fieldName]=l),type:"text",class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500",placeholder:e.label},null,40,hge),[[cn,e.block[e.fieldName]]])])):(k(),_("span",{key:0,onClick:s,class:"fm-cursor-pointer"},[Ot(i.$slots,"default",{},()=>[m("span",dge,ve(e.label)+": Click to add ",1)])]))])):Ot(i.$slots,"default",{key:1})]))}});function _n(t){this.content=t}_n.prototype={constructor:_n,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),s=r.content.slice();return o==-1?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new _n(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new _n(n)},addToStart:function(t,e){return new _n([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new _n(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),s=r.find(t);return o.splice(s==-1?o.length:s,0,e,n),new _n(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=_n.from(t),t.size?new _n(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=_n.from(t),t.size?new _n(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=_n.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};_n.from=function(t){if(t instanceof _n)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new _n(e)};function m9(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),s=e.child(r);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(let i=0;o.text[i]==s.text[i];i++)n++;return n}if(o.content.size||s.content.size){let i=m9(o.content,s.content,n+1);if(i!=null)return i}n+=o.nodeSize}}function g9(t,e,n,r){for(let o=t.childCount,s=e.childCount;;){if(o==0||s==0)return o==s?null:{a:n,b:r};let i=t.child(--o),a=e.child(--s),l=i.nodeSize;if(i==a){n-=l,r-=l;continue}if(!i.sameMarkup(a))return{a:n,b:r};if(i.isText&&i.text!=a.text){let c=0,u=Math.min(i.text.length,a.text.length);for(;c<u&&i.text[i.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(i.content.size||a.content.size){let c=g9(i.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class ie{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,s){for(let i=0,a=0;a<n;i++){let l=this.content[i],c=a+l.nodeSize;if(c>e&&r(l,o+a,s||null,i)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let s="",i=!0;return this.nodesBetween(e,n,(a,l)=>{a.isText?(s+=a.text.slice(Math.max(e,l)-l,n-l),i=!r):a.isLeaf?(o?s+=typeof o=="function"?o(a):o:a.type.spec.leafText&&(s+=a.type.spec.leafText(a)),i=!r):!i&&a.isBlock&&(s+=r,i=!0)},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)o.push(e.content[s]);return new ie(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let s=0,i=0;i<n;s++){let a=this.content[s],l=i+a.nodeSize;l>e&&((i<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-i),Math.min(a.text.length,n-i)):a=a.cut(Math.max(0,e-i-1),Math.min(a.content.size,n-i-1))),r.push(a),o+=a.nodeSize),i=l}return new ie(r,o)}cutByIndex(e,n){return e==n?ie.empty:e==0&&n==this.content.length?this:new ie(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new ie(o,s)}addToStart(e){return new ie([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ie(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))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 n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return m9(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return g9(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Jh(0,e);if(e==this.size)return Jh(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let s=this.child(r),i=o+s.nodeSize;if(i>=e)return i==e||n>0?Jh(r+1,i):Jh(r,o);o=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return ie.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new ie(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ie.empty;let n,r=0;for(let o=0;o<e.length;o++){let s=e[o];r+=s.nodeSize,o&&s.isText&&e[o-1].sameMarkup(s)?(n||(n=e.slice(0,o)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new ie(n||e,r)}static from(e){if(!e)return ie.empty;if(e instanceof ie)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ie([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ie.empty=new ie([],0);const e1={index:0,offset:0};function Jh(t,e){return e1.index=t,e1.offset=e,e1}function Km(t,e){if(t===e)return!0;
vendor: 4,111 bytes, line 105
105if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Km(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Km(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let St=class $b{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let s=e[o];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,o));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Km(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return $b.none;if(e instanceof $b)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};St.none=[];class Gm extends Error{}class we{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=v9(this.content,e+this.openStart,n);return r&&new we(r,this.openStart,this.openEnd)}removeBetween(e,n){return new we(y9(this.content,e+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(e,n){if(!n)return we.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new we(ie.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new we(e,r,o)}}we.empty=new we(ie.empty,0,0);function y9(t,e,n){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r),{index:i,offset:a}=t.findIndex(n);if(o==e||s.isText){if(a!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(y9(s.content,e-o-1,n-o-1)))}function v9(t,e,n,r){let{index:o,offset:s}=t.findIndex(e),i=t.maybeChild(o);if(s==e||i.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=v9(i.content,e-s-1,n);return a&&t.replaceChild(o,i.copy(a))}function mge(t,e,n){if(n.openStart>t.depth)throw new Gm("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Gm("Inconsistent open depths");return b9(t,e,n,0)}function b9(t,e,n,r){let o=t.index(r),s=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let i=b9(t,e,n,r+1);return s.copy(s.content.replaceChild(o,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let i=t.parent,a=i.content;return ll(i,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:i,end:a}=gge(n,t);return ll(s,k9(t,i,a,e,r))}else return ll(s,Jm(t,e,r))}function w9(t,e){if(!e.type.compatibleContent(t.type))throw new Gm("Cannot join "+e.type.name+" onto "+t.type.name)}function Db(t,e,n){let r=t.node(n);
vendor: 11,965 bytes, lines 105-106
105return w9(r,e.node(n)),r}function al(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Yd(t,e,n,r){let o=(e||t).node(n),s=0,i=e?e.index(n):o.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(al(t.nodeAfter,r),s++));for(let a=s;a<i;a++)al(o.child(a),r);e&&e.depth==n&&e.textOffset&&al(e.nodeBefore,r)}function ll(t,e){return t.type.checkContent(e),t.copy(e)}function k9(t,e,n,r,o){let s=t.depth>o&&Db(t,e,o+1),i=r.depth>o&&Db(n,r,o+1),a=[];return Yd(null,t,o,a),s&&i&&e.index(o)==n.index(o)?(w9(s,i),al(ll(s,k9(t,e,n,r,o+1)),a)):(s&&al(ll(s,Jm(t,e,o+1)),a),Yd(e,n,o,a),i&&al(ll(i,Jm(n,r,o+1)),a)),Yd(r,null,o,a),new ie(a)}function Jm(t,e,n){let r=[];if(Yd(null,t,n,r),t.depth>n){let o=Db(t,e,n+1);al(ll(o,Jm(t,e,n+1)),r)}return Yd(e,null,n,r),new ie(r)}function gge(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)r=e.node(o).copy(ie.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class If{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)o+=r.child(s).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return St.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let s=r.marks;for(var i=0;i<s.length;i++)s[i].type.spec.inclusive===!1&&(!o||!s[i].isInSet(o.marks))&&(s=s[i--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!o||!r[s].isInSet(o.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ym(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,s=n;for(let i=e;;){let{index:a,offset:l}=i.content.findIndex(s),c=s-l;if(r.push(i,a,o+l),!c||(i=i.child(a),i.isText))break;s=c-1,o+=l+1}return new If(n,r,s)}static resolveCached(e,n){for(let o=0;o<t1.length;o++){let s=t1[o];if(s.pos==n&&s.doc==e)return s}let r=t1[n1]=If.resolve(e,n);return n1=(n1+1)%yge,r}}let t1=[],n1=0,yge=12;class Ym{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const vge=Object.create(null);let cl=class Pb{constructor(e,n,r,o=St.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||ie.empty}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,n,r,o=0){this.content.nodesBetween(e,n,r,o,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,n,r,o){return this.content.textBetween(e,n,r,o)}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,n,r){return this.type==e&&Km(this.attrs,n||e.defaultAttrs||vge)&&St.sameSet(this.marks,r||St.none)}copy(e=null){return e==this.content?this:new Pb(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Pb(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return we.empty;let o=this.resolve(e),s=this.resolve(n),i=r?0:o.sharedDepth(n),a=o.start(i),l=o.node(i).content.cut(o.pos-a,s.pos-a);return new we(l,o.depth-i,s.depth-i)}replace(e,n,r){return mge(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return If.resolveCached(this,e)}resolveNoCache(e){return If.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(o=!0),!o)),o}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()+")"),x9(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=ie.empty,o=0,s=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,o,s),a=i&&i.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let s=this.contentMatchAt(e).matchType(r),i=s&&s.matchFragment(this.content,n);return i?i.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);let e=St.none;for(let n=0;n<this.marks.length;n++)e=this.marks[n].addToSet(e);if(!St.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=ie.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,o,r)}};cl.prototype.text=void 0;class Xm extends cl{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):x9(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Xm(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Xm(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function x9(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Tl{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new bge(e,n);if(r.next==null)return Tl.empty;let o=C9(r);r.next&&r.err("Unexpected trailing text");let s=Mge(Sge(o));return Tge(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let s=n;o&&s<r;s++)o=o.matchType(e.child(s).type);return o}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:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function s(i,a){let l=i.matchFragment(e,r);if(l&&(!n||l.validEnd))return ie.from(a.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:u,next:d}=i.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=s(d,a.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),s=o.match;if(s.matchType(e)){let i=[];for(let a=o;a.type;a=a.via)i.push(a.type);return i.reverse()}for(let i=0;i<s.next.length;i++){let{type:a,next:l}=s.next[i];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let s=o+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)s+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return s}).join(`
106`)}}Tl.empty=new Tl(!0);class bge{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?
vendor: 8,611 bytes, line 106
106=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function C9(t){let e=[];do e.push(wge(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function wge(t){let e=[];do e.push(kge(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function kge(t){let e=_ge(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=xge(t,e);else break;return e}function AS(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function xge(t,e){let n=AS(t),r=n;return t.eat(",")&&(t.next!="}"?r=AS(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Cge(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let s in n){let i=n[s];i.groups.indexOf(e)>-1&&o.push(i)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function _ge(t){if(t.eat("(")){let e=C9(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Cge(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Sge(t){let e=[[]];return o(s(t,0),n()),e;function n(){return e.push([])-1}function r(i,a,l){let c={term:l,to:a};return e[i].push(c),c}function o(i,a){i.forEach(l=>l.to=a)}function s(i,a){if(i.type=="choice")return i.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(i.type=="seq")for(let l=0;;l++){let c=s(i.exprs[l],a);if(l==i.exprs.length-1)return c;o(c,a=n())}else if(i.type=="star"){let l=n();return r(a,l),o(s(i.expr,l),l),[r(l)]}else if(i.type=="plus"){let l=n();return o(s(i.expr,a),l),o(s(i.expr,l),l),[r(l)]}else{if(i.type=="opt")return[r(a)].concat(s(i.expr,a));if(i.type=="range"){let l=a;for(let c=0;c<i.min;c++){let u=n();o(s(i.expr,l),u),l=u}if(i.max==-1)o(s(i.expr,l),l);else for(let c=i.min;c<i.max;c++){let u=n();r(l,u),o(s(i.expr,l),u),l=u}return[r(l)]}else{if(i.type=="name")return[r(a,void 0,i.value)];throw new Error("Unknown expr type")}}}}function _9(t,e){return e-t}function OS(t,e){let n=[];return r(e),n.sort(_9);function r(o){let s=t[o];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(o);for(let i=0;i<s.length;i++){let{term:a,to:l}=s[i];!a&&n.indexOf(l)==-1&&r(l)}}}function Mge(t){let e=Object.create(null);return n(OS(t,0));function n(r){let o=[];r.forEach(i=>{t[i].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);OS(t,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new Tl(r.indexOf(t.length-1)>-1);for(let i=0;i<o.length;i++){let a=o[i][1].sort(_9);s.next.push({type:o[i][0],next:e[a.join(",")]||n(a)})}return s}}function Tge(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],s=!o.validEnd,i=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];i.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function S9(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function M9(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let s=t[r];if(s.hasDefault)o=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function T9(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new Ege(t[n]);return e}let IS=class E9{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=T9(r.attrs),this.defaultAttrs=S9(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Tl.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}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:M9(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new cl(this,this.computeAttrs(e),ie.from(n),St.setFrom(r))}createChecked(e=null,n,r){return n=ie.from(n),this.checkContent(n),new cl(this,this.computeAttrs(e),n,St.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=ie.from(n),n.size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(ie.empty,!0);return s?new cl(this,e,n.append(s),St.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:St.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,i)=>r[s]=new E9(s,n,i));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Ege{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class c0{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=T9(o.attrs),this.excluded=null;let s=S9(this.attrs);this.instance=s?new St(this,s):null}create(e=null){return!e&&this.instance?this.instance:new St(this,M9(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((s,i)=>r[s]=new c0(s,o++,n,i)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}excludes(e){return this.excluded.indexOf(e)>-1}}class Age{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=_n.from(e.nodes),n.marks=_n.from(e.marks||{}),this.nodes=IS.compile(this.spec.nodes,this),this.marks=c0.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],i=s.spec.content||"",a=s.spec.marks;s.contentMatch=r[i]||(r[i]=Tl.parse(i,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.markSet=a=="_"?null:a?NS(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],i=s.spec.excludes;s.excluded=i==null?[s]:i==""?[]:NS(this,i.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof IS){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new Xm(r,r.defaultAttrs,e,St.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return cl.fromJSON(this,e)}markFromJSON(e){return St.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function NS(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],s=t.marks[o],i=s;
106if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(i=l)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class nu{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=e.nodes[r.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new RS(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new RS(this,n,!0);return r.addAll(e,n.from,n.to),we.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let s=this.tags[o];if(Nge(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let i=s.getAttrs(e);if(i===!1)continue;s.attrs=i||void 0}return s}}}matchStyle(e,n,r,o){for(let s=o?this.styles.indexOf(o)+1:0;s<this.styles.length;s++){let i=this.styles[s],a=i.style;if(!(a.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||a.length>
106e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(i.getAttrs){let l=i.getAttrs(n);if(l===!1)continue;i.attrs=l||void 0}return i}}}static schemaRules(e){let n=[];function r(o){let s=o.priority==null?50:o.priority,i=0;for(;i<n.length;i++){let a=n[i];if((a.priority==null?50:a.priority)<s)break}n.splice(i,0,o)}for(let o in e.marks){let s=e.marks[o].spec.parseDOM;s&&s.forEach(i=>{r(i=$S(i)),i.mark||i.ignore||i.clearMark||(i.mark=o)})}for(let o in e.nodes){let s=e.nodes[o].spec.parseDOM;s&&s.forEach(i=>{r(i=$S(i)),i.node||i.ignore||i.mark||(i.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new nu(e,nu.schemaRules(e)))}}const A9={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Oge={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},O9={ol:!0,ul:!0},Zm=1,Qm=2,Xd=4;function LS(t,e,n){return e!=null?(e?Zm:0)|(e==="full"?Qm:0):t&&t.whitespace=="pre"?Zm|Qm:n&~Xd}class Yh{constructor(e,n,r,o,s,i,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=s,this.options=a,this.content=[],this.activeMarks=St.none,this.stashMarks=[],this.match=i||(a&Xd?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ie.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Zm)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=ie.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ie.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let o=r[n];(this.type?this.type.allowsMarkType(o.type):Rge(o.type,e))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!A9.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class RS{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,s,i=LS(null,n.preserveWhitespace,0)|(r?Xd:0);o?s=new Yh(o.type,o.attrs,St.none,St.none,!0,n.topMatch||o.type.contentMatch,i):r?s=new Yh(null,null,St.none,St.none,!0,null,i):s=new Yh(e.schema.topNodeType,null,St.none,St.none,!0,null,i),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(e.nodeType==3)this.addTextNode(e);else if(e.nodeType==1){let n=e.getAttribute("style");if(!n)this.addElement(e);else{let r=this.readStyles(Lge(n));if(!r)return;let[o,s]=r,i=this.top;for(let a=0;a<s.length;a++)this.removePendingMark(s[a],i);for(let a=0;a<o.length;a++)this.addPendingMark(o[a]);this.addElement(e);for(let a=0;a<o.length;a++)this.removePendingMark(o[a],i);for(let a=0;a<s.length;a++)this.addPendingMark(s[a])}}}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&Qm||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&Zm)r.options&Qm?n=n.replace(/\r\n?/g,`
107`):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=r.content[r.content.length-1],s=e.previousSibling;(!o||s&&s.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(e)}else this.findInside(e)}addElement(e,n){let r=e.nodeName.toLowerCase(),o;O9.hasOwnProperty(r)&&this.parser.normalizeLists&&Ige(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));if(s?s.ignore:Oge.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let i,a=this.top,l=this.needsBlock;if(A9.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),i=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}this.addAll(e),i&&this.sync(a),this.needsBlock=l}else this.addElementByRule(e,s,s.consuming===!1?o:void 0)}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
108`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=St.none,r=St.none;for(let o=0;o<e.length;o+=2)for(let s=void 0;;){let i=this.parser.matchStyle(e[o],e[o+1],this,s);if(!i)break;if(i.ignore)return null;if(i.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEac
108h(a=>{i.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(n),i.consuming===!1)s=i;else break}return[n,r]}addElementByRule(e,n,r){let o,s,i;n.node?(s=this.parser.schema.nodes[n.node],s.isLeaf?this.insertNode(s.create(n.attrs))||this.leafFallback(e):o=this.enter(s,n.attrs||null,n.preserveWhitespace)):(i=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(i));let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,i&&this.removePendingMark(i,a)}addAll(e,n,r){let o=n||0;for(let s=n?e.childNodes[n]:e.firstChild,i=r==null?null:e.childNodes[r];s!=i;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s);this.findAtPoint(e,o)}findPlace(e){let n,r;for(let o=this.open;o>=0;o--){let s=this.nodes[o],i=s.findWrapping(e);if(i&&(!n||n.length>i.length)&&(n=i,r=s,!i.length)||s.solid)break}if(!n)return!1;this.sync(r);for(let o=0;o<n.length;o++)this.enterInner(n[o],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let o=0;o<e.marks.length;o++)(!n.type||n.type.allowsMarkType(e.marks[o].type))&&(r=e.marks[o].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let o=this.findPlace(e.create(n));return o&&this.enterInner(e,n,!0,r),o}enterInner(e,n=null,r=!1,o){this.closeExtra();let s=this.top;s.applyPending(e),s.match=s.match&&s.match.matchType(e);let i=LS(e,o,s.options);s.options&Xd&&s.content.length==0&&(i|=Xd),this.nodes.push(new Yh(e,n,s.activeMarks,s.pendingMarks,r,null,i)),this.open++}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(o?0:1),i=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(i(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return i(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];
108if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=$ge(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(e)>-1)o.pendingMarks=e.removeFromSet(o.pendingMarks);else{o.activeMarks=e.removeFromSet(o.activeMarks);let s=o.popFromStashMark(e);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==n)break}}}function Ige(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&O9.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Nge(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Lge(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function $S(t){let e={};for(let n in t)e[n]=t[n];return e}function Rge(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let s=[],i=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||s.indexOf(u)<0&&i(u))return!0}};if(i(o.contentMatch))return!0}}function $ge(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}class ns{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=r1(n).createDocumentFragment());let o=r,s=[];return e.forEach(i=>{if(s.length||i.marks.length){let a=0,l=0;for(;a<s.length&&l<i.marks.length;){let c=i.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)o=s.pop()[1];for(;l<i.marks.length;){let c=i.marks[l++],u=this.serializeMark(c,i.isInline,n);u&&(s.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(i,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=ns.renderSpec(r1(n),this.nodes[e.type.name](e));if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let s=this.serializeMark(e.marks[o],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&ns.renderSpec(r1(r),o(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let o=n[0],s=o.indexOf(" ");s>0&&(r=o.slice(0,s),o=o.slice(s+1));let i,a=r?e.createElementNS(r,o):e.createElement(o),l=n[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;u<n.length;u++){let d=n[u];if(d===0){if(u<n.length-1||u>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:h}=ns.renderSpec(e,d,r);if(a.appendChild(f),h){if(i)throw new RangeError("Multiple content holes");i=h}}}return{dom:a,contentDOM:i}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ns(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=DS(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return DS(e.marks)}}function DS(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function r1(t){return t.document||window.document}const I9=65535,N9=Math.pow(2,16);function Dge(t,e){return t+e*N9}function PS(t){return t&I9}function Pge(t){return(t-(t&I9))/N9}const L9=1,R9=2,Rp=4,$9=8;class Hb{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&$9)>0}get deletedBefore(){return(this.delInfo&(L9|Rp))>0}get deletedAfter(){return(this.delInfo&(R9|Rp))>0}get deletedAcross(){return(this.delInfo&Rp)>0}}class Zr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Zr.empty)return Zr.empty}recover(e){let n=0,r=PS(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+Pge(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,s=this.inverted?2:1,i=this.inverted?1:2;
vendor: 95,403 bytes, lines 108-112
108for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>e)break;let c=this.ranges[a+s],u=this.ranges[a+i],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:n:n,h=l+o+(f<0?0:u);if(r)return h;let p=e==(n<0?l:d)?null:Dge(a/3,e-l),g=e==l?R9:e==d?L9:Rp;return(n<0?e!=l:e!=d)&&(g|=$9),new Hb(h,g,p)}o+=u-c}return r?e+o:new Hb(e+o,0,null)}touches(e,n){let r=0,o=PS(n),s=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+s],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+i]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,s=0;o<this.ranges.length;o+=3){let i=this.ranges[o],a=i-(this.inverted?s:0),l=i+(this.inverted?0:s),c=this.ranges[o+n],u=this.ranges[o+r];e(a,a+c,l,l+u),s+=u-c}}invert(){return new Zr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Zr.empty:new Zr(e<0?[0,-e,0]:[0,0,e])}}Zr.empty=new Zr([]);class _c{constructor(e=[],n,r=0,o=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=o}slice(e=0,n=this.maps.length){return new _c(this.maps,this.mirror,e,n)}copy(){return new _c(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let o=e.getMirror(n);this.appendMap(e.maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new _c;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let s=this.from;s<this.to;s++){let i=this.maps[s],a=i.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this.maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new Hb(e,o,null)}}const o1=Object.create(null);class Mr{getMap(){return Zr.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=o1[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in o1)throw new RangeError("Duplicate use of step JSON ID "+e);return o1[e]=n,n.prototype.jsonID=e,n}}class an{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new an(e,null)}static fail(e){return new an(null,e)}static fromReplace(e,n,r,o){try{return an.ok(e.replace(n,r,o))}catch(s){if(s instanceof Gm)return an.fail(s.message);throw s}}}function hx(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let s=t.child(o);s.content.size&&(s=s.copy(hx(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return ie.fromArray(r)}class Ui extends Mr{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),s=new we(hx(n.content,(i,a)=>!i.isAtom||!a.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),o),n.openStart,n.openEnd);return an.fromReplace(e,this.from,this.to,s)}invert(){return new rs(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ui(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ui&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ui(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ui(n.from,n.to,e.markFromJSON(n.mark))}}Mr.jsonID("addMark",Ui);class rs extends Mr{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new we(hx(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return an.fromReplace(e,this.from,this.to,r)}invert(){return new Ui(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new rs(n.pos,r.pos,this.mark)}merge(e){return e instanceof rs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rs(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new rs(n.from,n.to,e.markFromJSON(n.mark))}}Mr.jsonID("removeMark",rs);class qi extends Mr{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return an.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return an.fromReplace(e,this.pos,this.pos+1,new we(ie.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new qi(this.pos,n.marks[o]);return new qi(this.pos,this.mark)}}return new ru(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new qi(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new qi(n.pos,e.markFromJSON(n.mark))}}Mr.jsonID("addNodeMark",qi);class ru extends Mr{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return an.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return an.fromReplace(e,this.pos,this.pos+1,new we(ie.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new qi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ru(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ru(n.pos,e.markFromJSON(n.mark))}}Mr.jsonID("removeNodeMark",ru);class Bn extends Mr{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Bb(e,this.from,this.to)?an.fail("Structure replace would overwrite content"):an.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Zr([this.from,this.to-this.from,this.slice.size])}invert(e){return new Bn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Bn(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Bn)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?we.empty:new we(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Bn(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?we.empty:new we(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Bn(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Bn(n.from,n.to,we.fromJSON(e,n.slice),!!n.structure)}}Mr.jsonID("replace",Bn);class hn extends Mr{constructor(e,n,r,o,s,i,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=s,this.insert=i,this.structure=a}apply(e){if(this.structure&&(Bb(e,this.from,this.gapFrom)||Bb(e,this.gapTo,this.to)))return an.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return an.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?an.fromReplace(e,this.from,this.to,r):an.fail("Content does not fit in gap")}getMap(){return new Zr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new hn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),s=e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||s>r.pos?null:new hn(n.pos,r.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new hn(n.from,n.to,n.gapFrom,n.gapTo,we.fromJSON(e,n.slice),n.insert,!!n.structure)}}Mr.jsonID("replaceAround",hn);function Bb(t,e,n){let r=t.resolve(e),o=n-e,s=r.depth;for(;o>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,o--;if(o>0){let i=r.node(s).maybeChild(r.indexAfter(s));for(;o>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,o--}}return!1}function Hge(t,e,n,r){let o=[],s=[],i,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+l.nodeSize,n),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(i&&i.to==f&&i.mark.eq(d[g])?i.to=h:o.push(i=new rs(f,h,d[g])));a&&a.to==f?a.to=h:s.push(a=new Ui(f,h,r))}}),o.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function Bge(t,e,n,r){let o=[],s=0;t.doc.nodesBetween(e,n,(i,a)=>{if(!i.isInline)return;s++;let l=null;if(r instanceof c0){let c=i.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(i.marks)&&(l=[r]):l=i.marks;if(l&&l.length){let c=Math.min(a+i.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],f;for(let h=0;h<o.length;h++){let p=o[h];p.step==s-1&&d.eq(o[h].style)&&(f=p)}f?(f.to=c,f.step=s):o.push({style:d,from:Math.max(a,e),to:c,step:s})}}}),o.forEach(i=>t.step(new rs(i.from,i.to,i.style)))}function Fge(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),s=[],i=e+1;for(let a=0;a<o.childCount;a++){let l=o.child(a),c=i+l.nodeSize,u=r.matchType(l.type);if(!u)s.push(new Bn(i,c,we.empty));else{r=u;for(let d=0;d<l.marks.length;d++)n.allowsMarkType(l.marks[d].type)||t.step(new rs(i,c,l.marks[d]))}i=c}if(!r.validEnd){let a=r.fillBefore(ie.empty,!0);t.replace(i,i,new we(a,0,0))}for(let a=s.length-1;a>=0;a--)t.step(s[a])}function jge(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ou(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),s=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,s,e))return n;if(n==0||r.type.spec.isolating||!jge(r,o,s))break}return null}function zge(t,e,n){let{$from:r,$to:o,depth:s}=e,i=r.before(s+1),a=o.after(s+1),l=i,c=a,u=ie.empty,d=0;for(let p=s,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,u=ie.from(r.node(p).copy(u)),d++):l--;let f=ie.empty,h=0;for(let p=s,g=!1;p>n;p--)g||o.after(p+1)<o.end(p)?(g=!0,f=ie.from(o.node(p).copy(f)),h++):c++;t.step(new hn(l,c,i,a,new we(u.append(f),d,h),u.size-d,!0))}function px(t,e,n=null,r=t){let o=Vge(t,e),s=o&&Uge(r,e);return s?o.map(HS).concat({type:e,attrs:n}).concat(s.map(HS)):null}function HS(t){return{type:t,attrs:null}}function Vge(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let i=s.length?s[0]:e;return n.canReplaceWith(r,o,i)?s:null}function Uge(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.child(r),i=e.contentMatch.findWrapping(s.type);if(!i)return null;let a=(i.length?i[i.length-1]:e).contentMatch;for(let l=r;a&&l<o;l++)a=a.matchType(n.child(l).type);return!a||!a.validEnd?null:i}function qge(t,e,n){let r=ie.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let a=n[i].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ie.from(n[i].type.create(n[i].attrs,r))}let o=e.start,s=e.end;t.step(new hn(o,s,o,s,new we(r,0,0),n.length,!0))}function Wge(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(i,a)=>{if(i.isTextblock&&!i.hasMarkup(r,o)&&Kge(t.doc,t.mapping.slice(s).map(a),r)){t.clearIncompatible(t.mapping.slice(s).map(a,1),r);let l=t.mapping.slice(s),c=l.map(a,1),u=l.map(a+i.nodeSize,1);return t.step(new hn(c,u,c+1,u-1,new we(ie.from(r.create(o,null,i.marks)),0,0),1,!0)),!1}})}function Kge(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function Gge(t,e,n,r,o){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let i=n.create(r,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,i);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new hn(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new we(ie.from(i),0,0),1,!0))}function Sc(t,e,n=1,r){let o=t.resolve(e),s=o.depth-n,i=r&&r[r.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!i.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>s;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let a=o.indexAfter(s),l=r&&r[0];return o.node(s).canReplaceWith(a,a,l?l.type:o.node(s+1).type)}function Jge(t,e,n=1,r){let o=t.doc.resolve(e),s=ie.empty,i=ie.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){s=ie.from(o.node(a).copy(s));let u=r&&r[c];i=ie.from(u?u.type.create(u.attrs,i):o.node(a).copy(i))}t.step(new Bn(e,e,new we(s.append(i),n,n),!0))}function ba(t,e){let n=t.resolve(e),r=n.index();return D9(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function D9(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function P9(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let s,i,a=r.index(o);if(o==r.depth?(s=r.nodeBefore,i=r.nodeAfter):n>0?(s=r.node(o+1),a++,i=r.node(o).maybeChild(a)):(s=r.node(o).maybeChild(a-1),i=r.node(o+1)),s&&!s.isTextblock&&D9(s,i)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function Yge(t,e,n){let r=new Bn(e-n,e+n,we.empty,!0);t.step(r)}function Xge(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let s=r.index(o);if(r.node(o).canReplaceWith(s,s,n))return r.before(o+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let s=r.indexAfter(o);if(r.node(o).canReplaceWith(s,s,n))return r.after(o+1);if(s<r.node(o).childCount)return null}return null}function H9(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let s=0;s<n.openStart;s++)o=o.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let i=r.depth;i>=0;i--){let a=i==r.depth?0:r.pos<=(r.start(i+1)+r.end(i+1))/2?-1:1,l=r.index(i)+(a>0?1:0),c=r.node(i),u=!1;if(s==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(i+1):r.after(i+1)}return null}function mx(t,e,n=e,r=we.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),s=t.resolve(n);return B9(o,s,r)?new Bn(e,n,r):new Zge(o,s,r).fit()}function B9(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Zge{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ie.empty;for(let o=0;o<=e.depth;o++){let s=e.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=ie.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let s=this.placed,i=r.depth,a=o.depth;for(;i&&a&&s.childCount==1;)s=s.firstChild.content,i--,a--;let l=new we(s,i,a);return e>-1?new hn(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Bn(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(o=0),s.type.spec.isolating&&o<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,s=null;r?(s=s1(this.unplaced.content,r-1).firstChild,o=s.content):o=this.unplaced.content;let i=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(i?c.matchType(i.type)||(d=c.fillBefore(ie.from(i),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:d};if(n==2&&i&&(u=c.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=s1(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new we(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=s1(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new we(yd(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new we(yd(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g<s.length;g++)this.openFrontierNode(s[g]);let i=this.unplaced,a=r?r.content:i.content,l=i.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));d=d.matchFragment(o)}let h=a.size+e-(i.content.size-i.openEnd);for(;c<a.childCount;){let g=a.child(c),y=d.matchType(g.type);if(!y)break;c++,(c>1||l==0||g.content.size)&&(d=y,u.push(F9(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?h:-1)))}let p=c==a.childCount;p||(h=-1),this.placed=vd(this.placed,n,ie.from(u)),this.frontier[n].match=d,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<h;g++){let w=y.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),y=w.content}this.unplaced=p?e==0?we.empty:new we(yd(i.content,e-1,1),e-1,h<0?i.openEnd:e-1):new we(yd(i.content,e,c),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!i1(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),i=i1(e,n,o,r,s);if(i){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=i1(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:i,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=vd(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),s=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,s)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=vd(this.placed,this.depth,ie.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(ie.empty,!0);e.childCount&&(this.placed=vd(this.placed,this.frontier.length,e))}}function yd(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(yd(t.firstChild.content,e-1,n)))}function vd(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(vd(t.lastChild.content,e-1,n)))}function s1(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function F9(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,F9(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ie.empty,!0)))),t.copy(r)}function i1(t,e,n,r,o){let s=t.node(e),i=o?t.indexAfter(e):t.index(e);if(i==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,i);return a&&!Qge(n,s.content,i)?a:null}function Qge(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function e0e(t){return t.spec.defining||t.spec.definingForContent}function t0e(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(B9(o,s,r))return t.step(new Bn(e,n,r));let i=z9(o,t.doc.resolve(n));i[i.length-1]==0&&i.pop();let a=-(o.depth+1);i.unshift(a);for(let f=o.depth,h=o.pos-1;f>0;f--,h--){let p=o.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;i.indexOf(f)>-1?a=f:o.before(f)==h&&i.splice(1,0,-f)}let l=i.indexOf(a),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==r.openStart)break;f=p.content}for(let f=u-1;f>=0;f--){let h=c[f].type,p=e0e(h);if(p&&o.node(l).type!=h)u=f;else if(p||!h.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),p=c[h];if(p)for(let g=0;g<i.length;g++){let y=i[(g+l)%i.length],w=!0;y<0&&(w=!1,y=-y);let x=o.node(y-1),C=o.index(y-1);if(x.canReplaceWith(C,C,p.type,p.marks))return t.replace(o.before(y),w?s.after(y):n,new we(j9(r.content,0,r.openStart,h),h,r.openEnd))}}let d=t.steps.length;for(let f=i.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let h=i[f];h<0||(e=o.before(h),n=s.after(h))}}function j9(t,e,n,r,o){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(j9(s.content,e+1,n,r,s)))}if(e>r){let s=o.contentMatchAt(0),i=s.fillBefore(t).append(t);t=i.append(s.matchFragment(i).fillBefore(ie.empty,!0))}return t}function n0e(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=Xge(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new we(ie.from(r),0,0))}function r0e(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),s=z9(r,o);for(let i=0;i<s.length;i++){let a=s[i],l=i==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return t.delete(r.before(i),n);t.delete(e,n)}function z9(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let s=t.start(o);if(s<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(s==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==s-1)&&n.push(o)}return n}class Mc extends Mr{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return an.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return an.fromReplace(e,this.pos,this.pos+1,new we(ie.from(o),0,n.isLeaf?0:1))}getMap(){return Zr.empty}invert(e){return new Mc(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Mc(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Mc(n.pos,n.attr,n.value)}}Mr.jsonID("attr",Mc);let ou=class extends Error{};ou=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};ou.prototype=Object.create(Error.prototype);ou.prototype.constructor=ou;ou.prototype.name="TransformError";class V9{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new _c}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ou(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=we.empty){let o=mx(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new we(ie.from(r),0,0))}delete(e,n){return this.replace(e,n,we.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return t0e(this,e,n,r),this}replaceRangeWith(e,n,r){return n0e(this,e,n,r),this}deleteRange(e,n){return r0e(this,e,n),this}lift(e,n){return zge(this,e,n),this}join(e,n=1){return Yge(this,e,n),this}wrap(e,n){return qge(this,e,n),this}setBlockType(e,n=e,r,o=null){return Wge(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return Gge(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Mc(e,n,r)),this}addNodeMark(e,n){return this.step(new qi(e,n)),this}removeNodeMark(e,n){if(!(n instanceof St)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new ru(e,n)),this}split(e,n=1,r){return Jge(this,e,n,r),this}addMark(e,n,r){return Hge(this,e,n,r),this}removeMark(e,n,r){return Bge(this,e,n,r),this}clearIncompatible(e,n,r){return Fge(this,e,n,r),this}}const a1=Object.create(null);class je{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new U9(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=we.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let s=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:l,$to:c}=i[a],u=e.mapping.slice(s);e.replaceRange(u.map(l.pos),u.map(c.pos),a?we.empty:n),a==0&&jS(e,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:i,$to:a}=o[s],l=e.mapping.slice(r),c=l.map(i.pos),u=l.map(a.pos);s?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),jS(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Ke(e):rc(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let s=e.depth-1;s>=0;s--){let i=n<0?rc(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):rc(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(i)return i}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Io(e.node(0))}static atStart(e){return rc(e,e,0,0,1)||new Io(e)}static atEnd(e){return rc(e,e,e.content.size,e.childCount,-1)||new Io(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=a1[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in a1)throw new RangeError("Duplicate use of selection JSON ID "+e);return a1[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Ke.between(this.$anchor,this.$head).getBookmark()}}je.prototype.visible=!0;class U9{constructor(e,n){this.$from=e,this.$to=n}}let BS=!1;function FS(t){!BS&&!t.parent.inlineContent&&(BS=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ke extends je{constructor(e,n=e){FS(e),FS(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return je.near(r);let o=e.resolve(n.map(this.anchor));return new Ke(o.parent.inlineContent?o:r,r)}replace(e,n=we.empty){if(super.replace(e,n),n==we.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ke&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new u0(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ke(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let s=je.findFrom(n,r,!0)||je.findFrom(n,-r,!0);if(s)n=s.$head;else return je.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(je.findFrom(e,-r,!0)||je.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Ke(e,n)}}je.jsonID("text",Ke);class u0{constructor(e,n){this.anchor=e,this.head=n}map(e){return new u0(e.map(this.anchor),e.map(this.head))}resolve(e){return Ke.between(e.resolve(this.anchor),e.resolve(this.head))}}class Be extends je{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),s=e.resolve(o);return r?je.near(s):new Be(s)}content(){return new we(ie.from(this.node),0,0)}eq(e){return e instanceof Be&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new gx(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Be(e.resolve(n.anchor))}static create(e,n){return new Be(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Be.prototype.visible=!1;je.jsonID("node",Be);class gx{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new u0(r,r):new gx(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Be.isSelectable(r)?new Be(n):je.near(n)}}class Io extends je{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=we.empty){if(n==we.empty){e.delete(0,e.doc.content.size);let r=je.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Io(e)}map(e){return new Io(e)}eq(e){return e instanceof Io}getBookmark(){return o0e}}je.jsonID("all",Io);const o0e={map(){return this},resolve(t){return new Io(t)}};function rc(t,e,n,r,o,s=!1){if(e.inlineContent)return Ke.create(t,n);for(let i=r-(o>0?0:1);o>0?i<e.childCount:i>=0;i+=o){let a=e.child(i);if(a.isAtom){if(!s&&Be.isSelectable(a))return Be.create(t,n-(o<0?a.nodeSize:0))}else{let l=rc(t,a,n+o,o<0?a.childCount:0,o,s);if(l)return l}n+=a.nodeSize*o}return null}function jS(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Bn||o instanceof hn))return;let s=t.mapping.maps[r],i;s.forEach((a,l,c,u)=>{i==null&&(i=u)}),t.setSelection(je.near(t.doc.resolve(i),n))}const zS=1,Xh=2,VS=4;class s0e extends V9{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|zS)&~Xh,this.storedMarks=null,this}get selectionSet(){return(this.updated&zS)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Xh,this}ensureMarks(e){return St.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Xh)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Xh,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||St.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let i=this.doc.resolve(n);s=r==n?i.marks():i.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,s)),this.selection.empty||this.setSelection(je.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=VS,this}get scrolledIntoView(){return(this.updated&VS)>0}}function US(t,e){return!e||!t?t:t.bind(e)}class bd{constructor(e,n,r){this.name=e,this.init=US(n.init,r),this.apply=US(n.apply,r)}}const i0e=[new bd("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new bd("selection",{init(t,e){return t.selection||je.atStart(e.doc)},apply(t){return t.selection}}),new bd("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new bd("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class l1{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=i0e.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new bd(r.key,r.spec.state,r))})}}class lc{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let s=!1;for(let i=0;i<this.config.plugins.length;i++){let a=this.config.plugins[i];if(a.spec.appendTransaction){let l=o?o[i].n:0,c=o?o[i].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,i)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<i?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),s=!0}o&&(o[i]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new lc(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let s=r[o];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new s0e(this)}static create(e){let n=new l1(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new lc(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new l1(this.schema,e.plugins),r=n.fields,o=new lc(n);for(let s=0;s<r.length;s++){let i=r[s].name;o[i]=this.hasOwnProperty(i)?this[i]:r[s].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],s=o.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new l1(e.schema,e.plugins),s=new lc(o);return o.fields.forEach(i=>{if(i.name=="doc")s.doc=cl.fromJSON(e.schema,n.doc);else if(i.name=="selection")s.selection=je.fromJSON(s.doc,n.selection);else if(i.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==i.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[i.name]=c.fromJSON.call(l,e,n[a],s);return}}s[i.name]=i.init(e,s)}}),s}}function q9(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=q9(o,e,{})),n[r]=o}return n}class Gn{constructor(e){this.spec=e,this.props={},e.props&&q9(e.props,this,this.props),this.key=e.key?e.key.key:W9("plugin")}getState(e){return e[this.key]}}const c1=Object.create(null);function W9(t){return t in c1?t+"$"+ ++c1[t]:(c1[t]=0,t+"$")}class Ur{constructor(e="key"){this.key=W9(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Qr=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Nf=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let qS=null;const $s=function(t,e,n){let r=qS||(qS=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},El=function(t,e,n,r){return n&&(WS(t,e,n,r,-1)||WS(t,e,n,r,1))},a0e=/^(img|br|input|textarea|hr)$/i;function WS(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Qo(t))){let s=t.parentNode;if(!s||s.nodeType!=1||c0e(t)||a0e.test(t.nodeName)||t.contentEditable=="false")return!1;e=Qr(t)+(o<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?Qo(t):0}else return!1}}function Qo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function l0e(t,e,n){for(let r=e==0,o=e==Qo(t);r||o;){if(t==n)return!0;let s=Qr(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,o=o&&s==Qo(t)}}function c0e(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const d0=function(t){return t.focusNode&&El(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Fa(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function u0e(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function d0e(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const bs=typeof navigator<"u"?navigator:null,KS=typeof document<"u"?document:null,wa=bs&&bs.userAgent||"",Fb=/Edge\/(\d+)/.exec(wa),K9=/MSIE \d/.exec(wa),jb=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wa),kr=!!(K9||jb||Fb),ta=K9?document.documentMode:jb?+jb[1]:Fb?+Fb[1]:0,Ho=!kr&&/gecko\/(\d+)/i.test(wa);Ho&&+(/Firefox\/(\d+)/.exec(wa)||[0,0])[1];const zb=!kr&&/Chrome\/(\d+)/.exec(wa),jn=!!zb,f0e=zb?+zb[1]:0,lr=!kr&&!!bs&&/Apple Computer/.test(bs.vendor),su=lr&&(/Mobile\/\w+/.test(wa)||!!bs&&bs.maxTouchPoints>2),Jr=su||(bs?/Mac/.test(bs.platform):!1),h0e=bs?/Win/.test(bs.platform):!1,_o=/Android \d/.test(wa),f0=!!KS&&"webkitFontSmoothing"in KS.documentElement.style,p0e=f0?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function m0e(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function bi(t,e){return typeof t=="number"?t:t[e]}function g0e(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function GS(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let i=n||t.dom;i;i=Nf(i)){if(i.nodeType!=1)continue;let a=i,l=a==s.body,c=l?m0e(s):g0e(a),u=0,d=0;if(e.top<c.top+bi(r,"top")?d=-(c.top-e.top+bi(o,"top")):e.bottom>c.bottom-bi(r,"bottom")&&(d=e.bottom-c.bottom+bi(o,"bottom")),e.left<c.left+bi(r,"left")?u=-(c.left-e.left+bi(o,"left")):e.right>c.right-bi(r,"right")&&(u=e.right-c.right+bi(o,"right")),u||d)if(l)s.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,h=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let p=a.scrollLeft-f,g=a.scrollTop-h;e={left:e.left-p,top:e.top-g,right:e.right-p,bottom:e.bottom-g}}if(l)break}}function y0e(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let s=(e.left+e.right)/2,i=n+1;i<Math.min(innerHeight,e.bottom);i+=5){let a=t.root.elementFromPoint(s,i);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:G9(t.dom)}}function G9(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Nf(r));return e}function v0e({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;J9(n,r==0?0:r-e)}function J9(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:s}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Ul=null;function b0e(t){if(t.setActive)return t.setActive();if(Ul)return t.focus(Ul);let e=G9(t);t.focus(Ul==null?{get preventScroll(){return Ul={preventScroll:!0},!0}}:void 0),Ul||(Ul=!1,J9(e,0))}function Y9(t,e){let n,r=2e8,o,s=0,i=e.top,a=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=$s(u).getClientRects();else continue;for(let h=0;h<f.length;h++){let p=f[h];if(p.top<=i&&p.bottom>=a){i=Math.max(p.bottom,i),a=Math.min(p.top,a);let g=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(g<r){n=u,r=g,o=g&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,u.nodeType==1&&g&&(s=d+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?w0e(n,o):!n||r&&n.nodeType==1?{node:t,offset:s}:Y9(n,o)}function w0e(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let s=_i(r,1);if(s.top!=s.bottom&&yx(e,s))return{node:t,offset:o+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function yx(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function k0e(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function x0e(t,e,n){let{node:r,offset:o}=Y9(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let i=r.getBoundingClientRect();s=i.left!=i.right&&n.left>(i.left+i.right)/2?1:-1}return t.docView.posFromDOM(r,o,s)}function C0e(t,e,n,r){let o=-1;for(let s=e,i=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!i||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!i&&(i=!0,l.left>r.left||l.top>r.top?o=a.posBefore:(l.right<r.left||l.bottom<r.top)&&(o=a.posAfter)),!a.contentDOM&&o<0)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}s=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function X9(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=o;;){let i=t.childNodes[s];if(i.nodeType==1){let a=i.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(yx(e,c))return X9(i,e,c)}}if((s=(s+1)%r)==o)break}return t}function _0e(t,e){let n=t.dom.ownerDocument,r,o=0,s=d0e(n,e.left,e.top);s&&({node:r,offset:o}=s);let i=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!i||!t.dom.contains(i.nodeType!=1?i.parentNode:i)){let c=t.dom.getBoundingClientRect();if(!yx(e,c)||(i=X9(t.dom,e,c),!i))return null}if(lr)for(let c=i;r&&c;c=Nf(c))c.draggable&&(r=void 0);if(i=k0e(i,e),r){if(Ho&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let c=r.childNodes[o],u;c.nodeName=="IMG"&&(u=c.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&o++}r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=C0e(t,r,o,e))}a==null&&(a=x0e(t,i,e));let l=t.docView.nearestDesc(i,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function JS(t){return t.top<t.bottom||t.left<t.right}function _i(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(JS(r))return r}return Array.prototype.find.call(n,JS)||t.getBoundingClientRect()}const S0e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Z9(t,e,n){let{node:r,offset:o,atom:s}=t.docView.domFromPos(e,n<0?-1:1),i=f0||Ho;if(r.nodeType==3)if(i&&(S0e.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let a=_i($s(r,o,o),n);if(Ho&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let l=_i($s(r,o-1,o-1),-1);if(l.top==a.top){let c=_i($s(r,o,o+1),-1);if(c.top!=a.top)return Ju(c,c.left<l.left)}}return a}else{let a=o,l=o,c=n<0?1:-1;return n<0&&!o?(l++,c=-1):n>=0&&o==r.nodeValue.length?(a--,c=1):n<0?a--:l++,Ju(_i($s(r,a,l),c),c<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==Qo(r))){let a=r.childNodes[o-1];if(a.nodeType==1)return u1(a.getBoundingClientRect(),!1)}if(s==null&&o<Qo(r)){let a=r.childNodes[o];if(a.nodeType==1)return u1(a.getBoundingClientRect(),!0)}return u1(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==Qo(r))){let a=r.childNodes[o-1],l=a.nodeType==3?$s(a,Qo(a)-(i?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(l)return Ju(_i(l,1),!1)}if(s==null&&o<Qo(r)){let a=r.childNodes[o];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let l=a?a.nodeType==3?$s(a,0,i?0:1):a.nodeType==1?a:null:null;if(l)return Ju(_i(l,-1),!0)}return Ju(_i(r.nodeType==3?$s(r):r,-n),n>=0)}function Ju(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function u1(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Q9(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function M0e(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return Q9(t,e,()=>{let{node:s}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let i=Z9(t,o.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=$s(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?i.top-u.top>(u.bottom-i.top)*2:u.bottom-i.bottom>(i.bottom-u.top)*2))return!1}}return!0})}const T0e=/[\u0590-\u08ac]/;function E0e(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,s=!o,i=o==r.parent.content.size,a=t.domSelection();return!T0e.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:i:Q9(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:g}=t.domSelectionRange(),y=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),y})}let YS=null,XS=null,ZS=!1;function A0e(t,e,n){return YS==e&&XS==n?ZS:(YS=e,XS=n,ZS=n=="up"||n=="down"?M0e(t,e,n):E0e(t,e,n))}const io=0,QS=1,Wa=2,ws=3;class ph{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=io,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,i;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(i)+i.size:this.posAtStart}else{let s,i;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(i):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>Qr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!1;break}if(s.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!0;break}if(s.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let s=this.getDesc(o),i;if(s&&(!n||s.node))if(r&&(i=s.nodeDOM)&&!(i.nodeType==1?i.contains(e.nodeType==1?e:e.parentNode):i==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let s=this.getDesc(o);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],s=r+o.size;if(r==e&&s!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(e<s)return o.descAt(e-r-o.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let s=0;r<this.children.length;r++){let i=this.children[r],a=s+i.size;if(a>e||i instanceof tO){o=e-s;break}s=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof eO&&s.side>=0;r--);if(n<=0){let s,i=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,i=!1);return s&&n&&i&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Qr(s.dom)+1:0}}else{let s,i=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,i=!1);return s&&i&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Qr(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,s=-1;for(let i=r,a=0;;a++){let l=this.children[a],c=i+l.size;if(o==-1&&e<=c){let u=i+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=i;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=Qr(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=Qr(d.dom);break}n+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let s=Math.min(e,n),i=Math.max(e,n);for(let f=0,h=0;f<this.children.length;f++){let p=this.children[f],g=h+p.size;if(s>h&&i<g)return p.setSelection(e-h-p.border,n-h-p.border,r,o);h=g}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.getSelection(),u=!1;if((Ho||lr)&&e==n){let{node:f,offset:h}=a;if(f.nodeType==3)u=!!(h&&f.nodeValue[h-1]==`
109`);else{let p=f.childNodes[h-1];u=p&&(p.nodeName=="BR"||p.contentEditable=="false")}}if(Ho&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let f=c.focusNode.childNodes[c.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||u&&lr)&&El(a.node,a.offset,c.anchorNode,c.anchorOffset)&&El(l.node,l.offset,c.focusNode,c.focusOffset))return;let d=!1;if((c.extend||e==n)&&!u){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(e>n){let h=a;a=l,l=h}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let s=this.children[o],i=r+s.size;if(r==i?e<=i&&n>=r:e<i&&n>r){let a=r+s.border,l=i-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==i?Wa:QS,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=ws:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Wa:ws}r=i}this.dirty=Wa}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Wa:QS;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class eO extends ph{constructor(e,n,r,o){let s,i=n.type.toDOM;if(typeof i=="function"&&(i=i(r,()=>{if(!s)return o;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(i.nodeType!=1){let a=document.createElement("span");a.appendChild(i),i=a}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==io&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class O0e extends ph{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Al extends ph{constructor(e,n,r,o){super(e,[],r,o),this.mark=n}static create(e,n,r,o){let s=o.nodeViews[n.type.name],i=s&&s(n,o,r);return(!i||!i.dom)&&(i=ns.renderSpec(document,n.type.spec.toDOM(n,r))),new Al(e,n,i.dom,i.contentDOM||i.dom)}parseRule(){return this.dirty&ws||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=ws&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=io){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=io}}slice(e,n,r){let o=Al.create(this.parent,this.mark,!0,r),s=this.children,i=this.size;n<i&&(s=qb(s,n,i,r)),e>0&&(s=qb(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=o;return o.children=s,o}}class na extends ph{constructor(e,n,r,o,s,i,a,l,c){super(e,[],s,i),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,s,i){let a=s.nodeViews[n.type.name],l,c=a&&a(n,s,()=>{if(!l)return i;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=ns.renderSpec(document,n.type.spec.toDOM(n)));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=oO(u,r,n),c?l=new I0e(e,n,r,o,u,d||null,f,c,s,i+1):n.isText?new h0(e,n,r,o,u,f,s):new na(e,n,r,o,u,d||null,f,s,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ie.empty)}return e}matchesNode(e,n,r){return this.dirty==io&&e.eq(this.node)&&Ub(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,s=e.composing?this.localCompositionInfo(e,n):null,i=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new L0e(this,i&&i.node,e);D0e(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?St.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,e);let h;l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(h=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(c,u,d,h,e)||l.updateNextNode(c,u,d,e,f,o)||l.addNode(c,u,d,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Wa)&&(i&&this.protectLocalComposition(e,i),nO(this.contentDOM,this.children,e),su&&P0e(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Ke)||r<n||o>n+this.node.content.size)return null;let s=e.domSelectionRange(),i=H0e(s.focusNode,s.focusOffset);if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let a=i.nodeValue,l=B0e(this.node.content,a,r-n,o-n);return l<0?null:{node:i,pos:l,text:a}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let i=new O0e(this,s,n,o);e.input.compositionNodes.push(i),this.children=qb(this.children,r,r+o.length,e,i)}update(e,n,r,o){return this.dirty==ws||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=io}updateOuterDeco(e){if(Ub(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=rO(this.dom,this.nodeDOM,Vb(this.outerDeco,this.node,n),Vb(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function e4(t,e,n,r,o){oO(r,e,t);let s=new na(void 0,t,e,n,r,r,r,o,0);return s.contentDOM&&s.updateChildren(o,0),s}class h0 extends na{constructor(e,n,r,o,s,i,a){super(e,n,r,o,s,null,i,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==ws||this.dirty!=io&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=io||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=io,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),s=document.createTextNode(o.text);return new h0(this.parent,o,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ws)}get domAtom(){return!1}}class tO extends ph{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==io&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class I0e extends na{constructor(e,n,r,o,s,i,a,l,c,u){super(e,n,r,o,s,i,a,c,u),this.spec=l}update(e,n,r,o){if(this.dirty==ws)return!1;if(this.spec.update){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,o),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function nO(t,e,n){let r=t.firstChild,o=!1;for(let s=0;s<e.length;s++){let i=e[s],a=i.dom;if(a.parentNode==t){for(;a!=r;)r=t4(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(i instanceof Al){let l=r?r.previousSibling:t.lastChild;nO(i.contentDOM,i.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=t4(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Zd=function(t){t&&(this.nodeName=t)};Zd.prototype=Object.create(null);const Ka=[new Zd];function Vb(t,e,n){if(t.length==0)return Ka;let r=n?Ka[0]:new Zd,o=[r];for(let s=0;s<t.length;s++){let i=t[s].type.attrs;if(i){i.nodeName&&o.push(r=new Zd(i.nodeName));for(let a in i){let l=i[a];l!=null&&(n&&o.length==1&&o.push(r=new Zd(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function rO(t,e,n,r){if(n==Ka&&r==Ka)return e;let o=e;for(let s=0;s<r.length;s++){let i=r[s],a=n[s];if(s){let l;a&&a.nodeName==i.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==i.nodeName||(l=document.createElement(i.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=Ka[0]),o=l}N0e(o,a||Ka[0],i)}return o}function N0e(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)o.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<o.length;s++)r.indexOf(o[s])==-1&&t.classList.add(o[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function oO(t,e,n){return rO(t,t,Ka,Vb(e,n,t.nodeType!=1))}function Ub(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function t4(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class L0e{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=R0e(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,s=this.stack.length>>1,i=Math.min(s,e.length);for(;o<i&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=io,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[s])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Al.create(this.top,e[s],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,r,o){let s=-1,i;if(o>=this.preMatch.index&&(i=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&i.matchesNode(e,n,r))s=this.top.children.indexOf(i,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,o,s){let i=this.top.children[o];return i.dirty==ws&&i.dom==i.contentDOM&&(i.dirty=Wa),i.update(e,n,r,s)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,s,i){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof na){let c=this.preMatch.matched.get(l);if(c!=null&&c!=s)return!1;let u=l.dom,d,f=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=ws&&Ub(n,l.outerDeco));if(!f&&l.update(e,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,e,n,r,o,i)))return this.top.children[this.index]=d,d.dirty=Wa,d.updateChildren(o,i+1),d.dirty=io,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,s,i){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let a=na.create(this.top,n,r,o,s,i);if(!a.contentDOM)return null;a.children=e.children,e.children=[],e.destroy();for(let l of a.children)l.parent=a;return a}addNode(e,n,r,o,s){let i=na.create(this.top,e,n,r,o,s);i.contentDOM&&i.updateChildren(o,s+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let s=new eO(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Al;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof h0)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((lr||jn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new tO(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function R0e(t,e){let n=e,r=n.children.length,o=t.childCount,s=new Map,i=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof Al)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,s.set(a,o),i.push(a)}}return{index:o,matched:s,matches:i.reverse()}}function $0e(t,e){return t.type.side-e.type.side}function D0e(t,e,n,r){let o=e.locals(t),s=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(s,u),c),s+=u.nodeSize}return}let i=0,a=[],l=null;for(let c=0;;){if(i<o.length&&o[i].to==s){let p=o[i++],g;for(;i<o.length&&o[i].to==s;)(g||(g=[p])).push(o[i++]);if(g){g.sort($0e);for(let y=0;y<g.length;y++)n(g[y],c,!!l)}else n(p,c,!!l)}let u,d;if(l)d=-1,u=l,l=null;else if(c<t.childCount)d=c,u=t.child(c++);else break;for(let p=0;p<a.length;p++)a[p].to<=s&&a.splice(p--,1);for(;i<o.length&&o[i].from<=s&&o[i].to>s;)a.push(o[i++]);let f=s+u.nodeSize;if(u.isText){let p=f;i<o.length&&o[i].from<p&&(p=o[i].from);for(let g=0;g<a.length;g++)a[g].to<p&&(p=a[g].to);p<f&&(l=u.cut(p-s),u=u.cut(0,p-s),f=p,d=-1)}let h=u.isInline&&!u.isLeaf?a.filter(p=>!p.inline):a.slice();r(u,h,e.forChild(s,u),d),s=f}}function P0e(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function H0e(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=Qo(t)}else if(t.nodeType==1&&e<t.childNodes.length)t=t.childNodes[e],e=0;else return null}}function B0e(t,e,n,r){for(let o=0,s=0;o<t.childCount&&s<=r;){let i=t.child(o++),a=s;if(s+=i.nodeSize,!i.isText)continue;let l=i.text;for(;o<t.childCount;){let c=t.child(o++);if(s+=c.nodeSize,!c.isText)break;l+=c.text}if(s>=n){let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function qb(t,e,n,r,o){let s=[];for(let i=0,a=0;i<t.length;i++){let l=t[i],c=a,u=a+=l.size;c>=n||u<=e?s.push(l):(c<e&&s.push(l.slice(0,e-c,r)),o&&(s.push(o),o=void 0),u>n&&s.push(l.slice(n-c,l.size,r)))}return s}function vx(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),s=o&&o.size==0,i=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(i<0)return null;let a=r.resolve(i),l,c;if(d0(n)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&Be.isSelectable(u)&&o.parent&&!(u.isInline&&l0e(n.focusNode,n.focusOffset,o.dom))){let d=o.posBefore;c=new Be(i==d?a:r.resolve(d))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!c){let u=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;c=bx(t,l,a,u)}return c}function sO(t){return t.editable?t.hasFocus():aO(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Zs(t,e=!1){let n=t.state.selection;if(iO(t,n),!!sO(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&jn){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&El(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)j0e(t);else{let{anchor:r,head:o}=n,s,i;n4&&!(n instanceof Ke)&&(n.$from.parent.inlineContent||(s=r4(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(i=r4(t,n.to))),t.docView.setSelection(r,o,t.root,e),n4&&(s&&o4(s),i&&o4(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&F0e(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const n4=lr||jn&&f0e<63;function r4(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(lr&&o&&o.contentEditable=="false")return d1(o);if((!o||o.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(o)return d1(o);if(s)return d1(s)}}function d1(t){return t.contentEditable="true",lr&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function o4(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function F0e(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!sO(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function j0e(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,Qr(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&kr&&ta<=11&&(r.disabled=!0,r.disabled=!1)}function iO(t,e){if(e instanceof Be){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(s4(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else s4(t)}function s4(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function bx(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Ke.between(e,n,r)}function i4(t){return t.editable&&!t.hasFocus()?!1:aO(t)}function aO(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function z0e(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return El(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Wb(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),s=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return s&&je.findFrom(s,e)}function ja(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function a4(t,e,n){let r=t.state.selection;if(r instanceof Ke){if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let o=Wb(t.state,e);return o&&o instanceof Be?ja(t,o):!1}else if(!(Jr&&n.indexOf("m")>-1)){let o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,i;if(!s||s.isText)return!1;let a=e<0?o.pos-s.nodeSize:o.pos;return s.isAtom||(i=t.docView.descAt(a))&&!i.contentDOM?Be.isSelectable(s)?ja(t,new Be(e<0?t.state.doc.resolve(o.pos-s.nodeSize):o)):f0?ja(t,new Ke(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else{if(r instanceof Be&&r.node.isInline)return ja(t,new Ke(e>0?r.$to:r.$from));{let o=Wb(t.state,e);return o?ja(t,o):!1}}}function eg(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Qd(t){let e=t.pmViewDesc;return e&&e.size==0&&(t.nextSibling||t.nodeName!="BR")}function Yu(t,e){return e<0?V0e(t):lO(t)}function V0e(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,s,i=!1;for(Ho&&n.nodeType==1&&r<eg(n)&&Qd(n.childNodes[r])&&(i=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Qd(a))o=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(cO(n))break;{let a=n.previousSibling;for(;a&&Qd(a);)o=n.parentNode,s=Qr(a),a=a.previousSibling;if(a)n=a,r=eg(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}i?Kb(t,n,r):o&&Kb(t,o,s)}function lO(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=eg(n),s,i;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Qd(a))s=n,i=++r;else break}else{if(cO(n))break;{let a=n.nextSibling;for(;a&&Qd(a);)s=a.parentNode,i=Qr(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=eg(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}s&&Kb(t,s,i)}function cO(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Kb(t,e,n){let r=t.domSelection();if(d0(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Zs(t)},50)}function l4(t,e){let n=t.state.doc.resolve(e);if(!(jn||h0e)&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(o.left-r.left)>1)return o.left<r.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(o.left-r.left)>1)return o.left>r.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function c4(t,e,n){let r=t.state.selection;if(r instanceof Ke&&!r.empty||n.indexOf("s")>-1||Jr&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let i=Wb(t.state,e);if(i&&i instanceof Be)return ja(t,i)}if(!o.parent.inlineContent){let i=e<0?o:s,a=r instanceof Io?je.near(i,e):je.findFrom(i,e);return a?ja(t,a):!1}return!1}function u4(t,e){if(!(t.state.selection instanceof Ke))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let i=t.state.tr;return e<0?i.delete(n.pos-s.nodeSize,n.pos):i.delete(n.pos,n.pos+s.nodeSize),t.dispatch(i),!0}return!1}function d4(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function U0e(t){if(!lr||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;d4(t,r,"true"),setTimeout(()=>d4(t,r,"false"),20)}return!1}function q0e(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function W0e(t,e){let n=e.keyCode,r=q0e(e);if(n==8||Jr&&n==72&&r=="c")return u4(t,-1)||Yu(t,-1);if(n==46||Jr&&n==68&&r=="c")return u4(t,1)||Yu(t,1);if(n==13||n==27)return!0;if(n==37||Jr&&n==66&&r=="c"){let o=n==37?l4(t,t.state.selection.from)=="ltr"?-1:1:-1;return a4(t,o,r)||Yu(t,o)}else if(n==39||Jr&&n==70&&r=="c"){let o=n==39?l4(t,t.state.selection.from)=="ltr"?1:-1:1;return a4(t,o,r)||Yu(t,o)}else{if(n==38||Jr&&n==80&&r=="c")return c4(t,-1,r)||Yu(t,-1);if(n==40||Jr&&n==78&&r=="c")return U0e(t)||c4(t,1,r)||lO(t);if(r==(Jr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function uO(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:o,openEnd:s}=e;for(;o>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,s--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let i=t.someProp("clipboardSerializer")||ns.fromSchema(t.state.schema),a=gO(),l=a.createElement("div");l.appendChild(i.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=mO[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=a.createElement(u[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${s}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
110
111`);return{dom:l,text:f}}function dO(t,e,n,r,o){let s=o.parent.type.spec.code,i,a;if(!n&&!e)return null;let l=e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,s||r,t)}),s)return e?new we(ie.from(t.state.schema.text(e.replace(/\r\n?/g,`
112`))),0,0):we.empty;let d=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(d)a=d;else{let f=o.marks(),{schema:h}=t.state,p=ns.fromSchema(h);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=i.appendChild(document.createElement("p"));g&&y.appendChild(p.serializeNode(h.text(g,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),i=J0e(n),f0&&Y0e(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=i.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;i=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||nu.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!K0e.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)a=X0e(f4(a,+u[1],+u[2]),u[4]);else if(a=we.maxOpen(G0e(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let h=a.content.firstChild;d<a.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=a.content.lastChild;f<a.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);a=f4(a,d,f)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const K0e=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function G0e(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(i=>{if(!s)return;let a=r.findWrapping(i.type),l;if(!a)return s=null;if(l=s.length&&o.length&&hO(a,o,i,s[s.length-1],0))s[s.length-1]=l;else{s.length&&(s[s.length-1]=pO(s[s.length-1],o.length));let c=fO(i,a);s.push(c),r=r.matchType(c.type),o=a}}),s)return ie.from(s)}return t}function fO(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ie.from(t));return t}function hO(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let s=hO(t,e,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(ie.from(fO(n,t,o+1))))}}function pO(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,pO(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(ie.empty,!0);return t.copy(n.append(r))}function Gb(t,e,n,r,o,s){let i=e<0?t.firstChild:t.lastChild,a=i.content;return t.childCount>1&&(s=0),o<r-1&&(a=Gb(a,e,n,r,o+1,s)),o>=n&&(a=e<0?i.contentMatchAt(0).fillBefore(a,s<=o).append(a):a.append(i.contentMatchAt(i.childCount).fillBefore(ie.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,i.copy(a))}function f4(t,e,n){return e<t.openStart&&(t=new we(Gb(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new we(Gb(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const mO={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let h4=null;function gO(){return h4||(h4=document.implementation.createHTMLDocument("title"))}function J0e(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=gO().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&mO[r[1].toLowerCase()])&&(t=o.map(s=>"<"+s+">").join("")+t+o.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=t,o)for(let s=0;s<o.length;s++)n=n.querySelector(o[s])||n;return n}function Y0e(t){let e=t.querySelectorAll(jn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function X0e(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:s,openEnd:i}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=ie.from(l.create(r[a+1],o)),s++,i++}return new we(o,s,i)}const cr={},ur={},Z0e={touchstart:!0,touchmove:!0};class Q0e{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function eye(t){for(let e in cr){let n=cr[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{nye(t,r)&&!wx(t,r)&&(t.editable||!(r.type in ur))&&n(t,r)},Z0e[e]?{passive:!0}:void 0)}lr&&t.dom.addEventListener("input",()=>null),Jb(t)}function Wi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function tye(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Jb(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>wx(t,r))})}function wx(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function nye(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function rye(t,e){!wx(t,e)&&cr[e.type]&&(t.editable||!(e.type in ur))&&cr[e.type](t,e)}ur.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!vO(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(_o&&jn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),su&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,Fa(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||W0e(t,n)?n.preventDefault():Wi(t,"key")};ur.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ur.keypress=(t,e)=>{let n=e;if(vO(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Jr&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Ke)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function p0(t){return{left:t.clientX,top:t.clientY}}function oye(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function kx(t,e,n,r,o){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let i=s.depth+1;i>0;i--)if(t.someProp(e,a=>i>s.depth?a(t,n,s.nodeAfter,s.before(i),o,!0):a(t,n,s.node(i),s.before(i),o,!1)))return!0;return!1}function Tc(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function sye(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Be.isSelectable(r)?(Tc(t,new Be(n)),!0):!1}function iye(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Be&&(r=n.node);let s=t.state.doc.resolve(e);for(let i=s.depth+1;i>0;i--){let a=i>s.depth?s.nodeAfter:s.node(i);if(Be.isSelectable(a)){r&&n.$from.depth>0&&i>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?o=s.before(n.$from.depth):o=s.before(i);break}}return o!=null?(Tc(t,Be.create(t.state.doc,o)),!0):!1}function aye(t,e,n,r,o){return kx(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(o?iye(t,n):sye(t,n))}function lye(t,e,n,r){return kx(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function cye(t,e,n,r){return kx(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||uye(t,n,r)}function uye(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Tc(t,Ke.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let s=o.depth+1;s>0;s--){let i=s>o.depth?o.nodeAfter:o.node(s),a=o.before(s);if(i.inlineContent)Tc(t,Ke.create(r,a+1,a+1+i.content.size));else if(Be.isSelectable(i))Tc(t,Be.create(r,a));else continue;return!0}}function xx(t){return tg(t)}const yO=Jr?"metaKey":"ctrlKey";cr.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=xx(t),o=Date.now(),s="singleClick";o-t.input.lastClick.time<500&&oye(n,t.input.lastClick)&&!n[yO]&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s};let i=t.posAtCoords(p0(n));i&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new dye(t,i,n,!!r)):(s=="doubleClick"?lye:cye)(t,i.pos,i.inside,n)?n.preventDefault():Wi(t,"pointer"))};class dye{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[yO],this.allowDefault=r.shiftKey;let s,i;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),i=n.inside;else{let u=e.state.doc.resolve(n.pos);s=u.parent,i=u.depth?u.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof Be&&c.from<=i&&c.to>i)&&(this.mightDrag={node:s,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ho&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Wi(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Zs(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(p0(e))),this.updateAllowDefault(e),this.allowDefault||!n?Wi(this.view,"pointer"):aye(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||lr&&this.mightDrag&&!this.mightDrag.node.isAtom||jn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Tc(this.view,je.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Wi(this.view,"pointer")}move(e){this.updateAllowDefault(e),Wi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}cr.touchstart=t=>{t.input.lastTouch=Date.now(),xx(t),Wi(t,"pointer")};cr.touchmove=t=>{t.input.lastTouch=Date.now(),Wi(t,"pointer")};cr.contextmenu=t=>xx(t);function vO(t,e){return t.composing?!0:lr&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const fye=_o?5e3:-1;ur.compositionstart=ur.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),tg(t,!0),t.markCursor=null;else if(tg(t),Ho&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,s=r.focusOffset;o&&o.nodeType==1&&s!=0;){let i=s<0?o.lastChild:o.childNodes[s-1];if(!i)break;if(i.nodeType==3){t.domSelection().collapse(i,i.nodeValue.length);break}else o=i,s=-1}}t.input.composing=!0}bO(t,fye)};ur.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionID++,bO(t,20))};function bO(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>tg(t),e))}function wO(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=hye());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function hye(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function tg(t,e=!1){if(!(_o&&t.domObserver.flushingSoon>
112=0)){if(t.domObserver.forceFlush(),wO(t),e||t.docView&&t.docView.dirty){let n=vx(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function pye(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const iu=kr&&ta<15||su&&p0e<604;cr.copy=ur.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let s=iu?null:n.clipboardData,i=r.content(),{dom:a,text:l}=uO(t,i);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):pye(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function mye(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function gye(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Lf(t,r.value,null,t.input.shiftKey,e):Lf(t,r.textContent,r.innerHTML,t.input.shiftKey,e)},50)}function Lf(t,e,n,r,o){let s=dO(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,s||we.empty)))return!0;if(!s)return!1;let i=mye(s),a=i?t.state.tr.replaceSelectionWith(i,t.input.shiftKey):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}ur.paste=(t,e)=>{let n=e;if(t.composing&&!_o)return;let r=iu?null:n.clipboardData;r&&Lf(t,r.getData("text/plain"),r.getData("text/html"),t.input.shiftKey,n)?n.preventDefault():gye(t,n)};class yye{constructor(e,n){this.slice=e,this.move=n}}const kO=Jr?"altKey":"ctrlKey";cr.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,s=o.empty?null:t.posAtCoords(p0(n));if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof Be?o.to-1:o.to))){if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Be.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let c=t.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=t.docView&&t.dispatch(t.state.tr.setSelection(Be.create(t.state.doc,c.posBefore)))}}let i=t.state.selection.content(),{dom:a,text:l}=uO(t,i);n.dataTransfer.clearData(),n.dataTransfer.setData(iu?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",iu||n.dataTransfer.setData("text/plain",l),t.dragging=new yye(i,!n[kO])};cr.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ur.dragover=ur.dragenter=(t,e)=>e.preventDefault();ur.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(p0(n));if(!o)return;let s=t.state.doc.resolve(o.pos),i=r&&r.slice;i?t.someProp("transformPasted",p=>{i=p(i,t)}):i=dO(t,n.dataTransfer.getData(iu?"Text":"text/plain"),iu?null:n.dataTransfer.getData("text/html"),!1,s);let a=!!(r&&!n[kO]);if(t.someProp("handleDrop",p=>p(t,n,i||we.empty,a))){n.preventDefault();return}if(!i)return;n.preventDefault();let l=i?H9(t.state.doc,s.pos,i):s.pos;l==null&&(l=s.pos);let c=t.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,i.content.firstChild):c.replaceRange(u,u,i),c.doc.eq(f))return;let h=c.doc.resolve(u);if(d&&Be.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new Be(h));else{let p=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,y,w,x)=>p=x),c.setSelection(bx(t,h,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};cr.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Zs(t)},20))};cr.blur=(t,e)=>{let n=e;
vendor: 41,659 bytes, lines 112-113
112t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};cr.beforeinput=(t,e)=>{if(jn&&_o&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Fa(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in ur)cr[t]=ur[t];function Rf(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Cx{constructor(e,n){this.toDOM=e,this.spec=n||ul,this.side=this.spec.side||0}map(e,n,r,o){let{pos:s,deleted:i}=e.mapResult(n.from+o,this.side<0?-1:1);return i?null:new gr(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Cx&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Rf(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ra{constructor(e,n){this.attrs=e,this.spec=n||ul}map(e,n,r,o){let s=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,i=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return s>=i?null:new gr(s,i,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof ra&&Rf(this.attrs,e.attrs)&&Rf(this.spec,e.spec)}static is(e){return e.type instanceof ra}destroy(){}}class _x{constructor(e,n){this.attrs=e,this.spec=n||ul}map(e,n,r,o){let s=e.mapResult(n.from+o,1);if(s.deleted)return null;let i=e.mapResult(n.to+o,-1);return i.deleted||i.pos<=s.pos?null:new gr(s.pos-r,i.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),s;return o==n.from&&!(s=e.child(r)).isText&&o+s.nodeSize==n.to}eq(e){return this==e||e instanceof _x&&Rf(this.attrs,e.attrs)&&Rf(this.spec,e.spec)}destroy(){}}class gr{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new gr(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new gr(e,e,new Cx(n,r))}static inline(e,n,r,o){return new gr(e,n,new ra(r,o))}static node(e,n,r,o){return new gr(e,n,new _x(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof ra}}const oc=[],ul={};class Ft{constructor(e,n){this.local=e.length?e:oc,this.children=n.length?n:oc}static create(e,n){return n.length?ng(n,e,0,ul):Dn}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,s){for(let i=0;i<this.local.length;i++){let a=this.local[i];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<n&&this.children[i+1]>e){let a=this.children[i]+1;this.children[i+2].findInner(e-a,n-a,r,o+a,s)}}map(e,n,r){return this==Dn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ul)}mapInner(e,n,r,o,s){let i;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,o);l&&l.type.valid(n,l)?(i||(i=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?vye(this.children,i||[],e,n,r,o,s):i?new Ft(i.sort(dl),oc):Dn}add(e,n){return n.length?this==Dn?Ft.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,s=0;e.forEach((a,l)=>{let c=l+r,u;if(u=CO(n,a,c)){for(o||(o=this.children.slice());s<o.length&&o[s]<l;)s+=3;o[s]==l?o[s+2]=o[s+2].addInner(a,u,c+1):o.splice(s,0,l,l+a.nodeSize,ng(u,a,c+1,ul)),s+=3}});let i=xO(s?_O(n):n,-r);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||i.splice(a--,1);return new Ft(i.length?this.local.concat(i).sort(dl):this.local,o||this.children)}remove(e){return e.length==0||this==Dn?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let s=0;s<r.length;s+=3){let i,a=r[s]+n,l=r[s+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>a&&d.to<l&&(e[u]=null,(i||(i=[])).push(d));if(!i)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(i,a+1);c!=Dn?r[s+2]=c:(r.splice(s,3),s-=3)}if(o.length){for(let s=0,i;s<e.length;s++)if(i=e[s])for(let a=0;a<o.length;a++)o[a].eq(i,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new Ft(o,r):Dn}forChild(e,n){if(this==Dn)return this;if(n.isLeaf)return Ft.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,i=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<i&&l.to>s&&l.type instanceof ra){let c=Math.max(s,l.from)-s,u=Math.min(i,l.to)-s;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new Ft(o.sort(dl),oc);return r?new Di([a,r]):a}return r||Dn}eq(e){if(this==e)return!0;if(!(e instanceof Ft)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Sx(this.localsInner(e))}localsInner(e){if(this==Dn)return oc;if(e.inlineContent||!this.local.some(ra.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ra||n.push(this.local[r]);return n}}Ft.empty=new Ft([],[]);Ft.removeOverlap=Sx;const Dn=Ft.empty;class Di{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,ul));return Di.from(r)}forChild(e,n){if(n.isLeaf)return Ft.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(e,n);s!=Dn&&(s instanceof Di?r=r.concat(s.members):r.push(s))}return Di.from(r)}eq(e){if(!(e instanceof Di)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let s=this.members[o].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let i=0;i<s.length;i++)n.push(s[i])}}return n?Sx(r?n:n.sort(dl)):oc}static from(e){switch(e.length){case 0:return Dn;case 1:return e[0];default:return new Di(e.every(n=>n instanceof Ft)?e:e.reduce((n,r)=>n.concat(r instanceof Ft?r:r.members),[]))}}}function vye(t,e,n,r,o,s,i){let a=t.slice();for(let c=0,u=s;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,h,p,g)=>{let y=g-p-(h-f);for(let w=0;w<a.length;w+=3){let x=a[w+1];if(x<0||f>x+u-d)continue;let C=a[w]+u-d;h>=C?a[w+1]=f<=C?-2:-1:p>=o&&y&&(a[w]+=y,a[w+1]+=y)}d+=y}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+s),d=u-o;if(d<0||d>=r.content.size){l=!0;continue}let f=n.map(t[c+1]+s,-1),h=f-o,{index:p,offset:g}=r.content.findIndex(d),y=r.maybeChild(p);if(y&&g==d&&g+y.nodeSize==h){let w=a[c+2].mapInner(n,y,u+1,t[c]+s+1,i);w!=Dn?(a[c]=d,a[c+1]=h,a[c+2]=w):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=bye(a,t,e,n,o,s,i),u=ng(c,r,0,i);e=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let h=u.children[d];for(;f<a.length&&a[f]<h;)f+=3;a.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new Ft(e.sort(dl),a)}function xO(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new gr(o.from+e,o.to+e,o.type))}return n}function bye(t,e,n,r,o,s,i){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,o,c);d?n.push(d):i.onRemove&&i.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function CO(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let s=0,i;s<t.length;s++)(i=t[s])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),t[s]=null);return o}function _O(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function ng(t,e,n,r){let o=[],s=!1;e.forEach((a,l)=>{let c=CO(t,a,l+n);if(c){s=!0;let u=ng(c,a,n+l+1,r);u!=Dn&&o.push(l,l+a.nodeSize,u)}});let i=xO(s?_O(t):t,-n).sort(dl);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||(r.onRemove&&r.onRemove(i[a].spec),i.splice(a--,1));return i.length||o.length?new Ft(i,o):Dn}function dl(t,e){return t.from-e.from||t.to-e.to}function Sx(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let s=e[o];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[o]=s.copy(s.from,r.to),p4(e,o+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),p4(e,o,r.copy(s.from,r.to)));break}}}return e}function p4(t,e,n){for(;e<t.length&&dl(n,t[e])>0;)e++;t.splice(e,0,n)}function f1(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Dn&&e.push(r)}),t.cursorWrapper&&e.push(Ft.create(t.state.doc,[t.cursorWrapper.deco])),Di.from(e)}const wye={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},kye=kr&&ta<=11;class xye{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Cye{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new xye,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);kr&&ta<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),kye&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,wye)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(i4(this.view)){if(this.suppressingSelectionUpdates)return Zs(this.view);if(kr&&ta<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&El(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Nf(s))n.add(s);for(let s=e.anchorNode;s;s=Nf(s))if(n.has(s)){r=s;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.observer?this.observer.takeRecords():[];this.queue.length&&(n=this.queue.concat(n),this.queue.length=0);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&i4(e)&&!this.ignoreSelectionChange(r),s=-1,i=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(s=s<0?d.from:Math.min(d.from,s),i=i<0?d.to:Math.max(d.to,i),d.typeOver&&(a=!0))}if(Ho&&l.length>1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;s<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&d0(r)&&(c=vx(e))&&c.eq(je.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Zs(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||o)&&(s>-1&&(e.docView.markDirty(s,i),_ye(e)),this.handleDOMChange(s,i,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Zs(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++)n.push(e.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,s=e.nextSibling;if(kr&&ta<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let i=o&&o.parentNode==e.target?Qr(o)+1:0,a=r.localPosFromDOM(e.target,i,-1),l=s&&s.parentNode==e.target?Qr(s):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let m4=new WeakMap,g4=!1;function _ye(t){if(!m4.has(t)&&(m4.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Ho,g4)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),g4=!0}}function Sye(t){let e;function n(l){l.preventDefault(),l.stopImmediatePropagation(),e=l.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0);let r=e.startContainer,o=e.startOffset,s=e.endContainer,i=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return El(a.node,a.offset,s,i)&&([r,o,s,i]=[s,i,r,o]),{anchorNode:r,anchorOffset:o,focusNode:s,focusOffset:i}}function Mye(t,e,n){let{node:r,fromOffset:o,toOffset:s,from:i,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],d0(l)||c.push({node:l.focusNode,offset:l.focusOffset})),jn&&t.input.lastKeyCode===8)for(let y=s;y>o;y--){let w=r.childNodes[y-1],x=w.pmViewDesc;if(w.nodeName=="BR"&&!x){s=y;break}if(!x||x.size)break}let d=t.state.doc,f=t.someProp("domParser")||nu.fromSchema(t.state.schema),h=d.resolve(i),p=null,g=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:Tye,context:h});if(c&&c[0].pos!=null){let y=c[0].pos,w=c[1]&&c[1].pos;w==null&&(w=y),p={anchor:y+i,head:w+i}}return{doc:g,sel:p,from:i,to:a}}function Tye(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(lr&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||lr&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Eye=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Aye(t,e,n,r,o){if(e<0){let T=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,A=vx(t,T);if(A&&!t.state.selection.eq(A)){if(jn&&_o&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",D=>D(t,Fa(13,"Enter"))))return;let N=t.state.tr.setSelection(A);T=="pointer"?N.setMeta("pointer",!0):T=="key"&&N.scrollIntoView(),t.composing&&N.setMeta("composition",t.input.compositionID),t.dispatch(N)}return}let s=t.state.doc.resolve(e),i=s.sharedDepth(n);e=s.before(i+1),n=t.state.doc.resolve(n).after(i+1);let a=t.state.selection,l=Mye(t,e,n),c=t.state.doc,u=c.slice(l.from,l.to),d,f;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(d=t.state.selection.to,f="end"):(d=t.state.selection.from,f="start"),t.input.lastKeyCode=null;let h=Nye(u.content,l.doc.content,l.from,d,f);if((su&&t.input.lastIOSEnter>Date.now()-225||_o)&&o.some(T=>T.nodeType==1&&!Eye.test(T.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",T=>T(t,Fa(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&a instanceof Ke&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))h={start:a.from,endA:a.to,endB:a.to};else{if(l.sel){let T=y4(t,t.state.doc,l.sel);if(T&&!T.eq(t.state.selection)){let A=t.state.tr.setSelection(T);t.composing&&A.setMeta("composition",t.input.compositionID),t.dispatch(A)}}return}if(jn&&t.cursorWrapper&&l.sel&&l.sel.anchor==t.cursorWrapper.deco.from&&l.sel.head==l.sel.anchor){let T=h.endB-h.start;l.sel={anchor:l.sel.anchor+T,head:l.sel.anchor+T}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof Ke&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=l.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=l.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),kr&&ta<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>l.from&&l.doc.textBetween(h.start-l.from-1,h.start-l.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let p=l.doc.resolveNoCache(h.start-l.from),g=l.doc.resolveNoCache(h.endB-l.from),y=c.resolve(h.start),w=p.sameParent(g)&&p.parent.inlineContent&&y.end()>=h.endA,x;if((su&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(T=>T.nodeName=="DIV"||T.nodeName=="P"))||!w&&p.pos<l.doc.content.size&&(x=je.findFrom(l.doc.resolve(p.pos+1),1,!0))&&x.head==g.pos)&&t.someProp("handleKeyDown",T=>T(t,Fa(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&Iye(c,h.start,h.endA,p,g)&&t.someProp("handleKeyDown",T=>T(t,Fa(8,"Backspace")))){_o&&jn&&t.domObserver.suppressSelectionUpdates();return}jn&&_o&&h.endB==h.start&&(t.input.lastAndroidDelete=Date.now()),_o&&!w&&p.start()!=g.start()&&g.parentOffset==0&&p.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==h.endA&&(h.endB-=2,g=l.doc.resolveNoCache(h.endB-l.from),setTimeout(()=>{t.someProp("handleKeyDown",function(T){return T(t,Fa(13,"Enter"))})},20));let C=h.start,v=h.endA,S,E,M;if(w){if(p.pos==g.pos)kr&&ta<=11&&p.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Zs(t),20)),S=t.state.tr.delete(C,v),E=c.resolve(h.start).marksAcross(c.resolve(h.endA));else if(h.endA==h.endB&&(M=Oye(p.parent.content.cut(p.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start()))))S=t.state.tr,M.type=="add"?S.addMark(C,v,M.mark):S.removeMark(C,v,M.mark);else if(p.parent.child(p.index()).isText&&p.index()==g.index()-(g.textOffset?0:1)){let T=p.parent.textBetween(p.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",A=>A(t,C,v,T)))return;S=t.state.tr.insertText(T,C,v)}}if(S||(S=t.state.tr.replace(C,v,l.doc.slice(h.start-l.from,h.endB-l.from))),l.sel){let T=y4(t,S.doc,l.sel);T&&!(jn&&_o&&t.composing&&T.empty&&(h.start!=h.endB||t.input.lastAndroidDelete<Date.now()-100)&&(T.head==C||T.head==S.mapping.map(v)-1)||kr&&T.empty&&T.head==C)&&S.setSelection(T)}E&&S.ensureMarks(E),t.composing&&S.setMeta("composition",t.input.compositionID),t.dispatch(S.scrollIntoView())}function y4(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:bx(t,e.resolve(n.anchor),e.resolve(n.head))}function Oye(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,s=r,i,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)s=n[u].removeFromSet(s);if(o.length==1&&s.length==0)a=o[0],i="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&s.length==1)a=s[0],i="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(ie.from(c).eq(t))return{mark:a,type:i}}function Iye(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||h1(r,!0,!1)<o.pos)return!1;let s=t.resolve(e);if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let i=t.resolve(h1(s,!0,!0));return!i.parent.isTextblock||i.pos>n||h1(i,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(i.parent.content)}function h1(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,o++}return o}function Nye(t,e,n,r,o){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:i,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,s-Math.min(i,a));r-=i+l-s}if(i<s&&t.size<e.size){let l=r<=s&&r>=i?s-r:0;s-=l,a=s+(a-i),i=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,i=s+(i-a),a=s}return{start:s,endA:i,endB:a}}class Lye{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Q0e,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(x4),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=w4(this),b4(this),this.nodeViews=k4(this),this.docView=e4(this.state.doc,v4(this),f1(this),this.dom,this),this.domObserver=new Cye(this,(r,o,s,i)=>Aye(this,r,o,s,i)),this.domObserver.start(),eye(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Jb(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(x4),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){let r=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(wO(this),s=!0),this.state=e;let i=r.plugins!=e.plugins||this._props.plugins!=n.plugins;if(i||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=k4(this);$ye(f,this.nodeViews)&&(this.nodeViews=f,o=!0)}(i||n.handleDOMEvents!=this._props.handleDOMEvents)&&Jb(this),this.editable=w4(this),b4(this);let a=f1(this),l=v4(this),c=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",u=o||!this.docView.matchesNode(e.doc,l,a);(u||!e.selection.eq(r.selection))&&(s=!0);let d=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&y0e(this);if(s){this.domObserver.stop();let f=u&&(kr||jn)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&Rye(r.selection,e.selection);if(u){let h=jn?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(e.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=e4(e.doc,l,a,this.dom,this)),h&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&z0e(this))?Zs(this,f):(iO(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&v0e(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Be){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&GS(this,n.getBoundingClientRect(),e)}else GS(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let i=0;i<this.directPlugins.length;i++){let a=this.directPlugins[i].props[e];if(a!=null&&(o=n?n(a):a))return o}let s=this.state.plugins;if(s)for(let i=0;i<s.length;i++){let a=s[i].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(kr){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&b0e(this.dom),Zs(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}posAtCoords(e){return _0e(this,e)}coordsAtPos(e,n=1){return Z9(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return A0e(this,n||this.state,e)}pasteHTML(e,n){return Lf(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Lf(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(tye(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],f1(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return rye(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return lr&&this.root.nodeType===11&&u0e(this.dom.ownerDocument)==this.dom?Sye(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function v4(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[gr.node(0,t.state.doc.content.size,e)]}function b4(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:gr.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function w4(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Rye(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function k4(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function $ye(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function x4(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var da={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},rg={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Dye=typeof navigator<"u"&&/Mac/.test(navigator.platform),Pye=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Tn=0;Tn<10;Tn++)da[48+Tn]=da[96+Tn]=String(Tn);for(var Tn=1;Tn<=24;Tn++)da[Tn+111]="F"+Tn;for(var Tn=65;Tn<=90;Tn++)da[Tn]=String.fromCharCode(Tn+32),rg[Tn]=String.fromCharCode(Tn);for(var p1 in da)rg.hasOwnProperty(p1)||(rg[p1]=da[p1]);function Hye(t){var e=Dye&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Pye&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?rg:da)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Bye=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Fye(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,s,i;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))Bye?i=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),i&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function jye(t){let e=Object.create(null);for(let n in t)e[Fye(n)]=t[n];return e}function m1(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function zye(t){return new Gn({props:{handleKeyDown:Mx(t)}})}function Mx(t){let e=jye(t);return function(n,r){let o=Hye(r),s,i=e[m1(o,r)];if(i&&i(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[m1(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(s=da[r.keyCode])&&s!=o){let a=e[m1(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Vye=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Uye(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset>0?null:n}const qye=(t,e,n)=>{let r=Uye(t);if(!r)return!1;let o=SO(r);if(!o){let i=r.blockRange(),a=i&&Ou(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}let s=o.nodeBefore;if(!s.type.spec.isolating&&EO(t,o,e))return!0;if(r.parent.content.size==0&&(au(s,"end")||Be.isSelectable(s))){let i=mx(t.doc,r.before(),r.after(),we.empty);if(i&&i.slice.size<i.to-i.from){if(e){let a=t.tr.step(i);a.setSelection(au(s,"end")?je.findFrom(a.doc.resolve(a.mapping.map(o.pos,-1)),-1):Be.create(a.doc,o.pos-s.nodeSize)),e(a.scrollIntoView())}return!0}}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1};function au(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Wye=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(r.parentOffset>0)return!1;s=SO(r)}let i=s&&s.nodeBefore;return!i||!Be.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Be.create(t.doc,s.pos-i.nodeSize)).scrollIntoView()),!0)};function SO(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Kye(t,e){let{$cursor:n}=t.selection;return!n||n.parentOffset<n.parent.content.size?null:n}const Gye=(t,e,n)=>{let r=Kye(t);if(!r)return!1;let o=MO(r);if(!o)return!1;let s=o.nodeAfter;if(EO(t,o,e))return!0;if(r.parent.content.size==0&&(au(s,"start")||Be.isSelectable(s))){let i=mx(t.doc,r.before(),r.after(),we.empty);if(i&&i.slice.size<i.to-i.from){if(e){let a=t.tr.step(i);a.setSelection(au(s,"start")?je.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):Be.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),!0):!1},Jye=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(r.parentOffset<r.parent.content.size)return!1;s=MO(r)}let i=s&&s.nodeAfter;return!i||!Be.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Be.create(t.doc,s.pos)).scrollIntoView()),!0)};function MO(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Yye=(t,e)=>{let n=t.selection,r=n instanceof Be,o;if(r){if(n.node.isTextblock||!ba(t.doc,n.from))return!1;o=n.from}else if(o=P9(t.doc,n.from,-1),o==null)return!1;if(e){let s=t.tr.join(o);r&&s.setSelection(Be.create(s.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},Xye=(t,e)=>{let n=t.selection,r;if(n instanceof Be){if(n.node.isTextblock||!ba(t.doc,n.to))return!1;r=n.to}else if(r=P9(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Zye=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),s=o&&Ou(o);return s==null?!1:(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)},Qye=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
113`).scrollIntoView()),!0)};function TO(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const e1e=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),i=TO(o.contentMatchAt(s));if(!i||!o.canReplaceWith(s,s,i))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,i.createAndFill());l.setSelection(je.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},t1e=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Io||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=TO(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let i=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(i,s.createAndFill());a.setSelection(Ke.create(a.doc,i+1)),e(a.scrollIntoView())}return!0},n1e=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Sc(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Ou(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},r1e=(t,e)=>{let{$from:n,to:r}=t.selection,o,s=n.sharedDepth(r);return s==0?!1:(o=n.before(s),e&&e(t.tr.setSelection(Be.create(t.doc,o))),!0)};function o1e(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,s=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(o.isTextblock||ba(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function EO(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,s,i;if(r.type.spec.isolating||o.type.spec.isolating)return!1;if(o1e(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(s=(i=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&i.matchType(s[0]||o.type).validEnd){if(n){let d=e.pos+o.nodeSize,f=ie.empty;for(let g=s.length-1;g>=0;g--)f=ie.from(s[g].create(null,f));f=ie.from(r.copy(f));let h=t.tr.step(new hn(e.pos-1,d,e.pos,d,new we(f,1,0),s.length,!0)),p=d+2*s.length;ba(h.doc,p)&&h.join(p),n(h.scrollIntoView())}return!0}let l=je.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&Ou(c);if(u!=null&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&au(o,"start",!0)&&au(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let h=o,p=1;for(;!h.isTextblock;h=h.firstChild)p++;if(d.canReplace(d.childCount,d.childCount,h.content)){if(n){let g=ie.empty;for(let w=f.length-1;w>=0;w--)g=ie.from(f[w].copy(g));let y=t.tr.step(new hn(e.pos-f.length,e.pos+o.nodeSize,e.pos+p,e.pos+o.nodeSize-p,new we(g,f.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function AO(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(e.tr.setSelection(Ke.create(e.doc,t<0?o.start(s):o.end(s)))),!0):!1}}const s1e=AO(-1),i1e=AO(1);function a1e(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),a=i&&px(i,t,e);return a?(r&&r(n.tr.wrap(i,a).scrollIntoView()),!0):!1}}function C4(t,e=null){return function(n,r){let o=!1;for(let s=0;s<n.selection.ranges.length&&!o;s++){let{$from:{pos:i},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(i,a,(l,c)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let s=n.tr;for(let i=0;i<n.selection.ranges.length;i++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[i];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function l1e(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),a=!1,l=i;if(!i)return!1;if(i.depth>=2&&o.node(i.depth-1).type.compatibleContent(t)&&i.startIndex==0){if(o.index(i.depth-1)==0)return!1;let u=n.doc.resolve(i.start-2);l=new Ym(u,u,i.depth),i.endIndex<i.parent.childCount&&(i=new Ym(o,n.doc.resolve(s.end(i.depth)),i.depth)),a=!0}let c=px(l,t,e,i);return c?(r&&r(c1e(n.tr,i,c,a,t).scrollIntoView()),!0):!1}}function c1e(t,e,n,r,o){let s=ie.empty;for(let u=n.length-1;u>=0;u--)s=ie.from(n[u].type.create(n[u].attrs,s));t.step(new hn(e.start-(r?2:0),e.end,e.start,e.end,new we(s,0,0),n.length,!0));let i=0;for(let u=0;u<n.length;u++)n[u].type==o&&(i=u+1);let a=n.length-i,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&Sc(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function u1e(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,i=>i.childCount>0&&i.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?d1e(e,n,t,s):f1e(e,n,s):!0:!1}}function d1e(t,e,n,r){let o=t.tr,s=r.end,i=r.$to.end(r.depth);s<i&&(o.step(new hn(s-1,i,s,i,new we(ie.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ym(o.doc.resolve(r.$from.pos),o.doc.resolve(i),r.depth));const a=Ou(r);if(a==null)return!1;o.lift(r,a);let l=o.mapping.map(s,-1)-1;return ba(o.doc,l)&&o.join(l),e(o.scrollIntoView()),!0}function f1e(t,e,n){let r=t.tr,o=n.parent;for(let h=n.end,p=n.endIndex-1,g=n.startIndex;p>g;p--)h-=o.child(p).nodeSize,r.delete(h-1,h+1);let s=r.doc.resolve(n.start),i=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(a?0:1),u+1,i.content.append(l?ie.empty:ie.from(o))))return!1;let d=s.pos,f=d+i.nodeSize;return r.step(new hn(d-(a?1:0),f+(l?1:0),d+1,f-1,new we((a?ie.empty:ie.from(o.copy(ie.empty))).append(l?ie.empty:ie.from(o.copy(ie.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function h1e(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let i=s.startIndex;if(i==0)return!1;let a=s.parent,l=a.child(i-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=ie.from(c?t.create():null),d=new we(ie.from(t.create(null,ie.from(a.type.create(null,u)))),c?3:1,0),f=s.start,h=s.end;n(e.tr.step(new hn(f-(c?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}function m0(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:s}=n;
vendor: 4,972 bytes, line 113
113return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}class g0{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:s}=r,i=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>{const u=l(...c)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(s),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:s}=this,{view:i}=o,a=[],l=!!e,c=e||s.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(c),a.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...p)=>{const g=this.buildProps(c,n),y=h(...p)(g);return a.push(y),d}])),run:u};return d}createCan(e){const{rawCommands:n,state:r}=this,o=!1,s=e||r.tr,i=this.buildProps(s,o);return{...Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...c)=>l(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(s,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:s}=this,{view:i}=o;s.storedMarks&&e.setStoredMarks(s.storedMarks);const a={tr:e,editor:o,view:i,state:m0({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class p1e{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function Ae(t,e,n){return t.config[e]===void 0&&t.parent?Ae(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Ae(t.parent,e,n):null}):t.config[e]}function y0(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function OO(t){const e=[],{nodeExtensions:n,markExtensions:r}=y0(t),o=[...n,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage},l=Ae(i,"addGlobalAttributes",a);l&&l().forEach(c=>{c.types.forEach(u=>{Object.entries(c.attributes).forEach(([d,f])=>{e.push({type:u,name:d,attribute:{...s,...f}})})})})}),o.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage},l=Ae(i,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,d])=>{const f={...s,...d};typeof f?.default=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&f?.default===void 0&&delete f.default,e.push({type:i.name,name:u,attribute:f})})}),e}function vn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function $t(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,s])=>{if(!r[o]){r[o]=s;return}o==="class"?r[o]=[r[o],s].join(" "):o==="style"?r[o]=[r[o],s].join("; "):r[o]=s}),r},{})}function Yb(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>$t(n,r),{})}function IO(t){return typeof t=="function"}function tt(t,e=void 0,...n){return IO(t)?e?t.bind(e)(...n):t(...n):t}function m1e(t={}){return Object.keys(t).length===0&&t.constructor===Object}function g1e(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function _4(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((s,i)=>{const a=i.attribute.parseHTML?i.attribute.parseHTML(n):g1e(n.getAttribute(i.name));return a==null?s:{...s,[i.name]:a}},{});return{...r,...o}}}}function S4(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&m1e(n)?!1:n!=null))}function y1e(t,e){var n;const r=OO(t),{nodeExtensions:o,markExtensions:s}=y0(t),i=(n=o.find(c=>Ae(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(o.map(c=>{const u=r.filter(w=>w.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((w,x)=>{const C=Ae(x,"extendNodeSchema",d);return{...w,...C?C(c):{}}
113},{}),h=S4({...f,content:tt(Ae(c,"content",d)),marks:tt(Ae(c,"marks",d)),group:tt(Ae(c,"group",d)),inline:tt(Ae(c,"inline",d)),atom:tt(Ae(c,"atom",d)),selectable:tt(Ae(c,"selectable",d)),draggable:tt(Ae(c,"draggable",d)),code:tt(Ae(c,"code",d)),defining:tt(Ae(c,"defining",d)),isolating:tt(Ae(c,"isolating",d)),attrs:Object.fromEntries(u.map(w=>{var x;return[w.name,{default:(x=w?.attribute)===null||x===void 0?void 0:x.default}]}))}),p=tt(Ae(c,"parseHTML",d));p&&(h.parseDOM=p.map(w=>_4(w,u)));const g=Ae(c,"renderHTML",d);g&&(h.toDOM=w=>g({node:w,HTMLAttributes:Yb(w,u)}));const y=Ae(c,"renderText",d);return y&&(h.toText=y),[c.name,h]})),l=Object.fromEntries(s.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,w)=>{const x=Ae(w,"extendMarkSchema",d);return{...y,...x?x(c):{}}},{}),h=S4({...f,inclusive:tt(Ae(c,"inclusive",d)),excludes:tt(Ae(c,"excludes",d)),group:tt(Ae(c,"group",d)),spanning:tt(Ae(c,"spanning",d)),code:tt(Ae(c,"code",d)),attrs:Object.from
113Entries(u.map(y=>{var w;return[y.name,{default:(w=y?.attribute)===null||w===void 0?void 0:w.default}]}))}),p=tt(Ae(c,"parseHTML",d));p&&(h.parseDOM=p.map(y=>_4(y,u)));const g=Ae(c,"renderHTML",d);return g&&(h.toDOM=y=>g({mark:y,HTMLAttributes:Yb(y,u)})),[c.name,h]}));return new Age({topNode:i,nodes:a,marks:l})}function g1(t,e){return e.nodes[t]||e.marks[t]||null}function M4(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const v1e=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,i,a)=>{var l,c;const u=((c=(l=o.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:o,pos:s,parent:i,index:a}))||o.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-s))}),n};function Tx(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class v0{constructor(e){this.find=e.find,this.handler=e.handler}}const b1e=(t,e)=>{if(Tx(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function y1(t){var e;const{editor:n,from:r,to:o,text:s,rules:i,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=v1e(c)+s;return i.forEach(f=>{if(u)return;const h=b1e(d,f.find);if(!h)return;const p=l.state.tr,g=m0({state:l.state,transaction:p}),y={from:r-(h[0].length-s.length),to:o},{commands:w,chain:x,can:C}=new g0({editor:n,state:g});f.handler({state:g,range:y,match:h,commands:w,chain:x,can:C})===null||!p.steps.length||(p.setMeta(a,{transform:p,from:r,to:o,text:s}),l.dispatch(p),u=!0)}),u}function w1e(t){const{editor:e,rules:n}=t,r=new Gn({state:{init(){return null},apply(o,s){return o.getMeta(r)||(o.selectionSet||o.docChanged?null:s)}},props:{handleTextInput(o,s,i,a){return y1({editor:e,from:s,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:s}=o.state.selection;s&&y1({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,s){if(s.key!=="Enter")return!1;const{$cursor:i}=o.state.selection;return i?y1({editor:e,from:i.pos,to:i.pos,text:`
114`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function k1e(t){return typeof t=="number"}class x1e{constructor(e){this.find=e.find,this.handler=e.handler}}const C1e=(t,e)=>{if(Tx(e))return[...t.matchAll(e)];const n=e(t);return n?n.map(r=>{const o=[r.text];return o.index=r.index,o.input=t,o.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(r.replaceWith)),o}):[]};function _1e(t){const{editor:e,state:n,from:r,to:o,rule:s}=t,{commands:i,chain:a,can:l}=new g0({editor:e,state:n}),c=[];return n.doc.nodesBetween(r,o,(u,d)=>{if(!u.isTextblock||u.type.spec.code)return;const f=Math.max(r,d),h=Math.min(o,d+u.content.size),p=u.textBetween(f-d,h-d,void 0,"");C1e(p,s.find).forEach(g=>{if(g.index===void 0)return;const y=f+g.index+1,w=y+g[0].length,x={from:n.tr.mapping.map(y),to:n.tr.mapping.map(w)},C=s.handler({state:n,range:x,match:g,commands:i,chain:a,can:l});c.push(C)})}),c.every(u=>u!==null)}function S1e(t){const{editor:e,rules:n}=t;let r=null,o=!1,s=!1;return n.map(i=>new Gn({view(a){const l=c=>{var u;r=!((u=a.dom.parentElement)===null||u===void 0)&&u.contains(c.target)?a.dom.parentElement:null};return window.addEventListener("dragstart",l),{destroy(){window.removeEventListener("dragstart",l)}}},props:{handleDOMEvents:{drop:a=>(s=r===a.dom.parentElement,!1),paste:(a,l)=>{var c;const u=(c=l.clipboardData)===null||c===void 0?void 0:c.getData("text/html");return o=!!(u!=null&&u.includes("data-pm-slice")),!1}}},appendTransaction:(a,l,c)=>{const u=a[0],d=u.getMeta("uiEvent")==="paste"&&!o,f=u.getMeta("uiEvent")==="drop"&&!s;if(!d&&!f)return;const h=l.doc.content.findDiffStart(c.doc.content),p=l.doc.content.findDiffEnd(c.doc.content);if(!k1e(h)||!p||h===p.b)return;const g=c.tr,y=m0({state:c,transaction:g});if(!(!_1e({editor:e,state:y,from:Math.max(h-1,0),to:p.b-1,rule:i})||!g.steps.length))return g}}))}function M1e(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}class cc{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=cc.resolve(e),this.schema=y1e(this.extensions,n),this.extensions.forEach(r=>{var o;this.editor.extensionStorage[r.name]=r.storage;const s={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:g1(r.name,this.schema)};r.type==="mark"&&(!((o=tt(Ae(r,"keepOnSplit",s)))!==null&&o!==void 0)||o)&&this.splittableMarks.push(r.name);const i=Ae(r,"onBeforeCreate",s);i&&this.editor.on("beforeCreate",i);const a=Ae(r,"onCreate",s);a&&this.editor.on("create",a);const l=Ae(r,"onUpdate",s);l&&this.editor.on("update",l);const c=Ae(r,"onSelectionUpdate",s);c&&this.editor.on("selectionUpdate",c);const u=Ae(r,"onTransaction",s);u&&this.editor.on("transaction",u);const d=Ae(r,"onFocus",s);d&&this.editor.on("focus",d);const f=Ae(r,"onBlur",s);f&&this.editor.on("blur",f);const h=Ae(r,"onDestroy",s);h&&this.editor.on("destroy",h)})}static resolve(e){const n=cc.sort(cc.flatten(e)),r=M1e(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=Ae(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(e){return e.sort((n,r)=>{const o=Ae(n,"priority")||100,s=Ae(r,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:g1(n.name,this.schema)},o=Ae(n,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,n=cc.sort([...this.extensions].reverse()),r=[],o=[],s=n.map(i=>{const a={name:i.name,options:i.options,storage:i.storage,editor:e,type:g1(i.name,this.schema)},l=[],c=Ae(i,"addKeyboardShortcuts",a);let u={};if(i.type==="mark"&&i.config.exitable&&(u.ArrowRight=()=>Bo.handleExit({editor:e,mark:i})),c){const g=Object.fromEntries(Object.entries(c()).map(([y,w])=>[y,()=>w({editor:e})]));u={...u,...g}}const d=zye(u);l.push(d);const f=Ae(i,"addInputRules",a);M4(i,e.options.enableInputRules)&&f&&r.push(...f());const h=Ae(i,"addPasteRules",a);M4(i,e.options.enablePasteRules)&&h&&o.push(...h());const p=Ae(i,"addProseMirrorPlugins",a);if(p){const g=p();l.push(...g)}return l}).flat();return[w1e({editor:e,rules:r}),...S1e({editor:e,rules:o}),...s]}get attributes(){return OO(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=y0(this.extensions);return Object.fromEntries(n.filter(r=>!!Ae(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:vn(r.name,this.schema)},i=Ae(r,"addNodeView",s);if(!i)return[];const a=(l,c,u,d)=>{const f=Yb(l,o);return i()({editor:e,node:l,getPos:u,decorations:d,HTMLAttributes:f,extension:r})};return[r.name,a]}
114))}}function T1e(t){return Object.prototype.toString.call(t).slice(8,-1)}function v1(t){return T1e(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function b0(t,e){const n={...t};return v1(t)&&v1(e)&&Object.keys(e).forEach(r=>{v1(e[r])?r in t?n[r]=b0(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}class qn{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=tt(Ae(this,"addOptions",{name:this.name}))),this.storage=tt(Ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qn(e)}configure(e={}){const n=this.extend();return n.options=b0(this.options,e),n.storage=tt(Ae(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new qn(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=tt(Ae(n,"addOptions",{name:n.name})),n.storage=tt(Ae(n,"addStorage",{name:n.name,options:n.options})),n}}function NO(t,e,n){const{from:r,to:o}=e,{blockSeparator:s=`
115
116`,textSerializers:i={}}=n||{};let a="",l=!0;return t.nodesBetween(r,o,(c,u,d,f)=>{var h;const p=i?.[c.type.name];p?(c.isBlock&&!l&&(a+=s,l=!0),d&&(a+=p({node:c,pos:u,parent:d,index:f,range:e}))):c.isText?(a+=(h=c?.text)===null||h===void 0?void 0:h.slice(Math.max(r,u)-u,o-u),l=!1):c.isBlock&&!l&&(a+=s,l=!0)}),a}function LO(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const E1e=qn.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Gn({key:new Ur("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:s}=o,i=Math.min(...s.map(c=>c.$from.pos)),a=Math.max(...s.map(c=>c.$to.pos)),l=LO(n);return NO(r,{from:i,to:a},{textSerializers:l})}}})]}}),A1e=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),O1e=(t=!1)=>({commands:e})=>e.setContent("",t),I1e=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:s,$to:i})=>{t.doc.nodesBetween(s.pos,i.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),f=c.resolve(u.map(l+a.nodeSize)),h=d.blockRange(f);if(!h)return;const p=Ou(h);if(a.type.isTextblock){const{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(h.start,g)}(p||p===0)&&e.lift(h,p)})}),!0},N1e=t=>e=>t(e),L1e=()=>({state:t,dispatch:e})=>t1e(t,e),R1e=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(e){const i=o.before(s),a=o.after(s);t.delete(i,a).scrollIntoView()}return!0}return!1},$1e=t=>({tr:e,state:n,dispatch:r})=>{const o=vn(t,n.schema),s=e.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===o){if(r){const a=s.before(i),l=s.after(i);e.delete(a,l).scrollIntoView()}return!0}return!1},D1e=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},P1e=()=>({state:t,dispatch:e})=>Vye(t,e),H1e=()=>({commands:t})=>t.keyboardShortcut("Enter"),B1e=()=>({state:t,dispatch:e})=>e1e(t,e);function og(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Tx(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function Xb(t,e,n={}){return t.find(r=>r.type===e&&og(r.attrs,n))}function F1e(t,e,n={}){return!!Xb(t,e,n)}function Ex(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=Xb([...r.node.marks],e,n);if(!o)return;let s=r.index,i=t.start()+r.offset,a=s+1,l=i+r.node.nodeSize;
116for(Xb([...r.node.marks],e,n);s>0&&o.isInSet(t.parent.child(s-1).marks);)s-=1,i-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&F1e([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:i,to:l}}function ka(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const j1e=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const s=ka(t,r.schema),{doc:i,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const d=Ex(l,s,e);if(d&&d.from<=c&&d.to>=u){const f=Ke.create(i,d.from,d.to);n.setSelection(f)}}return!0},z1e=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Ax(t){return t instanceof Ke}function Ws(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function RO(t,e=null){if(!e)return null;const n=je.atStart(t),r=je.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,s=r.to;return e==="all"?Ke.create(t,Ws(0,o,s),Ws(t.content.size,o,s)):Ke.create(t,Ws(e,o,s),Ws(e,o,s))}function Ox(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const V1e=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{Ox()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!Ax(n.state.selection))return i(),!0;const a=RO(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),i()),!0},U1e=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),q1e=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e);function T4(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function sg(t,e,n){if(n={slice:!0,parseOptions:{},...n},typeof t=="object"&&t!==null)try{return Array.isArray(t)&&t.length>0?ie.fromArray(t.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),sg("",e,n)}if(typeof t=="string"){const r=nu.fromSchema(e);return n.slice?r.parseSlice(T4(t),n.parseOptions).content:r.parse(T4(t),n.parseOptions)}return sg("",e,n)}function W1e(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof Bn||o instanceof hn))return;const s=t.mapping.maps[r];let i=0;s.forEach((a,l,c,u)=>{i===0&&(i=u)}),t.setSelection(je.near(t.doc.resolve(i),n))}const K1e=t=>t.toString().startsWith("<"),G1e=(t,e,n)=>({tr:r,dispatch:o,editor:s})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const i=sg(e,s.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(i.toString()==="<>")return!0;let{from:a,to:l}=typeof t=="number"?{from:t,to:t}:t,c=!0,u=!0;if((K1e(i)?i:[i]).forEach(d=>{d.check(),c=c?d.isText&&d.marks.length===0:!1,u=u?d.isBlock:!1}),a===l&&u){const{parent:d}=r.doc.resolve(a);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(a-=1,l+=1)}c?Array.isArray(e)?r.insertText(e.map(d=>d.text||"").join(""),a,l):typeof e=="object"&&e&&e.text?r.insertText(e.text,a,l):r.insertText(e,a,l):r.replaceWith(a,l,i),n.updateSelection&&W1e(r,r.steps.length-1,-1)}return!0},J1e=()=>({state:t,dispatch:e})=>Yye(t,e),Y1e=()=>({state:t,dispatch:e})=>Xye(t,e),X1e=()=>({state:t,dispatch:e})=>qye(t,e),Z1e=()=>({state:t,dispatch:e})=>Gye(t,e);function $O(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Q1e(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,s,i;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))Ox()||$O()?i=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),i&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const eve=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const s=Q1e(t).split(/-(?!$)/),i=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l?.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function $f(t,e,n={}){const{from:r,to:o,empty:s}=t.selection,i=e?vn(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(u,d)=>{if(u.isText)return;const f=Math.max(r,d),h=Math.min(o,d+u.nodeSize);a.push({node:u,from:f,to:h})});const l=o-r,c=a.filter(u=>
vendor: 4,114 bytes, line 116
116i?i.name===u.node.type.name:!0).filter(u=>og(u.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((u,d)=>u+d.to-d.from,0)>=l}const tve=(t,e={})=>({state:n,dispatch:r})=>{const o=vn(t,n.schema);return $f(n,o,e)?Zye(n,r):!1},nve=()=>({state:t,dispatch:e})=>n1e(t,e),rve=t=>({state:e,dispatch:n})=>{const r=vn(t,e.schema);return u1e(r)(e,n)},ove=()=>({state:t,dispatch:e})=>Qye(t,e);function w0(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function E4(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const sve=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const a=w0(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=vn(t,r.schema)),a==="mark"&&(i=ka(t,r.schema)),o&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{s&&s===c.type&&n.setNodeMarkup(u,void 0,E4(c.attrs,e)),i&&c.marks.length&&c.marks.forEach(d=>{i===d.type&&n.addMark(u,u+c.nodeSize,i.create(E4(d.attrs,e)))})})}),!0):!1},ive=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),ave=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),lve=()=>({state:t,dispatch:e})=>Wye(t,e),cve=()=>({state:t,dispatch:e})=>Jye(t,e),uve=()=>({state:t,dispatch:e})=>r1e(t,e),dve=()=>({state:t,dispatch:e})=>i1e(t,e),fve=()=>({state:t,dispatch:e})=>s1e(t,e);function DO(t,e,n={}){return sg(t,e,{slice:!1,parseOptions:n})}const hve=(t,e=!1,n={})=>({tr:r,editor:o,dispatch:s})=>{const{doc:i}=r,a=DO(t,o.schema,n);return s&&r.replaceWith(0,i.content.size,a).setMeta("preventUpdate",!e),!0};function pve(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function PO(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Ix(t){return e=>PO(e.$from,t)}function mve(t,e){const n=ns.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function gve(t,e){const n={from:0,to:t.content.size};return NO(t,n,e)}function k0(t,e){const n=ka(e,t.schema),{from:r,to:o,empty:s}=t.selection,i=[];s?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{i.push(...l.marks)});const a=i.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function yve(t,e){const n=vn(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,a=>{s.push(a)});const i=s.reverse().find(a=>a.type.name===n.name);return i?{...i.attrs}:{}}function vve(t,e){const n=w0(typeof e=="string"?e:e.name,t.schema);return n==="node"?yve(t,e):n==="mark"?k0(t,e):{}}function HO(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const s=n.resolve(t-1),i=Ex(s,o.type);i&&r.push({mark:o,...i})}):n.nodesBetween(t,e,(o,s)=>{r.push(...o.marks.map(i=>({from:s,to:s+o.nodeSize,mark:i})))}),r}function $p(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}function Zb(t,e,n={}){const{empty:r,ranges:o}=t.selection,s=e?ka(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>s?s.name===u.type.name:!0).find(u=>og(u.attrs,n,{strict:!1}));let i=0;const a=[];if(o.forEach(({$from:u,$to:d})=>{const f=u.pos,h=d.pos;t.doc.nodesBetween(f,h,(p,g)=>{if(!p.isText&&!p.marks.length)return;const y=Math.max(f,g),w=Math.min(h,g+p.nodeSize),x=w-y;i+=x,a.push(...p.marks.map(C=>({mark:C,from:y,to:w})))})}),i===0)return!1;const l=a.filter(u=>s?s.name===u.mark.type.name:!0).filter(u=>og(u.mark.attrs,n,{strict:!1})).reduce((u,d)=>u+d.to-d.from,0),c=a.filter(u=>s?u.mark.type!==s&&u.mark.type.excludes(s):!0).reduce((u,d)=>u+d.to-d.from,0);return(l>0?l+c:l)>=i}function bve(t,e,n={}){if(!e)return $f(t,null,n)||Zb(t,null,n);const r=w0(e,t.schema);return r==="node"?$f(t,e,n):r==="mark"?Zb(t,e,n):!1}function A4(t,e){const{nodeExtensions:n}=y0(e),r=n.find(i=>i.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},s=tt(Ae(r,"group",o));
116return typeof s!="string"?!1:s.split(" ").includes("list")}function wve(t){var e;const n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function kve(t){return t instanceof Be}function BO(t,e,n){const r=t.state.doc.content.size,o=Ws(e,0,r),s=Ws(n,0,r),i=t.coordsAtPos(o),a=t.coordsAtPos(s,-1),l=Math.min(i.top,a.top),c=Math.max(i.bottom,a.bottom),u=Math.min(i.left,a.left),d=Math.max(i.right,a.right),f=d-u,h=c-l,p={top:l,bottom:c,left:u,right:d,width:f,height:h,x:u,y:l};return{...p,toJSON:()=>p}}function xve(t,e,n){var r;const{selection:o}=e;let s=null;if(Ax(o)&&(s=o.$cursor),s){const a=(r=t.storedMarks)!==null&&r!==void 0?r:s.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:i}=o;return i.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(n),p=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=h&&p}return!c}),c})}const Cve=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:i,ranges:a}=s,l=ka(t,r.schema);if(o)if(i){const c=k0(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,h)=>{const p=Math.max(h,u),g=Math.min(h+f.nodeSize,d);f.marks.find(y=>y.type===l)?f.marks.forEach(y=>{l===y.type&&n.addMark(p,g,l.create({...y.attrs,...e}))}):n.addMark(p,g,l.create(e))})});return xve(r,n,l)},_ve=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Sve=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const s=vn(t,n.schema);return s.isTextblock?o().command(({commands:i})=>C4(s,e)(n)?!0:i.clearNodes()).command(({state:i})=>C4(s,e)(i,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Mve=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Ws(t,0,r.content.size),s=Be.create(r,o);e.setSelection(s)}return!0},Tve=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:s}=typeof t=="number"?{from:t,to:t}:t,i=Ke.atStart(r).from,a=Ke.atEnd(r).to,l=Ws(o,i,a),c=Ws(s,i,a),u=Ke.create(r,l,c);e.setSelection(u)}return!0},Eve=t=>({state:e,dispatch:n})=>{const r=vn(t,e.schema);return h1e(r)(e,n)};function O4(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}}const Ave=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:i}=e,{$from:a,$to:l}=s,c=o.extensionManager.attributes,u=$p(c,a.node().type.name,a.node().attrs);if(s instanceof Be&&s.node.isBlock)return!a.parentOffset||!Sc(i,a.pos)?!1:(r&&(t&&O4(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const d=l.parentOffset===l.parent.content.size;s instanceof Ke&&e.deleteSelection();const f=a.depth===0?void 0:pve(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=d&&f?[{type:f,attrs:u}]:void 0,p=Sc(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&Sc(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(p=!0,h=f?[{type:f,attrs:u}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,h),f&&!d&&!a.parentOffset&&a.parent.type!==f)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&O4(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},Ove=t=>({tr:e,state:n,dispatch:r,editor:o})=>{var s;const i=vn(t,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==i)return!1;const d=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==i||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let y=ie.empty;const w=a.index(-1)?1:a.index(-2)?2:3;for(let M=a.depth-w;M>=a.depth-3;M-=1)y=ie.from(a.node(M).copy(y));const x=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,C=$p(d,a.node().type.name,a.node().attrs),v=((s=i.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(C))||void 0;y=y.append(ie.from(i.createAndFill(null,v)||void 0));const S=a.before(a.depth-(w-1));e.replace(S,a.after(-x),new we(y,4-w,0));let E=-1;e.doc.nodesBetween(S,e.doc.content.size,(M,T)=>{if(E>-1)return!1;M.isTextblock&&M.content.size===0&&(E=T+1)}),E>-1&&e.setSelection(Ke.near(e.doc.resolve(E))),e.scrollIntoView()}return!0}const f=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,h=$p(d,u.type.name,u.attrs),p=$p(d,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const g=f?[{type:i,attrs:h},{type:f,attrs:p}]:[{type:i,attrs:h}];if(!Sc(e.doc,a.pos,2))return!1;if(r){const{selection:y,storedMarks:w}=n,{splittableMarks:x}=o.extensionManager,C=w||y.$to.parentOffset&&y.$from.marks();if(e.split(a.pos,2,g).scrollIntoView(),!C||!r)return!0;const v=C.filter(S=>x.includes(S.type.name));e.ensureMarks(v)}return!0},b1=(t,e)=>{const n=Ix(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&ba(t.doc,n.pos)&&t.join(n.pos),!0},w1=(t,e)=>{const n=Ix(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&ba(t.doc,r)&&t.join(r),!0},Ive=(t,e,n,r={})=>({editor:o,tr:s,state:i,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=o.extensionManager,h=vn(t,i.schema),p=vn(e,i.schema),{selection:g,storedMarks:y}=i,{$from:w,$to:x}=g,C=w.blockRange(x),v=y||g.$to.parentOffset&&g.$from.marks();if(!C)return!1;const S=Ix(E=>A4(E.type.name,d))(g);if(C.depth>=1&&S&&C.depth-S.depth<=1){if(S.node.type===h)return c.liftListItem(p);
vendor: 5,259 bytes, line 116
116if(A4(S.node.type.name,d)&&h.validContent(S.node.content)&&a)return l().command(()=>(s.setNodeMarkup(S.pos,h),!0)).command(()=>b1(s,h)).command(()=>w1(s,h)).run()}return!n||!v||!a?l().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>b1(s,h)).command(()=>w1(s,h)).run():l().command(()=>{const E=u().wrapInList(h,r),M=v.filter(T=>f.includes(T.type.name));return s.ensureMarks(M),E?!0:c.clearNodes()}).wrapInList(h,r).command(()=>b1(s,h)).command(()=>w1(s,h)).run()},Nve=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,i=ka(t,r.schema);return Zb(r,i,e)?o.unsetMark(i,{extendEmptyMarkRange:s}):o.setMark(i,e)},Lve=(t,e,n={})=>({state:r,commands:o})=>{const s=vn(t,r.schema),i=vn(e,r.schema);return $f(r,s,n)?o.setNode(i):o.setNode(s,n)},Rve=(t,e={})=>({state:n,commands:r})=>{const o=vn(t,n.schema);return $f(n,o,e)?r.lift(o):r.wrapIn(o,e)},$ve=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let s;if(o.spec.isInputRules&&(s=o.getState(t))){if(e){const i=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)i.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=i.doc.resolve(s.from).marks();i.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else i.delete(s.from,s.to)}return!0}}return!1},Dve=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},Pve=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=n,l=ka(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!o)return!0;if(u&&i){let{from:f,to:h}=a;const p=(s=c.marks().find(y=>y.type===l))===null||s===void 0?void 0:s.attrs,g=Ex(c,l,p);g&&(f=g.from,h=g.to),n.removeMark(f,h,l)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},Hve=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const a=w0(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=vn(t,r.schema)),a==="mark"&&(i=ka(t,r.schema)),o&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(d,f)=>{s&&s===d.type&&n.setNodeMarkup(f,void 0,{...d.attrs,...e}),i&&d.marks.length&&d.marks.forEach(h=>{if(i===h.type){const p=Math.max(f,c),g=Math.min(f+d.nodeSize,u);n.addMark(p,g,i.create({...h.attrs,...e}))}})})}),!0):!1},Bve=(t,e={})=>({state:n,dispatch:r})=>{const o=vn(t,n.schema);return a1e(o,e)(n,r)},Fve=(t,e={})=>({state:n,dispatch:r})=>{const o=vn(t,n.schema);return l1e(o,e)(n,r)};var jve=Object.freeze({__proto__:null,blur:A1e,clearContent:O1e,clearNodes:I1e,command:N1e,createParagraphNear:L1e,deleteCurrentNode:R1e,deleteNode:$1e,deleteRange:D1e,deleteSelection:P1e,enter:H1e,exitCode:B1e,extendMarkRange:j1e,first:z1e,focus:V1e,forEach:U1e,insertContent:q1e,insertContentAt:G1e,joinUp:J1e,joinDown:Y1e,joinBackward:X1e,joinForward:Z1e,keyboardShortcut:eve,lift:tve,liftEmptyBlock:nve,liftListItem:rve,newlineInCode:ove,resetAttributes:sve,scrollIntoView:ive,selectAll:ave,selectNodeBackward:lve,selectNodeForward:cve,selectParentNode:uve,selectTextblockEnd:dve,selectTextblockStart:fve,setContent:hve,setMark:Cve,setMeta:_ve,setNode:Sve,setNodeSelection:Mve,setTextSelection:Tve,sinkListItem:Eve,splitBlock:Ave,splitListItem:Ove,toggleList:Ive,toggleMark:Nve,toggleNode:Lve,toggleWrap:Rve,undoInputRule:$ve,unsetAllMarks:Dve,unsetMark:Pve,updateAttributes:Hve,wrapIn:Bve,wrapInList:Fve});const zve=qn.create({name:"commands",addCommands(){return{...jve}}}),Vve=qn.create({name:"editable",addProseMirrorPlugins(){return[new Gn({key:new Ur("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Uve=qn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Gn({key:new Ur("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),qve=qn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:i})=>{const{selection:a,doc:l}=i,{empty:c,$anchor:u}=a,{pos:d,parent:f}=u,h=je.atStart(l).from===d;return!c||!h||!f.type.isTextblock||f.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ox()||$O()?o:r},addProseMirrorPlugins(){return[new Gn({key:new Ur("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(d=>
116d.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:r,from:o,to:s}=e.selection,i=je.atStart(e.doc).from,a=je.atEnd(e.doc).to;if(r||!(o===i&&s===a)||n.doc.textBetween(0,n.doc.content.size," "," ").length!==0)return;const l=n.tr,c=m0({state:n,transaction:l}),{commands:u}=new g0({editor:this.editor,state:c});if(u.clearNodes(),!!l.steps.length)return l}})]}}),Wve=qn.create({name:"tabindex",addProseMirrorPlugins(){return[new Gn({key:new Ur("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Kve=Object.freeze({__proto__:null,ClipboardTextSerializer:E1e,Commands:zve,Editable:Vve,FocusEvents:Uve,Keymap:qve,Tabindex:Wve});const Gve=`.ProseMirror {
117  position: relative;
118}
119
120.ProseMirror {
121  word-wrap: break-word;
122  white-space: pre-wrap;
123  white-space: break-spaces;
124  -webkit-font-variant-ligatures: none;
125  font-variant-ligatures: none;
126  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
127}
128
129.ProseMirror [contenteditable="false"] {
130  white-space: normal;
131}
132
133.ProseMirror [contenteditable="false"] [contenteditable="true"] {
134  white-space: pre-wrap;
135}
136
137.ProseMirror pre {
138  white-space: pre-wrap;
139}
140
141img.ProseMirror-separator {
142  display: inline !important;
143  border: none !important;
144  margin: 0 !important;
145  width: 1px !important;
146  height: 1px !important;
147}
148
149.ProseMirror-gapcursor {
150  display: none;
151  pointer-events: none;
152  position: absolute;
153  margin: 0;
154}
155
156.ProseMirror-gapcursor:after {
157  content: "";
158  display: block;
159  position: absolute;
160  top: -2px;
161  width: 20px;
162  border-top: 1px solid black;
163  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
164}
165
166@keyframes ProseMirror-cursor-blink {
167  to {
168    visibility: hidden;
169  }
170}
171
172.ProseMirror-hideselection *::selection {
173  background: transparent;
174}
175
176.ProseMirror-hideselection *::-moz-selection {
177  background: transparent;
178}
179
180.ProseMirror-hideselection * {
181  caret-color: transparent;
182}
183
184.ProseMirror-focused .ProseMirror-gapcursor {
185  display: block;
186}
187
188.tippy-box[data-animation=fade][data-state=hidden] {
189  opacity: 0
190}`;function Jve(t,e){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(r),r}let Yve=class extends p1e{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Jve(Gve,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n=IO(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(t){if(this.isDestroyed)return;const e=typeof t=="string"?`${t}$`:t.key,n=this.state.reconfigure({plugins:this.state.plugins.filter(r=>!r.key.startsWith(e))});this.view.updateState(n)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(Kve):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(e?.type));this.extensionManager=new cc(t,this)}createCommandManager(){this.commandManager=new g0({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=DO(this.options.content,this.schema,this.options.parseOptions),e=RO(t,this.options.autofocus);this.view=new Lye(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:lc.create({doc:t,selection:e||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(s=>{var i;return(i=this.capturedTransaction)===null||i===void 0?void 0:i.step(s)});return}const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);
vendor: 4,418 bytes, lines 190-192
190this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const r=t.getMeta("focus"),o=t.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return vve(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return bve(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return mve(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
191
192`,textSerializers:n={}}=t||{};return gve(this.state.doc,{blockSeparator:e,textSerializers:{...LO(this.schema),...n}})}get isEmpty(){return wve(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}};function lu(t){return new v0({find:t.find,handler:({state:e,range:n,match:r})=>{const o=tt(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:s}=e,i=r[r.length-1],a=r[0];let l=n.to;if(i){const c=a.search(/\S/),u=n.from+a.indexOf(i),d=u+i.length;if(HO(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===t.type&&h!==f.mark.type)).filter(f=>f.to>u).length)return null;d<n.to&&s.delete(d,n.to),u>n.from&&s.delete(n.from+c,u),l=n.from+c+i.length,s.addMark(n.from+c,l,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function Xve(t){return new v0({find:t.find,handler:({state:e,range:n,match:r})=>{const o=tt(t.getAttributes,void 0,r)||{},{tr:s}=e,i=n.from;let a=n.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);let c=i+l;c>a?c=a:a=c+r[1].length;const u=r[0][r[0].length-1];s.insertText(u,i+r[0].length-1),s.replaceWith(c,a,t.type.create(o))}else r[0]&&s.replaceWith(i,a,t.type.create(o))}})}function Qb(t){return new v0({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),s=tt(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function Df(t){return new v0({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const s=tt(t.getAttributes,void 0,r)||{},i=e.tr.delete(n.from,n.to),a=i.doc.resolve(n.from).blockRange(),l=a&&px(a,t.type,s);if(!l)return null;if(i.wrap(a,l),t.keepMarks&&t.editor){const{selection:u,storedMarks:d}=e,{splittableMarks:f}=t.editor.extensionManager,h=d||u.$to.parentOffset&&u.$from.marks();if(h){const p=h.filter(g=>f.includes(g.type.name));i.ensureMarks(p)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(u,s).run()}const c=i.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&ba(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&i.join(n.from-1)}})}class Bo{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=tt(Ae(this,"addOptions",{name:this.name}))),this.storage=tt(Ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Bo(e)}configure(e={}){const n=this.extend();return n.options=b0(this.options,e),n.storage=tt(Ae(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Bo(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=tt(Ae(n,"addOptions",{name:n.name})),n.storage=tt(Ae(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!s.find(a=>
192a?.type.name===n.name))return!1;const i=s.find(a=>a?.type.name===n.name);return i&&r.removeStoredMark(i),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}class tn{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=tt(Ae(this,"addOptions",{name:this.name}))),this.storage=tt(Ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new tn(e)}configure(e={}){const n=this.extend();return n.options=b0(this.options,e),n.storage=tt(Ae(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new tn(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=tt(Ae(n,"addOptions",{name:n.name})),n.storage=tt(Ae(n,"addStorage",{name:n.name,options:n.options})),n}}function cu(t){return new x1e({find:t.find,handler:({state:e,range:n,match:r})=>{const o=tt(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:s}=e,i=r[r.length-1],a=r[0];let l=n.to;if(i){const c=a.search(/\S/),u=n.from+a.indexOf(i),d=u+i.length;if(HO(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===t.type&&h!==f.mark.type)).filter(f=>f.to>u).length)return null;d<n.to&&s.delete(d,n.to),u>n.from&&s.delete(n.from+c,u),l=n.from+c+i.length,s.addMark(n.from+c,l,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}const Zve=/^\s*>\s$/,Qve=tn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",$t(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Df({find:Zve,type:this.type})]}}),ebe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,tbe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,nbe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,rbe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,obe=Bo.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",$t(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[lu({find:ebe,type:this.type}),lu({find:nbe,type:this.type})]},addPasteRules(){return[cu({find:tbe,type:this.type}),cu({find:rbe,type:this.type})]}}),sbe=tn.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",$t(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),I4=Bo.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",$t(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=k0(t,this.type);return Object.entries(n).some(([,r])=>!!r)?!0:e.unsetMark(this.name)}}}}),N4=/^\s*([-+*])\s$/,ibe=tn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",$t(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(sbe.name,this.editor.getAttributes(I4.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}
192,addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Df({find:N4,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Df({find:N4,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(I4.name),editor:this.editor})),[t]}}),abe=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,lbe=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,cbe=Bo.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",$t(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[lu({find:abe,type:this.type})]},addPasteRules(){return[cu({find:lbe,type:this.type})]}}),ube=/^```([a-z]+)?[\s\n]$/,dbe=/^~~~([a-z]+)?[\s\n]$/,fbe=tn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;return[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0]||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",$t(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,i=r.parent.textContent.endsWith(`
193
194`);return!s||!i?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:s}=n;if(!s||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;const i=o.after();return i===void 0||r.nodeAt(i)?!1:t.commands.exitCode()}}},addInputRules(){return[Qb({find:ube,type:this.type,getAttributes:t=>({language:t[1]})}),Qb({find:dbe,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Gn({key:new Ur("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,s=o?.mode;if(!n||!s)return!1;const{tr:i}=t.state;return i.replaceSelectionWith(this.type.create({language:s})),i.setSelection(Ke.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.insertText(n.replace(/\r\n?/g,`
195`)),i.setMeta("paste",!0),t.dispatch(i),!0}}})]}}),hbe=tn.create({name:"doc",topNode:!0,content:"block+"});function pbe(t={}){return new Gn({view(e){return new mbe(e,t)}})}class mbe{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let s=i=>{this[o](i)};return e.dom.addEventListener(o,s),{name:o,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>
vendor: 4,104 bytes, line 195
195e.state.doc.content.size?this.setCursor(null):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),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=a?u.bottom:u.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let s,i;if(!o||o==document.body&&getComputedStyle(o).position=="static")s=-pageXOffset,i=-pageYOffset;else{let a=o.getBoundingClientRect();s=a.left-o.scrollLeft,i=a.top-o.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-i+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,s=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!s){let i=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=H9(this.editorView.state.doc,i,this.editorView.dragging.slice);a!=null&&(i=a)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const gbe=qn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[pbe(this.options)]}});class jt extends je{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return jt.valid(r)?new jt(r):je.near(r)}content(){return we.empty}eq(e){return e instanceof jt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new jt(e.resolve(n.pos))}getBookmark(){return new Nx(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!ybe(e)||!vbe(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&jt.valid(e))return e;let o=e.pos,s=null;for(let i=e.depth;;i--){let a=e.node(i);if(n>0?e.indexAfter(i)<a.childCount:e.index(i)>0){s=a.child(n>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;o+=n;let l=e.doc.resolve(o);if(jt.valid(l))return l}for(;;){let i=n>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!Be.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=i,o+=n;let a=e.doc.resolve(o);if(jt.valid(a))return a}return null}}}jt.prototype.visible=!1;jt.findFrom=jt.findGapCursorFrom;je.jsonID("gapcursor",jt);class Nx{constructor(e){this.pos=e}map(e){return new Nx(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return jt.valid(n)?new jt(n):je.near(n)}}function ybe(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;
vendor: 3,934 bytes, lines 195-196
195if(o.inlineContent)return!1}}return!0}function vbe(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function bbe(){return new Gn({props:{decorations:Cbe,createSelectionBetween(t,e,n){return e.pos==n.pos&&jt.valid(n)?new jt(n):null},handleClick:kbe,handleKeyDown:wbe,handleDOMEvents:{beforeinput:xbe}}})}const wbe=Mx({ArrowLeft:Zh("horiz",-1),ArrowRight:Zh("horiz",1),ArrowUp:Zh("vert",-1),ArrowDown:Zh("vert",1)});function Zh(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let i=r.selection,a=e>0?i.$to:i.$from,l=i.empty;if(i instanceof Ke){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=jt.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new jt(c))),!0):!1}}function kbe(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!jt.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Be.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new jt(r))),!0)}function xbe(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof jt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=ie.empty;for(let i=r.length-1;i>=0;i--)o=ie.from(r[i].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new we(o,0,0));return s.setSelection(Ke.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function Cbe(t){if(!(t.selection instanceof jt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ft.create(t.doc,[gr.widget(t.selection.head,e,{key:"gapcursor"})])}const _be=qn.create({name:"gapCursor",addProseMirrorPlugins(){return[bbe()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=tt(Ae(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),Sbe=tn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",$t(this.options.HTMLAttributes,t)]},renderText(){return`
196`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:a}=r.extensionManager,l=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&i){const d=l.filter(f=>a.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Mbe=tn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,$t(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Qb({find:new RegExp(`^(#{1,${t}}
196)\\s$`),type:this.type,getAttributes:{level:t}}))}});var ig=200,pn=function(){};pn.prototype.append=function(t){return t.length?(t=pn.from(t),!this.length&&t||t.length<ig&&this.leafAppend(t)||this.length<ig&&t.leafPrepend(this)||this.appendInner(t)):this};pn.prototype.prepend=function(t){return t.length?pn.from(t).append(this):this};pn.prototype.appendInner=function(t){return new Tbe(this,t)};pn.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?pn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))};pn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};pn.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)};pn.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(o,s){return r.push(t(o,s))},e,n),r};pn.from=function(t){return t instanceof pn?t:t&&t.length?new FO(t):pn.empty};var FO=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,s,i){for(var a=o;a<s;a++)if(r(this.values[a],i+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,i){for(var a=o-1;a>=s;a--)if(r(this.values[a],i+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=ig)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=ig)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(pn);pn.empty=new FO([]);var Tbe=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,r,o,s){var i=this.left.length;if(r<i&&this.left.forEachInner(n,r,Math.min(o,i),s)===!1||o>i&&this.right.forEachInner(n,Math.max(r-i,0),Math.min(this.length,o)-i,s+i)===!1)return!1},e.prototype.forEachInvertedInner=function(n,r,o,s){var i=this.left.length;if(r>i&&this.right.forEachInvertedInner(n,r-i,Math.max(o,i)-i,s+i)===!1||o<i&&this.left.forEachInvertedInner(n,Math.min(r,i),o,s)===!1)return!1},e.prototype.sliceInner=function(n,r){if(n==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(n,r):n>=o?this.right.slice(n-o,r-o):this.left.slice(n,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new e(r,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(pn);const Ebe=500;class Mo{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,s;n&&(o=this.remapping(r,this.items.length),s=o.maps.length);let i=e.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),s=o.maps.length),s--,u.push(d);return}if(o){u.push(new Ko(d.map));let h=d.step.map(o.slice(s)),p;h&&i.maybeStep(h).doc&&(p=i.mapping.maps[i.mapping.maps.length-1],c.push(new Ko(p,void 0,void 0,c.length+u.length))),s--,p&&o.appendMap(p,s)}else i.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(s)):d.selection,l=new Mo(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:i,selection:a}}addTransform(e,n,r,o){let s=[],i=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new Ko(e.mapping.maps[u],d,n),h;(h=l&&l.merge(f))&&(f=h,u?s.pop():a=a.slice(0,a.length-1)),s.push(f),n&&(i++,n=void 0),o||(l=f)}let c=i-r.depth;return c>Obe&&(a=Abe(a,c),i-=c),new Mo(a.append(s),i)}remapping(e,n){let r=new _c;
vendor: 4,816 bytes, line 196
196return this.items.forEach((o,s)=>{let i=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,i)},e,n),r}addMaps(e){return this.eventCount==0?this:new Mo(this.items.append(e.map(n=>new Ko(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=n;this.items.forEach(f=>{let h=s.getMirror(--l);if(h==null)return;i=Math.min(i,h);let p=s.maps[h];if(f.step){let g=e.steps[h].invert(e.docs[h]),y=f.selection&&f.selection.map(s.slice(l+1,h));y&&a++,r.push(new Ko(p,g,y))}else r.push(new Ko(p))},o);let c=[];for(let f=n;f<i;f++)c.push(new Ko(s.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new Mo(u,a);return d.emptyItemCount()>Ebe&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],s=0;return this.items.forEach((i,a)=>{if(a>=e)o.push(i),i.selection&&s++;else if(i.step){let l=i.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=i.selection&&i.selection.map(n.slice(r));u&&s++;let d=new Ko(c.invert(),l,u),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else i.map&&r--},this.items.length,0),new Mo(pn.from(o.reverse()),s)}}Mo.empty=new Mo(pn.empty,0);function Abe(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class Ko{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Ko(n.getMap().invert(),n,this.selection)}}}class Ii{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const Obe=20;function Ibe(t,e,n,r){let o=n.getMeta(oa),s;if(o)return o.historyState;n.getMeta(Lbe)&&(t=new Ii(t.done,t.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(i&&i.getMeta(oa))return i.getMeta(oa).redo?new Ii(t.done.addTransform(n,void 0,r,Dp(e)),t.undone,L4(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new Ii(t.done,t.undone.addTransform(n,void 0,r,Dp(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!i&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!Nbe(n,t.prevRanges)),c=i?k1(t.prevRanges,n.mapping):L4(n.mapping.maps[n.steps.length-1]);return new Ii(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Dp(e)),Mo.empty,c,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Ii(t.done.rebased(n,s),t.undone.rebased(n,s),k1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ii(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),k1(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Nbe(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(n=!0)}),n}function L4(t){let e=[];return t.forEach((n,r,o,s)=>e.push(o,s)),e}function k1(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),s=e.map(t[r+1],-1);o<=s&&n.push(o,s)}return n}function jO(t,e,n,r){let o=Dp(e),s=oa.get(e).spec.config,i=(r?t.undone:t.done).popEvent(e,o);if(!i)return;let a=i.selection.resolve(i.transform.doc),l=(r?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),s,o),c=new Ii(r?l:i.remaining,r?i.remaining:l,null,0,-1);n(i.transform.setSelection(a).setMeta(oa,{redo:r,historyState:c}).scrollIntoView())}let x1=!1,R4=null;function Dp(t){let e=t.plugins;if(R4!=e){x1=!1,R4=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){x1=!0;break}}return x1}const oa=new Ur("history"),Lbe=new Ur("closeHistory");function Rbe(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Gn({key:oa,state:{init(){return new Ii(Mo.empty,Mo.empty,null,0,-1)},apply(e,n,r){return Ibe(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?zO:r=="historyRedo"?VO:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}const zO=(t,e)=>{let n=oa.getState(t);return!n||n.done.eventCount==0?!1:(e&&jO(n,t,e,!1),!0)},VO=(t,e)=>{let n=oa.getState(t);return!n||n.undone.eventCount==0?!1:(e&&jO(n,t,e,!0),!0)},$be=qn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>zO(t,e),redo:()=>({state:t,dispatch:e})=>VO(t,e)}},addProseMirrorPlugins(){return[Rbe(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>
196this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Dbe=tn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",$t(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t})=>t().insertContent({type:this.name}).command(({tr:e,dispatch:n})=>{var r;if(n){const{$to:o}=e.selection,s=o.end();if(o.nodeAfter)e.setSelection(Ke.create(e.doc,o.pos));else{const i=(r=o.parent.type.contentMatch.defaultType)===null||r===void 0?void 0:r.create();i&&(e.insert(s,i),e.setSelection(Ke.create(e.doc,s)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[Xve({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Pbe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,Hbe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Bbe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Fbe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,jbe=Bo.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",$t(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[lu({find:Pbe,type:this.type}),lu({find:Bbe,type:this.type})]},addPasteRules(){return[cu({find:Hbe,type:this.type}),cu({find:Fbe,type:this.type})]}}),zbe=tn.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",$t(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Vbe=tn.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",$t(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),$4=Bo.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",$t(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=k0(t,this.type);return Object.entries(n).some(([,r])=>!!r)?!0:e.unsetMark(this.name)}}}}),D4=/^(\d+)\.\s$/,Ube=tn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",$t(this.options.HTMLAttributes,n),0]:["ol",$t(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Vbe.name,this.editor.getAttributes($4.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Df({find:D4,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Df({find:D4,type:this.t
196ype,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes($4.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),qbe=tn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",$t(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Wbe=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Kbe=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,Gbe=Bo.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",$t(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[lu({find:Wbe,type:this.type})]},addPasteRules(){return[cu({find:Kbe,type:this.type})]}}),Jbe=tn.create({name:"text",group:"inline"}),Ybe=qn.create({name:"starterKit",addExtensions(){var t,e,n,r,o,s,i,a,l,c,u,d,f,h,p,g,y,w;const x=[];return this.options.blockquote!==!1&&x.push(Qve.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(obe.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(ibe.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(cbe.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(fbe.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&x.push(hbe.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&x.push(gbe.configure((i=this.options)===null||i===void 0?void 0:i.dropcursor)),this.options.gapcursor!==!1&&x.push(_be.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&x.push(Sbe.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&x.push(Mbe.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&x.push($be.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(Dbe.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&x.push(jbe.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&x.push(zbe.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&x.push(Ube.configure((p=this.options)===null||p===void 0?void 0:p.orderedList)),this.options.paragraph!==!1&&x.push(qbe.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&x.push(Gbe.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&x.push(Jbe.configure((w=this.options)===null||w===void 0?void 0:w.text)),x}}),Xbe=Bo.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",$t(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Zbe=qn.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}}
vendor: 18,725 bytes, line 196
196,addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});var xr="top",po="bottom",mo="right",Cr="left",Lx="auto",mh=[xr,po,mo,Cr],uu="start",Pf="end",Qbe="clippingParents",UO="viewport",Xu="popper",ewe="reference",P4=mh.reduce(function(t,e){return t.concat([e+"-"+uu,e+"-"+Pf])},[]),qO=[].concat(mh,[Lx]).reduce(function(t,e){return t.concat([e,e+"-"+uu,e+"-"+Pf])},[]),twe="beforeRead",nwe="read",rwe="afterRead",owe="beforeMain",swe="main",iwe="afterMain",awe="beforeWrite",lwe="write",cwe="afterWrite",uwe=[twe,nwe,rwe,owe,swe,iwe,awe,lwe,cwe];function ks(t){return t?(t.nodeName||"").toLowerCase():null}function jr(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Ol(t){var e=jr(t).Element;return t instanceof e||t instanceof Element}function ao(t){var e=jr(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Rx(t){if(typeof ShadowRoot>"u")return!1;var e=jr(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function dwe(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},s=e.elements[n];!ao(s)||!ks(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var a=o[i];a===!1?s.removeAttribute(i):s.setAttribute(i,a===!0?"":a)}))})}function fwe(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],s=e.attributes[r]||{},i=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=i.reduce(function(l,c){return l[c]="",l},{});!ao(o)||!ks(o)||(Object.assign(o.style,a),Object.keys(s).forEach(function(l){o.removeAttribute(l)}))})}}const WO={name:"applyStyles",enabled:!0,phase:"write",fn:dwe,effect:fwe,requires:["computeStyles"]};function fs(t){return t.split("-")[0]}var fl=Math.max,ag=Math.min,du=Math.round;function ew(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function KO(){return!/^((?!chrome|android).)*safari/i.test(ew())}function fu(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,s=1;e&&ao(t)&&(o=t.offsetWidth>0&&du(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&du(r.height)/t.offsetHeight||1);var i=Ol(t)?jr(t):window,a=i.visualViewport,l=!KO()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/s,d=r.width/o,f=r.height/s;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function $x(t){var e=fu(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function GO(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Rx(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ii(t){return jr(t).getComputedStyle(t)}function hwe(t){return["table","td","th"].indexOf(ks(t))>=0}function xa(t){return((Ol(t)?t.ownerDocument:t.document)||window.document).documentElement}function x0(t){return ks(t)==="html"?t:t.assignedSlot||t.parentNode||(Rx(t)?t.host:null)||xa(t)}function H4(t){return!ao(t)||ii(t).position==="fixed"?null:t.offsetParent}function pwe(t){var e=/firefox/i.test(ew()),n=/Trident/i.test(ew());if(n&&ao(t)){var r=ii(t);if(r.position==="fixed")return null}var o=x0(t);for(Rx(o)&&(o=o.host);ao(o)&&["html","body"].indexOf(ks(o))<0;){var s=ii(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function gh(t){for(var e=jr(t),n=H4(t);n&&hwe(n)&&ii(n).position==="static";)n=H4(n);return n&&(ks(n)==="html"||ks(n)==="body"&&ii(n).position==="static")?e:n||pwe(t)||e}function Dx(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ef(t,e,n){return fl(t,ag(e,n))}function mwe(t,e,n){var r=ef(t,e,n);return r>n?n:r}function JO(){return{top:0,right:0,bottom:0,left:0}}function YO(t){return Object.assign({},JO(),t)}function XO(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var gwe=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,YO(typeof t!="number"?t:XO(t,mh))};function ywe(t){var e,n=t.state,r=t.name,o=t.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,a=fs(n.placement),l=Dx(a),c=[Cr,mo].indexOf(a)>=0,u=c?"height":"width";if(!(!s||!i)){var d=gwe(o.padding,n),f=$x(s),h=l==="y"?xr:Cr,p=l==="y"?po:mo,g=n.rects.reference[u]+n.rects.reference[l]-i[l]-n.rects.popper[u],y=i[l]-n.rects.reference[l],w=gh(s),x=w?l==="y"?w.clientHeight||0:w.clientWidth||0:0,C=g/2-y/2,v=d[h],S=x-f[u]-d[p],E=x/2-f[u]/2+C,M=ef(v,E,S),T=l;n.modifiersData[r]=(e={},e[T]=M,e.centerOffset=M-E,e)}}function vwe(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||GO(e.elements.popper,o)&&(e.elements.arrow=o))}const bwe={name:"arrow",enabled:!0,phase:"main",fn:ywe,effect:vwe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function hu(t){return t.split("-")[1]}var wwe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function kwe(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:du(n*o)/o||0,y:du(r*o)/o||0}}function B4(t){var e,n=t.popper,r=t.popperRect,o=t.placement,s=t.variation,i=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=i.x,h=f===void 0?0:f,p=i.y,g=p===void 0?0:p,y=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=y.x,g=y.y;var w=i.hasOwnProperty("x"),x=i.hasOwnProperty("y"),C=Cr,v=xr,S=window;if(c){var E=gh(n),M="clientHeight",T="clientWidth";if(E===jr(n)&&(E=xa(n),ii(E).position!=="static"&&a==="absolute"&&(M="scrollHeight",T="scrollWidth")),E=E,o===xr||(o===Cr||o===mo)&&s===Pf){v=po;var A=d&&E===S&&S.visualViewport?S.visualViewport.height:E[M];g-=A-r.height,g*=l?1:-1}if(o===Cr||(o===xr||o===po)&&s===Pf){C=mo;var N=d&&E===S&&S.visualViewport?S.visualViewport.width:E[T];h-=N-r.width,h*=l?1:-1}}var D=Object.assign({position:a},c&&wwe),$=u===!0?kwe({x:h,y:g},jr(n)):{x:h,y:g};if(h=$.x,g=$.y,l){var W;return Object.assign({},D,(W={},W[v]=x?"0":"",W[C]=w?"0":"",W.transform=(S.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",W))}return Object.assign({},D,(e={},e[v]=x?g+"px":"",e[C]=w?h+"px":"",e.transform="",e))}function xwe(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,i=s===void 0?!0:s,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:fs(e.placement),variation:hu(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,B4(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:i,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,B4(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Cwe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:xwe,data:{}};var Qh={passive:!0};function _we(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,a=i===void 0?!0:i,l=jr(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",n.update,Qh)}),a&&l.addEventListener("resize",n.update,Qh),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Qh)}),a&&l.removeEventListener("resize",n.update,Qh)}}const Swe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:_we,data:{}};var Mwe={left:"right",right:"left",bottom:"top",top:"bottom"};function Pp(t){return t.replace(/left|right|bottom|top/g,function(e){return Mwe[e]})}var Twe={start:"end",end:"start"};function F4(t){return t.replace(/start|end/g,function(e){return Twe[e]})}function Px(t){var e=jr(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Hx(t){return fu(xa(t)).left+Px(t).scrollLeft}function Ewe(t,e){var n=jr(t),r=xa(t),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;var c=KO();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a+Hx(t),y:l}}function Awe(t){var e,n=xa(t),r=Px(t),o=(e=t.ownerDocument)==null?void 0:e.body,s=fl(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=fl(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Hx(t),l=-r.scrollTop;return ii(o||n).direction==="rtl"&&(a+=fl(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:a,y:l}}function Bx(t){var e=ii(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function ZO(t){return["html","body","#document"].indexOf(ks(t))>=0?t.ownerDocument.body:ao(t)&&Bx(t)?t:ZO(x0(t))}function tf(t,e){var n;e===void 0&&(e=[]);var r=ZO(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),s=jr(r),i=o?[s].concat(s.visualViewport||[],Bx(r)?r:[]):r,a=e.concat(i);return o?a:a.concat(tf(x0(i)))}function tw(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Owe(t,e){var n=fu(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function j4(t,e,n){return e===UO?tw(Ewe(t,n)):Ol(e)?Owe(e,n):tw(Awe(xa(t)))}function Iwe(t){var e=tf(x0(t)),n=["absolute","fixed"].indexOf(ii(t).position)>=0,r=n&&ao(t)?gh(t):t;return Ol(r)?e.filter(function(o){return Ol(o)&&GO(o,r)&&ks(o)!=="body"}):[]}function Nwe(t,e,n,r){var o=e==="clippingParents"?Iwe(t):[].concat(e),s=[].concat(o,[n]),i=s[0],a=s.reduce(function(l,c){var u=j4(t,c,r);return l.top=fl(u.top,l.top),l.right=ag(u.right,l.right),l.bottom=ag(u.bottom,l.bottom),l.left=fl(u.left,l.left),l},j4(t,i,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function QO(t){var e=t.reference,n=t.element,r=t.placement,o=r?fs(r):null,s=r?hu(r):null,i=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case xr:l={x:i,y:e.y-n.height};break;case po:l={x:i,y:e.y+e.height};break;case mo:l={x:e.x+e.width,y:a};break;case Cr:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?Dx(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case uu:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Pf:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function Hf(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,s=n.strategy,i=s===void 0?t.strategy:s,a=n.boundary,l=a===void 0?Qbe:a,c=n.rootBoundary,u=c===void 0?UO:c,d=n.elementContext,f=d===void 0?Xu:d,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,y=g===void 0?0:g,w=YO(typeof y!="number"?y:XO(y,mh)),x=f===Xu?ewe:Xu,C=t.rects.popper,v=t.elements[p?x:f],S=Nwe(Ol(v)?v:v.contextElement||xa(t.elements.popper),l,u,i),E=fu(t.elements.reference),M=QO({reference:E,element:C,placement:o}),T=tw(Object.assign({},C,M)),A=f===Xu?T:E,N={top:S.top-A.top+w.top,bottom:A.bottom-S.bottom+w.bottom,left:S.left-A.left+w.left,right:A.right-S.right+w.right},D=t.modifiersData.offset;if(f===Xu&&D){var $=D[o];Object.keys(N).forEach(function(W){var me=[mo,po].indexOf(W)>=0?1:-1,V=[xr,po].indexOf(W)>=0?"y":"x";N[W]+=$[V]*me})}return N}function Lwe(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?qO:l,u=hu(r),d=u?a?P4:P4.filter(function(p){return hu(p)===u}):mh,f=d.filter(function(p){return c.indexOf(p)>=0});f.length===0&&(f=d);var h=f.reduce(function(p,g){return p[g]=Hf(t,{placement:g,boundary:o,rootBoundary:s,padding:i})[fs(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function Rwe(t){if(fs(t)===Lx)return[];var e=Pp(t);return[F4(t),e,F4(e)]}function $we(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,a=i===void 0?!0:i,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,y=e.options.placement,w=fs(y),x=w===y,C=l||(x||!p?[Pp(y)]:Rwe(y)),v=[y].concat(C).reduce(function(ee,se){return ee.concat(fs(se)===Lx?Lwe(e,{placement:se,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):se)},[]),S=e.rects.reference,E=e.rects.popper,M=new Map,T=!0,A=v[0],N=0;N<v.length;N++){var D=v[N],$=fs(D),W=hu(D)===uu,me=[xr,po].indexOf($)>=0,V=me?"width":"height",B=Hf(e,{placement:D,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),Y=me?W?mo:Cr:W?po:xr;S[V]>E[V]&&(Y=Pp(Y));var j=Pp(Y),P=[];if(s&&P.push(B[$]<=0),a&&P.push(B[Y]<=0,B[j]<=0),P.every(function(ee){return ee})){A=D,T=!1;break}M.set(D,P)}if(T)for(var Q=p?3:1,J=function(ee){var se=v.find(function(Re){var F=M.get(Re);if(F)return F.slice(0,ee).every(function(q){return q})});if(se)return A=se,"break"},ke=Q;ke>0;ke--){var Se=J(ke);if(Se==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const Dwe={name:"flip",enabled:!0,phase:"main",fn:$we,requiresIfExists:["offset"],data:{_skip:!1}};function z4(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function V4(t){return[xr,mo,po,Cr].some(function(e){return t[e]>=0})}function Pwe(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,s=e.modifiersData.preventOverflow,i=Hf(e,{elementContext:"reference"}),a=Hf(e,{altBoundary:!0}),l=z4(i,r),c=z4(a,o,s),u=V4(l),d=V4(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const Hwe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Pwe};function Bwe(t,e,n){var r=fs(t),o=[Cr,xr].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,i=s[0],a=s[1];return i=i||0,a=(a||0)*o,[Cr,mo].indexOf(r)>=0?{x:a,y:i}:{x:i,y:a}}function Fwe(t){var e=t.state,n=t.options,r=t.name,o=n.offset,s=o===void 0?[0,0]:o,i=qO.reduce(function(u,d){return u[d]=Bwe(d,e.rects,s),u},{}),a=i[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=i}const jwe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Fwe};function zwe(t){var e=t.state,n=t.name;e.modifiersData[n]=QO({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const Vwe={name:"popperOffsets",enabled:!0,phase:"read",fn:zwe,data:{}};function Uwe(t){return t==="x"?"y":"x"}function qwe(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,a=i===void 0?!1:i,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,p=n.tetherOffset,g=p===void 0?0:p,y=Hf(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),w=fs(e.placement),x=hu(e.placement),C=!x,v=Dx(w),S=Uwe(v),E=e.modifiersData.popperOffsets,M=e.rects.reference,T=e.rects.popper,A=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,N=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,$={x:0,y:0};if(E){if(s){var W,me=v==="y"?xr:Cr,V=v==="y"?po:mo,B=v==="y"?"height":"width",Y=E[v],j=Y+y[me],P=Y-y[V],Q=h?-T[B]/2:0,J=x===uu?M[B]:T[B],ke=x===uu?-T[B]:-M[B],Se=e.elements.arrow,ee=h&&Se?$x(Se):{width:0,height:0},se=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:JO(),Re=se[me],F=se[V],q=ef(0,M[B],ee[B]),ne=C?M[B]/2-Q-q-Re-N.mainAxis:J-q-Re-N.mainAxis,de=C?-M[B]/2+Q+q+F+N.mainAxis:ke+q+F+N.mainAxis,Pe=e.elements.arrow&&gh(e.elements.arrow),ot=Pe?v==="y"?Pe.clientTop||0:Pe.clientLeft||0:0,I=(W=D?.[v])!=null?W:0,O=Y+ne-I-ot,z=Y+de-I,K=ef(h?ag(j,O):j,Y,h?fl(P,z):P);E[v]=K,$[v]=K-Y}if(a){var G,re=v==="x"?xr:Cr,he=v==="x"?po:mo,le=E[S],ae=S==="y"?"height":"width",te=le+y[re],Me=le-y[he],ge=[xr,Cr].indexOf(w)!==-1,Te=(G=D?.[S])!=null?G:0,De=ge?te:le-M[ae]-T[ae]-Te+N.altAxis,Je=ge?le+M[ae]+T[ae]-Te-N.altAxis:Me,it=h&&ge?mwe(De,le,Je):ef(h?De:te,le,h?Je:Me);E[S]=it,$[S]=it-le}e.modifiersData[r]=$}}const Wwe={name:"preventOverflow",enabled:!0,phase:"main",fn:qwe,requiresIfExists:["offset"]};function Kwe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Gwe(t){return t===jr(t)||!ao(t)?Px(t):Kwe(t)}function Jwe(t){var e=t.getBoundingClientRect(),n=du(e.width)/t.offsetWidth||1,r=du(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Ywe(t,e,n){n===void 0&&(n=!1);var r=ao(e),o=ao(e)&&Jwe(e),s=xa(e),i=fu(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((ks(e)!=="body"||Bx(s))&&(a=Gwe(e)),ao(e)?(l=fu(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=Hx(s))),{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function Xwe(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function o(s){n.add(s.name);var i=[].concat(s.requires||[],s.requiresIfExists||[]);i.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||o(s)}),r}function Zwe(t){var e=Xwe(t);return uwe.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function Qwe(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function eke(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var U4={placement:"bottom",modifiers:[],strategy:"absolute"};function q4(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];
vendor: 9,480 bytes, line 196
196return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function tke(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,s=o===void 0?U4:o;return function(i,a,l){l===void 0&&(l=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},U4,s),modifiersData:{},elements:{reference:i,popper:a},attributes:{},styles:{}},u=[],d=!1,f={state:c,setOptions:function(g){var y=typeof g=="function"?g(c.options):g;p(),c.options=Object.assign({},s,c.options,y),c.scrollParents={reference:Ol(i)?tf(i):i.contextElement?tf(i.contextElement):[],popper:tf(a)};var w=Zwe(eke([].concat(r,c.options.modifiers)));return c.orderedModifiers=w.filter(function(x){return x.enabled}),h(),f.update()},forceUpdate:function(){if(!d){var g=c.elements,y=g.reference,w=g.popper;if(q4(y,w)){c.rects={reference:Ywe(y,gh(w),c.options.strategy==="fixed"),popper:$x(w)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(T){return c.modifiersData[T.name]=Object.assign({},T.data)});for(var x=0;x<c.orderedModifiers.length;x++){if(c.reset===!0){c.reset=!1,x=-1;continue}var C=c.orderedModifiers[x],v=C.fn,S=C.options,E=S===void 0?{}:S,M=C.name;typeof v=="function"&&(c=v({state:c,options:E,name:M,instance:f})||c)}}}},update:Qwe(function(){return new Promise(function(g){f.forceUpdate(),g(c)})}),destroy:function(){p(),d=!0}};if(!q4(i,a))return f;f.setOptions(l).then(function(g){!d&&l.onFirstUpdate&&l.onFirstUpdate(g)});function h(){c.orderedModifiers.forEach(function(g){var y=g.name,w=g.options,x=w===void 0?{}:w,C=g.effect;if(typeof C=="function"){var v=C({state:c,name:y,instance:f,options:x}),S=function(){};u.push(v||S)}})}function p(){u.forEach(function(g){return g()}),u=[]}return f}}var nke=[Swe,Vwe,Cwe,WO,jwe,Dwe,Wwe,bwe,Hwe],rke=tke({defaultModifiers:nke}),oke="tippy-box",eI="tippy-content",ske="tippy-backdrop",tI="tippy-arrow",nI="tippy-svg-arrow",Da={passive:!0,capture:!0},rI=function(){return document.body};function C1(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Fx(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function oI(t,e){return typeof t=="function"?t.apply(void 0,e):t}function W4(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function ike(t){return t.split(/\s+/).filter(Boolean)}function sc(t){return[].concat(t)}function K4(t,e){t.indexOf(e)===-1&&t.push(e)}function ake(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function lke(t){return t.split("-")[0]}function lg(t){return[].slice.call(t)}function G4(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function nf(){return document.createElement("div")}function C0(t){return["Element","Fragment"].some(function(e){return Fx(t,e)})}function cke(t){return Fx(t,"NodeList")}function uke(t){return Fx(t,"MouseEvent")}function dke(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function fke(t){return C0(t)?[t]:cke(t)?lg(t):Array.isArray(t)?t:lg(document.querySelectorAll(t))}function _1(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function J4(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function hke(t){var e,n=sc(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function pke(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var s=o.popperRect,i=o.popperState,a=o.props,l=a.interactiveBorder,c=lke(i.placement),u=i.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,p=c==="left"?u.right.x:0,g=s.top-r+d>l,y=r-s.bottom-f>l,w=s.left-n+h>l,x=n-s.right-p>l;return g||y||w||x})}function S1(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function Y4(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Xo={isTouch:!1},X4=0;function mke(){Xo.isTouch||(Xo.isTouch=!0,window.performance&&document.addEventListener("mousemove",sI))}function sI(){var t=performance.now();t-X4<20&&(Xo.isTouch=!1,document.removeEventListener("mousemove",sI)),X4=t}function gke(){var t=document.activeElement;if(dke(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function yke(){document.addEventListener("touchstart",mke,Da),window.addEventListener("blur",gke)}var vke=typeof window<"u"&&typeof document<"u",bke=vke?!!window.msCrypto:!1,wke={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},kke={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ao=Object.assign({appendTo:rI,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},wke,kke),xke=Object.keys(Ao),Cke=function(t){var e=Object.keys(t);e.forEach(function(n){Ao[n]=t[n]})};function iI(t){var e=t.plugins||[],n=e.reduce(function(r,o){var s=o.name,i=o.defaultValue;if(s){var a;r[s]=t[s]!==void 0?t[s]:(a=Ao[s])!=null?a:i}return r},{});return Object.assign({},t,n)}function _ke(t,e){var n=e?Object.keys(iI(Object.assign({},Ao,{plugins:e}))):xke,r=n.reduce(function(o,s){var i=(t.getAttribute("data-tippy-"+s)||"").trim();if(!i)return o;if(s==="content")o[s]=i;else try{o[s]=JSON.parse(i)}catch{o[s]=i}return o},{});return r}function Z4(t,e){var n=Object.assign({},e,{content:oI(e.content,[t])},e.ignoreAttributes?{}:_ke(t,e.plugins));return n.aria=Object.assign({},Ao.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var Ske=function(){return"innerHTML"};function nw(t,e){t[Ske()]=e}function Q4(t){var e=nf();return t===!0?e.className=tI:(e.className=nI,C0(t)?e.appendChild(t):nw(e,t)),e}function eM(t,e){C0(e.content)?(nw(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?nw(t,e.content):t.textContent=e.content)}function rw(t){var e=t.firstElementChild,n=lg(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(eI)}),arrow:n.find(function(r){return r.classList.contains(tI)||r.classList.contains(nI)}),backdrop:n.find(function(r){return r.classList.contains(ske)})}}function aI(t){var e=nf(),n=nf();n.className=oke,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=nf();r.className=eI,r.setAttribute("data-state","hidden"),eM(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props);function o(s,i){var a=rw(e),l=a.box,c=a.content,u=a.arrow;i.theme?l.setAttribute("data-theme",i.theme):l.removeAttribute("data-theme"),typeof i.animation=="string"?l.setAttribute("data-animation",i.animation):l.removeAttribute("data-animation"),i.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof i.maxWidth=="number"?i.maxWidth+"px":i.maxWidth,i.role?l.setAttribute("role",i.role):l.removeAttribute("role"),(s.content!==i.content||s.allowHTML!==i.allowHTML)&&eM(c,t.props),i.arrow?u?s.arrow!==i.arrow&&(l.removeChild(u),l.appendChild(Q4(i.arrow))):l.appendChild(Q4(i.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:o}}aI.$$tippy=!0;var Mke=1,ep=[],M1=[];function Tke(t,e){var n=Z4(t,Object.assign({},Ao,iI(G4(e)))),r,o,s,i=!1,a=!1,l=!1,c=!1,u,d,f,h=[],p=W4(O,n.interactiveDebounce),g,y=Mke++,w=null,x=ake(n.plugins),C={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:y,reference:t,popper:nf(),popperInstance:w,props:n,state:C,plugins:x,clearDelayTimeouts:De,setProps:Je,setContent:it,show:ht,hide:ln,hideWithInteractivity:Kt,enable:ge,disable:Te,unmount:Jn,destroy:bn};if(!n.render)return v;var S=n.render(v),E=S.popper,M=S.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+v.id,v.popper=E,t._tippy=v,E._tippy=v;var T=x.map(function(R){return R.fn(v)}),A=t.hasAttribute("aria-expanded");return Pe(),Q(),Y(),j("onCreate",[v]),n.showOnCreate&&te(),E.addEventListener("mouseenter",function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()}),E.addEventListener("mouseleave",function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&me().addEventListener("mousemove",p)}),v;function N(){var R=v.props.touch;return Array.isArray(R)?R:[R,0]}function D(){return N()[0]==="hold"}function $(){var R;return!!((R=v.props.render)!=null&&R.$$tippy)}function W(){return g||t}function me(){var R=W().parentNode;return R?hke(R):document}function V(){return rw(E)}function B(R){return v.state.isMounted&&!v.state.isVisible||Xo.isTouch||u&&u.type==="focus"?0:C1(v.props.delay,R?0:1,Ao.delay)}function Y(R){R===void 0&&(R=!1),E.style.pointerEvents=v.props.interactive&&!R?"":"none",E.style.zIndex=""+v.props.zIndex}function j(R,X,oe){if(oe===void 0&&(oe=!0),T.forEach(function(_e){_e[R]&&_e[R].apply(_e,X)}),oe){var Ce;(Ce=v.props)[R].apply(Ce,X)}}function P(){var R=v.props.aria;
vendor: 2,681 bytes, line 196
196if(R.content){var X="aria-"+R.content,oe=E.id,Ce=sc(v.props.triggerTarget||t);Ce.forEach(function(_e){var ct=_e.getAttribute(X);if(v.state.isVisible)_e.setAttribute(X,ct?ct+" "+oe:oe);else{var It=ct&&ct.replace(oe,"").trim();It?_e.setAttribute(X,It):_e.removeAttribute(X)}})}}function Q(){if(!(A||!v.props.aria.expanded)){var R=sc(v.props.triggerTarget||t);R.forEach(function(X){v.props.interactive?X.setAttribute("aria-expanded",v.state.isVisible&&X===W()?"true":"false"):X.removeAttribute("aria-expanded")})}}function J(){me().removeEventListener("mousemove",p),ep=ep.filter(function(R){return R!==p})}function ke(R){if(!(Xo.isTouch&&(l||R.type==="mousedown"))){var X=R.composedPath&&R.composedPath()[0]||R.target;if(!(v.props.interactive&&Y4(E,X))){if(sc(v.props.triggerTarget||t).some(function(oe){return Y4(oe,X)})){if(Xo.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[v,R]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),a=!0,setTimeout(function(){a=!1}),v.state.isMounted||Re())}}}function Se(){l=!0}function ee(){l=!1}function se(){var R=me();R.addEventListener("mousedown",ke,!0),R.addEventListener("touchend",ke,Da),R.addEventListener("touchstart",ee,Da),R.addEventListener("touchmove",Se,Da)}function Re(){var R=me();R.removeEventListener("mousedown",ke,!0),R.removeEventListener("touchend",ke,Da),R.removeEventListener("touchstart",ee,Da),R.removeEventListener("touchmove",Se,Da)}function F(R,X){ne(R,function(){!v.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&X()})}function q(R,X){ne(R,X)}function ne(R,X){var oe=V().box;function Ce(_e){_e.target===oe&&(S1(oe,"remove",Ce),X())}if(R===0)return X();S1(oe,"remove",d),S1(oe,"add",Ce),d=Ce}function de(R,X,oe){oe===void 0&&(oe=!1);var Ce=sc(v.props.triggerTarget||t);Ce.forEach(function(_e){_e.addEventListener(R,X,oe),h.push({node:_e,eventType:R,handler:X,options:oe})})}function Pe(){D()&&(de("touchstart",I,{passive:!0}),de("touchend",z,{passive:!0})),ike(v.props.trigger).forEach(function(R){if(R!=="manual")switch(de(R,I),R){case"mouseenter":de("mouseleave",z);break;case"focus":de(bke?"focusout":"blur",K);break;case"focusin":de("focusout",K);break}})}function ot(){h.forEach(function(R){var X=R.node,oe=R.eventType,Ce=R.handler,_e=R.options;X.removeEventListener(oe,Ce,_e)}),h=[]}function I(R){var X,oe=!1;if(!(!v.state.isEnabled||G(R)||a)){var Ce=((X=u)==null?void 0:X.type)==="focus";u=R,g=R.currentTarget,Q(),!v.state.isVisible&&uke(R)&&ep.forEach(function(_e){return _e(R)}),R.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||i)&&v.props.hideOnClick!==!1&&v.state.isVisible?oe=!0:te(R),R.type==="click"&&(i=!oe),oe&&!Ce&&Me(R)}}
vendor: 3,540 bytes, line 196
196function O(R){var X=R.target,oe=W().contains(X)||E.contains(X);if(!(R.type==="mousemove"&&oe)){var Ce=ae().concat(E).map(function(_e){var ct,It=_e._tippy,Tr=(ct=It.popperInstance)==null?void 0:ct.state;return Tr?{popperRect:_e.getBoundingClientRect(),popperState:Tr,props:n}:null}).filter(Boolean);pke(Ce,R)&&(J(),Me(R))}}function z(R){var X=G(R)||v.props.trigger.indexOf("click")>=0&&i;if(!X){if(v.props.interactive){v.hideWithInteractivity(R);return}Me(R)}}function K(R){v.props.trigger.indexOf("focusin")<0&&R.target!==W()||v.props.interactive&&R.relatedTarget&&E.contains(R.relatedTarget)||Me(R)}function G(R){return Xo.isTouch?D()!==R.type.indexOf("touch")>=0:!1}function re(){he();var R=v.props,X=R.popperOptions,oe=R.placement,Ce=R.offset,_e=R.getReferenceClientRect,ct=R.moveTransition,It=$()?rw(E).arrow:null,Tr=_e?{getBoundingClientRect:_e,contextElement:_e.contextElement||W()}:t,Es={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(As){var Er=As.state;if($()){var M0=V(),Ca=M0.box;["placement","reference-hidden","escaped"].forEach(function(Os){Os==="placement"?Ca.setAttribute("data-placement",Er.placement):Er.attributes.popper["data-popper-"+Os]?Ca.setAttribute("data-"+Os,""):Ca.removeAttribute("data-"+Os)}),Er.attributes.popper={}}}},Yn=[{name:"offset",options:{offset:Ce}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ct}},Es];$()&&It&&Yn.push({name:"arrow",options:{element:It,padding:3}}),Yn.push.apply(Yn,X?.modifiers||[]),v.popperInstance=rke(Tr,E,Object.assign({},X,{placement:oe,onFirstUpdate:f,modifiers:Yn}))}function he(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function le(){var R=v.props.appendTo,X,oe=W();v.props.interactive&&R===rI||R==="parent"?X=oe.parentNode:X=oI(R,[oe]),X.contains(E)||X.appendChild(E),v.state.isMounted=!0,re()}function ae(){return lg(E.querySelectorAll("[data-tippy-root]"))}function te(R){v.clearDelayTimeouts(),R&&j("onTrigger",[v,R]),se();var X=B(!0),oe=N(),Ce=oe[0],_e=oe[1];Xo.isTouch&&Ce==="hold"&&_e&&(X=_e),X?r=setTimeout(function(){v.show()},X):v.show()}function Me(R){if(v.clearDelayTimeouts(),j("onUntrigger",[v,R]),!v.state.isVisible){Re();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(R.type)>=0&&i)){var X=B(!1);X?o=setTimeout(function(){v.state.isVisible&&v.hide()},X):s=requestAnimationFrame(function(){v.hide()})}}function ge(){v.state.isEnabled=!0}function Te(){v.hide(),v.state.isEnabled=!1}function De(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(s)}function Je(R){if(!v.state.isDestroyed){j("onBeforeUpdate",[v,R]),ot();var X=v.props,oe=Z4(t,Object.assign({},X,G4(R),{ignoreAttributes:!0}));v.props=oe,Pe(),X.interactiveDebounce!==oe.interactiveDebounce&&(J(),p=W4(O,oe.interactiveDebounce)),X.triggerTarget&&!oe.triggerTarget?sc(X.triggerTarget).forEach(function(Ce){Ce.removeAttribute("aria-expanded")}):oe.triggerTarget&&t.removeAttribute("aria-expanded"),Q(),Y(),M&&M(X,oe),v.popperInstance&&(re(),ae().forEach(function(Ce){requestAnimationFrame(Ce._tippy.popperInstance.forceUpdate)})),j("onAfterUpdate",[v,R])}}function it(R){v.setProps({content:R})}function ht(){var R=v.state.isVisible,X=v.state.isDestroyed,oe=!v.state.isEnabled,Ce=Xo.isTouch&&!v.props.touch,_e=C1(v.props.duration,0,Ao.duration);if(!(R||X||oe||Ce)&&!W().hasAttribute("disabled")&&(j("onShow",[v],!1),v.props.onShow(v)!==!1)){if
196(v.state.isVisible=!0,$()&&(E.style.visibility="visible"),Y(),se(),v.state.isMounted||(E.style.transition="none"),$()){var ct=V(),It=ct.box,Tr=ct.content;_1([It,Tr],0)}f=function(){var Es;if(!(!v.state.isVisible||c)){if(c=!0,E.offsetHeight,E.style.transition=v.props.moveTransition,$()&&v.props.animation){var Yn=V(),As=Yn.box,Er=Yn.content;_1([As,Er],_e),J4([As,Er],"visible")}P(),Q(),K4(M1,v),(Es=v.popperInstance)==null||Es.forceUpdate(),j("onMount",[v]),v.props.animation&&$()&&q(_e,function(){v.state.isShown=!0,j("onShown",[v])})}},le()}}function ln(){var R=!v.state.isVisible,X=v.state.isDestroyed,oe=!v.state.isEnabled,Ce=C1(v.props.duration,1,Ao.duration);if(!(R||X||oe)&&(j("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,c=!1,i=!1,$()&&(E.style.visibility="hidden"),J(),Re(),Y(!0),$()){var _e=V(),ct=_e.box,It=_e.content;v.props.animation&&(_1([ct,It],Ce),J4([ct,It],"hidden"))}P(),Q(),v.props.animation?$()&&F(Ce,v.unmount):v.unmount()}}function Kt(R){me().addEventListener("mousemove",p),K4(ep,p),p(R)}function Jn(){v.state.isVisible&&v.hide(),v.state.isMounted&&(he(),ae().forEach(function(R){R._tippy.unmount()}),E.parentNode&&E.parentNode.removeChild(E),M1=M1.filter(function(R){return R!==v}),v.state.isMounted=!1,j("onHidden",[v]))}function bn(){!v.state.isDestroyed&&(v.clearDelayTimeouts(),v.unmount(),ot(),delete t._tippy,v.state.isDestroyed=!0,j("onDestroy",[v]))}}function Iu(t,e){e===void 0&&(e={});var n=Ao.plugins.concat(e.plugins||[]);yke();var r=Object.assign({},e,{plugins:n}),o=fke(t),s=o.reduce(function(i,a){var l=a&&Tke(a,r);return l&&i.push(l),i},[]);return C0(t)?s[0]:s}Iu.defaultProps=Ao;Iu.setDefaultProps=Cke;Iu.currentInput=Xo;Object.assign({},WO,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});Iu.setDefaultProps({render:aI});class Eke{constructor({editor:e,element:n,view:r,tippyOptions:o={},updateDelay:s=250,shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:u})=>{const{doc:d,selection:f}=l,{empty:h}=f,p=!d.textBetween(c,u).length&&Ax(l.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||h||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget)||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),u=!(l!=null&&l.doc.eq(a.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,u,l)},this.updateDelay))},this.updateHandler=(a,l,c,u)=>{var d,f,h;const{state:p,composing:g}=a,{selection:y}=p;if(g||!l&&!c)return;this.createTooltip();const{ranges:w}=y,x=Math.min(...w.map(v=>v.$from.pos)),C=Math.max(...w.map(v=>v.$to.pos));if(!(!((d=this.shouldShow)===null||d===void 0)&&d.call(this,{editor:this.editor,view:a,state:p,oldState:u,from:x,to:C}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(kve(p.selection)){let v=a.nodeDOM(x);const S=v.dataset.nodeViewWrapper?v:v.querySelector("[data-node-view-wrapper]");if(S&&(v=S.firstChild),v)return v.getBoundingClientRect()}return BO(a,x,C)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=s,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Iu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,o=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,n);return}const s=!(n!=null&&n.selection.eq(e.state.selection)),i=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,s,i,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Ake=t=>new Gn({key:typeof t.pluginKey=="string"?new Ur(t.pluginKey):t.pluginKey,view:e=>
196new Eke({view:e,...t})});qn.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Ake({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class Oke{constructor({editor:e,element:n,view:r,tippyOptions:o={},shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:i,state:a})=>{const{selection:l}=a,{$anchor:c,empty:u}=l,d=c.depth===1,f=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent;return!(!i.hasFocus()||!u||!d||!f||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:i})=>{var a;if(this.preventHide){this.preventHide=!1;return}i!=null&&i.relatedTarget&&!((a=this.element.parentNode)===null||a===void 0)&&a.contains(i.relatedTarget)||this.hide()},this.tippyBlurHandler=i=>{this.blurHandler({event:i})},this.editor=e,this.element=n,this.view=r,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Iu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,o,s;const{state:i}=e,{doc:a,selection:l}=i,{from:c,to:u}=l;if(!(n&&n.doc.eq(a)&&n.selection.eq(l))){if(this.createTooltip(),!(!((r=this.shouldShow)===null||r===void 0)&&r.call(this,{editor:this.editor,view:e,state:i,oldState:n}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:((s=this.tippyOptions)===null||s===void 0?void 0:s.getReferenceClientRect)||(()=>BO(e,c,u))}),this.show()}}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Ike=t=>new Gn({key:typeof t.pluginKey=="string"?new Ur(t.pluginKey):t.pluginKey,view:e=>new Oke({view:e,...t})});qn.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Ike({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});function tM(t){return KM((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class Nke extends Yve{constructor(e={}){return super(e),this.vueRenderers=or(new Map),this.contentComponent=null,this.reactiveState=tM(this.view.state),this.reactiveExtensionStorage=tM(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),jf(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){super.registerPlugin(e,n),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const Lke=Ne({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=pe(),n=go();return ww(()=>{const r=t.editor;r&&r.options.element&&e.value&&mn(()=>
196{if(!e.value||!r.options.element.firstChild)return;const o=b(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:o}),r.createNodeViews()})}),Fo(()=>{const r=t.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const o=document.createElement("div");o.append(...r.options.element.childNodes),r.setOptions({element:o})}),{rootEl:e}},render(){const t=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const n=mt(xw,{to:e.teleportElement,key:e.id},mt(e.component,{ref:e.id,...e.props}));t.push(n)}),mt("div",{ref:e=>{this.rootEl=e}},...t)}});var ow,sw;if(typeof WeakMap<"u"){let t=new WeakMap;ow=e=>t.get(e),sw=(e,n)=>(t.set(e,n),n)}else{const t=[];let e=0;ow=n=>{for(let r=0;r<t.length;r+=2)if(t[r]==n)return t[r+1]},sw=(n,r)=>(e==10&&(e=0),t[e++]=n,t[e++]=r)}var Vt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let s=r+1,i=o+1;for(let a=1;s<this.width&&this.map[e+a]==n;a++)s++;for(let a=1;i<this.height&&this.map[e+this.width*a]==n;a++)i++;return{left:r,top:o,right:s,bottom:i}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:s,bottom:i}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[s*this.width+(n<0?r-1:o)]:(n<0?s==0:i==this.height)?null:this.map[r+this.width*(n<0?s-1:i)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:s}=this.findCell(t),{left:i,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(n,i),top:Math.min(o,l),right:Math.max(r,a),bottom:Math.max(s,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const s=r*this.width+o,i=this.map[s];n[i]||(n[i]=!0,!(o==t.left&&o&&this.map[s-1]==i||r==t.top&&r&&this.map[s-this.width]==i)&&e.push(i))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const s=o+n.child(r).nodeSize;if(r==t){let i=e+t*this.width;const a=(t+1)*this.width;for(;i<a&&this.map[i]<o;)i++;return i==a?s-1:this.map[i]}o=s}}static get(t){return ow(t)||sw(t,Rke(t))}};function Rke(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=$ke(t),n=t.childCount,r=[];let o=0,s=null;const i=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const d=t.child(c);u++;for(let p=0;;p++){for(;o<r.length&&r[o]!=0;)o++;if(p==d.childCount)break;const g=d.child(p),{colspan:y,rowspan:w,colwidth:x}=g.attrs;for(let C=0;C<w;C++){if(C+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-C});break}const v=o+C*e;for(let S=0;S<y;S++){r[v+S]==0?r[v+S]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:y-S});const E=x&&x[S];if(E){const M=(v+S)%e*2,T=i[M];T==null||T!=E&&i[M+1]==1?(i[M]=E,i[M+1]=1):T==E&&i[M+1]++}}}o+=y,u+=g.nodeSize}const f=(c+1)*e;let h=0;for(;o<f;)r[o++]==0&&h++;h&&(s||(s=[])).push({type:"missing",row:c,n:h}),u++}const a=new Vt(e,n,r,s);let l=!1;for(let c=0;!l&&c<i.length;c+=2)i[c]!=null&&i[c+1]<n&&(l=!0);return l&&Dke(a,i,t),a}function $ke(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let s=0;if(n)for(let i=0;i<r;i++){const a=t.child(i);for(let l=0;l<a.childCount;l++){const c=a.child(l);i+c.attrs.rowspan>r&&(s+=c.attrs.colspan)}}for(let i=0;i<o.childCount;i++){const a=o.child(i);s+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function Dke(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const s=t.map[o];if(r[s])continue;r[s]=!0;const i=n.nodeAt(s);if(!i)throw new RangeError(`No cell with offset ${s} found`);let a=null;const l=i.attrs;for(let c=0;c<l.colspan;c++){const u=(o+c)%t.width,d=e[u*2];d!=null&&(!l.colwidth||l.colwidth[c]!=d)&&((a||(a=Pke(l)))[c]=d)}a&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function Pke(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Wn(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};
196for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var Pi=new Ur("selectingCells");function Nu(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Hke(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Vo(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function _0(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Nu(e.$head)||Bke(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function Bke(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function iw(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function Fke(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function jx(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function lI(t,e,n){const r=t.node(-1),o=Vt.get(r),s=t.start(-1),i=o.nextCell(t.pos-s,e,n);return i==null?null:t.node(0).resolve(s+i)}function Il(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function cI(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function jke(t,e,n){const r=Wn(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var ft=class extends je{constructor(t,e=t){const n=t.node(-1),r=Vt.get(n),o=t.start(-1),s=r.rectBetween(t.pos-o,e.pos-o),i=t.node(0),a=r.cellsInRect(s).filter(c=>c!=e.pos-o);a.unshift(e.pos-o);const l=a.map(c=>{const u=n.nodeAt(c);if(!u)throw RangeError(`No cell with offset ${c} found`);const d=o+c+1;return new U9(i.resolve(d),i.resolve(d+u.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=t,this.$headCell=e}map(t,e){const n=t.resolve(e.map(this.$anchorCell.pos)),r=t.resolve(e.map(this.$headCell.pos));if(iw(n)&&iw(r)&&jx(n,r)){const o=this.$anchorCell.node(-1)!=n.node(-1);return o&&this.isRowSelection()?ft.rowSelection(n,r):o&&this.isColSelection()?ft.colSelection(n,r):new ft(n,r)}return Ke.between(n,r)}content(){const t=this.$anchorCell.node(-1),e=Vt.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},s=[];for(let a=r.top;a<r.bottom;a++){const l=[];for(let c=a*e.width+r.left,u=r.left;u<r.right;u++,c++){const d=e.map[c];if(o[d])continue;o[d]=!0;const f=e.findCell(d);let h=t.nodeAt(d);if(!h)throw RangeError(`No cell with offset ${d} found`);const p=r.left-f.left,g=f.right-r.right;if(p>0||g>0){let y=h.attrs;if(p>0&&(y=Il(y,0,p)),g>0&&(y=Il(y,y.colspan-g,g)),f.left<r.left){if(h=h.type.createAndFill(y),!h)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else h=h.type.create(y,h.content)}if(f.top<r.top||f.bottom>r.bottom){const y={...h.attrs,rowspan:Math.min(f.bottom,r.bottom)-Math.max(f.top,r.top)};f.top<r.top?h=h.type.createAndFill(y):h=h.type.create(y,h.content)}l.push(h)}s.push(t.child(a).copy(ie.from(l)))}const i=this.isColSelection()&&this.isRowSelection()?t:s;return new we(ie.from(i),1,1)}replace(t,e=we.empty){const n=t.steps.length,r=this.ranges;for(let s=0;s<r.length;s++){const{$from:i,$to:a}=r[s],l=t.mapping.slice(n);t.replace(l.map(i.pos),l.map(a.pos),s?we.empty:e)}const o=je.findFrom(t.doc.resolve(t.mapping.slice(n).map(this.to)),-1);o&&t.setSelection(o)}replaceWith(t,e){this.replace(t,new we(ie.from(e),0,0))}forEachCell(t){const e=this.$anchorCell.node(-1),n=Vt.get(e),r=this.$anchorCell.start(-1),o=n.cells
196InRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let s=0;s<o.length;s++)t(e.nodeAt(o[s]),r+o[s])}isColSelection(){const t=this.$anchorCell.index(-1),e=this.$headCell.index(-1);if(Math.min(t,e)>0)return!1;const n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,e=t){const n=t.node(-1),r=Vt.get(n),o=t.start(-1),s=r.findCell(t.pos-o),i=r.findCell(e.pos-o),a=t.node(0);return s.top<=i.top?(s.top>0&&(t=a.resolve(o+r.map[s.left])),i.bottom<r.height&&(e=a.resolve(o+r.map[r.width*(r.height-1)+i.right-1]))):(i.top>0&&(e=a.resolve(o+r.map[i.left])),s.bottom<r.height&&(t=a.resolve(o+r.map[r.width*(r.height-1)+s.right-1]))),new ft(t,e)}isRowSelection(){const t=this.$anchorCell.node(-1),e=Vt.get(t),n=this.$anchorCell.start(-1),r=e.colCount(this.$anchorCell.pos-n),o=e.colCount(this.$headCell.pos-n);if(Math.min(r,o)>0)return!1;const s=r+this.$anchorCell.nodeAfter.attrs.colspan,i=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,i)==e.width}eq(t){return t instanceof ft&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,e=t){const n=t.node(-1),r=Vt.get(n),o=t.start(-1),s=r.findCell(t.pos-o),i=r.findCell(e.pos-o),a=t.node(0);return s.left<=i.left?(s.left>0&&(t=a.resolve(o+r.map[s.top*r.width])),i.right<r.width&&(e=a.resolve(o+r.map[r.width*(i.top+1)-1]))):(i.left>0&&(e=a.resolve(o+r.map[i.top*r.width])),s.right<r.width&&(t=a.resolve(o+r.map[r.width*(s.top+1)-1]))),new ft(t,e)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,e){return new ft(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){return new ft(t.resolve(e),t.resolve(n))}getBookmark(){return new uI(this.$anchorCell.pos,this.$headCell.pos)}};ft.prototype.visible=!1;je.jsonID("cell",ft);var uI=class{constructor(t,e){this.anchor=t,this.head=e}map(t){return new uI(t.map(this.anchor),t.map(this.head))}resolve(t){const e=t.resolve(this.anchor),n=t.resolve(this.head);return e.parent.type.spec.tableRole=="row"&&n.parent.type.spec.tableRole=="row"&&e.index()<e.parent.childCount&&n.index()<n.parent.childCount&&jx(e,n)?new ft(e,n):je.near(n,1)}};function zke(t){if(!(t.selection instanceof ft))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(gr.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Ft.create(t.doc,e)}function Vke({$from:t,$to:e}){if(t.pos==e.pos||t.pos<t.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function Uke({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const s=t.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let o=e.depth;o>0;o--){const s=e.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function qke(t,e,n){const r=(e||t).selection,o=(e||t).doc;let s,i;if(r instanceof Be&&(i=r.node.type.spec.tableRole)){if(i=="cell"||i=="header_cell")s=ft.create(o,r.from);else if(i=="row"){const a=o.resolve(r.from+1);s=ft.rowSelection(a,a)}else if(!n){const a=Vt.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];s=ft.create(o,l+1,c)}}else r instanceof Ke&&Vke(r)?s=Ke.create(o,r.from):r instanceof Ke&&Uke(r)&&(s=Ke.create(o,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var Wke=new Ur("fix-tables");function dI(t,e,n,r){const o=t.childCount,s=e.childCount;e:for(let i=0,a=0;i<s;i++){const l=e.child(i);for(let c=a,u=Math.min(o,i+3);c<u;c++)if(t.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<o&&t.child(a).sameMarkup(l)?dI(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function fI(t,e){let n;const r=(o,s)=>{o.type.spec.tableRole=="table"&&(n=Kke(t,o,s,n))};return e?e.doc!=t.doc&&dI(e.doc,t.doc,0,r):t.doc.descendants(r),n}function Kke(t,e,n,r){const o=Vt.get(e);if(!o.problems)return r;r||(r=t.tr);const s=[];for(let l=0;l<o.height;l++)s.push(0);for(let l=0;l<o.problems.length;l++){const c=o.problems[l];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let f=0;f<d.rowspan;f++)s[c.row+f]+=c.n;
196r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,Il(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}}let i,a;for(let l=0;l<s.length;l++)s[l]&&(i==null&&(i=l),a=l);for(let l=0,c=n+1;l<o.height;l++){const u=e.child(l),d=c+u.nodeSize,f=s[l];if(f>0){let h="cell";u.firstChild&&(h=u.firstChild.type.spec.tableRole);const p=[];for(let y=0;y<f;y++){const w=Wn(t.schema)[h].createAndFill();w&&p.push(w)}const g=(l==0||i==l-1)&&a==l?c+1:d-1;r.insert(r.mapping.map(g),p)}c=d}return r.setMeta(Wke,{fixTables:!0})}function Gke(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),s=o.type.spec.tableRole,i=o.type.schema,a=[];if(s=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const u=l?0:Math.max(0,n-1),d=l<e.childCount-1?0:Math.max(0,r-1);(u||d)&&(c=aw(Wn(i).row,new we(c,u,d)).content),a.push(c)}else if(s=="cell"||s=="header_cell")a.push(n||r?aw(Wn(i).row,new we(e,n,r)).content:e);else return null;return Jke(i,a)}function Jke(t,e){const n=[];for(let o=0;o<e.length;o++){const s=e[o];for(let i=s.childCount-1;i>=0;i--){const{rowspan:a,colspan:l}=s.child(i).attrs;for(let c=o;c<o+a;c++)n[c]=(n[c]||0)+l}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(ie.empty),n[o]<r){const s=Wn(t).cell.createAndFill(),i=[];for(let a=n[o];a<r;a++)i.push(s);e[o]=e[o].append(ie.from(i))}return{height:e.length,width:r,rows:e}}function aw(t,e){const n=t.createAndFill();return new V9(n).replace(0,n.content.size,e).doc}function Yke({width:t,height:e,rows:n},r,o){if(t!=r){const s=[],i=[];for(let a=0;a<n.length;a++){const l=n[a],c=[];for(let u=s[a]||0,d=0;u<r;d++){let f=l.child(d%l.childCount);u+f.attrs.colspan>r&&(f=f.type.createChecked(Il(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let h=1;h<f.attrs.rowspan;h++)s[a+h]=(s[a+h]||0)+f.attrs.colspan}i.push(ie.from(c))}n=i,t=r}if(e!=o){const s=[];for(let i=0,a=0;i<o;i++,a++){const l=[],c=n[a%e];for(let u=0;u<c.childCount;u++){let d=c.child(u);i+d.attrs.rowspan>o&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,o-d.attrs.rowspan)},d.content)),l.push(d)}s.push(ie.from(l))}n=s,e=o}return{width:t,height:e,rows:n}}function Xke(t,e,n,r,o,s,i){const a=t.doc.type.schema,l=Wn(a);let c,u;if(o>e.width)for(let d=0,f=0;d<e.height;d++){const h=n.child(d);f+=h.nodeSize;const p=[];let g;h.lastChild==null||h.lastChild.type==l.cell?g=c||(c=l.cell.createAndFill()):g=u||(u=l.header_cell.createAndFill());for(let y=e.width;y<o;y++)p.push(g);t.insert(t.mapping.slice(i).map(f-1+r),p)}if(s>e.height){const d=[];for(let p=0,g=(e.height-1)*e.width;p<Math.max(e.width,o);p++){const y=p>=e.width?!1:n.nodeAt(e.map[g+p]).type==l.header_cell;d.push(y?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const f=l.row.create(null,ie.from(d)),h=[];for(let p=e.height;p<s;p++)h.push(f);t.insert(t.mapping.slice(i).map(r+n.nodeSize-2),h)}return!!(c||u)}function nM(t,e,n,r,o,s,i,a){if(i==0||i==e.height)return!1;let l=!1;for(let c=o;c<s;c++){const u=i*e.width+c,d=e.map[u];if(e.map[u-e.width]==d){l=!0;const f=n.nodeAt(d),{top:h,left:p}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(a).map(d+r),null,{...f.attrs,rowspan:i-h}),t.insert(t.mapping.slice(a).map(e.positionAt(i,p,n)),f.type.createAndFill({...f.attrs,rowspan:h+f.attrs.rowspan-i})),c+=f.attrs.colspan-1}}return l}function rM(t,e,n,r,o,s,i,a){if(i==0||i==e.width)return!1;let l=!1;for(let c=o;c<s;c++){const u=c*e.width+i,d=e.map[u];if(e.map[u-1]==d){l=!0;const f=n.nodeAt(d),h=e.colCount(d),p=t.mapping.slice(a).map(d+r);t.setNodeMarkup(p,null,Il(f.attrs,i-h,f.attrs.colspan-(i-h))),t.insert(p+f.nodeSize,f.type.createAndFill(Il(f.attrs,0,i-h))),c+=f.attrs.rowspan-1}}return l}function oM(t,e,n,r,o){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let i=Vt.get(s);const{top:a,left:l}=r,c=l+o.width,u=a+o.height,d=t.tr;let f=0;function h(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");i=Vt.get(s),f=d.mapping.maps.length}Xke(d,i,s,n,c,u,f)&&h(),nM(d,i,s,n,l,c,a,f)&&h(),nM(d,i,s,n,l,c,u,f)&&h(),rM(d,i,s,n,a,u,l,f)&&h(),rM(d,i,s,n,a,u,c,f)&&h();for(let p=a;p<u;p++){const g=i.positionAt(p,l,s),y=i.positionAt(p,c,s);d.replace(d.mapping.slice(f).map(g+n),d.mapping.slice(f).map(y+n),new we(o.rows[p-a],0,0))}h(),d.setSelection(new ft(d.doc.resolve(n+i.positionAt(a,l,s)),d.doc.resolve(n+i.positionAt(u-1,c-1,s)))),e(d)}var Zke=Mx({ArrowLeft:tp("horiz",-1),ArrowRight:tp("horiz",1),ArrowUp:tp("vert",-1),ArrowDown:tp("vert",1),"Shift-ArrowLeft":np("horiz",-1),"Shift-ArrowRight":np("horiz",1),"Shift-ArrowUp":np("vert",-1),"Shift-ArrowDown":np("vert",1),Backspace:rp,"Mod-Backspace":rp,Delete:rp,"Mod-Delete":rp});function Hp(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function tp(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;if(s instanceof ft)return Hp(n,r,je.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const i=hI(o,t,e);if(i==null)return!1;if(t=="horiz")return Hp(n,r,je.near(n.doc.resolve(s.head+e),e));{const a=n.doc.resolve(i),l=lI(a,t,e);let c;return l?c=je.near(l,1):e<0?c=je.near(n.doc.resolve(a.before(-1)),-1):c=je.near(n.doc.resolve(a.after(-1)),1),Hp(n,r,c)}}}function np(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;let i;if(s instanceof ft)i=s;else{const l=hI(o,t,e);if(l==null)return!1;i=new ft(n.doc.resolve(l))}const a=lI(i.$headCell,t,e);return a?Hp(n,r,new ft(i.$anchorCell,a)):!1}}function rp(t,e){const n=t.selection;if(!(n instanceof ft))return!1;if(e){const r=t.tr,o=Wn(t.schema).cell.createAndFill().content;
196n.forEachCell((s,i)=>{s.content.eq(o)||r.replace(r.mapping.map(i+1),r.mapping.map(i+s.nodeSize-1),new we(o,0,0))}),r.docChanged&&e(r)}return!0}function Qke(t,e){const n=t.state.doc,r=Nu(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new ft(r))),!0):!1}function exe(t,e,n){if(!Vo(t.state))return!1;let r=Gke(n);const o=t.state.selection;if(o instanceof ft){r||(r={width:1,height:1,rows:[ie.from(aw(Wn(t.state.schema).cell,n))]});const s=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),a=Vt.get(s).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=Yke(r,a.right-a.left,a.bottom-a.top),oM(t.state,t.dispatch,i,a,r),!0}else if(r){const s=_0(t.state),i=s.start(-1);return oM(t.state,t.dispatch,i,Vt.get(s.node(-1)).findCell(s.pos-i),r),!0}else return!1}function txe(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=sM(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof ft)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=Nu(t.state.selection.$anchor))!=null&&((n=T1(t,e))==null?void 0:n.pos)!=o.pos)s(o,e),e.preventDefault();else if(!r)return;function s(l,c){let u=T1(t,c);const d=Pi.getState(t.state)==null;if(!u||!jx(l,u))if(d)u=l;else return;const f=new ft(l,u);if(d||!t.state.selection.eq(f)){const h=t.state.tr.setSelection(f);d&&h.setMeta(Pi,l.pos),t.dispatch(h)}}function i(){t.root.removeEventListener("mouseup",i),t.root.removeEventListener("dragstart",i),t.root.removeEventListener("mousemove",a),Pi.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Pi,-1))}function a(l){const c=l,u=Pi.getState(t.state);let d;if(u!=null)d=t.state.doc.resolve(u);else if(sM(t,c.target)!=r&&(d=T1(t,e),!d))return i();d&&s(d,c)}t.root.addEventListener("mouseup",i),t.root.addEventListener("dragstart",i),t.root.addEventListener("mousemove",a)}function hI(t,e,n){if(!(t.state.selection instanceof Ke))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const i=r.before(o),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?i:null}}return null}function sM(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function T1(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Nu(t.state.doc.resolve(n.pos)):null}var nxe=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),lw(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,lw(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function lw(t,e,n,r,o,s){var i;let a=0,l=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;d<u.childCount;d++){const{colspan:h,colwidth:p}=u.child(d).attrs;for(let g=0;g<h;g++,f++){const y=o==f?s:p&&p[g],w=y?y+"px":"";a+=y||r,y||(l=!1),c?(c.style.width!=w&&(c.style.width=w),c=c.nextSibling):e.appendChild(document.createElement("col")).style.width=w}}for(;c;){const d=c.nextSibling;(i=c.parentNode)==null||i.removeChild(c),c=d}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var eo=new Ur("tableColumnResizing");function rxe({handleWidth:t=5,cellMinWidth:e=25,View:n=nxe,lastColumnResizable:r=!0}={}){const o=new Gn({key:eo,state:{init(s,i){return o.spec.props.nodeViews[Wn(i.schema).table.name]=(a,l)=>new n(a,e,l),new Bp(-1,!1)},apply(s,i){return i.apply(s)}},props:{attributes:s=>{const i=eo.getState(s);return i&&i.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,i)=>{oxe(s,i,t,e,r)},mouseleave:s=>{sxe(s)},mousedown:(s,i)=>{ixe(s,i,e)}},decorations:s=>{const i=eo.getState(s);if(i&&i.activeHandle>-1)return fxe(s,i.activeHandle)},nodeViews:{}}});return o}var Bp=class{constructor(t,e){this.activeHandle=t,this.dragging=e}apply(t){const e=this,n=t.getMeta(eo);if(n&&n.setHandle!=null)return new Bp(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new Bp(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){let r=t.mapping.map(e.activeHandle,-1);return iw(t.doc.resolve(r))||(r=-1),new Bp(r,e.dragging)}return e}};function oxe(t,e,n,r,o){const s=eo.getState(t.state);if(s&&!s.dragging){const i=lxe(e.target);let a=-1;if(i){const{left:l,right:c}=i.getBoundingClientRect();e.clientX-l<=n?a=iM(t,e,"left"):c-e.clientX<=n&&(a=iM(t,e,"right"))}if(a!=s.activeHandle){if(!o&&a!==-1){const l=t.state.doc.resolve(a),c=l.node(-1),u=Vt.get(c),d=l.start(-1);if(u.colCount(l.pos-d)+l.nodeAfter.attrs.colspan-1==u.width-1)return}pI(t,a)}}}function sxe(t){const e=eo.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&pI(t,-1)}function ixe(t,e,n){const r=eo.getState(t.state);if(!r||r.activeHandle==-1||r.dragging)return!1;const o=t.state.doc.nodeAt(r.activeHandle),s=axe(t,r.activeHandle,o.attrs);t.dispatch(t.state.tr.setMeta(eo,{setDragging:{startX:e.clientX,startWidth:s}}));function i(l){window.removeEventListener("mouseup",i),window.removeEventListener("mousemove",a);const c=eo.getState(t.state);c!=null&&c.dragging&&(cxe(t,c.activeHandle,aM(c.dragging,l,n)),t.dis
196patch(t.state.tr.setMeta(eo,{setDragging:null})))}function a(l){if(!l.which)return i(l);const c=eo.getState(t.state);if(c&&c.dragging){const u=aM(c.dragging,l,n);uxe(t,c.activeHandle,u,n)}}return window.addEventListener("mouseup",i),window.addEventListener("mousemove",a),e.preventDefault(),!0}function axe(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const s=t.domAtPos(e);let i=s.node.childNodes[s.offset].offsetWidth,a=n;if(r)for(let l=0;l<n;l++)r[l]&&(i-=r[l],a--);return i/a}function lxe(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function iM(t,e,n){const r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return-1;const{pos:o}=r,s=Nu(t.state.doc.resolve(o));if(!s)return-1;if(n=="right")return s.pos;const i=Vt.get(s.node(-1)),a=s.start(-1),l=i.map.indexOf(s.pos-a);return l%i.width==0?-1:a+i.map[l-1]}function aM(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function pI(t,e){t.dispatch(t.state.tr.setMeta(eo,{setHandle:e}))}function cxe(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),s=Vt.get(o),i=r.start(-1),a=s.colCount(r.pos-i)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+a;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],f=o.nodeAt(d).attrs,h=f.colspan==1?0:a-s.colCount(d);if(f.colwidth&&f.colwidth[h]==n)continue;const p=f.colwidth?f.colwidth.slice():dxe(f.colspan);p[h]=n,l.setNodeMarkup(i+d,null,{...f,colwidth:p})}l.docChanged&&t.dispatch(l)}function uxe(t,e,n,r){const o=t.state.doc.resolve(e),s=o.node(-1),i=o.start(-1),a=Vt.get(s).colCount(o.pos-i)+o.nodeAfter.attrs.colspan-1;let l=t.domAtPos(o.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&lw(s,l.firstChild,l,r,a,n)}function dxe(t){return Array(t).fill(0)}function fxe(t,e){const n=[],r=t.doc.resolve(e),o=r.node(-1);if(!o)return Ft.empty;const s=Vt.get(o),i=r.start(-1),a=s.colCount(r.pos-i)+r.nodeAfter.attrs.colspan;for(let l=0;l<s.height;l++){const c=a+l*s.width-1;if((a==s.width||s.map[c]!=s.map[c+1])&&(l==0||s.map[c-1]!=s.map[c-1-s.width])){const u=s.map[c],d=i+u+o.nodeAt(u).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",n.push(gr.widget(d,f))}}return Ft.create(t.doc,n)}function Ts(t){const e=t.selection,n=_0(t),r=n.node(-1),o=n.start(-1),s=Vt.get(r);return{...e instanceof ft?s.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):s.findCell(n.pos-o),tableStart:o,map:s,table:r}}function mI(t,{map:e,tableStart:n,table:r},o){let s=o>0?-1:0;jke(e,r,o+s)&&(s=o==0||o==e.width?null:0);for(let i=0;i<e.height;i++){const a=i*e.width+o;if(o>0&&o<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],c=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,cI(c.attrs,o-e.colCount(l))),i+=c.attrs.rowspan-1}else{const l=s==null?Wn(r.type.schema).cell:r.nodeAt(e.map[a+s]).type,c=e.positionAt(i,o,r);t.insert(t.mapping.map(n+c),l.createAndFill())}}return t}function hxe(t,e){if(!Vo(t))return!1;if(e){const n=Ts(t);e(mI(t.tr,n,n.left))}return!0}function pxe(t,e){if(!Vo(t))return!1;if(e){const n=Ts(t);e(mI(t.tr,n,n.right))}return!0}function mxe(t,{map:e,table:n,tableStart:r},o){const s=t.mapping.maps.length;for(let i=0;i<e.height;){const a=i*e.width+o,l=e.map[a],c=n.nodeAt(l),u=c.attrs;if(o>0&&e.map[a-1]==l||o<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(s).map(r+l),null,Il(u,o-e.colCount(l)));else{const d=t.mapping.slice(s).map(r+l);t.delete(d,d+c.nodeSize)}i+=u.rowspan}}function gxe(t,e){if(!Vo(t))return!1;if(e){const n=Ts(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;mxe(r,n,o),o!=n.left;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=Vt.get(s)}e(r)}return!0}function yxe(t,e,n){var r;const o=Wn(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function gI(t,{map:e,tableStart:n,table:r},o){var s;let i=n;for(let c=0;c<o;c++)i+=r.child(c).nodeSize;const a=[];let l=o>0?-1:0;yxe(e,r,o+l)&&(l=o==0||o==e.height?null:0);for(let c=0,u=e.width*o;c<e.width;c++,u++)if(o>0&&o<e.height&&e.map[u]==e.map[u-e.width]){const d=e.map[u],f=r.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...f,rowspan:f.rowspan+1}),c+=f.colspan-1}else{const d=l==null?Wn(r.type.schema).cell:(s=r.nodeAt(e.map[u+l*e.width]))==null?void 0:s.type,f=d?.createAndFill();f&&a.push(f)}return t.insert(i,Wn(r.type.schema).row.create(null,a)),t}function vxe(t,e){if(!Vo(t))return!1;if(e){const n=Ts(t);e(gI(t.tr,n,n.top))}return!0}function bxe(t,e){if(!Vo(t))return!1;if(e){const n=Ts(t);e(gI(t.tr,n,n.bottom))}return!0}function wxe(t,{map:e,table:n,tableStart:r},o){let s=0;for(let l=0;l<o;l++)s+=n.child(l).nodeSize;const i=s+n.child(o).nodeSize,a=t.mapping.maps.length;t.delete(s+r,i+r);for(let l=0,c=o*e.width;l<e.width;l++,c++){const u=e.map[c];if(o>0&&u==e.map[c-e.width]){const d=n.nodeAt(u).attrs;t.setNodeMarkup(t.mapping.slice(a).map(u+r),null,{...d,rowspan:d.rowspan-1}),l+=d.colspan-1}else if(o<e.width&&u==e.map[c+e.width]){const d=n.nodeAt(u),f=d.attrs,h=d.type.create({...f,rowspan:d.attrs.rowspan-1},d.content),p=e.positionAt(o+1,l,n);t.insert(t.mapping.slice(a).map(r+p),h),l+=f.colspan-1}}}function kxe(t,e){if(!Vo(t))return!1;if(e){const n=Ts(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;wxe(r,n,o),o!=n.top;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=Vt.get(n.table)}e(r)}return!0}function lM(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function xxe({width:t,height:e,map:n},r){let o=r.top*t+r.left,s=o,i=(r.bottom-1)*t+r.left,a=o+(r.right-r.left-1);for(let l=r.top;
196l<r.bottom;l++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[a]==n[a+1])return!0;s+=t,a+=t}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[i]==n[i+t])return!0;o++,i++}return!1}function cM(t,e){const n=t.selection;if(!(n instanceof ft)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Ts(t),{map:o}=r;if(xxe(o,r))return!1;if(e){const s=t.tr,i={};let a=ie.empty,l,c;for(let u=r.top;u<r.bottom;u++)for(let d=r.left;d<r.right;d++){const f=o.map[u*o.width+d],h=r.table.nodeAt(f);if(!(i[f]||!h))if(i[f]=!0,l==null)l=f,c=h;else{lM(h)||(a=a.append(h.content));const p=s.mapping.map(f+r.tableStart);s.delete(p,p+h.nodeSize)}}if(l==null||c==null)return!0;if(s.setNodeMarkup(l+r.tableStart,null,{...cI(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),a.size){const u=l+1+c.content.size,d=lM(c)?l+1:u;s.replaceWith(d+r.tableStart,u+r.tableStart,a)}s.setSelection(new ft(s.doc.resolve(l+r.tableStart))),e(s)}return!0}function uM(t,e){const n=Wn(t.schema);return Cxe(({node:r})=>n[r.type.spec.tableRole])(t,e)}function Cxe(t){return(e,n)=>{var r;const o=e.selection;let s,i;if(o instanceof ft){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;s=o.$anchorCell.nodeAfter,i=o.$anchorCell.pos}else{if(s=Hke(o.$from),!s)return!1;i=(r=Nu(o.$from))==null?void 0:r.pos}if(s==null||i==null||s.attrs.colspan==1&&s.attrs.rowspan==1)return!1;if(n){let a=s.attrs;const l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const u=Ts(e),d=e.tr;for(let h=0;h<u.right-u.left;h++)l.push(c?{...a,colwidth:c&&c[h]?[c[h]]:null}:a);let f;for(let h=u.top;h<u.bottom;h++){let p=u.map.positionAt(h,u.left,u.table);h==u.top&&(p+=s.nodeSize);for(let g=u.left,y=0;g<u.right;g++,y++)g==u.left&&h==u.top||d.insert(f=d.mapping.map(p+u.tableStart,1),t({node:s,row:h,col:g}).createAndFill(l[y]))}d.setNodeMarkup(i,t({node:s,row:u.top,col:u.left}),l[0]),o instanceof ft&&d.setSelection(new ft(d.doc.resolve(o.$anchorCell.pos),f?d.doc.resolve(f):void 0)),n(d)}return!0}}function _xe(t,e){return function(n,r){if(!Vo(n))return!1;const o=_0(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof ft?n.selection.forEachCell((i,a)=>{i.attrs[t]!==e&&s.setNodeMarkup(a,null,{...i.attrs,[t]:e})}):s.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function Sxe(t){return function(e,n){if(!Vo(e))return!1;if(n){const r=Wn(e.schema),o=Ts(e),s=e.tr,i=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=i.map(l=>o.table.nodeAt(l));for(let l=0;l<i.length;l++)a[l].type==r.header_cell&&s.setNodeMarkup(o.tableStart+i[l],r.cell,a[l].attrs);if(s.steps.length==0)for(let l=0;l<i.length;l++)s.setNodeMarkup(o.tableStart+i[l],r.header_cell,a[l].attrs);n(s)}return!0}}function dM(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const s=e.table.nodeAt(r[o]);if(s&&s.type!==n.header_cell)return!1}return!0}function Bf(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Sxe(t):function(n,r){if(!Vo(n))return!1;if(r){const o=Wn(n.schema),s=Ts(n),i=n.tr,a=dM("row",s,o),l=dM("column",s,o),c=(t==="column"?a:t==="row"&&l)?1:0,u=t=="column"?{left:0,top:c,right:1,bottom:s.map.height}:t=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=t=="column"?l?o.cell:o.header_cell:t=="row"?a?o.cell:o.header_cell:o.cell;s.map.cellsInRect(u).forEach(f=>{const h=f+s.tableStart,p=i.doc.nodeAt(h);p&&i.setNodeMarkup(h,d,p.attrs)}),r(i)}return!0}}Bf("row",{useDeprecatedLogic:!0});Bf("column",{useDeprecatedLogic:!0});var Mxe=Bf("cell",{useDeprecatedLogic:!0});function Txe(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const s=t.node(-1).child(r),i=s.lastChild;if(i)return o-1-i.nodeSize;o-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return o+1;o+=s.nodeSize}}return null}function fM(t){return function(e,n){if(!Vo(e))return!1;const r=Txe(_0(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(Ke.between(o,Fke(o))).scrollIntoView())}return!0}}function Exe(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Axe({allowTableNodeSelection:t=!1}={}
196){return new Gn({key:Pi,state:{init(){return null},apply(e,n){const r=e.getMeta(Pi);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:s}=e.mapping.mapResult(n);return o?null:s}},props:{decorations:zke,handleDOMEvents:{mousedown:txe},createSelectionBetween(e){return Pi.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Qke,handleKeyDown:Zke,handlePaste:exe},appendTransaction(e,n,r){return qke(r,fI(r,n),t)}})}function hM(t,e,n,r,o,s){let i=0,a=!0,l=e.firstChild;const c=t.firstChild;for(let u=0,d=0;u<c.childCount;u+=1){const{colspan:f,colwidth:h}=c.child(u).attrs;for(let p=0;p<f;p+=1,d+=1){const g=o===d?s:h&&h[p],y=g?`${g}px`:"";i+=g||r,g||(a=!1),l?(l.style.width!==y&&(l.style.width=y),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=y}}for(;l;){const u=l.nextSibling;l.parentNode.removeChild(l),l=u}a?(n.style.width=`${i}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${i}px`)}class Oxe{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),hM(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,hM(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function pM(t,e){return t.createAndFill()}function Ixe(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function Nxe(t,e,n,r,o){const s=Ixe(t),i=[],a=[];for(let c=0;c<n;c+=1){const u=pM(s.cell);if(u&&a.push(u),r){const d=pM(s.header_cell);d&&i.push(d)}}const l=[];for(let c=0;c<e;c+=1)l.push(s.row.createChecked(null,r&&c===0?i:a));return s.table.createChecked(null,l)}function Lxe(t){return t instanceof ft}const op=({editor:t})=>{const{selection:e}=t.state;if(!Lxe(e))return!1;let n=0;const r=PO(e.ranges[0].$from,o=>o.type.name==="table");return r?.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},Rxe=tn.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Oxe,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:t}){return["table",$t(this.options.HTMLAttributes,t),["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:s})=>{const i=Nxe(s.schema,t,e,n);if(o){const a=r.selection.anchor+1;r.replaceSelectionWith(i).scrollIntoView().setSelection(Ke.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>hxe(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>pxe(t,e),deleteColumn:()=>({state:t,dispatch:e})=>gxe(t,e),addRowBefore:()=>({state:t,dispatch:e})=>vxe(t,e),addRowAfter:()=>({state:t,dispatch:e})=>bxe(t,e),deleteRow:()=>({state:t,dispatch:e})=>kxe(t,e),deleteTable:()=>({state:t,dispatch:e})=>Exe(t,e),mergeCells:()=>({state:t,dispatch:e})=>cM(t,e),splitCell:()=>({state:t,dispatch:e})=>uM(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Bf("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Bf("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>Mxe(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>cM(t,e)?!0:uM(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>_xe(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>fM(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>fM(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&fI(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=ft.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:op,"Mod-Backspace":op,Delete:op,"Mod-Delete":op}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[rxe({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Axe({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:tt(Ae(t,"tableRole",e))}}}),$xe=tn.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",$t(this.options.HTMLAttributes,t),0]}}),Dxe=tn.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",$t(this.options.HTMLAttributes,t),0]}}),Pxe=tn.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",$t(this.options.HTMLAttributes,t),0]}}),Hxe=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},Bxe={components:{EditorContent:Lke},props:{modelValue:{type:String,default:""}},emits:["update:modelValue","close"],data(){return{editor:null,tableOptionsOpen:!1,selectedClasses:"fm-p-2 fm-w-[36px] fm-h-[36px] fm-flex fm-items-center fm-justify-center dark:fm-text-gray-300 fm-rounded fm-cursor-pointer dark:hover:fm-text-gray-300 dark:fm-bg-gray-600 dark:hover:fm-bg-gray-500 fm-text-gray-300 hover:fm-text-white hover:fm-bg-gray-500 !fm-bg-gray-600",unSelectedClasses:"fm-p-2 fm-w-[36px] fm-h-[36px] fm-flex fm-items-center fm-justify-center fm-text-gray-500 fm-rounded fm-cursor-pointer hover:fm-text-gray-900 hover:fm-bg-gray-100 dark:fm-text-gray-400 dark:hover:fm-text-white dark:hover:fm-bg-gray-600",unSelectedClassesNoSize:"fm-p-2 fm-flex fm-items-center fm-justify-center fm-text-gray-500 fm-rounded fm-cursor-pointer hover:fm-text-gray-900 hover:fm-bg-gray-100 dark:fm-text-gray-400 dark:hover:fm-text-white dark:hover:fm-bg-gray-600"}},watch:{modelValue(t){this.editor.getHTML()!==t&&this.editor.commands.setContent(t,!1)}},methods:{toggleTableOptions(){this.tableOptionsOpen=!this.tableOptionsOpen}},mounted(){this.editor=new Nke({extensions:[Ybe,Xbe,Rxe.configure({resizable:!0}),Pxe,Dxe,$xe,Zbe.configure({types:["heading","paragraph"],alignments:["left","center","right"]})],content:this.modelValue,onUpdate:()=>{this.$emit("update:modelValue",this.editor.getHTML())}}),this.editor.commands.focus("end")},beforeUnmount(){this.editor.destroy()}},Fxe={class:"wysiwyg"},jxe={key:0,class:"fm-w-full fm-mb-4 fm-border fm-border-gray-200 fm-rounded-lg fm-bg-gray-50 dark:fm-bg-gray-700 dark:fm-border-gray-600"},zxe={class:"fm-flex fm-items-center fm-justify-between fm-px-3 fm-py-2 fm-border-b dark:fm-border-gray-600"},Vxe={class:"fm-flex fm-flex-wrap fm-items-center fm-divide-gray-200 sm:fm-divide-x dark:fm-divide-gray-600"},Uxe={class:"fm-flex fm-items-center fm-space-x-1 sm:fm-pr-4"},qxe=m("span",{class:"fm-sr-only"}
196,"Heading 1",-1),Wxe=m("span",{class:"fm-sr-only"},"Heading 2",-1),Kxe=m("span",{class:"fm-sr-only"},"Heading 3",-1),Gxe=m("span",{class:"fm-sr-only"},"Heading 4",-1),Jxe=m("span",{class:"fm-sr-only"},"Heading 5",-1),Yxe=m("span",{class:"fm-sr-only"},"Heading 6",-1),Xxe=m("span",{class:"fm-sr-only"},"Paragraph",-1),Zxe={class:"fm-flex fm-flex-wrap fm-items-center fm-space-x-1 sm:fm-px-4"},Qxe=m("span",{class:"fm-sr-only"},"Bold",-1),e5e=m("span",{class:"fm-sr-only"},"Italic",-1),t5e=m("span",{class:"fm-sr-only"},"Underline",-1),n5e=m("span",{class:"fm-sr-only"},"Strike through",-1),r5e={class:"fm-flex fm-flex-wrap fm-items-center fm-space-x-1 sm:fm-px-4"},o5e=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"})],-1),s5e=m("span",{class:"fm-sr-only"},"Left align",-1),i5e=[o5e,s5e],a5e=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"fm-w-5 fm-h-5"},[m("path",{d:"M3.75 6.75H20.25M8 12H15.75M6.5 17.25H17.25","stroke-linecap":"round","stroke-linejoin":"round"})],-1),l5e=m("span",{class:"fm-sr-only"},"Align center",-1),c5e=[a5e,l5e],u5e=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6.75h16.5M3.75 12h16.5M12 17.25h8.25"})],-1),d5e=m("span",{class:"fm-sr-only"},"Right align",-1),f5e=[u5e,d5e],h5e={class:"fm-flex fm-flex-wrap fm-items-center fm-space-x-1 sm:fm-px-4"},p5e=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zM3.75 12h.007v.008H3.75V12zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm-.375 5.25h.007v.008H3.75v-.008zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})],-1),m5e=m("span",{class:"fm-sr-only"},"Unordered list",-1),g5e=[p5e,m5e],y5e=ps('<svg fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="fm-w-5 fm-h-5"><path d="M8.25 6.75H20.25M8.25 12H20.25M8.25 17.25H20.25" stroke-linecap="round" stroke-linejoin="round"></path><path d="M5.31374 4.45459V7.00004H4.77557V4.96542H4.76065L4.17773 5.33083V4.85356L4.80788 4.45459H5.31374Z" fill="currentColor"></path><path d="M4.20632 13V12.6123L5.11239 11.7733C5.18945 11.6987 5.25408 11.6316 5.30629 11.572C5.35932 11.5123 5.3995 11.4539 5.42685 11.3967C5.45419 11.3387 5.46786 11.2761 5.46786 11.209C5.46786 11.1345 5.45088 11.0702 5.4169 11.0164C5.38293 10.9617 5.33653 10.9198 5.2777 10.8908C5.21887 10.861 5.15217 10.8461 5.07759 10.8461C4.9997 10.8461 4.93176 10.8618 4.87376 10.8933C4.81576 10.9248 4.77101 10.97 4.73952 11.0288C4.70804 11.0876 4.69229 11.1577 4.69229 11.2389H4.18146C4.18146 11.0723 4.21916 10.9277 4.29457 10.8051C4.36997 10.6825 4.47562 10.5876 4.61151 10.5205C4.7474 10.4533 4.904 10.4198 5.08132 10.4198C5.26361 10.4198 5.42229 10.4521 5.55735 10.5167C5.69324 10.5805 5.79889 10.6692 5.87429 10.7827C5.94969 10.8962 5.98739 11.0263 5.98739 11.173C5.98739 11.2691 5.96834 11.364 5.93022 11.4576C5.89293 11.5512 5.82623 11.6552 5.73011 11.7696C5.634 11.8831 5.49852 12.0194 5.32369 12.1785L4.95206 12.5427V12.5601H6.02095V13H4.20632Z" fill="currentColor"></path><path d="M5.14719 19.0348C4.96159 19.0348 4.79628 19.0029 4.65128 18.9391C4.5071 18.8745 4.39317 18.7859 4.30948 18.6732C4.22662 18.5596 4.18395 18.4287 4.18146 18.2804H4.72337C4.72668 18.3426 4.74698 18.3972 4.78427 18.4445C4.82238 18.4909 4.87293 18.5269 4.9359 18.5526C4.99888 18.5783 5.06972 18.5911 5.14844 18.5911C5.23047 18.5911 5.30297 18.5766 5.36594 18.5476C5.42892 18.5186 5.47822 18.4784 5.51385 18.4271C5.54948 18.3757 5.56729 18.3165 5.56729 18.2493C5.56729 18.1814 5.54824 18.1213 5.51012 18.0691C5.47283 18.0161 5.41897 17.9747 5.34854 17.9448C5.27894 17.915 5.19608 17.9001 5.09996 17.9001H4.86257V17.5048H5.09996C5.18117 17.5048 5.25284 17.4908 5.31499 17.4626C5.37
196796 17.4344 5.42685 17.3955 5.46165 17.3457C5.49645 17.2952 5.51385 17.2364 5.51385 17.1693C5.51385 17.1055 5.49852 17.0495 5.46786 17.0015C5.43803 16.9526 5.39577 16.9145 5.34109 16.8871C5.28723 16.8598 5.22425 16.8461 5.15217 16.8461C5.07925 16.8461 5.01255 16.8594 4.95206 16.8859C4.89157 16.9116 4.8431 16.9484 4.80664 16.9965C4.77018 17.0446 4.75071 17.1009 4.74822 17.1655H4.23242C4.23491 17.0189 4.27675 16.8896 4.35795 16.7777C4.43916 16.6659 4.54853 16.5785 4.68608 16.5155C4.82446 16.4517 4.98065 16.4198 5.15465 16.4198C5.33031 16.4198 5.48402 16.4517 5.61577 16.5155C5.74751 16.5793 5.84985 16.6655 5.92276 16.774C5.99651 16.8817 6.03297 17.0027 6.03214 17.1369C6.03297 17.2795 5.98864 17.3984 5.89915 17.4937C5.81049 17.5889 5.6949 17.6494 5.55238 17.6751V17.695C5.73964 17.719 5.88216 17.7841 5.97994 17.8901C6.07854 17.9954 6.12743 18.1271 6.1266 18.2854C6.12743 18.4304 6.08558 18.5592 6.00107 18.6719C5.91738 18.7846 5.80179 18.8733 5.6543 18.9379C5.50681 19.0025 5.33777 19.0348 5.14719 19.0348Z" fill="currentColor"></path></svg><span class="fm-sr-only">Ordered list</span>',2),v5e=[y5e],b5e={class:"fm-flex fm-flex-wrap fm-items-center fm-space-x-1 sm:fm-pl-4"},w5e={class:"fm-relative"},k5e=m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 01-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0112 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"})],-1),x5e=[k5e],C5e={key:0,class:"fm-absolute fm-top-[40px] fm-left-0 fm-flex fm-flex-col fm-gap-1 fm-z-10 fm-w-[160px] fm-p-2 fm-bg-gray-50 fm-rounded-b-lg fm-max-h-[200px] fm-overflow-auto"},_5e=m("svg",{"aria-hidden":"true",class:"fm-w-4 fm-h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),S5e=m("span",{class:"fm-sr-only"},"Close wysiwyg",-1),M5e=[_5e,S5e],T5e=m("div",{id:"tooltip-fullscreen",role:"tooltip",class:"fm-absolute fm-z-10 fm-invisible fm-inline-block fm-px-3 fm-py-2 fm-text-sm fm-font-medium fm-text-white fm-transition-opacity fm-duration-300 fm-bg-gray-900 fm-rounded-lg fm-shadow-sm fm-opacity-0 tooltip dark:fm-bg-gray-700"},[Le(" Show full screen "),m("div",{class:"tooltip-arrow","data-
196popper-arrow":""})],-1),E5e={class:"fm-p-2 fm-bg-white fm-rounded-b-lg dark:fm-bg-gray-800 dark:fm-text-white"};function A5e(t,e,n,r,o,s){const i=lf("editor-content");return k(),_("div",Fxe,[o.editor?(k(),_("div",jxe,[m("div",zxe,[m("div",Vxe,[m("div",Uxe,[m("button",{onClick:e[0]||(e[0]=a=>o.editor.chain().focus().toggleHeading({level:1}).run()),type:"button",class:H(o.editor.isActive("heading",{level:1})?o.selectedClasses:o.unSelectedClasses)},[Le(" H1 "),qxe],2),m("button",{onClick:e[1]||(e[1]=a=>o.editor.chain().focus().toggleHeading({level:2}).run()),type:"button",class:H(o.editor.isActive("heading",{level:2})?o.selectedClasses:o.unSelectedClasses)},[Le(" H2 "),Wxe],2),m("button",{onClick:e[2]||(e[2]=a=>o.editor.chain().focus().toggleHeading({level:3}).run()),type:"button",class:H(o.editor.isActive("heading",{level:3})?o.selectedClasses:o.unSelectedClasses)},[Le(" H3 "),Kxe],2),m("button",{onClick:e[3]||(e[3]=a=>o.editor.chain().focus().toggleHeading({level:4}).run()),type:"button",class:H(o.editor.isActive("heading",{level:4})?o.selectedClasses:o.unSelectedClasses)},[Le(" H4 "),Gxe],2),m("button",{onClick:e[4]||(e[4]=a=>o.editor.chain().focus().toggleHeading({level:5}).run()),type:"button",class:H(o.editor.isActive("heading",{level:5})?o.selectedClasses:o.unSelectedClasses)},[Le(" H5 "),Jxe],2),m("button",{onClick:e[5]||(e[5]=a=>o.editor.chain().focus().toggleHeading({level:6}).run()),type:"button",class:H(o.editor.isActive("heading",{level:6})?o.selectedClasses:o.unSelectedClasses)},[Le(" H6 "),Yxe],2),m("button",{onClick:e[6]||(e[6]=a=>o.editor.chain().focus().setParagraph().run()),type:"button",class:H(o.editor.isActive("paragraph")?o.selectedClasses:o.unSelectedClasses)},[Le(" P "),Xxe],2)]),m("div",Zxe,[m("button",{onClick:e[7]||(e[7]=a=>o.editor.chain().focus().toggleBold().run()),type:"button",class:H(o.editor.isActive("bold")?o.selectedClasses:o.unSelectedClasses)},[Le(" B "),Qxe],2),m("button",{onClick:e[8]||(e[8]=a=>o.editor.chain().focus().toggleItalic().run()),type:"button",class:H(o.editor.isActive("italic")?o.selectedClasses:o.unSelectedClasses)},[Le(" I "),e5e],2),m("button",{onClick:e[9]||(e[9]=a=>o.editor.chain().focus().toggleUnderline().run()),type:"button",class:H(o.editor.isActive("underline")?o.selectedClasses:o.unSelectedClasses)},[Le(" U "),t5e],2),m("button",{onClick:e[10]||(e[10]=a=>o.editor.chain().focus().toggleStrike().run()),type:"button",class:H(o.editor.isActive("strike")?o.selectedClasses:o.unSelectedClasses)},[Le(" S "),n5e],2)]),m("div",r5e,[m("button",{onClick:e[11]||(e[11]=a=>o.editor.chain().focus().setTextAlign("left").run()),type:"button",class:H(o.editor.isActive({textAlign:"left"})?o.selectedClasses:o.unSelectedClasses)},i5e,2),m("button",{onClick:e[12]||(e[12]=a=>o.editor.chain().focus().setTextAlign("center").run()),type:"button",class:H(o.editor.isActive({textAlign:"center"})?o.selectedClasses:o.unSelectedClasses)},c5e,2),m("button",{onClick:e[13]||(e[13]=a=>o.editor.chain().focus().setTextAlign("right").run()),type:"button",class:H(o.editor.isActive({textAlign:"right"})?o.selectedClasses:o.unSelectedClasses)},f5e,2)]),m("div",h5e,[m("button",{onClick:e[14]||(e[14]=a=>o.editor.chain().focus().toggleBulletList().run()),type:"button",class:H(o.editor.isActive("bulletList")?o.selectedClasses:o.unSelectedClasses)},g5e,2),m("button",{onClick:e[15]||(e[15]=a=>o.editor.chain().focus().toggleOrderedList().run()),type:"button",class:H(o.editor.isActive("orderedList")?o.selectedClasses:o.unSelectedClasses)},v5e,2)]),m("div",b5e,[m("div",w5e,[m("button",{type:"button",class:H(o.unSelectedClasses),onClick:e[16]||(e[16]=a=>s.toggleTableOptions())},x5e,2),o.tableOptionsOpen?(k(),_("div",C5e,[m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[17]||(e[17]=a=>(s.toggleTableOptions(),o.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()))},"Insert table",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[18]||(e[18]=a=>o.editor.chain().focus().addColumnBefore().run())},"Add column before",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[19]||(e[19]=a=>o.editor.chain().focus().addColumnAfter().run())},"Add column after",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[20]||(e[20]=a=>o.editor.chain().focus().addRowBefore().run())},"Add row before",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[21]||(e[21]=a=>o.editor.chain().focus().addRowAfter().run())},"Add row after",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[22]||(e[22]=a=>o.editor.chain().focus().deleteColumn().run())},"Delete column",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[23]||(e[23]=a=>o.editor.chain().focus().deleteRow().run())},"Delete row",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[24]||(e[24]=a=>(s.toggleTableOptions(),o.editor.chain().focus().deleteTable().run()))},"Delete table",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[25]||(e[25]=a=>o.editor.chain().focus().mergeCells().run())},"Merge cells",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[26]||(e[26]=a=>o.editor.chain().focus().splitCell().run())},"Split cells",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[27]||(e[27]=a=>o.editor.chain().focus().toggleHeaderColumn().run())},"Toggle header column",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[28]||(e[28]=a=>o.editor.chain().focus().toggleHeaderRow().run())},"Toggle header row",2),m("button",{class:H(o.unSelectedClassesNoSize),onClick:e[29]||(e[29]=a=>o.editor.chain().focus().toggleHeaderCell().run())},"Toggle header cell",2)])):L("",!0)])])]),m("button",{type:"button",onClick:e[30]||(e[30]=a=>t.$emit("close")),"data-tooltip-target":"tooltip-fullscreen",class:"fm-p-2 fm-text-gray-500 fm-rounded fm-cursor-pointer sm:fm-ml-auto hover:fm-text-gray-900 hover:fm-bg-gray-100 dark:fm-text-gray-400 dark:hover:fm-text-white dark:hover:fm-bg-gray-600"},M5e),T5e]),m("div",E5e,[Z(i,{editor:o.editor},null,8,["editor"])])])):L("",!0)])}const O5e=Hxe(Bxe,[["render",A5e]]),I5e={key:0},N5e={class:"fm-opacity-50"},L5e={key:1},R5e=Ne({__name:"FmWysiwyg",props:{block:{type:Object,required:!0},fieldName:{type:String,required:!0},label:{type:String,required:!0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t;let n=pe(!1);const r=s=>{s.key==="Escape"&&(n.value=!1)},o=()=>{e.block[e.fieldName]&&e.block[e.fieldName].replace(/<\/?[^>]+(>|$)/g,"").length===0&&(e.block[e.fieldName]=null),n.value=!1,document.dispatchEvent(new CustomEvent("flowmate-input-updated",{}))};return(s,i)=>(k(),_("div",null,[e.editMode?(k(),_("div",I5e,[b(n)?(k(),_("span",L5e,[Z(O5e,{onKeyup:r,onClose:o,class:"fm-text-black",modelValue:e.block[e.fieldName],"onUpdate:modelValue":i[1]||(i[1]=a=>e.block[e.fieldName]=a)},null,8,["modelValue"])])):(k(),_("span",{key:0,onClick:i[0]||(i[0]=a=>kt(n)?n.value=!0:n=!0),class:"fm-cursor-pointer"},[Ot(s.$slots,"default",{},()=>[m("span",N5e,ve(e.label)+": Click to add",1)])]))])):Ot(s.$slots,"default",{key:1})]))}}),$5e={class:"fm-relative"},D5e=m("svg",{fill:"none",stroke:"currentColor",class:"fm-w-5 fm-h-5","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125"})],-1),P5e={class:"fm-sr-only"},H5e={key:1},B5e={key:2,class:"fm-w-full"},F5e=m("div",{class:"fm-flex fm-relative fm-items-center fm-justify-center fm-w-full fm-h-36 fm-bg-gray-300 fm-rounded dark:fm-bg-gray-700 fm-opacity-80"},[m("svg",{class:"fm-w-12 fm-h-12 fm-text-gray-200",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",fill:"
196currentColor",viewBox:"0 0 640 512"},[m("path",{d:"M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z"})])],-1),j5e=[F5e],z5e=Ne({__name:"FmImage",props:{block:{type:Object,required:!0},fieldName:{type:String,required:!0},parent:{type:String,required:!1},blockIndex:{type:Number,required:!0,default:0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t;return(n,r)=>(k(),_("div",null,[m("div",$5e,[e.editMode&&e.configStore?(k(),_("button",{key:0,type:"button",onClick:r[0]||(r[0]=o=>e.configStore.setValues(e.block,e.blockIndex,e.fieldName,["jpg","jpeg","png","gif","webp","avif"],e.configStore.getActiveFieldType,"media",e.block.acf_fc_layout,!1,e.parent)),"data-dial-toggle":"speed-dial-menu-dropdown","aria-controls":"speed-dial-menu-dropdown","aria-expanded":"false",class:"fm-flex fm-items-center fm-justify-center fm-ml-auto fm-text-white !fm-bg-blue-700 fm-rounded-full fm-w-10 fm-h-10 hover:!fm-bg-blue-800 dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 focus:fm-ring-4 focus:fm-ring-blue-300 focus:fm-outline-none dark:focus:fm-ring-blue-800 fm-z-20 fm-absolute fm-top-2 fm-right-2"},[D5e,m("span",P5e,"Edit "+ve(e.configStore.getActiveFieldType),1)])):L("",!0),e.block[e.fieldName]&&e.block[e.fieldName].ID?(k(),_("div",H5e,[Ot(n.$slots,"default")])):(k(),_("div",B5e,j5e))])]))}}),V5e=m("svg",{"aria-hidden":"true",width:"20",height:"20",class:"fm-w-6 fm-h-6",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[m("path",{d:"M10 6C9.46957 6 8.96086 5.78929 8.58579 5.41421C8.21071 5.03914 8 4.53043 8 4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2C10.5304 2 11.0391 2.21071 11.4142 2.58579C11.7893 2.96086 12 3.46957 12 4C12 4.53043 11.7893 5.03914 11.4142 5.41421C11.0391 5.78929 10.5304 6 10 6ZM10 12C9.46957 12 8.96086 11.7893 8.58579 11.4142C8.21071 11.0391 8 10.5304 8 10C8 9.46957 8.21071 8.96086 8.58579 8.58579C8.96086 8.21071 9.46957 8 10 8C10.5304 8 11.0391 8.21071 11.4142 8.58579C11.7893 8.96086 12 9.46957 12 10C12 10.5304 11.7893 11.0391 11.4142 11.4142C11.0391 11.7893 10.5304 12 10 12ZM8 16C8 16.5304 8.21071 17.0391 8.58579 17.4142C8.96086 17.7893 9.46957 18 10 18C10.5304 18 11.0391 17.7893 11.4142 17.4142C11.7893 17.0391 12 16.5304 12 16C12 15.4696 11.7893 14.9609 11.4142 14.5858C11.0391 14.2107 10.5304 14 10 14C9.46957 14 8.96086 14.2107 8.58579 14.5858C8.21071 14.9609 8 15.4696 8 16Z",fill:"currentColor"})],-1),U5e=m("span",{class:"fm-sr-only"},"Open actions menu",-1),q5e=[V5e,U5e],W5e=["innerHTML"],K5e={class:"fm-absolute fm-bottom-0 fm-right-2 fm-flex fm-gap-1"},G5e={class:"fm-relative fm-inline-flex fm-items-center fm-justify-center fm-w-6 fm-h-6 fm-ml-1 fm-mt-1 fm-overflow-hidden fm-bg-gray-100 fm-rounded-full dark:fm-bg-gray-600"},J5e=["title"],Y5e={class:"fm-flex fm-gap-2 fm-flex-col fm-justify-end fm-space-y-2"},X5e={key:0},Z5e={key:0},Q5e=["for","innerHTML"],eCe=["id","onUpdate:modelValue"],tCe={key:0,value:""},nCe=["value","innerHTML"],rCe={key:1,class:"fm-flex fm-items-center"},oCe=["id","onChange","checked"],sCe=["for","innerHTML"],iCe={key:2,class:"fm-flex fm-flex-col"},aCe=["innerHTML"],lCe=["id","value","onUpdate:modelValue"],cCe=["for","innerHTML"],uCe={key:3,class:"fm-flex fm-flex-col"},dCe=["innerHTML"],fCe={key:0},hCe=["id","onUpdate:modelValue"],pCe=["for"],mCe=["id","value","onUpdate:modelValue"],gCe=["for","innerHTML"],yCe={key:4,class:"fm-flex fm-flex-col"},vCe=["onClick"],bCe={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"fm-w-6 fm-h-6"},wCe=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z"},null,-1),kCe=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 6h.008v.008H6V6z"},null,-1),xCe=[wCe,kCe],CCe={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"fm-w-6 fm-h-6"},_Ce=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1),SCe=[_Ce],MCe=["innerHTML"],TCe={key:0},ECe={key:0},ACe=["for","innerHTML"],OCe=["id","onUpdate:modelValue"],ICe={key:0,value:""},NCe=["value","innerHTML"],LCe={key:1,class:"fm-flex fm-items-center"},RCe=["id","onChange","checked"],$Ce=["for","innerHTML"],DCe={key:2,class:"fm-flex fm-flex-col"},PCe=["innerHTML"],HCe=["id","value","onUpdate:modelValue"],BCe=["for","innerHTML"],FCe={key:3,class:"fm-flex fm-flex-col"}
196,jCe=["innerHTML"],zCe={key:0},VCe=["id","onUpdate:modelValue"],UCe=["for"],qCe=["id","value","onUpdate:modelValue"],WCe=["for","innerHTML"],KCe={key:4,class:"fm-flex fm-flex-col"},GCe=["onClick"],JCe={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"fm-w-6 fm-h-6"},YCe=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z"},null,-1),XCe=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 6h.008v.008H6V6z"},null,-1),ZCe=[YCe,XCe],QCe={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"fm-w-6 fm-h-6"},e_e=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1),t_e=[e_e],n_e=["innerHTML"],r_e=Ne({__name:"FmSettings",props:{layout:{type:String,required:!0},block:{type:Object,required:!0},editMode:{type:Boolean,required:!0,default:!1},blockIndex:{type:Number,required:!0,default:0},configStore:{type:Object,required:!1,default:!1},collaborationsStore:{type:Object,required:!1,default:!1},additionalFields:{type:Array,required:!1}},setup(t){const e=t,n=pe(!1),r=e.configStore?e.configStore.getConfig:!1,o=Math.random().toString(36).substring(7),s=()=>{n.value=!n.value},i=(g,y,w)=>{g&&g.target&&g.target&&g.target instanceof HTMLInputElement&&(g.target.checked?w?e.block[y]=!0:e.block.settings[y]=!0:w?e.block[y]=!1:e.block.settings[y]=!1,h())},a=pe(),l=g=>{if(n.value){if(g.target!==a.value&&g.composedPath().includes(a.value))return;n.value=!1}};Zt(()=>{window.addEventListener("click",l)}),Fo(()=>{window.removeEventListener("click",l)});const c=U(()=>e.collaborationsStore&&e.collaborationsStore.getCollaborationGuests&&e.collaborationsStore.getCollaborationGuests.length>0?e.collaborationsStore.getCollaborationGuests.find(g=>g.activeBlockIndex===e.blockIndex):!1),u=U(()=>{if(c.value)return e.collaborationsStore.getGuestColor(c.value.name).border}),d=U(()=>{if(c.value)return e.collaborationsStore.getGuestColor(c.value.name).bg}),f=U(()=>e.collaborationsStore&&e.collaborationsStore.getCollaborationGuests&&e.collaborationsStore.getCollaborationGuests.length>0?e.collaborationsStore.getCollaborationGuests.filter(g=>g.activeBlockIndex===e.blockIndex):!1),h=()=>{document.dispatchEvent(new CustomEvent("flowmate-input-updated",{}))},p=U(()=>{var g;return(g=r.config[e.layout])==null?void 0:g.settings});return(g,y)=>e.editMode&&b(r)&&b(r).config?(k(),_("div",{key:0,ref_key:"fmSettings",ref:a,class:H(["fm-absolute fm-right-0 fm-bottom-0 fm-top-0 fm-left-0 fm-pointer-events-none group fm-settings",[n.value?"fm-z-40":"fm-z-10",u.value?u.value:"show-border"]])},[m("button",{type:"button",onClick:s,"aria-controls":"speed-dial-menu-dropdown","aria-expanded":"false",style:{"pointer-events":"all!important"},class:"fm-flex fm-absolute fm-top-4 fm-right-4 fm-items-center fm-justify-center fm-ml-auto fm-text-white !fm-bg-blue-700 fm-rounded-full fm-w-10 fm-h-10 hover:!fm-bg-blue-800 dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 focus:fm-ring-4 focus:fm-ring-blue-300 focus:fm-outline-none dark:focus:fm-ring-blue-800"},q5e),b(r).config[e.layout].acf_fc_label?(k(),_("span",{key:0,class:H(["fm-absolute fm-top-0 fm-left-0 fm-px-[8px] fm-py-[2px] fm-text-white fm-text-xs fm-layout-label fm-invisible",d.value?d.value:"!fm-bg-blue-700 dark:!fm-bg-blue-600"]),innerHTML:b(r).config[e.layout].acf_fc_label},null,10,W5e)):L("",!0),m("div",K5e,[(k(!0),_(ce,null,Oe(f.value,(w,x)=>(k(),_("div",{class:H(["fm-relative fm-w-8 fm-h-8 fm-rounded-full fm-rounded-bl-none fm-rounded-br-none",t.collaborationsStore.getGuestColor(w.name).bg]),key:x},[m("div",G5e,[m("span",{class:"fm-cursor-default fm-font-medium fm-text-gray-600 dark:fm-text-gray-300 fm-uppercase fm-text-sm",title:w.name},ve(t.collaborationsStore.getGuestInitials(w.name)),9,J5e)])],2))),128))]),m("div",{style:{"pointer-events":"all!important"},class:H(["fm-pointer-events-all fm-absolute fm-right-4 fm-top-14 fm-w-[300px] fm-max-h-[400px] fm-overflow-auto fm-p-4 fm-mt-2 fm-bg-white fm-border fm-border-gray-100 fm-rounded-lg fm-shadow-sm dark:fm-border-gray-600 dark:fm-bg-gray-700",n.value?"":"fm-hidden"])}
196,[m("div",Y5e,[(k(!0),_(ce,null,Oe(p.value.sub_fields,(w,x)=>(k(),_("div",null,[typeof w=="object"?(k(),_("div",X5e,[w.type==="select"?(k(),_("div",Z5e,[m("label",{for:x+b(o),class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:w.label},null,8,Q5e),Ie(m("select",{id:x+b(o),"onUpdate:modelValue":C=>e.block.settings[x]=C,onChange:h,class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},[w.allow_null===1?(k(),_("option",tCe,"- Select -")):L("",!0),(k(!0),_(ce,null,Oe(w.choices,(C,v)=>(k(),_("option",{value:v,innerHTML:C},null,8,nCe))),256))],40,eCe),[[co,e.block.settings[x]]])])):L("",!0),w.type==="true_false"?(k(),_("div",rCe,[m("input",{id:x+b(o),onChange:C=>i(C,x,!1),checked:e.block.settings[x]===!0,type:"checkbox",value:!0,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,oCe),m("label",{for:x+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300",innerHTML:w.label},null,8,sCe)])):L("",!0),w.type==="checkbox"?(k(),_("div",iCe,[m("p",{class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:w.label},null,8,aCe),(k(!0),_(ce,null,Oe(w.choices,(C,v)=>(k(),_("div",null,[Ie(m("input",{id:v+x+b(o),value:v,type:"checkbox","onUpdate:modelValue":S=>e.block.settings[x]=S,onChange:h,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,lCe),[[yl,e.block.settings[x]]]),m("label",{for:v+x+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300",innerHTML:C},null,8,cCe)]))),256))])):L("",!0),w.type==="radio"?(k(),_("div",uCe,[m("p",{class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:w.label},null,8,dCe),w.allow_null===1?(k(),_("div",fCe,[Ie(m("input",{id:"null_"+x+b(o),value:"",type:"radio","onUpdate:modelValue":C=>e.block.settings[x]=C,onChange:h,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,hCe),[[zs,e.block.settings[x]]]),m("label",{for:"null_"+x+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300"},"- None -",8,pCe)])):L("",!0),(k(!0),_(ce,null,Oe(w.choices,(C,v)=>(k(),_("div",null,[Ie(m("input",{id:v+x+b(o),value:v,type:"radio","onUpdate:modelValue":S=>e.block.settings[x]=S,onChange:h,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,mCe),[[zs,e.block.settings[x]]]),m("label",{for:v+x+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300",innerHTML:C},null,8,gCe)]))),256))])):L("",!0),w.type==="taxonomy"||w.type==="post_object"||w.type==="relationship"?(k(),_("div",yCe,[e.configStore?(k(),_("button",{key:0,onClick:C=>e.configStore.setValues(e.block,e.blockIndex,x,[],"","posts",e.layout,!0,""),type:"button",class:"fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},[w.type==="taxonomy"?(k(),_("svg",bCe,xCe)):(k(),_("svg",CCe,SCe)),m("span",{innerHTML:w.label},null,8,MCe)],8,vCe)):L("",!0)])):L("",!0)])):L("",!0)]))),256)),e.additionalFields&&e.additionalFields.length>0?(k(!0),_(ce,{key:0},Oe(e.additionalFields,w=>(k(),_("div",null,[typeof w=="string"&&typeof b(r).config[e.layout][w]=="object"?(k(),_("div",TCe,[b(r).config[e.layout][w].type==="select"?(k(),_("div",ECe,[m("label",{for:w+b(o),class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:b(r).config[e.layout][w].label},null,8,ACe),Ie(m("select",{id:w+b(o),"onUpdate:modelValue":x=>e.block[w]=x,onChange:h,class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},[b(r).config[e.layout][w].allow_null===1?(k(),_("option",ICe,"- Select -")):L("",!0),(k(!0),_(ce,null,Oe(b
196(r).config[e.layout][w].choices,(x,C)=>(k(),_("option",{value:C,innerHTML:x},null,8,NCe))),256))],40,OCe),[[co,e.block[w]]])])):L("",!0),b(r).config[e.layout][w].type==="true_false"?(k(),_("div",LCe,[m("input",{id:w+b(o),onChange:x=>i(x,w,!0),checked:e.block[w]===!0,type:"checkbox",value:!0,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,RCe),m("label",{for:w+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300",innerHTML:b(r).config[e.layout][w].label},null,8,$Ce)])):L("",!0),b(r).config[e.layout][w].type==="checkbox"?(k(),_("div",DCe,[m("p",{class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:b(r).config[e.layout][w].label},null,8,PCe),(k(!0),_(ce,null,Oe(b(r).config[e.layout][w].choices,(x,C)=>(k(),_("div",null,[Ie(m("input",{id:w+C+b(o),value:C,type:"checkbox","onUpdate:modelValue":v=>e.block[w]=v,onChange:h,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,HCe),[[yl,e.block[w]]]),m("label",{for:w+C+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300",innerHTML:x},null,8,BCe)]))),256))])):L("",!0),b(r).config[e.layout][w].type==="radio"?(k(),_("div",FCe,[m("p",{class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:b(r).config[e.layout][w].label},null,8,jCe),b(r).config[e.layout][w].allow_null===1?(k(),_("div",zCe,[Ie(m("input",{id:"null_"+w+b(o),value:"",type:"radio","onUpdate:modelValue":x=>e.block[w]=x,onChange:h,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,VCe),[[zs,e.block[w]]]),m("label",{for:"null_"+w+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300"}
196,"- None -",8,UCe)])):L("",!0),(k(!0),_(ce,null,Oe(b(r).config[e.layout][w].choices,(x,C)=>(k(),_("div",null,[Ie(m("input",{id:w+C+b(o),value:C,type:"radio","onUpdate:modelValue":v=>e.block[w]=v,onChange:h,class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,qCe),[[zs,e.block[w]]]),m("label",{for:w+C+b(o),class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300",innerHTML:x},null,8,WCe)]))),256))])):L("",!0),b(r).config[e.layout][w].type==="taxonomy"||b(r).config[e.layout][w].type==="post_object"||b(r).config[e.layout][w].type==="relationship"?(k(),_("div",KCe,[e.configStore?(k(),_("button",{key:0,onClick:x=>e.configStore.setValues(e.block,e.blockIndex,w,[],"","posts",e.layout,!1,""),type:"button",class:"fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},[b(r).config[e.layout][w].type==="taxonomy"?(k(),_("svg",JCe,ZCe)):(k(),_("svg",QCe,t_e)),m("span",{innerHTML:b(r).config[e.layout][w].label},null,8,n_e)],8,GCe)):L("",!0)])):L("",!0)])):L("",!0)]))),256)):L("",!0)])],2)],2)):L("",!0)}}),o_e={key:0},s_e={key:0,class:"fm-flex fm-gap-y-4 fm-gap-2 fm-flex-wrap fm-p-6 fm-bg-white fm-border fm-border-gray-200 fm-rounded-lg fm-shadow dark:fm-bg-gray-800 dark:fm-border-gray-700 fm-relative"},i_e=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1),a_e=[i_e],l_e={key:0},c_e=["for","innerHTML"],u_e=["onUpdate:modelValue","type","id","placeholder"],d_e={key:1,class:"fm-flex fm-items-center"},f_e=["id","onChange","checked"],h_e=["for"],p_e={key:1},m_e=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),g_e=Ne({__name:"FmLink",props:{block:{type:Object,required:!0},field:{type:Object,required:!0},label:{type:String,required:!0},fieldName:{type:String,required:!0},required:{type:Boolean,required:!0,default:!1},repeaterIndex:{type:Number,required:!1,default:0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t,n=Math.random().toString(36).substring(7);let r=or({title:"",url:"",target:""});const o=(a,l)=>{a&&a.target&&a.target&&a.target instanceof HTMLInputElement&&(console.log(a.target.checked),a.target.checked?e.field[l]="_blank":e.field[l]="")},s=()=>{console.log("ADD LINK"),e.block[e.fieldName]=r,r=or({title:"",url:"",target:""})},i=()=>{e.block[e.fieldName]=!1};return(a,l)=>(k(),_("div",null,[e.editMode?(k(),_("div",o_e,[e.field?(k(),_("div",s_e,[e.required?L("",!0):(k(),_("svg",{key:0,onClick:i,"aria-label":"Delete block",title:"Delete block",fill:"none",class:"fm-absolute fm-top-2 fm-right-2 fm-w-4 fm-h-4 fm-cursor-pointer",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"}
196,a_e)),(k(!0),_(ce,null,Oe(b(r),(c,u)=>(k(),_("div",{class:H(typeof u=="string"&&u==="target"?"fm-w-full":"fm-w-[calc(50%-0.25rem)]")},[typeof u=="string"&&u==="url"||typeof u=="string"&&u==="title"?(k(),_("div",l_e,[m("label",{for:b(n)+u,class:"fm-block fm-mb-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-white",innerHTML:u==="url"?"URL":u==="title"?"Title":u},null,8,c_e),Ie(m("input",{"onUpdate:modelValue":d=>e.field[u]=d,type:u==="url"?"url":"text",id:b(n)+u,class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500",placeholder:u==="url"?"URL":u==="title"?"Title":u,required:""},null,8,u_e),[[ZT,e.field[u]]])])):L("",!0),typeof u=="string"&&u==="target"?(k(),_("div",d_e,[m("input",{id:b(n)+u+t.repeaterIndex,onChange:d=>o(d,u),checked:e.field[u]==="_blank",type:"checkbox",value:"_blank",class:"fm-w-4 fm-h-4 fm-text-blue-600 fm-bg-gray-100 fm-border-gray-300 fm-rounded-full focus:fm-ring-blue-500 dark:focus:fm-ring-blue-600 dark:fm-ring-offset-gray-800 focus:fm-ring-2 dark:fm-bg-gray-700 dark:fm-border-gray-600"},null,40,f_e),m("label",{for:b(n)+u+t.repeaterIndex,class:"fm-ml-2 fm-text-sm fm-font-medium fm-text-gray-900 dark:fm-text-gray-300"},"Open in new tab",8,h_e)])):L("",!0)],2))),256))])):(k(),_("div",p_e,[m("button",{onClick:s,type:"button",class:"fm-mt-4 fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},[m_e,m("span",null,"Add "+ve(e.label),1)])]))])):Ot(a.$slots,"default",{key:1})]))}}),y_e={key:0},v_e=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),b_e=Ne({__name:"FmRepeater",props:{block:{type:Object,required:!0},fieldName:{type:String,required:!0},label:{type:String,required:!0},layout:{type:String,required:!0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t,n=e.configStore?e.configStore.getConfig:!1,r=()=>{e.block[e.fieldName]||(e.block[e.fieldName]=[]),e.block[e.fieldName].push({});for(const s in n.config[e.layout][e.fieldName].sub_fields)n.config[e.layout][e.fieldName].sub_fields[s].type==="link"?e.block[e.fieldName][e.block[e.fieldName].length-1][s]={title:"",url:"",target:""}:n.config[e.layout][e.fieldName].sub_fields[s].choices?e.block[e.fieldName][e.block[e.fieldName].length-1][s]=Object.keys(n.config[e.layout][e.fieldName].sub_fields[s].choices)[0]:e.block[e.fieldName][e.block[e.fieldName].length-1][s]=""};Ye(n,(s,i)=>{console.log("CONFIG CHANGE FROM",i),console.log("CONFIG CHANGE TO",s)});const o=U(()=>{if(n&&n.config&&n.config[e.layout])if(n.config[e.layout][e.fieldName].max){if(!e.block[e.fieldName]||e.block[e.fieldName].length<n.config[e.layout][e.fieldName].max)return!0}else return!0;return!1});return(s,i)=>(k(),_("div",null,[e.editMode?(k(),_("div",y_e,[Ot(s.$slots,"default"),m("button",{onClick:r,type:"button",class:H([o.value?"":"fm-opacity-30 fm-pointer-events-none","fm-mt-4 fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"])},[v_e,m("span",null,"Add "+ve(e.label),1)],2)])):Ot(s.$slots,"default",{key:1})]))}}),w_e={key:0},k_e=["value","innerHTML"],x_e=["value","innerHTML"],C_e=Ne({__name:"FmSelect",props:{layout:{type:String,required:!0},block:{type:Object,required:!0},fieldName:{type:String,required:!0},label:{type:String,required:!0},repeaterIndex:{type:Number,required:!1,default:0},parent:{type:String,required:!1},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t,n=U(()=>{const o=e.configStore?e.configStore.getConfig:!1;return o&&o.config&&o.config[e.layout]?e.parent?o.config[e.layout][e.parent].sub_fields[e.fieldName].choices:o.c
196onfig[e.layout][e.fieldName].choices:!1}),r=()=>{document.dispatchEvent(new CustomEvent("flowmate-input-updated",{}))};return(o,s)=>(k(),_("div",null,[e.editMode&&n.value?(k(),_("div",w_e,[e.parent?Ie((k(),_("select",{key:0,"onUpdate:modelValue":s[0]||(s[0]=i=>e.block[e.parent][e.repeaterIndex][e.fieldName]=i),onChange:r,class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},[(k(!0),_(ce,null,Oe(n.value,(i,a)=>(k(),_("option",{value:a,innerHTML:i},null,8,k_e))),256))],544)),[[co,e.block[e.parent][e.repeaterIndex][e.fieldName]]]):Ie((k(),_("select",{key:1,"onUpdate:modelValue":s[1]||(s[1]=i=>e.block[e.fieldName]=i),onChange:r,class:"fm-bg-gray-50 fm-border fm-border-gray-300 fm-text-gray-900 fm-text-sm fm-rounded-lg focus:fm-ring-blue-500 focus:fm-border-blue-500 fm-block fm-w-full fm-p-2.5 dark:fm-bg-gray-700 dark:fm-border-gray-600 dark:fm-placeholder-gray-400 dark:fm-text-white dark:focus:fm-ring-blue-500 dark:focus:fm-border-blue-500"},[(k(!0),_(ce,null,Oe(n.value,(i,a)=>(k(),_("option",{value:a,innerHTML:i},null,8,x_e))),256))],544)),[[co,e.block[e.fieldName]]])])):Ot(o.$slots,"default",{key:1})]))}}),__e={key:0},S_e=m("svg",{fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",class:"fm-w-5 fm-h-5"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),$3e=Ne({__name:"FmFile",props:{block:{type:Object,required:!0},fieldName:{type:String,required:!0},parent:{type:String,required:!1},label:{type:String,required:!1,default:"file"},acceptedMediaTypes:{type:Array,required:!1,default:[]},blockIndex:{type:Number,required:!0,default:0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t;return(n,r)=>e.editMode&&e.configStore?(k(),_("div",__e,[m("button",{onClick:r[0]||(r[0]=o=>e.configStore.setValues(e.block,e.blockIndex,e.fieldName,e.acceptedMediaTypes,"file","media",e.block.acf_fc_layout,!1,e.parent)),type:"button",class:"fm-mt-4 fm-text-white !fm-bg-blue-700 hover:!fm-bg-blue-800 focus:fm-ring-4 focus:fm-outline-none focus:fm-ring-blue-300 fm-font-medium fm-rounded-lg fm-text-sm fm-p-3 fm-text-center fm-inline-flex fm-items-center dark:!fm-bg-blue-600 dark:hover:!fm-bg-blue-700 dark:focus:fm-ring-blue-800 fm-justify-center fm-gap-2"},[S_e,m("span",null,"Add "+ve(e.label),1)])])):L("",!0)}}),M_e={key:0},T_e=m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1),E_e=[T_e],A_e=Ne({__name:"FmRemoveRepeaterIndexButton",props:{layout:{type:String,required:!0},block:{type:Object,required:!0},fieldName:{type:String,required:!0},repeaterIndex:{type:Number,required:!0,default:0},editMode:{type:Boolean,required:!0,default:!1},configStore:{type:Object,required:!1,default:!1}},setup(t){const e=t,n=()=>{e.block[e.fieldName].length===1?e.block[e.fieldName]=!1:e.block[e.fieldName].splice(e.repeaterIndex,1)},r=U(()=>{const o=e.configStore?e.configStore.getConfig:!1;if(o&&o.config&&o.config[e.layout])if(o.config[e.layout][e.fieldName].min){if(e.block[e.fieldName].length>o.config[e.layout][e.fieldName].min)return!0}else return!0;return!1});return(o,s)=>e.editMode?(k(),_("div",M_e,[(k(),_("svg",{onClick:s[0]||(s[0]=i=>n()),class:H([r.value?"":"fm-opacity-30 fm-pointer-events-none","fm-z-10 fm-absolute fm-top-2 fm-right-2 fm-w-4 fm-h-4 fm-cursor-pointer"]),"aria-label":"Delete block",title:"Delete block",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},E_e,2))])):L("",!0)}}),O_e={install:(t,e)=>{}},I_e=In(t=>{const e=yo();t.vueApp.use(O_e),t.vueApp.use(cge,{backend:e.public.backendUrl,frontend:e.public.frontendUrl,flex_group_id:e.public.flowmateFlexID,backendDriver:e.public.flowmateBackendDriver}),t.vueApp.component("fm-text",pge),t.vueApp.component("fm-wysiwyg",R5e),t.vueApp.component("fm-image",z5e),t.vueApp.component("fm-settings",r_e),t.vueApp.component("fm-link",g_e),t.vueApp.component("fm-repeater",b_e),t.vueApp.component("fm-remove-repeater-index-button",A_e),t.vueApp.component("fm-select",C_e)});var mM=/^GTM-[0-9A-Z]+$/;function E1(t){if(typeof t!="string"||!mM.test(t)){let e=String(t).toUpperCase().replace(/.*-|[^0-9A-Z]/g,""),n=e.length===0?"":` Did you mean 'GTM-${e}'?`;throw new Error(`'${t}' is not a valid GTM-ID (${mM}
196).${n}`)}}function wd(t,e="dataLayer"){return t[e]||(t[e]=[]),t[e]}function Ec(t,e){let n=document,r=n.createElement("script"),o=c=>{e.onReady?.({id:t,script:r}),r.removeEventListener("load",o)};r.addEventListener("load",o);let s=e.dataLayerName??"dataLayer";if(wd(window,s).push({event:"gtm.js","gtm.start":new Date().getTime()}),!t)return r;r.async=!e.defer,r.defer=!!(e.defer||e.compatibility),e.nonce&&r.setAttribute("nonce",e.nonce),e.scriptType&&(r.type=e.scriptType);let i=new URLSearchParams({id:t,...e.dataLayerName?{l:e.dataLayerName}:{},...e.queryParams??{}}),a=e.source??"https://www.googletagmanager.com/gtm.js";r.src=`${a}?${i}`;let l=e.parentElement??n.body;if(typeof l?.appendChild!="function")throw new Error("parentElement must be a DOM element");return l.appendChild(r),r}function N_e(t="https://www.googletagmanager.com/gtm.js"){return Array.from(document.getElementsByTagName("script")).some(e=>e.src.includes(t))}var L_e=class{id;options;scriptElements=[];constructor(t){if(Array.isArray(t.id))for(let e of t.id)E1(typeof e=="string"?e:e.id);else E1(t.id);this.id=t.id,this.options={enabled:!0,debug:!1,loadScript:!0,defer:!1,compatibility:!1,dataLayerName:"dataLayer",...t},delete this.options.id}isInBrowserContext=()=>typeof window<"u";enabled(){return this.options.enabled??!0}enable(t=!0,e){if(this.options.enabled=t,this.isInBrowserContext()&&t&&!N_e(e)&&this.options.loadScript)if(Array.isArray(this.id))this.id.forEach(n=>{let r;typeof n=="string"?r=Ec(n,{...this.options}):r=Ec(n.id,{...this.options,queryParams:n.queryParams}),this.scriptElements.push(r)});else{let n=Ec(this.id,{...this.options});this.scriptElements.push(n)}}debugEnabled(){return this.options.debug??!1}debug(t){this.options.debug=t}dataLayer(){return this.isInBrowserContext()&&this.options.enabled?wd(window,this.options.dataLayerName):!1}trackView(t,e,n={}){let r=this.isInBrowserContext()&&(this.options.enabled??!1);this.options.debug&&console.log(`[GTM-Support${r?"":"(disabled)"}]: Dispatching TrackView`,{screenName:t,path:e}),r&&wd(window,this.options.dataLayerName).push({...n,event:this.options.trackViewEventProperty??"content-view","content-name":e,"content-view-name":t})}trackEvent({event:t,category:e=null,action:n=null,label:r=null,value:o=null,noninteraction:s=!1,...i}={}){let a=this.isInBrowserContext()&&(this.options.enabled??!1);this.options.debug&&console.log(`[GTM-Support${a?"":"(disabled)"}]: Dispatching event`,{event:t,category:e,action:n,label:r,value:o,...i}),a&&wd(window,this.options.dataLayerName).push({event:t??"interaction",target:e,action:n,"target-properties":r,value:o,"interaction-type":s,...i})}push(t){let e=this.isInBrowserContext()&&(this.options.enabled??!1);this.options.debug&&console.log(`[GTM-Support${e?"":"(disabled)"}]: Dispatching event`,t),e&&wd(window,this.options.dataLayerName).push(t)}},js;function R_e(t,e={id:""}){e={trackOnNextTick:!1,...e},js=new L_e(e),t.config.globalProperties.$gtm=js,js.isInBrowserContext()&&(e.vueRouter&&$_e(t,e.vueRouter,e.ignoredViews,e.trackOnNextTick,e.vueRouterAdditionalEventData),js.options.enabled&&js.options.loadScript&&(Array.isArray(e.id)?e.id.forEach(n=>{if(typeof n=="string")Ec(n,e);else{let r={...e};n.queryParams!=null&&(r.queryParams={...r.queryParams,...n.queryParams}),Ec(n.id,r)}}):Ec(e.id,e))),t.provide("gtm",e)}function $_e(t,e,n=[],r,o=()=>({})){function s(i,a){return i instanceof Error?!!(i.type&a):!1}e.afterEach(async(i,a,l)=>{if(typeof i.name!="string"||Array.isArray(n)&&n.includes(i.name)||typeof n=="function"&&n(i,a))return;let c=i.meta&&typeof i.meta.gtm=="string"&&i.meta.gtm?i.meta.gtm:i.name;s(l,4)?js?.debugEnabled()&&console.log(`[VueGtm]: '${c}' not tracked due to navigation aborted`):s(l,8)&&js?.debugEnabled()&&console.log(`[VueGtm]: '${c}' not tracked due to navigation cancelled`);let u={...await o(i,a),...i.meta?.gtmAdditionalEventData},d=e.options?.history?.base??"";d.endsWith("/")||(d+="/"),d+=i.fullPath.startsWith("/")?i.fullPath.substring(1):i.fullPath,r?mn(()=>{js?.trackView(c,d,u)}):js?.trackView(c,d,u)})}function D_e(t){return{install:e=>R_e(e,t)}}const P_e=In(t=>{const e=yo();e.public.gtmEnabled&&t.hook("app:mounted",()=>{t.vueApp.use(D_e({id:e.public.gtmId,defer:!1,compatibility:!1,enabled:!0,debug:!0,loadScript:!0,vueRouter:!1,trackOnNextTick:!1,pageTracking:!1,pageViewEventName:"nuxtRoute",respectDoNotTrack:!1}))})});function H_e(t){const e=yo(),n=new URL(t);let r=t;const o=e.public.frontendUrl!==void 0&&e.public.frontendUrl!==null?e.public.frontendUrl:!1;return o&&(r=o+n.pathname),{url:r,isProxy:o!==!1}}function yI(t,e){const n=yo();let r;try{r=new URL(t)}catch{return{url:t,isProxy:!1}}let o=t;const s=n.public.imageProxyUrl!==void 0&&n.public.imageProxyUrl!==null?n.public.imageProxyUrl:!1;return s&&(o=s+r.pathname.replace("/wp-content/uploads/","/")),e&&(o=o+"?cmv="+e),{url:o,isProxy:s!==!1}}const B_e=In(t=>{function e(n){if(n===void 0)return[];const r=n.title??n.title,o=[];let s="";if(n.robots&&n.robots&&o.push({hid:"robots",name:"robots",content:Object.values(n.robots).join(", ")}),n.og_description&&o.push({hid:"description",name:"description",content:n.og_description}),n.og_title&&o.push({hid:"og:title",property:"og:title",content:n.og_title}),n.og_image&&n.og_image.length>0){const{url:i}=yI(n.og_image[0].url);o.push({hid:"og:image",property:"og:image",content:i})}if(n.og_description&&o.push({hid:"og:description",property:"og:description",content:n.og_description}),n.og_url){const{url:i}=H_e(n.og_url);o.push({hid:"og:url",property:"og:url",content:i}),s=i}return{title:r,meta:o,link:s?[{rel:"canonical",href:s}]:[]}}return{provide:{yoastHead:n=>e(n)}}}),F_e=[AD,ID,DD,gH,NH,LH,RH,$H,DH,PH,HH,BH,WH,GH,I_e,P_e,B_e],j_e=Ne({name:"NuxtRouteAnnouncer",props:{atomic:{type:Boolean,default:!1},politeness:{type:String,default:"polite"}},setup(t,{slots:e,expose:n}){const{set:r,polite:o,assertive:s,message:i,politeness:a}=_H({politeness:t.politeness});return n({set:r,polite:o,assertive:s,message:i,politeness:a}),()=>mt("span",{class:"nuxt-route-announcer",style:{position:"absolute"}},mt("span",{role:"alert","aria-live":a.value,"aria-atomic":t.atomic,style:{border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",width:"1px",overflow:"hidden",position:"absolute","white-space":"nowrap","word-wrap":"normal",margin:"-1px",padding:"0"}},e.default?e.default({message:i.value}):i.value))}}),vI=(t="RouteProvider")=>Ne({name:t,props:{route:{type:Object,required:!0},vnode:Object,vnodeRef:Object,renderKey:String,trackRootNodes:Boolean},setup(e){const n=e.renderKey,r=e.route,o={};for(const s in e.route)Object.defineProperty(o,s,{get:()=>n===e.renderKey?e.route[s]:r[s],enumerable:!0});return Ks(vl,es(o)),()=>e.vnode?mt(e.vnode,{ref:e.vnodeRef}):e.vnode}}),z_e=vI(),gM=new WeakMap,V_e=Ne({name:"NuxtPage",inheritAttrs:!1,props:{name:{type:String},transition:{type:[Boolean,Object],default:void 0},keepalive:{type:[Boolean,Object],default:void 0},route:{type:Object},pageKey:{type:[Function,String],default:null}},setup(t,{attrs:e,slots:n,expose:r}){const o=vt(),s=pe(),i=un(vl,null);let a;r({pageRef:s});const l=un(b3,null);let c;const u=o.deferHydration();if(o.isHydrating){const f=o.hooks.hookOnce("app:error",u);gn().beforeEach(f)}t.pageKey&&Ye(()=>t.pageKey,(f,h)=>{f!==h&&o.callHook("page:loading:start")});let d=!1;{const f=gn().beforeResolve(()=>{d=!1});Fo(()=>{f()})}return()=>mt(G3,{name:t.name,route:t.route,...e},{default:f=>{const h=q_e(i,f.route,f.Component),p=i&&i.matched.length===f.route.matched.length;if(!f.Component){if(c&&!p)return c;
196u();return}if(c&&l&&!l.isCurrent(f.route))return c;if(h&&i&&(!l||l?.isCurrent(i)))return p?c:null;const g=uv(f,t.pageKey),y=W_e(i,f.route,f.Component);!o.isHydrating&&a===g&&!y&&mn(()=>{d=!0,o.callHook("page:loading:end")}),a=g;const w=!!(t.transition??f.route.meta.pageTransition??$5),x=w&&U_e([t.transition,f.route.meta.pageTransition,$5,{onAfterLeave(){delete o._runningTransition,o.callHook("page:transition:finish",f.Component)}}]),C=t.keepalive??f.route.meta.keepalive??l$;return c=Y3(w&&x,WP(C,mt(Ow,{suspensible:!0,onPending:()=>{w&&(o._runningTransition=!0),o.callHook("page:start",f.Component)},onResolve:async()=>{await mn();try{o._route.sync?.(),await o.callHook("page:finish",f.Component),delete o._runningTransition,!d&&!y&&(d=!0,await o.callHook("page:loading:end"))}finally{u()}}},{default:()=>{const v={key:g||void 0,vnode:n.default?K_e(n.default,f):f.Component,route:f.route,renderKey:g||void 0,trackRootNodes:w,vnodeRef:s};if(!C)return mt(z_e,v);const S=f.Component.type,E=S;let M=gM.get(E);return M||(M=vI(S.name||S.__name),gM.set(E,M)),mt(M,v)}}))).default(),c}})}});function U_e(t){const e=[];for(const n of t)n&&e.push({...n,onAfterLeave:n.onAfterLeave?Vw(n.onAfterLeave):void 0});return y3(...e)}function q_e(t,e,n){if(!t)return!1;const r=e.matched.findIndex(o=>o.components?.default===n?.type);return!r||r===-1?!1:e.matched.slice(0,r).some((o,s)=>o.components?.default!==t.matched[s]?.components?.default)||n&&uv({route:e,Component:n})!==uv({route:t,Component:n})}function W_e(t,e,n){return t?e.matched.findIndex(o=>o.components?.default===n?.type)<e.matched.length-1:!1}function K_e(t,e){const n=t(e);return n.length===1?mt(n[0]):mt(ce,void 0,n)}const G_e=Ne({name:"LayoutLoader",inheritAttrs:!1,props:{name:String,layoutProps:Object},setup(t,e){return()=>mt(Hi[t.name],t.layoutProps,e.slots)}}),J_e={name:{type:[String,Boolean,Object],default:null},fallback:{type:[String,Object],default:null}},Y_e=Ne({name:"NuxtLayout",inheritAttrs:!1,props:J_e,setup(t,e){const n=vt(),r=un(vl),s=!r||r===Cs()?J3():r,i=U(()=>{let u=b(t.name)??s?.meta.layout??"default";return u&&!(u in Hi)&&t.fallback&&(u=b(t.fallback)),u}),a=Ro();e.expose({layoutRef:a});const l=n.deferHydration();if(n.isHydrating){const u=n.hooks.hookOnce("app:error",l);gn().beforeEach(u)}let c;return()=>{const u=i.value&&i.value in Hi,d=s?.meta.layoutTransition??a$,f=c;return c=i.value,Y3(u&&d,{default:()=>mt(Ow,{suspensible:!0,onResolve:()=>{mn(l)}},{default:()=>mt(X_e,{layoutProps:BT(e.attrs,{ref:a}),key:i.value||void 0,name:i.value,shouldProvide:!t.name,isRenderingNewLayout:h=>h!==f&&h===i.value,hasTransition:!!d},e.slots)})}).default()}}}),X_e=Ne({name:"NuxtLayoutProvider",inheritAttrs:!1,props:{name:{type:[String,Boolean]},layoutProps:{type:Object},hasTransition:{type:Boolean},shouldProvide:{type:Boolean},isRenderingNewLayout:{type:Function,required:!0}},setup(t,e){const n=t.name;t.shouldProvide&&Ks(b3,{isCurrent:s=>n===(s.meta.layout??"default")});const r=un(vl);if(r&&r===Cs()){const s=J3(),i={};for(const a in s){const l=a;Object.defineProperty(i,l,{enumerable:!0,get:()=>t.isRenderingNewLayout(t.name)?s[l]:r[l]})}Ks(vl,es(i))}return()=>!n||typeof n=="string"&&!(n in Hi)?e.slots.default?.():mt(G_e,{key:n,layoutProps:t.layoutProps,name:n},e.slots)}}),Lu=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},Z_e=vH(j_e),Q_e={};function e2e(t,e){const n=Z_e,r=V_e,o=Y_e;return k(),xe(o,null,{default:qe(()=>[Z(n),Z(r)]),_:1})}const t2e=Lu(Q_e,[["render",e2e]]),bI={},D3e=Object.freeze(Object.defineProperty({__proto__:null,default:bI},Symbol.toStringTag,{value:"Module"}));function yM(t,e,n){if(!t||typeof t!="object")return[];const r=[],o=t[e];Array.isArray(o)&&o.length>0&&r.push(o);for(const s of n){if(!s)continue;const i=t[`${e}_${s}`];Array.isArray(i)&&i.length>0&&r.push(i)}return r.length===0?Array.isArray(o)?o:[]:r.reduce((s,i)=>i.length>s.length?i:s)}function n2e(t){const e=[],n=t?.site_languages;if(typeof n=="string"&&n.trim()){const r=n.trim().replace("_","-").split("-")[0]?.toLowerCase();r&&e.push(r)}return e.includes("en")||e.push("en"),e}const hi=dr("CoreStore",{state:()=>({showMenu:!1,maintenance:!1,locations:["footer-menu-1","footer-menu-2","footer-menu-bottom","menu-1","career-menu"],menues:{},settings:{},cacheKey:"default",meta:{},menuData:{},localization:{isLoading:!1,hasLoaded:!1,country:{country_name:null,country_code:null}},translations:null,firstFlexBg:"",firstFlexTextColor:"dark",globalRows:40,dynamicCount:0,dynamicResolved:0,globalGridHidden:!1,isCareerPage:!1,activeCareerCountry:"",screenFactor:0,searchTabindex:0,burgerTabindex:0,careerMenuTabIndex:0,executeScripts:!0}),getters:{getShowMenu(t){return t.showMenu},getGlobalGridHidden(t){return t.globalGridHidden},getExecuteScripts(t){return t.executeScripts},getMenu:t=>e=>t.menues&&t.menues[e]?t.menues[e]:[],getCacheKey(t){return t.cacheKey},getSettings(t){return t.settings},getLocalization(t){return t.localization},getFirstFlexBg(t){return t.firstFlexBg},getMenuItemData:t=>e=>t.menuData[e],getFirstFlexTextColor(t){return t.firstFlexTextColor},getGlobalRows(t){return t.globalRows},getMaintenanceMode(t){return t.maintenance},getDynamicCount(t){return t.dynamicCount},getDynamicResolved(t){return t.dynamicResolved},getIsCareerPage(t){return t.isCareerPage},getScreenFactor(t){return t.screenFactor},getTranslations(t){return t.translations},getCareerCountry(t){return t.activeCareerCountry},getSearchTabindex(t){return t.searchTabindex},getBurgerTabindex(t){return t.burgerTabindex},getCareerMenuTabIndex(t){return t.careerMenuTabIndex}},actions:{setTabindex(t,e){t==="search"?this.searchTabindex=e:t==="burger"?this.burgerTabindex=e:t==="career-menu"&&(this.careerMenuTabIndex=e)},setGlobalGridHidden(t){this.globalGridHidden=t},setExecuteScripts(t){this.executeScripts=t},setIsCareerPage(t){this.isCareerPage=t},setGlobalRows(t){this.globalRows=t},setScreenFactor(t){this.screenFactor=t},setCacheKey(){try{let t=bI.readFileSync("./cache.config.json"),e=JSON.parse(t);this.cacheKey=e.cache_key}catch{}},setTranslations(t){this.translations=t},addToDynamicCount(){this.dynamicCount++},addToDynamicResolved(){this.dynamicResolved++},clearDynamicCount(){this.dynamicCount=0,this.dynamicResolved=0},setFirstFlexBg(t){this.firstFlexBg=t},setFirstFlexTextColor(t){this.firstFlexTextColor=t},setMeta(t){this.meta=t},toggleShowMenu(){this.showMenu=!this.showMenu},setMainMenu(t){if(t&&Array.isArray(t)){const e=t.map(n=>n.activate_megamenu&&!n.acf?.activate_megamenu?{...n,acf:{activate_megamenu:n.activate_megamenu,layout_type:n.layout_type,three_columns:n.three_columns,two_columns:n.two_columns,...n.acf}}:n);this.menues["menu-1"]=e}},async fetchProjectInitData(){const e=yo().public.menu.locations;let n;try{n=await $fetch("/api/init/",{params:{cmv:this.cacheKey}})}catch(r){console.error("Failed to fetch init data:",r),this.settings={};return}if(n){if(n.success===!1&&n.error){console.error("Init API returned error:",n.error),this.settings={};return}if(this.settings=n.settings||{},n.settings?.cache_key&&this.cacheKey==="default"&&(this.cacheKey=n.settings.cache_key),n.settings?.menu_data?.items&&(this.menuData=n.settings.menu_data.items),this.menues||(this.menues={}),n.menus){const r=n2e(n.settings);n.menus.en?e.forEach(o=>{this.menues[o]=yM(n.menus.en,o,r)}):e.forEach(o=>{this.menues[o]=yM(n.menus,o,r)})}this.performMenuDataMerge(n,e)}},performMenuDataMerge(t,e){if(t.settings&&t.settings.menu_data&&t.settings.menu_data.items){const n=t.settings.menu_data.items;e.forEach(r=>{this.menues[r]&&(this.menues[r]=this.menues[r].map(o=>n[o.ID]?{...o,acf:n[o.ID]}:o))})}t.enhanced_menu_data&&this.mergeEnhancedMenuData(t.enhanced_menu_data,e),t.country_menu_data&&this.mergeCountryMenuData(t.country_menu_data),t.megamenu_enhancements&&this.mergeMegamenuEnh
196ancements(t.megamenu_enhancements,e),t.menu_metadata&&this.mergeMenuMetadata(t.menu_metadata,e)},mergeEnhancedMenuData(t,e){e.forEach(n=>{if(this.menues[n]&&t[n]){const r=t[n];this.menues[n]=this.menues[n].map(o=>{const s=r.find(i=>i.menu_item_id===o.ID);return s?{...o,enhanced:s,...s.megamenu_config&&{megamenu_config:s.megamenu_config},...s.display_settings&&{display_settings:s.display_settings},...s.country_visibility&&{country_visibility:s.country_visibility}}:o})}})},mergeCountryMenuData(t){if(t.overrides&&this.menues["menu-1"]){const e=t.overrides;this.menues["menu-1"]=this.menues["menu-1"].map(n=>e[n.ID]?{...n,country_config:e[n.ID]}:n)}t.metadata&&(this.menuData._countryMenuMetadata=t.metadata)},mergeMegamenuEnhancements(t,e){e.forEach(n=>{if(this.menues[n]&&t[n]){const r=t[n];this.menues[n]=this.menues[n].map(o=>{if(r[o.ID]){const s=r[o.ID];return{...o,megamenu:{...o.megamenu,...s,enabled:s.enabled!==void 0?s.enabled:o.megamenu?.enabled||!1}}}return o})}})},mergeMenuMetadata(t,e){this.menuData._globalMetadata=t.global||{},e.forEach(n=>{t[n]&&(this.menuData._locationMetadata||(this.menuData._locationMetadata={}),this.menuData._locationMetadata[n]=t[n])})},checkCountryMenuSystem(t){if(t.debug_country_menu_active)return;if(t.country_menu_info){const{has_international_menu:n,detected_country:r,resolved_menu:o}=t.country_menu_info;if(n)return}Object.keys(t.menus||{}).some(n=>n.includes("main-menu-int")||n.includes("Main menu - INT"))},async fetchSettings(){const{$apiReqUrl:t}=vt(),e=t("/wp/v2/theme-settings");await $fetch(e,{method:"GET"}).then(n=>{this.settings=n,n.cache_key&&this.cacheKey==="default"&&(this.cacheKey=n.cache_key),this.maintenance=!1,n.hasOwnProperty("maintenance_mode")&&n.maintenance_mode==="yes"&&(this.maintenance=!0)}).catch(n=>{this.maintenance=!0})},async fetchLocalization(){this.localization.isLoading=!0;const t=Cs();let e="/-/location/?c="+Date.now();t.query.force_ip&&(e+="&force="+t.query.force_ip);const n={method:"GET"};await $fetch(e,n).then(r=>{this.localization.country=r;try{localStorage.getItem("careerCountry")||(localStorage.setItem("careerCountry",r.country_name),this.updateMenues(r.country_name))}catch(o){console.warn("localStorage not available (private mode?):",o),this.updateMenues(r.country_name)}this.modifyMainMenu(),this.localization.hasLoaded=!0,this.localization.isLoading=!1}).catch(r=>{this.localization.isLoading=!1})},filterMenuItems(t,e){for(let n=t.length-1;n>=0;n--){const r=t[n],o=this.menuData[r.ID];o&&o.country_code&&o.country_code!==""&&!o.country_code.split(",").includes(e)?t.splice(n,1):r.children&&r.children.length>0&&this.filterMenuItems(r.children,e)}},modifyMainMenu(){if(!this.menues["menu-1"])return;const t=this.localization.country.country_code;this.settings.debug_country_menu_active||this.filterMenuItems(this.menues["menu-1"],t)},updateMenues(t){if(!this.menues["career-menu"])return;const e=this.menues["career-menu"].find(n=>n.title===t);if(e&&e.url){this.activeCareerCountry=e.title;
196for(const n in this.menues)this.menues[n].forEach(r=>{(r.title==="Careers"||r.title==="Career")&&(r.url=e.url)})}},async fetchCountrySpecificMainMenu(){const{useCountryMenu:t}=await Wt(async()=>{const{useCountryMenu:a}=await import("./BeK0Xfyv.js");return{useCountryMenu:a}},[],import.meta.url),{getMenuFallbackChain:e,parseCountryOverrides:n,logMenuResolution:r}=t(),o=this.localization?.country?.country_code||null;let s=null;this.settings?.menu_data?.acf_data?.ip_menu_overrides&&(s=this.settings.menu_data.acf_data.ip_menu_overrides);const i=e(o,s);try{const a=await $fetch("/api/menus/",{method:"GET",params:{"locations[]":i[0],fallback_locations:i.join(","),structured:"true",include_legacy:"true",cmv:this.cacheKey}});let l=[],c="mainmenu";return a?._meta?.resolvedLocation&&(c=a._meta.resolvedLocation,a.en&&a.en[c]?l=a.en[c]:a[c]&&(l=a[c])),Array.isArray(l)&&l.length>0?(this.menues["menu-1"]=l,this.menues["menu-1"]._countryMenuMeta={resolvedLocation:c,reason:a._meta?.fallbackUsed?"fallback":"primary",fallbackUsed:a._meta?.fallbackUsed||!1,countryCode:o,overrideSettings:s,fallbackChain:i,timestamp:new Date().toISOString()},r(o,s,{resolvedLocation:c,fallbackUsed:a._meta?.fallbackUsed,menuItemCount:l.length}),!0):!1}catch{return!1}},async fetchMenus(){await this.fetchCountrySpecificMainMenu()?await this.fetchOtherMenus():await this.fetchLegacyMenus()},async fetchOtherMenus(){const{$apiReqUrl:t}=vt(),e=t("/wp/v2/cm-menus"),n=this.locations.filter(r=>r!=="menu-1");if(n.length!==0)try{const r=await $fetch(e,{method:"GET",params:{locations:n.join(","),structured:!0,depth:3,cmv:this.cacheKey}});n.forEach(o=>{r?.[0]?.[o]&&(this.menues[o]=r[0][o])})}catch{}},async fetchLegacyMenus(){const{$apiReqUrl:t}=vt(),e=t("/wp/v2/cm-menus");try{const n=await $fetch(e,{method:"GET",params:{locations:this.locations.join(","),structured:!0,depth:3,cmv:this.cacheKey}});this.locations.forEach(r=>{n?.[0]?.[r]&&(this.menues[r]=n[0][r])})}catch{}}}}),Ru=dr("TransitionStore",{state:()=>({isActive:!1,activeSince:null}),getters:{transitionActive(t){return t.isActive}},actions:{setTransition(t){this.isActive=t,t?this.activeSince=Date.now():(this.activeSince&&Date.now()-this.activeSince,this.activeSince=null)}}}),wI=()=>{const t=hi(),e=Ru();let n=pe(0);const r=pe(null),o=pe(!1);function s(){const f=window.innerWidth;let h=0;return f>1160?h=f/100*11:f>525?h=f/100*22:h=f/100*30,t.setScreenFactor(h),h}function i(f=!1){let h=null;const p=window.innerWidth;let g;f||t.getScreenFactor===0?g=s():g=t.getScreenFactor,p>1920?h=r.value?r.value?.offsetHeight+32:null:p>1440?h=r.value?r.value?.offsetHeight+24:null:h=r.value?r.value?.offsetHeight+16:null,o.value&&(o.value==="h1"?p>1160?h=h-p/100*1:p>760?h=h-11.2:h=h-10:o.value==="h2"?p>1160?h=h-p/100*.8:p>760?h=h-10:h=h-8.6:o.value==="h3"?p>1160?h=h-p/100*.7:p>760?h=h-7.6:h=h-7:o.value==="h4"?p>1160?h=h-p/100*.6:p>760?h=h-6:h=h-5.4:o.value==="h5"?p>1160?h=h-p/100*.54:p>760?h=h-7.8:h=h-6.6:o.value==="p"?p>1700?h=h-13:h=h-8:o.value==="huge"&&(p>1160?h=h-p/100*1.05:p>760?h=h-11.2:h=h-10));const y=h/g;n.value=Math.ceil(y)}function a(){const f=document.getElementById("mainLayout").offsetHeight;let h=s();t.setGlobalRows(Math.ceil(f/h))}function l(f,h,p=500){t.addToDynamicCount(),r.value=f,o.value=h,setTimeout(()=>{i(!1),window.addEventListener("resize",u),setTimeout(()=>{t.addToDynamicResolved(),t.dynamicCount===t.dynamicResolved&&(a(),t.clearDynamicCount(),e.setTransition(!1))},10)},p)}function c(){i(),a()}function u(){i(!0)}function d(){r.value=null,window.removeEventListener("resize",u)}return{rowSpan:n,start:l,destroy:d,recalculate:c,calcGlobalRows:a}},r2e={class:"absolute overflow-hidden max-h-full print:hidden global-grid w-full"},kI=Ne({__name:"Grid",setup(t){const e=hi(),{calcGlobalRows:n}=wI();return Zt(()=>{n(),window.addEventListener("resize",()=>{n()})}),(r,o)=>
196(k(),_(ce,null,[m("div",r2e,[(k(!0),_(ce,null,Oe(b(e).getGlobalRows,(s,i)=>(k(),_("div",{class:H(["grid-lines horizontal global bottom body-grid",i===0?"first":""])},null,2))),256))]),o[0]||(o[0]=ps('<div class="grid grid-cols-12 gap-global px-global global-grid absolute inset-0 body-grid print:hidden"><div class="col-span-6 lg:col-span-3 grid-lines vertical left right"></div><div class="col-span-6 lg:col-span-3 grid-lines vertical left right"></div><div class="col-span-6 lg:col-span-3 grid-lines vertical left right hidden lg:block"></div><div class="col-span-6 lg:col-span-3 grid-lines vertical left right hidden lg:block"></div></div>',1))],64))}}),o2e={},s2e={width:"882",height:"135",viewBox:"0 0 882 135",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"w-[212px] 2xl:h-[1.9vw] 2xl:w-auto 2xl:max-h-[39.8px] h-auto"};function i2e(t,e){return k(),_("svg",s2e,[...e[0]||(e[0]=[ps('<path d="M0 106.52V0H19.0218L65.7377 72.8903C69.5421 78.8249 72.5855 84.7595 74.8682 89.6285H75.4766C75.0205 84.3024 74.7158 77.9116 74.7158 70.3029V0H89.4771V106.52H70.4553L23.587 34.2387C19.7827 28.3041 16.7391 22.3695 14.6089 17.3477H14.0004C14.4565 22.5214 14.7603 28.9126 14.7603 36.369V106.52H0Z" fill="currentColor"></path><path d="M180.173 68.4778H116.413C117.63 86.1292 127.673 96.7814 141.978 96.7814C153.391 96.7814 162.52 90.3897 163.891 81.1078H178.651C176.977 98.3031 160.695 108.346 141.978 108.346C117.782 108.346 101.348 91.4553 101.348 64.6734C101.348 39.8694 116.565 21 141.673 21C167.238 21 180.173 39.8694 180.173 65.738V68.4778ZM116.717 57.2171H164.651C163.586 41.0869 154.303 32.5649 141.673 32.5649C128.587 32.5649 119 41.6954 116.717 57.2171Z" fill="currentColor"></path><path d="M229.937 34.3911H211.372V83.2377C211.372 92.8243 215.328 96.1725 221.72 96.1725C224.459 96.1725 227.35 95.563 229.937 94.3461V106.215C227.35 107.128 224.003 107.889 219.589 107.889C206.047 107.889 196.764 100.889 196.764 84.6071V34.3911H184.895V22.8257H196.764V0H211.372V22.8257H229.937V34.3911Z" fill="currentColor"></path><path d="M235.871 64.6734C235.871 38.9561 252.153 21 276.957 21C298.109 21 313.022 34.0867 314.544 54.1736H299.326C297.652 42.7605 291.413 32.5649 277.109 32.5649C260.979 32.5649 251.088 45.4997 251.088 64.6734C251.088 83.8466 261.131 96.7814 276.805 96.7814C289.435 96.7814 298.261 88.4118 299.631 74.26H314.847C313.326 95.2596 297.804 108.346 276.652 108.346C252.457 108.346 235.871 90.3897 235.871 64.6734Z" fill="currentColor"></path><path d="M323.676 64.3692C323.676 38.8043 339.654 21 364.458 21C389.262 21 405.239 38.8043 405.239 64.3692C405.239 90.3897 389.262 108.346 364.458 108.346C339.654 108.346 323.676 90.3897 323.676 64.3692ZM390.023 64.3692C390.023 45.3474 379.979 32.5649 364.458 32.5649C348.936 32.5649 338.893 45.3474 338.893 64.3692C338.893 83.5418 348.936 96.7814 364.458 96.7814C379.979 96.7814 390.023 83.5418 390.023 64.3692Z" fill="currentColor"></path><path d="M536.562 49.1517V106.52H521.953V50.6735C521.953 40.326 515.258 32.8697 504.911 32.8697C492.128 32.8697 483.454 44.1303 483.454 63.7602V106.52H468.846V50.6735C468.846 40.326 461.998 32.8697 451.954 32.8697C438.868 32.8697 430.346 45.4997 430.346 63.7602V106.52H415.738V22.826H429.89V41.9997H430.346C432.781 28.1521 444.498 21 456.367 21C468.846 21 479.802 28.7611 482.693 41.8477H482.998C486.65 26.9346 497.91 21 509.323 21C524.54 21 536.562 31.8041 536.562 49.1517Z" fill="currentColor"></path><path d="M629.39 64.2168C629.39 89.9336 613.564 108.194 593.326 108.194C580.999 108.194 569.13 101.347 565.173 87.6509H564.717V98.1507V134.368H550.109V22.826H564.717V41.9997H564.87C568.674 28.6087 580.391 21 593.782 21C614.478 21 629.39 38.5 629.39 64.2168ZM614.173 64.2168C614.173 45.1955 603.978 32.4131 589.826 32.4131C574.609 32.4131 564.565 47.0215 564.565 64.521C564.565 82.1725 574.761 96.629 589.674 96.629C603.978 96.629 614.173 83.3904 614.173 64.2168Z" fill="currentColor"></path><path d="M719.324 94.9549V105.912C716.129 106.976 712.934 107.585 709.433 107.585C697.564 107.585 692.39 100.737 692.39 90.542V87.6509H691.782C688.281 100.433 677.325 108.346 662.717 108.346C648.564 108.346 636.848 101.498 636.848 85.8244C636.848 66.4989 654.804 63.9125 671.086 61.0209C684.021 58.7388 691.934 55.9995 691.934 46.1082C691.934 38.3476 687.064 32.2607 673.521 32.2607C660.738 32.2607 653.434 37.891 653.434 50.5216H638.826C639.13 31.8041 651.608 21 673.521 21C694.673 21 706.237 31.1956 706.237 49.456V87.4986C706.237 95.1073 710.042 96.4767 713.238 96.4767C715.368 96.4767 717.498 95.8681 719.324 94.9549ZM691.934 68.6291V64.6734C686.759 
19668.4778 680.064 70.3033 674.282 71.5203C662.717 73.9552 651.76 75.1732 651.76 85.3683C651.76 93.4331 658.608 96.7814 667.13 96.7814C683.107 96.7814 691.934 85.3683 691.934 68.6291Z" fill="currentColor"></path><path d="M796.631 49.9126V106.52H782.023V52.6518C782.023 39.717 774.87 32.8697 764.218 32.8697C750.827 32.8697 741.241 43.6737 741.241 63.1516V106.52H726.633V22.826H740.785V41.9997H741.241C743.676 28.4563 755.24 21 768.175 21C784.762 21 796.631 32.5649 796.631 49.9126Z" fill="currentColor"></path><path d="M866.934 22.8262H881.999L851.869 103.477C847.456 115.194 836.956 134.368 817.173 134.368C811.848 134.368 808.5 132.998 806.978 132.237V120.215C808.956 121.281 812.457 122.65 816.87 122.65C826.456 122.65 832.696 115.955 835.891 107.89L802.109 22.8262H818.239L838.325 78.2169C839.847 82.1726 841.521 86.7379 842.587 92.5201H843.043C844.26 86.8902 845.934 82.325 847.456 78.2169L866.934 22.8262Z" fill="currentColor"></path>',10)])])}const a2e=Lu(o2e,[["render",i2e]]),l2e=["innerHTML"],pu={__name:"Icon",props:{name:String,classes:String},async setup(t){let e,n;const r=t;let o=[];const s=([e,n]=n5(()=>Object.assign({
196"/assets/images/icons/arrow-left.svg":()=>Wt(()=>import("./ErgDTQ7v.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/arrow-right.svg":()=>Wt(()=>import("./DkkcnlrZ.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/burger.svg":()=>Wt(()=>import("./E2Eg4B73.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/calendar-white.svg":()=>Wt(()=>import("./CmF2garK.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/calendar.svg":()=>Wt(()=>import("./BI1b8ZJ4.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/clock-white.svg":()=>Wt(()=>import("./B8nhcof-.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/clock.svg":()=>Wt(()=>import("./DvxJZT2e.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/close.svg":()=>Wt(()=>import("./DBe5xvky.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/logo.svg":()=>Wt(()=>import("./D9W2mY7d.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/minus.svg":()=>Wt(()=>import("./DyZtR4-b.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/pause.svg":()=>Wt(()=>import("./BPRELRRd.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/play.svg":()=>Wt(()=>import("./C1RDsTaW.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/plus.svg":()=>Wt(()=>import("./BaS2bkPZ.js"),[],import.meta.url).then(a=>a.default),
196"/assets/images/icons/search.svg":()=>Wt(()=>import("./Df9rdLke.js"),[],import.meta.url)
196.then(a=>a.default)})),e=await e,n(),e);for(const a in s)[e,n]=n5(()=>s[a]().then(l=>{let c=a.replace(/^.*[\\\/]/,"");o[c]=l})),await e,n();const i=o[r.name+".svg"];return(a,l)=>b(i)?(k(),_("div",{key:0,class:H(["content-center icon-wrap",t.classes]),innerHTML:b(i)},null,10,l2e)):L("",!0)}},c2e={props:{lazy:{type:Boolean,default:!0},src:{type:String},alt:{type:String,default:""},title:{type:String,default:""}},computed:{loading(){return this.lazy?"lazy":"eager"},imageSource(){const{url:t}=yI(this.src);return t}}},u2e=["src","loading","alt","title"];function d2e(t,e,n,r,o,s){return k(),_("img",{src:s.imageSource,loading:s.loading,alt:n.alt,title:n.title},null,8,u2e)}const f2e=Lu(c2e,[["render",d2e]]),Uo=dr("MenuStore",{state:()=>({burgerState:!1,megaDropState:!1,megamenuClosing:!1,searchState:!1,countryMenuState:!1,countryMiniMenuState:!1,activeLink:null,headerHideTop:!0,animateMenu:!1,scrollY:0,isScrollLocked:!1,scrollRecalcTrigger:0,popupOpen:!1}),getters:{getBurgerState(t){return t.burgerState},getMegaDropState(t){return t.megaDropState},getMegamenuClosing(t){return t.megamenuClosing},getAnimateMenu(t){return t.animateMenu},getActiveLink(t){return t.activeLink},getScrollRecalcTrigger(t){return t.scrollRecalcTrigger},getActiveChildren(t){return t.activeLink?.children??[]},getSearchState(t){return t.searchState},getHeaderHideTop(t){return t.headerHideTop},getCountryMenuState(t){return t.countryMenuState},getCountryMiniMenuState(t){return t.countryMiniMenuState},getIsScrollLocked(t){return t.isScrollLocked}},actions:{lockScroll(){if(typeof document>"u"||this.isScrollLocked)return;const t=window.innerWidth<=1159;if(this.scrollY=window.scrollY,document.documentElement.style.setProperty("--scroll-y",`-${this.scrollY}px`),t){const e=window.innerHeight*.01;document.documentElement.style.setProperty("--vh",`${e}px`);const n=Math.max(80,window.innerHeight*.08);document.documentElement.style.setProperty("--mobile-safe-bottom",`${n}px`)}document.documentElement.classList.add("megamenu-active"),this.isScrollLocked=!0},unlockScroll(){typeof document>"u"||!this.isScrollLocked||(document.documentElement.classList.remove("megamenu-active"),document.documentElement.style.removeProperty("--scroll-y"),document.documentElement.style.removeProperty("--vh"),document.documentElement.style.removeProperty("--mobile-safe-bottom"),window.scrollTo(0,this.scrollY),this.isScrollLocked=!1)},toggleBurgerState(){this.burgerState=!this.burgerState,this.burgerState?(this.searchState=!1,this.megaDropState=!1,this.activeLink=null,typeof window<"u"&&window.innerWidth<=1159&&this.lockScroll()):this.unlockScroll()},setBurgerState(t){this.burgerState=t,t&&typeof window<"u"&&window.innerWidth<=1159?this.lockScroll():this.unlockScroll()},toggleMegaDropState(){this.megaDropState=!this.megaDropState},setHeaderHideTop(t){this.headerHideTop=t},setCountryMiniMenuState(t){this.countryMiniMenuState=t},setCountryMenuState(t){this.countryMenuState=t},toggleCountryMenuState(){this.countryMenuState=!this.countryMenuState;try{localStorage.setItem("hasSeenCCM","true")}catch(t){console.warn("localStorage not available (private mode?):",t)}},openMegaDrop(t,e=!0){this.scrollRecalcTrigger++,this.activeLink?.ID===t.ID?this.closeMegaDrop():this.megaDropState?this.switchMegaDropContent(t,e):setTimeout(()=>{this.setDropdownActive(t,e)},150)},switchMegaDropContent(t,e=!0){this.animateMenu=!1,this.activeLink=t,setTimeout(()=>{this.animateMenu=!0},10),e&&setTimeout(()=>{document.querySelector("#mega-menu-arrow").focus()},500)},setDropdownActive(t,e=!0){this.activeLink=t,this.megaDropState=!0,this.burgerState=!1,this.searchState=!1,typeof window<"u"&&this.lockScroll(),setTimeout(()=>{this.animateMenu=!0},10),e&&setTimeout(()=>{const n=document.querySelector("#mega-menu-arrow");n&&n.focus()},500)},closeMegaDrop(t=!1){this.megamenuClosing=!0,this.megaDropState=!1,this.animateMenu=!1,t||this.unlockScroll(),setTimeout(()=>{this.activeLink=null},500),setTimeout(()=>{this.megamenuClosing=!1},500),t&&this.toggleBurgerState()},setActiveLink(t){this.activeLink=t},toggleSearchState(){this.searchState=!this.searchState,this.searchState&&(this.burgerState=!1,this.animateMenu=!1,this.megaDropState=!1,this.activeLink=null,setTimeout(()=>{this.activeLink=null},500))},setPopupOpen(t){this.popupOpen=t},reset(){this.closeMegaDrop(),this.burgerState=!1,this.searchState=!1,this.megamenuClosing=!1,this.unlockScroll()},forceCloseAll(){this.megaDropState=!1,this.megamenuClosing=!1,this.burgerState=!1,this.searchState=!1,this.animateMenu=!1,this.activeLink=null,this.countryMenuState=!1,this.countryMiniMenuState=!1,this.unlockScroll(),typeof document<"u"&&(document.body.classList.remove("menu-open","overflow-hidden"),document.documentElement.classList.remove("menu-open","overflow-hidden","megamenu-lock","megamenu-active"),document.body.style.position="",document.body.style.top="",document.body.style.width="",document.body.style.overflow="",document.documentElement.style.removeProperty("--scroll-y"))}}}),$u=dr("BreakpointsStore",{state:()=>({breakpoints:{xs:"320px",sm:"390px",smmd:"525px",md:"760px",lg:"1160px",xl:"1440px","2xl":"1700px"},currentBreakpoint:"xs",isMobile:!0,isMobileTablet:!0,mobileBreakpoints:["xs","sm","smmd"],mobileTabletBreakp
196oints:["xs","sm","smmd","md","lg"]}),getters:{getBreakpoints(t){return t.breakpoints},getCurrentBreakpoint(t){return t.currentBreakpoint},getIsMobile(t){return t.isMobile},getIsMobileTablet(t){return t.isMobileTablet},getMobileBreakpoints(t){return t.mobileBreakpoints}},actions:{setBreakpoints(t){this.breakpoints=t},setCurrentBreakpoint(t){this.currentBreakpoint=t,this.isMobile=this.mobileBreakpoints.includes(t),this.isMobileTablet=this.mobileTabletBreakpoints.includes(t)}}});function S0(){const{$apiReqUrl:t}=vt(),e=async(d=!1)=>{try{const f={"locations[]":"menu-1",structured:!0,include_legacy:d},h=Cs();return h.query.force_ip&&(f.force_ip=h.query.force_ip),await $fetch("/api/menus/",{method:"GET",params:f})}catch(f){return console.error("Error fetching megamenu data:",f),null}},n=d=>{if(d?.acf?.activate_megamenu!==!0)return!1;const f=d.acf.layout_type;if(!f)return!1;const h=f==="2"?"three_columns":"two_columns",p=d.acf[h];return!p||!Array.isArray(p)||p.length===0?!1:p.some(y=>y.column_links&&Array.isArray(y.column_links)&&y.column_links.length>0||y.section_links&&y.section_links.page_link)},r=d=>n(d)&&d.acf.layout_type||null,o=d=>{if(!n(d))return null;const f=r(d);if(!f)return null;const h=f==="2"?"three_columns":"two_columns",p=d.acf[h]||null;if(!p||!Array.isArray(p))return null;const g=p.filter(y=>y.column_links&&y.column_links!==!1);return g.length>0?g:null},s=d=>d?.has_legacy_items===!0,i=d=>s(d)&&d.legacy_submenu_items||null,a=d=>d?.acf?.legacy_submenu_handling||"hide",l=d=>{if(!d)return!1;if(d.startsWith("/")||d.startsWith("#"))return!0;try{const f=new URL(t());return new URL(d).hostname===f.hostname}catch{return!1}};return{fetchMegamenuData:e,hasMegamenu:n,getMegamenuLayout:r,getMegamenuColumns:o,hasLegacyItems:s,getLegacyItems:i,getLegacyHandling:a,processMenuLink:d=>{const f=d.internal_link||d.external_link?.url;let h=l(f),p;if(h)if(f.startsWith("#"))p=f;else try{const w=new URL(f,t());p=w.pathname+w.search+w.hash}catch{p=f}else p=f;let g=h?"_self":d.external_link?.target||"_self",y=d.internal_or_external_link=="external_Link"?d.external_link?.title:d?.link_text;return d.internal_or_external_link=="external_Link"&&(h=!1,p=d.external_link?.url,g=d.external_link?.target||"_blank"),{url:p,target:g,title:y,description:d.link_description,icon:d.optional_link_icon,accessibilityTitle:d.link_title_acessibility,isInternal:h}},processSectionLink:(d,f="")=>{if(!d)return null;let h,p,g;if(typeof d=="object"&&d.url)h=d.url,p=d.target||"_self",g=d.title||f;else if(typeof d=="string")h=d,p="_self",g=f;else return null;const y=l(h);if(y)try{const w=new URL(h,t());h=w.pathname+w.search+w.hash}catch{}return{url:h,target:p,title:g,isInternal:y}}}}const xI=()=>{const t=Uo(),e=pe(null),n=pe([]),r=d=>{if(!d)return[];const f=['a[href]:not([tabindex="-1"])','button:not([disabled]):not([tabindex="-1"])','input:not([disabled]):not([tabindex="-1"])','select:not([disabled]):not([tabindex="-1"])','textarea:not([disabled]):not([tabindex="-1"])','[tabindex]:not([tabindex="-1"])'].join(", ");return Array.from(d.querySelectorAll(f)).filter(h=>h.offsetParent!==null)},o=(d,f=[])=>{t.getMegaDropState?(d.forEach(p=>{p.element&&(p.element.tabIndex=-1)}),f.forEach((p,g)=>{p.element&&(p.element.tabIndex=0)})):(d.forEach((p,g)=>{p.element&&(p.element.tabIndex=g+3)}),f.forEach(p=>{p.element&&(p.element.tabIndex=-1)}))},s=(d,f)=>{if(!d||!t.getMegaDropState||f.key!=="Tab")return;const h=r(d);if(h.length===0)return;const p=h[0],g=h[h.length-1],y=document.activeElement,w=d.contains(y),x=Array.from(document.querySelectorAll('header button[aria-controls^="megamenu"], header a[href]')).filter(C=>C.tabIndex>=0);if(f.shiftKey){if(y===p){const C=t.getActiveLink,v=document.querySelector(`button[data-menu-id="${C?.ID}"]`);if(v){f.preventDefault(),f.stopPropagation(),v.focus();return}}else if(w){const C=h.indexOf(y);if(C>0){f.preventDefault(),f.stopPropagation(),h[C-1].focus();return}}}else if(y===g){const C=t.getActiveLink,v=document.querySelector(`button[data-menu-id="${C?.ID}"]`),S=x.indexOf(v);if(S>=0&&S<x.length-1){f.preventDefault(),f.stopPropagation(),t.getMegaDropState&&(a(!1),t.closeMegaDrop()),setTimeout(()=>{x[S+1].focus()},10);return}else{t.getMegaDropState&&(a(!1),t.closeMegaDrop());return}}else if(w){const C=h.indexOf(y);if(C>=0&&C<h.length-1){f.preventDefault(),f.stopPropagation(),h[C+1].focus();return}}w&&(f.preventDefault(),f.stopPropagation())},i=async(d,f)=>{e.value=d,await mn(),setTimeout(()=>{const h=r(f);if(h.length>0){h[0].focus();const p=Array.from(document.querySelectorAll('header button[aria-controls^="megamenu"], header a[href]')),g=document.querySelector('header button[aria-label*="search"]'),y=p.findIndex(S=>S===d),w=3,x=h.length;p.forEach((S,E)=>{E<=y?S.tabIndex=w+E:S.tabIndex=w+E+x});const C=w+y;h.forEach((S,E)=>{S.tabIndex=C+1+E});const v=w+p.length+x;g&&(g.tabIndex=v)}n.value=h},100)},a=(d=!0)=>{const f=document.querySelectorAll('header button[aria-controls^="megamenu"], header a[href]'),h=document.querySelector('header button[aria-label*="search"]'),p=3;f.forEach((y,w)=>{y.tabIndex=p+w}),h&&(h.tabIndex=p+f.length),document.querySelectorAll(".megamenu-container a, .megamenu-container button").forEach(y=>{y.tabIndex=-1}),d&&e.value?requestAnimationFrame(()=>{setTimeout(()=>{e.value&&(e.value.focus(),e.value=null)},100)}):e.value=null,n.value=[]},l=d=>{if(t.getMegaDropState)switch(d.key){case"ArrowDown":d.preventDefault(),c("down");break;case"ArrowUp":d.preventDefault(),c("up");break}},c=d=>{const f=n.value,h=f.findIndex(g=>g===document.activeElement);if(h===-1)return;let p;d==="down"?p=h+1>=f.length?0:h+1:p=h-1<0?f.length-1:h-1,f[p]?.focus()};return{lastFocusedElement:e,focusableElements:n,getFocusableElements:r,updateTabIndexes:o,trapFocus:s,onMegamenuOpen:i,onMegamenuClose:a,handleArrowNavigation:l,navigateInColumn:c,initializeFocusManagement:()=>{const d=f=>{if(t.getMegaDropState&&f.key==="Tab"){const h=document.querySelector(".megamenu-container");h&&s(h,f)}};return document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("keydown",d,!0)}}}};function CI(){const t=Uo(),e=Ru(),n=a=>a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||a.button===1,r=a=>{a.button},o=(a,l)=>{n(a)||a.defaultPrevented||a.button===0&&(a.preventDefault(),s(),e.setTransition(!0),Rc(l))},s=()=>{t.forceCloseAll()};return{isModifiedClick:n,onMenuAuxClick:r,onMenuLinkClick:o,onExternalLinkClick:a=>{n(a)||s()},closeBurgerMenuSafely:s}}const h2e=["id","aria-label","aria-hidden"],p2e={class:"megamenu-dropdown",style:{margin:"0 auto"}},m2e={key:1,class:"content z-[1] relative flex-1"},g2e={key:0,class:"megamenu-content megamenu-layout-3 grid grid-cols-12 gap-global"},y2e={key:0,class:"megamenu-column-title"},v2e=["innerHTML"],b2e=["href","target","title","tabindex"],w2e=["innerHTML"],k2e={key:2,class:"megamenu-section-link"},x2e=["innerHTML"],C2e={class:"megamenu-link-icon"},_2e=["src","alt"],S2e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",class:"default-icon"},M2e={key:2,class:"arrow-on-hover",xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none"},T2e={class:"megamenu-link-content"},E2e=["innerHTML"],A2e=["innerHTML"],O2e=["href","target","title","tabindex"],I2e={class:"megamenu-link-icon"},N2e=["src","alt"],L2e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",class:"default-icon"},R2e={key:2,class:"arrow-on-hover",xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none"},$2e={class:"megamenu-link-content"},D2e=["innerHTML"],P2e=["innerHTML"],H2e={class:"megamenu-link-icon"},B2e=["src","alt"],F2e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",class:"default-icon"},j2e={key:2,class:"arrow-on-hover",xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none"},z2e={class:"megamenu-link-content"},V2e=["innerHTML"],U2e=["innerHTML"],q2e={key:1,class:"megamenu-content megamenu-layout-2 grid grid-cols-12 gap-global"},W2e={key:0,class:"megamenu-column-title"},K2e=["innerHTML"],G2e=["href","target","title","tabindex"],J2e=["innerHTML"],Y2e={key:2,class:"megamenu-section-link"},X2e=["innerHTML"],Z2e={class:"megamenu-link-icon"},Q2e=["src","alt"],eSe={key:1,xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",class:"default-icon"},tSe={key:2,class:"arrow-on-hover",xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none"},nSe={class:"megamenu-link-content"},rSe=["innerHTML"],oSe=["innerHTML"],sSe=["href","target","title","tabindex"],iSe={class:"megamenu-link-icon"},aSe=["src","alt"],lSe={key:1,xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",class:"default-icon"},cSe={key:2,class:"arrow-on-hover",xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none"},uSe={class:"megamenu-link-content"},dSe=["innerHTML"],fSe=["innerHTML"],hSe={class:"megamenu-link-icon"},pSe=["src","alt"],mSe={key:1,xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",class:"default-icon"},gSe={key:2,class:"arrow-on-hover",xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none"},ySe={class:"megamenu-link-content"},vSe=["innerHTML"],bSe=["innerHTML"],wSe={key:0,class:"h-full w-full flex flex-col space-y-[1.3333rem] p-[1.3333rem] pt-[3.3rem]"},kSe={class:"flex flex-col flex-1 justify-between"},xSe=["innerHTML"],CSe=["innerHTML"],_Se=["innerHTML"],SSe=["href","tabindex"],MSe=["innerHTML"],TSe=Ne({__name:"AcfMegaDropdown",setup(t){const e=Cs(),n=Uo(),r=$u();Ru();const{hasMegamenu:o,getMegamenuLayout:s,getMegamenuColumns:i,processMenuLink:a,processSectionLink:l}=S0(),{onMegamenuOpen:c,onMegamenuClose:u}=xI(),{onMenuLinkClick:d,onMenuAuxClick:f,onExternalLinkClick:h}=CI(),p=pe(null),g=U(()=>n.getActiveLink),y=U(()=>r.getCurrentBreakpoint),w=U(()=>!["xs","sm","smmd","md"].includes(r.getCurrentBreakpoint));Ye(y,(V,B)=>{(V==="lg"&&B==="md"||V==="md"&&B==="lg")&&n.reset()}),Ye(()=>n.getMegaDropState,V=>{if(V){const B=document.querySelector(`[aria-controls="megamenu-${g.value?.ID}"]`);c(B,p.value)}else u()}),Ye(()=>e.fullPath,(V,B)=>{V!==B&&n.getMegaDropState&&n.forceCloseAll()});const x=U(()=>
196{if(!g.value||!o(g.value))return{layout:null,columns:[],linksColumn:null,contentColumn:null};let V=0;const Y=(i(g.value)||[]).map(Q=>{const J={...Q};return Q.section_links&&Q.section_links.page_link&&(V++,J.section_links={...Q.section_links,processed:{...l(Q.section_links.page_link,Q.section_links.page_title||""),tabindex:w.value?V:0}}),Q.column_links&&Array.isArray(Q.column_links)&&(J.column_links=Q.column_links.map(ke=>{const Se=Q.column_type==="content";return Se&&ke.story_link?(V++,{...ke,tabindex:w.value?V:0}):Se?ke:(V++,{...ke,processed:{...a(ke.links),tabindex:w.value?V:0}})})),J}),P=s(g.value)==="2"?"3":"2";return{layout:P,columns:Y,linksColumn:P==="2"?Y.find(Q=>Q.column_type==="links")||Y[0]:null,contentColumn:P==="2"?Y.find(Q=>Q.column_type==="content"):null}}),C=(V,B,Y)=>[`megamenu-link--${V.links.type||"arrow"}`,{"has-icon-image":V.processed.icon}],v=V=>[`megamenu-link--${V.links.type||"arrow"}`,{"has-icon-image":V.processed.icon}],S=V=>!V||!V.column_links?0:V.column_links.length,E=(V,B)=>{const Y=B===0,j=S(V);return Y&&j<5},M=V=>{const B=x.value.columns.length;return`transition-delay: ${450+(B>1?B-1-V:0)*100}ms`},T=V=>{const B=x.value.columns.length;return`transition-delay: ${500+(B>1?B-1-V:0)*100}ms`},A=(V,B)=>`transition-delay: ${500+V*100+B*50}ms`,N=V=>"transition-delay: 500ms",D=V=>`transition-delay: ${540+V*100}ms`,$=(V,B)=>{d(V,B),V.defaultPrevented||u()},W=V=>{h(V)};Zt(()=>{});const me=()=>{if(typeof window>"u")return"megamenu-design--curtain";try{return`megamenu-design--${new URLSearchParams(window.location.search).get("design")||"curtain"}`}catch{return"megamenu-design--curtain"}};return(V,B)=>{const Y=fa,j=f2e;return k(),_("div",{ref_key:"megamenuContainer",ref:p,class:H(["megamenu-container megamenu-container--acf show-grid-gutters absolute left-0 w-full z-30",[b(n).getMegaDropState?"megamenu-container--active pointer-events-auto top-0":"pointer-events-none megamenu-hidden",{"megamenu-container--closing":b(n).getMegamenuClosing},{"animate-menu":b(n).getAnimateMenu},me()]]),id:"megamenu-"+b(g)?.ID,role:"region","aria-label":"Submenu for "+b(g)?.title,"aria-hidden":!b(n).getMegaDropState},[m("div",p2e,[b(n).getMegaDropState?(k(),_("button",{key:0,class:"block lg:hidden","aria-label":"Back to main menu",id:"mega-menu-arrow",onClick:B[0]||(B[0]=P=>b(n).closeMegaDrop(!0))})):L("",!0),b(x).columns.length>0?(k(),_("div",m2e,[b(x).layout==="3"?(k(),_("ul",g2e,[(k(!0),_(ce,null,Oe(b
196(x).columns,(P,Q)=>(k(),_("li",{key:Q,class:H(["megamenu-column",[`megamenu-column--${P.column_style||"default"}`,Q===0?"lg:col-span-6":"lg:col-span-3",b(n).getAnimateMenu?"opacity-100 duration-300":"opacity-0"]]),style:xn(M(Q))},[P.section_links&&P.section_links.page_title?(k(),_("div",y2e,[P.section_links.processed&&P.section_links.processed.url&&V.$isInternalLink(P.section_links.processed.url)?(k(),xe(Y,{key:0,to:V.$getInternalPath(P.section_links.processed.url,!0),title:P.section_links.processed.accessibilityTitle||void 0,tabindex:P.section_links.processed.tabindex,class:"megamenu-section-link",onClick:J=>$(J,V.$getInternalPath(P.section_links.processed.url,!0)),onAuxclick:b(f)},{default:qe(()=>[m("span",{class:"megamenu-section-link__text",innerHTML:P.section_links.page_title},null,8,v2e),B[7]||(B[7]=m("svg",{class:"megamenu-section-link__arrow",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},[m("path",{d:"M17.3151 9.81818L18 9.0024L17.3151 8.18662L11.1271 0.815782L10.4423 0L9.07654 1.62677L9.76141 2.44255L14.2977 7.85071H0.966876H0V10.1541H0.966876H14.2977L9.75739 15.5575L9.07252 16.3732L10.4382 18L11.1231 17.1842L17.3151 9.81818Z",fill:"#FFFFFF"})],-1))]),_:2},1032,["to","title","tabindex","onClick","onAuxclick"])):P.section_links.processed&&P.section_links.processed.url&&!V.$isInternalLink(P.section_links.processed.url)?(k(),_("a",{key:1,href:P.section_links.processed.url,target:P.section_links.processed.target,title:P.section_links.processed.accessibilityTitle||void 0,tabindex:P.section_links.processed.tabindex,class:"megamenu-section-link",onClick:W,onAuxclick:B[1]||(B[1]=(...J)=>b(f)&&b(f)(...J))},[m("span",{class:"megamenu-section-link__text",innerHTML:P.section_links.page_title},null,8,w2e),B[8]||(B[8]=m("svg",{class:"megamenu-section-link__arrow",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},[m("path",{d:"M17.3151 9.81818L18 9.0024L17.3151 8.18662L11.1271 0.815782L10.4423 0L9.07654 1.62677L9.76141 2.44255L14.2977 7.85071H0.966876H0V10.1541H0.966876H14.2977L9.75739 15.5575L9.07252 16.3732L10.4382 18L11.1231 17.1842L17.3151 9.81818Z",fill:"#FFFFFF"})],-1))],40,b2e)):(k(),_("span",k2e,[m("span",{class:"megamenu-section-link__text",innerHTML:P.section_links.page_title},null,8,x2e)]))])):L("",!0),P.column_links&&Array.isArray(P.column_links)?(k(),_("ul",{key:1,class:H(["megamenu-column-links",[{"megamenu-column-links--full-width":E(P,Q)},b(n).getAnimateMenu?"opacity-100 translate-x-0 duration-300":"opacity-0 translate-x-6"]]),style:xn(T(Q))},[(k(!0),_(ce,null,Oe(P.column_links,(J,ke)=>(k(),_("li",{key:ke},[J.processed.url&&V.$isInternalLink(J.processed.url)?(k(),xe(Y,{key:0,to:V.$getInternalPath(J.processed.url,!0),title:J.processed.accessibilityTitle||void 0,tabindex:J.processed.tabindex,class:H(["megamenu-link",C(J)]),style:xn(A(Q,ke)),onClick:Se=>$(Se,V.$getInternalPath(J.processed.url,!0)),onAuxclick:b(f)},{default:qe(()=>[m("div",C2e,[J.processed.icon?(k(),_("img",{key:0,src:J.processed.icon.url,alt:J.processed.icon.alt,class:"default-icon"},null,8,_2e)):(k(),_("svg",S2e,[...B[9]||(B[9]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"white"},null,-1)])])),J.processed.icon?(k(),_("svg",M2e,[...B[10]||(B[10]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"white"},null,-1)])])):L("",!0)]),m("div",T2e,[J.processed.title?(k(),_("div",{key:0,class:"megamenu-link-title",innerHTML:J.processed.title},null,8,E2e)):L("",!0),J.processed.description?(k(),_("div",{key:1,class:"megamenu-link-description",innerHTML:J.processed.description},null,8,A2e)):L("",!0)])]),_:2},1032,["to","title","tabindex","class","style","onClick","onAuxclick"])):J.processed.url&&!V.$isInternalLink(J.processed.url)?(k(),_("a",{key:1,href:J.processed.url,target:J.processed.target,title:J.processed.accessibilityTitle||void 0,tabindex:J.processed.tabindex,class:H(["megamenu-link",C(J)]),style:xn(A(Q,ke)),onClick:W,onAuxclick:B[2]||(B[2]=(...Se)=>b(f)&&b(f)(...Se))},[m("div",I2e,[J.processed.icon?(k(),_("img",{key:0,src:J.processed.icon.url,alt:J.processed.icon.alt,class:"default-icon"},null,8,N2e)):(k(),_("svg",L2e,[...B[11]||(B[11]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"white"},null,-1)])])),J.processed.icon?(k(),_("svg",R2e,[...B[12]||(B[12]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"white"},null,-1)])])):L("",!0)]),m("div",$2e,[J.processed.title?(k(),_("div",{key:0,class:"megamenu-link-title",innerHTML:J.processed.title},null,8,D2e)):L("",!0),J.processed.description?(k(),_("div",{key:1,class:"megamenu-link-description",innerHTML:J.processed.description},null,8,P2e)):L("",!0)])],46,O2e)):(k(),_("div",{key:2,class:H(["megamenu-link",C(J)]),style:xn(A(Q,ke))},[m("div",H2e,[J.processed.icon?(k(),_("img",{key:0,src:J.processed.icon.url,alt:J.processed.icon.alt,class:"default-icon"},null,8,B2e)):(k(),_("svg",F2e,[...B[13]||(B[13]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"white"},null,-1)])])),J.processed.icon?(k(),_("svg",j2e,[...B[14]||(B[14]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"white"},null,-1)])])):L("",!0)]),m("div",z2e,[J.processed.title?(k(),_("div",{key:0,class:"megamenu-link-title",innerHTML:J.processed.title},null,8,V2e)):L("",!0),J.processed.description?(k(),_("div",{key:1,class:"megamenu-link-description",innerHTML:J.processed.description},null,8,U2e)):L("",!0)])],6))]))),128))],6)):L("",!0)],6))),128))])):b(x).layout==="2"?(k(),_("ul",q2e,[m("li",{class:H(["megamenu-column lg:col-span-6",b(n).getAnimateMenu?"opacity-100 duration-300":"opacity-0"]),style:xn(N())},[b(x).linksColumn&&b(x).linksColumn.section_links&&(b(x).linksColumn.section_links.processed?.title||b(x).linksColumn.section_links.page_title)?(k(),_("div",W2e,[b(x).linksColumn.section_links.processed&&b(x).linksColumn.section_links.processed.url&&V.$isInternalLink(b(x).linksColumn.section_links.processed.url)?(k(),xe(Y,{key:0,to:V.$getInternalPath(b(x).linksColumn.section_links.processed.url,!0),title:b(x).linksColumn.section_links.processed.accessibilityTitle||void 0,tabindex:b(x).linksColumn.section_links.processed.tabindex,class:"megamenu-section-link",onClick:B[3]||(B[3]=P=>$(P,V.$getInternalPath(b(x).linksColumn.section_links.processed.url,!0))),onAuxclick:b(f)},{default:qe(()=>[m("span",{class:"megamenu-section-link__text",innerHTML:b(x).linksColumn.section_links.page_title},null,8,K2e),B[15]||(B[15]=m("svg",{class:"megamenu-section-link__arrow",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},[m("path",{d:"M17.3151 9.81818L18 9.0024L17.3151 8.18662L11.1271 0.815782L10.4423 0L9.07654 1.62677L9.76141 2.44255L14.2977 7.85071H0.966876H0V10.1541H0.966876H14.2977L9.75739 15.5575L9.07252 16.3732L10.4382 18L11.1231 17.1842L17.3151 9.81818Z",fill:"#FFFFFF"})],-1))]),_:1},8,["to","title","tabindex","onAuxclick"])):b(x).linksColumn.section_links.processed&&b(x).linksColumn.section_links.processed.url&&!V.$isInternalLink(b(x).linksColumn.section_links.processed.url)?(k(),_("a",{key:1,href:b(x).linksColumn.section_links.processed.url,target:b(x).linksColumn.section_links.processed.target,title:b(x).linksColumn.section_links.processed.accessibilityTitle||void 0,tabindex:b(x).linksColumn.section_links.processed.tabindex,class:"megamenu-section-link",onClick:W,onAuxclick:B[4]||(B[4]=(...P)=>b(f)&&b(f)(...P))},[m("span",{class:"megamenu-section-link__text",innerHTML:b(x).linksColumn.section_links.page_title},null,8,J2e),B[16]||(B[16]=m("svg",{class:"megamenu-section-link__arrow",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},[m("path",{d:"M17.3151 9.81818L18 9.0024L17.3151 8.18662L11.1271 0.815782L10.4423 0L9.07654 1.62677L9.76141 2.44255L14.2977 7.85071H0.966876H0V10.1541H0.966876H14.2977L9.75739 15.5575L9.07252 16.3732L10.4382 18L11.1231 17.1842L17.3151 9.81818Z",fill:"#FFFFFF"})],-1))],40,G2e)):(k(),_("span",Y2e,[m("span",{class:"megamenu-section-link__text",innerHTML:b(x).linksColumn.section_links.page_title},null,8,X2e)]))])):L("",!0),b(x).linksColumn&&b(x).linksColumn.column_links&&Array.isArray(b(x).linksColumn.column_links)?(k(),_("ul",{key:1,class:H(["megamenu-column-links",[{"megamenu-column-links--full-width":E(b(x).linksColumn,0)},b(n).getAnimateMenu?"opacity-100 translate-x-0 duration-300":"opacity-0 translate-x-6"]]),style:xn(T(0))}
196,[(k(!0),_(ce,null,Oe(b(x).linksColumn.column_links,(P,Q)=>(k(),_("li",{key:Q},[P.processed.url&&V.$isInternalLink(P.processed.url)?(k(),xe(Y,{key:0,to:V.$getInternalPath(P.processed.url,!0),title:P.processed.accessibilityTitle||void 0,tabindex:P.processed.tabindex,class:H(["megamenu-link",v(P)]),style:xn(A(0,Q)),onClick:J=>$(J,V.$getInternalPath(P.processed.url,!0)),onAuxclick:b(f)},{default:qe(()=>[m("div",Z2e,[P.processed.icon?(k(),_("img",{key:0,src:P.processed.icon.url,alt:P.processed.icon.alt,class:"default-icon"},null,8,Q2e)):(k(),_("svg",eSe,[...B[17]||(B[17]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"white"},null,-1)])])),P.processed.icon?(k(),_("svg",tSe,[...B[18]||(B[18]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"white"},null,-1)])])):L("",!0)]),m("div",nSe,[P.processed.title?(k(),_("div",{key:0,class:"megamenu-link-title",innerHTML:P.processed.title},null,8,rSe)):L("",!0),P.processed.description?(k(),_("div",{key:1,class:"megamenu-link-description",innerHTML:P.processed.description},null,8,oSe)):L("",!0)])]),_:2},1032,["to","title","tabindex","class","style","onClick","onAuxclick"])):P.processed.url&&!V.$isInternalLink(P.processed.url)?(k(),_("a",{key:1,href:P.processed.url,target:P.processed.target,title:P.processed.accessibilityTitle||void 0,tabindex:P.processed.tabindex,class:H(["megamenu-link",v(P)]),style:xn(A(0,Q)),onClick:W,onAuxclick:B[5]||(B[5]=(...J)=>b(f)&&b(f)(...J))},[m("div",iSe,[P.processed.icon?(k(),_("img",{key:0,src:P.processed.icon.url,alt:P.processed.icon.alt,class:"default-icon"},null,8,aSe)):(k(),_("svg",lSe,[...B[19]||(B[19]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"white"},null,-1)])])),P.processed.icon?(k(),_("svg",cSe,[...B[20]||(B[20]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"white"},null,-1)])])):L("",!0)]),m("div",uSe,[P.processed.title?(k(),_("div",{key:0,class:"megamenu-link-title",innerHTML:P.processed.title},null,8,dSe)):L("",!0),P.processed.description?(k(),_("div",{key:1,class:"megamenu-link-description",innerHTML:P.processed.description},null,8,fSe)):L("",!0)])],46,sSe)):(k(),_("div",{key:2,class:H(["megamenu-link",v(P)]),style:xn(A(0,Q))},[m("div",hSe,[P.processed.icon?(k(),_("img",{key:0,src:P.processed.icon.url,alt:P.processed.icon.alt,class:"default-icon"},null,8,pSe)):(k(),_("svg",mSe,[...B[21]||(B[21]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"white"},null,-1)])])),P.processed.icon?(k(),_("svg",gSe,[...B[22]||(B[22]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"white"},null,-1)])])):L("",!0)]),m("div",ySe,[P.processed.title?(k(),_("div",{key:0,class:"megamenu-link-title",innerHTML:P.processed.title},null,8,vSe)):L("",!0),P.processed.description?(k(),_("div",{key:1,class:"megamenu-link-description",innerHTML:P.processed.description},null,8,bSe)):L("",!0)])],6))]))),128))],6)):L("",!0)],6),b(x).contentColumn?(k(),_("li",{key:0,class:H(["megamenu-column lg:col-span-6 h-full",b(n).getAnimateMenu?"opacity-100 duration-300":"opacity-0"]),style:xn(N())},[b(x).contentColumn.column_links&&Array.isArray(b(x).contentColumn.column_links)?(k(),_("div",wSe,[(k(!0),_(ce,null,Oe(b
196(x).contentColumn.column_links,(P,Q)=>(k(),_("div",{key:Q,class:H(["featured-story flex flex-col flex-1",b(n).getAnimateMenu?"opacity-100 duration-300":"opacity-0"]),style:xn(D(Q))},[P.story_image?(k(),xe(j,{key:0,src:Array.isArray(P.story_image)?P.story_image[0]?.url||P.story_image[0]:P.story_image.url||P.story_image,alt:P.story_headline,class:"w-full object-cover aspect-[2/1]"},null,8,["src","alt"])):L("",!0),m("div",kSe,[m("div",null,[P.story_headline?(k(),_("div",{key:0,class:"featured-story__headline",innerHTML:P.story_headline},null,8,xSe)):L("",!0),P.story_paragraph?(k(),_("p",{key:1,class:"featured-story__paragraph",innerHTML:P.story_paragraph},null,8,CSe)):L("",!0)]),P.story_link&&V.$isInternalLink(P.story_link)?(k(),xe(Y,{key:0,to:V.$getInternalPath(P.story_link,!0),tabindex:P.tabindex,class:"btn light mt-auto inline-flex self-start",onClick:J=>$(J,V.$getInternalPath(P.story_link,!0)),onAuxclick:b(f)},{default:qe(()=>[m("span",{innerHTML:P.story_link_text||"View all"},null,8,_Se)]),_:2},1032,["to","tabindex","onClick","onAuxclick"])):P.story_link&&!V.$isInternalLink(P.story_link)?(k(),_("a",{key:1,href:P.story_link,tabindex:P.tabindex,class:"btn light mt-auto inline-flex self-start",onClick:W,onAuxclick:B[6]||(B[6]=(...J)=>b(f)&&b(f)(...J))},[m("span",{innerHTML:P.story_link_text||"View all"},null,8,MSe)],40,SSe)):L("",!0)])],6))),128))])):L("",!0)],6)):L("",!0)])):L("",!0)])):L("",!0)])],10,h2e)}}}),ESe={class:"grid grid-cols-4 md:grid-cols-12 p-global gap-global bg-black overflow-hidden pb-[105px]"},ASe={class:"col-span-2 lg:col-span-3 grid-lines horizontal top bottom"},OSe={class:"content flex pt-[9.5rem] z-[1] relative"},ISe={key:0,class:"flex flex-col gap-global"},NSe=["innerHTML"],LSe=["href","target","tabindex"],RSe=["innerHTML"],$Se={class:"grid grid-cols-2 gap-global max-w-[450px]"},DSe=["href","target","innerHTML","tabindex"],PSe={__name:"MegaDropdown",props:{submenu:{type:Array,default:[]}},setup(t){hi();const e=$u(),n=U(()=>!["xs","sm","smmd","md"].includes(e.getCurrentBreakpoint)),r=Uo(),o=U(()=>r.getActiveChildren.length),s=a=>{r.forceCloseAll()},i=Cs();return Ye(()=>i.path,(a,l)=>{a!==l&&r.getMegaDropState&&r.forceCloseAll()},{immediate:!1}),Ye(()=>i.fullPath,(a,l)=>{a!==l&&r.getMegaDropState&&r.forceCloseAll()},{immediate:!1}),(a,l)=>{const c=pu,u=fa;return k(),_("div",{class:H(["absolute top-0 left-0 w-full z-30 duration-500",b(r).getMegaDropState?"pointer-events-auto translate-y-0":"pointer-events-none -translate-y-full"])},[m("div",ESe,[m("div",ASe,[m("div",OSe,[b(r).getMegaDropState?(k(),_("button",{key:0,class:"block lg:hidden","aria-label":"Back to main menu",id:"mega-menu-arrow",onClick:l[0]||(l[0]=d=>b(r).closeMegaDrop(!0))},[Z(c,{name:"arrow-left",classes:"child:w-12 child:h-12"})])):L("",!0)])]),l[1]||(l[1]=m("div",{class:"col-span-2 lg:col-span-3 row-start-2 grid-lines horizontal top bottom"},[m("div",{class:"h-full !absolute inset-0 grid-lines vertical left right"}),m("div",{class:"content"}
196)],-1)),(k(!0),_(ce,null,Oe(b(r).getActiveChildren,(d,f)=>(k(),_("div",{class:H(["grid-lines horizontal top bottom",[b(o)>2&&f>2||b(o)<=2&&f>1?"pt-global":"pt-40",b(o)>2&&f>1?"max-lg:!pt-global":"",f%2?"max-lg:col-start-8":"",b(o)>2?"col-span-3":"col-span-4"]])},[m("div",{class:H(["content flex items-end z-[1] relative",b(r).getAnimateMenu?"opacity-100 translate-y-0 duration-300 delay-[450ms]":"opacity-0 translate-y-6"])},[d.url?(k(),_("div",ISe,[a.$isInternalLink(d.url)?(k(),xe(u,{key:0,to:a.$getInternalPath(d.url,!0),tabindex:b(n)?d.tabindex:"0",onClick:s},{default:qe(()=>[m("h3",{class:"mb-0",innerHTML:d.title},null,8,NSe)]),_:2},1032,["to","tabindex"])):(k(),_("a",{key:1,href:d.url,target:d.target,tabindex:b(n)?d.tabindex:"0",onClick:s},[m("h3",{class:"mb-0",innerHTML:d.title},null,8,RSe)],8,LSe))])):L("",!0)],2),d.children.length>0?(k(),_("div",{key:0,class:H(["content mt-global",b(r).getAnimateMenu?"opacity-100 translate-y-0 duration-300 delay-[500ms]":"opacity-0 translate-y-6"])},[m("nav",null,[m("ul",$Se,[(k(!0),_(ce,null,Oe(d?.children,h=>(k(),_("li",{class:H(["text-sm text-gray hover:text-white duration-200",d.children.length>7?"col-span-1":"col-span-2"]),key:h.ID},[a.$isInternalLink(h)?(k(),xe(u,{key:0,to:a.$getInternalPath(h),innerHTML:h.title,tabindex:b(n)?h.tabindex:"0",onClick:s},null,8,["to","innerHTML","tabindex"])):(k(),_("a",{key:1,href:h.url,target:h.target,innerHTML:h.title,tabindex:b(n)?h.tabindex:"0",onClick:s},null,8,DSe))],2))),128))])])],2)):L("",!0)],2))),256))])],2)}}},HSe={key:0,class:"w-full flex flex-col"},BSe={key:0},FSe={key:0,class:"flex flex-col gap-global"},jSe={class:"megamenu-section-link__text !text-2xl"},zSe={key:1,class:"megamenu-section-link"},VSe={class:"megamenu-section-link__text !text-2xl"},USe={key:1,class:"mt-4"},qSe={class:"flex flex-col gap-2 list-none p-0"},WSe={class:"megamenu-link-icon"},KSe=["src","alt"],GSe={key:1,xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none"},JSe={class:"megamenu-link-content"},YSe=["innerHTML"],XSe=["innerHTML"],ZSe=["href","target"],QSe={class:"megamenu-link-icon"},e4e=["src","alt"],t4e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none"},n4e={class:"megamenu-link-content"},r4e=["innerHTML"],o4e=["innerHTML"],s4e={class:"megamenu-link-icon"},i4e=["src","alt"],a4e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none"},l4e={class:"megamenu-link-content"},c4e=["innerHTML"],u4e=["innerHTML"],d4e={key:1},f4e={key:0},h4e=["src","alt"],p4e={key:1,class:"featured-story__headline !text-2xl"},m4e={key:2,class:"featured-story__paragraph"},g4e=["href"],y4e={__name:"AcfBurgerMegamenu",props:{menuItem:{type:Object,required:!0}},setup(t){const e=t,n=Uo(),r=$u(),{hasMegamenu:o,getMegamenuColumns:s,processMenuLink:i}=S0(),{onMenuLinkClick:a,onMenuAuxClick:l,onExternalLinkClick:c}=CI(),u=U(()=>r.getCurrentBreakpoint);Ye(u,(g,y)=>{(g==="md"&&y==="lg"||g==="lg"&&y==="md"||y==="md"&&g==="sm"||y==="sm"&&g==="md")&&n.reset()});const d=U(()=>(s(e.menuItem)||[]).map(y=>{if(y.column_links&&Array.isArray(y.column_links)){const w=y.column_links.map(x=>({...x,processed:i(x.links)}));return{...y,column_links:w}}return y})),f=(g,y)=>{a(g,y)},h=g=>{c(g)},p=g=>{n.forceCloseAll()};return(g,y)=>{const w=fa;return t.menuItem&&b(o)(t.menuItem)?(k(),_("div",HSe,[(k(!0),_(ce,null,Oe(d.value,(x,C)=>(k(),_("div",{key:`column-${C}`,class:"w-full mb-global"},[!x.column_type||x.column_type==="links"?(k(),_("div",BSe,[x.section_links&&x.section_links.page_title?(k(),_("div",FSe,[x.section_links.page_link?(k(),xe(w,{key:0,to:x.section_links.page_link,class:"megamenu-section-link",onClick:p},{default:qe(()=>[m("span",jSe,ve(x.section_links.page_title),1),y[2]||(y[2]=m("svg",{class:"megamenu-section-link__arrow",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 18 18",fill:"none"},[m("path",{d:"M17.3151 9.81818L18 9.0024L17.3151 8.18662L11.1271 0.815782L10.4423 0L9.07654 1.62677L9.76141 2.44255L14.2977 7.85071H0.966876H0V10.1541H0.966876H14.2977L9.75739 15.5575L9.07252 16.3732L10.4382 18L11.1231 17.1842L17.3151 9.81818Z",fill:"#FFFFFF"})],-1))]),_:2},1032,["to"])):(k(),_("div",zSe,[m("span",VSe,ve(x.section_links.page_title),1)]))])):L("",!0),x.column_links&&x.column_links.length>0?(k(),_("nav",USe,[m("ul",qSe,[(k(!0),_(ce,null,Oe(x.column_links,(v,S)=>(k(),_("li",{key:`link-${S}`},[v.processed.url&&g.$isInternalLink(v.processed.url)?(k(),xe(w,{key:0,to:g.$getInternalPath(v.processed.url,!0),class:H(["megamenu-link",{"has-icon-image":v.processed.icon}]),onClick:E=>f(E,g.$getInternalPath(v.processed.url,!0)),onAuxclick:b(l)},{default:qe(()=>[m("div",WSe,[v.processed.icon?(k(),_("img",{key:0,src:v.processed.icon.url,alt:v.processed.icon.alt},null,8,KSe)):(k(),_("svg",GSe,[...y[3]||(y[3]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"currentColor"},null,-1)])])),y[4]||(y[4]=m("svg",{class:"arrow-on-hover",xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none"},[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"currentColor"})],-1))]),m("div",JSe,[m("div",{class:"megamenu-link-title",innerHTML:v.processed.title},null,8,YSe),m("div",{class:"megamenu-link-description",innerHTML:v.processed.description},null,8,XSe)])]),_:2},1032,["to","class","onClick","onAuxclick"])):v.processed.url&&!g.$isInternalLink(v.processed.url)?(k(),_("a",{key:1,href:v.processed.url,target:v.processed.target,class:H(["megamenu-link",{"has-icon-image":v.processed.icon}]),onClick:h,onAuxclick:y[0]||(y[0]=(...E)=>b(l)&&b(l)(...E))},[m("div",QSe,[v.processed.icon?(k(),_("img",{key:0,src:v.processed.icon.url,alt:v.processed.icon.alt},null,8,e4e)):(k(),_("svg",t4e,[...y[5]||(y[5]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"currentColor"},null,-1)])])),y[6]||(y[6]=m("svg",{class:"arrow-on-hover",xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none"},[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"currentColor"})],-1))]),m("div",n4e,[m("div",{class:"megamenu-link-title",innerHTML:v.processed.title},null,8,r4e),m("div",{class:"megamenu-link-description",innerHTML:v.processed.description},null,8,o4e)])],42,ZSe)):(k(),_("div",{key:2,class:H(["megamenu-link cursor-default",{"has-icon-image":v.processed.icon}])}
196,[m("div",s4e,[v.processed.icon?(k(),_("img",{key:0,src:v.processed.icon.url,alt:v.processed.icon.alt},null,8,i4e)):(k(),_("svg",a4e,[...y[7]||(y[7]=[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"currentColor"},null,-1)])])),y[8]||(y[8]=m("svg",{class:"arrow-on-hover",xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 13 13",fill:"none"},[m("path",{d:"M12.5054 7.09091L13 6.50173L12.5054 5.91256L8.03626 0.589176L7.54163 0L6.55528 1.17489L7.04991 1.76406L10.3261 5.66995H0.698299H0V7.33351H0.698299H10.3261L7.047 11.2359L6.55237 11.8251L7.53872 13L8.03335 12.4108L12.5054 7.09091Z",fill:"currentColor"})],-1))]),m("div",l4e,[m("div",{class:"megamenu-link-title",innerHTML:v.processed.title},null,8,c4e),m("div",{class:"megamenu-link-description",innerHTML:v.processed.description},null,8,u4e)])],2))]))),128))])])):L("",!0)])):L("",!0),x.column_type==="content"?(k(),_("div",d4e,[x.column_links&&Array.isArray(x.column_links)?(k(),_("div",f4e,[(k(!0),_(ce,null,Oe(x.column_links,(v,S)=>(k(),_("div",{key:S,class:"featured-story mt-4"},[v.story_image?(k(),_("img",{key:0,src:Array.isArray(v.story_image)?v.story_image[0]?.url||v.story_image[0]:v.story_image.url||v.story_image,alt:v.story_headline,class:"featured-story__image"},null,8,h4e)):L("",!0),v.story_headline?(k(),_("h4",p4e,ve(v.story_headline),1)):L("",!0),v.story_paragraph?(k(),_("p",m4e,ve(v.story_paragraph),1)):L("",!0),v.story_link&&g.$isInternalLink(v.story_link)?(k(),xe(w,{key:3,to:g.$getInternalPath(v.story_link,!0),class:"btn btn-primary mt-2",onClick:E=>f(E,g.$getInternalPath(v.story_link,!0)),onAuxclick:b(l)},{default:qe(()=>[Le(ve(v.story_link_text||"View all"),1)]),_:2},1032,["to","onClick","onAuxclick"])):v.story_link&&!g.$isInternalLink(v.story_link)?(k(),_("a",{key:4,href:v.story_link,class:"btn btn-primary mt-2",onClick:h,onAuxclick:y[1]||(y[1]=(...E)=>b(l)&&b(l)(...E))},ve(v.story_link_text||"View all"),41,g4e)):L("",!0)]))),128))])):L("",!0)])):L("",!0)]))),128))])):L("",!0)}}},v4e={class:"block menu-pull-down flex-auto text-left"},b4e={class:"w-8"},w4e={key:1},k4e={__name:"BurgerAccordion",props:{title:{type:String,default:"Menu Item"},parent:{type:Object,default:()=>{}},isMegamenu:{type:Boolean,default:!1}},setup(t){const e=t,n=Uo(),r=pe(!1);function o(){r.value=!r.value,r.value?n.setActiveLink(e.parent):n.setActiveLink(null)}const s=Ru(),i=U(()=>s.transitionActive),a=U(()=>n.getBurgerState);return Ye(a,l=>{l&&r.value&&(r.value=!1)}),Ye(i,l=>{l&&r.value&&(r.value=!1)}),(l,c)=>{const u=pu;return k(),_("div",{class:H(["flex flex-col w-full",{"gap-global":!t.isMegamenu}])},[m("div",{class:H(["flex items-end",{"gap-global":!t.isMegamenu}])},[m("button",{onClick:o,class:"flex gap-2 items-center text-xl md:text-2xl w-full"},[m("span",v4e,ve(e.title),1),m("div",b4e,[b(r)?(k(),xe(u,{key:0,rel:"icon",classes:"child:h-8 child:w-8",name:"minus"})):(k(),xe(u,{key:1,rel:"icon",classes:"child:h-8 child:w-8",name:"plus"}))])])],2),t.isMegamenu?(k(),_("div",{key:0,class:H(["accordion-content",{"accordion-active":b(r)}]),style:xn({"--accordion-max-height":b(r)?"2000px":"0px"})},[Ot(l.$slots,"default")],6)):b(r)?(k(),_("div",w4e,[Ot(l.$slots,"default")])):L("",!0)],2)}}},x4e={class:"flex flex-col gap-global"},C4e={class:"col-span-12 flex items-end"},_4e={key:0,class:"flex flex-col gap-global"},S4e=["innerHTML"],M4e=["href","target"],T4e=["innerHTML"],E4e={class:"col-span-12 row-start-2"},A4e={key:0,class:"grid grid-cols-12 gap-4 sm:gap-[32px] max-w-[450px]"},O4e=["href","target","innerHTML"],I4e={__name:"BurgerSubMenuItem",props:{sublink:{type:Object,default:()=>{}}},setup(t){const e=t,n=Uo(),r=o=>{n.forceCloseAll()};return(o,s)=>{const i=fa;return k(),_("div",x4e,[m("div",C4e,[e.sublink.title?(k(),_("div",_4e,[o.$isInternalLink(e.sublink.url)?(k(),xe(i,{key:0,to:o.$getInternalPath(e.sublink.url,!0),onClick:r},{default:qe(()=>[m("h5",{class:"mb-0",innerHTML:e.sublink.title}
196,null,8,S4e)]),_:1},8,["to"])):(k(),_("a",{key:1,href:e.sublink.url,target:e.sublink.target,onClick:r},[m("h5",{class:"mb-0",innerHTML:e.sublink.title},null,8,T4e)],8,M4e))])):L("",!0)]),m("div",E4e,[m("nav",null,[e.sublink.children&&e.sublink.children?.length>0?(k(),_("ul",A4e,[(k(!0),_(ce,null,Oe(e.sublink.children,a=>(k(),_("li",{class:H(["text-sm text-green-20 hover:text-white duration-200",e.sublink.children.length>7?"col-span-12 xs:col-span-6":"col-span-12"]),key:a.ID},[o.$isInternalLink(a)?(k(),xe(i,{key:0,to:o.$getInternalPath(a),innerHTML:a.title,onClick:r},null,8,["to","innerHTML"])):(k(),_("a",{key:1,href:a.url,target:a.target,innerHTML:a.title,onClick:r},null,8,O4e))],2))),128))])):L("",!0)])])])}}},N4e={class:"grid grid-cols-12 p-global gap-global bg-black overflow-hidden h-auto"},L4e=["onClick"],R4e=["innerHTML"],$4e={class:"w-4"},D4e=["onClick"],P4e=["innerHTML"],H4e={class:"w-4"},B4e={class:"w-full flex flex-col"},F4e=["innerHTML"],j4e=["href","target"],z4e=["innerHTML"],V4e={__name:"BurgerMenu",props:{menu:{type:Array,default:[]},hasMegaMenu:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:e}){const n=t,r=Uo(),o=$u(),{hasMegamenu:s}=S0(),i=U(()=>o.getCurrentBreakpoint);Ye(i,(c,u)=>{(c==="md"&&u==="lg"||c==="lg"&&u==="md"||u==="md"&&c==="sm"||u==="sm"&&c==="md")&&r.reset()});const a=U(()=>r.getBurgerState);U(()=>o.currentBreakpoint==="md"||o.currentBreakpoint==="lg"),U(()=>n.submenu.find(c=>c.title==="Public")),U(()=>n.submenu.find(c=>c.title==="Private"));const l=c=>{r.forceCloseAll()};return(c,u)=>{const d=pu,f=y4e,h=k4e,p=I4e,g=fa;return k(),_("div",{class:H(["absolute top-0 left-0 w-full z-20 duration-300 overflow-scroll max-md:h-dscreen md:h-auto",[a.value?"pointer-events-auto translate-y-0 bg-black opacity-100":"pointer-events-none -translate-y-full bg-transparent opacity-0",{"has-mega-menu":t.hasMegaMenu},{"megamenu-desktop":t.hasMegaMenu&&!b(o).isMobileTablet},{"megamenu-mobile-tablet":t.hasMegaMenu&&b(o).isMobileTablet}]])},[m("div",N4e,[(k(!0),_(ce,null,Oe(n.menu,(y,w)=>(k(),_("div",{class:H(["col-span-12 md:col-span-4 pt-global h-fit first:max-md:pt-32 md:min-h-150px grid-lines top bottom flex items-end",(b(s)(y)||y.children&&y.children.length>0)&&b(o).isMobileTablet?"":"horizontal"]),key:y.ID},[m("div",{class:H(["duration-300 w-full z-10",a.value?"opacity-100 translate-y-0":"opacity-0 translate-y-4"]),style:xn("transition-delay:"+(250+w*70)+"ms")},[a.value&&b(s)(y)&&!b(o).isMobileTablet?(k(),_("button",{key:0,onClick:x=>b(r).openMegaDrop(y),class:"hidden md:flex gap-2 items-center text-xl md:text-2xl menu-pull-down"},[m("span",{innerHTML:y.title},null,8,R4e),m("div",$4e,[Ie(Z(d,{rel:"icon",classes:"child:h-8 child:w-8",name:"minus"},null,512),[[Pn,y.ID===b(r).getActiveLink?.ID]]),Ie(Z(d,{rel:"icon",classes:"child:h-8 child:w-8",name:"plus"},null,512),[[Pn,y.ID!==b(r).getActiveLink?.ID]])])],8,L4e)):a.value&&b(s)(y)&&b(o).isMobileTablet?(k(),xe(h,{key:1,title:y.title,parent:y,"is-megamenu":!0},{default:qe(()=>[Z(f,{"menu-item":y},null,8,["menu-item"])]),_:2},1032,["title","parent"])):a.value&&y.children&&y.children.length>0&&!b(o).isMobileTablet?(k(),_("button",{key:2,onClick:x=>b(r).openMegaDrop(y),class:"hidden md:flex gap-2 items-center text-xl md:text-2xl menu-pull-down"},[m("span",{innerHTML:y.title},null,8,P4e),m("div",H4e,[Ie(Z(d,{rel:"icon",classes:"child:h-8 child:w-8",name:"minus"},null,512),[[Pn,y.ID===b(r).getActiveLink?.ID]]),Ie(Z(d,{rel:"icon",classes:"child:h-8 child:w-8",name:"plus"},null,512),[[Pn,y.ID!==b(r).getActiveLink?.ID]])])],8,D4e)):a.value&&y.children&&y.children.length>0&&b(o).isMobileTablet?(k(),xe(h,{key:3,title:y.title,parent:y},{default:qe(()=>[m("div",B4e,[(k(!0),_(ce,null,Oe(y.children,x=>(k(),_("div",{class:H(["w-full first:mt-global last:mb-[50px]",x.children.length>0?"mb-[50px]":"mb-global"]),key:x.ID},[Z(p,{sublink:x},null,8,["sublink"])],2))),128))])]),_:2},1032,["title","parent"])):a.value&&c.$isInternalLink(y)?(k(),xe(g,{key:4,to:c.$getInternalPath(y),class:"text-xl md:text-2xl w-full md:w-auto flex",onClick:l},{default:qe(()=>[m("span",{class:"flex-auto menu-pull-down",innerHTML:y.title},null,8,F4e),u[0]||(u[0]=Le()),Z(d,{name:"arrow-right",class:"inline-block md:hidden menu-pull-down",classes:"child:w-8 child:h-8"})]),_:2},1032,["to"])):a.value?(k(),_("a",{key:5,href:y.url,target:y.target,class:"text-xl md:text-2xl w-full md:w-auto flex",onClick:l},[m("span",{class:"flex-auto menu-pull-down",innerHTML:y.title},null,8,z4e),u[1]||(u[1]=Le()),Z(d,{name:"arrow-right",class:"inline-block md:hidden menu-pull-down",classes:"child:w-8 child:h-8"})],8,j4e)):L("",!0)],6)],2))),128))])],2)}}},U4e={class:"grid grid-cols-4 md:grid-cols-12 p-global gap-global bg-black overflow-hidden"},q4e={class:"col-span-4 md:col-span-6 row-start-2 grid-lines horizontal top bottom gh-1"},W4e={key:0,class:"w-full absolute top-0 left-0 pb-global flex items-end gap-global text-white border-b-[1px] border-white -translate-y-full"},K4e=["tabindex"],G4e=["tabindex"],J4e={__name:"Search",props:{submenu:{type:Array,default:[]}},setup(t){const e=hi(),n=Cs(),r=U(()=>e.getSearchTabindex),o=Uo(),s=pe(n.query.q||""),i=async()=>{o.reset(),await Rc("/search/?q="+s.value,{replace:!0})};return Ye(()=>o.searchState,()=>{o.searchState&&setTimeout(()=>{document.querySelector('input[name="search"]').focus();const a=s.value;document.querySelector('input[name="search"]').value="",document.querySelector('input[name="search"]').value=a},100)}),(a,l)=>{const c=pu;return k(),_("div",{class:H(["absolute top-0 left-0 w-full z-30 duration-300 max-md:h-dscreen md:h-auto bg-black overflow-hidden",b(o).searchState?"pointer-events-auto translate-y-0":"pointer-events-none -translate-y-full"])},[m("div",U4e,[l[2]||(l[2]=ps('<div class="hidden md:block col-span-3 min-h-[200px] grid-lines horizontal top bottom"><div class="h-full !absolute inset-0 grid-lines vertical left right"></div></div><div class="hidden md:block col-span-3 row-start-2 grid-lines horizontal top bottom"><div class="h-full !absolute inset-0 grid-lines vertical left right"></div><div class="content"></div></div><div class="col-span-4 md:col-span-6 min-h-[200px] grid-lines horizontal top bottom"><div class="h-full !absolute inset-0 grid-lines vertical left right"></div><div class="content h-full flex items-end"></div></div>',3)),m("div",q4e,[l[1]||(l[1]=m("div",{class:"h-full !absolute inset-0 grid-lines vertical left right"},null,-1)),m("form",{class:H(["flex gap-global relative justify-between",b(o).searchState?"opacity-100 translate-y-0 duration-300 delay-[300ms]":"opacity-0 translate-y-6"]),onSubmit:nt(i,["prevent"])},[b(o).searchState?(k(),_("div",W4e,[Ie(m("input",{tabindex:b(r)+1,type:"text","onUpdate:modelValue":l[0]||(l[0]=u=>kt(s)?s.value=u:null),name:"search",placeholder:"Search",autocomplete:"off","aria-label":"Search f
196ield",class:"w-[inherit] bg-transparent mb-1 text-xl lg:text-2xl xl:text-3xl focus:outline-none"},null,8,K4e),[[cn,b(s)]]),Z(c,{name:"search",classes:"child:w-10 child:h-10",rel:"icon"})])):L("",!0),b(o).searchState?(k(),_("input",{key:1,tabindex:b(r)+2,type:"submit",value:"Search","aria-label":"Submit search form",class:"py-2.5 btn light cursor-pointer mt-global"},null,8,G4e)):L("",!0)],34)]),l[3]||(l[3]=ps('<div class="hidden md:block col-span-3 min-h-[200px] grid-lines horizontal top bottom"><div class="h-full !absolute inset-0 grid-lines vertical left right"></div></div><div class="hidden md:block col-span-3 row-start-2 grid-lines horizontal top bottom"><div class="h-full !absolute inset-0 grid-lines vertical left right"></div><div class="content"></div></div>',2))])],2)}}},Y4e={class:"flex justify-between lg:grid gap-global px-global grid-cols-12 relative"},X4e={class:"col-span-3"},Z4e={class:"col-span-9 flex items-center justify-end lg:justify-between"},Q4e={class:"gap-[3vw] hidden lg:flex items-center"},eMe=["data-menu-id","tabindex","aria-expanded","aria-controls","aria-label","onKeyup","onKeydown","onClick"],tMe=["innerHTML"],nMe={class:"w-4"},rMe=["data-menu-id","tabindex","aria-expanded","aria-controls","aria-label","onKeyup","onKeydown","onClick"],oMe=["innerHTML"],sMe={class:"w-4"},iMe=["innerHTML"],aMe=["onFocus","tabindex","href","target","innerHTML"],lMe={class:"flex gap-global"},cMe=["tabindex"],uMe=["tabindex"],dMe=["tabindex"],fMe=75,hMe={__name:"SiteHeader",setup(t){const e=Ru(),n=hi(),r=Uo(),o=$u(),{hasMegamenu:s}=S0(),{initializeFocusManagement:i,onMegamenuOpen:a,onMegamenuClose:l}=xI(),c=U(()=>o.getCurrentBreakpoint),u=U(()=>{if(typeof window>"u")return!1;const ee=parseInt(o.getBreakpoints.lg,10);return window.innerWidth>=ee}),d=pe(!0),f=pe(null),h=pe(!1);let p=!1,g=null,y=null;const w=pe(!1),x=pe(0),C=pe(0),v=pe(!1);let S=null;const E=ee=>{r.getMegaDropState&&(ee?ee.tabindex!==r.getActiveLink.tabindex&&(l(!1),r.closeMegaDrop()):r.closeMegaDrop()),r.getSearchState&&r.toggleSearchState()},M=ee=>{r.openMegaDrop(ee)},T=(ee,se)=>{if((ee.key==="Enter"||ee.key===" ")&&(ee.preventDefault(),!r.getMegaDropState)){r.openMegaDrop(se);return}if(ee.key==="Escape"&&(ee.preventDefault(),r.getMegaDropState)){r.closeMegaDrop();return}},A=(ee,se)=>{E(se)};Zt(()=>{d.value=B.value,f.value=W.value,v.value=!0,$(),window.addEventListener("scroll",$),S=i(),document.addEventListener("keydown",function(ee){ee.key==="Escape"&&(r.getMegaDropState?r.closeMegaDrop():r.getSearchState?(document.querySelector('[tabindex="'+n.getSearchTabindex+'"]').focus(),r.toggleSearchState()):r.getBurgerState&&r.toggleBurgerState())}),document.querySelectorAll("header a, header button").forEach(ee=>{ee.addEventListener("focus",()=>{r.setHeaderHideTop(!1),h.value=!1})})}),pl(()=>{window.removeEventListener("scroll",$),window.removeEventListener("resize",Se),typeof S=="function"&&S()});const N=U(()=>n.getSearchTabindex),D=U(()=>n.getBurgerTabindex);function $(){r.popupOpen||p||(window.scrollY<75?(w.value=!1,h.value=!1):(w.value=!0,window.scrollY<x.value&&C.value<window.scrollY&&(C.value=window.scrollY),window.scrollY>x.value?(h.value=V.value!==!0,C.value=window.scrollY):window.scrollY<C.value-fMe?h.value=!1:h.value=V.value!==!0),r.setHeaderHideTop(h.value),x.value=window.scrollY)}const W=U(()=>n.getFirstFlexBg),me=U(()=>n.getFirstFlexTextColor),V=U(()=>r.getBurgerState||r.getMegaDropState||r.getSearchState),B=U(()=>{const ee=["dark-green","darker-green","faded-green"];return V.value||ee.includes(W.value)&&w.value===!1?!0:W.value==="image"&&me.value==="light"&&w.value===!1});U(()=>{const ee=["dark-green","darker-green","faded-green"];return V.value||ee.includes(W.value)&&w.value===!1||W.value==="image"&&me.value==="light"&&w.value===!1?"white":"black"});const Y=U(()=>{const ee=n.getMenu("menu-1");let se=3;ee.forEach((F,q)=>{F.tabindex=se+q,F.children&&F.children.length>0&&F.children.forEach(ne=>{ne.tabindex=-1})});const Re=se+ee.length;return n.setTabindex("search",Re),n.setTabindex("burger",Re+1),n.setTabindex("career-menu",Re+2),ee});Ye(W,ee=>{f.value=ee}),Ye(B,ee=>{d.value=ee}),Ye(c,(ee,se)=>{(ee==="md"&&se==="lg"||ee==="lg"&&se==="md"||se==="md"&&ee==="sm"||se==="sm"&&ee==="md")&&r.reset()});const j=U(()=>e.transitionActive);Ye(()=>r.popupOpen,ee=>{ee?y=h.value:(y!==null&&(h.value=y,r.setHeaderHideTop(y),y=null),x.value=window.scrollY,u.value||(p=!0,clearTimeout(g),g=setTimeout(()=>{p=!1},300)))},{flush:"sync"}),Ye(j,ee=>{ee&&r.reset()});const P=U(()=>{const ee=r.getActiveLink;return ee&&s(ee)}),Q=U(()=>Y.value.some(ee=>s(ee))),J=()=>{const ee=document.querySelector(".megamenu-container"),se=document.querySelector(".megamenu-dropdown");
196if(document.querySelector(".megamenu-content"),!ee||!se)return;const Re=window.innerHeight,F=ee.getBoundingClientRect().top,q=Re-F;ee.classList.contains("overflow-y-auto"),window.getComputedStyle(ee),ee.classList.remove("overflow-y-auto"),requestAnimationFrame(()=>{const ne=se.cloneNode(!0);ne.style.position="absolute",ne.style.left="-9999px",ne.style.top="0",ne.style.width=se.offsetWidth+"px",ne.style.height="auto",ne.style.maxHeight="none",ne.style.overflow="visible",ne.style.visibility="hidden",ne.style.pointerEvents="none",ne.classList.remove("overflow-y-auto"),document.body.appendChild(ne),ne.offsetHeight;const de=ne.scrollHeight;if(document.body.removeChild(ne),de>q+60){se.style.height=q+"px",se.style.maxHeight=q+"px",se.style.overflowY="auto",se.style.overflowX="hidden",se.style.display="flex",se.style.flexDirection="column";const I=se.querySelector(".content"),O=se.querySelector(".megamenu-content");I&&(I.style.setProperty("height","auto","important"),I.style.setProperty("min-height",de+"px","important"),I.style.setProperty("flex","none","important"),I.style.setProperty("overflow","visible","important"),I.style.setProperty("max-height","none","important")),O&&(O.style.setProperty("height","auto","important"),O.style.setProperty("min-height","auto","important"),O.style.setProperty("flex","none","important"),O.style.setProperty("max-height","none","important")),se.querySelectorAll(".megamenu-column").forEach((K,G)=>{K.style.setProperty("height","auto","important"),K.style.setProperty("max-height","none","important"),K.style.setProperty("flex-shrink","0","important")}),se.classList.add("overflow-y-auto"),setTimeout(()=>{window.getComputedStyle(se)},100)}else se.style.height="auto",se.style.maxHeight="none",se.style.overflowY="visible",se.classList.remove("overflow-y-auto")})};Ye(()=>r.getMegaDropState,(ee,se)=>{ee&&!se?mn(()=>{const Re=r.getActiveLink;if(Re){const F=document.querySelector(`button[data-menu-id="${Re.ID}"]`),q=document.querySelector(".megamenu-container");F&&q&&(a(F,q),J())}}):!ee&&se&&l(!0)},{immediate:!1}),Ye(()=>r.getActiveLink?.ID,(ee,se)=>{ee!==se&&r.getMegaDropState&&setTimeout(()=>{J()},800)});let ke;const Se=()=>{ke&&clearTimeout(ke),r.getMegaDropState&&r.getActiveLink?.ID&&(ke=setTimeout(()=>{r.getMegaDropState&&document.querySelector(".megamenu-container")&&J()},200))};return Zt(()=>{window.addEventListener("resize",Se);const ee=F=>{(r.getMegaDropState||r.getBurgerState||r.getSearchState)&&r.forceCloseAll()},se=()=>{(r.getMegaDropState||r.getBurgerState||r.getSearchState)&&r.forceCloseAll()},Re=()=>{document.hidden&&(r.getMegaDropState||r.getBurgerState||r.getSearchState)&&r.forceCloseAll()};window.addEventListener("popstate",ee),window.addEventListener("beforeunload",se),document.addEventListener("visibilitychange",Re),pl(()=>{window.removeEventListener("popstate",ee),window.removeEventListener("beforeunload",se),document.removeEventListener("visibilitychange",Re)})}),(ee,se)=>{const Re=a2e,F=fa,q=pu,ne=pu,de=TSe,Pe=PSe,ot=V4e,I=J4e;return Ie((k(),_("header",{class:H(["site-header print:hidden z-[100]",[b(f)?"bg-"+b(f):"not-set",b(Q)&&b(r).getMegaDropState&&b(u)?"megamenu-active":"",b(Q)&&b(r).getMegamenuClosing&&b(u)?"megamenu-closing":"",b(r).getBurgerState?"burger-active":"",b(r).getSearchState?"search-active":""]])},[m("div",{class:H(["fixed top-0 w-full duration-300 z-[60]",b(h)?"-translate-y-full":"translate-y-0"])},[se[8]||(se[8]=m("a",{class:"!absolute -bottom-16 left-4 btn light z-100 sr-only focus-visible:not-sr-only focus:not-sr-only !duration-0",tabindex:"1",href:"#main-content"},"Skip to main content",-1)),m("nav",{class:H(["relative z-50 py-global site-nav transition-colors duration-300",[b(d)?"text-white":"text-black",!b(Q)&&b(w)&&!b(V)?"bg-light-gray color-black":"",b(Q)&&b(w)?"bg-light-gray color-black":"",b(r).getBurgerState?"bg-black":"",b(Q)?{"megamenu-open":b(V)&&b(u)}:{}]])},[m("div",Y4e,[m("div",X4e,[Z(F,{class:"text-xl leading-1 cursor-pointer inline-block",rel:"home",to:"/",tabindex:"2",onFocus:se[0]||(se[0]=O=>E(null))},{default:qe(()=>[se[7]||(se[7]=m("span",{class:"sr-only"},"Netcompany logo",-1)),Z(Re)]),_:1}
196)]),m("div",Z4e,[m("ul",Q4e,[(k(!0),_(ce,null,Oe(b(Y),(O,z)=>(k(),_("li",{key:O.ID,class:"cursor-pointer"},[b(s)(O)?(k(),_("button",{key:0,"data-menu-id":O.ID,tabindex:O.tabindex,"aria-expanded":b(r).getMegaDropState&&b(r).getActiveLink?.ID===O.ID,"aria-controls":"megamenu-"+O.ID,role:"button","aria-label":"Open "+O.title+" submenu",onKeyup:K=>A(K,O),onKeydown:K=>T(K,O),onClick:K=>M(O),class:"flex gap-2 items-center font-sans leading-none font-normal sub-menu-button"},[m("span",{class:"font-sans leading-none font-normal",innerHTML:O.title},null,8,tMe),m("div",nMe,[Ie(Z(q,{rel:"icon",classes:"child:h-4 child:w-4",name:"minus"},null,512),[[Pn,O.ID===b(r).getActiveLink?.ID]]),Ie(Z(q,{rel:"icon",classes:"child:h-4 child:w-4",name:"plus"},null,512),[[Pn,O.ID!==b(r).getActiveLink?.ID]])])],40,eMe)):O.children&&O.children.length>0?(k(),_("button",{key:1,"data-menu-id":O.ID,tabindex:O.tabindex,"aria-expanded":b(r).getMegaDropState&&b(r).getActiveLink?.ID===O.ID,"aria-controls":"megamenu-"+O.ID,role:"button","aria-label":"Open "+O.title+" submenu",onKeyup:K=>A(K,O),onKeydown:K=>T(K,O),onClick:K=>M(O),class:"flex gap-2 items-center font-sans leading-none font-normal sub-menu-button"},[m("span",{class:"font-sans leading-none font-normal",innerHTML:O.title},null,8,oMe),m("div",sMe,[Ie(Z(q,{rel:"icon",classes:"child:h-4 child:w-4",name:"minus"},null,512),[[Pn,O.ID===b(r).getActiveLink?.ID]]),Ie(Z(q,{rel:"icon",classes:"child:h-4 child:w-4",name:"plus"},null,512),[[Pn,O.ID!==b(r).getActiveLink?.ID]])])],40,rMe)):ee.$isInternalLink(O)?(k(),xe(F,{key:2,onFocus:K=>E(O),tabindex:O.tabindex,to:ee.$getInternalPath(O)},{default:qe(()=>[m("span",{innerHTML:O.title},null,8,iMe)]),_:2},1032,["onFocus","tabindex","to"])):(k(),_("a",{key:3,onFocus:K=>E(O),tabindex:O.tabindex,href:O.url,target:O.target,innerHTML:O.title},null,40,aMe))]))),128))]),m("div",lMe,[m("button",{"aria-label":"Toggle searchbar",onClick:se[1]||(se[1]=O=>b(r).toggleSearchState()),tabindex:b(N)},[Z(ne,{name:"search",classes:"child:w-5 child:h-5 cursor-pointer"})],8,cMe),Ie(m("button",{class:"block lg:hidden","aria-label":"Open burger menu",onClick:se[2]||(se[2]=(...O)=>b(r).toggleBurgerState&&b(r).toggleBurgerState(...O)),tabindex:b(D),onFocus:se[3]||(se[3]=O=>E(null))},[Z(ne,{name:"burger",classes:"child:w-5 child:h-5 cursor-pointer"})],40,uMe),[[Pn,!b(r).getBurgerState&&!b(r).getMegaDropState]]),Ie(m("button",{"aria-label":"Close burger menu",class:"block lg:hidden",onClick:se[4]||(se[4]=(...O)=>b(r).reset&&b(r).reset(...O)),tabindex:b(D),onFocus:se[5]||(se[5]=O=>E(null))},[Z(ne,{name:"close",classes:"child:w-5 child:h-5 cursor-pointer"})],40,dMe),[[Pn,b(r).getBurgerState||b(r).getMegaDropState]])])])])],2),b(P)?(k(),xe(de,{key:0,class:"hidden md:block z-40","is-acf":!0})):(k(),xe(Pe,{key:1,class:"hidden md:block z-40","is-legacy":!0})),Z(ot,{class:"block lg:hidden z-30",menu:b(Y),"has-mega-menu":b(Q)},null,8,["menu","has-mega-menu"]),Z(I,{class:"z-30"}),b(V)?(k(),_("div",{key:2,class:"fixed inset-0 h-screen z-20",onClick:se[6]||(se[6]=(...O)=>b(r).reset&&b(r).reset(...O))})):L("",!0)],2)],2)),[[Pn,b(v)]])}}},pMe=globalThis.setInterval,_I={__name:"DynamicHeightComponent",props:{index:{type:Number,default:4},innerClasses:{type:String,default:""},innerStyles:{type:String,default:""},emitRowspan:{type:Boolean,default:!1},shouldRecalculate:{type:Number,default:0},excludeMargin:{type:String,default:""},subtract:{type:Number,default:0}},emits:["setHeight"],setup(t,{emit:e}){const n=e,r=pe(),{rowSpan:o,start:s,destroy:i,recalculate:a}=wI(),l=t;Zt(async()=>{if(await mn(),l.index<3){s(r.value,l.excludeMargin,0),await mn();const u=Date.now(),d=pMe(function(){Date.now()-u>300?clearInterval(d):a()},100)}else s(r.value,l.excludeMargin,0)}),pl(()=>{i()});const c=U(()=>l.shouldRecalculate);return Ye(c,(u,d)=>{u!==d&&a()}),Ye(o,(u,d)=>{l.emitRowspan&&u!==d&&n("setHeight",u)}),(u,d)=>(k(),_("div",{class:H("gh-"+(b(o)-t.subtract))},[m("div",{class:H(t.innerClasses),ref_key:"dynamicContent",ref:r},[Ot(u.$slots,"default")],2)],2))}},mMe={},gMe={width:"882",height:"135",viewBox:"0 0 882 135",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"w-[212px] h-auto lg:h-[2.3vw] lg:w-auto"};function yMe(t,e){return k(),_("svg",gMe,[...e[0]||(e[0]=[ps('<path d="M0 106.52V0H19.0218L65.7377 72.8903C69.5421 78.8249 72.5855 84.7595 74.8682 89.6285H75.4766C75.0205 84.3024 74.7158 77.9116 74.7158 70.3029V0H89.4771V106.52H70.4553L23.587 34.2387C19.7827 28.3041 16.7391 22.3695 14.6089 17.3477H14.0004C14.4565 22.5214 14.7603 28.9126 14.7603 36.369V106.52H0Z" fill="currentColor"></path><path d="M180.173 68.4778H116.413C117.63 86.1292 127.673 96.7814 141.978 96.7814C153.391 96.7814 162.52 90.3897 163.891 81.1078H178.651C176.977 98.3031 160.
196695 108.346 141.978 108.346C117.782 108.346 101.348 91.4553 101.348 64.6734C101.348 39.8694 116.565 21 141.673 21C167.238 21 180.173 39.8694 180.173 65.738V68.4778ZM116.717 57.2171H164.651C163.586 41.0869 154.303 32.5649 141.673 32.5649C128.587 32.5649 119 41.6954 116.717 57.2171Z" fill="currentColor"></path><path d="M229.937 34.3911H211.372V83.2377C211.372 92.8243 215.328 96.1725 221.72 96.1725C224.459 96.1725 227.35 95.563 229.937 94.3461V106.215C227.35 107.128 224.003 107.889 219.589 107.889C206.047 107.889 196.764 100.889 196.764 84.6071V34.3911H184.895V22.8257H196.764V0H211.372V22.8257H229.937V34.3911Z" fill="currentColor"></path><path d="M235.871 64.6734C235.871 38.9561 252.153 21 276.957 21C298.109 21 313.022 34.0867 314.544 54.1736H299.326C297.652 42.7605 291.413 32.5649 277.109 32.5649C260.979 32.5649 251.088 45.4997 251.088 64.6734C251.088 83.8466 261.131 96.7814 276.805 96.7814C289.435 96.7814 298.261 88.4118 299.631 74.26H314.847C313.326 95.2596 297.804 108.346 276.652 108.346C252.457 108.346 235.871 90.3897 235.871 64.6734Z" fill="currentColor"></path><path d="M323.676 64.3692C323.676 38.8043 339.654 21 364.458 21C389.262 21 405.239 38.8043 405.239 64.3692C405.239 90.3897 389.262 108.346 364.458 108.346C339.654 108.346 323.676 90.3897 323.676 64.3692ZM390.023 64.3692C390.023 45.3474 379.979 32.5649 364.458 32.5649C348.936 32.5649 338.893 45.3474 338.893 64.3692C338.893 83.5418 348.936 96.7814 364.458 96.7814C379.979 96.7814 390.023 83.5418 390.023 64.3692Z" fill="currentColor"></path><path d="M536.562 49.1517V106.52H521.953V50.6735C521.953 40.326 515.258 32.8697 504.911 32.8697C492.128 32.8697 483.454 44.1303 483.454 63.7602V106.52H468.846V50.6735C468.846 40.326 461.998 32.8697 451.954 32.8697C438.868 32.8697 430.346 45.4997 430.346 63.7602V106.52H415.738V22.826H429.89V41.9997H430.346C432.781 28.1521 444.498 21 456.367 21C468.846 21 479.802 28.7611 482.693 41.8477H482.998C486.65 26.9346 497.91 21 509.323 21C524.54 21 536.562 31.8041 536.562 49.1517Z" fill="currentColor"></path><path d="M629.39 64.2168C629.39 89.9336 613.564 108.194 593.326 108.194C580.999 108.194 569.13 101.347 565.173 87.6509H564.717V98.1507V134.368H550.109V22.826H564.717V41.9997H564.87C568.674 28.6087 580.391 21 593.782 21C614.478 21 629.39 38.5 629.39 64.2168ZM614.173 64.2168C614.173 45.1955 603.978 32.4131 589.826 32.4131C574.609 32.4131 564.565 47.0215 564.565 64.521C564.565 82.1725 574.761 96.629 589.674 96.629C603.978 96.629 614.173 83.3904 614.173 64.2168Z" fill="currentColor"></path><path d="M719.324 94.9549V105.912C716.129 106.976 712.934 107.585 709.433 107.585C697.564 107.585 692.39 100.737 692.39 90.542V87.6509H691.782C688.281 100.433 677.325 108.346 662.717 108.346C648.564 108.346 636.848 101.498 636.848 85.8244C636.848 66.4989 654.804 63.9125 671.086 61.0209C684.021 58.7388 691.934 55.9995 691.934 46.1082C691.934 38.3476 687.064 32.2607 673.521 32.2607C660.738 32.2607 653.434 37.891 653.434 50.5216H638.826C639.13 31.8041 651.608 21 673.521 21C694.673 21 706.237 31.1956 706.237 49.456V87.4986C706.237 95.1073 710.042 96.4767 713.238 96.4767C715.368 96.4767 717.498 95.8681 719.324 94.9549ZM691.934 68.6291V64.6734C686.759 68.4778 680.064 70.3033 674.282 71.5203C662.717 73.9552 651.76 75.1732 651.76 85.3683C651.76 93.4331 658.608 96.7814 667.13 96.7814C683.107 96.7814 691.934 85.3683 691.934 68.6291Z" fill="currentColor"></path><path d="M796.631 49.9126V106.52H782.023V52.6518C782.023 39.717 774.87 32.8697 764.218 32.8697C750.827 32.8697 741.241 43.6737 741.241 63.1516V106.52H726.633V22.826H740.785V41.9997H741.241C743.676 28.4563 755.24 21 768.175 21C784.762 21 796.631 32.5649 796.631 49.9126Z" fill="currentColor"></path><path d="M866.934 22.8262H881.999L851.869 103.477C847.456 115.194 836.956 134.368 817.173 134.368C811.848 134.368 808.5 132.998 806.978 132.237V120.215C808.956 121.281 812.457 122.65 816.87 122.65C826.456 122.65 832.696 115.955 835.891 107.89L802.109 22.8262H818.239L838.325 78.2169C839.847 82.1726 841.521 86.7379 842.587 92.5201H843.043C844.26 86.8902 845.934 82.325 847.456 78.2169L866.934 22.8262Z" fill="currentColor"></path>',10)])])}
196const vMe=Lu(mMe,[["render",yMe]]),bMe=()=>{const t=hi(),e=vt(),n=async()=>{const s=t.getLocalization;return s.hasLoaded?s:(e._localizationPending||(e._localizationPending=t.fetchLocalization().catch(()=>{e._localizationPending=null})),await e._localizationPending,t.getLocalization)},r=U(()=>t.getLocalization.country?.country_code||null),o=U(()=>t.getLocalization.country?.country_name||null);return n(),{getLocation:n,countryCode:r,countryName:o}};function wMe(){const t=pe("default"),{getCacheKey:e}=hi();e&&n(e);function n(r){return t.value=r}return{cacheKey:t}}const kMe={class:"relative print:hidden"},xMe={class:""},CMe={class:"grid grid-cols-12 px-global pb-[calc(var(--grid-gutter-space)-1px)] gap-x-global overflow-hidden main-footer relative text-white"},_Me={class:"flex flex-col gap-global content lg:hidden"},SMe=["href","textContent"],MMe=["href","textContent"],TMe={class:"col-span-12 md:col-span-6 lg:col-span-3 gh-1 pt-global flex flex-col gap-global lg:justify-end max-lg:hidden"},EMe={key:0,class:"lg:pull-down"},AMe={key:0,class:"col-span-12 md:col-span-6 lg:col-span-3 gh-1 pt-global flex flex-col gap-global lg:justify-end max-lg:hidden"},OMe={key:1,class:"col-span-12 md:col-span-6 lg:col-span-3 gh-1 pt-global flex flex-col gap-global lg:justify-end max-lg:hidden"},IMe={key:0,class:"lg:pull-down"},NMe={class:"flex flex-col gap-global content"},LMe=["href","textContent"],RMe=["href","textContent"],$Me={key:0,class:"lg:hidden mb-0"},DMe={class:"flex flex-col gap-y-global content"},PMe=["href","target","innerHTML"],HMe={key:1},BMe={class:"flex flex-col gap-y-global content md:hidden"},FMe=["href","target","innerHTML"],jMe={class:"flex flex-col gap-y-global content"},zMe=["href","target","innerHTML"],VMe={key:0,class:"lg:hidden mb-global"},UMe={class:"flex flex-col gap-y-global content"},qMe=["href","target","innerHTML"],WMe={class:"bg-pitch-black py-8 px-global flex flex-col lg:flex-row gap-y-global justify-between text-xs"},KMe={class:"order-2 md:order-1 flex flex-wrap gap-global gap-y-2 text-green-20"},GMe=["innerHTML"],JMe={key:1},YMe=["innerHTML"],XMe={class:"order-1 md:order-2"},ZMe={class:"flex flex-col md:flex-row gap-global text-green-20"},QMe=["href","target","innerHTML"],eTe=["innerHTML"],tTe={__name:"SiteFooter",setup(t){const e=pe("1.7.11"),{cacheKey:n}=wMe(),r=U(()=>`<!--  v.${e.value} | cmv:${n.value}-->`);Sw(async()=>{try{const y=await Wt(()=>import("./BAooSfjw.js"),[],import.meta.url);e.value=y.default.version||"1.7.3"}catch(y){console.warn("Could not load package.json version:",y)}});const o=hi(),{countryCode:s}=bMe(),i=U(()=>o.getSettings);U(()=>o.getLocalization);const a=U(()=>o.getMenu("footer-menu-1")),l=U(()=>{const y=a.value;return y?.length&&(y[0].children?.length||y[0].url==="#")?y[0]:null}),c=U(()=>{const y=l.value;return y?y.children?.length?y.children.filter(w=>w.ID!==y.ID):a.value.filter(w=>w.ID!==y.ID):a.value}),u=U(()=>o.getMenu("footer-menu-2")),d=U(()=>{const y=u.value;return y?.length&&(y[0].children?.length||y[0].url==="#")?y[0]:null}),f=U(()=>{const y=d.value;return y?y.children?.length?y.children.filter(w=>w.ID!==y.ID):u.value.filter(w=>w.ID!==y.ID):u.value}),h=U(()=>o.getMenu("footer-menu-bottom")),p=U(()=>{if(s.value===null||!i.value?.countries||!Array.isArray(i.value.countries))return null;const y=s.value.toUpperCase().trim();return i.value.countries.find(w=>w.country_code.split(",").map(x=>x.trim().toUpperCase()).includes(y))?.footer_menu_items}),g=pe(!1);return Zt(()=>{p.value&&(g.value=!0)}),(y,w)=>{const x=vMe,C=fa,v=_I;return k(),_("footer",kMe,[m("div",xMe,[m("div",CMe,[w[2]||(w[2]=m("div",{class:"absolute inset-0 z-behind bg-black"},null,-1)),Z(v,{class:"col-span-12 lg:col-span-3 pt-global flex flex-col gap-global lg:justify-end","inner-classes":"flex flex-col gap-global"},{default:qe(()=>[Z(C,{class:"text-xl leading-1 mb-0 cursor-pointer inline-block lg:hidden",rel:"home",to:"/"},{default:qe(()=>[w[0]||(w[0]=m("span",{class:"sr-only"},"Netcompany logo",-1)),Z(x)]),_:1}),Z(C,{to:"/",class:"logo-link max-lg:hidden translate-y-[0.5vw]"},{default:qe(()=>[w[1]||(w[1]=m("span",{class:"sr-only"},"Netcompany logo",-1)),Z(x)]),_:1}),m("ul",_Me,[m("li",null,[i.value?.company_info?.company_phone?(k(),_("a",{key:0,href:`tel:${i.value?.company_info?.company_phone}`,textContent:ve(i.value?.company_info?.company_phone)},null,8,SMe)):L("",!0)]),m("li",null,[i.value?.company_info?.company_email?(k(),_("a",{key:0,href:`mailto:${i.value?.company_info?.company_email}`,textContent:ve(i.value?.company_info?.company_email)},null,8,MMe)):L("",!0)])])]),_:1}
196),m("div",TMe,[l.value?(k(),_("h5",EMe,ve(l.value.title),1)):L("",!0)]),g.value?(k(),_("div",AMe)):L("",!0),f.value.length?(k(),_("div",OMe,[d.value?(k(),_("h5",IMe,ve(d.value.title),1)):L("",!0)])):L("",!0),Z(v,{class:"col-span-12 md:col-span-6 lg:col-span-3 pt-global lg:row-start-2 hidden lg:block"},{default:qe(()=>[m("ul",NMe,[m("li",null,[i.value?.company_info?.company_phone?(k(),_("a",{key:0,href:`tel:${i.value?.company_info?.company_phone}`,textContent:ve(i.value?.company_info?.company_phone)},null,8,LMe)):L("",!0)]),m("li",null,[i.value?.company_info?.company_email?(k(),_("a",{key:0,href:`mailto:${i.value?.company_info?.company_email}`,textContent:ve(i.value?.company_info?.company_email)},null,8,RMe)):L("",!0)])])]),_:1}),Z(v,{class:"col-span-12 md:col-span-6 lg:col-span-3 pt-global lg:row-start-2","inner-classes":"flex flex-col gap-global"},{default:qe(()=>[l.value?(k(),_("h5",$Me,ve(l.value.title),1)):L("",!0),m("nav",null,[m("ul",DMe,[(k(!0),_(ce,null,Oe(c.value,S=>(k(),_("li",{key:S.ID},[y.$isInternalLink(S)?(k(),xe(C,{key:0,to:y.$getInternalPath(S)},{default:qe(()=>[Le(ve(S.title),1)]),_:2},1032,["to"])):(k(),_("a",{key:1,href:S.url,target:S.target,innerHTML:S.title},null,8,PMe))]))),128))])]),g.value?(k(),_("nav",HMe,[m("ul",BMe,[(k(!0),_(ce,null,Oe(p.value,(S,E)=>(k(),_("li",{key:"local-link-"+E},[y.$isInternalLink(S.link)?(k(),xe(C,{key:0,to:y.$getInternalPath(S.link)},{default:qe(()=>[Le(ve(S.link.title),1)]),_:2},1032,["to"])):(k(),_("a",{key:1,href:S.link.url,target:S.link.target,innerHTML:S.link.title},null,8,FMe))]))),128))])])):L("",!0)]),_:1}),g.value?(k(),xe(v,{key:2,class:"col-span-12 md:col-span-6 lg:col-span-3 pt-global lg:row-start-2 max-md:hidden"},{default:qe(()=>[m("nav",null,[m("ul",jMe,[(k(!0),_(ce,null,Oe(p.value,(S,E)=>(k(),_("li",{key:"local-link-"+E},[y.$isInternalLink(S.link)?(k(),xe(C,{key:0,to:y.$getInternalPath(S.link)},{default:qe(()=>[Le(ve(S.link.title),1)]),_:2},1032,["to"])):(k(),_("a",{key:1,href:S.link.url,target:S.link.target,innerHTML:S.link.title},null,8,zMe))]))),128))])])]),_:1})):L("",!0),f.value.length?(k(),xe(v,{key:3,class:"col-span-12 md:col-span-6 lg:col-span-3 pt-global lg:row-start-2"},{default:qe(()=>[d.value?(k(),_("h5",VMe,ve(d.value.title),1)):L("",!0),m("nav",null,[m("ul",UMe,[(k(!0),_(ce,null,Oe(f.value,S=>(k(),_("li",{key:S.ID},[y.$isInternalLink(S)?(k(),xe(C,{key:0,to:y.$getInternalPath(S)},{default:qe(()=>[Le(ve(S.title),1)]),_:2},1032,["to"])):(k(),_("a",{key:1,href:S.url,target:S.target,innerHTML:S.title},null,8,qMe))]))),128))])])]),_:1})):L("",!0)])]),m("div",WMe,[m("div",KMe,[i.value?.company_info?.company_name?(k(),_("span",{key:0,innerHTML:"© "+i.value?.company_info?.company_name},null,8,GMe)):L("",!0),i.value?.company_info?.company_name?(k(),_("span",JMe,"All rights reserved")):L("",!0),i.value?.company_info?.company_cvr?(k(),_("span",{key:2,innerHTML:"CVR "+i.value?.company_info?.company_cvr},null,8,YMe)):L("",!0)]),m("nav",XMe,[m("ul",ZMe,[(k(!0),_(ce,null,Oe(h.value,S=>(k(),_("li",{key:S.ID,class:"hover:text-white duration-200"},[y.$isInternalLink(S)?(k(),xe(C,{key:0,to:y.$getInternalPath(S)},{default:qe(()=>[Le(ve(S.title),1)]),_:2},1032,["to"])):(k(),_("a",{key:1,href:S.url,target:S.target,innerHTML:S.title},null,8,QMe))]))),128))])])]),m("span",{innerHTML:r.value},null,8,eTe)])}}},nTe={},rTe={class:"px-global grid grid-cols-12 gap-x-global"};function oTe(t,e){return k(),_("div",rTe,[Ot(t.$slots,"default")])}const sTe=Lu(nTe,[["render",oTe]]),iTe={},aTe={class:"h-screen bg-dark-green text-white"},lTe={class:"col-span-12 gh-1"};function cTe(t,e){const n=kI,r=fa,o=sTe;return k(),_(ce,null,[Z(n),m("div",aTe,[Z(o,{class:"pt-global"},{default:qe(()=>[m("div",lTe,[Z(r,{class:"text-xl leading-1 cursor-pointer",rel:"home",to:"/"},{default:qe(()=>[...e[0]||(e[0]=[Le("Netcompany",-1)])]),_:1})]),e[1]||(e[1]=m("div",{class:"col-span-12"},[m("h1",{class:"mb-12"},"Sorry, we are down for scheduled maintenance."),m("h5",null,[Le("We expect to be back shortly."),m("br"),Le("Thank you for your patience.")])],-1))]),_:1})])],64)}const uTe=Lu(iTe,[["render",cTe]]),dTe=()=>
196{const t=$u(),e=t.getBreakpoints,n=pe(null);function r(l,c){return parseInt(l[1].replace("px",""))-parseInt(c[1].replace("px",""))}const o=()=>{const l=window.innerWidth;let c="xs";return Object.entries(e).sort(r).forEach(u=>{const[d,f]=u,h=parseInt(f.replace("px",""));l>=h&&(c=d)}),c};function s(){a(),window.addEventListener("resize",a)}function i(){window.removeEventListener("resize",a)}function a(){n.value=o(),t.setCurrentBreakpoint(n.value)}return{startCmBreakpoints:s,destroyCmBreakpoints:i}},fTe={class:"grid grid-cols-12 gap-x-global px-global z-10 relative"},hTe={class:"gh-1 pt-global col-span-12"},pTe=["innerHTML"],mTe={__name:"error",props:{error:Object},setup(t){const e=Uo(),n=gn(),r=Ru(),o=hi();o.setFirstFlexBg("light-gray");const s=o.getMaintenanceMode,{startCmBreakpoints:i,destroyCmBreakpoints:a}=dTe(),l=pe(!0),c=pe(!1),u=U(()=>n.currentRoute.value.path),d=U(()=>e.getBurgerState);Ye(d,(C,v)=>{document.body.style.overflow=C?"hidden":"auto"}),Ye(u,(C,v)=>{C!==v&&r.setTransition(!0)});const f=U(()=>r.transitionActive||l.value),h=U(()=>c.value&&!f.value),p=U(()=>e.getHeaderHideTop);Zt(()=>{c.value=!0,i(),setTimeout(()=>{l.value=!1},1e3)}),pl(()=>{a()});const g=t,y=()=>k3({redirect:"/"}),w={title:"Error... | Netcompany",og_title:"Error... | Netcompany",robots:{index:"noindex",follow:"nofollow","max-image-preview":"max-image-preview:none","max-snippet":"max-snippet:-1","max-video-preview":"max-video-preview:-1"}},{$yoastHead:x}=vt();return x&&CD(x(w)),(C,v)=>{const S=kI,E=hMe,M=_I,T=tTe;return b(s)?(k(),xe(uTe,{key:0,id:"mainLayout",class:"relative",ref:"layout"},null,512)):(k(),_("div",{key:1,id:"mainLayout",class:H(["relative",[b(h)?"page-ready":"",b(p)?"hide-grid":""]]),ref:"layout"},[m("div",{class:H(["fixed bg-light-gray inset-0 z-[10000] flex justify-center items-center duration-300",b(f)?"":"opacity-0 pointer-events-none"])},[Z(S)],2),Z(S),Z(E),v[3]||(v[3]=m("div",{class:"gh-1"},null,-1)),m("div",fTe,[m("div",hTe,[m("h1",{class:"text-giant",innerHTML:g.error.statusCode},null,8,pTe)]),Z(M,{class:"pt-global col-span-12 lg:col-span-6 lg:col-start-4"},{default:qe(()=>[v[0]||(v[0]=m("h4",null,"We couldn't find the page you were looking for.",-1)),v[1]||(v[1]=m("p",null,"Head to the front page, or browse through the navigation above or below.",-1)),m("button",{onClick:y,class:"btn light"},"Go to the front page")]),_:1}),v[2]||(v[2]=m("div",{class:"col-span-12 gh-1 pt-global"},null,-1))]),Z(T)],2))}}},gTe={key:0},vM={__name:"nuxt-root",setup(t){const e=()=>null,n=vt(),r=n.deferHydration();if(n.isHydrating){const c=n.hooks.hookOnce("app:error",r);gn().beforeEach(c)}const o=!1;Ks(vl,Cs()),n.hooks.callHookWith(c=>c.map(u=>u()),"vue:setup");const s=_g(),i=!1,a=/bot\b|chrome-lighthouse|facebookexternalhit|google\b/i;hT((c,u,d)=>{if(n.hooks.callHook("vue:error",c,u,d).catch(f=>console.error("[nuxt] Error in `vue:error` hook",f)),a.test(navigator.userAgent))return n.hooks.callHook("app:error",c),console.error(`[nuxt] Not rendering error page for bot with user agent \`${navigator.userAgent}\`:`,c),!1;if(x3(c)&&(c.fatal||c.unhandled))return n.runWithContext(()=>Oa(c)),!1});const l=!1;return(c,u)=>(k(),xe(Ow,{onResolve:b(r)},{default:qe(()=>[b(i)?(k(),_("div",gTe)):b(s)?(k(),xe(b(mTe),{key:1,error:b(s)},null,8,["error"])):b(l)?(k(),xe(b(e),{key:2,context:b(l)},null,8,["context"])):b(o)?(k(),xe(LN(b(o)),{key:3})):(k(),xe(b(t2e),{key:4}))]),_:1},8,["onResolve"]))}};let bM;{let t;bM=async function(){if(t)return t;const r=!!(window.__NUXT__?.serverRendered??document.getElementById("__NUXT_DATA__")?.dataset.ssr==="true")?tR(vM):eR(vM),o=p$({vueApp:r});async function s(i){await o.callHook("app:error",i),o.payload.error||=Qa(i)}r.config.errorHandler=s,o.hook("app:suspense:resolve",()=>{r.config.errorHandler===s&&(r.config.errorHandler=void 0)});try{await y$(o,F_e)}catch(i){s(i)}try{await o.hooks.callHook("app:created",r),await o.hooks.callHook("app:beforeMount",r),r.mount(d$),await o.hooks.callHook("app:mounted",r),await mn()}catch(i){s(i)}return r},t=bM().catch(e=>{throw console.error("Error while mounting app:",e),e})}export{Le as $,Ie as A,Pn as B,Lu as C,$u as D,mn as E,ce as F,Fo as G,ve as H,pu as I,SN as J,Wt as K,hC as L,wMe as M,xn as N,yI as O,bMe as P,pMe as Q,wTe as R,Q3 as S,xw as T,gn as U,pl as V,Ot as W,Ru as X,cn as Y,kt as Z,sTe as _,wI as a,t6 as a0,Qa as a1,or as a2,bTe as a3,qM as a4,xM as a5,D3e as a6,zr as a7,pge as a8,R5e as a9,co as aA,LN as aB,BT as aC,Mw as aD,VL as aE,z5e as aa,b_e as ab,g_e as ac,C_e as ad,r_e as ae,A_e as af,$3e as ag,vTe as ah,Sw as ai,un as aj,AM as ak,go as al,yH as am,mg as an,Ro as ao,GM as ap,L1 as aq,ps as ar,dTe as as,lf as at,uTe as au,kI as av,tTe as aw,hMe as ax,N1 as ay,yo as az,Cs as b,vt as c,Ye as d,CD as e,_ as f,m as g,Z as h,qe as i,b as j,k,_I as l,Oe as m,xe as n,Zt as o,nt as p,L as q,pe as r,Ne as s,U as t,hi as u,J3 as v,n5 as w,H as x,fa as y,Uo as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.