@xplor-education/react-wrappers 3.2.10 → 3.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{components.cjs → index.cjs} +86 -82
- package/dist/index.d.ts +187 -0
- package/dist/{components.js → index.js} +1953 -1920
- package/package.json +10 -8
- package/dist/components.d.ts +0 -463
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react");/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2018 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const Ep=new Set(["children","localName","ref","style","className"]),ga=new WeakMap,ua=(t,n,e,r,o)=>{const i=o==null?void 0:o[n];i===void 0?(t[n]=e,e==null&&n in HTMLElement.prototype&&t.removeAttribute(n)):e!==r&&((a,s,l)=>{let c=ga.get(a);c===void 0&&ga.set(a,c=new Map);let d=c.get(s);l!==void 0?d===void 0?(c.set(s,d={handleEvent:l}),a.addEventListener(s,d)):d.handleEvent=l:d!==void 0&&(c.delete(s),a.removeEventListener(s,d))})(t,i,e)},Ip=({react:t,tagName:n,elementClass:e,events:r,displayName:o})=>{const i=new Set(Object.keys(r??{})),a=t.forwardRef((s,l)=>{const c=t.useRef(new Map),d=t.useRef(null),h={},g={};for(const[u,f]of Object.entries(s))Ep.has(u)?h[u==="className"?"class":u]=f:i.has(u)||u in e.prototype?g[u]=f:h[u]=f;return t.useLayoutEffect(()=>{if(d.current===null)return;const u=new Map;for(const f in g)ua(d.current,f,s[f],c.current.get(f),r),c.current.delete(f),u.set(f,s[f]);for(const[f,m]of c.current)ua(d.current,f,void 0,m,r);c.current=u}),t.useLayoutEffect(()=>{var u;(u=d.current)==null||u.removeAttribute("defer-hydration")},[]),h.suppressHydrationWarning=!0,t.createElement(n,{...h,ref:t.useCallback(u=>{d.current=u,typeof l=="function"?l(u):l!==null&&(l.current=u)},[l])})});return a.displayName=o??e.name,a},$=({defineCustomElement:t,...n})=>(typeof t<"u"&&t(),Ip(n)),$p="xplor-component-library",Ot={hydratedSelectorName:"hydrated",lazyLoad:!1,slotRelocation:!0,updatable:!0};var Tp=Object.defineProperty,Mp=(t,n)=>{for(var e in n)Tp(t,e,{get:n[e],enumerable:!0})},Dp="http://www.w3.org/2000/svg",zp="http://www.w3.org/1999/xhtml",ol=(t=>(t.Undefined="undefined",t.Null="null",t.String="string",t.Number="number",t.SpecialNumber="number",t.Boolean="boolean",t.BigInt="bigint",t))(ol||{}),il=(t=>(t.Array="array",t.Date="date",t.Map="map",t.Object="object",t.RegularExpression="regexp",t.Set="set",t.Channel="channel",t.Symbol="symbol",t))(il||{}),fo="type",mo="value",Wo="serialized:",Ce=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},Op=(t,n)=>{const e={$flags$:0,$hostElement$:t,$cmpMeta$:n,$instanceValues$:new Map};e.$onReadyPromise$=new Promise(o=>e.$onReadyResolve$=o),t["s-p"]=[],t["s-rc"]=[];const r=e;return t.__stencil__getHostRef=()=>r,r},fa=(t,n)=>n in t,At=(t,n)=>(0,console.error)(t,n),or=new Map,Ap="r",Lp="o",Pp="s",Rp="t",Bp="c",bt="s-id",Uo="sty-id",ma="c-id",Np="slot-fb{display:contents}slot-fb[hidden]{display:none}",xa="http://www.w3.org/1999/xlink",W=typeof window<"u"?window:{},T=W.HTMLElement||class{},U={$flags$:0,$resourcesUrl$:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,n,e,r)=>t.addEventListener(n,e,r),rel:(t,n,e,r)=>t.removeEventListener(n,e,r),ce:(t,n)=>new CustomEvent(t,n)},Fp=(()=>{var t;let n=!1;try{(t=W.document)==null||t.addEventListener("e",null,Object.defineProperty({},"passive",{get(){n=!0}}))}catch{}return n})(),Hp=t=>Promise.resolve(t),$i=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),qo=!1,ba=[],al=[],jp=(t,n)=>e=>{t.push(e),qo||(qo=!0,U.$flags$&4?Yr(Ko):U.raf(Ko))},ya=t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(e){At(e)}t.length=0},Ko=()=>{ya(ba),ya(al),(qo=ba.length>0)&&U.raf(Ko)},Yr=t=>Hp().then(t),Xp=jp(al),Vp=t=>t!=null&&t!==void 0,Ti=t=>(t=typeof t,t==="object"||t==="function");function Wp(t){var n,e,r;return(r=(e=(n=t.head)==null?void 0:n.querySelector('meta[name="csp-nonce"]'))==null?void 0:e.getAttribute("content"))!=null?r:void 0}var Up=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),qp=class he{static fromLocalValue(n){const e=n[fo],r=mo in n?n[mo]:void 0;switch(e){case"string":return r;case"boolean":return r;case"bigint":return BigInt(r);case"undefined":return;case"null":return null;case"number":return r==="NaN"?NaN:r==="-0"?-0:r==="Infinity"?1/0:r==="-Infinity"?-1/0:r;case"array":return r.map(c=>he.fromLocalValue(c));case"date":return new Date(r);case"map":const o=new Map;for(const[c,d]of r){const h=typeof c=="object"&&c!==null?he.fromLocalValue(c):c,g=he.fromLocalValue(d);o.set(h,g)}return o;case"object":const i={};for(const[c,d]of r)i[c]=he.fromLocalValue(d);return i;case"regexp":const{pattern:a,flags:s}=r;return new RegExp(a,s);case"set":const l=new Set;for(const c of r)l.add(he.fromLocalValue(c));return l;case"symbol":return Symbol(r);default:throw new Error(`Unsupported type: ${e}`)}}static fromLocalValueArray(n){return n.map(e=>he.fromLocalValue(e))}static isLocalValueObject(n){if(typeof n!="object"||n===null||!n.hasOwnProperty(fo))return!1;const e=n[fo];return Object.values({...ol,...il}).includes(e)?e!=="null"&&e!=="undefined"?n.hasOwnProperty(mo):!0:!1}},Kp={};Mp(Kp,{err:()=>sl,map:()=>Jp,ok:()=>Jo,unwrap:()=>Gp,unwrapErr:()=>Yp});var Jo=t=>({isOk:!0,isErr:!1,value:t}),sl=t=>({isOk:!1,isErr:!0,value:t});function Jp(t,n){if(t.isOk){const e=n(t.value);return e instanceof Promise?e.then(r=>Jo(r)):Jo(e)}if(t.isErr){const e=t.value;return sl(e)}throw"should never get here"}var Gp=t=>{if(t.isOk)return t.value;throw t.value},Yp=t=>{if(t.isErr)return t.value;throw t.value};function Qp(t){return typeof t!="string"||!t.startsWith(Wo)?t:qp.fromLocalValue(JSON.parse(atob(t.slice(Wo.length))))}function Zp(t){const n=this.attachShadow({mode:"open"});if($i){const e=new CSSStyleSheet;e.replaceSync(Dh),n.adoptedStyleSheets.push(e)}}var ll=t=>{const n=ir(t,"childNodes");t.tagName&&t.tagName.includes("-")&&t["s-cr"]&&t.tagName!=="SLOT-FB"&&cl(n,t.tagName).forEach(r=>{r.nodeType===1&&r.tagName==="SLOT-FB"&&(eh(r,Mi(r),!1).length?r.hidden=!0:r.hidden=!1)});let e=0;for(e=0;e<n.length;e++){const r=n[e];r.nodeType===1&&ir(r,"childNodes").length&&ll(r)}},nh=t=>{const n=[];for(let e=0;e<t.length;e++){const r=t[e]["s-nr"]||void 0;r&&r.isConnected&&n.push(r)}return n};function cl(t,n,e){let r=0,o=[],i;for(;r<t.length;r++)i=t[r],i["s-sr"]&&(!n||i["s-hn"]===n)&&e===void 0&&o.push(i),o=[...o,...cl(i.childNodes,n,e)];return o}var eh=(t,n,e=!0)=>{const r=[];(e&&t["s-sr"]||!t["s-sr"])&&r.push(t);let o=t;for(;o=o.nextSibling;)Mi(o)===n&&(e||!o["s-sr"])&&r.push(o);return r},va=(t,n)=>t.nodeType===1?t.getAttribute("slot")===null&&n===""||t.getAttribute("slot")===n:t["s-sn"]===n?!0:n==="",th=(t,n,e,r)=>{if(t["s-ol"]&&t["s-ol"].isConnected)return;const o=document.createTextNode("");if(o["s-nr"]=t,!n["s-cr"]||!n["s-cr"].parentNode)return;const i=n["s-cr"].parentNode,a=ir(i,"appendChild");if(typeof r<"u"){o["s-oo"]=r;const s=ir(i,"childNodes"),l=[o];s.forEach(c=>{c["s-nr"]&&l.push(c)}),l.sort((c,d)=>!c["s-oo"]||c["s-oo"]<(d["s-oo"]||0)?-1:!d["s-oo"]||d["s-oo"]<c["s-oo"]?1:0),l.forEach(c=>a.call(i,c))}else a.call(i,o);t["s-ol"]=o,t["s-sh"]=n["s-hn"]},Mi=t=>typeof t["s-sn"]=="string"?t["s-sn"]:t.nodeType===1&&t.getAttribute("slot")||void 0;function dl(t){if(t.assignedElements||t.assignedNodes||!t["s-sr"])return;const n=e=>(function(r){const o=[],i=this["s-sn"];r!=null&&r.flatten&&console.error(`
|
|
2
6
|
Flattening is not supported for Stencil non-shadow slots.
|
|
3
7
|
You can use \`.childNodes\` to nested slot fallback content.
|
|
4
8
|
If you have a particular use case, please open an issue on the Stencil repo.
|
|
5
|
-
`);const a=this["s-cr"].parentElement;return(a.__childNodes?a.childNodes:Gp(a.childNodes)).forEach(l=>{i===Mi(l)&&o.push(l)}),e?o.filter(l=>l.nodeType===1):o}).bind(t);t.assignedElements=n(!0),t.assignedNodes=n(!1)}function ir(t,n){if("__"+n in t){const e=t["__"+n];return typeof e!="function"?e:e.bind(t)}else return typeof t[n]!="function"?t[n]:t[n].bind(t)}var ae=(t,n="")=>()=>{},p=(t,n,...e)=>{let r=null,o=null,i=null,a=!1,s=!1;const l=[],c=h=>{for(let g=0;g<h.length;g++)r=h[g],Array.isArray(r)?c(r):r!=null&&typeof r!="boolean"&&((a=typeof t!="function"&&!$i(r))&&(r=String(r)),a&&s?l[l.length-1].$text$+=r:l.push(a?Ue(null,r):r),s=a)};if(c(e),n){n.key&&(o=n.key),n.name&&(i=n.name);{const h=n.className||n.class;h&&(n.class=typeof h!="object"?h:Object.keys(h).filter(g=>h[g]).join(" "))}}if(typeof t=="function")return t(n===null?{}:n,l,nh);const d=Ue(t,null);return d.$attrs$=n,l.length>0&&(d.$children$=l),d.$key$=o,d.$name$=i,d},Ue=(t,n)=>{const e={$flags$:0,$tag$:t,$text$:n,$elm$:null,$children$:null};return e.$attrs$=null,e.$key$=null,e.$name$=null,e},E={},Zp=t=>t&&t.$tag$===E,nh={forEach:(t,n)=>t.map(ya).forEach(n),map:(t,n)=>t.map(ya).map(n).map(eh)},ya=t=>({vattrs:t.$attrs$,vchildren:t.$children$,vkey:t.$key$,vname:t.$name$,vtag:t.$tag$,vtext:t.$text$}),eh=t=>{if(typeof t.vtag=="function"){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),p(t.vtag,e,...t.vchildren||[])}const n=Ue(t.vtag,t.vtext);return n.$attrs$=t.vattrs,n.$children$=t.vchildren,n.$key$=t.vkey,n.$name$=t.vname,n},th=(t,n,e,r)=>{var o;const i=ae("hydrateClient",n),a=t.shadowRoot,s=[],l=[],c=[],d=a?[]:null,h=Ue(n,null);h.$elm$=t,Object.entries(((o=r.$cmpMeta$)==null?void 0:o.$members$)||{}).forEach(([D,[F,V]])=>{var de;if(!(F&31))return;const Ze=V||D,nt=t.getAttribute(Ze);if(nt!==null){const et=Di(nt,F);(de=r==null?void 0:r.$instanceValues$)==null||de.set(D,et)}});let u;{const D=r.$cmpMeta$;D&&D.$flags$&10&&t["s-sc"]?(u=t["s-sc"],t.classList.add(u+"-h")):t["s-sc"]&&delete t["s-sc"]}W.document&&(!U.$orgLocNodes$||!U.$orgLocNodes$.size)&&Yo(W.document.body,U.$orgLocNodes$=new Map),t[bt]=e,t.removeAttribute(bt),r.$vnode$=Go(h,s,l,d,t,t,e,c);let f=0;const m=s.length;let x;for(f;f<m;f++){x=s[f];const D=x.$hostId$+"."+x.$nodeId$,F=U.$orgLocNodes$.get(D),V=x.$elm$;a||(V["s-hn"]=n.toUpperCase(),x.$tag$==="slot"&&(V["s-cr"]=t["s-cr"])),x.$tag$==="slot"&&(x.$name$=x.$elm$["s-sn"]||x.$elm$.name||null,x.$children$?(x.$flags$|=2,x.$elm$.childNodes.length||x.$children$.forEach(de=>{x.$elm$.appendChild(de.$elm$)})):x.$flags$|=1),F&&F.isConnected&&(a&&F["s-en"]===""&&F.parentNode.insertBefore(V,F.nextSibling),F.parentNode.removeChild(F),a||(V["s-oo"]=parseInt(x.$nodeId$))),U.$orgLocNodes$.delete(D)}const b=[],_=c.length;let z=0,A,L,H,C;for(z;z<_;z++)if(A=c[z],!(!A||!A.length))for(H=A.length,L=0,L;L<H;L++){if(C=A[L],b[C.hostId]||(b[C.hostId]=U.$orgLocNodes$.get(C.hostId)),!b[C.hostId])continue;const D=b[C.hostId];(!D.shadowRoot||!a)&&(C.slot["s-cr"]=D["s-cr"],!C.slot["s-cr"]&&D.shadowRoot?C.slot["s-cr"]=D:C.slot["s-cr"]=(D.__childNodes||D.childNodes)[0],Qp(C.node,C.slot,!1,C.node["s-oo"])),D.shadowRoot&&C.node.parentElement!==D&&D.appendChild(C.node)}if(u&&l.length&&l.forEach(D=>{D.$elm$.parentElement.classList.add(u+"-s")}),a&&!a.childNodes.length){let D=0;const F=d.length;if(F){for(D;D<F;D++)a.appendChild(d[D]);Array.from(t.childNodes).forEach(V=>{typeof V["s-en"]!="string"&&typeof V["s-sn"]!="string"&&(V.nodeType===1&&V.slot&&V.hidden?V.removeAttribute("hidden"):(V.nodeType===8||V.nodeType===3&&!V.wholeText.trim())&&V.parentNode.removeChild(V))})}}U.$orgLocNodes$.delete(t["s-id"]),r.$hostElement$=t,i()},Go=(t,n,e,r,o,i,a,s=[])=>{let l,c,d,h;const g=o["s-sc"];if(i.nodeType===1){if(l=i.getAttribute(ua),l&&(c=l.split("."),c[0]===a||c[0]==="0")){d=va({$flags$:0,$hostId$:c[0],$nodeId$:c[1],$depth$:c[2],$index$:c[3],$tag$:i.tagName.toLowerCase(),$elm$:i,$attrs$:{class:i.className||""}}),n.push(d),i.removeAttribute(ua),t.$children$||(t.$children$=[]),g&&(i["s-si"]=g,d.$attrs$.class+=" "+g);const f=d.$elm$.getAttribute("s-sn");typeof f=="string"&&(d.$tag$==="slot-fb"&&(ka(f,c[2],d,i,t,n,e,r,s),g&&i.classList.add(g)),d.$elm$["s-sn"]=f,d.$elm$.removeAttribute("s-sn")),d.$index$!==void 0&&(t.$children$[d.$index$]=d),t=d,r&&d.$depth$==="0"&&(r[d.$index$]=d.$elm$)}if(i.shadowRoot)for(h=i.shadowRoot.childNodes.length-1;h>=0;h--)Go(t,n,e,r,o,i.shadowRoot.childNodes[h],a,s);const u=i.__childNodes||i.childNodes;for(h=u.length-1;h>=0;h--)Go(t,n,e,r,o,u[h],a,s)}else if(i.nodeType===8){if(c=i.nodeValue.split("."),c[1]===a||c[1]==="0"){if(l=c[0],d=va({$hostId$:c[1],$nodeId$:c[2],$depth$:c[3],$index$:c[4]||"0",$elm$:i,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null}),l===Op)d.$elm$=_a(i,3),d.$elm$&&d.$elm$.nodeType===3&&(d.$text$=d.$elm$.textContent,n.push(d),i.remove(),a===d.$hostId$&&(t.$children$||(t.$children$=[]),t.$children$[d.$index$]=d),r&&d.$depth$==="0"&&(r[d.$index$]=d.$elm$));else if(l===Ap)d.$elm$=_a(i,8),d.$elm$&&d.$elm$.nodeType===8&&(n.push(d),i.remove());else if(d.$hostId$===a)if(l===Dp){const u=i["s-sn"]=c[5]||"";ka(u,c[2],d,i,t,n,e,r,s)}else l===Mp&&(r?i.remove():(o["s-cr"]=i,i["s-cn"]=!0))}}else if(t&&t.$tag$==="style"){const u=Ue(null,i.textContent);u.$elm$=i,u.$index$="0",t.$children$=[u]}else i.nodeType===3&&!i.wholeText.trim()&&i.remove();return t},Yo=(t,n)=>{if(t.nodeType===1){const e=t[bt]||t.getAttribute(bt);e&&n.set(e,t);let r=0;if(t.shadowRoot)for(;r<t.shadowRoot.childNodes.length;r++)Yo(t.shadowRoot.childNodes[r],n);const o=t.__childNodes||t.childNodes;for(r=0;r<o.length;r++)Yo(o[r],n)}else if(t.nodeType===8){const e=t.nodeValue.split(".");e[0]===zp&&(n.set(e[1]+"."+e[2],t),t.nodeValue="",t["s-en"]=e[3])}},va=t=>({...{$flags$:0,$hostId$:null,$nodeId$:null,$depth$:null,$index$:"0",$elm$:null,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null},...t});function ka(t,n,e,r,o,i,a,s,l){r["s-sr"]=!0,e.$name$=t||null,e.$tag$="slot";const c=o!=null&&o.$elm$?o.$elm$["s-id"]||o.$elm$.getAttribute("s-id"):"";if(s&&W.document){const d=e.$elm$=W.document.createElement(e.$tag$);e.$name$&&e.$elm$.setAttribute("name",t),c&&c!==e.$hostId$?o.$elm$.insertBefore(d,o.$elm$.children[0]):r.parentNode.insertBefore(d,r),wa(l,n,t,r,e.$hostId$),r.remove(),e.$depth$==="0"&&(s[e.$index$]=e.$elm$)}else{const d=e.$elm$,h=c&&c!==e.$hostId$&&o.$elm$.shadowRoot;wa(l,n,t,r,h?c:e.$hostId$),ll(r),h&&o.$elm$.insertBefore(d,o.$elm$.children[0])}i.push(e),a.push(e),o.$children$||(o.$children$=[]),o.$children$[e.$index$]=e}var wa=(t,n,e,r,o)=>{let i=r.nextSibling;for(t[n]=t[n]||[];i&&((i.getAttribute&&i.getAttribute("slot")||i["s-sn"])===e||e===""&&!i["s-sn"]&&(i.nodeType===8&&i.nodeValue.indexOf(".")!==1||i.nodeType===3));)i["s-sn"]=e,t[n].push({slot:r,node:i,hostId:o}),i=i.nextSibling},_a=(t,n)=>{let e=t;do e=e.nextSibling;while(e&&(e.nodeType!==n||!e.nodeValue));return e},zi=t=>{const n=jp(t);return new RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${n}))(${n}\\b)`,"g")};zi("::slotted");zi(":host");zi(":host-context");var Di=(t,n,e)=>{if(typeof t=="string"&&(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]")))try{return t=JSON.parse(t),t}catch{}return typeof t=="string"&&t.startsWith(Wo)?(t=Kp(t),t):t!=null&&!$i(t)?n&4?t==="false"?!1:t===""||!!t:n&2?typeof t=="string"?parseFloat(t):typeof t=="number"?t:NaN:n&1?String(t):t:t},rh=t=>t,k=(t,n,e)=>{const r=rh(t);return{emit:o=>cl(r,n,{bubbles:!0,composed:!0,cancelable:!0,detail:o})}},cl=(t,n,e)=>{const r=U.ce(n,e);return t.dispatchEvent(r),r},Ne=new WeakMap,dl=(t,n,e)=>{let r=or.get(t);Ti&&e?(r=r||new CSSStyleSheet,typeof r=="string"?r=n:r.replaceSync(n)):r=n,or.set(t,r)},pl=(t,n,e)=>{var r;const o=Oi(n),i=or.get(o);if(!W.document)return o;if(t=t.nodeType===11?t:W.document,i)if(typeof i=="string"){t=t.head||t;let a=Ne.get(t),s;if(a||Ne.set(t,a=new Set),!a.has(o)){if(t.host&&(s=t.querySelector(`[${Uo}="${o}"]`)))s.innerHTML=i;else{s=W.document.createElement("style"),s.innerHTML=i;const l=(r=U.$nonce$)!=null?r:Hp(W.document);if(l!=null&&s.setAttribute("nonce",l),!(n.$flags$&1))if(t.nodeName==="HEAD"){const c=t.querySelectorAll("link[rel=preconnect]"),d=c.length>0?c[c.length-1].nextSibling:t.querySelector("style");t.insertBefore(s,(d==null?void 0:d.parentNode)===t?d:null)}else if("host"in t)if(Ti){const c=new CSSStyleSheet;c.replaceSync(i),t.adoptedStyleSheets=[c,...t.adoptedStyleSheets]}else{const c=t.querySelector("style");c?c.innerHTML=i+c.innerHTML:t.prepend(s)}else t.append(s);n.$flags$&1&&t.insertBefore(s,null)}n.$flags$&4&&(s.innerHTML+=Lp),a&&a.add(o)}}else t.adoptedStyleSheets.includes(i)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,i]);return o},oh=t=>{const n=t.$cmpMeta$,e=t.$hostElement$,r=n.$flags$,o=ae("attachStyles",n.$tagName$),i=pl(e.shadowRoot?e.shadowRoot:e.getRootNode(),n);r&10&&(e["s-sc"]=i,e.classList.add(i+"-h")),o()},Oi=(t,n)=>"sc-"+t.$tagName$,ih=t=>t.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{"),ah=()=>{if(!W.document)return;const t=W.document.querySelectorAll(`[${Uo}]`);let n=0;for(;n<t.length;n++)dl(t[n].getAttribute(Uo),ih(t[n].innerHTML),!0)},Ca=(t,n,e,r,o,i,a)=>{if(e===r)return;let s=ga(t,n),l=n.toLowerCase();if(n==="class"){const c=t.classList,d=Sa(e);let h=Sa(r);t["s-si"]&&a?(h.push(t["s-si"]),d.forEach(g=>{g.startsWith(t["s-si"])&&h.push(g)}),h=[...new Set(h)],c.add(...h)):(c.remove(...d.filter(g=>g&&!h.includes(g))),c.add(...h.filter(g=>g&&!d.includes(g))))}else if(n==="style"){for(const c in e)(!r||r[c]==null)&&(c.includes("-")?t.style.removeProperty(c):t.style[c]="");for(const c in r)(!e||r[c]!==e[c])&&(c.includes("-")?t.style.setProperty(c,r[c]):t.style[c]=r[c])}else if(n!=="key")if(n==="ref")r&&r(t);else if(!t.__lookupSetter__(n)&&n[0]==="o"&&n[1]==="n"){if(n[2]==="-"?n=n.slice(3):ga(W,l)?n=l.slice(2):n=l[2]+n.slice(3),e||r){const c=n.endsWith(hl);n=n.replace(lh,""),e&&U.rel(t,n,e,c),r&&U.ael(t,n,r,c)}}else{const c=$i(r);if((s||c&&r!==null)&&!o)try{if(t.tagName.includes("-"))t[n]!==r&&(t[n]=r);else{const h=r??"";n==="list"?s=!1:(e==null||t[n]!=h)&&(typeof t.__lookupSetter__(n)=="function"?t[n]=h:t.setAttribute(n,h))}}catch{}let d=!1;l!==(l=l.replace(/^xlink\:?/,""))&&(n=l,d=!0),r==null||r===!1?(r!==!1||t.getAttribute(n)==="")&&(d?t.removeAttributeNS(fa,n):t.removeAttribute(n)):(!s||i&4||o)&&!c&&t.nodeType===1&&(r=r===!0?"":r,d?t.setAttributeNS(fa,n,r):t.setAttribute(n,r))}},sh=/\s/,Sa=t=>(typeof t=="object"&&t&&"baseVal"in t&&(t=t.baseVal),!t||typeof t!="string"?[]:t.split(sh)),hl="Capture",lh=new RegExp(hl+"$"),Qo=(t,n,e,r)=>{const o=n.$elm$.nodeType===11&&n.$elm$.host?n.$elm$.host:n.$elm$,i=t&&t.$attrs$||{},a=n.$attrs$||{};for(const s of Ea(Object.keys(i)))s in a||Ca(o,s,i[s],void 0,e,n.$flags$,r);for(const s of Ea(Object.keys(a)))Ca(o,s,i[s],a[s],e,n.$flags$,r)};function Ea(t){return t.includes("ref")?[...t.filter(n=>n!=="ref"),"ref"]:t}var Yt,ar,Qr,Zo=!1,sr=!1,Ai=!1,fn=!1,lr=(t,n,e)=>{var r;const o=n.$children$[e];let i=0,a,s,l;if(Zo||(Ai=!0,o.$tag$==="slot"&&(o.$flags$|=o.$children$?2:1)),o.$text$!==null)a=o.$elm$=W.document.createTextNode(o.$text$);else if(o.$flags$&1)a=o.$elm$=W.document.createTextNode(""),Qo(null,o,fn);else{if(fn||(fn=o.$tag$==="svg"),!W.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(a=o.$elm$=W.document.createElementNS(fn?Ip:Tp,!Zo&&Ot.slotRelocation&&o.$flags$&2?"slot-fb":o.$tag$),fn&&o.$tag$==="foreignObject"&&(fn=!1),Qo(null,o,fn),Fp(Yt)&&a["s-si"]!==Yt&&a.classList.add(a["s-si"]=Yt),o.$children$)for(i=0;i<o.$children$.length;++i)s=lr(t,o,i),s&&a.appendChild(s);o.$tag$==="svg"?fn=!1:a.tagName==="foreignObject"&&(fn=!0)}return a["s-hn"]=Qr,o.$flags$&3&&(a["s-sr"]=!0,a["s-cr"]=ar,a["s-sn"]=o.$name$||"",a["s-rf"]=(r=o.$attrs$)==null?void 0:r.ref,ll(a),l=t&&t.$children$&&t.$children$[e],l&&l.$tag$===o.$tag$&&t.$elm$&&yt(t.$elm$,!1),xl(ar,a,n.$elm$,t==null?void 0:t.$elm$)),a},yt=(t,n)=>{U.$flags$|=1;const e=Array.from(t.__childNodes||t.childNodes);for(let r=e.length-1;r>=0;r--){const o=e[r];o["s-hn"]!==Qr&&o["s-ol"]&&(ne(vt(o).parentNode,o,vt(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,Ai=!0),n&&yt(o,n)}U.$flags$&=-2},gl=(t,n,e,r,o,i)=>{let a=t["s-cr"]&&t["s-cr"].parentNode||t,s;for(a.shadowRoot&&a.tagName===Qr&&(a=a.shadowRoot);o<=i;++o)r[o]&&(s=lr(null,e,o),s&&(r[o].$elm$=s,ne(a,s,vt(n))))},ul=(t,n,e)=>{for(let r=n;r<=e;++r){const o=t[r];if(o){const i=o.$elm$;ml(o),i&&(sr=!0,i["s-ol"]?i["s-ol"].remove():yt(i,!0),i.remove())}}},ch=(t,n,e,r,o=!1)=>{let i=0,a=0,s=0,l=0,c=n.length-1,d=n[0],h=n[c],g=r.length-1,u=r[0],f=r[g],m,x;for(;i<=c&&a<=g;)if(d==null)d=n[++i];else if(h==null)h=n[--c];else if(u==null)u=r[++a];else if(f==null)f=r[--g];else if(Ft(d,u,o))Le(d,u,o),d=n[++i],u=r[++a];else if(Ft(h,f,o))Le(h,f,o),h=n[--c],f=r[--g];else if(Ft(d,f,o))(d.$tag$==="slot"||f.$tag$==="slot")&&yt(d.$elm$.parentNode,!1),Le(d,f,o),ne(t,d.$elm$,h.$elm$.nextSibling),d=n[++i],f=r[--g];else if(Ft(h,u,o))(d.$tag$==="slot"||f.$tag$==="slot")&&yt(h.$elm$.parentNode,!1),Le(h,u,o),ne(t,h.$elm$,d.$elm$),h=n[--c],u=r[++a];else{for(s=-1,l=i;l<=c;++l)if(n[l]&&n[l].$key$!==null&&n[l].$key$===u.$key$){s=l;break}s>=0?(x=n[s],x.$tag$!==u.$tag$?m=lr(n&&n[a],e,s):(Le(x,u,o),n[s]=void 0,m=x.$elm$),u=r[++a]):(m=lr(n&&n[a],e,a),u=r[++a]),m&&ne(vt(d.$elm$).parentNode,m,vt(d.$elm$))}i>c?gl(t,r[g+1]==null?null:r[g+1].$elm$,e,r,a,g):a>g&&ul(n,i,c)},Ft=(t,n,e=!1)=>t.$tag$===n.$tag$?t.$tag$==="slot"?t.$name$===n.$name$:e?(e&&!t.$key$&&n.$key$&&(t.$key$=n.$key$),!0):t.$key$===n.$key$:!1,vt=t=>t&&t["s-ol"]||t,Le=(t,n,e=!1)=>{const r=n.$elm$=t.$elm$,o=t.$children$,i=n.$children$,a=n.$tag$,s=n.$text$;let l;s===null?(fn=a==="svg"?!0:a==="foreignObject"?!1:fn,Qo(t,n,fn,e),o!==null&&i!==null?ch(r,o,n,i,e):i!==null?(t.$text$!==null&&(r.textContent=""),gl(r,null,n,i,0,i.length-1)):!e&&Ot.updatable&&o!==null&&ul(o,0,o.length-1),fn&&a==="svg"&&(fn=!1)):(l=r["s-cr"])?l.parentNode.textContent=s:t.$text$!==s&&(r.data=s)},Hn=[],fl=t=>{let n,e,r;const o=t.__childNodes||t.childNodes;for(const i of o){if(i["s-sr"]&&(n=i["s-cr"])&&n.parentNode){e=n.parentNode.__childNodes||n.parentNode.childNodes;const a=i["s-sn"];for(r=e.length-1;r>=0;r--)if(n=e[r],!n["s-cn"]&&!n["s-nr"]&&n["s-hn"]!==i["s-hn"])if(ba(n,a)){let s=Hn.find(l=>l.$nodeToRelocate$===n);sr=!0,n["s-sn"]=n["s-sn"]||a,s?(s.$nodeToRelocate$["s-sh"]=i["s-hn"],s.$slotRefNode$=i):(n["s-sh"]=i["s-hn"],Hn.push({$slotRefNode$:i,$nodeToRelocate$:n})),n["s-sr"]&&Hn.map(l=>{ba(l.$nodeToRelocate$,n["s-sn"])&&(s=Hn.find(c=>c.$nodeToRelocate$===n),s&&!l.$slotRefNode$&&(l.$slotRefNode$=s.$slotRefNode$))})}else Hn.some(s=>s.$nodeToRelocate$===n)||Hn.push({$nodeToRelocate$:n})}i.nodeType===1&&fl(i)}},ml=t=>{t.$attrs$&&t.$attrs$.ref&&t.$attrs$.ref(null),t.$children$&&t.$children$.map(ml)},ne=(t,n,e)=>(typeof n["s-sn"]=="string"&&n["s-sr"]&&n["s-cr"]&&xl(n["s-cr"],n,t,n.parentElement),t==null?void 0:t.insertBefore(n,e));function xl(t,n,e,r){var o,i;let a;if(t&&typeof n["s-sn"]=="string"&&n["s-sr"]&&t.parentNode&&t.parentNode["s-sc"]&&(a=n["s-si"]||t.parentNode["s-sc"])){const s=n["s-sn"],l=n["s-hn"];if((o=e.classList)==null||o.add(a+"-s"),r&&((i=r.classList)!=null&&i.contains(a+"-s"))){let c=(r.__childNodes||r.childNodes)[0],d=!1;for(;c;){if(c["s-sn"]!==s&&c["s-hn"]===l&&c["s-sr"]){d=!0;break}c=c.nextSibling}d||r.classList.remove(a+"-s")}}}var dh=(t,n,e=!1)=>{var r,o,i,a;const s=t.$hostElement$,l=t.$cmpMeta$,c=t.$vnode$||Ue(null,null),h=Zp(n)?n:p(null,null,n);if(Qr=s.tagName,l.$attrsToReflect$&&(h.$attrs$=h.$attrs$||{},l.$attrsToReflect$.map(([g,u])=>h.$attrs$[u]=s[g])),e&&h.$attrs$)for(const g of Object.keys(h.$attrs$))s.hasAttribute(g)&&!["key","ref","style","class"].includes(g)&&(h.$attrs$[g]=s[g]);h.$tag$=null,h.$flags$|=4,t.$vnode$=h,h.$elm$=c.$elm$=s.shadowRoot||s,Yt=s["s-sc"],Zo=!!(l.$flags$&1)&&!(l.$flags$&128),ar=s["s-cr"],sr=!1,Le(c,h,e);{if(U.$flags$|=1,Ai){fl(h.$elm$);for(const g of Hn){const u=g.$nodeToRelocate$;if(!u["s-ol"]&&W.document){const f=W.document.createTextNode("");f["s-nr"]=u,ne(u.parentNode,u["s-ol"]=f,u)}}for(const g of Hn){const u=g.$nodeToRelocate$,f=g.$slotRefNode$;if(f){const m=f.parentNode;let x=f.nextSibling;{let z=(r=u["s-ol"])==null?void 0:r.previousSibling;for(;z;){let A=(o=z["s-nr"])!=null?o:null;if(A&&A["s-sn"]===u["s-sn"]&&m===(A.__parentNode||A.parentNode)){for(A=A.nextSibling;A===u||A!=null&&A["s-sr"];)A=A==null?void 0:A.nextSibling;if(!A||!A["s-nr"]){x=A;break}}z=z.previousSibling}}const b=u.__parentNode||u.parentNode,_=u.__nextSibling||u.nextSibling;(!x&&m!==b||_!==x)&&u!==x&&(!u["s-hn"]&&u["s-ol"]&&(u["s-hn"]=u["s-ol"].parentNode.nodeName),ne(m,u,x),u.nodeType===1&&u.tagName!=="SLOT-FB"&&(u.hidden=(i=u["s-ih"])!=null?i:!1)),u&&typeof f["s-rf"]=="function"&&f["s-rf"](f)}else u.nodeType===1&&(e&&(u["s-ih"]=(a=u.hidden)!=null?a:!1),u.hidden=!0)}}sr&&al(h.$elm$),U.$flags$&=-2,Hn.length=0}ar=void 0},bl=(t,n)=>{if(n&&!t.$onRenderResolve$&&n["s-p"]){const e=n["s-p"].push(new Promise(r=>t.$onRenderResolve$=()=>{n["s-p"].splice(e-1,1),r()}))}},Li=(t,n)=>{if(t.$flags$|=16,t.$flags$&4){t.$flags$|=512;return}return bl(t,t.$ancestorComponent$),Np(()=>ph(t,n))},ph=(t,n)=>{const e=t.$hostElement$,r=ae("scheduleUpdate",t.$cmpMeta$.$tagName$),o=e;if(!o)throw new Error(`Can't render component <${e.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let i;return n?i=je(o,"componentWillLoad",void 0,e):i=je(o,"componentWillUpdate",void 0,e),i=Ia(i,()=>je(o,"componentWillRender",void 0,e)),r(),Ia(i,()=>gh(t,o,n))},Ia=(t,n)=>hh(t)?t.then(n).catch(e=>{console.error(e),n()}):n(),hh=t=>t instanceof Promise||t&&t.then&&typeof t.then=="function",gh=async(t,n,e)=>{var r;const o=t.$hostElement$,i=ae("update",t.$cmpMeta$.$tagName$),a=o["s-rc"];e&&oh(t);const s=ae("render",t.$cmpMeta$.$tagName$);uh(t,n,o,e),a&&(a.map(l=>l()),o["s-rc"]=void 0),s(),i();{const l=(r=o["s-p"])!=null?r:[],c=()=>fh(t);l.length===0?c():(Promise.all(l).then(c),t.$flags$|=4,l.length=0)}},uh=(t,n,e,r)=>{try{n=n.render(),t.$flags$&=-17,t.$flags$|=2,dh(t,n,r)}catch(o){At(o,t.$hostElement$)}return null},fh=t=>{const n=t.$cmpMeta$.$tagName$,e=t.$hostElement$,r=ae("postUpdate",n),o=e,i=t.$ancestorComponent$;je(o,"componentDidRender",void 0,e),t.$flags$&64?(je(o,"componentDidUpdate",void 0,e),r()):(t.$flags$|=64,xh(e),je(o,"componentDidLoad",void 0,e),r(),t.$onReadyResolve$(e),i||mh()),t.$onRenderResolve$&&(t.$onRenderResolve$(),t.$onRenderResolve$=void 0),t.$flags$&512&&Yr(()=>Li(t,!1)),t.$flags$&=-517},mh=t=>{Yr(()=>cl(W,"appload",{detail:{namespace:Cp}}))},je=(t,n,e,r)=>{if(t&&t[n])try{return t[n](e)}catch(o){At(o,r)}},xh=t=>{var n;return t.setAttribute((n=Ot.hydratedSelectorName)!=null?n:"hydrated","")},bh=(t,n)=>Ce(t).$instanceValues$.get(n),Ta=(t,n,e,r)=>{const o=Ce(t),i=t,a=o.$instanceValues$.get(n),s=o.$flags$,l=i;e=Di(e,r.$members$[n][0]);const c=Number.isNaN(a)&&Number.isNaN(e);if(e!==a&&!c){o.$instanceValues$.set(n,e);{if(r.$watchers$&&s&128){const h=r.$watchers$[n];h&&h.map(g=>{try{l[g](e,a,n)}catch(u){At(u,i)}})}if((s&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(e,a,n)===!1)return;Li(o,!1)}}}},yh=(t,n,e)=>{var r,o;const i=t.prototype;if(n.$members$||n.$watchers$||t.watchers){t.watchers&&!n.$watchers$&&(n.$watchers$=t.watchers);const a=Object.entries((r=n.$members$)!=null?r:{});a.map(([s,[l]])=>{if(l&31||l&32){const{get:c,set:d}=Object.getOwnPropertyDescriptor(i,s)||{};c&&(n.$members$[s][0]|=2048),d&&(n.$members$[s][0]|=4096),Object.defineProperty(i,s,{get(){return c?c.apply(this):bh(this,s)},configurable:!0,enumerable:!0}),Object.defineProperty(i,s,{set(h){const g=Ce(this);if(d){const u=l&32?this[s]:g.$hostElement$[s];typeof u>"u"&&g.$instanceValues$.get(s)?h=g.$instanceValues$.get(s):!g.$instanceValues$.get(s)&&u&&g.$instanceValues$.set(s,u),d.apply(this,[Di(h,l)]),h=l&32?this[s]:g.$hostElement$[s],Ta(this,s,h,n);return}{Ta(this,s,h,n);return}}})}});{const s=new Map;i.attributeChangedCallback=function(l,c,d){U.jmp(()=>{var h;const g=s.get(l);if(!(this.hasOwnProperty(g)&&Ot.lazyLoad)){if(i.hasOwnProperty(g)&&typeof this[g]=="number"&&this[g]==d)return;if(g==null){const f=Ce(this),m=f==null?void 0:f.$flags$;if(m&&!(m&8)&&m&128&&d!==c){const b=this,_=(h=n.$watchers$)==null?void 0:h[l];_==null||_.forEach(z=>{b[z]!=null&&b[z].call(b,d,c,l)})}return}}const u=Object.getOwnPropertyDescriptor(i,g);d=d===null&&typeof this[g]=="boolean"?!1:d,d!==this[g]&&(!u.get||u.set)&&(this[g]=d)})},t.observedAttributes=Array.from(new Set([...Object.keys((o=n.$watchers$)!=null?o:{}),...a.filter(([l,c])=>c[0]&15).map(([l,c])=>{var d;const h=c[1]||l;return s.set(h,l),c[0]&512&&((d=n.$attrsToReflect$)==null||d.push([l,h])),h})]))}}return t},$a=async(t,n,e,r)=>{let o;if(!(n.$flags$&32)){n.$flags$|=32;{o=t.constructor;const s=t.localName;customElements.whenDefined(s).then(()=>n.$flags$|=128)}if(o&&o.style){let s;typeof o.style=="string"&&(s=o.style);const l=Oi(e);if(!or.has(l)){const c=ae("registerStyles",e.$tagName$);dl(l,s,!!(e.$flags$&1)),c()}}}const i=n.$ancestorComponent$,a=()=>Li(n,!0);i&&i["s-rc"]?i["s-rc"].push(a):a()},vh=(t,n)=>{},kh=t=>{if(!(U.$flags$&1)){const n=Ce(t),e=n.$cmpMeta$,r=ae("connectedCallback",e.$tagName$);if(n.$flags$&1)yl(t,n,e.$listeners$),n!=null&&n.$lazyInstance$||n!=null&&n.$onReadyPromise$&&n.$onReadyPromise$.then(()=>vh());else{n.$flags$|=1;let o;if(o=t.getAttribute(bt),o){if(e.$flags$&1){const i=pl(t.shadowRoot,e);t.classList.remove(i+"-h",i+"-s")}else if(e.$flags$&2){const i=Oi(e);t["s-sc"]=i}th(t,e.$tagName$,o,n)}o||e.$flags$&12&&wh(t);{let i=t;for(;i=i.parentNode||i.host;)if(i.nodeType===1&&i.hasAttribute("s-id")&&i["s-p"]||i["s-p"]){bl(n,n.$ancestorComponent$=i);break}}e.$members$&&Object.entries(e.$members$).map(([i,[a]])=>{if(a&31&&t.hasOwnProperty(i)){const s=t[i];delete t[i],t[i]=s}}),Ot.initializeNextTick?Yr(()=>$a(t,n,e)):$a(t,n,e)}r()}},wh=t=>{if(!W.document)return;const n=t["s-cr"]=W.document.createComment("");n["s-cn"]=!0,ne(t,n,t.firstChild)},_h=async t=>{if(!(U.$flags$&1)){const n=Ce(t);n.$rmListeners$&&(n.$rmListeners$.map(e=>e()),n.$rmListeners$=void 0)}Ne.has(t)&&Ne.delete(t),t.shadowRoot&&Ne.has(t.shadowRoot)&&Ne.delete(t.shadowRoot)},M=(t,n)=>{const e={$flags$:n[0],$tagName$:n[1]};e.$members$=n[2],e.$listeners$=n[3],e.$watchers$=t.$watchers$,e.$attrsToReflect$=[],ah();const r=t.prototype.connectedCallback,o=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){$p(this,e)},connectedCallback(){if(!this.__hasHostListenerAttached){const i=Ce(this);yl(this,i,e.$listeners$),this.__hasHostListenerAttached=!0}kh(this),r&&r.call(this)},disconnectedCallback(){_h(this),o&&o.call(this)},__attachShadow(){if(!this.shadowRoot)Jp.call(this,e);else if(this.shadowRoot.mode!=="open")throw new Error(`Unable to re-use existing shadow root for ${e.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}}),t.is=e.$tagName$,yh(t,e)},yl=(t,n,e,r)=>{e&&W.document&&e.map(([o,i,a])=>{const s=Sh(W.document,t,o),l=Ch(n,a),c=Eh(o);U.ael(s,i,l,c),(n.$rmListeners$=n.$rmListeners$||[]).push(()=>U.rel(s,i,l,c))})},Ch=(t,n)=>e=>{try{t.$hostElement$[n](e)}catch(r){At(r,t.$hostElement$)}},Sh=(t,n,e)=>e&4?t:n,Eh=t=>Pp?{passive:(t&1)!==0,capture:(t&2)!==0}:(t&2)!==0;const Ih=`*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb;}::before,::after{--tw-content:''}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Montserrat, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;}body{margin:0;line-height:inherit;}hr{height:0;color:inherit;border-top-width:1px;}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse;}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0;}button,select{text-transform:none}button,input:where([type='button']),input:where([type='reset']),input:where([type='submit']){-webkit-appearance:button;background-color:transparent;background-image:none;}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type='search']{-webkit-appearance:textfield;outline-offset:-2px;}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af;}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af;}button,[role="button"]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle;}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden="until-found"])){display:none}html[data-theme='office']{--color-primary:rgb(0, 119, 107);--color-secondary:rgb(128, 104, 186);--color-buttons:#89da59;--color-typography:#ff320e}html{--color-primary:rgb(0, 119, 107);--color-secondary:rgb(128, 104, 186);--color-buttons:#fbbc05;--color-typography:#ea4335}:root{--color-primary:rgb(0, 119, 107);--color-secondary:rgb(128, 104, 186);--color-tertiary:rgb(219, 59, 3);--color-white:white;--color-emphasis:rgb(8, 8, 9);--color-supergiant:rgb(213, 66, 99);--color-orange:rgb(250, 200, 127);--color-buttons:#fbbc05;--color-typography:#ea4335;--background:20 66% 99%;--foreground:20 51% 4%;--muted:20 25% 86%;--muted-foreground:20 7% 25%;--popover:20 66% 98%;--popover-foreground:20 51% 3%;--card:20 66% 98%;--card-foreground:20 51% 3%;--border:20 15% 94%;--input:20 15% 94%;--primary:20 48% 72%;--primary-foreground:20 48% 12%;--secondary:20 12% 92%;--secondary-foreground:20 12% 32%;--accent:20 12% 92%;--accent-foreground:20 12% 32%;--destructive:11 80% 22%;--destructive-foreground:11 80% 82%;--ring:20 48% 72%;--radius:0.5rem;--chart-1:12 76% 61%;--chart-2:173 58% 39%;--chart-3:197 37% 24%;--chart-4:43 74% 66%;--chart-5:27 87% 67%}.dark{--background:253 43% 3%;--foreground:253 31% 98%;--muted:253 7% 13%;--muted-foreground:253 13% 63%;--popover:253 43% 3%;--popover-foreground:253 31% 98%;--card:253 43% 4%;--card-foreground:253 31% 99%;--border:215 27.9% 16.9%;--input:215 27.9% 16.9%;--primary:253 91% 58%;--primary-foreground:253 91% 98%;--secondary:253 7% 9%;--secondary-foreground:253 7% 69%;--accent:253 13% 14%;--accent-foreground:253 13% 74%;--destructive:339.2 90.36% 51.18%;--destructive-foreground:0 0% 100%;--ring:253 91% 58%;--chart-1:220 70% 50%;--chart-2:160 60% 45%;--chart-3:30 80% 55%;--chart-4:280 65% 60%;--chart-5:340 75% 55%}*{border-color:hsl(var(--border))}body{box-sizing:border-box;background-color:hsl(var(--background));color:hsl(var(--foreground))}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:0.25rem}.mb-6{margin-bottom:1.5rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.contents{display:contents}.list-item{display:list-item}.hidden{display:none}.size-16{width:1rem;height:1rem}.h-3{height:0.75rem}.h-4{height:0.25rem}.w-3{width:0.75rem}.w-4{width:0.25rem}.w-full{width:100%}.max-w-6xl{max-width:72rem}.max-w-7xl{max-width:80rem}.max-w-xl{max-width:36rem}.grow{flex-grow:1}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:0.25rem}.gap-2{gap:0.5rem}.gap-20{gap:1.25rem}.gap-4{gap:0.25rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-x-8{-moz-column-gap:0.5rem;column-gap:0.5rem}.gap-y-12{row-gap:0.75rem}.overflow-x-auto{overflow-x:auto}.text-pretty{text-wrap:pretty}.rounded{border-radius:0.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:0.5rem}.rounded-md{border-radius:0.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-teal-600{--tw-bg-opacity:1;background-color:rgb(13 148 136 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-1\\.5{padding:0.375rem}.p-2{padding:0.5rem}.p-6{padding:1.5rem}.px-2{padding-left:0.5rem;padding-right:0.5rem}.px-3{padding-left:0.75rem;padding-right:0.75rem}.px-4{padding-left:0.25rem;padding-right:0.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:0.25rem;padding-bottom:0.25rem}.py-1\\.5{padding-top:0.375rem;padding-bottom:0.375rem}.py-24{padding-top:1.5rem;padding-bottom:1.5rem}.py-3{padding-top:0.75rem;padding-bottom:0.75rem}.text-left{text-align:left}.text-center{text-align:center}.font-sans{font-family:Montserrat, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base\\/7{font-size:1rem;line-height:1.75rem}.text-lg\\/8{font-size:1.125rem;line-height:2rem}.text-sm{font-size:0.875rem;line-height:1.25rem}.text-sm\\/6{font-size:0.875rem;line-height:1.5rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:0.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.italic{font-style:italic}.tracking-tight{letter-spacing:-0.025em}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity:1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-primary{color:var(--color-primary)}.text-teal-600{--tw-text-opacity:1;color:rgb(13 148 136 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.transition-colors{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.theme-office{--color-black:#000000;--color-white:#ffffff;--color-primary:#db3b03;--color-secondary:#ec7702;--color-buttons:#89da59;--color-typography:#ff320e}.theme-pg{--color-primary:#00776b;--color-secondary:#01a39d;--color-buttons:#89da59;--color-typography:#ff320e}.hover\\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:bg-teal-50:hover{--tw-bg-opacity:1;background-color:rgb(240 253 250 / var(--tw-bg-opacity, 1))}.hover\\:bg-teal-700:hover{--tw-bg-opacity:1;background-color:rgb(15 118 110 / var(--tw-bg-opacity, 1))}.hover\\:text-gray-600:hover{--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\\:text-gray-800:hover{--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.hover\\:text-gray-900:hover{--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\\:text-teal-800:hover{--tw-text-opacity:1;color:rgb(17 94 89 / var(--tw-text-opacity, 1))}.focus\\:border-teal-500:focus{--tw-border-opacity:1;border-color:rgb(20 184 166 / var(--tw-border-opacity, 1))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.focus\\:ring-teal-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(20 184 166 / var(--tw-ring-opacity, 1))}.disabled\\:opacity-50:disabled{opacity:0.5}@media (min-width: 640px){.sm\\:grid-cols-2{grid-template-columns:repeat(2, minmax(0, 1fr))}.sm\\:gap-y-16{row-gap:1rem}.sm\\:py-32{padding-top:2rem;padding-bottom:2rem}.sm\\:text-4xl{font-size:2.25rem;line-height:2.5rem}}@media (min-width: 1024px){.lg\\:px-8{padding-left:0.5rem;padding-right:0.5rem}}@media (min-width: 1280px){.xl\\:col-span-2{grid-column:span 2 / span 2}.xl\\:grid-cols-3{grid-template-columns:repeat(3, minmax(0, 1fr))}}`,Th=`@tailwind base;
|
|
9
|
+
`);const a=this["s-cr"].parentElement;return(a.__childNodes?a.childNodes:nh(a.childNodes)).forEach(l=>{i===Mi(l)&&o.push(l)}),e?o.filter(l=>l.nodeType===1):o}).bind(t);t.assignedElements=n(!0),t.assignedNodes=n(!1)}function ir(t,n){if("__"+n in t){const e=t["__"+n];return typeof e!="function"?e:e.bind(t)}else return typeof t[n]!="function"?t[n]:t[n].bind(t)}var ae=(t,n="")=>()=>{},p=(t,n,...e)=>{let r=null,o=null,i=null,a=!1,s=!1;const l=[],c=h=>{for(let g=0;g<h.length;g++)r=h[g],Array.isArray(r)?c(r):r!=null&&typeof r!="boolean"&&((a=typeof t!="function"&&!Ti(r))&&(r=String(r)),a&&s?l[l.length-1].$text$+=r:l.push(a?Ue(null,r):r),s=a)};if(c(e),n){n.key&&(o=n.key),n.name&&(i=n.name);{const h=n.className||n.class;h&&(n.class=typeof h!="object"?h:Object.keys(h).filter(g=>h[g]).join(" "))}}if(typeof t=="function")return t(n===null?{}:n,l,oh);const d=Ue(t,null);return d.$attrs$=n,l.length>0&&(d.$children$=l),d.$key$=o,d.$name$=i,d},Ue=(t,n)=>{const e={$flags$:0,$tag$:t,$text$:n,$elm$:null,$children$:null};return e.$attrs$=null,e.$key$=null,e.$name$=null,e},E={},rh=t=>t&&t.$tag$===E,oh={forEach:(t,n)=>t.map(ka).forEach(n),map:(t,n)=>t.map(ka).map(n).map(ih)},ka=t=>({vattrs:t.$attrs$,vchildren:t.$children$,vkey:t.$key$,vname:t.$name$,vtag:t.$tag$,vtext:t.$text$}),ih=t=>{if(typeof t.vtag=="function"){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),p(t.vtag,e,...t.vchildren||[])}const n=Ue(t.vtag,t.vtext);return n.$attrs$=t.vattrs,n.$children$=t.vchildren,n.$key$=t.vkey,n.$name$=t.vname,n},ah=(t,n,e,r)=>{var o;const i=ae("hydrateClient",n),a=t.shadowRoot,s=[],l=[],c=[],d=a?[]:null,h=Ue(n,null);h.$elm$=t,Object.entries(((o=r.$cmpMeta$)==null?void 0:o.$members$)||{}).forEach(([z,[F,V]])=>{var de;if(!(F&31))return;const Ze=V||z,nt=t.getAttribute(Ze);if(nt!==null){const et=zi(nt,F);(de=r==null?void 0:r.$instanceValues$)==null||de.set(z,et)}});let u;{const z=r.$cmpMeta$;z&&z.$flags$&10&&t["s-sc"]?(u=t["s-sc"],t.classList.add(u+"-h")):t["s-sc"]&&delete t["s-sc"]}W.document&&(!U.$orgLocNodes$||!U.$orgLocNodes$.size)&&Yo(W.document.body,U.$orgLocNodes$=new Map),t[bt]=e,t.removeAttribute(bt),r.$vnode$=Go(h,s,l,d,t,t,e,c);let f=0;const m=s.length;let x;for(f;f<m;f++){x=s[f];const z=x.$hostId$+"."+x.$nodeId$,F=U.$orgLocNodes$.get(z),V=x.$elm$;a||(V["s-hn"]=n.toUpperCase(),x.$tag$==="slot"&&(V["s-cr"]=t["s-cr"])),x.$tag$==="slot"&&(x.$name$=x.$elm$["s-sn"]||x.$elm$.name||null,x.$children$?(x.$flags$|=2,x.$elm$.childNodes.length||x.$children$.forEach(de=>{x.$elm$.appendChild(de.$elm$)})):x.$flags$|=1),F&&F.isConnected&&(a&&F["s-en"]===""&&F.parentNode.insertBefore(V,F.nextSibling),F.parentNode.removeChild(F),a||(V["s-oo"]=parseInt(x.$nodeId$))),U.$orgLocNodes$.delete(z)}const b=[],_=c.length;let D=0,A,L,H,C;for(D;D<_;D++)if(A=c[D],!(!A||!A.length))for(H=A.length,L=0,L;L<H;L++){if(C=A[L],b[C.hostId]||(b[C.hostId]=U.$orgLocNodes$.get(C.hostId)),!b[C.hostId])continue;const z=b[C.hostId];(!z.shadowRoot||!a)&&(C.slot["s-cr"]=z["s-cr"],!C.slot["s-cr"]&&z.shadowRoot?C.slot["s-cr"]=z:C.slot["s-cr"]=(z.__childNodes||z.childNodes)[0],th(C.node,C.slot,!1,C.node["s-oo"])),z.shadowRoot&&C.node.parentElement!==z&&z.appendChild(C.node)}if(u&&l.length&&l.forEach(z=>{z.$elm$.parentElement.classList.add(u+"-s")}),a&&!a.childNodes.length){let z=0;const F=d.length;if(F){for(z;z<F;z++)a.appendChild(d[z]);Array.from(t.childNodes).forEach(V=>{typeof V["s-en"]!="string"&&typeof V["s-sn"]!="string"&&(V.nodeType===1&&V.slot&&V.hidden?V.removeAttribute("hidden"):(V.nodeType===8||V.nodeType===3&&!V.wholeText.trim())&&V.parentNode.removeChild(V))})}}U.$orgLocNodes$.delete(t["s-id"]),r.$hostElement$=t,i()},Go=(t,n,e,r,o,i,a,s=[])=>{let l,c,d,h;const g=o["s-sc"];if(i.nodeType===1){if(l=i.getAttribute(ma),l&&(c=l.split("."),c[0]===a||c[0]==="0")){d=wa({$flags$:0,$hostId$:c[0],$nodeId$:c[1],$depth$:c[2],$index$:c[3],$tag$:i.tagName.toLowerCase(),$elm$:i,$attrs$:{class:i.className||""}}),n.push(d),i.removeAttribute(ma),t.$children$||(t.$children$=[]),g&&(i["s-si"]=g,d.$attrs$.class+=" "+g);const f=d.$elm$.getAttribute("s-sn");typeof f=="string"&&(d.$tag$==="slot-fb"&&(_a(f,c[2],d,i,t,n,e,r,s),g&&i.classList.add(g)),d.$elm$["s-sn"]=f,d.$elm$.removeAttribute("s-sn")),d.$index$!==void 0&&(t.$children$[d.$index$]=d),t=d,r&&d.$depth$==="0"&&(r[d.$index$]=d.$elm$)}if(i.shadowRoot)for(h=i.shadowRoot.childNodes.length-1;h>=0;h--)Go(t,n,e,r,o,i.shadowRoot.childNodes[h],a,s);const u=i.__childNodes||i.childNodes;for(h=u.length-1;h>=0;h--)Go(t,n,e,r,o,u[h],a,s)}else if(i.nodeType===8){if(c=i.nodeValue.split("."),c[1]===a||c[1]==="0"){if(l=c[0],d=wa({$hostId$:c[1],$nodeId$:c[2],$depth$:c[3],$index$:c[4]||"0",$elm$:i,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null}),l===Rp)d.$elm$=Sa(i,3),d.$elm$&&d.$elm$.nodeType===3&&(d.$text$=d.$elm$.textContent,n.push(d),i.remove(),a===d.$hostId$&&(t.$children$||(t.$children$=[]),t.$children$[d.$index$]=d),r&&d.$depth$==="0"&&(r[d.$index$]=d.$elm$));else if(l===Bp)d.$elm$=Sa(i,8),d.$elm$&&d.$elm$.nodeType===8&&(n.push(d),i.remove());else if(d.$hostId$===a)if(l===Pp){const u=i["s-sn"]=c[5]||"";_a(u,c[2],d,i,t,n,e,r,s)}else l===Ap&&(r?i.remove():(o["s-cr"]=i,i["s-cn"]=!0))}}else if(t&&t.$tag$==="style"){const u=Ue(null,i.textContent);u.$elm$=i,u.$index$="0",t.$children$=[u]}else i.nodeType===3&&!i.wholeText.trim()&&i.remove();return t},Yo=(t,n)=>{if(t.nodeType===1){const e=t[bt]||t.getAttribute(bt);e&&n.set(e,t);let r=0;if(t.shadowRoot)for(;r<t.shadowRoot.childNodes.length;r++)Yo(t.shadowRoot.childNodes[r],n);const o=t.__childNodes||t.childNodes;for(r=0;r<o.length;r++)Yo(o[r],n)}else if(t.nodeType===8){const e=t.nodeValue.split(".");e[0]===Lp&&(n.set(e[1]+"."+e[2],t),t.nodeValue="",t["s-en"]=e[3])}},wa=t=>({...{$flags$:0,$hostId$:null,$nodeId$:null,$depth$:null,$index$:"0",$elm$:null,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null},...t});function _a(t,n,e,r,o,i,a,s,l){r["s-sr"]=!0,e.$name$=t||null,e.$tag$="slot";const c=o!=null&&o.$elm$?o.$elm$["s-id"]||o.$elm$.getAttribute("s-id"):"";if(s&&W.document){const d=e.$elm$=W.document.createElement(e.$tag$);e.$name$&&e.$elm$.setAttribute("name",t),c&&c!==e.$hostId$?o.$elm$.insertBefore(d,o.$elm$.children[0]):r.parentNode.insertBefore(d,r),Ca(l,n,t,r,e.$hostId$),r.remove(),e.$depth$==="0"&&(s[e.$index$]=e.$elm$)}else{const d=e.$elm$,h=c&&c!==e.$hostId$&&o.$elm$.shadowRoot;Ca(l,n,t,r,h?c:e.$hostId$),dl(r),h&&o.$elm$.insertBefore(d,o.$elm$.children[0])}i.push(e),a.push(e),o.$children$||(o.$children$=[]),o.$children$[e.$index$]=e}var Ca=(t,n,e,r,o)=>{let i=r.nextSibling;for(t[n]=t[n]||[];i&&((i.getAttribute&&i.getAttribute("slot")||i["s-sn"])===e||e===""&&!i["s-sn"]&&(i.nodeType===8&&i.nodeValue.indexOf(".")!==1||i.nodeType===3));)i["s-sn"]=e,t[n].push({slot:r,node:i,hostId:o}),i=i.nextSibling},Sa=(t,n)=>{let e=t;do e=e.nextSibling;while(e&&(e.nodeType!==n||!e.nodeValue));return e},Di=t=>{const n=Up(t);return new RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${n}))(${n}\\b)`,"g")};Di("::slotted");Di(":host");Di(":host-context");var zi=(t,n,e)=>{if(typeof t=="string"&&(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]")))try{return t=JSON.parse(t),t}catch{}return typeof t=="string"&&t.startsWith(Wo)?(t=Qp(t),t):t!=null&&!Ti(t)?n&4?t==="false"?!1:t===""||!!t:n&2?typeof t=="string"?parseFloat(t):typeof t=="number"?t:NaN:n&1?String(t):t:t},sh=t=>t,k=(t,n,e)=>{const r=sh(t);return{emit:o=>pl(r,n,{bubbles:!0,composed:!0,cancelable:!0,detail:o})}},pl=(t,n,e)=>{const r=U.ce(n,e);return t.dispatchEvent(r),r},Ne=new WeakMap,hl=(t,n,e)=>{let r=or.get(t);$i&&e?(r=r||new CSSStyleSheet,typeof r=="string"?r=n:r.replaceSync(n)):r=n,or.set(t,r)},gl=(t,n,e)=>{var r;const o=Oi(n),i=or.get(o);if(!W.document)return o;if(t=t.nodeType===11?t:W.document,i)if(typeof i=="string"){t=t.head||t;let a=Ne.get(t),s;if(a||Ne.set(t,a=new Set),!a.has(o)){if(t.host&&(s=t.querySelector(`[${Uo}="${o}"]`)))s.innerHTML=i;else{s=W.document.createElement("style"),s.innerHTML=i;const l=(r=U.$nonce$)!=null?r:Wp(W.document);if(l!=null&&s.setAttribute("nonce",l),!(n.$flags$&1))if(t.nodeName==="HEAD"){const c=t.querySelectorAll("link[rel=preconnect]"),d=c.length>0?c[c.length-1].nextSibling:t.querySelector("style");t.insertBefore(s,(d==null?void 0:d.parentNode)===t?d:null)}else if("host"in t)if($i){const c=new CSSStyleSheet;c.replaceSync(i),t.adoptedStyleSheets=[c,...t.adoptedStyleSheets]}else{const c=t.querySelector("style");c?c.innerHTML=i+c.innerHTML:t.prepend(s)}else t.append(s);n.$flags$&1&&t.insertBefore(s,null)}n.$flags$&4&&(s.innerHTML+=Np),a&&a.add(o)}}else t.adoptedStyleSheets.includes(i)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,i]);return o},lh=t=>{const n=t.$cmpMeta$,e=t.$hostElement$,r=n.$flags$,o=ae("attachStyles",n.$tagName$),i=gl(e.shadowRoot?e.shadowRoot:e.getRootNode(),n);r&10&&(e["s-sc"]=i,e.classList.add(i+"-h")),o()},Oi=(t,n)=>"sc-"+t.$tagName$,ch=t=>t.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{"),dh=()=>{if(!W.document)return;const t=W.document.querySelectorAll(`[${Uo}]`);let n=0;for(;n<t.length;n++)hl(t[n].getAttribute(Uo),ch(t[n].innerHTML),!0)},Ea=(t,n,e,r,o,i,a)=>{if(e===r)return;let s=fa(t,n),l=n.toLowerCase();if(n==="class"){const c=t.classList,d=Ia(e);let h=Ia(r);t["s-si"]&&a?(h.push(t["s-si"]),d.forEach(g=>{g.startsWith(t["s-si"])&&h.push(g)}),h=[...new Set(h)],c.add(...h)):(c.remove(...d.filter(g=>g&&!h.includes(g))),c.add(...h.filter(g=>g&&!d.includes(g))))}else if(n==="style"){for(const c in e)(!r||r[c]==null)&&(c.includes("-")?t.style.removeProperty(c):t.style[c]="");for(const c in r)(!e||r[c]!==e[c])&&(c.includes("-")?t.style.setProperty(c,r[c]):t.style[c]=r[c])}else if(n!=="key")if(n==="ref")r&&r(t);else if(!t.__lookupSetter__(n)&&n[0]==="o"&&n[1]==="n"){if(n[2]==="-"?n=n.slice(3):fa(W,l)?n=l.slice(2):n=l[2]+n.slice(3),e||r){const c=n.endsWith(ul);n=n.replace(hh,""),e&&U.rel(t,n,e,c),r&&U.ael(t,n,r,c)}}else{const c=Ti(r);if((s||c&&r!==null)&&!o)try{if(t.tagName.includes("-"))t[n]!==r&&(t[n]=r);else{const h=r??"";n==="list"?s=!1:(e==null||t[n]!=h)&&(typeof t.__lookupSetter__(n)=="function"?t[n]=h:t.setAttribute(n,h))}}catch{}let d=!1;l!==(l=l.replace(/^xlink\:?/,""))&&(n=l,d=!0),r==null||r===!1?(r!==!1||t.getAttribute(n)==="")&&(d?t.removeAttributeNS(xa,n):t.removeAttribute(n)):(!s||i&4||o)&&!c&&t.nodeType===1&&(r=r===!0?"":r,d?t.setAttributeNS(xa,n,r):t.setAttribute(n,r))}},ph=/\s/,Ia=t=>(typeof t=="object"&&t&&"baseVal"in t&&(t=t.baseVal),!t||typeof t!="string"?[]:t.split(ph)),ul="Capture",hh=new RegExp(ul+"$"),Qo=(t,n,e,r)=>{const o=n.$elm$.nodeType===11&&n.$elm$.host?n.$elm$.host:n.$elm$,i=t&&t.$attrs$||{},a=n.$attrs$||{};for(const s of $a(Object.keys(i)))s in a||Ea(o,s,i[s],void 0,e,n.$flags$,r);for(const s of $a(Object.keys(a)))Ea(o,s,i[s],a[s],e,n.$flags$,r)};function $a(t){return t.includes("ref")?[...t.filter(n=>n!=="ref"),"ref"]:t}var Yt,ar,Qr,Zo=!1,sr=!1,Ai=!1,fn=!1,lr=(t,n,e)=>{var r;const o=n.$children$[e];let i=0,a,s,l;if(Zo||(Ai=!0,o.$tag$==="slot"&&(o.$flags$|=o.$children$?2:1)),o.$text$!==null)a=o.$elm$=W.document.createTextNode(o.$text$);else if(o.$flags$&1)a=o.$elm$=W.document.createTextNode(""),Qo(null,o,fn);else{if(fn||(fn=o.$tag$==="svg"),!W.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(a=o.$elm$=W.document.createElementNS(fn?Dp:zp,!Zo&&Ot.slotRelocation&&o.$flags$&2?"slot-fb":o.$tag$),fn&&o.$tag$==="foreignObject"&&(fn=!1),Qo(null,o,fn),Vp(Yt)&&a["s-si"]!==Yt&&a.classList.add(a["s-si"]=Yt),o.$children$)for(i=0;i<o.$children$.length;++i)s=lr(t,o,i),s&&a.appendChild(s);o.$tag$==="svg"?fn=!1:a.tagName==="foreignObject"&&(fn=!0)}return a["s-hn"]=Qr,o.$flags$&3&&(a["s-sr"]=!0,a["s-cr"]=ar,a["s-sn"]=o.$name$||"",a["s-rf"]=(r=o.$attrs$)==null?void 0:r.ref,dl(a),l=t&&t.$children$&&t.$children$[e],l&&l.$tag$===o.$tag$&&t.$elm$&&yt(t.$elm$,!1),yl(ar,a,n.$elm$,t==null?void 0:t.$elm$)),a},yt=(t,n)=>{U.$flags$|=1;const e=Array.from(t.__childNodes||t.childNodes);for(let r=e.length-1;r>=0;r--){const o=e[r];o["s-hn"]!==Qr&&o["s-ol"]&&(ne(vt(o).parentNode,o,vt(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,Ai=!0),n&&yt(o,n)}U.$flags$&=-2},fl=(t,n,e,r,o,i)=>{let a=t["s-cr"]&&t["s-cr"].parentNode||t,s;for(a.shadowRoot&&a.tagName===Qr&&(a=a.shadowRoot);o<=i;++o)r[o]&&(s=lr(null,e,o),s&&(r[o].$elm$=s,ne(a,s,vt(n))))},ml=(t,n,e)=>{for(let r=n;r<=e;++r){const o=t[r];if(o){const i=o.$elm$;bl(o),i&&(sr=!0,i["s-ol"]?i["s-ol"].remove():yt(i,!0),i.remove())}}},gh=(t,n,e,r,o=!1)=>{let i=0,a=0,s=0,l=0,c=n.length-1,d=n[0],h=n[c],g=r.length-1,u=r[0],f=r[g],m,x;for(;i<=c&&a<=g;)if(d==null)d=n[++i];else if(h==null)h=n[--c];else if(u==null)u=r[++a];else if(f==null)f=r[--g];else if(Ft(d,u,o))Le(d,u,o),d=n[++i],u=r[++a];else if(Ft(h,f,o))Le(h,f,o),h=n[--c],f=r[--g];else if(Ft(d,f,o))(d.$tag$==="slot"||f.$tag$==="slot")&&yt(d.$elm$.parentNode,!1),Le(d,f,o),ne(t,d.$elm$,h.$elm$.nextSibling),d=n[++i],f=r[--g];else if(Ft(h,u,o))(d.$tag$==="slot"||f.$tag$==="slot")&&yt(h.$elm$.parentNode,!1),Le(h,u,o),ne(t,h.$elm$,d.$elm$),h=n[--c],u=r[++a];else{for(s=-1,l=i;l<=c;++l)if(n[l]&&n[l].$key$!==null&&n[l].$key$===u.$key$){s=l;break}s>=0?(x=n[s],x.$tag$!==u.$tag$?m=lr(n&&n[a],e,s):(Le(x,u,o),n[s]=void 0,m=x.$elm$),u=r[++a]):(m=lr(n&&n[a],e,a),u=r[++a]),m&&ne(vt(d.$elm$).parentNode,m,vt(d.$elm$))}i>c?fl(t,r[g+1]==null?null:r[g+1].$elm$,e,r,a,g):a>g&&ml(n,i,c)},Ft=(t,n,e=!1)=>t.$tag$===n.$tag$?t.$tag$==="slot"?t.$name$===n.$name$:e?(e&&!t.$key$&&n.$key$&&(t.$key$=n.$key$),!0):t.$key$===n.$key$:!1,vt=t=>t&&t["s-ol"]||t,Le=(t,n,e=!1)=>{const r=n.$elm$=t.$elm$,o=t.$children$,i=n.$children$,a=n.$tag$,s=n.$text$;let l;s===null?(fn=a==="svg"?!0:a==="foreignObject"?!1:fn,Qo(t,n,fn,e),o!==null&&i!==null?gh(r,o,n,i,e):i!==null?(t.$text$!==null&&(r.textContent=""),fl(r,null,n,i,0,i.length-1)):!e&&Ot.updatable&&o!==null&&ml(o,0,o.length-1),fn&&a==="svg"&&(fn=!1)):(l=r["s-cr"])?l.parentNode.textContent=s:t.$text$!==s&&(r.data=s)},Hn=[],xl=t=>{let n,e,r;const o=t.__childNodes||t.childNodes;for(const i of o){if(i["s-sr"]&&(n=i["s-cr"])&&n.parentNode){e=n.parentNode.__childNodes||n.parentNode.childNodes;const a=i["s-sn"];for(r=e.length-1;r>=0;r--)if(n=e[r],!n["s-cn"]&&!n["s-nr"]&&n["s-hn"]!==i["s-hn"])if(va(n,a)){let s=Hn.find(l=>l.$nodeToRelocate$===n);sr=!0,n["s-sn"]=n["s-sn"]||a,s?(s.$nodeToRelocate$["s-sh"]=i["s-hn"],s.$slotRefNode$=i):(n["s-sh"]=i["s-hn"],Hn.push({$slotRefNode$:i,$nodeToRelocate$:n})),n["s-sr"]&&Hn.map(l=>{va(l.$nodeToRelocate$,n["s-sn"])&&(s=Hn.find(c=>c.$nodeToRelocate$===n),s&&!l.$slotRefNode$&&(l.$slotRefNode$=s.$slotRefNode$))})}else Hn.some(s=>s.$nodeToRelocate$===n)||Hn.push({$nodeToRelocate$:n})}i.nodeType===1&&xl(i)}},bl=t=>{t.$attrs$&&t.$attrs$.ref&&t.$attrs$.ref(null),t.$children$&&t.$children$.map(bl)},ne=(t,n,e)=>(typeof n["s-sn"]=="string"&&n["s-sr"]&&n["s-cr"]&&yl(n["s-cr"],n,t,n.parentElement),t==null?void 0:t.insertBefore(n,e));function yl(t,n,e,r){var o,i;let a;if(t&&typeof n["s-sn"]=="string"&&n["s-sr"]&&t.parentNode&&t.parentNode["s-sc"]&&(a=n["s-si"]||t.parentNode["s-sc"])){const s=n["s-sn"],l=n["s-hn"];if((o=e.classList)==null||o.add(a+"-s"),r&&((i=r.classList)!=null&&i.contains(a+"-s"))){let c=(r.__childNodes||r.childNodes)[0],d=!1;for(;c;){if(c["s-sn"]!==s&&c["s-hn"]===l&&c["s-sr"]){d=!0;break}c=c.nextSibling}d||r.classList.remove(a+"-s")}}}var uh=(t,n,e=!1)=>{var r,o,i,a;const s=t.$hostElement$,l=t.$cmpMeta$,c=t.$vnode$||Ue(null,null),h=rh(n)?n:p(null,null,n);if(Qr=s.tagName,l.$attrsToReflect$&&(h.$attrs$=h.$attrs$||{},l.$attrsToReflect$.map(([g,u])=>h.$attrs$[u]=s[g])),e&&h.$attrs$)for(const g of Object.keys(h.$attrs$))s.hasAttribute(g)&&!["key","ref","style","class"].includes(g)&&(h.$attrs$[g]=s[g]);h.$tag$=null,h.$flags$|=4,t.$vnode$=h,h.$elm$=c.$elm$=s.shadowRoot||s,Yt=s["s-sc"],Zo=!!(l.$flags$&1)&&!(l.$flags$&128),ar=s["s-cr"],sr=!1,Le(c,h,e);{if(U.$flags$|=1,Ai){xl(h.$elm$);for(const g of Hn){const u=g.$nodeToRelocate$;if(!u["s-ol"]&&W.document){const f=W.document.createTextNode("");f["s-nr"]=u,ne(u.parentNode,u["s-ol"]=f,u)}}for(const g of Hn){const u=g.$nodeToRelocate$,f=g.$slotRefNode$;if(f){const m=f.parentNode;let x=f.nextSibling;{let D=(r=u["s-ol"])==null?void 0:r.previousSibling;for(;D;){let A=(o=D["s-nr"])!=null?o:null;if(A&&A["s-sn"]===u["s-sn"]&&m===(A.__parentNode||A.parentNode)){for(A=A.nextSibling;A===u||A!=null&&A["s-sr"];)A=A==null?void 0:A.nextSibling;if(!A||!A["s-nr"]){x=A;break}}D=D.previousSibling}}const b=u.__parentNode||u.parentNode,_=u.__nextSibling||u.nextSibling;(!x&&m!==b||_!==x)&&u!==x&&(!u["s-hn"]&&u["s-ol"]&&(u["s-hn"]=u["s-ol"].parentNode.nodeName),ne(m,u,x),u.nodeType===1&&u.tagName!=="SLOT-FB"&&(u.hidden=(i=u["s-ih"])!=null?i:!1)),u&&typeof f["s-rf"]=="function"&&f["s-rf"](f)}else u.nodeType===1&&(e&&(u["s-ih"]=(a=u.hidden)!=null?a:!1),u.hidden=!0)}}sr&&ll(h.$elm$),U.$flags$&=-2,Hn.length=0}ar=void 0},vl=(t,n)=>{if(n&&!t.$onRenderResolve$&&n["s-p"]){const e=n["s-p"].push(new Promise(r=>t.$onRenderResolve$=()=>{n["s-p"].splice(e-1,1),r()}))}},Li=(t,n)=>{if(t.$flags$|=16,t.$flags$&4){t.$flags$|=512;return}return vl(t,t.$ancestorComponent$),Xp(()=>fh(t,n))},fh=(t,n)=>{const e=t.$hostElement$,r=ae("scheduleUpdate",t.$cmpMeta$.$tagName$),o=e;if(!o)throw new Error(`Can't render component <${e.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let i;return n?i=je(o,"componentWillLoad",void 0,e):i=je(o,"componentWillUpdate",void 0,e),i=Ta(i,()=>je(o,"componentWillRender",void 0,e)),r(),Ta(i,()=>xh(t,o,n))},Ta=(t,n)=>mh(t)?t.then(n).catch(e=>{console.error(e),n()}):n(),mh=t=>t instanceof Promise||t&&t.then&&typeof t.then=="function",xh=async(t,n,e)=>{var r;const o=t.$hostElement$,i=ae("update",t.$cmpMeta$.$tagName$),a=o["s-rc"];e&&lh(t);const s=ae("render",t.$cmpMeta$.$tagName$);bh(t,n,o,e),a&&(a.map(l=>l()),o["s-rc"]=void 0),s(),i();{const l=(r=o["s-p"])!=null?r:[],c=()=>yh(t);l.length===0?c():(Promise.all(l).then(c),t.$flags$|=4,l.length=0)}},bh=(t,n,e,r)=>{try{n=n.render(),t.$flags$&=-17,t.$flags$|=2,uh(t,n,r)}catch(o){At(o,t.$hostElement$)}return null},yh=t=>{const n=t.$cmpMeta$.$tagName$,e=t.$hostElement$,r=ae("postUpdate",n),o=e,i=t.$ancestorComponent$;je(o,"componentDidRender",void 0,e),t.$flags$&64?(je(o,"componentDidUpdate",void 0,e),r()):(t.$flags$|=64,kh(e),je(o,"componentDidLoad",void 0,e),r(),t.$onReadyResolve$(e),i||vh()),t.$onRenderResolve$&&(t.$onRenderResolve$(),t.$onRenderResolve$=void 0),t.$flags$&512&&Yr(()=>Li(t,!1)),t.$flags$&=-517},vh=t=>{Yr(()=>pl(W,"appload",{detail:{namespace:$p}}))},je=(t,n,e,r)=>{if(t&&t[n])try{return t[n](e)}catch(o){At(o,r)}},kh=t=>{var n;return t.setAttribute((n=Ot.hydratedSelectorName)!=null?n:"hydrated","")},wh=(t,n)=>Ce(t).$instanceValues$.get(n),Ma=(t,n,e,r)=>{const o=Ce(t),i=t,a=o.$instanceValues$.get(n),s=o.$flags$,l=i;e=zi(e,r.$members$[n][0]);const c=Number.isNaN(a)&&Number.isNaN(e);if(e!==a&&!c){o.$instanceValues$.set(n,e);{if(r.$watchers$&&s&128){const h=r.$watchers$[n];h&&h.map(g=>{try{l[g](e,a,n)}catch(u){At(u,i)}})}if((s&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(e,a,n)===!1)return;Li(o,!1)}}}},_h=(t,n,e)=>{var r,o;const i=t.prototype;if(n.$members$||n.$watchers$||t.watchers){t.watchers&&!n.$watchers$&&(n.$watchers$=t.watchers);const a=Object.entries((r=n.$members$)!=null?r:{});a.map(([s,[l]])=>{if(l&31||l&32){const{get:c,set:d}=Object.getOwnPropertyDescriptor(i,s)||{};c&&(n.$members$[s][0]|=2048),d&&(n.$members$[s][0]|=4096),Object.defineProperty(i,s,{get(){return c?c.apply(this):wh(this,s)},configurable:!0,enumerable:!0}),Object.defineProperty(i,s,{set(h){const g=Ce(this);if(d){const u=l&32?this[s]:g.$hostElement$[s];typeof u>"u"&&g.$instanceValues$.get(s)?h=g.$instanceValues$.get(s):!g.$instanceValues$.get(s)&&u&&g.$instanceValues$.set(s,u),d.apply(this,[zi(h,l)]),h=l&32?this[s]:g.$hostElement$[s],Ma(this,s,h,n);return}{Ma(this,s,h,n);return}}})}});{const s=new Map;i.attributeChangedCallback=function(l,c,d){U.jmp(()=>{var h;const g=s.get(l);if(!(this.hasOwnProperty(g)&&Ot.lazyLoad)){if(i.hasOwnProperty(g)&&typeof this[g]=="number"&&this[g]==d)return;if(g==null){const f=Ce(this),m=f==null?void 0:f.$flags$;if(m&&!(m&8)&&m&128&&d!==c){const b=this,_=(h=n.$watchers$)==null?void 0:h[l];_==null||_.forEach(D=>{b[D]!=null&&b[D].call(b,d,c,l)})}return}}const u=Object.getOwnPropertyDescriptor(i,g);d=d===null&&typeof this[g]=="boolean"?!1:d,d!==this[g]&&(!u.get||u.set)&&(this[g]=d)})},t.observedAttributes=Array.from(new Set([...Object.keys((o=n.$watchers$)!=null?o:{}),...a.filter(([l,c])=>c[0]&15).map(([l,c])=>{var d;const h=c[1]||l;return s.set(h,l),c[0]&512&&((d=n.$attrsToReflect$)==null||d.push([l,h])),h})]))}}return t},Da=async(t,n,e,r)=>{let o;if(!(n.$flags$&32)){n.$flags$|=32;{o=t.constructor;const s=t.localName;customElements.whenDefined(s).then(()=>n.$flags$|=128)}if(o&&o.style){let s;typeof o.style=="string"&&(s=o.style);const l=Oi(e);if(!or.has(l)){const c=ae("registerStyles",e.$tagName$);hl(l,s,!!(e.$flags$&1)),c()}}}const i=n.$ancestorComponent$,a=()=>Li(n,!0);i&&i["s-rc"]?i["s-rc"].push(a):a()},Ch=(t,n)=>{},Sh=t=>{if(!(U.$flags$&1)){const n=Ce(t),e=n.$cmpMeta$,r=ae("connectedCallback",e.$tagName$);if(n.$flags$&1)kl(t,n,e.$listeners$),n!=null&&n.$lazyInstance$||n!=null&&n.$onReadyPromise$&&n.$onReadyPromise$.then(()=>Ch());else{n.$flags$|=1;let o;if(o=t.getAttribute(bt),o){if(e.$flags$&1){const i=gl(t.shadowRoot,e);t.classList.remove(i+"-h",i+"-s")}else if(e.$flags$&2){const i=Oi(e);t["s-sc"]=i}ah(t,e.$tagName$,o,n)}o||e.$flags$&12&&Eh(t);{let i=t;for(;i=i.parentNode||i.host;)if(i.nodeType===1&&i.hasAttribute("s-id")&&i["s-p"]||i["s-p"]){vl(n,n.$ancestorComponent$=i);break}}e.$members$&&Object.entries(e.$members$).map(([i,[a]])=>{if(a&31&&t.hasOwnProperty(i)){const s=t[i];delete t[i],t[i]=s}}),Ot.initializeNextTick?Yr(()=>Da(t,n,e)):Da(t,n,e)}r()}},Eh=t=>{if(!W.document)return;const n=t["s-cr"]=W.document.createComment("");n["s-cn"]=!0,ne(t,n,t.firstChild)},Ih=async t=>{if(!(U.$flags$&1)){const n=Ce(t);n.$rmListeners$&&(n.$rmListeners$.map(e=>e()),n.$rmListeners$=void 0)}Ne.has(t)&&Ne.delete(t),t.shadowRoot&&Ne.has(t.shadowRoot)&&Ne.delete(t.shadowRoot)},M=(t,n)=>{const e={$flags$:n[0],$tagName$:n[1]};e.$members$=n[2],e.$listeners$=n[3],e.$watchers$=t.$watchers$,e.$attrsToReflect$=[],dh();const r=t.prototype.connectedCallback,o=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){Op(this,e)},connectedCallback(){if(!this.__hasHostListenerAttached){const i=Ce(this);kl(this,i,e.$listeners$),this.__hasHostListenerAttached=!0}Sh(this),r&&r.call(this)},disconnectedCallback(){Ih(this),o&&o.call(this)},__attachShadow(){if(!this.shadowRoot)Zp.call(this,e);else if(this.shadowRoot.mode!=="open")throw new Error(`Unable to re-use existing shadow root for ${e.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}}),t.is=e.$tagName$,_h(t,e)},kl=(t,n,e,r)=>{e&&W.document&&e.map(([o,i,a])=>{const s=Th(W.document,t,o),l=$h(n,a),c=Mh(o);U.ael(s,i,l,c),(n.$rmListeners$=n.$rmListeners$||[]).push(()=>U.rel(s,i,l,c))})},$h=(t,n)=>e=>{try{t.$hostElement$[n](e)}catch(r){At(r,t.$hostElement$)}},Th=(t,n,e)=>e&4?t:n,Mh=t=>Fp?{passive:(t&1)!==0,capture:(t&2)!==0}:(t&2)!==0;const Dh=`*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb;}::before,::after{--tw-content:''}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Montserrat, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;}body{margin:0;line-height:inherit;}hr{height:0;color:inherit;border-top-width:1px;}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse;}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0;}button,select{text-transform:none}button,input:where([type='button']),input:where([type='reset']),input:where([type='submit']){-webkit-appearance:button;background-color:transparent;background-image:none;}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type='search']{-webkit-appearance:textfield;outline-offset:-2px;}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af;}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af;}button,[role="button"]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle;}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden="until-found"])){display:none}html[data-theme='office']{--color-primary:rgb(0, 119, 107);--color-secondary:rgb(128, 104, 186);--color-buttons:#89da59;--color-typography:#ff320e}html{--color-primary:rgb(0, 119, 107);--color-secondary:rgb(128, 104, 186);--color-buttons:#fbbc05;--color-typography:#ea4335}:root{--color-primary:rgb(0, 119, 107);--color-secondary:rgb(128, 104, 186);--color-tertiary:rgb(219, 59, 3);--color-white:white;--color-emphasis:rgb(8, 8, 9);--color-supergiant:rgb(213, 66, 99);--color-orange:rgb(250, 200, 127);--color-buttons:#fbbc05;--color-typography:#ea4335;--background:20 66% 99%;--foreground:20 51% 4%;--muted:20 25% 86%;--muted-foreground:20 7% 25%;--popover:20 66% 98%;--popover-foreground:20 51% 3%;--card:20 66% 98%;--card-foreground:20 51% 3%;--border:20 15% 94%;--input:20 15% 94%;--primary:20 48% 72%;--primary-foreground:20 48% 12%;--secondary:20 12% 92%;--secondary-foreground:20 12% 32%;--accent:20 12% 92%;--accent-foreground:20 12% 32%;--destructive:11 80% 22%;--destructive-foreground:11 80% 82%;--ring:20 48% 72%;--radius:0.5rem;--chart-1:12 76% 61%;--chart-2:173 58% 39%;--chart-3:197 37% 24%;--chart-4:43 74% 66%;--chart-5:27 87% 67%}.dark{--background:253 43% 3%;--foreground:253 31% 98%;--muted:253 7% 13%;--muted-foreground:253 13% 63%;--popover:253 43% 3%;--popover-foreground:253 31% 98%;--card:253 43% 4%;--card-foreground:253 31% 99%;--border:215 27.9% 16.9%;--input:215 27.9% 16.9%;--primary:253 91% 58%;--primary-foreground:253 91% 98%;--secondary:253 7% 9%;--secondary-foreground:253 7% 69%;--accent:253 13% 14%;--accent-foreground:253 13% 74%;--destructive:339.2 90.36% 51.18%;--destructive-foreground:0 0% 100%;--ring:253 91% 58%;--chart-1:220 70% 50%;--chart-2:160 60% 45%;--chart-3:30 80% 55%;--chart-4:280 65% 60%;--chart-5:340 75% 55%}*{border-color:hsl(var(--border))}body{box-sizing:border-box;background-color:hsl(var(--background));color:hsl(var(--foreground))}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:0.25rem}.mb-6{margin-bottom:1.5rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.contents{display:contents}.list-item{display:list-item}.hidden{display:none}.size-16{width:1rem;height:1rem}.h-3{height:0.75rem}.h-4{height:0.25rem}.w-3{width:0.75rem}.w-4{width:0.25rem}.w-full{width:100%}.max-w-6xl{max-width:72rem}.max-w-7xl{max-width:80rem}.max-w-xl{max-width:36rem}.grow{flex-grow:1}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:0.25rem}.gap-2{gap:0.5rem}.gap-20{gap:1.25rem}.gap-4{gap:0.25rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-x-8{-moz-column-gap:0.5rem;column-gap:0.5rem}.gap-y-12{row-gap:0.75rem}.overflow-x-auto{overflow-x:auto}.text-pretty{text-wrap:pretty}.rounded{border-radius:0.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:0.5rem}.rounded-md{border-radius:0.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-teal-600{--tw-bg-opacity:1;background-color:rgb(13 148 136 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-1\\.5{padding:0.375rem}.p-2{padding:0.5rem}.p-6{padding:1.5rem}.px-2{padding-left:0.5rem;padding-right:0.5rem}.px-3{padding-left:0.75rem;padding-right:0.75rem}.px-4{padding-left:0.25rem;padding-right:0.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:0.25rem;padding-bottom:0.25rem}.py-1\\.5{padding-top:0.375rem;padding-bottom:0.375rem}.py-24{padding-top:1.5rem;padding-bottom:1.5rem}.py-3{padding-top:0.75rem;padding-bottom:0.75rem}.text-left{text-align:left}.text-center{text-align:center}.font-sans{font-family:Montserrat, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base\\/7{font-size:1rem;line-height:1.75rem}.text-lg\\/8{font-size:1.125rem;line-height:2rem}.text-sm{font-size:0.875rem;line-height:1.25rem}.text-sm\\/6{font-size:0.875rem;line-height:1.5rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:0.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.italic{font-style:italic}.tracking-tight{letter-spacing:-0.025em}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity:1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-primary{color:var(--color-primary)}.text-teal-600{--tw-text-opacity:1;color:rgb(13 148 136 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.transition-colors{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.theme-office{--color-black:#000000;--color-white:#ffffff;--color-primary:#db3b03;--color-secondary:#ec7702;--color-buttons:#89da59;--color-typography:#ff320e}.theme-pg{--color-primary:#00776b;--color-secondary:#01a39d;--color-buttons:#89da59;--color-typography:#ff320e}.hover\\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:bg-teal-50:hover{--tw-bg-opacity:1;background-color:rgb(240 253 250 / var(--tw-bg-opacity, 1))}.hover\\:bg-teal-700:hover{--tw-bg-opacity:1;background-color:rgb(15 118 110 / var(--tw-bg-opacity, 1))}.hover\\:text-gray-600:hover{--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\\:text-gray-800:hover{--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.hover\\:text-gray-900:hover{--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\\:text-teal-800:hover{--tw-text-opacity:1;color:rgb(17 94 89 / var(--tw-text-opacity, 1))}.focus\\:border-teal-500:focus{--tw-border-opacity:1;border-color:rgb(20 184 166 / var(--tw-border-opacity, 1))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.focus\\:ring-teal-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(20 184 166 / var(--tw-ring-opacity, 1))}.disabled\\:opacity-50:disabled{opacity:0.5}@media (min-width: 640px){.sm\\:grid-cols-2{grid-template-columns:repeat(2, minmax(0, 1fr))}.sm\\:gap-y-16{row-gap:1rem}.sm\\:py-32{padding-top:2rem;padding-bottom:2rem}.sm\\:text-4xl{font-size:2.25rem;line-height:2.5rem}}@media (min-width: 1024px){.lg\\:px-8{padding-left:0.5rem;padding-right:0.5rem}}@media (min-width: 1280px){.xl\\:col-span-2{grid-column:span 2 / span 2}.xl\\:grid-cols-3{grid-template-columns:repeat(3, minmax(0, 1fr))}}`,zh=`@tailwind base;
|
|
6
10
|
@tailwind components;
|
|
7
11
|
@tailwind utilities;
|
|
8
12
|
@layer base {
|
|
@@ -330,7 +334,7 @@ ol.mdc-list.sc-xplor-alert-dialog li.mdc-list-item.sc-xplor-alert-dialog, ul.mdc
|
|
|
330
334
|
opacity: 1;
|
|
331
335
|
transform: scale(1);
|
|
332
336
|
}
|
|
333
|
-
}`,
|
|
337
|
+
}`,wl=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorClose=k(this,"xplorClose"),this.xplorDialogChange=k(this,"xplorDialogChange"),this.open=!1,this.width="408px",this.persistent=!0,this.previouslyFocusedElement=null,this.handleBackdropClick=()=>{this.persistent||this.closeDialog()},this.handleCardClick=n=>{n.stopPropagation()},this.closeDialog=()=>{this.open=!1,this.xplorClose.emit(),this.xplorDialogChange.emit(!1)}}handleOpenChange(n){n?(document.body.style.overflow="hidden",this.previouslyFocusedElement=document.activeElement,requestAnimationFrame(()=>{this.setInitialFocus()})):(document.body.style.overflow="",this.previouslyFocusedElement&&(this.previouslyFocusedElement.focus(),this.previouslyFocusedElement=null))}disconnectedCallback(){document.body.style.overflow=""}handleKeyDown(n){if(this.open){if(n.key==="Escape"&&!this.persistent){n.preventDefault(),this.closeDialog();return}n.key==="Tab"&&this.trapFocus(n)}}getFocusableElements(){return this.dialogEl?Array.from(this.dialogEl.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])')):[]}trapFocus(n){const e=this.getFocusableElements();if(e.length===0)return;const r=e[0],o=e[e.length-1];n.shiftKey?document.activeElement===r&&(n.preventDefault(),o.focus()):document.activeElement===o&&(n.preventDefault(),r.focus())}setInitialFocus(){const n=this.getFocusableElements();n.length>0?n[0].focus():this.dialogEl&&this.dialogEl.focus()}render(){return this.open?p(E,null,p("div",{class:"xplor-alert-dialog__backdrop",onClick:this.handleBackdropClick},p("div",{class:"xplor-alert-dialog__card",style:{width:this.width},onClick:this.handleCardClick,role:"alertdialog","aria-modal":"true","aria-labelledby":this.ariaLabel?void 0:"xplor-alert-dialog-title","aria-label":this.ariaLabel,"aria-describedby":"xplor-alert-dialog-text",tabindex:"-1",ref:n=>this.dialogEl=n},p("button",{type:"button",class:"xplor-alert-dialog__close-btn",onClick:this.closeDialog,"aria-label":"Close dialog"},"✕"),p("div",{class:"xplor-alert-dialog__title",id:"xplor-alert-dialog-title"},p("slot",{name:"title"})),p("div",{class:"xplor-alert-dialog__text",id:"xplor-alert-dialog-text"},p("slot",{name:"text"})),p("div",{class:"xplor-alert-dialog__actions"},p("slot",{name:"actions"}))))):null}get el(){return this}static get watchers(){return{open:["handleOpenChange"]}}static get style(){return zh}},[6,"xplor-alert-dialog",{open:[1028],width:[1],persistent:[4],ariaLabel:[1,"aria-label"]},[[0,"keydown","handleKeyDown"]],{open:["handleOpenChange"]}]);function Oh(){if(typeof customElements>"u")return;["xplor-alert-dialog"].forEach(n=>{switch(n){case"xplor-alert-dialog":customElements.get(n)||customElements.define(n,wl);break}})}const Ah=wl,Lh=Oh,Ph=`@tailwind base;
|
|
334
338
|
@tailwind components;
|
|
335
339
|
@tailwind utilities;
|
|
336
340
|
@layer base {
|
|
@@ -662,29 +666,29 @@ ol.mdc-list.sc-xplor-alert-message li.mdc-list-item.sc-xplor-alert-message, ul.m
|
|
|
662
666
|
outline: 2px solid currentColor;
|
|
663
667
|
outline-offset: 2px;
|
|
664
668
|
border-radius: 2px;
|
|
665
|
-
}`,
|
|
669
|
+
}`,_l=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorDismiss=k(this,"xplorDismiss"),this.type="info",this.dismissible=!1,this.handleDismiss=()=>{this.xplorDismiss.emit()}}render(){return p(E,{key:"e5ad4fa2fd9fbdc47cfbfd73fb73b1db28a315e0"},p("div",{key:"ffd54ee02b5f4374fded564e8d22e766c4d38298",class:{"alert-message":!0,[`alert-message--${this.type}`]:!0},role:"alert"},p("div",{key:"343c0a7b2fc0850a8a198006623587a2b51222aa",class:"alert-message__content"},this.alertTitle&&p("div",{key:"e832315711af527990f7818b3a125fd451a9bbac",class:"alert-message__title"},p("slot",{key:"bec62d27a75cea441df1440d899b3cbdbb336677",name:"title"},this.alertTitle)),p("div",{key:"862ff923e142cf0a19e4d94b2c0f83d4b2880dbf",class:"alert-message__body"},p("slot",{key:"29ddafe2ffe87eab3434f65226e352ecb26d4bcb"})),p("div",{key:"8f4057d4c6c2baea6e2962f52e5a242f0c23e759",class:"alert-message__actions"},p("slot",{key:"937e8089b98ee78738b770ba74b3867f979c2f8d",name:"actions"}))),this.dismissible&&p("button",{key:"5f4999ac21586b31c0c44320464e40a63eab98ab",class:"alert-message__dismiss",onClick:this.handleDismiss,"aria-label":"Dismiss alert",type:"button"},"×")))}static get style(){return Ph}},[6,"xplor-alert-message",{type:[1],alertTitle:[1,"alert-title"],dismissible:[4]}]);function Rh(){if(typeof customElements>"u")return;["xplor-alert-message"].forEach(n=>{switch(n){case"xplor-alert-message":customElements.get(n)||customElements.define(n,_l);break}})}const Bh=_l,Nh=Rh;function Fh(){const t=Date.now(),n=Math.random().toString(36).substring(2,11);return`session_${t}_${n}`}function Hh(){const t=new Date,n=t.getFullYear(),e=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${n}-${e}-${r}`}function jh(){const t=new Date,n=String(t.getHours()).padStart(2,"0"),e=String(t.getMinutes()).padStart(2,"0"),r=String(t.getSeconds()).padStart(2,"0");return`${n}:${e}:${r}`}async function Xh(t,n,e,r,o,i){if(!t)throw new Error("API endpoint is required");if(!n||!n.trim())throw new Error("Message cannot be empty");const a={message:n.trim(),sessionId:e,userId:r,userEmail:o,userName:i,currentDate:Hh(),currentTime:jh()};try{const s=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!s.ok){const c=await s.text().catch(()=>s.statusText);throw new Error(`API error: ${s.status} - ${c}`)}const l=await s.json();if(!l.message||!l.sessionId)throw new Error("Invalid API response: missing required fields");return l}catch(s){throw s instanceof Error?s.name==="TypeError"&&s.message.includes("fetch")?new Error("Network error: Unable to reach the API. Please check your connection."):s:new Error("Unknown error occurred while calling the API")}}function Vh(){if(typeof window>"u")return{voiceInput:!1,textToSpeech:!1};const t="SpeechRecognition"in window||"webkitSpeechRecognition"in window,n="speechSynthesis"in window;return{voiceInput:t,textToSpeech:n}}class Wh{constructor(){if(this.recognition=null,this.onResultCallback=null,this.onErrorCallback=null,this.onStartCallback=null,this.onEndCallback=null,typeof window>"u")return;const n=window.SpeechRecognition||window.webkitSpeechRecognition;n&&(this.recognition=new n,this.recognition.continuous=!1,this.recognition.interimResults=!1,this.recognition.lang="en-US",this.recognition.maxAlternatives=1,this.recognition.onstart=()=>{this.onStartCallback&&this.onStartCallback()},this.recognition.onresult=e=>{const r=e.results[0][0].transcript;this.onResultCallback&&this.onResultCallback(r)},this.recognition.onerror=e=>{const r=this.getErrorMessage(e.error);this.onErrorCallback&&this.onErrorCallback(r)},this.recognition.onend=()=>{this.onEndCallback&&this.onEndCallback()})}getErrorMessage(n){switch(n){case"no-speech":return"No speech detected. Please try again.";case"audio-capture":return"No microphone found. Please ensure a microphone is connected.";case"not-allowed":return"Microphone permission denied. Please allow microphone access.";case"network":return"Network error. Please check your connection.";default:return`Speech recognition error: ${n}`}}start(){if(!this.recognition){console.error("Speech recognition not supported");return}try{this.recognition.start()}catch(n){console.error("Failed to start speech recognition:",n),this.onErrorCallback&&this.onErrorCallback("Failed to start voice recognition")}}stop(){this.recognition&&this.recognition.stop()}onResult(n){this.onResultCallback=n}onError(n){this.onErrorCallback=n}onStart(n){this.onStartCallback=n}onEnd(n){this.onEndCallback=n}isAvailable(){return this.recognition!==null}}class Uh{constructor(){this.currentUtterance=null,this.onStartCallback=null,this.onEndCallback=null}speak(n){if(typeof window>"u"||!("speechSynthesis"in window)){console.error("Speech synthesis not supported");return}this.stop(),this.currentUtterance=new SpeechSynthesisUtterance(n),this.currentUtterance.lang="en-US",this.currentUtterance.rate=1,this.currentUtterance.pitch=1,this.currentUtterance.volume=1,this.currentUtterance.onstart=()=>{this.onStartCallback&&this.onStartCallback()},this.currentUtterance.onend=()=>{this.onEndCallback&&this.onEndCallback(),this.currentUtterance=null},this.currentUtterance.onerror=e=>{console.error("Speech synthesis error:",e),this.onEndCallback&&this.onEndCallback(),this.currentUtterance=null},window.speechSynthesis.speak(this.currentUtterance)}stop(){typeof window>"u"||!("speechSynthesis"in window)||(window.speechSynthesis.speaking&&(window.speechSynthesis.cancel(),this.onEndCallback&&this.onEndCallback()),this.currentUtterance=null)}isSpeaking(){return typeof window>"u"||!("speechSynthesis"in window)?!1:window.speechSynthesis.speaking}onStart(n){this.onStartCallback=n}onEnd(n){this.onEndCallback=n}isAvailable(){return typeof window<"u"&&"speechSynthesis"in window}}const qh=`
|
|
666
670
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
667
671
|
<path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path>
|
|
668
672
|
<path d="M19 10v2a7 7 0 0 1-14 0v-2"></path>
|
|
669
673
|
<line x1="12" y1="19" x2="12" y2="23"></line>
|
|
670
674
|
<line x1="8" y1="23" x2="16" y2="23"></line>
|
|
671
675
|
</svg>
|
|
672
|
-
`,
|
|
676
|
+
`,Kh=`
|
|
673
677
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
674
678
|
<line x1="22" y1="2" x2="11" y2="13"></line>
|
|
675
679
|
<polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
|
|
676
680
|
</svg>
|
|
677
|
-
`,
|
|
681
|
+
`,Jh=`
|
|
678
682
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
679
683
|
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon>
|
|
680
684
|
<path d="M15.54 8.46a5 5 0 0 1 0 7.07"></path>
|
|
681
685
|
<path d="M19.07 4.93a10 10 0 0 1 0 14.14"></path>
|
|
682
686
|
</svg>
|
|
683
|
-
`,
|
|
687
|
+
`,Gh=`
|
|
684
688
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none">
|
|
685
689
|
<rect x="6" y="6" width="12" height="12" rx="2"></rect>
|
|
686
690
|
</svg>
|
|
687
|
-
`,
|
|
691
|
+
`,Yh=t=>{const{message:n,enableTextToSpeech:e,isSpeaking:r,onSpeak:o,onStopSpeaking:i}=t,a={"xplor-assistant__message":!0,"xplor-assistant__message--user":n.role==="user","xplor-assistant__message--assistant":n.role==="assistant"},s=()=>{r?i==null||i():o==null||o(n.content)},l=c=>{const d=c.getHours(),h=c.getMinutes(),g=d>=12?"PM":"AM",u=d%12||12,f=h<10?`0${h}`:h;return`${u}:${f} ${g}`};return p("div",{class:a},p("div",{class:"xplor-assistant__message-content"},n.content),p("div",{class:"xplor-assistant__message-footer"},p("span",{class:"xplor-assistant__message-timestamp"},l(n.timestamp)),n.role==="assistant"&&e&&p("button",{class:{"xplor-assistant__speak-button":!0,"xplor-assistant__speak-button--active":r},onClick:s,title:r?"Stop speaking":"Listen to message",type:"button"},p("span",{class:"xplor-assistant__speak-icon",innerHTML:r?Gh:Jh}))))},Qh=t=>{const{placeholder:n,disabled:e,isLoading:r,enableVoiceInput:o,isListening:i,inputValue:a,onSendMessage:s,onStartListening:l,onStopListening:c,setInputValue:d}=t,h=m=>{m.preventDefault(),console.log("[AssistantInput] Submit triggered, inputValue:",a),a.trim()&&!e&&!r?(console.log("[AssistantInput] Calling onSendMessage with:",a),s(a),d("")):console.log("[AssistantInput] Submit blocked - disabled:",e,"isLoading:",r,"hasValue:",!!a.trim())},g=m=>{const x=m.target;d(x.value)},u=()=>{i?c():l()},f=!a.trim()||e||r;return p("div",{class:"xplor-assistant__input-container"},p("form",{onSubmit:h,class:"xplor-assistant__input-form"},o&&p("button",{type:"button",class:{"xplor-assistant__voice-button":!0,"xplor-assistant__voice-button--listening":i},onClick:u,disabled:e||r,title:i?"Stop listening":"Start voice input","aria-label":"Voice input"},p("span",{class:"xplor-assistant__voice-icon",innerHTML:qh})),p("input",{type:"text",class:"xplor-assistant__input",placeholder:n,value:a,onInput:g,disabled:e||r}),p("button",{type:"submit",class:"xplor-assistant__send-button",disabled:f,title:"Send message","aria-label":"Send message"},p("span",{class:"xplor-assistant__send-icon",innerHTML:Kh}))))},Zh=t=>{const{replies:n,disabled:e,onReplyClick:r}=t;return!n||n.length===0?null:p("div",{class:"xplor-assistant__quick-replies"},n.map(o=>p("button",{class:"xplor-assistant__quick-reply",onClick:()=>r(o),disabled:e,type:"button"},o)))},ng=()=>p("div",{class:"xplor-assistant__typing-indicator"},p("span",{class:"xplor-assistant__typing-dot"}),p("span",{class:"xplor-assistant__typing-dot"}),p("span",{class:"xplor-assistant__typing-dot"})),eg=`@tailwind base;
|
|
688
692
|
@tailwind components;
|
|
689
693
|
@tailwind utilities;
|
|
690
694
|
@layer base {
|
|
@@ -2048,7 +2052,7 @@ ol.mdc-list.sc-xplor-assistant li.mdc-list-item.sc-xplor-assistant, ul.mdc-list.
|
|
|
2048
2052
|
transform: scale(1.05);
|
|
2049
2053
|
opacity: 0.9;
|
|
2050
2054
|
}
|
|
2051
|
-
}`,
|
|
2055
|
+
}`,Cl=M(class extends T{constructor(){super(),this.__registerHost(),this.assistantMessageSent=k(this,"assistantMessageSent"),this.assistantMessageReceived=k(this,"assistantMessageReceived"),this.assistantError=k(this,"assistantError"),this.assistantSessionCreated=k(this,"assistantSessionCreated"),this.placeholder="Type your message...",this.enableVoiceInput=!0,this.enableTextToSpeech=!0,this.autoSpeak=!1,this.maxHeight="600px",this.disabled=!1,this.messages=[],this.internalSessionId="",this.isLoading=!1,this.isListening=!1,this.isSpeaking=!1,this.error="",this.inputValue="",this.hasVoiceSupport=!1,this.hasTTSSupport=!1,this.handleSendMessage=async n=>{if(console.log("[XplorAssistant] handleSendMessage called with:",n),this.disabled||this.isLoading||!n.trim()){console.log("[XplorAssistant] Message blocked - disabled:",this.disabled,"isLoading:",this.isLoading,"hasValue:",!!n.trim());return}this.inputValue="",console.log("[XplorAssistant] Input cleared, proceeding with message");const e={id:`user-${Date.now()}`,role:"user",content:n.trim(),timestamp:new Date};this.messages=[...this.messages,e],this.error="",this.isLoading=!0,this.assistantMessageSent.emit({message:e.content,sessionId:this.internalSessionId,timestamp:e.timestamp});try{const r=await Xh(this.apiEndpoint,e.content,this.internalSessionId,this.userId,this.userEmail,this.userName);r.sessionId&&r.sessionId!==this.internalSessionId&&(this.internalSessionId=r.sessionId);const o={id:`assistant-${Date.now()}`,role:"assistant",content:r.message,timestamp:new Date};this.messages=[...this.messages,o],this.assistantMessageReceived.emit({message:o.content,sessionId:this.internalSessionId,timestamp:o.timestamp}),this.autoSpeak&&this.enableTextToSpeech&&this.speechSynthesis.speak(o.content)}catch(r){const o=r instanceof Error?r.message:"Failed to send message";this.handleError(o,"api")}finally{this.isLoading=!1}},this.handleVoiceInput=n=>{n&&n.trim()&&this.handleSendMessage(n)},this.handleError=(n,e)=>{this.error=n,this.assistantError.emit({error:n,type:e,timestamp:new Date})},this.handleStartListening=()=>{this.speechRecognition&&this.enableVoiceInput&&!this.disabled&&!this.isLoading&&this.speechRecognition.start()},this.handleStopListening=()=>{this.speechRecognition&&this.speechRecognition.stop()},this.handleSpeak=n=>{this.speechSynthesis&&this.enableTextToSpeech&&this.speechSynthesis.speak(n)},this.handleStopSpeaking=()=>{this.speechSynthesis&&this.speechSynthesis.stop()},this.handleQuickReply=n=>{this.handleSendMessage(n)},this.setInputValue=n=>{this.inputValue=n}}componentWillLoad(){if(!this.apiEndpoint){console.error("xplor-assistant: apiEndpoint prop is required"),this.error="Configuration error: API endpoint not provided";return}if(!this.userId||!this.userEmail||!this.userName){console.error("xplor-assistant: userId, userEmail, and userName props are required"),this.error="Configuration error: User information not provided";return}this.sessionId?this.internalSessionId=this.sessionId:(this.internalSessionId=Fh(),this.assistantSessionCreated.emit({sessionId:this.internalSessionId,timestamp:new Date}));const n=Vh();this.hasVoiceSupport=n.voiceInput,this.hasTTSSupport=n.textToSpeech,this.hasVoiceSupport||(this.enableVoiceInput=!1),this.hasTTSSupport||(this.enableTextToSpeech=!1),this.speechRecognition=new Wh,this.speechSynthesis=new Uh,this.speechRecognition.onStart(()=>{this.isListening=!0}),this.speechRecognition.onEnd(()=>{this.isListening=!1}),this.speechRecognition.onResult(e=>{this.handleVoiceInput(e)}),this.speechRecognition.onError(e=>{this.isListening=!1,this.handleError(e,"voice")}),this.speechSynthesis.onStart(()=>{this.isSpeaking=!0}),this.speechSynthesis.onEnd(()=>{this.isSpeaking=!1})}handleSessionIdChange(n){n&&n!==this.internalSessionId&&(this.internalSessionId=n)}componentDidUpdate(){this.scrollToBottom()}disconnectedCallback(){this.speechSynthesis&&this.speechSynthesis.stop()}async sendMessage(n){!n||!n.trim()||await this.handleSendMessage(n)}async clearHistory(){this.messages=[],this.error=""}async speak(n){this.enableTextToSpeech&&this.speechSynthesis&&this.speechSynthesis.speak(n)}async stopSpeaking(){this.speechSynthesis&&this.speechSynthesis.stop()}scrollToBottom(){this.messagesContainerRef&&setTimeout(()=>{this.messagesContainerRef.scrollTop=this.messagesContainerRef.scrollHeight},100)}render(){return this.error&&!this.apiEndpoint?p(E,null,p("div",{class:"xplor-assistant xplor-assistant--error"},p("div",{class:"xplor-assistant__error-message"},this.error))):p(E,null,p("div",{class:{"xplor-assistant":!0,"xplor-assistant--disabled":this.disabled},style:{maxHeight:this.maxHeight}},p("div",{class:"xplor-assistant__messages",ref:n=>this.messagesContainerRef=n,role:"log","aria-live":"polite","aria-busy":this.isLoading?"true":"false"},this.messages.map(n=>p(Yh,{message:n,enableTextToSpeech:this.enableTextToSpeech,autoSpeak:!1,isSpeaking:this.isSpeaking,onSpeak:this.handleSpeak,onStopSpeaking:this.handleStopSpeaking})),this.isLoading&&p("div",{class:"xplor-assistant__message xplor-assistant__message--assistant"},p(ng,null)),this.error&&this.apiEndpoint&&p("div",{class:"xplor-assistant__error-banner"},this.error)),this.quickReplies&&this.quickReplies.length>0&&p(Zh,{replies:this.quickReplies,disabled:this.disabled||this.isLoading,onReplyClick:this.handleQuickReply}),p(Qh,{placeholder:this.placeholder,disabled:this.disabled,isLoading:this.isLoading,enableVoiceInput:this.enableVoiceInput&&this.hasVoiceSupport,isListening:this.isListening,onSendMessage:this.handleSendMessage,onStartListening:this.handleStartListening,onStopListening:this.handleStopListening,inputValue:this.inputValue,setInputValue:this.setInputValue})))}get el(){return this}static get watchers(){return{sessionId:["handleSessionIdChange"]}}static get style(){return eg}},[2,"xplor-assistant",{apiEndpoint:[1,"api-endpoint"],userId:[1,"user-id"],userEmail:[1,"user-email"],userName:[1,"user-name"],sessionId:[1,"session-id"],quickReplies:[16,"quick-replies"],placeholder:[1],enableVoiceInput:[4,"enable-voice-input"],enableTextToSpeech:[4,"enable-text-to-speech"],autoSpeak:[4,"auto-speak"],maxHeight:[1,"max-height"],disabled:[4],messages:[32],internalSessionId:[32],isLoading:[32],isListening:[32],isSpeaking:[32],error:[32],inputValue:[32],hasVoiceSupport:[32],hasTTSSupport:[32],sendMessage:[64],clearHistory:[64],speak:[64],stopSpeaking:[64]},void 0,{sessionId:["handleSessionIdChange"]}]);function tg(){if(typeof customElements>"u")return;["xplor-assistant"].forEach(n=>{switch(n){case"xplor-assistant":customElements.get(n)||customElements.define(n,Cl);break}})}const rg=Cl,og=tg,ig=`@tailwind base;
|
|
2052
2056
|
@tailwind components;
|
|
2053
2057
|
@tailwind utilities;
|
|
2054
2058
|
@layer base {
|
|
@@ -2486,7 +2490,7 @@ ol.mdc-list.sc-xplor-autocomplete li.mdc-list-item.sc-xplor-autocomplete, ul.mdc
|
|
|
2486
2490
|
text-align: center;
|
|
2487
2491
|
color: #757575;
|
|
2488
2492
|
font-size: 0.875rem;
|
|
2489
|
-
}`,
|
|
2493
|
+
}`,Sl=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorChange=k(this,"xplorChange"),this.xplorSelect=k(this,"xplorSelect"),this.xplorClear=k(this,"xplorClear"),this.xplorSearch=k(this,"xplorSearch"),this.items=[],this.value=null,this.placeholder="Search...",this.disabled=!1,this.readonly=!1,this.clearable=!1,this.multiple=!1,this.minSearchLength=0,this.itemValue="value",this.itemText="label",this.menuMaxWidth="100%",this.isOpen=!1,this.searchQuery="",this.filteredItems=[],this.selectedItems=[],this.highlightedIndex=-1,this.handleInputFocus=()=>{this.disabled||this.readonly||(this.isOpen=!0,this.highlightedIndex=-1)},this.handleInputChange=n=>{const e=n.target;this.searchQuery=e.value,this.filterItems(),this.isOpen=!0,this.highlightedIndex=-1,this.xplorSearch.emit(this.searchQuery),!this.multiple&&this.searchQuery===""&&(this.value=null,this.xplorChange.emit(null))},this.handleInputKeyDown=n=>{var e;if(!(this.disabled||this.readonly))switch(n.key){case"ArrowDown":n.preventDefault(),this.isOpen=!0,this.highlightedIndex=Math.min(this.highlightedIndex+1,this.filteredItems.length-1),this.scrollToHighlighted();break;case"ArrowUp":n.preventDefault(),this.highlightedIndex=Math.max(this.highlightedIndex-1,-1),this.scrollToHighlighted();break;case"Enter":n.preventDefault(),this.highlightedIndex>=0&&this.highlightedIndex<this.filteredItems.length&&this.selectItem(this.filteredItems[this.highlightedIndex]);break;case"Escape":n.preventDefault(),this.isOpen=!1,(e=this.inputEl)===null||e===void 0||e.blur();break;case"Backspace":this.multiple&&this.searchQuery===""&&this.selectedItems.length>0&&(n.preventDefault(),this.removeItem(this.selectedItems[this.selectedItems.length-1]));break}},this.handleClear=()=>{var n;this.value=this.multiple?[]:null,this.selectedItems=[],this.searchQuery="",this.filterItems(),this.xplorChange.emit(this.value),this.xplorClear.emit(),(n=this.inputEl)===null||n===void 0||n.focus()}}getItemValue(n){return n[this.itemValue]!==void 0?n[this.itemValue]:n.value}getItemText(n){return n[this.itemText]!==void 0?String(n[this.itemText]):String(n.label)}componentWillLoad(){if(this.filterItems(),this.value!==null){if(this.multiple&&Array.isArray(this.value))this.selectedItems=this.value;else if(!this.multiple){const n=this.items.find(e=>this.getItemValue(e)===this.value);n&&(this.searchQuery=this.getItemText(n))}}}handleDocumentClick(n){const e=n.target;this.el.contains(e)||(this.isOpen=!1)}filterItems(){if(this.searchQuery.length<this.minSearchLength){this.filteredItems=this.items;return}const n=this.searchQuery.toLowerCase();this.filteredItems=this.items.filter(e=>this.getItemText(e).toLowerCase().includes(n))}scrollToHighlighted(){if(this.dropdownEl&&this.highlightedIndex>=0){const n=this.dropdownEl.querySelector(`[data-index="${this.highlightedIndex}"]`);n&&n.scrollIntoView({block:"nearest"})}}selectItem(n){var e;if(n.disabled)return;const r=this.getItemValue(n);this.multiple?(this.selectedItems.includes(r)||(this.selectedItems=[...this.selectedItems,r],this.value=this.selectedItems,this.xplorChange.emit(this.value)),this.searchQuery="",this.filterItems()):(this.value=r,this.searchQuery=this.getItemText(n),this.isOpen=!1,this.xplorChange.emit(this.value)),this.xplorSelect.emit(n),(e=this.inputEl)===null||e===void 0||e.focus()}removeItem(n){this.selectedItems=this.selectedItems.filter(e=>e!==n),this.value=this.selectedItems,this.xplorChange.emit(this.value)}getSelectedItemLabel(n){const e=this.items.find(r=>this.getItemValue(r)===n);return e?this.getItemText(e):n}findItemByValue(n){return this.items.find(e=>this.getItemValue(e)===n)}render(){const n=this.multiple?this.selectedItems.length>0:this.value!==null&&this.searchQuery!=="",e="autocomplete-listbox",r="autocomplete-label",o=this.highlightedIndex>=0?`autocomplete-option-${this.highlightedIndex}`:void 0;return p(E,{key:"f76ac5f9d1cd6e6c9618ac3884bc86a2bfabb3c5"},p("div",{key:"efd2bd854c305c56971b5d6e19a5b9eb497099f8",class:{autocomplete:!0,"autocomplete--disabled":this.disabled,"autocomplete--readonly":this.readonly,"autocomplete--open":this.isOpen}},this.label&&p("label",{key:"97bb161105b66181558d22519c9f0cd1287b2c49",class:"autocomplete__label",id:r},this.label),p("div",{key:"128acf53793205be89a8d619ce548107aaed8b28",class:"autocomplete__input-wrapper"},this.multiple&&this.selectedItems.length>0&&p("div",{key:"670da50897139688951c077db4b6116b88bfadfa",class:"autocomplete__chips"},this.selectedItems.map(i=>{const a=this.findItemByValue(i),s=this.getSelectedItemLabel(i);return p("div",{class:"autocomplete__chip"},p("span",{class:"autocomplete__chip-label"},this.renderSelection&&a?this.renderSelection(a):s),p("button",{type:"button",class:"autocomplete__chip-remove",onClick:()=>this.removeItem(i),disabled:this.disabled||this.readonly,"aria-label":`Remove ${s}`},"×"))})),p("input",{key:"25e9e5111726cd720ab88a4a5ae25f84b48eee1e",ref:i=>this.inputEl=i,type:"text",class:"autocomplete__input",placeholder:this.placeholder,value:this.searchQuery,onFocus:this.handleInputFocus,onInput:this.handleInputChange,onKeyDown:this.handleInputKeyDown,disabled:this.disabled,readonly:this.readonly,autocomplete:"off",role:"combobox","aria-expanded":this.isOpen?"true":"false","aria-haspopup":"listbox","aria-controls":this.isOpen?e:void 0,"aria-activedescendant":o,"aria-labelledby":this.label?r:void 0,"aria-label":this.label?void 0:this.ariaLabel||this.placeholder,"aria-autocomplete":"list"}),p("div",{key:"5128b893c4743a49439a279b0cb7094077ebd528",class:"autocomplete__actions"},this.clearable&&n&&!this.disabled&&!this.readonly&&p("button",{key:"512d7956e79d9767e072462f1ec309b081716c86",type:"button",class:"autocomplete__clear",onClick:this.handleClear,"aria-label":"Clear selection"},"×"),p("span",{key:"e0cfba3c1513b63f9697835ad6919d045c7011db",class:"autocomplete__icon","aria-hidden":"true"},"▼"))),this.isOpen&&this.filteredItems.length>0&&p("div",{key:"9c100abedb5ee252df82994722c0da9d5787d1bf",class:"autocomplete__dropdown",ref:i=>this.dropdownEl=i,style:{maxWidth:this.menuMaxWidth},role:"listbox",id:e,"aria-label":this.label||this.ariaLabel||"Suggestions"},this.filteredItems.map((i,a)=>{const s=this.getItemValue(i),l=this.multiple?this.selectedItems.includes(s):this.value===s;return p("div",{key:s,id:`autocomplete-option-${a}`,"data-index":a,role:"option","aria-selected":l?"true":"false","aria-disabled":i.disabled?"true":void 0,class:{autocomplete__item:!0,"autocomplete__item--highlighted":a===this.highlightedIndex,"autocomplete__item--selected":l,"autocomplete__item--disabled":i.disabled},onClick:()=>this.selectItem(i)},this.renderItem?this.renderItem(i):this.getItemText(i))})),this.isOpen&&this.filteredItems.length===0&&p("div",{key:"329f92d7f4bf36bb114909853e249978412ae82f",class:"autocomplete__dropdown",style:{maxWidth:this.menuMaxWidth},role:"listbox",id:e},p("div",{key:"400e97f955724f59830fb37b52d99c3723627e51",class:"autocomplete__no-results",role:"option","aria-disabled":"true"},"No results found"))))}get el(){return this}static get style(){return ig}},[2,"xplor-autocomplete",{items:[16],value:[1032],placeholder:[1],label:[1],ariaLabel:[1,"aria-label"],disabled:[4],readonly:[4],clearable:[4],multiple:[4],minSearchLength:[2,"min-search-length"],itemValue:[1,"item-value"],itemText:[1,"item-text"],menuMaxWidth:[1,"menu-max-width"],renderItem:[16,"render-item"],renderSelection:[16,"render-selection"],isOpen:[32],searchQuery:[32],filteredItems:[32],selectedItems:[32],highlightedIndex:[32]},[[4,"click","handleDocumentClick"]]]);function ag(){if(typeof customElements>"u")return;["xplor-autocomplete"].forEach(n=>{switch(n){case"xplor-autocomplete":customElements.get(n)||customElements.define(n,Sl);break}})}const sg=Sl,lg=ag,cg=`/* on mobile browsers, I set a width of 100% */
|
|
2490
2494
|
@tailwind base;
|
|
2491
2495
|
@tailwind components;
|
|
2492
2496
|
@tailwind utilities;
|
|
@@ -2755,7 +2759,7 @@ ul.mdc-list li.mdc-list-item {
|
|
|
2755
2759
|
|
|
2756
2760
|
:host {
|
|
2757
2761
|
display: block;
|
|
2758
|
-
}`,
|
|
2762
|
+
}`,El=M(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.disabled=!1}render(){let n="xpl-avatar";this.size&&(n+=` xpl-avatar--${this.size}`),this.color&&(n+=` xpl-avatar--${this.color}`);const e=p("div",{key:"525379beeb0274318733a9369cd21e2cbb4c29d5"},this.src?p("img",{alt:this.name,src:this.src}):p("div",{class:"xpl-avatar__placeholder"},p("slot",null)),this.status&&p("div",{key:"13a67637105ff7bfc277dea7bf5db54b418e3925",class:`xpl-avatar__dot--${this.status}`,"aria-label":`Status: ${this.status}`,role:"img"}));return p(E,{key:"3f9ba8949f576d96bd14c8a1387124af752f63b9"},this.href&&!this.disabled?p("a",{href:this.href,class:n,target:this.target},e):this.href&&this.disabled?p("div",{class:n+" xpl-avatar--disabled"},e):p("div",{class:n},e))}static get style(){return cg}},[1,"xplor-avatar",{color:[1],disabled:[4],href:[1],name:[1],size:[1],src:[1],status:[1],target:[1]}]);function Il(){if(typeof customElements>"u")return;["xplor-avatar"].forEach(n=>{switch(n){case"xplor-avatar":customElements.get(n)||customElements.define(n,El);break}})}const dg=`@tailwind base;
|
|
2759
2763
|
@tailwind components;
|
|
2760
2764
|
@tailwind utilities;
|
|
2761
2765
|
@layer base {
|
|
@@ -3019,7 +3023,7 @@ ol.mdc-list.sc-xplor-avatar-and-name li.mdc-list-item.sc-xplor-avatar-and-name,
|
|
|
3019
3023
|
font-weight: 500;
|
|
3020
3024
|
color: #212121;
|
|
3021
3025
|
line-height: 1.5;
|
|
3022
|
-
}
|
|
3026
|
+
}`,$l=M(class extends T{constructor(){super(),this.__registerHost(),this.size="md"}render(){return p(E,{key:"3cecf9b9082d00a08f658b095b22b73b89c049ab"},p("div",{key:"45d7af0d4244bb5757e90eb5a5c18480ae183ff3",class:"avatar-and-name"},p("xplor-avatar",{key:"d707f7729ecad111af15023198a6c0f88fcb7615",name:this.name,src:this.src,size:this.size,color:this.color,status:this.status},!this.src&&this.name&&this.name.charAt(0).toUpperCase()),p("span",{key:"7226b976cd3976cd97be2bc62ba15176496b479d",class:"avatar-and-name__text"},p("slot",{key:"521c6002cc282c3909f14b96f74cb7425be5fa8b"},this.name))))}static get style(){return dg}},[6,"xplor-avatar-and-name",{name:[1],src:[1],size:[1],color:[1],status:[1]}]);function pg(){if(typeof customElements>"u")return;["xplor-avatar-and-name","xplor-avatar"].forEach(n=>{switch(n){case"xplor-avatar-and-name":customElements.get(n)||customElements.define(n,$l);break;case"xplor-avatar":customElements.get(n)||Il();break}})}const hg=$l,gg=pg,ug=El,fg=Il,mg=`@tailwind base;
|
|
3023
3027
|
@tailwind components;
|
|
3024
3028
|
@tailwind utilities;
|
|
3025
3029
|
@layer base {
|
|
@@ -3279,7 +3283,7 @@ ol.mdc-list.sc-xplor-badge-active li.mdc-list-item.sc-xplor-badge-active, ul.mdc
|
|
|
3279
3283
|
padding: 4px 12px;
|
|
3280
3284
|
border-radius: 16px;
|
|
3281
3285
|
display: inline-block;
|
|
3282
|
-
}`,
|
|
3286
|
+
}`,Tl=M(class extends T{constructor(){super(),this.__registerHost()}render(){return p(E,{key:"41f14585e6efaff93c9ba04a32db266222ea6b40"},p("span",{key:"a051889e2b74c3503e12d2045704f81bd8876e8c",class:"xplor-badge-active"},"Active"))}static get style(){return mg}},[2,"xplor-badge-active"]);function xg(){if(typeof customElements>"u")return;["xplor-badge-active"].forEach(n=>{switch(n){case"xplor-badge-active":customElements.get(n)||customElements.define(n,Tl);break}})}const bg=Tl,yg=xg,vg=`@tailwind base;
|
|
3283
3287
|
@tailwind components;
|
|
3284
3288
|
@tailwind utilities;
|
|
3285
3289
|
@layer base {
|
|
@@ -3539,7 +3543,7 @@ ol.mdc-list.sc-xplor-badge-archived li.mdc-list-item.sc-xplor-badge-archived, ul
|
|
|
3539
3543
|
padding: 4px 12px;
|
|
3540
3544
|
border-radius: 16px;
|
|
3541
3545
|
display: inline-block;
|
|
3542
|
-
}`,
|
|
3546
|
+
}`,Ml=M(class extends T{constructor(){super(),this.__registerHost()}render(){return p(E,{key:"e898977f5a87755f614e9cec94885c1eb33f7f47"},p("span",{key:"c0db6423521d172f81f4d8de731dbfb5caf95917",class:"xplor-badge-archived"},"Archived"))}static get style(){return vg}},[2,"xplor-badge-archived"]);function kg(){if(typeof customElements>"u")return;["xplor-badge-archived"].forEach(n=>{switch(n){case"xplor-badge-archived":customElements.get(n)||customElements.define(n,Ml);break}})}const wg=Ml,_g=kg,Cg=`@tailwind base;
|
|
3543
3547
|
@tailwind components;
|
|
3544
3548
|
@tailwind utilities;
|
|
3545
3549
|
@layer base {
|
|
@@ -3799,7 +3803,7 @@ ol.mdc-list.sc-xplor-badge-deleted li.mdc-list-item.sc-xplor-badge-deleted, ul.m
|
|
|
3799
3803
|
padding: 4px 12px;
|
|
3800
3804
|
border-radius: 16px;
|
|
3801
3805
|
display: inline-block;
|
|
3802
|
-
}
|
|
3806
|
+
}`,Dl=M(class extends T{constructor(){super(),this.__registerHost()}render(){return p(E,{key:"07d61ee7c210ada3c3eaf2b0c0c91bb6747d39e6"},p("span",{key:"1535e3498d7e7b1d12438b835cb3da2efec112ff",class:"xplor-badge-deleted"},"Deleted"))}static get style(){return Cg}},[2,"xplor-badge-deleted"]);function Sg(){if(typeof customElements>"u")return;["xplor-badge-deleted"].forEach(n=>{switch(n){case"xplor-badge-deleted":customElements.get(n)||customElements.define(n,Dl);break}})}const Eg=Dl,Ig=Sg,$g=`@tailwind base;
|
|
3803
3807
|
@tailwind components;
|
|
3804
3808
|
@tailwind utilities;
|
|
3805
3809
|
@layer base {
|
|
@@ -4059,7 +4063,7 @@ ol.mdc-list.sc-xplor-badge-expired li.mdc-list-item.sc-xplor-badge-expired, ul.m
|
|
|
4059
4063
|
padding: 4px 12px;
|
|
4060
4064
|
border-radius: 16px;
|
|
4061
4065
|
display: inline-block;
|
|
4062
|
-
}`,
|
|
4066
|
+
}`,zl=M(class extends T{constructor(){super(),this.__registerHost()}render(){return p(E,{key:"28da2eebab84d7cb5ce6aa010d102c6b45b607d9"},p("span",{key:"879d02cf4052f13e3e5324be091bea5fa0849300",class:"xplor-badge-expired"},"Expired"))}static get style(){return $g}},[2,"xplor-badge-expired"]);function Tg(){if(typeof customElements>"u")return;["xplor-badge-expired"].forEach(n=>{switch(n){case"xplor-badge-expired":customElements.get(n)||customElements.define(n,zl);break}})}const Mg=zl,Dg=Tg,zg=`@tailwind base;
|
|
4063
4067
|
@tailwind components;
|
|
4064
4068
|
@tailwind utilities;
|
|
4065
4069
|
@layer base {
|
|
@@ -4319,7 +4323,7 @@ ol.mdc-list.sc-xplor-badge-inactive li.mdc-list-item.sc-xplor-badge-inactive, ul
|
|
|
4319
4323
|
padding: 4px 12px;
|
|
4320
4324
|
border-radius: 16px;
|
|
4321
4325
|
display: inline-block;
|
|
4322
|
-
}`,
|
|
4326
|
+
}`,Ol=M(class extends T{constructor(){super(),this.__registerHost()}render(){return p(E,{key:"f87a4a1d082c17102c5192ca1c064d636b13d803"},p("span",{key:"75aa909657eedd5b91d90cf0b71a59215e13b2c8",class:"xplor-badge-inactive"},"Inactive"))}static get style(){return zg}},[2,"xplor-badge-inactive"]);function Og(){if(typeof customElements>"u")return;["xplor-badge-inactive"].forEach(n=>{switch(n){case"xplor-badge-inactive":customElements.get(n)||customElements.define(n,Ol);break}})}const Ag=Ol,Lg=Og,Pg=`@tailwind base;
|
|
4323
4327
|
@tailwind components;
|
|
4324
4328
|
@tailwind utilities;
|
|
4325
4329
|
@layer base {
|
|
@@ -4579,7 +4583,7 @@ ol.mdc-list.sc-xplor-badge-recalled li.mdc-list-item.sc-xplor-badge-recalled, ul
|
|
|
4579
4583
|
padding: 4px 12px;
|
|
4580
4584
|
border-radius: 16px;
|
|
4581
4585
|
display: inline-block;
|
|
4582
|
-
}`,
|
|
4586
|
+
}`,Al=M(class extends T{constructor(){super(),this.__registerHost()}render(){return p(E,{key:"bf0879b3e61b3f732345c974185809bd78a57063"},p("span",{key:"f4cdf5ef2b1bf4910f0bbfc1bbefdee98ae09575",class:"xplor-badge-recalled"},"Recalled"))}static get style(){return Pg}},[2,"xplor-badge-recalled"]);function Rg(){if(typeof customElements>"u")return;["xplor-badge-recalled"].forEach(n=>{switch(n){case"xplor-badge-recalled":customElements.get(n)||customElements.define(n,Al);break}})}const Bg=Al,Ng=Rg,Fg=`@tailwind base;
|
|
4583
4587
|
@tailwind components;
|
|
4584
4588
|
@tailwind utilities;
|
|
4585
4589
|
@layer base {
|
|
@@ -4859,7 +4863,7 @@ ol.mdc-list.sc-xplor-badge-session-booking li.mdc-list-item.sc-xplor-badge-sessi
|
|
|
4859
4863
|
}
|
|
4860
4864
|
.xplor-badge-session-booking--waived.sc-xplor-badge-session-booking {
|
|
4861
4865
|
opacity: 0.5;
|
|
4862
|
-
}`,
|
|
4866
|
+
}`,Ll=M(class extends T{constructor(){super(),this.__registerHost()}getBookingTypeClass(){var n,e;const r=["xplor-badge-session-booking"];switch((n=this.booking)===null||n===void 0?void 0:n.type){case"absence":r.push("xplor-badge-session-booking--absent");break;case"attendance":r.push("xplor-badge-session-booking--attend");break;case"holiday":r.push("xplor-badge-session-booking--holiday");break;default:r.push("xplor-badge-session-booking--default");break}return!((e=this.item)===null||e===void 0)&&e.ccs_gap_fee_is_waived&&r.push("xplor-badge-session-booking--waived"),r.join(" ")}render(){return p(E,{key:"2de356577c682b61f7bab3df1963df5b23884a19"},p("span",{key:"810ab3316b54ada35c0352a5ae47f60a4590b986",class:this.getBookingTypeClass()},p("slot",{key:"7da46c8b9e18ee6a1553a088bea17494e0aee832"})))}static get style(){return Fg}},[6,"xplor-badge-session-booking",{booking:[16],item:[16]}]);function Hg(){if(typeof customElements>"u")return;["xplor-badge-session-booking"].forEach(n=>{switch(n){case"xplor-badge-session-booking":customElements.get(n)||customElements.define(n,Ll);break}})}const jg=Ll,Xg=Hg,Vg=`@tailwind base;
|
|
4863
4867
|
@tailwind components;
|
|
4864
4868
|
@tailwind utilities;
|
|
4865
4869
|
@layer base {
|
|
@@ -5119,7 +5123,7 @@ ol.mdc-list.sc-xplor-badge-upcoming li.mdc-list-item.sc-xplor-badge-upcoming, ul
|
|
|
5119
5123
|
padding: 4px 12px;
|
|
5120
5124
|
border-radius: 16px;
|
|
5121
5125
|
display: inline-block;
|
|
5122
|
-
}`,
|
|
5126
|
+
}`,Pl=M(class extends T{constructor(){super(),this.__registerHost()}render(){return p(E,{key:"e670e6d49428aae18b3a0f97c39a10745cb5a039"},p("span",{key:"dfbd77ac03b9b4779758963e62504450040243b4",class:"xplor-badge-upcoming"},"Upcoming"))}static get style(){return Vg}},[2,"xplor-badge-upcoming"]);function Wg(){if(typeof customElements>"u")return;["xplor-badge-upcoming"].forEach(n=>{switch(n){case"xplor-badge-upcoming":customElements.get(n)||customElements.define(n,Pl);break}})}const Ug=Pl,qg=Wg,Kg=`@tailwind base;
|
|
5123
5127
|
@tailwind components;
|
|
5124
5128
|
@tailwind utilities;
|
|
5125
5129
|
@layer base {
|
|
@@ -5379,7 +5383,7 @@ ol.mdc-list.sc-xplor-badge-waitlist li.mdc-list-item.sc-xplor-badge-waitlist, ul
|
|
|
5379
5383
|
padding: 4px 12px;
|
|
5380
5384
|
border-radius: 16px;
|
|
5381
5385
|
display: inline-block;
|
|
5382
|
-
}`,
|
|
5386
|
+
}`,Rl=M(class extends T{constructor(){super(),this.__registerHost()}render(){return p(E,{key:"150ff857e845f012a1fb6f8d04cf519b0e18c1dd"},p("span",{key:"00ef3af174c37039b23603a9d47fd7e30cf497b3",class:"xplor-badge-waitlist"},"Waitlist"))}static get style(){return Kg}},[2,"xplor-badge-waitlist"]);function Jg(){if(typeof customElements>"u")return;["xplor-badge-waitlist"].forEach(n=>{switch(n){case"xplor-badge-waitlist":customElements.get(n)||customElements.define(n,Rl);break}})}const Gg=Rl,Yg=Jg,Qg=`@tailwind base;
|
|
5383
5387
|
@tailwind components;
|
|
5384
5388
|
@tailwind utilities;
|
|
5385
5389
|
@layer base {
|
|
@@ -6459,7 +6463,7 @@ ol.mdc-list.sc-xplor-badge li.mdc-list-item.sc-xplor-badge, ul.mdc-list.sc-xplor
|
|
|
6459
6463
|
.xplor-badge--datatable.sc-xplor-badge {
|
|
6460
6464
|
padding: 8px 12px;
|
|
6461
6465
|
border-radius: 14px;
|
|
6462
|
-
}`,
|
|
6466
|
+
}`,Bl=M(class extends T{constructor(){super(),this.__registerHost(),this.backgroundColor="#e3f2fd",this.color="auto",this.threshold=130,this.variant="flat",this.size="medium",this.datatable=!1,this.text=""}calculateLuminance(n,e,r){const[o,i,a]=[n,e,r].map(s=>(s=s/255,s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4)));return .2126*o+.7152*i+.0722*a}parseColor(n){if(n.startsWith("#")){const r=n.replace("#","");if(r.length===3){const o=parseInt(r[0]+r[0],16),i=parseInt(r[1]+r[1],16),a=parseInt(r[2]+r[2],16);return{r:o,g:i,b:a}}else if(r.length===6){const o=parseInt(r.substring(0,2),16),i=parseInt(r.substring(2,4),16),a=parseInt(r.substring(4,6),16);return{r:o,g:i,b:a}}}const e=n.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);return e?{r:parseInt(e[1]),g:parseInt(e[2]),b:parseInt(e[3])}:null}calculateContrastingColor(n){const e=this.parseColor(n);return e?this.calculateLuminance(e.r,e.g,e.b)>.5?"#000000":"#ffffff":"#000000"}get cssVars(){const n={};return n["--xplor-badge-bg"]=this.backgroundColor,this.color==="auto"?n["--xplor-badge-color"]=this.calculateContrastingColor(this.backgroundColor):n["--xplor-badge-color"]=this.color,n}get computedClasses(){return{"xplor-badge":!0,[`xplor-badge--${this.variant}`]:!0,[`xplor-badge--${this.size}`]:!0,"xplor-badge--datatable":this.datatable}}render(){return p(E,{key:"4aadb0c86d68133c04ad829d14095aa5c9dba36e"},p("span",{key:"f0f4b465265cf55da555ad25d2ea478e7e8d75c0",class:this.computedClasses,style:this.cssVars},p("slot",{key:"3d6c7ab9d5b383b716c38adebf179d4a9d29ee82"},this.text)))}static get style(){return Qg}},[6,"xplor-badge",{backgroundColor:[1,"background-color"],color:[1],threshold:[2],variant:[1],size:[1],datatable:[4],text:[1]}]);function Zg(){if(typeof customElements>"u")return;["xplor-badge"].forEach(n=>{switch(n){case"xplor-badge":customElements.get(n)||customElements.define(n,Bl);break}})}const nu=Bl,eu=Zg,tu=`@tailwind base;
|
|
6463
6467
|
@tailwind components;
|
|
6464
6468
|
@tailwind utilities;
|
|
6465
6469
|
@layer base {
|
|
@@ -6745,7 +6749,7 @@ ol.mdc-list.sc-xplor-btn-back-to-parent li.mdc-list-item.sc-xplor-btn-back-to-pa
|
|
|
6745
6749
|
position: relative;
|
|
6746
6750
|
top: 0;
|
|
6747
6751
|
right: 0;
|
|
6748
|
-
}`,
|
|
6752
|
+
}`,Nl=M(class extends T{constructor(){super(),this.__registerHost(),this.back=k(this,"back"),this.size="2.25rem",this.inline=!1,this.bgColor="white",this.color="secondary",this.variant="tonal",this.ariaLabel="Back to parent",this.handleClick=()=>{this.back.emit()}}render(){const n={"xplor-btn-back-to-parent":!0,"xplor-btn-back-to-parent--inline":this.inline},e={"--btn-size":this.size};return p(E,{key:"3423fa1064a5527c1313e5e74f01093fbfdf9a5c"},p("button",{key:"362161229ce57836bb0bdcd3d6ce671669208d70",class:n,style:e,onClick:this.handleClick,"aria-label":this.ariaLabel},p("span",{key:"223cc632ce76b936f6129e39a1602123c89e4fc1",class:"xplor-btn-back-to-parent__icon"},"✕")))}static get style(){return tu}},[2,"xplor-btn-back-to-parent",{size:[1],inline:[4],bgColor:[1,"bg-color"],color:[1],variant:[1],ariaLabel:[1,"aria-label"]}]);function ru(){if(typeof customElements>"u")return;["xplor-btn-back-to-parent"].forEach(n=>{switch(n){case"xplor-btn-back-to-parent":customElements.get(n)||customElements.define(n,Nl);break}})}const ou=Nl,iu=ru,au=`@tailwind base;
|
|
6749
6753
|
@tailwind components;
|
|
6750
6754
|
@tailwind utilities;
|
|
6751
6755
|
@layer base {
|
|
@@ -7031,7 +7035,7 @@ ol.mdc-list.sc-xplor-btn-back li.mdc-list-item.sc-xplor-btn-back, ul.mdc-list.sc
|
|
|
7031
7035
|
opacity: 0.38;
|
|
7032
7036
|
cursor: not-allowed;
|
|
7033
7037
|
pointer-events: none;
|
|
7034
|
-
}`,
|
|
7038
|
+
}`,Fl=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorClick=k(this,"xplorClick"),this.color="secondary",this.minWidth="6.375rem",this.minHeight="3rem",this.gap="0.625rem",this.disabled=!1,this.handleClick=n=>{this.disabled||this.xplorClick.emit(n)}}render(){const n={"xplor-btn-back":!0,"xplor-btn-back--disabled":this.disabled},e={"--min-width":this.minWidth,"--min-height":this.minHeight,"--gap":this.gap};return p(E,{key:"11a49ee4557580e42bf35430829f95d4744c23c3"},p("button",{key:"52a8657c87b146ef5ecb0adf0388132a5bb2bf93",class:n,style:e,disabled:this.disabled,onClick:this.handleClick},p("span",{key:"6c399ed83f9779a3b0f2e2162b0e05e186f2ba1b",class:"xplor-btn-back__icon"},"‹"),p("span",{key:"05bc6d2cbbef85d33b6ed4225aa4fc45dc4cbe0f",class:"xplor-btn-back__text"},p("slot",{key:"61800e333b89fb55fe4fe638ce055870fce0e4fd"},"Back"))))}static get style(){return au}},[6,"xplor-btn-back",{color:[1],minWidth:[1,"min-width"],minHeight:[1,"min-height"],gap:[1],disabled:[4]}]);function su(){if(typeof customElements>"u")return;["xplor-btn-back"].forEach(n=>{switch(n){case"xplor-btn-back":customElements.get(n)||customElements.define(n,Fl);break}})}const lu=Fl,cu=su,du=`@tailwind base;
|
|
7035
7039
|
@tailwind components;
|
|
7036
7040
|
@tailwind utilities;
|
|
7037
7041
|
@layer base {
|
|
@@ -7381,7 +7385,7 @@ ol.mdc-list.sc-xplor-btn-icon li.mdc-list-item.sc-xplor-btn-icon, ul.mdc-list.sc
|
|
|
7381
7385
|
opacity: 0.38;
|
|
7382
7386
|
cursor: not-allowed;
|
|
7383
7387
|
pointer-events: none;
|
|
7384
|
-
}`,
|
|
7388
|
+
}`,Hl=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorClick=k(this,"xplorClick"),this.color="secondary",this.size="32",this.iconSize="18",this.variant="elevated",this.disabled=!1,this.handleClick=n=>{this.disabled||this.xplorClick.emit(n)}}render(){const n={"xplor-btn-icon":!0,[`xplor-btn-icon--${this.color}`]:!0,[`xplor-btn-icon--${this.variant}`]:!0,"xplor-btn-icon--disabled":this.disabled},e={"--btn-size":typeof this.size=="number"?`${this.size}px`:this.size,"--icon-size":typeof this.iconSize=="number"?`${this.iconSize}px`:this.iconSize};return p(E,{key:"d4312cd0ef1b871a49fc252fdc913c3a089a2d33"},p("button",{key:"5b9b112c5b1c70ea82c6c615c24403ce514753a0",class:n,style:e,disabled:this.disabled,onClick:this.handleClick,"aria-label":this.ariaLabel},p("span",{key:"1736857fad944996c0ad380189edbf5e30c013f0",class:"xplor-btn-icon__content"},p("slot",{key:"8bd0e864ae2469dfa4fe48c2bd4215a38f8db182"}))))}static get style(){return du}},[6,"xplor-btn-icon",{color:[1],size:[8],iconSize:[8,"icon-size"],variant:[1],disabled:[4],ariaLabel:[1,"aria-label"]}]);function pu(){if(typeof customElements>"u")return;["xplor-btn-icon"].forEach(n=>{switch(n){case"xplor-btn-icon":customElements.get(n)||customElements.define(n,Hl);break}})}const hu=Hl,gu=pu,uu=`@tailwind base;
|
|
7385
7389
|
@tailwind components;
|
|
7386
7390
|
@tailwind utilities;
|
|
7387
7391
|
@layer base {
|
|
@@ -7688,7 +7692,7 @@ ol.mdc-list.sc-xplor-btn-menu li.mdc-list-item.sc-xplor-btn-menu, ul.mdc-list.sc
|
|
|
7688
7692
|
opacity: 0.38;
|
|
7689
7693
|
cursor: not-allowed;
|
|
7690
7694
|
pointer-events: none;
|
|
7691
|
-
}`,
|
|
7695
|
+
}`,jl=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorClick=k(this,"xplorClick"),this.label="",this.options=[],this.hiddenKeys=[],this.disabledKeys=[],this.color="secondary",this.density="default",this.show=!1,this.focusedIndex=-1,this.handleOutsideClick=n=>{this.menuRef&&!this.menuRef.contains(n.target)&&(this.show=!1)},this.toggleMenu=()=>{this.show=!this.show,this.show||(this.focusedIndex=-1)},this.handleClickOption=n=>{var e;this.xplorClick.emit(n),this.show=!1,this.focusedIndex=-1,(e=this.triggerBtnRef)===null||e===void 0||e.focus()},this.isHidden=n=>n!==null&&this.hiddenKeys.includes(n),this.isDisabled=n=>n!==null&&this.disabledKeys.includes(n)}componentDidLoad(){document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){document.removeEventListener("click",this.handleOutsideClick)}getVisibleOptions(){return this.options.map((n,e)=>({option:n,key:n.key||String(e)})).filter(({key:n})=>!this.isHidden(n))}focusMenuItem(n){if(this.menuRef){const e=this.menuRef.querySelectorAll('[role="menuitem"]');e[n]&&e[n].focus()}}handleKeyDown(n){var e,r;if(!this.show&&(n.key==="ArrowDown"||n.key==="Enter"||n.key===" ")){const a=n.target;(a===this.triggerBtnRef||!((e=this.el.querySelector('[slot="activator"]'))===null||e===void 0)&&e.contains(a))&&n.key==="ArrowDown"&&(n.preventDefault(),this.show=!0,this.focusedIndex=0,requestAnimationFrame(()=>this.focusMenuItem(0)));return}if(!this.show)return;const o=this.getVisibleOptions(),i=o.length;switch(n.key){case"ArrowDown":n.preventDefault(),this.focusedIndex=this.focusedIndex<i-1?this.focusedIndex+1:0,this.focusMenuItem(this.focusedIndex);break;case"ArrowUp":n.preventDefault(),this.focusedIndex=this.focusedIndex>0?this.focusedIndex-1:i-1,this.focusMenuItem(this.focusedIndex);break;case"Escape":n.preventDefault(),this.show=!1,this.focusedIndex=-1,(r=this.triggerBtnRef)===null||r===void 0||r.focus();break;case"Enter":case" ":if(n.preventDefault(),this.focusedIndex>=0&&this.focusedIndex<i){const{option:a,key:s}=o[this.focusedIndex];this.isDisabled(s)||this.handleClickOption(a)}break;case"Home":n.preventDefault(),this.focusedIndex=0,this.focusMenuItem(this.focusedIndex);break;case"End":n.preventDefault(),this.focusedIndex=i-1,this.focusMenuItem(this.focusedIndex);break;case"Tab":this.show=!1,this.focusedIndex=-1;break}}render(){const n="xplor-btn-menu-list";let e=0;return p(E,{key:"20b1a4d54b992d5ea4b1a4cd8fbaa5699b1bc6ab"},p("div",{key:"e23725f6fa432e19b59a3c0809706df45df02def",class:"xplor-btn-menu",ref:r=>this.menuRef=r},p("slot",{key:"ed385faab26b9a1bf83ed583261b0d22744a5b10",name:"activator"},p("button",{key:"f0539b0092489e356b087cddd67bfb84cb31acf8",ref:r=>this.triggerBtnRef=r,class:"xplor-btn-menu__button",onClick:this.toggleMenu,"aria-haspopup":"menu","aria-expanded":this.show?"true":"false","aria-controls":this.show?n:void 0,"aria-label":this.ariaLabel||this.label||"Menu"},p("span",{key:"b1126eb8ffc12a89b3dd1a83afd5f644226496ee"},this.label),p("span",{key:"f9053a73065841d35278612e8f9d5345b3e1daf4",class:"xplor-btn-menu__icon","aria-hidden":"true"},"▼"))),this.show&&p("div",{key:"7b294e8b3702051c2adc317736d9bb3085137f27",class:"xplor-btn-menu__list",role:"menu",id:n,"aria-label":this.ariaLabel||this.label||"Menu"},this.options.map((r,o)=>{const i=r.key||String(o);if(this.isHidden(i))return null;const a=this.isDisabled(i),s=e++;return p("div",{key:i,role:"menuitem",tabindex:s===this.focusedIndex?0:-1,"aria-disabled":a?"true":void 0,class:{"xplor-btn-menu__item":!0,"xplor-btn-menu__item--disabled":a},onClick:()=>!a&&this.handleClickOption(r)},p("slot",{name:i},r.label||""))}))))}get el(){return this}static get style(){return uu}},[6,"xplor-btn-menu",{ariaLabel:[1,"aria-label"],label:[1],options:[16],hiddenKeys:[16,"hidden-keys"],disabledKeys:[16,"disabled-keys"],color:[1],density:[1],show:[32],focusedIndex:[32]},[[0,"keydown","handleKeyDown"]]]);function fu(){if(typeof customElements>"u")return;["xplor-btn-menu"].forEach(n=>{switch(n){case"xplor-btn-menu":customElements.get(n)||customElements.define(n,jl);break}})}const mu=jl,xu=fu,bu=`@tailwind base;
|
|
7692
7696
|
@tailwind components;
|
|
7693
7697
|
@tailwind utilities;
|
|
7694
7698
|
@layer base {
|
|
@@ -7946,7 +7950,7 @@ ol.mdc-list.sc-xplor-btn-toggle-group li.mdc-list-item.sc-xplor-btn-toggle-group
|
|
|
7946
7950
|
flex-wrap: wrap;
|
|
7947
7951
|
gap: 0.5rem;
|
|
7948
7952
|
height: auto;
|
|
7949
|
-
}`,
|
|
7953
|
+
}`,Xl=M(class extends T{constructor(){super(),this.__registerHost(),this.multiple=!1,this.density="default"}render(){return p(E,{key:"9f4c71cf767b466ed9116c30d3befde6d794122d"},p("div",{key:"8004544207dce87f5eebbb56fa2829a17adcb5e6",class:"xplor-btn-toggle-group",role:"group"},p("slot",{key:"3aa75d08de1bc105295b5204273c34697b46ef87"})))}static get style(){return bu}},[6,"xplor-btn-toggle-group",{multiple:[4],density:[1]}]);function yu(){if(typeof customElements>"u")return;["xplor-btn-toggle-group"].forEach(n=>{switch(n){case"xplor-btn-toggle-group":customElements.get(n)||customElements.define(n,Xl);break}})}const vu=Xl,ku=yu,wu=`@tailwind base;
|
|
7950
7954
|
@tailwind components;
|
|
7951
7955
|
@tailwind utilities;
|
|
7952
7956
|
@layer base {
|
|
@@ -8240,7 +8244,7 @@ ol.mdc-list.sc-xplor-btn-toggle-secondary li.mdc-list-item.sc-xplor-btn-toggle-s
|
|
|
8240
8244
|
}
|
|
8241
8245
|
.xplor-btn-toggle-secondary.sc-xplor-btn-toggle-secondary:hover:not(.xplor-btn-toggle-secondary--disabled).xplor-btn-toggle-secondary--active {
|
|
8242
8246
|
background-color: #D0EBD2;
|
|
8243
|
-
}`,
|
|
8247
|
+
}`,Vl=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorToggle=k(this,"xplorToggle"),this.active=!1,this.disabled=!1,this.inactiveOutlined=!1,this.handleClick=()=>{this.disabled||(this.active=!this.active,this.xplorToggle.emit(this.active))}}render(){const n={"xplor-btn-toggle-secondary":!0,"xplor-btn-toggle-secondary--active":this.active,"xplor-btn-toggle-secondary--disabled":this.disabled,"xplor-btn-toggle-secondary--inactive-outlined":this.inactiveOutlined&&!this.active};return p(E,{key:"52551538bd39aedb16ab80e6f7e82d922128df31"},p("button",{key:"8d527b973bef5aebaf437cd962421572e0005c11",class:n,disabled:this.disabled,onClick:this.handleClick,"aria-pressed":this.active?"true":"false"},p("slot",{key:"1f8da5c88d120cd82b0e91a40fa76f6f5aaa006b"})))}static get style(){return wu}},[6,"xplor-btn-toggle-secondary",{active:[1028],disabled:[4],inactiveOutlined:[4,"inactive-outlined"]}]);function _u(){if(typeof customElements>"u")return;["xplor-btn-toggle-secondary"].forEach(n=>{switch(n){case"xplor-btn-toggle-secondary":customElements.get(n)||customElements.define(n,Vl);break}})}const Cu=Vl,Su=_u,Eu=`@tailwind base;
|
|
8244
8248
|
@tailwind components;
|
|
8245
8249
|
@tailwind utilities;
|
|
8246
8250
|
@layer base {
|
|
@@ -8532,7 +8536,7 @@ ol.mdc-list.sc-xplor-btn-toggle li.mdc-list-item.sc-xplor-btn-toggle, ul.mdc-lis
|
|
|
8532
8536
|
}
|
|
8533
8537
|
.xplor-btn-toggle.sc-xplor-btn-toggle:hover:not(.xplor-btn-toggle--disabled).xplor-btn-toggle--active {
|
|
8534
8538
|
background-color: #D0EBD2;
|
|
8535
|
-
}`,
|
|
8539
|
+
}`,Wl=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorToggle=k(this,"xplorToggle"),this.active=!1,this.color="secondary",this.disabled=!1,this.inactiveOutlined=!1,this.handleClick=()=>{this.disabled||(this.active=!this.active,this.xplorToggle.emit(this.active))}}render(){const n={"xplor-btn-toggle":!0,"xplor-btn-toggle--active":this.active,"xplor-btn-toggle--disabled":this.disabled,"xplor-btn-toggle--inactive-outlined":this.inactiveOutlined&&!this.active};return p(E,{key:"0df89df461cff00e400c8519d01355e02944a09b"},p("button",{key:"3b3ae840b9724bc999729e0596166c6247319d3d",class:n,disabled:this.disabled,onClick:this.handleClick,"aria-pressed":this.active?"true":"false"},p("slot",{key:"468875beb8d19c779c6c1f29b016e4d870f8c563"})))}static get style(){return Eu}},[6,"xplor-btn-toggle",{active:[1028],color:[1],disabled:[4],inactiveOutlined:[4,"inactive-outlined"]}]);function Iu(){if(typeof customElements>"u")return;["xplor-btn-toggle"].forEach(n=>{switch(n){case"xplor-btn-toggle":customElements.get(n)||customElements.define(n,Wl);break}})}const $u=Wl,Tu=Iu,Mu=`@tailwind base;
|
|
8536
8540
|
@tailwind components;
|
|
8537
8541
|
@tailwind utilities;
|
|
8538
8542
|
@layer base {
|
|
@@ -9780,7 +9784,7 @@ ol.mdc-list.sc-xplor-button li.mdc-list-item.sc-xplor-button, ul.mdc-list.sc-xpl
|
|
|
9780
9784
|
.x-button.disabled.x-button--icon-only.sc-xplor-button, .x-button.disabled.x-button--with-icon.sc-xplor-button {
|
|
9781
9785
|
cursor: not-allowed;
|
|
9782
9786
|
opacity: 0.6;
|
|
9783
|
-
}`,
|
|
9787
|
+
}`,Ul=M(class extends T{constructor(){super(),this.__registerHost(),this.type="secondary",this.mode="pg",this.ariaLabel=null,this.disabled=!1,this.fullWidth=!1,this.fullWidthAttr=!1,this.iconPosition=null,this.icon="+"}renderIcon(){return this.icon==="svg"&&this.iconSvg?p("span",{class:"button-icon button-icon--svg ",innerHTML:this.iconSvg}):p("span",{class:"button-icon"},this.icon)}render(){const n=this.fullWidth||this.fullWidthAttr,e=!this.text&&this.iconPosition!==null,r=this.iconPosition!==null;return p(E,{key:"d338a1b17a25fc843820a5dde83a38663a6ebb2e",class:{"x-button--full-width":n}},p("slot",{key:"5a6e640c188b9b9e1165add358cb71b97c319dd0"},p("button",{key:"c699bebecfac65bb0705f6397891afe22105b12c",role:"button",class:Object.assign({"x-button":!0,[this.type]:!0,"x-button--full-width":n,"x-button--icon-only":e,"x-button--with-icon":r&&!e,"x-button--icon-start":this.iconPosition==="start"&&!e,"x-button--icon-end":this.iconPosition==="end"&&!e},this.styles?{[this.styles]:!0}:{}),onClick:()=>this.clickAction&&this.clickAction(),"aria-label":this.ariaLabel,"aria-disabled":this.disabled?"true":null,disabled:this.disabled},r&&this.iconPosition==="start"&&this.renderIcon(),this.text&&p("span",{key:"d830e09d660f0260e83a4eca4cf41ab49aa4a490",class:"button-text"},this.text),r&&this.iconPosition==="end"&&this.renderIcon())))}static get style(){return Mu}},[6,"xplor-button",{text:[1],type:[1],mode:[1],size:[1],styles:[1],clickAction:[16,"click-action"],ariaLabel:[1,"aria-label"],disabled:[4],fullWidth:[516,"full-width"],fullWidthAttr:[4,"fullwidth"],iconPosition:[1,"icon-position"],icon:[1],iconSvg:[1,"icon-svg"]}]);function Lt(){if(typeof customElements>"u")return;["xplor-button"].forEach(n=>{switch(n){case"xplor-button":customElements.get(n)||customElements.define(n,Ul);break}})}const Du=`@tailwind base;
|
|
9784
9788
|
@tailwind components;
|
|
9785
9789
|
@tailwind utilities;
|
|
9786
9790
|
@layer base {
|
|
@@ -10096,7 +10100,7 @@ ol.mdc-list.sc-xplor-tooltip li.mdc-list-item.sc-xplor-tooltip, ul.mdc-list.sc-x
|
|
|
10096
10100
|
|
|
10097
10101
|
.tooltip--right.sc-xplor-tooltip .tooltip__arrow.sc-xplor-tooltip {
|
|
10098
10102
|
box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.1);
|
|
10099
|
-
}`;let
|
|
10103
|
+
}`;let zu=0;const ql=M(class extends T{constructor(){super(),this.__registerHost(),this.position="top",this.trigger="hover",this.arrow=!0,this.open=!1,this.disabled=!1,this.tooltipStyle={},this.arrowStyle={},this.tooltipId=`xplor-tooltip-${++zu}`,this.handleMouseEnter=()=>{this.disabled||(this.hideTimeout&&clearTimeout(this.hideTimeout),this.showTooltip())},this.handleMouseLeave=()=>{this.disabled||(this.hideTimeout=setTimeout(()=>{this.hideTooltip()},100))},this.handleFocusIn=()=>{this.disabled||this.showTooltip()},this.handleFocusOut=()=>{this.disabled||this.hideTooltip()},this.handleClick=()=>{this.disabled||this.trigger==="click"&&(this.open=!this.open,this.open&&requestAnimationFrame(()=>this.updatePosition()))}}componentDidLoad(){this.trigger==="hover"&&this.setupHoverListeners()}disconnectedCallback(){this.cleanupListeners(),this.hideTimeout&&clearTimeout(this.hideTimeout)}setupHoverListeners(){this.triggerEl&&(this.triggerEl.addEventListener("mouseenter",this.handleMouseEnter),this.triggerEl.addEventListener("mouseleave",this.handleMouseLeave),this.triggerEl.addEventListener("focusin",this.handleFocusIn),this.triggerEl.addEventListener("focusout",this.handleFocusOut))}cleanupListeners(){this.triggerEl&&(this.triggerEl.removeEventListener("mouseenter",this.handleMouseEnter),this.triggerEl.removeEventListener("mouseleave",this.handleMouseLeave),this.triggerEl.removeEventListener("focusin",this.handleFocusIn),this.triggerEl.removeEventListener("focusout",this.handleFocusOut))}handleDocumentClick(n){if(this.trigger==="click"&&this.open){const e=n.target;this.el.contains(e)||(this.open=!1)}}showTooltip(){this.open=!0,requestAnimationFrame(()=>this.updatePosition())}hideTooltip(){this.open=!1}updatePosition(){if(!this.triggerEl||!this.tooltipEl)return;const n=this.triggerEl.getBoundingClientRect(),e=this.tooltipEl.getBoundingClientRect(),r=8,o=this.arrow?6:0;let i=0,a=0,s="",l="",c="";switch(this.position){case"top":i=n.top-e.height-r-o,a=n.left+n.width/2-e.width/2,s="100%",l="50%",c="translateX(-50%) rotate(45deg)";break;case"bottom":i=n.bottom+r+o,a=n.left+n.width/2-e.width/2,s="-6px",l="50%",c="translateX(-50%) rotate(45deg)";break;case"left":i=n.top+n.height/2-e.height/2,a=n.left-e.width-r-o,s="50%",l="100%",c="translateY(-50%) rotate(45deg)";break;case"right":i=n.top+n.height/2-e.height/2,a=n.right+r+o,s="50%",l="-6px",c="translateY(-50%) rotate(45deg)";break}const d=8;a<d?a=d:a+e.width>window.innerWidth-d&&(a=window.innerWidth-e.width-d),i<d?i=d:i+e.height>window.innerHeight-d&&(i=window.innerHeight-e.height-d),this.tooltipStyle={top:`${i}px`,left:`${a}px`},this.arrowStyle={top:s,left:l,transform:c}}render(){return p(E,{key:"aa588e55e6f61fdc836e6463940837ee9b01bff0"},p("div",{key:"8aa1430d9762baccfa60341362c08a37db894433",class:"tooltip-trigger",ref:n=>this.triggerEl=n,onClick:this.handleClick,"aria-describedby":this.open?this.tooltipId:void 0},p("slot",{key:"a12f087b5025c462f4c31a7d38d642ac133dab13",name:"trigger"})),this.open&&p("div",{key:"357ee3a461a83df7ef6b4c7bb693e88e24aae0df",class:{tooltip:!0,[`tooltip--${this.position}`]:!0},style:this.tooltipStyle,ref:n=>this.tooltipEl=n,role:"tooltip",id:this.tooltipId},p("div",{key:"2845a038bd1964a7237d82d48aed518b112d5973",class:"tooltip__content"},p("slot",{key:"70ac6bc962d70e8f68b1be63ae3586bd6f3be46d"},this.content)),this.arrow&&p("div",{key:"2858ec182c4c4cafd5f8367b9a5578077c1250b4",class:"tooltip__arrow",style:this.arrowStyle})))}get el(){return this}static get style(){return Du}},[6,"xplor-tooltip",{position:[1],trigger:[1],arrow:[4],open:[1028],content:[1],disabled:[4],tooltipStyle:[32],arrowStyle:[32]},[[4,"click","handleDocumentClick"]]]);function Kl(){if(typeof customElements>"u")return;["xplor-tooltip"].forEach(n=>{switch(n){case"xplor-tooltip":customElements.get(n)||customElements.define(n,ql);break}})}const Ou=`@tailwind base;
|
|
10100
10104
|
@tailwind components;
|
|
10101
10105
|
@tailwind utilities;
|
|
10102
10106
|
@layer base {
|
|
@@ -10347,7 +10351,7 @@ ol.mdc-list.sc-xplor-btn-tooltip li.mdc-list-item.sc-xplor-btn-tooltip, ul.mdc-l
|
|
|
10347
10351
|
|
|
10348
10352
|
.sc-xplor-btn-tooltip-h {
|
|
10349
10353
|
display: inline-block;
|
|
10350
|
-
}`,
|
|
10354
|
+
}`,Jl=M(class extends T{constructor(){super(),this.__registerHost(),this.tooltipPosition="top",this.type="primary",this.disabled=!1}render(){return p(E,{key:"6d43dae5717d346c8a9ffa210f79bd9d74d8d6a9"},p("xplor-tooltip",{key:"a5dd7d12066e3fb08334463cc7410d5cdde5158b",position:this.tooltipPosition,content:this.tooltipText,trigger:"hover",arrow:!0,disabled:this.disabled},p("xplor-button",{key:"83e0ac08cfafeeadd25c23e682af15faa2cc81de",slot:"trigger",text:this.text,type:this.type,mode:this.mode,"icon-position":this.iconPosition},p("slot",{key:"e994ce16062426a41f67d92dfb0be8f54acceff1"}))))}static get style(){return Ou}},[6,"xplor-btn-tooltip",{text:[1],tooltipText:[1,"tooltip-text"],tooltipPosition:[1,"tooltip-position"],type:[1],mode:[1],iconPosition:[1,"icon-position"],disabled:[4]}]);function Au(){if(typeof customElements>"u")return;["xplor-btn-tooltip","xplor-button","xplor-tooltip"].forEach(n=>{switch(n){case"xplor-btn-tooltip":customElements.get(n)||customElements.define(n,Jl);break;case"xplor-button":customElements.get(n)||Lt();break;case"xplor-tooltip":customElements.get(n)||Kl();break}})}const Lu=Jl,Pu=Au,Ru=Ul,Bu=Lt,Nu=`@tailwind base;
|
|
10351
10355
|
@tailwind components;
|
|
10352
10356
|
@tailwind utilities;
|
|
10353
10357
|
@layer base {
|
|
@@ -11550,7 +11554,7 @@ ol.mdc-list.sc-xplor-canvas-editor li.mdc-list-item.sc-xplor-canvas-editor, ul.m
|
|
|
11550
11554
|
--canvas-btn-active-bg: rgba(33, 150, 243, 0.2);
|
|
11551
11555
|
--canvas-btn-active-color: var(--color-primary-300, var(--color-primary-300, #64b5f6));
|
|
11552
11556
|
--handle-fill: #1e1e2e;
|
|
11553
|
-
}`;let Pu=0;const Kl=M(class extends ${constructor(){super(),this.__registerHost(),this.xplorShapeAdd=k(this,"xplorShapeAdd"),this.xplorShapeRemove=k(this,"xplorShapeRemove"),this.xplorShapeChange=k(this,"xplorShapeChange"),this.componentId=`xplor-canvas-${++Pu}`,this.isDrawing=!1,this.drawStart=null,this.isResizing=!1,this.resizeHandle=null,this.resizeStart=null,this.width=800,this.height=500,this.tool="select",this.shapes=[],this.selectedId=null,this.activeTool="select",this.draftShape=null,this.onSvgMouseDown=n=>{const e=n.target,r=e===this.svgEl||e.classList.contains("xplor-canvas__bg");if(this.activeTool==="select"){r&&(this.selectedId=null);return}if(!r)return;const o=this.getSvgPoint(n);this.isDrawing=!0,this.drawStart=o,this.draftShape={id:"__draft__",type:this.activeTool,x:o.x,y:o.y,width:0,height:0,fill:"rgba(33, 150, 243, 0.15)",stroke:"#2196f3"},n.preventDefault()},this.onSvgMouseMove=n=>{if(!this.isDrawing||!this.drawStart||!this.draftShape)return;const e=this.getSvgPoint(n),r=Math.min(e.x,this.drawStart.x),o=Math.min(e.y,this.drawStart.y),i=Math.abs(e.x-this.drawStart.x),a=Math.abs(e.y-this.drawStart.y);this.draftShape=Object.assign(Object.assign({},this.draftShape),{x:r,y:o,width:i,height:a})},this.onSvgMouseUp=n=>{if(!this.isDrawing||!this.draftShape){this.isDrawing=!1;return}if(this.isDrawing=!1,this.draftShape.width<5||this.draftShape.height<5){this.draftShape=null,this.drawStart=null;return}const e=Object.assign(Object.assign({},this.draftShape),{id:this.generateId(),fill:"rgba(33, 150, 243, 0.25)",stroke:"#1976d2"});this.shapes=[...this.shapes,e],this.draftShape=null,this.drawStart=null,this.xplorShapeAdd.emit(e)},this.onShapeClick=(n,e)=>{this.activeTool==="select"&&(n.stopPropagation(),this.selectedId=e.id)},this.onResizeHandleMouseDown=(n,e)=>{n.stopPropagation(),n.preventDefault();const r=this.shapes.find(s=>s.id===this.selectedId);if(!r)return;const o=this.getSvgPoint(n);this.isResizing=!0,this.resizeHandle=e,this.resizeStart={x:o.x,y:o.y,shape:Object.assign({},r)};const i=s=>this.onResizeMouseMove(s),a=s=>{this.onResizeMouseUp(s),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",a)};window.addEventListener("mousemove",i),window.addEventListener("mouseup",a)},this.onResizeMouseMove=n=>{if(!this.isResizing||!this.resizeStart||!this.resizeHandle)return;const e=this.getSvgPoint(n),r=e.x-this.resizeStart.x,o=e.y-this.resizeStart.y,i=this.resizeStart.shape,a=10;let{x:s,y:l,width:c,height:d}=i;if(this.resizeHandle.includes("e")&&(c=Math.max(a,i.width+r)),this.resizeHandle.includes("w")){const h=Math.max(a,i.width-r);s=i.x+(i.width-h),c=h}if(this.resizeHandle.includes("s")&&(d=Math.max(a,i.height+o)),this.resizeHandle.includes("n")){const h=Math.max(a,i.height-o);l=i.y+(i.height-h),d=h}this.shapes=this.shapes.map(h=>h.id===this.selectedId?Object.assign(Object.assign({},h),{x:s,y:l,width:c,height:d}):h)},this.onResizeMouseUp=n=>{if(!this.isResizing)return;this.isResizing=!1,this.resizeHandle=null,this.resizeStart=null;const e=this.shapes.find(r=>r.id===this.selectedId);e&&this.xplorShapeChange.emit(Object.assign({},e))},this.onKeyDown=n=>{(n.key==="Delete"||n.key==="Backspace")&&(n.preventDefault(),this.deleteSelected())}}componentWillLoad(){this.activeTool=this.tool}async clearAll(){this.shapes=[],this.selectedId=null}async getShapes(){return[...this.shapes]}generateId(){return`shape-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}getSvgPoint(n){const e=this.svgEl.getBoundingClientRect();return{x:Math.max(0,Math.min(this.width,n.clientX-e.left)),y:Math.max(0,Math.min(this.height,n.clientY-e.top))}}setActiveTool(n){this.activeTool=n,this.draftShape=null,this.isDrawing=!1}deleteSelected(){if(!this.selectedId)return;const n=this.selectedId;this.shapes=this.shapes.filter(e=>e.id!==n),this.selectedId=null,this.xplorShapeRemove.emit(n)}renderShape(n,e=!1){const o={class:{"xplor-canvas__shape":!0,"xplor-canvas__shape--selected":!e&&n.id===this.selectedId,"xplor-canvas__shape--draft":e},fill:n.fill,stroke:n.stroke,"stroke-width":"2",style:{cursor:this.activeTool==="select"&&!e?"pointer":"default"},onClick:e?void 0:i=>this.onShapeClick(i,n)};return n.type==="rect"?p("rect",Object.assign({},o,{x:n.x,y:n.y,width:n.width,height:n.height,rx:"2"})):n.type==="circle"?p("ellipse",Object.assign({},o,{cx:n.x+n.width/2,cy:n.y+n.height/2,rx:n.width/2,ry:n.height/2})):n.type==="line"?p("line",Object.assign({},o,{x1:n.x,y1:n.y,x2:n.x+n.width,y2:n.y+n.height,fill:"none"})):null}renderSelectionOverlay(n){const e={class:"xplor-canvas__selection-overlay",stroke:"var(--selection-color, #2196f3)","stroke-dasharray":"5,3","stroke-width":"2",fill:"none",style:{pointerEvents:"none"}};return n.type==="line"?p("line",Object.assign({},e,{x1:n.x,y1:n.y,x2:n.x+n.width,y2:n.y+n.height})):n.type==="circle"?p("ellipse",Object.assign({},e,{cx:n.x+n.width/2,cy:n.y+n.height/2,rx:n.width/2,ry:n.height/2})):p("rect",Object.assign({},e,{x:n.x,y:n.y,width:n.width,height:n.height,rx:"2"}))}renderResizeHandles(n){const{x:e,y:r,width:o,height:i}=n,a=e+o/2,s=r+i/2;return[{name:"nw",cx:e,cy:r,cursor:"nwse-resize"},{name:"n",cx:a,cy:r,cursor:"ns-resize"},{name:"ne",cx:e+o,cy:r,cursor:"nesw-resize"},{name:"e",cx:e+o,cy:s,cursor:"ew-resize"},{name:"se",cx:e+o,cy:r+i,cursor:"nwse-resize"},{name:"s",cx:a,cy:r+i,cursor:"ns-resize"},{name:"sw",cx:e,cy:r+i,cursor:"nesw-resize"},{name:"w",cx:e,cy:s,cursor:"ew-resize"}].map(c=>c("circle",{key:c.name,class:"xplor-canvas__handle",cx:c.cx,cy:c.cy,r:"var(--handle-size, 5)",style:{cursor:c.cursor},onMouseDown:d=>this.onResizeHandleMouseDown(d,c.name),"aria-label":`Resize ${c.name.toUpperCase()} handle`,role:"button"}))}renderToolbar(){const n=[{id:"select",label:"Select tool",icon:p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M4 0 L20 12 L12.5 14.5 L10 24 Z"}))},{id:"rect",label:"Rectangle tool",icon:p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},p("rect",{x:"3",y:"3",width:"18",height:"18",rx:"1"}))},{id:"circle",label:"Circle / Ellipse tool",icon:p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},p("ellipse",{cx:"12",cy:"12",rx:"9",ry:"9"}))},{id:"line",label:"Line tool",icon:p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},p("line",{x1:"3",y1:"21",x2:"21",y2:"3"}))}];return p("div",{class:"xplor-canvas__toolbar",role:"toolbar","aria-label":"Canvas drawing tools",id:`${this.componentId}-toolbar`},p("div",{class:"xplor-canvas__toolbar-group",role:"group","aria-label":"Drawing tools"},n.map(e=>p("button",{type:"button",key:e.id,class:{"xplor-canvas__toolbar-btn":!0,"xplor-canvas__toolbar-btn--active":this.activeTool===e.id},"aria-label":e.label,"aria-pressed":String(this.activeTool===e.id),title:e.label,onClick:()=>this.setActiveTool(e.id)},e.icon))),p("div",{class:"xplor-canvas__toolbar-divider","aria-hidden":"true"}),p("div",{class:"xplor-canvas__toolbar-group",role:"group","aria-label":"Canvas actions"},p("button",{type:"button",class:{"xplor-canvas__toolbar-btn":!0,"xplor-canvas__toolbar-btn--danger":!!this.selectedId},"aria-label":"Delete selected shape",title:"Delete selected (Del)",disabled:!this.selectedId,onClick:()=>this.deleteSelected()},p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}))),p("button",{type:"button",class:"xplor-canvas__toolbar-btn","aria-label":"Clear all shapes",title:"Clear all",onClick:()=>this.clearAll()},p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z"}),p("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})))))}render(){const n=this.selectedId?this.shapes.find(r=>r.id===this.selectedId):null,e=this.activeTool!=="select"?"crosshair":"default";return p(E,{key:"14f6878d3a4a6de64d1862ab998f2acdf00004d5"},p("div",{key:"62a4fff983faeea8884d30df8a3bc3e39e6931a6",class:"xplor-canvas",role:"application","aria-label":"Canvas editor","aria-describedby":`${this.componentId}-desc`,tabIndex:0,onKeyDown:this.onKeyDown},p("span",{key:"cb962f76307036784990f491e9b55f38baa0b660",id:`${this.componentId}-desc`,class:"xplor-canvas__sr-only"},"Interactive canvas editor. Use toolbar to select a drawing tool, then click and drag on the canvas to draw shapes. Press Delete to remove a selected shape."),this.renderToolbar(),p("div",{key:"e46429cfb82d2804ad97f474469e307d4cedc61a",class:"xplor-canvas__svg-wrapper"},p("svg",{key:"01f59f5ad95af1854ce8883b79fbcb382b8c910f",ref:r=>this.svgEl=r,class:"xplor-canvas__svg",width:this.width,height:this.height,style:{cursor:e},"aria-label":`Drawing canvas, ${this.shapes.length} shape${this.shapes.length!==1?"s":""}`,role:"img",onMouseDown:this.onSvgMouseDown,onMouseMove:this.onSvgMouseMove,onMouseUp:this.onSvgMouseUp},p("rect",{key:"831a519b540b5dd36c15edec85ad67bcb6d1dc03",class:"xplor-canvas__bg",x:"0",y:"0",width:this.width,height:this.height,fill:"transparent"}),this.shapes.map(r=>this.renderShape(r)),n&&this.renderSelectionOverlay(n),n&&this.activeTool==="select"&&this.renderResizeHandles(n),this.draftShape&&this.renderShape(this.draftShape,!0))),p("div",{key:"5758ccf14f88614a1732085e287bad7f29ea0030",class:"xplor-canvas__sr-only","aria-live":"polite","aria-atomic":"true"},this.shapes.length>0?`Canvas contains ${this.shapes.length} shape${this.shapes.length!==1?"s":""}.`:"Canvas is empty.")))}get el(){return this}static get style(){return Lu}},[2,"xplor-canvas-editor",{width:[2],height:[2],tool:[1],shapes:[32],selectedId:[32],activeTool:[32],draftShape:[32],clearAll:[64],getShapes:[64]}]);function Ru(){if(typeof customElements>"u")return;["xplor-canvas-editor"].forEach(n=>{switch(n){case"xplor-canvas-editor":customElements.get(n)||customElements.define(n,Kl);break}})}const Bu=Kl,Nu=Ru,Fu=`/* on mobile browsers, I set a width of 100% */
|
|
11557
|
+
}`;let Fu=0;const Gl=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorShapeAdd=k(this,"xplorShapeAdd"),this.xplorShapeRemove=k(this,"xplorShapeRemove"),this.xplorShapeChange=k(this,"xplorShapeChange"),this.componentId=`xplor-canvas-${++Fu}`,this.isDrawing=!1,this.drawStart=null,this.isResizing=!1,this.resizeHandle=null,this.resizeStart=null,this.width=800,this.height=500,this.tool="select",this.shapes=[],this.selectedId=null,this.activeTool="select",this.draftShape=null,this.onSvgMouseDown=n=>{const e=n.target,r=e===this.svgEl||e.classList.contains("xplor-canvas__bg");if(this.activeTool==="select"){r&&(this.selectedId=null);return}if(!r)return;const o=this.getSvgPoint(n);this.isDrawing=!0,this.drawStart=o,this.draftShape={id:"__draft__",type:this.activeTool,x:o.x,y:o.y,width:0,height:0,fill:"rgba(33, 150, 243, 0.15)",stroke:"#2196f3"},n.preventDefault()},this.onSvgMouseMove=n=>{if(!this.isDrawing||!this.drawStart||!this.draftShape)return;const e=this.getSvgPoint(n),r=Math.min(e.x,this.drawStart.x),o=Math.min(e.y,this.drawStart.y),i=Math.abs(e.x-this.drawStart.x),a=Math.abs(e.y-this.drawStart.y);this.draftShape=Object.assign(Object.assign({},this.draftShape),{x:r,y:o,width:i,height:a})},this.onSvgMouseUp=n=>{if(!this.isDrawing||!this.draftShape){this.isDrawing=!1;return}if(this.isDrawing=!1,this.draftShape.width<5||this.draftShape.height<5){this.draftShape=null,this.drawStart=null;return}const e=Object.assign(Object.assign({},this.draftShape),{id:this.generateId(),fill:"rgba(33, 150, 243, 0.25)",stroke:"#1976d2"});this.shapes=[...this.shapes,e],this.draftShape=null,this.drawStart=null,this.xplorShapeAdd.emit(e)},this.onShapeClick=(n,e)=>{this.activeTool==="select"&&(n.stopPropagation(),this.selectedId=e.id)},this.onResizeHandleMouseDown=(n,e)=>{n.stopPropagation(),n.preventDefault();const r=this.shapes.find(s=>s.id===this.selectedId);if(!r)return;const o=this.getSvgPoint(n);this.isResizing=!0,this.resizeHandle=e,this.resizeStart={x:o.x,y:o.y,shape:Object.assign({},r)};const i=s=>this.onResizeMouseMove(s),a=s=>{this.onResizeMouseUp(s),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",a)};window.addEventListener("mousemove",i),window.addEventListener("mouseup",a)},this.onResizeMouseMove=n=>{if(!this.isResizing||!this.resizeStart||!this.resizeHandle)return;const e=this.getSvgPoint(n),r=e.x-this.resizeStart.x,o=e.y-this.resizeStart.y,i=this.resizeStart.shape,a=10;let{x:s,y:l,width:c,height:d}=i;if(this.resizeHandle.includes("e")&&(c=Math.max(a,i.width+r)),this.resizeHandle.includes("w")){const h=Math.max(a,i.width-r);s=i.x+(i.width-h),c=h}if(this.resizeHandle.includes("s")&&(d=Math.max(a,i.height+o)),this.resizeHandle.includes("n")){const h=Math.max(a,i.height-o);l=i.y+(i.height-h),d=h}this.shapes=this.shapes.map(h=>h.id===this.selectedId?Object.assign(Object.assign({},h),{x:s,y:l,width:c,height:d}):h)},this.onResizeMouseUp=n=>{if(!this.isResizing)return;this.isResizing=!1,this.resizeHandle=null,this.resizeStart=null;const e=this.shapes.find(r=>r.id===this.selectedId);e&&this.xplorShapeChange.emit(Object.assign({},e))},this.onKeyDown=n=>{(n.key==="Delete"||n.key==="Backspace")&&(n.preventDefault(),this.deleteSelected())}}componentWillLoad(){this.activeTool=this.tool}async clearAll(){this.shapes=[],this.selectedId=null}async getShapes(){return[...this.shapes]}generateId(){return`shape-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}getSvgPoint(n){const e=this.svgEl.getBoundingClientRect();return{x:Math.max(0,Math.min(this.width,n.clientX-e.left)),y:Math.max(0,Math.min(this.height,n.clientY-e.top))}}setActiveTool(n){this.activeTool=n,this.draftShape=null,this.isDrawing=!1}deleteSelected(){if(!this.selectedId)return;const n=this.selectedId;this.shapes=this.shapes.filter(e=>e.id!==n),this.selectedId=null,this.xplorShapeRemove.emit(n)}renderShape(n,e=!1){const o={class:{"xplor-canvas__shape":!0,"xplor-canvas__shape--selected":!e&&n.id===this.selectedId,"xplor-canvas__shape--draft":e},fill:n.fill,stroke:n.stroke,"stroke-width":"2",style:{cursor:this.activeTool==="select"&&!e?"pointer":"default"},onClick:e?void 0:i=>this.onShapeClick(i,n)};return n.type==="rect"?p("rect",Object.assign({},o,{x:n.x,y:n.y,width:n.width,height:n.height,rx:"2"})):n.type==="circle"?p("ellipse",Object.assign({},o,{cx:n.x+n.width/2,cy:n.y+n.height/2,rx:n.width/2,ry:n.height/2})):n.type==="line"?p("line",Object.assign({},o,{x1:n.x,y1:n.y,x2:n.x+n.width,y2:n.y+n.height,fill:"none"})):null}renderSelectionOverlay(n){const e={class:"xplor-canvas__selection-overlay",stroke:"var(--selection-color, #2196f3)","stroke-dasharray":"5,3","stroke-width":"2",fill:"none",style:{pointerEvents:"none"}};return n.type==="line"?p("line",Object.assign({},e,{x1:n.x,y1:n.y,x2:n.x+n.width,y2:n.y+n.height})):n.type==="circle"?p("ellipse",Object.assign({},e,{cx:n.x+n.width/2,cy:n.y+n.height/2,rx:n.width/2,ry:n.height/2})):p("rect",Object.assign({},e,{x:n.x,y:n.y,width:n.width,height:n.height,rx:"2"}))}renderResizeHandles(n){const{x:e,y:r,width:o,height:i}=n,a=e+o/2,s=r+i/2;return[{name:"nw",cx:e,cy:r,cursor:"nwse-resize"},{name:"n",cx:a,cy:r,cursor:"ns-resize"},{name:"ne",cx:e+o,cy:r,cursor:"nesw-resize"},{name:"e",cx:e+o,cy:s,cursor:"ew-resize"},{name:"se",cx:e+o,cy:r+i,cursor:"nwse-resize"},{name:"s",cx:a,cy:r+i,cursor:"ns-resize"},{name:"sw",cx:e,cy:r+i,cursor:"nesw-resize"},{name:"w",cx:e,cy:s,cursor:"ew-resize"}].map(c=>c("circle",{key:c.name,class:"xplor-canvas__handle",cx:c.cx,cy:c.cy,r:"var(--handle-size, 5)",style:{cursor:c.cursor},onMouseDown:d=>this.onResizeHandleMouseDown(d,c.name),"aria-label":`Resize ${c.name.toUpperCase()} handle`,role:"button"}))}renderToolbar(){const n=[{id:"select",label:"Select tool",icon:p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M4 0 L20 12 L12.5 14.5 L10 24 Z"}))},{id:"rect",label:"Rectangle tool",icon:p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},p("rect",{x:"3",y:"3",width:"18",height:"18",rx:"1"}))},{id:"circle",label:"Circle / Ellipse tool",icon:p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},p("ellipse",{cx:"12",cy:"12",rx:"9",ry:"9"}))},{id:"line",label:"Line tool",icon:p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},p("line",{x1:"3",y1:"21",x2:"21",y2:"3"}))}];return p("div",{class:"xplor-canvas__toolbar",role:"toolbar","aria-label":"Canvas drawing tools",id:`${this.componentId}-toolbar`},p("div",{class:"xplor-canvas__toolbar-group",role:"group","aria-label":"Drawing tools"},n.map(e=>p("button",{type:"button",key:e.id,class:{"xplor-canvas__toolbar-btn":!0,"xplor-canvas__toolbar-btn--active":this.activeTool===e.id},"aria-label":e.label,"aria-pressed":String(this.activeTool===e.id),title:e.label,onClick:()=>this.setActiveTool(e.id)},e.icon))),p("div",{class:"xplor-canvas__toolbar-divider","aria-hidden":"true"}),p("div",{class:"xplor-canvas__toolbar-group",role:"group","aria-label":"Canvas actions"},p("button",{type:"button",class:{"xplor-canvas__toolbar-btn":!0,"xplor-canvas__toolbar-btn--danger":!!this.selectedId},"aria-label":"Delete selected shape",title:"Delete selected (Del)",disabled:!this.selectedId,onClick:()=>this.deleteSelected()},p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}))),p("button",{type:"button",class:"xplor-canvas__toolbar-btn","aria-label":"Clear all shapes",title:"Clear all",onClick:()=>this.clearAll()},p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z"}),p("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})))))}render(){const n=this.selectedId?this.shapes.find(r=>r.id===this.selectedId):null,e=this.activeTool!=="select"?"crosshair":"default";return p(E,{key:"14f6878d3a4a6de64d1862ab998f2acdf00004d5"},p("div",{key:"62a4fff983faeea8884d30df8a3bc3e39e6931a6",class:"xplor-canvas",role:"application","aria-label":"Canvas editor","aria-describedby":`${this.componentId}-desc`,tabIndex:0,onKeyDown:this.onKeyDown},p("span",{key:"cb962f76307036784990f491e9b55f38baa0b660",id:`${this.componentId}-desc`,class:"xplor-canvas__sr-only"},"Interactive canvas editor. Use toolbar to select a drawing tool, then click and drag on the canvas to draw shapes. Press Delete to remove a selected shape."),this.renderToolbar(),p("div",{key:"e46429cfb82d2804ad97f474469e307d4cedc61a",class:"xplor-canvas__svg-wrapper"},p("svg",{key:"01f59f5ad95af1854ce8883b79fbcb382b8c910f",ref:r=>this.svgEl=r,class:"xplor-canvas__svg",width:this.width,height:this.height,style:{cursor:e},"aria-label":`Drawing canvas, ${this.shapes.length} shape${this.shapes.length!==1?"s":""}`,role:"img",onMouseDown:this.onSvgMouseDown,onMouseMove:this.onSvgMouseMove,onMouseUp:this.onSvgMouseUp},p("rect",{key:"831a519b540b5dd36c15edec85ad67bcb6d1dc03",class:"xplor-canvas__bg",x:"0",y:"0",width:this.width,height:this.height,fill:"transparent"}),this.shapes.map(r=>this.renderShape(r)),n&&this.renderSelectionOverlay(n),n&&this.activeTool==="select"&&this.renderResizeHandles(n),this.draftShape&&this.renderShape(this.draftShape,!0))),p("div",{key:"5758ccf14f88614a1732085e287bad7f29ea0030",class:"xplor-canvas__sr-only","aria-live":"polite","aria-atomic":"true"},this.shapes.length>0?`Canvas contains ${this.shapes.length} shape${this.shapes.length!==1?"s":""}.`:"Canvas is empty.")))}get el(){return this}static get style(){return Nu}},[2,"xplor-canvas-editor",{width:[2],height:[2],tool:[1],shapes:[32],selectedId:[32],activeTool:[32],draftShape:[32],clearAll:[64],getShapes:[64]}]);function Hu(){if(typeof customElements>"u")return;["xplor-canvas-editor"].forEach(n=>{switch(n){case"xplor-canvas-editor":customElements.get(n)||customElements.define(n,Gl);break}})}const ju=Gl,Xu=Hu,Vu=`/* on mobile browsers, I set a width of 100% */
|
|
11554
11558
|
@tailwind base;
|
|
11555
11559
|
@tailwind components;
|
|
11556
11560
|
@tailwind utilities;
|
|
@@ -11834,7 +11838,7 @@ ul.mdc-list li.mdc-list-item {
|
|
|
11834
11838
|
height: 45px;
|
|
11835
11839
|
text-align: center;
|
|
11836
11840
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
11837
|
-
}`,
|
|
11841
|
+
}`,Yl=M(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow()}render(){return p(E,{key:"a4cdcfb36108dbb84eeea5a4afbcbc59652e9cb0"},p("select",{key:"1ad560027207d9b0fe9d9986c9ab4e6ab947c71c",class:"xplor-dropdown",onChange:this.handleChange},this.options.map(n=>p("option",{value:n,selected:this.selected===n},n))))}static get style(){return Vu}},[1,"xplor-dropdown",{options:[16],selected:[1],handleChange:[16,"handle-change"]}]);function Ql(){if(typeof customElements>"u")return;["xplor-dropdown"].forEach(n=>{switch(n){case"xplor-dropdown":customElements.get(n)||customElements.define(n,Yl);break}})}const Wu=`/* on mobile browsers, I set a width of 100% */
|
|
11838
11842
|
@tailwind base;
|
|
11839
11843
|
@tailwind components;
|
|
11840
11844
|
@tailwind utilities;
|
|
@@ -12108,7 +12112,7 @@ ul.mdc-list li.mdc-list-item {
|
|
|
12108
12112
|
.container {
|
|
12109
12113
|
display: flex;
|
|
12110
12114
|
margin-top: 20px;
|
|
12111
|
-
}`,
|
|
12115
|
+
}`,Zl=M(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.languageOptions=["English","Spanish","French","German","Italian"],this.textId="text",this.selectedLanguage="English",this.handleClick=()=>{debugger;fetch("https://nnvy1fqqcb.execute-api.ap-southeast-2.amazonaws.com/ai_dev/ai/prompt-generation",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.apiKey},body:JSON.stringify({service:null,action:"translate",language:this.selectedLanguage,content:this.textValue||""})}).then(n=>{if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return n.json()}).then(n=>{console.log("Success:",n),this.textValue=n.response}).catch(n=>{console.error("Error:",n)})},this.handleChange=n=>{const e=n.target;this.selectedLanguage=e.value,console.log("Selected language:",this.selectedLanguage)}}componentDidLoad(){var n;const e=(n=this.host.shadowRoot)===null||n===void 0?void 0:n.getElementById("text");e&&(this.textValue=e.textContent||"",console.log("textValue:",this.textValue))}render(){return p(E,{key:"5d2dcc41806f640f3dce9dea7aefe60877115b6c"},p("div",{key:"3624422b51c11f58fa35249e91ab3a5a4ae70cd1",id:"ai-text"},this.textValue),p("div",{key:"ba23a8071db26f0695fbfc75a740b9e816c72eac",class:"container"},p("xplor-dropdown",{key:"b944f0a90ac707f98bc3ed75736823572d0f77e5",options:this.languageOptions,selected:this.selectedLanguage,handleChange:this.handleChange}),p("xplor-button",{key:"e9d9b16969b7da1cb1160a7f6c9c77b932da8834",text:"translate",mode:"pg",type:"primary",onClick:this.handleClick})))}get host(){return this}static get style(){return Wu}},[1,"xplor-chat-widget",{languageOptions:[16,"language-options"],textId:[1,"text-id"],apiKey:[1,"api-key"],selectedLanguage:[32],textValue:[32]}]);function Uu(){if(typeof customElements>"u")return;["xplor-chat-widget","xplor-button","xplor-dropdown"].forEach(n=>{switch(n){case"xplor-chat-widget":customElements.get(n)||customElements.define(n,Zl);break;case"xplor-button":customElements.get(n)||Lt();break;case"xplor-dropdown":customElements.get(n)||Ql();break}})}const qu=Zl,Ku=Uu,Ju=`/* on mobile browsers, I set a width of 100% */
|
|
12112
12116
|
@tailwind base;
|
|
12113
12117
|
@tailwind components;
|
|
12114
12118
|
@tailwind utilities;
|
|
@@ -12559,7 +12563,7 @@ ul.mdc-list li.mdc-list-item {
|
|
|
12559
12563
|
}
|
|
12560
12564
|
.checkbox.disabled ~ .label {
|
|
12561
12565
|
opacity: 0.4;
|
|
12562
|
-
}`;let
|
|
12566
|
+
}`;let Gu=0;const nc=M(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.checkboxChange=k(this,"checkboxChange"),this.labelId=`xplor-checkbox-label-${++Gu}`,this.initialChecked=!1,this.initialIndeterminate=!1,this.disabled=!1,this.error=!1,this.label="",this.checked=!1,this.indeterminate=!1,this.isHovered=!1,this.isFocused=!1,this.isPressed=!1,this.handleClick=()=>{this.disabled||(this.indeterminate?(this.indeterminate=!1,this.checked=!0):this.checked=!this.checked,this.checkboxChange.emit({checked:this.checked,indeterminate:this.indeterminate}))},this.handleKeyDown=n=>{this.disabled||(n.key===" "||n.key==="Enter")&&(n.preventDefault(),this.isPressed=!0,this.handleClick())},this.handleKeyUp=n=>{(n.key===" "||n.key==="Enter")&&(this.isPressed=!1)},this.getCheckboxClass=()=>{const n=["checkbox"];return this.checked&&n.push("checked"),this.indeterminate&&n.push("indeterminate"),this.disabled&&n.push("disabled"),this.error&&n.push("error"),this.isHovered&&!this.disabled&&n.push("hover"),this.isFocused&&!this.disabled&&n.push("focus"),this.isPressed&&!this.disabled&&n.push("pressed"),n.join(" ")}}watchCheckedProp(n){this.checked=n}watchIndeterminateProp(n){this.indeterminate=n}componentWillLoad(){this.checked=this.initialChecked,this.indeterminate=this.initialIndeterminate}render(){return p("div",{key:"1fe78163ff3fc8d337731e9765628f2dd48bbbb5",class:"checkbox-wrapper"},p("div",{key:"0ed33fa8c645b4ddce726b991f40da8712758a71",class:this.getCheckboxClass(),onClick:this.handleClick,onMouseEnter:()=>this.isHovered=!0,onMouseLeave:()=>this.isHovered=!1,onMouseDown:()=>this.isPressed=!0,onMouseUp:()=>this.isPressed=!1,onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,tabIndex:this.disabled?-1:0,role:"checkbox","aria-checked":this.indeterminate?"mixed":this.checked.toString(),"aria-disabled":this.disabled.toString(),"aria-labelledby":this.label?this.labelId:void 0},this.checked&&p("svg",{key:"75bd98168be72bf08998da1058aefe6fe9c46947",class:"check-icon",viewBox:"0 0 16 16",fill:"none"},p("path",{key:"ddfb568863af95b55ca70df1ba3dd8be5a3d30cb",d:"M13.3334 4L6.00002 11.3333L2.66669 8",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})),this.indeterminate&&p("svg",{key:"1eadbf511badc60a60a5419c010c0c9b09014e22",class:"indeterminate-icon",viewBox:"0 0 16 16",fill:"none"},p("path",{key:"b654b703226b817484375a9b7d008feb44c8f592",d:"M3.33331 8H12.6666",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"}))),this.label&&p("span",{key:"1e53eb3e690f18f983d1cdded64fe9e8b557e5c8",class:"label",id:this.labelId},this.label))}static get watchers(){return{initialChecked:["watchCheckedProp"],initialIndeterminate:["watchIndeterminateProp"]}}static get style(){return Ju}},[1,"xplor-checkbox",{initialChecked:[4,"initial-checked"],initialIndeterminate:[4,"initial-indeterminate"],disabled:[4],error:[4],label:[1],checked:[32],indeterminate:[32],isHovered:[32],isFocused:[32],isPressed:[32]},void 0,{initialChecked:["watchCheckedProp"],initialIndeterminate:["watchIndeterminateProp"]}]);function Yu(){if(typeof customElements>"u")return;["xplor-checkbox"].forEach(n=>{switch(n){case"xplor-checkbox":customElements.get(n)||customElements.define(n,nc);break}})}const Qu=nc,Zu=Yu,nf=`@tailwind base;
|
|
12563
12567
|
@tailwind components;
|
|
12564
12568
|
@tailwind utilities;
|
|
12565
12569
|
@layer base {
|
|
@@ -13012,7 +13016,7 @@ ol.mdc-list.sc-xplor-combobox li.mdc-list-item.sc-xplor-combobox, ul.mdc-list.sc
|
|
|
13012
13016
|
text-align: center;
|
|
13013
13017
|
color: #757575;
|
|
13014
13018
|
font-size: 0.875rem;
|
|
13015
|
-
}`,
|
|
13019
|
+
}`,ec=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorChange=k(this,"xplorChange"),this.xplorSelect=k(this,"xplorSelect"),this.xplorCreate=k(this,"xplorCreate"),this.xplorClear=k(this,"xplorClear"),this.xplorSearch=k(this,"xplorSearch"),this.items=[],this.value=null,this.placeholder="Type to search or add...",this.disabled=!1,this.readonly=!1,this.clearable=!1,this.multiple=!1,this.allowCustom=!0,this.createMessage="Create",this.isOpen=!1,this.searchQuery="",this.filteredItems=[],this.selectedItems=[],this.highlightedIndex=-1,this.customItems=[],this.handleInputFocus=()=>{this.disabled||this.readonly||(this.isOpen=!0,this.highlightedIndex=-1)},this.handleInputChange=n=>{const e=n.target;this.searchQuery=e.value,this.filterItems(),this.isOpen=!0,this.highlightedIndex=-1,this.xplorSearch.emit(this.searchQuery),!this.multiple&&this.searchQuery===""&&(this.value=null,this.xplorChange.emit(null))},this.handleInputKeyDown=n=>{var e;if(this.disabled||this.readonly)return;const r=this.filteredItems.length+(this.canCreateNew()?1:0);switch(n.key){case"ArrowDown":n.preventDefault(),this.isOpen=!0,this.highlightedIndex=Math.min(this.highlightedIndex+1,r-1),this.scrollToHighlighted();break;case"ArrowUp":n.preventDefault(),this.highlightedIndex=Math.max(this.highlightedIndex-1,-1),this.scrollToHighlighted();break;case"Enter":n.preventDefault(),this.highlightedIndex>=0?this.highlightedIndex<this.filteredItems.length?this.selectItem(this.filteredItems[this.highlightedIndex]):this.canCreateNew()&&this.createNewItem():this.canCreateNew()&&this.searchQuery.trim()!==""&&this.createNewItem();break;case"Escape":n.preventDefault(),this.isOpen=!1,(e=this.inputEl)===null||e===void 0||e.blur();break;case"Backspace":this.multiple&&this.searchQuery===""&&this.selectedItems.length>0&&(n.preventDefault(),this.removeItem(this.selectedItems[this.selectedItems.length-1]));break}},this.handleClear=()=>{var n;this.value=this.multiple?[]:null,this.selectedItems=[],this.searchQuery="",this.filterItems(),this.xplorChange.emit(this.value),this.xplorClear.emit(),(n=this.inputEl)===null||n===void 0||n.focus()}}componentWillLoad(){if(this.filterItems(),this.value!==null){if(this.multiple&&Array.isArray(this.value))this.selectedItems=this.value;else if(!this.multiple){const e=[...this.items,...this.customItems].find(r=>r.value===this.value);e&&(this.searchQuery=e.label)}}}handleDocumentClick(n){const e=n.target;this.el.contains(e)||(this.isOpen=!1)}filterItems(){const n=this.searchQuery.toLowerCase(),e=[...this.items,...this.customItems];if(n===""){this.filteredItems=e;return}this.filteredItems=e.filter(r=>r.label.toLowerCase().includes(n))}canCreateNew(){return!this.allowCustom||this.searchQuery.trim()===""?!1:![...this.items,...this.customItems].some(r=>r.label.toLowerCase()===this.searchQuery.toLowerCase())}scrollToHighlighted(){if(this.dropdownEl&&this.highlightedIndex>=0){const n=this.dropdownEl.querySelector(`[data-index="${this.highlightedIndex}"]`);n&&n.scrollIntoView({block:"nearest"})}}selectItem(n){var e;n.disabled||(this.multiple?(this.selectedItems.includes(n.value)||(this.selectedItems=[...this.selectedItems,n.value],this.value=this.selectedItems,this.xplorChange.emit(this.value)),this.searchQuery="",this.filterItems()):(this.value=n.value,this.searchQuery=n.label,this.isOpen=!1,this.xplorChange.emit(this.value)),this.xplorSelect.emit(n),(e=this.inputEl)===null||e===void 0||e.focus())}createNewItem(){const n=this.searchQuery.trim(),e={label:n,value:n};this.customItems=[...this.customItems,e],this.selectItem(e),this.xplorCreate.emit(n)}removeItem(n){this.selectedItems=this.selectedItems.filter(e=>e!==n),this.value=this.selectedItems,this.xplorChange.emit(this.value)}getSelectedItemLabel(n){const r=[...this.items,...this.customItems].find(o=>o.value===n);return r?r.label:n}render(){const n=this.multiple?this.selectedItems.length>0:this.value!==null&&this.searchQuery!=="",e=this.canCreateNew(),r="combobox-listbox",o="combobox-label",i=this.highlightedIndex>=0?`combobox-option-${this.highlightedIndex}`:void 0;return p(E,{key:"30d75fafd92568e91b4f695fa48d06fe2c433c40"},p("div",{key:"b8c6278923ff28cd85adaf793d8a9c36bc812370",class:{combobox:!0,"combobox--disabled":this.disabled,"combobox--readonly":this.readonly,"combobox--open":this.isOpen}},this.label&&p("label",{key:"b8c250d88bf3fefc0b83232e3f93123034e43149",class:"combobox__label",id:o},this.label),p("div",{key:"b0c00a90810d030afc86f815b4f90bc259841885",class:"combobox__input-wrapper"},this.multiple&&this.selectedItems.length>0&&p("div",{key:"50d4ea9a7798b65d6bc52466b458f022358d881a",class:"combobox__chips"},this.selectedItems.map(a=>{const s=this.getSelectedItemLabel(a);return p("div",{class:"combobox__chip"},p("span",{class:"combobox__chip-label"},s),p("button",{type:"button",class:"combobox__chip-remove",onClick:()=>this.removeItem(a),disabled:this.disabled||this.readonly,"aria-label":`Remove ${s}`},"×"))})),p("input",{key:"5fb92aa47a90ce22bc6538b267ab5ebc228ef38c",ref:a=>this.inputEl=a,type:"text",class:"combobox__input",placeholder:this.placeholder,value:this.searchQuery,onFocus:this.handleInputFocus,onInput:this.handleInputChange,onKeyDown:this.handleInputKeyDown,disabled:this.disabled,readonly:this.readonly,autocomplete:"off",role:"combobox","aria-expanded":this.isOpen?"true":"false","aria-haspopup":"listbox","aria-controls":this.isOpen?r:void 0,"aria-activedescendant":i,"aria-labelledby":this.label?o:void 0,"aria-label":this.label?void 0:this.ariaLabel||this.placeholder,"aria-autocomplete":"list"}),p("div",{key:"4ade4fece05a81bc1ac4a0a289beecd6a2068f8c",class:"combobox__actions"},this.clearable&&n&&!this.disabled&&!this.readonly&&p("button",{key:"8ee876b5e4a35fd0b0af71544bbc2e98a29148fd",type:"button",class:"combobox__clear",onClick:this.handleClear,"aria-label":"Clear selection"},"×"),p("span",{key:"ca1e3180e381b5fe1ace789b0af66092cd9dfeee",class:"combobox__icon","aria-hidden":"true"},"▼"))),this.isOpen&&(this.filteredItems.length>0||e)&&p("div",{key:"cb5501119e5aa39e161de50b1ac6b310dc1edaa3",class:"combobox__dropdown",ref:a=>this.dropdownEl=a,role:"listbox",id:r,"aria-label":this.label||this.ariaLabel||"Options"},this.filteredItems.map((a,s)=>{const l=this.multiple?this.selectedItems.includes(a.value):this.value===a.value;return p("div",{key:a.value,id:`combobox-option-${s}`,"data-index":s,role:"option","aria-selected":l?"true":"false","aria-disabled":a.disabled?"true":void 0,class:{combobox__item:!0,"combobox__item--highlighted":s===this.highlightedIndex,"combobox__item--selected":l,"combobox__item--disabled":a.disabled},onClick:()=>this.selectItem(a)},a.label)}),e&&p("div",{key:"dddf029e093efa939b5f40b63101c548e11eb654",id:`combobox-option-${this.filteredItems.length}`,"data-index":this.filteredItems.length,role:"option","aria-selected":"false",class:{combobox__item:!0,"combobox__item--create":!0,"combobox__item--highlighted":this.highlightedIndex===this.filteredItems.length},onClick:()=>this.createNewItem()},p("span",{key:"478d841838f5b2249f868d5852982bede08fe3de",class:"combobox__create-label"},this.createMessage,":")," ",p("strong",{key:"05c284c7d27f7107dfc717c5c2376077c627d4c7"},'"',this.searchQuery,'"'))),this.isOpen&&this.filteredItems.length===0&&!e&&p("div",{key:"c333a2909fef4d33e8b1655043340ba4f27d898e",class:"combobox__dropdown",role:"listbox",id:r},p("div",{key:"1ba3213f34a8f281143e6ead11fc0c90844475fc",class:"combobox__no-results",role:"option","aria-disabled":"true"},"No results found"))))}get el(){return this}static get style(){return nf}},[2,"xplor-combobox",{items:[16],value:[1032],placeholder:[1],label:[1],ariaLabel:[1,"aria-label"],disabled:[4],readonly:[4],clearable:[4],multiple:[4],allowCustom:[4,"allow-custom"],createMessage:[1,"create-message"],isOpen:[32],searchQuery:[32],filteredItems:[32],selectedItems:[32],highlightedIndex:[32],customItems:[32]},[[4,"click","handleDocumentClick"]]]);function ef(){if(typeof customElements>"u")return;["xplor-combobox"].forEach(n=>{switch(n){case"xplor-combobox":customElements.get(n)||customElements.define(n,ec);break}})}const tf=ec,rf=ef,of=`/* on mobile browsers, I set a width of 100% */
|
|
13016
13020
|
@tailwind base;
|
|
13017
13021
|
@tailwind components;
|
|
13018
13022
|
@tailwind utilities;
|
|
@@ -13590,7 +13594,7 @@ table.hover tbody tr:not(.empty-row):hover.selected {
|
|
|
13590
13594
|
.datatable-footer .footer-controls {
|
|
13591
13595
|
justify-content: space-between;
|
|
13592
13596
|
}
|
|
13593
|
-
}`,
|
|
13597
|
+
}`,tc=M(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.rowClick=k(this,"rowClick"),this.xplorSelectionChange=k(this,"xplorSelectionChange"),this.paginationChange=k(this,"paginationChange"),this.sortChange=k(this,"sortChange"),this.headers=[],this.items=[],this.loading=!1,this.pagination={page:1,perpage:10,total:0},this.selected=[],this.canSelect=!1,this.horizontalLines=!0,this.striped=!1,this.skeletonLoader=!0,this.hover=!0,this.perPageOptions=[10,25,50,100],this.sortBy=null,this.sortDirection=null,this.internalSelected=new Set,this.allSelected=!1,this.handleSort=n=>{n.sortable!==!1&&(this.sortBy===n.value?this.sortDirection==="asc"?this.sortDirection="desc":this.sortDirection==="desc"&&(this.sortDirection=null,this.sortBy=null):(this.sortBy=n.value,this.sortDirection="asc"),this.sortChange.emit({column:this.sortBy,direction:this.sortDirection}))},this.handleSelectAll=n=>{const r=n.target.checked;r?this.items.forEach(o=>this.internalSelected.add(o)):this.internalSelected.clear(),this.allSelected=r,this.internalSelected=new Set(this.internalSelected),this.xplorSelectionChange.emit(Array.from(this.internalSelected))},this.handleSelectOne=(n,e)=>{n.target.checked?this.internalSelected.add(e):this.internalSelected.delete(e),this.internalSelected=new Set(this.internalSelected),this.updateAllSelectedState(),this.xplorSelectionChange.emit(Array.from(this.internalSelected))},this.handleRowClick=(n,e)=>{const r=e.target;r.tagName==="INPUT"||r.closest("input")||this.rowClick.emit(n)},this.handlePageChange=n=>{const e=Object.assign(Object.assign({},this.pagination),{page:n});this.paginationChange.emit(e)},this.handlePerPageChange=n=>{const e=n.target,r=parseInt(e.value,10);if(!isNaN(r)){const o=Object.assign(Object.assign({},this.pagination),{page:1,perpage:r});this.paginationChange.emit(o)}}}componentWillLoad(){this.internalSelected=new Set(this.selected)}watchSelected(n){this.internalSelected=new Set(n),this.updateAllSelectedState()}watchItems(){this.updateAllSelectedState()}updateAllSelectedState(){if(this.items.length===0){this.allSelected=!1;return}this.allSelected=this.items.every(n=>this.internalSelected.has(n))}getSortIcon(n){return this.sortBy!==n.value?p("svg",{class:"sort-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p("path",{d:"M8 3L11 6H5L8 3Z",fill:"currentColor",opacity:"0.3"}),p("path",{d:"M8 13L5 10H11L8 13Z",fill:"currentColor",opacity:"0.3"})):this.sortDirection==="asc"?p("svg",{class:"sort-icon active",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p("path",{d:"M8 3L11 6H5L8 3Z",fill:"currentColor"}),p("path",{d:"M8 13L5 10H11L8 13Z",fill:"currentColor",opacity:"0.3"})):p("svg",{class:"sort-icon active",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p("path",{d:"M8 3L11 6H5L8 3Z",fill:"currentColor",opacity:"0.3"}),p("path",{d:"M8 13L5 10H11L8 13Z",fill:"currentColor"}))}renderSkeletonLoader(){return p("tbody",{class:"skeleton-loader"},Array.from({length:this.pagination.perpage}).map(()=>p("tr",null,this.canSelect&&p("td",null,p("div",{class:"skeleton skeleton-checkbox"})),this.headers.map(()=>p("td",null,p("div",{class:"skeleton skeleton-text"}))))))}renderPagination(){const n=Math.ceil(this.pagination.total/this.pagination.perpage),e=this.pagination.page,r=(e-1)*this.pagination.perpage+1,o=Math.min(e*this.pagination.perpage,this.pagination.total);return p("div",{class:"datatable-footer"},p("div",{class:"footer-info"},this.pagination.total>0?p("span",null,"Showing ",r," to ",o," of ",this.pagination.total," entries"):p("span",null,"No entries")),p("div",{class:"footer-controls"},p("div",{class:"per-page-selector"},p("label",null,"Rows per page:",p("select",{onInput:this.handlePerPageChange},this.perPageOptions.map(i=>p("option",{value:i,selected:i===this.pagination.perpage},i))))),p("div",{class:"pagination-controls"},p("button",{class:"pagination-btn",disabled:e===1,onClick:()=>this.handlePageChange(1),"aria-label":"First page"},p("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p("path",{d:"M11 12L7 8L11 4M5 4V12",stroke:"currentColor","stroke-width":"1.5"}))),p("button",{class:"pagination-btn",disabled:e===1,onClick:()=>this.handlePageChange(e-1),"aria-label":"Previous page"},p("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p("path",{d:"M10 12L6 8L10 4",stroke:"currentColor","stroke-width":"1.5"}))),p("span",{class:"page-info"},"Page ",e," of ",n||1),p("button",{class:"pagination-btn",disabled:e>=n,onClick:()=>this.handlePageChange(e+1),"aria-label":"Next page"},p("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p("path",{d:"M6 4L10 8L6 12",stroke:"currentColor","stroke-width":"1.5"}))),p("button",{class:"pagination-btn",disabled:e>=n,onClick:()=>this.handlePageChange(n),"aria-label":"Last page"},p("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},p("path",{d:"M5 4L9 8L5 12M11 4V12",stroke:"currentColor","stroke-width":"1.5"}))))))}render(){const n=typeof this.height=="number"?`${this.height}px`:this.height,e=!!this.height;return p(E,{key:"31026bbaf1331e11115147771e80fb3d59c02104",class:"xplor-datatable"},p("div",{key:"6b4feed4000f1cc56bf2ed2e7bb6808996662ca9",class:"datatable-container"},p("div",{key:"2d395becc036e9e19f3b9397fbf154edf07f36e4",class:{"table-wrapper":!0,"has-height":e,"horizontal-lines":this.horizontalLines,striped:this.striped,"is-empty":this.items.length===0},style:e?{height:n}:{}},p("table",{key:"fdf0bf570246d6abd84dfa2e2cf5757dde309e6c",class:{hover:this.hover}},p("thead",{key:"634480ba84300e86339dbbf95dce396cde8395c5"},p("tr",{key:"08e44beee5fb0c703694b38a7bfbc2da3691611e"},this.canSelect&&p("th",{key:"9587a2bb1e11e5c8b44f5b7c4de3e2d6d4e7bb30",class:"select-column"},p("label",{key:"a2cdfaabd4fff5cba3801568de522eb60104a79e",class:"checkbox-label"},p("input",{key:"3500b6b71893fc242b6ad956cb1190b2533e13de",type:"checkbox",checked:this.allSelected,indeterminate:this.internalSelected.size>0&&this.internalSelected.size<this.items.length,onChange:this.handleSelectAll,"aria-label":"Select all rows"}))),this.headers.map(r=>p("th",{class:{sortable:r.sortable!==!1,sorted:this.sortBy===r.value,fixed:r.fixed,[`align-${r.align||"left"}`]:!0},style:r.width?{width:typeof r.width=="number"?`${r.width}px`:r.width}:{},onClick:()=>r.sortable!==!1&&this.handleSort(r),"aria-sort":r.sortable!==!1&&this.sortBy===r.value?this.sortDirection==="asc"?"ascending":this.sortDirection==="desc"?"descending":"none":void 0},p("div",{class:"header-content"},p("span",null,r.text),r.sortable!==!1&&this.getSortIcon(r)))))),this.loading&&this.skeletonLoader?this.renderSkeletonLoader():p("tbody",null,this.items.length===0?p("tr",{class:"empty-row"},p("td",{colSpan:this.headers.length+(this.canSelect?1:0)},p("div",{class:"empty-state"},p("p",null,"No data available")))):this.items.map(r=>{const o=this.internalSelected.has(r);return p("tr",{class:{selected:o,clickable:!0},onClick:i=>this.handleRowClick(r,i),"aria-selected":this.canSelect?o?"true":"false":void 0},this.canSelect&&p("td",{class:"select-column"},p("label",{class:"checkbox-label"},p("input",{type:"checkbox",checked:o,onChange:i=>this.handleSelectOne(i,r)}))),this.headers.map(i=>p("td",{class:`align-${i.align||"left"}`},p("slot",{name:`item.${i.value}`},r[i.value]))))})))),this.pagination&&this.pagination.total>0&&this.renderPagination()))}get el(){return this}static get watchers(){return{selected:["watchSelected"],items:["watchItems"]}}static get style(){return of}},[1,"xplor-datatable",{headers:[16],items:[16],loading:[4],pagination:[16],selected:[16],canSelect:[4,"can-select"],horizontalLines:[4,"horizontal-lines"],striped:[4],height:[8],skeletonLoader:[4,"skeleton-loader"],hover:[4],perPageOptions:[16,"per-page-options"],sortBy:[32],sortDirection:[32],internalSelected:[32],allSelected:[32]},void 0,{selected:["watchSelected"],items:["watchItems"]}]);function af(){if(typeof customElements>"u")return;["xplor-datatable"].forEach(n=>{switch(n){case"xplor-datatable":customElements.get(n)||customElements.define(n,tc);break}})}const sf=tc,lf=af,cf=`@tailwind base;
|
|
13594
13598
|
@tailwind components;
|
|
13595
13599
|
@tailwind utilities;
|
|
13596
13600
|
@layer base {
|
|
@@ -13980,7 +13984,7 @@ ol.mdc-list.sc-xplor-inline-date-picker li.mdc-list-item.sc-xplor-inline-date-pi
|
|
|
13980
13984
|
}
|
|
13981
13985
|
[compact].sc-xplor-inline-date-picker-h .xplor-inline-date-picker__calendar.sc-xplor-inline-date-picker {
|
|
13982
13986
|
width: 280px;
|
|
13983
|
-
}`,
|
|
13987
|
+
}`,rc=M(class extends T{constructor(){super(),this.__registerHost(),this.dateSelected=k(this,"dateSelected"),this.monthChanged=k(this,"monthChanged"),this.selectedDate="",this.min="",this.max="",this.readonly=!1,this.color="#008480",this.startWeekOnSunday=!0,this.focusedDay=0,this.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],this.dayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],this.dayNamesStartMonday=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],this.previousMonth=()=>{this.currentMonth===0?(this.currentMonth=11,this.currentYear--):this.currentMonth--,this.viewDate=new Date(this.currentYear,this.currentMonth,1),this.monthChanged.emit({year:this.currentYear,month:this.currentMonth})},this.nextMonth=()=>{this.currentMonth===11?(this.currentMonth=0,this.currentYear++):this.currentMonth++,this.viewDate=new Date(this.currentYear,this.currentMonth,1),this.monthChanged.emit({year:this.currentYear,month:this.currentMonth})},this.selectDate=n=>{if(this.readonly)return;const e=new Date(this.currentYear,this.currentMonth,n),r=this.formatDate(e);this.isDateDisabled(e)||(this.selectedDate=r,this.dateSelected.emit(r))},this.formatDate=n=>{const e=n.getFullYear(),r=String(n.getMonth()+1).padStart(2,"0"),o=String(n.getDate()).padStart(2,"0");return`${e}-${r}-${o}`},this.isDateDisabled=n=>{if(this.min){const e=new Date(this.min);if(n<e)return!0}if(this.max){const e=new Date(this.max);if(n>e)return!0}return!1},this.isToday=n=>{const e=new Date;return n===e.getDate()&&this.currentMonth===e.getMonth()&&this.currentYear===e.getFullYear()},this.isSelected=n=>{if(!this.selectedDate)return!1;const e=new Date(this.selectedDate);return n===e.getDate()&&this.currentMonth===e.getMonth()&&this.currentYear===e.getFullYear()},this.getDaysInMonth=()=>new Date(this.currentYear,this.currentMonth+1,0).getDate(),this.getFirstDayOfMonth=()=>{const n=new Date(this.currentYear,this.currentMonth,1).getDay();return this.startWeekOnSunday?n:n===0?6:n-1},this.renderCalendarDays=()=>{const n=this.getDaysInMonth(),e=this.getFirstDayOfMonth(),r=[];for(let o=0;o<e;o++)r.push(p("div",{class:"xplor-inline-date-picker__day xplor-inline-date-picker__day--empty"}));for(let o=1;o<=n;o++){const i=new Date(this.currentYear,this.currentMonth,o),a=this.isDateDisabled(i),s=this.isToday(o),l=this.isSelected(o);r.push(p("div",{class:{"xplor-inline-date-picker__day":!0,"xplor-inline-date-picker__day--today":s,"xplor-inline-date-picker__day--selected":l,"xplor-inline-date-picker__day--disabled":a},onClick:()=>!a&&this.selectDate(o),role:"gridcell","aria-selected":l?"true":"false","aria-current":s?"date":void 0,"aria-disabled":a?"true":void 0,tabIndex:o===this.focusedDay?0:-1,"data-day":o},o))}return r},this.getSidebarDate=()=>{const n=this.selectedDate?new Date(this.selectedDate):new Date,e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return{year:n.getFullYear(),day:e[n.getDay()],date:`${r[n.getMonth()]} ${n.getDate()}`}}}componentWillLoad(){const n=this.selectedDate?new Date(this.selectedDate):new Date;this.currentYear=n.getFullYear(),this.currentMonth=n.getMonth(),this.viewDate=new Date(this.currentYear,this.currentMonth,1),this.focusedDay=n.getDate()}handleKeyDown(n){const e=this.getDaysInMonth();switch(n.key){case"ArrowLeft":n.preventDefault(),this.focusedDay>1?this.focusedDay--:(this.previousMonth(),this.focusedDay=this.getDaysInMonth());break;case"ArrowRight":n.preventDefault(),this.focusedDay<e?this.focusedDay++:(this.nextMonth(),this.focusedDay=1);break;case"ArrowUp":n.preventDefault(),this.focusedDay>7?this.focusedDay-=7:(this.previousMonth(),this.focusedDay=this.getDaysInMonth()-(7-this.focusedDay));break;case"ArrowDown":if(n.preventDefault(),this.focusedDay+7<=e)this.focusedDay+=7;else{const r=this.focusedDay+7-e;this.nextMonth(),this.focusedDay=r}break;case"Enter":case" ":n.preventDefault(),this.focusedDay>=1&&this.focusedDay<=e&&this.selectDate(this.focusedDay);break;default:return}requestAnimationFrame(()=>{const r=this.el.querySelector(`[data-day="${this.focusedDay}"]`);r&&r.focus()})}render(){const n=this.getSidebarDate(),e=this.startWeekOnSunday?this.dayNames:this.dayNamesStartMonday;return p(E,{key:"0e2c9ee42cbe61406ab4bac151dbf0e40475ed23"},p("div",{key:"5e4a7875966f6f4a37f81446d58b68672c35dac3",class:"xplor-inline-date-picker",style:{"--picker-color":this.color}},p("div",{key:"fa29ee023214d89bed7ceb205578f8be89e09337",class:"xplor-inline-date-picker__sidebar"},p("div",{key:"556e7992f45d9bc4ad0b0b9dd1fdd08d4b69c5d9",class:"xplor-inline-date-picker__sidebar-year"},n.year),p("div",{key:"0b581be2477f17c0d80dbce52fc2ad3d31e9b0a3",class:"xplor-inline-date-picker__sidebar-day"},n.day,","),p("div",{key:"d17c951c734d23365dce0c417e53e215a6d810c8",class:"xplor-inline-date-picker__sidebar-date"},n.date)),p("div",{key:"0829d8eac4d5300c425c0bc3540fb7e2a67a8127",class:"xplor-inline-date-picker__calendar"},p("div",{key:"026c1ffc57ca6ebc8c81d9ca5168b06108fb98fa",class:"xplor-inline-date-picker__header"},p("button",{key:"a3093ab8152b08681ffb746bd2441e64ea0ad117",type:"button",class:"xplor-inline-date-picker__arrow",onClick:this.previousMonth,"aria-label":"Previous month"},"‹"),p("div",{key:"924e78c2f181360b899816a64403470029667876",class:"xplor-inline-date-picker__title"},this.monthNames[this.currentMonth]," ",this.currentYear),p("button",{key:"b9d70ec267b289f7c9c920eb12ee19b0f94d2852",type:"button",class:"xplor-inline-date-picker__arrow",onClick:this.nextMonth,"aria-label":"Next month"},"›")),p("div",{key:"d9cddf3b2ec7a57d489fdc9dfb97a48b4e04836a",class:"xplor-inline-date-picker__weekdays"},e.map(r=>p("div",{class:"xplor-inline-date-picker__weekday"},r))),p("div",{key:"bfed53b3822299f0c9c42f7662cff6b0e7dcdc48",class:"xplor-inline-date-picker__days",role:"grid"},this.renderCalendarDays()))))}get el(){return this}static get style(){return cf}},[2,"xplor-inline-date-picker",{selectedDate:[1025,"selected-date"],min:[1],max:[1],readonly:[4],color:[1],startWeekOnSunday:[4,"start-week-on-sunday"],currentYear:[32],currentMonth:[32],viewDate:[32],focusedDay:[32]},[[0,"keydown","handleKeyDown"]]]);function oc(){if(typeof customElements>"u")return;["xplor-inline-date-picker"].forEach(n=>{switch(n){case"xplor-inline-date-picker":customElements.get(n)||customElements.define(n,rc);break}})}const df=`@tailwind base;
|
|
13984
13988
|
@tailwind components;
|
|
13985
13989
|
@tailwind utilities;
|
|
13986
13990
|
@layer base {
|
|
@@ -14375,7 +14379,7 @@ ol.mdc-list.sc-xplor-date-picker li.mdc-list-item.sc-xplor-date-picker, ul.mdc-l
|
|
|
14375
14379
|
}
|
|
14376
14380
|
.date-picker__error-message.sc-xplor-date-picker {
|
|
14377
14381
|
color: #d32f2f;
|
|
14378
|
-
}`;let
|
|
14382
|
+
}`;let pf=0;const ic=M(class extends T{constructor(){super(),this.__registerHost(),this.dateChange=k(this,"dateChange"),this.xplorFocus=k(this,"xplorFocus"),this.xplorBlur=k(this,"xplorBlur"),this.xplorClear=k(this,"xplorClear"),this.value="",this.label="",this.placeholder="Select date",this.type="date",this.monthType="start",this.display="input",this.dateFormat="short",this.min="",this.max="",this.readonly=!1,this.disabled=!1,this.clearable=!1,this.closeOnSelect=!0,this.bgColor="white",this.color="#008480",this.startWeekOnSunday=!0,this.error="",this.hideDetails="auto",this.required=!1,this.isOpen=!1,this.inputText="",this.dropdownPosition="bottom",this.inputId=`xplor-date-picker-${++pf}`,this.labelId=`${this.inputId}-label`,this.errorId=`${this.inputId}-error`,this.toggleDropdown=()=>{this.disabled||this.readonly||(this.updateDropdownPosition(),this.isOpen=!this.isOpen)},this.handleInputFocus=n=>{this.xplorFocus.emit(n)},this.handleInputBlur=n=>{this.xplorBlur.emit(n);const e=this.parseInputText(this.inputText);e&&this.isDateInRange(e)?(this.value=e,this.inputText=this.formatDateForDisplay(e),this.dateChange.emit(e)):this.value?this.inputText=this.formatDateForDisplay(this.value):this.inputText=""},this.handleInputChange=n=>{const e=n.target;this.inputText=e.value},this.handleDateSelected=n=>{n.stopPropagation();const e=n.detail;if(this.isDateInRange(e)){if(this.type==="month"){const r=this.parseISODate(e);if(r){let o;this.monthType==="end"?o=new Date(r.getFullYear(),r.getMonth()+1,0):o=new Date(r.getFullYear(),r.getMonth(),1);const i=this.toISO(o);this.value=i,this.inputText=this.formatDateForDisplay(i),this.dateChange.emit(i)}}else this.value=e,this.inputText=this.formatDateForDisplay(e),this.dateChange.emit(e);this.closeOnSelect&&(this.isOpen=!1)}},this.handleClear=n=>{n.stopPropagation(),this.value="",this.inputText="",this.dateChange.emit(""),this.xplorClear.emit()},this.handleTextClick=()=>{this.disabled||this.readonly||(this.updateDropdownPosition(),this.isOpen=!this.isOpen)}}componentWillLoad(){this.value&&(this.inputText=this.formatDateForDisplay(this.value))}handleDocumentClick(n){const e=n.target;this.el.contains(e)||(this.isOpen=!1)}parseISODate(n){if(!n)return null;const e=new Date(n+"T00:00:00");return isNaN(e.getTime())?null:e}formatDateForDisplay(n){const e=this.parseISODate(n);if(!e)return n;if(this.type==="month")return new Intl.DateTimeFormat("en-AU",{month:"long",year:"numeric"}).format(e);switch(this.dateFormat){case"long":return new Intl.DateTimeFormat("en-AU",{day:"numeric",month:"short",year:"numeric"}).format(e);case"iso":return n;case"short":default:return new Intl.DateTimeFormat("en-AU",{day:"2-digit",month:"2-digit",year:"numeric"}).format(e)}}toISO(n){const e=n.getFullYear(),r=String(n.getMonth()+1).padStart(2,"0"),o=String(n.getDate()).padStart(2,"0");return`${e}-${r}-${o}`}parseInputText(n){const e=n.trim();if(!e)return null;const r=e.match(/^(\d{1,2})[/\-.](\d{1,2})[/\-.](\d{4})$/);if(r){const a=parseInt(r[1],10),s=parseInt(r[2],10),l=parseInt(r[3],10),c=new Date(l,s-1,a);if(c.getFullYear()===l&&c.getMonth()===s-1&&c.getDate()===a)return this.toISO(c)}const o=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(o){const a=parseInt(o[1],10),s=parseInt(o[2],10),l=parseInt(o[3],10),c=new Date(a,s-1,l);if(c.getFullYear()===a&&c.getMonth()===s-1&&c.getDate()===l)return this.toISO(c)}const i=new Date(e);return isNaN(i.getTime())?null:this.toISO(i)}isDateInRange(n){return n?!(this.min&&n<this.min||this.max&&n>this.max):!0}updateDropdownPosition(){const n=this.el.getBoundingClientRect(),e=window.innerHeight-n.bottom;this.dropdownPosition=e<350?"top":"bottom"}render(){const n=this.hideDetails===!1||this.hideDetails==="auto"&&this.error,e=p("svg",{key:"d78ff4ab59055d3d19d872651a7e726c0b60cfb5",class:"date-picker__icon-svg",viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},p("rect",{key:"d43dc4e0ca1d8c6b4a55484d0f6ae81f00201954",x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),p("line",{key:"1f5fe56ffa03cc49409553f0c13184667c0bed62",x1:"16",y1:"2",x2:"16",y2:"6"}),p("line",{key:"18e8c75d559ce76bcd0336241955a4018daaa270",x1:"8",y1:"2",x2:"8",y2:"6"}),p("line",{key:"880167220cb172fc0f5b18b1eb0fabfc3326501b",x1:"3",y1:"10",x2:"21",y2:"10"}));return p(E,{key:"53584be9a38a833329033b5e547c15671d43b9ea"},p("div",{key:"32c32b9abd3021718994879c797d15c7c92b200a",class:{"date-picker":!0,"date-picker--disabled":this.disabled,"date-picker--error":!!this.error,"date-picker--open":this.isOpen}},this.label&&p("label",{key:"38f0b77a965ecd259037a521984cf3edc81d83d0",class:"date-picker__label",id:this.labelId,htmlFor:this.inputId},this.label,this.required&&p("span",{key:"7d4967354fe742c08170c80286c97f353fa54d5f",class:"date-picker__required"},"*")),this.display==="text"?p("div",{class:"date-picker__text-display",onClick:this.handleTextClick,"aria-expanded":this.isOpen?"true":"false","aria-haspopup":"dialog",role:"button",tabIndex:0},p("span",{class:"date-picker__text-value"},this.value?this.formatDateForDisplay(this.value):this.placeholder),e):p("div",{class:"date-picker__field"},p("input",{id:this.inputId,type:"text",class:"date-picker__input",value:this.inputText,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onInput:this.handleInputChange,style:{backgroundColor:this.bgColor},"aria-expanded":this.isOpen?"true":"false","aria-haspopup":"dialog","aria-describedby":this.error?this.errorId:void 0,"aria-invalid":this.error?"true":void 0,"aria-required":this.required?"true":void 0}),p("div",{class:"date-picker__actions"},this.clearable&&this.value&&!this.disabled&&!this.readonly&&p("button",{type:"button",class:"date-picker__clear",onClick:this.handleClear,"aria-label":"Clear"},"×"),p("button",{type:"button",class:"date-picker__icon-btn",onClick:this.toggleDropdown,disabled:this.disabled,"aria-label":"Open calendar"},e))),n&&p("div",{key:"66ff5c32e4f6ca2db4feac663377afde49476a21",class:"date-picker__details"},this.error&&p("div",{key:"03cfd6ba58a9bb716e24fe008928744403b5d54c",class:"date-picker__error-message",id:this.errorId},this.error)),this.isOpen&&p("div",{key:"9b3f462b7c80ed5be13090d376d5f74a65563811",class:{"date-picker__dropdown":!0,"date-picker__dropdown--top":this.dropdownPosition==="top"}},p("xplor-inline-date-picker",{key:"214a5858b26b70a77d2ec4e896a5045581167d76",selectedDate:this.value,min:this.min,max:this.max,readonly:this.readonly,color:this.color,startWeekOnSunday:this.startWeekOnSunday,onDateSelected:this.handleDateSelected}))))}get el(){return this}static get style(){return df}},[2,"xplor-date-picker",{value:[1025],label:[1],placeholder:[1],type:[1],monthType:[1,"month-type"],display:[1],dateFormat:[1,"date-format"],min:[1],max:[1],readonly:[4],disabled:[4],clearable:[4],closeOnSelect:[4,"close-on-select"],bgColor:[1,"bg-color"],color:[1],startWeekOnSunday:[4,"start-week-on-sunday"],error:[1],hideDetails:[8,"hide-details"],required:[4],isOpen:[32],inputText:[32],dropdownPosition:[32]},[[4,"click","handleDocumentClick"]]]);function hf(){if(typeof customElements>"u")return;["xplor-date-picker","xplor-inline-date-picker"].forEach(n=>{switch(n){case"xplor-date-picker":customElements.get(n)||customElements.define(n,ic);break;case"xplor-inline-date-picker":customElements.get(n)||oc();break}})}const gf=ic,uf=hf,ff=`@tailwind base;
|
|
14379
14383
|
@tailwind components;
|
|
14380
14384
|
@tailwind utilities;
|
|
14381
14385
|
@layer base {
|
|
@@ -15638,7 +15642,7 @@ ol.mdc-list.sc-xplor-drag-and-drop-input li.mdc-list-item.sc-xplor-drag-and-drop
|
|
|
15638
15642
|
.file-info__remove.sc-xplor-drag-and-drop-input:hover {
|
|
15639
15643
|
background-color: #e0e0e0;
|
|
15640
15644
|
color: #424242;
|
|
15641
|
-
}`,xo="*/*",
|
|
15645
|
+
}`,xo="*/*",mf=700,ac=M(class extends T{constructor(){super(),this.__registerHost(),this.fileSelect=k(this,"fileSelect"),this.fileClear=k(this,"fileClear"),this.disabled=!1,this.accepts=xo,this.label="Drag and drop your files here",this.browseLabel="Browse Files",this.ariaLabel=null,this.progress=-1,this.dragover=!1,this.currentFile=null,this.horizontal=!1,this.onDrop=n=>{var e,r;if(n.preventDefault(),this.dragover=!1,this.disabled)return;const o=(r=(e=n.dataTransfer)===null||e===void 0?void 0:e.files)===null||r===void 0?void 0:r[0];o&&(this.currentFile=o,this.fileSelect.emit(this.currentFile))},this.onDragOver=n=>{n.preventDefault(),this.disabled||(this.dragover=!0)},this.onDragEnter=n=>{n.preventDefault(),this.disabled||(this.dragover=!0)},this.onDragLeave=n=>{n.preventDefault(),this.dragover=!1},this.onFileSelect=n=>{var e;const r=n.target,o=(e=r.files)===null||e===void 0?void 0:e[0];o&&(this.currentFile=o,this.fileSelect.emit(this.currentFile)),r.value=""},this.openFileDialog=()=>{var n;this.disabled||(n=this.fileInputEl)===null||n===void 0||n.click()},this.getAcceptsLabel=()=>{var n;const e=(n=this.accepts)===null||n===void 0?void 0:n.trim();return!e||e===xo?"*":e.split(",").map(r=>r.trim()).filter(r=>r.length>0).map(r=>r.startsWith("image/")?r.slice(6).toUpperCase():r.startsWith(".")?r.slice(1).toUpperCase():r.toUpperCase()).join("/")},this.formatFileSize=n=>{if(n===0)return"0 Bytes";const e=1024,r=["Bytes","KB","MB","GB"],o=Math.floor(Math.log(n)/Math.log(e));return parseFloat((n/Math.pow(e,o)).toFixed(2))+" "+r[o]},this.formatDate=n=>{const e=new Date(n),r=e.getDate(),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],a=e.getFullYear(),s=r===1||r===21||r===31?"st":r===2||r===22?"nd":r===3||r===23?"rd":"th",l=e.getHours(),c=e.getMinutes().toString().padStart(2,"0"),d=e.getSeconds().toString().padStart(2,"0"),h=l>=12?"PM":"AM",g=l%12||12;return`${r}${s} ${i} ${a}, ${g}:${c}:${d} ${h}`},this.showProgress=()=>this.progress>=0&&this.progress<=100}connectedCallback(){this.resizeObserver=new ResizeObserver(n=>{for(const e of n)this.horizontal=e.contentRect.width>=mf})}componentDidLoad(){const n=this.el.querySelector(".drag-drop-zone");n&&this.resizeObserver&&this.resizeObserver.observe(n)}disconnectedCallback(){var n;(n=this.resizeObserver)===null||n===void 0||n.disconnect()}async clearCurrentFile(){this.currentFile=null,this.fileInputEl&&(this.fileInputEl.value=""),this.fileClear.emit()}render(){const n=Math.min(Math.max(this.progress,0),100),e=this.ariaLabel||`${this.label}. Accepted file types: ${this.getAcceptsLabel()}. Or use the ${this.browseLabel} button.`;return p(E,{key:"2eacbaaed09889dd61176cb1f40a1f6d57a500eb"},p("div",{key:"52736f49694809e2f1e6109938b8c6c20a5a310a",class:{"drag-drop-zone":!0,"drag-drop-zone--horizontal":this.horizontal}},p("div",{key:"601660ed6210fd827ea1f70a6150386fde0cbe85",class:{"drag-drop-card":!0,"drag-drop-card--dragover":this.dragover,"drag-drop-card--disabled":this.disabled},onDrop:this.onDrop,onDragOver:this.onDragOver,onDragEnter:this.onDragEnter,onDragLeave:this.onDragLeave,role:"region","aria-label":e},p("div",{key:"326beba09aea9a50c8a4d1eaaabf3a089f39c7bb",class:"drag-drop-card__content"},p("div",{key:"44cb69927785334d44183448a70f4fdaea84d4f9",class:"drag-drop-card__body"},p("svg",{key:"5034f7cb9abed8ce8096b89a6b197e79adc3182b",class:"drag-drop-card__icon",xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},p("path",{key:"12c4a69b0d769f0b0219134f8f43b98d95872a98",d:"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04Z",fill:"currentColor",opacity:"0.3"}),p("path",{key:"464d590b120bc66cb00de7a725dacd3d4876588e",d:"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM14 13V17H10V13H7L12 8L17 13H14Z",fill:"currentColor"})),p("div",{key:"c12e46bb7cd3fa26972ab594ea64f06a05908058",class:"drag-drop-card__text"},p("h3",{key:"d9432f6f3f3a7710a2ef29aed828ef44c76658b1",class:"drag-drop-card__title"},this.label),this.accepts&&this.accepts!==xo&&p("p",{key:"917e60a73fb80146438559d9f9b1d962e6be3aaa",class:"drag-drop-card__accepts"},"Accepted file types: ",this.getAcceptsLabel()))),p("p",{key:"f45e185338d8385291aa8e561e573d5a053ff97e",class:"drag-drop-card__divider"},"or"),p("div",{key:"7a9ad643e13cce967e34299a43967cc757be9020",class:"drag-drop-card__action"},p("xplor-button",{key:"e392d2e3779f07834412ece1abce688894ecce22",text:this.browseLabel,type:this.disabled?"disabled":"primary",clickAction:this.openFileDialog,"aria-label":this.browseLabel}))))),this.currentFile&&p("div",{key:"6bc899dd7cd5fc411934dd03b81d0c85c93d6fb4",class:"file-info","aria-live":"polite"},this.showProgress()&&p("p",{key:"262868b9829c96965c68e01d6a4ae17eca16c2c9",class:"file-info__status"},"Uploading ",this.progress===100?"1":"0"," / 1"),p("div",{key:"e2213c9e6c37abbd06d6c4c4553b6a1e120c64b8",class:"file-info__card"},p("div",{key:"3ff619277dfcf66664f80df52ec729572d2e2d37",class:"file-info__icon","aria-hidden":"true"},p("svg",{key:"c7ede2f02ec8cc66b6c2145f4c2342f9a675835b",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor"},p("path",{key:"876db2e41243a14330e435fffbdea712ff1dadba",d:"M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2ZM6 20V4H13V9H18V20H6Z"}))),p("div",{key:"c704971c9290828ae4ed4385f72fce2cead6bb70",class:"file-info__details"},p("p",{key:"4a5004f7928e7edc25d1081ce8d8bddd7163d7b8",class:"file-info__name"},this.currentFile.name),p("p",{key:"e0781583e2f7021c8c389745ae2d6b25ecc9fba9",class:"file-info__meta"},this.formatFileSize(this.currentFile.size),this.currentFile.lastModified?` | Last modified: ${this.formatDate(this.currentFile.lastModified)}`:""),this.showProgress()&&p("div",{key:"893e2190e9b62fb4817824aef28f6f24d89688ba",class:"file-info__progress-row"},p("div",{key:"4bb48687b4a39bb5b261936f3e6073be44aeed42",class:"file-info__progress-bar",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Upload progress: ${Math.round(n)}%`},p("div",{key:"fff1ddc5c5913c4928f4afd38bbdc4aec46c5978",class:"file-info__progress-fill",style:{width:`${n}%`}})),p("span",{key:"0325aeb98bef764a685d46c03da1ccd1c41a9301",class:"file-info__progress-text","aria-hidden":"true"},Math.round(this.progress),"%"))),p("button",{key:"ba5c770c340a739041d387204b582cd5a819e7ad",class:"file-info__remove",onClick:()=>this.clearCurrentFile(),"aria-label":`Remove file ${this.currentFile.name}`},p("svg",{key:"03e8a7b0f531a73e3892f113ee2dab6e44db65c2",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{key:"c122d5436ca8695d6d9ffc84f1b53612d14aa0b9",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12Z"}))))),p("input",{key:"bec810bcee088ac73b13b8e9c52e4532e5c66ede",id:"drag-drop-file-select",type:"file",disabled:this.disabled,accept:this.accepts,class:"drag-drop-input-hidden",ref:r=>this.fileInputEl=r,onChange:this.onFileSelect,"aria-label":`${this.browseLabel} - ${this.label}`,tabindex:-1}))}get el(){return this}static get style(){return ff}},[2,"xplor-drag-and-drop-input",{disabled:[4],accepts:[1],label:[1],browseLabel:[1,"browse-label"],ariaLabel:[1,"aria-label"],progress:[2],dragover:[32],currentFile:[32],horizontal:[32],clearCurrentFile:[64]}]);function xf(){if(typeof customElements>"u")return;["xplor-drag-and-drop-input","xplor-button"].forEach(n=>{switch(n){case"xplor-drag-and-drop-input":customElements.get(n)||customElements.define(n,ac);break;case"xplor-button":customElements.get(n)||Lt();break}})}const bf=ac,yf=xf,vf=Yl,kf=Ql,wf=`@tailwind base;
|
|
15642
15646
|
@tailwind components;
|
|
15643
15647
|
@tailwind utilities;
|
|
15644
15648
|
@layer base {
|
|
@@ -15952,7 +15956,7 @@ ol.mdc-list.sc-xplor-expansion-panel li.mdc-list-item.sc-xplor-expansion-panel,
|
|
|
15952
15956
|
|
|
15953
15957
|
.expansion-panel__content-inner.sc-xplor-expansion-panel {
|
|
15954
15958
|
padding: 1rem 1.5rem;
|
|
15955
|
-
}`;let
|
|
15959
|
+
}`;let _f=0;const sc=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorPanelToggle=k(this,"xplorPanelToggle"),this.disabled=!1,this.open=!1,this.contentHeight=0,this.handleToggle=()=>{this.disabled||(this.open=!this.open,this.xplorPanelToggle.emit({id:this.panelId,isOpen:this.open}),setTimeout(()=>this.updateContentHeight(),0))}}componentWillLoad(){this.panelId=`panel-${_f++}`}componentDidLoad(){this.updateContentHeight()}updateContentHeight(){this.contentEl&&(this.contentHeight=this.contentEl.scrollHeight)}render(){return p(E,{key:"ec0cf0741d58e980e3fe9897d3b79908f19eac8d"},p("div",{key:"a5e1676b6646e8d0414d774408a072d96d230ef3",class:{"expansion-panel":!0,"expansion-panel--open":this.open,"expansion-panel--disabled":this.disabled}},p("button",{key:"5b56717fd245896ee650b5d5eb05343ec9995f15",class:"expansion-panel__header",onClick:this.handleToggle,disabled:this.disabled,"aria-expanded":this.open?"true":"false","aria-controls":`${this.panelId}-content`,type:"button"},p("div",{key:"d24e0e3633e513039f0341304f164095f95984bd",class:"expansion-panel__header-content"},p("slot",{key:"a58f1a4fd78d57f8e4a89d1c325ea0f24347ccaf",name:"header"})),p("span",{key:"0b1d9eb011ef40275de9d827b3a901acf9662d64",class:{"expansion-panel__icon":!0,"expansion-panel__icon--open":this.open}},"▼")),p("div",{key:"39a23cb9cd76993be5e684100f1b10c4591ac7b1",class:"expansion-panel__content",id:`${this.panelId}-content`,role:"region","aria-labelledby":this.panelId,style:{maxHeight:this.open?`${this.contentHeight}px`:"0"}},p("div",{key:"11926bcbf205bb3acc9cba477b9f623c9d5c78ea",class:"expansion-panel__content-inner",ref:n=>this.contentEl=n},p("slot",{key:"6cc362dfb63dd256422b1dfdcb1532d794feddbe"})))))}get el(){return this}static get style(){return wf}},[6,"xplor-expansion-panel",{disabled:[4],open:[1028],panelId:[32],contentHeight:[32]}]);function Cf(){if(typeof customElements>"u")return;["xplor-expansion-panel"].forEach(n=>{switch(n){case"xplor-expansion-panel":customElements.get(n)||customElements.define(n,sc);break}})}const Sf=sc,Ef=Cf,If=`@tailwind base;
|
|
15956
15960
|
@tailwind components;
|
|
15957
15961
|
@tailwind utilities;
|
|
15958
15962
|
@layer base {
|
|
@@ -16209,7 +16213,7 @@ ol.mdc-list.sc-xplor-expansion-panels li.mdc-list-item.sc-xplor-expansion-panels
|
|
|
16209
16213
|
display: flex;
|
|
16210
16214
|
flex-direction: column;
|
|
16211
16215
|
gap: 0;
|
|
16212
|
-
}`,
|
|
16216
|
+
}`,lc=M(class extends T{constructor(){super(),this.__registerHost(),this.value=[],this.multiple=!1,this.accordion=!0,this.openPanels=new Set}componentWillLoad(){Array.isArray(this.value)?this.openPanels=new Set(this.value):this.value&&(this.openPanels=new Set([this.value]))}handlePanelToggle(n){n.stopPropagation();const{id:e,isOpen:r}=n.detail;if(r)this.multiple?this.openPanels=new Set([...this.openPanels,e]):this.openPanels=new Set([e]);else{const o=new Set(this.openPanels);o.delete(e),this.openPanels=o}this.value=this.multiple?Array.from(this.openPanels):Array.from(this.openPanels)[0]||""}render(){return p(E,{key:"915aad4dd0665cd44e3b784ce6f39e30972fa720"},p("div",{key:"f608e9bd9234b6a57bd06d4f7c843ac4b9ef5a38",class:"expansion-panels","aria-label":"Accordion"},p("slot",{key:"30b0c595f0c4e503dbe8e144c3805be2a8d4aed5"})))}static get style(){return If}},[6,"xplor-expansion-panels",{value:[1025],multiple:[4],accordion:[4],openPanels:[32]},[[0,"xplorPanelToggle","handlePanelToggle"]]]);function $f(){if(typeof customElements>"u")return;["xplor-expansion-panels"].forEach(n=>{switch(n){case"xplor-expansion-panels":customElements.get(n)||customElements.define(n,lc);break}})}const Tf=lc,Mf=$f,Df=`@tailwind base;
|
|
16213
16217
|
@tailwind components;
|
|
16214
16218
|
@tailwind utilities;
|
|
16215
16219
|
@layer base {
|
|
@@ -16622,7 +16626,7 @@ ol.mdc-list.sc-xplor-file-upload li.mdc-list-item.sc-xplor-file-upload, ul.mdc-l
|
|
|
16622
16626
|
.file-upload__remove.sc-xplor-file-upload:focus {
|
|
16623
16627
|
outline: 2px solid #1976d2;
|
|
16624
16628
|
outline-offset: 2px;
|
|
16625
|
-
}`,
|
|
16629
|
+
}`,zf="*/*",cc=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorFileAdd=k(this,"xplorFileAdd"),this.xplorFileRemove=k(this,"xplorFileRemove"),this.xplorError=k(this,"xplorError"),this.accepts=zf,this.maxSize=10*1024*1024,this.multiple=!1,this.disabled=!1,this.showPreview=!0,this.label="Upload Files",this.files=[],this.isDragging=!1,this.error="",this.handleFileSelect=n=>{const e=n.target;e.files&&this.processFiles(Array.from(e.files))},this.handleDragOver=n=>{n.preventDefault(),this.disabled||(this.isDragging=!0)},this.handleDragLeave=n=>{n.preventDefault(),this.isDragging=!1},this.handleDrop=n=>{var e;n.preventDefault(),this.isDragging=!1,!this.disabled&&!((e=n.dataTransfer)===null||e===void 0)&&e.files&&this.processFiles(Array.from(n.dataTransfer.files))},this.handleRemoveFile=n=>{this.files=this.files.filter(e=>e.id!==n.id),this.xplorFileRemove.emit(n)},this.handleButtonClick=()=>{!this.disabled&&this.fileInputEl&&this.fileInputEl.click()}}processFiles(n){this.error="";const e=[];for(const r of n){if(r.size>this.maxSize){const i=(this.maxSize/1048576).toFixed(2);this.error=`File "${r.name}" exceeds maximum size of ${i}MB`,this.xplorError.emit(this.error);continue}if(this.accepts!=="*/*"){const i=this.accepts.split(",").map(l=>l.trim()),a=`.${r.name.split(".").pop()}`;if(!i.some(l=>l.endsWith("/*")?r.type.startsWith(l.replace("/*","")):l===r.type||l===a)){this.error=`File type "${r.type}" is not accepted`,this.xplorError.emit(this.error);continue}}const o={file:r,id:`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,name:r.name,size:r.size,type:r.type};if(this.showPreview&&r.type.startsWith("image/")){const i=new FileReader;i.onload=a=>{var s;o.dataUrl=(s=a.target)===null||s===void 0?void 0:s.result,this.files=[...this.files]},i.readAsDataURL(r)}e.push(o)}e.length>0&&(this.multiple?this.files=[...this.files,...e]:this.files=[e[0]],this.xplorFileAdd.emit(e)),this.fileInputEl&&(this.fileInputEl.value="")}formatFileSize(n){if(n===0)return"0 Bytes";const e=1024,r=["Bytes","KB","MB","GB"],o=Math.floor(Math.log(n)/Math.log(e));return Math.round(n/Math.pow(e,o)*100)/100+" "+r[o]}render(){return p(E,{key:"cf146eb8fadc05f46253e96a189508447ab7b3d4"},p("div",{key:"672ebaac1aa611f51b673d5d23f04bf7874ab376",class:"file-upload"},p("div",{key:"8c59c36125bb7e99940a8208e0db3978499b5728",class:{"file-upload__dropzone":!0,"file-upload__dropzone--dragging":this.isDragging,"file-upload__dropzone--disabled":this.disabled},onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop,"aria-label":`Drop zone for file upload. ${this.accepts!=="*/*"?`Accepts: ${this.accepts}.`:""} Maximum size: ${this.formatFileSize(this.maxSize)}`},p("input",{key:"1f3125b36debba5fb8931850154b6cc0a3ebcf40",ref:n=>this.fileInputEl=n,type:"file",accept:this.accepts,multiple:this.multiple,disabled:this.disabled,onChange:this.handleFileSelect,class:"file-upload__input"}),p("div",{key:"5956b2840433dfa4dd2d8874bcaa133dc13b2468",class:"file-upload__content"},p("svg",{key:"90c23bc86b89941009eecaec7ac786c0822d3e7b",class:"file-upload__icon",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none"},p("path",{key:"6a638d3c13e465d9b2b8c2c0b298a3e9da5fd06f",d:"M12 15V3M12 3L8 7M12 3L16 7",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),p("path",{key:"535d50c699a4367b88e62f007a3d3d6d53347dbc",d:"M2 17L2 19C2 20.1046 2.89543 21 4 21L20 21C21.1046 21 22 20.1046 22 19L22 17",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})),p("p",{key:"83531b59abf5b300c2e850c057f90e1b82996210",class:"file-upload__text"},"Drag & drop files here or"," ",p("button",{key:"5ea856d24ce7b87ebdfae3274ec9199cad0c0b20",type:"button",class:"file-upload__button",onClick:this.handleButtonClick,disabled:this.disabled},this.label)),p("p",{key:"3a5bf9ef84a50d26a7ab86bc97fa1b38db239c03",class:"file-upload__hint"},"Max size: ",this.formatFileSize(this.maxSize),this.accepts!=="*/*"&&` • Accepts: ${this.accepts}`))),this.error&&p("div",{key:"a78d9953e8356c6bb43ac13341fb9f211ae2694b",class:"file-upload__error",role:"alert"},this.error),this.files.length>0&&p("div",{key:"4d88ddac01a98bd991fed2fdf190cc9f095707a4",class:"file-upload__files"},this.files.map(n=>p("div",{key:n.id,class:"file-upload__file"},n.dataUrl&&p("img",{src:n.dataUrl,alt:n.name,class:"file-upload__preview"}),p("div",{class:"file-upload__file-info"},p("span",{class:"file-upload__file-name",title:n.name},n.name),p("span",{class:"file-upload__file-size"},this.formatFileSize(n.size))),p("button",{type:"button",class:"file-upload__remove",onClick:()=>this.handleRemoveFile(n),"aria-label":`Remove ${n.name}`},"×"))))))}static get style(){return Df}},[2,"xplor-file-upload",{accepts:[1],maxSize:[2,"max-size"],multiple:[4],disabled:[4],showPreview:[4,"show-preview"],label:[1],files:[32],isDragging:[32],error:[32]}]);function Of(){if(typeof customElements>"u")return;["xplor-file-upload"].forEach(n=>{switch(n){case"xplor-file-upload":customElements.get(n)||customElements.define(n,cc);break}})}const Af=cc,Lf=Of,Pf=`@tailwind base;
|
|
16626
16630
|
@tailwind components;
|
|
16627
16631
|
@tailwind utilities;
|
|
16628
16632
|
@layer base {
|
|
@@ -16902,7 +16906,7 @@ ol.mdc-list.sc-xplor-inline-checkbox li.mdc-list-item.sc-xplor-inline-checkbox,
|
|
|
16902
16906
|
}
|
|
16903
16907
|
.xplor-inline-checkbox--disabled.sc-xplor-inline-checkbox .xplor-inline-checkbox__label.sc-xplor-inline-checkbox {
|
|
16904
16908
|
color: rgba(0, 0, 0, 0.38);
|
|
16905
|
-
}`,
|
|
16909
|
+
}`,dc=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorChange=k(this,"xplorChange"),this.checked=!1,this.color="#008480",this.disabled=!1,this.indeterminate=!1,this.label="",this.handleChange=n=>{const e=n.target;this.checked=e.checked,this.xplorChange.emit(this.checked)}}render(){const n={"xplor-inline-checkbox":!0,"xplor-inline-checkbox--disabled":this.disabled,"xplor-inline-checkbox--checked":this.checked};return p(E,{key:"6c625424d179755dd930d006c64b6a172f393b19"},p("label",{key:"c4fb7542f9e62050bdcaef33a46f80e9fa37fe90",class:n},p("input",{key:"0c116552b286e2b7f43196cb4bf8eaf823cc6472",type:"checkbox",class:"xplor-inline-checkbox__input",checked:this.checked,value:this.value,disabled:this.disabled,indeterminate:this.indeterminate,onChange:this.handleChange,style:{accentColor:this.color}}),this.label&&p("span",{key:"1b8a24dffab83791a336d84dd92385f068ffc595",class:"xplor-inline-checkbox__label"},this.label),p("slot",{key:"224e152167e79a599c6ad72cd60c3ed225a37a1b"})))}static get style(){return Pf}},[6,"xplor-inline-checkbox",{checked:[1028],value:[8],color:[1],disabled:[4],indeterminate:[4],label:[1]}]);function Rf(){if(typeof customElements>"u")return;["xplor-inline-checkbox"].forEach(n=>{switch(n){case"xplor-inline-checkbox":customElements.get(n)||customElements.define(n,dc);break}})}const Bf=dc,Nf=Rf,Ff=rc,Hf=oc,jf=`@tailwind base;
|
|
16906
16910
|
@tailwind components;
|
|
16907
16911
|
@tailwind utilities;
|
|
16908
16912
|
@layer base {
|
|
@@ -17225,7 +17229,7 @@ ol.mdc-list.sc-xplor-inline-switch li.mdc-list-item.sc-xplor-inline-switch, ul.m
|
|
|
17225
17229
|
.xplor-inline-switch__input.sc-xplor-inline-switch:focus + .xplor-inline-switch__track.sc-xplor-inline-switch {
|
|
17226
17230
|
outline: 2px solid var(--switch-color);
|
|
17227
17231
|
outline-offset: 2px;
|
|
17228
|
-
}`,
|
|
17232
|
+
}`,pc=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorChange=k(this,"xplorChange"),this.checked=!1,this.color="#008480",this.disabled=!1,this.label="",this.handleChange=n=>{const e=n.target;this.checked=e.checked,this.xplorChange.emit(this.checked)}}render(){const n={"xplor-inline-switch":!0,"xplor-inline-switch--disabled":this.disabled,"xplor-inline-switch--checked":this.checked};return p(E,{key:"40c4b15ff78042a8ef5ee7055e10f694bfdd1157"},p("label",{key:"2105c92c9277a8ba7c4b69a8f72678181bf5b1a8",class:n,style:{"--switch-color":this.color}},p("input",{key:"4165706883a4b517e8c5413d7e1421fff1b96bac",type:"checkbox",class:"xplor-inline-switch__input",checked:this.checked,value:this.value,disabled:this.disabled,onChange:this.handleChange}),p("span",{key:"94dab33872aee8012cd05101e8fbb69bd940b098",class:"xplor-inline-switch__track"},p("span",{key:"82ef76b07835561676897ba35c268bb565a4150f",class:"xplor-inline-switch__thumb"})),this.label&&p("span",{key:"1e0f0c5abf6f3c6af2d7313e750f29b03b42e4e9",class:"xplor-inline-switch__label"},this.label),p("slot",{key:"6fcdc1730d652bcca0d5c629cc66266abb86574e"})))}static get style(){return jf}},[6,"xplor-inline-switch",{checked:[1028],value:[8],color:[1],disabled:[4],label:[1]}]);function Xf(){if(typeof customElements>"u")return;["xplor-inline-switch"].forEach(n=>{switch(n){case"xplor-inline-switch":customElements.get(n)||customElements.define(n,pc);break}})}const Vf=pc,Wf=Xf,Uf=`@tailwind base;
|
|
17229
17233
|
@tailwind components;
|
|
17230
17234
|
@tailwind utilities;
|
|
17231
17235
|
@layer base {
|
|
@@ -17596,7 +17600,7 @@ ol.mdc-list.sc-xplor-input-file li.mdc-list-item.sc-xplor-input-file, ul.mdc-lis
|
|
|
17596
17600
|
font-size: 0.75rem;
|
|
17597
17601
|
color: rgba(0, 0, 0, 0.6);
|
|
17598
17602
|
padding: 0 1rem;
|
|
17599
|
-
}`;let
|
|
17603
|
+
}`;let qf=0;const hc=M(class extends T{constructor(){super(),this.__registerHost(),this.attach=k(this,"attach"),this.xplorClear=k(this,"xplorClear"),this.inputId=`xplor-input-file-${++qf}`,this.label="",this.placeholder="Choose file(s)",this.color="#008480",this.disabled=!1,this.multiple=!1,this.accept="",this.maxChips=1,this.counter=!0,this.showSize=1e3,this.prependInnerIcon="📎",this.selectedFiles=[],this.handleFileChange=n=>{const e=n.target;e.files&&(this.selectedFiles=Array.from(e.files),this.attach.emit(this.selectedFiles))},this.handleClear=()=>{this.selectedFiles=[],this.fileInputRef&&(this.fileInputRef.value=""),this.xplorClear.emit()},this.formatFileSize=n=>{if(n===0)return"0 Bytes";const e=1024,r=["Bytes","KB","MB","GB"],o=Math.floor(Math.log(n)/Math.log(e));return Math.round(n/Math.pow(e,o)*100)/100+" "+r[o]}}render(){const n={"xplor-input-file":!0,"xplor-input-file--disabled":this.disabled},e=this.selectedFiles.slice(0,this.maxChips),r=this.selectedFiles.length-this.maxChips;return p(E,{key:"6046d07e1d0ffc22eb241e951c6adffad6c3e3de"},p("div",{key:"7cedfc886300027a00eb38ac657c09b2445d37cf",class:n},this.label&&p("label",{key:"2c0e0b16e4d2e9c4a7a49874a00a7ad9592021d1",class:"xplor-input-file__label",htmlFor:this.inputId},this.label),p("div",{key:"4aa03e8dd2c2b33ad6b21d5ff5e23f2f5777e7ed",class:"xplor-input-file__field"},p("span",{key:"5e0ee10df523cf58f2b4858c2c3f7520734812ce",class:"xplor-input-file__icon"},this.prependInnerIcon),p("div",{key:"30075554073f992c027c976bd776a70e55a54f96",class:"xplor-input-file__content"},this.selectedFiles.length===0?p("span",{class:"xplor-input-file__placeholder"},this.placeholder):p("div",{class:"xplor-input-file__chips"},e.map(o=>p("div",{class:"xplor-input-file__chip",key:o.name},p("span",{class:"xplor-input-file__chip-text"},o.name),this.showSize&&o.size&&p("span",{class:"xplor-input-file__chip-size"},"(",this.formatFileSize(o.size),")"))),r>0&&p("span",{class:"xplor-input-file__additional"},"+",r," additional file",r>1?"s":""))),this.selectedFiles.length>0&&!this.disabled&&p("button",{key:"fedfcf641b1a9e11f86e1d8f24b1591d5d3b7324",type:"button",class:"xplor-input-file__clear",onClick:this.handleClear,"aria-label":"Clear"},"✕"),p("input",{key:"51216edbb463cc891afe25cbb740fc9e39188bc6",id:this.inputId,ref:o=>this.fileInputRef=o,type:"file",class:"xplor-input-file__input",multiple:this.multiple,accept:this.accept,disabled:this.disabled,onChange:this.handleFileChange,"aria-label":this.label||"Choose file"})),this.counter&&this.selectedFiles.length>0&&p("div",{key:"1eb9aa1da01c8892326a270675f9e6c02548276c",class:"xplor-input-file__counter"},this.selectedFiles.length," file",this.selectedFiles.length>1?"s":""," selected")))}static get style(){return Uf}},[2,"xplor-input-file",{label:[1],placeholder:[1],color:[1],disabled:[4],multiple:[4],accept:[1],maxChips:[2,"max-chips"],counter:[4],showSize:[2,"show-size"],prependInnerIcon:[1,"prepend-inner-icon"],selectedFiles:[32]}]);function Kf(){if(typeof customElements>"u")return;["xplor-input-file"].forEach(n=>{switch(n){case"xplor-input-file":customElements.get(n)||customElements.define(n,hc);break}})}const Jf=hc,Gf=Kf,Yf=`@tailwind base;
|
|
17600
17604
|
@tailwind components;
|
|
17601
17605
|
@tailwind utilities;
|
|
17602
17606
|
@layer base {
|
|
@@ -17947,7 +17951,7 @@ ol.mdc-list.sc-xplor-input-search li.mdc-list-item.sc-xplor-input-search, ul.mdc
|
|
|
17947
17951
|
}
|
|
17948
17952
|
.xplor-input-search--disabled.sc-xplor-input-search .xplor-input-search__field.sc-xplor-input-search {
|
|
17949
17953
|
background-color: rgba(0, 0, 0, 0.04);
|
|
17950
|
-
}`;let
|
|
17954
|
+
}`;let Qf=0;const gc=M(class extends T{constructor(){super(),this.__registerHost(),this.search=k(this,"search"),this.inputId=`xplor-input-search-${++Qf}`,this.value="",this.placeholder="Search...",this.bgColor="white",this.color="#008480",this.disabled=!1,this.density="default",this.isFocused=!1,this.handleInput=n=>{const e=n.target;this.value=e.value},this.handleSearch=()=>{this.search.emit(this.value)},this.handleKeyDown=n=>{n.key==="Enter"&&this.handleSearch()}}render(){const n={"xplor-input-search":!0,[`xplor-input-search--${this.density}`]:!0,"xplor-input-search--focused":this.isFocused,"xplor-input-search--disabled":this.disabled};return p(E,{key:"9a6ee3c5c790fd37995f34937090bd5400c87a3b"},p("div",{key:"e2dc574436c7acf421bbd1294a2eb2fed5449e88",class:n},p("div",{key:"aada1f1d2824b93e4595316a02a9dd7363b2afc0",class:"xplor-input-search__field"},p("input",{key:"ef5b78b7f259c38bcbf7757ea551a71db2a2e22c",id:this.inputId,type:"search",class:"xplor-input-search__input",value:this.value,placeholder:this.placeholder,disabled:this.disabled,onInput:this.handleInput,onKeyDown:this.handleKeyDown,onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,style:{backgroundColor:this.bgColor},role:"searchbox","aria-label":"Search"}),p("slot",{key:"fd71c5fdbe26ca8a9a151ae6423d88736d145d61",name:"append-inner"},p("button",{key:"bba0473372fcf00b1499e73ed134ad8b0500b95f",type:"button",class:"xplor-input-search__button",onClick:this.handleSearch,disabled:this.disabled,"data-testid":"input-search-button","aria-label":"Search"},p("svg",{key:"6d5a1c9c1cf80194cc8451824e212e2b9d667ad6",viewBox:"0 0 24 24",class:"xplor-input-search__icon"},p("path",{key:"7907dad7eec82444844b1938437a9ad28946d5cb",d:"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"})))))))}static get style(){return Yf}},[6,"xplor-input-search",{value:[1025],placeholder:[1],bgColor:[1,"bg-color"],color:[1],disabled:[4],density:[1],isFocused:[32]}]);function Zf(){if(typeof customElements>"u")return;["xplor-input-search"].forEach(n=>{switch(n){case"xplor-input-search":customElements.get(n)||customElements.define(n,gc);break}})}const nm=gc,em=Zf,tm=`@tailwind base;
|
|
17951
17955
|
@tailwind components;
|
|
17952
17956
|
@tailwind utilities;
|
|
17953
17957
|
@layer base {
|
|
@@ -18319,7 +18323,7 @@ ol.mdc-list.sc-xplor-input-select li.mdc-list-item.sc-xplor-input-select, ul.mdc
|
|
|
18319
18323
|
}
|
|
18320
18324
|
.xplor-input-select__helper-text.sc-xplor-input-select {
|
|
18321
18325
|
color: rgba(0, 0, 0, 0.6);
|
|
18322
|
-
}`,
|
|
18326
|
+
}`,uc=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorChange=k(this,"xplorChange"),this.value=null,this.label="",this.placeholder="Select...",this.options=[],this.multiple=!1,this.bgColor="white",this.color="#008480",this.disabled=!1,this.readonly=!1,this.hideDetails="auto",this.error="",this.helperText="",this.required=!1,this.isOpen=!1,this.isFocused=!1,this.menuPosition=null,this.highlightedIndex=-1,this.updateMenuPosition=()=>{if(this.fieldRef){const n=this.fieldRef.getBoundingClientRect();this.menuPosition={top:n.bottom+4,left:n.left,width:n.width}}},this.handleOutsideClick=n=>{this.selectRef&&!this.selectRef.contains(n.target)&&(this.isOpen=!1)},this.toggleDropdown=()=>{!this.disabled&&!this.readonly&&(this.isOpen||(this.updateMenuPosition(),this.highlightedIndex=-1),this.isOpen=!this.isOpen,this.isOpen||(this.highlightedIndex=-1))},this.handleOptionClick=n=>{if(this.multiple){const e=Array.isArray(this.value)?this.value:[],r=e.findIndex(o=>o===n.value);r>-1?this.value=e.filter((o,i)=>i!==r):this.value=[...e,n.value]}else this.value=n.value,this.isOpen=!1;this.xplorChange.emit(this.value)},this.isSelected=n=>this.multiple?(Array.isArray(this.value)?this.value:[]).includes(n.value):this.value===n.value,this.getDisplayValue=()=>{if(this.multiple){const e=Array.isArray(this.value)?this.value:[];return e.length===0?this.placeholder:`${this.options.filter(o=>e.includes(o.value)).length} selected`}const n=this.options.find(e=>e.value===this.value);return n?n.title:this.placeholder}}componentDidLoad(){document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){document.removeEventListener("click",this.handleOutsideClick)}handleKeyDown(n){var e;const r=this.options.length;if(r!==0)switch(n.key){case"ArrowDown":n.preventDefault(),this.isOpen?this.highlightedIndex=this.highlightedIndex<r-1?this.highlightedIndex+1:0:(this.updateMenuPosition(),this.isOpen=!0,this.highlightedIndex=0),this.scrollToHighlightedOption();break;case"ArrowUp":n.preventDefault(),this.isOpen?this.highlightedIndex=this.highlightedIndex>0?this.highlightedIndex-1:r-1:(this.updateMenuPosition(),this.isOpen=!0,this.highlightedIndex=r-1),this.scrollToHighlightedOption();break;case"Enter":case" ":n.preventDefault(),this.isOpen&&this.highlightedIndex>=0&&this.highlightedIndex<r?this.handleOptionClick(this.options[this.highlightedIndex]):this.isOpen||this.toggleDropdown();break;case"Escape":n.preventDefault(),this.isOpen=!1,this.highlightedIndex=-1,(e=this.fieldRef)===null||e===void 0||e.focus();break;case"Home":this.isOpen&&(n.preventDefault(),this.highlightedIndex=0,this.scrollToHighlightedOption());break;case"End":this.isOpen&&(n.preventDefault(),this.highlightedIndex=r-1,this.scrollToHighlightedOption());break;case"Tab":this.isOpen=!1,this.highlightedIndex=-1;break}}scrollToHighlightedOption(){requestAnimationFrame(()=>{if(this.selectRef&&this.highlightedIndex>=0){const n=this.selectRef.querySelector(`[data-option-index="${this.highlightedIndex}"]`);n&&n.scrollIntoView({block:"nearest"})}})}render(){const n={"xplor-input-select":!0,"xplor-input-select--open":this.isOpen,"xplor-input-select--focused":this.isFocused,"xplor-input-select--disabled":this.disabled,"xplor-input-select--error":!!this.error},e=this.hideDetails===!1||this.hideDetails==="auto"&&(this.error||this.helperText),r="input-select-listbox",o="input-select-label",i="input-select-error",a="input-select-helper",s=this.highlightedIndex>=0?`input-select-option-${this.highlightedIndex}`:void 0,l=[];this.error&&l.push(i),!this.error&&this.helperText&&l.push(a);const c=l.length>0?l.join(" "):void 0;return p(E,{key:"19c2267c0d4185dcb92a346a876b55c3371c071f"},p("div",{key:"fd506ff00dfbf41d28537f0ca9e30d72729285d9",class:n,ref:d=>this.selectRef=d},this.label&&p("label",{key:"33bdce10e83128e2a742a274e3ff3d918b8b4e45",class:"xplor-input-select__label",id:o},this.label,this.required&&p("span",{key:"9326a0077c2acd34f2f4a123f79e3342f7610557",class:"xplor-input-select__required"},"*")),p("div",{key:"7d632eed242ac59dbe8d856d2c354149b83a51bf",class:"xplor-input-select__field",onClick:this.toggleDropdown,ref:d=>this.fieldRef=d,role:"combobox",tabindex:this.disabled?-1:0,"aria-expanded":this.isOpen?"true":"false","aria-haspopup":"listbox","aria-controls":this.isOpen?r:void 0,"aria-activedescendant":s,"aria-labelledby":this.label?o:void 0,"aria-label":this.label?void 0:this.ariaLabel||this.placeholder,"aria-describedby":c,"aria-required":this.required?"true":void 0,"aria-disabled":this.disabled?"true":void 0},p("div",{key:"d07d43f99e57bec7338699b56d9bcf9f3e4b287a",class:"xplor-input-select__value"},this.getDisplayValue()),p("span",{key:"342d784c9b51bb11aebef84ae658d2c5546e12d5",class:"xplor-input-select__arrow","aria-hidden":"true"},this.isOpen?"▲":"▼")),this.isOpen&&this.menuPosition&&p("div",{key:"18d8c79f781f348e646771c274a7ec3fcc880fdf",class:"xplor-input-select__menu",role:"listbox",id:r,"aria-label":this.label||this.ariaLabel||"Options","aria-multiselectable":this.multiple?"true":void 0,style:{position:"fixed",top:`${this.menuPosition.top}px`,left:`${this.menuPosition.left}px`,width:`${this.menuPosition.width}px`}},this.options.length===0?p("div",{class:"xplor-input-select__empty",role:"option","aria-disabled":"true"},"No options available"):this.options.map((d,h)=>{const g=this.isSelected(d);return p("div",{key:d.value,id:`input-select-option-${h}`,"data-option-index":h,role:"option","aria-selected":g?"true":"false",class:{"xplor-input-select__option":!0,"xplor-input-select__option--selected":g,"xplor-input-select__option--highlighted":h===this.highlightedIndex},onClick:()=>this.handleOptionClick(d)},this.multiple&&p("input",{type:"checkbox",class:"xplor-input-select__checkbox",checked:g,readOnly:!0,tabindex:-1,"aria-checked":g?"true":"false","aria-hidden":"true"}),p("div",{class:"xplor-input-select__option-content"},p("div",{class:"xplor-input-select__option-title"},d.title),d.subtitle&&p("div",{class:"xplor-input-select__option-subtitle"},d.subtitle)))})),e&&p("div",{key:"f2d51f7549e0fafdf125bf492cd3981e13a10ef9",class:"xplor-input-select__details"},this.error&&p("div",{key:"028e8f2d27dcfc3888f078c02311879a93935db4",class:"xplor-input-select__error-message",id:i,role:"alert"},this.error),!this.error&&this.helperText&&p("div",{key:"200b65f2a002c6ba54a7d638e2cba2850bdf526f",class:"xplor-input-select__helper-text",id:a},this.helperText))))}get el(){return this}static get style(){return tm}},[2,"xplor-input-select",{ariaLabel:[1,"aria-label"],value:[1032],label:[1],placeholder:[1],options:[16],multiple:[4],bgColor:[1,"bg-color"],color:[1],disabled:[4],readonly:[4],hideDetails:[8,"hide-details"],error:[1],helperText:[1,"helper-text"],required:[4],isOpen:[32],isFocused:[32],menuPosition:[32],highlightedIndex:[32]},[[0,"keydown","handleKeyDown"]]]);function rm(){if(typeof customElements>"u")return;["xplor-input-select"].forEach(n=>{switch(n){case"xplor-input-select":customElements.get(n)||customElements.define(n,uc);break}})}const om=uc,im=rm,am=`@tailwind base;
|
|
18323
18327
|
@tailwind components;
|
|
18324
18328
|
@tailwind utilities;
|
|
18325
18329
|
@layer base {
|
|
@@ -18611,7 +18615,7 @@ ol.mdc-list.sc-xplor-input-send li.mdc-list-item.sc-xplor-input-send, ul.mdc-lis
|
|
|
18611
18615
|
|
|
18612
18616
|
.input-send__button.sc-xplor-input-send {
|
|
18613
18617
|
flex-shrink: 0;
|
|
18614
|
-
}`,
|
|
18618
|
+
}`,fc=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorSend=k(this,"xplorSend"),this.xplorValueChange=k(this,"xplorValueChange"),this.placeholder="Type a message...",this.disabled=!1,this.value="",this.buttonText="Send",this.buttonType="primary",this.internalValue="",this.handleInput=n=>{const e=n.target;this.internalValue=e.value,this.value=e.value,this.xplorValueChange.emit(e.value)},this.handleKeyDown=n=>{n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),this.handleSend())},this.handleSend=()=>{this.disabled||!this.internalValue.trim()||(this.xplorSend.emit(this.internalValue.trim()),this.internalValue="",this.value="",this.inputEl&&this.inputEl.focus())}}componentWillLoad(){this.internalValue=this.value}render(){return p(E,{key:"856b9171408964c11a5ed8d7fc06bdf559e9d43b"},p("div",{key:"1f53244b4bf383f38c76339736b40ccc6c74bd63",class:{"input-send":!0,"input-send--disabled":this.disabled}},p("input",{key:"ab7f0a797f7eb6e56516498abd0e5d29de0f9403",ref:n=>this.inputEl=n,type:"text",class:"input-send__input",placeholder:this.placeholder,value:this.internalValue,onInput:this.handleInput,onKeyDown:this.handleKeyDown,disabled:this.disabled,maxLength:this.maxLength,"aria-label":this.placeholder||"Type a message"}),p("xplor-button",{key:"2213d6749d7e8412061d6d6adc97b93b18c573cb",class:"input-send__button",text:this.buttonText,type:this.disabled||!this.internalValue.trim()?"disabled":this.buttonType,onClick:this.handleSend})))}static get style(){return am}},[2,"xplor-input-send",{placeholder:[1],disabled:[4],maxLength:[2,"max-length"],value:[1025],buttonText:[1,"button-text"],buttonType:[1,"button-type"],internalValue:[32]}]);function sm(){if(typeof customElements>"u")return;["xplor-input-send","xplor-button"].forEach(n=>{switch(n){case"xplor-input-send":customElements.get(n)||customElements.define(n,fc);break;case"xplor-button":customElements.get(n)||Lt();break}})}const lm=fc,cm=sm,dm=`@tailwind base;
|
|
18615
18619
|
@tailwind components;
|
|
18616
18620
|
@tailwind utilities;
|
|
18617
18621
|
@layer base {
|
|
@@ -18976,7 +18980,7 @@ ol.mdc-list.sc-xplor-input-text-area li.mdc-list-item.sc-xplor-input-text-area,
|
|
|
18976
18980
|
}
|
|
18977
18981
|
.xplor-input-text-area__helper-text.sc-xplor-input-text-area {
|
|
18978
18982
|
color: rgba(0, 0, 0, 0.6);
|
|
18979
|
-
}`;let
|
|
18983
|
+
}`;let pm=0;const mc=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorInput=k(this,"xplorInput"),this.xplorChange=k(this,"xplorChange"),this.xplorClear=k(this,"xplorClear"),this.inputId=`xplor-input-text-area-${++pm}`,this.errorId=`${this.inputId}-error`,this.helperId=`${this.inputId}-helper`,this.value="",this.label="",this.placeholder="",this.bgColor="white",this.color="#008480",this.disabled=!1,this.readonly=!1,this.clearable=!0,this.rows=3,this.hideDetails="auto",this.error="",this.helperText="",this.required=!1,this.isFocused=!1,this.handleInput=n=>{const e=n.target;this.value=e.value,this.xplorInput.emit(this.value)},this.handleChange=n=>{const e=n.target;this.value=e.value,this.xplorChange.emit(this.value)},this.handleClear=()=>{this.value="",this.xplorClear.emit(),this.xplorChange.emit(this.value)}}render(){const n=this.value!=null&&this.value!=="",e=this.isFocused||n,r={"xplor-input-text-area":!0,"xplor-input-text-area--focused":this.isFocused,"xplor-input-text-area--floating":e,"xplor-input-text-area--disabled":this.disabled,"xplor-input-text-area--error":!!this.error},o=this.clearable&&this.value&&!this.readonly&&!this.disabled,i=this.hideDetails===!1||this.hideDetails==="auto"&&(this.error||this.helperText);return p(E,{key:"499771f2851bb143873f4eeffd8b94b2ebea25d1"},p("div",{key:"1146216625f0e53726e89fa501b6693a2fa193d6",class:r},p("div",{key:"b15032551ad190e6a55aef831e1a5aca8362a858",class:"xplor-input-text-area__field"},p("textarea",{key:"48727ed731a8c91ec7d60c1416505485c9986941",id:this.inputId,class:"xplor-input-text-area__input",value:this.value,placeholder:e?this.placeholder:"",disabled:this.disabled,readonly:this.readonly,required:this.required,rows:this.rows,onInput:this.handleInput,onChange:this.handleChange,onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,style:{backgroundColor:this.bgColor},"aria-invalid":this.error?"true":void 0,"aria-required":this.required?"true":void 0,"aria-describedby":this.error?this.errorId:this.helperText?this.helperId:void 0}),this.label&&p("label",{key:"be53c38576a49ca6e569628944d2ffde34a1f974",class:"xplor-input-text-area__label",htmlFor:this.inputId,style:{backgroundColor:this.bgColor}},this.label,this.required&&p("span",{key:"c5c477c25d45ecad8eaa796486d9957b6bad2b42",class:"xplor-input-text-area__required"},"*")),o&&p("button",{key:"3071ff6a2a2f95a27bad3f2659591a442c9ad472",type:"button",class:"xplor-input-text-area__clear",onClick:this.handleClear,"aria-label":"Clear"},"✕")),i&&p("div",{key:"dbc13a86ce7ef5f97851e50a64b6905f04eb896d",class:"xplor-input-text-area__details"},this.error&&p("div",{key:"9575a980cca5901ee68b5a40a1ee26827ac45126",class:"xplor-input-text-area__error-message",id:this.errorId},this.error),!this.error&&this.helperText&&p("div",{key:"32a790df7518f6a042bf0737bf1466098f947beb",class:"xplor-input-text-area__helper-text",id:this.helperId},this.helperText))))}static get style(){return dm}},[2,"xplor-input-text-area",{value:[1025],label:[1],placeholder:[1],bgColor:[1,"bg-color"],color:[1],disabled:[4],readonly:[4],clearable:[4],rows:[2],hideDetails:[8,"hide-details"],error:[1],helperText:[1,"helper-text"],required:[4],isFocused:[32]}]);function hm(){if(typeof customElements>"u")return;["xplor-input-text-area"].forEach(n=>{switch(n){case"xplor-input-text-area":customElements.get(n)||customElements.define(n,mc);break}})}const gm=mc,um=hm,fm=`@tailwind base;
|
|
18980
18984
|
@tailwind components;
|
|
18981
18985
|
@tailwind utilities;
|
|
18982
18986
|
@layer base {
|
|
@@ -19295,7 +19299,7 @@ ol.mdc-list.sc-xplor-input-text-secondary li.mdc-list-item.sc-xplor-input-text-s
|
|
|
19295
19299
|
}
|
|
19296
19300
|
.input-secondary__helper-text.sc-xplor-input-text-secondary {
|
|
19297
19301
|
color: rgba(0, 0, 0, 0.6);
|
|
19298
|
-
}`;let
|
|
19302
|
+
}`;let mm=0;const xc=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorInput=k(this,"xplorInput"),this.xplorChange=k(this,"xplorChange"),this.xplorFocus=k(this,"xplorFocus"),this.xplorBlur=k(this,"xplorBlur"),this.inputId=`xplor-input-text-secondary-${++mm}`,this.errorId=`${this.inputId}-error`,this.helperId=`${this.inputId}-helper`,this.value="",this.label="",this.placeholder="",this.type="text",this.bgColor="white",this.disabled=!1,this.readonly=!1,this.hideDetails="auto",this.error="",this.helperText="",this.required=!1,this.isDirty=!1,this.isFocused=!1,this.handleInput=n=>{const e=n.target;this.value=e.value,this.xplorInput.emit(this.value)},this.handleChange=n=>{const e=n.target;this.value=e.value,this.xplorChange.emit(this.value)},this.handleFocus=n=>{this.isFocused=!0,this.xplorFocus.emit(n)},this.handleBlur=n=>{this.isFocused=!1,this.xplorBlur.emit(n)}}render(){const n={"input-secondary":!0,"input-secondary--focused":this.isFocused,"input-secondary--disabled":this.disabled,"input-secondary--error":!!this.error,"input-secondary--dirty":this.isDirty},e=this.hideDetails===!1||this.hideDetails==="auto"&&(this.error||this.helperText);return p(E,{key:"a62362fc1f52b7206cffc0756a1a32cdcfbf3ec0"},p("div",{key:"c4358644e222ebb2d2349d2f11e7bee17d032c1d",class:n},this.label&&p("label",{key:"95dd10cc4f9c27d50aaf6beb5993bf68f45a6352",class:"input-secondary__label",htmlFor:this.inputId},this.label,this.required&&p("span",{key:"c904c62b4d8124adff62eb8b9759da11835a50cf",class:"input-secondary__required"},"*")),p("div",{key:"72ee352843e05f39be97683a4c5d16172e72cb9a",class:"input-secondary__field"},p("input",{key:"f76ba5ffa6047ff85fbe73541055c3e5fc56632d",id:this.inputId,type:this.type,class:"input-secondary__input",value:this.value,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,required:this.required,onInput:this.handleInput,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur,style:{backgroundColor:this.bgColor},"aria-invalid":this.error?"true":void 0,"aria-required":this.required?"true":void 0,"aria-describedby":this.error?this.errorId:this.helperText?this.helperId:void 0}),p("slot",{key:"521dbc72d697f2fb86c0d192efeb987f6033c587",name:"append-inner"})),e&&p("div",{key:"e155a41d29fd859467e277799746bc253f28aa73",class:"input-secondary__details"},this.error&&p("div",{key:"fa3b2fbc558a6d5024a77d011141264d2155def8",class:"input-secondary__error-message",id:this.errorId},this.error),!this.error&&this.helperText&&p("div",{key:"9f0598ea14a287cdc25435e4f8caf740b722bfb3",class:"input-secondary__helper-text",id:this.helperId},this.helperText)),p("slot",{key:"e65a65f11e1d63118dd2566d0eeae7b950ff5987",name:"append"})))}static get style(){return fm}},[6,"xplor-input-text-secondary",{value:[1025],label:[1],placeholder:[1],type:[1],bgColor:[1,"bg-color"],disabled:[4],readonly:[4],hideDetails:[8,"hide-details"],error:[1],helperText:[1,"helper-text"],required:[4],isDirty:[4,"is-dirty"],isFocused:[32]}]);function xm(){if(typeof customElements>"u")return;["xplor-input-text-secondary"].forEach(n=>{switch(n){case"xplor-input-text-secondary":customElements.get(n)||customElements.define(n,xc);break}})}const bm=xc,ym=xm,vm=`@tailwind base;
|
|
19299
19303
|
@tailwind components;
|
|
19300
19304
|
@tailwind utilities;
|
|
19301
19305
|
@layer base {
|
|
@@ -19637,7 +19641,7 @@ ol.mdc-list.sc-xplor-input-text li.mdc-list-item.sc-xplor-input-text, ul.mdc-lis
|
|
|
19637
19641
|
}
|
|
19638
19642
|
.xplor-input-text__helper-text.sc-xplor-input-text {
|
|
19639
19643
|
color: rgba(0, 0, 0, 0.6);
|
|
19640
|
-
}`;let
|
|
19644
|
+
}`;let km=0;const bc=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorInput=k(this,"xplorInput"),this.xplorChange=k(this,"xplorChange"),this.xplorFocus=k(this,"xplorFocus"),this.xplorBlur=k(this,"xplorBlur"),this.inputId=`xplor-input-text-${++km}`,this.errorId=`${this.inputId}-error`,this.helperId=`${this.inputId}-helper`,this.value="",this.label="",this.placeholder="",this.type="text",this.bgColor="white",this.color="#008480",this.disabled=!1,this.readonly=!1,this.hideDetails="auto",this.error="",this.helperText="",this.required=!1,this.isFocused=!1,this.handleInput=n=>{const e=n.target;this.value=e.value,this.xplorInput.emit(this.value)},this.handleChange=n=>{const e=n.target;this.value=e.value,this.xplorChange.emit(this.value)},this.handleFocus=n=>{this.isFocused=!0,this.xplorFocus.emit(n)},this.handleBlur=n=>{this.isFocused=!1,this.xplorBlur.emit(n)}}render(){const n=this.value!=null&&this.value!=="",e=this.isFocused||n,r={"xplor-input-text":!0,"xplor-input-text--focused":this.isFocused,"xplor-input-text--floating":e,"xplor-input-text--disabled":this.disabled,"xplor-input-text--error":!!this.error},o=this.hideDetails===!1||this.hideDetails==="auto"&&(this.error||this.helperText);return p(E,{key:"764b3d65709568ba47eed1daec32340a9f4ddf3a"},p("div",{key:"50aa5c726722ac0a1406b1aeb6f4652b0021c93c",class:r},p("div",{key:"e6879bbf287bd46a2398ce21e877a93eec23ccca",class:"xplor-input-text__field"},p("input",{key:"847eb323f86c24317a67ec95ff7091680b816f18",id:this.inputId,type:this.type,class:"xplor-input-text__input",value:this.value,placeholder:e?this.placeholder:"",disabled:this.disabled,readonly:this.readonly,required:this.required,onInput:this.handleInput,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur,style:{backgroundColor:this.bgColor},"aria-invalid":this.error?"true":void 0,"aria-required":this.required?"true":void 0,"aria-describedby":this.error?this.errorId:this.helperText?this.helperId:void 0}),this.label&&p("label",{key:"3f135039ab03449cad21ce93071bd7b597d65d40",class:"xplor-input-text__label",htmlFor:this.inputId,style:{backgroundColor:this.bgColor}},this.label,this.required&&p("span",{key:"a3d04091abd40736d9b3d00c8796355c4ae8bf30",class:"xplor-input-text__required"},"*")),p("slot",{key:"290d13fe4c82231ff3341c60f9bffb319ab686d0",name:"append-inner"})),o&&p("div",{key:"c38de9592f5a0520e8ac18aa64f4d88c9db9b62e",class:"xplor-input-text__details"},this.error&&p("div",{key:"3535de57296c0b265d701dac604bdf65c4bd6801",class:"xplor-input-text__error-message",id:this.errorId},this.error),!this.error&&this.helperText&&p("div",{key:"46003ab056e8677ef304a007610ff95b07434482",class:"xplor-input-text__helper-text",id:this.helperId},this.helperText)),p("slot",{key:"c4a0dda405f82c24df42e82b029ccc3e9cfcc7ad",name:"append"})))}static get style(){return vm}},[6,"xplor-input-text",{value:[1025],label:[1],placeholder:[1],type:[1],bgColor:[1,"bg-color"],color:[1],disabled:[4],readonly:[4],hideDetails:[8,"hide-details"],error:[1],helperText:[1,"helper-text"],required:[4],isFocused:[32]}]);function wm(){if(typeof customElements>"u")return;["xplor-input-text"].forEach(n=>{switch(n){case"xplor-input-text":customElements.get(n)||customElements.define(n,bc);break}})}const _m=bc,Cm=wm,Sm=`@tailwind base;
|
|
19641
19645
|
@tailwind components;
|
|
19642
19646
|
@tailwind utilities;
|
|
19643
19647
|
@layer base {
|
|
@@ -19921,7 +19925,7 @@ ol.mdc-list.sc-xplor-input-title li.mdc-list-item.sc-xplor-input-title, ul.mdc-l
|
|
|
19921
19925
|
}
|
|
19922
19926
|
.xplor-input-title.sc-xplor-input-title:read-only {
|
|
19923
19927
|
color: rgba(0, 0, 0, 0.6);
|
|
19924
|
-
}`,
|
|
19928
|
+
}`,yc=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorInput=k(this,"xplorInput"),this.xplorChange=k(this,"xplorChange"),this.value="",this.placeholder="",this.disabled=!1,this.readonly=!1,this.ariaLabel="Title",this.handleInput=n=>{const e=n.target;this.value=e.value,this.xplorInput.emit(this.value)},this.handleChange=n=>{const e=n.target;this.value=e.value,this.xplorChange.emit(this.value)}}render(){return p(E,{key:"d704477e948ba0d8184a4a1231b855d56ea8c390"},p("input",{key:"d1c171f69b54b7981f56da8b3651f212c52e1af9",type:"text",class:"xplor-input-title",value:this.value,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,"aria-label":this.ariaLabel,onInput:this.handleInput,onChange:this.handleChange}))}static get style(){return Sm}},[2,"xplor-input-title",{value:[1025],placeholder:[1],disabled:[4],readonly:[4],ariaLabel:[1,"aria-label"]}]);function Em(){if(typeof customElements>"u")return;["xplor-input-title"].forEach(n=>{switch(n){case"xplor-input-title":customElements.get(n)||customElements.define(n,yc);break}})}const Im=yc,$m=Em,Tm=":host{display:block}.x-link{display:block;padding:0.5rem 0;text-decoration:none;color:var(--xplor-link-color)}",vc=M(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.imageAlt=""}render(){return p(E,{key:"889187734e978da8f6303bc6348d16ff58a4f117",class:`theme-${this.brand}`},p("a",{key:"31ec1b964e1033ed77ae8e13d4d6a2bbb47681ae",class:"x-link",href:"https://google.com"}," ","googole this is a link"," "),p("div",{key:"5c368f18b9189f2e7d6b078f8d8d55422dbba8be",class:"bg-black p-2 rounded-md flex justify-center"},p("h1",{key:"c59f722b0c6d67af621872de924f3bfddbee2b71",class:"text-primary font-sans"},"This is a Stencil component using Tailwind")),p("div",{key:"69a8672d3dfa05ae91762f63f879359ee8eaae7c",class:"bg-white py-24 sm:py-32"},p("div",{key:"f3cf50757eee5bd60902d9402b9169ace12ab570",class:"mx-auto grid max-w-7xl gap-20 px-6 lg:px-8 xl:grid-cols-3"},p("div",{key:"06c98d24f3fe053033b6e4ab6e7d3339797cfb4f",class:"max-w-xl"},p("h2",{key:"6a8c0b137fa3cc971271df5f55a87b11d01abc52",class:"text-pretty text-3xl font-semibold tracking-tight text-gray-900 sm:text-4xl"},"Meet our leadership"),p("p",{key:"ae46370f680162d2d073a8a81762ee5cabf66506",class:"mt-6 text-lg/8 text-gray-600"},"We’re a dynamic group of individuals who are passionate about what we do and dedicated to delivering the best results for our clients.")),p("ul",{key:"a02b593fe26d9814b2ebe89bb1fc8a93e7b25dbe",role:"list",class:"grid gap-x-8 gap-y-12 sm:grid-cols-2 sm:gap-y-16 xl:col-span-2"},p("li",{key:"a2ce1ff6fc5379cc1c3d93dbb0ede1f47dc20e06"},p("div",{key:"8ef99aacde6e9d5ea9c3c05ee8f4e262655bd130",class:"flex items-center gap-x-6"},p("img",{key:"e742f8c1d0cb3e6bd5649a94966c01027314dc7e",class:"size-16 rounded-full",src:"https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",alt:this.imageAlt}),p("div",{key:"dd31c47ff1c7b1d6c3f11938abb61b7556ef9e9c"},p("h3",{key:"a1c97a24c3c1baaa1a78409bcc8410aad4f4f1f7",class:"text-base/7 font-semibold tracking-tight text-gray-900"},"Leslie Alexander"),p("p",{key:"77709dadf6ff62a9473ac88ce6fc419fe81217fc",class:"text-sm/6 font-semibold text-indigo-600"},"Co-Founder / CEO"))))))))}static get style(){return Tm}},[1,"xplor-links",{brand:[1],imageAlt:[1,"image-alt"]}]);function Mm(){if(typeof customElements>"u")return;["xplor-links"].forEach(n=>{switch(n){case"xplor-links":customElements.get(n)||customElements.define(n,vc);break}})}const Dm=vc,zm=Mm,Om=`@tailwind base;
|
|
19925
19929
|
@tailwind components;
|
|
19926
19930
|
@tailwind utilities;
|
|
19927
19931
|
@layer base {
|
|
@@ -20287,7 +20291,7 @@ ol.mdc-list.sc-xplor-modal li.mdc-list-item.sc-xplor-modal, ul.mdc-list.sc-xplor
|
|
|
20287
20291
|
to {
|
|
20288
20292
|
transform: rotate(360deg);
|
|
20289
20293
|
}
|
|
20290
|
-
}`,
|
|
20294
|
+
}`,kc=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorClose=k(this,"xplorClose"),this.open=!1,this.width="600px",this.maxWidth="90%",this.maxHeight="90%",this.scrollable=!0,this.persistent=!1,this.loading=!1,this.showTitle=!0,this.previouslyFocusedElement=null,this.handleBackdropClick=()=>{this.persistent||this.closeModal()},this.handleCardClick=n=>{n.stopPropagation()},this.closeModal=()=>{this.open=!1,this.xplorClose.emit()}}handleOpenChange(n){n?(document.body.style.overflow="hidden",this.previouslyFocusedElement=document.activeElement,requestAnimationFrame(()=>{this.setInitialFocus()})):(document.body.style.overflow="",this.previouslyFocusedElement&&(this.previouslyFocusedElement.focus(),this.previouslyFocusedElement=null))}disconnectedCallback(){document.body.style.overflow=""}handleKeyDown(n){if(this.open){if(n.key==="Escape"&&!this.persistent){n.preventDefault(),this.closeModal();return}n.key==="Tab"&&this.trapFocus(n)}}getFocusableElements(){return this.dialogEl?Array.from(this.dialogEl.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])')):[]}trapFocus(n){const e=this.getFocusableElements();if(e.length===0)return;const r=e[0],o=e[e.length-1];n.shiftKey?document.activeElement===r&&(n.preventDefault(),o.focus()):document.activeElement===o&&(n.preventDefault(),r.focus())}setInitialFocus(){const n=this.getFocusableElements();n.length>0?n[0].focus():this.dialogEl&&this.dialogEl.focus()}render(){if(!this.open)return null;const n={"xplor-modal__card":!0,"xplor-modal__card--scrollable":this.scrollable},e={"xplor-modal__body":!0,"xplor-modal__body--no-title":!this.showTitle};return p(E,null,p("div",{class:"xplor-modal__backdrop",onClick:this.handleBackdropClick},p("div",{class:n,style:{width:this.width,maxWidth:this.maxWidth,maxHeight:this.maxHeight},onClick:this.handleCardClick,role:"dialog","aria-modal":"true","aria-labelledby":this.ariaLabel?void 0:"xplor-modal-title","aria-label":this.ariaLabel,tabindex:"-1",ref:r=>this.dialogEl=r},p("button",{type:"button",class:"xplor-modal__close-btn",onClick:this.closeModal,"aria-label":"Close modal","data-testid":"common-modal-close-button"},"✕"),p("div",{class:"xplor-modal__title",id:"xplor-modal-title"},p("slot",{name:"title"})),p("div",{class:"xplor-modal__subtitle"},p("slot",{name:"subtitle"})),p("div",{class:e},this.loading?p("div",{class:"xplor-modal__loading",role:"status","aria-label":"Loading"},p("div",{class:"xplor-modal__spinner"})):[p("slot",{name:"body"}),p("slot",null)]),p("div",{class:"xplor-modal__actions"},p("slot",{name:"actions"})))))}get el(){return this}static get watchers(){return{open:["handleOpenChange"]}}static get style(){return Om}},[6,"xplor-modal",{open:[1028],width:[1],maxWidth:[1,"max-width"],maxHeight:[1,"max-height"],scrollable:[4],persistent:[4],loading:[4],showTitle:[4,"show-title"],ariaLabel:[1,"aria-label"]},[[0,"keydown","handleKeyDown"]],{open:["handleOpenChange"]}]);function wc(){if(typeof customElements>"u")return;["xplor-modal"].forEach(n=>{switch(n){case"xplor-modal":customElements.get(n)||customElements.define(n,kc);break}})}const _c=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorClose=k(this,"xplorClose"),this.open=!1,this.width="600px",this.maxWidth="90%",this.maxHeight="90%",this.loading=!1}render(){return p(E,{key:"a63a1be6d3f7f91ee12d9ac55263862d4a304520"},p("xplor-modal",{key:"d96ca5c6388f90e2345da0b97b7683b785da01f9",open:this.open,width:this.width,maxWidth:this.maxWidth,maxHeight:this.maxHeight,loading:this.loading,persistent:!0,onXplorClose:()=>this.xplorClose.emit()},p("slot",{key:"8bdf1a54705992482008ffc724b90a182c19d6c9",name:"title",slot:"title"}),p("slot",{key:"91316e16134121d55bb5119a7ed6aacce244161a",name:"subtitle",slot:"subtitle"}),p("slot",{key:"b728a60734f050286b8e36079cfcd6872d5bb737",name:"body",slot:"body"}),p("slot",{key:"d2f44d88fd6e4b109193e07e013168c92741b202",name:"actions",slot:"actions"})))}},[4,"xplor-modal-persistent",{open:[4],width:[1],maxWidth:[1,"max-width"],maxHeight:[1,"max-height"],loading:[4]}]);function Am(){if(typeof customElements>"u")return;["xplor-modal-persistent","xplor-modal"].forEach(n=>{switch(n){case"xplor-modal-persistent":customElements.get(n)||customElements.define(n,_c);break;case"xplor-modal":customElements.get(n)||wc();break}})}const Lm=_c,Pm=Am,Rm=kc,Bm=wc,Nm=`@tailwind base;
|
|
20291
20295
|
@tailwind components;
|
|
20292
20296
|
@tailwind utilities;
|
|
20293
20297
|
@layer base {
|
|
@@ -20600,7 +20604,7 @@ ol.mdc-list.sc-xplor-nav-tabs li.mdc-list-item.sc-xplor-nav-tabs, ul.mdc-list.sc
|
|
|
20600
20604
|
|
|
20601
20605
|
.nav-tabs--secondary.sc-xplor-nav-tabs .nav-tabs__tab.sc-xplor-nav-tabs:hover:not(.nav-tabs__tab--disabled) {
|
|
20602
20606
|
color: #7b1fa2;
|
|
20603
|
-
}`,
|
|
20607
|
+
}`,Cc=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorChange=k(this,"xplorChange"),this.items=[],this.color="primary",this.grow=!1,this.handleTabClick=n=>{n.disabled||(this.value=n.value,this.xplorChange.emit(n.value))}}handleKeyDown(n){const e=this.items.filter(c=>!c.disabled);if(e.length===0)return;const r=e.findIndex(c=>c.value===this.value);let o=r;switch(n.key){case"ArrowRight":n.preventDefault(),o=r<e.length-1?r+1:0;break;case"ArrowLeft":n.preventDefault(),o=r>0?r-1:e.length-1;break;case"Home":n.preventDefault(),o=0;break;case"End":n.preventDefault(),o=e.length-1;break;default:return}const i=e[o];this.value=i.value,this.xplorChange.emit(i.value);const a=this.el.querySelectorAll('button[role="tab"]'),s=this.items.indexOf(i),l=a[s];l&&l.focus()}render(){return p(E,{key:"c2ea1eb0316856196a7c84589fa74cb05cf9bd0a"},p("div",{key:"360f41422ff1a5b29417ffe02b150e19ad2779d3",class:{"nav-tabs":!0,"nav-tabs--grow":this.grow,[`nav-tabs--${this.color}`]:!0},role:"tablist"},this.items.map(n=>p("button",{key:n.value,class:{"nav-tabs__tab":!0,"nav-tabs__tab--active":this.value===n.value,"nav-tabs__tab--disabled":n.disabled},onClick:()=>this.handleTabClick(n),disabled:n.disabled,role:"tab","aria-selected":this.value===n.value?"true":"false",tabIndex:this.value===n.value?0:-1,type:"button"},n.label)),p("slot",{key:"4b070fa29fa37e878b737fdc5d3eaa4b492bdc01"})))}get el(){return this}static get style(){return Nm}},[6,"xplor-nav-tabs",{value:[1025],items:[16],color:[1],grow:[4]},[[0,"keydown","handleKeyDown"]]]);function Fm(){if(typeof customElements>"u")return;["xplor-nav-tabs"].forEach(n=>{switch(n){case"xplor-nav-tabs":customElements.get(n)||customElements.define(n,Cc);break}})}const Hm=Cc,jm=Fm,Xm=`/* on mobile browsers, I set a width of 100% */
|
|
20604
20608
|
@tailwind base;
|
|
20605
20609
|
@tailwind components;
|
|
20606
20610
|
@tailwind utilities;
|
|
@@ -20984,19 +20988,19 @@ ul.mdc-list li.mdc-list-item {
|
|
|
20984
20988
|
|
|
20985
20989
|
.radio-wrapper--disabled .label {
|
|
20986
20990
|
opacity: 0.4;
|
|
20987
|
-
}`,_c=M(class extends ${constructor(){super(),this.__registerHost(),this.__attachShadow(),this.radioChange=k(this,"radioChange"),this.label="",this.value="",this.name="",this.initialChecked=!1,this.disabled=!1,this.error=!1,this.checked=!1,this.isHovered=!1,this.isFocused=!1,this.isPressed=!1,this.handleClick=()=>{this.disabled||this.checked||(this.getSiblingRadios().forEach(n=>n.deselect()),this.checked=!0,this.radioChange.emit({value:this.value,checked:this.checked}))},this.handleKeyDown=n=>{this.disabled||(n.key===" "||n.key==="Enter")&&(n.preventDefault(),this.isPressed=!0,this.handleClick())},this.handleKeyUp=n=>{(n.key===" "||n.key==="Enter")&&(this.isPressed=!1)},this.getRadioClass=()=>{const n=["radio"];return this.checked&&n.push("checked"),this.disabled&&n.push("disabled"),this.error&&n.push("error"),this.isHovered&&!this.disabled&&n.push("hover"),this.isFocused&&!this.disabled&&n.push("focus"),this.isPressed&&!this.disabled&&n.push("pressed"),n.join(" ")}}watchCheckedProp(n){this.checked=n}componentWillLoad(){this.checked=this.initialChecked}async deselect(){this.checked=!1}getSiblingRadios(){if(!this.name)return[];const n=this.el.parentElement;return n?Array.from(n.querySelectorAll(`xplor-radio-btn[name="${this.name}"]`)).filter(r=>r!==this.el):[]}render(){return p("label",{key:"7bc995d1df46cd9818692d9a2b59fc6560f23cdd",class:{"radio-wrapper":!0,"radio-wrapper--disabled":this.disabled}},p("div",{key:"eea71f02b6335bd443f4410b350a61f1706a9b59",class:this.getRadioClass(),onClick:this.handleClick,onMouseEnter:()=>this.isHovered=!0,onMouseLeave:()=>this.isHovered=!1,onMouseDown:()=>this.isPressed=!0,onMouseUp:()=>this.isPressed=!1,onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,tabIndex:this.disabled?-1:0,role:"radio","aria-checked":this.checked.toString(),"aria-disabled":this.disabled.toString(),"aria-label":this.label},p("div",{key:"0b61c18ef3a9f08f6b89176de2b7a4d21b16d9fc",class:{"radio-inner":!0,"radio-inner--visible":this.checked}})),this.label&&p("span",{key:"7b227dca0fa69409dc71a04bc642c2de30bd2562",class:"label"},this.label))}get el(){return this}static get watchers(){return{initialChecked:["watchCheckedProp"]}}static get style(){return Nm}},[1,"xplor-radio-btn",{label:[1],value:[1],name:[1],initialChecked:[4,"initial-checked"],disabled:[4],error:[4],checked:[32],isHovered:[32],isFocused:[32],isPressed:[32],deselect:[64]},void 0,{initialChecked:["watchCheckedProp"]}]);function Fm(){if(typeof customElements>"u")return;["xplor-radio-btn"].forEach(n=>{switch(n){case"xplor-radio-btn":customElements.get(n)||customElements.define(n,_c);break}})}const Hm=_c,jm=Fm;function rn(t){this.content=t}rn.prototype={constructor:rn,find:function(t){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===t)return n;return-1},get:function(t){var n=this.find(t);return n==-1?void 0:this.content[n+1]},update:function(t,n,e){var r=e&&e!=t?this.remove(e):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(e||t,n):(i[o+1]=n,e&&(i[o]=e)),new rn(i)},remove:function(t){var n=this.find(t);if(n==-1)return this;var e=this.content.slice();return e.splice(n,2),new rn(e)},addToStart:function(t,n){return new rn([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var e=this.remove(t).content.slice();return e.push(t,n),new rn(e)},addBefore:function(t,n,e){var r=this.remove(n),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,n,e),new rn(o)},forEach:function(t){for(var n=0;n<this.content.length;n+=2)t(this.content[n],this.content[n+1])},prepend:function(t){return t=rn.from(t),t.size?new rn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=rn.from(t),t.size?new rn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=rn.from(t);for(var e=0;e<t.content.length;e+=2)n=n.remove(t.content[e]);return n},toObject:function(){var t={};return this.forEach(function(n,e){t[n]=e}),t},get size(){return this.content.length>>1}};rn.from=function(t){if(t instanceof rn)return t;var n=[];if(t)for(var e in t)n.push(e,t[e]);return new rn(n)};function Cc(t,n,e){for(let r=0;;r++){if(r==t.childCount||r==n.childCount)return t.childCount==n.childCount?null:e;let o=t.child(r),i=n.child(r);if(o==i){e+=o.nodeSize;continue}if(!o.sameMarkup(i))return e;if(o.isText&&o.text!=i.text){for(let a=0;o.text[a]==i.text[a];a++)e++;return e}if(o.content.size||i.content.size){let a=Cc(o.content,i.content,e+1);if(a!=null)return a}e+=o.nodeSize}}function Sc(t,n,e,r){for(let o=t.childCount,i=n.childCount;;){if(o==0||i==0)return o==i?null:{a:e,b:r};let a=t.child(--o),s=n.child(--i),l=a.nodeSize;if(a==s){e-=l,r-=l;continue}if(!a.sameMarkup(s))return{a:e,b:r};if(a.isText&&a.text!=s.text){let c=0,d=Math.min(a.text.length,s.text.length);for(;c<d&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,e--,r--;return{a:e,b:r}}if(a.content.size||s.content.size){let c=Sc(a.content,s.content,e-1,r-1);if(c)return c}e-=l,r-=l}}class y{constructor(n,e){if(this.content=n,this.size=e||0,e==null)for(let r=0;r<n.length;r++)this.size+=n[r].nodeSize}nodesBetween(n,e,r,o=0,i){for(let a=0,s=0;s<e;a++){let l=this.content[a],c=s+l.nodeSize;if(c>n&&r(l,o+s,i||null,a)!==!1&&l.content.size){let d=s+1;l.nodesBetween(Math.max(0,n-d),Math.min(l.content.size,e-d),r,o+d)}s=c}}descendants(n){this.nodesBetween(0,this.size,n)}textBetween(n,e,r,o){let i="",a=!0;return this.nodesBetween(n,e,(s,l)=>{let c=s.isText?s.text.slice(Math.max(n,l)-l,e-l):s.isLeaf?o?typeof o=="function"?o(s):o:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&r&&(a?a=!1:i+=r),i+=c},0),i}append(n){if(!n.size)return this;if(!this.size)return n;let e=this.lastChild,r=n.firstChild,o=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(r)&&(o[o.length-1]=e.withText(e.text+r.text),i=1);i<n.content.length;i++)o.push(n.content[i]);return new y(o,this.size+n.size)}cut(n,e=this.size){if(n==0&&e==this.size)return this;let r=[],o=0;if(e>n)for(let i=0,a=0;a<e;i++){let s=this.content[i],l=a+s.nodeSize;l>n&&((a<n||l>e)&&(s.isText?s=s.cut(Math.max(0,n-a),Math.min(s.text.length,e-a)):s=s.cut(Math.max(0,n-a-1),Math.min(s.content.size,e-a-1))),r.push(s),o+=s.nodeSize),a=l}return new y(r,o)}cutByIndex(n,e){return n==e?y.empty:n==0&&e==this.content.length?this:new y(this.content.slice(n,e))}replaceChild(n,e){let r=this.content[n];if(r==e)return this;let o=this.content.slice(),i=this.size+e.nodeSize-r.nodeSize;return o[n]=e,new y(o,i)}addToStart(n){return new y([n].concat(this.content),this.size+n.nodeSize)}addToEnd(n){return new y(this.content.concat(n),this.size+n.nodeSize)}eq(n){if(this.content.length!=n.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(n.content[e]))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(n){let e=this.content[n];if(!e)throw new RangeError("Index "+n+" out of range for "+this);return e}maybeChild(n){return this.content[n]||null}forEach(n){for(let e=0,r=0;e<this.content.length;e++){let o=this.content[e];n(o,r,e),r+=o.nodeSize}}findDiffStart(n,e=0){return Cc(this,n,e)}findDiffEnd(n,e=this.size,r=n.size){return Sc(this,n,e,r)}findIndex(n){if(n==0)return Ht(0,n);if(n==this.size)return Ht(this.content.length,n);if(n>this.size||n<0)throw new RangeError(`Position ${n} outside of fragment (${this})`);for(let e=0,r=0;;e++){let o=this.child(e),i=r+o.nodeSize;if(i>=n)return i==n?Ht(e+1,i):Ht(e,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(n=>n.toJSON()):null}static fromJSON(n,e){if(!e)return y.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new y(e.map(n.nodeFromJSON))}static fromArray(n){if(!n.length)return y.empty;let e,r=0;for(let o=0;o<n.length;o++){let i=n[o];r+=i.nodeSize,o&&i.isText&&n[o-1].sameMarkup(i)?(e||(e=n.slice(0,o)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new y(e||n,r)}static from(n){if(!n)return y.empty;if(n instanceof y)return n;if(Array.isArray(n))return this.fromArray(n);if(n.attrs)return new y([n],n.nodeSize);throw new RangeError("Can not convert "+n+" to a Fragment"+(n.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}y.empty=new y([],0);const bo={index:0,offset:0};function Ht(t,n){return bo.index=t,bo.offset=n,bo}function cr(t,n){if(t===n)return!0;if(!(t&&typeof t=="object")||!(n&&typeof n=="object"))return!1;let e=Array.isArray(t);if(Array.isArray(n)!=e)return!1;if(e){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!cr(t[r],n[r]))return!1}else{for(let r in t)if(!(r in n)||!cr(t[r],n[r]))return!1;for(let r in n)if(!(r in t))return!1}return!0}let j=class ni{constructor(n,e){this.type=n,this.attrs=e}addToSet(n){let e,r=!1;for(let o=0;o<n.length;o++){let i=n[o];if(this.eq(i))return n;if(this.type.excludes(i.type))e||(e=n.slice(0,o));else{if(i.type.excludes(this.type))return n;!r&&i.type.rank>this.type.rank&&(e||(e=n.slice(0,o)),e.push(this),r=!0),e&&e.push(i)}}return e||(e=n.slice()),r||e.push(this),e}removeFromSet(n){for(let e=0;e<n.length;e++)if(this.eq(n[e]))return n.slice(0,e).concat(n.slice(e+1));return n}isInSet(n){for(let e=0;e<n.length;e++)if(this.eq(n[e]))return!0;return!1}eq(n){return this==n||this.type==n.type&&cr(this.attrs,n.attrs)}toJSON(){let n={type:this.type.name};for(let e in this.attrs){n.attrs=this.attrs;break}return n}static fromJSON(n,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let r=n.marks[e.type];if(!r)throw new RangeError(`There is no mark type ${e.type} in this schema`);let o=r.create(e.attrs);return r.checkAttrs(o.attrs),o}static sameSet(n,e){if(n==e)return!0;if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!n[r].eq(e[r]))return!1;return!0}static setFrom(n){if(!n||Array.isArray(n)&&n.length==0)return ni.none;if(n instanceof ni)return[n];let e=n.slice();return e.sort((r,o)=>r.type.rank-o.type.rank),e}};j.none=[];class dr extends Error{}class w{constructor(n,e,r){this.content=n,this.openStart=e,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(n,e){let r=Ic(this.content,n+this.openStart,e);return r&&new w(r,this.openStart,this.openEnd)}removeBetween(n,e){return new w(Ec(this.content,n+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(n){return this.content.eq(n.content)&&this.openStart==n.openStart&&this.openEnd==n.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let n={content:this.content.toJSON()};return this.openStart>0&&(n.openStart=this.openStart),this.openEnd>0&&(n.openEnd=this.openEnd),n}static fromJSON(n,e){if(!e)return w.empty;let r=e.openStart||0,o=e.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new w(y.fromJSON(n,e.content),r,o)}static maxOpen(n,e=!0){let r=0,o=0;for(let i=n.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=n.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)o++;return new w(n,r,o)}}w.empty=new w(y.empty,0,0);function Ec(t,n,e){let{index:r,offset:o}=t.findIndex(n),i=t.maybeChild(r),{index:a,offset:s}=t.findIndex(e);if(o==n||i.isText){if(s!=e&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(e))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Ec(i.content,n-o-1,e-o-1)))}function Ic(t,n,e,r){let{index:o,offset:i}=t.findIndex(n),a=t.maybeChild(o);if(i==n||a.isText)return r&&!r.canReplace(o,o,e)?null:t.cut(0,n).append(e).append(t.cut(n));let s=Ic(a.content,n-i-1,e,a);return s&&t.replaceChild(o,a.copy(s))}function Xm(t,n,e){if(e.openStart>t.depth)throw new dr("Inserted content deeper than insertion position");if(t.depth-e.openStart!=n.depth-e.openEnd)throw new dr("Inconsistent open depths");return Tc(t,n,e,0)}function Tc(t,n,e,r){let o=t.index(r),i=t.node(r);if(o==n.index(r)&&r<t.depth-e.openStart){let a=Tc(t,n,e,r+1);return i.copy(i.content.replaceChild(o,a))}else if(e.content.size)if(!e.openStart&&!e.openEnd&&t.depth==r&&n.depth==r){let a=t.parent,s=a.content;return ve(a,s.cut(0,t.parentOffset).append(e.content).append(s.cut(n.parentOffset)))}else{let{start:a,end:s}=Vm(e,t);return ve(i,Mc(t,a,s,n,r))}else return ve(i,pr(t,n,r))}function $c(t,n){if(!n.type.compatibleContent(t.type))throw new dr("Cannot join "+n.type.name+" onto "+t.type.name)}function ei(t,n,e){let r=t.node(e);return $c(r,n.node(e)),r}function ye(t,n){let e=n.length-1;e>=0&&t.isText&&t.sameMarkup(n[e])?n[e]=t.withText(n[e].text+t.text):n.push(t)}function ct(t,n,e,r){let o=(n||t).node(e),i=0,a=n?n.index(e):o.childCount;t&&(i=t.index(e),t.depth>e?i++:t.textOffset&&(ye(t.nodeAfter,r),i++));for(let s=i;s<a;s++)ye(o.child(s),r);n&&n.depth==e&&n.textOffset&&ye(n.nodeBefore,r)}function ve(t,n){return t.type.checkContent(n),t.copy(n)}function Mc(t,n,e,r,o){let i=t.depth>o&&ei(t,n,o+1),a=r.depth>o&&ei(e,r,o+1),s=[];return ct(null,t,o,s),i&&a&&n.index(o)==e.index(o)?($c(i,a),ye(ve(i,Mc(t,n,e,r,o+1)),s)):(i&&ye(ve(i,pr(t,n,o+1)),s),ct(n,e,o,s),a&&ye(ve(a,pr(e,r,o+1)),s)),ct(r,null,o,s),new y(s)}function pr(t,n,e){let r=[];if(ct(null,t,e,r),t.depth>e){let o=ei(t,n,e+1);ye(ve(o,pr(t,n,e+1)),r)}return ct(n,null,e,r),new y(r)}function Vm(t,n){let e=n.depth-t.openStart,o=n.node(e).copy(t.content);for(let i=e-1;i>=0;i--)o=n.node(i).copy(y.from(o));return{start:o.resolveNoCache(t.openStart+e),end:o.resolveNoCache(o.content.size-t.openEnd-e)}}class kt{constructor(n,e,r){this.pos=n,this.path=e,this.parentOffset=r,this.depth=e.length/3-1}resolveDepth(n){return n==null?this.depth:n<0?this.depth+n:n}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(n){return this.path[this.resolveDepth(n)*3]}index(n){return this.path[this.resolveDepth(n)*3+1]}indexAfter(n){return n=this.resolveDepth(n),this.index(n)+(n==this.depth&&!this.textOffset?0:1)}start(n){return n=this.resolveDepth(n),n==0?0:this.path[n*3-1]+1}end(n){return n=this.resolveDepth(n),this.start(n)+this.node(n).content.size}before(n){if(n=this.resolveDepth(n),!n)throw new RangeError("There is no position before the top-level node");return n==this.depth+1?this.pos:this.path[n*3-1]}after(n){if(n=this.resolveDepth(n),!n)throw new RangeError("There is no position after the top-level node");return n==this.depth+1?this.pos:this.path[n*3-1]+this.path[n*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let n=this.parent,e=this.index(this.depth);if(e==n.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=n.child(e);return r?n.child(e).cut(r):o}get nodeBefore(){let n=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(n).cut(0,e):n==0?null:this.parent.child(n-1)}posAtIndex(n,e){e=this.resolveDepth(e);let r=this.path[e*3],o=e==0?0:this.path[e*3-1]+1;for(let i=0;i<n;i++)o+=r.child(i).nodeSize;return o}marks(){let n=this.parent,e=this.index();if(n.content.size==0)return j.none;if(this.textOffset)return n.child(e).marks;let r=n.maybeChild(e-1),o=n.maybeChild(e);if(!r){let s=r;r=o,o=s}let i=r.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!o||!i[a].isInSet(o.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(n){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let r=e.marks,o=n.parent.maybeChild(n.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(n){for(let e=this.depth;e>0;e--)if(this.start(e)<=n&&this.end(e)>=n)return e;return 0}blockRange(n=this,e){if(n.pos<this.pos)return n.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==n.pos?1:0);r>=0;r--)if(n.pos<=this.end(r)&&(!e||e(this.node(r))))return new hr(this,n,r);return null}sameParent(n){return this.pos-this.parentOffset==n.pos-n.parentOffset}max(n){return n.pos>this.pos?n:this}min(n){return n.pos<this.pos?n:this}toString(){let n="";for(let e=1;e<=this.depth;e++)n+=(n?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return n+":"+this.parentOffset}static resolve(n,e){if(!(e>=0&&e<=n.content.size))throw new RangeError("Position "+e+" out of range");let r=[],o=0,i=e;for(let a=n;;){let{index:s,offset:l}=a.content.findIndex(i),c=i-l;if(r.push(a,s,o+l),!c||(a=a.child(s),a.isText))break;i=c-1,o+=l+1}return new kt(e,r,i)}static resolveCached(n,e){let r=Ma.get(n);if(r)for(let i=0;i<r.elts.length;i++){let a=r.elts[i];if(a.pos==e)return a}else Ma.set(n,r=new Wm);let o=r.elts[r.i]=kt.resolve(n,e);return r.i=(r.i+1)%Um,o}}class Wm{constructor(){this.elts=[],this.i=0}}const Um=12,Ma=new WeakMap;class hr{constructor(n,e,r){this.$from=n,this.$to=e,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 qm=Object.create(null);let ee=class ti{constructor(n,e,r,o=j.none){this.type=n,this.attrs=e,this.marks=o,this.content=r||y.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(n){return this.content.child(n)}maybeChild(n){return this.content.maybeChild(n)}forEach(n){this.content.forEach(n)}nodesBetween(n,e,r,o=0){this.content.nodesBetween(n,e,r,o,this)}descendants(n){this.nodesBetween(0,this.content.size,n)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(n,e,r,o){return this.content.textBetween(n,e,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(n){return this==n||this.sameMarkup(n)&&this.content.eq(n.content)}sameMarkup(n){return this.hasMarkup(n.type,n.attrs,n.marks)}hasMarkup(n,e,r){return this.type==n&&cr(this.attrs,e||n.defaultAttrs||qm)&&j.sameSet(this.marks,r||j.none)}copy(n=null){return n==this.content?this:new ti(this.type,this.attrs,n,this.marks)}mark(n){return n==this.marks?this:new ti(this.type,this.attrs,this.content,n)}cut(n,e=this.content.size){return n==0&&e==this.content.size?this:this.copy(this.content.cut(n,e))}slice(n,e=this.content.size,r=!1){if(n==e)return w.empty;let o=this.resolve(n),i=this.resolve(e),a=r?0:o.sharedDepth(e),s=o.start(a),c=o.node(a).content.cut(o.pos-s,i.pos-s);return new w(c,o.depth-a,i.depth-a)}replace(n,e,r){return Xm(this.resolve(n),this.resolve(e),r)}nodeAt(n){for(let e=this;;){let{index:r,offset:o}=e.content.findIndex(n);if(e=e.maybeChild(r),!e)return null;if(o==n||e.isText)return e;n-=o+1}}childAfter(n){let{index:e,offset:r}=this.content.findIndex(n);return{node:this.content.maybeChild(e),index:e,offset:r}}childBefore(n){if(n==0)return{node:null,index:0,offset:0};let{index:e,offset:r}=this.content.findIndex(n);if(r<n)return{node:this.content.child(e),index:e,offset:r};let o=this.content.child(e-1);return{node:o,index:e-1,offset:r-o.nodeSize}}resolve(n){return kt.resolveCached(this,n)}resolveNoCache(n){return kt.resolve(this,n)}rangeHasMark(n,e,r){let o=!1;return e>n&&this.nodesBetween(n,e,i=>(r.isInSet(i.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 n=this.type.name;return this.content.size&&(n+="("+this.content.toStringInner()+")"),zc(this.marks,n)}contentMatchAt(n){let e=this.type.contentMatch.matchFragment(this.content,0,n);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(n,e,r=y.empty,o=0,i=r.childCount){let a=this.contentMatchAt(n).matchFragment(r,o,i),s=a&&a.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(n,e,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(n).matchType(r),a=i&&i.matchFragment(this.content,e);return a?a.validEnd:!1}canAppend(n){return n.content.size?this.canReplace(this.childCount,this.childCount,n.content):this.type.compatibleContent(n.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let n=j.none;for(let e=0;e<this.marks.length;e++){let r=this.marks[e];r.type.checkAttrs(r.attrs),n=r.addToSet(n)}if(!j.sameSet(n,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let n={type:this.type.name};for(let e in this.attrs){n.attrs=this.attrs;break}return this.content.size&&(n.content=this.content.toJSON()),this.marks.length&&(n.marks=this.marks.map(e=>e.toJSON())),n}static fromJSON(n,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let r;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=e.marks.map(n.markFromJSON)}if(e.type=="text"){if(typeof e.text!="string")throw new RangeError("Invalid text node in JSON");return n.text(e.text,r)}let o=y.fromJSON(n,e.content),i=n.nodeType(e.type).create(e.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};ee.prototype.text=void 0;class gr extends ee{constructor(n,e,r,o){if(super(n,e,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):zc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(n,e){return this.text.slice(n,e)}get nodeSize(){return this.text.length}mark(n){return n==this.marks?this:new gr(this.type,this.attrs,this.text,n)}withText(n){return n==this.text?this:new gr(this.type,this.attrs,n,this.marks)}cut(n=0,e=this.text.length){return n==0&&e==this.text.length?this:this.withText(this.text.slice(n,e))}eq(n){return this.sameMarkup(n)&&this.text==n.text}toJSON(){let n=super.toJSON();return n.text=this.text,n}}function zc(t,n){for(let e=t.length-1;e>=0;e--)n=t[e].type.name+"("+n+")";return n}class Se{constructor(n){this.validEnd=n,this.next=[],this.wrapCache=[]}static parse(n,e){let r=new Km(n,e);if(r.next==null)return Se.empty;let o=Dc(r);r.next&&r.err("Unexpected trailing text");let i=e0(n0(o));return t0(i,r),i}matchType(n){for(let e=0;e<this.next.length;e++)if(this.next[e].type==n)return this.next[e].next;return null}matchFragment(n,e=0,r=n.childCount){let o=this;for(let i=e;o&&i<r;i++)o=o.matchType(n.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let n=0;n<this.next.length;n++){let{type:e}=this.next[n];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(n){for(let e=0;e<this.next.length;e++)for(let r=0;r<n.next.length;r++)if(this.next[e].type==n.next[r].type)return!0;return!1}fillBefore(n,e=!1,r=0){let o=[this];function i(a,s){let l=a.matchFragment(n,r);if(l&&(!e||l.validEnd))return y.from(s.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:d,next:h}=a.next[c];if(!(d.isText||d.hasRequiredAttrs())&&o.indexOf(h)==-1){o.push(h);let g=i(h,s.concat(d));if(g)return g}}return null}return i(this,[])}findWrapping(n){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==n)return this.wrapCache[r+1];let e=this.computeWrapping(n);return this.wrapCache.push(n,e),e}computeWrapping(n){let e=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(n)){let a=[];for(let s=o;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<i.next.length;a++){let{type:s,next:l}=i.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in e)&&(!o.type||l.validEnd)&&(r.push({match:s.contentMatch,type:s,via:o}),e[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(n){if(n>=this.next.length)throw new RangeError(`There's no ${n}th edge in this content match`);return this.next[n]}toString(){let n=[];function e(r){n.push(r);for(let o=0;o<r.next.length;o++)n.indexOf(r.next[o].next)==-1&&e(r.next[o].next)}return e(this),n.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)i+=(a?", ":"")+r.next[a].type.name+"->"+n.indexOf(r.next[a].next);return i}).join(`
|
|
20988
|
-
`)}}Se.empty=new Se(!0);class Km{constructor(n,e){this.string=n,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=n.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(n){return this.next==n&&(this.pos++||!0)}err(n){throw new SyntaxError(n+" (in content expression '"+this.string+"')")}}function Dc(t){let n=[];do n.push(Jm(t));while(t.eat("|"));return n.length==1?n[0]:{type:"choice",exprs:n}}function Jm(t){let n=[];do n.push(Gm(t));while(t.next&&t.next!=")"&&t.next!="|");return n.length==1?n[0]:{type:"seq",exprs:n}}function Gm(t){let n=Zm(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=Ym(t,n);else break;return n}function za(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function Ym(t,n){let e=za(t),r=e;return t.eat(",")&&(t.next!="}"?r=za(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:e,max:r,expr:n}}function Qm(t,n){let e=t.nodeTypes,r=e[n];if(r)return[r];let o=[];for(let i in e){let a=e[i];a.isInGroup(n)&&o.push(a)}return o.length==0&&t.err("No node type or group '"+n+"' found"),o}function Zm(t){if(t.eat("(")){let n=Dc(t);return t.eat(")")||t.err("Missing closing paren"),n}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let n=Qm(t,t.next).map(e=>(t.inline==null?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,n.length==1?n[0]:{type:"choice",exprs:n}}}function n0(t){let n=[[]];return o(i(t,0),e()),n;function e(){return n.push([])-1}function r(a,s,l){let c={term:l,to:s};return n[a].push(c),c}function o(a,s){a.forEach(l=>l.to=s)}function i(a,s){if(a.type=="choice")return a.exprs.reduce((l,c)=>l.concat(i(c,s)),[]);if(a.type=="seq")for(let l=0;;l++){let c=i(a.exprs[l],s);if(l==a.exprs.length-1)return c;o(c,s=e())}else if(a.type=="star"){let l=e();return r(s,l),o(i(a.expr,l),l),[r(l)]}else if(a.type=="plus"){let l=e();return o(i(a.expr,s),l),o(i(a.expr,l),l),[r(l)]}else{if(a.type=="opt")return[r(s)].concat(i(a.expr,s));if(a.type=="range"){let l=s;for(let c=0;c<a.min;c++){let d=e();o(i(a.expr,l),d),l=d}if(a.max==-1)o(i(a.expr,l),l);else for(let c=a.min;c<a.max;c++){let d=e();r(l,d),o(i(a.expr,l),d),l=d}return[r(l)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function Oc(t,n){return n-t}function Da(t,n){let e=[];return r(n),e.sort(Oc);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);e.push(o);for(let a=0;a<i.length;a++){let{term:s,to:l}=i[a];!s&&e.indexOf(l)==-1&&r(l)}}}function e0(t){let n=Object.create(null);return e(Da(t,0));function e(r){let o=[];r.forEach(a=>{t[a].forEach(({term:s,to:l})=>{if(!s)return;let c;for(let d=0;d<o.length;d++)o[d][0]==s&&(c=o[d][1]);Da(t,l).forEach(d=>{c||o.push([s,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let i=n[r.join(",")]=new Se(r.indexOf(t.length-1)>-1);for(let a=0;a<o.length;a++){let s=o[a][1].sort(Oc);i.next.push({type:o[a][0],next:n[s.join(",")]||e(s)})}return i}}function t0(t,n){for(let e=0,r=[t];e<r.length;e++){let o=r[e],i=!o.validEnd,a=[];for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];a.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&n.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Ac(t){let n=Object.create(null);for(let e in t){let r=t[e];if(!r.hasDefault)return null;n[e]=r.default}return n}function Lc(t,n){let e=Object.create(null);for(let r in t){let o=n&&n[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}e[r]=o}return e}function Pc(t,n,e,r){for(let o in n)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${e} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(n[o])}}function Rc(t,n){let e=Object.create(null);if(n)for(let r in n)e[r]=new o0(t,r,n[r]);return e}let Oa=class Bc{constructor(n,e,r){this.name=n,this.schema=e,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Rc(n,r.attrs),this.defaultAttrs=Ac(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||n=="text"),this.isText=n=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Se.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(n){return this.groups.indexOf(n)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let n in this.attrs)if(this.attrs[n].isRequired)return!0;return!1}compatibleContent(n){return this==n||this.contentMatch.compatible(n.contentMatch)}computeAttrs(n){return!n&&this.defaultAttrs?this.defaultAttrs:Lc(this.attrs,n)}create(n=null,e,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ee(this,this.computeAttrs(n),y.from(e),j.setFrom(r))}createChecked(n=null,e,r){return e=y.from(e),this.checkContent(e),new ee(this,this.computeAttrs(n),e,j.setFrom(r))}createAndFill(n=null,e,r){if(n=this.computeAttrs(n),e=y.from(e),e.size){let a=this.contentMatch.fillBefore(e);if(!a)return null;e=a.append(e)}let o=this.contentMatch.matchFragment(e),i=o&&o.fillBefore(y.empty,!0);return i?new ee(this,n,e.append(i),j.setFrom(r)):null}validContent(n){let e=this.contentMatch.matchFragment(n);if(!e||!e.validEnd)return!1;for(let r=0;r<n.childCount;r++)if(!this.allowsMarks(n.child(r).marks))return!1;return!0}checkContent(n){if(!this.validContent(n))throw new RangeError(`Invalid content for node ${this.name}: ${n.toString().slice(0,50)}`)}checkAttrs(n){Pc(this.attrs,n,"node")}allowsMarkType(n){return this.markSet==null||this.markSet.indexOf(n)>-1}allowsMarks(n){if(this.markSet==null)return!0;for(let e=0;e<n.length;e++)if(!this.allowsMarkType(n[e].type))return!1;return!0}allowedMarks(n){if(this.markSet==null)return n;let e;for(let r=0;r<n.length;r++)this.allowsMarkType(n[r].type)?e&&e.push(n[r]):e||(e=n.slice(0,r));return e?e.length?e:j.none:n}static compile(n,e){let r=Object.create(null);n.forEach((i,a)=>r[i]=new Bc(i,e,a));let o=e.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 i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function r0(t,n,e){let r=e.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${n} on type ${t}, got ${i}`)}}class o0{constructor(n,e,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?r0(n,e,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Zr{constructor(n,e,r,o){this.name=n,this.rank=e,this.schema=r,this.spec=o,this.attrs=Rc(n,o.attrs),this.excluded=null;let i=Ac(this.attrs);this.instance=i?new j(this,i):null}create(n=null){return!n&&this.instance?this.instance:new j(this,Lc(this.attrs,n))}static compile(n,e){let r=Object.create(null),o=0;return n.forEach((i,a)=>r[i]=new Zr(i,o++,e,a)),r}removeFromSet(n){for(var e=0;e<n.length;e++)n[e].type==this&&(n=n.slice(0,e).concat(n.slice(e+1)),e--);return n}isInSet(n){for(let e=0;e<n.length;e++)if(n[e].type==this)return n[e]}checkAttrs(n){Pc(this.attrs,n,"mark")}excludes(n){return this.excluded.indexOf(n)>-1}}class Nc{constructor(n){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let o in n)e[o]=n[o];e.nodes=rn.from(n.nodes),e.marks=rn.from(n.marks||{}),this.nodes=Oa.compile(this.spec.nodes,this),this.marks=Zr.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 i=this.nodes[o],a=i.spec.content||"",s=i.spec.marks;if(i.contentMatch=r[a]||(r[a]=Se.parse(a,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=s=="_"?null:s?Aa(this,s.split(" ")):s==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],a=i.spec.excludes;i.excluded=a==null?[i]:a==""?[]:Aa(this,a.split(" "))}this.nodeFromJSON=o=>ee.fromJSON(this,o),this.markFromJSON=o=>j.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(n,e=null,r,o){if(typeof n=="string")n=this.nodeType(n);else if(n instanceof Oa){if(n.schema!=this)throw new RangeError("Node type from different schema used ("+n.name+")")}else throw new RangeError("Invalid node type: "+n);return n.createChecked(e,r,o)}text(n,e){let r=this.nodes.text;return new gr(r,r.defaultAttrs,n,j.setFrom(e))}mark(n,e){return typeof n=="string"&&(n=this.marks[n]),n.create(e)}nodeType(n){let e=this.nodes[n];if(!e)throw new RangeError("Unknown node type: "+n);return e}}function Aa(t,n){let e=[];for(let r=0;r<n.length;r++){let o=n[r],i=t.marks[o],a=i;if(i)e.push(i);else for(let s in t.marks){let l=t.marks[s];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&e.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+n[r]+"'")}return e}function i0(t){return t.tag!=null}function a0(t){return t.style!=null}class te{constructor(n,e){this.schema=n,this.rules=e,this.tags=[],this.styles=[];let r=this.matchedStyles=[];e.forEach(o=>{if(i0(o))this.tags.push(o);else if(a0(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=n.nodes[o.node];return i.contentMatch.matchType(i)})}parse(n,e={}){let r=new Pa(this,e,!1);return r.addAll(n,j.none,e.from,e.to),r.finish()}parseSlice(n,e={}){let r=new Pa(this,e,!0);return r.addAll(n,j.none,e.from,e.to),w.maxOpen(r.finish())}matchTag(n,e,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(c0(n,i.tag)&&(i.namespace===void 0||n.namespaceURI==i.namespace)&&(!i.context||e.matchesContext(i.context))){if(i.getAttrs){let a=i.getAttrs(n);if(a===!1)continue;i.attrs=a||void 0}return i}}}matchStyle(n,e,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let a=this.styles[i],s=a.style;if(!(s.indexOf(n)!=0||a.context&&!r.matchesContext(a.context)||s.length>n.length&&(s.charCodeAt(n.length)!=61||s.slice(n.length+1)!=e))){if(a.getAttrs){let l=a.getAttrs(e);if(l===!1)continue;a.attrs=l||void 0}return a}}}static schemaRules(n){let e=[];function r(o){let i=o.priority==null?50:o.priority,a=0;for(;a<e.length;a++){let s=e[a];if((s.priority==null?50:s.priority)<i)break}e.splice(a,0,o)}for(let o in n.marks){let i=n.marks[o].spec.parseDOM;i&&i.forEach(a=>{r(a=Ra(a)),a.mark||a.ignore||a.clearMark||(a.mark=o)})}for(let o in n.nodes){let i=n.nodes[o].spec.parseDOM;i&&i.forEach(a=>{r(a=Ra(a)),a.node||a.ignore||a.mark||(a.node=o)})}return e}static fromSchema(n){return n.cached.domParser||(n.cached.domParser=new te(n,te.schemaRules(n)))}}const Fc={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},s0={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Hc={ol:!0,ul:!0},wt=1,ri=2,Qt=4;function La(t,n,e){return n!=null?(n?wt:0)|(n==="full"?ri:0):t&&t.whitespace=="pre"?wt|ri:e&-5}class jt{constructor(n,e,r,o,i,a){this.type=n,this.attrs=e,this.marks=r,this.solid=o,this.options=a,this.content=[],this.activeMarks=j.none,this.match=i||(a&Qt?null:n.contentMatch)}findWrapping(n){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(y.from(n));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(n.type))?(this.match=r,o):null}}return this.match.findWrapping(n.type)}finish(n){if(!(this.options&wt)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let e=y.from(this.content);return!n&&this.match&&(e=e.append(this.match.fillBefore(y.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(n){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:n.parentNode&&!Fc.hasOwnProperty(n.parentNode.nodeName.toLowerCase())}}class Pa{constructor(n,e,r){this.parser=n,this.options=e,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=e.topNode,i,a=La(null,e.preserveWhitespace,0)|(r?Qt:0);o?i=new jt(o.type,o.attrs,j.none,!0,e.topMatch||o.type.contentMatch,a):r?i=new jt(null,null,j.none,!0,null,a):i=new jt(n.schema.topNodeType,null,j.none,!0,null,a),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(n,e){n.nodeType==3?this.addTextNode(n,e):n.nodeType==1&&this.addElement(n,e)}addTextNode(n,e){let r=n.nodeValue,o=this.top,i=o.options&ri?"full":this.localPreserveWS||(o.options&wt)>0,{schema:a}=this.parser;if(i==="full"||o.inlineContext(n)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
|
|
20989
|
-
`);else if(a.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(a.linebreakReplacement.create())){let s=r.split(/\r?\n|\r/);for(let l=0;l<s.length;l++)l&&this.insertNode(a.linebreakReplacement.create(),e,!0),s[l]&&this.insertNode(a.text(s[l]),e,!/\S/.test(s[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=o.content[o.content.length-1],l=n.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(a.text(r),e,!/\S/.test(r)),this.findInText(n)}else this.findInside(n)}addElement(n,e,r){let o=this.localPreserveWS,i=this.top;(n.tagName=="PRE"||/pre/.test(n.style&&n.style.whiteSpace))&&(this.localPreserveWS=!0);let a=n.nodeName.toLowerCase(),s;
|
|
20990
|
-
`),e)}ignoreFallback(n,e){n.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(n,e){let r=n.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],a=r.getPropertyValue(i);if(a)for(let s=void 0;;){let l=this.parser.matchStyle(i,a,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?e=e.filter(c=>!l.clearMark(c)):e=e.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return e}addElementByRule(n,e,r,o){let i,a;if(e.node)if(a=this.parser.schema.nodes[e.node],a.isLeaf)this.insertNode(a.create(e.attrs),r,n.nodeName=="BR")||this.leafFallback(n,r);else{let l=this.enter(a,e.attrs||null,r,e.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[e.mark];r=r.concat(l.create(e.attrs))}let s=this.top;if(a&&a.isLeaf)this.findInside(n);else if(o)this.addElement(n,r,o);else if(e.getContent)this.findInside(n),e.getContent(n,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=n;typeof e.contentElement=="string"?l=n.querySelector(e.contentElement):typeof e.contentElement=="function"?l=e.contentElement(n):e.contentElement&&(l=e.contentElement),this.findAround(n,l,!0),this.addAll(l,r),this.findAround(n,l,!1)}i&&this.sync(s)&&this.open--}addAll(n,e,r,o){let i=r||0;for(let a=r?n.childNodes[r]:n.firstChild,s=o==null?null:n.childNodes[o];a!=s;a=a.nextSibling,++i)this.findAtPoint(n,i),this.addDOM(a,e);this.findAtPoint(n,i)}findPlace(n,e,r){let o,i;for(let a=this.open,s=0;a>=0;a--){let l=this.nodes[a],c=l.findWrapping(n);if(c&&(!o||o.length>c.length+s)&&(o=c,i=l,!c.length))break;if(l.solid){if(r)break;s+=2}}if(!o)return null;this.sync(i);for(let a=0;a<o.length;a++)e=this.enterInner(o[a],null,e,!1);return e}insertNode(n,e,r){if(n.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(e=this.enterInner(i,null,e))}let o=this.findPlace(n,e,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(n.type));let a=j.none;for(let s of o.concat(n.marks))(i.type?i.type.allowsMarkType(s.type):Ba(s.type,n.type))&&(a=s.addToSet(a));return i.content.push(n.mark(a)),!0}return!1}enter(n,e,r,o){let i=this.findPlace(n.create(e),r,!1);return i&&(i=this.enterInner(n,e,r,!0,o)),i}enterInner(n,e,r,o=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(n);let s=La(n,i,a.options);a.options&Qt&&a.content.length==0&&(s|=Qt);let l=j.none;return r=r.filter(c=>(a.type?a.type.allowsMarkType(c.type):Ba(c.type,n))?(l=c.addToSet(l),!1):!0),this.nodes.push(new jt(n,e,l,o,null,s)),this.open++,r}closeExtra(n=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(n));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(n){for(let e=this.open;e>=0;e--){if(this.nodes[e]==n)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=wt)}return!1}get currentPos(){this.closeExtra();let n=0;for(let e=this.open;e>=0;e--){let r=this.nodes[e].content;for(let o=r.length-1;o>=0;o--)n+=r[o].nodeSize;e&&n++}return n}findAtPoint(n,e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==n&&this.find[r].offset==e&&(this.find[r].pos=this.currentPos)}findInside(n){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].pos==null&&n.nodeType==1&&n.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(n,e,r){if(n!=e&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&n.nodeType==1&&n.contains(this.find[o].node)&&e.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(n){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==n&&(this.find[e].pos=this.currentPos-(n.nodeValue.length-this.find[e].offset))}matchesContext(n){if(n.indexOf("|")>-1)return n.split(/\s*\|\s*/).some(this.matchesContext,this);let e=n.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),a=(s,l)=>{for(;s>=0;s--){let c=e[s];if(c==""){if(s==e.length-1||s==0)continue;for(;l>=i;l--)if(a(s-1,l))return!0;return!1}else{let d=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return a(e.length-1,this.open)}textblockFromContext(){let n=this.options.context;if(n)for(let e=n.depth;e>=0;e--){let r=n.node(e).contentMatchAt(n.indexAfter(e)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let e in this.parser.schema.nodes){let r=this.parser.schema.nodes[e];if(r.isTextblock&&r.defaultAttrs)return r}}}function l0(t){for(let n=t.firstChild,e=null;n;n=n.nextSibling){let r=n.nodeType==1?n.nodeName.toLowerCase():null;r&&Hc.hasOwnProperty(r)&&e?(e.appendChild(n),n=e):r=="li"?e=n:r&&(e=null)}}function c0(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function Ra(t){let n={};for(let e in t)n[e]=t[e];return n}function Ba(t,n){let e=n.schema.nodes;for(let r in e){let o=e[r];if(!o.allowsMarkType(t))continue;let i=[],a=s=>{i.push(s);for(let l=0;l<s.edgeCount;l++){let{type:c,next:d}=s.edge(l);if(c==n||i.indexOf(d)<0&&a(d))return!0}};if(a(o.contentMatch))return!0}}class Me{constructor(n,e){this.nodes=n,this.marks=e}serializeFragment(n,e={},r){r||(r=yo(e).createDocumentFragment());let o=r,i=[];return n.forEach(a=>{if(i.length||a.marks.length){let s=0,l=0;for(;s<i.length&&l<a.marks.length;){let c=a.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[s][0])||c.type.spec.spanning===!1)break;s++,l++}for(;s<i.length;)o=i.pop()[1];for(;l<a.marks.length;){let c=a.marks[l++],d=this.serializeMark(c,a.isInline,e);d&&(i.push([c,o]),o.appendChild(d.dom),o=d.contentDOM||d.dom)}}o.appendChild(this.serializeNodeInner(a,e))}),r}serializeNodeInner(n,e){let{dom:r,contentDOM:o}=Zt(yo(e),this.nodes[n.type.name](n),null,n.attrs);if(o){if(n.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(n.content,e,o)}return r}serializeNode(n,e={}){let r=this.serializeNodeInner(n,e);for(let o=n.marks.length-1;o>=0;o--){let i=this.serializeMark(n.marks[o],n.isInline,e);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(n,e,r={}){let o=this.marks[n.type.name];return o&&Zt(yo(r),o(n,e),null,n.attrs)}static renderSpec(n,e,r=null,o){return Zt(n,e,r,o)}static fromSchema(n){return n.cached.domSerializer||(n.cached.domSerializer=new Me(this.nodesFromSchema(n),this.marksFromSchema(n)))}static nodesFromSchema(n){let e=Na(n.nodes);return e.text||(e.text=r=>r.text),e}static marksFromSchema(n){return Na(n.marks)}}function Na(t){let n={};for(let e in t){let r=t[e].spec.toDOM;r&&(n[e]=r)}return n}function yo(t){return t.document||window.document}const Fa=new WeakMap;function d0(t){let n=Fa.get(t);return n===void 0&&Fa.set(t,n=p0(t)),n}function p0(t){let n=null;function e(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")n||(n=[]),n.push(r);else for(let o=0;o<r.length;o++)e(r[o]);else for(let o in r)e(r[o])}return e(t),n}function Zt(t,n,e,r){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let o=n[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=d0(r))&&i.indexOf(n)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=o.indexOf(" ");a>0&&(e=o.slice(0,a),o=o.slice(a+1));let s,l=e?t.createElementNS(e,o):t.createElement(o),c=n[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let h in c)if(c[h]!=null){let g=h.indexOf(" ");g>0?l.setAttributeNS(h.slice(0,g),h.slice(g+1),c[h]):h=="style"&&l.style?l.style.cssText=c[h]:l.setAttribute(h,c[h])}}for(let h=d;h<n.length;h++){let g=n[h];if(g===0){if(h<n.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:u,contentDOM:f}=Zt(t,g,e,r);if(l.appendChild(u),f){if(s)throw new RangeError("Multiple content holes");s=f}}}return{dom:l,contentDOM:s}}const jc=65535,Xc=Math.pow(2,16);function h0(t,n){return t+n*Xc}function Ha(t){return t&jc}function g0(t){return(t-(t&jc))/Xc}const Vc=1,Wc=2,nr=4,Uc=8;class oi{constructor(n,e,r){this.pos=n,this.delInfo=e,this.recover=r}get deleted(){return(this.delInfo&Uc)>0}get deletedBefore(){return(this.delInfo&(Vc|nr))>0}get deletedAfter(){return(this.delInfo&(Wc|nr))>0}get deletedAcross(){return(this.delInfo&nr)>0}}class yn{constructor(n,e=!1){if(this.ranges=n,this.inverted=e,!n.length&&yn.empty)return yn.empty}recover(n){let e=0,r=Ha(n);if(!this.inverted)for(let o=0;o<r;o++)e+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+e+g0(n)}mapResult(n,e=1){return this._map(n,e,!1)}map(n,e=1){return this._map(n,e,!0)}_map(n,e,r){let o=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?o:0);if(l>n)break;let c=this.ranges[s+i],d=this.ranges[s+a],h=l+c;if(n<=h){let g=c?n==l?-1:n==h?1:e:e,u=l+o+(g<0?0:d);if(r)return u;let f=n==(e<0?l:h)?null:h0(s/3,n-l),m=n==l?Wc:n==h?Vc:nr;return(e<0?n!=l:n!=h)&&(m|=Uc),new oi(u,m,f)}o+=d-c}return r?n+o:new oi(n+o,0,null)}touches(n,e){let r=0,o=Ha(e),i=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>n)break;let c=this.ranges[s+i],d=l+c;if(n<=d&&s==o*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(n){let e=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let a=this.ranges[o],s=a-(this.inverted?i:0),l=a+(this.inverted?0:i),c=this.ranges[o+e],d=this.ranges[o+r];n(s,s+c,l,l+d),i+=d-c}}invert(){return new yn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(n){return n==0?yn.empty:new yn(n<0?[0,-n,0]:[0,0,n])}}yn.empty=new yn([]);class _t{constructor(n,e,r=0,o=n?n.length:0){this.mirror=e,this.from=r,this.to=o,this._maps=n||[],this.ownData=!(n||e)}get maps(){return this._maps}slice(n=0,e=this.maps.length){return new _t(this._maps,this.mirror,n,e)}appendMap(n,e){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(n),e!=null&&this.setMirror(this._maps.length-1,e)}appendMapping(n){for(let e=0,r=this._maps.length;e<n._maps.length;e++){let o=n.getMirror(e);this.appendMap(n._maps[e],o!=null&&o<e?r+o:void 0)}}getMirror(n){if(this.mirror){for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==n)return this.mirror[e+(e%2?-1:1)]}}setMirror(n,e){this.mirror||(this.mirror=[]),this.mirror.push(n,e)}appendMappingInverted(n){for(let e=n.maps.length-1,r=this._maps.length+n._maps.length;e>=0;e--){let o=n.getMirror(e);this.appendMap(n._maps[e].invert(),o!=null&&o>e?r-o-1:void 0)}}invert(){let n=new _t;return n.appendMappingInverted(this),n}map(n,e=1){if(this.mirror)return this._map(n,e,!0);for(let r=this.from;r<this.to;r++)n=this._maps[r].map(n,e);return n}mapResult(n,e=1){return this._map(n,e,!1)}_map(n,e,r){let o=0;for(let i=this.from;i<this.to;i++){let a=this._maps[i],s=a.mapResult(n,e);if(s.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,n=this._maps[l].recover(s.recover);continue}}o|=s.delInfo,n=s.pos}return r?n:new oi(n,o,null)}}const vo=Object.create(null);class pn{getMap(){return yn.empty}merge(n){return null}static fromJSON(n,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=vo[e.stepType];if(!r)throw new RangeError(`No step type ${e.stepType} defined`);return r.fromJSON(n,e)}static jsonID(n,e){if(n in vo)throw new RangeError("Duplicate use of step JSON ID "+n);return vo[n]=e,e.prototype.jsonID=n,e}}class Y{constructor(n,e){this.doc=n,this.failed=e}static ok(n){return new Y(n,null)}static fail(n){return new Y(null,n)}static fromReplace(n,e,r,o){try{return Y.ok(n.replace(e,r,o))}catch(i){if(i instanceof dr)return Y.fail(i.message);throw i}}}function Pi(t,n,e){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(Pi(i.content,n,i))),i.isInline&&(i=n(i,e,o)),r.push(i)}return y.fromArray(r)}class Yn extends pn{constructor(n,e,r){super(),this.from=n,this.to=e,this.mark=r}apply(n){let e=n.slice(this.from,this.to),r=n.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new w(Pi(e.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),o),e.openStart,e.openEnd);return Y.fromReplace(n,this.from,this.to,i)}invert(){return new Dn(this.from,this.to,this.mark)}map(n){let e=n.mapResult(this.from,1),r=n.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new Yn(e.pos,r.pos,this.mark)}merge(n){return n instanceof Yn&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from?new Yn(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(n,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Yn(e.from,e.to,n.markFromJSON(e.mark))}}pn.jsonID("addMark",Yn);class Dn extends pn{constructor(n,e,r){super(),this.from=n,this.to=e,this.mark=r}apply(n){let e=n.slice(this.from,this.to),r=new w(Pi(e.content,o=>o.mark(this.mark.removeFromSet(o.marks)),n),e.openStart,e.openEnd);return Y.fromReplace(n,this.from,this.to,r)}invert(){return new Yn(this.from,this.to,this.mark)}map(n){let e=n.mapResult(this.from,1),r=n.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new Dn(e.pos,r.pos,this.mark)}merge(n){return n instanceof Dn&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from?new Dn(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(n,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Dn(e.from,e.to,n.markFromJSON(e.mark))}}pn.jsonID("removeMark",Dn);class Qn extends pn{constructor(n,e){super(),this.pos=n,this.mark=e}apply(n){let e=n.nodeAt(this.pos);if(!e)return Y.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return Y.fromReplace(n,this.pos,this.pos+1,new w(y.from(r),0,e.isLeaf?0:1))}invert(n){let e=n.nodeAt(this.pos);if(e){let r=this.mark.addToSet(e.marks);if(r.length==e.marks.length){for(let o=0;o<e.marks.length;o++)if(!e.marks[o].isInSet(r))return new Qn(this.pos,e.marks[o]);return new Qn(this.pos,this.mark)}}return new Ee(this.pos,this.mark)}map(n){let e=n.mapResult(this.pos,1);return e.deletedAfter?null:new Qn(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(n,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Qn(e.pos,n.markFromJSON(e.mark))}}pn.jsonID("addNodeMark",Qn);class Ee extends pn{constructor(n,e){super(),this.pos=n,this.mark=e}apply(n){let e=n.nodeAt(this.pos);if(!e)return Y.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return Y.fromReplace(n,this.pos,this.pos+1,new w(y.from(r),0,e.isLeaf?0:1))}invert(n){let e=n.nodeAt(this.pos);return!e||!this.mark.isInSet(e.marks)?this:new Qn(this.pos,this.mark)}map(n){let e=n.mapResult(this.pos,1);return e.deletedAfter?null:new Ee(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(n,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ee(e.pos,n.markFromJSON(e.mark))}}pn.jsonID("removeNodeMark",Ee);class J extends pn{constructor(n,e,r,o=!1){super(),this.from=n,this.to=e,this.slice=r,this.structure=o}apply(n){return this.structure&&ii(n,this.from,this.to)?Y.fail("Structure replace would overwrite content"):Y.fromReplace(n,this.from,this.to,this.slice)}getMap(){return new yn([this.from,this.to-this.from,this.slice.size])}invert(n){return new J(this.from,this.from+this.slice.size,n.slice(this.from,this.to))}map(n){let e=n.mapResult(this.to,-1),r=this.from==this.to&&J.MAP_BIAS<0?e:n.mapResult(this.from,1);return r.deletedAcross&&e.deletedAcross?null:new J(r.pos,Math.max(r.pos,e.pos),this.slice,this.structure)}merge(n){if(!(n instanceof J)||n.structure||this.structure)return null;if(this.from+this.slice.size==n.from&&!this.slice.openEnd&&!n.slice.openStart){let e=this.slice.size+n.slice.size==0?w.empty:new w(this.slice.content.append(n.slice.content),this.slice.openStart,n.slice.openEnd);return new J(this.from,this.to+(n.to-n.from),e,this.structure)}else if(n.to==this.from&&!this.slice.openStart&&!n.slice.openEnd){let e=this.slice.size+n.slice.size==0?w.empty:new w(n.slice.content.append(this.slice.content),n.slice.openStart,this.slice.openEnd);return new J(n.from,this.to,e,this.structure)}else return null}toJSON(){let n={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n}static fromJSON(n,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new J(e.from,e.to,w.fromJSON(n,e.slice),!!e.structure)}}J.MAP_BIAS=1;pn.jsonID("replace",J);class Z extends pn{constructor(n,e,r,o,i,a,s=!1){super(),this.from=n,this.to=e,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=a,this.structure=s}apply(n){if(this.structure&&(ii(n,this.from,this.gapFrom)||ii(n,this.gapTo,this.to)))return Y.fail("Structure gap-replace would overwrite content");let e=n.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return Y.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,e.content);return r?Y.fromReplace(n,this.from,this.to,r):Y.fail("Content does not fit in gap")}getMap(){return new yn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(n){let e=this.gapTo-this.gapFrom;return new Z(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,n.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(n){let e=n.mapResult(this.from,1),r=n.mapResult(this.to,-1),o=this.from==this.gapFrom?e.pos:n.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:n.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||o<e.pos||i>r.pos?null:new Z(e.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let n={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n}static fromJSON(n,e){if(typeof e.from!="number"||typeof e.to!="number"||typeof e.gapFrom!="number"||typeof e.gapTo!="number"||typeof e.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Z(e.from,e.to,e.gapFrom,e.gapTo,w.fromJSON(n,e.slice),e.insert,!!e.structure)}}pn.jsonID("replaceAround",Z);function ii(t,n,e){let r=t.resolve(n),o=e-n,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let a=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}}return!1}function u0(t,n,e,r){let o=[],i=[],a,s;t.doc.nodesBetween(n,e,(l,c,d)=>{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let g=Math.max(c,n),u=Math.min(c+l.nodeSize,e),f=r.addToSet(h);for(let m=0;m<h.length;m++)h[m].isInSet(f)||(a&&a.to==g&&a.mark.eq(h[m])?a.to=u:o.push(a=new Dn(g,u,h[m])));s&&s.to==g?s.to=u:i.push(s=new Yn(g,u,r))}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function f0(t,n,e,r){let o=[],i=0;t.doc.nodesBetween(n,e,(a,s)=>{if(!a.isInline)return;i++;let l=null;if(r instanceof Zr){let c=a.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(a.marks)&&(l=[r]):l=a.marks;if(l&&l.length){let c=Math.min(s+a.nodeSize,e);for(let d=0;d<l.length;d++){let h=l[d],g;for(let u=0;u<o.length;u++){let f=o[u];f.step==i-1&&h.eq(o[u].style)&&(g=f)}g?(g.to=c,g.step=i):o.push({style:h,from:Math.max(s,n),to:c,step:i})}}}),o.forEach(a=>t.step(new Dn(a.from,a.to,a.style)))}function Ri(t,n,e,r=e.contentMatch,o=!0){let i=t.doc.nodeAt(n),a=[],s=n+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),d=s+c.nodeSize,h=r.matchType(c.type);if(!h)a.push(new J(s,d,w.empty));else{r=h;for(let g=0;g<c.marks.length;g++)e.allowsMarkType(c.marks[g].type)||t.step(new Dn(s,d,c.marks[g]));if(o&&c.isText&&e.whitespace!="pre"){let g,u=/\r?\n|\r/g,f;for(;g=u.exec(c.text);)f||(f=new w(y.from(e.schema.text(" ",e.allowedMarks(c.marks))),0,0)),a.push(new J(s+g.index,s+g.index+g[0].length,f))}}s=d}if(!r.validEnd){let l=r.fillBefore(y.empty,!0);t.replace(s,s,new w(l,0,0))}for(let l=a.length-1;l>=0;l--)t.step(a[l])}function m0(t,n,e){return(n==0||t.canReplace(n,t.childCount))&&(e==t.childCount||t.canReplace(0,e))}function Qe(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,o=0,i=0;;--r){let a=t.$from.node(r),s=t.$from.index(r)+o,l=t.$to.indexAfter(r)-i;if(r<t.depth&&a.canReplace(s,l,e))return r;if(r==0||a.type.spec.isolating||!m0(a,s,l))break;s&&(o=1),l<a.childCount&&(i=1)}return null}function x0(t,n,e){let{$from:r,$to:o,depth:i}=n,a=r.before(i+1),s=o.after(i+1),l=a,c=s,d=y.empty,h=0;for(let f=i,m=!1;f>e;f--)m||r.index(f)>0?(m=!0,d=y.from(r.node(f).copy(d)),h++):l--;let g=y.empty,u=0;for(let f=i,m=!1;f>e;f--)m||o.after(f+1)<o.end(f)?(m=!0,g=y.from(o.node(f).copy(g)),u++):c++;t.step(new Z(l,c,a,s,new w(d.append(g),h,u),d.size-h,!0))}function Bi(t,n,e=null,r=t){let o=b0(t,n),i=o&&y0(r,n);return i?o.map(ja).concat({type:n,attrs:e}).concat(i.map(ja)):null}function ja(t){return{type:t,attrs:null}}function b0(t,n){let{parent:e,startIndex:r,endIndex:o}=t,i=e.contentMatchAt(r).findWrapping(n);if(!i)return null;let a=i.length?i[0]:n;return e.canReplaceWith(r,o,a)?i:null}function y0(t,n){let{parent:e,startIndex:r,endIndex:o}=t,i=e.child(r),a=n.contentMatch.findWrapping(i.type);if(!a)return null;let l=(a.length?a[a.length-1]:n).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(e.child(c).type);return!l||!l.validEnd?null:a}function v0(t,n,e){let r=y.empty;for(let a=e.length-1;a>=0;a--){if(r.size){let s=e[a].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=y.from(e[a].type.create(e[a].attrs,r))}let o=n.start,i=n.end;t.step(new Z(o,i,o,i,new w(r,0,0),e.length,!0))}function k0(t,n,e,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(n,e,(a,s)=>{let l=typeof o=="function"?o(a):o;if(a.isTextblock&&!a.hasMarkup(r,l)&&w0(t.doc,t.mapping.slice(i).map(s),r)){let c=null;if(r.schema.linebreakReplacement){let u=r.whitespace=="pre",f=!!r.contentMatch.matchType(r.schema.linebreakReplacement);u&&!f?c=!1:!u&&f&&(c=!0)}c===!1&&Kc(t,a,s,i),Ri(t,t.mapping.slice(i).map(s,1),r,void 0,c===null);let d=t.mapping.slice(i),h=d.map(s,1),g=d.map(s+a.nodeSize,1);return t.step(new Z(h,g,h+1,g-1,new w(y.from(r.create(l,null,a.marks)),0,0),1,!0)),c===!0&&qc(t,a,s,i),!1}})}function qc(t,n,e,r){n.forEach((o,i)=>{if(o.isText){let a,s=/\r?\n|\r/g;for(;a=s.exec(o.text);){let l=t.mapping.slice(r).map(e+1+i+a.index);t.replaceWith(l,l+1,n.type.schema.linebreakReplacement.create())}}})}function Kc(t,n,e,r){n.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(e+1+i);t.replaceWith(a,a+1,n.type.schema.text(`
|
|
20991
|
-
`))}})}function w0(t,n,e){let r=t.resolve(n),o=r.index();return r.parent.canReplaceWith(o,o+1,e)}function _0(t,n,e,r,o){let i=t.doc.nodeAt(n);if(!i)throw new RangeError("No node at given position");e||(e=i.type);let a=e.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(n,n+i.nodeSize,a);if(!e.validContent(i.content))throw new RangeError("Invalid content for node type "+e.name);t.step(new Z(n,n+i.nodeSize,n+1,n+i.nodeSize-1,new w(y.from(a),0,0),1,!0))}function Xe(t,n,e=1,r){let o=t.resolve(n),i=o.depth-e,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,d=e-2;c>i;c--,d--){let h=o.node(c),g=o.index(c);if(h.type.spec.isolating)return!1;let u=h.content.cutByIndex(g,h.childCount),f=r&&r[d+1];f&&(u=u.replaceChild(0,f.type.create(f.attrs)));let m=r&&r[d]||h;if(!h.canReplace(g+1,h.childCount)||!m.type.validContent(u))return!1}let s=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(s,s,l?l.type:o.node(i+1).type)}function C0(t,n,e=1,r){let o=t.doc.resolve(n),i=y.empty,a=y.empty;for(let s=o.depth,l=o.depth-e,c=e-1;s>l;s--,c--){i=y.from(o.node(s).copy(i));let d=r&&r[c];a=y.from(d?d.type.create(d.attrs,a):o.node(s).copy(a))}t.step(new J(n,n,new w(i.append(a),e,e),!0))}function le(t,n){let e=t.resolve(n),r=e.index();return Jc(e.nodeBefore,e.nodeAfter)&&e.parent.canReplace(r,r+1)}function S0(t,n){n.content.size||t.type.compatibleContent(n.type);let e=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<n.childCount;o++){let i=n.child(o),a=i.type==r?t.type.schema.nodes.text:i.type;if(e=e.matchType(a),!e||!t.type.allowsMarks(i.marks))return!1}return e.validEnd}function Jc(t,n){return!!(t&&n&&!t.isLeaf&&S0(t,n))}function no(t,n,e=-1){let r=t.resolve(n);for(let o=r.depth;;o--){let i,a,s=r.index(o);if(o==r.depth?(i=r.nodeBefore,a=r.nodeAfter):e>0?(i=r.node(o+1),s++,a=r.node(o).maybeChild(s)):(i=r.node(o).maybeChild(s-1),a=r.node(o+1)),i&&!i.isTextblock&&Jc(i,a)&&r.node(o).canReplace(s,s+1))return n;if(o==0)break;n=e<0?r.before(o):r.after(o)}}function E0(t,n,e){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(n-e),a=i.node().type;if(o&&a.inlineContent){let d=a.whitespace=="pre",h=!!a.contentMatch.matchType(o);d&&!h?r=!1:!d&&h&&(r=!0)}let s=t.steps.length;if(r===!1){let d=t.doc.resolve(n+e);Kc(t,d.node(),d.before(),s)}a.inlineContent&&Ri(t,n+e-1,a,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(s),c=l.map(n-e);if(t.step(new J(c,l.map(n+e,-1),w.empty,!0)),r===!0){let d=t.doc.resolve(c);qc(t,d.node(),d.before(),t.steps.length)}return t}function I0(t,n,e){let r=t.resolve(n);if(r.parent.canReplaceWith(r.index(),r.index(),e))return n;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,e))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,e))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function Gc(t,n,e){let r=t.resolve(n);if(!e.content.size)return n;let o=e.content;for(let i=0;i<e.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(e.openStart==0&&e.size?2:1);i++)for(let a=r.depth;a>=0;a--){let s=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,l=r.index(a)+(s>0?1:0),c=r.node(a),d=!1;if(i==1)d=c.canReplace(l,l,o);else{let h=c.contentMatchAt(l).findWrapping(o.firstChild.type);d=h&&c.canReplaceWith(l,l,h[0])}if(d)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}function eo(t,n,e=n,r=w.empty){if(n==e&&!r.size)return null;let o=t.resolve(n),i=t.resolve(e);return Yc(o,i,r)?new J(n,e,r):new T0(o,i,r).fit()}function Yc(t,n,e){return!e.openStart&&!e.openEnd&&t.start()==n.start()&&t.parent.canReplace(t.index(),n.index(),e.content)}class T0{constructor(n,e,r){this.$from=n,this.$to=e,this.unplaced=r,this.frontier=[],this.placed=y.empty;for(let o=0;o<=n.depth;o++){let i=n.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(n.indexAfter(o))})}for(let o=n.depth;o>0;o--)this.placed=y.from(n.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 n=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(n<0?this.$to:r.doc.resolve(n));if(!o)return null;let i=this.placed,a=r.depth,s=o.depth;for(;a&&s&&i.childCount==1;)i=i.firstChild.content,a--,s--;let l=new w(i,a,s);return n>-1?new Z(r.pos,n,this.$to.pos,this.$to.end(),l,e):l.size||r.pos!=this.$to.pos?new J(r.pos,o.pos,l):null}findFittable(){let n=this.unplaced.openStart;for(let e=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<n;r++){let i=e.firstChild;if(e.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){n=r;break}e=i.content}for(let e=1;e<=2;e++)for(let r=e==1?n:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=ko(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let a=o.firstChild;for(let s=this.depth;s>=0;s--){let{type:l,match:c}=this.frontier[s],d,h=null;if(e==1&&(a?c.matchType(a.type)||(h=c.fillBefore(y.from(a),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:s,parent:i,inject:h};if(e==2&&a&&(d=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:i,wrap:d};if(i&&c.matchType(i.type))break}}}openMore(){let{content:n,openStart:e,openEnd:r}=this.unplaced,o=ko(n,e);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new w(n,e+1,Math.max(r,o.size+e>=n.size-r?e+1:0)),!0)}dropNode(){let{content:n,openStart:e,openEnd:r}=this.unplaced,o=ko(n,e);if(o.childCount<=1&&e>0){let i=n.size-e<=e+o.size;this.unplaced=new w(it(n,e-1,1),e-1,i?e-1:r)}else this.unplaced=new w(it(n,e,1),e,r)}placeNodes({sliceDepth:n,frontierDepth:e,parent:r,inject:o,wrap:i}){for(;this.depth>e;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let a=this.unplaced,s=r?r.content:a.content,l=a.openStart-n,c=0,d=[],{match:h,type:g}=this.frontier[e];if(o){for(let m=0;m<o.childCount;m++)d.push(o.child(m));h=h.matchFragment(o)}let u=s.size+n-(a.content.size-a.openEnd);for(;c<s.childCount;){let m=s.child(c),x=h.matchType(m.type);if(!x)break;c++,(c>1||l==0||m.content.size)&&(h=x,d.push(Qc(m.mark(g.allowedMarks(m.marks)),c==1?l:0,c==s.childCount?u:-1)))}let f=c==s.childCount;f||(u=-1),this.placed=at(this.placed,e,y.from(d)),this.frontier[e].match=h,f&&u<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,x=s;m<u;m++){let b=x.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),x=b.content}this.unplaced=f?n==0?w.empty:new w(it(a.content,n-1,1),n-1,u<0?a.openEnd:n-1):new w(it(a.content,n,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let n=this.frontier[this.depth],e;if(!n.type.isTextblock||!wo(this.$to,this.$to.depth,n.type,n.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.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(n){n:for(let e=Math.min(this.depth,n.depth);e>=0;e--){let{match:r,type:o}=this.frontier[e],i=e<n.depth&&n.end(e+1)==n.pos+(n.depth-(e+1)),a=wo(n,e,o,r,i);if(a){for(let s=e-1;s>=0;s--){let{match:l,type:c}=this.frontier[s],d=wo(n,s,c,l,!0);if(!d||d.childCount)continue n}return{depth:e,fit:a,move:i?n.doc.resolve(n.after(e+1)):n}}}}close(n){let e=this.findCloseLevel(n);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=at(this.placed,e.depth,e.fit)),n=e.move;for(let r=e.depth+1;r<=n.depth;r++){let o=n.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,n.index(r));this.openFrontierNode(o.type,o.attrs,i)}return n}openFrontierNode(n,e=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(n),this.placed=at(this.placed,this.depth,y.from(n.create(e,r))),this.frontier.push({type:n,match:n.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(y.empty,!0);e.childCount&&(this.placed=at(this.placed,this.frontier.length,e))}}function it(t,n,e){return n==0?t.cutByIndex(e,t.childCount):t.replaceChild(0,t.firstChild.copy(it(t.firstChild.content,n-1,e)))}function at(t,n,e){return n==0?t.append(e):t.replaceChild(t.childCount-1,t.lastChild.copy(at(t.lastChild.content,n-1,e)))}function ko(t,n){for(let e=0;e<n;e++)t=t.firstChild.content;return t}function Qc(t,n,e){if(n<=0)return t;let r=t.content;return n>1&&(r=r.replaceChild(0,Qc(r.firstChild,n-1,r.childCount==1?e-1:0))),n>0&&(r=t.type.contentMatch.fillBefore(r).append(r),e<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(y.empty,!0)))),t.copy(r)}function wo(t,n,e,r,o){let i=t.node(n),a=o?t.indexAfter(n):t.index(n);if(a==i.childCount&&!e.compatibleContent(i.type))return null;let s=r.fillBefore(i.content,!0,a);return s&&!$0(e,i.content,a)?s:null}function $0(t,n,e){for(let r=e;r<n.childCount;r++)if(!t.allowsMarks(n.child(r).marks))return!0;return!1}function M0(t){return t.spec.defining||t.spec.definingForContent}function z0(t,n,e,r){if(!r.size)return t.deleteRange(n,e);let o=t.doc.resolve(n),i=t.doc.resolve(e);if(Yc(o,i,r))return t.step(new J(n,e,r));let a=nd(o,i);a[a.length-1]==0&&a.pop();let s=-(o.depth+1);a.unshift(s);for(let g=o.depth,u=o.pos-1;g>0;g--,u--){let f=o.node(g).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;a.indexOf(g)>-1?s=g:o.before(g)==u&&a.splice(1,0,-g)}let l=a.indexOf(s),c=[],d=r.openStart;for(let g=r.content,u=0;;u++){let f=g.firstChild;if(c.push(f),u==r.openStart)break;g=f.content}for(let g=d-1;g>=0;g--){let u=c[g],f=M0(u.type);if(f&&!u.sameMarkup(o.node(Math.abs(s)-1)))d=g;else if(f||!u.type.isTextblock)break}for(let g=r.openStart;g>=0;g--){let u=(g+d+1)%(r.openStart+1),f=c[u];if(f)for(let m=0;m<a.length;m++){let x=a[(m+l)%a.length],b=!0;x<0&&(b=!1,x=-x);let _=o.node(x-1),z=o.index(x-1);if(_.canReplaceWith(z,z,f.type,f.marks))return t.replace(o.before(x),b?i.after(x):e,new w(Zc(r.content,0,r.openStart,u),u,r.openEnd))}}let h=t.steps.length;for(let g=a.length-1;g>=0&&(t.replace(n,e,r),!(t.steps.length>h));g--){let u=a[g];u<0||(n=o.before(u),e=i.after(u))}}function Zc(t,n,e,r,o){if(n<e){let i=t.firstChild;t=t.replaceChild(0,i.copy(Zc(i.content,n+1,e,r,i)))}if(n>r){let i=o.contentMatchAt(0),a=i.fillBefore(t).append(t);t=a.append(i.matchFragment(a).fillBefore(y.empty,!0))}return t}function D0(t,n,e,r){if(!r.isInline&&n==e&&t.doc.resolve(n).parent.content.size){let o=I0(t.doc,n,r.type);o!=null&&(n=e=o)}t.replaceRange(n,e,new w(y.from(r),0,0))}function O0(t,n,e){let r=t.doc.resolve(n),o=t.doc.resolve(e);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&r.parentOffset==0&&o.parentOffset==0){let a=r.sharedDepth(e),s=!1;for(let l=r.depth;l>a;l--)r.node(l).type.spec.isolating&&(s=!0);for(let l=o.depth;l>a;l--)o.node(l).type.spec.isolating&&(s=!0);if(!s){for(let l=r.depth;l>0&&n==r.start(l);l--)n=r.before(l);for(let l=o.depth;l>0&&e==o.start(l);l--)e=o.before(l);r=t.doc.resolve(n),o=t.doc.resolve(e)}}let i=nd(r,o);for(let a=0;a<i.length;a++){let s=i[a],l=a==i.length-1;if(l&&s==0||r.node(s).type.contentMatch.validEnd)return t.delete(r.start(s),o.end(s));if(s>0&&(l||r.node(s-1).canReplace(r.index(s-1),o.indexAfter(s-1))))return t.delete(r.before(s),o.after(s))}for(let a=1;a<=r.depth&&a<=o.depth;a++)if(n-r.start(a)==r.depth-a&&e>r.end(a)&&o.end(a)-e!=o.depth-a&&r.start(a-1)==o.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),o.index(a-1)))return t.delete(r.before(a),e);t.delete(n,e)}function nd(t,n){let e=[],r=Math.min(t.depth,n.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||n.end(o)>n.pos+(n.depth-o)||t.node(o).type.spec.isolating||n.node(o).type.spec.isolating)break;(i==n.start(o)||o==t.depth&&o==n.depth&&t.parent.inlineContent&&n.parent.inlineContent&&o&&n.start(o-1)==i-1)&&e.push(o)}return e}class Ve extends pn{constructor(n,e,r){super(),this.pos=n,this.attr=e,this.value=r}apply(n){let e=n.nodeAt(this.pos);if(!e)return Y.fail("No node at attribute step's position");let r=Object.create(null);for(let i in e.attrs)r[i]=e.attrs[i];r[this.attr]=this.value;let o=e.type.create(r,null,e.marks);return Y.fromReplace(n,this.pos,this.pos+1,new w(y.from(o),0,e.isLeaf?0:1))}getMap(){return yn.empty}invert(n){return new Ve(this.pos,this.attr,n.nodeAt(this.pos).attrs[this.attr])}map(n){let e=n.mapResult(this.pos,1);return e.deletedAfter?null:new Ve(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(n,e){if(typeof e.pos!="number"||typeof e.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ve(e.pos,e.attr,e.value)}}pn.jsonID("attr",Ve);class Ct extends pn{constructor(n,e){super(),this.attr=n,this.value=e}apply(n){let e=Object.create(null);for(let o in n.attrs)e[o]=n.attrs[o];e[this.attr]=this.value;let r=n.type.create(e,n.content,n.marks);return Y.ok(r)}getMap(){return yn.empty}invert(n){return new Ct(this.attr,n.attrs[this.attr])}map(n){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(n,e){if(typeof e.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ct(e.attr,e.value)}}pn.jsonID("docAttr",Ct);let qe=class extends Error{};qe=function t(n){let e=Error.call(this,n);return e.__proto__=t.prototype,e};qe.prototype=Object.create(Error.prototype);qe.prototype.constructor=qe;qe.prototype.name="TransformError";class ed{constructor(n){this.doc=n,this.steps=[],this.docs=[],this.mapping=new _t}get before(){return this.docs.length?this.docs[0]:this.doc}step(n){let e=this.maybeStep(n);if(e.failed)throw new qe(e.failed);return this}maybeStep(n){let e=n.apply(this.doc);return e.failed||this.addStep(n,e.doc),e}get docChanged(){return this.steps.length>0}changedRange(){let n=1e9,e=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let o=this.mapping.maps[r];r&&(n=o.map(n,1),e=o.map(e,-1)),o.forEach((i,a,s,l)=>{n=Math.min(n,s),e=Math.max(e,l)})}return n==1e9?null:{from:n,to:e}}addStep(n,e){this.docs.push(this.doc),this.steps.push(n),this.mapping.appendMap(n.getMap()),this.doc=e}replace(n,e=n,r=w.empty){let o=eo(this.doc,n,e,r);return o&&this.step(o),this}replaceWith(n,e,r){return this.replace(n,e,new w(y.from(r),0,0))}delete(n,e){return this.replace(n,e,w.empty)}insert(n,e){return this.replaceWith(n,n,e)}replaceRange(n,e,r){return z0(this,n,e,r),this}replaceRangeWith(n,e,r){return D0(this,n,e,r),this}deleteRange(n,e){return O0(this,n,e),this}lift(n,e){return x0(this,n,e),this}join(n,e=1){return E0(this,n,e),this}wrap(n,e){return v0(this,n,e),this}setBlockType(n,e=n,r,o=null){return k0(this,n,e,r,o),this}setNodeMarkup(n,e,r=null,o){return _0(this,n,e,r,o),this}setNodeAttribute(n,e,r){return this.step(new Ve(n,e,r)),this}setDocAttribute(n,e){return this.step(new Ct(n,e)),this}addNodeMark(n,e){return this.step(new Qn(n,e)),this}removeNodeMark(n,e){let r=this.doc.nodeAt(n);if(!r)throw new RangeError("No node at position "+n);if(e instanceof j)e.isInSet(r.marks)&&this.step(new Ee(n,e));else{let o=r.marks,i,a=[];for(;i=e.isInSet(o);)a.push(new Ee(n,i)),o=i.removeFromSet(o);for(let s=a.length-1;s>=0;s--)this.step(a[s])}return this}split(n,e=1,r){return C0(this,n,e,r),this}addMark(n,e,r){return u0(this,n,e,r),this}removeMark(n,e,r){return f0(this,n,e,r),this}clearIncompatible(n,e,r){return Ri(this,n,e,r),this}}const _o=Object.create(null);class B{constructor(n,e,r){this.$anchor=n,this.$head=e,this.ranges=r||[new A0(n.min(e),n.max(e))]}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 n=this.ranges;for(let e=0;e<n.length;e++)if(n[e].$from.pos!=n[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(n,e=w.empty){let r=e.content.lastChild,o=null;for(let s=0;s<e.openEnd;s++)o=r,r=r.lastChild;let i=n.steps.length,a=this.ranges;for(let s=0;s<a.length;s++){let{$from:l,$to:c}=a[s],d=n.mapping.slice(i);n.replaceRange(d.map(l.pos),d.map(c.pos),s?w.empty:e),s==0&&Wa(n,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(n,e){let r=n.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:a,$to:s}=o[i],l=n.mapping.slice(r),c=l.map(a.pos),d=l.map(s.pos);i?n.deleteRange(c,d):(n.replaceRangeWith(c,d,e),Wa(n,r,e.isInline?-1:1))}}static findFrom(n,e,r=!1){let o=n.parent.inlineContent?new P(n):Pe(n.node(0),n.parent,n.pos,n.index(),e,r);if(o)return o;for(let i=n.depth-1;i>=0;i--){let a=e<0?Pe(n.node(0),n.node(i),n.before(i+1),n.index(i),e,r):Pe(n.node(0),n.node(i),n.after(i+1),n.index(i)+1,e,r);if(a)return a}return null}static near(n,e=1){return this.findFrom(n,e)||this.findFrom(n,-e)||new Sn(n.node(0))}static atStart(n){return Pe(n,n,0,0,1)||new Sn(n)}static atEnd(n){return Pe(n,n,n.content.size,n.childCount,-1)||new Sn(n)}static fromJSON(n,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=_o[e.type];if(!r)throw new RangeError(`No selection type ${e.type} defined`);return r.fromJSON(n,e)}static jsonID(n,e){if(n in _o)throw new RangeError("Duplicate use of selection JSON ID "+n);return _o[n]=e,e.prototype.jsonID=n,e}getBookmark(){return P.between(this.$anchor,this.$head).getBookmark()}}B.prototype.visible=!0;class A0{constructor(n,e){this.$from=n,this.$to=e}}let Xa=!1;function Va(t){!Xa&&!t.parent.inlineContent&&(Xa=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class P extends B{constructor(n,e=n){Va(n),Va(e),super(n,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(n,e){let r=n.resolve(e.map(this.head));if(!r.parent.inlineContent)return B.near(r);let o=n.resolve(e.map(this.anchor));return new P(o.parent.inlineContent?o:r,r)}replace(n,e=w.empty){if(super.replace(n,e),e==w.empty){let r=this.$from.marksAcross(this.$to);r&&n.ensureMarks(r)}}eq(n){return n instanceof P&&n.anchor==this.anchor&&n.head==this.head}getBookmark(){return new to(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(n,e){if(typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new P(n.resolve(e.anchor),n.resolve(e.head))}static create(n,e,r=e){let o=n.resolve(e);return new this(o,r==e?o:n.resolve(r))}static between(n,e,r){let o=n.pos-e.pos;if((!r||o)&&(r=o>=0?1:-1),!e.parent.inlineContent){let i=B.findFrom(e,r,!0)||B.findFrom(e,-r,!0);if(i)e=i.$head;else return B.near(e,r)}return n.parent.inlineContent||(o==0?n=e:(n=(B.findFrom(n,-r,!0)||B.findFrom(n,r,!0)).$anchor,n.pos<e.pos!=o<0&&(n=e))),new P(n,e)}}B.jsonID("text",P);class to{constructor(n,e){this.anchor=n,this.head=e}map(n){return new to(n.map(this.anchor),n.map(this.head))}resolve(n){return P.between(n.resolve(this.anchor),n.resolve(this.head))}}class O extends B{constructor(n){let e=n.nodeAfter,r=n.node(0).resolve(n.pos+e.nodeSize);super(n,r),this.node=e}map(n,e){let{deleted:r,pos:o}=e.mapResult(this.anchor),i=n.resolve(o);return r?B.near(i):new O(i)}content(){return new w(y.from(this.node),0,0)}eq(n){return n instanceof O&&n.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ni(this.anchor)}static fromJSON(n,e){if(typeof e.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new O(n.resolve(e.anchor))}static create(n,e){return new O(n.resolve(e))}static isSelectable(n){return!n.isText&&n.type.spec.selectable!==!1}}O.prototype.visible=!1;B.jsonID("node",O);class Ni{constructor(n){this.anchor=n}map(n){let{deleted:e,pos:r}=n.mapResult(this.anchor);return e?new to(r,r):new Ni(r)}resolve(n){let e=n.resolve(this.anchor),r=e.nodeAfter;return r&&O.isSelectable(r)?new O(e):B.near(e)}}class Sn extends B{constructor(n){super(n.resolve(0),n.resolve(n.content.size))}replace(n,e=w.empty){if(e==w.empty){n.delete(0,n.doc.content.size);let r=B.atStart(n.doc);r.eq(n.selection)||n.setSelection(r)}else super.replace(n,e)}toJSON(){return{type:"all"}}static fromJSON(n){return new Sn(n)}map(n){return new Sn(n)}eq(n){return n instanceof Sn}getBookmark(){return L0}}B.jsonID("all",Sn);const L0={map(){return this},resolve(t){return new Sn(t)}};function Pe(t,n,e,r,o,i=!1){if(n.inlineContent)return P.create(t,e);for(let a=r-(o>0?0:1);o>0?a<n.childCount:a>=0;a+=o){let s=n.child(a);if(s.isAtom){if(!i&&O.isSelectable(s))return O.create(t,e-(o<0?s.nodeSize:0))}else{let l=Pe(t,s,e+o,o<0?s.childCount:0,o,i);if(l)return l}e+=s.nodeSize*o}return null}function Wa(t,n,e){let r=t.steps.length-1;if(r<n)return;let o=t.steps[r];if(!(o instanceof J||o instanceof Z))return;let i=t.mapping.maps[r],a;i.forEach((s,l,c,d)=>{a==null&&(a=d)}),t.setSelection(B.near(t.doc.resolve(a),e))}const Ua=1,qa=2,Ka=4;class P0 extends ed{constructor(n){super(n.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=n.selection,this.storedMarks=n.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(n){if(n.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=n,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Ua)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ua)>0}setStoredMarks(n){return this.storedMarks=n,this.updated|=qa,this}ensureMarks(n){return j.sameSet(this.storedMarks||this.selection.$from.marks(),n)||this.setStoredMarks(n),this}addStoredMark(n){return this.ensureMarks(n.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(n){return this.ensureMarks(n.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&qa)>0}addStep(n,e){super.addStep(n,e),this.updated=this.updated&-3,this.storedMarks=null}setTime(n){return this.time=n,this}replaceSelection(n){return this.selection.replace(this,n),this}replaceSelectionWith(n,e=!0){let r=this.selection;return e&&(n=n.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||j.none))),r.replaceWith(this,n),this}deleteSelection(){return this.selection.replace(this),this}insertText(n,e,r){let o=this.doc.type.schema;if(e==null)return n?this.replaceSelectionWith(o.text(n),!0):this.deleteSelection();{if(r==null&&(r=e),!n)return this.deleteRange(e,r);let i=this.storedMarks;if(!i){let a=this.doc.resolve(e);i=r==e?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(e,r,o.text(n,i)),!this.selection.empty&&this.selection.to==e+n.length&&this.setSelection(B.near(this.selection.$to)),this}}setMeta(n,e){return this.meta[typeof n=="string"?n:n.key]=e,this}getMeta(n){return this.meta[typeof n=="string"?n:n.key]}get isGeneric(){for(let n in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ka,this}get scrolledIntoView(){return(this.updated&Ka)>0}}function Ja(t,n){return!n||!t?t:t.bind(n)}class st{constructor(n,e,r){this.name=n,this.init=Ja(e.init,r),this.apply=Ja(e.apply,r)}}const R0=[new st("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new st("selection",{init(t,n){return t.selection||B.atStart(n.doc)},apply(t){return t.selection}}),new st("storedMarks",{init(t){return t.storedMarks||null},apply(t,n,e,r){return r.selection.$cursor?t.storedMarks:null}}),new st("scrollToSelection",{init(){return 0},apply(t,n){return t.scrolledIntoView?n+1:n}})];class Co{constructor(n,e){this.schema=n,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=R0.slice(),e&&e.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 st(r.key,r.spec.state,r))})}}class Fe{constructor(n){this.config=n}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(n){return this.applyTransaction(n).state}filterTransaction(n,e=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=e){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,n,this))return!1}return!0}applyTransaction(n){if(!this.filterTransaction(n))return{state:this,transactions:[]};let e=[n],r=this.applyInner(n),o=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let s=this.config.plugins[a];if(s.spec.appendTransaction){let l=o?o[a].n:0,c=o?o[a].state:this,d=l<e.length&&s.spec.appendTransaction.call(s,l?e.slice(l):e,c,r);if(d&&r.filterTransaction(d,a)){if(d.setMeta("appendedTransaction",n),!o){o=[];for(let h=0;h<this.config.plugins.length;h++)o.push(h<a?{state:r,n:e.length}:{state:this,n:0})}e.push(d),r=r.applyInner(d),i=!0}o&&(o[a]={state:r,n:e.length})}}if(!i)return{state:r,transactions:e}}}applyInner(n){if(!n.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let e=new Fe(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];e[i.name]=i.apply(n,this[i.name],this,e)}return e}get tr(){return new P0(this)}static create(n){let e=new Co(n.doc?n.doc.type.schema:n.schema,n.plugins),r=new Fe(e);for(let o=0;o<e.fields.length;o++)r[e.fields[o].name]=e.fields[o].init(n,r);return r}reconfigure(n){let e=new Co(this.schema,n.plugins),r=e.fields,o=new Fe(e);for(let i=0;i<r.length;i++){let a=r[i].name;o[a]=this.hasOwnProperty(a)?this[a]:r[i].init(n,o)}return o}toJSON(n){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(r=>r.toJSON())),n&&typeof n=="object")for(let r in n){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=n[r],i=o.spec.state;i&&i.toJSON&&(e[r]=i.toJSON.call(o,this[o.key]))}return e}static fromJSON(n,e,r){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!n.schema)throw new RangeError("Required config field 'schema' missing");let o=new Co(n.schema,n.plugins),i=new Fe(o);return o.fields.forEach(a=>{if(a.name=="doc")i.doc=ee.fromJSON(n.schema,e.doc);else if(a.name=="selection")i.selection=B.fromJSON(i.doc,e.selection);else if(a.name=="storedMarks")e.storedMarks&&(i.storedMarks=e.storedMarks.map(n.schema.markFromJSON));else{if(r)for(let s in r){let l=r[s],c=l.spec.state;if(l.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(e,s)){i[a.name]=c.fromJSON.call(l,n,e[s],i);return}}i[a.name]=a.init(n,i)}}),i}}function td(t,n,e){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(n):r=="handleDOMEvents"&&(o=td(o,n,{})),e[r]=o}return e}class Q{constructor(n){this.spec=n,this.props={},n.props&&td(n.props,this,this.props),this.key=n.key?n.key.key:rd("plugin")}getState(n){return n[this.key]}}const So=Object.create(null);function rd(t){return t in So?t+"$"+ ++So[t]:(So[t]=0,t+"$")}class un{constructor(n="key"){this.key=rd(n)}get(n){return n.config.pluginsByKey[this.key]}getState(n){return n[this.key]}}const on=function(t){for(var n=0;;n++)if(t=t.previousSibling,!t)return n},Ke=function(t){let n=t.assignedSlot||t.parentNode;return n&&n.nodeType==11?n.host:n};let ai=null;const Fn=function(t,n,e){let r=ai||(ai=document.createRange());return r.setEnd(t,e??t.nodeValue.length),r.setStart(t,n||0),r},B0=function(){ai=null},Ie=function(t,n,e,r){return e&&(Ga(t,n,e,r,-1)||Ga(t,n,e,r,1))},N0=/^(img|br|input|textarea|hr)$/i;function Ga(t,n,e,r,o){for(var i;;){if(t==e&&n==r)return!0;if(n==(o<0?0:Cn(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Pt(t)||N0.test(t.nodeName)||t.contentEditable=="false")return!1;n=on(t)+(o<0?0:1),t=a}else if(t.nodeType==1){let a=t.childNodes[n+(o<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((i=a.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)n+=o;else return!1;else t=a,n=o<0?Cn(t):0}else return!1}}function Cn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function F0(t,n){for(;;){if(t.nodeType==3&&n)return t;if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=Cn(t)}else if(t.parentNode&&!Pt(t))n=on(t),t=t.parentNode;else return null}}function H0(t,n){for(;;){if(t.nodeType==3&&n<t.nodeValue.length)return t;if(t.nodeType==1&&n<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[n],n=0}else if(t.parentNode&&!Pt(t))n=on(t)+1,t=t.parentNode;else return null}}function j0(t,n,e){for(let r=n==0,o=n==Cn(t);r||o;){if(t==e)return!0;let i=on(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==Cn(t)}}function Pt(t){let n;for(let e=t;e&&!(n=e.pmViewDesc);e=e.parentNode);return n&&n.node&&n.node.isBlock&&(n.dom==t||n.contentDOM==t)}const ro=function(t){return t.focusNode&&Ie(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ge(t,n){let e=document.createEvent("Event");return e.initEvent("keydown",!0,!0),e.keyCode=t,e.key=e.code=n,e}function X0(t){let n=t.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function V0(t,n,e){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(n,e);if(r)return{node:r.offsetNode,offset:Math.min(Cn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(n,e);if(r)return{node:r.startContainer,offset:Math.min(Cn(r.startContainer),r.startOffset)}}}const On=typeof navigator<"u"?navigator:null,Ya=typeof document<"u"?document:null,ze=On&&On.userAgent||"",si=/Edge\/(\d+)/.exec(ze),od=/MSIE \d/.exec(ze),li=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ze),xn=!!(od||li||si),re=od?document.documentMode:li?+li[1]:si?+si[1]:0,Tn=!xn&&/gecko\/(\d+)/i.test(ze),ci=!xn&&/Chrome\/(\d+)/.exec(ze),sn=!!ci,id=ci?+ci[1]:0,dn=!xn&&!!On&&/Apple Computer/.test(On.vendor),Je=dn&&(/Mobile\/\w+/.test(ze)||!!On&&On.maxTouchPoints>2),_n=Je||(On?/Mac/.test(On.platform):!1),ad=On?/Win/.test(On.platform):!1,jn=/Android \d/.test(ze),Rt=!!Ya&&"webkitFontSmoothing"in Ya.documentElement.style,W0=Rt?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function U0(t){let n=t.defaultView&&t.defaultView.visualViewport;return n?{left:0,right:n.width,top:0,bottom:n.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Pn(t,n){return typeof t=="number"?t:t[n]}function q0(t){let n=t.getBoundingClientRect(),e=n.width/t.offsetWidth||1,r=n.height/t.offsetHeight||1;return{left:n.left,right:n.left+t.clientWidth*e,top:n.top,bottom:n.top+t.clientHeight*r}}function Qa(t,n,e){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let a=e||t.dom;a;){if(a.nodeType!=1){a=Ke(a);continue}let s=a,l=s==i.body,c=l?U0(i):q0(s),d=0,h=0;if(n.top<c.top+Pn(r,"top")?h=-(c.top-n.top+Pn(o,"top")):n.bottom>c.bottom-Pn(r,"bottom")&&(h=n.bottom-n.top>c.bottom-c.top?n.top+Pn(o,"top")-c.top:n.bottom-c.bottom+Pn(o,"bottom")),n.left<c.left+Pn(r,"left")?d=-(c.left-n.left+Pn(o,"left")):n.right>c.right-Pn(r,"right")&&(d=n.right-c.right+Pn(o,"right")),d||h)if(l)i.defaultView.scrollBy(d,h);else{let u=s.scrollLeft,f=s.scrollTop;h&&(s.scrollTop+=h),d&&(s.scrollLeft+=d);let m=s.scrollLeft-u,x=s.scrollTop-f;n={left:n.left-m,top:n.top-x,right:n.right-m,bottom:n.bottom-x}}let g=l?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(g))break;a=g=="absolute"?a.offsetParent:Ke(a)}}function K0(t){let n=t.dom.getBoundingClientRect(),e=Math.max(0,n.top),r,o;for(let i=(n.left+n.right)/2,a=e+1;a<Math.min(innerHeight,n.bottom);a+=5){let s=t.root.elementFromPoint(i,a);if(!s||s==t.dom||!t.dom.contains(s))continue;let l=s.getBoundingClientRect();if(l.top>=e-20){r=s,o=l.top;break}}return{refDOM:r,refTop:o,stack:sd(t.dom)}}function sd(t){let n=[],e=t.ownerDocument;for(let r=t;r&&(n.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=e);r=Ke(r));return n}function J0({refDOM:t,refTop:n,stack:e}){let r=t?t.getBoundingClientRect().top:0;ld(e,r==0?0:r-n)}function ld(t,n){for(let e=0;e<t.length;e++){let{dom:r,top:o,left:i}=t[e];r.scrollTop!=o+n&&(r.scrollTop=o+n),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Oe=null;function G0(t){if(t.setActive)return t.setActive();if(Oe)return t.focus(Oe);let n=sd(t);t.focus(Oe==null?{get preventScroll(){return Oe={preventScroll:!0},!0}}:void 0),Oe||(Oe=!1,ld(n,0))}function cd(t,n){let e,r=2e8,o,i=0,a=n.top,s=n.top,l,c;for(let d=t.firstChild,h=0;d;d=d.nextSibling,h++){let g;if(d.nodeType==1)g=d.getClientRects();else if(d.nodeType==3)g=Fn(d).getClientRects();else continue;for(let u=0;u<g.length;u++){let f=g[u];if(f.top<=a&&f.bottom>=s){a=Math.max(f.bottom,a),s=Math.min(f.top,s);let m=f.left>n.left?f.left-n.left:f.right<n.left?n.left-f.right:0;if(m<r){e=d,r=m,o=m&&e.nodeType==3?{left:f.right<n.left?f.right:f.left,top:n.top}:n,d.nodeType==1&&m&&(i=h+(n.left>=(f.left+f.right)/2?1:0));continue}}else f.top>n.top&&!l&&f.left<=n.left&&f.right>=n.left&&(l=d,c={left:Math.max(f.left,Math.min(f.right,n.left)),top:f.top});!e&&(n.left>=f.right&&n.top>=f.top||n.left>=f.left&&n.top>=f.bottom)&&(i=h+1)}}return!e&&l&&(e=l,o=c,r=0),e&&e.nodeType==3?Y0(e,o):!e||r&&e.nodeType==1?{node:t,offset:i}:cd(e,o)}function Y0(t,n){let e=t.nodeValue.length,r=document.createRange(),o;for(let i=0;i<e;i++){r.setEnd(t,i+1),r.setStart(t,i);let a=Wn(r,1);if(a.top!=a.bottom&&Fi(n,a)){o={node:t,offset:i+(n.left>=(a.left+a.right)/2?1:0)};break}}return r.detach(),o||{node:t,offset:0}}function Fi(t,n){return t.left>=n.left-1&&t.left<=n.right+1&&t.top>=n.top-1&&t.top<=n.bottom+1}function Q0(t,n){let e=t.parentNode;return e&&/^li$/i.test(e.nodeName)&&n.left<t.getBoundingClientRect().left?e:t}function Z0(t,n,e){let{node:r,offset:o}=cd(n,e),i=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();i=a.left!=a.right&&e.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function nx(t,n,e,r){let o=-1;for(let i=n,a=!1;i!=t.dom;){let s=t.docView.nearestDesc(i,!0),l;if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((l=s.dom.getBoundingClientRect()).width||l.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!a&&l.left>r.left||l.top>r.top?o=s.posBefore:(!a&&l.right<r.left||l.bottom<r.top)&&(o=s.posAfter),a=!0),!s.contentDOM&&o<0&&!s.node.isText))return(s.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?s.posBefore:s.posAfter;i=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(n,e,-1)}function dd(t,n,e){let r=t.childNodes.length;if(r&&e.top<e.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(n.top-e.top)/(e.bottom-e.top))-2)),i=o;;){let a=t.childNodes[i];if(a.nodeType==1){let s=a.getClientRects();for(let l=0;l<s.length;l++){let c=s[l];if(Fi(n,c))return dd(a,n,c)}}if((i=(i+1)%r)==o)break}return t}function ex(t,n){let e=t.dom.ownerDocument,r,o=0,i=V0(e,n.left,n.top);i&&({node:r,offset:o}=i);let a=(t.root.elementFromPoint?t.root:e).elementFromPoint(n.left,n.top),s;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let c=t.dom.getBoundingClientRect();if(!Fi(n,c)||(a=dd(t.dom,n,c),!a))return null}if(dn)for(let c=a;r&&c;c=Ke(c))c.draggable&&(r=void 0);if(a=Q0(a,n),r){if(Tn&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let d=r.childNodes[o],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=n.left&&h.bottom>n.top&&o++}let c;Rt&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=n.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&n.top>r.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(s=nx(t,r,o,n))}s==null&&(s=Z0(t,a,n));let l=t.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function Za(t){return t.top<t.bottom||t.left<t.right}function Wn(t,n){let e=t.getClientRects();if(e.length){let r=e[n<0?0:e.length-1];if(Za(r))return r}return Array.prototype.find.call(e,Za)||t.getBoundingClientRect()}const tx=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function pd(t,n,e){let{node:r,offset:o,atom:i}=t.docView.domFromPos(n,e<0?-1:1),a=Rt||Tn;if(r.nodeType==3)if(a&&(tx.test(r.nodeValue)||(e<0?!o:o==r.nodeValue.length))){let l=Wn(Fn(r,o,o),e);if(Tn&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Wn(Fn(r,o-1,o-1),-1);if(c.top==l.top){let d=Wn(Fn(r,o,o+1),-1);if(d.top!=l.top)return rt(d,d.left<c.left)}}return l}else{let l=o,c=o,d=e<0?1:-1;return e<0&&!o?(c++,d=-1):e>=0&&o==r.nodeValue.length?(l--,d=1):e<0?l--:c++,rt(Wn(Fn(r,l,c),d),d<0)}if(!t.state.doc.resolve(n-(i||0)).parent.inlineContent){if(i==null&&o&&(e<0||o==Cn(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return Eo(l.getBoundingClientRect(),!1)}if(i==null&&o<Cn(r)){let l=r.childNodes[o];if(l.nodeType==1)return Eo(l.getBoundingClientRect(),!0)}return Eo(r.getBoundingClientRect(),e>=0)}if(i==null&&o&&(e<0||o==Cn(r))){let l=r.childNodes[o-1],c=l.nodeType==3?Fn(l,Cn(l)-(a?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return rt(Wn(c,1),!1)}if(i==null&&o<Cn(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Fn(l,0,a?0:1):l.nodeType==1?l:null:null;if(c)return rt(Wn(c,-1),!0)}return rt(Wn(r.nodeType==3?Fn(r):r,-e),e>=0)}function rt(t,n){if(t.width==0)return t;let e=n?t.left:t.right;return{top:t.top,bottom:t.bottom,left:e,right:e}}function Eo(t,n){if(t.height==0)return t;let e=n?t.top:t.bottom;return{top:e,bottom:e,left:t.left,right:t.right}}function hd(t,n,e){let r=t.state,o=t.root.activeElement;r!=n&&t.updateState(n),o!=t.dom&&t.focus();try{return e()}finally{r!=n&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function rx(t,n,e){let r=n.selection,o=e=="up"?r.$from:r.$to;return hd(t,n,()=>{let{node:i}=t.docView.domFromPos(o.pos,e=="up"?-1:1);for(;;){let s=t.docView.nearestDesc(i,!0);if(!s)break;if(s.node.isBlock){i=s.contentDOM||s.dom;break}i=s.dom.parentNode}let a=pd(t,o.pos,1);for(let s=i.firstChild;s;s=s.nextSibling){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=Fn(s,0,s.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(e=="up"?a.top-d.top>(d.bottom-a.top)*2:d.bottom-a.bottom>(a.bottom-d.top)*2))return!1}}return!0})}const ox=/[\u0590-\u08ac]/;function ix(t,n,e){let{$head:r}=n.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=t.domSelection();return s?!ox.test(r.parent.textContent)||!s.modify?e=="left"||e=="backward"?i:a:hd(t,n,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:h}=t.domSelectionRange(),g=s.caretBidiLevel;s.modify("move",e,"character");let u=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:f,focusOffset:m}=t.domSelectionRange(),x=f&&!u.contains(f.nodeType==1?f:f.parentNode)||l==f&&c==m;try{s.collapse(d,h),l&&(l!=d||c!=h)&&s.extend&&s.extend(l,c)}catch{}return g!=null&&(s.caretBidiLevel=g),x}):r.pos==r.start()||r.pos==r.end()}let ns=null,es=null,ts=!1;function ax(t,n,e){return ns==n&&es==e?ts:(ns=n,es=e,ts=e=="up"||e=="down"?rx(t,n,e):ix(t,n,e))}const En=0,rs=1,fe=2,An=3;class Bt{constructor(n,e,r,o){this.parent=n,this.children=e,this.dom=r,this.contentDOM=o,this.dirty=En,r.pmViewDesc=this}matchesWidget(n){return!1}matchesMark(n){return!1}matchesNode(n,e,r){return!1}matchesHack(n){return!1}parseRule(){return null}stopEvent(n){return!1}get size(){let n=0;for(let e=0;e<this.children.length;e++)n+=this.children[e].size;return n}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let n=0;n<this.children.length;n++)this.children[n].destroy()}posBeforeChild(n){for(let e=0,r=this.posAtStart;;e++){let o=this.children[e];if(o==n)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(n,e,r){if(this.contentDOM&&this.contentDOM.contains(n.nodeType==1?n:n.parentNode))if(r<0){let i,a;if(n==this.contentDOM)i=n.childNodes[e-1];else{for(;n.parentNode!=this.contentDOM;)n=n.parentNode;i=n.previousSibling}for(;i&&!((a=i.pmViewDesc)&&a.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(a)+a.size:this.posAtStart}else{let i,a;if(n==this.contentDOM)i=n.childNodes[e];else{for(;n.parentNode!=this.contentDOM;)n=n.parentNode;i=n.nextSibling}for(;i&&!((a=i.pmViewDesc)&&a.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(a):this.posAtEnd}let o;if(n==this.dom&&this.contentDOM)o=e>on(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=n.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(e==0)for(let i=n;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&e==n.childNodes.length)for(let i=n;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(n,e=!1){for(let r=!0,o=n;o;o=o.parentNode){let i=this.getDesc(o),a;if(i&&(!e||i.node))if(r&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(n.nodeType==1?n:n.parentNode):a==n))r=!1;else return i}}getDesc(n){let e=n.pmViewDesc;for(let r=e;r;r=r.parent)if(r==this)return e}posFromDOM(n,e,r){for(let o=n;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(n,e,r)}return-1}descAt(n){for(let e=0,r=0;e<this.children.length;e++){let o=this.children[e],i=r+o.size;if(r==n&&i!=r){for(;!o.border&&o.children.length;)for(let a=0;a<o.children.length;a++){let s=o.children[a];if(s.size){o=s;break}}return o}if(n<i)return o.descAt(n-r-o.border);r=i}}domFromPos(n,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:n+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let a=this.children[r],s=i+a.size;if(s>n||a instanceof ud){o=n-i;break}i=s}if(o)return this.children[r].domFromPos(o-this.children[r].border,e);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof gd&&i.side>=0;r--);if(e<=0){let i,a=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,a=!1);return i&&e&&a&&!i.border&&!i.domAtom?i.domFromPos(i.size,e):{node:this.contentDOM,offset:i?on(i.dom)+1:0}}else{let i,a=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,a=!1);return i&&a&&!i.border&&!i.domAtom?i.domFromPos(0,e):{node:this.contentDOM,offset:i?on(i.dom):this.contentDOM.childNodes.length}}}parseRange(n,e,r=0){if(this.children.length==0)return{node:this.contentDOM,from:n,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let a=r,s=0;;s++){let l=this.children[s],c=a+l.size;if(o==-1&&n<=c){let d=a+l.border;if(n>=d&&e<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(n,e,d);n=a;for(let h=s;h>0;h--){let g=this.children[h-1];if(g.size&&g.dom.parentNode==this.contentDOM&&!g.emptyChildAt(1)){o=on(g.dom)+1;break}n-=g.size}o==-1&&(o=0)}if(o>-1&&(c>e||s==this.children.length-1)){e=c;for(let d=s+1;d<this.children.length;d++){let h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){i=on(h.dom);break}e+=h.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:n,to:e,fromOffset:o,toOffset:i}}emptyChildAt(n){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[n<0?0:this.children.length-1];return e.size==0||e.emptyChildAt(n)}domAfterPos(n){let{node:e,offset:r}=this.domFromPos(n,0);if(e.nodeType!=1||r==e.childNodes.length)throw new RangeError("No node after pos "+n);return e.childNodes[r]}setSelection(n,e,r,o=!1){let i=Math.min(n,e),a=Math.max(n,e);for(let u=0,f=0;u<this.children.length;u++){let m=this.children[u],x=f+m.size;if(i>f&&a<x)return m.setSelection(n-f-m.border,e-f-m.border,r,o);f=x}let s=this.domFromPos(n,n?-1:1),l=e==n?s:this.domFromPos(e,e?-1:1),c=r.root.getSelection(),d=r.domSelectionRange(),h=!1;if((Tn||dn)&&n==e){let{node:u,offset:f}=s;if(u.nodeType==3){if(h=!!(f&&u.nodeValue[f-1]==`
|
|
20992
|
-
`),h&&f==u.nodeValue.length)for(let m=u,x;m;m=m.parentNode){if(x=m.nextSibling){x.nodeName=="BR"&&(s=l={node:x.parentNode,offset:on(x)+1});break}let b=m.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let m=u.childNodes[f-1];h=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(Tn&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let u=d.focusNode.childNodes[d.focusOffset];u&&u.contentEditable=="false"&&(o=!0)}if(!(o||h&&dn)&&Ie(s.node,s.offset,d.anchorNode,d.anchorOffset)&&Ie(l.node,l.offset,d.focusNode,d.focusOffset))return;let g=!1;if((c.extend||n==e)&&!(h&&Tn)){c.collapse(s.node,s.offset);try{n!=e&&c.extend(l.node,l.offset),g=!0}catch{}}if(!g){if(n>e){let f=s;s=l,l=f}let u=document.createRange();u.setEnd(l.node,l.offset),u.setStart(s.node,s.offset),c.removeAllRanges(),c.addRange(u)}}ignoreMutation(n){return!this.contentDOM&&n.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(n,e){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],a=r+i.size;if(r==a?n<=a&&e>=r:n<a&&e>r){let s=r+i.border,l=a-i.border;if(n>=s&&e<=l){this.dirty=n==r||e==a?fe:rs,n==s&&e==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=An:i.markDirty(n-s,e-s);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?fe:An}r=a}this.dirty=fe}markParentsDirty(){let n=1;for(let e=this.parent;e;e=e.parent,n++){let r=n==1?fe:rs;e.dirty<r&&(e.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(n){return!1}}class gd extends Bt{constructor(n,e,r,o){let i,a=e.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!e.type.spec.raw){if(a.nodeType!=1){let s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(n,[],a,null),this.widget=e,this.widget=e,i=this}matchesWidget(n){return this.dirty==En&&n.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(n){let e=this.widget.spec.stopEvent;return e?e(n):!1}ignoreMutation(n){return n.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class sx extends Bt{constructor(n,e,r,o){super(n,[],e,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(n,e){return n!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(n){return{node:this.textDOM,offset:n}}ignoreMutation(n){return n.type==="characterData"&&n.target.nodeValue==n.oldValue}}class Te extends Bt{constructor(n,e,r,o,i){super(n,[],r,o),this.mark=e,this.spec=i}static create(n,e,r,o){let i=o.nodeViews[e.type.name],a=i&&i(e,o,r);return(!a||!a.dom)&&(a=Me.renderSpec(document,e.type.spec.toDOM(e,r),null,e.attrs)),new Te(n,e,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&An||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(n){return this.dirty!=An&&this.mark.eq(n)}markDirty(n,e){if(super.markDirty(n,e),this.dirty!=En){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=En}}slice(n,e,r){let o=Te.create(this.parent,this.mark,!0,r),i=this.children,a=this.size;e<a&&(i=pi(i,e,a,r)),n>0&&(i=pi(i,0,n,r));for(let s=0;s<i.length;s++)i[s].parent=o;return o.children=i,o}ignoreMutation(n){return this.spec.ignoreMutation?this.spec.ignoreMutation(n):super.ignoreMutation(n)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class oe extends Bt{constructor(n,e,r,o,i,a,s,l,c){super(n,[],i,a),this.node=e,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=s}static create(n,e,r,o,i,a){let s=i.nodeViews[e.type.name],l,c=s&&s(e,i,()=>{if(!l)return a;if(l.parent)return l.parent.posBeforeChild(l)},r,o),d=c&&c.dom,h=c&&c.contentDOM;if(e.isText){if(!d)d=document.createTextNode(e.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:h}=Me.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs));!h&&!e.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),e.type.spec.draggable&&(d.draggable=!0));let g=d;return d=xd(d,r,e),c?l=new lx(n,e,r,o,d,h||null,g,c,i,a+1):e.isText?new oo(n,e,r,o,d,g,i):new oe(n,e,r,o,d,h||null,g,i,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let r=this.children[e];if(this.dom.contains(r.dom.parentNode)){n.contentElement=r.dom.parentNode;break}}n.contentElement||(n.getContent=()=>y.empty)}return n}matchesNode(n,e,r){return this.dirty==En&&n.eq(this.node)&&ur(e,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(n,e){let r=this.node.inlineContent,o=e,i=n.composing?this.localCompositionInfo(n,e):null,a=i&&i.pos>-1?i:null,s=i&&i.pos<0,l=new dx(this,a&&a.node,n);gx(this.node,this.innerDeco,(c,d,h)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,n,d):c.type.side>=0&&!h&&l.syncToMarks(d==this.node.childCount?j.none:this.node.child(d).marks,r,n,d),l.placeWidget(c,n,o)},(c,d,h,g)=>{l.syncToMarks(c.marks,r,n,g);let u;l.findNodeMatch(c,d,h,g)||s&&n.state.selection.from>o&&n.state.selection.to<o+c.nodeSize&&(u=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,d,h,u,n)||l.updateNextNode(c,d,h,n,g,o)||l.addNode(c,d,h,n,o),o+=c.nodeSize}),l.syncToMarks([],r,n,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==fe)&&(a&&this.protectLocalComposition(n,a),fd(this.contentDOM,this.children,n),Je&&ux(this.dom))}localCompositionInfo(n,e){let{from:r,to:o}=n.state.selection;if(!(n.state.selection instanceof P)||r<e||o>e+this.node.content.size)return null;let i=n.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let a=i.nodeValue,s=fx(this.node.content,a,r-e,o-e);return s<0?null:{node:i,pos:s,text:a}}else return{node:i,pos:-1,text:""}}protectLocalComposition(n,{node:e,pos:r,text:o}){if(this.getDesc(e))return;let i=e;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new sx(this,i,e,o);n.input.compositionNodes.push(a),this.children=pi(this.children,r,r+o.length,n,a)}update(n,e,r,o){return this.dirty==An||!n.sameMarkup(this.node)?!1:(this.updateInner(n,e,r,o),!0)}updateInner(n,e,r,o){this.updateOuterDeco(e),this.node=n,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=En}updateOuterDeco(n){if(ur(n,this.outerDeco))return;let e=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=md(this.dom,this.nodeDOM,di(this.outerDeco,this.node,e),di(n,this.node,e)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=n}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function is(t,n,e,r,o){xd(r,n,t);let i=new oe(void 0,t,n,e,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class oo extends oe{constructor(n,e,r,o,i,a,s){super(n,e,r,o,i,null,a,s,0)}parseRule(){let n=this.nodeDOM.parentNode;for(;n&&n!=this.dom&&!n.pmIsDeco;)n=n.parentNode;return{skip:n||!0}}update(n,e,r,o){return this.dirty==An||this.dirty!=En&&!this.inParent()||!n.sameMarkup(this.node)?!1:(this.updateOuterDeco(e),(this.dirty!=En||n.text!=this.node.text)&&n.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=n.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=n,this.dirty=En,!0)}inParent(){let n=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==n)return!0;return!1}domFromPos(n){return{node:this.nodeDOM,offset:n}}localPosFromDOM(n,e,r){return n==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(n,e,r)}ignoreMutation(n){return n.type!="characterData"&&n.type!="selection"}slice(n,e,r){let o=this.node.cut(n,e),i=document.createTextNode(o.text);return new oo(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(n,e){super.markDirty(n,e),this.dom!=this.nodeDOM&&(n==0||e==this.nodeDOM.nodeValue.length)&&(this.dirty=An)}get domAtom(){return!1}isText(n){return this.node.text==n}}class ud extends Bt{parseRule(){return{ignore:!0}}matchesHack(n){return this.dirty==En&&this.dom.nodeName==n}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class lx extends oe{constructor(n,e,r,o,i,a,s,l,c,d){super(n,e,r,o,i,a,s,c,d),this.spec=l}update(n,e,r,o){if(this.dirty==An)return!1;if(this.spec.update&&(this.node.type==n.type||this.spec.multiType)){let i=this.spec.update(n,e,r);return i&&this.updateInner(n,e,r,o),i}else return!this.contentDOM&&!n.isLeaf?!1:super.update(n,e,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(n,e,r,o){this.spec.setSelection?this.spec.setSelection(n,e,r.root):super.setSelection(n,e,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(n){return this.spec.stopEvent?this.spec.stopEvent(n):!1}ignoreMutation(n){return this.spec.ignoreMutation?this.spec.ignoreMutation(n):super.ignoreMutation(n)}}function fd(t,n,e){let r=t.firstChild,o=!1;for(let i=0;i<n.length;i++){let a=n[i],s=a.dom;if(s.parentNode==t){for(;s!=r;)r=as(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(s,r);if(a instanceof Te){let l=r?r.previousSibling:t.lastChild;fd(a.contentDOM,a.children,e),r=l?l.nextSibling:t.firstChild}}for(;r;)r=as(r),o=!0;o&&e.trackWrites==t&&(e.trackWrites=null)}const dt=function(t){t&&(this.nodeName=t)};dt.prototype=Object.create(null);const me=[new dt];function di(t,n,e){if(t.length==0)return me;let r=e?me[0]:new dt,o=[r];for(let i=0;i<t.length;i++){let a=t[i].type.attrs;if(a){a.nodeName&&o.push(r=new dt(a.nodeName));for(let s in a){let l=a[s];l!=null&&(e&&o.length==1&&o.push(r=new dt(n.isInline?"span":"div")),s=="class"?r.class=(r.class?r.class+" ":"")+l:s=="style"?r.style=(r.style?r.style+";":"")+l:s!="nodeName"&&(r[s]=l))}}}return o}function md(t,n,e,r){if(e==me&&r==me)return n;let o=n;for(let i=0;i<r.length;i++){let a=r[i],s=e[i];if(i){let l;s&&s.nodeName==a.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==a.nodeName||(l=document.createElement(a.nodeName),l.pmIsDeco=!0,l.appendChild(o),s=me[0]),o=l}cx(o,s||me[0],a)}return o}function cx(t,n,e){for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&!(r in e)&&t.removeAttribute(r);for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&e[r]!=n[r]&&t.setAttribute(r,e[r]);if(n.class!=e.class){let r=n.class?n.class.split(" ").filter(Boolean):[],o=e.class?e.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(n.style!=e.style){if(n.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(n.style);)t.style.removeProperty(o[1])}e.style&&(t.style.cssText+=e.style)}}function xd(t,n,e){return md(t,t,me,di(n,e,t.nodeType!=1))}function ur(t,n){if(t.length!=n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].type.eq(n[e].type))return!1;return!0}function as(t){let n=t.nextSibling;return t.parentNode.removeChild(t),n}class dx{constructor(n,e,r){this.lock=e,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=n,this.preMatch=px(n.node.content,n)}destroyBetween(n,e){if(n!=e){for(let r=n;r<e;r++)this.top.children[r].destroy();this.top.children.splice(n,e-n),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(n,e,r,o){let i=0,a=this.stack.length>>1,s=Math.min(a,n.length);for(;i<s&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(n[i])&&n[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=En,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<n.length;){this.stack.push(this.top,this.index+1);let l=-1,c=this.top.children.length;o<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let d=this.index;d<c;d++){let h=this.top.children[d];if(h.matchesMark(n[a])&&!this.isLocked(h.dom)){l=d;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let d=Te.create(this.top,n[a],e,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,a++}}findNodeMatch(n,e,r,o){let i=-1,a;if(o>=this.preMatch.index&&(a=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&a.matchesNode(n,e,r))i=this.top.children.indexOf(a,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s<l;s++){let c=this.top.children[s];if(c.matchesNode(n,e,r)&&!this.preMatch.matched.has(c)){i=s;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(n,e,r,o,i){let a=this.top.children[o];return a.dirty==An&&a.dom==a.contentDOM&&(a.dirty=fe),a.update(n,e,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(n){for(;;){let e=n.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let r=n.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}n=e}}updateNextNode(n,e,r,o,i,a){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof oe){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let d=l.dom,h,g=this.isLocked(d)&&!(n.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==n.text&&l.dirty!=An&&ur(e,l.outerDeco));if(!g&&l.update(n,e,r,o))return this.destroyBetween(this.index,s),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!g&&(h=this.recreateWrapper(l,n,e,r,o,a)))return this.destroyBetween(this.index,s),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=fe,h.updateChildren(o,a+1),h.dirty=En),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(n,e,r,o,i,a){if(n.dirty||e.isAtom||!n.children.length||!n.node.content.eq(e.content)||!ur(r,n.outerDeco)||!o.eq(n.innerDeco))return null;let s=oe.create(this.top,e,r,o,i,a);if(s.contentDOM){s.children=n.children,n.children=[];for(let l of s.children)l.parent=s}return n.destroy(),s}addNode(n,e,r,o,i){let a=oe.create(this.top,n,e,r,o,i);a.contentDOM&&a.updateChildren(o,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(n,e,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(n)&&(n==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new gd(this.top,n,e,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let n=this.top.children[this.index-1],e=this.top;for(;n instanceof Te;)e=n,n=e.children[e.children.length-1];(!n||!(n instanceof oo)||/\n$/.test(n.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(n.node.text))&&((dn||sn)&&n&&n.dom.contentEditable=="false"&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(n,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(n))this.index++;else{let r=document.createElement(n);n=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),n=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new ud(this.top,[],r,null);e!=this.top?e.children.push(o):e.children.splice(this.index++,0,o),this.changed=!0}}isLocked(n){return this.lock&&(n==this.lock||n.nodeType==1&&n.contains(this.lock.parentNode))}}function px(t,n){let e=n,r=e.children.length,o=t.childCount,i=new Map,a=[];n:for(;o>0;){let s;for(;;)if(r){let c=e.children[r-1];if(c instanceof Te)e=c,r=c.children.length;else{s=c,r--;break}}else{if(e==n)break n;r=e.parent.children.indexOf(e),e=e.parent}let l=s.node;if(l){if(l!=t.child(o-1))break;--o,i.set(s,o),a.push(s)}}return{index:o,matched:i,matches:a.reverse()}}function hx(t,n){return t.type.side-n.type.side}function gx(t,n,e,r){let o=n.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);r(d,o,n.forChild(i,d),c),i+=d.nodeSize}return}let a=0,s=[],l=null;for(let c=0;;){let d,h;for(;a<o.length&&o[a].to==i;){let x=o[a++];x.widget&&(d?(h||(h=[d])).push(x):d=x)}if(d)if(h){h.sort(hx);for(let x=0;x<h.length;x++)e(h[x],c,!!l)}else e(d,c,!!l);let g,u;if(l)u=-1,g=l,l=null;else if(c<t.childCount)u=c,g=t.child(c++);else break;for(let x=0;x<s.length;x++)s[x].to<=i&&s.splice(x--,1);for(;a<o.length&&o[a].from<=i&&o[a].to>i;)s.push(o[a++]);let f=i+g.nodeSize;if(g.isText){let x=f;a<o.length&&o[a].from<x&&(x=o[a].from);for(let b=0;b<s.length;b++)s[b].to<x&&(x=s[b].to);x<f&&(l=g.cut(x-i),g=g.cut(0,x-i),f=x,u=-1)}else for(;a<o.length&&o[a].to<f;)a++;let m=g.isInline&&!g.isLeaf?s.filter(x=>!x.inline):s.slice();r(g,m,n.forChild(i,g),u),i=f}}function ux(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let n=t.style.cssText;t.style.cssText=n+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=n}}function fx(t,n,e,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let a=t.child(o++),s=i;if(i+=a.nodeSize,!a.isText)continue;let l=a.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=e){if(i>=r&&l.slice(r-n.length-s,r-s)==n)return r-n.length;let c=s<r?l.lastIndexOf(n,r-s-1):-1;if(c>=0&&c+n.length+s>=e)return s+c;if(e==r&&l.length>=r+n.length-s&&l.slice(r-s,r-s+n.length)==n)return r}}return-1}function pi(t,n,e,r,o){let i=[];for(let a=0,s=0;a<t.length;a++){let l=t[a],c=s,d=s+=l.size;c>=e||d<=n?i.push(l):(c<n&&i.push(l.slice(0,n-c,r)),o&&(i.push(o),o=void 0),d>e&&i.push(l.slice(e-c,l.size,r)))}return i}function Hi(t,n=null){let e=t.domSelectionRange(),r=t.state.doc;if(!e.focusNode)return null;let o=t.docView.nearestDesc(e.focusNode),i=o&&o.size==0,a=t.docView.posFromDOM(e.focusNode,e.focusOffset,1);if(a<0)return null;let s=r.resolve(a),l,c;if(ro(e)){for(l=a;o&&!o.node;)o=o.parent;let h=o.node;if(o&&h.isAtom&&O.isSelectable(h)&&o.parent&&!(h.isInline&&j0(e.focusNode,e.focusOffset,o.dom))){let g=o.posBefore;c=new O(a==g?s:r.resolve(g))}}else{if(e instanceof t.dom.ownerDocument.defaultView.Selection&&e.rangeCount>1){let h=a,g=a;for(let u=0;u<e.rangeCount;u++){let f=e.getRangeAt(u);h=Math.min(h,t.docView.posFromDOM(f.startContainer,f.startOffset,1)),g=Math.max(g,t.docView.posFromDOM(f.endContainer,f.endOffset,-1))}if(h<0)return null;[l,a]=g==t.state.selection.anchor?[g,h]:[h,g],s=r.resolve(a)}else l=t.docView.posFromDOM(e.anchorNode,e.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!c){let h=n=="pointer"||t.state.selection.head<s.pos&&!i?1:-1;c=ji(t,d,s,h)}return c}function bd(t){return t.editable?t.hasFocus():vd(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Xn(t,n=!1){let e=t.state.selection;if(yd(t,e),!!bd(t)){if(!n&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&sn){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Ie(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)xx(t);else{let{anchor:r,head:o}=e,i,a;ss&&!(e instanceof P)&&(e.$from.parent.inlineContent||(i=ls(t,e.from)),!e.empty&&!e.$from.parent.inlineContent&&(a=ls(t,e.to))),t.docView.setSelection(r,o,t,n),ss&&(i&&cs(i),a&&cs(a)),e.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&mx(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const ss=dn||sn&&id<63;function ls(t,n){let{node:e,offset:r}=t.docView.domFromPos(n,0),o=r<e.childNodes.length?e.childNodes[r]:null,i=r?e.childNodes[r-1]:null;if(dn&&o&&o.contentEditable=="false")return Io(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Io(o);if(i)return Io(i)}}function Io(t){return t.contentEditable="true",dn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function cs(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function mx(t){let n=t.dom.ownerDocument;n.removeEventListener("selectionchange",t.input.hideSelectionGuard);let e=t.domSelectionRange(),r=e.anchorNode,o=e.anchorOffset;n.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(e.anchorNode!=r||e.anchorOffset!=o)&&(n.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!bd(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function xx(t){let n=t.domSelection();if(!n)return;let e=t.cursorWrapper.dom,r=e.nodeName=="IMG";r?n.collapse(e.parentNode,on(e)+1):n.collapse(e,0),!r&&!t.state.selection.visible&&xn&&re<=11&&(e.disabled=!0,e.disabled=!1)}function yd(t,n){if(n instanceof O){let e=t.docView.descAt(n.from);e!=t.lastSelectedViewDesc&&(ds(t),e&&e.selectNode(),t.lastSelectedViewDesc=e)}else ds(t)}function ds(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function ji(t,n,e,r){return t.someProp("createSelectionBetween",o=>o(t,n,e))||P.between(n,e,r)}function ps(t){return t.editable&&!t.hasFocus()?!1:vd(t)}function vd(t){let n=t.domSelectionRange();if(!n.anchorNode)return!1;try{return t.dom.contains(n.anchorNode.nodeType==3?n.anchorNode.parentNode:n.anchorNode)&&(t.editable||t.dom.contains(n.focusNode.nodeType==3?n.focusNode.parentNode:n.focusNode))}catch{return!1}}function bx(t){let n=t.docView.domFromPos(t.state.selection.anchor,0),e=t.domSelectionRange();return Ie(n.node,n.offset,e.anchorNode,e.anchorOffset)}function hi(t,n){let{$anchor:e,$head:r}=t.selection,o=n>0?e.max(r):e.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(n>0?o.after():o.before()):null:o;return i&&B.findFrom(i,n)}function Un(t,n){return t.dispatch(t.state.tr.setSelection(n).scrollIntoView()),!0}function hs(t,n,e){let r=t.state.selection;if(r instanceof P)if(e.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:n<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=t.state.doc.resolve(o.pos+i.nodeSize*(n<0?-1:1));return Un(t,new P(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(n>0?"forward":"backward")){let o=hi(t.state,n);return o&&o instanceof O?Un(t,o):!1}else if(!(_n&&e.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:n<0?o.nodeBefore:o.nodeAfter,a;if(!i||i.isText)return!1;let s=n<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(a=t.docView.descAt(s))&&!a.contentDOM?O.isSelectable(i)?Un(t,new O(n<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):Rt?Un(t,new P(t.state.doc.resolve(n<0?s:s+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof O&&r.node.isInline)return Un(t,new P(n>0?r.$to:r.$from));{let o=hi(t.state,n);return o?Un(t,o):!1}}}function fr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function pt(t,n){let e=t.pmViewDesc;return e&&e.size==0&&(n<0||t.nextSibling||t.nodeName!="BR")}function Ae(t,n){return n<0?yx(t):vx(t)}function yx(t){let n=t.domSelectionRange(),e=n.focusNode,r=n.focusOffset;if(!e)return;let o,i,a=!1;for(Tn&&e.nodeType==1&&r<fr(e)&&pt(e.childNodes[r],-1)&&(a=!0);;)if(r>0){if(e.nodeType!=1)break;{let s=e.childNodes[r-1];if(pt(s,-1))o=e,i=--r;else if(s.nodeType==3)e=s,r=e.nodeValue.length;else break}}else{if(kd(e))break;{let s=e.previousSibling;for(;s&&pt(s,-1);)o=e.parentNode,i=on(s),s=s.previousSibling;if(s)e=s,r=fr(e);else{if(e=e.parentNode,e==t.dom)break;r=0}}}a?gi(t,e,r):o&&gi(t,o,i)}function vx(t){let n=t.domSelectionRange(),e=n.focusNode,r=n.focusOffset;if(!e)return;let o=fr(e),i,a;for(;;)if(r<o){if(e.nodeType!=1)break;let s=e.childNodes[r];if(pt(s,1))i=e,a=++r;else break}else{if(kd(e))break;{let s=e.nextSibling;for(;s&&pt(s,1);)i=s.parentNode,a=on(s)+1,s=s.nextSibling;if(s)e=s,r=0,o=fr(e);else{if(e=e.parentNode,e==t.dom)break;r=o=0}}}i&&gi(t,i,a)}function kd(t){let n=t.pmViewDesc;return n&&n.node&&n.node.isBlock}function kx(t,n){for(;t&&n==t.childNodes.length&&!Pt(t);)n=on(t)+1,t=t.parentNode;for(;t&&n<t.childNodes.length;){let e=t.childNodes[n];if(e.nodeType==3)return e;if(e.nodeType==1&&e.contentEditable=="false")break;t=e,n=0}}function wx(t,n){for(;t&&!n&&!Pt(t);)n=on(t),t=t.parentNode;for(;t&&n;){let e=t.childNodes[n-1];if(e.nodeType==3)return e;if(e.nodeType==1&&e.contentEditable=="false")break;t=e,n=t.childNodes.length}}function gi(t,n,e){if(n.nodeType!=3){let i,a;(a=kx(n,e))?(n=a,e=0):(i=wx(n,e))&&(n=i,e=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(ro(r)){let i=document.createRange();i.setEnd(n,e),i.setStart(n,e),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(n,e);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Xn(t)},50)}function gs(t,n){let e=t.state.doc.resolve(n);if(!(sn||ad)&&e.parent.inlineContent){let o=t.coordsAtPos(n);if(n>e.start()){let i=t.coordsAtPos(n-1),a=(i.top+i.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(n<e.end()){let i=t.coordsAtPos(n+1),a=(i.top+i.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function us(t,n,e){let r=t.state.selection;if(r instanceof P&&!r.empty||e.indexOf("s")>-1||_n&&e.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(n<0?"up":"down")){let a=hi(t.state,n);if(a&&a instanceof O)return Un(t,a)}if(!o.parent.inlineContent){let a=n<0?o:i,s=r instanceof Sn?B.near(a,n):B.findFrom(a,n);return s?Un(t,s):!1}return!1}function fs(t,n){if(!(t.state.selection instanceof P))return!0;let{$head:e,$anchor:r,empty:o}=t.state.selection;if(!e.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(n>0?"forward":"backward"))return!0;let i=!e.textOffset&&(n<0?e.nodeBefore:e.nodeAfter);if(i&&!i.isText){let a=t.state.tr;return n<0?a.delete(e.pos-i.nodeSize,e.pos):a.delete(e.pos,e.pos+i.nodeSize),t.dispatch(a),!0}return!1}function ms(t,n,e){t.domObserver.stop(),n.contentEditable=e,t.domObserver.start()}function _x(t){if(!dn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:n,focusOffset:e}=t.domSelectionRange();if(n&&n.nodeType==1&&e==0&&n.firstChild&&n.firstChild.contentEditable=="false"){let r=n.firstChild;ms(t,r,"true"),setTimeout(()=>ms(t,r,"false"),20)}return!1}function Cx(t){let n="";return t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n}function Sx(t,n){let e=n.keyCode,r=Cx(n);if(e==8||_n&&e==72&&r=="c")return fs(t,-1)||Ae(t,-1);if(e==46&&!n.shiftKey||_n&&e==68&&r=="c")return fs(t,1)||Ae(t,1);if(e==13||e==27)return!0;if(e==37||_n&&e==66&&r=="c"){let o=e==37?gs(t,t.state.selection.from)=="ltr"?-1:1:-1;return hs(t,o,r)||Ae(t,o)}else if(e==39||_n&&e==70&&r=="c"){let o=e==39?gs(t,t.state.selection.from)=="ltr"?1:-1:1;return hs(t,o,r)||Ae(t,o)}else{if(e==38||_n&&e==80&&r=="c")return us(t,-1,r)||Ae(t,-1);if(e==40||_n&&e==78&&r=="c")return _x(t)||us(t,1,r)||Ae(t,1);if(r==(_n?"m":"c")&&(e==66||e==73||e==89||e==90))return!0}return!1}function Xi(t,n){t.someProp("transformCopied",u=>{n=u(n,t)});let e=[],{content:r,openStart:o,openEnd:i}=n;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let u=r.firstChild;e.push(u.type.name,u.attrs!=u.type.defaultAttrs?u.attrs:null),r=u.content}let a=t.someProp("clipboardSerializer")||Me.fromSchema(t.state.schema),s=Id(),l=s.createElement("div");l.appendChild(a.serializeFragment(r,{document:s}));let c=l.firstChild,d,h=0;for(;c&&c.nodeType==1&&(d=Ed[c.nodeName.toLowerCase()]);){for(let u=d.length-1;u>=0;u--){let f=s.createElement(d[u]);for(;l.firstChild;)f.appendChild(l.firstChild);l.appendChild(f),h++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${h?` -${h}`:""} ${JSON.stringify(e)}`);let g=t.someProp("clipboardTextSerializer",u=>u(n,t))||n.content.textBetween(0,n.content.size,`
|
|
20993
|
-
|
|
20994
|
-
`);return{dom:l,text:g,slice:n}}function
|
|
20995
|
-
`))),0,0),t.someProp("transformPasted",g=>{s=g(s,t,!0)}),s;let h=t.someProp("clipboardTextParser",g=>g(n,o,r,t));if(h)s=h;else{let g=o.marks(),{schema:u}=t.state,f=Me.fromSchema(u);a=document.createElement("div"),n.split(/(?:\r\n?|\n)+/).forEach(m=>{let x=a.appendChild(document.createElement("p"));m&&x.appendChild(f.serializeNode(u.text(m,g)))})}}else t.someProp("transformPastedHTML",h=>{e=h(e,t)}),a=$x(e),Rt&&Mx(a);let c=a&&a.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let h=+d[3];h>0;h--){let g=a.firstChild;for(;g&&g.nodeType!=1;)g=g.nextSibling;if(!g)break;a=g}if(s||(s=(t.someProp("clipboardParser")||t.someProp("domParser")||te.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(l||d),context:o,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!Ex.test(g.parentNode.nodeName)?{ignore:!0}:null}})),d)s=zx(xs(s,+d[1],+d[2]),d[4]);else if(s=w.maxOpen(Ix(s.content,o),!0),s.openStart||s.openEnd){let h=0,g=0;for(let u=s.content.firstChild;h<s.openStart&&!u.type.spec.isolating;h++,u=u.firstChild);for(let u=s.content.lastChild;g<s.openEnd&&!u.type.spec.isolating;g++,u=u.lastChild);s=xs(s,h,g)}return t.someProp("transformPasted",h=>{s=h(s,t,l)}),s}const Ex=/^(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 Ix(t,n){if(t.childCount<2)return t;for(let e=n.depth;e>=0;e--){let o=n.node(e).contentMatchAt(n.index(e)),i,a=[];if(t.forEach(s=>{if(!a)return;let l=o.findWrapping(s.type),c;if(!l)return a=null;if(c=a.length&&i.length&&Cd(l,i,s,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=Sd(a[a.length-1],i.length));let d=_d(s,l);a.push(d),o=o.matchType(d.type),i=l}}),a)return y.from(a)}return t}function _d(t,n,e=0){for(let r=n.length-1;r>=e;r--)t=n[r].create(null,y.from(t));return t}function Cd(t,n,e,r,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let i=Cd(t,n,e,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?e.type:t[o+1]))return r.copy(r.content.append(y.from(_d(e,t,o+1))))}}function Sd(t,n){if(n==0)return t;let e=t.content.replaceChild(t.childCount-1,Sd(t.lastChild,n-1)),r=t.contentMatchAt(t.childCount).fillBefore(y.empty,!0);return t.copy(e.append(r))}function ui(t,n,e,r,o,i){let a=n<0?t.firstChild:t.lastChild,s=a.content;return t.childCount>1&&(i=0),o<r-1&&(s=ui(s,n,e,r,o+1,i)),o>=e&&(s=n<0?a.contentMatchAt(0).fillBefore(s,i<=o).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(y.empty,!0))),t.replaceChild(n<0?0:t.childCount-1,a.copy(s))}function xs(t,n,e){return n<t.openStart&&(t=new w(ui(t.content,-1,n,t.openStart,0,t.openEnd),n,t.openEnd)),e<t.openEnd&&(t=new w(ui(t.content,1,e,t.openEnd,0,0),t.openStart,e)),t}const Ed={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 bs=null;function Id(){return bs||(bs=document.implementation.createHTMLDocument("title"))}let To=null;function Tx(t){let n=window.trustedTypes;return n?(To||(To=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),To.createHTML(t)):t}function $x(t){let n=/^(\s*<meta [^>]*>)*/.exec(t);n&&(t=t.slice(n[0].length));let e=Id().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&Ed[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),e.innerHTML=Tx(t),o)for(let i=0;i<o.length;i++)e=e.querySelector(o[i])||e;return e}function Mx(t){let n=t.querySelectorAll(sn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let e=0;e<n.length;e++){let r=n[e];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function zx(t,n){if(!t.size)return t;let e=t.content.firstChild.type.schema,r;try{r=JSON.parse(n)}catch{return t}let{content:o,openStart:i,openEnd:a}=t;for(let s=r.length-2;s>=0;s-=2){let l=e.nodes[r[s]];if(!l||l.hasRequiredAttrs())break;o=y.from(l.create(r[s+1],o)),i++,a++}return new w(o,i,a)}const hn={},gn={},Dx={touchstart:!0,touchmove:!0};class Ox{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Ax(t){for(let n in hn){let e=hn[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>{Px(t,r)&&!Vi(t,r)&&(t.editable||!(r.type in gn))&&e(t,r)},Dx[n]?{passive:!0}:void 0)}dn&&t.dom.addEventListener("input",()=>null),fi(t)}function Zn(t,n){t.input.lastSelectionOrigin=n,t.input.lastSelectionTime=Date.now()}function Lx(t){t.domObserver.stop();for(let n in t.input.eventHandlers)t.dom.removeEventListener(n,t.input.eventHandlers[n]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function fi(t){t.someProp("handleDOMEvents",n=>{for(let e in n)t.input.eventHandlers[e]||t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>Vi(t,r))})}function Vi(t,n){return t.someProp("handleDOMEvents",e=>{let r=e[n.type];return r?r(t,n)||n.defaultPrevented:!1})}function Px(t,n){if(!n.bubbles)return!0;if(n.defaultPrevented)return!1;for(let e=n.target;e!=t.dom;e=e.parentNode)if(!e||e.nodeType==11||e.pmViewDesc&&e.pmViewDesc.stopEvent(n))return!1;return!0}function Rx(t,n){!Vi(t,n)&&hn[n.type]&&(t.editable||!(n.type in gn))&&hn[n.type](t,n)}gn.keydown=(t,n)=>{let e=n;if(t.input.shiftKey=e.keyCode==16||e.shiftKey,!$d(t,e)&&(t.input.lastKeyCode=e.keyCode,t.input.lastKeyCodeTime=Date.now(),!(jn&&sn&&e.keyCode==13)))if(e.keyCode!=229&&t.domObserver.forceFlush(),Je&&e.keyCode==13&&!e.ctrlKey&&!e.altKey&&!e.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,ge(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,e))||Sx(t,e)?e.preventDefault():Zn(t,"key")};gn.keyup=(t,n)=>{n.keyCode==16&&(t.input.shiftKey=!1)};gn.keypress=(t,n)=>{let e=n;if($d(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||_n&&e.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,e))){e.preventDefault();return}let r=t.state.selection;if(!(r instanceof P)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(e.charCode),i=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",a=>a(t,r.$from.pos,r.$to.pos,o,i))&&t.dispatch(i()),e.preventDefault()}};function io(t){return{left:t.clientX,top:t.clientY}}function Bx(t,n){let e=n.x-t.clientX,r=n.y-t.clientY;return e*e+r*r<100}function Wi(t,n,e,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let a=i.depth+1;a>0;a--)if(t.someProp(n,s=>a>i.depth?s(t,e,i.nodeAfter,i.before(a),o,!0):s(t,e,i.node(a),i.before(a),o,!1)))return!0;return!1}function We(t,n,e){if(t.focused||t.focus(),t.state.selection.eq(n))return;let r=t.state.tr.setSelection(n);r.setMeta("pointer",!0),t.dispatch(r)}function Nx(t,n){if(n==-1)return!1;let e=t.state.doc.resolve(n),r=e.nodeAfter;return r&&r.isAtom&&O.isSelectable(r)?(We(t,new O(e)),!0):!1}function Fx(t,n){if(n==-1)return!1;let e=t.state.selection,r,o;e instanceof O&&(r=e.node);let i=t.state.doc.resolve(n);for(let a=i.depth+1;a>0;a--){let s=a>i.depth?i.nodeAfter:i.node(a);if(O.isSelectable(s)){r&&e.$from.depth>0&&a>=e.$from.depth&&i.before(e.$from.depth+1)==e.$from.pos?o=i.before(e.$from.depth):o=i.before(a);break}}return o!=null?(We(t,O.create(t.state.doc,o)),!0):!1}function Hx(t,n,e,r,o){return Wi(t,"handleClickOn",n,e,r)||t.someProp("handleClick",i=>i(t,n,r))||(o?Fx(t,e):Nx(t,e))}function jx(t,n,e,r){return Wi(t,"handleDoubleClickOn",n,e,r)||t.someProp("handleDoubleClick",o=>o(t,n,r))}function Xx(t,n,e,r){return Wi(t,"handleTripleClickOn",n,e,r)||t.someProp("handleTripleClick",o=>o(t,n,r))||Vx(t,e,r)}function Vx(t,n,e){if(e.button!=0)return!1;let r=t.state.doc;if(n==-1)return r.inlineContent?(We(t,P.create(r,0,r.content.size)),!0):!1;let o=r.resolve(n);for(let i=o.depth+1;i>0;i--){let a=i>o.depth?o.nodeAfter:o.node(i),s=o.before(i);if(a.inlineContent)We(t,P.create(r,s+1,s+1+a.content.size));else if(O.isSelectable(a))We(t,O.create(r,s));else continue;return!0}}function Ui(t){return mr(t)}const Td=_n?"metaKey":"ctrlKey";hn.mousedown=(t,n)=>{let e=n;t.input.shiftKey=e.shiftKey;let r=Ui(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&Bx(e,t.input.lastClick)&&!e[Td]&&t.input.lastClick.button==e.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:e.clientX,y:e.clientY,type:i,button:e.button};let a=t.posAtCoords(io(e));a&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Wx(t,a,e,!!r)):(i=="doubleClick"?jx:Xx)(t,a.pos,a.inside,e)?e.preventDefault():Zn(t,"pointer"))};class Wx{constructor(n,e,r,o){this.view=n,this.pos=e,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=n.state.doc,this.selectNode=!!r[Td],this.allowDefault=r.shiftKey;let i,a;if(e.inside>-1)i=n.state.doc.nodeAt(e.inside),a=e.inside;else{let d=n.state.doc.resolve(e.pos);i=d.parent,a=d.depth?d.before():0}const s=o?null:r.target,l=s?n.docView.nearestDesc(s,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=n.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof O&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Tn&&!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()),n.root.addEventListener("mouseup",this.up=this.up.bind(this)),n.root.addEventListener("mousemove",this.move=this.move.bind(this)),Zn(n,"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(()=>Xn(this.view)),this.view.input.mouseDown=null}up(n){if(this.done(),!this.view.dom.contains(n.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(io(n))),this.updateAllowDefault(n),this.allowDefault||!e?Zn(this.view,"pointer"):Hx(this.view,e.pos,e.inside,n,this.selectNode)?n.preventDefault():n.button==0&&(this.flushed||dn&&this.mightDrag&&!this.mightDrag.node.isAtom||sn&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(We(this.view,B.near(this.view.state.doc.resolve(e.pos))),n.preventDefault()):Zn(this.view,"pointer")}move(n){this.updateAllowDefault(n),Zn(this.view,"pointer"),n.buttons==0&&this.done()}updateAllowDefault(n){!this.allowDefault&&(Math.abs(this.event.x-n.clientX)>4||Math.abs(this.event.y-n.clientY)>4)&&(this.allowDefault=!0)}}hn.touchstart=t=>{t.input.lastTouch=Date.now(),Ui(t),Zn(t,"pointer")};hn.touchmove=t=>{t.input.lastTouch=Date.now(),Zn(t,"pointer")};hn.contextmenu=t=>Ui(t);function $d(t,n){return t.composing?!0:dn&&Math.abs(n.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Ux=jn?5e3:-1;gn.compositionstart=gn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:n}=t,e=n.selection.$to;if(n.selection instanceof P&&(n.storedMarks||!e.textOffset&&e.parentOffset&&e.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||sn&&ad&&qx(t)))t.markCursor=t.state.storedMarks||e.marks(),mr(t,!0),t.markCursor=null;else if(mr(t,!n.selection.empty),Tn&&n.selection.empty&&e.parentOffset&&!e.textOffset&&e.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(a.nodeType==3){let s=t.domSelection();s&&s.collapse(a,a.nodeValue.length);break}else o=a,i=-1}}t.input.composing=!0}Md(t,Ux)};function qx(t){let{focusNode:n,focusOffset:e}=t.domSelectionRange();if(!n||n.nodeType!=1||e>=n.childNodes.length)return!1;let r=n.childNodes[e];return r.nodeType==1&&r.contentEditable=="false"}gn.compositionend=(t,n)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=n.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Md(t,20))};function Md(t,n){clearTimeout(t.input.composingTimeout),n>-1&&(t.input.composingTimeout=setTimeout(()=>mr(t),n))}function zd(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Jx());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Kx(t){let n=t.domSelectionRange();if(!n.focusNode)return null;let e=F0(n.focusNode,n.focusOffset),r=H0(n.focusNode,n.focusOffset);if(e&&r&&e!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(e==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let a=e.pmViewDesc;if(!(!a||!a.isText(e.nodeValue)))return r}}return e||r}function Jx(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function mr(t,n=!1){if(!(jn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),zd(t),n||t.docView&&t.docView.dirty){let e=Hi(t),r=t.state.selection;return e&&!e.eq(r)?t.dispatch(t.state.tr.setSelection(e)):(t.markCursor||n)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Gx(t,n){if(!t.dom.parentNode)return;let e=t.dom.parentNode.appendChild(document.createElement("div"));e.appendChild(n),e.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(n),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e),t.focus()},50)}const St=xn&&re<15||Je&&W0<604;hn.copy=gn.cut=(t,n)=>{let e=n,r=t.state.selection,o=e.type=="cut";if(r.empty)return;let i=St?null:e.clipboardData,a=r.content(),{dom:s,text:l}=Xi(t,a);i?(e.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",l)):Gx(t,s),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Yx(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Qx(t,n){if(!t.dom.parentNode)return;let e=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(e?"textarea":"div"));e||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),e?Et(t,r.value,null,o,n):Et(t,r.textContent,r.innerHTML,o,n)},50)}function Et(t,n,e,r,o){let i=wd(t,n,e,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||w.empty)))return!0;if(!i)return!1;let a=Yx(i),s=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(i);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Dd(t){let n=t.getData("text/plain")||t.getData("Text");if(n)return n;let e=t.getData("text/uri-list");return e?e.replace(/\r?\n/g," "):""}gn.paste=(t,n)=>{let e=n;if(t.composing&&!jn)return;let r=St?null:e.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Et(t,Dd(r),r.getData("text/html"),o,e)?e.preventDefault():Qx(t,e)};class Od{constructor(n,e,r){this.slice=n,this.move=e,this.node=r}}const Zx=_n?"altKey":"ctrlKey";function Ad(t,n){let e;return t.someProp("dragCopies",r=>{e=e||r(n)}),e!=null?!e:!n[Zx]}hn.dragstart=(t,n)=>{let e=n,r=t.input.mouseDown;if(r&&r.done(),!e.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(io(e)),a;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof O?o.to-1:o.to))){if(r&&r.mightDrag)a=O.create(t.state.doc,r.mightDrag.pos);else if(e.target&&e.target.nodeType==1){let h=t.docView.nearestDesc(e.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(a=O.create(t.state.doc,h.posBefore))}}let s=(a||t.state.selection).content(),{dom:l,text:c,slice:d}=Xi(t,s);(!e.dataTransfer.files.length||!sn||id>120)&&e.dataTransfer.clearData(),e.dataTransfer.setData(St?"Text":"text/html",l.innerHTML),e.dataTransfer.effectAllowed="copyMove",St||e.dataTransfer.setData("text/plain",c),t.dragging=new Od(d,Ad(t,e),a)};hn.dragend=t=>{let n=t.dragging;window.setTimeout(()=>{t.dragging==n&&(t.dragging=null)},50)};gn.dragover=gn.dragenter=(t,n)=>n.preventDefault();gn.drop=(t,n)=>{try{nb(t,n,t.dragging)}finally{t.dragging=null}};function nb(t,n,e){if(!n.dataTransfer)return;let r=t.posAtCoords(io(n));if(!r)return;let o=t.state.doc.resolve(r.pos),i=e&&e.slice;i?t.someProp("transformPasted",u=>{i=u(i,t,!1)}):i=wd(t,Dd(n.dataTransfer),St?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(e&&Ad(t,n));if(t.someProp("handleDrop",u=>u(t,n,i||w.empty,a))){n.preventDefault();return}if(!i)return;n.preventDefault();let s=i?Gc(t.state.doc,o.pos,i):o.pos;s==null&&(s=o.pos);let l=t.state.tr;if(a){let{node:u}=e;u?u.replace(l):l.deleteSelection()}let c=l.mapping.map(s),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=l.doc;if(d?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),l.doc.eq(h))return;let g=l.doc.resolve(c);if(d&&O.isSelectable(i.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new O(g));else{let u=l.mapping.map(s);l.mapping.maps[l.mapping.maps.length-1].forEach((f,m,x,b)=>u=b),l.setSelection(ji(t,g,l.doc.resolve(u)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}hn.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())&&Xn(t)},20))};hn.blur=(t,n)=>{let e=n;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),e.relatedTarget&&t.dom.contains(e.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};hn.beforeinput=(t,n)=>{if(sn&&jn&&n.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,ge(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in gn)hn[t]=gn[t];function It(t,n){if(t==n)return!0;for(let e in t)if(t[e]!==n[e])return!1;for(let e in n)if(!(e in t))return!1;return!0}class xr{constructor(n,e){this.toDOM=n,this.spec=e||ke,this.side=this.spec.side||0}map(n,e,r,o){let{pos:i,deleted:a}=n.mapResult(e.from+o,this.side<0?-1:1);return a?null:new vn(i-r,i-r,this)}valid(){return!0}eq(n){return this==n||n instanceof xr&&(this.spec.key&&this.spec.key==n.spec.key||this.toDOM==n.toDOM&&It(this.spec,n.spec))}destroy(n){this.spec.destroy&&this.spec.destroy(n)}}class ie{constructor(n,e){this.attrs=n,this.spec=e||ke}map(n,e,r,o){let i=n.map(e.from+o,this.spec.inclusiveStart?-1:1)-r,a=n.map(e.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=a?null:new vn(i,a,this)}valid(n,e){return e.from<e.to}eq(n){return this==n||n instanceof ie&&It(this.attrs,n.attrs)&&It(this.spec,n.spec)}static is(n){return n.type instanceof ie}destroy(){}}class qi{constructor(n,e){this.attrs=n,this.spec=e||ke}map(n,e,r,o){let i=n.mapResult(e.from+o,1);if(i.deleted)return null;let a=n.mapResult(e.to+o,-1);return a.deleted||a.pos<=i.pos?null:new vn(i.pos-r,a.pos-r,this)}valid(n,e){let{index:r,offset:o}=n.content.findIndex(e.from),i;return o==e.from&&!(i=n.child(r)).isText&&o+i.nodeSize==e.to}eq(n){return this==n||n instanceof qi&&It(this.attrs,n.attrs)&&It(this.spec,n.spec)}destroy(){}}class vn{constructor(n,e,r){this.from=n,this.to=e,this.type=r}copy(n,e){return new vn(n,e,this.type)}eq(n,e=0){return this.type.eq(n.type)&&this.from+e==n.from&&this.to+e==n.to}map(n,e,r){return this.type.map(n,this,e,r)}static widget(n,e,r){return new vn(n,n,new xr(e,r))}static inline(n,e,r,o){return new vn(n,e,new ie(r,o))}static node(n,e,r,o){return new vn(n,e,new qi(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof ie}get widget(){return this.type instanceof xr}}const Re=[],ke={};class G{constructor(n,e){this.local=n.length?n:Re,this.children=e.length?e:Re}static create(n,e){return e.length?br(e,n,0,ke):cn}find(n,e,r){let o=[];return this.findInner(n??0,e??1e9,o,0,r),o}findInner(n,e,r,o,i){for(let a=0;a<this.local.length;a++){let s=this.local[a];s.from<=e&&s.to>=n&&(!i||i(s.spec))&&r.push(s.copy(s.from+o,s.to+o))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<e&&this.children[a+1]>n){let s=this.children[a]+1;this.children[a+2].findInner(n-s,e-s,r,o+s,i)}}map(n,e,r){return this==cn||n.maps.length==0?this:this.mapInner(n,e,0,0,r||ke)}mapInner(n,e,r,o,i){let a;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(n,r,o);l&&l.type.valid(e,l)?(a||(a=[])).push(l):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?eb(this.children,a||[],n,e,r,o,i):a?new G(a.sort(we),Re):cn}add(n,e){return e.length?this==cn?G.create(n,e):this.addInner(n,e,0):this}addInner(n,e,r){let o,i=0;n.forEach((s,l)=>{let c=l+r,d;if(d=Pd(e,s,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(s,d,c+1):o.splice(i,0,l,l+s.nodeSize,br(d,s,c+1,ke)),i+=3}});let a=Ld(i?Rd(e):e,-r);for(let s=0;s<a.length;s++)a[s].type.valid(n,a[s])||a.splice(s--,1);return new G(a.length?this.local.concat(a).sort(we):this.local,o||this.children)}remove(n){return n.length==0||this==cn?this:this.removeInner(n,0)}removeInner(n,e){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let a,s=r[i]+e,l=r[i+1]+e;for(let d=0,h;d<n.length;d++)(h=n[d])&&h.from>s&&h.to<l&&(n[d]=null,(a||(a=[])).push(h));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(a,s+1);c!=cn?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,a;i<n.length;i++)if(a=n[i])for(let s=0;s<o.length;s++)o[s].eq(a,e)&&(o==this.local&&(o=this.local.slice()),o.splice(s--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new G(o,r):cn}forChild(n,e){if(this==cn)return this;if(e.isLeaf)return G.empty;let r,o;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=n){this.children[s]==n&&(r=this.children[s+2]);break}let i=n+1,a=i+e.content.size;for(let s=0;s<this.local.length;s++){let l=this.local[s];if(l.from<a&&l.to>i&&l.type instanceof ie){let c=Math.max(i,l.from)-i,d=Math.min(a,l.to)-i;c<d&&(o||(o=[])).push(l.copy(c,d))}}if(o){let s=new G(o.sort(we),Re);return r?new Jn([s,r]):s}return r||cn}eq(n){if(this==n)return!0;if(!(n instanceof G)||this.local.length!=n.local.length||this.children.length!=n.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(n.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=n.children[e]||this.children[e+1]!=n.children[e+1]||!this.children[e+2].eq(n.children[e+2]))return!1;return!0}locals(n){return Ki(this.localsInner(n))}localsInner(n){if(this==cn)return Re;if(n.inlineContent||!this.local.some(ie.is))return this.local;let e=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ie||e.push(this.local[r]);return e}forEachSet(n){n(this)}}G.empty=new G([],[]);G.removeOverlap=Ki;const cn=G.empty;class Jn{constructor(n){this.members=n}map(n,e){const r=this.members.map(o=>o.map(n,e,ke));return Jn.from(r)}forChild(n,e){if(e.isLeaf)return G.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(n,e);i!=cn&&(i instanceof Jn?r=r.concat(i.members):r.push(i))}return Jn.from(r)}eq(n){if(!(n instanceof Jn)||n.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(n.members[e]))return!1;return!0}locals(n){let e,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(n);if(i.length)if(!e)e=i;else{r&&(e=e.slice(),r=!1);for(let a=0;a<i.length;a++)e.push(i[a])}}return e?Ki(r?e:e.sort(we)):Re}static from(n){switch(n.length){case 0:return cn;case 1:return n[0];default:return new Jn(n.every(e=>e instanceof G)?n:n.reduce((e,r)=>e.concat(r instanceof G?r:r.members),[]))}}forEachSet(n){for(let e=0;e<this.members.length;e++)this.members[e].forEachSet(n)}}function eb(t,n,e,r,o,i,a){let s=t.slice();for(let c=0,d=i;c<e.maps.length;c++){let h=0;e.maps[c].forEach((g,u,f,m)=>{let x=m-f-(u-g);for(let b=0;b<s.length;b+=3){let _=s[b+1];if(_<0||g>_+d-h)continue;let z=s[b]+d-h;u>=z?s[b+1]=g<=z?-2:-1:g>=d&&x&&(s[b]+=x,s[b+1]+=x)}h+=x}),d=e.maps[c].map(d,-1)}let l=!1;for(let c=0;c<s.length;c+=3)if(s[c+1]<0){if(s[c+1]==-2){l=!0,s[c+1]=-1;continue}let d=e.map(t[c]+i),h=d-o;if(h<0||h>=r.content.size){l=!0;continue}let g=e.map(t[c+1]+i,-1),u=g-o,{index:f,offset:m}=r.content.findIndex(h),x=r.maybeChild(f);if(x&&m==h&&m+x.nodeSize==u){let b=s[c+2].mapInner(e,x,d+1,t[c]+i+1,a);b!=cn?(s[c]=h,s[c+1]=u,s[c+2]=b):(s[c+1]=-2,l=!0)}else l=!0}if(l){let c=tb(s,t,n,e,o,i,a),d=br(c,r,0,a);n=d.local;for(let h=0;h<s.length;h+=3)s[h+1]<0&&(s.splice(h,3),h-=3);for(let h=0,g=0;h<d.children.length;h+=3){let u=d.children[h];for(;g<s.length&&s[g]<u;)g+=3;s.splice(g,0,d.children[h],d.children[h+1],d.children[h+2])}}return new G(n.sort(we),s)}function Ld(t,n){if(!n||!t.length)return t;let e=[];for(let r=0;r<t.length;r++){let o=t[r];e.push(new vn(o.from+n,o.to+n,o.type))}return e}function tb(t,n,e,r,o,i,a){function s(l,c){for(let d=0;d<l.local.length;d++){let h=l.local[d].map(r,o,c);h?e.push(h):a.onRemove&&a.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)s(l.children[d+2],l.children[d]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&s(t[l+2],n[l]+i+1);return e}function Pd(t,n,e){if(n.isLeaf)return null;let r=e+n.nodeSize,o=null;for(let i=0,a;i<t.length;i++)(a=t[i])&&a.from>e&&a.to<r&&((o||(o=[])).push(a),t[i]=null);return o}function Rd(t){let n=[];for(let e=0;e<t.length;e++)t[e]!=null&&n.push(t[e]);return n}function br(t,n,e,r){let o=[],i=!1;n.forEach((s,l)=>{let c=Pd(t,s,l+e);if(c){i=!0;let d=br(c,s,e+l+1,r);d!=cn&&o.push(l,l+s.nodeSize,d)}});let a=Ld(i?Rd(t):t,-e).sort(we);for(let s=0;s<a.length;s++)a[s].type.valid(n,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||o.length?new G(a,o):cn}function we(t,n){return t.from-n.from||t.to-n.to}function Ki(t){let n=t;for(let e=0;e<n.length-1;e++){let r=n[e];if(r.from!=r.to)for(let o=e+1;o<n.length;o++){let i=n[o];if(i.from==r.from){i.to!=r.to&&(n==t&&(n=t.slice()),n[o]=i.copy(i.from,r.to),ys(n,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(n==t&&(n=t.slice()),n[e]=r.copy(r.from,i.from),ys(n,o,r.copy(i.from,r.to)));break}}}return n}function ys(t,n,e){for(;n<t.length&&we(e,t[n])>0;)n++;t.splice(n,0,e)}function $o(t){let n=[];return t.someProp("decorations",e=>{let r=e(t.state);r&&r!=cn&&n.push(r)}),t.cursorWrapper&&n.push(G.create(t.state.doc,[t.cursorWrapper.deco])),Jn.from(n)}const rb={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ob=xn&&re<=11;class ib{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(n){this.anchorNode=n.anchorNode,this.anchorOffset=n.anchorOffset,this.focusNode=n.focusNode,this.focusOffset=n.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(n){return n.anchorNode==this.anchorNode&&n.anchorOffset==this.anchorOffset&&n.focusNode==this.focusNode&&n.focusOffset==this.focusOffset}}class ab{constructor(n,e){this.view=n,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ib,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);xn&&re<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():dn&&n.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(n.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ob&&(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,rb)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let n=this.observer.takeRecords();if(n.length){for(let e=0;e<n.length;e++)this.queue.push(n[e]);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(ps(this.view)){if(this.suppressingSelectionUpdates)return Xn(this.view);if(xn&&re<=11&&!this.view.state.selection.empty){let n=this.view.domSelectionRange();if(n.focusNode&&Ie(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(n){if(!n.focusNode)return!0;let e=new Set,r;for(let i=n.focusNode;i;i=Ke(i))e.add(i);for(let i=n.anchorNode;i;i=Ke(i))if(e.has(i)){r=i;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}pendingRecords(){if(this.observer)for(let n of this.observer.takeRecords())this.queue.push(n);return this.queue}flush(){let{view:n}=this;if(!n.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let r=n.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&ps(n)&&!this.ignoreSelectionChange(r),i=-1,a=-1,s=!1,l=[];if(n.editable)for(let d=0;d<e.length;d++){let h=this.registerMutation(e[d],l);h&&(i=i<0?h.from:Math.min(h.from,i),a=a<0?h.to:Math.max(h.to,a),h.typeOver&&(s=!0))}if(l.some(d=>d.nodeName=="BR")&&(n.input.lastKeyCode==8||n.input.lastKeyCode==46)){for(let d of l)if(d.nodeName=="BR"&&d.parentNode){let h=d.nextSibling;for(;h&&h.nodeType==1;){if(h.contentEditable=="false"){d.parentNode.removeChild(d);break}h=h.firstChild}}}else if(Tn&&l.length){let d=l.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,g]=d;h.parentNode&&h.parentNode.parentNode==g.parentNode?g.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let g of d){let u=g.parentNode;u&&u.nodeName=="LI"&&(!h||cb(n,h)!=u)&&g.remove()}}}let c=null;i<0&&o&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&ro(r)&&(c=Hi(n))&&c.eq(B.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,Xn(n),this.currentSelection.set(r),n.scrollToSelection()):(i>-1||o)&&(i>-1&&(n.docView.markDirty(i,a),sb(n)),n.input.badSafariComposition&&(n.input.badSafariComposition=!1,db(n,l)),this.handleDOMChange(i,a,s,l),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(r)||Xn(n),this.currentSelection.set(r))}registerMutation(n,e){if(e.indexOf(n.target)>-1)return null;let r=this.view.docView.nearestDesc(n.target);if(n.type=="attributes"&&(r==this.view.docView||n.attributeName=="contenteditable"||n.attributeName=="style"&&!n.oldValue&&!n.target.getAttribute("style"))||!r||r.ignoreMutation(n))return null;if(n.type=="childList"){for(let d=0;d<n.addedNodes.length;d++){let h=n.addedNodes[d];e.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(n.target))return{from:r.posBefore,to:r.posAfter};let o=n.previousSibling,i=n.nextSibling;if(xn&&re<=11&&n.addedNodes.length)for(let d=0;d<n.addedNodes.length;d++){let{previousSibling:h,nextSibling:g}=n.addedNodes[d];(!h||Array.prototype.indexOf.call(n.addedNodes,h)<0)&&(o=h),(!g||Array.prototype.indexOf.call(n.addedNodes,g)<0)&&(i=g)}let a=o&&o.parentNode==n.target?on(o)+1:0,s=r.localPosFromDOM(n.target,a,-1),l=i&&i.parentNode==n.target?on(i):n.target.childNodes.length,c=r.localPosFromDOM(n.target,l,1);return{from:s,to:c}}else return n.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=n.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:n.target.nodeValue==n.oldValue})}}let vs=new WeakMap,ks=!1;function sb(t){if(!vs.has(t)&&(vs.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Tn,ks)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."),ks=!0}}function ws(t,n){let e=n.startContainer,r=n.startOffset,o=n.endContainer,i=n.endOffset,a=t.domAtPos(t.state.selection.anchor);return Ie(a.node,a.offset,o,i)&&([e,r,o,i]=[o,i,e,r]),{anchorNode:e,anchorOffset:r,focusNode:o,focusOffset:i}}function lb(t,n){if(n.getComposedRanges){let o=n.getComposedRanges(t.root)[0];if(o)return ws(t,o)}let e;function r(o){o.preventDefault(),o.stopImmediatePropagation(),e=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),e?ws(t,e):null}function cb(t,n){for(let e=n.parentNode;e&&e!=t.dom;e=e.parentNode){let r=t.docView.nearestDesc(e,!0);if(r&&r.node.isBlock)return e}return null}function db(t,n){var e;let{focusNode:r,focusOffset:o}=t.domSelectionRange();for(let i of n)if(((e=i.parentNode)===null||e===void 0?void 0:e.nodeName)=="TR"){let a=i.nextSibling;for(;a&&a.nodeName!="TD"&&a.nodeName!="TH";)a=a.nextSibling;if(a){let s=a;for(;;){let l=s.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;s=l}s.insertBefore(i,s.firstChild),r==i&&t.domSelection().collapse(i,o)}else i.parentNode.removeChild(i)}}function pb(t,n,e){let{node:r,fromOffset:o,toOffset:i,from:a,to:s}=t.docView.parseRange(n,e),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],ro(l)||c.push({node:l.focusNode,offset:l.focusOffset})),sn&&t.input.lastKeyCode===8)for(let x=i;x>o;x--){let b=r.childNodes[x-1],_=b.pmViewDesc;if(b.nodeName=="BR"&&!_){i=x;break}if(!_||_.size)break}let h=t.state.doc,g=t.someProp("domParser")||te.fromSchema(t.state.schema),u=h.resolve(a),f=null,m=g.parse(r,{topNode:u.parent,topMatch:u.parent.contentMatchAt(u.index()),topOpen:!0,from:o,to:i,preserveWhitespace:u.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:hb,context:u});if(c&&c[0].pos!=null){let x=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=x),f={anchor:x+a,head:b+a}}return{doc:m,sel:f,from:a,to:s}}function hb(t){let n=t.pmViewDesc;if(n)return n.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(dn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(t.parentNode.lastChild==t||dn&&/^(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 gb=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function ub(t,n,e,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,n<0){let C=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,D=Hi(t,C);if(D&&!t.state.selection.eq(D)){if(sn&&jn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",V=>V(t,ge(13,"Enter"))))return;let F=t.state.tr.setSelection(D);C=="pointer"?F.setMeta("pointer",!0):C=="key"&&F.scrollIntoView(),i&&F.setMeta("composition",i),t.dispatch(F)}return}let a=t.state.doc.resolve(n),s=a.sharedDepth(e);n=a.before(s+1),e=t.state.doc.resolve(e).after(s+1);let l=t.state.selection,c=pb(t,n,e),d=t.state.doc,h=d.slice(c.from,c.to),g,u;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(g=t.state.selection.to,u="end"):(g=t.state.selection.from,u="start"),t.input.lastKeyCode=null;let f=xb(h.content,c.doc.content,c.from,g,u);if(f&&t.input.domChangeCount++,(Je&&t.input.lastIOSEnter>Date.now()-225||jn)&&o.some(C=>C.nodeType==1&&!gb.test(C.nodeName))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",C=>C(t,ge(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!f)if(r&&l instanceof P&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))f={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=_s(t,t.state.doc,c.sel);if(C&&!C.eq(t.state.selection)){let D=t.state.tr.setSelection(C);i&&D.setMeta("composition",i),t.dispatch(D)}}return}t.state.selection.from<t.state.selection.to&&f.start==f.endB&&t.state.selection instanceof P&&(f.start>t.state.selection.from&&f.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?f.start=t.state.selection.from:f.endA<t.state.selection.to&&f.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(f.endB+=t.state.selection.to-f.endA,f.endA=t.state.selection.to)),xn&&re<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>c.from&&c.doc.textBetween(f.start-c.from-1,f.start-c.from+1)==" "&&(f.start--,f.endA--,f.endB--);let m=c.doc.resolveNoCache(f.start-c.from),x=c.doc.resolveNoCache(f.endB-c.from),b=d.resolve(f.start),_=m.sameParent(x)&&m.parent.inlineContent&&b.end()>=f.endA;if((Je&&t.input.lastIOSEnter>Date.now()-225&&(!_||o.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!_&&m.pos<c.doc.content.size&&(!m.sameParent(x)||!m.parent.inlineContent)&&m.pos<x.pos&&!/\S/.test(c.doc.textBetween(m.pos,x.pos,"","")))&&t.someProp("handleKeyDown",C=>C(t,ge(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>f.start&&mb(d,f.start,f.endA,m,x)&&t.someProp("handleKeyDown",C=>C(t,ge(8,"Backspace")))){jn&&sn&&t.domObserver.suppressSelectionUpdates();return}sn&&f.endB==f.start&&(t.input.lastChromeDelete=Date.now()),jn&&!_&&m.start()!=x.start()&&x.parentOffset==0&&m.depth==x.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==f.endA&&(f.endB-=2,x=c.doc.resolveNoCache(f.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(C){return C(t,ge(13,"Enter"))})},20));let z=f.start,A=f.endA,L=C=>{let D=C||t.state.tr.replace(z,A,c.doc.slice(f.start-c.from,f.endB-c.from));if(c.sel){let F=_s(t,D.doc,c.sel);F&&!(sn&&t.composing&&F.empty&&(f.start!=f.endB||t.input.lastChromeDelete<Date.now()-100)&&(F.head==z||F.head==D.mapping.map(A)-1)||xn&&F.empty&&F.head==z)&&D.setSelection(F)}return i&&D.setMeta("composition",i),D.scrollIntoView()},H;if(_)if(m.pos==x.pos){xn&&re<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Xn(t),20));let C=L(t.state.tr.delete(z,A)),D=d.resolve(f.start).marksAcross(d.resolve(f.endA));D&&C.ensureMarks(D),t.dispatch(C)}else if(f.endA==f.endB&&(H=fb(m.parent.content.cut(m.parentOffset,x.parentOffset),b.parent.content.cut(b.parentOffset,f.endA-b.start())))){let C=L(t.state.tr);H.type=="add"?C.addMark(z,A,H.mark):C.removeMark(z,A,H.mark),t.dispatch(C)}else if(m.parent.child(m.index()).isText&&m.index()==x.index()-(x.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,x.parentOffset),D=()=>L(t.state.tr.insertText(C,z,A));t.someProp("handleTextInput",F=>F(t,z,A,C,D))||t.dispatch(D())}else t.dispatch(L());else t.dispatch(L())}function _s(t,n,e){return Math.max(e.anchor,e.head)>n.content.size?null:ji(t,n.resolve(e.anchor),n.resolve(e.head))}function fb(t,n){let e=t.firstChild.marks,r=n.firstChild.marks,o=e,i=r,a,s,l;for(let d=0;d<r.length;d++)o=r[d].removeFromSet(o);for(let d=0;d<e.length;d++)i=e[d].removeFromSet(i);if(o.length==1&&i.length==0)s=o[0],a="add",l=d=>d.mark(s.addToSet(d.marks));else if(o.length==0&&i.length==1)s=i[0],a="remove",l=d=>d.mark(s.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<n.childCount;d++)c.push(l(n.child(d)));if(y.from(c).eq(t))return{mark:s,type:a}}function mb(t,n,e,r,o){if(e-n<=o.pos-r.pos||Mo(r,!0,!1)<o.pos)return!1;let i=t.resolve(n);if(!r.parent.isTextblock){let s=i.nodeAfter;return s!=null&&e==n+s.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let a=t.resolve(Mo(i,!0,!0));return!a.parent.isTextblock||a.pos>e||Mo(a,!0,!1)<e?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function Mo(t,n,e){let r=t.depth,o=n?t.end():t.pos;for(;r>0&&(n||t.indexAfter(r)==t.node(r).childCount);)r--,o++,n=!1;if(e){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function xb(t,n,e,r,o){let i=t.findDiffStart(n,e);if(i==null)return null;let{a,b:s}=t.findDiffEnd(n,e+t.size,e+n.size);if(o=="end"){let l=Math.max(0,i-Math.min(a,s));r-=a+l-i}if(a<i&&t.size<n.size){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<n.size&&Cs(n.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}else if(s<i){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<t.size&&Cs(t.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}return{start:i,endA:a,endB:s}}function Cs(t){if(t.length!=2)return!1;let n=t.charCodeAt(0),e=t.charCodeAt(1);return n>=56320&&n<=57343&&e>=55296&&e<=56319}class Bd{constructor(n,e){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 Ox,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach($s),this.dispatch=this.dispatch.bind(this),this.dom=n&&n.mount||document.createElement("div"),n&&(n.appendChild?n.appendChild(this.dom):typeof n=="function"?n(this.dom):n.mount&&(this.mounted=!0)),this.editable=Is(this),Es(this),this.nodeViews=Ts(this),this.docView=is(this.state.doc,Ss(this),$o(this),this.dom,this),this.domObserver=new ab(this,(r,o,i,a)=>ub(this,r,o,i,a)),this.domObserver.start(),Ax(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let n=this._props;this._props={};for(let e in n)this._props[e]=n[e];this._props.state=this.state}return this._props}update(n){n.handleDOMEvents!=this._props.handleDOMEvents&&fi(this);let e=this._props;this._props=n,n.plugins&&(n.plugins.forEach($s),this.directPlugins=n.plugins),this.updateStateInner(n.state,e)}setProps(n){let e={};for(let r in this._props)e[r]=this._props[r];e.state=this.state;for(let r in n)e[r]=n[r];this.update(e)}updateState(n){this.updateStateInner(n,this._props)}updateStateInner(n,e){var r;let o=this.state,i=!1,a=!1;n.storedMarks&&this.composing&&(zd(this),a=!0),this.state=n;let s=o.plugins!=n.plugins||this._props.plugins!=e.plugins;if(s||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let u=Ts(this);yb(u,this.nodeViews)&&(this.nodeViews=u,i=!0)}(s||e.handleDOMEvents!=this._props.handleDOMEvents)&&fi(this),this.editable=Is(this),Es(this);let l=$o(this),c=Ss(this),d=o.plugins!=n.plugins&&!o.doc.eq(n.doc)?"reset":n.scrollToSelection>o.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(n.doc,c,l);(h||!n.selection.eq(o.selection))&&(a=!0);let g=d=="preserve"&&a&&this.dom.style.overflowAnchor==null&&K0(this);if(a){this.domObserver.stop();let u=h&&(xn||sn)&&!this.composing&&!o.selection.empty&&!n.selection.empty&&bb(o.selection,n.selection);if(h){let f=sn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Kx(this)),(i||!this.docView.update(n.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=is(n.doc,c,l,this.dom,this)),f&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(u=!0)}u||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&bx(this))?Xn(this,u):(yd(this,n.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(n.doc)&&this.updateDraggedNode(this.dragging,o),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():g&&J0(g)}scrollToSelection(){let n=this.domSelectionRange().focusNode;if(!(!n||!this.dom.contains(n.nodeType==1?n:n.parentNode))){if(!this.someProp("handleScrollToSelection",e=>e(this)))if(this.state.selection instanceof O){let e=this.docView.domAfterPos(this.state.selection.from);e.nodeType==1&&Qa(this,e.getBoundingClientRect(),n)}else Qa(this,this.coordsAtPos(this.state.selection.head,1),n)}}destroyPluginViews(){let n;for(;n=this.pluginViews.pop();)n.destroy&&n.destroy()}updatePluginViews(n){if(!n||n.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let r=this.directPlugins[e];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let r=this.state.plugins[e];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let e=0;e<this.pluginViews.length;e++){let r=this.pluginViews[e];r.update&&r.update(this,n)}}updateDraggedNode(n,e){let r=n.node,o=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-e.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new Od(n.slice,n.move,o<0?void 0:O.create(this.state.doc,o))}someProp(n,e){let r=this._props&&this._props[n],o;if(r!=null&&(o=e?e(r):r))return o;for(let a=0;a<this.directPlugins.length;a++){let s=this.directPlugins[a].props[n];if(s!=null&&(o=e?e(s):s))return o}let i=this.state.plugins;if(i)for(let a=0;a<i.length;a++){let s=i[a].props[n];if(s!=null&&(o=e?e(s):s))return o}}hasFocus(){if(xn){let n=this.root.activeElement;if(n==this.dom)return!0;if(!n||!this.dom.contains(n))return!1;for(;n&&this.dom!=n&&this.dom.contains(n);){if(n.contentEditable=="false")return!1;n=n.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&G0(this.dom),Xn(this),this.domObserver.start()}get root(){let n=this._root;if(n==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return n||document}updateRoot(){this._root=null}posAtCoords(n){return ex(this,n)}coordsAtPos(n,e=1){return pd(this,n,e)}domAtPos(n,e=0){return this.docView.domFromPos(n,e)}nodeDOM(n){let e=this.docView.descAt(n);return e?e.nodeDOM:null}posAtDOM(n,e,r=-1){let o=this.docView.posFromDOM(n,e,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(n,e){return ax(this,e||this.state,n)}pasteHTML(n,e){return Et(this,"",n,!1,e||new ClipboardEvent("paste"))}pasteText(n,e){return Et(this,n,null,!0,e||new ClipboardEvent("paste"))}serializeForClipboard(n){return Xi(this,n)}destroy(){this.docView&&(Lx(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],$o(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,B0())}get isDestroyed(){return this.docView==null}dispatchEvent(n){return Rx(this,n)}domSelectionRange(){let n=this.domSelection();return n?dn&&this.root.nodeType===11&&X0(this.dom.ownerDocument)==this.dom&&lb(this,n)||n:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Bd.prototype.dispatch=function(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))};function Ss(t){let n=Object.create(null);return n.class="ProseMirror",n.contenteditable=String(t.editable),t.someProp("attributes",e=>{if(typeof e=="function"&&(e=e(t.state)),e)for(let r in e)r=="class"?n.class+=" "+e[r]:r=="style"?n.style=(n.style?n.style+";":"")+e[r]:!n[r]&&r!="contenteditable"&&r!="nodeName"&&(n[r]=String(e[r]))}),n.translate||(n.translate="no"),[vn.node(0,t.state.doc.content.size,n)]}function Es(t){if(t.markCursor){let n=document.createElement("img");n.className="ProseMirror-separator",n.setAttribute("mark-placeholder","true"),n.setAttribute("alt",""),t.cursorWrapper={dom:n,deco:vn.widget(t.state.selection.from,n,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Is(t){return!t.someProp("editable",n=>n(t.state)===!1)}function bb(t,n){let e=Math.min(t.$anchor.sharedDepth(t.head),n.$anchor.sharedDepth(n.head));return t.$anchor.start(e)!=n.$anchor.start(e)}function Ts(t){let n=Object.create(null);function e(r){for(let o in r)Object.prototype.hasOwnProperty.call(n,o)||(n[o]=r[o])}return t.someProp("nodeViews",e),t.someProp("markViews",e),n}function yb(t,n){let e=0,r=0;for(let o in t){if(t[o]!=n[o])return!0;e++}for(let o in n)r++;return e!=r}function $s(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 se={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:"'"},yr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},vb=typeof navigator<"u"&&/Mac/.test(navigator.platform),kb=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var an=0;an<10;an++)se[48+an]=se[96+an]=String(an);for(var an=1;an<=24;an++)se[an+111]="F"+an;for(var an=65;an<=90;an++)se[an]=String.fromCharCode(an+32),yr[an]=String.fromCharCode(an);for(var zo in se)yr.hasOwnProperty(zo)||(yr[zo]=se[zo]);function wb(t){var n=vb&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||kb&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",e=!n&&t.key||(t.shiftKey?yr:se)[t.keyCode]||t.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}const _b=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Cb=typeof navigator<"u"&&/Win/.test(navigator.platform);function Sb(t){let n=t.split(/-(?!$)/),e=n[n.length-1];e=="Space"&&(e=" ");let r,o,i,a;for(let s=0;s<n.length-1;s++){let l=n[s];if(/^(cmd|meta|m)$/i.test(l))a=!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))i=!0;else if(/^mod$/i.test(l))_b?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(e="Alt-"+e),o&&(e="Ctrl-"+e),a&&(e="Meta-"+e),i&&(e="Shift-"+e),e}function Eb(t){let n=Object.create(null);for(let e in t)n[Sb(e)]=t[e];return n}function Do(t,n,e=!0){return n.altKey&&(t="Alt-"+t),n.ctrlKey&&(t="Ctrl-"+t),n.metaKey&&(t="Meta-"+t),e&&n.shiftKey&&(t="Shift-"+t),t}function Ib(t){return new Q({props:{handleKeyDown:Nd(t)}})}function Nd(t){let n=Eb(t);return function(e,r){let o=wb(r),i,a=n[Do(o,r)];if(a&&a(e.state,e.dispatch,e))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let s=n[Do(o,r,!1)];if(s&&s(e.state,e.dispatch,e))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(Cb&&r.ctrlKey&&r.altKey)&&(i=se[r.keyCode])&&i!=o){let s=n[Do(i,r)];if(s&&s(e.state,e.dispatch,e))return!0}}return!1}}const Tb=(t,n)=>t.selection.empty?!1:(n&&n(t.tr.deleteSelection().scrollIntoView()),!0);function Fd(t,n){let{$cursor:e}=t.selection;return!e||e.parentOffset>0?null:e}const $b=(t,n,e)=>{let r=Fd(t);if(!r)return!1;let o=Ji(r);if(!o){let a=r.blockRange(),s=a&&Qe(a);return s==null?!1:(n&&n(t.tr.lift(a,s).scrollIntoView()),!0)}let i=o.nodeBefore;if(Vd(t,o,n,-1))return!0;if(r.parent.content.size==0&&(Ge(i,"end")||O.isSelectable(i)))for(let a=r.depth;;a--){let s=eo(t.doc,r.before(a),r.after(a),w.empty);if(s&&s.slice.size<s.to-s.from){if(n){let l=t.tr.step(s);l.setSelection(Ge(i,"end")?B.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):O.create(l.doc,o.pos-i.nodeSize)),n(l.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(n&&n(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},Mb=(t,n,e)=>{let r=Fd(t);if(!r)return!1;let o=Ji(r);return o?Hd(t,o,n):!1},zb=(t,n,e)=>{let r=jd(t);if(!r)return!1;let o=Gi(r);return o?Hd(t,o,n):!1};function Hd(t,n,e){let r=n.nodeBefore,o=r,i=n.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let d=o.lastChild;if(!d)return!1;o=d}let a=n.nodeAfter,s=a,l=n.pos+1;for(;!s.isTextblock;l++){if(s.type.spec.isolating)return!1;let d=s.firstChild;if(!d)return!1;s=d}let c=eo(t.doc,i,l,w.empty);if(!c||c.from!=i||c instanceof J&&c.slice.size>=l-i)return!1;if(e){let d=t.tr.step(c);d.setSelection(P.create(d.doc,i)),e(d.scrollIntoView())}return!0}function Ge(t,n,e=!1){for(let r=t;r;r=n=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(e&&r.childCount!=1)return!1}return!1}const Db=(t,n,e)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(r.parentOffset>0)return!1;i=Ji(r)}let a=i&&i.nodeBefore;return!a||!O.isSelectable(a)?!1:(n&&n(t.tr.setSelection(O.create(t.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)};function Ji(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){if(t.index(n)>0)return t.doc.resolve(t.before(n+1));if(t.node(n).type.spec.isolating)break}return null}function jd(t,n){let{$cursor:e}=t.selection;return!e||e.parentOffset<e.parent.content.size?null:e}const Ob=(t,n,e)=>{let r=jd(t);if(!r)return!1;let o=Gi(r);if(!o)return!1;let i=o.nodeAfter;if(Vd(t,o,n,1))return!0;if(r.parent.content.size==0&&(Ge(i,"start")||O.isSelectable(i))){let a=eo(t.doc,r.before(),r.after(),w.empty);if(a&&a.slice.size<a.to-a.from){if(n){let s=t.tr.step(a);s.setSelection(Ge(i,"start")?B.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):O.create(s.doc,s.mapping.map(o.pos))),n(s.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(n&&n(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},Ab=(t,n,e)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(r.parentOffset<r.parent.content.size)return!1;i=Gi(r)}let a=i&&i.nodeAfter;return!a||!O.isSelectable(a)?!1:(n&&n(t.tr.setSelection(O.create(t.doc,i.pos)).scrollIntoView()),!0)};function Gi(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){let e=t.node(n);if(t.index(n)+1<e.childCount)return t.doc.resolve(t.after(n+1));if(e.type.spec.isolating)break}return null}const Lb=(t,n)=>{let e=t.selection,r=e instanceof O,o;if(r){if(e.node.isTextblock||!le(t.doc,e.from))return!1;o=e.from}else if(o=no(t.doc,e.from,-1),o==null)return!1;if(n){let i=t.tr.join(o);r&&i.setSelection(O.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),n(i.scrollIntoView())}return!0},Pb=(t,n)=>{let e=t.selection,r;if(e instanceof O){if(e.node.isTextblock||!le(t.doc,e.to))return!1;r=e.to}else if(r=no(t.doc,e.to,1),r==null)return!1;return n&&n(t.tr.join(r).scrollIntoView()),!0},Rb=(t,n)=>{let{$from:e,$to:r}=t.selection,o=e.blockRange(r),i=o&&Qe(o);return i==null?!1:(n&&n(t.tr.lift(o,i).scrollIntoView()),!0)},Bb=(t,n)=>{let{$head:e,$anchor:r}=t.selection;return!e.parent.type.spec.code||!e.sameParent(r)?!1:(n&&n(t.tr.insertText(`
|
|
20996
|
-
`).scrollIntoView()),!0)};function Xd(t){for(let n=0;n<t.edgeCount;n++){let{type:e}=t.edge(n);if(e.isTextblock&&!e.hasRequiredAttrs())return e}return null}const Nb=(t,n)=>{let{$head:e,$anchor:r}=t.selection;if(!e.parent.type.spec.code||!e.sameParent(r))return!1;let o=e.node(-1),i=e.indexAfter(-1),a=Xd(o.contentMatchAt(i));if(!a||!o.canReplaceWith(i,i,a))return!1;if(n){let s=e.after(),l=t.tr.replaceWith(s,s,a.createAndFill());l.setSelection(B.near(l.doc.resolve(s),1)),n(l.scrollIntoView())}return!0},Fb=(t,n)=>{let e=t.selection,{$from:r,$to:o}=e;if(e instanceof Sn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Xd(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(n){let a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=t.tr.insert(a,i.createAndFill());s.setSelection(P.create(s.doc,a+1)),n(s.scrollIntoView())}return!0},Hb=(t,n)=>{let{$cursor:e}=t.selection;if(!e||e.parent.content.size)return!1;if(e.depth>1&&e.after()!=e.end(-1)){let i=e.before();if(Xe(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let r=e.blockRange(),o=r&&Qe(r);return o==null?!1:(n&&n(t.tr.lift(r,o).scrollIntoView()),!0)},jb=(t,n)=>{let{$from:e,to:r}=t.selection,o,i=e.sharedDepth(r);return i==0?!1:(o=e.before(i),n&&n(t.tr.setSelection(O.create(t.doc,o))),!0)};function Xb(t,n,e){let r=n.nodeBefore,o=n.nodeAfter,i=n.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&n.parent.canReplace(i-1,i)?(e&&e(t.tr.delete(n.pos-r.nodeSize,n.pos).scrollIntoView()),!0):!n.parent.canReplace(i,i+1)||!(o.isTextblock||le(t.doc,n.pos))?!1:(e&&e(t.tr.join(n.pos).scrollIntoView()),!0)}function Vd(t,n,e,r){let o=n.nodeBefore,i=n.nodeAfter,a,s,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&Xb(t,n,e))return!0;let c=!l&&n.parent.canReplace(n.index(),n.index()+1);if(c&&(a=(s=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&s.matchType(a[0]||i.type).validEnd){if(e){let u=n.pos+i.nodeSize,f=y.empty;for(let b=a.length-1;b>=0;b--)f=y.from(a[b].create(null,f));f=y.from(o.copy(f));let m=t.tr.step(new Z(n.pos-1,u,n.pos,u,new w(f,1,0),a.length,!0)),x=m.doc.resolve(u+2*a.length);x.nodeAfter&&x.nodeAfter.type==o.type&&le(m.doc,x.pos)&&m.join(x.pos),e(m.scrollIntoView())}return!0}let d=i.type.spec.isolating||r>0&&l?null:B.findFrom(n,1),h=d&&d.$from.blockRange(d.$to),g=h&&Qe(h);if(g!=null&&g>=n.depth)return e&&e(t.tr.lift(h,g).scrollIntoView()),!0;if(c&&Ge(i,"start",!0)&&Ge(o,"end")){let u=o,f=[];for(;f.push(u),!u.isTextblock;)u=u.lastChild;let m=i,x=1;for(;!m.isTextblock;m=m.firstChild)x++;if(u.canReplace(u.childCount,u.childCount,m.content)){if(e){let b=y.empty;for(let z=f.length-1;z>=0;z--)b=y.from(f[z].copy(b));let _=t.tr.step(new Z(n.pos-f.length,n.pos+i.nodeSize,n.pos+x,n.pos+i.nodeSize-x,new w(b,f.length,0),0,!0));e(_.scrollIntoView())}return!0}}return!1}function Wd(t){return function(n,e){let r=n.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(e&&e(n.tr.setSelection(P.create(n.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const Vb=Wd(-1),Wb=Wd(1);function Ub(t,n=null){return function(e,r){let{$from:o,$to:i}=e.selection,a=o.blockRange(i),s=a&&Bi(a,t,n);return s?(r&&r(e.tr.wrap(a,s).scrollIntoView()),!0):!1}}function Ms(t,n=null){return function(e,r){let o=!1;for(let i=0;i<e.selection.ranges.length&&!o;i++){let{$from:{pos:a},$to:{pos:s}}=e.selection.ranges[i];e.doc.nodesBetween(a,s,(l,c)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,n)))if(l.type==t)o=!0;else{let d=e.doc.resolve(c),h=d.index();o=d.parent.canReplaceWith(h,h+1,t)}})}if(!o)return!1;if(r){let i=e.tr;for(let a=0;a<e.selection.ranges.length;a++){let{$from:{pos:s},$to:{pos:l}}=e.selection.ranges[a];i.setBlockType(s,l,t,n)}r(i.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function qb(t,n=null){return function(e,r){let{$from:o,$to:i}=e.selection,a=o.blockRange(i);if(!a)return!1;let s=r?e.tr:null;return Kb(s,a,t,n)?(r&&r(s.scrollIntoView()),!0):!1}}function Kb(t,n,e,r=null){let o=!1,i=n,a=n.$from.doc;if(n.depth>=2&&n.$from.node(n.depth-1).type.compatibleContent(e)&&n.startIndex==0){if(n.$from.index(n.depth-1)==0)return!1;let l=a.resolve(n.start-2);i=new hr(l,l,n.depth),n.endIndex<n.parent.childCount&&(n=new hr(n.$from,a.resolve(n.$to.end(n.depth)),n.depth)),o=!0}let s=Bi(i,e,r,n);return s?(t&&Jb(t,n,s,o,e),!0):!1}function Jb(t,n,e,r,o){let i=y.empty;for(let d=e.length-1;d>=0;d--)i=y.from(e[d].type.create(e[d].attrs,i));t.step(new Z(n.start-(r?2:0),n.end,n.start,n.end,new w(i,0,0),e.length,!0));let a=0;for(let d=0;d<e.length;d++)e[d].type==o&&(a=d+1);let s=e.length-a,l=n.start+e.length-(r?2:0),c=n.parent;for(let d=n.startIndex,h=n.endIndex,g=!0;d<h;d++,g=!1)!g&&Xe(t.doc,l,s)&&(t.split(l,s),l+=2*s),l+=c.child(d).nodeSize;return t}function Gb(t){return function(n,e){let{$from:r,$to:o}=n.selection,i=r.blockRange(o,a=>a.childCount>0&&a.firstChild.type==t);return i?e?r.node(i.depth-1).type==t?Yb(n,e,t,i):Qb(n,e,i):!0:!1}}function Yb(t,n,e,r){let o=t.tr,i=r.end,a=r.$to.end(r.depth);i<a&&(o.step(new Z(i-1,a,i,a,new w(y.from(e.create(null,r.parent.copy())),1,0),1,!0)),r=new hr(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const s=Qe(r);if(s==null)return!1;o.lift(r,s);let l=o.doc.resolve(o.mapping.map(i,-1)-1);return le(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),n(o.scrollIntoView()),!0}function Qb(t,n,e){let r=t.tr,o=e.parent;for(let u=e.end,f=e.endIndex-1,m=e.startIndex;f>m;f--)u-=o.child(f).nodeSize,r.delete(u-1,u+1);let i=r.doc.resolve(e.start),a=i.nodeAfter;if(r.mapping.map(e.end)!=e.start+i.nodeAfter.nodeSize)return!1;let s=e.startIndex==0,l=e.endIndex==o.childCount,c=i.node(-1),d=i.index(-1);if(!c.canReplace(d+(s?0:1),d+1,a.content.append(l?y.empty:y.from(o))))return!1;let h=i.pos,g=h+a.nodeSize;return r.step(new Z(h-(s?1:0),g+(l?1:0),h+1,g-1,new w((s?y.empty:y.from(o.copy(y.empty))).append(l?y.empty:y.from(o.copy(y.empty))),s?0:1,l?0:1),s?0:1)),n(r.scrollIntoView()),!0}function Zb(t){return function(n,e){let{$from:r,$to:o}=n.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let a=i.startIndex;if(a==0)return!1;let s=i.parent,l=s.child(a-1);if(l.type!=t)return!1;if(e){let c=l.lastChild&&l.lastChild.type==s.type,d=y.from(c?t.create():null),h=new w(y.from(t.create(null,y.from(s.type.create(null,d)))),c?3:1,0),g=i.start,u=i.end;e(n.tr.step(new Z(g-(c?3:1),u,g,u,h,1,!0)).scrollIntoView())}return!0}}function ao(t){const{state:n,transaction:e}=t;let{selection:r}=e,{doc:o}=e,{storedMarks:i}=e;return{...n,apply:n.apply.bind(n),applyTransaction:n.applyTransaction.bind(n),plugins:n.plugins,schema:n.schema,reconfigure:n.reconfigure.bind(n),toJSON:n.toJSON.bind(n),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=e.selection,o=e.doc,i=e.storedMarks,e}}}class so{constructor(n){this.editor=n.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=n.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:n,editor:e,state:r}=this,{view:o}=e,{tr:i}=r,a=this.buildProps(i);return Object.fromEntries(Object.entries(n).map(([s,l])=>[s,(...d)=>{const h=l(...d)(a);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,e=!0){const{rawCommands:r,editor:o,state:i}=this,{view:a}=o,s=[],l=!!n,c=n||i.tr,d=()=>(!l&&e&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),s.every(g=>g===!0)),h={...Object.fromEntries(Object.entries(r).map(([g,u])=>[g,(...m)=>{const x=this.buildProps(c,e),b=u(...m)(x);return s.push(b),h}])),run:d};return h}createCan(n){const{rawCommands:e,state:r}=this,o=!1,i=n||r.tr,a=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...d)=>c(...d)({...a,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(n,e=!0){const{rawCommands:r,editor:o,state:i}=this,{view:a}=o,s={tr:n,editor:o,view:a,state:ao({state:i,transaction:n}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(n,e),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...d)=>c(...d)(s)]))}};return s}}class n2{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const r=this.callbacks[n];return r&&r.forEach(o=>o.apply(this,e)),this}off(n,e){const r=this.callbacks[n];return r&&(e?this.callbacks[n]=r.filter(o=>o!==e):delete this.callbacks[n]),this}once(n,e){const r=(...o)=>{this.off(n,r),e.apply(this,o)};return this.on(n,r)}removeAllListeners(){this.callbacks={}}}function S(t,n,e){return t.config[n]===void 0&&t.parent?S(t.parent,n,e):typeof t.config[n]=="function"?t.config[n].bind({...e,parent:t.parent?S(t.parent,n,e):null}):t.config[n]}function lo(t){const n=t.filter(o=>o.type==="extension"),e=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:n,nodeExtensions:e,markExtensions:r}}function Ud(t){const n=[],{nodeExtensions:e,markExtensions:r}=lo(t),o=[...e,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage,extensions:o},l=S(a,"addGlobalAttributes",s);if(!l)return;l().forEach(d=>{d.types.forEach(h=>{Object.entries(d.attributes).forEach(([g,u])=>{n.push({type:h,name:g,attribute:{...i,...u}})})})})}),o.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},l=S(a,"addAttributes",s);if(!l)return;const c=l();Object.entries(c).forEach(([d,h])=>{const g={...i,...h};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,n.push({type:a.name,name:d,attribute:g})})}),n}function en(t,n){if(typeof t=="string"){if(!n.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return n.nodes[t]}return t}function tn(...t){return t.filter(n=>!!n).reduce((n,e)=>{const r={...n};return Object.entries(e).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const s=i?String(i).split(" "):[],l=r[o]?r[o].split(" "):[],c=s.filter(d=>!l.includes(d));r[o]=[...l,...c].join(" ")}else if(o==="style"){const s=i?i.split(";").map(d=>d.trim()).filter(Boolean):[],l=r[o]?r[o].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[h,g]=d.split(":").map(u=>u.trim());c.set(h,g)}),s.forEach(d=>{const[h,g]=d.split(":").map(u=>u.trim());c.set(h,g)}),r[o]=Array.from(c.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[o]=i}),r},{})}function mi(t,n){return n.filter(e=>e.type===t.type.name).filter(e=>e.attribute.rendered).map(e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]}).reduce((e,r)=>tn(e,r),{})}function qd(t){return typeof t=="function"}function N(t,n=void 0,...e){return qd(t)?n?t.bind(n)(...e):t(...e):t}function e2(t={}){return Object.keys(t).length===0&&t.constructor===Object}function t2(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function zs(t,n){return"style"in t?t:{...t,getAttrs:e=>{const r=t.getAttrs?t.getAttrs(e):t.attrs;if(r===!1)return!1;const o=n.reduce((i,a)=>{const s=a.attribute.parseHTML?a.attribute.parseHTML(e):t2(e.getAttribute(a.name));return s==null?i:{...i,[a.name]:s}},{});return{...r,...o}}}}function Ds(t){return Object.fromEntries(Object.entries(t).filter(([n,e])=>n==="attrs"&&e2(e)?!1:e!=null))}function r2(t,n){var e;const r=Ud(t),{nodeExtensions:o,markExtensions:i}=lo(t),a=(e=o.find(c=>S(c,"topNode")))===null||e===void 0?void 0:e.name,s=Object.fromEntries(o.map(c=>{const d=r.filter(b=>b.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:n},g=t.reduce((b,_)=>{const z=S(_,"extendNodeSchema",h);return{...b,...z?z(c):{}}},{}),u=Ds({...g,content:N(S(c,"content",h)),marks:N(S(c,"marks",h)),group:N(S(c,"group",h)),inline:N(S(c,"inline",h)),atom:N(S(c,"atom",h)),selectable:N(S(c,"selectable",h)),draggable:N(S(c,"draggable",h)),code:N(S(c,"code",h)),whitespace:N(S(c,"whitespace",h)),linebreakReplacement:N(S(c,"linebreakReplacement",h)),defining:N(S(c,"defining",h)),isolating:N(S(c,"isolating",h)),attrs:Object.fromEntries(d.map(b=>{var _;return[b.name,{default:(_=b==null?void 0:b.attribute)===null||_===void 0?void 0:_.default}]}))}),f=N(S(c,"parseHTML",h));f&&(u.parseDOM=f.map(b=>zs(b,d)));const m=S(c,"renderHTML",h);m&&(u.toDOM=b=>m({node:b,HTMLAttributes:mi(b,d)}));const x=S(c,"renderText",h);return x&&(u.toText=x),[c.name,u]})),l=Object.fromEntries(i.map(c=>{const d=r.filter(x=>x.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:n},g=t.reduce((x,b)=>{const _=S(b,"extendMarkSchema",h);return{...x,..._?_(c):{}}},{}),u=Ds({...g,inclusive:N(S(c,"inclusive",h)),excludes:N(S(c,"excludes",h)),group:N(S(c,"group",h)),spanning:N(S(c,"spanning",h)),code:N(S(c,"code",h)),attrs:Object.fromEntries(d.map(x=>{var b;return[x.name,{default:(b=x==null?void 0:x.attribute)===null||b===void 0?void 0:b.default}]}))}),f=N(S(c,"parseHTML",h));f&&(u.parseDOM=f.map(x=>zs(x,d)));const m=S(c,"renderHTML",h);return m&&(u.toDOM=x=>m({mark:x,HTMLAttributes:mi(x,d)})),[c.name,u]}));return new Nc({topNode:a,nodes:s,marks:l})}function Oo(t,n){return n.nodes[t]||n.marks[t]||null}function Os(t,n){return Array.isArray(n)?n.some(e=>(typeof e=="string"?e:e.name)===t.name):n}function Yi(t,n){const e=Me.fromSchema(n).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(e),o.innerHTML}const o2=(t,n=500)=>{let e="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-n),r,(o,i,a,s)=>{var l,c;const d=((c=(l=o.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:o,pos:i,parent:a,index:s}))||o.textContent||"%leaf%";e+=o.isAtom&&!o.isText?d:d.slice(0,Math.max(0,r-i))}),e};function Qi(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class co{constructor(n){this.find=n.find,this.handler=n.handler}}const i2=(t,n)=>{if(Qi(n))return n.exec(t);const e=n(t);if(!e)return null;const r=[e.text];return r.index=e.index,r.input=t,r.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(e.replaceWith)),r};function Xt(t){var n;const{editor:e,from:r,to:o,text:i,rules:a,plugin:s}=t,{view:l}=e;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((n=c.nodeBefore||c.nodeAfter)===null||n===void 0)&&n.marks.find(g=>g.type.spec.code))return!1;let d=!1;const h=o2(c)+i;return a.forEach(g=>{if(d)return;const u=i2(h,g.find);if(!u)return;const f=l.state.tr,m=ao({state:l.state,transaction:f}),x={from:r-(u[0].length-i.length),to:o},{commands:b,chain:_,can:z}=new so({editor:e,state:m});g.handler({state:m,range:x,match:u,commands:b,chain:_,can:z})===null||!f.steps.length||(f.setMeta(s,{transform:f,from:r,to:o,text:i}),l.dispatch(f),d=!0)}),d}function a2(t){const{editor:n,rules:e}=t,r=new Q({state:{init(){return null},apply(o,i,a){const s=o.getMeta(r);if(s)return s;const l=o.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=Yi(y.from(d),a.schema);const{from:h}=l,g=h+d.length;Xt({editor:n,from:h,to:g,text:d,rules:e,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,a,s){return Xt({editor:n,from:i,to:a,text:s,rules:e,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&Xt({editor:n,from:i.pos,to:i.pos,text:"",rules:e,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:a}=o.state.selection;return a?Xt({editor:n,from:a.pos,to:a.pos,text:`
|
|
20997
|
-
`,rules:e,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
20998
|
-
|
|
20999
|
-
`,textSerializers:a={}}=e||{};let s="";return t.nodesBetween(r,o,(l,c,d,h)=>{var g;l.isBlock&&c>r&&(s+=i);const u=a==null?void 0:a[l.type.name];if(u)return d&&(s+=u({node:l,pos:c,parent:d,index:h,range:n})),!1;l.isText&&(s+=(g=l==null?void 0:l.text)===null||g===void 0?void 0:g.slice(Math.max(r,c)-c,o-c))}),s}function Jd(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,n])=>n.spec.toText).map(([n,e])=>[n,e.spec.toText]))}const f2=ln.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Q({key:new un("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:n,schema:e}=t,{doc:r,selection:o}=n,{ranges:i}=o,a=Math.min(...i.map(d=>d.$from.pos)),s=Math.max(...i.map(d=>d.$to.pos)),l=Jd(e);return Kd(r,{from:a,to:s},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),m2=()=>({editor:t,view:n})=>(requestAnimationFrame(()=>{var e;t.isDestroyed||(n.dom.blur(),(e=window==null?void 0:window.getSelection())===null||e===void 0||e.removeAllRanges())}),!0),x2=(t=!1)=>({commands:n})=>n.setContent("",t),b2=()=>({state:t,tr:n,dispatch:e})=>{const{selection:r}=n,{ranges:o}=r;return e&&o.forEach(({$from:i,$to:a})=>{t.doc.nodesBetween(i.pos,a.pos,(s,l)=>{if(s.type.isText)return;const{doc:c,mapping:d}=n,h=c.resolve(d.map(l)),g=c.resolve(d.map(l+s.nodeSize)),u=h.blockRange(g);if(!u)return;const f=Qe(u);if(s.type.isTextblock){const{defaultType:m}=h.parent.contentMatchAt(h.index());n.setNodeMarkup(u.start,m)}(f||f===0)&&n.lift(u,f)})}),!0},y2=t=>n=>t(n),v2=()=>({state:t,dispatch:n})=>Fb(t,n),k2=(t,n)=>({editor:e,tr:r})=>{const{state:o}=e,i=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const a=r.mapping.map(n);return r.insert(a,i.content),r.setSelection(new P(r.doc.resolve(Math.max(a-1,0)))),!0},w2=()=>({tr:t,dispatch:n})=>{const{selection:e}=t,r=e.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(n){const s=o.before(i),l=o.after(i);t.delete(s,l).scrollIntoView()}return!0}return!1},_2=t=>({tr:n,state:e,dispatch:r})=>{const o=en(t,e.schema),i=n.selection.$anchor;for(let a=i.depth;a>0;a-=1)if(i.node(a).type===o){if(r){const l=i.before(a),c=i.after(a);n.delete(l,c).scrollIntoView()}return!0}return!1},C2=t=>({tr:n,dispatch:e})=>{const{from:r,to:o}=t;return e&&n.delete(r,o),!0},S2=()=>({state:t,dispatch:n})=>Tb(t,n),E2=()=>({commands:t})=>t.keyboardShortcut("Enter"),I2=()=>({state:t,dispatch:n})=>Nb(t,n);function vr(t,n,e={strict:!0}){const r=Object.keys(n);return r.length?r.every(o=>e.strict?n[o]===t[o]:Qi(n[o])?n[o].test(t[o]):n[o]===t[o]):!0}function Gd(t,n,e={}){return t.find(r=>r.type===n&&vr(Object.fromEntries(Object.keys(e).map(o=>[o,r.attrs[o]])),e))}function As(t,n,e={}){return!!Gd(t,n,e)}function Zi(t,n,e){var r;if(!t||!n)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(d=>d.type===n))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(d=>d.type===n)||(e=e||((r=o.node.marks[0])===null||r===void 0?void 0:r.attrs),!Gd([...o.node.marks],n,e)))return;let a=o.index,s=t.start()+o.offset,l=a+1,c=s+o.node.nodeSize;for(;a>0&&As([...t.parent.child(a-1).marks],n,e);)a-=1,s-=t.parent.child(a).nodeSize;for(;l<t.parent.childCount&&As([...t.parent.child(l).marks],n,e);)c+=t.parent.child(l).nodeSize,l+=1;return{from:s,to:c}}function ce(t,n){if(typeof t=="string"){if(!n.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return n.marks[t]}return t}const T2=(t,n={})=>({tr:e,state:r,dispatch:o})=>{const i=ce(t,r.schema),{doc:a,selection:s}=e,{$from:l,from:c,to:d}=s;if(o){const h=Zi(l,i,n);if(h&&h.from<=c&&h.to>=d){const g=P.create(a,h.from,h.to);e.setSelection(g)}}return!0},$2=t=>n=>{const e=typeof t=="function"?t(n):t;for(let r=0;r<e.length;r+=1)if(e[r](n))return!0;return!1};function Yd(t){return t instanceof P}function xe(t=0,n=0,e=0){return Math.min(Math.max(t,n),e)}function Qd(t,n=null){if(!n)return null;const e=B.atStart(t),r=B.atEnd(t);if(n==="start"||n===!0)return e;if(n==="end")return r;const o=e.from,i=r.to;return n==="all"?P.create(t,xe(0,o,i),xe(t.content.size,o,i)):P.create(t,xe(n,o,i),xe(n,o,i))}function Ls(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function kr(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function M2(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const z2=(t=null,n={})=>({editor:e,view:r,tr:o,dispatch:i})=>{n={scrollIntoView:!0,...n};const a=()=>{(kr()||Ls())&&r.dom.focus(),requestAnimationFrame(()=>{e.isDestroyed||(r.focus(),M2()&&!kr()&&!Ls()&&r.dom.focus({preventScroll:!0}))})};if(r.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!Yd(e.state.selection))return a(),!0;const s=Qd(o.doc,t)||e.state.selection,l=e.state.selection.eq(s);return i&&(l||o.setSelection(s),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0},D2=(t,n)=>e=>t.every((r,o)=>n(r,{...e,index:o})),O2=(t,n)=>({tr:e,commands:r})=>r.insertContentAt({from:e.selection.from,to:e.selection.to},t,n),Zd=t=>{const n=t.childNodes;for(let e=n.length-1;e>=0;e-=1){const r=n[e];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&Zd(r)}return t};function Ut(t){const n=`<body>${t}</body>`,e=new window.DOMParser().parseFromString(n,"text/html").body;return Zd(e)}function Tt(t,n,e){if(t instanceof ee||t instanceof y)return t;e={slice:!0,parseOptions:{},...e};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return y.fromArray(t.map(s=>n.nodeFromJSON(s)));const a=n.nodeFromJSON(t);return e.errorOnInvalidContent&&a.check(),a}catch(i){if(e.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),Tt("",n,e)}if(o){if(e.errorOnInvalidContent){let a=!1,s="";const l=new Nc({topNode:n.spec.topNode,marks:n.spec.marks,nodes:n.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(a=!0,s=typeof c=="string"?c:c.outerHTML,null)}]}})});if(e.slice?te.fromSchema(l).parseSlice(Ut(t),e.parseOptions):te.fromSchema(l).parse(Ut(t),e.parseOptions),e.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${s}`)})}const i=te.fromSchema(n);return e.slice?i.parseSlice(Ut(t),e.parseOptions).content:i.parse(Ut(t),e.parseOptions)}return Tt("",n,e)}function A2(t,n,e){const r=t.steps.length-1;if(r<n)return;const o=t.steps[r];if(!(o instanceof J||o instanceof Z))return;const i=t.mapping.maps[r];let a=0;i.forEach((s,l,c,d)=>{a===0&&(a=d)}),t.setSelection(B.near(t.doc.resolve(a),e))}const L2=t=>!("type"in t),P2=(t,n,e)=>({tr:r,dispatch:o,editor:i})=>{var a;if(o){e={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...e};let s;const l=x=>{i.emit("contentError",{editor:i,error:x,disableCollaboration:()=>{i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...e.parseOptions};if(!e.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{Tt(n,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(x){l(x)}try{s=Tt(n,i.schema,{parseOptions:c,errorOnInvalidContent:(a=e.errorOnInvalidContent)!==null&&a!==void 0?a:i.options.enableContentCheck})}catch(x){return l(x),!1}let{from:d,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},g=!0,u=!0;if((L2(s)?s:[s]).forEach(x=>{x.check(),g=g?x.isText&&x.marks.length===0:!1,u=u?x.isBlock:!1}),d===h&&u){const{parent:x}=r.doc.resolve(d);x.isTextblock&&!x.type.spec.code&&!x.childCount&&(d-=1,h+=1)}let m;if(g){if(Array.isArray(n))m=n.map(x=>x.text||"").join("");else if(n instanceof y){let x="";n.forEach(b=>{b.text&&(x+=b.text)}),m=x}else typeof n=="object"&&n&&n.text?m=n.text:m=n;r.insertText(m,d,h)}else m=s,r.replaceWith(d,h,m);e.updateSelection&&A2(r,r.steps.length-1,-1),e.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:m}),e.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:m})}return!0},R2=()=>({state:t,dispatch:n})=>Lb(t,n),B2=()=>({state:t,dispatch:n})=>Pb(t,n),N2=()=>({state:t,dispatch:n})=>$b(t,n),F2=()=>({state:t,dispatch:n})=>Ob(t,n),H2=()=>({state:t,dispatch:n,tr:e})=>{try{const r=no(t.doc,t.selection.$from.pos,-1);return r==null?!1:(e.join(r,2),n&&n(e),!0)}catch{return!1}},j2=()=>({state:t,dispatch:n,tr:e})=>{try{const r=no(t.doc,t.selection.$from.pos,1);return r==null?!1:(e.join(r,2),n&&n(e),!0)}catch{return!1}},X2=()=>({state:t,dispatch:n})=>Mb(t,n),V2=()=>({state:t,dispatch:n})=>zb(t,n);function np(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function W2(t){const n=t.split(/-(?!$)/);let e=n[n.length-1];e==="Space"&&(e=" ");let r,o,i,a;for(let s=0;s<n.length-1;s+=1){const l=n[s];if(/^(cmd|meta|m)$/i.test(l))a=!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))i=!0;else if(/^mod$/i.test(l))kr()||np()?a=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(e=`Alt-${e}`),o&&(e=`Ctrl-${e}`),a&&(e=`Meta-${e}`),i&&(e=`Shift-${e}`),e}const U2=t=>({editor:n,view:e,tr:r,dispatch:o})=>{const i=W2(t).split(/-(?!$)/),a=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),s=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=n.captureTransaction(()=>{e.someProp("handleKeyDown",c=>c(e,s))});return l==null||l.steps.forEach(c=>{const d=c.map(r.mapping);d&&o&&r.maybeStep(d)}),!0};function $t(t,n,e={}){const{from:r,to:o,empty:i}=t.selection,a=n?en(n,t.schema):null,s=[];t.doc.nodesBetween(r,o,(h,g)=>{if(h.isText)return;const u=Math.max(r,g),f=Math.min(o,g+h.nodeSize);s.push({node:h,from:u,to:f})});const l=o-r,c=s.filter(h=>a?a.name===h.node.type.name:!0).filter(h=>vr(h.node.attrs,e,{strict:!1}));return i?!!c.length:c.reduce((h,g)=>h+g.to-g.from,0)>=l}const q2=(t,n={})=>({state:e,dispatch:r})=>{const o=en(t,e.schema);return $t(e,o,n)?Rb(e,r):!1},K2=()=>({state:t,dispatch:n})=>Hb(t,n),J2=t=>({state:n,dispatch:e})=>{const r=en(t,n.schema);return Gb(r)(n,e)},G2=()=>({state:t,dispatch:n})=>Bb(t,n);function ho(t,n){return n.nodes[t]?"node":n.marks[t]?"mark":null}function Ps(t,n){const e=typeof n=="string"?[n]:n;return Object.keys(t).reduce((r,o)=>(e.includes(o)||(r[o]=t[o]),r),{})}const Y2=(t,n)=>({tr:e,state:r,dispatch:o})=>{let i=null,a=null;const s=ho(typeof t=="string"?t:t.name,r.schema);return s?(s==="node"&&(i=en(t,r.schema)),s==="mark"&&(a=ce(t,r.schema)),o&&e.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,d)=>{i&&i===c.type&&e.setNodeMarkup(d,void 0,Ps(c.attrs,n)),a&&c.marks.length&&c.marks.forEach(h=>{a===h.type&&e.addMark(d,d+c.nodeSize,a.create(Ps(h.attrs,n)))})})}),!0):!1},Q2=()=>({tr:t,dispatch:n})=>(n&&t.scrollIntoView(),!0),Z2=()=>({tr:t,dispatch:n})=>{if(n){const e=new Sn(t.doc);t.setSelection(e)}return!0},n1=()=>({state:t,dispatch:n})=>Db(t,n),e1=()=>({state:t,dispatch:n})=>Ab(t,n),t1=()=>({state:t,dispatch:n})=>jb(t,n),r1=()=>({state:t,dispatch:n})=>Wb(t,n),o1=()=>({state:t,dispatch:n})=>Vb(t,n);function xi(t,n,e={},r={}){return Tt(t,n,{slice:!1,parseOptions:e,errorOnInvalidContent:r.errorOnInvalidContent})}const i1=(t,n=!1,e={},r={})=>({editor:o,tr:i,dispatch:a,commands:s})=>{var l,c;const{doc:d}=i;if(e.preserveWhitespace!=="full"){const h=xi(t,o.schema,e,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:o.options.enableContentCheck});return a&&i.replaceWith(0,d.content.size,h).setMeta("preventUpdate",!n),!0}return a&&i.setMeta("preventUpdate",!n),s.insertContentAt({from:0,to:d.content.size},t,{parseOptions:e,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function ep(t,n){const e=ce(n,t.schema),{from:r,to:o,empty:i}=t.selection,a=[];i?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{a.push(...l.marks)});const s=a.find(l=>l.type.name===e.name);return s?{...s.attrs}:{}}function a1(t,n){const e=new ed(t);return n.forEach(r=>{r.steps.forEach(o=>{e.step(o)})}),e}function s1(t){for(let n=0;n<t.edgeCount;n+=1){const{type:e}=t.edge(n);if(e.isTextblock&&!e.hasRequiredAttrs())return e}return null}function l1(t,n,e){const r=[];return t.nodesBetween(n.from,n.to,(o,i)=>{e(o)&&r.push({node:o,pos:i})}),r}function c1(t,n){for(let e=t.depth;e>0;e-=1){const r=t.node(e);if(n(r))return{pos:e>0?t.before(e):0,start:t.start(e),depth:e,node:r}}}function na(t){return n=>c1(n.$from,t)}function d1(t,n){const e={from:0,to:t.content.size};return Kd(t,e,n)}function p1(t,n){const e=en(n,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,s=>{i.push(s)});const a=i.reverse().find(s=>s.type.name===e.name);return a?{...a.attrs}:{}}function tp(t,n){const e=ho(typeof n=="string"?n:n.name,t.schema);return e==="node"?p1(t,n):e==="mark"?ep(t,n):{}}function h1(t,n=JSON.stringify){const e={};return t.filter(r=>{const o=n(r);return Object.prototype.hasOwnProperty.call(e,o)?!1:e[o]=!0})}function g1(t){const n=h1(t);return n.length===1?n:n.filter((e,r)=>!n.filter((i,a)=>a!==r).some(i=>e.oldRange.from>=i.oldRange.from&&e.oldRange.to<=i.oldRange.to&&e.newRange.from>=i.newRange.from&&e.newRange.to<=i.newRange.to))}function u1(t){const{mapping:n,steps:e}=t,r=[];return n.maps.forEach((o,i)=>{const a=[];if(o.ranges.length)o.forEach((s,l)=>{a.push({from:s,to:l})});else{const{from:s,to:l}=e[i];if(s===void 0||l===void 0)return;a.push({from:s,to:l})}a.forEach(({from:s,to:l})=>{const c=n.slice(i).map(s,-1),d=n.slice(i).map(l),h=n.invert().map(c,-1),g=n.invert().map(d);r.push({oldRange:{from:h,to:g},newRange:{from:c,to:d}})})}),g1(r)}function ea(t,n,e){const r=[];return t===n?e.resolve(t).marks().forEach(o=>{const i=e.resolve(t),a=Zi(i,o.type);a&&r.push({mark:o,...a})}):e.nodesBetween(t,n,(o,i)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(a=>({from:i,to:i+o.nodeSize,mark:a})))}),r}function er(t,n,e){return Object.fromEntries(Object.entries(e).filter(([r])=>{const o=t.find(i=>i.type===n&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function bi(t,n,e={}){const{empty:r,ranges:o}=t.selection,i=n?ce(n,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>vr(h.attrs,e,{strict:!1}));let a=0;const s=[];if(o.forEach(({$from:h,$to:g})=>{const u=h.pos,f=g.pos;t.doc.nodesBetween(u,f,(m,x)=>{if(!m.isText&&!m.marks.length)return;const b=Math.max(u,x),_=Math.min(f,x+m.nodeSize),z=_-b;a+=z,s.push(...m.marks.map(A=>({mark:A,from:b,to:_})))})}),a===0)return!1;const l=s.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>vr(h.mark.attrs,e,{strict:!1})).reduce((h,g)=>h+g.to-g.from,0),c=s.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,g)=>h+g.to-g.from,0);return(l>0?l+c:l)>=a}function f1(t,n,e={}){if(!n)return $t(t,null,e)||bi(t,null,e);const r=ho(n,t.schema);return r==="node"?$t(t,n,e):r==="mark"?bi(t,n,e):!1}function Rs(t,n){const{nodeExtensions:e}=lo(n),r=e.find(a=>a.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=N(S(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function go(t,{checkChildren:n=!0,ignoreWhitespace:e=!1}={}){var r;if(e){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(n){let o=!0;return t.content.forEach(i=>{o!==!1&&(go(i,{ignoreWhitespace:e,checkChildren:n})||(o=!1))}),o}return!1}function m1(t){return t instanceof O}function x1(t,n,e){var r;const{selection:o}=n;let i=null;if(Yd(o)&&(i=o.$cursor),i){const s=(r=t.storedMarks)!==null&&r!==void 0?r:i.marks();return!!e.isInSet(s)||!s.some(l=>l.type.excludes(e))}const{ranges:a}=o;return a.some(({$from:s,$to:l})=>{let c=s.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(e):!1;return t.doc.nodesBetween(s.pos,l.pos,(d,h,g)=>{if(c)return!1;if(d.isInline){const u=!g||g.type.allowsMarkType(e),f=!!e.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(e));c=u&&f}return!c}),c})}const b1=(t,n={})=>({tr:e,state:r,dispatch:o})=>{const{selection:i}=e,{empty:a,ranges:s}=i,l=ce(t,r.schema);if(o)if(a){const c=ep(r,l);e.addStoredMark(l.create({...c,...n}))}else s.forEach(c=>{const d=c.$from.pos,h=c.$to.pos;r.doc.nodesBetween(d,h,(g,u)=>{const f=Math.max(u,d),m=Math.min(u+g.nodeSize,h);g.marks.find(b=>b.type===l)?g.marks.forEach(b=>{l===b.type&&e.addMark(f,m,l.create({...b.attrs,...n}))}):e.addMark(f,m,l.create(n))})});return x1(r,e,l)},y1=(t,n)=>({tr:e})=>(e.setMeta(t,n),!0),v1=(t,n={})=>({state:e,dispatch:r,chain:o})=>{const i=en(t,e.schema);let a;return e.selection.$anchor.sameParent(e.selection.$head)&&(a=e.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:s})=>Ms(i,{...a,...n})(e)?!0:s.clearNodes()).command(({state:s})=>Ms(i,{...a,...n})(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},k1=t=>({tr:n,dispatch:e})=>{if(e){const{doc:r}=n,o=xe(t,0,r.content.size),i=O.create(r,o);n.setSelection(i)}return!0},w1=t=>({tr:n,dispatch:e})=>{if(e){const{doc:r}=n,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,a=P.atStart(r).from,s=P.atEnd(r).to,l=xe(o,a,s),c=xe(i,a,s),d=P.create(r,l,c);n.setSelection(d)}return!0},_1=t=>({state:n,dispatch:e})=>{const r=en(t,n.schema);return Zb(r)(n,e)};function Bs(t,n){const e=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(e){const r=e.filter(o=>n==null?void 0:n.includes(o.type.name));t.tr.ensureMarks(r)}}const C1=({keepMarks:t=!0}={})=>({tr:n,state:e,dispatch:r,editor:o})=>{const{selection:i,doc:a}=n,{$from:s,$to:l}=i,c=o.extensionManager.attributes,d=er(c,s.node().type.name,s.node().attrs);if(i instanceof O&&i.node.isBlock)return!s.parentOffset||!Xe(a,s.pos)?!1:(r&&(t&&Bs(e,o.extensionManager.splittableMarks),n.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,g=s.depth===0?void 0:s1(s.node(-1).contentMatchAt(s.indexAfter(-1)));let u=h&&g?[{type:g,attrs:d}]:void 0,f=Xe(n.doc,n.mapping.map(s.pos),1,u);if(!u&&!f&&Xe(n.doc,n.mapping.map(s.pos),1,g?[{type:g}]:void 0)&&(f=!0,u=g?[{type:g,attrs:d}]:void 0),r){if(f&&(i instanceof P&&n.deleteSelection(),n.split(n.mapping.map(s.pos),1,u),g&&!h&&!s.parentOffset&&s.parent.type!==g)){const m=n.mapping.map(s.before()),x=n.doc.resolve(m);s.node(-1).canReplaceWith(x.index(),x.index()+1,g)&&n.setNodeMarkup(n.mapping.map(s.before()),g)}t&&Bs(e,o.extensionManager.splittableMarks),n.scrollIntoView()}return f},S1=(t,n={})=>({tr:e,state:r,dispatch:o,editor:i})=>{var a;const s=en(t,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const h=l.node(-1);if(h.type!==s)return!1;const g=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let b=y.empty;const _=l.index(-1)?1:l.index(-2)?2:3;for(let D=l.depth-_;D>=l.depth-3;D-=1)b=y.from(l.node(D).copy(b));const z=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,A={...er(g,l.node().type.name,l.node().attrs),...n},L=((a=s.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(A))||void 0;b=b.append(y.from(s.createAndFill(null,L)||void 0));const H=l.before(l.depth-(_-1));e.replace(H,l.after(-z),new w(b,4-_,0));let C=-1;e.doc.nodesBetween(H,e.doc.content.size,(D,F)=>{if(C>-1)return!1;D.isTextblock&&D.content.size===0&&(C=F+1)}),C>-1&&e.setSelection(P.near(e.doc.resolve(C))),e.scrollIntoView()}return!0}const u=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...er(g,h.type.name,h.attrs),...n},m={...er(g,l.node().type.name,l.node().attrs),...n};e.delete(l.pos,c.pos);const x=u?[{type:s,attrs:f},{type:u,attrs:m}]:[{type:s,attrs:f}];if(!Xe(e.doc,l.pos,2))return!1;if(o){const{selection:b,storedMarks:_}=r,{splittableMarks:z}=i.extensionManager,A=_||b.$to.parentOffset&&b.$from.marks();if(e.split(l.pos,2,x).scrollIntoView(),!A||!o)return!0;const L=A.filter(H=>z.includes(H.type.name));e.ensureMarks(L)}return!0},Ao=(t,n)=>{const e=na(a=>a.type===n)(t.selection);if(!e)return!0;const r=t.doc.resolve(Math.max(0,e.pos-1)).before(e.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return e.node.type===(o==null?void 0:o.type)&&le(t.doc,e.pos)&&t.join(e.pos),!0},Lo=(t,n)=>{const e=na(a=>a.type===n)(t.selection);if(!e)return!0;const r=t.doc.resolve(e.start).after(e.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return e.node.type===(o==null?void 0:o.type)&&le(t.doc,r)&&t.join(r),!0},E1=(t,n,e,r={})=>({editor:o,tr:i,state:a,dispatch:s,chain:l,commands:c,can:d})=>{const{extensions:h,splittableMarks:g}=o.extensionManager,u=en(t,a.schema),f=en(n,a.schema),{selection:m,storedMarks:x}=a,{$from:b,$to:_}=m,z=b.blockRange(_),A=x||m.$to.parentOffset&&m.$from.marks();if(!z)return!1;const L=na(H=>Rs(H.type.name,h))(m);if(z.depth>=1&&L&&z.depth-L.depth<=1){if(L.node.type===u)return c.liftListItem(f);if(Rs(L.node.type.name,h)&&u.validContent(L.node.content)&&s)return l().command(()=>(i.setNodeMarkup(L.pos,u),!0)).command(()=>Ao(i,u)).command(()=>Lo(i,u)).run()}return!e||!A||!s?l().command(()=>d().wrapInList(u,r)?!0:c.clearNodes()).wrapInList(u,r).command(()=>Ao(i,u)).command(()=>Lo(i,u)).run():l().command(()=>{const H=d().wrapInList(u,r),C=A.filter(D=>g.includes(D.type.name));return i.ensureMarks(C),H?!0:c.clearNodes()}).wrapInList(u,r).command(()=>Ao(i,u)).command(()=>Lo(i,u)).run()},I1=(t,n={},e={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=e,a=ce(t,r.schema);return bi(r,a,n)?o.unsetMark(a,{extendEmptyMarkRange:i}):o.setMark(a,n)},T1=(t,n,e={})=>({state:r,commands:o})=>{const i=en(t,r.schema),a=en(n,r.schema),s=$t(r,i,e);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),s?o.setNode(a,l):o.setNode(i,{...l,...e})},$1=(t,n={})=>({state:e,commands:r})=>{const o=en(t,e.schema);return $t(e,o,n)?r.lift(o):r.wrapIn(o,n)},M1=()=>({state:t,dispatch:n})=>{const e=t.plugins;for(let r=0;r<e.length;r+=1){const o=e[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(n){const a=t.tr,s=i.transform;for(let l=s.steps.length-1;l>=0;l-=1)a.step(s.steps[l].invert(s.docs[l]));if(i.text){const l=a.doc.resolve(i.from).marks();a.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else a.delete(i.from,i.to)}return!0}}return!1},z1=()=>({tr:t,dispatch:n})=>{const{selection:e}=t,{empty:r,ranges:o}=e;return r||n&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},D1=(t,n={})=>({tr:e,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:a=!1}=n,{selection:s}=e,l=ce(t,r.schema),{$from:c,empty:d,ranges:h}=s;if(!o)return!0;if(d&&a){let{from:g,to:u}=s;const f=(i=c.marks().find(x=>x.type===l))===null||i===void 0?void 0:i.attrs,m=Zi(c,l,f);m&&(g=m.from,u=m.to),e.removeMark(g,u,l)}else h.forEach(g=>{e.removeMark(g.$from.pos,g.$to.pos,l)});return e.removeStoredMark(l),!0},O1=(t,n={})=>({tr:e,state:r,dispatch:o})=>{let i=null,a=null;const s=ho(typeof t=="string"?t:t.name,r.schema);return s?(s==="node"&&(i=en(t,r.schema)),s==="mark"&&(a=ce(t,r.schema)),o&&e.selection.ranges.forEach(l=>{const c=l.$from.pos,d=l.$to.pos;let h,g,u,f;e.selection.empty?r.doc.nodesBetween(c,d,(m,x)=>{i&&i===m.type&&(u=Math.max(x,c),f=Math.min(x+m.nodeSize,d),h=x,g=m)}):r.doc.nodesBetween(c,d,(m,x)=>{x<c&&i&&i===m.type&&(u=Math.max(x,c),f=Math.min(x+m.nodeSize,d),h=x,g=m),x>=c&&x<=d&&(i&&i===m.type&&e.setNodeMarkup(x,void 0,{...m.attrs,...n}),a&&m.marks.length&&m.marks.forEach(b=>{if(a===b.type){const _=Math.max(x,c),z=Math.min(x+m.nodeSize,d);e.addMark(_,z,a.create({...b.attrs,...n}))}}))}),g&&(h!==void 0&&e.setNodeMarkup(h,void 0,{...g.attrs,...n}),a&&g.marks.length&&g.marks.forEach(m=>{a===m.type&&e.addMark(u,f,a.create({...m.attrs,...n}))}))}),!0):!1},A1=(t,n={})=>({state:e,dispatch:r})=>{const o=en(t,e.schema);return Ub(o,n)(e,r)},L1=(t,n={})=>({state:e,dispatch:r})=>{const o=en(t,e.schema);return qb(o,n)(e,r)};var P1=Object.freeze({__proto__:null,blur:m2,clearContent:x2,clearNodes:b2,command:y2,createParagraphNear:v2,cut:k2,deleteCurrentNode:w2,deleteNode:_2,deleteRange:C2,deleteSelection:S2,enter:E2,exitCode:I2,extendMarkRange:T2,first:$2,focus:z2,forEach:D2,insertContent:O2,insertContentAt:P2,joinBackward:N2,joinDown:B2,joinForward:F2,joinItemBackward:H2,joinItemForward:j2,joinTextblockBackward:X2,joinTextblockForward:V2,joinUp:R2,keyboardShortcut:U2,lift:q2,liftEmptyBlock:K2,liftListItem:J2,newlineInCode:G2,resetAttributes:Y2,scrollIntoView:Q2,selectAll:Z2,selectNodeBackward:n1,selectNodeForward:e1,selectParentNode:t1,selectTextblockEnd:r1,selectTextblockStart:o1,setContent:i1,setMark:b1,setMeta:y1,setNode:v1,setNodeSelection:k1,setTextSelection:w1,sinkListItem:_1,splitBlock:C1,splitListItem:S1,toggleList:E1,toggleMark:I1,toggleNode:T1,toggleWrap:$1,undoInputRule:M1,unsetAllMarks:z1,unsetMark:D1,updateAttributes:O1,wrapIn:A1,wrapInList:L1});const R1=ln.create({name:"commands",addCommands(){return{...P1}}}),B1=ln.create({name:"drop",addProseMirrorPlugins(){return[new Q({key:new un("tiptapDrop"),props:{handleDrop:(t,n,e,r)=>{this.editor.emit("drop",{editor:this.editor,event:n,slice:e,moved:r})}}})]}}),N1=ln.create({name:"editable",addProseMirrorPlugins(){return[new Q({key:new un("editable"),props:{editable:()=>this.editor.options.editable}})]}}),F1=new un("focusEvents"),H1=ln.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Q({key:F1,props:{handleDOMEvents:{focus:(n,e)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:e}).setMeta("addToHistory",!1);return n.dispatch(r),!1},blur:(n,e)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:e}).setMeta("addToHistory",!1);return n.dispatch(r),!1}}}})]}}),j1=ln.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:s})=>{const{selection:l,doc:c}=s,{empty:d,$anchor:h}=l,{pos:g,parent:u}=h,f=h.parent.isTextblock&&g>0?s.doc.resolve(g-1):h,m=f.parent.type.spec.isolating,x=h.pos-h.parentOffset,b=m&&f.parent.childCount===1?x===h.pos:B.atStart(c).from===g;return!d||!u.type.isTextblock||u.textContent.length||!b||b&&h.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),n=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return kr()||np()?i:o},addProseMirrorPlugins(){return[new Q({key:new un("clearDocument"),appendTransaction:(t,n,e)=>{if(t.some(m=>m.getMeta("composition")))return;const r=t.some(m=>m.docChanged)&&!n.doc.eq(e.doc),o=t.some(m=>m.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:a,to:s}=n.selection,l=B.atStart(n.doc).from,c=B.atEnd(n.doc).to;if(i||!(a===l&&s===c)||!go(e.doc))return;const g=e.tr,u=ao({state:e,transaction:g}),{commands:f}=new so({editor:this.editor,state:u});if(f.clearNodes(),!!g.steps.length)return g}})]}}),X1=ln.create({name:"paste",addProseMirrorPlugins(){return[new Q({key:new un("tiptapPaste"),props:{handlePaste:(t,n,e)=>{this.editor.emit("paste",{editor:this.editor,event:n,slice:e})}}})]}}),V1=ln.create({name:"tabindex",addProseMirrorPlugins(){return[new Q({key:new un("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class ue{get name(){return this.node.type.name}constructor(n,e,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=n,this.editor=e,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var n;return(n=this.actualDepth)!==null&&n!==void 0?n:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(n){let e=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}e=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:e,to:r},n)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const n=this.resolvedPos.start(this.resolvedPos.depth-1),e=this.resolvedPos.doc.resolve(n);return new ue(e,this.editor)}get before(){let n=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return n.depth!==this.depth&&(n=this.resolvedPos.doc.resolve(this.from-3)),new ue(n,this.editor)}get after(){let n=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return n.depth!==this.depth&&(n=this.resolvedPos.doc.resolve(this.to+3)),new ue(n,this.editor)}get children(){const n=[];return this.node.content.forEach((e,r)=>{const o=e.isBlock&&!e.isTextblock,i=e.isAtom&&!e.isText,a=this.pos+r+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const s=this.resolvedPos.doc.resolve(a);if(!o&&s.depth<=this.depth)return;const l=new ue(s,this.editor,o,o?e:null);o&&(l.actualDepth=this.depth+1),n.push(new ue(s,this.editor,o,o?e:null))}),n}get firstChild(){return this.children[0]||null}get lastChild(){const n=this.children;return n[n.length-1]||null}closest(n,e={}){let r=null,o=this.parent;for(;o&&!r;)o.node.type.name===n&&(Object.keys(e).length>0||(r=o)),o=o.parent;return r}querySelector(n,e={}){return this.querySelectorAll(n,e,!0)[0]||null}querySelectorAll(n,e={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const i=Object.keys(e);return this.children.forEach(a=>{r&&o.length>0||(a.node.type.name===n&&i.every(l=>e[l]===a.node.attrs[l])&&o.push(a),!(r&&o.length>0)&&(o=o.concat(a.querySelectorAll(n,e,r))))}),o}setAttribute(n){const{tr:e}=this.editor.state;e.setNodeMarkup(this.from,void 0,{...this.node.attrs,...n}),this.editor.view.dispatch(e)}}const W1=`.ProseMirror {
|
|
20991
|
+
}`,Sc=M(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.radioChange=k(this,"radioChange"),this.label="",this.value="",this.name="",this.initialChecked=!1,this.disabled=!1,this.error=!1,this.checked=!1,this.isHovered=!1,this.isFocused=!1,this.isPressed=!1,this.handleClick=()=>{this.disabled||this.checked||(this.getSiblingRadios().forEach(n=>n.deselect()),this.checked=!0,this.radioChange.emit({value:this.value,checked:this.checked}))},this.handleKeyDown=n=>{this.disabled||(n.key===" "||n.key==="Enter")&&(n.preventDefault(),this.isPressed=!0,this.handleClick())},this.handleKeyUp=n=>{(n.key===" "||n.key==="Enter")&&(this.isPressed=!1)},this.getRadioClass=()=>{const n=["radio"];return this.checked&&n.push("checked"),this.disabled&&n.push("disabled"),this.error&&n.push("error"),this.isHovered&&!this.disabled&&n.push("hover"),this.isFocused&&!this.disabled&&n.push("focus"),this.isPressed&&!this.disabled&&n.push("pressed"),n.join(" ")}}watchCheckedProp(n){this.checked=n}componentWillLoad(){this.checked=this.initialChecked}async deselect(){this.checked=!1}getSiblingRadios(){if(!this.name)return[];const n=this.el.parentElement;return n?Array.from(n.querySelectorAll(`xplor-radio-btn[name="${this.name}"]`)).filter(r=>r!==this.el):[]}render(){return p("label",{key:"7bc995d1df46cd9818692d9a2b59fc6560f23cdd",class:{"radio-wrapper":!0,"radio-wrapper--disabled":this.disabled}},p("div",{key:"eea71f02b6335bd443f4410b350a61f1706a9b59",class:this.getRadioClass(),onClick:this.handleClick,onMouseEnter:()=>this.isHovered=!0,onMouseLeave:()=>this.isHovered=!1,onMouseDown:()=>this.isPressed=!0,onMouseUp:()=>this.isPressed=!1,onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,tabIndex:this.disabled?-1:0,role:"radio","aria-checked":this.checked.toString(),"aria-disabled":this.disabled.toString(),"aria-label":this.label},p("div",{key:"0b61c18ef3a9f08f6b89176de2b7a4d21b16d9fc",class:{"radio-inner":!0,"radio-inner--visible":this.checked}})),this.label&&p("span",{key:"7b227dca0fa69409dc71a04bc642c2de30bd2562",class:"label"},this.label))}get el(){return this}static get watchers(){return{initialChecked:["watchCheckedProp"]}}static get style(){return Xm}},[1,"xplor-radio-btn",{label:[1],value:[1],name:[1],initialChecked:[4,"initial-checked"],disabled:[4],error:[4],checked:[32],isHovered:[32],isFocused:[32],isPressed:[32],deselect:[64]},void 0,{initialChecked:["watchCheckedProp"]}]);function Vm(){if(typeof customElements>"u")return;["xplor-radio-btn"].forEach(n=>{switch(n){case"xplor-radio-btn":customElements.get(n)||customElements.define(n,Sc);break}})}const Wm=Sc,Um=Vm;function rn(t){this.content=t}rn.prototype={constructor:rn,find:function(t){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===t)return n;return-1},get:function(t){var n=this.find(t);return n==-1?void 0:this.content[n+1]},update:function(t,n,e){var r=e&&e!=t?this.remove(e):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(e||t,n):(i[o+1]=n,e&&(i[o]=e)),new rn(i)},remove:function(t){var n=this.find(t);if(n==-1)return this;var e=this.content.slice();return e.splice(n,2),new rn(e)},addToStart:function(t,n){return new rn([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var e=this.remove(t).content.slice();return e.push(t,n),new rn(e)},addBefore:function(t,n,e){var r=this.remove(n),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,n,e),new rn(o)},forEach:function(t){for(var n=0;n<this.content.length;n+=2)t(this.content[n],this.content[n+1])},prepend:function(t){return t=rn.from(t),t.size?new rn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=rn.from(t),t.size?new rn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=rn.from(t);for(var e=0;e<t.content.length;e+=2)n=n.remove(t.content[e]);return n},toObject:function(){var t={};return this.forEach(function(n,e){t[n]=e}),t},get size(){return this.content.length>>1}};rn.from=function(t){if(t instanceof rn)return t;var n=[];if(t)for(var e in t)n.push(e,t[e]);return new rn(n)};function Ec(t,n,e){for(let r=0;;r++){if(r==t.childCount||r==n.childCount)return t.childCount==n.childCount?null:e;let o=t.child(r),i=n.child(r);if(o==i){e+=o.nodeSize;continue}if(!o.sameMarkup(i))return e;if(o.isText&&o.text!=i.text){for(let a=0;o.text[a]==i.text[a];a++)e++;return e}if(o.content.size||i.content.size){let a=Ec(o.content,i.content,e+1);if(a!=null)return a}e+=o.nodeSize}}function Ic(t,n,e,r){for(let o=t.childCount,i=n.childCount;;){if(o==0||i==0)return o==i?null:{a:e,b:r};let a=t.child(--o),s=n.child(--i),l=a.nodeSize;if(a==s){e-=l,r-=l;continue}if(!a.sameMarkup(s))return{a:e,b:r};if(a.isText&&a.text!=s.text){let c=0,d=Math.min(a.text.length,s.text.length);for(;c<d&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,e--,r--;return{a:e,b:r}}if(a.content.size||s.content.size){let c=Ic(a.content,s.content,e-1,r-1);if(c)return c}e-=l,r-=l}}class y{constructor(n,e){if(this.content=n,this.size=e||0,e==null)for(let r=0;r<n.length;r++)this.size+=n[r].nodeSize}nodesBetween(n,e,r,o=0,i){for(let a=0,s=0;s<e;a++){let l=this.content[a],c=s+l.nodeSize;if(c>n&&r(l,o+s,i||null,a)!==!1&&l.content.size){let d=s+1;l.nodesBetween(Math.max(0,n-d),Math.min(l.content.size,e-d),r,o+d)}s=c}}descendants(n){this.nodesBetween(0,this.size,n)}textBetween(n,e,r,o){let i="",a=!0;return this.nodesBetween(n,e,(s,l)=>{let c=s.isText?s.text.slice(Math.max(n,l)-l,e-l):s.isLeaf?o?typeof o=="function"?o(s):o:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&r&&(a?a=!1:i+=r),i+=c},0),i}append(n){if(!n.size)return this;if(!this.size)return n;let e=this.lastChild,r=n.firstChild,o=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(r)&&(o[o.length-1]=e.withText(e.text+r.text),i=1);i<n.content.length;i++)o.push(n.content[i]);return new y(o,this.size+n.size)}cut(n,e=this.size){if(n==0&&e==this.size)return this;let r=[],o=0;if(e>n)for(let i=0,a=0;a<e;i++){let s=this.content[i],l=a+s.nodeSize;l>n&&((a<n||l>e)&&(s.isText?s=s.cut(Math.max(0,n-a),Math.min(s.text.length,e-a)):s=s.cut(Math.max(0,n-a-1),Math.min(s.content.size,e-a-1))),r.push(s),o+=s.nodeSize),a=l}return new y(r,o)}cutByIndex(n,e){return n==e?y.empty:n==0&&e==this.content.length?this:new y(this.content.slice(n,e))}replaceChild(n,e){let r=this.content[n];if(r==e)return this;let o=this.content.slice(),i=this.size+e.nodeSize-r.nodeSize;return o[n]=e,new y(o,i)}addToStart(n){return new y([n].concat(this.content),this.size+n.nodeSize)}addToEnd(n){return new y(this.content.concat(n),this.size+n.nodeSize)}eq(n){if(this.content.length!=n.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(n.content[e]))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(n){let e=this.content[n];if(!e)throw new RangeError("Index "+n+" out of range for "+this);return e}maybeChild(n){return this.content[n]||null}forEach(n){for(let e=0,r=0;e<this.content.length;e++){let o=this.content[e];n(o,r,e),r+=o.nodeSize}}findDiffStart(n,e=0){return Ec(this,n,e)}findDiffEnd(n,e=this.size,r=n.size){return Ic(this,n,e,r)}findIndex(n){if(n==0)return Ht(0,n);if(n==this.size)return Ht(this.content.length,n);if(n>this.size||n<0)throw new RangeError(`Position ${n} outside of fragment (${this})`);for(let e=0,r=0;;e++){let o=this.child(e),i=r+o.nodeSize;if(i>=n)return i==n?Ht(e+1,i):Ht(e,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(n=>n.toJSON()):null}static fromJSON(n,e){if(!e)return y.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new y(e.map(n.nodeFromJSON))}static fromArray(n){if(!n.length)return y.empty;let e,r=0;for(let o=0;o<n.length;o++){let i=n[o];r+=i.nodeSize,o&&i.isText&&n[o-1].sameMarkup(i)?(e||(e=n.slice(0,o)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new y(e||n,r)}static from(n){if(!n)return y.empty;if(n instanceof y)return n;if(Array.isArray(n))return this.fromArray(n);if(n.attrs)return new y([n],n.nodeSize);throw new RangeError("Can not convert "+n+" to a Fragment"+(n.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}y.empty=new y([],0);const bo={index:0,offset:0};function Ht(t,n){return bo.index=t,bo.offset=n,bo}function cr(t,n){if(t===n)return!0;if(!(t&&typeof t=="object")||!(n&&typeof n=="object"))return!1;let e=Array.isArray(t);if(Array.isArray(n)!=e)return!1;if(e){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!cr(t[r],n[r]))return!1}else{for(let r in t)if(!(r in n)||!cr(t[r],n[r]))return!1;for(let r in n)if(!(r in t))return!1}return!0}let j=class ni{constructor(n,e){this.type=n,this.attrs=e}addToSet(n){let e,r=!1;for(let o=0;o<n.length;o++){let i=n[o];if(this.eq(i))return n;if(this.type.excludes(i.type))e||(e=n.slice(0,o));else{if(i.type.excludes(this.type))return n;!r&&i.type.rank>this.type.rank&&(e||(e=n.slice(0,o)),e.push(this),r=!0),e&&e.push(i)}}return e||(e=n.slice()),r||e.push(this),e}removeFromSet(n){for(let e=0;e<n.length;e++)if(this.eq(n[e]))return n.slice(0,e).concat(n.slice(e+1));return n}isInSet(n){for(let e=0;e<n.length;e++)if(this.eq(n[e]))return!0;return!1}eq(n){return this==n||this.type==n.type&&cr(this.attrs,n.attrs)}toJSON(){let n={type:this.type.name};for(let e in this.attrs){n.attrs=this.attrs;break}return n}static fromJSON(n,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let r=n.marks[e.type];if(!r)throw new RangeError(`There is no mark type ${e.type} in this schema`);let o=r.create(e.attrs);return r.checkAttrs(o.attrs),o}static sameSet(n,e){if(n==e)return!0;if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!n[r].eq(e[r]))return!1;return!0}static setFrom(n){if(!n||Array.isArray(n)&&n.length==0)return ni.none;if(n instanceof ni)return[n];let e=n.slice();return e.sort((r,o)=>r.type.rank-o.type.rank),e}};j.none=[];class dr extends Error{}class w{constructor(n,e,r){this.content=n,this.openStart=e,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(n,e){let r=Tc(this.content,n+this.openStart,e);return r&&new w(r,this.openStart,this.openEnd)}removeBetween(n,e){return new w($c(this.content,n+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(n){return this.content.eq(n.content)&&this.openStart==n.openStart&&this.openEnd==n.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let n={content:this.content.toJSON()};return this.openStart>0&&(n.openStart=this.openStart),this.openEnd>0&&(n.openEnd=this.openEnd),n}static fromJSON(n,e){if(!e)return w.empty;let r=e.openStart||0,o=e.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new w(y.fromJSON(n,e.content),r,o)}static maxOpen(n,e=!0){let r=0,o=0;for(let i=n.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=n.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)o++;return new w(n,r,o)}}w.empty=new w(y.empty,0,0);function $c(t,n,e){let{index:r,offset:o}=t.findIndex(n),i=t.maybeChild(r),{index:a,offset:s}=t.findIndex(e);if(o==n||i.isText){if(s!=e&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(e))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy($c(i.content,n-o-1,e-o-1)))}function Tc(t,n,e,r){let{index:o,offset:i}=t.findIndex(n),a=t.maybeChild(o);if(i==n||a.isText)return r&&!r.canReplace(o,o,e)?null:t.cut(0,n).append(e).append(t.cut(n));let s=Tc(a.content,n-i-1,e,a);return s&&t.replaceChild(o,a.copy(s))}function qm(t,n,e){if(e.openStart>t.depth)throw new dr("Inserted content deeper than insertion position");if(t.depth-e.openStart!=n.depth-e.openEnd)throw new dr("Inconsistent open depths");return Mc(t,n,e,0)}function Mc(t,n,e,r){let o=t.index(r),i=t.node(r);if(o==n.index(r)&&r<t.depth-e.openStart){let a=Mc(t,n,e,r+1);return i.copy(i.content.replaceChild(o,a))}else if(e.content.size)if(!e.openStart&&!e.openEnd&&t.depth==r&&n.depth==r){let a=t.parent,s=a.content;return ve(a,s.cut(0,t.parentOffset).append(e.content).append(s.cut(n.parentOffset)))}else{let{start:a,end:s}=Km(e,t);return ve(i,zc(t,a,s,n,r))}else return ve(i,pr(t,n,r))}function Dc(t,n){if(!n.type.compatibleContent(t.type))throw new dr("Cannot join "+n.type.name+" onto "+t.type.name)}function ei(t,n,e){let r=t.node(e);return Dc(r,n.node(e)),r}function ye(t,n){let e=n.length-1;e>=0&&t.isText&&t.sameMarkup(n[e])?n[e]=t.withText(n[e].text+t.text):n.push(t)}function ct(t,n,e,r){let o=(n||t).node(e),i=0,a=n?n.index(e):o.childCount;t&&(i=t.index(e),t.depth>e?i++:t.textOffset&&(ye(t.nodeAfter,r),i++));for(let s=i;s<a;s++)ye(o.child(s),r);n&&n.depth==e&&n.textOffset&&ye(n.nodeBefore,r)}function ve(t,n){return t.type.checkContent(n),t.copy(n)}function zc(t,n,e,r,o){let i=t.depth>o&&ei(t,n,o+1),a=r.depth>o&&ei(e,r,o+1),s=[];return ct(null,t,o,s),i&&a&&n.index(o)==e.index(o)?(Dc(i,a),ye(ve(i,zc(t,n,e,r,o+1)),s)):(i&&ye(ve(i,pr(t,n,o+1)),s),ct(n,e,o,s),a&&ye(ve(a,pr(e,r,o+1)),s)),ct(r,null,o,s),new y(s)}function pr(t,n,e){let r=[];if(ct(null,t,e,r),t.depth>e){let o=ei(t,n,e+1);ye(ve(o,pr(t,n,e+1)),r)}return ct(n,null,e,r),new y(r)}function Km(t,n){let e=n.depth-t.openStart,o=n.node(e).copy(t.content);for(let i=e-1;i>=0;i--)o=n.node(i).copy(y.from(o));return{start:o.resolveNoCache(t.openStart+e),end:o.resolveNoCache(o.content.size-t.openEnd-e)}}class kt{constructor(n,e,r){this.pos=n,this.path=e,this.parentOffset=r,this.depth=e.length/3-1}resolveDepth(n){return n==null?this.depth:n<0?this.depth+n:n}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(n){return this.path[this.resolveDepth(n)*3]}index(n){return this.path[this.resolveDepth(n)*3+1]}indexAfter(n){return n=this.resolveDepth(n),this.index(n)+(n==this.depth&&!this.textOffset?0:1)}start(n){return n=this.resolveDepth(n),n==0?0:this.path[n*3-1]+1}end(n){return n=this.resolveDepth(n),this.start(n)+this.node(n).content.size}before(n){if(n=this.resolveDepth(n),!n)throw new RangeError("There is no position before the top-level node");return n==this.depth+1?this.pos:this.path[n*3-1]}after(n){if(n=this.resolveDepth(n),!n)throw new RangeError("There is no position after the top-level node");return n==this.depth+1?this.pos:this.path[n*3-1]+this.path[n*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let n=this.parent,e=this.index(this.depth);if(e==n.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=n.child(e);return r?n.child(e).cut(r):o}get nodeBefore(){let n=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(n).cut(0,e):n==0?null:this.parent.child(n-1)}posAtIndex(n,e){e=this.resolveDepth(e);let r=this.path[e*3],o=e==0?0:this.path[e*3-1]+1;for(let i=0;i<n;i++)o+=r.child(i).nodeSize;return o}marks(){let n=this.parent,e=this.index();if(n.content.size==0)return j.none;if(this.textOffset)return n.child(e).marks;let r=n.maybeChild(e-1),o=n.maybeChild(e);if(!r){let s=r;r=o,o=s}let i=r.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!o||!i[a].isInSet(o.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(n){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let r=e.marks,o=n.parent.maybeChild(n.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(n){for(let e=this.depth;e>0;e--)if(this.start(e)<=n&&this.end(e)>=n)return e;return 0}blockRange(n=this,e){if(n.pos<this.pos)return n.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==n.pos?1:0);r>=0;r--)if(n.pos<=this.end(r)&&(!e||e(this.node(r))))return new hr(this,n,r);return null}sameParent(n){return this.pos-this.parentOffset==n.pos-n.parentOffset}max(n){return n.pos>this.pos?n:this}min(n){return n.pos<this.pos?n:this}toString(){let n="";for(let e=1;e<=this.depth;e++)n+=(n?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return n+":"+this.parentOffset}static resolve(n,e){if(!(e>=0&&e<=n.content.size))throw new RangeError("Position "+e+" out of range");let r=[],o=0,i=e;for(let a=n;;){let{index:s,offset:l}=a.content.findIndex(i),c=i-l;if(r.push(a,s,o+l),!c||(a=a.child(s),a.isText))break;i=c-1,o+=l+1}return new kt(e,r,i)}static resolveCached(n,e){let r=za.get(n);if(r)for(let i=0;i<r.elts.length;i++){let a=r.elts[i];if(a.pos==e)return a}else za.set(n,r=new Jm);let o=r.elts[r.i]=kt.resolve(n,e);return r.i=(r.i+1)%Gm,o}}class Jm{constructor(){this.elts=[],this.i=0}}const Gm=12,za=new WeakMap;class hr{constructor(n,e,r){this.$from=n,this.$to=e,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 Ym=Object.create(null);let ee=class ti{constructor(n,e,r,o=j.none){this.type=n,this.attrs=e,this.marks=o,this.content=r||y.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(n){return this.content.child(n)}maybeChild(n){return this.content.maybeChild(n)}forEach(n){this.content.forEach(n)}nodesBetween(n,e,r,o=0){this.content.nodesBetween(n,e,r,o,this)}descendants(n){this.nodesBetween(0,this.content.size,n)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(n,e,r,o){return this.content.textBetween(n,e,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(n){return this==n||this.sameMarkup(n)&&this.content.eq(n.content)}sameMarkup(n){return this.hasMarkup(n.type,n.attrs,n.marks)}hasMarkup(n,e,r){return this.type==n&&cr(this.attrs,e||n.defaultAttrs||Ym)&&j.sameSet(this.marks,r||j.none)}copy(n=null){return n==this.content?this:new ti(this.type,this.attrs,n,this.marks)}mark(n){return n==this.marks?this:new ti(this.type,this.attrs,this.content,n)}cut(n,e=this.content.size){return n==0&&e==this.content.size?this:this.copy(this.content.cut(n,e))}slice(n,e=this.content.size,r=!1){if(n==e)return w.empty;let o=this.resolve(n),i=this.resolve(e),a=r?0:o.sharedDepth(e),s=o.start(a),c=o.node(a).content.cut(o.pos-s,i.pos-s);return new w(c,o.depth-a,i.depth-a)}replace(n,e,r){return qm(this.resolve(n),this.resolve(e),r)}nodeAt(n){for(let e=this;;){let{index:r,offset:o}=e.content.findIndex(n);if(e=e.maybeChild(r),!e)return null;if(o==n||e.isText)return e;n-=o+1}}childAfter(n){let{index:e,offset:r}=this.content.findIndex(n);return{node:this.content.maybeChild(e),index:e,offset:r}}childBefore(n){if(n==0)return{node:null,index:0,offset:0};let{index:e,offset:r}=this.content.findIndex(n);if(r<n)return{node:this.content.child(e),index:e,offset:r};let o=this.content.child(e-1);return{node:o,index:e-1,offset:r-o.nodeSize}}resolve(n){return kt.resolveCached(this,n)}resolveNoCache(n){return kt.resolve(this,n)}rangeHasMark(n,e,r){let o=!1;return e>n&&this.nodesBetween(n,e,i=>(r.isInSet(i.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 n=this.type.name;return this.content.size&&(n+="("+this.content.toStringInner()+")"),Oc(this.marks,n)}contentMatchAt(n){let e=this.type.contentMatch.matchFragment(this.content,0,n);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(n,e,r=y.empty,o=0,i=r.childCount){let a=this.contentMatchAt(n).matchFragment(r,o,i),s=a&&a.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(n,e,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(n).matchType(r),a=i&&i.matchFragment(this.content,e);return a?a.validEnd:!1}canAppend(n){return n.content.size?this.canReplace(this.childCount,this.childCount,n.content):this.type.compatibleContent(n.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let n=j.none;for(let e=0;e<this.marks.length;e++){let r=this.marks[e];r.type.checkAttrs(r.attrs),n=r.addToSet(n)}if(!j.sameSet(n,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let n={type:this.type.name};for(let e in this.attrs){n.attrs=this.attrs;break}return this.content.size&&(n.content=this.content.toJSON()),this.marks.length&&(n.marks=this.marks.map(e=>e.toJSON())),n}static fromJSON(n,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let r;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=e.marks.map(n.markFromJSON)}if(e.type=="text"){if(typeof e.text!="string")throw new RangeError("Invalid text node in JSON");return n.text(e.text,r)}let o=y.fromJSON(n,e.content),i=n.nodeType(e.type).create(e.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};ee.prototype.text=void 0;class gr extends ee{constructor(n,e,r,o){if(super(n,e,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):Oc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(n,e){return this.text.slice(n,e)}get nodeSize(){return this.text.length}mark(n){return n==this.marks?this:new gr(this.type,this.attrs,this.text,n)}withText(n){return n==this.text?this:new gr(this.type,this.attrs,n,this.marks)}cut(n=0,e=this.text.length){return n==0&&e==this.text.length?this:this.withText(this.text.slice(n,e))}eq(n){return this.sameMarkup(n)&&this.text==n.text}toJSON(){let n=super.toJSON();return n.text=this.text,n}}function Oc(t,n){for(let e=t.length-1;e>=0;e--)n=t[e].type.name+"("+n+")";return n}class Se{constructor(n){this.validEnd=n,this.next=[],this.wrapCache=[]}static parse(n,e){let r=new Qm(n,e);if(r.next==null)return Se.empty;let o=Ac(r);r.next&&r.err("Unexpected trailing text");let i=i0(o0(o));return a0(i,r),i}matchType(n){for(let e=0;e<this.next.length;e++)if(this.next[e].type==n)return this.next[e].next;return null}matchFragment(n,e=0,r=n.childCount){let o=this;for(let i=e;o&&i<r;i++)o=o.matchType(n.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let n=0;n<this.next.length;n++){let{type:e}=this.next[n];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(n){for(let e=0;e<this.next.length;e++)for(let r=0;r<n.next.length;r++)if(this.next[e].type==n.next[r].type)return!0;return!1}fillBefore(n,e=!1,r=0){let o=[this];function i(a,s){let l=a.matchFragment(n,r);if(l&&(!e||l.validEnd))return y.from(s.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:d,next:h}=a.next[c];if(!(d.isText||d.hasRequiredAttrs())&&o.indexOf(h)==-1){o.push(h);let g=i(h,s.concat(d));if(g)return g}}return null}return i(this,[])}findWrapping(n){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==n)return this.wrapCache[r+1];let e=this.computeWrapping(n);return this.wrapCache.push(n,e),e}computeWrapping(n){let e=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(n)){let a=[];for(let s=o;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<i.next.length;a++){let{type:s,next:l}=i.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in e)&&(!o.type||l.validEnd)&&(r.push({match:s.contentMatch,type:s,via:o}),e[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(n){if(n>=this.next.length)throw new RangeError(`There's no ${n}th edge in this content match`);return this.next[n]}toString(){let n=[];function e(r){n.push(r);for(let o=0;o<r.next.length;o++)n.indexOf(r.next[o].next)==-1&&e(r.next[o].next)}return e(this),n.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)i+=(a?", ":"")+r.next[a].type.name+"->"+n.indexOf(r.next[a].next);return i}).join(`
|
|
20992
|
+
`)}}Se.empty=new Se(!0);class Qm{constructor(n,e){this.string=n,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=n.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(n){return this.next==n&&(this.pos++||!0)}err(n){throw new SyntaxError(n+" (in content expression '"+this.string+"')")}}function Ac(t){let n=[];do n.push(Zm(t));while(t.eat("|"));return n.length==1?n[0]:{type:"choice",exprs:n}}function Zm(t){let n=[];do n.push(n0(t));while(t.next&&t.next!=")"&&t.next!="|");return n.length==1?n[0]:{type:"seq",exprs:n}}function n0(t){let n=r0(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=e0(t,n);else break;return n}function Oa(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function e0(t,n){let e=Oa(t),r=e;return t.eat(",")&&(t.next!="}"?r=Oa(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:e,max:r,expr:n}}function t0(t,n){let e=t.nodeTypes,r=e[n];if(r)return[r];let o=[];for(let i in e){let a=e[i];a.isInGroup(n)&&o.push(a)}return o.length==0&&t.err("No node type or group '"+n+"' found"),o}function r0(t){if(t.eat("(")){let n=Ac(t);return t.eat(")")||t.err("Missing closing paren"),n}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let n=t0(t,t.next).map(e=>(t.inline==null?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,n.length==1?n[0]:{type:"choice",exprs:n}}}function o0(t){let n=[[]];return o(i(t,0),e()),n;function e(){return n.push([])-1}function r(a,s,l){let c={term:l,to:s};return n[a].push(c),c}function o(a,s){a.forEach(l=>l.to=s)}function i(a,s){if(a.type=="choice")return a.exprs.reduce((l,c)=>l.concat(i(c,s)),[]);if(a.type=="seq")for(let l=0;;l++){let c=i(a.exprs[l],s);if(l==a.exprs.length-1)return c;o(c,s=e())}else if(a.type=="star"){let l=e();return r(s,l),o(i(a.expr,l),l),[r(l)]}else if(a.type=="plus"){let l=e();return o(i(a.expr,s),l),o(i(a.expr,l),l),[r(l)]}else{if(a.type=="opt")return[r(s)].concat(i(a.expr,s));if(a.type=="range"){let l=s;for(let c=0;c<a.min;c++){let d=e();o(i(a.expr,l),d),l=d}if(a.max==-1)o(i(a.expr,l),l);else for(let c=a.min;c<a.max;c++){let d=e();r(l,d),o(i(a.expr,l),d),l=d}return[r(l)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function Lc(t,n){return n-t}function Aa(t,n){let e=[];return r(n),e.sort(Lc);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);e.push(o);for(let a=0;a<i.length;a++){let{term:s,to:l}=i[a];!s&&e.indexOf(l)==-1&&r(l)}}}function i0(t){let n=Object.create(null);return e(Aa(t,0));function e(r){let o=[];r.forEach(a=>{t[a].forEach(({term:s,to:l})=>{if(!s)return;let c;for(let d=0;d<o.length;d++)o[d][0]==s&&(c=o[d][1]);Aa(t,l).forEach(d=>{c||o.push([s,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let i=n[r.join(",")]=new Se(r.indexOf(t.length-1)>-1);for(let a=0;a<o.length;a++){let s=o[a][1].sort(Lc);i.next.push({type:o[a][0],next:n[s.join(",")]||e(s)})}return i}}function a0(t,n){for(let e=0,r=[t];e<r.length;e++){let o=r[e],i=!o.validEnd,a=[];for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];a.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&n.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Pc(t){let n=Object.create(null);for(let e in t){let r=t[e];if(!r.hasDefault)return null;n[e]=r.default}return n}function Rc(t,n){let e=Object.create(null);for(let r in t){let o=n&&n[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}e[r]=o}return e}function Bc(t,n,e,r){for(let o in n)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${e} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(n[o])}}function Nc(t,n){let e=Object.create(null);if(n)for(let r in n)e[r]=new l0(t,r,n[r]);return e}let La=class Fc{constructor(n,e,r){this.name=n,this.schema=e,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Nc(n,r.attrs),this.defaultAttrs=Pc(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||n=="text"),this.isText=n=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Se.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(n){return this.groups.indexOf(n)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let n in this.attrs)if(this.attrs[n].isRequired)return!0;return!1}compatibleContent(n){return this==n||this.contentMatch.compatible(n.contentMatch)}computeAttrs(n){return!n&&this.defaultAttrs?this.defaultAttrs:Rc(this.attrs,n)}create(n=null,e,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ee(this,this.computeAttrs(n),y.from(e),j.setFrom(r))}createChecked(n=null,e,r){return e=y.from(e),this.checkContent(e),new ee(this,this.computeAttrs(n),e,j.setFrom(r))}createAndFill(n=null,e,r){if(n=this.computeAttrs(n),e=y.from(e),e.size){let a=this.contentMatch.fillBefore(e);if(!a)return null;e=a.append(e)}let o=this.contentMatch.matchFragment(e),i=o&&o.fillBefore(y.empty,!0);return i?new ee(this,n,e.append(i),j.setFrom(r)):null}validContent(n){let e=this.contentMatch.matchFragment(n);if(!e||!e.validEnd)return!1;for(let r=0;r<n.childCount;r++)if(!this.allowsMarks(n.child(r).marks))return!1;return!0}checkContent(n){if(!this.validContent(n))throw new RangeError(`Invalid content for node ${this.name}: ${n.toString().slice(0,50)}`)}checkAttrs(n){Bc(this.attrs,n,"node")}allowsMarkType(n){return this.markSet==null||this.markSet.indexOf(n)>-1}allowsMarks(n){if(this.markSet==null)return!0;for(let e=0;e<n.length;e++)if(!this.allowsMarkType(n[e].type))return!1;return!0}allowedMarks(n){if(this.markSet==null)return n;let e;for(let r=0;r<n.length;r++)this.allowsMarkType(n[r].type)?e&&e.push(n[r]):e||(e=n.slice(0,r));return e?e.length?e:j.none:n}static compile(n,e){let r=Object.create(null);n.forEach((i,a)=>r[i]=new Fc(i,e,a));let o=e.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 i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function s0(t,n,e){let r=e.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${n} on type ${t}, got ${i}`)}}class l0{constructor(n,e,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?s0(n,e,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Zr{constructor(n,e,r,o){this.name=n,this.rank=e,this.schema=r,this.spec=o,this.attrs=Nc(n,o.attrs),this.excluded=null;let i=Pc(this.attrs);this.instance=i?new j(this,i):null}create(n=null){return!n&&this.instance?this.instance:new j(this,Rc(this.attrs,n))}static compile(n,e){let r=Object.create(null),o=0;return n.forEach((i,a)=>r[i]=new Zr(i,o++,e,a)),r}removeFromSet(n){for(var e=0;e<n.length;e++)n[e].type==this&&(n=n.slice(0,e).concat(n.slice(e+1)),e--);return n}isInSet(n){for(let e=0;e<n.length;e++)if(n[e].type==this)return n[e]}checkAttrs(n){Bc(this.attrs,n,"mark")}excludes(n){return this.excluded.indexOf(n)>-1}}class Hc{constructor(n){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let o in n)e[o]=n[o];e.nodes=rn.from(n.nodes),e.marks=rn.from(n.marks||{}),this.nodes=La.compile(this.spec.nodes,this),this.marks=Zr.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 i=this.nodes[o],a=i.spec.content||"",s=i.spec.marks;if(i.contentMatch=r[a]||(r[a]=Se.parse(a,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=s=="_"?null:s?Pa(this,s.split(" ")):s==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],a=i.spec.excludes;i.excluded=a==null?[i]:a==""?[]:Pa(this,a.split(" "))}this.nodeFromJSON=o=>ee.fromJSON(this,o),this.markFromJSON=o=>j.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(n,e=null,r,o){if(typeof n=="string")n=this.nodeType(n);else if(n instanceof La){if(n.schema!=this)throw new RangeError("Node type from different schema used ("+n.name+")")}else throw new RangeError("Invalid node type: "+n);return n.createChecked(e,r,o)}text(n,e){let r=this.nodes.text;return new gr(r,r.defaultAttrs,n,j.setFrom(e))}mark(n,e){return typeof n=="string"&&(n=this.marks[n]),n.create(e)}nodeType(n){let e=this.nodes[n];if(!e)throw new RangeError("Unknown node type: "+n);return e}}function Pa(t,n){let e=[];for(let r=0;r<n.length;r++){let o=n[r],i=t.marks[o],a=i;if(i)e.push(i);else for(let s in t.marks){let l=t.marks[s];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&e.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+n[r]+"'")}return e}function c0(t){return t.tag!=null}function d0(t){return t.style!=null}class te{constructor(n,e){this.schema=n,this.rules=e,this.tags=[],this.styles=[];let r=this.matchedStyles=[];e.forEach(o=>{if(c0(o))this.tags.push(o);else if(d0(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=n.nodes[o.node];return i.contentMatch.matchType(i)})}parse(n,e={}){let r=new Ba(this,e,!1);return r.addAll(n,j.none,e.from,e.to),r.finish()}parseSlice(n,e={}){let r=new Ba(this,e,!0);return r.addAll(n,j.none,e.from,e.to),w.maxOpen(r.finish())}matchTag(n,e,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(g0(n,i.tag)&&(i.namespace===void 0||n.namespaceURI==i.namespace)&&(!i.context||e.matchesContext(i.context))){if(i.getAttrs){let a=i.getAttrs(n);if(a===!1)continue;i.attrs=a||void 0}return i}}}matchStyle(n,e,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let a=this.styles[i],s=a.style;if(!(s.indexOf(n)!=0||a.context&&!r.matchesContext(a.context)||s.length>n.length&&(s.charCodeAt(n.length)!=61||s.slice(n.length+1)!=e))){if(a.getAttrs){let l=a.getAttrs(e);if(l===!1)continue;a.attrs=l||void 0}return a}}}static schemaRules(n){let e=[];function r(o){let i=o.priority==null?50:o.priority,a=0;for(;a<e.length;a++){let s=e[a];if((s.priority==null?50:s.priority)<i)break}e.splice(a,0,o)}for(let o in n.marks){let i=n.marks[o].spec.parseDOM;i&&i.forEach(a=>{r(a=Na(a)),a.mark||a.ignore||a.clearMark||(a.mark=o)})}for(let o in n.nodes){let i=n.nodes[o].spec.parseDOM;i&&i.forEach(a=>{r(a=Na(a)),a.node||a.ignore||a.mark||(a.node=o)})}return e}static fromSchema(n){return n.cached.domParser||(n.cached.domParser=new te(n,te.schemaRules(n)))}}const jc={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},p0={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Xc={ol:!0,ul:!0},wt=1,ri=2,Qt=4;function Ra(t,n,e){return n!=null?(n?wt:0)|(n==="full"?ri:0):t&&t.whitespace=="pre"?wt|ri:e&-5}class jt{constructor(n,e,r,o,i,a){this.type=n,this.attrs=e,this.marks=r,this.solid=o,this.options=a,this.content=[],this.activeMarks=j.none,this.match=i||(a&Qt?null:n.contentMatch)}findWrapping(n){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(y.from(n));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(n.type))?(this.match=r,o):null}}return this.match.findWrapping(n.type)}finish(n){if(!(this.options&wt)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let e=y.from(this.content);return!n&&this.match&&(e=e.append(this.match.fillBefore(y.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(n){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:n.parentNode&&!jc.hasOwnProperty(n.parentNode.nodeName.toLowerCase())}}class Ba{constructor(n,e,r){this.parser=n,this.options=e,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=e.topNode,i,a=Ra(null,e.preserveWhitespace,0)|(r?Qt:0);o?i=new jt(o.type,o.attrs,j.none,!0,e.topMatch||o.type.contentMatch,a):r?i=new jt(null,null,j.none,!0,null,a):i=new jt(n.schema.topNodeType,null,j.none,!0,null,a),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(n,e){n.nodeType==3?this.addTextNode(n,e):n.nodeType==1&&this.addElement(n,e)}addTextNode(n,e){let r=n.nodeValue,o=this.top,i=o.options&ri?"full":this.localPreserveWS||(o.options&wt)>0,{schema:a}=this.parser;if(i==="full"||o.inlineContext(n)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
|
|
20993
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(a.linebreakReplacement.create())){let s=r.split(/\r?\n|\r/);for(let l=0;l<s.length;l++)l&&this.insertNode(a.linebreakReplacement.create(),e,!0),s[l]&&this.insertNode(a.text(s[l]),e,!/\S/.test(s[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=o.content[o.content.length-1],l=n.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(a.text(r),e,!/\S/.test(r)),this.findInText(n)}else this.findInside(n)}addElement(n,e,r){let o=this.localPreserveWS,i=this.top;(n.tagName=="PRE"||/pre/.test(n.style&&n.style.whiteSpace))&&(this.localPreserveWS=!0);let a=n.nodeName.toLowerCase(),s;Xc.hasOwnProperty(a)&&this.parser.normalizeLists&&h0(n);let l=this.options.ruleFromNode&&this.options.ruleFromNode(n)||(s=this.parser.matchTag(n,this,r));n:if(l?l.ignore:p0.hasOwnProperty(a))this.findInside(n),this.ignoreFallback(n,e);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(n=l.skip);let c,d=this.needsBlock;if(jc.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!n.firstChild){this.leafFallback(n,e);break n}let h=l&&l.skip?e:this.readStyles(n,e);h&&this.addAll(n,h),c&&this.sync(i),this.needsBlock=d}else{let c=this.readStyles(n,e);c&&this.addElementByRule(n,l,c,l.consuming===!1?s:void 0)}this.localPreserveWS=o}leafFallback(n,e){n.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(n.ownerDocument.createTextNode(`
|
|
20994
|
+
`),e)}ignoreFallback(n,e){n.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(n,e){let r=n.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],a=r.getPropertyValue(i);if(a)for(let s=void 0;;){let l=this.parser.matchStyle(i,a,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?e=e.filter(c=>!l.clearMark(c)):e=e.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return e}addElementByRule(n,e,r,o){let i,a;if(e.node)if(a=this.parser.schema.nodes[e.node],a.isLeaf)this.insertNode(a.create(e.attrs),r,n.nodeName=="BR")||this.leafFallback(n,r);else{let l=this.enter(a,e.attrs||null,r,e.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[e.mark];r=r.concat(l.create(e.attrs))}let s=this.top;if(a&&a.isLeaf)this.findInside(n);else if(o)this.addElement(n,r,o);else if(e.getContent)this.findInside(n),e.getContent(n,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=n;typeof e.contentElement=="string"?l=n.querySelector(e.contentElement):typeof e.contentElement=="function"?l=e.contentElement(n):e.contentElement&&(l=e.contentElement),this.findAround(n,l,!0),this.addAll(l,r),this.findAround(n,l,!1)}i&&this.sync(s)&&this.open--}addAll(n,e,r,o){let i=r||0;for(let a=r?n.childNodes[r]:n.firstChild,s=o==null?null:n.childNodes[o];a!=s;a=a.nextSibling,++i)this.findAtPoint(n,i),this.addDOM(a,e);this.findAtPoint(n,i)}findPlace(n,e,r){let o,i;for(let a=this.open,s=0;a>=0;a--){let l=this.nodes[a],c=l.findWrapping(n);if(c&&(!o||o.length>c.length+s)&&(o=c,i=l,!c.length))break;if(l.solid){if(r)break;s+=2}}if(!o)return null;this.sync(i);for(let a=0;a<o.length;a++)e=this.enterInner(o[a],null,e,!1);return e}insertNode(n,e,r){if(n.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(e=this.enterInner(i,null,e))}let o=this.findPlace(n,e,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(n.type));let a=j.none;for(let s of o.concat(n.marks))(i.type?i.type.allowsMarkType(s.type):Fa(s.type,n.type))&&(a=s.addToSet(a));return i.content.push(n.mark(a)),!0}return!1}enter(n,e,r,o){let i=this.findPlace(n.create(e),r,!1);return i&&(i=this.enterInner(n,e,r,!0,o)),i}enterInner(n,e,r,o=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(n);let s=Ra(n,i,a.options);a.options&Qt&&a.content.length==0&&(s|=Qt);let l=j.none;return r=r.filter(c=>(a.type?a.type.allowsMarkType(c.type):Fa(c.type,n))?(l=c.addToSet(l),!1):!0),this.nodes.push(new jt(n,e,l,o,null,s)),this.open++,r}closeExtra(n=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(n));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(n){for(let e=this.open;e>=0;e--){if(this.nodes[e]==n)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=wt)}return!1}get currentPos(){this.closeExtra();let n=0;for(let e=this.open;e>=0;e--){let r=this.nodes[e].content;for(let o=r.length-1;o>=0;o--)n+=r[o].nodeSize;e&&n++}return n}findAtPoint(n,e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==n&&this.find[r].offset==e&&(this.find[r].pos=this.currentPos)}findInside(n){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].pos==null&&n.nodeType==1&&n.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(n,e,r){if(n!=e&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&n.nodeType==1&&n.contains(this.find[o].node)&&e.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(n){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==n&&(this.find[e].pos=this.currentPos-(n.nodeValue.length-this.find[e].offset))}matchesContext(n){if(n.indexOf("|")>-1)return n.split(/\s*\|\s*/).some(this.matchesContext,this);let e=n.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),a=(s,l)=>{for(;s>=0;s--){let c=e[s];if(c==""){if(s==e.length-1||s==0)continue;for(;l>=i;l--)if(a(s-1,l))return!0;return!1}else{let d=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return a(e.length-1,this.open)}textblockFromContext(){let n=this.options.context;if(n)for(let e=n.depth;e>=0;e--){let r=n.node(e).contentMatchAt(n.indexAfter(e)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let e in this.parser.schema.nodes){let r=this.parser.schema.nodes[e];if(r.isTextblock&&r.defaultAttrs)return r}}}function h0(t){for(let n=t.firstChild,e=null;n;n=n.nextSibling){let r=n.nodeType==1?n.nodeName.toLowerCase():null;r&&Xc.hasOwnProperty(r)&&e?(e.appendChild(n),n=e):r=="li"?e=n:r&&(e=null)}}function g0(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function Na(t){let n={};for(let e in t)n[e]=t[e];return n}function Fa(t,n){let e=n.schema.nodes;for(let r in e){let o=e[r];if(!o.allowsMarkType(t))continue;let i=[],a=s=>{i.push(s);for(let l=0;l<s.edgeCount;l++){let{type:c,next:d}=s.edge(l);if(c==n||i.indexOf(d)<0&&a(d))return!0}};if(a(o.contentMatch))return!0}}class Me{constructor(n,e){this.nodes=n,this.marks=e}serializeFragment(n,e={},r){r||(r=yo(e).createDocumentFragment());let o=r,i=[];return n.forEach(a=>{if(i.length||a.marks.length){let s=0,l=0;for(;s<i.length&&l<a.marks.length;){let c=a.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[s][0])||c.type.spec.spanning===!1)break;s++,l++}for(;s<i.length;)o=i.pop()[1];for(;l<a.marks.length;){let c=a.marks[l++],d=this.serializeMark(c,a.isInline,e);d&&(i.push([c,o]),o.appendChild(d.dom),o=d.contentDOM||d.dom)}}o.appendChild(this.serializeNodeInner(a,e))}),r}serializeNodeInner(n,e){let{dom:r,contentDOM:o}=Zt(yo(e),this.nodes[n.type.name](n),null,n.attrs);if(o){if(n.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(n.content,e,o)}return r}serializeNode(n,e={}){let r=this.serializeNodeInner(n,e);for(let o=n.marks.length-1;o>=0;o--){let i=this.serializeMark(n.marks[o],n.isInline,e);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(n,e,r={}){let o=this.marks[n.type.name];return o&&Zt(yo(r),o(n,e),null,n.attrs)}static renderSpec(n,e,r=null,o){return Zt(n,e,r,o)}static fromSchema(n){return n.cached.domSerializer||(n.cached.domSerializer=new Me(this.nodesFromSchema(n),this.marksFromSchema(n)))}static nodesFromSchema(n){let e=Ha(n.nodes);return e.text||(e.text=r=>r.text),e}static marksFromSchema(n){return Ha(n.marks)}}function Ha(t){let n={};for(let e in t){let r=t[e].spec.toDOM;r&&(n[e]=r)}return n}function yo(t){return t.document||window.document}const ja=new WeakMap;function u0(t){let n=ja.get(t);return n===void 0&&ja.set(t,n=f0(t)),n}function f0(t){let n=null;function e(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")n||(n=[]),n.push(r);else for(let o=0;o<r.length;o++)e(r[o]);else for(let o in r)e(r[o])}return e(t),n}function Zt(t,n,e,r){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let o=n[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=u0(r))&&i.indexOf(n)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=o.indexOf(" ");a>0&&(e=o.slice(0,a),o=o.slice(a+1));let s,l=e?t.createElementNS(e,o):t.createElement(o),c=n[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let h in c)if(c[h]!=null){let g=h.indexOf(" ");g>0?l.setAttributeNS(h.slice(0,g),h.slice(g+1),c[h]):h=="style"&&l.style?l.style.cssText=c[h]:l.setAttribute(h,c[h])}}for(let h=d;h<n.length;h++){let g=n[h];if(g===0){if(h<n.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:u,contentDOM:f}=Zt(t,g,e,r);if(l.appendChild(u),f){if(s)throw new RangeError("Multiple content holes");s=f}}}return{dom:l,contentDOM:s}}const Vc=65535,Wc=Math.pow(2,16);function m0(t,n){return t+n*Wc}function Xa(t){return t&Vc}function x0(t){return(t-(t&Vc))/Wc}const Uc=1,qc=2,nr=4,Kc=8;class oi{constructor(n,e,r){this.pos=n,this.delInfo=e,this.recover=r}get deleted(){return(this.delInfo&Kc)>0}get deletedBefore(){return(this.delInfo&(Uc|nr))>0}get deletedAfter(){return(this.delInfo&(qc|nr))>0}get deletedAcross(){return(this.delInfo&nr)>0}}class yn{constructor(n,e=!1){if(this.ranges=n,this.inverted=e,!n.length&&yn.empty)return yn.empty}recover(n){let e=0,r=Xa(n);if(!this.inverted)for(let o=0;o<r;o++)e+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+e+x0(n)}mapResult(n,e=1){return this._map(n,e,!1)}map(n,e=1){return this._map(n,e,!0)}_map(n,e,r){let o=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?o:0);if(l>n)break;let c=this.ranges[s+i],d=this.ranges[s+a],h=l+c;if(n<=h){let g=c?n==l?-1:n==h?1:e:e,u=l+o+(g<0?0:d);if(r)return u;let f=n==(e<0?l:h)?null:m0(s/3,n-l),m=n==l?qc:n==h?Uc:nr;return(e<0?n!=l:n!=h)&&(m|=Kc),new oi(u,m,f)}o+=d-c}return r?n+o:new oi(n+o,0,null)}touches(n,e){let r=0,o=Xa(e),i=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>n)break;let c=this.ranges[s+i],d=l+c;if(n<=d&&s==o*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(n){let e=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let a=this.ranges[o],s=a-(this.inverted?i:0),l=a+(this.inverted?0:i),c=this.ranges[o+e],d=this.ranges[o+r];n(s,s+c,l,l+d),i+=d-c}}invert(){return new yn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(n){return n==0?yn.empty:new yn(n<0?[0,-n,0]:[0,0,n])}}yn.empty=new yn([]);class _t{constructor(n,e,r=0,o=n?n.length:0){this.mirror=e,this.from=r,this.to=o,this._maps=n||[],this.ownData=!(n||e)}get maps(){return this._maps}slice(n=0,e=this.maps.length){return new _t(this._maps,this.mirror,n,e)}appendMap(n,e){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(n),e!=null&&this.setMirror(this._maps.length-1,e)}appendMapping(n){for(let e=0,r=this._maps.length;e<n._maps.length;e++){let o=n.getMirror(e);this.appendMap(n._maps[e],o!=null&&o<e?r+o:void 0)}}getMirror(n){if(this.mirror){for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==n)return this.mirror[e+(e%2?-1:1)]}}setMirror(n,e){this.mirror||(this.mirror=[]),this.mirror.push(n,e)}appendMappingInverted(n){for(let e=n.maps.length-1,r=this._maps.length+n._maps.length;e>=0;e--){let o=n.getMirror(e);this.appendMap(n._maps[e].invert(),o!=null&&o>e?r-o-1:void 0)}}invert(){let n=new _t;return n.appendMappingInverted(this),n}map(n,e=1){if(this.mirror)return this._map(n,e,!0);for(let r=this.from;r<this.to;r++)n=this._maps[r].map(n,e);return n}mapResult(n,e=1){return this._map(n,e,!1)}_map(n,e,r){let o=0;for(let i=this.from;i<this.to;i++){let a=this._maps[i],s=a.mapResult(n,e);if(s.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,n=this._maps[l].recover(s.recover);continue}}o|=s.delInfo,n=s.pos}return r?n:new oi(n,o,null)}}const vo=Object.create(null);class pn{getMap(){return yn.empty}merge(n){return null}static fromJSON(n,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=vo[e.stepType];if(!r)throw new RangeError(`No step type ${e.stepType} defined`);return r.fromJSON(n,e)}static jsonID(n,e){if(n in vo)throw new RangeError("Duplicate use of step JSON ID "+n);return vo[n]=e,e.prototype.jsonID=n,e}}class Y{constructor(n,e){this.doc=n,this.failed=e}static ok(n){return new Y(n,null)}static fail(n){return new Y(null,n)}static fromReplace(n,e,r,o){try{return Y.ok(n.replace(e,r,o))}catch(i){if(i instanceof dr)return Y.fail(i.message);throw i}}}function Pi(t,n,e){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(Pi(i.content,n,i))),i.isInline&&(i=n(i,e,o)),r.push(i)}return y.fromArray(r)}class Yn extends pn{constructor(n,e,r){super(),this.from=n,this.to=e,this.mark=r}apply(n){let e=n.slice(this.from,this.to),r=n.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new w(Pi(e.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),o),e.openStart,e.openEnd);return Y.fromReplace(n,this.from,this.to,i)}invert(){return new zn(this.from,this.to,this.mark)}map(n){let e=n.mapResult(this.from,1),r=n.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new Yn(e.pos,r.pos,this.mark)}merge(n){return n instanceof Yn&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from?new Yn(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(n,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Yn(e.from,e.to,n.markFromJSON(e.mark))}}pn.jsonID("addMark",Yn);class zn extends pn{constructor(n,e,r){super(),this.from=n,this.to=e,this.mark=r}apply(n){let e=n.slice(this.from,this.to),r=new w(Pi(e.content,o=>o.mark(this.mark.removeFromSet(o.marks)),n),e.openStart,e.openEnd);return Y.fromReplace(n,this.from,this.to,r)}invert(){return new Yn(this.from,this.to,this.mark)}map(n){let e=n.mapResult(this.from,1),r=n.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new zn(e.pos,r.pos,this.mark)}merge(n){return n instanceof zn&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from?new zn(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(n,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new zn(e.from,e.to,n.markFromJSON(e.mark))}}pn.jsonID("removeMark",zn);class Qn extends pn{constructor(n,e){super(),this.pos=n,this.mark=e}apply(n){let e=n.nodeAt(this.pos);if(!e)return Y.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return Y.fromReplace(n,this.pos,this.pos+1,new w(y.from(r),0,e.isLeaf?0:1))}invert(n){let e=n.nodeAt(this.pos);if(e){let r=this.mark.addToSet(e.marks);if(r.length==e.marks.length){for(let o=0;o<e.marks.length;o++)if(!e.marks[o].isInSet(r))return new Qn(this.pos,e.marks[o]);return new Qn(this.pos,this.mark)}}return new Ee(this.pos,this.mark)}map(n){let e=n.mapResult(this.pos,1);return e.deletedAfter?null:new Qn(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(n,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Qn(e.pos,n.markFromJSON(e.mark))}}pn.jsonID("addNodeMark",Qn);class Ee extends pn{constructor(n,e){super(),this.pos=n,this.mark=e}apply(n){let e=n.nodeAt(this.pos);if(!e)return Y.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return Y.fromReplace(n,this.pos,this.pos+1,new w(y.from(r),0,e.isLeaf?0:1))}invert(n){let e=n.nodeAt(this.pos);return!e||!this.mark.isInSet(e.marks)?this:new Qn(this.pos,this.mark)}map(n){let e=n.mapResult(this.pos,1);return e.deletedAfter?null:new Ee(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(n,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ee(e.pos,n.markFromJSON(e.mark))}}pn.jsonID("removeNodeMark",Ee);class J extends pn{constructor(n,e,r,o=!1){super(),this.from=n,this.to=e,this.slice=r,this.structure=o}apply(n){return this.structure&&ii(n,this.from,this.to)?Y.fail("Structure replace would overwrite content"):Y.fromReplace(n,this.from,this.to,this.slice)}getMap(){return new yn([this.from,this.to-this.from,this.slice.size])}invert(n){return new J(this.from,this.from+this.slice.size,n.slice(this.from,this.to))}map(n){let e=n.mapResult(this.to,-1),r=this.from==this.to&&J.MAP_BIAS<0?e:n.mapResult(this.from,1);return r.deletedAcross&&e.deletedAcross?null:new J(r.pos,Math.max(r.pos,e.pos),this.slice,this.structure)}merge(n){if(!(n instanceof J)||n.structure||this.structure)return null;if(this.from+this.slice.size==n.from&&!this.slice.openEnd&&!n.slice.openStart){let e=this.slice.size+n.slice.size==0?w.empty:new w(this.slice.content.append(n.slice.content),this.slice.openStart,n.slice.openEnd);return new J(this.from,this.to+(n.to-n.from),e,this.structure)}else if(n.to==this.from&&!this.slice.openStart&&!n.slice.openEnd){let e=this.slice.size+n.slice.size==0?w.empty:new w(n.slice.content.append(this.slice.content),n.slice.openStart,this.slice.openEnd);return new J(n.from,this.to,e,this.structure)}else return null}toJSON(){let n={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n}static fromJSON(n,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new J(e.from,e.to,w.fromJSON(n,e.slice),!!e.structure)}}J.MAP_BIAS=1;pn.jsonID("replace",J);class Z extends pn{constructor(n,e,r,o,i,a,s=!1){super(),this.from=n,this.to=e,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=a,this.structure=s}apply(n){if(this.structure&&(ii(n,this.from,this.gapFrom)||ii(n,this.gapTo,this.to)))return Y.fail("Structure gap-replace would overwrite content");let e=n.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return Y.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,e.content);return r?Y.fromReplace(n,this.from,this.to,r):Y.fail("Content does not fit in gap")}getMap(){return new yn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(n){let e=this.gapTo-this.gapFrom;return new Z(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,n.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(n){let e=n.mapResult(this.from,1),r=n.mapResult(this.to,-1),o=this.from==this.gapFrom?e.pos:n.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:n.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||o<e.pos||i>r.pos?null:new Z(e.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let n={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n}static fromJSON(n,e){if(typeof e.from!="number"||typeof e.to!="number"||typeof e.gapFrom!="number"||typeof e.gapTo!="number"||typeof e.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Z(e.from,e.to,e.gapFrom,e.gapTo,w.fromJSON(n,e.slice),e.insert,!!e.structure)}}pn.jsonID("replaceAround",Z);function ii(t,n,e){let r=t.resolve(n),o=e-n,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let a=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}}return!1}function b0(t,n,e,r){let o=[],i=[],a,s;t.doc.nodesBetween(n,e,(l,c,d)=>{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let g=Math.max(c,n),u=Math.min(c+l.nodeSize,e),f=r.addToSet(h);for(let m=0;m<h.length;m++)h[m].isInSet(f)||(a&&a.to==g&&a.mark.eq(h[m])?a.to=u:o.push(a=new zn(g,u,h[m])));s&&s.to==g?s.to=u:i.push(s=new Yn(g,u,r))}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function y0(t,n,e,r){let o=[],i=0;t.doc.nodesBetween(n,e,(a,s)=>{if(!a.isInline)return;i++;let l=null;if(r instanceof Zr){let c=a.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(a.marks)&&(l=[r]):l=a.marks;if(l&&l.length){let c=Math.min(s+a.nodeSize,e);for(let d=0;d<l.length;d++){let h=l[d],g;for(let u=0;u<o.length;u++){let f=o[u];f.step==i-1&&h.eq(o[u].style)&&(g=f)}g?(g.to=c,g.step=i):o.push({style:h,from:Math.max(s,n),to:c,step:i})}}}),o.forEach(a=>t.step(new zn(a.from,a.to,a.style)))}function Ri(t,n,e,r=e.contentMatch,o=!0){let i=t.doc.nodeAt(n),a=[],s=n+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),d=s+c.nodeSize,h=r.matchType(c.type);if(!h)a.push(new J(s,d,w.empty));else{r=h;for(let g=0;g<c.marks.length;g++)e.allowsMarkType(c.marks[g].type)||t.step(new zn(s,d,c.marks[g]));if(o&&c.isText&&e.whitespace!="pre"){let g,u=/\r?\n|\r/g,f;for(;g=u.exec(c.text);)f||(f=new w(y.from(e.schema.text(" ",e.allowedMarks(c.marks))),0,0)),a.push(new J(s+g.index,s+g.index+g[0].length,f))}}s=d}if(!r.validEnd){let l=r.fillBefore(y.empty,!0);t.replace(s,s,new w(l,0,0))}for(let l=a.length-1;l>=0;l--)t.step(a[l])}function v0(t,n,e){return(n==0||t.canReplace(n,t.childCount))&&(e==t.childCount||t.canReplace(0,e))}function Qe(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,o=0,i=0;;--r){let a=t.$from.node(r),s=t.$from.index(r)+o,l=t.$to.indexAfter(r)-i;if(r<t.depth&&a.canReplace(s,l,e))return r;if(r==0||a.type.spec.isolating||!v0(a,s,l))break;s&&(o=1),l<a.childCount&&(i=1)}return null}function k0(t,n,e){let{$from:r,$to:o,depth:i}=n,a=r.before(i+1),s=o.after(i+1),l=a,c=s,d=y.empty,h=0;for(let f=i,m=!1;f>e;f--)m||r.index(f)>0?(m=!0,d=y.from(r.node(f).copy(d)),h++):l--;let g=y.empty,u=0;for(let f=i,m=!1;f>e;f--)m||o.after(f+1)<o.end(f)?(m=!0,g=y.from(o.node(f).copy(g)),u++):c++;t.step(new Z(l,c,a,s,new w(d.append(g),h,u),d.size-h,!0))}function Bi(t,n,e=null,r=t){let o=w0(t,n),i=o&&_0(r,n);return i?o.map(Va).concat({type:n,attrs:e}).concat(i.map(Va)):null}function Va(t){return{type:t,attrs:null}}function w0(t,n){let{parent:e,startIndex:r,endIndex:o}=t,i=e.contentMatchAt(r).findWrapping(n);if(!i)return null;let a=i.length?i[0]:n;return e.canReplaceWith(r,o,a)?i:null}function _0(t,n){let{parent:e,startIndex:r,endIndex:o}=t,i=e.child(r),a=n.contentMatch.findWrapping(i.type);if(!a)return null;let l=(a.length?a[a.length-1]:n).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(e.child(c).type);return!l||!l.validEnd?null:a}function C0(t,n,e){let r=y.empty;for(let a=e.length-1;a>=0;a--){if(r.size){let s=e[a].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=y.from(e[a].type.create(e[a].attrs,r))}let o=n.start,i=n.end;t.step(new Z(o,i,o,i,new w(r,0,0),e.length,!0))}function S0(t,n,e,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(n,e,(a,s)=>{let l=typeof o=="function"?o(a):o;if(a.isTextblock&&!a.hasMarkup(r,l)&&E0(t.doc,t.mapping.slice(i).map(s),r)){let c=null;if(r.schema.linebreakReplacement){let u=r.whitespace=="pre",f=!!r.contentMatch.matchType(r.schema.linebreakReplacement);u&&!f?c=!1:!u&&f&&(c=!0)}c===!1&&Gc(t,a,s,i),Ri(t,t.mapping.slice(i).map(s,1),r,void 0,c===null);let d=t.mapping.slice(i),h=d.map(s,1),g=d.map(s+a.nodeSize,1);return t.step(new Z(h,g,h+1,g-1,new w(y.from(r.create(l,null,a.marks)),0,0),1,!0)),c===!0&&Jc(t,a,s,i),!1}})}function Jc(t,n,e,r){n.forEach((o,i)=>{if(o.isText){let a,s=/\r?\n|\r/g;for(;a=s.exec(o.text);){let l=t.mapping.slice(r).map(e+1+i+a.index);t.replaceWith(l,l+1,n.type.schema.linebreakReplacement.create())}}})}function Gc(t,n,e,r){n.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(e+1+i);t.replaceWith(a,a+1,n.type.schema.text(`
|
|
20995
|
+
`))}})}function E0(t,n,e){let r=t.resolve(n),o=r.index();return r.parent.canReplaceWith(o,o+1,e)}function I0(t,n,e,r,o){let i=t.doc.nodeAt(n);if(!i)throw new RangeError("No node at given position");e||(e=i.type);let a=e.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(n,n+i.nodeSize,a);if(!e.validContent(i.content))throw new RangeError("Invalid content for node type "+e.name);t.step(new Z(n,n+i.nodeSize,n+1,n+i.nodeSize-1,new w(y.from(a),0,0),1,!0))}function Xe(t,n,e=1,r){let o=t.resolve(n),i=o.depth-e,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,d=e-2;c>i;c--,d--){let h=o.node(c),g=o.index(c);if(h.type.spec.isolating)return!1;let u=h.content.cutByIndex(g,h.childCount),f=r&&r[d+1];f&&(u=u.replaceChild(0,f.type.create(f.attrs)));let m=r&&r[d]||h;if(!h.canReplace(g+1,h.childCount)||!m.type.validContent(u))return!1}let s=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(s,s,l?l.type:o.node(i+1).type)}function $0(t,n,e=1,r){let o=t.doc.resolve(n),i=y.empty,a=y.empty;for(let s=o.depth,l=o.depth-e,c=e-1;s>l;s--,c--){i=y.from(o.node(s).copy(i));let d=r&&r[c];a=y.from(d?d.type.create(d.attrs,a):o.node(s).copy(a))}t.step(new J(n,n,new w(i.append(a),e,e),!0))}function le(t,n){let e=t.resolve(n),r=e.index();return Yc(e.nodeBefore,e.nodeAfter)&&e.parent.canReplace(r,r+1)}function T0(t,n){n.content.size||t.type.compatibleContent(n.type);let e=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<n.childCount;o++){let i=n.child(o),a=i.type==r?t.type.schema.nodes.text:i.type;if(e=e.matchType(a),!e||!t.type.allowsMarks(i.marks))return!1}return e.validEnd}function Yc(t,n){return!!(t&&n&&!t.isLeaf&&T0(t,n))}function no(t,n,e=-1){let r=t.resolve(n);for(let o=r.depth;;o--){let i,a,s=r.index(o);if(o==r.depth?(i=r.nodeBefore,a=r.nodeAfter):e>0?(i=r.node(o+1),s++,a=r.node(o).maybeChild(s)):(i=r.node(o).maybeChild(s-1),a=r.node(o+1)),i&&!i.isTextblock&&Yc(i,a)&&r.node(o).canReplace(s,s+1))return n;if(o==0)break;n=e<0?r.before(o):r.after(o)}}function M0(t,n,e){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(n-e),a=i.node().type;if(o&&a.inlineContent){let d=a.whitespace=="pre",h=!!a.contentMatch.matchType(o);d&&!h?r=!1:!d&&h&&(r=!0)}let s=t.steps.length;if(r===!1){let d=t.doc.resolve(n+e);Gc(t,d.node(),d.before(),s)}a.inlineContent&&Ri(t,n+e-1,a,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(s),c=l.map(n-e);if(t.step(new J(c,l.map(n+e,-1),w.empty,!0)),r===!0){let d=t.doc.resolve(c);Jc(t,d.node(),d.before(),t.steps.length)}return t}function D0(t,n,e){let r=t.resolve(n);if(r.parent.canReplaceWith(r.index(),r.index(),e))return n;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,e))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,e))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function Qc(t,n,e){let r=t.resolve(n);if(!e.content.size)return n;let o=e.content;for(let i=0;i<e.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(e.openStart==0&&e.size?2:1);i++)for(let a=r.depth;a>=0;a--){let s=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,l=r.index(a)+(s>0?1:0),c=r.node(a),d=!1;if(i==1)d=c.canReplace(l,l,o);else{let h=c.contentMatchAt(l).findWrapping(o.firstChild.type);d=h&&c.canReplaceWith(l,l,h[0])}if(d)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}function eo(t,n,e=n,r=w.empty){if(n==e&&!r.size)return null;let o=t.resolve(n),i=t.resolve(e);return Zc(o,i,r)?new J(n,e,r):new z0(o,i,r).fit()}function Zc(t,n,e){return!e.openStart&&!e.openEnd&&t.start()==n.start()&&t.parent.canReplace(t.index(),n.index(),e.content)}class z0{constructor(n,e,r){this.$from=n,this.$to=e,this.unplaced=r,this.frontier=[],this.placed=y.empty;for(let o=0;o<=n.depth;o++){let i=n.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(n.indexAfter(o))})}for(let o=n.depth;o>0;o--)this.placed=y.from(n.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 n=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(n<0?this.$to:r.doc.resolve(n));if(!o)return null;let i=this.placed,a=r.depth,s=o.depth;for(;a&&s&&i.childCount==1;)i=i.firstChild.content,a--,s--;let l=new w(i,a,s);return n>-1?new Z(r.pos,n,this.$to.pos,this.$to.end(),l,e):l.size||r.pos!=this.$to.pos?new J(r.pos,o.pos,l):null}findFittable(){let n=this.unplaced.openStart;for(let e=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<n;r++){let i=e.firstChild;if(e.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){n=r;break}e=i.content}for(let e=1;e<=2;e++)for(let r=e==1?n:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=ko(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let a=o.firstChild;for(let s=this.depth;s>=0;s--){let{type:l,match:c}=this.frontier[s],d,h=null;if(e==1&&(a?c.matchType(a.type)||(h=c.fillBefore(y.from(a),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:s,parent:i,inject:h};if(e==2&&a&&(d=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:i,wrap:d};if(i&&c.matchType(i.type))break}}}openMore(){let{content:n,openStart:e,openEnd:r}=this.unplaced,o=ko(n,e);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new w(n,e+1,Math.max(r,o.size+e>=n.size-r?e+1:0)),!0)}dropNode(){let{content:n,openStart:e,openEnd:r}=this.unplaced,o=ko(n,e);if(o.childCount<=1&&e>0){let i=n.size-e<=e+o.size;this.unplaced=new w(it(n,e-1,1),e-1,i?e-1:r)}else this.unplaced=new w(it(n,e,1),e,r)}placeNodes({sliceDepth:n,frontierDepth:e,parent:r,inject:o,wrap:i}){for(;this.depth>e;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let a=this.unplaced,s=r?r.content:a.content,l=a.openStart-n,c=0,d=[],{match:h,type:g}=this.frontier[e];if(o){for(let m=0;m<o.childCount;m++)d.push(o.child(m));h=h.matchFragment(o)}let u=s.size+n-(a.content.size-a.openEnd);for(;c<s.childCount;){let m=s.child(c),x=h.matchType(m.type);if(!x)break;c++,(c>1||l==0||m.content.size)&&(h=x,d.push(nd(m.mark(g.allowedMarks(m.marks)),c==1?l:0,c==s.childCount?u:-1)))}let f=c==s.childCount;f||(u=-1),this.placed=at(this.placed,e,y.from(d)),this.frontier[e].match=h,f&&u<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,x=s;m<u;m++){let b=x.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),x=b.content}this.unplaced=f?n==0?w.empty:new w(it(a.content,n-1,1),n-1,u<0?a.openEnd:n-1):new w(it(a.content,n,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let n=this.frontier[this.depth],e;if(!n.type.isTextblock||!wo(this.$to,this.$to.depth,n.type,n.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.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(n){n:for(let e=Math.min(this.depth,n.depth);e>=0;e--){let{match:r,type:o}=this.frontier[e],i=e<n.depth&&n.end(e+1)==n.pos+(n.depth-(e+1)),a=wo(n,e,o,r,i);if(a){for(let s=e-1;s>=0;s--){let{match:l,type:c}=this.frontier[s],d=wo(n,s,c,l,!0);if(!d||d.childCount)continue n}return{depth:e,fit:a,move:i?n.doc.resolve(n.after(e+1)):n}}}}close(n){let e=this.findCloseLevel(n);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=at(this.placed,e.depth,e.fit)),n=e.move;for(let r=e.depth+1;r<=n.depth;r++){let o=n.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,n.index(r));this.openFrontierNode(o.type,o.attrs,i)}return n}openFrontierNode(n,e=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(n),this.placed=at(this.placed,this.depth,y.from(n.create(e,r))),this.frontier.push({type:n,match:n.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(y.empty,!0);e.childCount&&(this.placed=at(this.placed,this.frontier.length,e))}}function it(t,n,e){return n==0?t.cutByIndex(e,t.childCount):t.replaceChild(0,t.firstChild.copy(it(t.firstChild.content,n-1,e)))}function at(t,n,e){return n==0?t.append(e):t.replaceChild(t.childCount-1,t.lastChild.copy(at(t.lastChild.content,n-1,e)))}function ko(t,n){for(let e=0;e<n;e++)t=t.firstChild.content;return t}function nd(t,n,e){if(n<=0)return t;let r=t.content;return n>1&&(r=r.replaceChild(0,nd(r.firstChild,n-1,r.childCount==1?e-1:0))),n>0&&(r=t.type.contentMatch.fillBefore(r).append(r),e<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(y.empty,!0)))),t.copy(r)}function wo(t,n,e,r,o){let i=t.node(n),a=o?t.indexAfter(n):t.index(n);if(a==i.childCount&&!e.compatibleContent(i.type))return null;let s=r.fillBefore(i.content,!0,a);return s&&!O0(e,i.content,a)?s:null}function O0(t,n,e){for(let r=e;r<n.childCount;r++)if(!t.allowsMarks(n.child(r).marks))return!0;return!1}function A0(t){return t.spec.defining||t.spec.definingForContent}function L0(t,n,e,r){if(!r.size)return t.deleteRange(n,e);let o=t.doc.resolve(n),i=t.doc.resolve(e);if(Zc(o,i,r))return t.step(new J(n,e,r));let a=td(o,i);a[a.length-1]==0&&a.pop();let s=-(o.depth+1);a.unshift(s);for(let g=o.depth,u=o.pos-1;g>0;g--,u--){let f=o.node(g).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;a.indexOf(g)>-1?s=g:o.before(g)==u&&a.splice(1,0,-g)}let l=a.indexOf(s),c=[],d=r.openStart;for(let g=r.content,u=0;;u++){let f=g.firstChild;if(c.push(f),u==r.openStart)break;g=f.content}for(let g=d-1;g>=0;g--){let u=c[g],f=A0(u.type);if(f&&!u.sameMarkup(o.node(Math.abs(s)-1)))d=g;else if(f||!u.type.isTextblock)break}for(let g=r.openStart;g>=0;g--){let u=(g+d+1)%(r.openStart+1),f=c[u];if(f)for(let m=0;m<a.length;m++){let x=a[(m+l)%a.length],b=!0;x<0&&(b=!1,x=-x);let _=o.node(x-1),D=o.index(x-1);if(_.canReplaceWith(D,D,f.type,f.marks))return t.replace(o.before(x),b?i.after(x):e,new w(ed(r.content,0,r.openStart,u),u,r.openEnd))}}let h=t.steps.length;for(let g=a.length-1;g>=0&&(t.replace(n,e,r),!(t.steps.length>h));g--){let u=a[g];u<0||(n=o.before(u),e=i.after(u))}}function ed(t,n,e,r,o){if(n<e){let i=t.firstChild;t=t.replaceChild(0,i.copy(ed(i.content,n+1,e,r,i)))}if(n>r){let i=o.contentMatchAt(0),a=i.fillBefore(t).append(t);t=a.append(i.matchFragment(a).fillBefore(y.empty,!0))}return t}function P0(t,n,e,r){if(!r.isInline&&n==e&&t.doc.resolve(n).parent.content.size){let o=D0(t.doc,n,r.type);o!=null&&(n=e=o)}t.replaceRange(n,e,new w(y.from(r),0,0))}function R0(t,n,e){let r=t.doc.resolve(n),o=t.doc.resolve(e);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&r.parentOffset==0&&o.parentOffset==0){let a=r.sharedDepth(e),s=!1;for(let l=r.depth;l>a;l--)r.node(l).type.spec.isolating&&(s=!0);for(let l=o.depth;l>a;l--)o.node(l).type.spec.isolating&&(s=!0);if(!s){for(let l=r.depth;l>0&&n==r.start(l);l--)n=r.before(l);for(let l=o.depth;l>0&&e==o.start(l);l--)e=o.before(l);r=t.doc.resolve(n),o=t.doc.resolve(e)}}let i=td(r,o);for(let a=0;a<i.length;a++){let s=i[a],l=a==i.length-1;if(l&&s==0||r.node(s).type.contentMatch.validEnd)return t.delete(r.start(s),o.end(s));if(s>0&&(l||r.node(s-1).canReplace(r.index(s-1),o.indexAfter(s-1))))return t.delete(r.before(s),o.after(s))}for(let a=1;a<=r.depth&&a<=o.depth;a++)if(n-r.start(a)==r.depth-a&&e>r.end(a)&&o.end(a)-e!=o.depth-a&&r.start(a-1)==o.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),o.index(a-1)))return t.delete(r.before(a),e);t.delete(n,e)}function td(t,n){let e=[],r=Math.min(t.depth,n.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||n.end(o)>n.pos+(n.depth-o)||t.node(o).type.spec.isolating||n.node(o).type.spec.isolating)break;(i==n.start(o)||o==t.depth&&o==n.depth&&t.parent.inlineContent&&n.parent.inlineContent&&o&&n.start(o-1)==i-1)&&e.push(o)}return e}class Ve extends pn{constructor(n,e,r){super(),this.pos=n,this.attr=e,this.value=r}apply(n){let e=n.nodeAt(this.pos);if(!e)return Y.fail("No node at attribute step's position");let r=Object.create(null);for(let i in e.attrs)r[i]=e.attrs[i];r[this.attr]=this.value;let o=e.type.create(r,null,e.marks);return Y.fromReplace(n,this.pos,this.pos+1,new w(y.from(o),0,e.isLeaf?0:1))}getMap(){return yn.empty}invert(n){return new Ve(this.pos,this.attr,n.nodeAt(this.pos).attrs[this.attr])}map(n){let e=n.mapResult(this.pos,1);return e.deletedAfter?null:new Ve(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(n,e){if(typeof e.pos!="number"||typeof e.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ve(e.pos,e.attr,e.value)}}pn.jsonID("attr",Ve);class Ct extends pn{constructor(n,e){super(),this.attr=n,this.value=e}apply(n){let e=Object.create(null);for(let o in n.attrs)e[o]=n.attrs[o];e[this.attr]=this.value;let r=n.type.create(e,n.content,n.marks);return Y.ok(r)}getMap(){return yn.empty}invert(n){return new Ct(this.attr,n.attrs[this.attr])}map(n){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(n,e){if(typeof e.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ct(e.attr,e.value)}}pn.jsonID("docAttr",Ct);let qe=class extends Error{};qe=function t(n){let e=Error.call(this,n);return e.__proto__=t.prototype,e};qe.prototype=Object.create(Error.prototype);qe.prototype.constructor=qe;qe.prototype.name="TransformError";class rd{constructor(n){this.doc=n,this.steps=[],this.docs=[],this.mapping=new _t}get before(){return this.docs.length?this.docs[0]:this.doc}step(n){let e=this.maybeStep(n);if(e.failed)throw new qe(e.failed);return this}maybeStep(n){let e=n.apply(this.doc);return e.failed||this.addStep(n,e.doc),e}get docChanged(){return this.steps.length>0}changedRange(){let n=1e9,e=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let o=this.mapping.maps[r];r&&(n=o.map(n,1),e=o.map(e,-1)),o.forEach((i,a,s,l)=>{n=Math.min(n,s),e=Math.max(e,l)})}return n==1e9?null:{from:n,to:e}}addStep(n,e){this.docs.push(this.doc),this.steps.push(n),this.mapping.appendMap(n.getMap()),this.doc=e}replace(n,e=n,r=w.empty){let o=eo(this.doc,n,e,r);return o&&this.step(o),this}replaceWith(n,e,r){return this.replace(n,e,new w(y.from(r),0,0))}delete(n,e){return this.replace(n,e,w.empty)}insert(n,e){return this.replaceWith(n,n,e)}replaceRange(n,e,r){return L0(this,n,e,r),this}replaceRangeWith(n,e,r){return P0(this,n,e,r),this}deleteRange(n,e){return R0(this,n,e),this}lift(n,e){return k0(this,n,e),this}join(n,e=1){return M0(this,n,e),this}wrap(n,e){return C0(this,n,e),this}setBlockType(n,e=n,r,o=null){return S0(this,n,e,r,o),this}setNodeMarkup(n,e,r=null,o){return I0(this,n,e,r,o),this}setNodeAttribute(n,e,r){return this.step(new Ve(n,e,r)),this}setDocAttribute(n,e){return this.step(new Ct(n,e)),this}addNodeMark(n,e){return this.step(new Qn(n,e)),this}removeNodeMark(n,e){let r=this.doc.nodeAt(n);if(!r)throw new RangeError("No node at position "+n);if(e instanceof j)e.isInSet(r.marks)&&this.step(new Ee(n,e));else{let o=r.marks,i,a=[];for(;i=e.isInSet(o);)a.push(new Ee(n,i)),o=i.removeFromSet(o);for(let s=a.length-1;s>=0;s--)this.step(a[s])}return this}split(n,e=1,r){return $0(this,n,e,r),this}addMark(n,e,r){return b0(this,n,e,r),this}removeMark(n,e,r){return y0(this,n,e,r),this}clearIncompatible(n,e,r){return Ri(this,n,e,r),this}}const _o=Object.create(null);class B{constructor(n,e,r){this.$anchor=n,this.$head=e,this.ranges=r||[new B0(n.min(e),n.max(e))]}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 n=this.ranges;for(let e=0;e<n.length;e++)if(n[e].$from.pos!=n[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(n,e=w.empty){let r=e.content.lastChild,o=null;for(let s=0;s<e.openEnd;s++)o=r,r=r.lastChild;let i=n.steps.length,a=this.ranges;for(let s=0;s<a.length;s++){let{$from:l,$to:c}=a[s],d=n.mapping.slice(i);n.replaceRange(d.map(l.pos),d.map(c.pos),s?w.empty:e),s==0&&qa(n,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(n,e){let r=n.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:a,$to:s}=o[i],l=n.mapping.slice(r),c=l.map(a.pos),d=l.map(s.pos);i?n.deleteRange(c,d):(n.replaceRangeWith(c,d,e),qa(n,r,e.isInline?-1:1))}}static findFrom(n,e,r=!1){let o=n.parent.inlineContent?new P(n):Pe(n.node(0),n.parent,n.pos,n.index(),e,r);if(o)return o;for(let i=n.depth-1;i>=0;i--){let a=e<0?Pe(n.node(0),n.node(i),n.before(i+1),n.index(i),e,r):Pe(n.node(0),n.node(i),n.after(i+1),n.index(i)+1,e,r);if(a)return a}return null}static near(n,e=1){return this.findFrom(n,e)||this.findFrom(n,-e)||new Sn(n.node(0))}static atStart(n){return Pe(n,n,0,0,1)||new Sn(n)}static atEnd(n){return Pe(n,n,n.content.size,n.childCount,-1)||new Sn(n)}static fromJSON(n,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=_o[e.type];if(!r)throw new RangeError(`No selection type ${e.type} defined`);return r.fromJSON(n,e)}static jsonID(n,e){if(n in _o)throw new RangeError("Duplicate use of selection JSON ID "+n);return _o[n]=e,e.prototype.jsonID=n,e}getBookmark(){return P.between(this.$anchor,this.$head).getBookmark()}}B.prototype.visible=!0;class B0{constructor(n,e){this.$from=n,this.$to=e}}let Wa=!1;function Ua(t){!Wa&&!t.parent.inlineContent&&(Wa=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class P extends B{constructor(n,e=n){Ua(n),Ua(e),super(n,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(n,e){let r=n.resolve(e.map(this.head));if(!r.parent.inlineContent)return B.near(r);let o=n.resolve(e.map(this.anchor));return new P(o.parent.inlineContent?o:r,r)}replace(n,e=w.empty){if(super.replace(n,e),e==w.empty){let r=this.$from.marksAcross(this.$to);r&&n.ensureMarks(r)}}eq(n){return n instanceof P&&n.anchor==this.anchor&&n.head==this.head}getBookmark(){return new to(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(n,e){if(typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new P(n.resolve(e.anchor),n.resolve(e.head))}static create(n,e,r=e){let o=n.resolve(e);return new this(o,r==e?o:n.resolve(r))}static between(n,e,r){let o=n.pos-e.pos;if((!r||o)&&(r=o>=0?1:-1),!e.parent.inlineContent){let i=B.findFrom(e,r,!0)||B.findFrom(e,-r,!0);if(i)e=i.$head;else return B.near(e,r)}return n.parent.inlineContent||(o==0?n=e:(n=(B.findFrom(n,-r,!0)||B.findFrom(n,r,!0)).$anchor,n.pos<e.pos!=o<0&&(n=e))),new P(n,e)}}B.jsonID("text",P);class to{constructor(n,e){this.anchor=n,this.head=e}map(n){return new to(n.map(this.anchor),n.map(this.head))}resolve(n){return P.between(n.resolve(this.anchor),n.resolve(this.head))}}class O extends B{constructor(n){let e=n.nodeAfter,r=n.node(0).resolve(n.pos+e.nodeSize);super(n,r),this.node=e}map(n,e){let{deleted:r,pos:o}=e.mapResult(this.anchor),i=n.resolve(o);return r?B.near(i):new O(i)}content(){return new w(y.from(this.node),0,0)}eq(n){return n instanceof O&&n.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ni(this.anchor)}static fromJSON(n,e){if(typeof e.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new O(n.resolve(e.anchor))}static create(n,e){return new O(n.resolve(e))}static isSelectable(n){return!n.isText&&n.type.spec.selectable!==!1}}O.prototype.visible=!1;B.jsonID("node",O);class Ni{constructor(n){this.anchor=n}map(n){let{deleted:e,pos:r}=n.mapResult(this.anchor);return e?new to(r,r):new Ni(r)}resolve(n){let e=n.resolve(this.anchor),r=e.nodeAfter;return r&&O.isSelectable(r)?new O(e):B.near(e)}}class Sn extends B{constructor(n){super(n.resolve(0),n.resolve(n.content.size))}replace(n,e=w.empty){if(e==w.empty){n.delete(0,n.doc.content.size);let r=B.atStart(n.doc);r.eq(n.selection)||n.setSelection(r)}else super.replace(n,e)}toJSON(){return{type:"all"}}static fromJSON(n){return new Sn(n)}map(n){return new Sn(n)}eq(n){return n instanceof Sn}getBookmark(){return N0}}B.jsonID("all",Sn);const N0={map(){return this},resolve(t){return new Sn(t)}};function Pe(t,n,e,r,o,i=!1){if(n.inlineContent)return P.create(t,e);for(let a=r-(o>0?0:1);o>0?a<n.childCount:a>=0;a+=o){let s=n.child(a);if(s.isAtom){if(!i&&O.isSelectable(s))return O.create(t,e-(o<0?s.nodeSize:0))}else{let l=Pe(t,s,e+o,o<0?s.childCount:0,o,i);if(l)return l}e+=s.nodeSize*o}return null}function qa(t,n,e){let r=t.steps.length-1;if(r<n)return;let o=t.steps[r];if(!(o instanceof J||o instanceof Z))return;let i=t.mapping.maps[r],a;i.forEach((s,l,c,d)=>{a==null&&(a=d)}),t.setSelection(B.near(t.doc.resolve(a),e))}const Ka=1,Ja=2,Ga=4;class F0 extends rd{constructor(n){super(n.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=n.selection,this.storedMarks=n.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(n){if(n.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=n,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Ka)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ka)>0}setStoredMarks(n){return this.storedMarks=n,this.updated|=Ja,this}ensureMarks(n){return j.sameSet(this.storedMarks||this.selection.$from.marks(),n)||this.setStoredMarks(n),this}addStoredMark(n){return this.ensureMarks(n.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(n){return this.ensureMarks(n.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ja)>0}addStep(n,e){super.addStep(n,e),this.updated=this.updated&-3,this.storedMarks=null}setTime(n){return this.time=n,this}replaceSelection(n){return this.selection.replace(this,n),this}replaceSelectionWith(n,e=!0){let r=this.selection;return e&&(n=n.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||j.none))),r.replaceWith(this,n),this}deleteSelection(){return this.selection.replace(this),this}insertText(n,e,r){let o=this.doc.type.schema;if(e==null)return n?this.replaceSelectionWith(o.text(n),!0):this.deleteSelection();{if(r==null&&(r=e),!n)return this.deleteRange(e,r);let i=this.storedMarks;if(!i){let a=this.doc.resolve(e);i=r==e?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(e,r,o.text(n,i)),!this.selection.empty&&this.selection.to==e+n.length&&this.setSelection(B.near(this.selection.$to)),this}}setMeta(n,e){return this.meta[typeof n=="string"?n:n.key]=e,this}getMeta(n){return this.meta[typeof n=="string"?n:n.key]}get isGeneric(){for(let n in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ga,this}get scrolledIntoView(){return(this.updated&Ga)>0}}function Ya(t,n){return!n||!t?t:t.bind(n)}class st{constructor(n,e,r){this.name=n,this.init=Ya(e.init,r),this.apply=Ya(e.apply,r)}}const H0=[new st("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new st("selection",{init(t,n){return t.selection||B.atStart(n.doc)},apply(t){return t.selection}}),new st("storedMarks",{init(t){return t.storedMarks||null},apply(t,n,e,r){return r.selection.$cursor?t.storedMarks:null}}),new st("scrollToSelection",{init(){return 0},apply(t,n){return t.scrolledIntoView?n+1:n}})];class Co{constructor(n,e){this.schema=n,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=H0.slice(),e&&e.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 st(r.key,r.spec.state,r))})}}class Fe{constructor(n){this.config=n}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(n){return this.applyTransaction(n).state}filterTransaction(n,e=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=e){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,n,this))return!1}return!0}applyTransaction(n){if(!this.filterTransaction(n))return{state:this,transactions:[]};let e=[n],r=this.applyInner(n),o=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let s=this.config.plugins[a];if(s.spec.appendTransaction){let l=o?o[a].n:0,c=o?o[a].state:this,d=l<e.length&&s.spec.appendTransaction.call(s,l?e.slice(l):e,c,r);if(d&&r.filterTransaction(d,a)){if(d.setMeta("appendedTransaction",n),!o){o=[];for(let h=0;h<this.config.plugins.length;h++)o.push(h<a?{state:r,n:e.length}:{state:this,n:0})}e.push(d),r=r.applyInner(d),i=!0}o&&(o[a]={state:r,n:e.length})}}if(!i)return{state:r,transactions:e}}}applyInner(n){if(!n.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let e=new Fe(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];e[i.name]=i.apply(n,this[i.name],this,e)}return e}get tr(){return new F0(this)}static create(n){let e=new Co(n.doc?n.doc.type.schema:n.schema,n.plugins),r=new Fe(e);for(let o=0;o<e.fields.length;o++)r[e.fields[o].name]=e.fields[o].init(n,r);return r}reconfigure(n){let e=new Co(this.schema,n.plugins),r=e.fields,o=new Fe(e);for(let i=0;i<r.length;i++){let a=r[i].name;o[a]=this.hasOwnProperty(a)?this[a]:r[i].init(n,o)}return o}toJSON(n){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(r=>r.toJSON())),n&&typeof n=="object")for(let r in n){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=n[r],i=o.spec.state;i&&i.toJSON&&(e[r]=i.toJSON.call(o,this[o.key]))}return e}static fromJSON(n,e,r){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!n.schema)throw new RangeError("Required config field 'schema' missing");let o=new Co(n.schema,n.plugins),i=new Fe(o);return o.fields.forEach(a=>{if(a.name=="doc")i.doc=ee.fromJSON(n.schema,e.doc);else if(a.name=="selection")i.selection=B.fromJSON(i.doc,e.selection);else if(a.name=="storedMarks")e.storedMarks&&(i.storedMarks=e.storedMarks.map(n.schema.markFromJSON));else{if(r)for(let s in r){let l=r[s],c=l.spec.state;if(l.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(e,s)){i[a.name]=c.fromJSON.call(l,n,e[s],i);return}}i[a.name]=a.init(n,i)}}),i}}function od(t,n,e){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(n):r=="handleDOMEvents"&&(o=od(o,n,{})),e[r]=o}return e}class Q{constructor(n){this.spec=n,this.props={},n.props&&od(n.props,this,this.props),this.key=n.key?n.key.key:id("plugin")}getState(n){return n[this.key]}}const So=Object.create(null);function id(t){return t in So?t+"$"+ ++So[t]:(So[t]=0,t+"$")}class un{constructor(n="key"){this.key=id(n)}get(n){return n.config.pluginsByKey[this.key]}getState(n){return n[this.key]}}const on=function(t){for(var n=0;;n++)if(t=t.previousSibling,!t)return n},Ke=function(t){let n=t.assignedSlot||t.parentNode;return n&&n.nodeType==11?n.host:n};let ai=null;const Fn=function(t,n,e){let r=ai||(ai=document.createRange());return r.setEnd(t,e??t.nodeValue.length),r.setStart(t,n||0),r},j0=function(){ai=null},Ie=function(t,n,e,r){return e&&(Qa(t,n,e,r,-1)||Qa(t,n,e,r,1))},X0=/^(img|br|input|textarea|hr)$/i;function Qa(t,n,e,r,o){for(var i;;){if(t==e&&n==r)return!0;if(n==(o<0?0:Cn(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Pt(t)||X0.test(t.nodeName)||t.contentEditable=="false")return!1;n=on(t)+(o<0?0:1),t=a}else if(t.nodeType==1){let a=t.childNodes[n+(o<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((i=a.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)n+=o;else return!1;else t=a,n=o<0?Cn(t):0}else return!1}}function Cn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function V0(t,n){for(;;){if(t.nodeType==3&&n)return t;if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=Cn(t)}else if(t.parentNode&&!Pt(t))n=on(t),t=t.parentNode;else return null}}function W0(t,n){for(;;){if(t.nodeType==3&&n<t.nodeValue.length)return t;if(t.nodeType==1&&n<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[n],n=0}else if(t.parentNode&&!Pt(t))n=on(t)+1,t=t.parentNode;else return null}}function U0(t,n,e){for(let r=n==0,o=n==Cn(t);r||o;){if(t==e)return!0;let i=on(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==Cn(t)}}function Pt(t){let n;for(let e=t;e&&!(n=e.pmViewDesc);e=e.parentNode);return n&&n.node&&n.node.isBlock&&(n.dom==t||n.contentDOM==t)}const ro=function(t){return t.focusNode&&Ie(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ge(t,n){let e=document.createEvent("Event");return e.initEvent("keydown",!0,!0),e.keyCode=t,e.key=e.code=n,e}function q0(t){let n=t.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function K0(t,n,e){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(n,e);if(r)return{node:r.offsetNode,offset:Math.min(Cn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(n,e);if(r)return{node:r.startContainer,offset:Math.min(Cn(r.startContainer),r.startOffset)}}}const On=typeof navigator<"u"?navigator:null,Za=typeof document<"u"?document:null,De=On&&On.userAgent||"",si=/Edge\/(\d+)/.exec(De),ad=/MSIE \d/.exec(De),li=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(De),xn=!!(ad||li||si),re=ad?document.documentMode:li?+li[1]:si?+si[1]:0,$n=!xn&&/gecko\/(\d+)/i.test(De),ci=!xn&&/Chrome\/(\d+)/.exec(De),sn=!!ci,sd=ci?+ci[1]:0,dn=!xn&&!!On&&/Apple Computer/.test(On.vendor),Je=dn&&(/Mobile\/\w+/.test(De)||!!On&&On.maxTouchPoints>2),_n=Je||(On?/Mac/.test(On.platform):!1),ld=On?/Win/.test(On.platform):!1,jn=/Android \d/.test(De),Rt=!!Za&&"webkitFontSmoothing"in Za.documentElement.style,J0=Rt?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function G0(t){let n=t.defaultView&&t.defaultView.visualViewport;return n?{left:0,right:n.width,top:0,bottom:n.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Pn(t,n){return typeof t=="number"?t:t[n]}function Y0(t){let n=t.getBoundingClientRect(),e=n.width/t.offsetWidth||1,r=n.height/t.offsetHeight||1;return{left:n.left,right:n.left+t.clientWidth*e,top:n.top,bottom:n.top+t.clientHeight*r}}function ns(t,n,e){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let a=e||t.dom;a;){if(a.nodeType!=1){a=Ke(a);continue}let s=a,l=s==i.body,c=l?G0(i):Y0(s),d=0,h=0;if(n.top<c.top+Pn(r,"top")?h=-(c.top-n.top+Pn(o,"top")):n.bottom>c.bottom-Pn(r,"bottom")&&(h=n.bottom-n.top>c.bottom-c.top?n.top+Pn(o,"top")-c.top:n.bottom-c.bottom+Pn(o,"bottom")),n.left<c.left+Pn(r,"left")?d=-(c.left-n.left+Pn(o,"left")):n.right>c.right-Pn(r,"right")&&(d=n.right-c.right+Pn(o,"right")),d||h)if(l)i.defaultView.scrollBy(d,h);else{let u=s.scrollLeft,f=s.scrollTop;h&&(s.scrollTop+=h),d&&(s.scrollLeft+=d);let m=s.scrollLeft-u,x=s.scrollTop-f;n={left:n.left-m,top:n.top-x,right:n.right-m,bottom:n.bottom-x}}let g=l?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(g))break;a=g=="absolute"?a.offsetParent:Ke(a)}}function Q0(t){let n=t.dom.getBoundingClientRect(),e=Math.max(0,n.top),r,o;for(let i=(n.left+n.right)/2,a=e+1;a<Math.min(innerHeight,n.bottom);a+=5){let s=t.root.elementFromPoint(i,a);if(!s||s==t.dom||!t.dom.contains(s))continue;let l=s.getBoundingClientRect();if(l.top>=e-20){r=s,o=l.top;break}}return{refDOM:r,refTop:o,stack:cd(t.dom)}}function cd(t){let n=[],e=t.ownerDocument;for(let r=t;r&&(n.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=e);r=Ke(r));return n}function Z0({refDOM:t,refTop:n,stack:e}){let r=t?t.getBoundingClientRect().top:0;dd(e,r==0?0:r-n)}function dd(t,n){for(let e=0;e<t.length;e++){let{dom:r,top:o,left:i}=t[e];r.scrollTop!=o+n&&(r.scrollTop=o+n),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Oe=null;function nx(t){if(t.setActive)return t.setActive();if(Oe)return t.focus(Oe);let n=cd(t);t.focus(Oe==null?{get preventScroll(){return Oe={preventScroll:!0},!0}}:void 0),Oe||(Oe=!1,dd(n,0))}function pd(t,n){let e,r=2e8,o,i=0,a=n.top,s=n.top,l,c;for(let d=t.firstChild,h=0;d;d=d.nextSibling,h++){let g;if(d.nodeType==1)g=d.getClientRects();else if(d.nodeType==3)g=Fn(d).getClientRects();else continue;for(let u=0;u<g.length;u++){let f=g[u];if(f.top<=a&&f.bottom>=s){a=Math.max(f.bottom,a),s=Math.min(f.top,s);let m=f.left>n.left?f.left-n.left:f.right<n.left?n.left-f.right:0;if(m<r){e=d,r=m,o=m&&e.nodeType==3?{left:f.right<n.left?f.right:f.left,top:n.top}:n,d.nodeType==1&&m&&(i=h+(n.left>=(f.left+f.right)/2?1:0));continue}}else f.top>n.top&&!l&&f.left<=n.left&&f.right>=n.left&&(l=d,c={left:Math.max(f.left,Math.min(f.right,n.left)),top:f.top});!e&&(n.left>=f.right&&n.top>=f.top||n.left>=f.left&&n.top>=f.bottom)&&(i=h+1)}}return!e&&l&&(e=l,o=c,r=0),e&&e.nodeType==3?ex(e,o):!e||r&&e.nodeType==1?{node:t,offset:i}:pd(e,o)}function ex(t,n){let e=t.nodeValue.length,r=document.createRange(),o;for(let i=0;i<e;i++){r.setEnd(t,i+1),r.setStart(t,i);let a=Wn(r,1);if(a.top!=a.bottom&&Fi(n,a)){o={node:t,offset:i+(n.left>=(a.left+a.right)/2?1:0)};break}}return r.detach(),o||{node:t,offset:0}}function Fi(t,n){return t.left>=n.left-1&&t.left<=n.right+1&&t.top>=n.top-1&&t.top<=n.bottom+1}function tx(t,n){let e=t.parentNode;return e&&/^li$/i.test(e.nodeName)&&n.left<t.getBoundingClientRect().left?e:t}function rx(t,n,e){let{node:r,offset:o}=pd(n,e),i=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();i=a.left!=a.right&&e.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function ox(t,n,e,r){let o=-1;for(let i=n,a=!1;i!=t.dom;){let s=t.docView.nearestDesc(i,!0),l;if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((l=s.dom.getBoundingClientRect()).width||l.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!a&&l.left>r.left||l.top>r.top?o=s.posBefore:(!a&&l.right<r.left||l.bottom<r.top)&&(o=s.posAfter),a=!0),!s.contentDOM&&o<0&&!s.node.isText))return(s.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?s.posBefore:s.posAfter;i=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(n,e,-1)}function hd(t,n,e){let r=t.childNodes.length;if(r&&e.top<e.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(n.top-e.top)/(e.bottom-e.top))-2)),i=o;;){let a=t.childNodes[i];if(a.nodeType==1){let s=a.getClientRects();for(let l=0;l<s.length;l++){let c=s[l];if(Fi(n,c))return hd(a,n,c)}}if((i=(i+1)%r)==o)break}return t}function ix(t,n){let e=t.dom.ownerDocument,r,o=0,i=K0(e,n.left,n.top);i&&({node:r,offset:o}=i);let a=(t.root.elementFromPoint?t.root:e).elementFromPoint(n.left,n.top),s;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let c=t.dom.getBoundingClientRect();if(!Fi(n,c)||(a=hd(t.dom,n,c),!a))return null}if(dn)for(let c=a;r&&c;c=Ke(c))c.draggable&&(r=void 0);if(a=tx(a,n),r){if($n&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let d=r.childNodes[o],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=n.left&&h.bottom>n.top&&o++}let c;Rt&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=n.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&n.top>r.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(s=ox(t,r,o,n))}s==null&&(s=rx(t,a,n));let l=t.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function es(t){return t.top<t.bottom||t.left<t.right}function Wn(t,n){let e=t.getClientRects();if(e.length){let r=e[n<0?0:e.length-1];if(es(r))return r}return Array.prototype.find.call(e,es)||t.getBoundingClientRect()}const ax=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function gd(t,n,e){let{node:r,offset:o,atom:i}=t.docView.domFromPos(n,e<0?-1:1),a=Rt||$n;if(r.nodeType==3)if(a&&(ax.test(r.nodeValue)||(e<0?!o:o==r.nodeValue.length))){let l=Wn(Fn(r,o,o),e);if($n&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Wn(Fn(r,o-1,o-1),-1);if(c.top==l.top){let d=Wn(Fn(r,o,o+1),-1);if(d.top!=l.top)return rt(d,d.left<c.left)}}return l}else{let l=o,c=o,d=e<0?1:-1;return e<0&&!o?(c++,d=-1):e>=0&&o==r.nodeValue.length?(l--,d=1):e<0?l--:c++,rt(Wn(Fn(r,l,c),d),d<0)}if(!t.state.doc.resolve(n-(i||0)).parent.inlineContent){if(i==null&&o&&(e<0||o==Cn(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return Eo(l.getBoundingClientRect(),!1)}if(i==null&&o<Cn(r)){let l=r.childNodes[o];if(l.nodeType==1)return Eo(l.getBoundingClientRect(),!0)}return Eo(r.getBoundingClientRect(),e>=0)}if(i==null&&o&&(e<0||o==Cn(r))){let l=r.childNodes[o-1],c=l.nodeType==3?Fn(l,Cn(l)-(a?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return rt(Wn(c,1),!1)}if(i==null&&o<Cn(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Fn(l,0,a?0:1):l.nodeType==1?l:null:null;if(c)return rt(Wn(c,-1),!0)}return rt(Wn(r.nodeType==3?Fn(r):r,-e),e>=0)}function rt(t,n){if(t.width==0)return t;let e=n?t.left:t.right;return{top:t.top,bottom:t.bottom,left:e,right:e}}function Eo(t,n){if(t.height==0)return t;let e=n?t.top:t.bottom;return{top:e,bottom:e,left:t.left,right:t.right}}function ud(t,n,e){let r=t.state,o=t.root.activeElement;r!=n&&t.updateState(n),o!=t.dom&&t.focus();try{return e()}finally{r!=n&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function sx(t,n,e){let r=n.selection,o=e=="up"?r.$from:r.$to;return ud(t,n,()=>{let{node:i}=t.docView.domFromPos(o.pos,e=="up"?-1:1);for(;;){let s=t.docView.nearestDesc(i,!0);if(!s)break;if(s.node.isBlock){i=s.contentDOM||s.dom;break}i=s.dom.parentNode}let a=gd(t,o.pos,1);for(let s=i.firstChild;s;s=s.nextSibling){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=Fn(s,0,s.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(e=="up"?a.top-d.top>(d.bottom-a.top)*2:d.bottom-a.bottom>(a.bottom-d.top)*2))return!1}}return!0})}const lx=/[\u0590-\u08ac]/;function cx(t,n,e){let{$head:r}=n.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=t.domSelection();return s?!lx.test(r.parent.textContent)||!s.modify?e=="left"||e=="backward"?i:a:ud(t,n,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:h}=t.domSelectionRange(),g=s.caretBidiLevel;s.modify("move",e,"character");let u=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:f,focusOffset:m}=t.domSelectionRange(),x=f&&!u.contains(f.nodeType==1?f:f.parentNode)||l==f&&c==m;try{s.collapse(d,h),l&&(l!=d||c!=h)&&s.extend&&s.extend(l,c)}catch{}return g!=null&&(s.caretBidiLevel=g),x}):r.pos==r.start()||r.pos==r.end()}let ts=null,rs=null,is=!1;function dx(t,n,e){return ts==n&&rs==e?is:(ts=n,rs=e,is=e=="up"||e=="down"?sx(t,n,e):cx(t,n,e))}const En=0,as=1,fe=2,An=3;class Bt{constructor(n,e,r,o){this.parent=n,this.children=e,this.dom=r,this.contentDOM=o,this.dirty=En,r.pmViewDesc=this}matchesWidget(n){return!1}matchesMark(n){return!1}matchesNode(n,e,r){return!1}matchesHack(n){return!1}parseRule(){return null}stopEvent(n){return!1}get size(){let n=0;for(let e=0;e<this.children.length;e++)n+=this.children[e].size;return n}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let n=0;n<this.children.length;n++)this.children[n].destroy()}posBeforeChild(n){for(let e=0,r=this.posAtStart;;e++){let o=this.children[e];if(o==n)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(n,e,r){if(this.contentDOM&&this.contentDOM.contains(n.nodeType==1?n:n.parentNode))if(r<0){let i,a;if(n==this.contentDOM)i=n.childNodes[e-1];else{for(;n.parentNode!=this.contentDOM;)n=n.parentNode;i=n.previousSibling}for(;i&&!((a=i.pmViewDesc)&&a.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(a)+a.size:this.posAtStart}else{let i,a;if(n==this.contentDOM)i=n.childNodes[e];else{for(;n.parentNode!=this.contentDOM;)n=n.parentNode;i=n.nextSibling}for(;i&&!((a=i.pmViewDesc)&&a.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(a):this.posAtEnd}let o;if(n==this.dom&&this.contentDOM)o=e>on(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=n.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(e==0)for(let i=n;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&e==n.childNodes.length)for(let i=n;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(n,e=!1){for(let r=!0,o=n;o;o=o.parentNode){let i=this.getDesc(o),a;if(i&&(!e||i.node))if(r&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(n.nodeType==1?n:n.parentNode):a==n))r=!1;else return i}}getDesc(n){let e=n.pmViewDesc;for(let r=e;r;r=r.parent)if(r==this)return e}posFromDOM(n,e,r){for(let o=n;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(n,e,r)}return-1}descAt(n){for(let e=0,r=0;e<this.children.length;e++){let o=this.children[e],i=r+o.size;if(r==n&&i!=r){for(;!o.border&&o.children.length;)for(let a=0;a<o.children.length;a++){let s=o.children[a];if(s.size){o=s;break}}return o}if(n<i)return o.descAt(n-r-o.border);r=i}}domFromPos(n,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:n+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let a=this.children[r],s=i+a.size;if(s>n||a instanceof md){o=n-i;break}i=s}if(o)return this.children[r].domFromPos(o-this.children[r].border,e);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof fd&&i.side>=0;r--);if(e<=0){let i,a=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,a=!1);return i&&e&&a&&!i.border&&!i.domAtom?i.domFromPos(i.size,e):{node:this.contentDOM,offset:i?on(i.dom)+1:0}}else{let i,a=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,a=!1);return i&&a&&!i.border&&!i.domAtom?i.domFromPos(0,e):{node:this.contentDOM,offset:i?on(i.dom):this.contentDOM.childNodes.length}}}parseRange(n,e,r=0){if(this.children.length==0)return{node:this.contentDOM,from:n,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let a=r,s=0;;s++){let l=this.children[s],c=a+l.size;if(o==-1&&n<=c){let d=a+l.border;if(n>=d&&e<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(n,e,d);n=a;for(let h=s;h>0;h--){let g=this.children[h-1];if(g.size&&g.dom.parentNode==this.contentDOM&&!g.emptyChildAt(1)){o=on(g.dom)+1;break}n-=g.size}o==-1&&(o=0)}if(o>-1&&(c>e||s==this.children.length-1)){e=c;for(let d=s+1;d<this.children.length;d++){let h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){i=on(h.dom);break}e+=h.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:n,to:e,fromOffset:o,toOffset:i}}emptyChildAt(n){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[n<0?0:this.children.length-1];return e.size==0||e.emptyChildAt(n)}domAfterPos(n){let{node:e,offset:r}=this.domFromPos(n,0);if(e.nodeType!=1||r==e.childNodes.length)throw new RangeError("No node after pos "+n);return e.childNodes[r]}setSelection(n,e,r,o=!1){let i=Math.min(n,e),a=Math.max(n,e);for(let u=0,f=0;u<this.children.length;u++){let m=this.children[u],x=f+m.size;if(i>f&&a<x)return m.setSelection(n-f-m.border,e-f-m.border,r,o);f=x}let s=this.domFromPos(n,n?-1:1),l=e==n?s:this.domFromPos(e,e?-1:1),c=r.root.getSelection(),d=r.domSelectionRange(),h=!1;if(($n||dn)&&n==e){let{node:u,offset:f}=s;if(u.nodeType==3){if(h=!!(f&&u.nodeValue[f-1]==`
|
|
20996
|
+
`),h&&f==u.nodeValue.length)for(let m=u,x;m;m=m.parentNode){if(x=m.nextSibling){x.nodeName=="BR"&&(s=l={node:x.parentNode,offset:on(x)+1});break}let b=m.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let m=u.childNodes[f-1];h=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if($n&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let u=d.focusNode.childNodes[d.focusOffset];u&&u.contentEditable=="false"&&(o=!0)}if(!(o||h&&dn)&&Ie(s.node,s.offset,d.anchorNode,d.anchorOffset)&&Ie(l.node,l.offset,d.focusNode,d.focusOffset))return;let g=!1;if((c.extend||n==e)&&!(h&&$n)){c.collapse(s.node,s.offset);try{n!=e&&c.extend(l.node,l.offset),g=!0}catch{}}if(!g){if(n>e){let f=s;s=l,l=f}let u=document.createRange();u.setEnd(l.node,l.offset),u.setStart(s.node,s.offset),c.removeAllRanges(),c.addRange(u)}}ignoreMutation(n){return!this.contentDOM&&n.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(n,e){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],a=r+i.size;if(r==a?n<=a&&e>=r:n<a&&e>r){let s=r+i.border,l=a-i.border;if(n>=s&&e<=l){this.dirty=n==r||e==a?fe:as,n==s&&e==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=An:i.markDirty(n-s,e-s);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?fe:An}r=a}this.dirty=fe}markParentsDirty(){let n=1;for(let e=this.parent;e;e=e.parent,n++){let r=n==1?fe:as;e.dirty<r&&(e.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(n){return!1}}class fd extends Bt{constructor(n,e,r,o){let i,a=e.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!e.type.spec.raw){if(a.nodeType!=1){let s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(n,[],a,null),this.widget=e,this.widget=e,i=this}matchesWidget(n){return this.dirty==En&&n.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(n){let e=this.widget.spec.stopEvent;return e?e(n):!1}ignoreMutation(n){return n.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class px extends Bt{constructor(n,e,r,o){super(n,[],e,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(n,e){return n!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(n){return{node:this.textDOM,offset:n}}ignoreMutation(n){return n.type==="characterData"&&n.target.nodeValue==n.oldValue}}class $e extends Bt{constructor(n,e,r,o,i){super(n,[],r,o),this.mark=e,this.spec=i}static create(n,e,r,o){let i=o.nodeViews[e.type.name],a=i&&i(e,o,r);return(!a||!a.dom)&&(a=Me.renderSpec(document,e.type.spec.toDOM(e,r),null,e.attrs)),new $e(n,e,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&An||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(n){return this.dirty!=An&&this.mark.eq(n)}markDirty(n,e){if(super.markDirty(n,e),this.dirty!=En){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=En}}slice(n,e,r){let o=$e.create(this.parent,this.mark,!0,r),i=this.children,a=this.size;e<a&&(i=pi(i,e,a,r)),n>0&&(i=pi(i,0,n,r));for(let s=0;s<i.length;s++)i[s].parent=o;return o.children=i,o}ignoreMutation(n){return this.spec.ignoreMutation?this.spec.ignoreMutation(n):super.ignoreMutation(n)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class oe extends Bt{constructor(n,e,r,o,i,a,s,l,c){super(n,[],i,a),this.node=e,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=s}static create(n,e,r,o,i,a){let s=i.nodeViews[e.type.name],l,c=s&&s(e,i,()=>{if(!l)return a;if(l.parent)return l.parent.posBeforeChild(l)},r,o),d=c&&c.dom,h=c&&c.contentDOM;if(e.isText){if(!d)d=document.createTextNode(e.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:h}=Me.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs));!h&&!e.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),e.type.spec.draggable&&(d.draggable=!0));let g=d;return d=yd(d,r,e),c?l=new hx(n,e,r,o,d,h||null,g,c,i,a+1):e.isText?new oo(n,e,r,o,d,g,i):new oe(n,e,r,o,d,h||null,g,i,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let r=this.children[e];if(this.dom.contains(r.dom.parentNode)){n.contentElement=r.dom.parentNode;break}}n.contentElement||(n.getContent=()=>y.empty)}return n}matchesNode(n,e,r){return this.dirty==En&&n.eq(this.node)&&ur(e,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(n,e){let r=this.node.inlineContent,o=e,i=n.composing?this.localCompositionInfo(n,e):null,a=i&&i.pos>-1?i:null,s=i&&i.pos<0,l=new ux(this,a&&a.node,n);xx(this.node,this.innerDeco,(c,d,h)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,n,d):c.type.side>=0&&!h&&l.syncToMarks(d==this.node.childCount?j.none:this.node.child(d).marks,r,n,d),l.placeWidget(c,n,o)},(c,d,h,g)=>{l.syncToMarks(c.marks,r,n,g);let u;l.findNodeMatch(c,d,h,g)||s&&n.state.selection.from>o&&n.state.selection.to<o+c.nodeSize&&(u=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,d,h,u,n)||l.updateNextNode(c,d,h,n,g,o)||l.addNode(c,d,h,n,o),o+=c.nodeSize}),l.syncToMarks([],r,n,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==fe)&&(a&&this.protectLocalComposition(n,a),xd(this.contentDOM,this.children,n),Je&&bx(this.dom))}localCompositionInfo(n,e){let{from:r,to:o}=n.state.selection;if(!(n.state.selection instanceof P)||r<e||o>e+this.node.content.size)return null;let i=n.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let a=i.nodeValue,s=yx(this.node.content,a,r-e,o-e);return s<0?null:{node:i,pos:s,text:a}}else return{node:i,pos:-1,text:""}}protectLocalComposition(n,{node:e,pos:r,text:o}){if(this.getDesc(e))return;let i=e;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new px(this,i,e,o);n.input.compositionNodes.push(a),this.children=pi(this.children,r,r+o.length,n,a)}update(n,e,r,o){return this.dirty==An||!n.sameMarkup(this.node)?!1:(this.updateInner(n,e,r,o),!0)}updateInner(n,e,r,o){this.updateOuterDeco(e),this.node=n,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=En}updateOuterDeco(n){if(ur(n,this.outerDeco))return;let e=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=bd(this.dom,this.nodeDOM,di(this.outerDeco,this.node,e),di(n,this.node,e)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=n}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ss(t,n,e,r,o){yd(r,n,t);let i=new oe(void 0,t,n,e,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class oo extends oe{constructor(n,e,r,o,i,a,s){super(n,e,r,o,i,null,a,s,0)}parseRule(){let n=this.nodeDOM.parentNode;for(;n&&n!=this.dom&&!n.pmIsDeco;)n=n.parentNode;return{skip:n||!0}}update(n,e,r,o){return this.dirty==An||this.dirty!=En&&!this.inParent()||!n.sameMarkup(this.node)?!1:(this.updateOuterDeco(e),(this.dirty!=En||n.text!=this.node.text)&&n.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=n.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=n,this.dirty=En,!0)}inParent(){let n=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==n)return!0;return!1}domFromPos(n){return{node:this.nodeDOM,offset:n}}localPosFromDOM(n,e,r){return n==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(n,e,r)}ignoreMutation(n){return n.type!="characterData"&&n.type!="selection"}slice(n,e,r){let o=this.node.cut(n,e),i=document.createTextNode(o.text);return new oo(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(n,e){super.markDirty(n,e),this.dom!=this.nodeDOM&&(n==0||e==this.nodeDOM.nodeValue.length)&&(this.dirty=An)}get domAtom(){return!1}isText(n){return this.node.text==n}}class md extends Bt{parseRule(){return{ignore:!0}}matchesHack(n){return this.dirty==En&&this.dom.nodeName==n}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class hx extends oe{constructor(n,e,r,o,i,a,s,l,c,d){super(n,e,r,o,i,a,s,c,d),this.spec=l}update(n,e,r,o){if(this.dirty==An)return!1;if(this.spec.update&&(this.node.type==n.type||this.spec.multiType)){let i=this.spec.update(n,e,r);return i&&this.updateInner(n,e,r,o),i}else return!this.contentDOM&&!n.isLeaf?!1:super.update(n,e,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(n,e,r,o){this.spec.setSelection?this.spec.setSelection(n,e,r.root):super.setSelection(n,e,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(n){return this.spec.stopEvent?this.spec.stopEvent(n):!1}ignoreMutation(n){return this.spec.ignoreMutation?this.spec.ignoreMutation(n):super.ignoreMutation(n)}}function xd(t,n,e){let r=t.firstChild,o=!1;for(let i=0;i<n.length;i++){let a=n[i],s=a.dom;if(s.parentNode==t){for(;s!=r;)r=ls(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(s,r);if(a instanceof $e){let l=r?r.previousSibling:t.lastChild;xd(a.contentDOM,a.children,e),r=l?l.nextSibling:t.firstChild}}for(;r;)r=ls(r),o=!0;o&&e.trackWrites==t&&(e.trackWrites=null)}const dt=function(t){t&&(this.nodeName=t)};dt.prototype=Object.create(null);const me=[new dt];function di(t,n,e){if(t.length==0)return me;let r=e?me[0]:new dt,o=[r];for(let i=0;i<t.length;i++){let a=t[i].type.attrs;if(a){a.nodeName&&o.push(r=new dt(a.nodeName));for(let s in a){let l=a[s];l!=null&&(e&&o.length==1&&o.push(r=new dt(n.isInline?"span":"div")),s=="class"?r.class=(r.class?r.class+" ":"")+l:s=="style"?r.style=(r.style?r.style+";":"")+l:s!="nodeName"&&(r[s]=l))}}}return o}function bd(t,n,e,r){if(e==me&&r==me)return n;let o=n;for(let i=0;i<r.length;i++){let a=r[i],s=e[i];if(i){let l;s&&s.nodeName==a.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==a.nodeName||(l=document.createElement(a.nodeName),l.pmIsDeco=!0,l.appendChild(o),s=me[0]),o=l}gx(o,s||me[0],a)}return o}function gx(t,n,e){for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&!(r in e)&&t.removeAttribute(r);for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&e[r]!=n[r]&&t.setAttribute(r,e[r]);if(n.class!=e.class){let r=n.class?n.class.split(" ").filter(Boolean):[],o=e.class?e.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(n.style!=e.style){if(n.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(n.style);)t.style.removeProperty(o[1])}e.style&&(t.style.cssText+=e.style)}}function yd(t,n,e){return bd(t,t,me,di(n,e,t.nodeType!=1))}function ur(t,n){if(t.length!=n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].type.eq(n[e].type))return!1;return!0}function ls(t){let n=t.nextSibling;return t.parentNode.removeChild(t),n}class ux{constructor(n,e,r){this.lock=e,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=n,this.preMatch=fx(n.node.content,n)}destroyBetween(n,e){if(n!=e){for(let r=n;r<e;r++)this.top.children[r].destroy();this.top.children.splice(n,e-n),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(n,e,r,o){let i=0,a=this.stack.length>>1,s=Math.min(a,n.length);for(;i<s&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(n[i])&&n[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=En,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<n.length;){this.stack.push(this.top,this.index+1);let l=-1,c=this.top.children.length;o<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let d=this.index;d<c;d++){let h=this.top.children[d];if(h.matchesMark(n[a])&&!this.isLocked(h.dom)){l=d;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let d=$e.create(this.top,n[a],e,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,a++}}findNodeMatch(n,e,r,o){let i=-1,a;if(o>=this.preMatch.index&&(a=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&a.matchesNode(n,e,r))i=this.top.children.indexOf(a,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s<l;s++){let c=this.top.children[s];if(c.matchesNode(n,e,r)&&!this.preMatch.matched.has(c)){i=s;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(n,e,r,o,i){let a=this.top.children[o];return a.dirty==An&&a.dom==a.contentDOM&&(a.dirty=fe),a.update(n,e,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(n){for(;;){let e=n.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let r=n.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}n=e}}updateNextNode(n,e,r,o,i,a){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof oe){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let d=l.dom,h,g=this.isLocked(d)&&!(n.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==n.text&&l.dirty!=An&&ur(e,l.outerDeco));if(!g&&l.update(n,e,r,o))return this.destroyBetween(this.index,s),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!g&&(h=this.recreateWrapper(l,n,e,r,o,a)))return this.destroyBetween(this.index,s),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=fe,h.updateChildren(o,a+1),h.dirty=En),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(n,e,r,o,i,a){if(n.dirty||e.isAtom||!n.children.length||!n.node.content.eq(e.content)||!ur(r,n.outerDeco)||!o.eq(n.innerDeco))return null;let s=oe.create(this.top,e,r,o,i,a);if(s.contentDOM){s.children=n.children,n.children=[];for(let l of s.children)l.parent=s}return n.destroy(),s}addNode(n,e,r,o,i){let a=oe.create(this.top,n,e,r,o,i);a.contentDOM&&a.updateChildren(o,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(n,e,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(n)&&(n==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new fd(this.top,n,e,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let n=this.top.children[this.index-1],e=this.top;for(;n instanceof $e;)e=n,n=e.children[e.children.length-1];(!n||!(n instanceof oo)||/\n$/.test(n.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(n.node.text))&&((dn||sn)&&n&&n.dom.contentEditable=="false"&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(n,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(n))this.index++;else{let r=document.createElement(n);n=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),n=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new md(this.top,[],r,null);e!=this.top?e.children.push(o):e.children.splice(this.index++,0,o),this.changed=!0}}isLocked(n){return this.lock&&(n==this.lock||n.nodeType==1&&n.contains(this.lock.parentNode))}}function fx(t,n){let e=n,r=e.children.length,o=t.childCount,i=new Map,a=[];n:for(;o>0;){let s;for(;;)if(r){let c=e.children[r-1];if(c instanceof $e)e=c,r=c.children.length;else{s=c,r--;break}}else{if(e==n)break n;r=e.parent.children.indexOf(e),e=e.parent}let l=s.node;if(l){if(l!=t.child(o-1))break;--o,i.set(s,o),a.push(s)}}return{index:o,matched:i,matches:a.reverse()}}function mx(t,n){return t.type.side-n.type.side}function xx(t,n,e,r){let o=n.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);r(d,o,n.forChild(i,d),c),i+=d.nodeSize}return}let a=0,s=[],l=null;for(let c=0;;){let d,h;for(;a<o.length&&o[a].to==i;){let x=o[a++];x.widget&&(d?(h||(h=[d])).push(x):d=x)}if(d)if(h){h.sort(mx);for(let x=0;x<h.length;x++)e(h[x],c,!!l)}else e(d,c,!!l);let g,u;if(l)u=-1,g=l,l=null;else if(c<t.childCount)u=c,g=t.child(c++);else break;for(let x=0;x<s.length;x++)s[x].to<=i&&s.splice(x--,1);for(;a<o.length&&o[a].from<=i&&o[a].to>i;)s.push(o[a++]);let f=i+g.nodeSize;if(g.isText){let x=f;a<o.length&&o[a].from<x&&(x=o[a].from);for(let b=0;b<s.length;b++)s[b].to<x&&(x=s[b].to);x<f&&(l=g.cut(x-i),g=g.cut(0,x-i),f=x,u=-1)}else for(;a<o.length&&o[a].to<f;)a++;let m=g.isInline&&!g.isLeaf?s.filter(x=>!x.inline):s.slice();r(g,m,n.forChild(i,g),u),i=f}}function bx(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let n=t.style.cssText;t.style.cssText=n+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=n}}function yx(t,n,e,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let a=t.child(o++),s=i;if(i+=a.nodeSize,!a.isText)continue;let l=a.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=e){if(i>=r&&l.slice(r-n.length-s,r-s)==n)return r-n.length;let c=s<r?l.lastIndexOf(n,r-s-1):-1;if(c>=0&&c+n.length+s>=e)return s+c;if(e==r&&l.length>=r+n.length-s&&l.slice(r-s,r-s+n.length)==n)return r}}return-1}function pi(t,n,e,r,o){let i=[];for(let a=0,s=0;a<t.length;a++){let l=t[a],c=s,d=s+=l.size;c>=e||d<=n?i.push(l):(c<n&&i.push(l.slice(0,n-c,r)),o&&(i.push(o),o=void 0),d>e&&i.push(l.slice(e-c,l.size,r)))}return i}function Hi(t,n=null){let e=t.domSelectionRange(),r=t.state.doc;if(!e.focusNode)return null;let o=t.docView.nearestDesc(e.focusNode),i=o&&o.size==0,a=t.docView.posFromDOM(e.focusNode,e.focusOffset,1);if(a<0)return null;let s=r.resolve(a),l,c;if(ro(e)){for(l=a;o&&!o.node;)o=o.parent;let h=o.node;if(o&&h.isAtom&&O.isSelectable(h)&&o.parent&&!(h.isInline&&U0(e.focusNode,e.focusOffset,o.dom))){let g=o.posBefore;c=new O(a==g?s:r.resolve(g))}}else{if(e instanceof t.dom.ownerDocument.defaultView.Selection&&e.rangeCount>1){let h=a,g=a;for(let u=0;u<e.rangeCount;u++){let f=e.getRangeAt(u);h=Math.min(h,t.docView.posFromDOM(f.startContainer,f.startOffset,1)),g=Math.max(g,t.docView.posFromDOM(f.endContainer,f.endOffset,-1))}if(h<0)return null;[l,a]=g==t.state.selection.anchor?[g,h]:[h,g],s=r.resolve(a)}else l=t.docView.posFromDOM(e.anchorNode,e.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!c){let h=n=="pointer"||t.state.selection.head<s.pos&&!i?1:-1;c=ji(t,d,s,h)}return c}function vd(t){return t.editable?t.hasFocus():wd(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Xn(t,n=!1){let e=t.state.selection;if(kd(t,e),!!vd(t)){if(!n&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&sn){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Ie(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)kx(t);else{let{anchor:r,head:o}=e,i,a;cs&&!(e instanceof P)&&(e.$from.parent.inlineContent||(i=ds(t,e.from)),!e.empty&&!e.$from.parent.inlineContent&&(a=ds(t,e.to))),t.docView.setSelection(r,o,t,n),cs&&(i&&ps(i),a&&ps(a)),e.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&vx(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const cs=dn||sn&&sd<63;function ds(t,n){let{node:e,offset:r}=t.docView.domFromPos(n,0),o=r<e.childNodes.length?e.childNodes[r]:null,i=r?e.childNodes[r-1]:null;if(dn&&o&&o.contentEditable=="false")return Io(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Io(o);if(i)return Io(i)}}function Io(t){return t.contentEditable="true",dn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function ps(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function vx(t){let n=t.dom.ownerDocument;n.removeEventListener("selectionchange",t.input.hideSelectionGuard);let e=t.domSelectionRange(),r=e.anchorNode,o=e.anchorOffset;n.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(e.anchorNode!=r||e.anchorOffset!=o)&&(n.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!vd(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function kx(t){let n=t.domSelection();if(!n)return;let e=t.cursorWrapper.dom,r=e.nodeName=="IMG";r?n.collapse(e.parentNode,on(e)+1):n.collapse(e,0),!r&&!t.state.selection.visible&&xn&&re<=11&&(e.disabled=!0,e.disabled=!1)}function kd(t,n){if(n instanceof O){let e=t.docView.descAt(n.from);e!=t.lastSelectedViewDesc&&(hs(t),e&&e.selectNode(),t.lastSelectedViewDesc=e)}else hs(t)}function hs(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function ji(t,n,e,r){return t.someProp("createSelectionBetween",o=>o(t,n,e))||P.between(n,e,r)}function gs(t){return t.editable&&!t.hasFocus()?!1:wd(t)}function wd(t){let n=t.domSelectionRange();if(!n.anchorNode)return!1;try{return t.dom.contains(n.anchorNode.nodeType==3?n.anchorNode.parentNode:n.anchorNode)&&(t.editable||t.dom.contains(n.focusNode.nodeType==3?n.focusNode.parentNode:n.focusNode))}catch{return!1}}function wx(t){let n=t.docView.domFromPos(t.state.selection.anchor,0),e=t.domSelectionRange();return Ie(n.node,n.offset,e.anchorNode,e.anchorOffset)}function hi(t,n){let{$anchor:e,$head:r}=t.selection,o=n>0?e.max(r):e.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(n>0?o.after():o.before()):null:o;return i&&B.findFrom(i,n)}function Un(t,n){return t.dispatch(t.state.tr.setSelection(n).scrollIntoView()),!0}function us(t,n,e){let r=t.state.selection;if(r instanceof P)if(e.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:n<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=t.state.doc.resolve(o.pos+i.nodeSize*(n<0?-1:1));return Un(t,new P(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(n>0?"forward":"backward")){let o=hi(t.state,n);return o&&o instanceof O?Un(t,o):!1}else if(!(_n&&e.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:n<0?o.nodeBefore:o.nodeAfter,a;if(!i||i.isText)return!1;let s=n<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(a=t.docView.descAt(s))&&!a.contentDOM?O.isSelectable(i)?Un(t,new O(n<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):Rt?Un(t,new P(t.state.doc.resolve(n<0?s:s+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof O&&r.node.isInline)return Un(t,new P(n>0?r.$to:r.$from));{let o=hi(t.state,n);return o?Un(t,o):!1}}}function fr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function pt(t,n){let e=t.pmViewDesc;return e&&e.size==0&&(n<0||t.nextSibling||t.nodeName!="BR")}function Ae(t,n){return n<0?_x(t):Cx(t)}function _x(t){let n=t.domSelectionRange(),e=n.focusNode,r=n.focusOffset;if(!e)return;let o,i,a=!1;for($n&&e.nodeType==1&&r<fr(e)&&pt(e.childNodes[r],-1)&&(a=!0);;)if(r>0){if(e.nodeType!=1)break;{let s=e.childNodes[r-1];if(pt(s,-1))o=e,i=--r;else if(s.nodeType==3)e=s,r=e.nodeValue.length;else break}}else{if(_d(e))break;{let s=e.previousSibling;for(;s&&pt(s,-1);)o=e.parentNode,i=on(s),s=s.previousSibling;if(s)e=s,r=fr(e);else{if(e=e.parentNode,e==t.dom)break;r=0}}}a?gi(t,e,r):o&&gi(t,o,i)}function Cx(t){let n=t.domSelectionRange(),e=n.focusNode,r=n.focusOffset;if(!e)return;let o=fr(e),i,a;for(;;)if(r<o){if(e.nodeType!=1)break;let s=e.childNodes[r];if(pt(s,1))i=e,a=++r;else break}else{if(_d(e))break;{let s=e.nextSibling;for(;s&&pt(s,1);)i=s.parentNode,a=on(s)+1,s=s.nextSibling;if(s)e=s,r=0,o=fr(e);else{if(e=e.parentNode,e==t.dom)break;r=o=0}}}i&&gi(t,i,a)}function _d(t){let n=t.pmViewDesc;return n&&n.node&&n.node.isBlock}function Sx(t,n){for(;t&&n==t.childNodes.length&&!Pt(t);)n=on(t)+1,t=t.parentNode;for(;t&&n<t.childNodes.length;){let e=t.childNodes[n];if(e.nodeType==3)return e;if(e.nodeType==1&&e.contentEditable=="false")break;t=e,n=0}}function Ex(t,n){for(;t&&!n&&!Pt(t);)n=on(t),t=t.parentNode;for(;t&&n;){let e=t.childNodes[n-1];if(e.nodeType==3)return e;if(e.nodeType==1&&e.contentEditable=="false")break;t=e,n=t.childNodes.length}}function gi(t,n,e){if(n.nodeType!=3){let i,a;(a=Sx(n,e))?(n=a,e=0):(i=Ex(n,e))&&(n=i,e=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(ro(r)){let i=document.createRange();i.setEnd(n,e),i.setStart(n,e),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(n,e);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Xn(t)},50)}function fs(t,n){let e=t.state.doc.resolve(n);if(!(sn||ld)&&e.parent.inlineContent){let o=t.coordsAtPos(n);if(n>e.start()){let i=t.coordsAtPos(n-1),a=(i.top+i.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(n<e.end()){let i=t.coordsAtPos(n+1),a=(i.top+i.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function ms(t,n,e){let r=t.state.selection;if(r instanceof P&&!r.empty||e.indexOf("s")>-1||_n&&e.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(n<0?"up":"down")){let a=hi(t.state,n);if(a&&a instanceof O)return Un(t,a)}if(!o.parent.inlineContent){let a=n<0?o:i,s=r instanceof Sn?B.near(a,n):B.findFrom(a,n);return s?Un(t,s):!1}return!1}function xs(t,n){if(!(t.state.selection instanceof P))return!0;let{$head:e,$anchor:r,empty:o}=t.state.selection;if(!e.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(n>0?"forward":"backward"))return!0;let i=!e.textOffset&&(n<0?e.nodeBefore:e.nodeAfter);if(i&&!i.isText){let a=t.state.tr;return n<0?a.delete(e.pos-i.nodeSize,e.pos):a.delete(e.pos,e.pos+i.nodeSize),t.dispatch(a),!0}return!1}function bs(t,n,e){t.domObserver.stop(),n.contentEditable=e,t.domObserver.start()}function Ix(t){if(!dn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:n,focusOffset:e}=t.domSelectionRange();if(n&&n.nodeType==1&&e==0&&n.firstChild&&n.firstChild.contentEditable=="false"){let r=n.firstChild;bs(t,r,"true"),setTimeout(()=>bs(t,r,"false"),20)}return!1}function $x(t){let n="";return t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n}function Tx(t,n){let e=n.keyCode,r=$x(n);if(e==8||_n&&e==72&&r=="c")return xs(t,-1)||Ae(t,-1);if(e==46&&!n.shiftKey||_n&&e==68&&r=="c")return xs(t,1)||Ae(t,1);if(e==13||e==27)return!0;if(e==37||_n&&e==66&&r=="c"){let o=e==37?fs(t,t.state.selection.from)=="ltr"?-1:1:-1;return us(t,o,r)||Ae(t,o)}else if(e==39||_n&&e==70&&r=="c"){let o=e==39?fs(t,t.state.selection.from)=="ltr"?1:-1:1;return us(t,o,r)||Ae(t,o)}else{if(e==38||_n&&e==80&&r=="c")return ms(t,-1,r)||Ae(t,-1);if(e==40||_n&&e==78&&r=="c")return Ix(t)||ms(t,1,r)||Ae(t,1);if(r==(_n?"m":"c")&&(e==66||e==73||e==89||e==90))return!0}return!1}function Xi(t,n){t.someProp("transformCopied",u=>{n=u(n,t)});let e=[],{content:r,openStart:o,openEnd:i}=n;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let u=r.firstChild;e.push(u.type.name,u.attrs!=u.type.defaultAttrs?u.attrs:null),r=u.content}let a=t.someProp("clipboardSerializer")||Me.fromSchema(t.state.schema),s=Td(),l=s.createElement("div");l.appendChild(a.serializeFragment(r,{document:s}));let c=l.firstChild,d,h=0;for(;c&&c.nodeType==1&&(d=$d[c.nodeName.toLowerCase()]);){for(let u=d.length-1;u>=0;u--){let f=s.createElement(d[u]);for(;l.firstChild;)f.appendChild(l.firstChild);l.appendChild(f),h++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${h?` -${h}`:""} ${JSON.stringify(e)}`);let g=t.someProp("clipboardTextSerializer",u=>u(n,t))||n.content.textBetween(0,n.content.size,`
|
|
20997
|
+
|
|
20998
|
+
`);return{dom:l,text:g,slice:n}}function Cd(t,n,e,r,o){let i=o.parent.type.spec.code,a,s;if(!e&&!n)return null;let l=!!n&&(r||i||!e);if(l){if(t.someProp("transformPastedText",g=>{n=g(n,i||r,t)}),i)return s=new w(y.from(t.state.schema.text(n.replace(/\r\n?/g,`
|
|
20999
|
+
`))),0,0),t.someProp("transformPasted",g=>{s=g(s,t,!0)}),s;let h=t.someProp("clipboardTextParser",g=>g(n,o,r,t));if(h)s=h;else{let g=o.marks(),{schema:u}=t.state,f=Me.fromSchema(u);a=document.createElement("div"),n.split(/(?:\r\n?|\n)+/).forEach(m=>{let x=a.appendChild(document.createElement("p"));m&&x.appendChild(f.serializeNode(u.text(m,g)))})}}else t.someProp("transformPastedHTML",h=>{e=h(e,t)}),a=Ox(e),Rt&&Ax(a);let c=a&&a.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let h=+d[3];h>0;h--){let g=a.firstChild;for(;g&&g.nodeType!=1;)g=g.nextSibling;if(!g)break;a=g}if(s||(s=(t.someProp("clipboardParser")||t.someProp("domParser")||te.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(l||d),context:o,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!Mx.test(g.parentNode.nodeName)?{ignore:!0}:null}})),d)s=Lx(ys(s,+d[1],+d[2]),d[4]);else if(s=w.maxOpen(Dx(s.content,o),!0),s.openStart||s.openEnd){let h=0,g=0;for(let u=s.content.firstChild;h<s.openStart&&!u.type.spec.isolating;h++,u=u.firstChild);for(let u=s.content.lastChild;g<s.openEnd&&!u.type.spec.isolating;g++,u=u.lastChild);s=ys(s,h,g)}return t.someProp("transformPasted",h=>{s=h(s,t,l)}),s}const Mx=/^(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 Dx(t,n){if(t.childCount<2)return t;for(let e=n.depth;e>=0;e--){let o=n.node(e).contentMatchAt(n.index(e)),i,a=[];if(t.forEach(s=>{if(!a)return;let l=o.findWrapping(s.type),c;if(!l)return a=null;if(c=a.length&&i.length&&Ed(l,i,s,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=Id(a[a.length-1],i.length));let d=Sd(s,l);a.push(d),o=o.matchType(d.type),i=l}}),a)return y.from(a)}return t}function Sd(t,n,e=0){for(let r=n.length-1;r>=e;r--)t=n[r].create(null,y.from(t));return t}function Ed(t,n,e,r,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let i=Ed(t,n,e,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?e.type:t[o+1]))return r.copy(r.content.append(y.from(Sd(e,t,o+1))))}}function Id(t,n){if(n==0)return t;let e=t.content.replaceChild(t.childCount-1,Id(t.lastChild,n-1)),r=t.contentMatchAt(t.childCount).fillBefore(y.empty,!0);return t.copy(e.append(r))}function ui(t,n,e,r,o,i){let a=n<0?t.firstChild:t.lastChild,s=a.content;return t.childCount>1&&(i=0),o<r-1&&(s=ui(s,n,e,r,o+1,i)),o>=e&&(s=n<0?a.contentMatchAt(0).fillBefore(s,i<=o).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(y.empty,!0))),t.replaceChild(n<0?0:t.childCount-1,a.copy(s))}function ys(t,n,e){return n<t.openStart&&(t=new w(ui(t.content,-1,n,t.openStart,0,t.openEnd),n,t.openEnd)),e<t.openEnd&&(t=new w(ui(t.content,1,e,t.openEnd,0,0),t.openStart,e)),t}const $d={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 vs=null;function Td(){return vs||(vs=document.implementation.createHTMLDocument("title"))}let $o=null;function zx(t){let n=window.trustedTypes;return n?($o||($o=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),$o.createHTML(t)):t}function Ox(t){let n=/^(\s*<meta [^>]*>)*/.exec(t);n&&(t=t.slice(n[0].length));let e=Td().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&$d[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),e.innerHTML=zx(t),o)for(let i=0;i<o.length;i++)e=e.querySelector(o[i])||e;return e}function Ax(t){let n=t.querySelectorAll(sn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let e=0;e<n.length;e++){let r=n[e];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function Lx(t,n){if(!t.size)return t;let e=t.content.firstChild.type.schema,r;try{r=JSON.parse(n)}catch{return t}let{content:o,openStart:i,openEnd:a}=t;for(let s=r.length-2;s>=0;s-=2){let l=e.nodes[r[s]];if(!l||l.hasRequiredAttrs())break;o=y.from(l.create(r[s+1],o)),i++,a++}return new w(o,i,a)}const hn={},gn={},Px={touchstart:!0,touchmove:!0};class Rx{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Bx(t){for(let n in hn){let e=hn[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>{Fx(t,r)&&!Vi(t,r)&&(t.editable||!(r.type in gn))&&e(t,r)},Px[n]?{passive:!0}:void 0)}dn&&t.dom.addEventListener("input",()=>null),fi(t)}function Zn(t,n){t.input.lastSelectionOrigin=n,t.input.lastSelectionTime=Date.now()}function Nx(t){t.domObserver.stop();for(let n in t.input.eventHandlers)t.dom.removeEventListener(n,t.input.eventHandlers[n]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function fi(t){t.someProp("handleDOMEvents",n=>{for(let e in n)t.input.eventHandlers[e]||t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>Vi(t,r))})}function Vi(t,n){return t.someProp("handleDOMEvents",e=>{let r=e[n.type];return r?r(t,n)||n.defaultPrevented:!1})}function Fx(t,n){if(!n.bubbles)return!0;if(n.defaultPrevented)return!1;for(let e=n.target;e!=t.dom;e=e.parentNode)if(!e||e.nodeType==11||e.pmViewDesc&&e.pmViewDesc.stopEvent(n))return!1;return!0}function Hx(t,n){!Vi(t,n)&&hn[n.type]&&(t.editable||!(n.type in gn))&&hn[n.type](t,n)}gn.keydown=(t,n)=>{let e=n;if(t.input.shiftKey=e.keyCode==16||e.shiftKey,!Dd(t,e)&&(t.input.lastKeyCode=e.keyCode,t.input.lastKeyCodeTime=Date.now(),!(jn&&sn&&e.keyCode==13)))if(e.keyCode!=229&&t.domObserver.forceFlush(),Je&&e.keyCode==13&&!e.ctrlKey&&!e.altKey&&!e.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,ge(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,e))||Tx(t,e)?e.preventDefault():Zn(t,"key")};gn.keyup=(t,n)=>{n.keyCode==16&&(t.input.shiftKey=!1)};gn.keypress=(t,n)=>{let e=n;if(Dd(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||_n&&e.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,e))){e.preventDefault();return}let r=t.state.selection;if(!(r instanceof P)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(e.charCode),i=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",a=>a(t,r.$from.pos,r.$to.pos,o,i))&&t.dispatch(i()),e.preventDefault()}};function io(t){return{left:t.clientX,top:t.clientY}}function jx(t,n){let e=n.x-t.clientX,r=n.y-t.clientY;return e*e+r*r<100}function Wi(t,n,e,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let a=i.depth+1;a>0;a--)if(t.someProp(n,s=>a>i.depth?s(t,e,i.nodeAfter,i.before(a),o,!0):s(t,e,i.node(a),i.before(a),o,!1)))return!0;return!1}function We(t,n,e){if(t.focused||t.focus(),t.state.selection.eq(n))return;let r=t.state.tr.setSelection(n);r.setMeta("pointer",!0),t.dispatch(r)}function Xx(t,n){if(n==-1)return!1;let e=t.state.doc.resolve(n),r=e.nodeAfter;return r&&r.isAtom&&O.isSelectable(r)?(We(t,new O(e)),!0):!1}function Vx(t,n){if(n==-1)return!1;let e=t.state.selection,r,o;e instanceof O&&(r=e.node);let i=t.state.doc.resolve(n);for(let a=i.depth+1;a>0;a--){let s=a>i.depth?i.nodeAfter:i.node(a);if(O.isSelectable(s)){r&&e.$from.depth>0&&a>=e.$from.depth&&i.before(e.$from.depth+1)==e.$from.pos?o=i.before(e.$from.depth):o=i.before(a);break}}return o!=null?(We(t,O.create(t.state.doc,o)),!0):!1}function Wx(t,n,e,r,o){return Wi(t,"handleClickOn",n,e,r)||t.someProp("handleClick",i=>i(t,n,r))||(o?Vx(t,e):Xx(t,e))}function Ux(t,n,e,r){return Wi(t,"handleDoubleClickOn",n,e,r)||t.someProp("handleDoubleClick",o=>o(t,n,r))}function qx(t,n,e,r){return Wi(t,"handleTripleClickOn",n,e,r)||t.someProp("handleTripleClick",o=>o(t,n,r))||Kx(t,e,r)}function Kx(t,n,e){if(e.button!=0)return!1;let r=t.state.doc;if(n==-1)return r.inlineContent?(We(t,P.create(r,0,r.content.size)),!0):!1;let o=r.resolve(n);for(let i=o.depth+1;i>0;i--){let a=i>o.depth?o.nodeAfter:o.node(i),s=o.before(i);if(a.inlineContent)We(t,P.create(r,s+1,s+1+a.content.size));else if(O.isSelectable(a))We(t,O.create(r,s));else continue;return!0}}function Ui(t){return mr(t)}const Md=_n?"metaKey":"ctrlKey";hn.mousedown=(t,n)=>{let e=n;t.input.shiftKey=e.shiftKey;let r=Ui(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&jx(e,t.input.lastClick)&&!e[Md]&&t.input.lastClick.button==e.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:e.clientX,y:e.clientY,type:i,button:e.button};let a=t.posAtCoords(io(e));a&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Jx(t,a,e,!!r)):(i=="doubleClick"?Ux:qx)(t,a.pos,a.inside,e)?e.preventDefault():Zn(t,"pointer"))};class Jx{constructor(n,e,r,o){this.view=n,this.pos=e,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=n.state.doc,this.selectNode=!!r[Md],this.allowDefault=r.shiftKey;let i,a;if(e.inside>-1)i=n.state.doc.nodeAt(e.inside),a=e.inside;else{let d=n.state.doc.resolve(e.pos);i=d.parent,a=d.depth?d.before():0}const s=o?null:r.target,l=s?n.docView.nearestDesc(s,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=n.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof O&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&$n&&!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()),n.root.addEventListener("mouseup",this.up=this.up.bind(this)),n.root.addEventListener("mousemove",this.move=this.move.bind(this)),Zn(n,"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(()=>Xn(this.view)),this.view.input.mouseDown=null}up(n){if(this.done(),!this.view.dom.contains(n.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(io(n))),this.updateAllowDefault(n),this.allowDefault||!e?Zn(this.view,"pointer"):Wx(this.view,e.pos,e.inside,n,this.selectNode)?n.preventDefault():n.button==0&&(this.flushed||dn&&this.mightDrag&&!this.mightDrag.node.isAtom||sn&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(We(this.view,B.near(this.view.state.doc.resolve(e.pos))),n.preventDefault()):Zn(this.view,"pointer")}move(n){this.updateAllowDefault(n),Zn(this.view,"pointer"),n.buttons==0&&this.done()}updateAllowDefault(n){!this.allowDefault&&(Math.abs(this.event.x-n.clientX)>4||Math.abs(this.event.y-n.clientY)>4)&&(this.allowDefault=!0)}}hn.touchstart=t=>{t.input.lastTouch=Date.now(),Ui(t),Zn(t,"pointer")};hn.touchmove=t=>{t.input.lastTouch=Date.now(),Zn(t,"pointer")};hn.contextmenu=t=>Ui(t);function Dd(t,n){return t.composing?!0:dn&&Math.abs(n.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Gx=jn?5e3:-1;gn.compositionstart=gn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:n}=t,e=n.selection.$to;if(n.selection instanceof P&&(n.storedMarks||!e.textOffset&&e.parentOffset&&e.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||sn&&ld&&Yx(t)))t.markCursor=t.state.storedMarks||e.marks(),mr(t,!0),t.markCursor=null;else if(mr(t,!n.selection.empty),$n&&n.selection.empty&&e.parentOffset&&!e.textOffset&&e.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(a.nodeType==3){let s=t.domSelection();s&&s.collapse(a,a.nodeValue.length);break}else o=a,i=-1}}t.input.composing=!0}zd(t,Gx)};function Yx(t){let{focusNode:n,focusOffset:e}=t.domSelectionRange();if(!n||n.nodeType!=1||e>=n.childNodes.length)return!1;let r=n.childNodes[e];return r.nodeType==1&&r.contentEditable=="false"}gn.compositionend=(t,n)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=n.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,zd(t,20))};function zd(t,n){clearTimeout(t.input.composingTimeout),n>-1&&(t.input.composingTimeout=setTimeout(()=>mr(t),n))}function Od(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Zx());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Qx(t){let n=t.domSelectionRange();if(!n.focusNode)return null;let e=V0(n.focusNode,n.focusOffset),r=W0(n.focusNode,n.focusOffset);if(e&&r&&e!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(e==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let a=e.pmViewDesc;if(!(!a||!a.isText(e.nodeValue)))return r}}return e||r}function Zx(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function mr(t,n=!1){if(!(jn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Od(t),n||t.docView&&t.docView.dirty){let e=Hi(t),r=t.state.selection;return e&&!e.eq(r)?t.dispatch(t.state.tr.setSelection(e)):(t.markCursor||n)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function nb(t,n){if(!t.dom.parentNode)return;let e=t.dom.parentNode.appendChild(document.createElement("div"));e.appendChild(n),e.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(n),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e),t.focus()},50)}const St=xn&&re<15||Je&&J0<604;hn.copy=gn.cut=(t,n)=>{let e=n,r=t.state.selection,o=e.type=="cut";if(r.empty)return;let i=St?null:e.clipboardData,a=r.content(),{dom:s,text:l}=Xi(t,a);i?(e.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",l)):nb(t,s),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function eb(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function tb(t,n){if(!t.dom.parentNode)return;let e=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(e?"textarea":"div"));e||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),e?Et(t,r.value,null,o,n):Et(t,r.textContent,r.innerHTML,o,n)},50)}function Et(t,n,e,r,o){let i=Cd(t,n,e,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||w.empty)))return!0;if(!i)return!1;let a=eb(i),s=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(i);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Ad(t){let n=t.getData("text/plain")||t.getData("Text");if(n)return n;let e=t.getData("text/uri-list");return e?e.replace(/\r?\n/g," "):""}gn.paste=(t,n)=>{let e=n;if(t.composing&&!jn)return;let r=St?null:e.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Et(t,Ad(r),r.getData("text/html"),o,e)?e.preventDefault():tb(t,e)};class Ld{constructor(n,e,r){this.slice=n,this.move=e,this.node=r}}const rb=_n?"altKey":"ctrlKey";function Pd(t,n){let e;return t.someProp("dragCopies",r=>{e=e||r(n)}),e!=null?!e:!n[rb]}hn.dragstart=(t,n)=>{let e=n,r=t.input.mouseDown;if(r&&r.done(),!e.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(io(e)),a;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof O?o.to-1:o.to))){if(r&&r.mightDrag)a=O.create(t.state.doc,r.mightDrag.pos);else if(e.target&&e.target.nodeType==1){let h=t.docView.nearestDesc(e.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(a=O.create(t.state.doc,h.posBefore))}}let s=(a||t.state.selection).content(),{dom:l,text:c,slice:d}=Xi(t,s);(!e.dataTransfer.files.length||!sn||sd>120)&&e.dataTransfer.clearData(),e.dataTransfer.setData(St?"Text":"text/html",l.innerHTML),e.dataTransfer.effectAllowed="copyMove",St||e.dataTransfer.setData("text/plain",c),t.dragging=new Ld(d,Pd(t,e),a)};hn.dragend=t=>{let n=t.dragging;window.setTimeout(()=>{t.dragging==n&&(t.dragging=null)},50)};gn.dragover=gn.dragenter=(t,n)=>n.preventDefault();gn.drop=(t,n)=>{try{ob(t,n,t.dragging)}finally{t.dragging=null}};function ob(t,n,e){if(!n.dataTransfer)return;let r=t.posAtCoords(io(n));if(!r)return;let o=t.state.doc.resolve(r.pos),i=e&&e.slice;i?t.someProp("transformPasted",u=>{i=u(i,t,!1)}):i=Cd(t,Ad(n.dataTransfer),St?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(e&&Pd(t,n));if(t.someProp("handleDrop",u=>u(t,n,i||w.empty,a))){n.preventDefault();return}if(!i)return;n.preventDefault();let s=i?Qc(t.state.doc,o.pos,i):o.pos;s==null&&(s=o.pos);let l=t.state.tr;if(a){let{node:u}=e;u?u.replace(l):l.deleteSelection()}let c=l.mapping.map(s),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=l.doc;if(d?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),l.doc.eq(h))return;let g=l.doc.resolve(c);if(d&&O.isSelectable(i.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new O(g));else{let u=l.mapping.map(s);l.mapping.maps[l.mapping.maps.length-1].forEach((f,m,x,b)=>u=b),l.setSelection(ji(t,g,l.doc.resolve(u)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}hn.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())&&Xn(t)},20))};hn.blur=(t,n)=>{let e=n;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),e.relatedTarget&&t.dom.contains(e.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};hn.beforeinput=(t,n)=>{if(sn&&jn&&n.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,ge(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in gn)hn[t]=gn[t];function It(t,n){if(t==n)return!0;for(let e in t)if(t[e]!==n[e])return!1;for(let e in n)if(!(e in t))return!1;return!0}class xr{constructor(n,e){this.toDOM=n,this.spec=e||ke,this.side=this.spec.side||0}map(n,e,r,o){let{pos:i,deleted:a}=n.mapResult(e.from+o,this.side<0?-1:1);return a?null:new vn(i-r,i-r,this)}valid(){return!0}eq(n){return this==n||n instanceof xr&&(this.spec.key&&this.spec.key==n.spec.key||this.toDOM==n.toDOM&&It(this.spec,n.spec))}destroy(n){this.spec.destroy&&this.spec.destroy(n)}}class ie{constructor(n,e){this.attrs=n,this.spec=e||ke}map(n,e,r,o){let i=n.map(e.from+o,this.spec.inclusiveStart?-1:1)-r,a=n.map(e.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=a?null:new vn(i,a,this)}valid(n,e){return e.from<e.to}eq(n){return this==n||n instanceof ie&&It(this.attrs,n.attrs)&&It(this.spec,n.spec)}static is(n){return n.type instanceof ie}destroy(){}}class qi{constructor(n,e){this.attrs=n,this.spec=e||ke}map(n,e,r,o){let i=n.mapResult(e.from+o,1);if(i.deleted)return null;let a=n.mapResult(e.to+o,-1);return a.deleted||a.pos<=i.pos?null:new vn(i.pos-r,a.pos-r,this)}valid(n,e){let{index:r,offset:o}=n.content.findIndex(e.from),i;return o==e.from&&!(i=n.child(r)).isText&&o+i.nodeSize==e.to}eq(n){return this==n||n instanceof qi&&It(this.attrs,n.attrs)&&It(this.spec,n.spec)}destroy(){}}class vn{constructor(n,e,r){this.from=n,this.to=e,this.type=r}copy(n,e){return new vn(n,e,this.type)}eq(n,e=0){return this.type.eq(n.type)&&this.from+e==n.from&&this.to+e==n.to}map(n,e,r){return this.type.map(n,this,e,r)}static widget(n,e,r){return new vn(n,n,new xr(e,r))}static inline(n,e,r,o){return new vn(n,e,new ie(r,o))}static node(n,e,r,o){return new vn(n,e,new qi(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof ie}get widget(){return this.type instanceof xr}}const Re=[],ke={};class G{constructor(n,e){this.local=n.length?n:Re,this.children=e.length?e:Re}static create(n,e){return e.length?br(e,n,0,ke):cn}find(n,e,r){let o=[];return this.findInner(n??0,e??1e9,o,0,r),o}findInner(n,e,r,o,i){for(let a=0;a<this.local.length;a++){let s=this.local[a];s.from<=e&&s.to>=n&&(!i||i(s.spec))&&r.push(s.copy(s.from+o,s.to+o))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<e&&this.children[a+1]>n){let s=this.children[a]+1;this.children[a+2].findInner(n-s,e-s,r,o+s,i)}}map(n,e,r){return this==cn||n.maps.length==0?this:this.mapInner(n,e,0,0,r||ke)}mapInner(n,e,r,o,i){let a;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(n,r,o);l&&l.type.valid(e,l)?(a||(a=[])).push(l):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?ib(this.children,a||[],n,e,r,o,i):a?new G(a.sort(we),Re):cn}add(n,e){return e.length?this==cn?G.create(n,e):this.addInner(n,e,0):this}addInner(n,e,r){let o,i=0;n.forEach((s,l)=>{let c=l+r,d;if(d=Bd(e,s,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(s,d,c+1):o.splice(i,0,l,l+s.nodeSize,br(d,s,c+1,ke)),i+=3}});let a=Rd(i?Nd(e):e,-r);for(let s=0;s<a.length;s++)a[s].type.valid(n,a[s])||a.splice(s--,1);return new G(a.length?this.local.concat(a).sort(we):this.local,o||this.children)}remove(n){return n.length==0||this==cn?this:this.removeInner(n,0)}removeInner(n,e){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let a,s=r[i]+e,l=r[i+1]+e;for(let d=0,h;d<n.length;d++)(h=n[d])&&h.from>s&&h.to<l&&(n[d]=null,(a||(a=[])).push(h));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(a,s+1);c!=cn?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,a;i<n.length;i++)if(a=n[i])for(let s=0;s<o.length;s++)o[s].eq(a,e)&&(o==this.local&&(o=this.local.slice()),o.splice(s--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new G(o,r):cn}forChild(n,e){if(this==cn)return this;if(e.isLeaf)return G.empty;let r,o;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=n){this.children[s]==n&&(r=this.children[s+2]);break}let i=n+1,a=i+e.content.size;for(let s=0;s<this.local.length;s++){let l=this.local[s];if(l.from<a&&l.to>i&&l.type instanceof ie){let c=Math.max(i,l.from)-i,d=Math.min(a,l.to)-i;c<d&&(o||(o=[])).push(l.copy(c,d))}}if(o){let s=new G(o.sort(we),Re);return r?new Jn([s,r]):s}return r||cn}eq(n){if(this==n)return!0;if(!(n instanceof G)||this.local.length!=n.local.length||this.children.length!=n.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(n.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=n.children[e]||this.children[e+1]!=n.children[e+1]||!this.children[e+2].eq(n.children[e+2]))return!1;return!0}locals(n){return Ki(this.localsInner(n))}localsInner(n){if(this==cn)return Re;if(n.inlineContent||!this.local.some(ie.is))return this.local;let e=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ie||e.push(this.local[r]);return e}forEachSet(n){n(this)}}G.empty=new G([],[]);G.removeOverlap=Ki;const cn=G.empty;class Jn{constructor(n){this.members=n}map(n,e){const r=this.members.map(o=>o.map(n,e,ke));return Jn.from(r)}forChild(n,e){if(e.isLeaf)return G.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(n,e);i!=cn&&(i instanceof Jn?r=r.concat(i.members):r.push(i))}return Jn.from(r)}eq(n){if(!(n instanceof Jn)||n.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(n.members[e]))return!1;return!0}locals(n){let e,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(n);if(i.length)if(!e)e=i;else{r&&(e=e.slice(),r=!1);for(let a=0;a<i.length;a++)e.push(i[a])}}return e?Ki(r?e:e.sort(we)):Re}static from(n){switch(n.length){case 0:return cn;case 1:return n[0];default:return new Jn(n.every(e=>e instanceof G)?n:n.reduce((e,r)=>e.concat(r instanceof G?r:r.members),[]))}}forEachSet(n){for(let e=0;e<this.members.length;e++)this.members[e].forEachSet(n)}}function ib(t,n,e,r,o,i,a){let s=t.slice();for(let c=0,d=i;c<e.maps.length;c++){let h=0;e.maps[c].forEach((g,u,f,m)=>{let x=m-f-(u-g);for(let b=0;b<s.length;b+=3){let _=s[b+1];if(_<0||g>_+d-h)continue;let D=s[b]+d-h;u>=D?s[b+1]=g<=D?-2:-1:g>=d&&x&&(s[b]+=x,s[b+1]+=x)}h+=x}),d=e.maps[c].map(d,-1)}let l=!1;for(let c=0;c<s.length;c+=3)if(s[c+1]<0){if(s[c+1]==-2){l=!0,s[c+1]=-1;continue}let d=e.map(t[c]+i),h=d-o;if(h<0||h>=r.content.size){l=!0;continue}let g=e.map(t[c+1]+i,-1),u=g-o,{index:f,offset:m}=r.content.findIndex(h),x=r.maybeChild(f);if(x&&m==h&&m+x.nodeSize==u){let b=s[c+2].mapInner(e,x,d+1,t[c]+i+1,a);b!=cn?(s[c]=h,s[c+1]=u,s[c+2]=b):(s[c+1]=-2,l=!0)}else l=!0}if(l){let c=ab(s,t,n,e,o,i,a),d=br(c,r,0,a);n=d.local;for(let h=0;h<s.length;h+=3)s[h+1]<0&&(s.splice(h,3),h-=3);for(let h=0,g=0;h<d.children.length;h+=3){let u=d.children[h];for(;g<s.length&&s[g]<u;)g+=3;s.splice(g,0,d.children[h],d.children[h+1],d.children[h+2])}}return new G(n.sort(we),s)}function Rd(t,n){if(!n||!t.length)return t;let e=[];for(let r=0;r<t.length;r++){let o=t[r];e.push(new vn(o.from+n,o.to+n,o.type))}return e}function ab(t,n,e,r,o,i,a){function s(l,c){for(let d=0;d<l.local.length;d++){let h=l.local[d].map(r,o,c);h?e.push(h):a.onRemove&&a.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)s(l.children[d+2],l.children[d]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&s(t[l+2],n[l]+i+1);return e}function Bd(t,n,e){if(n.isLeaf)return null;let r=e+n.nodeSize,o=null;for(let i=0,a;i<t.length;i++)(a=t[i])&&a.from>e&&a.to<r&&((o||(o=[])).push(a),t[i]=null);return o}function Nd(t){let n=[];for(let e=0;e<t.length;e++)t[e]!=null&&n.push(t[e]);return n}function br(t,n,e,r){let o=[],i=!1;n.forEach((s,l)=>{let c=Bd(t,s,l+e);if(c){i=!0;let d=br(c,s,e+l+1,r);d!=cn&&o.push(l,l+s.nodeSize,d)}});let a=Rd(i?Nd(t):t,-e).sort(we);for(let s=0;s<a.length;s++)a[s].type.valid(n,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||o.length?new G(a,o):cn}function we(t,n){return t.from-n.from||t.to-n.to}function Ki(t){let n=t;for(let e=0;e<n.length-1;e++){let r=n[e];if(r.from!=r.to)for(let o=e+1;o<n.length;o++){let i=n[o];if(i.from==r.from){i.to!=r.to&&(n==t&&(n=t.slice()),n[o]=i.copy(i.from,r.to),ks(n,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(n==t&&(n=t.slice()),n[e]=r.copy(r.from,i.from),ks(n,o,r.copy(i.from,r.to)));break}}}return n}function ks(t,n,e){for(;n<t.length&&we(e,t[n])>0;)n++;t.splice(n,0,e)}function To(t){let n=[];return t.someProp("decorations",e=>{let r=e(t.state);r&&r!=cn&&n.push(r)}),t.cursorWrapper&&n.push(G.create(t.state.doc,[t.cursorWrapper.deco])),Jn.from(n)}const sb={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},lb=xn&&re<=11;class cb{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(n){this.anchorNode=n.anchorNode,this.anchorOffset=n.anchorOffset,this.focusNode=n.focusNode,this.focusOffset=n.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(n){return n.anchorNode==this.anchorNode&&n.anchorOffset==this.anchorOffset&&n.focusNode==this.focusNode&&n.focusOffset==this.focusOffset}}class db{constructor(n,e){this.view=n,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new cb,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);xn&&re<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():dn&&n.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(n.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),lb&&(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,sb)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let n=this.observer.takeRecords();if(n.length){for(let e=0;e<n.length;e++)this.queue.push(n[e]);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(gs(this.view)){if(this.suppressingSelectionUpdates)return Xn(this.view);if(xn&&re<=11&&!this.view.state.selection.empty){let n=this.view.domSelectionRange();if(n.focusNode&&Ie(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(n){if(!n.focusNode)return!0;let e=new Set,r;for(let i=n.focusNode;i;i=Ke(i))e.add(i);for(let i=n.anchorNode;i;i=Ke(i))if(e.has(i)){r=i;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}pendingRecords(){if(this.observer)for(let n of this.observer.takeRecords())this.queue.push(n);return this.queue}flush(){let{view:n}=this;if(!n.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let r=n.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&gs(n)&&!this.ignoreSelectionChange(r),i=-1,a=-1,s=!1,l=[];if(n.editable)for(let d=0;d<e.length;d++){let h=this.registerMutation(e[d],l);h&&(i=i<0?h.from:Math.min(h.from,i),a=a<0?h.to:Math.max(h.to,a),h.typeOver&&(s=!0))}if(l.some(d=>d.nodeName=="BR")&&(n.input.lastKeyCode==8||n.input.lastKeyCode==46)){for(let d of l)if(d.nodeName=="BR"&&d.parentNode){let h=d.nextSibling;for(;h&&h.nodeType==1;){if(h.contentEditable=="false"){d.parentNode.removeChild(d);break}h=h.firstChild}}}else if($n&&l.length){let d=l.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,g]=d;h.parentNode&&h.parentNode.parentNode==g.parentNode?g.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let g of d){let u=g.parentNode;u&&u.nodeName=="LI"&&(!h||gb(n,h)!=u)&&g.remove()}}}let c=null;i<0&&o&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&ro(r)&&(c=Hi(n))&&c.eq(B.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,Xn(n),this.currentSelection.set(r),n.scrollToSelection()):(i>-1||o)&&(i>-1&&(n.docView.markDirty(i,a),pb(n)),n.input.badSafariComposition&&(n.input.badSafariComposition=!1,ub(n,l)),this.handleDOMChange(i,a,s,l),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(r)||Xn(n),this.currentSelection.set(r))}registerMutation(n,e){if(e.indexOf(n.target)>-1)return null;let r=this.view.docView.nearestDesc(n.target);if(n.type=="attributes"&&(r==this.view.docView||n.attributeName=="contenteditable"||n.attributeName=="style"&&!n.oldValue&&!n.target.getAttribute("style"))||!r||r.ignoreMutation(n))return null;if(n.type=="childList"){for(let d=0;d<n.addedNodes.length;d++){let h=n.addedNodes[d];e.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(n.target))return{from:r.posBefore,to:r.posAfter};let o=n.previousSibling,i=n.nextSibling;if(xn&&re<=11&&n.addedNodes.length)for(let d=0;d<n.addedNodes.length;d++){let{previousSibling:h,nextSibling:g}=n.addedNodes[d];(!h||Array.prototype.indexOf.call(n.addedNodes,h)<0)&&(o=h),(!g||Array.prototype.indexOf.call(n.addedNodes,g)<0)&&(i=g)}let a=o&&o.parentNode==n.target?on(o)+1:0,s=r.localPosFromDOM(n.target,a,-1),l=i&&i.parentNode==n.target?on(i):n.target.childNodes.length,c=r.localPosFromDOM(n.target,l,1);return{from:s,to:c}}else return n.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=n.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:n.target.nodeValue==n.oldValue})}}let ws=new WeakMap,_s=!1;function pb(t){if(!ws.has(t)&&(ws.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=$n,_s)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."),_s=!0}}function Cs(t,n){let e=n.startContainer,r=n.startOffset,o=n.endContainer,i=n.endOffset,a=t.domAtPos(t.state.selection.anchor);return Ie(a.node,a.offset,o,i)&&([e,r,o,i]=[o,i,e,r]),{anchorNode:e,anchorOffset:r,focusNode:o,focusOffset:i}}function hb(t,n){if(n.getComposedRanges){let o=n.getComposedRanges(t.root)[0];if(o)return Cs(t,o)}let e;function r(o){o.preventDefault(),o.stopImmediatePropagation(),e=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),e?Cs(t,e):null}function gb(t,n){for(let e=n.parentNode;e&&e!=t.dom;e=e.parentNode){let r=t.docView.nearestDesc(e,!0);if(r&&r.node.isBlock)return e}return null}function ub(t,n){var e;let{focusNode:r,focusOffset:o}=t.domSelectionRange();for(let i of n)if(((e=i.parentNode)===null||e===void 0?void 0:e.nodeName)=="TR"){let a=i.nextSibling;for(;a&&a.nodeName!="TD"&&a.nodeName!="TH";)a=a.nextSibling;if(a){let s=a;for(;;){let l=s.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;s=l}s.insertBefore(i,s.firstChild),r==i&&t.domSelection().collapse(i,o)}else i.parentNode.removeChild(i)}}function fb(t,n,e){let{node:r,fromOffset:o,toOffset:i,from:a,to:s}=t.docView.parseRange(n,e),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],ro(l)||c.push({node:l.focusNode,offset:l.focusOffset})),sn&&t.input.lastKeyCode===8)for(let x=i;x>o;x--){let b=r.childNodes[x-1],_=b.pmViewDesc;if(b.nodeName=="BR"&&!_){i=x;break}if(!_||_.size)break}let h=t.state.doc,g=t.someProp("domParser")||te.fromSchema(t.state.schema),u=h.resolve(a),f=null,m=g.parse(r,{topNode:u.parent,topMatch:u.parent.contentMatchAt(u.index()),topOpen:!0,from:o,to:i,preserveWhitespace:u.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:mb,context:u});if(c&&c[0].pos!=null){let x=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=x),f={anchor:x+a,head:b+a}}return{doc:m,sel:f,from:a,to:s}}function mb(t){let n=t.pmViewDesc;if(n)return n.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(dn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(t.parentNode.lastChild==t||dn&&/^(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 xb=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function bb(t,n,e,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,n<0){let C=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,z=Hi(t,C);if(z&&!t.state.selection.eq(z)){if(sn&&jn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",V=>V(t,ge(13,"Enter"))))return;let F=t.state.tr.setSelection(z);C=="pointer"?F.setMeta("pointer",!0):C=="key"&&F.scrollIntoView(),i&&F.setMeta("composition",i),t.dispatch(F)}return}let a=t.state.doc.resolve(n),s=a.sharedDepth(e);n=a.before(s+1),e=t.state.doc.resolve(e).after(s+1);let l=t.state.selection,c=fb(t,n,e),d=t.state.doc,h=d.slice(c.from,c.to),g,u;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(g=t.state.selection.to,u="end"):(g=t.state.selection.from,u="start"),t.input.lastKeyCode=null;let f=kb(h.content,c.doc.content,c.from,g,u);if(f&&t.input.domChangeCount++,(Je&&t.input.lastIOSEnter>Date.now()-225||jn)&&o.some(C=>C.nodeType==1&&!xb.test(C.nodeName))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",C=>C(t,ge(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!f)if(r&&l instanceof P&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))f={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=Ss(t,t.state.doc,c.sel);if(C&&!C.eq(t.state.selection)){let z=t.state.tr.setSelection(C);i&&z.setMeta("composition",i),t.dispatch(z)}}return}t.state.selection.from<t.state.selection.to&&f.start==f.endB&&t.state.selection instanceof P&&(f.start>t.state.selection.from&&f.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?f.start=t.state.selection.from:f.endA<t.state.selection.to&&f.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(f.endB+=t.state.selection.to-f.endA,f.endA=t.state.selection.to)),xn&&re<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>c.from&&c.doc.textBetween(f.start-c.from-1,f.start-c.from+1)==" "&&(f.start--,f.endA--,f.endB--);let m=c.doc.resolveNoCache(f.start-c.from),x=c.doc.resolveNoCache(f.endB-c.from),b=d.resolve(f.start),_=m.sameParent(x)&&m.parent.inlineContent&&b.end()>=f.endA;if((Je&&t.input.lastIOSEnter>Date.now()-225&&(!_||o.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!_&&m.pos<c.doc.content.size&&(!m.sameParent(x)||!m.parent.inlineContent)&&m.pos<x.pos&&!/\S/.test(c.doc.textBetween(m.pos,x.pos,"","")))&&t.someProp("handleKeyDown",C=>C(t,ge(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>f.start&&vb(d,f.start,f.endA,m,x)&&t.someProp("handleKeyDown",C=>C(t,ge(8,"Backspace")))){jn&&sn&&t.domObserver.suppressSelectionUpdates();return}sn&&f.endB==f.start&&(t.input.lastChromeDelete=Date.now()),jn&&!_&&m.start()!=x.start()&&x.parentOffset==0&&m.depth==x.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==f.endA&&(f.endB-=2,x=c.doc.resolveNoCache(f.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(C){return C(t,ge(13,"Enter"))})},20));let D=f.start,A=f.endA,L=C=>{let z=C||t.state.tr.replace(D,A,c.doc.slice(f.start-c.from,f.endB-c.from));if(c.sel){let F=Ss(t,z.doc,c.sel);F&&!(sn&&t.composing&&F.empty&&(f.start!=f.endB||t.input.lastChromeDelete<Date.now()-100)&&(F.head==D||F.head==z.mapping.map(A)-1)||xn&&F.empty&&F.head==D)&&z.setSelection(F)}return i&&z.setMeta("composition",i),z.scrollIntoView()},H;if(_)if(m.pos==x.pos){xn&&re<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Xn(t),20));let C=L(t.state.tr.delete(D,A)),z=d.resolve(f.start).marksAcross(d.resolve(f.endA));z&&C.ensureMarks(z),t.dispatch(C)}else if(f.endA==f.endB&&(H=yb(m.parent.content.cut(m.parentOffset,x.parentOffset),b.parent.content.cut(b.parentOffset,f.endA-b.start())))){let C=L(t.state.tr);H.type=="add"?C.addMark(D,A,H.mark):C.removeMark(D,A,H.mark),t.dispatch(C)}else if(m.parent.child(m.index()).isText&&m.index()==x.index()-(x.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,x.parentOffset),z=()=>L(t.state.tr.insertText(C,D,A));t.someProp("handleTextInput",F=>F(t,D,A,C,z))||t.dispatch(z())}else t.dispatch(L());else t.dispatch(L())}function Ss(t,n,e){return Math.max(e.anchor,e.head)>n.content.size?null:ji(t,n.resolve(e.anchor),n.resolve(e.head))}function yb(t,n){let e=t.firstChild.marks,r=n.firstChild.marks,o=e,i=r,a,s,l;for(let d=0;d<r.length;d++)o=r[d].removeFromSet(o);for(let d=0;d<e.length;d++)i=e[d].removeFromSet(i);if(o.length==1&&i.length==0)s=o[0],a="add",l=d=>d.mark(s.addToSet(d.marks));else if(o.length==0&&i.length==1)s=i[0],a="remove",l=d=>d.mark(s.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<n.childCount;d++)c.push(l(n.child(d)));if(y.from(c).eq(t))return{mark:s,type:a}}function vb(t,n,e,r,o){if(e-n<=o.pos-r.pos||Mo(r,!0,!1)<o.pos)return!1;let i=t.resolve(n);if(!r.parent.isTextblock){let s=i.nodeAfter;return s!=null&&e==n+s.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let a=t.resolve(Mo(i,!0,!0));return!a.parent.isTextblock||a.pos>e||Mo(a,!0,!1)<e?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function Mo(t,n,e){let r=t.depth,o=n?t.end():t.pos;for(;r>0&&(n||t.indexAfter(r)==t.node(r).childCount);)r--,o++,n=!1;if(e){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function kb(t,n,e,r,o){let i=t.findDiffStart(n,e);if(i==null)return null;let{a,b:s}=t.findDiffEnd(n,e+t.size,e+n.size);if(o=="end"){let l=Math.max(0,i-Math.min(a,s));r-=a+l-i}if(a<i&&t.size<n.size){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<n.size&&Es(n.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}else if(s<i){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<t.size&&Es(t.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}return{start:i,endA:a,endB:s}}function Es(t){if(t.length!=2)return!1;let n=t.charCodeAt(0),e=t.charCodeAt(1);return n>=56320&&n<=57343&&e>=55296&&e<=56319}class Fd{constructor(n,e){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 Rx,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(Ds),this.dispatch=this.dispatch.bind(this),this.dom=n&&n.mount||document.createElement("div"),n&&(n.appendChild?n.appendChild(this.dom):typeof n=="function"?n(this.dom):n.mount&&(this.mounted=!0)),this.editable=Ts(this),$s(this),this.nodeViews=Ms(this),this.docView=ss(this.state.doc,Is(this),To(this),this.dom,this),this.domObserver=new db(this,(r,o,i,a)=>bb(this,r,o,i,a)),this.domObserver.start(),Bx(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let n=this._props;this._props={};for(let e in n)this._props[e]=n[e];this._props.state=this.state}return this._props}update(n){n.handleDOMEvents!=this._props.handleDOMEvents&&fi(this);let e=this._props;this._props=n,n.plugins&&(n.plugins.forEach(Ds),this.directPlugins=n.plugins),this.updateStateInner(n.state,e)}setProps(n){let e={};for(let r in this._props)e[r]=this._props[r];e.state=this.state;for(let r in n)e[r]=n[r];this.update(e)}updateState(n){this.updateStateInner(n,this._props)}updateStateInner(n,e){var r;let o=this.state,i=!1,a=!1;n.storedMarks&&this.composing&&(Od(this),a=!0),this.state=n;let s=o.plugins!=n.plugins||this._props.plugins!=e.plugins;if(s||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let u=Ms(this);_b(u,this.nodeViews)&&(this.nodeViews=u,i=!0)}(s||e.handleDOMEvents!=this._props.handleDOMEvents)&&fi(this),this.editable=Ts(this),$s(this);let l=To(this),c=Is(this),d=o.plugins!=n.plugins&&!o.doc.eq(n.doc)?"reset":n.scrollToSelection>o.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(n.doc,c,l);(h||!n.selection.eq(o.selection))&&(a=!0);let g=d=="preserve"&&a&&this.dom.style.overflowAnchor==null&&Q0(this);if(a){this.domObserver.stop();let u=h&&(xn||sn)&&!this.composing&&!o.selection.empty&&!n.selection.empty&&wb(o.selection,n.selection);if(h){let f=sn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Qx(this)),(i||!this.docView.update(n.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=ss(n.doc,c,l,this.dom,this)),f&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(u=!0)}u||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&wx(this))?Xn(this,u):(kd(this,n.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(n.doc)&&this.updateDraggedNode(this.dragging,o),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():g&&Z0(g)}scrollToSelection(){let n=this.domSelectionRange().focusNode;if(!(!n||!this.dom.contains(n.nodeType==1?n:n.parentNode))){if(!this.someProp("handleScrollToSelection",e=>e(this)))if(this.state.selection instanceof O){let e=this.docView.domAfterPos(this.state.selection.from);e.nodeType==1&&ns(this,e.getBoundingClientRect(),n)}else ns(this,this.coordsAtPos(this.state.selection.head,1),n)}}destroyPluginViews(){let n;for(;n=this.pluginViews.pop();)n.destroy&&n.destroy()}updatePluginViews(n){if(!n||n.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let r=this.directPlugins[e];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let r=this.state.plugins[e];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let e=0;e<this.pluginViews.length;e++){let r=this.pluginViews[e];r.update&&r.update(this,n)}}updateDraggedNode(n,e){let r=n.node,o=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-e.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new Ld(n.slice,n.move,o<0?void 0:O.create(this.state.doc,o))}someProp(n,e){let r=this._props&&this._props[n],o;if(r!=null&&(o=e?e(r):r))return o;for(let a=0;a<this.directPlugins.length;a++){let s=this.directPlugins[a].props[n];if(s!=null&&(o=e?e(s):s))return o}let i=this.state.plugins;if(i)for(let a=0;a<i.length;a++){let s=i[a].props[n];if(s!=null&&(o=e?e(s):s))return o}}hasFocus(){if(xn){let n=this.root.activeElement;if(n==this.dom)return!0;if(!n||!this.dom.contains(n))return!1;for(;n&&this.dom!=n&&this.dom.contains(n);){if(n.contentEditable=="false")return!1;n=n.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&nx(this.dom),Xn(this),this.domObserver.start()}get root(){let n=this._root;if(n==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return n||document}updateRoot(){this._root=null}posAtCoords(n){return ix(this,n)}coordsAtPos(n,e=1){return gd(this,n,e)}domAtPos(n,e=0){return this.docView.domFromPos(n,e)}nodeDOM(n){let e=this.docView.descAt(n);return e?e.nodeDOM:null}posAtDOM(n,e,r=-1){let o=this.docView.posFromDOM(n,e,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(n,e){return dx(this,e||this.state,n)}pasteHTML(n,e){return Et(this,"",n,!1,e||new ClipboardEvent("paste"))}pasteText(n,e){return Et(this,n,null,!0,e||new ClipboardEvent("paste"))}serializeForClipboard(n){return Xi(this,n)}destroy(){this.docView&&(Nx(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],To(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,j0())}get isDestroyed(){return this.docView==null}dispatchEvent(n){return Hx(this,n)}domSelectionRange(){let n=this.domSelection();return n?dn&&this.root.nodeType===11&&q0(this.dom.ownerDocument)==this.dom&&hb(this,n)||n:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Fd.prototype.dispatch=function(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))};function Is(t){let n=Object.create(null);return n.class="ProseMirror",n.contenteditable=String(t.editable),t.someProp("attributes",e=>{if(typeof e=="function"&&(e=e(t.state)),e)for(let r in e)r=="class"?n.class+=" "+e[r]:r=="style"?n.style=(n.style?n.style+";":"")+e[r]:!n[r]&&r!="contenteditable"&&r!="nodeName"&&(n[r]=String(e[r]))}),n.translate||(n.translate="no"),[vn.node(0,t.state.doc.content.size,n)]}function $s(t){if(t.markCursor){let n=document.createElement("img");n.className="ProseMirror-separator",n.setAttribute("mark-placeholder","true"),n.setAttribute("alt",""),t.cursorWrapper={dom:n,deco:vn.widget(t.state.selection.from,n,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Ts(t){return!t.someProp("editable",n=>n(t.state)===!1)}function wb(t,n){let e=Math.min(t.$anchor.sharedDepth(t.head),n.$anchor.sharedDepth(n.head));return t.$anchor.start(e)!=n.$anchor.start(e)}function Ms(t){let n=Object.create(null);function e(r){for(let o in r)Object.prototype.hasOwnProperty.call(n,o)||(n[o]=r[o])}return t.someProp("nodeViews",e),t.someProp("markViews",e),n}function _b(t,n){let e=0,r=0;for(let o in t){if(t[o]!=n[o])return!0;e++}for(let o in n)r++;return e!=r}function Ds(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 se={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:"'"},yr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Cb=typeof navigator<"u"&&/Mac/.test(navigator.platform),Sb=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var an=0;an<10;an++)se[48+an]=se[96+an]=String(an);for(var an=1;an<=24;an++)se[an+111]="F"+an;for(var an=65;an<=90;an++)se[an]=String.fromCharCode(an+32),yr[an]=String.fromCharCode(an);for(var Do in se)yr.hasOwnProperty(Do)||(yr[Do]=se[Do]);function Eb(t){var n=Cb&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Sb&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",e=!n&&t.key||(t.shiftKey?yr:se)[t.keyCode]||t.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}const Ib=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),$b=typeof navigator<"u"&&/Win/.test(navigator.platform);function Tb(t){let n=t.split(/-(?!$)/),e=n[n.length-1];e=="Space"&&(e=" ");let r,o,i,a;for(let s=0;s<n.length-1;s++){let l=n[s];if(/^(cmd|meta|m)$/i.test(l))a=!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))i=!0;else if(/^mod$/i.test(l))Ib?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(e="Alt-"+e),o&&(e="Ctrl-"+e),a&&(e="Meta-"+e),i&&(e="Shift-"+e),e}function Mb(t){let n=Object.create(null);for(let e in t)n[Tb(e)]=t[e];return n}function zo(t,n,e=!0){return n.altKey&&(t="Alt-"+t),n.ctrlKey&&(t="Ctrl-"+t),n.metaKey&&(t="Meta-"+t),e&&n.shiftKey&&(t="Shift-"+t),t}function Db(t){return new Q({props:{handleKeyDown:Hd(t)}})}function Hd(t){let n=Mb(t);return function(e,r){let o=Eb(r),i,a=n[zo(o,r)];if(a&&a(e.state,e.dispatch,e))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let s=n[zo(o,r,!1)];if(s&&s(e.state,e.dispatch,e))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!($b&&r.ctrlKey&&r.altKey)&&(i=se[r.keyCode])&&i!=o){let s=n[zo(i,r)];if(s&&s(e.state,e.dispatch,e))return!0}}return!1}}const zb=(t,n)=>t.selection.empty?!1:(n&&n(t.tr.deleteSelection().scrollIntoView()),!0);function jd(t,n){let{$cursor:e}=t.selection;return!e||e.parentOffset>0?null:e}const Ob=(t,n,e)=>{let r=jd(t);if(!r)return!1;let o=Ji(r);if(!o){let a=r.blockRange(),s=a&&Qe(a);return s==null?!1:(n&&n(t.tr.lift(a,s).scrollIntoView()),!0)}let i=o.nodeBefore;if(Ud(t,o,n,-1))return!0;if(r.parent.content.size==0&&(Ge(i,"end")||O.isSelectable(i)))for(let a=r.depth;;a--){let s=eo(t.doc,r.before(a),r.after(a),w.empty);if(s&&s.slice.size<s.to-s.from){if(n){let l=t.tr.step(s);l.setSelection(Ge(i,"end")?B.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):O.create(l.doc,o.pos-i.nodeSize)),n(l.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(n&&n(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},Ab=(t,n,e)=>{let r=jd(t);if(!r)return!1;let o=Ji(r);return o?Xd(t,o,n):!1},Lb=(t,n,e)=>{let r=Vd(t);if(!r)return!1;let o=Gi(r);return o?Xd(t,o,n):!1};function Xd(t,n,e){let r=n.nodeBefore,o=r,i=n.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let d=o.lastChild;if(!d)return!1;o=d}let a=n.nodeAfter,s=a,l=n.pos+1;for(;!s.isTextblock;l++){if(s.type.spec.isolating)return!1;let d=s.firstChild;if(!d)return!1;s=d}let c=eo(t.doc,i,l,w.empty);if(!c||c.from!=i||c instanceof J&&c.slice.size>=l-i)return!1;if(e){let d=t.tr.step(c);d.setSelection(P.create(d.doc,i)),e(d.scrollIntoView())}return!0}function Ge(t,n,e=!1){for(let r=t;r;r=n=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(e&&r.childCount!=1)return!1}return!1}const Pb=(t,n,e)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(r.parentOffset>0)return!1;i=Ji(r)}let a=i&&i.nodeBefore;return!a||!O.isSelectable(a)?!1:(n&&n(t.tr.setSelection(O.create(t.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)};function Ji(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){if(t.index(n)>0)return t.doc.resolve(t.before(n+1));if(t.node(n).type.spec.isolating)break}return null}function Vd(t,n){let{$cursor:e}=t.selection;return!e||e.parentOffset<e.parent.content.size?null:e}const Rb=(t,n,e)=>{let r=Vd(t);if(!r)return!1;let o=Gi(r);if(!o)return!1;let i=o.nodeAfter;if(Ud(t,o,n,1))return!0;if(r.parent.content.size==0&&(Ge(i,"start")||O.isSelectable(i))){let a=eo(t.doc,r.before(),r.after(),w.empty);if(a&&a.slice.size<a.to-a.from){if(n){let s=t.tr.step(a);s.setSelection(Ge(i,"start")?B.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):O.create(s.doc,s.mapping.map(o.pos))),n(s.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(n&&n(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},Bb=(t,n,e)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(r.parentOffset<r.parent.content.size)return!1;i=Gi(r)}let a=i&&i.nodeAfter;return!a||!O.isSelectable(a)?!1:(n&&n(t.tr.setSelection(O.create(t.doc,i.pos)).scrollIntoView()),!0)};function Gi(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){let e=t.node(n);if(t.index(n)+1<e.childCount)return t.doc.resolve(t.after(n+1));if(e.type.spec.isolating)break}return null}const Nb=(t,n)=>{let e=t.selection,r=e instanceof O,o;if(r){if(e.node.isTextblock||!le(t.doc,e.from))return!1;o=e.from}else if(o=no(t.doc,e.from,-1),o==null)return!1;if(n){let i=t.tr.join(o);r&&i.setSelection(O.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),n(i.scrollIntoView())}return!0},Fb=(t,n)=>{let e=t.selection,r;if(e instanceof O){if(e.node.isTextblock||!le(t.doc,e.to))return!1;r=e.to}else if(r=no(t.doc,e.to,1),r==null)return!1;return n&&n(t.tr.join(r).scrollIntoView()),!0},Hb=(t,n)=>{let{$from:e,$to:r}=t.selection,o=e.blockRange(r),i=o&&Qe(o);return i==null?!1:(n&&n(t.tr.lift(o,i).scrollIntoView()),!0)},jb=(t,n)=>{let{$head:e,$anchor:r}=t.selection;return!e.parent.type.spec.code||!e.sameParent(r)?!1:(n&&n(t.tr.insertText(`
|
|
21000
|
+
`).scrollIntoView()),!0)};function Wd(t){for(let n=0;n<t.edgeCount;n++){let{type:e}=t.edge(n);if(e.isTextblock&&!e.hasRequiredAttrs())return e}return null}const Xb=(t,n)=>{let{$head:e,$anchor:r}=t.selection;if(!e.parent.type.spec.code||!e.sameParent(r))return!1;let o=e.node(-1),i=e.indexAfter(-1),a=Wd(o.contentMatchAt(i));if(!a||!o.canReplaceWith(i,i,a))return!1;if(n){let s=e.after(),l=t.tr.replaceWith(s,s,a.createAndFill());l.setSelection(B.near(l.doc.resolve(s),1)),n(l.scrollIntoView())}return!0},Vb=(t,n)=>{let e=t.selection,{$from:r,$to:o}=e;if(e instanceof Sn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Wd(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(n){let a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=t.tr.insert(a,i.createAndFill());s.setSelection(P.create(s.doc,a+1)),n(s.scrollIntoView())}return!0},Wb=(t,n)=>{let{$cursor:e}=t.selection;if(!e||e.parent.content.size)return!1;if(e.depth>1&&e.after()!=e.end(-1)){let i=e.before();if(Xe(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let r=e.blockRange(),o=r&&Qe(r);return o==null?!1:(n&&n(t.tr.lift(r,o).scrollIntoView()),!0)},Ub=(t,n)=>{let{$from:e,to:r}=t.selection,o,i=e.sharedDepth(r);return i==0?!1:(o=e.before(i),n&&n(t.tr.setSelection(O.create(t.doc,o))),!0)};function qb(t,n,e){let r=n.nodeBefore,o=n.nodeAfter,i=n.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&n.parent.canReplace(i-1,i)?(e&&e(t.tr.delete(n.pos-r.nodeSize,n.pos).scrollIntoView()),!0):!n.parent.canReplace(i,i+1)||!(o.isTextblock||le(t.doc,n.pos))?!1:(e&&e(t.tr.join(n.pos).scrollIntoView()),!0)}function Ud(t,n,e,r){let o=n.nodeBefore,i=n.nodeAfter,a,s,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&qb(t,n,e))return!0;let c=!l&&n.parent.canReplace(n.index(),n.index()+1);if(c&&(a=(s=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&s.matchType(a[0]||i.type).validEnd){if(e){let u=n.pos+i.nodeSize,f=y.empty;for(let b=a.length-1;b>=0;b--)f=y.from(a[b].create(null,f));f=y.from(o.copy(f));let m=t.tr.step(new Z(n.pos-1,u,n.pos,u,new w(f,1,0),a.length,!0)),x=m.doc.resolve(u+2*a.length);x.nodeAfter&&x.nodeAfter.type==o.type&&le(m.doc,x.pos)&&m.join(x.pos),e(m.scrollIntoView())}return!0}let d=i.type.spec.isolating||r>0&&l?null:B.findFrom(n,1),h=d&&d.$from.blockRange(d.$to),g=h&&Qe(h);if(g!=null&&g>=n.depth)return e&&e(t.tr.lift(h,g).scrollIntoView()),!0;if(c&&Ge(i,"start",!0)&&Ge(o,"end")){let u=o,f=[];for(;f.push(u),!u.isTextblock;)u=u.lastChild;let m=i,x=1;for(;!m.isTextblock;m=m.firstChild)x++;if(u.canReplace(u.childCount,u.childCount,m.content)){if(e){let b=y.empty;for(let D=f.length-1;D>=0;D--)b=y.from(f[D].copy(b));let _=t.tr.step(new Z(n.pos-f.length,n.pos+i.nodeSize,n.pos+x,n.pos+i.nodeSize-x,new w(b,f.length,0),0,!0));e(_.scrollIntoView())}return!0}}return!1}function qd(t){return function(n,e){let r=n.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(e&&e(n.tr.setSelection(P.create(n.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const Kb=qd(-1),Jb=qd(1);function Gb(t,n=null){return function(e,r){let{$from:o,$to:i}=e.selection,a=o.blockRange(i),s=a&&Bi(a,t,n);return s?(r&&r(e.tr.wrap(a,s).scrollIntoView()),!0):!1}}function zs(t,n=null){return function(e,r){let o=!1;for(let i=0;i<e.selection.ranges.length&&!o;i++){let{$from:{pos:a},$to:{pos:s}}=e.selection.ranges[i];e.doc.nodesBetween(a,s,(l,c)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,n)))if(l.type==t)o=!0;else{let d=e.doc.resolve(c),h=d.index();o=d.parent.canReplaceWith(h,h+1,t)}})}if(!o)return!1;if(r){let i=e.tr;for(let a=0;a<e.selection.ranges.length;a++){let{$from:{pos:s},$to:{pos:l}}=e.selection.ranges[a];i.setBlockType(s,l,t,n)}r(i.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Yb(t,n=null){return function(e,r){let{$from:o,$to:i}=e.selection,a=o.blockRange(i);if(!a)return!1;let s=r?e.tr:null;return Qb(s,a,t,n)?(r&&r(s.scrollIntoView()),!0):!1}}function Qb(t,n,e,r=null){let o=!1,i=n,a=n.$from.doc;if(n.depth>=2&&n.$from.node(n.depth-1).type.compatibleContent(e)&&n.startIndex==0){if(n.$from.index(n.depth-1)==0)return!1;let l=a.resolve(n.start-2);i=new hr(l,l,n.depth),n.endIndex<n.parent.childCount&&(n=new hr(n.$from,a.resolve(n.$to.end(n.depth)),n.depth)),o=!0}let s=Bi(i,e,r,n);return s?(t&&Zb(t,n,s,o,e),!0):!1}function Zb(t,n,e,r,o){let i=y.empty;for(let d=e.length-1;d>=0;d--)i=y.from(e[d].type.create(e[d].attrs,i));t.step(new Z(n.start-(r?2:0),n.end,n.start,n.end,new w(i,0,0),e.length,!0));let a=0;for(let d=0;d<e.length;d++)e[d].type==o&&(a=d+1);let s=e.length-a,l=n.start+e.length-(r?2:0),c=n.parent;for(let d=n.startIndex,h=n.endIndex,g=!0;d<h;d++,g=!1)!g&&Xe(t.doc,l,s)&&(t.split(l,s),l+=2*s),l+=c.child(d).nodeSize;return t}function n2(t){return function(n,e){let{$from:r,$to:o}=n.selection,i=r.blockRange(o,a=>a.childCount>0&&a.firstChild.type==t);return i?e?r.node(i.depth-1).type==t?e2(n,e,t,i):t2(n,e,i):!0:!1}}function e2(t,n,e,r){let o=t.tr,i=r.end,a=r.$to.end(r.depth);i<a&&(o.step(new Z(i-1,a,i,a,new w(y.from(e.create(null,r.parent.copy())),1,0),1,!0)),r=new hr(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const s=Qe(r);if(s==null)return!1;o.lift(r,s);let l=o.doc.resolve(o.mapping.map(i,-1)-1);return le(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),n(o.scrollIntoView()),!0}function t2(t,n,e){let r=t.tr,o=e.parent;for(let u=e.end,f=e.endIndex-1,m=e.startIndex;f>m;f--)u-=o.child(f).nodeSize,r.delete(u-1,u+1);let i=r.doc.resolve(e.start),a=i.nodeAfter;if(r.mapping.map(e.end)!=e.start+i.nodeAfter.nodeSize)return!1;let s=e.startIndex==0,l=e.endIndex==o.childCount,c=i.node(-1),d=i.index(-1);if(!c.canReplace(d+(s?0:1),d+1,a.content.append(l?y.empty:y.from(o))))return!1;let h=i.pos,g=h+a.nodeSize;return r.step(new Z(h-(s?1:0),g+(l?1:0),h+1,g-1,new w((s?y.empty:y.from(o.copy(y.empty))).append(l?y.empty:y.from(o.copy(y.empty))),s?0:1,l?0:1),s?0:1)),n(r.scrollIntoView()),!0}function r2(t){return function(n,e){let{$from:r,$to:o}=n.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let a=i.startIndex;if(a==0)return!1;let s=i.parent,l=s.child(a-1);if(l.type!=t)return!1;if(e){let c=l.lastChild&&l.lastChild.type==s.type,d=y.from(c?t.create():null),h=new w(y.from(t.create(null,y.from(s.type.create(null,d)))),c?3:1,0),g=i.start,u=i.end;e(n.tr.step(new Z(g-(c?3:1),u,g,u,h,1,!0)).scrollIntoView())}return!0}}function ao(t){const{state:n,transaction:e}=t;let{selection:r}=e,{doc:o}=e,{storedMarks:i}=e;return{...n,apply:n.apply.bind(n),applyTransaction:n.applyTransaction.bind(n),plugins:n.plugins,schema:n.schema,reconfigure:n.reconfigure.bind(n),toJSON:n.toJSON.bind(n),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=e.selection,o=e.doc,i=e.storedMarks,e}}}class so{constructor(n){this.editor=n.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=n.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:n,editor:e,state:r}=this,{view:o}=e,{tr:i}=r,a=this.buildProps(i);return Object.fromEntries(Object.entries(n).map(([s,l])=>[s,(...d)=>{const h=l(...d)(a);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,e=!0){const{rawCommands:r,editor:o,state:i}=this,{view:a}=o,s=[],l=!!n,c=n||i.tr,d=()=>(!l&&e&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),s.every(g=>g===!0)),h={...Object.fromEntries(Object.entries(r).map(([g,u])=>[g,(...m)=>{const x=this.buildProps(c,e),b=u(...m)(x);return s.push(b),h}])),run:d};return h}createCan(n){const{rawCommands:e,state:r}=this,o=!1,i=n||r.tr,a=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...d)=>c(...d)({...a,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(n,e=!0){const{rawCommands:r,editor:o,state:i}=this,{view:a}=o,s={tr:n,editor:o,view:a,state:ao({state:i,transaction:n}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(n,e),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...d)=>c(...d)(s)]))}};return s}}class o2{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const r=this.callbacks[n];return r&&r.forEach(o=>o.apply(this,e)),this}off(n,e){const r=this.callbacks[n];return r&&(e?this.callbacks[n]=r.filter(o=>o!==e):delete this.callbacks[n]),this}once(n,e){const r=(...o)=>{this.off(n,r),e.apply(this,o)};return this.on(n,r)}removeAllListeners(){this.callbacks={}}}function S(t,n,e){return t.config[n]===void 0&&t.parent?S(t.parent,n,e):typeof t.config[n]=="function"?t.config[n].bind({...e,parent:t.parent?S(t.parent,n,e):null}):t.config[n]}function lo(t){const n=t.filter(o=>o.type==="extension"),e=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:n,nodeExtensions:e,markExtensions:r}}function Kd(t){const n=[],{nodeExtensions:e,markExtensions:r}=lo(t),o=[...e,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage,extensions:o},l=S(a,"addGlobalAttributes",s);if(!l)return;l().forEach(d=>{d.types.forEach(h=>{Object.entries(d.attributes).forEach(([g,u])=>{n.push({type:h,name:g,attribute:{...i,...u}})})})})}),o.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},l=S(a,"addAttributes",s);if(!l)return;const c=l();Object.entries(c).forEach(([d,h])=>{const g={...i,...h};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,n.push({type:a.name,name:d,attribute:g})})}),n}function en(t,n){if(typeof t=="string"){if(!n.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return n.nodes[t]}return t}function tn(...t){return t.filter(n=>!!n).reduce((n,e)=>{const r={...n};return Object.entries(e).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const s=i?String(i).split(" "):[],l=r[o]?r[o].split(" "):[],c=s.filter(d=>!l.includes(d));r[o]=[...l,...c].join(" ")}else if(o==="style"){const s=i?i.split(";").map(d=>d.trim()).filter(Boolean):[],l=r[o]?r[o].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[h,g]=d.split(":").map(u=>u.trim());c.set(h,g)}),s.forEach(d=>{const[h,g]=d.split(":").map(u=>u.trim());c.set(h,g)}),r[o]=Array.from(c.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[o]=i}),r},{})}function mi(t,n){return n.filter(e=>e.type===t.type.name).filter(e=>e.attribute.rendered).map(e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]}).reduce((e,r)=>tn(e,r),{})}function Jd(t){return typeof t=="function"}function N(t,n=void 0,...e){return Jd(t)?n?t.bind(n)(...e):t(...e):t}function i2(t={}){return Object.keys(t).length===0&&t.constructor===Object}function a2(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Os(t,n){return"style"in t?t:{...t,getAttrs:e=>{const r=t.getAttrs?t.getAttrs(e):t.attrs;if(r===!1)return!1;const o=n.reduce((i,a)=>{const s=a.attribute.parseHTML?a.attribute.parseHTML(e):a2(e.getAttribute(a.name));return s==null?i:{...i,[a.name]:s}},{});return{...r,...o}}}}function As(t){return Object.fromEntries(Object.entries(t).filter(([n,e])=>n==="attrs"&&i2(e)?!1:e!=null))}function s2(t,n){var e;const r=Kd(t),{nodeExtensions:o,markExtensions:i}=lo(t),a=(e=o.find(c=>S(c,"topNode")))===null||e===void 0?void 0:e.name,s=Object.fromEntries(o.map(c=>{const d=r.filter(b=>b.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:n},g=t.reduce((b,_)=>{const D=S(_,"extendNodeSchema",h);return{...b,...D?D(c):{}}},{}),u=As({...g,content:N(S(c,"content",h)),marks:N(S(c,"marks",h)),group:N(S(c,"group",h)),inline:N(S(c,"inline",h)),atom:N(S(c,"atom",h)),selectable:N(S(c,"selectable",h)),draggable:N(S(c,"draggable",h)),code:N(S(c,"code",h)),whitespace:N(S(c,"whitespace",h)),linebreakReplacement:N(S(c,"linebreakReplacement",h)),defining:N(S(c,"defining",h)),isolating:N(S(c,"isolating",h)),attrs:Object.fromEntries(d.map(b=>{var _;return[b.name,{default:(_=b==null?void 0:b.attribute)===null||_===void 0?void 0:_.default}]}))}),f=N(S(c,"parseHTML",h));f&&(u.parseDOM=f.map(b=>Os(b,d)));const m=S(c,"renderHTML",h);m&&(u.toDOM=b=>m({node:b,HTMLAttributes:mi(b,d)}));const x=S(c,"renderText",h);return x&&(u.toText=x),[c.name,u]})),l=Object.fromEntries(i.map(c=>{const d=r.filter(x=>x.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:n},g=t.reduce((x,b)=>{const _=S(b,"extendMarkSchema",h);return{...x,..._?_(c):{}}},{}),u=As({...g,inclusive:N(S(c,"inclusive",h)),excludes:N(S(c,"excludes",h)),group:N(S(c,"group",h)),spanning:N(S(c,"spanning",h)),code:N(S(c,"code",h)),attrs:Object.fromEntries(d.map(x=>{var b;return[x.name,{default:(b=x==null?void 0:x.attribute)===null||b===void 0?void 0:b.default}]}))}),f=N(S(c,"parseHTML",h));f&&(u.parseDOM=f.map(x=>Os(x,d)));const m=S(c,"renderHTML",h);return m&&(u.toDOM=x=>m({mark:x,HTMLAttributes:mi(x,d)})),[c.name,u]}));return new Hc({topNode:a,nodes:s,marks:l})}function Oo(t,n){return n.nodes[t]||n.marks[t]||null}function Ls(t,n){return Array.isArray(n)?n.some(e=>(typeof e=="string"?e:e.name)===t.name):n}function Yi(t,n){const e=Me.fromSchema(n).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(e),o.innerHTML}const l2=(t,n=500)=>{let e="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-n),r,(o,i,a,s)=>{var l,c;const d=((c=(l=o.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:o,pos:i,parent:a,index:s}))||o.textContent||"%leaf%";e+=o.isAtom&&!o.isText?d:d.slice(0,Math.max(0,r-i))}),e};function Qi(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class co{constructor(n){this.find=n.find,this.handler=n.handler}}const c2=(t,n)=>{if(Qi(n))return n.exec(t);const e=n(t);if(!e)return null;const r=[e.text];return r.index=e.index,r.input=t,r.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(e.replaceWith)),r};function Xt(t){var n;const{editor:e,from:r,to:o,text:i,rules:a,plugin:s}=t,{view:l}=e;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((n=c.nodeBefore||c.nodeAfter)===null||n===void 0)&&n.marks.find(g=>g.type.spec.code))return!1;let d=!1;const h=l2(c)+i;return a.forEach(g=>{if(d)return;const u=c2(h,g.find);if(!u)return;const f=l.state.tr,m=ao({state:l.state,transaction:f}),x={from:r-(u[0].length-i.length),to:o},{commands:b,chain:_,can:D}=new so({editor:e,state:m});g.handler({state:m,range:x,match:u,commands:b,chain:_,can:D})===null||!f.steps.length||(f.setMeta(s,{transform:f,from:r,to:o,text:i}),l.dispatch(f),d=!0)}),d}function d2(t){const{editor:n,rules:e}=t,r=new Q({state:{init(){return null},apply(o,i,a){const s=o.getMeta(r);if(s)return s;const l=o.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=Yi(y.from(d),a.schema);const{from:h}=l,g=h+d.length;Xt({editor:n,from:h,to:g,text:d,rules:e,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,a,s){return Xt({editor:n,from:i,to:a,text:s,rules:e,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&Xt({editor:n,from:i.pos,to:i.pos,text:"",rules:e,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:a}=o.state.selection;return a?Xt({editor:n,from:a.pos,to:a.pos,text:`
|
|
21001
|
+
`,rules:e,plugin:r}):!1}},isInputRules:!0});return r}function p2(t){return Object.prototype.toString.call(t).slice(8,-1)}function Vt(t){return p2(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function po(t,n){const e={...t};return Vt(t)&&Vt(n)&&Object.keys(n).forEach(r=>{Vt(n[r])&&Vt(t[r])?e[r]=po(t[r],n[r]):e[r]=n[r]}),e}class Ln{constructor(n={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...n},this.name=this.config.name,n.defaultOptions&&Object.keys(n.defaultOptions).length>0&&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=N(S(this,"addOptions",{name:this.name}))),this.storage=N(S(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new Ln(n)}configure(n={}){const e=this.extend({...this.config,addOptions:()=>po(this.options,n)});return e.name=this.name,e.parent=this.parent,e}extend(n={}){const e=new Ln(n);return e.parent=this,this.child=e,e.name=n.name?n.name:e.parent.name,n.defaultOptions&&Object.keys(n.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=N(S(e,"addOptions",{name:e.name})),e.storage=N(S(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:n,mark:e}){const{tr:r}=n.state,o=n.state.selection.$from;if(o.pos===o.end()){const a=o.marks();if(!!!a.find(c=>(c==null?void 0:c.type.name)===e.name))return!1;const l=a.find(c=>(c==null?void 0:c.type.name)===e.name);return l&&r.removeStoredMark(l),r.insertText(" ",o.pos),n.view.dispatch(r),!0}return!1}}function h2(t){return typeof t=="number"}class g2{constructor(n){this.find=n.find,this.handler=n.handler}}const u2=(t,n,e)=>{if(Qi(n))return[...t.matchAll(n)];const r=n(t,e);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function f2(t){const{editor:n,state:e,from:r,to:o,rule:i,pasteEvent:a,dropEvent:s}=t,{commands:l,chain:c,can:d}=new so({editor:n,state:e}),h=[];return e.doc.nodesBetween(r,o,(u,f)=>{if(!u.isTextblock||u.type.spec.code)return;const m=Math.max(r,f),x=Math.min(o,f+u.content.size),b=u.textBetween(m-f,x-f,void 0,"");u2(b,i.find,a).forEach(D=>{if(D.index===void 0)return;const A=m+D.index+1,L=A+D[0].length,H={from:e.tr.mapping.map(A),to:e.tr.mapping.map(L)},C=i.handler({state:e,range:H,match:D,commands:l,chain:c,can:d,pasteEvent:a,dropEvent:s});h.push(C)})}),h.every(u=>u!==null)}let Wt=null;const m2=t=>{var n;const e=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(n=e.clipboardData)===null||n===void 0||n.setData("text/html",t),e};function x2(t){const{editor:n,rules:e}=t;let r=null,o=!1,i=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,s;try{s=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{s=null}const l=({state:d,from:h,to:g,rule:u,pasteEvt:f})=>{const m=d.tr,x=ao({state:d,transaction:m});if(!(!f2({editor:n,state:x,from:Math.max(h-1,0),to:g.b-1,rule:u,pasteEvent:f,dropEvent:s})||!m.steps.length)){try{s=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{s=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return e.map(d=>new Q({view(h){const g=f=>{var m;r=!((m=h.dom.parentElement)===null||m===void 0)&&m.contains(f.target)?h.dom.parentElement:null,r&&(Wt=n)},u=()=>{Wt&&(Wt=null)};return window.addEventListener("dragstart",g),window.addEventListener("dragend",u),{destroy(){window.removeEventListener("dragstart",g),window.removeEventListener("dragend",u)}}},props:{handleDOMEvents:{drop:(h,g)=>{if(i=r===h.dom.parentElement,s=g,!i){const u=Wt;u!=null&&u.isEditable&&setTimeout(()=>{const f=u.state.selection;f&&u.commands.deleteRange({from:f.from,to:f.to})},10)}return!1},paste:(h,g)=>{var u;const f=(u=g.clipboardData)===null||u===void 0?void 0:u.getData("text/html");return a=g,o=!!(f!=null&&f.includes("data-pm-slice")),!1}}},appendTransaction:(h,g,u)=>{const f=h[0],m=f.getMeta("uiEvent")==="paste"&&!o,x=f.getMeta("uiEvent")==="drop"&&!i,b=f.getMeta("applyPasteRules"),_=!!b;if(!m&&!x&&!_)return;if(_){let{text:L}=b;typeof L=="string"?L=L:L=Yi(y.from(L),u.schema);const{from:H}=b,C=H+L.length,z=m2(L);return l({rule:d,state:u,from:H,to:{b:C},pasteEvt:z})}const D=g.doc.content.findDiffStart(u.doc.content),A=g.doc.content.findDiffEnd(u.doc.content);if(!(!h2(D)||!A||D===A.b))return l({rule:d,state:u,from:D,to:A,pasteEvt:a})}}))}function b2(t){const n=t.filter((e,r)=>t.indexOf(e)!==r);return Array.from(new Set(n))}class He{constructor(n,e){this.splittableMarks=[],this.editor=e,this.extensions=He.resolve(n),this.schema=s2(this.extensions,e),this.setupExtensions()}static resolve(n){const e=He.sort(He.flatten(n)),r=b2(e.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.`),e}static flatten(n){return n.map(e=>{const r={name:e.name,options:e.options,storage:e.storage},o=S(e,"addExtensions",r);return o?[e,...this.flatten(o())]:e}).flat(10)}static sort(n){return n.sort((r,o)=>{const i=S(r,"priority")||100,a=S(o,"priority")||100;return i>a?-1:i<a?1:0})}get commands(){return this.extensions.reduce((n,e)=>{const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Oo(e.name,this.schema)},o=S(e,"addCommands",r);return o?{...n,...o()}:n},{})}get plugins(){const{editor:n}=this,e=He.sort([...this.extensions].reverse()),r=[],o=[],i=e.map(a=>{const s={name:a.name,options:a.options,storage:a.storage,editor:n,type:Oo(a.name,this.schema)},l=[],c=S(a,"addKeyboardShortcuts",s);let d={};if(a.type==="mark"&&S(a,"exitable",s)&&(d.ArrowRight=()=>Ln.handleExit({editor:n,mark:a})),c){const m=Object.fromEntries(Object.entries(c()).map(([x,b])=>[x,()=>b({editor:n})]));d={...d,...m}}const h=Db(d);l.push(h);const g=S(a,"addInputRules",s);Ls(a,n.options.enableInputRules)&&g&&r.push(...g());const u=S(a,"addPasteRules",s);Ls(a,n.options.enablePasteRules)&&u&&o.push(...u());const f=S(a,"addProseMirrorPlugins",s);if(f){const m=f();l.push(...m)}return l}).flat();return[d2({editor:n,rules:r}),...x2({editor:n,rules:o}),...i]}get attributes(){return Kd(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=lo(this.extensions);return Object.fromEntries(e.filter(r=>!!S(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:n,type:en(r.name,this.schema)},a=S(r,"addNodeView",i);if(!a)return[];const s=(l,c,d,h,g)=>{const u=mi(l,o);return a()({node:l,view:c,getPos:d,decorations:h,innerDecorations:g,editor:n,extension:r,HTMLAttributes:u})};return[r.name,s]}))}setupExtensions(){this.extensions.forEach(n=>{var e;this.editor.extensionStorage[n.name]=n.storage;const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Oo(n.name,this.schema)};n.type==="mark"&&(!((e=N(S(n,"keepOnSplit",r)))!==null&&e!==void 0)||e)&&this.splittableMarks.push(n.name);const o=S(n,"onBeforeCreate",r),i=S(n,"onCreate",r),a=S(n,"onUpdate",r),s=S(n,"onSelectionUpdate",r),l=S(n,"onTransaction",r),c=S(n,"onFocus",r),d=S(n,"onBlur",r),h=S(n,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),a&&this.editor.on("update",a),s&&this.editor.on("selectionUpdate",s),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}}class ln{constructor(n={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...n},this.name=this.config.name,n.defaultOptions&&Object.keys(n.defaultOptions).length>0&&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=N(S(this,"addOptions",{name:this.name}))),this.storage=N(S(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new ln(n)}configure(n={}){const e=this.extend({...this.config,addOptions:()=>po(this.options,n)});return e.name=this.name,e.parent=this.parent,e}extend(n={}){const e=new ln({...this.config,...n});return e.parent=this,this.child=e,e.name=n.name?n.name:e.parent.name,n.defaultOptions&&Object.keys(n.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=N(S(e,"addOptions",{name:e.name})),e.storage=N(S(e,"addStorage",{name:e.name,options:e.options})),e}}function Gd(t,n,e){const{from:r,to:o}=n,{blockSeparator:i=`
|
|
21002
|
+
|
|
21003
|
+
`,textSerializers:a={}}=e||{};let s="";return t.nodesBetween(r,o,(l,c,d,h)=>{var g;l.isBlock&&c>r&&(s+=i);const u=a==null?void 0:a[l.type.name];if(u)return d&&(s+=u({node:l,pos:c,parent:d,index:h,range:n})),!1;l.isText&&(s+=(g=l==null?void 0:l.text)===null||g===void 0?void 0:g.slice(Math.max(r,c)-c,o-c))}),s}function Yd(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,n])=>n.spec.toText).map(([n,e])=>[n,e.spec.toText]))}const y2=ln.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Q({key:new un("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:n,schema:e}=t,{doc:r,selection:o}=n,{ranges:i}=o,a=Math.min(...i.map(d=>d.$from.pos)),s=Math.max(...i.map(d=>d.$to.pos)),l=Yd(e);return Gd(r,{from:a,to:s},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),v2=()=>({editor:t,view:n})=>(requestAnimationFrame(()=>{var e;t.isDestroyed||(n.dom.blur(),(e=window==null?void 0:window.getSelection())===null||e===void 0||e.removeAllRanges())}),!0),k2=(t=!1)=>({commands:n})=>n.setContent("",t),w2=()=>({state:t,tr:n,dispatch:e})=>{const{selection:r}=n,{ranges:o}=r;return e&&o.forEach(({$from:i,$to:a})=>{t.doc.nodesBetween(i.pos,a.pos,(s,l)=>{if(s.type.isText)return;const{doc:c,mapping:d}=n,h=c.resolve(d.map(l)),g=c.resolve(d.map(l+s.nodeSize)),u=h.blockRange(g);if(!u)return;const f=Qe(u);if(s.type.isTextblock){const{defaultType:m}=h.parent.contentMatchAt(h.index());n.setNodeMarkup(u.start,m)}(f||f===0)&&n.lift(u,f)})}),!0},_2=t=>n=>t(n),C2=()=>({state:t,dispatch:n})=>Vb(t,n),S2=(t,n)=>({editor:e,tr:r})=>{const{state:o}=e,i=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const a=r.mapping.map(n);return r.insert(a,i.content),r.setSelection(new P(r.doc.resolve(Math.max(a-1,0)))),!0},E2=()=>({tr:t,dispatch:n})=>{const{selection:e}=t,r=e.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(n){const s=o.before(i),l=o.after(i);t.delete(s,l).scrollIntoView()}return!0}return!1},I2=t=>({tr:n,state:e,dispatch:r})=>{const o=en(t,e.schema),i=n.selection.$anchor;for(let a=i.depth;a>0;a-=1)if(i.node(a).type===o){if(r){const l=i.before(a),c=i.after(a);n.delete(l,c).scrollIntoView()}return!0}return!1},$2=t=>({tr:n,dispatch:e})=>{const{from:r,to:o}=t;return e&&n.delete(r,o),!0},T2=()=>({state:t,dispatch:n})=>zb(t,n),M2=()=>({commands:t})=>t.keyboardShortcut("Enter"),D2=()=>({state:t,dispatch:n})=>Xb(t,n);function vr(t,n,e={strict:!0}){const r=Object.keys(n);return r.length?r.every(o=>e.strict?n[o]===t[o]:Qi(n[o])?n[o].test(t[o]):n[o]===t[o]):!0}function Qd(t,n,e={}){return t.find(r=>r.type===n&&vr(Object.fromEntries(Object.keys(e).map(o=>[o,r.attrs[o]])),e))}function Ps(t,n,e={}){return!!Qd(t,n,e)}function Zi(t,n,e){var r;if(!t||!n)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(d=>d.type===n))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(d=>d.type===n)||(e=e||((r=o.node.marks[0])===null||r===void 0?void 0:r.attrs),!Qd([...o.node.marks],n,e)))return;let a=o.index,s=t.start()+o.offset,l=a+1,c=s+o.node.nodeSize;for(;a>0&&Ps([...t.parent.child(a-1).marks],n,e);)a-=1,s-=t.parent.child(a).nodeSize;for(;l<t.parent.childCount&&Ps([...t.parent.child(l).marks],n,e);)c+=t.parent.child(l).nodeSize,l+=1;return{from:s,to:c}}function ce(t,n){if(typeof t=="string"){if(!n.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return n.marks[t]}return t}const z2=(t,n={})=>({tr:e,state:r,dispatch:o})=>{const i=ce(t,r.schema),{doc:a,selection:s}=e,{$from:l,from:c,to:d}=s;if(o){const h=Zi(l,i,n);if(h&&h.from<=c&&h.to>=d){const g=P.create(a,h.from,h.to);e.setSelection(g)}}return!0},O2=t=>n=>{const e=typeof t=="function"?t(n):t;for(let r=0;r<e.length;r+=1)if(e[r](n))return!0;return!1};function Zd(t){return t instanceof P}function xe(t=0,n=0,e=0){return Math.min(Math.max(t,n),e)}function np(t,n=null){if(!n)return null;const e=B.atStart(t),r=B.atEnd(t);if(n==="start"||n===!0)return e;if(n==="end")return r;const o=e.from,i=r.to;return n==="all"?P.create(t,xe(0,o,i),xe(t.content.size,o,i)):P.create(t,xe(n,o,i),xe(n,o,i))}function Rs(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function kr(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function A2(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const L2=(t=null,n={})=>({editor:e,view:r,tr:o,dispatch:i})=>{n={scrollIntoView:!0,...n};const a=()=>{(kr()||Rs())&&r.dom.focus(),requestAnimationFrame(()=>{e.isDestroyed||(r.focus(),A2()&&!kr()&&!Rs()&&r.dom.focus({preventScroll:!0}))})};if(r.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!Zd(e.state.selection))return a(),!0;const s=np(o.doc,t)||e.state.selection,l=e.state.selection.eq(s);return i&&(l||o.setSelection(s),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0},P2=(t,n)=>e=>t.every((r,o)=>n(r,{...e,index:o})),R2=(t,n)=>({tr:e,commands:r})=>r.insertContentAt({from:e.selection.from,to:e.selection.to},t,n),ep=t=>{const n=t.childNodes;for(let e=n.length-1;e>=0;e-=1){const r=n[e];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&ep(r)}return t};function Ut(t){const n=`<body>${t}</body>`,e=new window.DOMParser().parseFromString(n,"text/html").body;return ep(e)}function $t(t,n,e){if(t instanceof ee||t instanceof y)return t;e={slice:!0,parseOptions:{},...e};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return y.fromArray(t.map(s=>n.nodeFromJSON(s)));const a=n.nodeFromJSON(t);return e.errorOnInvalidContent&&a.check(),a}catch(i){if(e.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),$t("",n,e)}if(o){if(e.errorOnInvalidContent){let a=!1,s="";const l=new Hc({topNode:n.spec.topNode,marks:n.spec.marks,nodes:n.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(a=!0,s=typeof c=="string"?c:c.outerHTML,null)}]}})});if(e.slice?te.fromSchema(l).parseSlice(Ut(t),e.parseOptions):te.fromSchema(l).parse(Ut(t),e.parseOptions),e.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${s}`)})}const i=te.fromSchema(n);return e.slice?i.parseSlice(Ut(t),e.parseOptions).content:i.parse(Ut(t),e.parseOptions)}return $t("",n,e)}function B2(t,n,e){const r=t.steps.length-1;if(r<n)return;const o=t.steps[r];if(!(o instanceof J||o instanceof Z))return;const i=t.mapping.maps[r];let a=0;i.forEach((s,l,c,d)=>{a===0&&(a=d)}),t.setSelection(B.near(t.doc.resolve(a),e))}const N2=t=>!("type"in t),F2=(t,n,e)=>({tr:r,dispatch:o,editor:i})=>{var a;if(o){e={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...e};let s;const l=x=>{i.emit("contentError",{editor:i,error:x,disableCollaboration:()=>{i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...e.parseOptions};if(!e.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{$t(n,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(x){l(x)}try{s=$t(n,i.schema,{parseOptions:c,errorOnInvalidContent:(a=e.errorOnInvalidContent)!==null&&a!==void 0?a:i.options.enableContentCheck})}catch(x){return l(x),!1}let{from:d,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},g=!0,u=!0;if((N2(s)?s:[s]).forEach(x=>{x.check(),g=g?x.isText&&x.marks.length===0:!1,u=u?x.isBlock:!1}),d===h&&u){const{parent:x}=r.doc.resolve(d);x.isTextblock&&!x.type.spec.code&&!x.childCount&&(d-=1,h+=1)}let m;if(g){if(Array.isArray(n))m=n.map(x=>x.text||"").join("");else if(n instanceof y){let x="";n.forEach(b=>{b.text&&(x+=b.text)}),m=x}else typeof n=="object"&&n&&n.text?m=n.text:m=n;r.insertText(m,d,h)}else m=s,r.replaceWith(d,h,m);e.updateSelection&&B2(r,r.steps.length-1,-1),e.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:m}),e.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:m})}return!0},H2=()=>({state:t,dispatch:n})=>Nb(t,n),j2=()=>({state:t,dispatch:n})=>Fb(t,n),X2=()=>({state:t,dispatch:n})=>Ob(t,n),V2=()=>({state:t,dispatch:n})=>Rb(t,n),W2=()=>({state:t,dispatch:n,tr:e})=>{try{const r=no(t.doc,t.selection.$from.pos,-1);return r==null?!1:(e.join(r,2),n&&n(e),!0)}catch{return!1}},U2=()=>({state:t,dispatch:n,tr:e})=>{try{const r=no(t.doc,t.selection.$from.pos,1);return r==null?!1:(e.join(r,2),n&&n(e),!0)}catch{return!1}},q2=()=>({state:t,dispatch:n})=>Ab(t,n),K2=()=>({state:t,dispatch:n})=>Lb(t,n);function tp(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function J2(t){const n=t.split(/-(?!$)/);let e=n[n.length-1];e==="Space"&&(e=" ");let r,o,i,a;for(let s=0;s<n.length-1;s+=1){const l=n[s];if(/^(cmd|meta|m)$/i.test(l))a=!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))i=!0;else if(/^mod$/i.test(l))kr()||tp()?a=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(e=`Alt-${e}`),o&&(e=`Ctrl-${e}`),a&&(e=`Meta-${e}`),i&&(e=`Shift-${e}`),e}const G2=t=>({editor:n,view:e,tr:r,dispatch:o})=>{const i=J2(t).split(/-(?!$)/),a=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),s=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=n.captureTransaction(()=>{e.someProp("handleKeyDown",c=>c(e,s))});return l==null||l.steps.forEach(c=>{const d=c.map(r.mapping);d&&o&&r.maybeStep(d)}),!0};function Tt(t,n,e={}){const{from:r,to:o,empty:i}=t.selection,a=n?en(n,t.schema):null,s=[];t.doc.nodesBetween(r,o,(h,g)=>{if(h.isText)return;const u=Math.max(r,g),f=Math.min(o,g+h.nodeSize);s.push({node:h,from:u,to:f})});const l=o-r,c=s.filter(h=>a?a.name===h.node.type.name:!0).filter(h=>vr(h.node.attrs,e,{strict:!1}));return i?!!c.length:c.reduce((h,g)=>h+g.to-g.from,0)>=l}const Y2=(t,n={})=>({state:e,dispatch:r})=>{const o=en(t,e.schema);return Tt(e,o,n)?Hb(e,r):!1},Q2=()=>({state:t,dispatch:n})=>Wb(t,n),Z2=t=>({state:n,dispatch:e})=>{const r=en(t,n.schema);return n2(r)(n,e)},n1=()=>({state:t,dispatch:n})=>jb(t,n);function ho(t,n){return n.nodes[t]?"node":n.marks[t]?"mark":null}function Bs(t,n){const e=typeof n=="string"?[n]:n;return Object.keys(t).reduce((r,o)=>(e.includes(o)||(r[o]=t[o]),r),{})}const e1=(t,n)=>({tr:e,state:r,dispatch:o})=>{let i=null,a=null;const s=ho(typeof t=="string"?t:t.name,r.schema);return s?(s==="node"&&(i=en(t,r.schema)),s==="mark"&&(a=ce(t,r.schema)),o&&e.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,d)=>{i&&i===c.type&&e.setNodeMarkup(d,void 0,Bs(c.attrs,n)),a&&c.marks.length&&c.marks.forEach(h=>{a===h.type&&e.addMark(d,d+c.nodeSize,a.create(Bs(h.attrs,n)))})})}),!0):!1},t1=()=>({tr:t,dispatch:n})=>(n&&t.scrollIntoView(),!0),r1=()=>({tr:t,dispatch:n})=>{if(n){const e=new Sn(t.doc);t.setSelection(e)}return!0},o1=()=>({state:t,dispatch:n})=>Pb(t,n),i1=()=>({state:t,dispatch:n})=>Bb(t,n),a1=()=>({state:t,dispatch:n})=>Ub(t,n),s1=()=>({state:t,dispatch:n})=>Jb(t,n),l1=()=>({state:t,dispatch:n})=>Kb(t,n);function xi(t,n,e={},r={}){return $t(t,n,{slice:!1,parseOptions:e,errorOnInvalidContent:r.errorOnInvalidContent})}const c1=(t,n=!1,e={},r={})=>({editor:o,tr:i,dispatch:a,commands:s})=>{var l,c;const{doc:d}=i;if(e.preserveWhitespace!=="full"){const h=xi(t,o.schema,e,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:o.options.enableContentCheck});return a&&i.replaceWith(0,d.content.size,h).setMeta("preventUpdate",!n),!0}return a&&i.setMeta("preventUpdate",!n),s.insertContentAt({from:0,to:d.content.size},t,{parseOptions:e,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function rp(t,n){const e=ce(n,t.schema),{from:r,to:o,empty:i}=t.selection,a=[];i?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{a.push(...l.marks)});const s=a.find(l=>l.type.name===e.name);return s?{...s.attrs}:{}}function d1(t,n){const e=new rd(t);return n.forEach(r=>{r.steps.forEach(o=>{e.step(o)})}),e}function p1(t){for(let n=0;n<t.edgeCount;n+=1){const{type:e}=t.edge(n);if(e.isTextblock&&!e.hasRequiredAttrs())return e}return null}function h1(t,n,e){const r=[];return t.nodesBetween(n.from,n.to,(o,i)=>{e(o)&&r.push({node:o,pos:i})}),r}function g1(t,n){for(let e=t.depth;e>0;e-=1){const r=t.node(e);if(n(r))return{pos:e>0?t.before(e):0,start:t.start(e),depth:e,node:r}}}function na(t){return n=>g1(n.$from,t)}function u1(t,n){const e={from:0,to:t.content.size};return Gd(t,e,n)}function f1(t,n){const e=en(n,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,s=>{i.push(s)});const a=i.reverse().find(s=>s.type.name===e.name);return a?{...a.attrs}:{}}function op(t,n){const e=ho(typeof n=="string"?n:n.name,t.schema);return e==="node"?f1(t,n):e==="mark"?rp(t,n):{}}function m1(t,n=JSON.stringify){const e={};return t.filter(r=>{const o=n(r);return Object.prototype.hasOwnProperty.call(e,o)?!1:e[o]=!0})}function x1(t){const n=m1(t);return n.length===1?n:n.filter((e,r)=>!n.filter((i,a)=>a!==r).some(i=>e.oldRange.from>=i.oldRange.from&&e.oldRange.to<=i.oldRange.to&&e.newRange.from>=i.newRange.from&&e.newRange.to<=i.newRange.to))}function b1(t){const{mapping:n,steps:e}=t,r=[];return n.maps.forEach((o,i)=>{const a=[];if(o.ranges.length)o.forEach((s,l)=>{a.push({from:s,to:l})});else{const{from:s,to:l}=e[i];if(s===void 0||l===void 0)return;a.push({from:s,to:l})}a.forEach(({from:s,to:l})=>{const c=n.slice(i).map(s,-1),d=n.slice(i).map(l),h=n.invert().map(c,-1),g=n.invert().map(d);r.push({oldRange:{from:h,to:g},newRange:{from:c,to:d}})})}),x1(r)}function ea(t,n,e){const r=[];return t===n?e.resolve(t).marks().forEach(o=>{const i=e.resolve(t),a=Zi(i,o.type);a&&r.push({mark:o,...a})}):e.nodesBetween(t,n,(o,i)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(a=>({from:i,to:i+o.nodeSize,mark:a})))}),r}function er(t,n,e){return Object.fromEntries(Object.entries(e).filter(([r])=>{const o=t.find(i=>i.type===n&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function bi(t,n,e={}){const{empty:r,ranges:o}=t.selection,i=n?ce(n,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>vr(h.attrs,e,{strict:!1}));let a=0;const s=[];if(o.forEach(({$from:h,$to:g})=>{const u=h.pos,f=g.pos;t.doc.nodesBetween(u,f,(m,x)=>{if(!m.isText&&!m.marks.length)return;const b=Math.max(u,x),_=Math.min(f,x+m.nodeSize),D=_-b;a+=D,s.push(...m.marks.map(A=>({mark:A,from:b,to:_})))})}),a===0)return!1;const l=s.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>vr(h.mark.attrs,e,{strict:!1})).reduce((h,g)=>h+g.to-g.from,0),c=s.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,g)=>h+g.to-g.from,0);return(l>0?l+c:l)>=a}function y1(t,n,e={}){if(!n)return Tt(t,null,e)||bi(t,null,e);const r=ho(n,t.schema);return r==="node"?Tt(t,n,e):r==="mark"?bi(t,n,e):!1}function Ns(t,n){const{nodeExtensions:e}=lo(n),r=e.find(a=>a.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=N(S(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function go(t,{checkChildren:n=!0,ignoreWhitespace:e=!1}={}){var r;if(e){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(n){let o=!0;return t.content.forEach(i=>{o!==!1&&(go(i,{ignoreWhitespace:e,checkChildren:n})||(o=!1))}),o}return!1}function v1(t){return t instanceof O}function k1(t,n,e){var r;const{selection:o}=n;let i=null;if(Zd(o)&&(i=o.$cursor),i){const s=(r=t.storedMarks)!==null&&r!==void 0?r:i.marks();return!!e.isInSet(s)||!s.some(l=>l.type.excludes(e))}const{ranges:a}=o;return a.some(({$from:s,$to:l})=>{let c=s.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(e):!1;return t.doc.nodesBetween(s.pos,l.pos,(d,h,g)=>{if(c)return!1;if(d.isInline){const u=!g||g.type.allowsMarkType(e),f=!!e.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(e));c=u&&f}return!c}),c})}const w1=(t,n={})=>({tr:e,state:r,dispatch:o})=>{const{selection:i}=e,{empty:a,ranges:s}=i,l=ce(t,r.schema);if(o)if(a){const c=rp(r,l);e.addStoredMark(l.create({...c,...n}))}else s.forEach(c=>{const d=c.$from.pos,h=c.$to.pos;r.doc.nodesBetween(d,h,(g,u)=>{const f=Math.max(u,d),m=Math.min(u+g.nodeSize,h);g.marks.find(b=>b.type===l)?g.marks.forEach(b=>{l===b.type&&e.addMark(f,m,l.create({...b.attrs,...n}))}):e.addMark(f,m,l.create(n))})});return k1(r,e,l)},_1=(t,n)=>({tr:e})=>(e.setMeta(t,n),!0),C1=(t,n={})=>({state:e,dispatch:r,chain:o})=>{const i=en(t,e.schema);let a;return e.selection.$anchor.sameParent(e.selection.$head)&&(a=e.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:s})=>zs(i,{...a,...n})(e)?!0:s.clearNodes()).command(({state:s})=>zs(i,{...a,...n})(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},S1=t=>({tr:n,dispatch:e})=>{if(e){const{doc:r}=n,o=xe(t,0,r.content.size),i=O.create(r,o);n.setSelection(i)}return!0},E1=t=>({tr:n,dispatch:e})=>{if(e){const{doc:r}=n,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,a=P.atStart(r).from,s=P.atEnd(r).to,l=xe(o,a,s),c=xe(i,a,s),d=P.create(r,l,c);n.setSelection(d)}return!0},I1=t=>({state:n,dispatch:e})=>{const r=en(t,n.schema);return r2(r)(n,e)};function Fs(t,n){const e=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(e){const r=e.filter(o=>n==null?void 0:n.includes(o.type.name));t.tr.ensureMarks(r)}}const $1=({keepMarks:t=!0}={})=>({tr:n,state:e,dispatch:r,editor:o})=>{const{selection:i,doc:a}=n,{$from:s,$to:l}=i,c=o.extensionManager.attributes,d=er(c,s.node().type.name,s.node().attrs);if(i instanceof O&&i.node.isBlock)return!s.parentOffset||!Xe(a,s.pos)?!1:(r&&(t&&Fs(e,o.extensionManager.splittableMarks),n.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,g=s.depth===0?void 0:p1(s.node(-1).contentMatchAt(s.indexAfter(-1)));let u=h&&g?[{type:g,attrs:d}]:void 0,f=Xe(n.doc,n.mapping.map(s.pos),1,u);if(!u&&!f&&Xe(n.doc,n.mapping.map(s.pos),1,g?[{type:g}]:void 0)&&(f=!0,u=g?[{type:g,attrs:d}]:void 0),r){if(f&&(i instanceof P&&n.deleteSelection(),n.split(n.mapping.map(s.pos),1,u),g&&!h&&!s.parentOffset&&s.parent.type!==g)){const m=n.mapping.map(s.before()),x=n.doc.resolve(m);s.node(-1).canReplaceWith(x.index(),x.index()+1,g)&&n.setNodeMarkup(n.mapping.map(s.before()),g)}t&&Fs(e,o.extensionManager.splittableMarks),n.scrollIntoView()}return f},T1=(t,n={})=>({tr:e,state:r,dispatch:o,editor:i})=>{var a;const s=en(t,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const h=l.node(-1);if(h.type!==s)return!1;const g=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let b=y.empty;const _=l.index(-1)?1:l.index(-2)?2:3;for(let z=l.depth-_;z>=l.depth-3;z-=1)b=y.from(l.node(z).copy(b));const D=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,A={...er(g,l.node().type.name,l.node().attrs),...n},L=((a=s.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(A))||void 0;b=b.append(y.from(s.createAndFill(null,L)||void 0));const H=l.before(l.depth-(_-1));e.replace(H,l.after(-D),new w(b,4-_,0));let C=-1;e.doc.nodesBetween(H,e.doc.content.size,(z,F)=>{if(C>-1)return!1;z.isTextblock&&z.content.size===0&&(C=F+1)}),C>-1&&e.setSelection(P.near(e.doc.resolve(C))),e.scrollIntoView()}return!0}const u=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...er(g,h.type.name,h.attrs),...n},m={...er(g,l.node().type.name,l.node().attrs),...n};e.delete(l.pos,c.pos);const x=u?[{type:s,attrs:f},{type:u,attrs:m}]:[{type:s,attrs:f}];if(!Xe(e.doc,l.pos,2))return!1;if(o){const{selection:b,storedMarks:_}=r,{splittableMarks:D}=i.extensionManager,A=_||b.$to.parentOffset&&b.$from.marks();if(e.split(l.pos,2,x).scrollIntoView(),!A||!o)return!0;const L=A.filter(H=>D.includes(H.type.name));e.ensureMarks(L)}return!0},Ao=(t,n)=>{const e=na(a=>a.type===n)(t.selection);if(!e)return!0;const r=t.doc.resolve(Math.max(0,e.pos-1)).before(e.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return e.node.type===(o==null?void 0:o.type)&&le(t.doc,e.pos)&&t.join(e.pos),!0},Lo=(t,n)=>{const e=na(a=>a.type===n)(t.selection);if(!e)return!0;const r=t.doc.resolve(e.start).after(e.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return e.node.type===(o==null?void 0:o.type)&&le(t.doc,r)&&t.join(r),!0},M1=(t,n,e,r={})=>({editor:o,tr:i,state:a,dispatch:s,chain:l,commands:c,can:d})=>{const{extensions:h,splittableMarks:g}=o.extensionManager,u=en(t,a.schema),f=en(n,a.schema),{selection:m,storedMarks:x}=a,{$from:b,$to:_}=m,D=b.blockRange(_),A=x||m.$to.parentOffset&&m.$from.marks();if(!D)return!1;const L=na(H=>Ns(H.type.name,h))(m);if(D.depth>=1&&L&&D.depth-L.depth<=1){if(L.node.type===u)return c.liftListItem(f);if(Ns(L.node.type.name,h)&&u.validContent(L.node.content)&&s)return l().command(()=>(i.setNodeMarkup(L.pos,u),!0)).command(()=>Ao(i,u)).command(()=>Lo(i,u)).run()}return!e||!A||!s?l().command(()=>d().wrapInList(u,r)?!0:c.clearNodes()).wrapInList(u,r).command(()=>Ao(i,u)).command(()=>Lo(i,u)).run():l().command(()=>{const H=d().wrapInList(u,r),C=A.filter(z=>g.includes(z.type.name));return i.ensureMarks(C),H?!0:c.clearNodes()}).wrapInList(u,r).command(()=>Ao(i,u)).command(()=>Lo(i,u)).run()},D1=(t,n={},e={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=e,a=ce(t,r.schema);return bi(r,a,n)?o.unsetMark(a,{extendEmptyMarkRange:i}):o.setMark(a,n)},z1=(t,n,e={})=>({state:r,commands:o})=>{const i=en(t,r.schema),a=en(n,r.schema),s=Tt(r,i,e);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),s?o.setNode(a,l):o.setNode(i,{...l,...e})},O1=(t,n={})=>({state:e,commands:r})=>{const o=en(t,e.schema);return Tt(e,o,n)?r.lift(o):r.wrapIn(o,n)},A1=()=>({state:t,dispatch:n})=>{const e=t.plugins;for(let r=0;r<e.length;r+=1){const o=e[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(n){const a=t.tr,s=i.transform;for(let l=s.steps.length-1;l>=0;l-=1)a.step(s.steps[l].invert(s.docs[l]));if(i.text){const l=a.doc.resolve(i.from).marks();a.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else a.delete(i.from,i.to)}return!0}}return!1},L1=()=>({tr:t,dispatch:n})=>{const{selection:e}=t,{empty:r,ranges:o}=e;return r||n&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},P1=(t,n={})=>({tr:e,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:a=!1}=n,{selection:s}=e,l=ce(t,r.schema),{$from:c,empty:d,ranges:h}=s;if(!o)return!0;if(d&&a){let{from:g,to:u}=s;const f=(i=c.marks().find(x=>x.type===l))===null||i===void 0?void 0:i.attrs,m=Zi(c,l,f);m&&(g=m.from,u=m.to),e.removeMark(g,u,l)}else h.forEach(g=>{e.removeMark(g.$from.pos,g.$to.pos,l)});return e.removeStoredMark(l),!0},R1=(t,n={})=>({tr:e,state:r,dispatch:o})=>{let i=null,a=null;const s=ho(typeof t=="string"?t:t.name,r.schema);return s?(s==="node"&&(i=en(t,r.schema)),s==="mark"&&(a=ce(t,r.schema)),o&&e.selection.ranges.forEach(l=>{const c=l.$from.pos,d=l.$to.pos;let h,g,u,f;e.selection.empty?r.doc.nodesBetween(c,d,(m,x)=>{i&&i===m.type&&(u=Math.max(x,c),f=Math.min(x+m.nodeSize,d),h=x,g=m)}):r.doc.nodesBetween(c,d,(m,x)=>{x<c&&i&&i===m.type&&(u=Math.max(x,c),f=Math.min(x+m.nodeSize,d),h=x,g=m),x>=c&&x<=d&&(i&&i===m.type&&e.setNodeMarkup(x,void 0,{...m.attrs,...n}),a&&m.marks.length&&m.marks.forEach(b=>{if(a===b.type){const _=Math.max(x,c),D=Math.min(x+m.nodeSize,d);e.addMark(_,D,a.create({...b.attrs,...n}))}}))}),g&&(h!==void 0&&e.setNodeMarkup(h,void 0,{...g.attrs,...n}),a&&g.marks.length&&g.marks.forEach(m=>{a===m.type&&e.addMark(u,f,a.create({...m.attrs,...n}))}))}),!0):!1},B1=(t,n={})=>({state:e,dispatch:r})=>{const o=en(t,e.schema);return Gb(o,n)(e,r)},N1=(t,n={})=>({state:e,dispatch:r})=>{const o=en(t,e.schema);return Yb(o,n)(e,r)};var F1=Object.freeze({__proto__:null,blur:v2,clearContent:k2,clearNodes:w2,command:_2,createParagraphNear:C2,cut:S2,deleteCurrentNode:E2,deleteNode:I2,deleteRange:$2,deleteSelection:T2,enter:M2,exitCode:D2,extendMarkRange:z2,first:O2,focus:L2,forEach:P2,insertContent:R2,insertContentAt:F2,joinBackward:X2,joinDown:j2,joinForward:V2,joinItemBackward:W2,joinItemForward:U2,joinTextblockBackward:q2,joinTextblockForward:K2,joinUp:H2,keyboardShortcut:G2,lift:Y2,liftEmptyBlock:Q2,liftListItem:Z2,newlineInCode:n1,resetAttributes:e1,scrollIntoView:t1,selectAll:r1,selectNodeBackward:o1,selectNodeForward:i1,selectParentNode:a1,selectTextblockEnd:s1,selectTextblockStart:l1,setContent:c1,setMark:w1,setMeta:_1,setNode:C1,setNodeSelection:S1,setTextSelection:E1,sinkListItem:I1,splitBlock:$1,splitListItem:T1,toggleList:M1,toggleMark:D1,toggleNode:z1,toggleWrap:O1,undoInputRule:A1,unsetAllMarks:L1,unsetMark:P1,updateAttributes:R1,wrapIn:B1,wrapInList:N1});const H1=ln.create({name:"commands",addCommands(){return{...F1}}}),j1=ln.create({name:"drop",addProseMirrorPlugins(){return[new Q({key:new un("tiptapDrop"),props:{handleDrop:(t,n,e,r)=>{this.editor.emit("drop",{editor:this.editor,event:n,slice:e,moved:r})}}})]}}),X1=ln.create({name:"editable",addProseMirrorPlugins(){return[new Q({key:new un("editable"),props:{editable:()=>this.editor.options.editable}})]}}),V1=new un("focusEvents"),W1=ln.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Q({key:V1,props:{handleDOMEvents:{focus:(n,e)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:e}).setMeta("addToHistory",!1);return n.dispatch(r),!1},blur:(n,e)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:e}).setMeta("addToHistory",!1);return n.dispatch(r),!1}}}})]}}),U1=ln.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:s})=>{const{selection:l,doc:c}=s,{empty:d,$anchor:h}=l,{pos:g,parent:u}=h,f=h.parent.isTextblock&&g>0?s.doc.resolve(g-1):h,m=f.parent.type.spec.isolating,x=h.pos-h.parentOffset,b=m&&f.parent.childCount===1?x===h.pos:B.atStart(c).from===g;return!d||!u.type.isTextblock||u.textContent.length||!b||b&&h.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),n=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return kr()||tp()?i:o},addProseMirrorPlugins(){return[new Q({key:new un("clearDocument"),appendTransaction:(t,n,e)=>{if(t.some(m=>m.getMeta("composition")))return;const r=t.some(m=>m.docChanged)&&!n.doc.eq(e.doc),o=t.some(m=>m.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:a,to:s}=n.selection,l=B.atStart(n.doc).from,c=B.atEnd(n.doc).to;if(i||!(a===l&&s===c)||!go(e.doc))return;const g=e.tr,u=ao({state:e,transaction:g}),{commands:f}=new so({editor:this.editor,state:u});if(f.clearNodes(),!!g.steps.length)return g}})]}}),q1=ln.create({name:"paste",addProseMirrorPlugins(){return[new Q({key:new un("tiptapPaste"),props:{handlePaste:(t,n,e)=>{this.editor.emit("paste",{editor:this.editor,event:n,slice:e})}}})]}}),K1=ln.create({name:"tabindex",addProseMirrorPlugins(){return[new Q({key:new un("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class ue{get name(){return this.node.type.name}constructor(n,e,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=n,this.editor=e,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var n;return(n=this.actualDepth)!==null&&n!==void 0?n:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(n){let e=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}e=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:e,to:r},n)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const n=this.resolvedPos.start(this.resolvedPos.depth-1),e=this.resolvedPos.doc.resolve(n);return new ue(e,this.editor)}get before(){let n=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return n.depth!==this.depth&&(n=this.resolvedPos.doc.resolve(this.from-3)),new ue(n,this.editor)}get after(){let n=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return n.depth!==this.depth&&(n=this.resolvedPos.doc.resolve(this.to+3)),new ue(n,this.editor)}get children(){const n=[];return this.node.content.forEach((e,r)=>{const o=e.isBlock&&!e.isTextblock,i=e.isAtom&&!e.isText,a=this.pos+r+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const s=this.resolvedPos.doc.resolve(a);if(!o&&s.depth<=this.depth)return;const l=new ue(s,this.editor,o,o?e:null);o&&(l.actualDepth=this.depth+1),n.push(new ue(s,this.editor,o,o?e:null))}),n}get firstChild(){return this.children[0]||null}get lastChild(){const n=this.children;return n[n.length-1]||null}closest(n,e={}){let r=null,o=this.parent;for(;o&&!r;)o.node.type.name===n&&(Object.keys(e).length>0||(r=o)),o=o.parent;return r}querySelector(n,e={}){return this.querySelectorAll(n,e,!0)[0]||null}querySelectorAll(n,e={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const i=Object.keys(e);return this.children.forEach(a=>{r&&o.length>0||(a.node.type.name===n&&i.every(l=>e[l]===a.node.attrs[l])&&o.push(a),!(r&&o.length>0)&&(o=o.concat(a.querySelectorAll(n,e,r))))}),o}setAttribute(n){const{tr:e}=this.editor.state;e.setNodeMarkup(this.from,void 0,{...this.node.attrs,...n}),this.editor.view.dispatch(e)}}const J1=`.ProseMirror {
|
|
21000
21004
|
position: relative;
|
|
21001
21005
|
}
|
|
21002
21006
|
|
|
@@ -21070,17 +21074,17 @@ img.ProseMirror-separator {
|
|
|
21070
21074
|
|
|
21071
21075
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
21072
21076
|
opacity: 0
|
|
21073
|
-
}`;function
|
|
21077
|
+
}`;function G1(t,n,e){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return n&&o.setAttribute("nonce",n),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}class Y1 extends o2{constructor(n={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),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),this.on("drop",({event:e,slice:r,moved:o})=>this.options.onDrop(e,r,o)),this.on("paste",({event:e,slice:r})=>this.options.onPaste(e,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},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=G1(J1,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),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(n,e){const r=Jd(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}unregisterPlugin(n){if(this.isDestroyed)return;const e=this.state.plugins;let r=e;if([].concat(n).forEach(i=>{const a=typeof i=="string"?`${i}$`:i.key;r=r.filter(s=>!s.key.startsWith(a))}),e.length===r.length)return;const o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}createExtensionManager(){var n,e;const o=[...this.options.enableCoreExtensions?[X1,y2.configure({blockSeparator:(e=(n=this.options.coreExtensionOptions)===null||n===void 0?void 0:n.clipboardTextSerializer)===null||e===void 0?void 0:e.blockSeparator}),H1,W1,U1,K1,j1,q1].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new He(o,this)}createCommandManager(){this.commandManager=new so({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var n;let e;try{e=xi(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(a){if(!(a instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(a.message))throw a;this.emit("contentError",{editor:this,error:a,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),e=xi(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=np(e,this.options.autofocus);this.view=new Fd(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(n=this.options.editorProps)===null||n===void 0?void 0:n.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Fe.create({doc:e,selection:r||void 0})});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(a=>{var s;return(s=this.capturedTransaction)===null||s===void 0?void 0:s.step(a)});return}const e=this.state.apply(n),r=!this.state.selection.eq(e.selection);this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n}),r&&this.emit("selectionUpdate",{editor:this,transaction:n});const o=n.getMeta("focus"),i=n.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:n}),i&&this.emit("blur",{editor:this,event:i.event,transaction:n}),!(!n.docChanged||n.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:n})}getAttributes(n){return op(this.state,n)}isActive(n,e){const r=typeof n=="string"?n:null,o=typeof n=="string"?e:n;return y1(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Yi(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:e=`
|
|
21074
21078
|
|
|
21075
|
-
`,textSerializers:r={}}=n||{};return
|
|
21079
|
+
`,textSerializers:r={}}=n||{};return u1(this.state.doc,{blockSeparator:e,textSerializers:{...Yd(this.schema),...r}})}get isEmpty(){return go(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(){if(this.emit("destroy"),this.view){const n=this.view.dom;n&&n.editor&&delete n.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var n;return!(!((n=this.view)===null||n===void 0)&&n.docView)}$node(n,e){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(n,e))||null}$nodes(n,e){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(n,e))||null}$pos(n){const e=this.state.doc.resolve(n);return new ue(e,this)}get $doc(){return this.$pos(0)}}function Ye(t){return new co({find:t.find,handler:({state:n,range:e,match:r})=>{const o=N(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=n,a=r[r.length-1],s=r[0];if(a){const l=s.search(/\S/),c=e.from+s.indexOf(a),d=c+a.length;if(ea(e.from,e.to,n.doc).filter(u=>u.mark.type.excluded.find(m=>m===t.type&&m!==u.mark.type)).filter(u=>u.to>c).length)return null;d<e.to&&i.delete(d,e.to),c>e.from&&i.delete(e.from+l,c);const g=e.from+l+a.length;i.addMark(e.from+l,g,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function Q1(t){return new co({find:t.find,handler:({state:n,range:e,match:r})=>{const o=N(t.getAttributes,void 0,r)||{},{tr:i}=n,a=e.from;let s=e.to;const l=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let d=a+c;d>s?d=s:s=d+r[1].length;const h=r[0][r[0].length-1];i.insertText(h,a+r[0].length-1),i.replaceWith(d,s,l)}else if(r[0]){const c=t.type.isInline?a:a-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(a),i.mapping.map(s))}i.scrollIntoView()}})}function yi(t){return new co({find:t.find,handler:({state:n,range:e,match:r})=>{const o=n.doc.resolve(e.from),i=N(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;n.tr.delete(e.from,e.to).setBlockType(e.from,e.from,t.type,i)}})}function Mt(t){return new co({find:t.find,handler:({state:n,range:e,match:r,chain:o})=>{const i=N(t.getAttributes,void 0,r)||{},a=n.tr.delete(e.from,e.to),l=a.doc.resolve(e.from).blockRange(),c=l&&Bi(l,t.type,i);if(!c)return null;if(a.wrap(l,c),t.keepMarks&&t.editor){const{selection:h,storedMarks:g}=n,{splittableMarks:u}=t.editor.extensionManager,f=g||h.$to.parentOffset&&h.$from.marks();if(f){const m=f.filter(x=>u.includes(x.type.name));a.ensureMarks(m)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(h,i).run()}const d=a.doc.resolve(e.from-1).nodeBefore;d&&d.type===t.type&&le(a.doc,e.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&a.join(e.from-1)}})}class bn{constructor(n={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...n},this.name=this.config.name,n.defaultOptions&&Object.keys(n.defaultOptions).length>0&&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=N(S(this,"addOptions",{name:this.name}))),this.storage=N(S(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new bn(n)}configure(n={}){const e=this.extend({...this.config,addOptions:()=>po(this.options,n)});return e.name=this.name,e.parent=this.parent,e}extend(n={}){const e=new bn(n);return e.parent=this,this.child=e,e.name=n.name?n.name:e.parent.name,n.defaultOptions&&Object.keys(n.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=N(S(e,"addOptions",{name:e.name})),e.storage=N(S(e,"addStorage",{name:e.name,options:e.options})),e}}function Te(t){return new g2({find:t.find,handler:({state:n,range:e,match:r,pasteEvent:o})=>{const i=N(t.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:a}=n,s=r[r.length-1],l=r[0];let c=e.to;if(s){const d=l.search(/\S/),h=e.from+l.indexOf(s),g=h+s.length;if(ea(e.from,e.to,n.doc).filter(f=>f.mark.type.excluded.find(x=>x===t.type&&x!==f.mark.type)).filter(f=>f.to>h).length)return null;g<e.to&&a.delete(g,e.to),h>e.from&&a.delete(e.from+d,h),c=e.from+d+s.length,a.addMark(e.from+d,c,t.type.create(i||{})),a.removeStoredMark(t.type)}}})}function Z1(t,n){const{selection:e}=t,{$from:r}=e;if(e instanceof O){const i=r.index();return r.parent.canReplaceWith(i,i+1,n)}let o=r.depth;for(;o>=0;){const i=r.index(o);if(r.node(o).contentMatchAt(i).matchType(n))return!0;o-=1}return!1}const n5=/^\s*>\s$/,e5=bn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",tn(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[Mt({find:n5,type:this.type})]}}),t5=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,r5=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,o5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,i5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,a5=Ln.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",tn(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[Ye({find:t5,type:this.type}),Ye({find:o5,type:this.type})]},addPasteRules(){return[Te({find:r5,type:this.type}),Te({find:i5,type:this.type})]}}),s5="listItem",Hs="textStyle",js=/^\s*([-+*])\s$/,l5=bn.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",tn(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(s5,this.editor.getAttributes(Hs)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Mt({find:js,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mt({find:js,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Hs),editor:this.editor})),[t]}}),c5=/(^|[^`])`([^`]+)`(?!`)/,d5=/(^|[^`])`([^`]+)`(?!`)/g,p5=Ln.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",tn(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[Ye({find:c5,type:this.type})]},addPasteRules(){return[Te({find:d5,type:this.type})]}}),h5=/^```([a-z]+)?[\s\n]$/,g5=/^~~~([a-z]+)?[\s\n]$/,u5=bn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var n;const{languageClassPrefix:e}=this.options,i=[...((n=t.firstElementChild)===null||n===void 0?void 0:n.classList)||[]].filter(a=>a.startsWith(e)).map(a=>a.replace(e,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:n}){return["pre",tn(this.options.HTMLAttributes,n),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:n})=>n.setNode(this.name,t),toggleCodeBlock:t=>({commands:n})=>n.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:n}=this.editor.state.selection,e=n.pos===1;return!t||n.parent.type.name!==this.name?!1:e||!n.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:n}=t,{selection:e}=n,{$from:r,empty:o}=e;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
|
|
21076
21080
|
|
|
21077
|
-
`);return!i||!a?!1:t.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:n}=t,{selection:e,doc:r}=n,{$from:o,empty:i}=e;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const s=o.after();return s===void 0?!1:r.nodeAt(s)?t.commands.command(({tr:c})=>(c.setSelection(B.near(r.resolve(s))),!0)):t.commands.exitCode()}}},addInputRules(){return[yi({find:
|
|
21078
|
-
`));return a.replaceSelectionWith(this.type.create({language:i},l)),a.selection.$from.parent.type!==this.type&&a.setSelection(P.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}}),
|
|
21079
|
-
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:n,state:e,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:i}=e;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,l=i||o.$to.parentOffset&&o.$from.marks();return n().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&a){const h=l.filter(g=>s.includes(g.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),C5=bn.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:n}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,tn(this.options.HTMLAttributes,n),0]},addCommands(){return{setHeading:t=>({commands:n})=>this.options.levels.includes(t.level)?n.setNode(this.name,t):!1,toggleHeading:t=>({commands:n})=>this.options.levels.includes(t.level)?n.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,n)=>({...t,[`Mod-Alt-${n}`]:()=>this.editor.commands.toggleHeading({level:n})}),{})},addInputRules(){return this.options.levels.map(t=>yi({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var wr=200,nn=function(){};nn.prototype.append=function(n){return n.length?(n=nn.from(n),!this.length&&n||n.length<wr&&this.leafAppend(n)||this.length<wr&&n.leafPrepend(this)||this.appendInner(n)):this};nn.prototype.prepend=function(n){return n.length?nn.from(n).append(this):this};nn.prototype.appendInner=function(n){return new S5(this,n)};nn.prototype.slice=function(n,e){return n===void 0&&(n=0),e===void 0&&(e=this.length),n>=e?nn.empty:this.sliceInner(Math.max(0,n),Math.min(this.length,e))};nn.prototype.get=function(n){if(!(n<0||n>=this.length))return this.getInner(n)};nn.prototype.forEach=function(n,e,r){e===void 0&&(e=0),r===void 0&&(r=this.length),e<=r?this.forEachInner(n,e,r,0):this.forEachInvertedInner(n,e,r,0)};nn.prototype.map=function(n,e,r){e===void 0&&(e=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,a){return o.push(n(i,a))},e,r),o};nn.from=function(n){return n instanceof nn?n:n&&n.length?new op(n):nn.empty};var op=function(t){function n(r){t.call(this),this.values=r}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={length:{configurable:!0},depth:{configurable:!0}};return n.prototype.flatten=function(){return this.values},n.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new n(this.values.slice(o,i))},n.prototype.getInner=function(o){return this.values[o]},n.prototype.forEachInner=function(o,i,a,s){for(var l=i;l<a;l++)if(o(this.values[l],s+l)===!1)return!1},n.prototype.forEachInvertedInner=function(o,i,a,s){for(var l=i-1;l>=a;l--)if(o(this.values[l],s+l)===!1)return!1},n.prototype.leafAppend=function(o){if(this.length+o.length<=wr)return new n(this.values.concat(o.flatten()))},n.prototype.leafPrepend=function(o){if(this.length+o.length<=wr)return new n(o.flatten().concat(this.values))},e.length.get=function(){return this.values.length},e.depth.get=function(){return 0},Object.defineProperties(n.prototype,e),n}(nn);nn.empty=new op([]);var S5=function(t){function n(e,r){t.call(this),this.left=e,this.right=r,this.length=e.length+r.length,this.depth=Math.max(e.depth,r.depth)+1}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},n.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},n.prototype.forEachInner=function(r,o,i,a){var s=this.left.length;if(o<s&&this.left.forEachInner(r,o,Math.min(i,s),a)===!1||i>s&&this.right.forEachInner(r,Math.max(o-s,0),Math.min(this.length,i)-s,a+s)===!1)return!1},n.prototype.forEachInvertedInner=function(r,o,i,a){var s=this.left.length;if(o>s&&this.right.forEachInvertedInner(r,o-s,Math.max(i,s)-s,a+s)===!1||i<s&&this.left.forEachInvertedInner(r,Math.min(o,s),i,a)===!1)return!1},n.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},n.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new n(this.left,o)},n.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new n(o,this.right)},n.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new n(this.left,new n(this.right,r)):new n(this,r)},n}(nn);const E5=500;class In{constructor(n,e){this.items=n,this.eventCount=e}popEvent(n,e){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;e&&(o=this.remapping(r,this.items.length),i=o.maps.length);let a=n.tr,s,l,c=[],d=[];return this.items.forEach((h,g)=>{if(!h.step){o||(o=this.remapping(r,g+1),i=o.maps.length),i--,d.push(h);return}if(o){d.push(new $n(h.map));let u=h.step.map(o.slice(i)),f;u&&a.maybeStep(u).doc&&(f=a.mapping.maps[a.mapping.maps.length-1],c.push(new $n(f,void 0,void 0,c.length+d.length))),i--,f&&o.appendMap(f,i)}else a.maybeStep(h.step);if(h.selection)return s=o?h.selection.map(o.slice(i)):h.selection,l=new In(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:a,selection:s}}addTransform(n,e,r,o){let i=[],a=this.eventCount,s=this.items,l=!o&&s.length?s.get(s.length-1):null;for(let d=0;d<n.steps.length;d++){let h=n.steps[d].invert(n.docs[d]),g=new $n(n.mapping.maps[d],h,e),u;(u=l&&l.merge(g))&&(g=u,d?i.pop():s=s.slice(0,s.length-1)),i.push(g),e&&(a++,e=void 0),o||(l=g)}let c=a-r.depth;return c>T5&&(s=I5(s,c),a-=c),new In(s.append(i),a)}remapping(n,e){let r=new _t;return this.items.forEach((o,i)=>{let a=o.mirrorOffset!=null&&i-o.mirrorOffset>=n?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,a)},n,e),r}addMaps(n){return this.eventCount==0?this:new In(this.items.append(n.map(e=>new $n(e))),this.eventCount)}rebased(n,e){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-e),i=n.mapping,a=n.steps.length,s=this.eventCount;this.items.forEach(g=>{g.selection&&s--},o);let l=e;this.items.forEach(g=>{let u=i.getMirror(--l);if(u==null)return;a=Math.min(a,u);let f=i.maps[u];if(g.step){let m=n.steps[u].invert(n.docs[u]),x=g.selection&&g.selection.map(i.slice(l+1,u));x&&s++,r.push(new $n(f,m,x))}else r.push(new $n(f))},o);let c=[];for(let g=e;g<a;g++)c.push(new $n(i.maps[g]));let d=this.items.slice(0,o).append(c).append(r),h=new In(d,s);return h.emptyItemCount()>E5&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let n=0;return this.items.forEach(e=>{e.step||n++}),n}compress(n=this.items.length){let e=this.remapping(0,n),r=e.maps.length,o=[],i=0;return this.items.forEach((a,s)=>{if(s>=n)o.push(a),a.selection&&i++;else if(a.step){let l=a.step.map(e.slice(r)),c=l&&l.getMap();if(r--,c&&e.appendMap(c,r),l){let d=a.selection&&a.selection.map(e.slice(r));d&&i++;let h=new $n(c.invert(),l,d),g,u=o.length-1;(g=o.length&&o[u].merge(h))?o[u]=g:o.push(h)}}else a.map&&r--},this.items.length,0),new In(nn.from(o.reverse()),i)}}In.empty=new In(nn.empty,0);function I5(t,n){let e;return t.forEach((r,o)=>{if(r.selection&&n--==0)return e=o,!1}),t.slice(e)}class $n{constructor(n,e,r,o){this.map=n,this.step=e,this.selection=r,this.mirrorOffset=o}merge(n){if(this.step&&n.step&&!n.selection){let e=n.step.merge(this.step);if(e)return new $n(e.getMap().invert(),e,this.selection)}}}class qn{constructor(n,e,r,o,i){this.done=n,this.undone=e,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const T5=20;function $5(t,n,e,r){let o=e.getMeta(_e),i;if(o)return o.historyState;e.getMeta(D5)&&(t=new qn(t.done,t.undone,null,0,-1));let a=e.getMeta("appendedTransaction");if(e.steps.length==0)return t;if(a&&a.getMeta(_e))return a.getMeta(_e).redo?new qn(t.done.addTransform(e,void 0,r,tr(n)),t.undone,Hs(e.mapping.maps),t.prevTime,t.prevComposition):new qn(t.done,t.undone.addTransform(e,void 0,r,tr(n)),null,t.prevTime,t.prevComposition);if(e.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=e.getMeta("composition"),l=t.prevTime==0||!a&&t.prevComposition!=s&&(t.prevTime<(e.time||0)-r.newGroupDelay||!M5(e,t.prevRanges)),c=a?Po(t.prevRanges,e.mapping):Hs(e.mapping.maps);return new qn(t.done.addTransform(e,l?n.selection.getBookmark():void 0,r,tr(n)),In.empty,c,e.time,s??t.prevComposition)}else return(i=e.getMeta("rebased"))?new qn(t.done.rebased(e,i),t.undone.rebased(e,i),Po(t.prevRanges,e.mapping),t.prevTime,t.prevComposition):new qn(t.done.addMaps(e.mapping.maps),t.undone.addMaps(e.mapping.maps),Po(t.prevRanges,e.mapping),t.prevTime,t.prevComposition)}function M5(t,n){if(!n)return!1;if(!t.docChanged)return!0;let e=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<n.length;i+=2)r<=n[i+1]&&o>=n[i]&&(e=!0)}),e}function Hs(t){let n=[];for(let e=t.length-1;e>=0&&n.length==0;e--)t[e].forEach((r,o,i,a)=>n.push(i,a));return n}function Po(t,n){if(!t)return null;let e=[];for(let r=0;r<t.length;r+=2){let o=n.map(t[r],1),i=n.map(t[r+1],-1);o<=i&&e.push(o,i)}return e}function z5(t,n,e){let r=tr(n),o=_e.get(n).spec.config,i=(e?t.undone:t.done).popEvent(n,r);if(!i)return null;let a=i.selection.resolve(i.transform.doc),s=(e?t.done:t.undone).addTransform(i.transform,n.selection.getBookmark(),o,r),l=new qn(e?s:i.remaining,e?i.remaining:s,null,0,-1);return i.transform.setSelection(a).setMeta(_e,{redo:e,historyState:l})}let Ro=!1,js=null;function tr(t){let n=t.plugins;if(js!=n){Ro=!1,js=n;for(let e=0;e<n.length;e++)if(n[e].spec.historyPreserveItems){Ro=!0;break}}return Ro}const _e=new un("history"),D5=new un("closeHistory");function O5(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Q({key:_e,state:{init(){return new qn(In.empty,In.empty,null,0,-1)},apply(n,e,r){return $5(e,r,n,t)}},config:t,props:{handleDOMEvents:{beforeinput(n,e){let r=e.inputType,o=r=="historyUndo"?ap:r=="historyRedo"?sp:null;return!o||!n.editable?!1:(e.preventDefault(),o(n.state,n.dispatch))}}}})}function ip(t,n){return(e,r)=>{let o=_e.getState(e);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let i=z5(o,e,t);i&&r(i.scrollIntoView())}return!0}}const ap=ip(!1),sp=ip(!0),A5=ln.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:n})=>ap(t,n),redo:()=>({state:t,dispatch:n})=>sp(t,n)}},addProseMirrorPlugins(){return[O5(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),L5=bn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",tn(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:n})=>{if(!J1(n,n.schema.nodes[this.name]))return!1;const{selection:e}=n,{$from:r,$to:o}=e,i=t();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):m1(e)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:a,dispatch:s})=>{var l;if(s){const{$to:c}=a.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(P.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(O.create(a.doc,c.pos)):a.setSelection(P.create(a.doc,c.pos));else{const h=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();h&&(a.insert(d,h),a.setSelection(P.create(a.doc,d+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[K1({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),P5=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,R5=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,B5=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,N5=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,F5=Ln.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",tn(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[Ye({find:P5,type:this.type}),Ye({find:B5,type:this.type})]},addPasteRules(){return[$e({find:R5,type:this.type}),$e({find:N5,type:this.type})]}}),H5=bn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",tn(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)}}}),j5="listItem",Xs="textStyle",Vs=/^(\d+)\.\s$/,X5=bn.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},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:n,...e}=t;return n===1?["ol",tn(this.options.HTMLAttributes,e),0]:["ol",tn(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(j5,this.editor.getAttributes(Xs)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Mt({find:Vs,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:(n,e)=>e.childCount+e.attrs.start===+n[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mt({find:Vs,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(Xs)}),joinPredicate:(n,e)=>e.childCount+e.attrs.start===+n[1],editor:this.editor})),[t]}}),V5=bn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",tn(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),W5=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,U5=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,q5=Ln.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",tn(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-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ye({find:W5,type:this.type})]},addPasteRules(){return[$e({find:U5,type:this.type})]}}),K5=bn.create({name:"text",group:"inline"}),J5=ln.create({name:"starterKit",addExtensions(){const t=[];return this.options.bold!==!1&&t.push(t5.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(Y1.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(o5.configure(this.options.bulletList)),this.options.code!==!1&&t.push(s5.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(d5.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(p5.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(u5.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(w5.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(_5.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(C5.configure(this.options.heading)),this.options.history!==!1&&t.push(A5.configure(this.options.history)),this.options.horizontalRule!==!1&&t.push(L5.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(F5.configure(this.options.italic)),this.options.listItem!==!1&&t.push(H5.configure(this.options.listItem)),this.options.orderedList!==!1&&t.push(X5.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(V5.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(q5.configure(this.options.strike)),this.options.text!==!1&&t.push(K5.configure(this.options.text)),t}}),G5=Ln.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",tn(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()}}}),Y5="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Q5="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",vi="numeric",ki="ascii",wi="alpha",ht="asciinumeric",lt="alphanumeric",_i="domain",lp="emoji",Z5="scheme",ny="slashscheme",Bo="whitespace";function ey(t,n){return t in n||(n[t]=[]),n[t]}function be(t,n,e){n[vi]&&(n[ht]=!0,n[lt]=!0),n[ki]&&(n[ht]=!0,n[wi]=!0),n[ht]&&(n[lt]=!0),n[wi]&&(n[lt]=!0),n[lt]&&(n[_i]=!0),n[lp]&&(n[_i]=!0);for(const r in n){const o=ey(r,e);o.indexOf(t)<0&&o.push(t)}}function ty(t,n){const e={};for(const r in n)n[r].indexOf(t)>=0&&(e[r]=!0);return e}function mn(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}mn.groups={};mn.prototype={accepts(){return!!this.t},go(t){const n=this,e=n.j[t];if(e)return e;for(let r=0;r<n.jr.length;r++){const o=n.jr[r][0],i=n.jr[r][1];if(i&&o.test(t))return i}return n.jd},has(t,n=!1){return n?t in this.j:!!this.go(t)},ta(t,n,e,r){for(let o=0;o<t.length;o++)this.tt(t[o],n,e,r)},tr(t,n,e,r){r=r||mn.groups;let o;return n&&n.j?o=n:(o=new mn(n),e&&r&&be(n,e,r)),this.jr.push([t,o]),o},ts(t,n,e,r){let o=this;const i=t.length;if(!i)return o;for(let a=0;a<i-1;a++)o=o.tt(t[a]);return o.tt(t[i-1],n,e,r)},tt(t,n,e,r){r=r||mn.groups;const o=this;if(n&&n.j)return o.j[t]=n,n;const i=n;let a,s=o.go(t);if(s?(a=new mn,Object.assign(a.j,s.j),a.jr.push.apply(a.jr,s.jr),a.jd=s.jd,a.t=s.t):a=new mn,i){if(r)if(a.t&&typeof a.t=="string"){const l=Object.assign(ty(a.t,r),e);be(i,l,r)}else e&&be(i,e,r);a.t=i}return o.j[t]=a,a}};const R=(t,n,e,r,o)=>t.ta(n,e,r,o),q=(t,n,e,r,o)=>t.tr(n,e,r,o),Ws=(t,n,e,r,o)=>t.ts(n,e,r,o),v=(t,n,e,r,o)=>t.tt(n,e,r,o),Nn="WORD",Ci="UWORD",cp="ASCIINUMERICAL",dp="ALPHANUMERICAL",zt="LOCALHOST",Si="TLD",Ei="UTLD",rr="SCHEME",Be="SLASH_SCHEME",ra="NUM",Ii="WS",oa="NL",gt="OPENBRACE",ut="CLOSEBRACE",_r="OPENBRACKET",Cr="CLOSEBRACKET",Sr="OPENPAREN",Er="CLOSEPAREN",Ir="OPENANGLEBRACKET",Tr="CLOSEANGLEBRACKET",$r="FULLWIDTHLEFTPAREN",Mr="FULLWIDTHRIGHTPAREN",zr="LEFTCORNERBRACKET",Dr="RIGHTCORNERBRACKET",Or="LEFTWHITECORNERBRACKET",Ar="RIGHTWHITECORNERBRACKET",Lr="FULLWIDTHLESSTHAN",Pr="FULLWIDTHGREATERTHAN",Rr="AMPERSAND",Br="APOSTROPHE",Nr="ASTERISK",Kn="AT",Fr="BACKSLASH",Hr="BACKTICK",jr="CARET",Gn="COLON",ia="COMMA",Xr="DOLLAR",Mn="DOT",Vr="EQUALS",aa="EXCLAMATION",wn="HYPHEN",ft="PERCENT",Wr="PIPE",Ur="PLUS",qr="POUND",mt="QUERY",sa="QUOTE",pp="FULLWIDTHMIDDLEDOT",la="SEMI",zn="SLASH",xt="TILDE",Kr="UNDERSCORE",hp="EMOJI",Jr="SYM";var gp=Object.freeze({__proto__:null,ALPHANUMERICAL:dp,AMPERSAND:Rr,APOSTROPHE:Br,ASCIINUMERICAL:cp,ASTERISK:Nr,AT:Kn,BACKSLASH:Fr,BACKTICK:Hr,CARET:jr,CLOSEANGLEBRACKET:Tr,CLOSEBRACE:ut,CLOSEBRACKET:Cr,CLOSEPAREN:Er,COLON:Gn,COMMA:ia,DOLLAR:Xr,DOT:Mn,EMOJI:hp,EQUALS:Vr,EXCLAMATION:aa,FULLWIDTHGREATERTHAN:Pr,FULLWIDTHLEFTPAREN:$r,FULLWIDTHLESSTHAN:Lr,FULLWIDTHMIDDLEDOT:pp,FULLWIDTHRIGHTPAREN:Mr,HYPHEN:wn,LEFTCORNERBRACKET:zr,LEFTWHITECORNERBRACKET:Or,LOCALHOST:zt,NL:oa,NUM:ra,OPENANGLEBRACKET:Ir,OPENBRACE:gt,OPENBRACKET:_r,OPENPAREN:Sr,PERCENT:ft,PIPE:Wr,PLUS:Ur,POUND:qr,QUERY:mt,QUOTE:sa,RIGHTCORNERBRACKET:Dr,RIGHTWHITECORNERBRACKET:Ar,SCHEME:rr,SEMI:la,SLASH:zn,SLASH_SCHEME:Be,SYM:Jr,TILDE:xt,TLD:Si,UNDERSCORE:Kr,UTLD:Ei,UWORD:Ci,WORD:Nn,WS:Ii});const Rn=/[a-z]/,ot=new RegExp("\\p{L}","u"),No=new RegExp("\\p{Emoji}","u"),Bn=/\d/,Fo=/\s/,Us="\r",Ho=`
|
|
21080
|
-
`,
|
|
21081
|
+
`);return!i||!a?!1:t.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:n}=t,{selection:e,doc:r}=n,{$from:o,empty:i}=e;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const s=o.after();return s===void 0?!1:r.nodeAt(s)?t.commands.command(({tr:c})=>(c.setSelection(B.near(r.resolve(s))),!0)):t.commands.exitCode()}}},addInputRules(){return[yi({find:h5,type:this.type,getAttributes:t=>({language:t[1]})}),yi({find:g5,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Q({key:new un("codeBlockVSCodeHandler"),props:{handlePaste:(t,n)=>{if(!n.clipboardData||this.editor.isActive(this.type.name))return!1;const e=n.clipboardData.getData("text/plain"),r=n.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o==null?void 0:o.mode;if(!e||!i)return!1;const{tr:a,schema:s}=t.state,l=s.text(e.replace(/\r\n?/g,`
|
|
21082
|
+
`));return a.replaceSelectionWith(this.type.create({language:i},l)),a.selection.$from.parent.type!==this.type&&a.setSelection(P.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}}),f5=bn.create({name:"doc",topNode:!0,content:"block+"});function m5(t={}){return new Q({view(n){return new x5(n,t)}})}class x5{constructor(n,e){var r;this.editorView=n,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=e.width)!==null&&r!==void 0?r:1,this.color=e.color===!1?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=a=>{this[o](a)};return n.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:n,handler:e})=>this.editorView.dom.removeEventListener(n,e))}update(n,e){this.cursorPos!=null&&e.doc!=n.state.doc&&(this.cursorPos>n.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(n){n!=this.cursorPos&&(this.cursorPos=n,n==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let n=this.editorView.state.doc.resolve(this.cursorPos),e=!n.parent.inlineContent,r,o=this.editorView.dom,i=o.getBoundingClientRect(),a=i.width/o.offsetWidth,s=i.height/o.offsetHeight;if(e){let h=n.nodeBefore,g=n.nodeAfter;if(h||g){let u=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(u){let f=u.getBoundingClientRect(),m=h?f.bottom:f.top;h&&g&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let x=this.width/2*s;r={left:f.left,right:f.right,top:m-x,bottom:m+x}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),g=this.width/2*a;r={left:h.left-g,right:h.left+g,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.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",e),this.element.classList.toggle("prosemirror-dropcursor-inline",!e);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let h=l.getBoundingClientRect(),g=h.width/l.offsetWidth,u=h.height/l.offsetHeight;c=h.left-l.scrollLeft*g,d=h.top-l.scrollTop*u}this.element.style.left=(r.left-c)/a+"px",this.element.style.top=(r.top-d)/s+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/s+"px"}scheduleRemoval(n){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),n)}dragover(n){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:n.clientX,top:n.clientY}),r=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,e,n):o;if(e&&!i){let a=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let s=Qc(this.editorView.state.doc,a,this.editorView.dragging.slice);s!=null&&(a=s)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(n){this.editorView.dom.contains(n.relatedTarget)||this.setCursor(null)}}const b5=ln.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[m5(this.options)]}});class K extends B{constructor(n){super(n,n)}map(n,e){let r=n.resolve(e.map(this.head));return K.valid(r)?new K(r):B.near(r)}content(){return w.empty}eq(n){return n instanceof K&&n.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(n,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new K(n.resolve(e.pos))}getBookmark(){return new ta(this.anchor)}static valid(n){let e=n.parent;if(e.inlineContent||!y5(n)||!v5(n))return!1;let r=e.type.spec.allowGapCursor;if(r!=null)return r;let o=e.contentMatchAt(n.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(n,e,r=!1){n:for(;;){if(!r&&K.valid(n))return n;let o=n.pos,i=null;for(let a=n.depth;;a--){let s=n.node(a);if(e>0?n.indexAfter(a)<s.childCount:n.index(a)>0){i=s.child(e>0?n.indexAfter(a):n.index(a)-1);break}else if(a==0)return null;o+=e;let l=n.doc.resolve(o);if(K.valid(l))return l}for(;;){let a=e>0?i.firstChild:i.lastChild;if(!a){if(i.isAtom&&!i.isText&&!O.isSelectable(i)){n=n.doc.resolve(o+i.nodeSize*e),r=!1;continue n}break}i=a,o+=e;let s=n.doc.resolve(o);if(K.valid(s))return s}return null}}}K.prototype.visible=!1;K.findFrom=K.findGapCursorFrom;B.jsonID("gapcursor",K);class ta{constructor(n){this.pos=n}map(n){return new ta(n.map(this.pos))}resolve(n){let e=n.resolve(this.pos);return K.valid(e)?new K(e):B.near(e)}}function ip(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function y5(t){for(let n=t.depth;n>=0;n--){let e=t.index(n),r=t.node(n);if(e==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(e-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||ip(o.type))return!0;if(o.inlineContent)return!1}}return!0}function v5(t){for(let n=t.depth;n>=0;n--){let e=t.indexAfter(n),r=t.node(n);if(e==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(e);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||ip(o.type))return!0;if(o.inlineContent)return!1}}return!0}function k5(){return new Q({props:{decorations:S5,createSelectionBetween(t,n,e){return n.pos==e.pos&&K.valid(e)?new K(e):null},handleClick:_5,handleKeyDown:w5,handleDOMEvents:{beforeinput:C5}}})}const w5=Hd({ArrowLeft:qt("horiz",-1),ArrowRight:qt("horiz",1),ArrowUp:qt("vert",-1),ArrowDown:qt("vert",1)});function qt(t,n){const e=t=="vert"?n>0?"down":"up":n>0?"right":"left";return function(r,o,i){let a=r.selection,s=n>0?a.$to:a.$from,l=a.empty;if(a instanceof P){if(!i.endOfTextblock(e)||s.depth==0)return!1;l=!1,s=r.doc.resolve(n>0?s.after():s.before())}let c=K.findGapCursorFrom(s,n,l);return c?(o&&o(r.tr.setSelection(new K(c))),!0):!1}}function _5(t,n,e){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(n);if(!K.valid(r))return!1;let o=t.posAtCoords({left:e.clientX,top:e.clientY});return o&&o.inside>-1&&O.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new K(r))),!0)}function C5(t,n){if(n.inputType!="insertCompositionText"||!(t.state.selection instanceof K))return!1;let{$from:e}=t.state.selection,r=e.parent.contentMatchAt(e.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=y.empty;for(let a=r.length-1;a>=0;a--)o=y.from(r[a].createAndFill(null,o));let i=t.state.tr.replace(e.pos,e.pos,new w(o,0,0));return i.setSelection(P.near(i.doc.resolve(e.pos+1))),t.dispatch(i),!1}function S5(t){if(!(t.selection instanceof K))return null;let n=document.createElement("div");return n.className="ProseMirror-gapcursor",G.create(t.doc,[vn.widget(t.selection.head,n,{key:"gapcursor"})])}const E5=ln.create({name:"gapCursor",addProseMirrorPlugins(){return[k5()]},extendNodeSchema(t){var n;const e={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(n=N(S(t,"allowGapCursor",e)))!==null&&n!==void 0?n:null}}}),I5=bn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",tn(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
21083
|
+
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:n,state:e,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:i}=e;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,l=i||o.$to.parentOffset&&o.$from.marks();return n().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&a){const h=l.filter(g=>s.includes(g.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),$5=bn.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:n}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,tn(this.options.HTMLAttributes,n),0]},addCommands(){return{setHeading:t=>({commands:n})=>this.options.levels.includes(t.level)?n.setNode(this.name,t):!1,toggleHeading:t=>({commands:n})=>this.options.levels.includes(t.level)?n.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,n)=>({...t,[`Mod-Alt-${n}`]:()=>this.editor.commands.toggleHeading({level:n})}),{})},addInputRules(){return this.options.levels.map(t=>yi({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var wr=200,nn=function(){};nn.prototype.append=function(n){return n.length?(n=nn.from(n),!this.length&&n||n.length<wr&&this.leafAppend(n)||this.length<wr&&n.leafPrepend(this)||this.appendInner(n)):this};nn.prototype.prepend=function(n){return n.length?nn.from(n).append(this):this};nn.prototype.appendInner=function(n){return new T5(this,n)};nn.prototype.slice=function(n,e){return n===void 0&&(n=0),e===void 0&&(e=this.length),n>=e?nn.empty:this.sliceInner(Math.max(0,n),Math.min(this.length,e))};nn.prototype.get=function(n){if(!(n<0||n>=this.length))return this.getInner(n)};nn.prototype.forEach=function(n,e,r){e===void 0&&(e=0),r===void 0&&(r=this.length),e<=r?this.forEachInner(n,e,r,0):this.forEachInvertedInner(n,e,r,0)};nn.prototype.map=function(n,e,r){e===void 0&&(e=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,a){return o.push(n(i,a))},e,r),o};nn.from=function(n){return n instanceof nn?n:n&&n.length?new ap(n):nn.empty};var ap=function(t){function n(r){t.call(this),this.values=r}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var e={length:{configurable:!0},depth:{configurable:!0}};return n.prototype.flatten=function(){return this.values},n.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new n(this.values.slice(o,i))},n.prototype.getInner=function(o){return this.values[o]},n.prototype.forEachInner=function(o,i,a,s){for(var l=i;l<a;l++)if(o(this.values[l],s+l)===!1)return!1},n.prototype.forEachInvertedInner=function(o,i,a,s){for(var l=i-1;l>=a;l--)if(o(this.values[l],s+l)===!1)return!1},n.prototype.leafAppend=function(o){if(this.length+o.length<=wr)return new n(this.values.concat(o.flatten()))},n.prototype.leafPrepend=function(o){if(this.length+o.length<=wr)return new n(o.flatten().concat(this.values))},e.length.get=function(){return this.values.length},e.depth.get=function(){return 0},Object.defineProperties(n.prototype,e),n}(nn);nn.empty=new ap([]);var T5=function(t){function n(e,r){t.call(this),this.left=e,this.right=r,this.length=e.length+r.length,this.depth=Math.max(e.depth,r.depth)+1}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},n.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},n.prototype.forEachInner=function(r,o,i,a){var s=this.left.length;if(o<s&&this.left.forEachInner(r,o,Math.min(i,s),a)===!1||i>s&&this.right.forEachInner(r,Math.max(o-s,0),Math.min(this.length,i)-s,a+s)===!1)return!1},n.prototype.forEachInvertedInner=function(r,o,i,a){var s=this.left.length;if(o>s&&this.right.forEachInvertedInner(r,o-s,Math.max(i,s)-s,a+s)===!1||i<s&&this.left.forEachInvertedInner(r,Math.min(o,s),i,a)===!1)return!1},n.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},n.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new n(this.left,o)},n.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new n(o,this.right)},n.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new n(this.left,new n(this.right,r)):new n(this,r)},n}(nn);const M5=500;class In{constructor(n,e){this.items=n,this.eventCount=e}popEvent(n,e){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;e&&(o=this.remapping(r,this.items.length),i=o.maps.length);let a=n.tr,s,l,c=[],d=[];return this.items.forEach((h,g)=>{if(!h.step){o||(o=this.remapping(r,g+1),i=o.maps.length),i--,d.push(h);return}if(o){d.push(new Tn(h.map));let u=h.step.map(o.slice(i)),f;u&&a.maybeStep(u).doc&&(f=a.mapping.maps[a.mapping.maps.length-1],c.push(new Tn(f,void 0,void 0,c.length+d.length))),i--,f&&o.appendMap(f,i)}else a.maybeStep(h.step);if(h.selection)return s=o?h.selection.map(o.slice(i)):h.selection,l=new In(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:a,selection:s}}addTransform(n,e,r,o){let i=[],a=this.eventCount,s=this.items,l=!o&&s.length?s.get(s.length-1):null;for(let d=0;d<n.steps.length;d++){let h=n.steps[d].invert(n.docs[d]),g=new Tn(n.mapping.maps[d],h,e),u;(u=l&&l.merge(g))&&(g=u,d?i.pop():s=s.slice(0,s.length-1)),i.push(g),e&&(a++,e=void 0),o||(l=g)}let c=a-r.depth;return c>z5&&(s=D5(s,c),a-=c),new In(s.append(i),a)}remapping(n,e){let r=new _t;return this.items.forEach((o,i)=>{let a=o.mirrorOffset!=null&&i-o.mirrorOffset>=n?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,a)},n,e),r}addMaps(n){return this.eventCount==0?this:new In(this.items.append(n.map(e=>new Tn(e))),this.eventCount)}rebased(n,e){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-e),i=n.mapping,a=n.steps.length,s=this.eventCount;this.items.forEach(g=>{g.selection&&s--},o);let l=e;this.items.forEach(g=>{let u=i.getMirror(--l);if(u==null)return;a=Math.min(a,u);let f=i.maps[u];if(g.step){let m=n.steps[u].invert(n.docs[u]),x=g.selection&&g.selection.map(i.slice(l+1,u));x&&s++,r.push(new Tn(f,m,x))}else r.push(new Tn(f))},o);let c=[];for(let g=e;g<a;g++)c.push(new Tn(i.maps[g]));let d=this.items.slice(0,o).append(c).append(r),h=new In(d,s);return h.emptyItemCount()>M5&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let n=0;return this.items.forEach(e=>{e.step||n++}),n}compress(n=this.items.length){let e=this.remapping(0,n),r=e.maps.length,o=[],i=0;return this.items.forEach((a,s)=>{if(s>=n)o.push(a),a.selection&&i++;else if(a.step){let l=a.step.map(e.slice(r)),c=l&&l.getMap();if(r--,c&&e.appendMap(c,r),l){let d=a.selection&&a.selection.map(e.slice(r));d&&i++;let h=new Tn(c.invert(),l,d),g,u=o.length-1;(g=o.length&&o[u].merge(h))?o[u]=g:o.push(h)}}else a.map&&r--},this.items.length,0),new In(nn.from(o.reverse()),i)}}In.empty=new In(nn.empty,0);function D5(t,n){let e;return t.forEach((r,o)=>{if(r.selection&&n--==0)return e=o,!1}),t.slice(e)}class Tn{constructor(n,e,r,o){this.map=n,this.step=e,this.selection=r,this.mirrorOffset=o}merge(n){if(this.step&&n.step&&!n.selection){let e=n.step.merge(this.step);if(e)return new Tn(e.getMap().invert(),e,this.selection)}}}class qn{constructor(n,e,r,o,i){this.done=n,this.undone=e,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const z5=20;function O5(t,n,e,r){let o=e.getMeta(_e),i;if(o)return o.historyState;e.getMeta(P5)&&(t=new qn(t.done,t.undone,null,0,-1));let a=e.getMeta("appendedTransaction");if(e.steps.length==0)return t;if(a&&a.getMeta(_e))return a.getMeta(_e).redo?new qn(t.done.addTransform(e,void 0,r,tr(n)),t.undone,Xs(e.mapping.maps),t.prevTime,t.prevComposition):new qn(t.done,t.undone.addTransform(e,void 0,r,tr(n)),null,t.prevTime,t.prevComposition);if(e.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=e.getMeta("composition"),l=t.prevTime==0||!a&&t.prevComposition!=s&&(t.prevTime<(e.time||0)-r.newGroupDelay||!A5(e,t.prevRanges)),c=a?Po(t.prevRanges,e.mapping):Xs(e.mapping.maps);return new qn(t.done.addTransform(e,l?n.selection.getBookmark():void 0,r,tr(n)),In.empty,c,e.time,s??t.prevComposition)}else return(i=e.getMeta("rebased"))?new qn(t.done.rebased(e,i),t.undone.rebased(e,i),Po(t.prevRanges,e.mapping),t.prevTime,t.prevComposition):new qn(t.done.addMaps(e.mapping.maps),t.undone.addMaps(e.mapping.maps),Po(t.prevRanges,e.mapping),t.prevTime,t.prevComposition)}function A5(t,n){if(!n)return!1;if(!t.docChanged)return!0;let e=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<n.length;i+=2)r<=n[i+1]&&o>=n[i]&&(e=!0)}),e}function Xs(t){let n=[];for(let e=t.length-1;e>=0&&n.length==0;e--)t[e].forEach((r,o,i,a)=>n.push(i,a));return n}function Po(t,n){if(!t)return null;let e=[];for(let r=0;r<t.length;r+=2){let o=n.map(t[r],1),i=n.map(t[r+1],-1);o<=i&&e.push(o,i)}return e}function L5(t,n,e){let r=tr(n),o=_e.get(n).spec.config,i=(e?t.undone:t.done).popEvent(n,r);if(!i)return null;let a=i.selection.resolve(i.transform.doc),s=(e?t.done:t.undone).addTransform(i.transform,n.selection.getBookmark(),o,r),l=new qn(e?s:i.remaining,e?i.remaining:s,null,0,-1);return i.transform.setSelection(a).setMeta(_e,{redo:e,historyState:l})}let Ro=!1,Vs=null;function tr(t){let n=t.plugins;if(Vs!=n){Ro=!1,Vs=n;for(let e=0;e<n.length;e++)if(n[e].spec.historyPreserveItems){Ro=!0;break}}return Ro}const _e=new un("history"),P5=new un("closeHistory");function R5(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Q({key:_e,state:{init(){return new qn(In.empty,In.empty,null,0,-1)},apply(n,e,r){return O5(e,r,n,t)}},config:t,props:{handleDOMEvents:{beforeinput(n,e){let r=e.inputType,o=r=="historyUndo"?lp:r=="historyRedo"?cp:null;return!o||!n.editable?!1:(e.preventDefault(),o(n.state,n.dispatch))}}}})}function sp(t,n){return(e,r)=>{let o=_e.getState(e);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let i=L5(o,e,t);i&&r(i.scrollIntoView())}return!0}}const lp=sp(!1),cp=sp(!0),B5=ln.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:n})=>lp(t,n),redo:()=>({state:t,dispatch:n})=>cp(t,n)}},addProseMirrorPlugins(){return[R5(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),N5=bn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",tn(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:n})=>{if(!Z1(n,n.schema.nodes[this.name]))return!1;const{selection:e}=n,{$from:r,$to:o}=e,i=t();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):v1(e)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:a,dispatch:s})=>{var l;if(s){const{$to:c}=a.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(P.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(O.create(a.doc,c.pos)):a.setSelection(P.create(a.doc,c.pos));else{const h=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();h&&(a.insert(d,h),a.setSelection(P.create(a.doc,d+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Q1({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),F5=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,H5=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,j5=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,X5=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,V5=Ln.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",tn(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[Ye({find:F5,type:this.type}),Ye({find:j5,type:this.type})]},addPasteRules(){return[Te({find:H5,type:this.type}),Te({find:X5,type:this.type})]}}),W5=bn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",tn(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)}}}),U5="listItem",Ws="textStyle",Us=/^(\d+)\.\s$/,q5=bn.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},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:n,...e}=t;return n===1?["ol",tn(this.options.HTMLAttributes,e),0]:["ol",tn(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(U5,this.editor.getAttributes(Ws)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Mt({find:Us,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:(n,e)=>e.childCount+e.attrs.start===+n[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mt({find:Us,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(Ws)}),joinPredicate:(n,e)=>e.childCount+e.attrs.start===+n[1],editor:this.editor})),[t]}}),K5=bn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",tn(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),J5=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,G5=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Y5=Ln.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",tn(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-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ye({find:J5,type:this.type})]},addPasteRules(){return[Te({find:G5,type:this.type})]}}),Q5=bn.create({name:"text",group:"inline"}),Z5=ln.create({name:"starterKit",addExtensions(){const t=[];return this.options.bold!==!1&&t.push(a5.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(e5.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(l5.configure(this.options.bulletList)),this.options.code!==!1&&t.push(p5.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(u5.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(f5.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(b5.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(E5.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(I5.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push($5.configure(this.options.heading)),this.options.history!==!1&&t.push(B5.configure(this.options.history)),this.options.horizontalRule!==!1&&t.push(N5.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(V5.configure(this.options.italic)),this.options.listItem!==!1&&t.push(W5.configure(this.options.listItem)),this.options.orderedList!==!1&&t.push(q5.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(K5.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(Y5.configure(this.options.strike)),this.options.text!==!1&&t.push(Q5.configure(this.options.text)),t}}),ny=Ln.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",tn(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()}}}),ey="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",ty="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",vi="numeric",ki="ascii",wi="alpha",ht="asciinumeric",lt="alphanumeric",_i="domain",dp="emoji",ry="scheme",oy="slashscheme",Bo="whitespace";function iy(t,n){return t in n||(n[t]=[]),n[t]}function be(t,n,e){n[vi]&&(n[ht]=!0,n[lt]=!0),n[ki]&&(n[ht]=!0,n[wi]=!0),n[ht]&&(n[lt]=!0),n[wi]&&(n[lt]=!0),n[lt]&&(n[_i]=!0),n[dp]&&(n[_i]=!0);for(const r in n){const o=iy(r,e);o.indexOf(t)<0&&o.push(t)}}function ay(t,n){const e={};for(const r in n)n[r].indexOf(t)>=0&&(e[r]=!0);return e}function mn(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}mn.groups={};mn.prototype={accepts(){return!!this.t},go(t){const n=this,e=n.j[t];if(e)return e;for(let r=0;r<n.jr.length;r++){const o=n.jr[r][0],i=n.jr[r][1];if(i&&o.test(t))return i}return n.jd},has(t,n=!1){return n?t in this.j:!!this.go(t)},ta(t,n,e,r){for(let o=0;o<t.length;o++)this.tt(t[o],n,e,r)},tr(t,n,e,r){r=r||mn.groups;let o;return n&&n.j?o=n:(o=new mn(n),e&&r&&be(n,e,r)),this.jr.push([t,o]),o},ts(t,n,e,r){let o=this;const i=t.length;if(!i)return o;for(let a=0;a<i-1;a++)o=o.tt(t[a]);return o.tt(t[i-1],n,e,r)},tt(t,n,e,r){r=r||mn.groups;const o=this;if(n&&n.j)return o.j[t]=n,n;const i=n;let a,s=o.go(t);if(s?(a=new mn,Object.assign(a.j,s.j),a.jr.push.apply(a.jr,s.jr),a.jd=s.jd,a.t=s.t):a=new mn,i){if(r)if(a.t&&typeof a.t=="string"){const l=Object.assign(ay(a.t,r),e);be(i,l,r)}else e&&be(i,e,r);a.t=i}return o.j[t]=a,a}};const R=(t,n,e,r,o)=>t.ta(n,e,r,o),q=(t,n,e,r,o)=>t.tr(n,e,r,o),qs=(t,n,e,r,o)=>t.ts(n,e,r,o),v=(t,n,e,r,o)=>t.tt(n,e,r,o),Nn="WORD",Ci="UWORD",pp="ASCIINUMERICAL",hp="ALPHANUMERICAL",Dt="LOCALHOST",Si="TLD",Ei="UTLD",rr="SCHEME",Be="SLASH_SCHEME",ra="NUM",Ii="WS",oa="NL",gt="OPENBRACE",ut="CLOSEBRACE",_r="OPENBRACKET",Cr="CLOSEBRACKET",Sr="OPENPAREN",Er="CLOSEPAREN",Ir="OPENANGLEBRACKET",$r="CLOSEANGLEBRACKET",Tr="FULLWIDTHLEFTPAREN",Mr="FULLWIDTHRIGHTPAREN",Dr="LEFTCORNERBRACKET",zr="RIGHTCORNERBRACKET",Or="LEFTWHITECORNERBRACKET",Ar="RIGHTWHITECORNERBRACKET",Lr="FULLWIDTHLESSTHAN",Pr="FULLWIDTHGREATERTHAN",Rr="AMPERSAND",Br="APOSTROPHE",Nr="ASTERISK",Kn="AT",Fr="BACKSLASH",Hr="BACKTICK",jr="CARET",Gn="COLON",ia="COMMA",Xr="DOLLAR",Mn="DOT",Vr="EQUALS",aa="EXCLAMATION",wn="HYPHEN",ft="PERCENT",Wr="PIPE",Ur="PLUS",qr="POUND",mt="QUERY",sa="QUOTE",gp="FULLWIDTHMIDDLEDOT",la="SEMI",Dn="SLASH",xt="TILDE",Kr="UNDERSCORE",up="EMOJI",Jr="SYM";var fp=Object.freeze({__proto__:null,ALPHANUMERICAL:hp,AMPERSAND:Rr,APOSTROPHE:Br,ASCIINUMERICAL:pp,ASTERISK:Nr,AT:Kn,BACKSLASH:Fr,BACKTICK:Hr,CARET:jr,CLOSEANGLEBRACKET:$r,CLOSEBRACE:ut,CLOSEBRACKET:Cr,CLOSEPAREN:Er,COLON:Gn,COMMA:ia,DOLLAR:Xr,DOT:Mn,EMOJI:up,EQUALS:Vr,EXCLAMATION:aa,FULLWIDTHGREATERTHAN:Pr,FULLWIDTHLEFTPAREN:Tr,FULLWIDTHLESSTHAN:Lr,FULLWIDTHMIDDLEDOT:gp,FULLWIDTHRIGHTPAREN:Mr,HYPHEN:wn,LEFTCORNERBRACKET:Dr,LEFTWHITECORNERBRACKET:Or,LOCALHOST:Dt,NL:oa,NUM:ra,OPENANGLEBRACKET:Ir,OPENBRACE:gt,OPENBRACKET:_r,OPENPAREN:Sr,PERCENT:ft,PIPE:Wr,PLUS:Ur,POUND:qr,QUERY:mt,QUOTE:sa,RIGHTCORNERBRACKET:zr,RIGHTWHITECORNERBRACKET:Ar,SCHEME:rr,SEMI:la,SLASH:Dn,SLASH_SCHEME:Be,SYM:Jr,TILDE:xt,TLD:Si,UNDERSCORE:Kr,UTLD:Ei,UWORD:Ci,WORD:Nn,WS:Ii});const Rn=/[a-z]/,ot=new RegExp("\\p{L}","u"),No=new RegExp("\\p{Emoji}","u"),Bn=/\d/,Fo=/\s/,Ks="\r",Ho=`
|
|
21084
|
+
`,sy="️",ly="",jo="";let Kt=null,Jt=null;function cy(t=[]){const n={};mn.groups=n;const e=new mn;Kt==null&&(Kt=Js(ey)),Jt==null&&(Jt=Js(ty)),v(e,"'",Br),v(e,"{",gt),v(e,"}",ut),v(e,"[",_r),v(e,"]",Cr),v(e,"(",Sr),v(e,")",Er),v(e,"<",Ir),v(e,">",$r),v(e,"(",Tr),v(e,")",Mr),v(e,"「",Dr),v(e,"」",zr),v(e,"『",Or),v(e,"』",Ar),v(e,"<",Lr),v(e,">",Pr),v(e,"&",Rr),v(e,"*",Nr),v(e,"@",Kn),v(e,"`",Hr),v(e,"^",jr),v(e,":",Gn),v(e,",",ia),v(e,"$",Xr),v(e,".",Mn),v(e,"=",Vr),v(e,"!",aa),v(e,"-",wn),v(e,"%",ft),v(e,"|",Wr),v(e,"+",Ur),v(e,"#",qr),v(e,"?",mt),v(e,'"',sa),v(e,"/",Dn),v(e,";",la),v(e,"~",xt),v(e,"_",Kr),v(e,"\\",Fr),v(e,"・",gp);const r=q(e,Bn,ra,{[vi]:!0});q(r,Bn,r);const o=q(r,Rn,pp,{[ht]:!0}),i=q(r,ot,hp,{[lt]:!0}),a=q(e,Rn,Nn,{[ki]:!0});q(a,Bn,o),q(a,Rn,a),q(o,Bn,o),q(o,Rn,o);const s=q(e,ot,Ci,{[wi]:!0});q(s,Rn),q(s,Bn,i),q(s,ot,s),q(i,Bn,i),q(i,Rn),q(i,ot,i);const l=v(e,Ho,oa,{[Bo]:!0}),c=v(e,Ks,Ii,{[Bo]:!0}),d=q(e,Fo,Ii,{[Bo]:!0});v(e,jo,d),v(c,Ho,l),v(c,jo,d),q(c,Fo,d),v(d,Ks),v(d,Ho),q(d,Fo,d),v(d,jo,d);const h=q(e,No,up,{[dp]:!0});v(h,"#"),q(h,No,h),v(h,sy,h);const g=v(h,ly);v(g,"#"),q(g,No,h);const u=[[Rn,a],[Bn,o]],f=[[Rn,null],[ot,s],[Bn,i]];for(let m=0;m<Kt.length;m++)Vn(e,Kt[m],Si,Nn,u);for(let m=0;m<Jt.length;m++)Vn(e,Jt[m],Ei,Ci,f);be(Si,{tld:!0,ascii:!0},n),be(Ei,{utld:!0,alpha:!0},n),Vn(e,"file",rr,Nn,u),Vn(e,"mailto",rr,Nn,u),Vn(e,"http",Be,Nn,u),Vn(e,"https",Be,Nn,u),Vn(e,"ftp",Be,Nn,u),Vn(e,"ftps",Be,Nn,u),be(rr,{scheme:!0,ascii:!0},n),be(Be,{slashscheme:!0,ascii:!0},n),t=t.sort((m,x)=>m[0]>x[0]?1:-1);for(let m=0;m<t.length;m++){const x=t[m][0],_=t[m][1]?{[ry]:!0}:{[oy]:!0};x.indexOf("-")>=0?_[_i]=!0:Rn.test(x)?Bn.test(x)?_[ht]=!0:_[ki]=!0:_[vi]=!0,qs(e,x,x,_)}return qs(e,"localhost",Dt,{ascii:!0}),e.jd=new mn(Jr),{start:e,tokens:Object.assign({groups:n},fp)}}function mp(t,n){const e=dy(n.replace(/[A-Z]/g,s=>s.toLowerCase())),r=e.length,o=[];let i=0,a=0;for(;a<r;){let s=t,l=null,c=0,d=null,h=-1,g=-1;for(;a<r&&(l=s.go(e[a]));)s=l,s.accepts()?(h=0,g=0,d=s):h>=0&&(h+=e[a].length,g++),c+=e[a].length,i+=e[a].length,a++;i-=h,a-=g,c-=h,o.push({t:d.t,v:n.slice(i-c,i),s:i-c,e:i})}return o}function dy(t){const n=[],e=t.length;let r=0;for(;r<e;){let o=t.charCodeAt(r),i,a=o<55296||o>56319||r+1===e||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);n.push(a),r+=a.length}return n}function Vn(t,n,e,r,o){let i;const a=n.length;for(let s=0;s<a-1;s++){const l=n[s];t.j[l]?i=t.j[l]:(i=new mn(r),i.jr=o.slice(),t.j[l]=i),t=i}return i=new mn(e),i.jr=o.slice(),t.j[n[a-1]]=i,i}function Js(t){const n=[],e=[];let r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){n.push(e.join(""));for(let a=parseInt(t.substring(r,r+i),10);a>0;a--)e.pop();r+=i}else e.push(t[r]),r++}return n}const zt={defaultProtocol:"http",events:null,format:Gs,formatHref:Gs,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ca(t,n=null){let e=Object.assign({},zt);t&&(e=Object.assign(e,t instanceof ca?t.o:t));const r=e.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=e,n&&(this.defaultRender=n),this.ignoreTags=o}ca.prototype={o:zt,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,n,e){const r=n!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=e.t in o?o[e.t]:zt[t],typeof o=="function"&&r&&(o=o(n,e))):typeof o=="function"&&r&&(o=o(n,e.t,e)),o)},getObj(t,n,e){let r=this.o[t];return typeof r=="function"&&n!=null&&(r=r(n,e.t,e)),r},render(t){const n=t.render(this);return(this.get("render",null,t)||this.defaultRender)(n,t.t,t)}};function Gs(t){return t}function xp(t,n){this.t="token",this.v=t,this.tk=n}xp.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const n=this.toString(),e=t.get("truncate",n,this),r=t.get("format",n,this);return e&&r.length>e?r.substring(0,e)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=zt.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const n=this,e=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",e,this),o=t.get("tagName",e,n),i=this.toFormattedString(t),a={},s=t.get("className",e,n),l=t.get("target",e,n),c=t.get("rel",e,n),d=t.getObj("attributes",e,n),h=t.getObj("events",e,n);return a.href=r,s&&(a.class=s),l&&(a.target=l),c&&(a.rel=c),d&&Object.assign(a,d),{tagName:o,attributes:a,content:i,eventListeners:h}}};function uo(t,n){class e extends xp{constructor(o,i){super(o,i),this.t=t}}for(const r in n)e.prototype[r]=n[r];return e.t=t,e}const Ys=uo("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Qs=uo("text"),py=uo("nl"),Gt=uo("url",{isLink:!0,toHref(t=zt.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Dt&&t[1].t===Gn}}),kn=t=>new mn(t);function hy({groups:t}){const n=t.domain.concat([Rr,Nr,Kn,Fr,Hr,jr,Xr,Vr,wn,ra,ft,Wr,Ur,qr,Dn,Jr,xt,Kr]),e=[Br,Gn,ia,Mn,aa,ft,mt,sa,la,Ir,$r,gt,ut,Cr,_r,Sr,Er,Tr,Mr,Dr,zr,Or,Ar,Lr,Pr],r=[Rr,Br,Nr,Fr,Hr,jr,Xr,Vr,wn,gt,ut,ft,Wr,Ur,qr,mt,Dn,Jr,xt,Kr],o=kn(),i=v(o,xt);R(i,r,i),R(i,t.domain,i);const a=kn(),s=kn(),l=kn();R(o,t.domain,a),R(o,t.scheme,s),R(o,t.slashscheme,l),R(a,r,i),R(a,t.domain,a);const c=v(a,Kn);v(i,Kn,c),v(s,Kn,c),v(l,Kn,c);const d=v(i,Mn);R(d,r,i),R(d,t.domain,i);const h=kn();R(c,t.domain,h),R(h,t.domain,h);const g=v(h,Mn);R(g,t.domain,h);const u=kn(Ys);R(g,t.tld,u),R(g,t.utld,u),v(c,Dt,u);const f=v(h,wn);v(f,wn,f),R(f,t.domain,h),R(u,t.domain,h),v(u,Mn,g),v(u,wn,f);const m=v(u,Gn);R(m,t.numeric,Ys);const x=v(a,wn),b=v(a,Mn);v(x,wn,x),R(x,t.domain,a),R(b,r,i),R(b,t.domain,a);const _=kn(Gt);R(b,t.tld,_),R(b,t.utld,_),R(_,t.domain,a),R(_,r,i),v(_,Mn,b),v(_,wn,x),v(_,Kn,c);const D=v(_,Gn),A=kn(Gt);R(D,t.numeric,A);const L=kn(Gt),H=kn();R(L,n,L),R(L,e,H),R(H,n,L),R(H,e,H),v(_,Dn,L),v(A,Dn,L);const C=v(s,Gn),z=v(l,Gn),F=v(z,Dn),V=v(F,Dn);R(s,t.domain,a),v(s,Mn,b),v(s,wn,x),R(l,t.domain,a),v(l,Mn,b),v(l,wn,x),R(C,t.domain,L),v(C,Dn,L),v(C,mt,L),R(V,t.domain,L),R(V,n,L),v(V,Dn,L);const de=[[gt,ut],[_r,Cr],[Sr,Er],[Ir,$r],[Tr,Mr],[Dr,zr],[Or,Ar],[Lr,Pr]];for(let Ze=0;Ze<de.length;Ze++){const[nt,et]=de[Ze],Nt=v(L,nt);v(H,nt,Nt),v(Nt,et,L);const ze=kn(Gt);R(Nt,n,ze);const tt=kn();R(Nt,e),R(ze,n,ze),R(ze,e,tt),R(tt,n,ze),R(tt,e,tt),v(ze,et,L),v(tt,et,L)}return v(o,Dt,_),v(o,oa,py),{start:o,tokens:fp}}function gy(t,n,e){let r=e.length,o=0,i=[],a=[];for(;o<r;){let s=t,l=null,c=null,d=0,h=null,g=-1;for(;o<r&&!(l=s.go(e[o].t));)a.push(e[o++]);for(;o<r&&(c=l||s.go(e[o].t));)l=null,s=c,s.accepts()?(g=0,h=s):g>=0&&g++,o++,d++;if(g<0)o-=d,o<r&&(a.push(e[o]),o++);else{a.length>0&&(i.push(Xo(Qs,n,a)),a=[]),o-=g,d-=g;const u=h.t,f=e.slice(o-d,o);i.push(Xo(u,n,f))}}return a.length>0&&i.push(Xo(Qs,n,a)),i}function Xo(t,n,e){const r=e[0].s,o=e[e.length-1].e,i=n.slice(r,o);return new t(i,e)}const uy=typeof console<"u"&&console&&console.warn||(()=>{}),fy="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",X={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function my(){return mn.groups={},X.scanner=null,X.parser=null,X.tokenQueue=[],X.pluginQueue=[],X.customSchemes=[],X.initialized=!1,X}function Zs(t,n=!1){if(X.initialized&&uy(`linkifyjs: already initialized - will not register custom scheme "${t}" ${fy}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
21081
21085
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
21082
21086
|
2. Cannot start or end with "-"
|
|
21083
|
-
3. "-" cannot repeat`);X.customSchemes.push([t,n])}function gy(){X.scanner=iy(X.customSchemes);for(let t=0;t<X.tokenQueue.length;t++)X.tokenQueue[t][1]({scanner:X.scanner});X.parser=ly(X.scanner.tokens);for(let t=0;t<X.pluginQueue.length;t++)X.pluginQueue[t][1]({scanner:X.scanner,parser:X.parser});return X.initialized=!0,X}function da(t){return X.initialized||gy(),cy(X.parser.start,t,up(X.scanner.start,t))}da.scan=up;function mp(t,n=null,e=null){if(n&&typeof n=="object"){if(e)throw Error(`linkifyjs: Invalid link type ${n}; must be a string`);e=n,n=null}const r=new ca(e),o=da(t),i=[];for(let a=0;a<o.length;a++){const s=o[a];s.isLink&&(!n||s.t===n)&&r.check(s)&&i.push(s.toFormattedObject(r))}return i}const pa="[\0- -\u2029 ]",uy=new RegExp(pa),fy=new RegExp(`${pa}$`),my=new RegExp(pa,"g");function xy(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function by(t){return new Q({key:new un("autolink"),appendTransaction:(n,e,r)=>{const o=n.some(c=>c.docChanged)&&!e.doc.eq(r.doc),i=n.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;const{tr:a}=r,s=a1(e.doc,[...n]);if(u1(s).forEach(({newRange:c})=>{const d=l1(r.doc,c,u=>u.isTextblock);let h,g;if(d.length>1)h=d[0],g=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(d.length){const u=r.doc.textBetween(c.from,c.to," "," ");if(!fy.test(u))return;h=d[0],g=r.doc.textBetween(h.pos,c.to,void 0," ")}if(h&&g){const u=g.split(uy).filter(Boolean);if(u.length<=0)return!1;const f=u[u.length-1],m=h.pos+g.lastIndexOf(f);if(!f)return!1;const x=da(f).map(b=>b.toObject(t.defaultProtocol));if(!xy(x))return!1;x.filter(b=>b.isLink).map(b=>({...b,from:m+b.start+1,to:m+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>t.validate(b.value)).filter(b=>t.shouldAutoLink(b.value)).forEach(b=>{ea(b.from,b.to,r.doc).some(_=>_.mark.type===t.type)||a.addMark(b.from,b.to,t.type.create({href:b.href}))})}}),!!a.steps.length)return a}})}function yy(t){return new Q({key:new un("handleClickLink"),props:{handleClick:(n,e,r)=>{var o,i;if(r.button!==0||!n.editable)return!1;let a=r.target;const s=[];for(;a.nodeName!=="DIV";)s.push(a),a=a.parentNode;if(!s.find(g=>g.nodeName==="A"))return!1;const l=tp(n.state,t.type.name),c=r.target,d=(o=c==null?void 0:c.href)!==null&&o!==void 0?o:l.href,h=(i=c==null?void 0:c.target)!==null&&i!==void 0?i:l.target;return c&&d?(window.open(d,h),!0):!1}}})}function vy(t){return new Q({key:new un("handlePasteLink"),props:{handlePaste:(n,e,r)=>{const{state:o}=n,{selection:i}=o,{empty:a}=i;if(a)return!1;let s="";r.content.forEach(c=>{s+=c.textContent});const l=mp(s,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===s);return!s||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}function pe(t,n){const e=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return n&&n.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&e.push(o)}),!t||t.replace(my,"").match(new RegExp(`^(?:(?:${e.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const ky=Ln.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Ys(t);return}Ys(t.scheme,t.optionalSlashes)})},onDestroy(){hy()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,n)=>!!pe(t,n.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const n=t.getAttribute("href");return!n||!this.options.isAllowedUri(n,{defaultValidate:e=>!!pe(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:n=>!!pe(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",tn(this.options.HTMLAttributes,t),0]:["a",tn(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:n})=>{const{href:e}=t;return this.options.isAllowedUri(e,{defaultValidate:r=>!!pe(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?n().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:n})=>{const{href:e}=t;return this.options.isAllowedUri(e,{defaultValidate:r=>!!pe(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?n().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[$e({find:t=>{const n=[];if(t){const{protocols:e,defaultProtocol:r}=this.options,o=mp(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:a=>!!pe(a,e),protocols:e,defaultProtocol:r}));o.length&&o.forEach(i=>n.push({text:i.value,data:{href:i.href},index:i.start}))}return n},type:this.type,getAttributes:t=>{var n;return{href:(n=t.data)===null||n===void 0?void 0:n.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:n,defaultProtocol:e}=this.options;return this.options.autolink&&t.push(by({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!pe(o,n),protocols:n,defaultProtocol:e}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(yy({type:this.type})),this.options.linkOnPaste&&t.push(vy({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),wy=ln.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Q({key:new un("placeholder"),props:{decorations:({doc:t,selection:n})=>{const e=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=n,o=[];if(!e)return null;const i=this.editor.isEmpty;return t.descendants((a,s)=>{const l=r>=s&&r<=s+a.nodeSize,c=!a.isLeaf&&go(a);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];i&&d.push(this.options.emptyEditorClass);const h=vn.node(s,s+a.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:s,hasAnchor:l}):this.options.placeholder});o.push(h)}return this.options.includeChildren}),G.create(t,o)}}})]}}),_y=ln.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(n=>n!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const n=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=n.textBetween(0,n.content.size,void 0," ");return this.options.textCounter(r)}return n.nodeSize},this.storage.words=t=>{const n=(t==null?void 0:t.node)||this.editor.state.doc,e=n.textBetween(0,n.content.size," "," ");return this.options.wordCounter(e)}},addProseMirrorPlugins(){let t=!1;return[new Q({key:new un("characterCount"),appendTransaction:(n,e,r)=>{if(t)return;const o=this.options.limit;if(o==null||o===0){t=!0;return}const i=this.storage.characters({node:r.doc});if(i>o){const a=i-o,s=0,l=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(s,l);return t=!0,c}t=!0},filterTransaction:(n,e)=>{const r=this.options.limit;if(!n.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:e.doc}),i=this.storage.characters({node:n.doc});if(i<=r||o>r&&i>r&&i<=o)return!0;if(o>r&&i>r&&i>o||!n.getMeta("paste"))return!1;const s=n.selection.$head.pos,l=i-r,c=s-l,d=s;return n.deleteRange(c,d),!(this.storage.characters({node:n.doc})>r)}})]}}),Cy={paragraph:"p","heading-one":"h1","heading-two":"h2","heading-three":"h3","heading-four":"h4","heading-five":"h5","heading-six":"h6","bulleted-list":"ul","numbered-list":"ol","list-item":"li","block-quote":"blockquote","code-block":"pre",quote:"blockquote",code:"pre","unordered-list":"ul","ordered-list":"ol",list_item:"li"},Sy={bold:t=>`<strong>${t}</strong>`,italic:t=>`<em>${t}</em>`,underline:t=>`<u>${t}</u>`,strikethrough:t=>`<s>${t}</s>`,"strike-through":t=>`<s>${t}</s>`,strike:t=>`<s>${t}</s>`,code:t=>`<code>${t}</code>`,superscript:t=>`<sup>${t}</sup>`,subscript:t=>`<sub>${t}</sub>`};function Gr(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Qs(t,n){return!n||n.length===0?t:n.reduce((e,r)=>{const o=Sy[r.type];return o?o(e):e},t)}function Vo(t){if(t.leaves&&t.leaves.length>0)return t.leaves.map(e=>{const r=Gr(e.text||"");return Qs(r,e.marks||[])}).join("");const n=Gr(t.text||"");return Qs(n,t.marks||[])}function Zs(t){var n,e,r;const o=ha(t.nodes||[]);switch(t.type){case"link":{const i=((n=t.data)===null||n===void 0?void 0:n.href)||((e=t.data)===null||e===void 0?void 0:e.url)||"#",a=((r=t.data)===null||r===void 0?void 0:r.target)||"",s=a?` target="${Gr(a)}"`:"";return`<a href="${Gr(i)}"${s}>${o}</a>`}case"mention":return`<span class="mention">${o}</span>`;default:return o}}function nl(t){const n=ha(t.nodes||[]),e=Cy[t.type];return t.type==="code-block"||t.type==="code"?`<pre><code>${n}</code></pre>`:e?`<${e}>${n}</${e}>`:`<div>${n}</div>`}function ha(t){return!t||t.length===0?"":t.map(n=>{switch(n.object){case"text":return Vo(n);case"inline":return Zs(n);case"block":return nl(n);default:return n.type?n.text!==void 0?Vo(n):["link","mention"].includes(n.type)?Zs(n):nl(n):n.text!==void 0?Vo(n):""}}).join("")}function Ey(t){if(!t)return"";const n=t.document!==void 0?t.document:t;return!n||!n.nodes||n.nodes.length===0?"":ha(n.nodes)}function el(t){if(!t||typeof t!="string")return"";try{const n=JSON.parse(t);return Ey(n)}catch{return console.warn("[xplor-rich-text-editor] Failed to parse legacy Slate document JSON:",t),""}}const Iy=`@tailwind base;
|
|
21087
|
+
3. "-" cannot repeat`);X.customSchemes.push([t,n])}function xy(){X.scanner=cy(X.customSchemes);for(let t=0;t<X.tokenQueue.length;t++)X.tokenQueue[t][1]({scanner:X.scanner});X.parser=hy(X.scanner.tokens);for(let t=0;t<X.pluginQueue.length;t++)X.pluginQueue[t][1]({scanner:X.scanner,parser:X.parser});return X.initialized=!0,X}function da(t){return X.initialized||xy(),gy(X.parser.start,t,mp(X.scanner.start,t))}da.scan=mp;function bp(t,n=null,e=null){if(n&&typeof n=="object"){if(e)throw Error(`linkifyjs: Invalid link type ${n}; must be a string`);e=n,n=null}const r=new ca(e),o=da(t),i=[];for(let a=0;a<o.length;a++){const s=o[a];s.isLink&&(!n||s.t===n)&&r.check(s)&&i.push(s.toFormattedObject(r))}return i}const pa="[\0- -\u2029 ]",by=new RegExp(pa),yy=new RegExp(`${pa}$`),vy=new RegExp(pa,"g");function ky(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function wy(t){return new Q({key:new un("autolink"),appendTransaction:(n,e,r)=>{const o=n.some(c=>c.docChanged)&&!e.doc.eq(r.doc),i=n.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;const{tr:a}=r,s=d1(e.doc,[...n]);if(b1(s).forEach(({newRange:c})=>{const d=h1(r.doc,c,u=>u.isTextblock);let h,g;if(d.length>1)h=d[0],g=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(d.length){const u=r.doc.textBetween(c.from,c.to," "," ");if(!yy.test(u))return;h=d[0],g=r.doc.textBetween(h.pos,c.to,void 0," ")}if(h&&g){const u=g.split(by).filter(Boolean);if(u.length<=0)return!1;const f=u[u.length-1],m=h.pos+g.lastIndexOf(f);if(!f)return!1;const x=da(f).map(b=>b.toObject(t.defaultProtocol));if(!ky(x))return!1;x.filter(b=>b.isLink).map(b=>({...b,from:m+b.start+1,to:m+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>t.validate(b.value)).filter(b=>t.shouldAutoLink(b.value)).forEach(b=>{ea(b.from,b.to,r.doc).some(_=>_.mark.type===t.type)||a.addMark(b.from,b.to,t.type.create({href:b.href}))})}}),!!a.steps.length)return a}})}function _y(t){return new Q({key:new un("handleClickLink"),props:{handleClick:(n,e,r)=>{var o,i;if(r.button!==0||!n.editable)return!1;let a=r.target;const s=[];for(;a.nodeName!=="DIV";)s.push(a),a=a.parentNode;if(!s.find(g=>g.nodeName==="A"))return!1;const l=op(n.state,t.type.name),c=r.target,d=(o=c==null?void 0:c.href)!==null&&o!==void 0?o:l.href,h=(i=c==null?void 0:c.target)!==null&&i!==void 0?i:l.target;return c&&d?(window.open(d,h),!0):!1}}})}function Cy(t){return new Q({key:new un("handlePasteLink"),props:{handlePaste:(n,e,r)=>{const{state:o}=n,{selection:i}=o,{empty:a}=i;if(a)return!1;let s="";r.content.forEach(c=>{s+=c.textContent});const l=bp(s,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===s);return!s||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}function pe(t,n){const e=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return n&&n.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&e.push(o)}),!t||t.replace(vy,"").match(new RegExp(`^(?:(?:${e.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Sy=Ln.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Zs(t);return}Zs(t.scheme,t.optionalSlashes)})},onDestroy(){my()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,n)=>!!pe(t,n.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const n=t.getAttribute("href");return!n||!this.options.isAllowedUri(n,{defaultValidate:e=>!!pe(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:n=>!!pe(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",tn(this.options.HTMLAttributes,t),0]:["a",tn(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:n})=>{const{href:e}=t;return this.options.isAllowedUri(e,{defaultValidate:r=>!!pe(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?n().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:n})=>{const{href:e}=t;return this.options.isAllowedUri(e,{defaultValidate:r=>!!pe(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?n().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Te({find:t=>{const n=[];if(t){const{protocols:e,defaultProtocol:r}=this.options,o=bp(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:a=>!!pe(a,e),protocols:e,defaultProtocol:r}));o.length&&o.forEach(i=>n.push({text:i.value,data:{href:i.href},index:i.start}))}return n},type:this.type,getAttributes:t=>{var n;return{href:(n=t.data)===null||n===void 0?void 0:n.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:n,defaultProtocol:e}=this.options;return this.options.autolink&&t.push(wy({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!pe(o,n),protocols:n,defaultProtocol:e}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(_y({type:this.type})),this.options.linkOnPaste&&t.push(Cy({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),Ey=ln.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Q({key:new un("placeholder"),props:{decorations:({doc:t,selection:n})=>{const e=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=n,o=[];if(!e)return null;const i=this.editor.isEmpty;return t.descendants((a,s)=>{const l=r>=s&&r<=s+a.nodeSize,c=!a.isLeaf&&go(a);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];i&&d.push(this.options.emptyEditorClass);const h=vn.node(s,s+a.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:s,hasAnchor:l}):this.options.placeholder});o.push(h)}return this.options.includeChildren}),G.create(t,o)}}})]}}),Iy=ln.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(n=>n!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const n=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=n.textBetween(0,n.content.size,void 0," ");return this.options.textCounter(r)}return n.nodeSize},this.storage.words=t=>{const n=(t==null?void 0:t.node)||this.editor.state.doc,e=n.textBetween(0,n.content.size," "," ");return this.options.wordCounter(e)}},addProseMirrorPlugins(){let t=!1;return[new Q({key:new un("characterCount"),appendTransaction:(n,e,r)=>{if(t)return;const o=this.options.limit;if(o==null||o===0){t=!0;return}const i=this.storage.characters({node:r.doc});if(i>o){const a=i-o,s=0,l=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(s,l);return t=!0,c}t=!0},filterTransaction:(n,e)=>{const r=this.options.limit;if(!n.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:e.doc}),i=this.storage.characters({node:n.doc});if(i<=r||o>r&&i>r&&i<=o)return!0;if(o>r&&i>r&&i>o||!n.getMeta("paste"))return!1;const s=n.selection.$head.pos,l=i-r,c=s-l,d=s;return n.deleteRange(c,d),!(this.storage.characters({node:n.doc})>r)}})]}}),$y={paragraph:"p","heading-one":"h1","heading-two":"h2","heading-three":"h3","heading-four":"h4","heading-five":"h5","heading-six":"h6","bulleted-list":"ul","numbered-list":"ol","list-item":"li","block-quote":"blockquote","code-block":"pre",quote:"blockquote",code:"pre","unordered-list":"ul","ordered-list":"ol",list_item:"li"},Ty={bold:t=>`<strong>${t}</strong>`,italic:t=>`<em>${t}</em>`,underline:t=>`<u>${t}</u>`,strikethrough:t=>`<s>${t}</s>`,"strike-through":t=>`<s>${t}</s>`,strike:t=>`<s>${t}</s>`,code:t=>`<code>${t}</code>`,superscript:t=>`<sup>${t}</sup>`,subscript:t=>`<sub>${t}</sub>`};function Gr(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function nl(t,n){return!n||n.length===0?t:n.reduce((e,r)=>{const o=Ty[r.type];return o?o(e):e},t)}function Vo(t){if(t.leaves&&t.leaves.length>0)return t.leaves.map(e=>{const r=Gr(e.text||"");return nl(r,e.marks||[])}).join("");const n=Gr(t.text||"");return nl(n,t.marks||[])}function el(t){var n,e,r;const o=ha(t.nodes||[]);switch(t.type){case"link":{const i=((n=t.data)===null||n===void 0?void 0:n.href)||((e=t.data)===null||e===void 0?void 0:e.url)||"#",a=((r=t.data)===null||r===void 0?void 0:r.target)||"",s=a?` target="${Gr(a)}"`:"";return`<a href="${Gr(i)}"${s}>${o}</a>`}case"mention":return`<span class="mention">${o}</span>`;default:return o}}function tl(t){const n=ha(t.nodes||[]),e=$y[t.type];return t.type==="code-block"||t.type==="code"?`<pre><code>${n}</code></pre>`:e?`<${e}>${n}</${e}>`:`<div>${n}</div>`}function ha(t){return!t||t.length===0?"":t.map(n=>{switch(n.object){case"text":return Vo(n);case"inline":return el(n);case"block":return tl(n);default:return n.type?n.text!==void 0?Vo(n):["link","mention"].includes(n.type)?el(n):tl(n):n.text!==void 0?Vo(n):""}}).join("")}function My(t){if(!t)return"";const n=t.document!==void 0?t.document:t;return!n||!n.nodes||n.nodes.length===0?"":ha(n.nodes)}function rl(t){if(!t||typeof t!="string")return"";try{const n=JSON.parse(t);return My(n)}catch{return console.warn("[xplor-rich-text-editor] Failed to parse legacy Slate document JSON:",t),""}}const Dy=`@tailwind base;
|
|
21084
21088
|
@tailwind components;
|
|
21085
21089
|
@tailwind utilities;
|
|
21086
21090
|
@layer base {
|
|
@@ -22492,7 +22496,7 @@ ol.mdc-list.sc-xplor-rich-text-editor li.mdc-list-item.sc-xplor-rich-text-editor
|
|
|
22492
22496
|
--rte-btn-hover-bg: var(--color-gray-700, #616161);
|
|
22493
22497
|
--rte-btn-active-bg: rgba(0, 132, 128, 0.2);
|
|
22494
22498
|
--rte-placeholder-color: var(--color-gray-600, #757575);
|
|
22495
|
-
}`;let Ty=0;const xp=M(class extends ${constructor(){super(),this.__registerHost(),this.xplorChange=k(this,"xplorChange"),this.xplorFocus=k(this,"xplorFocus"),this.xplorBlur=k(this,"xplorBlur"),this.editor=null,this.editorId=`xplor-rte-${++Ty}`,this.toolbarId=`${this.editorId}-toolbar`,this.charCountId=`${this.editorId}-char-count`,this.labelId=`${this.editorId}-label`,this.value="",this.legacySlateDocument="",this.placeholder="Start typing…",this.label="",this.required=!1,this.readonly=!1,this.disabled=!1,this.ariaLabel="",this.ariaLabelledBy="",this.toolbar="full",this.maxLength=void 0,this.error="",this.helperText="",this.editorVersion=0,this.isFocused=!1,this.showLinkPopover=!1,this.linkUrl="",this.charCount=0,this.handleLinkButtonClick=n=>{n.preventDefault(),!(!this.editor||this.disabled||this.readonly)&&(this.editor.isActive("link")?this.editor.chain().focus().extendMarkRange("link").unsetLink().run():(this.linkUrl=this.editor.getAttributes("link").href||"",this.showLinkPopover=!this.showLinkPopover))},this.handleLinkSubmit=n=>{if(n.preventDefault(),!this.editor)return;const e=this.linkUrl.trim();e?this.editor.chain().focus().extendMarkRange("link").setLink({href:e}).run():this.editor.chain().focus().extendMarkRange("link").unsetLink().run(),this.showLinkPopover=!1,this.linkUrl=""},this.handleLinkCancel=()=>{this.showLinkPopover=!1,this.linkUrl=""},this.handleLinkKeyDown=n=>{n.key==="Escape"&&(this.showLinkPopover=!1,this.linkUrl="")}}componentDidLoad(){this.initEditor()}disconnectedCallback(){var n;(n=this.editor)===null||n===void 0||n.destroy(),this.editor=null}handleValueChange(n){this.editor&&this.editor.getHTML()!==n&&this.editor.commands.setContent(n||"",!1)}handleReadonlyChange(){var n;(n=this.editor)===null||n===void 0||n.setEditable(!this.readonly&&!this.disabled)}handleDisabledChange(){var n;(n=this.editor)===null||n===void 0||n.setEditable(!this.readonly&&!this.disabled)}handleLegacyDocChange(n){if(!n||!this.editor)return;const e=el(n);this.editor.commands.setContent(e,!1)}async getHTMLContent(){var n,e;return(e=(n=this.editor)===null||n===void 0?void 0:n.getHTML())!==null&&e!==void 0?e:""}async getText(){var n,e;return(e=(n=this.editor)===null||n===void 0?void 0:n.getText())!==null&&e!==void 0?e:""}async setContent(n){var e;(e=this.editor)===null||e===void 0||e.commands.setContent(n,!1)}async clearContent(){var n;(n=this.editor)===null||n===void 0||n.commands.clearContent(!0)}async focusEditor(){var n;(n=this.editor)===null||n===void 0||n.commands.focus()}initEditor(){var n,e,r;let o="";this.legacySlateDocument?o=el(this.legacySlateDocument):this.value&&(o=this.value);const i=[J5,G5,ky.configure({openOnClick:!1,autolink:!0}),wy.configure({placeholder:this.placeholder})];this.maxLength!=null&&i.push(_y.configure({limit:this.maxLength})),this.editor=new q1({element:this.editorEl,extensions:i,content:o,editable:!this.readonly&&!this.disabled,onUpdate:({editor:a})=>{var s,l,c;const d=a.getHTML();this.value=d,this.maxLength!=null&&(this.charCount=(c=(l=(s=a.storage)===null||s===void 0?void 0:s.characterCount)===null||l===void 0?void 0:l.characters())!==null&&c!==void 0?c:0),this.xplorChange.emit({html:d,text:a.getText(),isEmpty:a.isEmpty})},onFocus:()=>{this.isFocused=!0,this.xplorFocus.emit()},onBlur:()=>{this.isFocused=!1,this.showLinkPopover=!1,this.xplorBlur.emit()},onTransaction:()=>{this.editorVersion+=1},onSelectionUpdate:()=>{this.editorVersion+=1}}),this.maxLength!=null&&(this.charCount=(r=(e=(n=this.editor.storage)===null||n===void 0?void 0:n.characterCount)===null||e===void 0?void 0:e.characters())!==null&&r!==void 0?r:0)}execCommand(n,e){e.preventDefault(),!(!this.editor||this.disabled||this.readonly)&&n()}renderToolbarButton(n,e,r,o){return p("button",{type:"button",class:{"xplor-rte__toolbar-btn":!0,"xplor-rte__toolbar-btn--active":e},"aria-label":n,"aria-pressed":String(e),title:n,disabled:this.disabled||this.readonly,onClick:r},o)}renderLinkPopover(){return p("div",{class:"xplor-rte__link-popover",role:"dialog","aria-label":"Insert link","aria-modal":"false"},p("form",{onSubmit:this.handleLinkSubmit,class:"xplor-rte__link-form"},p("label",{class:"xplor-rte__link-label",htmlFor:`${this.editorId}-link-input`},"URL"),p("input",{id:`${this.editorId}-link-input`,class:"xplor-rte__link-input",type:"url",placeholder:"https://example.com",value:this.linkUrl,onInput:n=>{this.linkUrl=n.target.value},onKeyDown:this.handleLinkKeyDown,autoFocus:!0}),p("div",{class:"xplor-rte__link-actions"},p("button",{type:"submit",class:"xplor-rte__link-apply"},"Apply"),p("button",{type:"button",class:"xplor-rte__link-cancel",onClick:this.handleLinkCancel},"Cancel"))))}renderToolbar(){if(this.toolbar==="none"||!this.editor)return null;const n=this.editor,e=this.toolbar==="minimal",r=p("div",{class:"xplor-rte__toolbar-group",role:"group","aria-label":"Text style"},this.renderToolbarButton("Bold (Ctrl+B)",n.isActive("bold"),o=>this.execCommand(()=>n.chain().focus().toggleBold().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M15.6 11.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5S13.83 9.5 13 9.5h-3V6.5zm3.5 9H10V13h3.5c.83 0 1.5.67 1.5 1.5S14.33 15.5 13.5 15.5z"}))),this.renderToolbarButton("Italic (Ctrl+I)",n.isActive("italic"),o=>this.execCommand(()=>n.chain().focus().toggleItalic().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}))),this.renderToolbarButton("Underline (Ctrl+U)",n.isActive("underline"),o=>this.execCommand(()=>n.chain().focus().toggleUnderline().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"}))),this.renderToolbarButton("Strikethrough",n.isActive("strike"),o=>this.execCommand(()=>n.chain().focus().toggleStrike().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M6.85 7.08C6.85 4.37 9.45 3 12.24 3c1.64 0 3 .49 3.9 1.28.77.65 1.46 1.73 1.46 3.24h-3.01c0-.31-.05-.59-.15-.85-.29-.86-1.2-1.28-2.25-1.28-1.86 0-2.34.92-2.34 1.69 0 .48.25.88.74 1.21L13.25 9H7.39c-.21-.28-.54-.71-.54-1.92zM21 12v-2H3v2h9.62c1.15.45 1.96.75 1.96 1.97 0 1-.81 1.67-2.28 1.67-1.54 0-2.93-.54-2.93-2.51H7.4c0 1.97.93 5.15 5.85 5.15 3.47 0 5.37-1.96 5.37-4.15 0-.87-.23-1.58-.62-2.13z"}))),this.renderToolbarButton("Inline code",n.isActive("code"),o=>this.execCommand(()=>n.chain().focus().toggleCode().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}))));return e?p("div",{id:this.toolbarId,class:"xplor-rte__toolbar",role:"toolbar","aria-label":"Text formatting","aria-controls":this.editorId},r):p("div",{id:this.toolbarId,class:"xplor-rte__toolbar",role:"toolbar","aria-label":"Text formatting","aria-controls":this.editorId},r,p("div",{class:"xplor-rte__toolbar-divider","aria-hidden":"true"}),p("div",{class:"xplor-rte__toolbar-group",role:"group","aria-label":"Headings"},[1,2,3].map(o=>this.renderToolbarButton(`Heading ${o}`,n.isActive("heading",{level:o}),i=>this.execCommand(()=>n.chain().focus().toggleHeading({level:o}).run(),i),p("span",{class:"xplor-rte__toolbar-text","aria-hidden":"true"},"H",o)))),p("div",{class:"xplor-rte__toolbar-divider","aria-hidden":"true"}),p("div",{class:"xplor-rte__toolbar-group",role:"group","aria-label":"Lists"},this.renderToolbarButton("Bullet list",n.isActive("bulletList"),o=>this.execCommand(()=>n.chain().focus().toggleBulletList().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"}))),this.renderToolbarButton("Numbered list",n.isActive("orderedList"),o=>this.execCommand(()=>n.chain().focus().toggleOrderedList().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"})))),p("div",{class:"xplor-rte__toolbar-divider","aria-hidden":"true"}),p("div",{class:"xplor-rte__toolbar-group",role:"group","aria-label":"Block elements"},this.renderToolbarButton("Blockquote",n.isActive("blockquote"),o=>this.execCommand(()=>n.chain().focus().toggleBlockquote().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"}))),this.renderToolbarButton("Code block",n.isActive("codeBlock"),o=>this.execCommand(()=>n.chain().focus().toggleCodeBlock().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M20 3H4v10c0 2.21 1.79 4 4 4h6c2.21 0 4-1.79 4-4v-3h2c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2zm0 5h-2V5h2v3zM4 19h16v2H4z"})))),p("div",{class:"xplor-rte__toolbar-divider","aria-hidden":"true"}),p("div",{class:"xplor-rte__toolbar-group",role:"group","aria-label":"Insert and utilities"},p("div",{class:"xplor-rte__link-wrapper"},this.renderToolbarButton(n.isActive("link")?"Remove link":"Insert link",n.isActive("link"),this.handleLinkButtonClick,p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"}))),this.showLinkPopover&&this.renderLinkPopover()),this.renderToolbarButton("Clear formatting",!1,o=>this.execCommand(()=>n.chain().focus().clearNodes().unsetAllMarks().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M6 19h4v-2H6v2zM3 5v2h18V5H3zm3 9h7v-2H6v2zm10.88-3.36L18.3 9.2l1.41 1.41-1.42 1.43 1.42 1.41-1.41 1.41-1.42-1.41-1.41 1.41-1.41-1.41 1.41-1.41-1.41-1.43 1.41-1.41 1.41 1.43z"})))))}render(){const n=!!this.error,e=this.maxLength!=null,o=(e?this.charCountId:void 0)||void 0,i=this.ariaLabelledBy||(this.label?this.labelId:void 0),a=i?void 0:this.ariaLabel||"Rich text editor",s={"xplor-rte":!0,"xplor-rte--focused":this.isFocused,"xplor-rte--disabled":this.disabled,"xplor-rte--readonly":this.readonly,"xplor-rte--error":n,"xplor-rte--has-toolbar":this.toolbar!=="none"};return p(E,{key:"d15876a85220e846333352ee11c52960a17341be"},this.label&&p("label",{key:"ecc7035c2cb8543b4c7447b2aa6665f53260959a",class:"xplor-rte__label",id:this.labelId,htmlFor:this.editorId},this.label,this.required&&p("span",{key:"8c5e9b8eb1efe34faa289748e8393a3261099489",class:"xplor-rte__required","aria-hidden":"true"}," ","*")),p("div",{key:"bd0b1c75612f26d7f7ee13cfcec584ebf6349f3a",class:s},this.renderToolbar(),p("div",{key:"ec047a31509004185b3be5abaa939a0278e86243",class:"xplor-rte__content",id:this.editorId,ref:l=>{this.editorEl=l},"aria-label":a,"aria-labelledby":i,"aria-multiline":"true","aria-readonly":this.readonly?"true":void 0,"aria-disabled":this.disabled?"true":void 0,"aria-required":this.required?"true":void 0,"aria-describedby":o,"aria-invalid":n?"true":void 0}),e&&p("div",{key:"4b7806ebfe4356fcfbf71192385875897dbba4fa",id:this.charCountId,class:{"xplor-rte__char-count":!0,"xplor-rte__char-count--limit":this.charCount>=this.maxLength},role:"status","aria-live":"polite","aria-atomic":"true"},this.charCount," / ",this.maxLength)),n&&p("div",{key:"b2892869df2c26f02158d30d8bf6ee239e503de3",class:"xplor-rte__error",role:"alert","aria-live":"assertive"},this.error),!n&&this.helperText&&p("div",{key:"ca2eb4562b4d514f6602b915ef76e85dc8dc6b02",class:"xplor-rte__helper"},this.helperText))}get el(){return this}static get watchers(){return{value:["handleValueChange"],readonly:["handleReadonlyChange"],disabled:["handleDisabledChange"],legacySlateDocument:["handleLegacyDocChange"]}}static get style(){return Iy}},[2,"xplor-rich-text-editor",{value:[1025],legacySlateDocument:[1,"legacy-slate-document"],placeholder:[1],label:[1],required:[4],readonly:[4],disabled:[4],ariaLabel:[1,"aria-label"],ariaLabelledBy:[1,"aria-labelled-by"],toolbar:[1],maxLength:[2,"max-length"],error:[1],helperText:[1,"helper-text"],editorVersion:[32],isFocused:[32],showLinkPopover:[32],linkUrl:[32],charCount:[32],getHTMLContent:[64],getText:[64],setContent:[64],clearContent:[64],focusEditor:[64]},void 0,{value:["handleValueChange"],readonly:["handleReadonlyChange"],disabled:["handleDisabledChange"],legacySlateDocument:["handleLegacyDocChange"]}]);function $y(){if(typeof customElements>"u")return;["xplor-rich-text-editor"].forEach(n=>{switch(n){case"xplor-rich-text-editor":customElements.get(n)||customElements.define(n,xp);break}})}const My=xp,zy=$y,Dy=`@tailwind base;
|
|
22499
|
+
}`;let zy=0;const yp=M(class extends T{constructor(){super(),this.__registerHost(),this.xplorChange=k(this,"xplorChange"),this.xplorFocus=k(this,"xplorFocus"),this.xplorBlur=k(this,"xplorBlur"),this.editor=null,this.editorId=`xplor-rte-${++zy}`,this.toolbarId=`${this.editorId}-toolbar`,this.charCountId=`${this.editorId}-char-count`,this.labelId=`${this.editorId}-label`,this.value="",this.legacySlateDocument="",this.placeholder="Start typing…",this.label="",this.required=!1,this.readonly=!1,this.disabled=!1,this.ariaLabel="",this.ariaLabelledBy="",this.toolbar="full",this.maxLength=void 0,this.error="",this.helperText="",this.editorVersion=0,this.isFocused=!1,this.showLinkPopover=!1,this.linkUrl="",this.charCount=0,this.handleLinkButtonClick=n=>{n.preventDefault(),!(!this.editor||this.disabled||this.readonly)&&(this.editor.isActive("link")?this.editor.chain().focus().extendMarkRange("link").unsetLink().run():(this.linkUrl=this.editor.getAttributes("link").href||"",this.showLinkPopover=!this.showLinkPopover))},this.handleLinkSubmit=n=>{if(n.preventDefault(),!this.editor)return;const e=this.linkUrl.trim();e?this.editor.chain().focus().extendMarkRange("link").setLink({href:e}).run():this.editor.chain().focus().extendMarkRange("link").unsetLink().run(),this.showLinkPopover=!1,this.linkUrl=""},this.handleLinkCancel=()=>{this.showLinkPopover=!1,this.linkUrl=""},this.handleLinkKeyDown=n=>{n.key==="Escape"&&(this.showLinkPopover=!1,this.linkUrl="")}}componentDidLoad(){this.initEditor()}disconnectedCallback(){var n;(n=this.editor)===null||n===void 0||n.destroy(),this.editor=null}handleValueChange(n){this.editor&&this.editor.getHTML()!==n&&this.editor.commands.setContent(n||"",!1)}handleReadonlyChange(){var n;(n=this.editor)===null||n===void 0||n.setEditable(!this.readonly&&!this.disabled)}handleDisabledChange(){var n;(n=this.editor)===null||n===void 0||n.setEditable(!this.readonly&&!this.disabled)}handleLegacyDocChange(n){if(!n||!this.editor)return;const e=rl(n);this.editor.commands.setContent(e,!1)}async getHTMLContent(){var n,e;return(e=(n=this.editor)===null||n===void 0?void 0:n.getHTML())!==null&&e!==void 0?e:""}async getText(){var n,e;return(e=(n=this.editor)===null||n===void 0?void 0:n.getText())!==null&&e!==void 0?e:""}async setContent(n){var e;(e=this.editor)===null||e===void 0||e.commands.setContent(n,!1)}async clearContent(){var n;(n=this.editor)===null||n===void 0||n.commands.clearContent(!0)}async focusEditor(){var n;(n=this.editor)===null||n===void 0||n.commands.focus()}initEditor(){var n,e,r;let o="";this.legacySlateDocument?o=rl(this.legacySlateDocument):this.value&&(o=this.value);const i=[Z5,ny,Sy.configure({openOnClick:!1,autolink:!0}),Ey.configure({placeholder:this.placeholder})];this.maxLength!=null&&i.push(Iy.configure({limit:this.maxLength})),this.editor=new Y1({element:this.editorEl,extensions:i,content:o,editable:!this.readonly&&!this.disabled,onUpdate:({editor:a})=>{var s,l,c;const d=a.getHTML();this.value=d,this.maxLength!=null&&(this.charCount=(c=(l=(s=a.storage)===null||s===void 0?void 0:s.characterCount)===null||l===void 0?void 0:l.characters())!==null&&c!==void 0?c:0),this.xplorChange.emit({html:d,text:a.getText(),isEmpty:a.isEmpty})},onFocus:()=>{this.isFocused=!0,this.xplorFocus.emit()},onBlur:()=>{this.isFocused=!1,this.showLinkPopover=!1,this.xplorBlur.emit()},onTransaction:()=>{this.editorVersion+=1},onSelectionUpdate:()=>{this.editorVersion+=1}}),this.maxLength!=null&&(this.charCount=(r=(e=(n=this.editor.storage)===null||n===void 0?void 0:n.characterCount)===null||e===void 0?void 0:e.characters())!==null&&r!==void 0?r:0)}execCommand(n,e){e.preventDefault(),!(!this.editor||this.disabled||this.readonly)&&n()}renderToolbarButton(n,e,r,o){return p("button",{type:"button",class:{"xplor-rte__toolbar-btn":!0,"xplor-rte__toolbar-btn--active":e},"aria-label":n,"aria-pressed":String(e),title:n,disabled:this.disabled||this.readonly,onClick:r},o)}renderLinkPopover(){return p("div",{class:"xplor-rte__link-popover",role:"dialog","aria-label":"Insert link","aria-modal":"false"},p("form",{onSubmit:this.handleLinkSubmit,class:"xplor-rte__link-form"},p("label",{class:"xplor-rte__link-label",htmlFor:`${this.editorId}-link-input`},"URL"),p("input",{id:`${this.editorId}-link-input`,class:"xplor-rte__link-input",type:"url",placeholder:"https://example.com",value:this.linkUrl,onInput:n=>{this.linkUrl=n.target.value},onKeyDown:this.handleLinkKeyDown,autoFocus:!0}),p("div",{class:"xplor-rte__link-actions"},p("button",{type:"submit",class:"xplor-rte__link-apply"},"Apply"),p("button",{type:"button",class:"xplor-rte__link-cancel",onClick:this.handleLinkCancel},"Cancel"))))}renderToolbar(){if(this.toolbar==="none"||!this.editor)return null;const n=this.editor,e=this.toolbar==="minimal",r=p("div",{class:"xplor-rte__toolbar-group",role:"group","aria-label":"Text style"},this.renderToolbarButton("Bold (Ctrl+B)",n.isActive("bold"),o=>this.execCommand(()=>n.chain().focus().toggleBold().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M15.6 11.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5S13.83 9.5 13 9.5h-3V6.5zm3.5 9H10V13h3.5c.83 0 1.5.67 1.5 1.5S14.33 15.5 13.5 15.5z"}))),this.renderToolbarButton("Italic (Ctrl+I)",n.isActive("italic"),o=>this.execCommand(()=>n.chain().focus().toggleItalic().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}))),this.renderToolbarButton("Underline (Ctrl+U)",n.isActive("underline"),o=>this.execCommand(()=>n.chain().focus().toggleUnderline().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"}))),this.renderToolbarButton("Strikethrough",n.isActive("strike"),o=>this.execCommand(()=>n.chain().focus().toggleStrike().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M6.85 7.08C6.85 4.37 9.45 3 12.24 3c1.64 0 3 .49 3.9 1.28.77.65 1.46 1.73 1.46 3.24h-3.01c0-.31-.05-.59-.15-.85-.29-.86-1.2-1.28-2.25-1.28-1.86 0-2.34.92-2.34 1.69 0 .48.25.88.74 1.21L13.25 9H7.39c-.21-.28-.54-.71-.54-1.92zM21 12v-2H3v2h9.62c1.15.45 1.96.75 1.96 1.97 0 1-.81 1.67-2.28 1.67-1.54 0-2.93-.54-2.93-2.51H7.4c0 1.97.93 5.15 5.85 5.15 3.47 0 5.37-1.96 5.37-4.15 0-.87-.23-1.58-.62-2.13z"}))),this.renderToolbarButton("Inline code",n.isActive("code"),o=>this.execCommand(()=>n.chain().focus().toggleCode().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}))));return e?p("div",{id:this.toolbarId,class:"xplor-rte__toolbar",role:"toolbar","aria-label":"Text formatting","aria-controls":this.editorId},r):p("div",{id:this.toolbarId,class:"xplor-rte__toolbar",role:"toolbar","aria-label":"Text formatting","aria-controls":this.editorId},r,p("div",{class:"xplor-rte__toolbar-divider","aria-hidden":"true"}),p("div",{class:"xplor-rte__toolbar-group",role:"group","aria-label":"Headings"},[1,2,3].map(o=>this.renderToolbarButton(`Heading ${o}`,n.isActive("heading",{level:o}),i=>this.execCommand(()=>n.chain().focus().toggleHeading({level:o}).run(),i),p("span",{class:"xplor-rte__toolbar-text","aria-hidden":"true"},"H",o)))),p("div",{class:"xplor-rte__toolbar-divider","aria-hidden":"true"}),p("div",{class:"xplor-rte__toolbar-group",role:"group","aria-label":"Lists"},this.renderToolbarButton("Bullet list",n.isActive("bulletList"),o=>this.execCommand(()=>n.chain().focus().toggleBulletList().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"}))),this.renderToolbarButton("Numbered list",n.isActive("orderedList"),o=>this.execCommand(()=>n.chain().focus().toggleOrderedList().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"})))),p("div",{class:"xplor-rte__toolbar-divider","aria-hidden":"true"}),p("div",{class:"xplor-rte__toolbar-group",role:"group","aria-label":"Block elements"},this.renderToolbarButton("Blockquote",n.isActive("blockquote"),o=>this.execCommand(()=>n.chain().focus().toggleBlockquote().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"}))),this.renderToolbarButton("Code block",n.isActive("codeBlock"),o=>this.execCommand(()=>n.chain().focus().toggleCodeBlock().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M20 3H4v10c0 2.21 1.79 4 4 4h6c2.21 0 4-1.79 4-4v-3h2c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2zm0 5h-2V5h2v3zM4 19h16v2H4z"})))),p("div",{class:"xplor-rte__toolbar-divider","aria-hidden":"true"}),p("div",{class:"xplor-rte__toolbar-group",role:"group","aria-label":"Insert and utilities"},p("div",{class:"xplor-rte__link-wrapper"},this.renderToolbarButton(n.isActive("link")?"Remove link":"Insert link",n.isActive("link"),this.handleLinkButtonClick,p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"}))),this.showLinkPopover&&this.renderLinkPopover()),this.renderToolbarButton("Clear formatting",!1,o=>this.execCommand(()=>n.chain().focus().clearNodes().unsetAllMarks().run(),o),p("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},p("path",{d:"M6 19h4v-2H6v2zM3 5v2h18V5H3zm3 9h7v-2H6v2zm10.88-3.36L18.3 9.2l1.41 1.41-1.42 1.43 1.42 1.41-1.41 1.41-1.42-1.41-1.41 1.41-1.41-1.41 1.41-1.41-1.41-1.43 1.41-1.41 1.41 1.43z"})))))}render(){const n=!!this.error,e=this.maxLength!=null,o=(e?this.charCountId:void 0)||void 0,i=this.ariaLabelledBy||(this.label?this.labelId:void 0),a=i?void 0:this.ariaLabel||"Rich text editor",s={"xplor-rte":!0,"xplor-rte--focused":this.isFocused,"xplor-rte--disabled":this.disabled,"xplor-rte--readonly":this.readonly,"xplor-rte--error":n,"xplor-rte--has-toolbar":this.toolbar!=="none"};return p(E,{key:"d15876a85220e846333352ee11c52960a17341be"},this.label&&p("label",{key:"ecc7035c2cb8543b4c7447b2aa6665f53260959a",class:"xplor-rte__label",id:this.labelId,htmlFor:this.editorId},this.label,this.required&&p("span",{key:"8c5e9b8eb1efe34faa289748e8393a3261099489",class:"xplor-rte__required","aria-hidden":"true"}," ","*")),p("div",{key:"bd0b1c75612f26d7f7ee13cfcec584ebf6349f3a",class:s},this.renderToolbar(),p("div",{key:"ec047a31509004185b3be5abaa939a0278e86243",class:"xplor-rte__content",id:this.editorId,ref:l=>{this.editorEl=l},"aria-label":a,"aria-labelledby":i,"aria-multiline":"true","aria-readonly":this.readonly?"true":void 0,"aria-disabled":this.disabled?"true":void 0,"aria-required":this.required?"true":void 0,"aria-describedby":o,"aria-invalid":n?"true":void 0}),e&&p("div",{key:"4b7806ebfe4356fcfbf71192385875897dbba4fa",id:this.charCountId,class:{"xplor-rte__char-count":!0,"xplor-rte__char-count--limit":this.charCount>=this.maxLength},role:"status","aria-live":"polite","aria-atomic":"true"},this.charCount," / ",this.maxLength)),n&&p("div",{key:"b2892869df2c26f02158d30d8bf6ee239e503de3",class:"xplor-rte__error",role:"alert","aria-live":"assertive"},this.error),!n&&this.helperText&&p("div",{key:"ca2eb4562b4d514f6602b915ef76e85dc8dc6b02",class:"xplor-rte__helper"},this.helperText))}get el(){return this}static get watchers(){return{value:["handleValueChange"],readonly:["handleReadonlyChange"],disabled:["handleDisabledChange"],legacySlateDocument:["handleLegacyDocChange"]}}static get style(){return Dy}},[2,"xplor-rich-text-editor",{value:[1025],legacySlateDocument:[1,"legacy-slate-document"],placeholder:[1],label:[1],required:[4],readonly:[4],disabled:[4],ariaLabel:[1,"aria-label"],ariaLabelledBy:[1,"aria-labelled-by"],toolbar:[1],maxLength:[2,"max-length"],error:[1],helperText:[1,"helper-text"],editorVersion:[32],isFocused:[32],showLinkPopover:[32],linkUrl:[32],charCount:[32],getHTMLContent:[64],getText:[64],setContent:[64],clearContent:[64],focusEditor:[64]},void 0,{value:["handleValueChange"],readonly:["handleReadonlyChange"],disabled:["handleDisabledChange"],legacySlateDocument:["handleLegacyDocChange"]}]);function Oy(){if(typeof customElements>"u")return;["xplor-rich-text-editor"].forEach(n=>{switch(n){case"xplor-rich-text-editor":customElements.get(n)||customElements.define(n,yp);break}})}const Ay=yp,Ly=Oy,Py=`@tailwind base;
|
|
22496
22500
|
@tailwind components;
|
|
22497
22501
|
@tailwind utilities;
|
|
22498
22502
|
@layer base {
|
|
@@ -23548,7 +23552,7 @@ ol.mdc-list.sc-xplor-section-card li.mdc-list-item.sc-xplor-section-card, ul.mdc
|
|
|
23548
23552
|
}
|
|
23549
23553
|
.section-card__actions.sc-xplor-section-card:empty {
|
|
23550
23554
|
display: none;
|
|
23551
|
-
}`,
|
|
23555
|
+
}`,vp=M(class extends T{constructor(){super(),this.__registerHost(),this.outlined=!0,this.rounded=!0,this.padding="1.5rem"}render(){return p(E,{key:"7ae2731a35235a4adf7ad15ab57f83a92d56af69"},p("div",{key:"84241d02081e3bf5f5052841cba7023b93f1a325",class:{"section-card":!0,"section-card--outlined":this.outlined,"section-card--rounded":this.rounded},style:{padding:this.padding}},p("slot",{key:"a6b923edf2e228daa178a6e81d2d386d57ff701e",name:"title"}),p("slot",{key:"89870fa359b4c5e321eca737c509825ea22c261b",name:"subtitle"}),p("div",{key:"505c4207244af1d55ea7fe7b1b25e815e605d16b",class:"section-card__body"},p("slot",{key:"bdd5bc4f9c3d7d095d5ff665d4f06f58f820904b",name:"body"}),p("slot",{key:"90122903283a62f92fb0ea0e23c41a1932bfd393"})),p("div",{key:"cb7b7e68268f7a32181708537612fca37156c6f1",class:"section-card__actions"},p("slot",{key:"f910eeb994425f0fa36a980228b1eba747e46e92",name:"actions"}))))}static get style(){return Py}},[6,"xplor-section-card",{outlined:[4],rounded:[4],padding:[1]}]);function Ry(){if(typeof customElements>"u")return;["xplor-section-card"].forEach(n=>{switch(n){case"xplor-section-card":customElements.get(n)||customElements.define(n,vp);break}})}const By=vp,Ny=Ry,Fy=`@tailwind base;
|
|
23552
23556
|
@tailwind components;
|
|
23553
23557
|
@tailwind utilities;
|
|
23554
23558
|
@layer base {
|
|
@@ -23813,7 +23817,7 @@ ol.mdc-list.sc-xplor-section-heading li.mdc-list-item.sc-xplor-section-heading,
|
|
|
23813
23817
|
}
|
|
23814
23818
|
.section-heading--large.sc-xplor-section-heading {
|
|
23815
23819
|
font-size: 1.1em;
|
|
23816
|
-
}`,yp=M(class extends ${constructor(){super(),this.__registerHost(),this.size="medium",this.level=2}render(){const n=`h${this.level}`;return p(E,{key:"9707e9846b57f6d5a32f74735169a3d742c7eb48"},p(n,{key:"66688163c5a01afad9cb83de53715bfd2f448386",class:{"section-heading":!0,"section-heading--small":this.size==="small","section-heading--large":this.size==="large"}},p("slot",{key:"51cd4671527643821f5f271ca8b201438b56c403"},this.text)))}static get style(){return Py}},[6,"xplor-section-heading",{size:[1],text:[1],level:[2]}]);function Ry(){if(typeof customElements>"u")return;["xplor-section-heading"].forEach(n=>{switch(n){case"xplor-section-heading":customElements.get(n)||customElements.define(n,yp);break}})}const By=yp,Ny=Ry,Fy=t=>{switch(t){case"asc":return"arrow-up";case"desc":return"arrow-down";default:return"dash"}},vp=M(class extends ${constructor(){super(),this.__registerHost(),this.__attachShadow(),this.tableSelect=k(this,"tableSelect"),this.selectedValues=[],this.isSortable=!0,this.sortableColumns=[],this.areAllSelected=!1,this.hasScrolled=!1,this.sortTypeArray=[],this.selectedDateRange="All",this.currentPage=1,this.totalPages=3,this.handlePagination=n=>{switch(n){case"first":this.currentPage=1;break;case"prev":this.currentPage>1&&this.currentPage--;break;case"next":this.currentPage<this.totalPages&&this.currentPage++;break;case"last":this.currentPage=this.totalPages;break}},this.handleDateRangeChange=n=>{const e=n.target;this.selectedDateRange=e.value},this.handleFilterReports=()=>{console.log("Filter reports clicked")},this.handleDownloadAll=()=>{console.log("Download all clicked")},this.selectAllValue=Math.random().toString(36).slice(2),this.selectAll=n=>{const{target:e}=n;if(!(e instanceof HTMLInputElement))return;const{checked:r}=e;this.areAllSelected=r,this.selected=this.selectedValues.length>0?Array.from(this.el.querySelectorAll("tbody td:first-child input")).map(o=>r&&(o==null?void 0:o.value)):this.selected.map(()=>r),this.onChange()},this.selectOne=(n,e)=>{const{target:r}=n;if(!(r instanceof HTMLInputElement))return;const{checked:o,value:i}=r;this.areAllSelected=!1,this.selected=this.selected.map((a,s)=>s!==e?a:this.selectedValues.length>0?o&&i:o),this.onChange()},this.onChange=()=>{this.tableSelect.emit({selected:this.selected,areAllSelected:this.areAllSelected})},this.onScroll=()=>{this.hasScrolled=this.container.scrollLeft>0},this.sortBy=n=>{this.sortTypeArray=this.sortTypeArray.map((r,o)=>{if(o!==n)return null;switch(r){case"asc":return"desc";case"desc":return null;default:return"asc"}});const e=(r,o)=>r[n].toLocaleLowerCase()<o[n].toLocaleLowerCase()?-1:r[n].toLocaleLowerCase()>o[n].toLocaleLowerCase()?1:0;this.sortTypeArray[n]==="asc"?this.rowData.sort((r,o)=>e(r,o)):this.sortTypeArray[n]==="desc"?this.rowData.sort((r,o)=>e(o,r)):(this.rowData=this.data,this.sortTypeArray[n]=null),this.rowData=Array.from(this.rowData),this.render()},this.setData=()=>{this.rowData=this.data!==void 0?Array.from(this.data):[]}}getPaginatedData(){const n=(this.currentPage-1)*10,e=n+10;return this.rowData.slice(n,e)}watchData(){this.setData()}componentWillLoad(){this.areAllSelected=!1,this.setData(),this.selected=new Array(this.rowData.length).fill(!1),this.sortTypeArray=this.columns&&this.columns.map(()=>null)}render(){let n="xpl-table";this.striped&&(n+=" xpl-table--striped"),this.freeze&&(n+=" xpl-table--freeze"),this.hasScrolled&&(n+=" xpl-table--has-scrolled");const e=this.getPaginatedData();return p(E,{key:"3af5842ac1127a45153b2c2b4bcb500a8c69e11f",class:"xplor-table"},p("div",{key:"ee2f0df0a6960e8dc0cda29948071568c0c0394c",class:"bg-white rounded-lg shadow-sm border border-gray-200 p-6 max-w-6xl mx-auto"},p("div",{key:"60d30bb877d3377c0429abf333e9672c37344e4c",class:"xpl-table-container",onScroll:this.onScroll,ref:r=>{this.container=r}},p("div",{key:"edcfb3387b22a5b6e45c403677d5ae5bca8f3eaf",class:"mb-6"},p("h1",{key:"6c3fd76011f577e7bfda92eb629c7bbb80d6064d",class:"text-xl font-semibold text-gray-900 mb-4"},"Head Counts Report"),p("div",{key:"6138438a7990e5438eb82f2a69455e2e29cfc26c",class:"flex flex-wrap items-center gap-4 mb-6"},p("div",{key:"82f227b67faed69685a8d7df71c2ff11a51a355d",class:"flex items-center gap-2"},p("label",{key:"241bc6b655054643f9c9714d8442106745730676",class:"text-sm text-gray-600 font-medium"},"Date Range"),p("select",{key:"fbc8b9e0483de820a9c45e2a51370236b6d3c391",class:"border border-gray-300 rounded px-3 py-1.5 text-sm bg-white focus:outline-none focus:ring-2 focus:ring-teal-500 focus:border-teal-500",onInput:this.handleDateRangeChange},p("option",{key:"da7ab88a6dddb239b98d6229008583bc1a17b722",value:"All"},"All"),p("option",{key:"de9de322c49e9ec5ea98f35b7cdf38e87523d243",value:"Today"},"Today"),p("option",{key:"ab5e245befad53c172b4995045dfb92723d1f97c",value:"This Week"},"This Week"),p("option",{key:"4db601ec2e619e0886d3e783b896161206e4dc60",value:"This Month"},"This Month"),p("option",{key:"70de0ddb1ae329df006833e238c7a4cda3f624e3",value:"Custom"},"Custom Range")),p("button",{key:"697f5562ac46d096c0735266bbfd14dd68e85302",class:"p-1.5 border border-gray-300 rounded hover:bg-gray-50"},p("svg",{key:"9cd261cdf88f786b15954f1c58d3f8214176e594",class:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p("path",{key:"84272a7b9798064f927a7b4978d1fb3d333dea55","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})))),p("button",{key:"6c30e7375827170df47134282386c5dd6875b5b7",onClick:this.handleFilterReports,class:"bg-teal-600 hover:bg-teal-700 text-white px-4 py-1.5 rounded text-sm font-medium transition-colors"},"Filter Reports"),p("button",{key:"765892382923e914c8253deecff36504749e517c",onClick:this.handleDownloadAll,class:"flex items-center gap-2 text-gray-600 hover:text-gray-800 text-sm"},p("svg",{key:"2b13b995dd856df389ca2336052e49380bc908c3",class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p("path",{key:"8cb555ec2db80155b33151a516b860c03c8c7b01","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})),"Download All"))),p("table",{key:"571d6e2bdb7d96b665676e77e58d29084ce08a86",class:`w-full ${n}`},this.columns&&p("thead",{key:"657caea29dd0f04f86a9286621d9aa2a415174d3"},this.columns.map((r,o)=>{const i=Fy(this.sortTypeArray[o]),a=!!(this.isSortable&&this.sortableColumns[o]);return p("th",{class:"text-left py-3 px-4 text-sm font-medium text-gray-600","aria-sort":a&&this.sortTypeArray[o]?this.sortTypeArray[o]==="asc"?"ascending":"descending":a?"none":void 0},this.multiselect&&o===0?p("label",{onClick:s=>{s.preventDefault(),s.stopPropagation(),a&&this.sortBy(o)},class:a?"cursor-pointer":""},p("input",{checked:this.areAllSelected,id:"__xpl-table-th",indeterminate:!this.areAllSelected&&this.selected.some(s=>s),onClick:s=>{s.stopPropagation(),this.selectAll(s)},type:"checkbox",value:`select-all-${this.selectAllValue}`,"aria-label":"Select all rows"}),r,a&&!!this.sortTypeArray[o]&&p("xpl-icon",{icon:i,size:16})):p("label",{onClick:()=>a&&this.sortBy(o),class:a?"cursor-pointer":"","aria-label":a?`Sort by ${r}`:void 0},r,a&&!!this.sortTypeArray[o]&&p("svg",{width:"11",height:"6",viewBox:"0 0 11 6",xmlns:"http://www.w3.org/2000/svg"},p("path",{d:"M10.5 5.5L5.5 0.5L0.5 5.5L10.5 5.5Z",fill:"currentColor"}))))})),p("tbody",{key:"f5e83931272ed89a586ec0b747d590a27f902570"},e.map((r,o)=>p("tr",{class:"border-b border-gray-100 hover:bg-gray-50"},r.map((i,a)=>p("td",{class:"py-3 px-4 text-sm text-gray-900"},this.multiselect&&a===0?p("label",{class:"flex items-center gap-2",htmlFor:`__xpl-table-row-${o}`},p("input",{id:`__xpl-table-row-${o}`,checked:!!this.selected[o],type:"checkbox",onChange:s=>this.selectOne(s,o),value:this.selectedValues.length>0?this.selectedValues[o]:`xpl-table-checkbox-${o}`}),p("div",{innerHTML:i})):p("div",{innerHTML:i}))))))),p("div",{key:"8c9abcee75d63a6c3ee6377e3af19e51714a357c",id:"pagination",class:"w-full flex items-center justify-between mt-6 text-sm"},p("div",{key:"07316e6e983869121ed4850521a6cc0ca9ea65d9",class:"flex items-center gap-2"},p("button",{key:"edd5869d104d33de97e5112ec3ed4de8c5dcc3ec",onClick:()=>this.handlePagination("first"),class:"p-1.5 text-gray-400 hover:text-gray-600 disabled:opacity-50",disabled:this.currentPage===1},p("svg",{key:"de7f4e16bc06ece898c34a331bce66da9b3c921a",class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p("path",{key:"c9cb26551fb5fca8bb5485561fcfc942d36a3f7f","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"}))),p("button",{key:"a882ca1c531b3862a4adc311cc6b8bca3aabe2a1",onClick:()=>this.handlePagination("prev"),class:"p-1.5 text-gray-400 hover:text-gray-600 disabled:opacity-50",disabled:this.currentPage===1},p("svg",{key:"8caca1e52abf2ca8dc4771f525b347603c5a5948",class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p("path",{key:"ea3332b9bc24bc2b5b3ca18388eec2aec1aa74f3","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})))),p("span",{key:"02198cd02677ee3483e54a7147c708a9f9918d98",class:"text-gray-600"},"Page ",this.currentPage," of ",this.totalPages),p("div",{key:"0cdaed33f4635b034d94972c58a9bedb322d1a2c",class:"flex items-center gap-2"},p("button",{key:"5da664556d5e5aca8250e97cc75db27b78be41b5",onClick:()=>this.handlePagination("next"),class:"p-1.5 text-gray-400 hover:text-gray-600 disabled:opacity-50",disabled:this.currentPage===this.totalPages},p("svg",{key:"59f287a0b728d8a9089ad6ba15176fdff0c7c019",class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p("path",{key:"6ef0aa4e82af5c79485cfc667903d630d1b1bd00","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"}))),p("button",{key:"0988918c39cd517fe858bbe66a7700aaf2a1b91d",onClick:()=>this.handlePagination("last"),class:"p-1.5 text-gray-400 hover:text-gray-600 disabled:opacity-50",disabled:this.currentPage===this.totalPages},p("svg",{key:"1c81b4ca1c8fd404c3e246dcd1e52e88dbced809",class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p("path",{key:"c07e4ff68359b08ea8d35cbc49cd79f59eaa26a4","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 5l7 7-7 7M5 5l7 7-7 7"}))))))))}get el(){return this}static get watchers(){return{data:["watchData"]}}},[1,"xplor-table",{columns:[16],data:[16],freeze:[4],multiselect:[4],striped:[4],selectedValues:[16,"selected-values"],isSortable:[4,"is-sortable"],sortableColumns:[16,"sortable-columns"],areAllSelected:[32],rowData:[32],hasScrolled:[32],selected:[32],sortTypeArray:[32],selectedDateRange:[32],currentPage:[32],totalPages:[32]},void 0,{data:["watchData"]}]);function Hy(){if(typeof customElements>"u")return;["xplor-table"].forEach(n=>{switch(n){case"xplor-table":customElements.get(n)||customElements.define(n,vp);break}})}const jy=vp,Xy=Hy,Vy=`@tailwind base;
|
|
23820
|
+
}`,kp=M(class extends T{constructor(){super(),this.__registerHost(),this.size="medium",this.level=2}render(){const n=`h${this.level}`;return p(E,{key:"9707e9846b57f6d5a32f74735169a3d742c7eb48"},p(n,{key:"66688163c5a01afad9cb83de53715bfd2f448386",class:{"section-heading":!0,"section-heading--small":this.size==="small","section-heading--large":this.size==="large"}},p("slot",{key:"51cd4671527643821f5f271ca8b201438b56c403"},this.text)))}static get style(){return Fy}},[6,"xplor-section-heading",{size:[1],text:[1],level:[2]}]);function Hy(){if(typeof customElements>"u")return;["xplor-section-heading"].forEach(n=>{switch(n){case"xplor-section-heading":customElements.get(n)||customElements.define(n,kp);break}})}const jy=kp,Xy=Hy,Vy=t=>{switch(t){case"asc":return"arrow-up";case"desc":return"arrow-down";default:return"dash"}},wp=M(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.tableSelect=k(this,"tableSelect"),this.selectedValues=[],this.isSortable=!0,this.sortableColumns=[],this.areAllSelected=!1,this.hasScrolled=!1,this.sortTypeArray=[],this.selectedDateRange="All",this.currentPage=1,this.totalPages=3,this.handlePagination=n=>{switch(n){case"first":this.currentPage=1;break;case"prev":this.currentPage>1&&this.currentPage--;break;case"next":this.currentPage<this.totalPages&&this.currentPage++;break;case"last":this.currentPage=this.totalPages;break}},this.handleDateRangeChange=n=>{const e=n.target;this.selectedDateRange=e.value},this.handleFilterReports=()=>{console.log("Filter reports clicked")},this.handleDownloadAll=()=>{console.log("Download all clicked")},this.selectAllValue=Math.random().toString(36).slice(2),this.selectAll=n=>{const{target:e}=n;if(!(e instanceof HTMLInputElement))return;const{checked:r}=e;this.areAllSelected=r,this.selected=this.selectedValues.length>0?Array.from(this.el.querySelectorAll("tbody td:first-child input")).map(o=>r&&(o==null?void 0:o.value)):this.selected.map(()=>r),this.onChange()},this.selectOne=(n,e)=>{const{target:r}=n;if(!(r instanceof HTMLInputElement))return;const{checked:o,value:i}=r;this.areAllSelected=!1,this.selected=this.selected.map((a,s)=>s!==e?a:this.selectedValues.length>0?o&&i:o),this.onChange()},this.onChange=()=>{this.tableSelect.emit({selected:this.selected,areAllSelected:this.areAllSelected})},this.onScroll=()=>{this.hasScrolled=this.container.scrollLeft>0},this.sortBy=n=>{this.sortTypeArray=this.sortTypeArray.map((r,o)=>{if(o!==n)return null;switch(r){case"asc":return"desc";case"desc":return null;default:return"asc"}});const e=(r,o)=>r[n].toLocaleLowerCase()<o[n].toLocaleLowerCase()?-1:r[n].toLocaleLowerCase()>o[n].toLocaleLowerCase()?1:0;this.sortTypeArray[n]==="asc"?this.rowData.sort((r,o)=>e(r,o)):this.sortTypeArray[n]==="desc"?this.rowData.sort((r,o)=>e(o,r)):(this.rowData=this.data,this.sortTypeArray[n]=null),this.rowData=Array.from(this.rowData),this.render()},this.setData=()=>{this.rowData=this.data!==void 0?Array.from(this.data):[]}}getPaginatedData(){const n=(this.currentPage-1)*10,e=n+10;return this.rowData.slice(n,e)}watchData(){this.setData()}componentWillLoad(){this.areAllSelected=!1,this.setData(),this.selected=new Array(this.rowData.length).fill(!1),this.sortTypeArray=this.columns&&this.columns.map(()=>null)}render(){let n="xpl-table";this.striped&&(n+=" xpl-table--striped"),this.freeze&&(n+=" xpl-table--freeze"),this.hasScrolled&&(n+=" xpl-table--has-scrolled");const e=this.getPaginatedData();return p(E,{key:"3af5842ac1127a45153b2c2b4bcb500a8c69e11f",class:"xplor-table"},p("div",{key:"ee2f0df0a6960e8dc0cda29948071568c0c0394c",class:"bg-white rounded-lg shadow-sm border border-gray-200 p-6 max-w-6xl mx-auto"},p("div",{key:"60d30bb877d3377c0429abf333e9672c37344e4c",class:"xpl-table-container",onScroll:this.onScroll,ref:r=>{this.container=r}},p("div",{key:"edcfb3387b22a5b6e45c403677d5ae5bca8f3eaf",class:"mb-6"},p("h1",{key:"6c3fd76011f577e7bfda92eb629c7bbb80d6064d",class:"text-xl font-semibold text-gray-900 mb-4"},"Head Counts Report"),p("div",{key:"6138438a7990e5438eb82f2a69455e2e29cfc26c",class:"flex flex-wrap items-center gap-4 mb-6"},p("div",{key:"82f227b67faed69685a8d7df71c2ff11a51a355d",class:"flex items-center gap-2"},p("label",{key:"241bc6b655054643f9c9714d8442106745730676",class:"text-sm text-gray-600 font-medium"},"Date Range"),p("select",{key:"fbc8b9e0483de820a9c45e2a51370236b6d3c391",class:"border border-gray-300 rounded px-3 py-1.5 text-sm bg-white focus:outline-none focus:ring-2 focus:ring-teal-500 focus:border-teal-500",onInput:this.handleDateRangeChange},p("option",{key:"da7ab88a6dddb239b98d6229008583bc1a17b722",value:"All"},"All"),p("option",{key:"de9de322c49e9ec5ea98f35b7cdf38e87523d243",value:"Today"},"Today"),p("option",{key:"ab5e245befad53c172b4995045dfb92723d1f97c",value:"This Week"},"This Week"),p("option",{key:"4db601ec2e619e0886d3e783b896161206e4dc60",value:"This Month"},"This Month"),p("option",{key:"70de0ddb1ae329df006833e238c7a4cda3f624e3",value:"Custom"},"Custom Range")),p("button",{key:"697f5562ac46d096c0735266bbfd14dd68e85302",class:"p-1.5 border border-gray-300 rounded hover:bg-gray-50"},p("svg",{key:"9cd261cdf88f786b15954f1c58d3f8214176e594",class:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p("path",{key:"84272a7b9798064f927a7b4978d1fb3d333dea55","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})))),p("button",{key:"6c30e7375827170df47134282386c5dd6875b5b7",onClick:this.handleFilterReports,class:"bg-teal-600 hover:bg-teal-700 text-white px-4 py-1.5 rounded text-sm font-medium transition-colors"},"Filter Reports"),p("button",{key:"765892382923e914c8253deecff36504749e517c",onClick:this.handleDownloadAll,class:"flex items-center gap-2 text-gray-600 hover:text-gray-800 text-sm"},p("svg",{key:"2b13b995dd856df389ca2336052e49380bc908c3",class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p("path",{key:"8cb555ec2db80155b33151a516b860c03c8c7b01","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})),"Download All"))),p("table",{key:"571d6e2bdb7d96b665676e77e58d29084ce08a86",class:`w-full ${n}`},this.columns&&p("thead",{key:"657caea29dd0f04f86a9286621d9aa2a415174d3"},this.columns.map((r,o)=>{const i=Vy(this.sortTypeArray[o]),a=!!(this.isSortable&&this.sortableColumns[o]);return p("th",{class:"text-left py-3 px-4 text-sm font-medium text-gray-600","aria-sort":a&&this.sortTypeArray[o]?this.sortTypeArray[o]==="asc"?"ascending":"descending":a?"none":void 0},this.multiselect&&o===0?p("label",{onClick:s=>{s.preventDefault(),s.stopPropagation(),a&&this.sortBy(o)},class:a?"cursor-pointer":""},p("input",{checked:this.areAllSelected,id:"__xpl-table-th",indeterminate:!this.areAllSelected&&this.selected.some(s=>s),onClick:s=>{s.stopPropagation(),this.selectAll(s)},type:"checkbox",value:`select-all-${this.selectAllValue}`,"aria-label":"Select all rows"}),r,a&&!!this.sortTypeArray[o]&&p("xpl-icon",{icon:i,size:16})):p("label",{onClick:()=>a&&this.sortBy(o),class:a?"cursor-pointer":"","aria-label":a?`Sort by ${r}`:void 0},r,a&&!!this.sortTypeArray[o]&&p("svg",{width:"11",height:"6",viewBox:"0 0 11 6",xmlns:"http://www.w3.org/2000/svg"},p("path",{d:"M10.5 5.5L5.5 0.5L0.5 5.5L10.5 5.5Z",fill:"currentColor"}))))})),p("tbody",{key:"f5e83931272ed89a586ec0b747d590a27f902570"},e.map((r,o)=>p("tr",{class:"border-b border-gray-100 hover:bg-gray-50"},r.map((i,a)=>p("td",{class:"py-3 px-4 text-sm text-gray-900"},this.multiselect&&a===0?p("label",{class:"flex items-center gap-2",htmlFor:`__xpl-table-row-${o}`},p("input",{id:`__xpl-table-row-${o}`,checked:!!this.selected[o],type:"checkbox",onChange:s=>this.selectOne(s,o),value:this.selectedValues.length>0?this.selectedValues[o]:`xpl-table-checkbox-${o}`}),p("div",{innerHTML:i})):p("div",{innerHTML:i}))))))),p("div",{key:"8c9abcee75d63a6c3ee6377e3af19e51714a357c",id:"pagination",class:"w-full flex items-center justify-between mt-6 text-sm"},p("div",{key:"07316e6e983869121ed4850521a6cc0ca9ea65d9",class:"flex items-center gap-2"},p("button",{key:"edd5869d104d33de97e5112ec3ed4de8c5dcc3ec",onClick:()=>this.handlePagination("first"),class:"p-1.5 text-gray-400 hover:text-gray-600 disabled:opacity-50",disabled:this.currentPage===1},p("svg",{key:"de7f4e16bc06ece898c34a331bce66da9b3c921a",class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p("path",{key:"c9cb26551fb5fca8bb5485561fcfc942d36a3f7f","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"}))),p("button",{key:"a882ca1c531b3862a4adc311cc6b8bca3aabe2a1",onClick:()=>this.handlePagination("prev"),class:"p-1.5 text-gray-400 hover:text-gray-600 disabled:opacity-50",disabled:this.currentPage===1},p("svg",{key:"8caca1e52abf2ca8dc4771f525b347603c5a5948",class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p("path",{key:"ea3332b9bc24bc2b5b3ca18388eec2aec1aa74f3","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})))),p("span",{key:"02198cd02677ee3483e54a7147c708a9f9918d98",class:"text-gray-600"},"Page ",this.currentPage," of ",this.totalPages),p("div",{key:"0cdaed33f4635b034d94972c58a9bedb322d1a2c",class:"flex items-center gap-2"},p("button",{key:"5da664556d5e5aca8250e97cc75db27b78be41b5",onClick:()=>this.handlePagination("next"),class:"p-1.5 text-gray-400 hover:text-gray-600 disabled:opacity-50",disabled:this.currentPage===this.totalPages},p("svg",{key:"59f287a0b728d8a9089ad6ba15176fdff0c7c019",class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p("path",{key:"6ef0aa4e82af5c79485cfc667903d630d1b1bd00","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"}))),p("button",{key:"0988918c39cd517fe858bbe66a7700aaf2a1b91d",onClick:()=>this.handlePagination("last"),class:"p-1.5 text-gray-400 hover:text-gray-600 disabled:opacity-50",disabled:this.currentPage===this.totalPages},p("svg",{key:"1c81b4ca1c8fd404c3e246dcd1e52e88dbced809",class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p("path",{key:"c07e4ff68359b08ea8d35cbc49cd79f59eaa26a4","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 5l7 7-7 7M5 5l7 7-7 7"}))))))))}get el(){return this}static get watchers(){return{data:["watchData"]}}},[1,"xplor-table",{columns:[16],data:[16],freeze:[4],multiselect:[4],striped:[4],selectedValues:[16,"selected-values"],isSortable:[4,"is-sortable"],sortableColumns:[16,"sortable-columns"],areAllSelected:[32],rowData:[32],hasScrolled:[32],selected:[32],sortTypeArray:[32],selectedDateRange:[32],currentPage:[32],totalPages:[32]},void 0,{data:["watchData"]}]);function Wy(){if(typeof customElements>"u")return;["xplor-table"].forEach(n=>{switch(n){case"xplor-table":customElements.get(n)||customElements.define(n,wp);break}})}const Uy=wp,qy=Wy,Ky=`@tailwind base;
|
|
23817
23821
|
@tailwind components;
|
|
23818
23822
|
@tailwind utilities;
|
|
23819
23823
|
@layer base {
|
|
@@ -24078,7 +24082,7 @@ ol.mdc-list.sc-xplor-text-bubble li.mdc-list-item.sc-xplor-text-bubble, ul.mdc-l
|
|
|
24078
24082
|
.text-bubble--orange.sc-xplor-text-bubble {
|
|
24079
24083
|
border: 1px solid #F28602;
|
|
24080
24084
|
background: #FEF2E0;
|
|
24081
|
-
}`,
|
|
24085
|
+
}`,_p=M(class extends T{constructor(){super(),this.__registerHost(),this.color="orange"}render(){return p(E,{key:"b5f5fd2cff3c2b7f9712cdb879743d972d416285"},p("div",{key:"5a0699d01928eae4c5e52b0681e466d7447b56ae",class:{"text-bubble":!0,"text-bubble--green":this.color==="green","text-bubble--orange":this.color==="orange"}},p("slot",{key:"d5c6074d517155b2530f02fc018e694cec2fe348"})))}static get style(){return Ky}},[6,"xplor-text-bubble",{color:[1]}]);function Jy(){if(typeof customElements>"u")return;["xplor-text-bubble"].forEach(n=>{switch(n){case"xplor-text-bubble":customElements.get(n)||customElements.define(n,_p);break}})}const Gy=_p,Yy=Jy,Qy=`@tailwind base;
|
|
24082
24086
|
@tailwind components;
|
|
24083
24087
|
@tailwind utilities;
|
|
24084
24088
|
@layer base {
|
|
@@ -25338,7 +25342,7 @@ ol.mdc-list.sc-xplor-text-field li.mdc-list-item.sc-xplor-text-field, ul.mdc-lis
|
|
|
25338
25342
|
}
|
|
25339
25343
|
.xplor-text-field--underlined.xplor-text-field--focused.sc-xplor-text-field .xplor-text-field__outline.sc-xplor-text-field {
|
|
25340
25344
|
border-bottom-width: 2px;
|
|
25341
|
-
}`,
|
|
25345
|
+
}`,Cp=M(class extends T{constructor(){super(),this.__registerHost(),this.valueChange=k(this,"valueChange"),this.inputBlur=k(this,"inputBlur"),this.inputFocus=k(this,"inputFocus"),this.clearClick=k(this,"clearClick"),this.value="",this.label="",this.placeholder="",this.type="text",this.color="secondary",this.variant="outlined",this.bgColor="white",this.errorMessages=[],this.hideDetails="auto",this.disabled=!1,this.readonly=!1,this.required=!1,this.isDirty=!1,this.clearable=!1,this.customClass="",this.isFocused=!1,this.hasValue=!1,this.handleInput=n=>{const e=n.target;this.value=e.value,this.valueChange.emit(e.value)},this.handleFocus=n=>{this.isFocused=!0,this.inputFocus.emit(n)},this.handleBlur=n=>{this.isFocused=!1,this.inputBlur.emit(n)},this.handleClear=n=>{n.stopPropagation(),this.value="",this.valueChange.emit(""),this.clearClick.emit(),this.inputElement&&this.inputElement.focus()}}handleValueChange(n){this.hasValue=!!n}componentWillLoad(){this.hasValue=!!this.value}get hasError(){return this.errorMessages&&this.errorMessages.length>0}get showDetails(){return typeof this.hideDetails=="boolean"?!this.hideDetails:this.hasError}get computedClasses(){return{"xplor-text-field":!0,[`xplor-text-field--${this.variant}`]:!0,[`xplor-text-field--${this.color}`]:!0,"xplor-text-field--focused":this.isFocused,"xplor-text-field--error":this.hasError,"xplor-text-field--disabled":this.disabled,"xplor-text-field--readonly":this.readonly,"xplor-text-field--dirty":this.isDirty,"xplor-text-field--has-value":this.hasValue||this.isFocused,[this.customClass]:!!this.customClass}}render(){const n=this.isFocused||this.hasValue;return p(E,{key:"7688bafbb708956e01ead321771941c4ecb83bcf"},p("div",{key:"28e49b516fbb9683cd330bc3abe39d0317296a8b",class:this.computedClasses},p("div",{key:"8a794cc50d3c867f5037952acd0aba9ec9ee9c77",class:"xplor-text-field__wrapper",style:{backgroundColor:this.bgColor}},p("div",{key:"6648e824d3e7bab5570412e4419dee91534a7d8d",class:"xplor-text-field__input-wrapper"},this.label&&p("label",{key:"cd40e099e18564269e90070aeabb1f55706ae35d",class:{"xplor-text-field__label":!0,"xplor-text-field__label--floating":n}},p("slot",{key:"2d4bd72e4d3b40e5fc1e85131d07862bf24a48be",name:"label"},this.label),this.required&&p("span",{key:"756814ec4e90525285efd96b591e8b0915b6ebf3",class:"xplor-text-field__required"},"*")),p("input",{key:"deb2a58f1bc30ebcd421f2cc030bfee0212dc7dc",ref:e=>this.inputElement=e,class:"xplor-text-field__input",type:this.type,value:this.value,placeholder:this.isFocused?this.placeholder:"",disabled:this.disabled,readonly:this.readonly,required:this.required,maxlength:this.maxlength,min:this.min,max:this.max,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,"aria-invalid":this.hasError?"true":"false","aria-describedby":this.hasError?"error-messages":void 0}),p("div",{key:"3ce1c1f6a6c910a4d7715857026522d10a22be83",class:"xplor-text-field__append-inner"},this.clearable&&this.hasValue&&!this.disabled&&!this.readonly&&p("button",{key:"9656d4fae8eaa02631098b5e8ef72374d8b45f28",type:"button",class:"xplor-text-field__clear-btn",onClick:this.handleClear,"aria-label":"Clear"},p("svg",{key:"51824a45c1aec572b395fd8d072beb2b0d1003e7",width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor"},p("path",{key:"1cbce1823cbfc152ae7442696d8a6f077cd6a4e2",d:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"}))),p("slot",{key:"31768a009720a207c972d1c15f2272617d29e3dc",name:"append-inner"})),p("fieldset",{key:"96494a34a975405453ca10da271ac6a2d3b443e9",class:"xplor-text-field__outline"},p("legend",{key:"7353e3a474bd5e06d12fb43c1add91d21b3306b8",class:{"xplor-text-field__outline-legend":!0,"xplor-text-field__outline-legend--floating":n}},n&&this.label?p("span",null,this.label,this.required&&"*"):p("span",null,"")))),p("div",{key:"42b5eff7483dff022d404c0fe23816dab12e3e02",class:"xplor-text-field__append"},p("slot",{key:"93cbb0cce038f42f0d26e575f13e1f8f9a3127b5",name:"append"}))),this.showDetails&&p("div",{key:"dd65c61d0d7084ca04ad99eb46df5fe0ef356f2a",class:"xplor-text-field__details"},this.hasError&&p("div",{key:"99250ed143880032bfe5a31070b1a712aa7da48e",id:"error-messages",class:"xplor-text-field__error-messages"},this.errorMessages.map(e=>p("div",{class:"xplor-text-field__error"},e))))))}get el(){return this}static get watchers(){return{value:["handleValueChange"]}}static get style(){return Qy}},[6,"xplor-text-field",{value:[1025],label:[1],placeholder:[1],type:[1],color:[1],variant:[1],bgColor:[1,"bg-color"],errorMessages:[16,"error-messages"],hideDetails:[8,"hide-details"],disabled:[4],readonly:[4],required:[4],isDirty:[4,"is-dirty"],clearable:[4],customClass:[1,"custom-class"],maxlength:[2],min:[2],max:[2],isFocused:[32],hasValue:[32]},void 0,{value:["handleValueChange"]}]);function Zy(){if(typeof customElements>"u")return;["xplor-text-field"].forEach(n=>{switch(n){case"xplor-text-field":customElements.get(n)||customElements.define(n,Cp);break}})}const n3=Cp,e3=Zy,t3=`@tailwind base;
|
|
25342
25346
|
@tailwind components;
|
|
25343
25347
|
@tailwind utilities;
|
|
25344
25348
|
@layer base {
|
|
@@ -25766,4 +25770,4 @@ ol.mdc-list.sc-xplor-time-picker li.mdc-list-item.sc-xplor-time-picker, ul.mdc-l
|
|
|
25766
25770
|
}
|
|
25767
25771
|
.time-picker__error-message.sc-xplor-time-picker {
|
|
25768
25772
|
color: #d32f2f;
|
|
25769
|
-
}`,_p=M(class extends ${constructor(){super(),this.__registerHost(),this.timeChange=k(this,"timeChange"),this.xplorFocus=k(this,"xplorFocus"),this.xplorBlur=k(this,"xplorBlur"),this.xplorClear=k(this,"xplorClear"),this.value="",this.label="",this.placeholder="Select time",this.clearable=!1,this.prefill=!1,this.bgColor="white",this.showSeconds=!1,this.disabled=!1,this.readonly=!1,this.error="",this.hideDetails="auto",this.required=!1,this.isOpen=!1,this.inputText="",this.hours=12,this.minutes=0,this.seconds=0,this.period="AM",this.lastGoodValue="",this.toggleDropdown=()=>{this.disabled||this.readonly||(this.isOpen=!this.isOpen)},this.handleInputFocus=n=>{if(this.xplorFocus.emit(n),this.prefill&&!this.value){const e=new Date;this.hours=e.getHours()%12||12,this.minutes=e.getMinutes(),this.seconds=e.getSeconds(),this.period=e.getHours()>=12?"PM":"AM",this.emitChange()}},this.handleInputBlur=n=>{if(this.xplorBlur.emit(n),this.inputText.trim()==="")return;this.parseInputText(this.inputText)?this.emitChange():this.inputText=this.lastGoodValue},this.handleInputChange=n=>{const e=n.target;this.inputText=e.value},this.handleClear=n=>{n.stopPropagation(),this.value="",this.inputText="",this.lastGoodValue="",this.hours=12,this.minutes=0,this.seconds=0,this.period="AM",this.timeChange.emit(""),this.xplorClear.emit()},this.incrementHours=()=>{this.hours=this.hours>=12?1:this.hours+1,this.emitChange()},this.decrementHours=()=>{this.hours=this.hours<=1?12:this.hours-1,this.emitChange()},this.incrementMinutes=()=>{this.minutes>=59?(this.minutes=0,this.incrementHours()):(this.minutes++,this.emitChange())},this.decrementMinutes=()=>{this.minutes<=0?(this.minutes=59,this.decrementHours()):(this.minutes--,this.emitChange())},this.incrementSeconds=()=>{this.seconds>=59?(this.seconds=0,this.incrementMinutes()):(this.seconds++,this.emitChange())},this.decrementSeconds=()=>{this.seconds<=0?(this.seconds=59,this.decrementMinutes()):(this.seconds--,this.emitChange())},this.togglePeriod=()=>{this.period=this.period==="AM"?"PM":"AM",this.emitChange()}}componentWillLoad(){this.value&&(this.parseValueToState(this.value),this.inputText=this.formatDisplayTime(),this.lastGoodValue=this.inputText)}handleDocumentClick(n){const e=n.target;this.el.contains(e)||(this.isOpen=!1)}parseValueToState(n){if(!n)return;const e=n.split(":");let r=parseInt(e[0],10)||0;const o=parseInt(e[1],10)||0,i=parseInt(e[2],10)||0;this.period=r>=12?"PM":"AM",r===0?r=12:r>12&&(r-=12),this.hours=r,this.minutes=o,this.seconds=i}stateToValue(){let n=this.hours;this.period==="AM"&&n===12?n=0:this.period==="PM"&&n!==12&&(n+=12);const e=String(n).padStart(2,"0"),r=String(this.minutes).padStart(2,"0"),o=String(this.seconds).padStart(2,"0");return`${e}:${r}:${o}`}formatDisplayTime(){const n=this.hours,e=String(this.minutes).padStart(2,"0");if(this.showSeconds){const r=String(this.seconds).padStart(2,"0");return`${n}:${e}:${r} ${this.period}`}return`${n}:${e} ${this.period}`}parseInputText(n){const e=n.trim();if(!e)return!1;if(e.toLowerCase()==="am"||e.toLowerCase()==="pm")return this.hours=12,this.minutes=0,this.seconds=0,this.period=e.toLowerCase()==="pm"?"PM":"AM",!0;let r="am";e.toLowerCase().indexOf("p")!==-1&&(r="pm");const o=e.replace(/(\s*)(pm|am|p|a)/gi,"").trim(),a=o.replace(/\./g,":").split(":");let s,l=0,c=0;if(a.length===1){const d=o.trim();d.length===3?(s=parseInt(d.substring(0,1),10),l=parseInt(d.substring(1,3),10)):d.length===4?(s=parseInt(d.substring(0,2),10),l=parseInt(d.substring(2,4),10)):d.length===6?(s=parseInt(d.substring(0,2),10),l=parseInt(d.substring(2,4),10),c=parseInt(d.substring(4,6),10)):s=parseInt(d,10)}else if(a.length===2)s=parseInt(a[0].trim(),10),l=parseInt(a[1].trim(),10);else if(a.length===3)s=parseInt(a[0].trim(),10),l=parseInt(a[1].trim(),10),c=parseInt(a[2].trim(),10);else return!1;return isNaN(s)||s<0?!1:(isNaN(l)&&(l=0),isNaN(c)&&(c=0),l>=60&&(s+=Math.floor(l/60),l=l%60),s>=12&&(r="pm",s>=24&&(s=s%24,r=s>=12?"pm":"am"),s>12&&(s-=12)),s===0&&(s=12,r="am"),c>=60&&(c=59),this.hours=s,this.minutes=l,this.seconds=c,this.period=r==="pm"?"PM":"AM",!0)}emitChange(){const n=this.stateToValue();this.value=n,this.inputText=this.formatDisplayTime(),this.lastGoodValue=this.inputText,this.timeChange.emit(n)}renderChevronUp(){return p("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},p("polyline",{points:"18 15 12 9 6 15"}))}renderChevronDown(){return p("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},p("polyline",{points:"6 9 12 15 18 9"}))}render(){const n=this.hideDetails===!1||this.hideDetails==="auto"&&this.error,e=p("svg",{key:"fe7b627c18d27b85f40120cfebd75b5e84d05ffb",class:"time-picker__icon-svg",viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},p("circle",{key:"8506a6cd516f42e7298df3a8711b4240d3073ddf",cx:"12",cy:"12",r:"10"}),p("polyline",{key:"abe3af03c9975c553e45b926c0561200be010048",points:"12 6 12 12 16 14"}));return p(E,{key:"7726361a1b2e579d542f2dc0dc68af50fc40fb94"},p("div",{key:"1a13b496b12a8a186a3a4c1dbdabf1424d38073b",class:{"time-picker":!0,"time-picker--disabled":this.disabled,"time-picker--error":!!this.error,"time-picker--open":this.isOpen}},this.label&&p("label",{key:"e07b413d91ea7d636f1d613f283fd0146836842a",class:"time-picker__label"},this.label,this.required&&p("span",{key:"d78be67681f84b5a0c33dc71a1a899be5899b089",class:"time-picker__required"},"*")),p("div",{key:"52273f1628d69c2ad7cf23b483e7106682f4a903",class:"time-picker__field"},p("input",{key:"95a270bfcf61b6fb95a193d4efb3b834714c3268",type:"text",class:"time-picker__input",value:this.inputText,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onInput:this.handleInputChange,style:{backgroundColor:this.bgColor}}),p("div",{key:"8e968c366b997652d7f5b9dd582157f179c52af6",class:"time-picker__actions"},this.clearable&&this.value&&!this.disabled&&!this.readonly&&p("button",{key:"d9c090ed12649214da5eb07ae128dc0ebaa6e94e",type:"button",class:"time-picker__clear",onClick:this.handleClear,"aria-label":"Clear"},"×"),p("button",{key:"58daab9391580e6b3dcb07665582bac08d770907",type:"button",class:"time-picker__icon-btn",onClick:this.toggleDropdown,disabled:this.disabled,"aria-label":"Open time picker"},e))),n&&p("div",{key:"e1a479b852cb3f352f681c906b1cd5403d2be14d",class:"time-picker__details"},this.error&&p("div",{key:"b40e5a31cb3839dabfc7156d7911489a5c8fa173",class:"time-picker__error-message"},this.error)),this.isOpen&&p("div",{key:"f4d3ac5c9658085e4df87e9ad90f7bf858c4aa36",class:"time-picker__dropdown"},p("div",{key:"b66a8a064a4e09e83073f2f90e2eddacb3e9748c",class:"time-picker__columns"},p("div",{key:"9dc9382f48f8d4e50fe8738bf14c1e7ab8938c55",class:"time-picker__column"},p("button",{key:"d013faf5714f426bc9075fae84da79e22e92fd8f",type:"button",class:"time-picker__spinner-btn",onClick:this.incrementHours,"aria-label":"Increase hours"},this.renderChevronUp()),p("div",{key:"2fbdc620aa22346d026af3f6bafdce919b7bc469",class:"time-picker__value"},String(this.hours).padStart(2,"0")),p("button",{key:"f28ba42badef4eaf59ca51a14aa141b383fcc999",type:"button",class:"time-picker__spinner-btn",onClick:this.decrementHours,"aria-label":"Decrease hours"},this.renderChevronDown())),p("div",{key:"92d30ec7821ab78d51bff5be38e318ec3870437d",class:"time-picker__separator"},":"),p("div",{key:"6a3cb83fc67b13e894e990908c998da96e69612d",class:"time-picker__column"},p("button",{key:"dcb237b53e359a90da737da41d15bcd0a45d8e63",type:"button",class:"time-picker__spinner-btn",onClick:this.incrementMinutes,"aria-label":"Increase minutes"},this.renderChevronUp()),p("div",{key:"2cbb2c828a6cac6585b9004cb10fd71b890088d4",class:"time-picker__value"},String(this.minutes).padStart(2,"0")),p("button",{key:"4eea1d49921c922f645ce2e67e0f65a2782570d5",type:"button",class:"time-picker__spinner-btn",onClick:this.decrementMinutes,"aria-label":"Decrease minutes"},this.renderChevronDown())),this.showSeconds&&[p("div",{key:"6a992f5956d5a62bf2c727d57ee6873f21e351ee",class:"time-picker__separator"},":"),p("div",{key:"7f767c2b47e77f4a370eef1b34230b59e283d852",class:"time-picker__column"},p("button",{key:"50362fcd64188b6bc0292b973046b6e97271a103",type:"button",class:"time-picker__spinner-btn",onClick:this.incrementSeconds,"aria-label":"Increase seconds"},this.renderChevronUp()),p("div",{key:"ebec647338f001aadbf792bbfa5e210677144d9b",class:"time-picker__value"},String(this.seconds).padStart(2,"0")),p("button",{key:"5e4c9cc6102fe1de7e4438df5edbea7749d98349",type:"button",class:"time-picker__spinner-btn",onClick:this.decrementSeconds,"aria-label":"Decrease seconds"},this.renderChevronDown()))],p("div",{key:"9f59e5a1647b78609e63f2dcccf3193d756056b2",class:"time-picker__column time-picker__column--period"},p("button",{key:"9ccb2713bc81b1366b68b9ffb6c57e6165a5b0fa",type:"button",class:"time-picker__spinner-btn",onClick:this.togglePeriod,"aria-label":"Toggle AM/PM"},this.renderChevronUp()),p("div",{key:"4010106b1caae18bc2145f5b8e8a6befa8c60b15",class:"time-picker__value time-picker__value--period"},this.period),p("button",{key:"08bc807fd013ba7f51cc8b4f019ec9c415ca739a",type:"button",class:"time-picker__spinner-btn",onClick:this.togglePeriod,"aria-label":"Toggle AM/PM"},this.renderChevronDown()))))))}get el(){return this}static get style(){return Qy}},[2,"xplor-time-picker",{value:[1025],label:[1],placeholder:[1],clearable:[4],prefill:[4],bgColor:[1,"bg-color"],showSeconds:[4,"show-seconds"],disabled:[4],readonly:[4],error:[1],hideDetails:[8,"hide-details"],required:[4],isOpen:[32],inputText:[32],hours:[32],minutes:[32],seconds:[32],period:[32],lastGoodValue:[32]},[[4,"click","handleDocumentClick"]]]);function Zy(){if(typeof customElements>"u")return;["xplor-time-picker"].forEach(n=>{switch(n){case"xplor-time-picker":customElements.get(n)||customElements.define(n,_p);break}})}const n3=_p,e3=Zy,t3=Wl,r3=Ul,o3=I.createComponent({tagName:"xplor-alert-dialog",elementClass:Mh,react:T,events:{onXplorClose:"xplorClose",onXplorDialogChange:"xplorDialogChange"},defineCustomElement:zh}),i3=I.createComponent({tagName:"xplor-alert-message",elementClass:Ah,react:T,events:{onXplorDismiss:"xplorDismiss"},defineCustomElement:Lh}),a3=I.createComponent({tagName:"xplor-assistant",elementClass:Zh,react:T,events:{onAssistantMessageSent:"assistantMessageSent",onAssistantMessageReceived:"assistantMessageReceived",onAssistantError:"assistantError",onAssistantSessionCreated:"assistantSessionCreated"},defineCustomElement:ng}),s3=I.createComponent({tagName:"xplor-autocomplete",elementClass:rg,react:T,events:{onXplorChange:"xplorChange",onXplorSelect:"xplorSelect",onXplorClear:"xplorClear",onXplorSearch:"xplorSearch"},defineCustomElement:og}),l3=I.createComponent({tagName:"xplor-avatar",elementClass:dg,react:T,events:{},defineCustomElement:pg}),c3=I.createComponent({tagName:"xplor-avatar-and-name",elementClass:lg,react:T,events:{},defineCustomElement:cg}),d3=I.createComponent({tagName:"xplor-badge",elementClass:Gg,react:T,events:{},defineCustomElement:Yg}),p3=I.createComponent({tagName:"xplor-badge-active",elementClass:ug,react:T,events:{},defineCustomElement:fg}),h3=I.createComponent({tagName:"xplor-badge-archived",elementClass:bg,react:T,events:{},defineCustomElement:yg}),g3=I.createComponent({tagName:"xplor-badge-deleted",elementClass:wg,react:T,events:{},defineCustomElement:_g}),u3=I.createComponent({tagName:"xplor-badge-expired",elementClass:Eg,react:T,events:{},defineCustomElement:Ig}),f3=I.createComponent({tagName:"xplor-badge-inactive",elementClass:Mg,react:T,events:{},defineCustomElement:zg}),m3=I.createComponent({tagName:"xplor-badge-recalled",elementClass:Ag,react:T,events:{},defineCustomElement:Lg}),x3=I.createComponent({tagName:"xplor-badge-session-booking",elementClass:Bg,react:T,events:{},defineCustomElement:Ng}),b3=I.createComponent({tagName:"xplor-badge-upcoming",elementClass:jg,react:T,events:{},defineCustomElement:Xg}),y3=I.createComponent({tagName:"xplor-badge-waitlist",elementClass:Ug,react:T,events:{},defineCustomElement:qg}),v3=I.createComponent({tagName:"xplor-btn-back",elementClass:ou,react:T,events:{onXplorClick:"xplorClick"},defineCustomElement:iu}),k3=I.createComponent({tagName:"xplor-btn-back-to-parent",elementClass:nu,react:T,events:{onBack:"back"},defineCustomElement:eu}),w3=I.createComponent({tagName:"xplor-btn-icon",elementClass:lu,react:T,events:{onXplorClick:"xplorClick"},defineCustomElement:cu}),_3=I.createComponent({tagName:"xplor-btn-menu",elementClass:hu,react:T,events:{onXplorClick:"xplorClick"},defineCustomElement:gu}),C3=I.createComponent({tagName:"xplor-btn-toggle",elementClass:Cu,react:T,events:{onXplorToggle:"xplorToggle"},defineCustomElement:Su}),S3=I.createComponent({tagName:"xplor-btn-toggle-group",elementClass:mu,react:T,events:{},defineCustomElement:xu}),E3=I.createComponent({tagName:"xplor-btn-toggle-secondary",elementClass:vu,react:T,events:{onXplorToggle:"xplorToggle"},defineCustomElement:ku}),I3=I.createComponent({tagName:"xplor-btn-tooltip",elementClass:zu,react:T,events:{},defineCustomElement:Du}),T3=I.createComponent({tagName:"xplor-button",elementClass:Ou,react:T,events:{},defineCustomElement:Au}),$3=I.createComponent({tagName:"xplor-canvas-editor",elementClass:Bu,react:T,events:{onXplorShapeAdd:"xplorShapeAdd",onXplorShapeRemove:"xplorShapeRemove",onXplorShapeChange:"xplorShapeChange"},defineCustomElement:Nu}),M3=I.createComponent({tagName:"xplor-chat-widget",elementClass:Xu,react:T,events:{},defineCustomElement:Vu}),z3=I.createComponent({tagName:"xplor-checkbox",elementClass:Ku,react:T,events:{onCheckboxChange:"checkboxChange"},defineCustomElement:Ju}),D3=I.createComponent({tagName:"xplor-combobox",elementClass:Qu,react:T,events:{onXplorChange:"xplorChange",onXplorSelect:"xplorSelect",onXplorCreate:"xplorCreate",onXplorClear:"xplorClear",onXplorSearch:"xplorSearch"},defineCustomElement:Zu}),O3=I.createComponent({tagName:"xplor-datatable",elementClass:tf,react:T,events:{onRowClick:"rowClick",onXplorSelectionChange:"xplorSelectionChange",onPaginationChange:"paginationChange",onSortChange:"sortChange"},defineCustomElement:rf}),A3=I.createComponent({tagName:"xplor-date-picker",elementClass:cf,react:T,events:{onDateChange:"dateChange",onXplorFocus:"xplorFocus",onXplorBlur:"xplorBlur",onXplorClear:"xplorClear"},defineCustomElement:df}),L3=I.createComponent({tagName:"xplor-drag-and-drop-input",elementClass:uf,react:T,events:{onFileSelect:"fileSelect",onFileClear:"fileClear"},defineCustomElement:ff}),P3=I.createComponent({tagName:"xplor-dropdown",elementClass:mf,react:T,events:{},defineCustomElement:xf}),R3=I.createComponent({tagName:"xplor-expansion-panel",elementClass:kf,react:T,events:{onXplorPanelToggle:"xplorPanelToggle"},defineCustomElement:wf}),B3=I.createComponent({tagName:"xplor-expansion-panels",elementClass:Sf,react:T,events:{},defineCustomElement:Ef}),N3=I.createComponent({tagName:"xplor-file-upload",elementClass:Mf,react:T,events:{onXplorFileAdd:"xplorFileAdd",onXplorFileRemove:"xplorFileRemove",onXplorError:"xplorError"},defineCustomElement:zf}),F3=I.createComponent({tagName:"xplor-inline-checkbox",elementClass:Af,react:T,events:{onXplorChange:"xplorChange"},defineCustomElement:Lf}),H3=I.createComponent({tagName:"xplor-inline-date-picker",elementClass:Pf,react:T,events:{onDateSelected:"dateSelected",onMonthChanged:"monthChanged"},defineCustomElement:Rf}),j3=I.createComponent({tagName:"xplor-inline-switch",elementClass:Ff,react:T,events:{onXplorChange:"xplorChange"},defineCustomElement:Hf}),X3=I.createComponent({tagName:"xplor-input-file",elementClass:Wf,react:T,events:{onAttach:"attach",onXplorClear:"xplorClear"},defineCustomElement:Uf}),V3=I.createComponent({tagName:"xplor-input-search",elementClass:Gf,react:T,events:{onSearch:"search"},defineCustomElement:Yf}),W3=I.createComponent({tagName:"xplor-input-select",elementClass:nm,react:T,events:{onXplorChange:"xplorChange"},defineCustomElement:em}),U3=I.createComponent({tagName:"xplor-input-send",elementClass:om,react:T,events:{onXplorSend:"xplorSend",onXplorValueChange:"xplorValueChange"},defineCustomElement:im}),q3=I.createComponent({tagName:"xplor-input-text",elementClass:ym,react:T,events:{onXplorInput:"xplorInput",onXplorChange:"xplorChange",onXplorFocus:"xplorFocus",onXplorBlur:"xplorBlur"},defineCustomElement:vm}),K3=I.createComponent({tagName:"xplor-input-text-area",elementClass:cm,react:T,events:{onXplorInput:"xplorInput",onXplorChange:"xplorChange",onXplorClear:"xplorClear"},defineCustomElement:dm}),J3=I.createComponent({tagName:"xplor-input-text-secondary",elementClass:um,react:T,events:{onXplorInput:"xplorInput",onXplorChange:"xplorChange",onXplorFocus:"xplorFocus",onXplorBlur:"xplorBlur"},defineCustomElement:fm}),G3=I.createComponent({tagName:"xplor-input-title",elementClass:_m,react:T,events:{onXplorInput:"xplorInput",onXplorChange:"xplorChange"},defineCustomElement:Cm}),Y3=I.createComponent({tagName:"xplor-links",elementClass:Im,react:T,events:{},defineCustomElement:Tm}),Q3=I.createComponent({tagName:"xplor-modal",elementClass:Om,react:T,events:{onXplorClose:"xplorClose"},defineCustomElement:Am}),Z3=I.createComponent({tagName:"xplor-modal-persistent",elementClass:zm,react:T,events:{onXplorClose:"xplorClose"},defineCustomElement:Dm}),nv=I.createComponent({tagName:"xplor-nav-tabs",elementClass:Rm,react:T,events:{onXplorChange:"xplorChange"},defineCustomElement:Bm}),ev=I.createComponent({tagName:"xplor-radio-btn",elementClass:Hm,react:T,events:{onRadioChange:"radioChange"},defineCustomElement:jm}),tv=I.createComponent({tagName:"xplor-rich-text-editor",elementClass:My,react:T,events:{onXplorChange:"xplorChange",onXplorFocus:"xplorFocus",onXplorBlur:"xplorBlur"},defineCustomElement:zy}),rv=I.createComponent({tagName:"xplor-section-card",elementClass:Ay,react:T,events:{},defineCustomElement:Ly}),ov=I.createComponent({tagName:"xplor-section-heading",elementClass:By,react:T,events:{},defineCustomElement:Ny}),iv=I.createComponent({tagName:"xplor-table",elementClass:jy,react:T,events:{onTableSelect:"tableSelect"},defineCustomElement:Xy}),av=I.createComponent({tagName:"xplor-text-bubble",elementClass:Uy,react:T,events:{},defineCustomElement:qy}),sv=I.createComponent({tagName:"xplor-text-field",elementClass:Gy,react:T,events:{onValueChange:"valueChange",onInputBlur:"inputBlur",onInputFocus:"inputFocus",onClearClick:"clearClick"},defineCustomElement:Yy}),lv=I.createComponent({tagName:"xplor-time-picker",elementClass:n3,react:T,events:{onTimeChange:"timeChange",onXplorFocus:"xplorFocus",onXplorBlur:"xplorBlur",onXplorClear:"xplorClear"},defineCustomElement:e3}),cv=I.createComponent({tagName:"xplor-tooltip",elementClass:t3,react:T,events:{},defineCustomElement:r3});exports.XplorAlertDialog=o3;exports.XplorAlertMessage=i3;exports.XplorAssistant=a3;exports.XplorAutocomplete=s3;exports.XplorAvatar=l3;exports.XplorAvatarAndName=c3;exports.XplorBadge=d3;exports.XplorBadgeActive=p3;exports.XplorBadgeArchived=h3;exports.XplorBadgeDeleted=g3;exports.XplorBadgeExpired=u3;exports.XplorBadgeInactive=f3;exports.XplorBadgeRecalled=m3;exports.XplorBadgeSessionBooking=x3;exports.XplorBadgeUpcoming=b3;exports.XplorBadgeWaitlist=y3;exports.XplorBtnBack=v3;exports.XplorBtnBackToParent=k3;exports.XplorBtnIcon=w3;exports.XplorBtnMenu=_3;exports.XplorBtnToggle=C3;exports.XplorBtnToggleGroup=S3;exports.XplorBtnToggleSecondary=E3;exports.XplorBtnTooltip=I3;exports.XplorButton=T3;exports.XplorCanvasEditor=$3;exports.XplorChatWidget=M3;exports.XplorCheckbox=z3;exports.XplorCombobox=D3;exports.XplorDatatable=O3;exports.XplorDatePicker=A3;exports.XplorDragAndDropInput=L3;exports.XplorDropdown=P3;exports.XplorExpansionPanel=R3;exports.XplorExpansionPanels=B3;exports.XplorFileUpload=N3;exports.XplorInlineCheckbox=F3;exports.XplorInlineDatePicker=H3;exports.XplorInlineSwitch=j3;exports.XplorInputFile=X3;exports.XplorInputSearch=V3;exports.XplorInputSelect=W3;exports.XplorInputSend=U3;exports.XplorInputText=q3;exports.XplorInputTextArea=K3;exports.XplorInputTextSecondary=J3;exports.XplorInputTitle=G3;exports.XplorLinks=Y3;exports.XplorModal=Q3;exports.XplorModalPersistent=Z3;exports.XplorNavTabs=nv;exports.XplorRadioBtn=ev;exports.XplorRichTextEditor=tv;exports.XplorSectionCard=rv;exports.XplorSectionHeading=ov;exports.XplorTable=iv;exports.XplorTextBubble=av;exports.XplorTextField=sv;exports.XplorTimePicker=lv;exports.XplorTooltip=cv;
|
|
25773
|
+
}`,Sp=M(class extends T{constructor(){super(),this.__registerHost(),this.timeChange=k(this,"timeChange"),this.xplorFocus=k(this,"xplorFocus"),this.xplorBlur=k(this,"xplorBlur"),this.xplorClear=k(this,"xplorClear"),this.value="",this.label="",this.placeholder="Select time",this.clearable=!1,this.prefill=!1,this.bgColor="white",this.showSeconds=!1,this.disabled=!1,this.readonly=!1,this.error="",this.hideDetails="auto",this.required=!1,this.isOpen=!1,this.inputText="",this.hours=12,this.minutes=0,this.seconds=0,this.period="AM",this.lastGoodValue="",this.toggleDropdown=()=>{this.disabled||this.readonly||(this.isOpen=!this.isOpen)},this.handleInputFocus=n=>{if(this.xplorFocus.emit(n),this.prefill&&!this.value){const e=new Date;this.hours=e.getHours()%12||12,this.minutes=e.getMinutes(),this.seconds=e.getSeconds(),this.period=e.getHours()>=12?"PM":"AM",this.emitChange()}},this.handleInputBlur=n=>{if(this.xplorBlur.emit(n),this.inputText.trim()==="")return;this.parseInputText(this.inputText)?this.emitChange():this.inputText=this.lastGoodValue},this.handleInputChange=n=>{const e=n.target;this.inputText=e.value},this.handleClear=n=>{n.stopPropagation(),this.value="",this.inputText="",this.lastGoodValue="",this.hours=12,this.minutes=0,this.seconds=0,this.period="AM",this.timeChange.emit(""),this.xplorClear.emit()},this.incrementHours=()=>{this.hours=this.hours>=12?1:this.hours+1,this.emitChange()},this.decrementHours=()=>{this.hours=this.hours<=1?12:this.hours-1,this.emitChange()},this.incrementMinutes=()=>{this.minutes>=59?(this.minutes=0,this.incrementHours()):(this.minutes++,this.emitChange())},this.decrementMinutes=()=>{this.minutes<=0?(this.minutes=59,this.decrementHours()):(this.minutes--,this.emitChange())},this.incrementSeconds=()=>{this.seconds>=59?(this.seconds=0,this.incrementMinutes()):(this.seconds++,this.emitChange())},this.decrementSeconds=()=>{this.seconds<=0?(this.seconds=59,this.decrementMinutes()):(this.seconds--,this.emitChange())},this.togglePeriod=()=>{this.period=this.period==="AM"?"PM":"AM",this.emitChange()}}componentWillLoad(){this.value&&(this.parseValueToState(this.value),this.inputText=this.formatDisplayTime(),this.lastGoodValue=this.inputText)}handleDocumentClick(n){const e=n.target;this.el.contains(e)||(this.isOpen=!1)}parseValueToState(n){if(!n)return;const e=n.split(":");let r=parseInt(e[0],10)||0;const o=parseInt(e[1],10)||0,i=parseInt(e[2],10)||0;this.period=r>=12?"PM":"AM",r===0?r=12:r>12&&(r-=12),this.hours=r,this.minutes=o,this.seconds=i}stateToValue(){let n=this.hours;this.period==="AM"&&n===12?n=0:this.period==="PM"&&n!==12&&(n+=12);const e=String(n).padStart(2,"0"),r=String(this.minutes).padStart(2,"0"),o=String(this.seconds).padStart(2,"0");return`${e}:${r}:${o}`}formatDisplayTime(){const n=this.hours,e=String(this.minutes).padStart(2,"0");if(this.showSeconds){const r=String(this.seconds).padStart(2,"0");return`${n}:${e}:${r} ${this.period}`}return`${n}:${e} ${this.period}`}parseInputText(n){const e=n.trim();if(!e)return!1;if(e.toLowerCase()==="am"||e.toLowerCase()==="pm")return this.hours=12,this.minutes=0,this.seconds=0,this.period=e.toLowerCase()==="pm"?"PM":"AM",!0;let r="am";e.toLowerCase().indexOf("p")!==-1&&(r="pm");const o=e.replace(/(\s*)(pm|am|p|a)/gi,"").trim(),a=o.replace(/\./g,":").split(":");let s,l=0,c=0;if(a.length===1){const d=o.trim();d.length===3?(s=parseInt(d.substring(0,1),10),l=parseInt(d.substring(1,3),10)):d.length===4?(s=parseInt(d.substring(0,2),10),l=parseInt(d.substring(2,4),10)):d.length===6?(s=parseInt(d.substring(0,2),10),l=parseInt(d.substring(2,4),10),c=parseInt(d.substring(4,6),10)):s=parseInt(d,10)}else if(a.length===2)s=parseInt(a[0].trim(),10),l=parseInt(a[1].trim(),10);else if(a.length===3)s=parseInt(a[0].trim(),10),l=parseInt(a[1].trim(),10),c=parseInt(a[2].trim(),10);else return!1;return isNaN(s)||s<0?!1:(isNaN(l)&&(l=0),isNaN(c)&&(c=0),l>=60&&(s+=Math.floor(l/60),l=l%60),s>=12&&(r="pm",s>=24&&(s=s%24,r=s>=12?"pm":"am"),s>12&&(s-=12)),s===0&&(s=12,r="am"),c>=60&&(c=59),this.hours=s,this.minutes=l,this.seconds=c,this.period=r==="pm"?"PM":"AM",!0)}emitChange(){const n=this.stateToValue();this.value=n,this.inputText=this.formatDisplayTime(),this.lastGoodValue=this.inputText,this.timeChange.emit(n)}renderChevronUp(){return p("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},p("polyline",{points:"18 15 12 9 6 15"}))}renderChevronDown(){return p("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},p("polyline",{points:"6 9 12 15 18 9"}))}render(){const n=this.hideDetails===!1||this.hideDetails==="auto"&&this.error,e=p("svg",{key:"fe7b627c18d27b85f40120cfebd75b5e84d05ffb",class:"time-picker__icon-svg",viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},p("circle",{key:"8506a6cd516f42e7298df3a8711b4240d3073ddf",cx:"12",cy:"12",r:"10"}),p("polyline",{key:"abe3af03c9975c553e45b926c0561200be010048",points:"12 6 12 12 16 14"}));return p(E,{key:"7726361a1b2e579d542f2dc0dc68af50fc40fb94"},p("div",{key:"1a13b496b12a8a186a3a4c1dbdabf1424d38073b",class:{"time-picker":!0,"time-picker--disabled":this.disabled,"time-picker--error":!!this.error,"time-picker--open":this.isOpen}},this.label&&p("label",{key:"e07b413d91ea7d636f1d613f283fd0146836842a",class:"time-picker__label"},this.label,this.required&&p("span",{key:"d78be67681f84b5a0c33dc71a1a899be5899b089",class:"time-picker__required"},"*")),p("div",{key:"52273f1628d69c2ad7cf23b483e7106682f4a903",class:"time-picker__field"},p("input",{key:"95a270bfcf61b6fb95a193d4efb3b834714c3268",type:"text",class:"time-picker__input",value:this.inputText,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onInput:this.handleInputChange,style:{backgroundColor:this.bgColor}}),p("div",{key:"8e968c366b997652d7f5b9dd582157f179c52af6",class:"time-picker__actions"},this.clearable&&this.value&&!this.disabled&&!this.readonly&&p("button",{key:"d9c090ed12649214da5eb07ae128dc0ebaa6e94e",type:"button",class:"time-picker__clear",onClick:this.handleClear,"aria-label":"Clear"},"×"),p("button",{key:"58daab9391580e6b3dcb07665582bac08d770907",type:"button",class:"time-picker__icon-btn",onClick:this.toggleDropdown,disabled:this.disabled,"aria-label":"Open time picker"},e))),n&&p("div",{key:"e1a479b852cb3f352f681c906b1cd5403d2be14d",class:"time-picker__details"},this.error&&p("div",{key:"b40e5a31cb3839dabfc7156d7911489a5c8fa173",class:"time-picker__error-message"},this.error)),this.isOpen&&p("div",{key:"f4d3ac5c9658085e4df87e9ad90f7bf858c4aa36",class:"time-picker__dropdown"},p("div",{key:"b66a8a064a4e09e83073f2f90e2eddacb3e9748c",class:"time-picker__columns"},p("div",{key:"9dc9382f48f8d4e50fe8738bf14c1e7ab8938c55",class:"time-picker__column"},p("button",{key:"d013faf5714f426bc9075fae84da79e22e92fd8f",type:"button",class:"time-picker__spinner-btn",onClick:this.incrementHours,"aria-label":"Increase hours"},this.renderChevronUp()),p("div",{key:"2fbdc620aa22346d026af3f6bafdce919b7bc469",class:"time-picker__value"},String(this.hours).padStart(2,"0")),p("button",{key:"f28ba42badef4eaf59ca51a14aa141b383fcc999",type:"button",class:"time-picker__spinner-btn",onClick:this.decrementHours,"aria-label":"Decrease hours"},this.renderChevronDown())),p("div",{key:"92d30ec7821ab78d51bff5be38e318ec3870437d",class:"time-picker__separator"},":"),p("div",{key:"6a3cb83fc67b13e894e990908c998da96e69612d",class:"time-picker__column"},p("button",{key:"dcb237b53e359a90da737da41d15bcd0a45d8e63",type:"button",class:"time-picker__spinner-btn",onClick:this.incrementMinutes,"aria-label":"Increase minutes"},this.renderChevronUp()),p("div",{key:"2cbb2c828a6cac6585b9004cb10fd71b890088d4",class:"time-picker__value"},String(this.minutes).padStart(2,"0")),p("button",{key:"4eea1d49921c922f645ce2e67e0f65a2782570d5",type:"button",class:"time-picker__spinner-btn",onClick:this.decrementMinutes,"aria-label":"Decrease minutes"},this.renderChevronDown())),this.showSeconds&&[p("div",{key:"6a992f5956d5a62bf2c727d57ee6873f21e351ee",class:"time-picker__separator"},":"),p("div",{key:"7f767c2b47e77f4a370eef1b34230b59e283d852",class:"time-picker__column"},p("button",{key:"50362fcd64188b6bc0292b973046b6e97271a103",type:"button",class:"time-picker__spinner-btn",onClick:this.incrementSeconds,"aria-label":"Increase seconds"},this.renderChevronUp()),p("div",{key:"ebec647338f001aadbf792bbfa5e210677144d9b",class:"time-picker__value"},String(this.seconds).padStart(2,"0")),p("button",{key:"5e4c9cc6102fe1de7e4438df5edbea7749d98349",type:"button",class:"time-picker__spinner-btn",onClick:this.decrementSeconds,"aria-label":"Decrease seconds"},this.renderChevronDown()))],p("div",{key:"9f59e5a1647b78609e63f2dcccf3193d756056b2",class:"time-picker__column time-picker__column--period"},p("button",{key:"9ccb2713bc81b1366b68b9ffb6c57e6165a5b0fa",type:"button",class:"time-picker__spinner-btn",onClick:this.togglePeriod,"aria-label":"Toggle AM/PM"},this.renderChevronUp()),p("div",{key:"4010106b1caae18bc2145f5b8e8a6befa8c60b15",class:"time-picker__value time-picker__value--period"},this.period),p("button",{key:"08bc807fd013ba7f51cc8b4f019ec9c415ca739a",type:"button",class:"time-picker__spinner-btn",onClick:this.togglePeriod,"aria-label":"Toggle AM/PM"},this.renderChevronDown()))))))}get el(){return this}static get style(){return t3}},[2,"xplor-time-picker",{value:[1025],label:[1],placeholder:[1],clearable:[4],prefill:[4],bgColor:[1,"bg-color"],showSeconds:[4,"show-seconds"],disabled:[4],readonly:[4],error:[1],hideDetails:[8,"hide-details"],required:[4],isOpen:[32],inputText:[32],hours:[32],minutes:[32],seconds:[32],period:[32],lastGoodValue:[32]},[[4,"click","handleDocumentClick"]]]);function r3(){if(typeof customElements>"u")return;["xplor-time-picker"].forEach(n=>{switch(n){case"xplor-time-picker":customElements.get(n)||customElements.define(n,Sp);break}})}const o3=Sp,i3=r3,a3=ql,s3=Kl,l3=$({tagName:"xplor-alert-dialog",elementClass:Ah,react:I,events:{onXplorClose:"xplorClose",onXplorDialogChange:"xplorDialogChange"},defineCustomElement:Lh}),c3=$({tagName:"xplor-alert-message",elementClass:Bh,react:I,events:{onXplorDismiss:"xplorDismiss"},defineCustomElement:Nh}),d3=$({tagName:"xplor-assistant",elementClass:rg,react:I,events:{onAssistantMessageSent:"assistantMessageSent",onAssistantMessageReceived:"assistantMessageReceived",onAssistantError:"assistantError",onAssistantSessionCreated:"assistantSessionCreated"},defineCustomElement:og}),p3=$({tagName:"xplor-autocomplete",elementClass:sg,react:I,events:{onXplorChange:"xplorChange",onXplorSelect:"xplorSelect",onXplorClear:"xplorClear",onXplorSearch:"xplorSearch"},defineCustomElement:lg}),h3=$({tagName:"xplor-avatar",elementClass:ug,react:I,events:{},defineCustomElement:fg}),g3=$({tagName:"xplor-avatar-and-name",elementClass:hg,react:I,events:{},defineCustomElement:gg}),u3=$({tagName:"xplor-badge",elementClass:nu,react:I,events:{},defineCustomElement:eu}),f3=$({tagName:"xplor-badge-active",elementClass:bg,react:I,events:{},defineCustomElement:yg}),m3=$({tagName:"xplor-badge-archived",elementClass:wg,react:I,events:{},defineCustomElement:_g}),x3=$({tagName:"xplor-badge-deleted",elementClass:Eg,react:I,events:{},defineCustomElement:Ig}),b3=$({tagName:"xplor-badge-expired",elementClass:Mg,react:I,events:{},defineCustomElement:Dg}),y3=$({tagName:"xplor-badge-inactive",elementClass:Ag,react:I,events:{},defineCustomElement:Lg}),v3=$({tagName:"xplor-badge-recalled",elementClass:Bg,react:I,events:{},defineCustomElement:Ng}),k3=$({tagName:"xplor-badge-session-booking",elementClass:jg,react:I,events:{},defineCustomElement:Xg}),w3=$({tagName:"xplor-badge-upcoming",elementClass:Ug,react:I,events:{},defineCustomElement:qg}),_3=$({tagName:"xplor-badge-waitlist",elementClass:Gg,react:I,events:{},defineCustomElement:Yg}),C3=$({tagName:"xplor-btn-back",elementClass:lu,react:I,events:{onXplorClick:"xplorClick"},defineCustomElement:cu}),S3=$({tagName:"xplor-btn-back-to-parent",elementClass:ou,react:I,events:{onBack:"back"},defineCustomElement:iu}),E3=$({tagName:"xplor-btn-icon",elementClass:hu,react:I,events:{onXplorClick:"xplorClick"},defineCustomElement:gu}),I3=$({tagName:"xplor-btn-menu",elementClass:mu,react:I,events:{onXplorClick:"xplorClick"},defineCustomElement:xu}),$3=$({tagName:"xplor-btn-toggle",elementClass:$u,react:I,events:{onXplorToggle:"xplorToggle"},defineCustomElement:Tu}),T3=$({tagName:"xplor-btn-toggle-group",elementClass:vu,react:I,events:{},defineCustomElement:ku}),M3=$({tagName:"xplor-btn-toggle-secondary",elementClass:Cu,react:I,events:{onXplorToggle:"xplorToggle"},defineCustomElement:Su}),D3=$({tagName:"xplor-btn-tooltip",elementClass:Lu,react:I,events:{},defineCustomElement:Pu}),z3=$({tagName:"xplor-button",elementClass:Ru,react:I,events:{},defineCustomElement:Bu}),O3=$({tagName:"xplor-canvas-editor",elementClass:ju,react:I,events:{onXplorShapeAdd:"xplorShapeAdd",onXplorShapeRemove:"xplorShapeRemove",onXplorShapeChange:"xplorShapeChange"},defineCustomElement:Xu}),A3=$({tagName:"xplor-chat-widget",elementClass:qu,react:I,events:{},defineCustomElement:Ku}),L3=$({tagName:"xplor-checkbox",elementClass:Qu,react:I,events:{onCheckboxChange:"checkboxChange"},defineCustomElement:Zu}),P3=$({tagName:"xplor-combobox",elementClass:tf,react:I,events:{onXplorChange:"xplorChange",onXplorSelect:"xplorSelect",onXplorCreate:"xplorCreate",onXplorClear:"xplorClear",onXplorSearch:"xplorSearch"},defineCustomElement:rf}),R3=$({tagName:"xplor-datatable",elementClass:sf,react:I,events:{onRowClick:"rowClick",onXplorSelectionChange:"xplorSelectionChange",onPaginationChange:"paginationChange",onSortChange:"sortChange"},defineCustomElement:lf}),B3=$({tagName:"xplor-date-picker",elementClass:gf,react:I,events:{onDateChange:"dateChange",onXplorFocus:"xplorFocus",onXplorBlur:"xplorBlur",onXplorClear:"xplorClear"},defineCustomElement:uf}),N3=$({tagName:"xplor-drag-and-drop-input",elementClass:bf,react:I,events:{onFileSelect:"fileSelect",onFileClear:"fileClear"},defineCustomElement:yf}),F3=$({tagName:"xplor-dropdown",elementClass:vf,react:I,events:{},defineCustomElement:kf}),H3=$({tagName:"xplor-expansion-panel",elementClass:Sf,react:I,events:{onXplorPanelToggle:"xplorPanelToggle"},defineCustomElement:Ef}),j3=$({tagName:"xplor-expansion-panels",elementClass:Tf,react:I,events:{},defineCustomElement:Mf}),X3=$({tagName:"xplor-file-upload",elementClass:Af,react:I,events:{onXplorFileAdd:"xplorFileAdd",onXplorFileRemove:"xplorFileRemove",onXplorError:"xplorError"},defineCustomElement:Lf}),V3=$({tagName:"xplor-inline-checkbox",elementClass:Bf,react:I,events:{onXplorChange:"xplorChange"},defineCustomElement:Nf}),W3=$({tagName:"xplor-inline-date-picker",elementClass:Ff,react:I,events:{onDateSelected:"dateSelected",onMonthChanged:"monthChanged"},defineCustomElement:Hf}),U3=$({tagName:"xplor-inline-switch",elementClass:Vf,react:I,events:{onXplorChange:"xplorChange"},defineCustomElement:Wf}),q3=$({tagName:"xplor-input-file",elementClass:Jf,react:I,events:{onAttach:"attach",onXplorClear:"xplorClear"},defineCustomElement:Gf}),K3=$({tagName:"xplor-input-search",elementClass:nm,react:I,events:{onSearch:"search"},defineCustomElement:em}),J3=$({tagName:"xplor-input-select",elementClass:om,react:I,events:{onXplorChange:"xplorChange"},defineCustomElement:im}),G3=$({tagName:"xplor-input-send",elementClass:lm,react:I,events:{onXplorSend:"xplorSend",onXplorValueChange:"xplorValueChange"},defineCustomElement:cm}),Y3=$({tagName:"xplor-input-text",elementClass:_m,react:I,events:{onXplorInput:"xplorInput",onXplorChange:"xplorChange",onXplorFocus:"xplorFocus",onXplorBlur:"xplorBlur"},defineCustomElement:Cm}),Q3=$({tagName:"xplor-input-text-area",elementClass:gm,react:I,events:{onXplorInput:"xplorInput",onXplorChange:"xplorChange",onXplorClear:"xplorClear"},defineCustomElement:um}),Z3=$({tagName:"xplor-input-text-secondary",elementClass:bm,react:I,events:{onXplorInput:"xplorInput",onXplorChange:"xplorChange",onXplorFocus:"xplorFocus",onXplorBlur:"xplorBlur"},defineCustomElement:ym}),nv=$({tagName:"xplor-input-title",elementClass:Im,react:I,events:{onXplorInput:"xplorInput",onXplorChange:"xplorChange"},defineCustomElement:$m}),ev=$({tagName:"xplor-links",elementClass:Dm,react:I,events:{},defineCustomElement:zm}),tv=$({tagName:"xplor-modal",elementClass:Rm,react:I,events:{onXplorClose:"xplorClose"},defineCustomElement:Bm}),rv=$({tagName:"xplor-modal-persistent",elementClass:Lm,react:I,events:{onXplorClose:"xplorClose"},defineCustomElement:Pm}),ov=$({tagName:"xplor-nav-tabs",elementClass:Hm,react:I,events:{onXplorChange:"xplorChange"},defineCustomElement:jm}),iv=$({tagName:"xplor-radio-btn",elementClass:Wm,react:I,events:{onRadioChange:"radioChange"},defineCustomElement:Um}),av=$({tagName:"xplor-rich-text-editor",elementClass:Ay,react:I,events:{onXplorChange:"xplorChange",onXplorFocus:"xplorFocus",onXplorBlur:"xplorBlur"},defineCustomElement:Ly}),sv=$({tagName:"xplor-section-card",elementClass:By,react:I,events:{},defineCustomElement:Ny}),lv=$({tagName:"xplor-section-heading",elementClass:jy,react:I,events:{},defineCustomElement:Xy}),cv=$({tagName:"xplor-table",elementClass:Uy,react:I,events:{onTableSelect:"tableSelect"},defineCustomElement:qy}),dv=$({tagName:"xplor-text-bubble",elementClass:Gy,react:I,events:{},defineCustomElement:Yy}),pv=$({tagName:"xplor-text-field",elementClass:n3,react:I,events:{onValueChange:"valueChange",onInputBlur:"inputBlur",onInputFocus:"inputFocus",onClearClick:"clearClick"},defineCustomElement:e3}),hv=$({tagName:"xplor-time-picker",elementClass:o3,react:I,events:{onTimeChange:"timeChange",onXplorFocus:"xplorFocus",onXplorBlur:"xplorBlur",onXplorClear:"xplorClear"},defineCustomElement:i3}),gv=$({tagName:"xplor-tooltip",elementClass:a3,react:I,events:{},defineCustomElement:s3}),uv=l3,fv=c3,mv=d3,xv=p3,bv=h3,yv=g3,vv=u3,kv=f3,wv=m3,_v=x3,Cv=b3,Sv=y3,Ev=v3,Iv=k3,$v=w3,Tv=_3,Mv=C3,Dv=S3,zv=E3,Ov=I3,Av=$3,Lv=T3,Pv=M3,Rv=D3,Bv=z3,Nv=O3,Fv=A3,Hv=L3,jv=P3,Xv=R3,Vv=B3,Wv=N3,Uv=F3,qv=H3,Kv=j3,Jv=X3,Gv=V3,Yv=W3,Qv=U3,Zv=q3,n4=K3,e4=J3,t4=G3,r4=Y3,o4=Q3,i4=Z3,a4=nv,s4=ev,l4=tv,c4=rv,d4=ov,p4=iv,h4=av,g4=sv,u4=lv,f4=cv,m4=dv,x4=pv,b4=hv,y4=gv;exports.XplorAlertDialog=uv;exports.XplorAlertMessage=fv;exports.XplorAssistant=mv;exports.XplorAutocomplete=xv;exports.XplorAvatar=bv;exports.XplorAvatarAndName=yv;exports.XplorBadge=vv;exports.XplorBadgeActive=kv;exports.XplorBadgeArchived=wv;exports.XplorBadgeDeleted=_v;exports.XplorBadgeExpired=Cv;exports.XplorBadgeInactive=Sv;exports.XplorBadgeRecalled=Ev;exports.XplorBadgeSessionBooking=Iv;exports.XplorBadgeUpcoming=$v;exports.XplorBadgeWaitlist=Tv;exports.XplorBtnBack=Mv;exports.XplorBtnBackToParent=Dv;exports.XplorBtnIcon=zv;exports.XplorBtnMenu=Ov;exports.XplorBtnToggle=Av;exports.XplorBtnToggleGroup=Lv;exports.XplorBtnToggleSecondary=Pv;exports.XplorBtnTooltip=Rv;exports.XplorButton=Bv;exports.XplorCanvasEditor=Nv;exports.XplorChatWidget=Fv;exports.XplorCheckbox=Hv;exports.XplorCombobox=jv;exports.XplorDatatable=Xv;exports.XplorDatePicker=Vv;exports.XplorDragAndDropInput=Wv;exports.XplorDropdown=Uv;exports.XplorExpansionPanel=qv;exports.XplorExpansionPanels=Kv;exports.XplorFileUpload=Jv;exports.XplorInlineCheckbox=Gv;exports.XplorInlineDatePicker=Yv;exports.XplorInlineSwitch=Qv;exports.XplorInputFile=Zv;exports.XplorInputSearch=n4;exports.XplorInputSelect=e4;exports.XplorInputSend=t4;exports.XplorInputText=r4;exports.XplorInputTextArea=o4;exports.XplorInputTextSecondary=i4;exports.XplorInputTitle=a4;exports.XplorLinks=s4;exports.XplorModal=l4;exports.XplorModalPersistent=c4;exports.XplorNavTabs=d4;exports.XplorRadioBtn=p4;exports.XplorRichTextEditor=h4;exports.XplorSectionCard=g4;exports.XplorSectionHeading=u4;exports.XplorTable=f4;exports.XplorTextBubble=m4;exports.XplorTextField=x4;exports.XplorTimePicker=b4;exports.XplorTooltip=y4;
|