PageSourceSearch

https://toolsaday.com/987.6a1cdabc1b27d945.js

js toolsaday.com collected 2026-10-03 23:35:55 UTC 344,975 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkttoools_web=self.webpackChunkttoools_web||[]).push([[987],{98485:(Nt,it,Oe)=>{Oe.d(it,{e:()=>D});const D=[{label:"\u{1f1e6}\u{1f1ea} Arabic",value:"Arabic"},{label:"\u{1f1e7}\u{1f1ec} Bulgarian",value:"Bulgarian"},{label:"\u{1f1e8}\u{1f1f3} Chinese (S)",value:"Chinese (S)"},{label:"\u{1f1f9}\u{1f1fc} Chinese (T)",value:"Chinese (T)"},{label:"\u{1f1e8}\u{1f1ff} Czech",value:"Czech"},{label:"\u{1f1e9}\u{1f1f0} Danish",value:"Danish"},{label:"\u{1f1f3}\u{1f1f1} Dutch",value:"Dutch"},{label:"\u{1f1fa}\u{1f1f8} English",value:"English"},{label:"\u{1f1ec}\u{1f1e7} English (UK)",value:"English (UK)"},{label:"\u{1f1e6}\u{1f1fa} English (AU)",value:"English (AU)"},{label:"\u{1f1ee}\u{1f1f7} Farsi",value:"Farsi"},{label:"\u{1f1f5}\u{1f1ed} Filipino",value:"Filipino"},{label:"\u{1f1eb}\u{1f1ee} Finnish",value:"Finnish"},{label:"\u{1f1eb}\u{1f1f7} French",value:"French"},{label:"\u{1f1e9}\u{1f1ea} German",value:"German"},{label:"\u{1f1ec}\u{1f1f7} Greek",value:"Greek"},{label:"\u{1f1ee}\u{1f1f1} Hebrew",value:"Hebrew"},{label:"\u{1f1ee}\u{1f1f3} Hindi",value:"Hindi"},{label:"\u{1f1ed}\u{1f1fa} Hungarian",value:"Hungarian"},{label:"\u{1f1ee}\u{1f1e9} Indonesian",value:"Indonesian"},{label:"\u{1f1ee}\u{1f1f9} Italian",value:"Italian"},{label:"\u{1f1ef}\u{1f1f5} Japanese",value:"Japanese"},{label:"\u{1f1f0}\u{1f1f7} Korean",value:"Korean"},{label:"\u{1f1f1}\u{1f1fb} Latvian",value:"Latvian"},{label:"\u{1f1f1}\u{1f1f9} Lithuanian",value:"Lithuanian"},{label:"\u{1f1f2}\u{1f1fe} Malay",value:"Malay"},{label:"\u{1f1f3}\u{1f1f4} Norwegian",value:"Norwegian"},{label:"\u{1f1f5}\u{1f1f1} Polish",value:"Polish"},{label:"\u{1f1f5}\u{1f1f9} Portuguese (Portugal)",value:"Portuguese (Portugal)"},{label:"\u{1f1e7}\u{1f1f7} Portuguese (Brazil)",value:"Portuguese (Brazil)"},{label:"\u{1f1f7}\u{1f1f4} Romanian",value:"Romanian"},{label:"\u{1f1f7}\u{1f1fa} Russian",value:"Russian"},{label:"\u{1f1f8}\u{1f1f0} Slovak",value:"Slovak"},{label:"\u{1f1f8}\u{1f1ee} Slovenian",value:"Slovenian"},{label:"\u{1f1ea}\u{1f1f8} Spanish",value:"Spanish"},{label:"\u{1f1f8}\u{1f1ea} Swedish",value:"Swedish"},{label:"\u{1f1f9}\u{1f1ed} Thai",value:"Thai"},{label:"\u{1f1f9}\u{1f1f7} Turkish",value:"Turkish"},{label:"\u{1f1fa}\u{1f1e6} Ukrainian",value:"Ukrainian"},{label:"\u{1f1fb}\u{1f1f3} Vietnamese",value:"Vietnamese"}]},98333:(Nt,it,Oe)=>{Oe.d(it,{Q:()=>ne});var D=Oe(45312),Ee=Oe(17705),ye=Oe(21626),ie=Oe(95416);let ne=(()=>{class Te{constructor(Fe,Ae){this.http=Fe,this.snackbar=Ae,this.endpoint=D.c.text_to_docx_url}downloadDocxV0(Fe,Ae="output.docx"){this.snackbar.open("Document is currently being exported, please wait...","",{duration:3e4}),this.http.post(this.endpoint+"ttdocx/",{pages:Fe}).subscribe(He=>{const Xe=this.base64ToBlob(He.docx_base64,"application/vnd.openxmlformats-officedocument.wordprocessingml.document"),Qe=window.URL.createObjectURL(Xe),Ke=document.createElement("a");Ke.href=Qe,Ke.download=Ae,Ke.click(),this.snackbar.open("Your document has been successfully exported. Thank you for waiting!")},He=>console.error(He))}downloadDocx(Fe,Ae="output.docx"){this.snackbar.open("Document is currently being exported, please wait...","",{duration:3e4});const $e={pages:Fe},He=Ae.replace(/[:\\\/\?\*\"\<\>\|\.{2,}]/g,"_").replace(/\s+/g,"_").replace(/_{2,}/g,"_"),De=He.endsWith(".docx")?He:He+".docx";this.http.post(this.endpoint+"ttdocx/",$e).subscribe(Xe=>{const Ke=this.base64ToBlob(Xe.docx_base64,"application/vnd.openxmlformats-officedocument.wordprocessingml.document"),Ne=window.URL.createObjectURL(Ke),xe=document.createElement("a");xe.href=Ne,xe.download=De,xe.click(),window.URL.revokeObjectURL(Ne),this.snackbar.open("Your document has been successfully exported. Thank you for waiting!")},Xe=>{console.error(Xe),this.snackbar.open("Error exporting document. Please try again.","",{duration:5e3})})}htmlToDocx(Fe,Ae="output.docx"){this.snackbar.open("Document is currently being exported, please wait...","",{duration:3e4}),this.http.post(this.endpoint+"ttdocx/html-to-docx",{html:Fe}).subscribe(He=>{const Xe=this.base64ToBlob(He.docx_base64,"application/vnd.openxmlformats-officedocument.wordprocessingml.document"),Qe=window.URL.createObjectURL(Xe),Ke=document.createElement("a");Ke.href=Qe,Ke.download=Ae,Ke.click(),this.snackbar.open("Your document has been successfully exported. Thank y
1ou for waiting!")},He=>console.error(He))}base64ToBlob(Fe,Ae){const He=atob(Fe),De=He.length,Xe=Math.ceil(De/512),Qe=new Array(Xe);for(let Ke=0;Ke<Xe;++Ke){const Ne=512*Ke,xe=Math.min(Ne+512,De),Z=new Array(xe-Ne);for(let fe=Ne,me=0;fe<xe;++me,++fe)Z[me]=He[fe].charCodeAt(0);Qe[Ke]=new Uint8Array(Z)}return new Blob(Qe,{type:Ae})}static{this.\u0275fac=function(Ae){return new(Ae||Te)(Ee.KVO(ye.Qq),Ee.KVO(ie.UG))}}static{this.\u0275prov=Ee.jDH({token:Te,factory:Te.\u0275fac,providedIn:"root"})}}return Te})()},57967:(Nt,it,Oe)=>{function D(v){if(null==v)return window;if("[object Window]"!==v.toString()){var k=v.ownerDocument;return k&&k.defaultView||window}return v}function Ee(v){return v instanceof D(v).Element||v instanceof Element}function ye(v){return v instanceof D(v).HTMLElement||v instanceof HTMLElement}function ie(v){return!(typeof ShadowRoot>"u")&&(v instanceof D(v).ShadowRoot||v instanceof ShadowRoot)}Oe.d(it,{Ay:()=>fi,qO:()=>Cr});var ne=Math.max,Te=Math.min,Pe=Math.round;function Fe(){var v=navigator.userAgentData;return null!=v&&v.brands&&Array.isArray(v.brands)?v.brands.map(function(k){return k.brand+"/"+k.version}).join(" "):navigator.userAgent}function Ae(){return!/^((?!chrome|android).)*safari/i.test(Fe())}function $e(v,k,O){void 0===k&&(k=!1),void 0===O&&(O=!1);var V=v.getBoundingClientRect(),q=1,te=1;k&&ye(v)&&(q=v.offsetWidth>0&&Pe(V.width)/v.offsetWidth||1,te=v.offsetHeight>0&&Pe(V.height)/v.offsetHeight||1);var ce=(Ee(v)?D(v):window).visualViewport,ue=!Ae()&&O,Re=(V.left+(ue&&ce?ce.offsetLeft:0))/q,be=(V.top+(ue&&ce?ce.offsetTop:0))/te,nt=V.width/q,et=V.height/te;return{width:nt,height:et,top:be,right:Re+nt,bottom:be+et,left:Re,x:Re,y:be}}function He(v){var k=D(v);return{scrollLeft:k.pageXOffset,scrollTop:k.pageYOffset}}function Qe(v){return v?(v.nodeName||"").toLowerCase():null}function Ke(v){return((Ee(v)?v.ownerDocument:v.document)||window.document).documentElement}function Ne(v){return $e(Ke(v)).left+He(v).scrollLeft}function xe(v){return D(v).getComputedStyle(v)}function Z(v){var k=xe(v);return/auto|scroll|overlay|hidden/.test(k.overflow+k.overflowY+k.overflowX)}function me(v,k,O){void 0===O&&(O=!1);var V=ye(k),q=ye(k)&&function fe(v){var k=v.getBoundingClientRect(),O=Pe(k.width)/v.offsetWidth||1,V=Pe(k.height)/v.offsetHeight||1;return 1!==O||1!==V}(k),te=Ke(k),ae=$e(v,q,O),ce={scrollLeft:0,scrollTop:0},ue={x:0,y:0};return(V||!V&&!O)&&(("body"!==Qe(k)||Z(te))&&(ce=function Xe(v){return v!==D(v)&&ye(v)?function De(v){return{scrollLeft:v.scrollLeft,scrollTop:v.scrollTop}}(v):He(v)}(k)),ye(k)?((ue=$e(k,!0)).x+=k.clientLeft,ue.y+=k.clientTop):te&&(ue.x=Ne(te))),{x:ae.left+ce.scrollLeft-ue.x,y:ae.top+ce.scrollTop-ue.y,width:ae.width,height:ae.height}}function oe(v){var k=$e(v),O=v.offsetWidth,V=v.offsetHeight;return Math.abs(k.width-O)<=1&&(O=k.width),Math.abs(k.height-V)<=1&&(V=k.height),{x:v.offsetLeft,y:v.offsetTop,width:O,height:V}}function Se(v){return"html"===Qe(v)?v:v.assignedSlot||v.parentNode||(ie(v)?v.host:null)||Ke(v)}function Ve(v){return["html","body","#document"].indexOf(Qe(v))>=0?v.ownerDocument.body:ye(v)&&Z(v)?v:Ve(Se(v))}function qe(v,k){var O;void 0===k&&(k=[]);var V=Ve(v),q=V===(null==(O=v.ownerDocument)?void 0:O.body),te=D(V),ae=q?[te].concat(te.visualViewport||[],Z(V)?V:[]):V,ce=k.concat(ae);return q?ce:ce.concat(qe(Se(ae)))}function wt(v){return["table","td","th"].indexOf(Qe(v))>=0}function ct(v){return ye(v)&&"fixed"!==xe(v).position?v.offsetParent:null}function yt(v){for(var k=D(v),O=ct(v);O&&wt(O)&&"static"===xe(O).position;)O=ct(O);return O&&("html"===Qe(O)||"body"===Qe(O)&&"static"===xe(O).position)?k:O||function rt(v){var k=/firefox/i.test(Fe());if(/Trident/i.test(Fe())&&ye(v)&&"fixed"===xe(v).position)return null;var q=Se(v);for(ie(q)&&(q=q.host);ye(q)&&["html","body"].indexOf(Qe(q))<0;){var te=xe(q);if("none"!==te.transform||"none"!==te.perspective||"paint"===te.contain||-1!==["transform","perspective"].indexOf(te.willChange)||k&&"filter"===te.willChange||k&&te.filter&&"none"!==te.filter)return q;q=q.parentNode}return null}(v)||k}var at="top",Ie="bottom",N="right",J="left",X="auto",ve=[at,Ie,N,J],Y="start",$="end",se="viewport",ge="popper",_e=ve.reduce(function(v,k){return v.concat([k+"-"+Y,k+"-"+$])}
1,[]),Ze=[].concat(ve,[X]).reduce(function(v,k){return v.concat([k,k+"-"+Y,k+"-"+$])},[]),An=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function yn(v){var k=new Map,O=new Set,V=[];function q(te){O.add(te.name),[].concat(te.requires||[],te.requiresIfExists||[]).forEach(function(ce){if(!O.has(ce)){var ue=k.get(ce);ue&&q(ue)}}),V.push(te)}return v.forEach(function(te){k.set(te.name,te)}),v.forEach(function(te){O.has(te.name)||q(te)}),V}function Nn(v){var k;return function(){return k||(k=new Promise(function(O){Promise.resolve().then(function(){k=void 0,O(v())})})),k}}var rn={placement:"bottom",modifiers:[],strategy:"absolute"};function Fn(){for(var v=arguments.length,k=new Array(v),O=0;O<v;O++)k[O]=arguments[O];return!k.some(function(V){return!(V&&"function"==typeof V.getBoundingClientRect)})}function Kt(v){void 0===v&&(v={});var O=v.defaultModifiers,V=void 0===O?[]:O,q=v.defaultOptions,te=void 0===q?rn:q;return function(ce,ue,Re){void 0===Re&&(Re=te);var be={placement:"bottom",orderedModifiers:[],options:Object.assign({},rn,te),modifiersData:{},elements:{reference:ce,popper:ue},attributes:{},styles:{}},nt=[],et=!1,Ye={state:be,setOptions:function(Be){var tt="function"==typeof Be?Be(be.options):Be;Ue(),be.options=Object.assign({},te,be.options,tt),be.scrollParents={reference:Ee(ce)?qe(ce):ce.contextElement?qe(ce.contextElement):[],popper:qe(ue)};var lt=function Zt(v){var k=yn(v);return An.reduce(function(O,V){return O.concat(k.filter(function(q){return q.phase===V}))},[])}(function xn(v){var k=v.reduce(function(O,V){var q=O[V.name];return O[V.name]=q?Object.assign({},q,V,{options:Object.assign({},q.options,V.options),data:Object.assign({},q.data,V.data)}):V,O},{});return Object.keys(k).map(function(O){return k[O]})}([].concat(V,be.options.modifiers)));return be.orderedModifiers=lt.filter(function(z){return z.enabled}),function Ge(){be.orderedModifiers.forEach(function(We){var tt=We.options,z=We.effect;if("function"==typeof z){var Je=z({state:be,name:We.name,instance:Ye,options:void 0===tt?{}:tt});nt.push(Je||function(){})}})}(),Ye.update()},forceUpdate:function(){if(!et){var Be=be.elements,tt=Be.reference,lt=Be.popper;if(Fn(tt,lt)){be.rects={reference:me(tt,yt(lt),"fixed"===be.options.strategy),popper:oe(lt)},be.reset=!1,be.placement=be.options.placement,be.orderedModifiers.forEach(function(kt){return be.modifiersData[kt.name]=Object.assign({},kt.data)});for(var z=0;z<be.orderedModifiers.length;z++)if(!0!==be.reset){var Je=be.orderedModifiers[z],Le=Je.fn,ut=Je.options;"function"==typeof Le&&(be=Le({state:be,options:void 0===ut?{}:ut,name:Je.name,instance:Ye})||be)}else be.reset=!1,z=-1}}},update:Nn(function(){return new Promise(function(We){Ye.forceUpdate(),We(be)})}),destroy:function(){Ue(),et=!0}};if(!Fn(ce,ue))return Ye;function Ue(){nt.forEach(function(We){return We()}),nt=[]}return Ye.setOptions(Re).then(function(We){!et&&Re.onFirstUpdate&&Re.onFirstUpdate(We)}),Ye}}var on={passive:!0};function Bt(v){return v.split("-")[0]}function Rt(v){return v.split("-")[1]}function Qt(v){return["top","bottom"].indexOf(v)>=0?"x":"y"}function Wt(v){var ue,k=v.reference,O=v.element,V=v.placement,q=V?Bt(V):null,te=V?Rt(V):null,ae=k.x+k.width/2-O.width/2,ce=k.y+k.height/2-O.height/2;switch(q){case at:ue={x:ae,y:k.y-O.height};break;case Ie:ue={x:ae,y:k.y+k.height};break;case N:ue={x:k.x+k.width,y:ce};break;case J:ue={x:k.x-O.width,y:ce};break;default:ue={x:k.x,y:k.y}}var Re=q?Qt(q):null;if(null!=Re){var be="y"===Re?"height":"width";switch(te){case Y:ue[Re]=ue[Re]-(k[be]/2-O[be]/2);break;case $:ue[Re]=ue[Re]+(k[be]/2-O[be]/2)}}return ue}var g={top:"auto",right:"auto",bottom:"auto",left:"auto"};function M(v){var k,O=v.popper,V=v.popperRect,q=v.placement,te=v.variation,ae=v.offsets,ce=v.position,ue=v.gpuAcceleration,Re=v.adaptive,be=v.roundOffsets,nt=v.isFixed,et=ae.x,Ye=void 0===et?0:et,Ge=ae.y,Ue=void 0===Ge?0:Ge,We="function"==typeof be?be({x:Ye,y:Ue}):{x:Ye,y:Ue};Ye=We.x,Ue=We.y;var Be=ae.hasOwnProperty("x"),tt=ae.hasOwnProperty("y"),lt=J,z=at,Je=window;if(Re){var Le=yt(O),ut="clientHeight",pt="clientWidth";Le===D(O)&&"static"!==xe(Le=Ke(O)).position&&"absolute"===ce&&(ut="scrollHeight",pt="scrollWidth"),(q===at||(q===J||q===N)&&te===$)&&(z=Ie,Ue-=(nt&&Le===Je&&Je.visualVie
1wport?Je.visualViewport.height:Le[ut])-V.height,Ue*=ue?1:-1),q!==J&&(q!==at&&q!==Ie||te!==$)||(lt=N,Ye-=(nt&&Le===Je&&Je.visualViewport?Je.visualViewport.width:Le[pt])-V.width,Ye*=ue?1:-1)}var gt,Dt=Object.assign({position:ce},Re&&g),Tt=!0===be?function m(v,k){var V=v.y,q=k.devicePixelRatio||1;return{x:Pe(v.x*q)/q||0,y:Pe(V*q)/q||0}}({x:Ye,y:Ue},D(O)):{x:Ye,y:Ue};return Ye=Tt.x,Ue=Tt.y,Object.assign({},Dt,ue?((gt={})[z]=tt?"0":"",gt[lt]=Be?"0":"",gt.transform=(Je.devicePixelRatio||1)<=1?"translate("+Ye+"px, "+Ue+"px)":"translate3d("+Ye+"px, "+Ue+"px, 0)",gt):((k={})[z]=tt?Ue+"px":"",k[lt]=Be?Ye+"px":"",k.transform="",k))}const ke={name:"applyStyles",enabled:!0,phase:"write",fn:function H(v){var k=v.state;Object.keys(k.elements).forEach(function(O){var V=k.styles[O]||{},q=k.attributes[O]||{},te=k.elements[O];!ye(te)||!Qe(te)||(Object.assign(te.style,V),Object.keys(q).forEach(function(ae){var ce=q[ae];!1===ce?te.removeAttribute(ae):te.setAttribute(ae,!0===ce?"":ce)}))})},effect:function le(v){var k=v.state,O={popper:{position:k.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(k.elements.popper.style,O.popper),k.styles=O,k.elements.arrow&&Object.assign(k.elements.arrow.style,O.arrow),function(){Object.keys(k.elements).forEach(function(V){var q=k.elements[V],te=k.attributes[V]||{},ce=Object.keys(k.styles.hasOwnProperty(V)?k.styles[V]:O[V]).reduce(function(ue,Re){return ue[Re]="",ue},{});!ye(q)||!Qe(q)||(Object.assign(q.style,ce),Object.keys(te).forEach(function(ue){q.removeAttribute(ue)}))})}},requires:["computeStyles"]};var s={left:"right",right:"left",bottom:"top",top:"bottom"};function c(v){return v.replace(/left|right|bottom|top/g,function(k){return s[k]})}var h={start:"end",end:"start"};function w(v){return v.replace(/start|end/g,function(k){return h[k]})}function U(v,k){var O=k.getRootNode&&k.getRootNode();if(v.contains(k))return!0;if(O&&ie(O)){var V=k;do{if(V&&v.isSameNode(V))return!0;V=V.parentNode||V.host}while(V)}return!1}function G(v){return Object.assign({},v,{left:v.x,top:v.y,right:v.x+v.width,bottom:v.y+v.height})}function ot(v,k,O){return k===se?G(function C(v,k){var O=D(v),V=Ke(v),q=O.visualViewport,te=V.clientWidth,ae=V.clientHeight,ce=0,ue=0;if(q){te=q.width,ae=q.height;var Re=Ae();(Re||!Re&&"fixed"===k)&&(ce=q.offsetLeft,ue=q.offsetTop)}return{width:te,height:ae,x:ce+Ne(v),y:ue}}(v,O)):Ee(k)?function Me(v,k){var O=$e(v,!1,"fixed"===k);return O.top=O.top+v.clientTop,O.left=O.left+v.clientLeft,O.bottom=O.top+v.clientHeight,O.right=O.left+v.clientWidth,O.width=v.clientWidth,O.height=v.clientHeight,O.x=O.left,O.y=O.top,O}(k,O):G(function P(v){var k,O=Ke(v),V=He(v),q=null==(k=v.ownerDocument)?void 0:k.body,te=ne(O.scrollWidth,O.clientWidth,q?q.scrollWidth:0,q?q.clientWidth:0),ae=ne(O.scrollHeight,O.clientHeight,q?q.scrollHeight:0,q?q.clientHeight:0),ce=-V.scrollLeft+Ne(v),ue=-V.scrollTop;return"rtl"===xe(q||O).direction&&(ce+=ne(O.clientWidth,q?q.clientWidth:0)-te),{width:te,height:ae,x:ce,y:ue}}(Ke(v)))}function wn(v){return Object.assign({},{top:0,right:0,bottom:0,left:0},v)}function Xn(v,k){return k.reduce(function(O,V){return O[V]=v,O},{})}function bn(v,k){void 0===k&&(k={});var V=k.placement,q=void 0===V?v.placement:V,te=k.strategy,ae=void 0===te?v.strategy:te,ce=k.boundary,ue=void 0===ce?"clippingParents":ce,Re=k.rootBoundary,be=void 0===Re?se:Re,nt=k.elementContext,et=void 0===nt?ge:nt,Ye=k.altBoundary,Ge=void 0!==Ye&&Ye,Ue=k.padding,We=void 0===Ue?0:Ue,Be=wn("number"!=typeof We?We:Xn(We,ve)),lt=v.rects.popper,z=v.elements[Ge?et===ge?"reference":ge:et],Je=function jt(v,k,O,V){var q="clippingParents"===k?function Ct(v){var k=qe(Se(v)),V=["absolute","fixed"].indexOf(xe(v).position)>=0&&ye(v)?yt(v):v;return Ee(V)?k.filter(function(q){return Ee(q)&&U(q,V)&&"body"!==Qe(q)}):[]}(v):[].concat(k),te=[].concat(q,[O]),ce=te.reduce(function(ue,Re){var be=ot(v,Re,V);return ue.top=ne(be.top,ue.top),ue.right=Te(be.right,ue.right),ue.bottom=Te(be.bottom,ue.bottom),ue.left=ne(be.left,ue.left),ue},ot(v,te[0],V));return ce.width=ce.right-ce.left,ce.height=ce.bottom-ce.top,ce.x=ce.left,ce.y=ce.top,ce}(Ee(z)?z:z.contextElement||Ke(v.elements.popper),ue,be,ae),Le=$e(v.elements.reference),ut=Wt({reference:Le,element:lt,strategy:"absolute",placement:q}),pt=G(Object.assign({},lt,ut)),vt=et===ge?pt:Le,kt={top:Je.top-vt.top+Be.top,bottom:vt.bottom-Je.bottom+Be.bottom,left:Je.left-vt.left+Be.left,right:vt.right-Je.right+Be.right},Dt=v.modifiersData.offset;if(et===ge&&Dt){var Tt=Dt[q];Object.keys(kt).forEach(function(gt){var Ft=[N,Ie].indexOf(gt)>=0?1:-1,qt=[at,Ie].indexOf(gt)>=0?"y":"x";kt[gt]+=Tt[qt]*Ft})}return kt}function zn(v,k,O){return ne(v,Te(k,O))}function wr(v,k,O){return void 0===O&&(O={x:0,y:0}),{top:v.top-k.height-O.y,right:v.right-k.width+O.x,bottom:v.bottom-k.height+O.y,left:v.left-k.width-O.x}}function Sr(v){return[at,N,Ie,J].some(function(k){return v[k]>=0})}var ri=Kt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function sn(v){var k=v.state,O=v.instance,V=v.options,q=V.scroll,te=void 0===q||q,ae=V.resize,ce=void 0===ae||ae,ue=D(k.elements.popper),Re=[].concat(k.scrollParents.reference,k.scrollParents.popper);return te&&Re.forEach(function(be){be.addEventListener("scroll",O.update,on)}),ce&&ue.addEventListener("resize",O.update,on),function(){te&&Re.forEach(function(be){be.removeEventListener("scroll",O.update,on)}),ce&&ue.removeEventListener("resize",O.update,on)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function an(v){var k=v.state;k.modifiersData[v.name]=Wt({reference:k.rects.reference,element:k.rects.popper,strategy:"absolute",placement:k.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function R(v){var k=v.state,O=v.options,V=O.gpuAcceleration,q=void 0===V||V,te=O.adaptive,ae=void 0===te||te,ce=O.roundOffsets,ue=void 0===ce||ce,Re={placement:Bt(k.placement),variation:Rt(k.placement),popper:k.elements.popper,popperRect:k.rects.popper,gpuAcceleration:q,isFixed:"fixed"===k.options.strategy};null!=k.modifiersData.popperOffsets&&(k.styles.popper=Object.assign({},k.styles.popper,M(Object.assign({},Re,{offsets:k.modifiersData.popperOffsets,position:k.options.strategy,adaptive:ae,roundOffsets:ue})))),null!=k.modifiersData.arrow&&(k.styles.arrow=Object.assign({},k.styles.arrow,M(Object.assign({},Re,{offsets:k.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:ue})))),k.attributes.popper=Object.assign({},k.attributes.popper,{"data-popper-placement":k.placement})},data:{}},ke,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function ze(v){var k=v.state,V=v.name,q=v.options.offset,te=void 0===q?[0,0]:q,ae=Ze.reduce(function(be,nt){return be[nt]=function he(v,k,O){var V=Bt(v),q=[J,at].indexOf(V)>=0?-1:1,te="function"==typeof O?O(Object.assign({},k,{placement:v})):O,ae=te[0],ce=te[1];return ae=ae||0,ce=(ce||0)*q,[J,N].indexOf(V)>=0?{x:ce,y:ae}:{x:ae,y:ce}}(nt,k.rects,te),be},{}),ce=ae[k.placement],Re=ce.y;null!=k.modifiersData.popperOffsets&&(k.modifiersData.popperOffsets.x+=ce.x,k.modifiersData.popperOffsets.y+=Re),k.modifiersData[V]=ae}},{name:"flip",enabled:!0,phase:"main",fn:function ti(v){var k=v.state,O=v.options,V=v.name;if(!k.modifiersData[V]._skip){for(var q=O.mainAxis,te=void 0===q||q,ae=O.altAxis,ce=void 0===ae||ae,ue=O.fallbackPlacements,Re=O.padding,be=O.boundary,nt=O.rootBoundary,et=O.altBoundary,Ye=O.flipVariations,Ge=void 0===Ye||Ye,Ue=O.allowedAutoPlacements,We=k.options.placement,Be=Bt(We),lt=ue||(Be!==We&&Ge?function vr(v){if(Bt(v)===X)return[];var k=c(v);return[w(v),k,w(k)]}(We):[c(We)]),z=[We].concat(lt).reduce(function(l,d){return l.concat(Bt(d)===X?function ei(v,k){void 0===k&&(k={});var q=k.boundary,te=k.rootBoundary,ae=k.padding,ce=k.flipVariations,ue=k.allowedAutoPlacements,Re=void 0===ue?Ze:ue,be=Rt(k.placement),nt=be?ce?_e:_e.filter(function(Ge){return Rt(Ge)===be}):ve,et=nt.filter(function(Ge){return Re.indexOf(Ge)>=0});0===et.length&&(et=nt);var Ye=et.reduce(function(Ge,Ue){return Ge[Ue]=bn(v,{placement:Ue,boundary:q,rootBoundary:te,padding:ae})[Bt(Ue)],Ge},{});return Object.keys(Ye).sort(function(Ge,Ue){return Ye[Ge]-Ye[Ue]})}(k,{placement:d,boundary:be,rootBoundary:nt,padding:Re,flipVariations:Ge,allowedAutoPlacements:Ue}):d)},[]),Je=k.rects.reference,Le=k.rects.popper,ut=new Map,pt=!0,vt=z[0],kt=0;kt<z.length;kt++){var Dt=z[kt],Tt=Bt(Dt),gt=Rt(Dt)===Y,Ft=[at,Ie].indexOf(Tt)>=0,qt=Ft?"width":"height",_t=bn(k,{placement:Dt,boundary:be,rootBoundary:nt,altBoundary:et,padding:Re}),$t=Ft?gt?N:J:gt?Ie:at;Je[qt]>Le[qt]&&($t=c($t));var Lt=c($t),hn=[];if(te&&hn.push(_t[Tt]<=0),ce&&hn.push(_t[$t]<=0,_t[Lt]<=0),hn.every(function(l){return l})){vt=Dt,pt=!1;break}ut.set(Dt,hn)}if(pt)for(var t=function(d){var f=z.find(function(b){var x=ut.get(b);if(x)return x.slice(0,d).every(function(A){return A})});if(f)return vt=f,"break"},e=Ge?3:1;e>0&&"break"!==t(e);e--);k.placement!==vt&&(k.modifiersData[V]._skip=!0,k.placement=vt,k.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function $r(v){var k=v.state,O=v.options,V=v.name,q=O.mainAxis,te=void 0===q||q,ae=O.altAxis,ce=void 0!==ae&&ae,et=O.tether,Ye=void 0===et||et,Ge=O.tetherOffset,Ue=void 0===Ge?0:Ge,We=bn(k,{boundary:O.boun
1dary,rootBoundary:O.rootBoundary,padding:O.padding,altBoundary:O.altBoundary}),Be=Bt(k.placement),tt=Rt(k.placement),lt=!tt,z=Qt(Be),Je=function _n(v){return"x"===v?"y":"x"}(z),Le=k.modifiersData.popperOffsets,ut=k.rects.reference,pt=k.rects.popper,vt="function"==typeof Ue?Ue(Object.assign({},k.rects,{placement:k.placement})):Ue,kt="number"==typeof vt?{mainAxis:vt,altAxis:vt}:Object.assign({mainAxis:0,altAxis:0},vt),Dt=k.modifiersData.offset?k.modifiersData.offset[k.placement]:null,Tt={x:0,y:0};if(Le){if(te){var gt,Ft="y"===z?at:J,qt="y"===z?Ie:N,_t="y"===z?"height":"width",$t=Le[z],Lt=$t+We[Ft],hn=$t-We[qt],mn=Ye?-pt[_t]/2:0,t=tt===Y?ut[_t]:pt[_t],e=tt===Y?-pt[_t]:-ut[_t],r=k.elements.arrow,l=Ye&&r?oe(r):{width:0,height:0},d=k.modifiersData["arrow#persistent"]?k.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},f=d[Ft],b=d[qt],x=zn(0,ut[_t],l[_t]),A=lt?ut[_t]/2-mn-x-f-kt.mainAxis:t-x-f-kt.mainAxis,I=lt?-ut[_t]/2+mn+x+b+kt.mainAxis:e+x+b+kt.mainAxis,i=k.elements.arrow&&yt(k.elements.arrow),n=i?"y"===z?i.clientTop||0:i.clientLeft||0:0,o=null!=(gt=Dt?.[z])?gt:0,u=$t+I-o,p=zn(Ye?Te(Lt,$t+A-o-n):Lt,$t,Ye?ne(hn,u):hn);Le[z]=p,Tt[z]=p-$t}if(ce){var y,B=Le[Je],L="y"===Je?"height":"width",_=B+We["x"===z?at:J],W=B-We["x"===z?Ie:N],j=-1!==[at,J].indexOf(Be),ee=null!=(y=Dt?.[Je])?y:0,re=j?_:B-ut[L]-pt[L]-ee+kt.altAxis,pe=j?B+ut[L]+pt[L]-ee-kt.altAxis:W,Ce=Ye&&j?function vn(v,k,O){var V=zn(v,k,O);return V>O?O:V}(re,B,pe):zn(Ye?re:_,B,Ye?pe:W);Le[Je]=Ce,Tt[Je]=Ce-B}k.modifiersData[V]=Tt}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function xr(v){var k,O=v.state,V=v.name,q=v.options,te=O.elements.arrow,ae=O.modifiersData.popperOffsets,ce=Bt(O.placement),ue=Qt(ce),be=[J,N].indexOf(ce)>=0?"height":"width";if(te&&ae){var nt=function(k,O){return wn("number"!=typeof(k="function"==typeof k?k(Object.assign({},O.rects,{placement:O.placement})):k)?k:Xn(k,ve))}(q.padding,O),et=oe(te),Ye="y"===ue?at:J,Ge="y"===ue?Ie:N,Ue=O.rects.reference[be]+O.rects.reference[ue]-ae[ue]-O.rects.popper[be],We=ae[ue]-O.rects.reference[ue],Be=yt(te),tt=Be?"y"===ue?Be.clientHeight||0:Be.clientWidth||0:0,Le=tt/2-et[be]/2+(Ue/2-We/2),ut=zn(nt[Ye],Le,tt-et[be]-nt[Ge]);O.modifiersData[V]=((k={})[ue]=ut,k.centerOffset=ut-Le,k)}},effect:function lr(v){var k=v.state,V=v.options.element,q=void 0===V?"[data-popper-arrow]":V;null!=q&&("string"==typeof q&&!(q=k.elements.popper.querySelector(q))||U(k.elements.popper,q)&&(k.elements.arrow=q))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function Mr(v){var k=v.state,O=v.name,V=k.rects.reference,q=k.rects.popper,te=k.modifiersData.preventOverflow,ae=bn(k,{elementContext:"reference"}),ce=bn(k,{altBoundary:!0}),ue=wr(ae,V),Re=wr(ce,q,te),be=Sr(ue),nt=Sr(Re);k.modifiersData[O]={referenceClippingOffsets:ue,popperEscapeOffsets:Re,isReferenceHidden:be,hasPopperEscaped:nt},k.attributes.popper=Object.assign({},k.attributes.popper,{"data-popper-reference-hidden":be,"data-popper-escaped":nt})}}]}),Cr='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',Or="tippy-content",Zn="tippy-backdrop",Vn="tippy-arrow",Pn="tippy-svg-arrow",tn={passive:!0,capture:!0},Er=function(){return document.body};function Qn(v,k,O){return Array.isArray(v)?v[k]??(Array.isArray(O)?O[k]:O):v}function cn(v,k){var O={}.toString.call(v);return 0===O.indexOf("[object")&&O.indexOf(k+"]")>-1}function ar(v,k){return"function"==typeof v?v.apply(void 0,k):v}function Dr(v,k){return 0===k?v:function(V){clearTimeout(O),O=setTimeout(function(){v(V)},k)};var O}function dn(v){return[].concat(v)}function Ar(v,k){-1===v.indexOf(k)&&v.push(k)}function Cn(v){return[].slice.call(v)}function Nr(v){return Object.keys(v).reduce(function(k,O){return void 0!==v[O]&&(k[O]=v[O]),k},{})}function On(){return document.createElement("div")}function En(v){return["Element","Fragment"].some(function(k){return cn(v,k)})}function dr(v,k){v.forEach(function(O){O&&(O.style.transitionDuration=k+"ms")})}function Hn(v,k){v.forEach(function(O){O&&O.setAttribute("data-state",k)})}function er(v,k,O){var V=k+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(q){v[V](q,O)})}function Ur(v,k){for(var O=k;O;){var V;if(v.contains(O))return!0;O=null==O.getRootNode||null==(V=O.getRootNode())?void 0:V.host}return!1}var fn={isTouch:!1},Jr=0;function qr(){fn.isTouch||(fn.isTouch=!0,window.performance&&document.addEventListener("mousemove",zt))}function zt(){var v=performance.now();v-Jr<20&&(fn.isTouch=!1,document.removeEventListener("mousemove",zt)),Jr=v}function Ht(){var v=document.activeElement;(function Pr(v){return!(!v||!v._tippy||v._tippy.reference!==v)})(v)&&v.blur&&!v._tippy.state.isVisible&&v.blur()}var oi=!!(typeof window<"u"&&typeof document<"u")&&!!window.msCrypto,Jt=Object.assign({appendTo:Er,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Br=Object.keys(Jt);function Lr(v){var O=(v.plugins||[]).reduce(function(V,q){var ce,te=q.name;return te&&(V[te]=void 0!==v[te]?v[te]:null!=(ce=Jt[te])?ce:q.defaultValue),V},{});return Object.assign({},v,O)}function pr(v,k){var O=Object.assign({}
1,k,{content:ar(k.content,[v])},k.ignoreAttributes?{}:function ai(v,k){return(k?Object.keys(Lr(Object.assign({},Jt,{plugins:k}))):Br).reduce(function(q,te){var ae=(v.getAttribute("data-tippy-"+te)||"").trim();if(!ae)return q;if("content"===te)q[te]=ae;else try{q[te]=JSON.parse(ae)}catch{q[te]=ae}return q},{})}(v,k.plugins));return O.aria=Object.assign({},Jt.aria,O.aria),O.aria={expanded:"auto"===O.aria.expanded?k.interactive:O.aria.expanded,content:"auto"===O.aria.content?k.interactive?null:"describedby":O.aria.content},O}var ci=function(){return"innerHTML"};function hr(v,k){v[ci()]=k}function ir(v){var k=On();return!0===v?k.className=Vn:(k.className=Pn,En(v)?k.appendChild(v):hr(k,v)),k}function or(v,k){En(k.content)?(hr(v,""),v.appendChild(k.content)):"function"!=typeof k.content&&(k.allowHTML?hr(v,k.content):v.textContent=k.content)}function mr(v){var k=v.firstElementChild,O=Cn(k.children);return{box:k,content:O.find(function(V){return V.classList.contains(Or)}),arrow:O.find(function(V){return V.classList.contains(Vn)||V.classList.contains(Pn)}),backdrop:O.find(function(V){return V.classList.contains(Zn)})}}function ui(v){var k=On(),O=On();O.className="tippy-box",O.setAttribute("data-state","hidden"),O.setAttribute("tabindex","-1");var V=On();function q(te,ae){var ce=mr(k),ue=ce.box,Re=ce.content,be=ce.arrow;ae.theme?ue.setAttribute("data-theme",ae.theme):ue.removeAttribute("data-theme"),"string"==typeof ae.animation?ue.setAttribute("data-animation",ae.animation):ue.removeAttribute("data-animation"),ae.inertia?ue.setAttribute("data-inertia",""):ue.removeAttribute("data-inertia"),ue.style.maxWidth="number"==typeof ae.maxWidth?ae.maxWidth+"px":ae.maxWidth,ae.role?ue.setAttribute("role",ae.role):ue.removeAttribute("role"),(te.content!==ae.content||te.allowHTML!==ae.allowHTML)&&or(Re,v.props),ae.arrow?be?te.arrow!==ae.arrow&&(ue.removeChild(be),ue.appendChild(ir(ae.arrow))):ue.appendChild(ir(ae.arrow)):be&&ue.removeChild(be)}return V.className=Or,V.setAttribute("data-state","hidden"),or(V,v.props),k.appendChild(O),O.appendChild(V),q(v.props,v.props),{popper:k,onUpdate:q}}ui.$$tippy=!0;var Fr=1,jn=[],gr=[];function Un(v,k){var V,q,te,be,nt,et,Ue,O=pr(v,Object.assign({},Jt,Lr(Nr(k)))),ae=!1,ce=!1,ue=!1,Re=!1,Ye=[],Ge=Dr(a,O.interactiveDebounce),We=Fr++,tt=function cr(v){return v.filter(function(k,O){return v.indexOf(k)===O})}(O.plugins),z={id:We,reference:v,popper:On(),popperInstance:null,props:O,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:tt,clearDelayTimeouts:function re(){clearTimeout(V),clearTimeout(q),cancelAnimationFrame(te)},setProps:function pe(de){if(!z.state.isDestroyed){Lt("onBeforeUpdate",[z,de]),n();var je=z.props,st=pr(v,Object.assign({},je,Nr(de),{ignoreAttributes:!0}));z.props=st,i(),je.interactiveDebounce!==st.interactiveDebounce&&(t(),Ge=Dr(a,st.interactiveDebounce)),je.triggerTarget&&!st.triggerTarget?dn(je.triggerTarget).forEach(function(Et){Et.removeAttribute("aria-expanded")}):st.triggerTarget&&v.removeAttribute("aria-expanded"),mn(),$t(),ut&&ut(je,st),z.popperInstance&&(S(),L().forEac
1h(function(Et){requestAnimationFrame(Et._tippy.popperInstance.forceUpdate)})),Lt("onAfterUpdate",[z,de])}},setContent:function Ce(de){z.setProps({content:de})},show:function dt(){var de=z.state.isVisible,je=z.state.isDestroyed,st=!z.state.isEnabled,Et=fn.isTouch&&!z.props.touch,bt=Qn(z.props.duration,0,Jt.duration);if(!(de||je||st||Et||gt().hasAttribute("disabled")||(Lt("onShow",[z],!1),!1===z.props.onShow(z)))){if(z.state.isVisible=!0,Tt()&&(Le.style.visibility="visible"),$t(),d(),z.state.isMounted||(Le.style.transition="none"),Tt()){var nn=qt();dr([nn.box,nn.content],0)}et=function(){var Vr;if(z.state.isVisible&&!Re){if(Re=!0,Le.style.transition=z.props.moveTransition,Tt()&&z.props.animation){var ki=qt(),yi=ki.box,Qr=ki.content;dr([yi,Qr],bt),Hn([yi,Qr],"visible")}hn(),mn(),Ar(gr,z),null==(Vr=z.popperInstance)||Vr.forceUpdate(),Lt("onMount",[z]),z.props.animation&&Tt()&&function x(de,je){A(de,je)}(bt,function(){z.state.isShown=!0,Lt("onShown",[z])})}},function B(){var je,de=z.props.appendTo,st=gt();(je=z.props.interactive&&de===Er||"parent"===de?st.parentNode:ar(de,[st])).contains(Le)||je.appendChild(Le),z.state.isMounted=!0,S()}()}},hide:function mt(){var de=!z.state.isVisible,je=z.state.isDestroyed,st=!z.state.isEnabled,Et=Qn(z.props.duration,1,Jt.duration);if(!(de||je||st)&&(Lt("onHide",[z],!1),!1!==z.props.onHide(z))){if(z.state.isVisible=!1,z.state.isShown=!1,Re=!1,ae=!1,Tt()&&(Le.style.visibility="hidden"),t(),f(),$t(!0),Tt()){var bt=qt(),nn=bt.box,Dn=bt.content;z.props.animation&&(dr([nn,Dn],Et),Hn([nn,Dn],"hidden"))}hn(),mn(),z.props.animation?Tt()&&function b(de,je){A(de,function(){!z.state.isVisible&&Le.parentNode&&Le.parentNode.contains(Le)&&je()})}(Et,z.unmount):z.unmount()}},hideWithInteractivity:function Pt(de){Ft().addEventListener("mousemove",Ge),Ar(jn,Ge),Ge(de)},enable:function j(){z.state.isEnabled=!0},disable:function ee(){z.hide(),z.state.isEnabled=!1},unmount:function At(){z.state.isVisible&&z.hide(),z.state.isMounted&&(E(),L().forEac
1h(function(de){de._tippy.unmount()}),Le.parentNode&&Le.parentNode.removeChild(Le),gr=gr.filter(function(de){return de!==z}),z.state.isMounted=!1,Lt("onHidden",[z]))},destroy:function en(){z.state.isDestroyed||(z.clearDelayTimeouts(),z.unmount(),n(),delete v._tippy,z.state.isDestroyed=!0,Lt("onDestroy",[z]))}};if(!O.render)return z;var Je=O.render(z),Le=Je.popper,ut=Je.onUpdate;Le.setAttribute("data-tippy-root",""),Le.id="tippy-"+z.id,z.popper=Le,v._tippy=z,Le._tippy=z;var pt=tt.map(function(de){return de.fn(z)}),vt=v.hasAttribute("aria-expanded");return i(),mn(),$t(),Lt("onCreate",[z]),O.showOnCreate&&_(),Le.addEventListener("mouseenter",function(){z.props.interactive&&z.state.isVisible&&z.clearDelayTimeouts()}),Le.addEventListener("mouseleave",function(){z.props.interactive&&z.props.trigger.indexOf("mouseenter")>=0&&Ft().addEventListener("mousemove",Ge)}),z;function kt(){var de=z.props.touch;return Array.isArray(de)?de:[de,0]}function Dt(){return"hold"===kt()[0]}function Tt(){var de;return!(null==(de=z.props.render)||!de.$$tippy)}function gt(){return Ue||v}function Ft(){var de=gt().parentNode;return de?function Ir(v){var k,V=dn(v)[0];return null!=V&&null!=(k=V.ownerDocument)&&k.body?V.ownerDocument:document}(de):document}function qt(){return mr(Le)}function _t(de){return z.state.isMounted&&!z.state.isVisible||fn.isTouch||be&&"focus"===be.type?0:Qn(z.props.delay,de?0:1,Jt.delay)}function $t(de){void 0===de&&(de=!1),Le.style.pointerEvents=z.props.interactive&&!de?"":"none",Le.style.zIndex=""+z.props.zIndex}function Lt(de,je,st){var Et;void 0===st&&(st=!0),pt.forEach(function(bt){bt[de]&&bt[de].apply(bt,je)}),st&&(Et=z.props)[de].apply(Et,je)}function hn(){var de=z.props.aria;if(de.content){var je="aria-"+de.content,st=Le.id;dn(z.props.triggerTarget||v).forEach(function(bt){var nn=bt.getAttribute(je);if(z.state.isVisible)bt.setAttribute(je,nn?nn+" "+st:st);else{var Dn=nn&&nn.replace(st,"").trim();Dn?bt.setAttribute(je,Dn):bt.removeAttribute(je)}})}}function mn(){!vt&&z.props.aria.expanded&&dn(z.props.triggerTarget||v).forEach(function(je){z.props.interactive?je.setAttribute("aria-expanded",z.state.isVisible&&je===gt()?"true":"false"):je.removeAttribute("aria-expanded")})}function t(){Ft().removeEventListener("mousemove",Ge),jn=jn.filter(function(de){return de!==Ge})}function e(de){if(!fn.isTouch||!ue&&"mousedown"!==de.type){var je=de.composedPath&&de.composedPath()[0]||de.target;if(!z.props.interactive||!Ur(Le,je)){if(dn(z.props.triggerTarget||v).some(function(st){return Ur(st,je)})){if(fn.isTouch||z.state.isVisible&&z.props.trigger.indexOf("click")>=0)return}else Lt("onClickOutside",[z,de]);!0===z.props.hideOnClick&&(z.clearDelayTimeouts(),z.hide(),ce=!0,setTimeout(function(){ce=!1}),z.state.isMounted||f())}}}function r(){ue=!0}function l(){ue=!1}function d(){var de=Ft();de.addEventListener("mousedown",e,!0),de.addEventListener("touchend",e,tn),de.addEventListener("touchstart",l,tn),de.addEventListener("touchmove",r,tn)}function f(){var de=Ft();de.removeEventListener("mousedown",e,!0),de.removeEventListener("touchend",e,tn),de.removeEventListener("touchstart",l,tn),de.removeEventListener("touchmove",r,tn)}function A(de,je){var st=qt().box;function Et(bt){bt.target===st&&(er(st,"remove",Et),je())}if(0===de)return je();er(st,"remove",nt),er(st,"add",Et),nt=Et}function I(de,je,st){void 0===st&&(st=!1),dn(z.props.triggerTarget||v).forEach(function(bt){bt.addEventListener(de,je,st),Ye.push({node:bt,eventType:de,handler:je,options:st})})}function i(){Dt()&&(I("touchstart",o,{passive:!0}),I("touchend",u,{passive:!0})),function un(v){return v.split(/\s+/).filter(Boolean)}(z.props.trigger).forEach(function(de){if("manual"!==de)switch(I(de,o),de){case"mouseenter":I("mouseleave",u);break;case"focus":I(oi?"focusout":"blur",p);break;case"focusin":I("focusout",p)}})}function n(){Ye.forEach(function(de){de.node.removeEventListener(de.eventType,de.handler,de.options)}),Ye=[]}function o(de){var je,st=!1;if(z.state.isEnabled&&!y(de)&&!ce){var Et="focus"===(null==(je=be)?void 0:je.type);be=de,Ue=de.currentTarget,mn(),!z.state.isVisible&&function ur(v){return cn(v,"MouseEvent")}(de)&&jn.forEach(function(bt){return bt(de)}
1),"click"===de.type&&(z.props.trigger.indexOf("mouseenter")<0||ae)&&!1!==z.props.hideOnClick&&z.state.isVisible?st=!0:_(de),"click"===de.type&&(ae=!st),st&&!Et&&W(de)}}function a(de){var je=de.target,st=gt().contains(je)||Le.contains(je);"mousemove"===de.type&&st||function jr(v,k){var O=k.clientX,V=k.clientY;return v.every(function(q){var te=q.popperRect,ae=q.popperState,ue=q.props.interactiveBorder,Re=function Wr(v){return v.split("-")[0]}(ae.placement),be=ae.modifiersData.offset;return!be||te.top-V+("bottom"===Re?be.top.y:0)>ue||V-te.bottom-("top"===Re?be.bottom.y:0)>ue||te.left-O+("right"===Re?be.left.x:0)>ue||O-te.right-("left"===Re?be.right.x:0)>ue})}(L().concat(Le).map(function(bt){var nn,Zr=null==(nn=bt._tippy.popperInstance)?void 0:nn.state;return Zr?{popperRect:bt.getBoundingClientRect(),popperState:Zr,props:O}:null}).filter(Boolean),de)&&(t(),W(de))}function u(de){if(!(y(de)||z.props.trigger.indexOf("click")>=0&&ae)){if(z.props.interactive)return void z.hideWithInteractivity(de);W(de)}}function p(de){z.props.trigger.indexOf("focusin")<0&&de.target!==gt()||z.props.interactive&&de.relatedTarget&&Le.contains(de.relatedTarget)||W(de)}function y(de){return!!fn.isTouch&&Dt()!==de.type.indexOf("touch")>=0}function S(){E();var de=z.props,je=de.popperOptions,st=de.placement,Et=de.offset,bt=de.getReferenceClientRect,nn=de.moveTransition,Dn=Tt()?mr(Le).arrow:null,Zr=bt?{getBoundingClientRect:bt,contextElement:bt.contextElement||gt()}:v,Vr=[{name:"offset",options:{offset:Et}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!nn}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(yi){var Qr=yi.state;if(Tt()){var xi=qt().box;["placement","reference-hidden","escaped"].forEach(function(bi){"placement"===bi?xi.setAttribute("data-placement",Qr.placement):Qr.attributes.popper["data-popper-"+bi]?xi.setAttribute("data-"+bi,""):xi.removeAttribute("data-"+bi)}),Qr.attributes.popper={}}}}];Tt()&&Dn&&Vr.push({name:"arrow",options:{element:Dn,padding:3}}),Vr.push.apply(Vr,je?.modifiers||[]),z.popperInstance=ri(Zr,Le,Object.assign({},je,{placement:st,onFirstUpdate:et,modifiers:Vr}))}function E(){z.popperInstance&&(z.popperInstance.destroy(),z.popperInstance=null)}function L(){return Cn(Le.querySelectorAll("[data-tippy-root]"))}function _(de){z.clearDelayTimeouts(),de&&Lt("onTrigger",[z,de]),d();var je=_t(!0),st=kt(),bt=st[1];fn.isTouch&&"hold"===st[0]&&bt&&(je=bt),je?V=setTimeout(function(){z.show()},je):z.show()}function W(de){if(z.clearDelayTimeouts(),Lt("onUntrigger",[z,de]),z.state.isVisible){if(!(z.props.trigger.indexOf("mouseenter")>=0&&z.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(de.type)>=0&&ae)){var je=_t(!1);je?q=setTimeout(function(){z.state.isVisible&&z.hide()},je):te=requestAnimationFrame(function(){z.hide()})}}else f()}}function Tn(v,k){void 0===k&&(k={});var O=Jt.plugins.concat(k.plugins||[]);!function tr(){document.addEventListener("touchstart",qr,tn),window.addEventListener("blur",Ht)}();var V=Object.assign({},k,{plugins:O}),ce=function Rr(v){return En(v)?[v]:function Kn(v){return cn(v,"NodeList")}(v)?Cn(v):Array.isArray(v)?v:Cn(document.querySelectorAll(v))}(v).reduce(function(ue,Re){var be=Re&&Un(Re,V);return be&&ue.push(be),ue},[]);return En(v)?ce[0]:ce}Tn.defaultProps=Jt,Tn.setDefaultProps=function(k){Object.keys(k).forEach(function(V){Jt[V]=k[V]})},Tn.currentInput=fn,Object.assign({},ke,{effect:function(k){var O=k.state,V={popper:{position:O.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(O.elements.popper.style,V.popper),O.styles=V,O.elements.arrow&&Object.assign(O.elements.arrow.style,V.arrow)}}),Tn.setDefaultProps({render:ui});const fi=Tn},89153:(Nt,it,Oe)=>{Oe.d(it,{KE:()=>_t,YY:()=>Ut,CU:()=>bn,bP:()=>e,Yv:()=>r,gk:()=>he,AB:()=>d,T7:()=>ai,Nx:()=>ci,gu:()=>Un,FF:()=>sr,iI:()=>m,hO:()=>yr,q4:()=>Fr,iR:()=>lr,Op:()=>kn,BQ:()=>qn,eE:()=>$n,OX:()=>$t,Zc:()=>l,KV:()=>H,jT:()=>Lt,MG:()=>It,JJ:()=>hn,tG:()=>t});var D=Oe(17398),Ee=Oe(77154),ye=Oe(8620),ie=Oe(17533),ne=Oe(66085);const Te=(i,n)=>!i.selection.empty&&(n&&n(i.tr.deleteSelection().scrollIntoView()),!0);function Pe(i,n){let{$cursor:o}=i.selection;return!o||(n?!n.endOfTextblock("backward",i):o.parentOffset>0)?null:o}const Fe=(i,n,o)=>{let a=Pe(i,o);if(!a)return!1;let u=Qe(a);if(!u){let y=a.blockRange(),S=y&&(0,ne.jP)(y);return null!=S&&(n&&n(i.tr.lift(y,S).scrollIntoView()),!0)}let p=u.nodeBefore;if(X(i,u,n,-1))return!0;
1if(0==a.parent.content.size&&(De(p,"end")||D.nh.isSelectable(p)))for(let y=a.depth;;y--){let S=(0,ne.$L)(i.doc,a.before(y),a.after(y),ie.Ji.empty);if(S&&S.slice.size<S.to-S.from){if(n){let E=i.tr.step(S);E.setSelection(De(p,"end")?D.LN.findFrom(E.doc.resolve(E.mapping.map(u.pos,-1)),-1):D.nh.create(E.doc,u.pos-p.nodeSize)),n(E.scrollIntoView())}return!0}if(1==y||a.node(y-1).childCount>1)break}return!(!p.isAtom||u.depth!=a.depth-1||(n&&n(i.tr.delete(u.pos-p.nodeSize,u.pos).scrollIntoView()),0))};function He(i,n,o){let u=n.nodeBefore,p=n.pos-1;for(;!u.isTextblock;p--){if(u.type.spec.isolating)return!1;let L=u.lastChild;if(!L)return!1;u=L}let S=n.nodeAfter,E=n.pos+1;for(;!S.isTextblock;E++){if(S.type.spec.isolating)return!1;let L=S.firstChild;if(!L)return!1;S=L}let B=(0,ne.$L)(i.doc,p,E,ie.Ji.empty);if(!B||B.from!=p||B instanceof ne.Ln&&B.slice.size>=E-p)return!1;if(o){let L=i.tr.step(B);L.setSelection(D.U3.create(L.doc,p)),o(L.scrollIntoView())}return!0}function De(i,n,o=!1){for(let a=i;a;a="start"==n?a.firstChild:a.lastChild){if(a.isTextblock)return!0;if(o&&1!=a.childCount)return!1}return!1}const Xe=(i,n,o)=>{let{$head:a,empty:u}=i.selection,p=a;if(!u)return!1;if(a.parent.isTextblock){if(o?!o.endOfTextblock("backward",i):a.parentOffset>0)return!1;p=Qe(a)}let y=p&&p.nodeBefore;return!(!y||!D.nh.isSelectable(y)||(n&&n(i.tr.setSelection(D.nh.create(i.doc,p.pos-y.nodeSize)).scrollIntoView()),0))};function Qe(i){if(!i.parent.type.spec.isolating)for(let n=i.depth-1;n>=0;n--){if(i.index(n)>0)return i.doc.resolve(i.before(n+1));if(i.node(n).type.spec.isolating)break}return null}function Ke(i,n){let{$cursor:o}=i.selection;return!o||(n?!n.endOfTextblock("forward",i):o.parentOffset<o.parent.content.size)?null:o}const Ne=(i,n,o)=>{let a=Ke(i,o);if(!a)return!1;let u=Z(a);if(!u)return!1;let p=u.nodeAfter;if(X(i,u,n,1))return!0;if(0==a.parent.content.size&&(De(p,"start")||D.nh.isSelectable(p))){let y=(0,ne.$L)(i.doc,a.before(),a.after(),ie.Ji.empty);if(y&&y.slice.size<y.to-y.from){if(n){let S=i.tr.step(y);S.setSelection(De(p,"start")?D.LN.findFrom(S.doc.resolve(S.mapping.map(u.pos)),1):D.nh.create(S.doc,S.mapping.map(u.pos))),n(S.scrollIntoView())}return!0}}return!(!p.isAtom||u.depth!=a.depth-1||(n&&n(i.tr.delete(u.pos,u.pos+p.nodeSize).scrollIntoView()),0))},xe=(i,n,o)=>{let{$head:a,empty:u}=i.selection,p=a;if(!u)return!1;if(a.parent.isTextblock){if(o?!o.endOfTextblock("forward",i):a.parentOffset<a.parent.content.size)return!1;p=Z(a)}let y=p&&p.nodeAfter;return!(!y||!D.nh.isSelectable(y)||(n&&n(i.tr.setSelection(D.nh.create(i.doc,p.pos)).scrollIntoView()),0))};function Z(i){if(!i.parent.type.spec.isolating)for(let n=i.depth-1;n>=0;n--){let o=i.node(n);if(i.index(n)+1<o.childCount)return i.doc.resolve(i.after(n+1));if(o.type.spec.isolating)break}return null}const Se=(i,n)=>{let{$head:o,$anchor:a}=i.selection;return!(!o.parent.type.spec.code||!o.sameParent(a)||(n&&n(i.tr.insertText("\n").scrollIntoView()),0))};function Ve(i){for(let n=0;n<i.edgeCount;n++){let{type:o}=i.edge(n);if(o.isTextblock&&!o.hasRequiredAttrs())return o}return null}const qe=(i,n)=>{let{$head:o,$anchor:a}=i.selection;if(!o.parent.type.spec.code||!o.sameParent(a))return!1;let u=o.node(-1),p=o.indexAfter(-1),y=Ve(u.contentMatchAt(p));if(!y||!u.canReplaceWith(p,p,y))return!1;if(n){let S=o.after(),E=i.tr.replaceWith(S,S,y.createAndFill());E.setSelection(D.LN.near(E.doc.resolve(S),1)),n(E.scrollIntoView())}return!0},wt=(i,n)=>{let o=i.selection,{$from:a,$to:u}=o;if(o instanceof D.i5||a.parent.inlineContent||u.parent.inlineContent)return!1;let p=Ve(u.parent.contentMatchAt(u.indexAfter()));if(!p||!p.isTextblock)return!1;if(n){let y=(!a.parentOffset&&u.index()<u.parent.childCount?a:u).pos,S=i.tr.insert(y,p.createAndFill());S.setSelection(D.U3.create(S.doc,y+1)),n(S.scrollIntoView())}return!0},ct=(i,n)=>{let{$cursor:o}=i.selection;if(!o||o.parent.content.size)return!1;if(o.depth>1&&o.after()!=o.end(-1)){let p=o.before();if((0,ne.zy)(i.doc,p))return n&&n(i.tr.split(p).scrollIntoView()),!0}let a=o.blockRange(),u=a&&(0,ne.jP)(a);return null!=u&&(n&&n(i.tr.lift(a,u).scrollIntoView()),!0)},yt=function rt(i){return(n,o)=>{let{$from:a,$to:u}=n.selection;if(n.selection instanceof D.nh&&n.selection.node.isBlock)return!(!a.parentOffset||!(0,ne.zy)(n.doc,a.pos)||(o&&o(n.tr.split(a.pos).scrollIntoView()),0));if(!a.depth)return!1;let y,S,p=[],E=!1,B=!1;for(let j=a.depth;;j--){if(a.node(j).isBlock){E=a.end(j)==a.pos+(a.depth-j),B=a.start(j)==a.pos-(a.depth-j),S=Ve(a.node(j-1).contentMatchAt(a.indexAfter(j-1)));let re=i&&i(u.parent,E,a);p.unshift(re||(E&&S?{type:S}:null)),y=j;break}if(1==j)return!1;p.unshift(null)}let L=n.tr;(n.selection instanceof D.U3||n.selection instanceof D.i5)&&L.deleteSelection();let _=L.mapping.map(a.pos),W=(0,ne.zy)(L.doc,_,p.length,p);if(W||(p[0]=S?{type:S}:null,W=(0,ne.zy)(L.doc,_,p.length,p)),!W)return!1;if(L.split(_,p.length,p),!E&&B&&a.node(y).type!=S){let j=L.mapping.map(a.before(y)),ee=L.doc.resolve(j);S&&a.node(y-1).canReplaceWith(ee.index(),ee.index()+1,S)&&L.setNodeMarkup(L.mapping.map(a.before(y)),S)}return o&&o(L.scrollIntoView()),!0}}();function X(i,n,o,a){let y,S,u=n.nodeBefore,p=n.nodeAfter,E=u.type.spec.isolating||p.type.spec.isolating;if(!E&&function J(i,n,o){let a=n.nodeBefore,u=n.nodeAfter,p=n.index();return!(!(a&&u&&a.type.compatibleContent(u.type))||(!a.content.size&&n.parent.canReplace(p-1,p)?(o&&o(i.tr.delete(n.pos-a.nodeSize,n.pos).scrollIntoView()),0):!n.parent.canReplace(p,p+1)||!u.isTextblock&&!(0,ne.n9)(i.doc,n.pos)||(o&&o(i.tr.join(n.pos).scrollIntoView()),0)))}(i,n,o))return!0;let B=!E&&n.parent.canReplace(n.index(),n.index()+1);if(B&&(y=(S=u.contentMatchAt(u.childCount)).findWrapping(p.type))&&S.matchType(y[0]||p.type).validEnd){if(o){let j=n.pos+p.nodeSize,ee=ie.FK.empty;for(let Ce=y.length-1;Ce>=0;Ce--)ee=ie.FK.from(y[Ce].create(null,ee));ee=ie.FK.from(u.copy(ee));let re=i.tr.step(new ne.Wg(n.pos-1,j,n.pos,j,new ie.Ji(ee,1,0),y.length,!0)),pe=re.doc.resolve(j+2*y.length);pe.nodeAfter&&pe.nodeAfter.type==u.type&&(0,ne.n9)(re.doc,pe.pos)&&re.join(pe.pos),o(re.scrollIntoView())}return!0}let L=p.type.spec.isolating||a>0&&E?null:D.LN.findFrom(n,1),_=L&&L.$from.blockRange(L.$to),W=_&&(0,ne.jP)(_);if(null!=W&&W>=n.depth)return o&&o(i.tr.lift(_,W).scrollIntoView()),!0;if(B&&De(p,"start",!0)&&De(u,"end")){let j=u,ee=[];for(;ee.push(j),!j.isTextblock;)j=j.lastChild;let re=p,pe=1;for(;!re.isTextblock;re=re.firstChild)pe++;if(j.canReplace(j.childCount,j.childCount,re.content)){if(o){let Ce=ie.FK.empty;for(let mt=ee.length-1;mt>=0;mt--)Ce=ie.FK.from(ee[mt].copy(Ce));o(i.tr.step(new ne.Wg(n.pos-ee.length,n.pos+p.nodeSize,n.pos+pe,n.pos+p.nodeSize-pe,new ie.Ji(Ce,ee.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ve(i){return function(n,o){let a=n.selection,u=i<0?a.$from:a.$to,p=u.depth;for(;u.node(p).isInline;){if(!p)return!1;p--}return!!u.node(p).isTextblock&&(o&&o(n.tr.setSelection(D.U3.create(n.doc,i<0?u.start(p):u.end(p)))),!0)}}const Y=ve(-1),$=ve(1);function se(i,n=null){return function(o,a){let u=!1;for(let p=0;p<o.selection.ranges.length&&!u;p++){let{$from:{pos:y},$to:{pos:S}}=o.selection.ranges[p];o.doc.nodesBetween(y,S,(E,B)=>
1{if(u)return!1;if(E.isTextblock&&!E.hasMarkup(i,n))if(E.type==i)u=!0;else{let L=o.doc.resolve(B),_=L.index();u=L.parent.canReplaceWith(_,_+1,i)}})}if(!u)return!1;if(a){let p=o.tr;for(let y=0;y<o.selection.ranges.length;y++){let{$from:{pos:S},$to:{pos:E}}=o.selection.ranges[y];p.setBlockType(S,E,i,n)}a(p.scrollIntoView())}return!0}}function Ot(...i){return function(n,o,a){for(let u=0;u<i.length;u++)if(i[u](n,o,a))return!0;return!1}}let St=Ot(Te,Fe,Xe),Mt=Ot(Te,Ne,xe);const ht={Enter:Ot(Se,wt,ct,yt),"Mod-Enter":qe,Backspace:St,"Mod-Backspace":St,"Shift-Backspace":St,Delete:Mt,"Mod-Delete":Mt,"Mod-a":(i,n)=>(n&&n(i.tr.setSelection(new D.i5(i.doc))),!0)},xt={"Ctrl-h":ht.Backspace,"Alt-Backspace":ht["Mod-Backspace"],"Ctrl-d":ht.Delete,"Ctrl-Alt-Backspace":ht["Mod-Delete"],"Alt-Delete":ht["Mod-Delete"],"Alt-d":ht["Mod-Delete"],"Ctrl-a":Y,"Ctrl-e":$};for(let i in ht)xt[i]=ht[i];function an(i){const{state:n,transaction:o}=i;let{selection:a}=o,{doc:u}=o,{storedMarks:p}=o;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 p},get selection(){return a},get doc(){return u},get tr(){return a=o.selection,u=o.doc,p=o.storedMarks,o}}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform();class K{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:o,state:a}=this,{view:u}=o,{tr:p}=a,y=this.buildProps(p);return Object.fromEntries(Object.entries(n).map(([S,E])=>[S,(...L)=>{const _=E(...L)(y);return!p.getMeta("preventDispatch")&&!this.hasCustomState&&u.dispatch(p),_}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,o=!0){const{rawCommands:a,editor:u,state:p}=this,{view:y}=u,S=[],E=!!n,B=n||p.tr,_={...Object.fromEntries(Object.entries(a).map(([W,j])=>[W,(...re)=>{const pe=this.buildProps(B,o),Ce=j(...re)(pe);return S.push(Ce),_}])),run:()=>(!E&&o&&!B.getMeta("preventDispatch")&&!this.hasCustomState&&y.dispatch(B),S.every(W=>!0===W))};return _}createCan(n){const{rawCommands:o,state:a}=this,p=n||a.tr,y=this.buildProps(p,!1);return{...Object.fromEntries(Object.entries(o).map(([E,B])=>[E,(...L)=>B(...L)({...y,dispatch:void 0})])),chain:()=>this.createChain(p,!1)}}buildProps(n,o=!0){const{rawCommands:a,editor:u,state:p}=this,{view:y}=u,S={tr:n,editor:u,view:y,state:an({state:p,transaction:n}),dispatch:o?()=>{}:void 0,chain:()=>this.createChain(n,o),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(a).map(([E,B])=>[E,(...L)=>B(...L)(S)]))}};return S}}class g{constructor(){this.callbacks={}}on(n,o){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(o),this}emit(n,...o){const a=this.callbacks[n];return a&&a.forEach(u=>u.apply(this,o)),this}off(n,o){const a=this.callbacks[n];return a&&(o?this.callbacks[n]=a.filter(u=>u!==o):delete this.callbacks[n]),this}once(n,o){const a=(...u)=>{this.off(n,a),o.apply(this,u)};return this.on(n,a)}removeAllListeners(){this.callbacks={}}}function m(i,n,o){return void 0===i.config[n]&&i.parent?m(i.parent,n,o):"function"==typeof i.config[n]?i.config[n].bind({...o,parent:i.parent?m(i.parent,n,o):null}):i.config[n]}function M(i){return{baseExtensions:i.filter(u=>"extension"===u.type),nodeExtensions:i.filter(u=>"node"===u.type),markExtensions:i.filter(u=>"mark"===u.type)}}function R(i){const n=[],{nodeExtensions:o,markExtensions:a}=M(i),u=[...o,...a],p={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return i.forEach(y=>{const E=m(y,"addGlobalAttributes",{name:y.name,options:y.options,storage:y.storage,extensions:u});E&&E().forEach(L=>{L.types.forEach(_=>{Object.entries(L.attributes).forEach(([W,j])=>{n.push({type:_,name:W,attribute:{...p,...j}})})})})}),u.forEach(y=>{const E=m(y,"addAttributes",{name:y.name,options:y.options,storage:y.storage});if(!E)return;const B=E();
1Object.entries(B).forEach(([L,_])=>{const W={...p,..._};"function"==typeof W?.default&&(W.default=W.default()),W?.isRequired&&void 0===W?.default&&delete W.default,n.push({type:y.name,name:L,attribute:W})})}),n}function F(i,n){if("string"==typeof i){if(!n.nodes[i])throw Error(`There is no node type named '${i}'. Maybe you forgot to add the extension?`);return n.nodes[i]}return i}function H(...i){return i.filter(n=>!!n).reduce((n,o)=>{const a={...n};return Object.entries(o).forEach(([u,p])=>{if(a[u])if("class"===u){const S=p?String(p).split(" "):[],E=a[u]?a[u].split(" "):[],B=S.filter(L=>!E.includes(L));a[u]=[...E,...B].join(" ")}else if("style"===u){const S=p?p.split(";").map(L=>L.trim()).filter(Boolean):[],E=a[u]?a[u].split(";").map(L=>L.trim()).filter(Boolean):[],B=new Map;E.forEach(L=>{const[_,W]=L.split(":").map(j=>j.trim());B.set(_,W)}),S.forEach(L=>{const[_,W]=L.split(":").map(j=>j.trim());B.set(_,W)}),a[u]=Array.from(B.entries()).map(([L,_])=>`${L}: ${_}`).join("; ")}else a[u]=p;else a[u]=p}),a},{})}function le(i,n){return n.filter(o=>o.type===i.type.name).filter(o=>o.attribute.rendered).map(o=>o.attribute.renderHTML?o.attribute.renderHTML(i.attrs)||{}:{[o.name]:i.attrs[o.name]}).reduce((o,a)=>H(o,a),{})}function ke(i){return"function"==typeof i}function he(i,n=void 0,...o){return ke(i)?n?i.bind(n)(...o):i(...o):i}function s(i,n){return"style"in i?i:{...i,getAttrs:o=>{const a=i.getAttrs?i.getAttrs(o):i.attrs;if(!1===a)return!1;const u=n.reduce((p,y)=>{const S=y.attribute.parseHTML?y.attribute.parseHTML(o):function T(i){return"string"!=typeof i?i:i.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(i):"true"===i||"false"!==i&&i}(o.getAttribute(y.name));return null==S?p:{...p,[y.name]:S}},{});return{...a,...u}}}}function c(i){return Object.fromEntries(Object.entries(i).filter(([n,o])=>("attrs"!==n||!function ze(i={}){return 0===Object.keys(i).length&&i.constructor===Object}(o))&&null!=o))}function w(i,n){return n.nodes[i]||n.marks[i]||null}function C(i,n){return Array.isArray(n)?n.some(o=>("string"==typeof o?o:o.name)===i.name):n}function P(i,n){const o=ie.ZF.fromSchema(n).serializeFragment(i),u=document.implementation.createHTMLDocument().createElement("div");return u.appendChild(o),u.innerHTML}const U=(i,n=500)=>{let o="";const a=i.parentOffset;return i.parent.nodesBetween(Math.max(0,a-n),a,(u,p,y,S)=>{var E,B;const L=(null===(B=(E=u.type.spec).toText)||void 0===B?void 0:B.call(E,{node:u,pos:p,parent:y,index:S}))||u.textContent||"%leaf%";o+=u.isAtom&&!u.isText?L:L.slice(0,Math.max(0,a-p))}),o};function G(i){return"[object RegExp]"===Object.prototype.toString.call(i)}class Me{constructor(n){this.find=n.find,this.handler=n.handler}}const ot=(i,n)=>{if(G(n))return n.exec(i);const o=n(i);if(!o)return null;const a=[o.text];return a.index=o.index,a.input=i,a.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),a.push(o.replaceWith)),a};function Ct(i){var n;const{editor:o,from:a,to:u,text:p,rules:y,plugin:S}=i,{view:E}=o;if(E.composing)return!1;const B=E.state.doc.resolve(a);if(B.parent.type.spec.code||null!==(n=B.nodeBefore||B.nodeAfter)&&void 0!==n&&n.marks.find(W=>W.type.spec.code))return!1;let L=!1;const _=U(B)+p;return y.forEach(W=>{if(L)return;const j=ot(_,W.find);if(!j)return;const ee=E.state.tr,re=an({state:E.state,transaction:ee}),pe={from:a-(j[0].length-p.length),to:u},{commands:Ce,chain:dt,can:mt}=new K({editor:o,state:re});null===W.handler({state:re,range:pe,match:j,commands:Ce,chain:dt,can:mt})||!ee.steps.length||(ee.setMeta(S,{transform:ee,from:a,to:u,text:p}),E.dispatch(ee),L=!0)}),L}function jt(i){const{editor:n,rules:o}=i,a=new D.k_({state:{init:()=>null,apply(u,p,y){const S=u.getMeta(a);if(S)return S;const E=u.getMeta("applyInputRules");return!!E&&setTimeout(()=>{let{text:L}=E;"string"==typeof L||(L=P(ie.FK.from(L),y.schema));const{from:_}=E;Ct({editor:n,from:_,to:_+L.length,text:L,rules:o,plugin:a})}),u.selectionSet||u.docChanged?null:p}},props:{handleTextInput:(u,p,y,S)=>Ct({editor:n,from:p,to:y,text:S,rules:o,plugin:a}),handleDOMEvents:{compositionend:u=>(setTimeout(()=>
1{const{$cursor:p}=u.state.selection;p&&Ct({editor:n,from:p.pos,to:p.pos,text:"",rules:o,plugin:a})}),!1)},handleKeyDown(u,p){if("Enter"!==p.key)return!1;const{$cursor:y}=u.state.selection;return!!y&&Ct({editor:n,from:y.pos,to:y.pos,text:"\n",rules:o,plugin:a})}},isInputRules:!0});return a}function wn(i){return"Object"===function Gn(i){return Object.prototype.toString.call(i).slice(8,-1)}(i)&&i.constructor===Object&&Object.getPrototypeOf(i)===Object.prototype}function Xn(i,n){const o={...i};return wn(i)&&wn(n)&&Object.keys(n).forEach(a=>{o[a]=wn(n[a])&&wn(i[a])?Xn(i[a],n[a]):n[a]}),o}class bn{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=he(m(this,"addOptions",{name:this.name}))),this.storage=he(m(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new bn(n)}configure(n={}){const o=this.extend({...this.config,addOptions:()=>Xn(this.options,n)});return o.name=this.name,o.parent=this.parent,o}extend(n={}){const o=new bn(n);return o.parent=this,this.child=o,o.name=n.name?n.name:o.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: "${o.name}".`),o.options=he(m(o,"addOptions",{name:o.name})),o.storage=he(m(o,"addStorage",{name:o.name,options:o.options})),o}static handleExit({editor:n,mark:o}){const{tr:a}=n.state,u=n.state.selection.$from;if(u.pos===u.end()){const y=u.marks();if(!y.find(B=>B?.type.name===o.name))return!1;const E=y.find(B=>B?.type.name===o.name);return E&&a.removeStoredMark(E),a.insertText(" ",u.pos),n.view.dispatch(a),!0}return!1}}class vr{constructor(n){this.find=n.find,this.handler=n.handler}}let _n=null;function vn(i){const{editor:n,rules:o}=i;let S,a=null,u=!1,p=!1,y=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null;try{S=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{S=null}const E=({state:L,from:_,to:W,rule:j,pasteEvt:ee})=>{const re=L.tr,pe=an({state:L,transaction:re});if(function kr(i){const{editor:n,state:o,from:a,to:u,rule:p,pasteEvent:y,dropEvent:S}=i,{commands:E,chain:B,can:L}=new K({editor:n,state:o}),_=[];return o.doc.nodesBetween(a,u,(j,ee)=>{if(!j.isTextblock||j.type.spec.code)return;const re=Math.max(a,ee),pe=Math.min(u,ee+j.content.size);((i,n,o)=>{if(G(n))return[...i.matchAll(n)];const a=n(i,o);return a?a.map(u=>{const p=[u.text];return p.index=u.index,p.input=i,p.data=u.data,u.replaceWith&&(u.text.includes(u.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),p.push(u.replaceWith)),p}):[]})(j.textBetween(re-ee,pe-ee,void 0,"\ufffc"),p.find,y).forEach(mt=>{if(void 0===mt.index)return;const Pt=re+mt.index+1,At=Pt+mt[0].length,en={from:o.tr.mapping.map(Pt),to:o.tr.mapping.map(At)},de=p.handler({state:o,range:en,match:mt,commands:E,chain:B,can:L,pasteEvent:y,dropEvent:S});_.push(de)})}),_.every(j=>null!==j)}({editor:n,state:pe,from:Math.max(_-1,0),to:W.b-1,rule:j,pasteEvent:ee,dropEvent:S})&&re.steps.length){try{S=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{S=null}return y=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,re}};return o.map(L=>new D.k_({view(_){const W=ee=>{var re;a=null!==(re=_.dom.parentElement)&&void 0!==re&&re.contains(ee.target)?_.dom.parentElement:null,a&&(_n=n)},j=()=>{_n&&(_n=null)};return window.addEventListener("dragstart",W),window.addEventListener("dragend",j),{destroy(){window.removeEventListener("dragstart",W),window.removeEventListener("dragend",j)}}},props:{handleDOMEvents:{drop:(_,W)=>{if(p=a===_.dom.parentElement,S=W,!p){const j=_n;j?.isEditable&&setTimeout(()=>{const ee=j.state.selection;ee&&j.commands.deleteRange({from:ee.from,to:ee.to})},10)}return!1},paste:(_,W)=>{var j;const ee=null===(j=W.clipboardData)||void 0===j?void 0:j.getData("text/html");return y=W,u=!!ee?.includes("data-pm-slice"),!1}}},appendTransaction:(_,W,j)=>{const ee=_[0],re="paste"===ee.getMeta("uiEvent")&&!u,pe="drop"===ee.getMeta("uiEvent")&&!p,Ce=ee.getMeta("applyPasteRules"),dt=!!Ce;if(!re&&!pe&&!dt)return;if(dt){let{text:At}=Ce;"string"==typeof At||(At=P(ie.FK.from(At),j.schema));const{from:en}=Ce,de=en+At.length,je=(i=>{var n;const o=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null===(n=o.clipboardData)||void 0===n||n.setData("text/html",i),o})(At);return E({rule:L,state:j,from:en,to:{b:de},pasteEvt:je})}const mt=W.doc.content.findDiffStart(j.doc.content),Pt=W.doc.content.findDiffEnd(j.doc.content);return function ei(i){return"number"==typeof i}(mt)&&Pt&&mt!==Pt.b?E({rule:L,state:j,from:mt,to:Pt,pasteEvt:y}):void 0}}))}class Sn{constructor(n,o){this.splittableMarks=[],this.editor=o,this.extensions=Sn.resolve(n),this.schema=function h(i,n){var o;const a=R(i),{nodeExtensions:u,markExtensions:p}=M(i),y=null===(o=u.find(B=>m(B,"topNode")))||void 0===o?void 0:o.name,S=Object.fromEntries(u.map(B=>{const L=a.filter(Ce=>Ce.type===B.name),_={name:B.name,options:B.options,storage:B.storage,editor:n},j=c({...i.reduce((Ce,dt)=>{const mt=m(dt,"extendNodeSchema",_);return{...Ce,...mt?mt(B):{}}},{}),content:he(m(B,"content",_)),marks:he(m(B,"marks",_)),group:he(m(B,"group",_)),inline:he(m(B,"inline",_)),atom:he(m(B,"atom",_)),selectable:he(m(B,"selectable",_)),draggable:he(m(B,"draggable",_)),code:he(m(B,"code",_)),whitespace:he(m(B,"whitespace",_)),linebreakReplacement:he(m(B,"linebreakReplacement",_)),defining:he(m(B,"defining",_)),isolating:he(m(B,"isolating",_)),attrs:Object.fromEntries(L.map(Ce=>{var dt;return[Ce.name,{default:null===(dt=Ce?.attribute)||void 0===dt?void 0:dt.default}]}))}),ee=he(m(B,"parseHTML",_));ee&&(j.parseDOM=ee.map(Ce=>s(Ce,L)));const re=m(B,"renderHTML",_);re&&(j.toDOM=Ce=>re({node:Ce,HTMLAttributes:le(Ce,L)}));const pe=m(B,"renderText",_);return pe&&(j.toText=pe),[B.name,j]})),E=Object.fromEntries(p.map(B=>{const L=a.filter(pe=>pe.type===B.name),_={name:B.name,options:B.options,storage:B.storage,editor:n},j=c({...i.reduce((pe,Ce)=>{const dt=m(Ce,"extendMarkSchema",_);return{...pe,...dt?dt(B):{}}},{}),inclusive:he(m(B,"inclusive",_)),excludes:he(m(B,"excludes",_)),group:he(m(B,"group",_)),spanning:he(m(B,"spanning",_)),code:he(m(B,"code",_)),attrs:Object.fromEntries(L.map(pe=>{var Ce;return[pe.name,{default:null===(Ce=pe?.attribute)||void 0===Ce?void 0:Ce.default}]}))}),ee=he(m(B,"parseHTML",_));ee&&(j.parseDOM=ee.map(pe=>s(pe,L)));const re=m(B,"renderHTML",_);return re&&(j.toDOM=pe=>re({mark:pe,HTMLAttributes:le(pe,L)})),[B.name,j]}));return new ie.Sj({topNode:y,nodes:S,marks:E})}(this.extensions,o),this.setupExtensions()}static resolve(n){const o=Sn.sort(Sn.flatten(n)),a=function $r(i){const n=i.filter((o,a)=>i.indexOf(o)!==a);return Array.from(new Set(n))}(o.map(u=>u.name));return a.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${a.map(u=>`'${u}'`).join(", ")}]. This can lead to issues.`),o}static flatten(n){return n.map(o=>{const u=m(o,"addExtensions",{name:o.name,options:o.options,storage:o.storage});return u?[o,...this.flatten(u())]:o}).flat(10)}static sort(n){return n.sort((a,u)=>{const p=m(a,"priority")||100,y=m(u,"priority")||100;return p>y?-1:p<y?1:0})}get commands(){return this.extensions.reduce((n,o)=>{const u=m(o,"addCommands",{name:o.name,options:o.options,storage:o.storage,editor:this.editor,type:w(o.name,this.schema)});return u?{...n,...u()}:n},{})}get plugins(){const{editor:n}=this,o=Sn.sort([...this.extensions].reverse()),a=[],u=[],p=o.map(y=>
vendor: 4,135 bytes, line 1
1{const S={name:y.name,options:y.options,storage:y.storage,editor:n,type:w(y.name,this.schema)},E=[],B=m(y,"addKeyboardShortcuts",S);let L={};if("mark"===y.type&&m(y,"exitable",S)&&(L.ArrowRight=()=>bn.handleExit({editor:n,mark:y})),B){const re=Object.fromEntries(Object.entries(B()).map(([pe,Ce])=>[pe,()=>Ce({editor:n})]));L={...L,...re}}const _=(0,ye.w)(L);E.push(_);const W=m(y,"addInputRules",S);C(y,n.options.enableInputRules)&&W&&a.push(...W());const j=m(y,"addPasteRules",S);C(y,n.options.enablePasteRules)&&j&&u.push(...j());const ee=m(y,"addProseMirrorPlugins",S);if(ee){const re=ee();E.push(...re)}return E}).flat();return[jt({editor:n,rules:a}),...vn({editor:n,rules:u}),...p]}get attributes(){return R(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:o}=M(this.extensions);return Object.fromEntries(o.filter(a=>!!m(a,"addNodeView")).map(a=>{const u=this.attributes.filter(E=>E.type===a.name),p={name:a.name,options:a.options,storage:a.storage,editor:n,type:F(a.name,this.schema)},y=m(a,"addNodeView",p);return y?[a.name,(E,B,L,_,W)=>{const j=le(E,u);return y()({node:E,view:B,getPos:L,decorations:_,innerDecorations:W,editor:n,extension:a,HTMLAttributes:j})}]:[]}))}setupExtensions(){this.extensions.forEach(n=>{var o;this.editor.extensionStorage[n.name]=n.storage;const a={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:w(n.name,this.schema)};"mark"===n.type&&(null===(o=he(m(n,"keepOnSplit",a)))||void 0===o||o)&&this.splittableMarks.push(n.name);const u=m(n,"onBeforeCreate",a),p=m(n,"onCreate",a),y=m(n,"onUpdate",a),S=m(n,"onSelectionUpdate",a),E=m(n,"onTransaction",a),B=m(n,"onFocus",a),L=m(n,"onBlur",a),_=m(n,"onDestroy",a);u&&this.editor.on("beforeCreate",u),p&&this.editor.on("create",p),y&&this.editor.on("update",y),S&&this.editor.on("selectionUpdate",S),E&&this.editor.on("transaction",E),B&&this.editor.on("focus",B),L&&this.editor.on("blur",L),_&&this.editor.on("destroy",_)})}}class Ut{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=he(m(this,"addOptions",{name:this.name}))),this.storage=he(m(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new Ut(n)}configure(n={}){const o=this.extend({...this.config,addOptions:()=>Xn(this.options,n)});return o.name=this.name,o.parent=this.parent,o}extend(n={}){const o=new Ut({...this.config,...n});return o.parent=this,this.child=o,o.name=n.name?n.name:o.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: "${o.name}".`),o.options=he(m(o,"addOptions",{name:o.name})),o.storage=he(m(o,"addStorage",{name:o.name,options:o.options})),o}}function xr(i,n,o){const{from:a,to:u}=n,{blockSeparator:p="\n\n",textSerializers:y={}}=o||{};let S="";return i.nodesBetween(a,u,(E,B,L,_)=>{var W;E.isBlock&&B>a&&(S+=p);const j=y?.[E.type.name];if(j)return L&&(S+=j({node:E,pos:B,parent:L,index:_,range:n})),!1;E.isText&&(S+=null===(W=E?.text)||void 0===W?void 0:W.slice(Math.max(a,B)-B,u-B))}),S}function lr(i){return Object.fromEntries(Object.entries(i.nodes).filter(([,n])=>n.spec.toText).map(([n,o])=>[n,o.spec.toText]))}const Kr=Ut.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new D.k_({key:new D.hs("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:i}=this,{state:n,schema:o}=i,{doc:a,selection:u}=n,{ranges:p}=u,y=Math.min(...p.map(L=>L.$from.pos)),S=Math.max(...p.map(L=>L.$to.pos)),E=lr(o);return xr(a,{from:y,to:S},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{}
1,textSerializers:E})}}})]}});function tn(i,n,o={strict:!0}){const a=Object.keys(n);return!a.length||a.every(u=>o.strict?n[u]===i[u]:G(n[u])?n[u].test(i[u]):n[u]===i[u])}function Er(i,n,o={}){return i.find(a=>a.type===n&&tn(Object.fromEntries(Object.keys(o).map(u=>[u,a.attrs[u]])),o))}function Tr(i,n,o={}){return!!Er(i,n,o)}function Qn(i,n,o){var a;if(!i||!n)return;let u=i.parent.childAfter(i.parentOffset);if((!u.node||!u.node.marks.some(L=>L.type===n))&&(u=i.parent.childBefore(i.parentOffset)),!u.node||!u.node.marks.some(L=>L.type===n)||(o=o||(null===(a=u.node.marks[0])||void 0===a?void 0:a.attrs),!Er([...u.node.marks],n,o)))return;let y=u.index,S=i.start()+u.offset,E=y+1,B=S+u.node.nodeSize;for(;y>0&&Tr([...i.parent.child(y-1).marks],n,o);)y-=1,S-=i.parent.child(y).nodeSize;for(;E<i.parent.childCount&&Tr([...i.parent.child(E).marks],n,o);)B+=i.parent.child(E).nodeSize,E+=1;return{from:S,to:B}}function cn(i,n){if("string"==typeof i){if(!n.marks[i])throw Error(`There is no mark type named '${i}'. Maybe you forgot to add the extension?`);return n.marks[i]}return i}function $n(i){return i instanceof D.U3}function un(i=0,n=0,o=0){return Math.min(Math.max(i,n),o)}function dn(i,n=null){if(!n)return null;const o=D.LN.atStart(i),a=D.LN.atEnd(i);if("start"===n||!0===n)return o;if("end"===n)return a;const u=o.from,p=a.to;return"all"===n?D.U3.create(i,un(0,u,p),un(i.content.size,u,p)):D.U3.create(i,un(n,u,p),un(n,u,p))}function Ar(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function cr(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const On=i=>{const n=i.childNodes;for(let o=n.length-1;o>=0;o-=1){const a=n[o];3===a.nodeType&&a.nodeValue&&/^(\n\s\s|\n)$/.test(a.nodeValue)?i.removeChild(a):1===a.nodeType&&On(a)}return i};function En(i){const n=`<body>${i}</body>`,o=(new window.DOMParser).parseFromString(n,"text/html").body;return On(o)}function Kn(i,n,o){if(i instanceof ie.bP||i instanceof ie.FK)return i;o={slice:!0,parseOptions:{},...o};const u="string"==typeof i;if("object"==typeof i&&null!==i)try{if(Array.isArray(i)&&i.length>0)return ie.FK.fromArray(i.map(S=>n.nodeFromJSON(S)));const y=n.nodeFromJSON(i);return o.errorOnInvalidContent&&y.check(),y}catch(p){if(o.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:p});return console.warn("[tiptap warn]: Invalid content.","Passed value:",i,"Error:",p),Kn("",n,o)}if(u){if(o.errorOnInvalidContent){let y=!1,S="";const E=new ie.Sj({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:B=>(y=!0,S="string"==typeof B?B:B.outerHTML,null)}]}})});if(o.slice?ie.S4.fromSchema(E).parseSlice(En(i),o.parseOptions):ie.S4.fromSchema(E).parse(En(i),o.parseOptions),o.errorOnInvalidContent&&y)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${S}`)})}const p=ie.S4.fromSchema(n);return o.slice?p.parseSlice(En(i),o.parseOptions).content:p.parse(En(i),o.parseOptions)}return Kn("",n,o)}function qr(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)}function tr(i,n,o={}){const{from:a,to:u,empty:p}=i.selection,y=n?F(n,i.schema):null,S=[];i.doc.nodesBetween(a,u,(_,W)=>{if(_.isText)return;const j=Math.max(a,W),ee=Math.min(u,W+_.nodeSize);S.push({node:_,from:j,to:ee})});const E=u-a,B=S.filter(_=>!y||y.name===_.node.type.name).filter(_=>tn(_.node.attrs,o,{strict:!1}));return p?!!B.length:B.reduce((_,W)=>_+W.to-W.from,0)>=E}function Wn(i,n){return n.nodes[i]?"node":n.marks[i]?"mark":null}function nr(i,n){const o="string"==typeof n?[n]:n;return Object.keys(i).reduce((a,u)=>(o.includes(u)||(a[u]=i[u]),a),{})}function Br(i,n,o={},a={}){return Kn(i,n,{slice:!1,parseOptions:o,errorOnInvalidContent:a.errorOnInvalidContent})}function Lr(i,n){const o=cn(n,i.schema),{from:a,to:u,empty:p}=i.selection,y=[];p?(i.storedMarks&&y.push(...i.storedMarks),y.push(...i.selection.$head.marks())):i.doc.nodesBetween(a,u,E=>{y.push(...E.marks)});const S=y.find(E=>E.type.name===o.name);return S?{...S.attrs}:{}}function ai(i,n){const o=new ne.dL(i);
1return n.forEach(a=>{a.steps.forEach(u=>{o.step(u)})}),o}function ci(i,n,o){const a=[];return i.nodesBetween(n.from,n.to,(u,p)=>{o(u)&&a.push({node:u,pos:p})}),a}function ir(i){return n=>function hr(i,n){for(let o=i.depth;o>0;o-=1){const a=i.node(o);if(n(a))return{pos:o>0?i.before(o):0,start:i.start(o),depth:o,node:a}}}(n.$from,i)}function Fr(i,n){return xr(i,{from:0,to:i.content.size},n)}function Un(i,n){const o=Wn("string"==typeof n?n:n.name,i.schema);return"node"===o?function gr(i,n){const o=F(n,i.schema),{from:a,to:u}=i.selection,p=[];i.doc.nodesBetween(a,u,S=>{p.push(S)});const y=p.reverse().find(S=>S.type.name===o.name);return y?{...y.attrs}:{}}(i,n):"mark"===o?Lr(i,n):{}}function sr(i){const{mapping:n,steps:o}=i,a=[];return n.maps.forEach((u,p)=>{const y=[];if(u.ranges.length)u.forEach((S,E)=>{y.push({from:S,to:E})});else{const{from:S,to:E}=o[p];if(void 0===S||void 0===E)return;y.push({from:S,to:E})}y.forEach(({from:S,to:E})=>{const B=n.slice(p).map(S,-1),L=n.slice(p).map(E),_=n.invert().map(B,-1),W=n.invert().map(L);a.push({oldRange:{from:_,to:W},newRange:{from:B,to:L}})})}),function mi(i){const n=function Tn(i,n=JSON.stringify){const o={};return i.filter(a=>{const u=n(a);return!Object.prototype.hasOwnProperty.call(o,u)&&(o[u]=!0)})}(i);return 1===n.length?n:n.filter((o,a)=>!n.filter((p,y)=>y!==a).some(p=>o.oldRange.from>=p.oldRange.from&&o.oldRange.to<=p.oldRange.to&&o.newRange.from>=p.newRange.from&&o.newRange.to<=p.newRange.to))}(a)}function yr(i,n,o){const a=[];return i===n?o.resolve(i).marks().forEach(u=>{const y=Qn(o.resolve(i),u.type);y&&a.push({mark:u,...y})}):o.nodesBetween(i,n,(u,p)=>{!u||void 0===u?.nodeSize||a.push(...u.marks.map(y=>({from:p,to:p+u.nodeSize,mark:y})))}),a}function br(i,n,o){return Object.fromEntries(Object.entries(o).filter(([a])=>{const u=i.find(p=>p.type===n&&p.name===a);return!!u&&u.attribute.keepOnSplit}))}function Bn(i,n,o={}){const{empty:a,ranges:u}=i.selection,p=n?cn(n,i.schema):null;if(a)return!!(i.storedMarks||i.selection.$from.marks()).filter(_=>!p||p.name===_.type.name).find(_=>tn(_.attrs,o,{strict:!1}));let y=0;const S=[];if(u.forEach(({$from:_,$to:W})=>{const j=_.pos,ee=W.pos;i.doc.nodesBetween(j,ee,(re,pe)=>{if(!re.isText&&!re.marks.length)return;const Ce=Math.max(j,pe),dt=Math.min(ee,pe+re.nodeSize);y+=dt-Ce,S.push(...re.marks.map(Pt=>({mark:Pt,from:Ce,to:dt})))})}),0===y)return!1;const E=S.filter(_=>!p||p.name===_.mark.type.name).filter(_=>tn(_.mark.attrs,o,{strict:!1})).reduce((_,W)=>_+W.to-W.from,0),B=S.filter(_=>!p||_.mark.type!==p&&_.mark.type.excludes(p)).reduce((_,W)=>_+W.to-W.from,0);return(E>0?E+B:E)>=y}function Gt(i,n){const{nodeExtensions:o}=M(n),a=o.find(y=>y.name===i);if(!a)return!1;const p=he(m(a,"group",{name:a.name,options:a.options,storage:a.storage}));return"string"==typeof p&&p.split(" ").includes("list")}function kn(i,{checkChildren:n=!0,ignoreWhitespace:o=!1}={}){var a;if(o){if("hardBreak"===i.type.name)return!0;if(i.isText)return/^\s*$/m.test(null!==(a=i.text)&&void 0!==a?a:"")}if(i.isText)return!i.text;if(i.isAtom||i.isLeaf)return!1;if(0===i.content.childCount)return!0;if(n){let u=!0;return i.content.forEach(p=>{!1!==u&&(kn(p,{ignoreWhitespace:o,checkChildren:n})||(u=!1))}),u}return!1}function qn(i){return i instanceof D.nh}function It(i,n,o){const u=i.state.doc.content.size,p=un(n,0,u),y=un(o,0,u),S=i.coordsAtPos(p),E=i.coordsAtPos(y,-1),B=Math.min(S.top,E.top),L=Math.max(S.bottom,E.bottom),_=Math.min(S.left,E.left),W=Math.max(S.right,E.right),Ce={top:B,bottom:L,left:_,right:W,width:W-_,height:L-B,x:_,y:B};return{...Ce,toJSON:()=>Ce}}function q(i,n){const o=i.storedMarks||i.selection.$to.parentOffset&&i.selection.$from.marks();if(o){const a=o.filter(u=>n?.includes(u.type.name));i.tr.ensureMarks(a)}}const ce=(i,n)=>{const o=ir(y=>y.type===n)(i.selection);if(!o)return!0;const a=i.doc.resolve(Math.max(0,o.pos-1)).before(o.depth);if(void 0===a)return!0;const u=i.doc.nodeAt(a);return o.node.type===u?.type&&(0,ne.n9)(i.doc,o.pos)&&i.join(o.pos),!0},ue=(i,n)=>{const o=ir(y=>y.type===n)(i.selection);if(!o)return!0;const a=i.doc.resolve(o.start).after(o.depth);if(void 0===a)return!0;const u=i.doc.nodeAt(a);return o.node.type===u?.type&&(0,ne.n9)(i.doc,a)&&i.join(a),!0};var lt=Object.freeze({__proto__:null,blur:()=>({editor:i,view:n})=>(requestAnimationFrame(()=>{var o;i.isDestroyed||(n.dom.blur(),null===(o=window?.getSelection())||void 0===o||o.removeAllRanges())}),!0),clearContent:(i=!1)=>({commands:n})=>n.setContent("",i),clearNodes:()=>({state:i,tr:n,dispatch:o})=>{const{selection:a}=n,{ranges:u}=a;return o&&u.forEach(({$from:p,$to:y})=>{i.doc.nodesBetween(p.pos,y.pos,(S,E)=>{if(S.type.isText)return;const{doc:B,mapping:L}=n,_=B.resolve(L.map(E)),W=B.resolve(L.map(E+S.nodeSize)),j=_.blockRange(W);if(!j)return;const ee=(0,ne.jP)(j);if(S.type.isTextblock){const{defaultType:re}=_.parent.contentMatchAt(_.index());n.setNodeMarkup(j.start,re)}(ee||0===ee)&&n.lift(j,ee)})}),!0},command:i=>n=>i(n),createParagraphNear:()=>({state:i,dispatch:n})=>
1wt(i,n),cut:(i,n)=>({editor:o,tr:a})=>{const{state:u}=o,p=u.doc.slice(i.from,i.to);a.deleteRange(i.from,i.to);const y=a.mapping.map(n);return a.insert(y,p.content),a.setSelection(new D.U3(a.doc.resolve(y-1))),!0},deleteCurrentNode:()=>({tr:i,dispatch:n})=>{const{selection:o}=i,a=o.$anchor.node();if(a.content.size>0)return!1;const u=i.selection.$anchor;for(let p=u.depth;p>0;p-=1)if(u.node(p).type===a.type){if(n){const S=u.before(p),E=u.after(p);i.delete(S,E).scrollIntoView()}return!0}return!1},deleteNode:i=>({tr:n,state:o,dispatch:a})=>{const u=F(i,o.schema),p=n.selection.$anchor;for(let y=p.depth;y>0;y-=1)if(p.node(y).type===u){if(a){const E=p.before(y),B=p.after(y);n.delete(E,B).scrollIntoView()}return!0}return!1},deleteRange:i=>({tr:n,dispatch:o})=>{const{from:a,to:u}=i;return o&&n.delete(a,u),!0},deleteSelection:()=>({state:i,dispatch:n})=>Te(i,n),enter:()=>({commands:i})=>i.keyboardShortcut("Enter"),exitCode:()=>({state:i,dispatch:n})=>qe(i,n),extendMarkRange:(i,n={})=>({tr:o,state:a,dispatch:u})=>{const p=cn(i,a.schema),{doc:y,selection:S}=o,{$from:E,from:B,to:L}=S;if(u){const _=Qn(E,p,n);if(_&&_.from<=B&&_.to>=L){const W=D.U3.create(y,_.from,_.to);o.setSelection(W)}}return!0},first:i=>n=>{const o="function"==typeof i?i(n):i;for(let a=0;a<o.length;a+=1)if(o[a](n))return!0;return!1},focus:(i=null,n={})=>({editor:o,view:a,tr:u,dispatch:p})=>{n={scrollIntoView:!0,...n};const y=()=>{(cr()||Ar())&&a.dom.focus(),requestAnimationFrame(()=>{o.isDestroyed||(a.focus(),n?.scrollIntoView&&o.commands.scrollIntoView())})};if(a.hasFocus()&&null===i||!1===i)return!0;if(p&&null===i&&!$n(o.state.selection))return y(),!0;const S=dn(u.doc,i)||o.state.selection,E=o.state.selection.eq(S);return p&&(E||u.setSelection(S),E&&u.storedMarks&&u.setStoredMarks(u.storedMarks),y()),!0},forEach:(i,n)=>o=>i.every((a,u)=>n(a,{...o,index:u})),insertContent:(i,n)=>({tr:o,commands:a})=>a.insertContentAt({from:o.selection.from,to:o.selection.to},i,n),insertContentAt:(i,n,o)=>({tr:a,dispatch:u,editor:p})=>{var y;if(u){let S;const E=pe=>{p.emit("contentError",{editor:p,error:pe,disableCollaboration:()=>{p.storage.collaboration&&(p.storage.collaboration.isDisabled=!0)}})},B={preserveWhitespace:"full",...(o={parseOptions:p.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...o}).parseOptions};if(!o.errorOnInvalidContent&&!p.options.enableContentCheck&&p.options.emitContentError)try{Kn(n,p.schema,{parseOptions:B,errorOnInvalidContent:!0})}catch(pe){E(pe)}try{S=Kn(n,p.schema,{parseOptions:B,errorOnInvalidContent:null!==(y=o.errorOnInvalidContent)&&void 0!==y?y:p.options.enableContentCheck})}catch(pe){return E(pe),!1}let re,{from:L,to:_}="number"==typeof i?{from:i,to:i}:{from:i.from,to:i.to},W=!0,j=!0;if(((i=>!("type"in i))(S)?S:[S]).forEach(pe=>{pe.check(),W=!!W&&pe.isText&&0===pe.marks.length,j=!!j&&pe.isBlock}),L===_&&j){const{parent:pe}=a.doc.resolve(L);pe.isTextblock&&!pe.type.spec.code&&!pe.childCount&&(L-=1,_+=1)}if(W){if(Array.isArray(n))re=n.map(pe=>pe.text||"").join("");else if(n instanceof ie.FK){let pe="";n.forEach(Ce=>{Ce.text&&(pe+=Ce.text)}),re=pe}else re="object"==typeof n&&n&&n.text?n.text:n;a.insertText(re,L,_)}else re=S,a.replaceWith(L,_,re);o.updateSelection&&function ur(i,n,o){const a=i.steps.length-1;if(a<n)return;const u=i.steps[a];if(!(u instanceof ne.Ln||u instanceof ne.Wg))return;let y=0;i.mapping.maps[a].forEach((S,E,B,L)=>{0===y&&(y=L)}),i.setSelection(D.LN.near(i.doc.resolve(y),o))}(a,a.steps.length-1,-1),o.applyInputRules&&a.setMeta("applyInputRules",{from:L,text:re}),o.applyPasteRules&&a.setMeta("applyPasteRules",{from:L,text:re})}return!0},joinBackward:()=>({state:i,dispatch:n})=>Fe(i,n),joinDown:()=>({state:i,dispatch:n})=>((i,n)=>{let a,o=i.selection;if(o instanceof D.nh){if(o.node.isTextblock||!(0,ne.n9)(i.doc,o.to))return!1;a=o.to}else if(a=(0,ne.N0)(i.doc,o.to,1),null==a)return!1;return n&&n(i.tr.join(a).scrollIntoView()),!0})(i,n),joinForward:()=>({state:i,dispatch:n})=>Ne(i,n),joinItemBackward:()=>({state:i,dispatch:n,tr:o})=>{try{const a=(0,ne.N0)(i.doc,i.selection.$from.pos,-1);return null!=a&&(o.join(a,2),n&&n(o),!0)}catch{return!1}},joinItemForward:()=>({state:i,dispatch:n,tr:o})=>{try{const a=(0,ne.N0)(i.doc,i.selection.$from.pos,1);return null!=a&&(o.join(a,2),n&&n(o),!0)}catch{return!1}},joinTextblockBackward:()=>({state:i,dispatch:n})=>((i,n,o)=>{let a=Pe(i,void 0);if(!a)return!1;let u=Qe(a);return!!u&&He(i,u,n)})(i,n),joinTextblockForward:()=>({state:i,dispatch:n})=>((i,n,o)=>{let a=Ke(i,void 0);if(!a)return!1;let u=Z(a);return!!u&&He(i,u,n)})(i,n),joinUp:()=>({state:i,dispatch:n})=>((i,n)=>{let u,o=i.selection,a=o instanceof D.nh;if(a){if(o.node.isTextblock||!(0,ne.n9)(i.doc,o.from))return!1;u=o.from}else if(u=(0,ne.N0)(i.doc,o.from,-1),null==u)return!1;if(n){let p=i.tr.join(u);a&&p.setSelection(D.nh.create(p.doc,u-i.doc.resolve(u).nodeBefore.nodeSize)),n(p.scrollIntoView())}return!0})(i,n),keyboardShortcut:i=>({editor:n,view:o,tr:a,dispatch:u})=>{const p=function zt(i){const n=i.split(/-(?!$)/);let a,u,p,y,o=n[n.length-1];"Space"===o&&(o=" ");for(let S=0;S<n.length-1;S+=1){const E=n[S];if(/^(cmd|meta|m)$/i.test(E))y=!0;else if(/^a(lt)?$/i.test(E))a=!0;else if(/^(c|ctrl|control)$/i.test(E))u=!0;else if(/^s(hift)?$/i.test(E))p=!0;else{if(!/^mod$/i.test(E))throw new Error(`Unrecognized modifier name: ${E}`);cr()||qr()?y=!0:u=!0}}return a&&(o=`Alt-${o}`),u&&(o=`Ctrl-${o}`),y&&(o=`Meta-${o}`),p&&(o=`Shift-${o}`),o}(i).split(/-(?!$)/),y=p.find(B=>!["Alt","Ctrl","Meta","Shift"].includes(B)),S=new KeyboardEvent("keydown",{key:"Space"
1===y?" ":y,altKey:p.includes("Alt"),ctrlKey:p.includes("Ctrl"),metaKey:p.includes("Meta"),shiftKey:p.includes("Shift"),bubbles:!0,cancelable:!0}),E=n.captureTransaction(()=>{o.someProp("handleKeyDown",B=>B(o,S))});return E?.steps.forEach(B=>{const L=B.map(a.mapping);L&&u&&a.maybeStep(L)}),!0},lift:(i,n={})=>({state:o,dispatch:a})=>!!tr(o,F(i,o.schema),n)&&((i,n)=>{let{$from:o,$to:a}=i.selection,u=o.blockRange(a),p=u&&(0,ne.jP)(u);return null!=p&&(n&&n(i.tr.lift(u,p).scrollIntoView()),!0)})(o,a),liftEmptyBlock:()=>({state:i,dispatch:n})=>ct(i,n),liftListItem:i=>({state:n,dispatch:o})=>function Bt(i){return function(n,o){let{$from:a,$to:u}=n.selection,p=a.blockRange(u,y=>y.childCount>0&&y.firstChild.type==i);return!!p&&(!o||(a.node(p.depth-1).type==i?function Rt(i,n,o,a){let u=i.tr,p=a.end,y=a.$to.end(a.depth);p<y&&(u.step(new ne.Wg(p-1,y,p,y,new ie.Ji(ie.FK.from(o.create(null,a.parent.copy())),1,0),1,!0)),a=new ie.u$(u.doc.resolve(a.$from.pos),u.doc.resolve(y),a.depth));const S=(0,ne.jP)(a);if(null==S)return!1;u.lift(a,S);let E=u.doc.resolve(u.mapping.map(p,-1)-1);return(0,ne.n9)(u.doc,E.pos)&&E.nodeBefore.type==E.nodeAfter.type&&u.join(E.pos),n(u.scrollIntoView()),!0}(n,o,i,p):function Qt(i,n,o){let a=i.tr,u=o.parent;for(let j=o.end,ee=o.endIndex-1,re=o.startIndex;ee>re;ee--)j-=u.child(ee).nodeSize,a.delete(j-1,j+1);let p=a.doc.resolve(o.start),y=p.nodeAfter;if(a.mapping.map(o.end)!=o.start+p.nodeAfter.nodeSize)return!1;let S=0==o.startIndex,E=o.endIndex==u.childCount,B=p.node(-1),L=p.index(-1);if(!B.canReplace(L+(S?0:1),L+1,y.content.append(E?ie.FK.empty:ie.FK.from(u))))return!1;let _=p.pos,W=_+y.nodeSize;return a.step(new ne.Wg(_-(S?1:0),W+(E?1:0),_+1,W-1,new ie.Ji((S?ie.FK.empty:ie.FK.from(u.copy(ie.FK.empty))).append(E?ie.FK.empty:ie.FK.from(u.copy(ie.FK.empty))),S?0:1,E?0:1),S?0:1)),n(a.scrollIntoView()),!0}(n,o,p)))}}(F(i,n.schema))(n,o),newlineInCode:()=>({state:i,dispatch:n})=>Se(i,n),resetAttributes:(i,n)=>({tr:o,state:a,dispatch:u})=>{let p=null,y=null;const S=Wn("string"==typeof i?i:i.name,a.schema);return!!S&&("node"===S&&(p=F(i,a.schema)),"mark"===S&&(y=cn(i,a.schema)),u&&o.selection.ranges.forEach(E=>{a.doc.nodesBetween(E.$from.pos,E.$to.pos,(B,L)=>{p&&p===B.type&&o.setNodeMarkup(L,void 0,nr(B.attrs,n)),y&&B.marks.length&&B.marks.forEach(_=>{y===_.type&&o.addMark(L,L+B.nodeSize,y.create(nr(_.attrs,n)))})})}),!0)},scrollIntoView:()=>({tr:i,dispatch:n})=>(n&&i.scrollIntoView(),!0),selectAll:()=>({tr:i,dispatch:n})=>{if(n){const o=new D.i5(i.doc);i.setSelection(o)}return!0},selectNodeBackward:()=>({state:i,dispatch:n})=>Xe(i,n),selectNodeForward:()=>({state:i,dispatch:n})=>xe(i,n),selectParentNode:()=>({state:i,dispatch:n})=>((i,n)=>{let u,{$from:o,to:a}=i.selection,p=o.sharedDepth(a);return 0!=p&&(u=o.before(p),n&&n(i.tr.setSelection(D.nh.create(i.doc,u))),!0)})(i,n),selectTextblockEnd:()=>({state:i,dispatch:n})=>$(i,n),selectTextblockStart:()=>({state:i,dispatch:n})=>Y(i,n),setContent:(i,n=!1,o={},a={})=>({editor:u,tr:p,dispatch:y,commands:S})=>{var E,B;const{doc:L}=p;if("full"!==o.preserveWhitespace){const _=Br(i,u.schema,o,{errorOnInvalidContent:null!==(E=a.errorOnInvalidContent)&&void 0!==E?E:u.options.enableContentCheck});return y&&p.replaceWith(0,L.content.size,_).setMeta("preventUpdate",!n),!0}return y&&p.setMeta("preventUpdate",!n),S.insertContentAt({from:0,to:L.content.size},i,{parseOptions:o,errorOnInvalidContent:null!==(B=a.errorOnInvalidContent)&&void 0!==B?B:u.options.enableContentCheck})},setMark:(i,n={})=>({tr:o,state:a,dispatch:u})=>{const{selection:p}=o,{empty:y,ranges:S}=p,E=cn(i,a.schema);if(u)if(y){const B=Lr(a,E);o.addStoredMark(E.create({...B,...n}))}else S.forEach(B=>{const L=B.$from.pos,_=B.$to.pos;a.doc.nodesBetween(L,_,(W,j)=>{const ee=Math.max(j,L),re=Math.min(j+W.nodeSize,_);W.marks.find(Ce=>Ce.type===E)?W.marks.forEach(Ce=>{E===Ce.type&&o.addMark(ee,re,E.create({...Ce.attrs,...n}))}):o.addMark(ee,re,E.create(n))})});return function gi(i,n,o){var a;const{selection:u}=n;let p=null;if($n(u)&&(p=u.$cursor),p){const S=null!==(a=i.storedMarks)&&void 0!==a?a:p.marks();return!!o.isInSet(S)||!S.some(E=>E.type.excludes(o))}const{ranges:y}=u;return y.some(({$from:S,$to:E})=>{let B=0===S.depth&&i.doc.inlineContent&&i.doc.type.allowsMarkType(o);return i.doc.nodesBetween(S.pos,E.pos,(L,_,W)=>{if(B)return!1;if(L.isInline){const j=!W||W.type.allowsMarkType(o),ee=!!o.isInSet(L.marks)||!L.marks.some(re=>re.type.excludes(o));B=j&&ee}return!B}),B})}(a,o,E)},setMeta:(i,n)=>({tr:o})=>(o.setMeta(i,n),!0),setNode:(i,n={})=>({state:o,dispatch:a,chain:u})=>{const p=F(i,o.schema);let y;return o.selection.$anchor.sameParent(o.selection.$head)&&(y=o.selection.$anchor.parent.attrs),p.isTextblock?u().command(({commands:S})=>!!se(p,{...y,...n})(o)||S.clearNodes()).command(({state:S})=>se(p,{...y,...n})(S,a)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:i=>({tr:n,dispatch:o})=>{if(o){const{doc:a}=n,u=un(i,0,a.content.size),p=D.nh.create(a,u);n.setSelection(p)}return!0},setTextSelection:i=>({tr:n,dispatch:o})=>{if(o){const{doc:a}=n,{from:u,to:p}="number"==typeof i?{from:i,to:i}:i,y=D.U3.atStart(a).from,S=D.U3.atEnd(a).to,E=un(u,y,S),B=un(p,y,S),L=D.U3.create(a,E,B);n.setSelection(L)}return!0},sinkListItem:i=>({state:n,dispatch:o})=>function Wt(i){return function(n,o){let{$from:a,$to:u}=n.selection,p=a.blockRange(u,B=>B.childCount>0&&B.firstChild.type==i);if(!p)return!1;let y=p.startIndex;if(0==y)return!1;let S=p.parent,E=S.child(y-1);if(E.type!=i)return!1;if(o){let B=E.lastChild&&E.lastChild.type==S.type,L=ie.FK.from(B?i.create():null),_=new ie.Ji(ie.FK.from(i.create(null,ie.FK.from(S.type.create(null,L)))),B?3:1,0),W=p.start,j=p.end;o(n.tr.step(new ne.Wg(W-(B?3:1),j,W,j,_,1,!0)).scrollIntoView())}return!0}}(F(i,n.schema))(n,o),splitBlock:({keepMarks:i=!0}={})=>({tr:n,state:o,dispatch:a,editor:u})=>{const{selection:p,doc:y}=n,{$from:S,$to:E}=p,L=br(u.extensionManager.attributes,S.node().type.name,S.node().attrs);if(p instanceof D.nh&&p.node.isBlock)return!(!S.parentOffset||!(0,ne.zy)(y,S.pos)||(a&&(i&&q(o,u.extensionManager.splittableMarks),n.split(S.pos).scrollIntoView()),0));if(!S.parent.isBlock)return!1;const _=E.parentOffset===E.parent.content.size,W=0===S.depth?void 0:function pr(i){for(let n=0;n<i.edgeCount;n+=1){const{type:o}=i.edge(n);if(o.isTextblock&&!o.hasRequiredAttrs())return o}return null}(S.node(-1).contentMatchAt(S.indexAfter(-1)));let j=_&&W?[{type:W,attrs:L}]:void 0,ee=(0,ne.zy)(n.doc,n.mapping.map(S.pos),1,j);if(!j&&!ee&&(0,ne.zy)(n.doc,n.mapping.map(S.pos),1,W?[{type:W}]:void 0)&&(ee=!0,j=W?[{type:W,attrs:L}]:void 0),a){if(ee&&(p instanceof D.U3&&n.deleteSelection(),n.split(n.mapping.map(S.pos),1,j),W&&!_&&!S.parentOffset&&S.parent.type!==W)){const re=n.mapping.map(S.before()),pe=n.doc.resolve(re);S.node(-1).canReplaceWith(pe.index(),pe.index()+1,W)&&n.setNodeMarkup(n.mapping.map(S.before()),W)}i&&q(o,u.extensionManager.splittableMarks),n.scrollIntoView()}return ee},splitListItem:(i,n={})=>({tr:o,state:a,dispatch:u,editor:p})=>{var y;const S=F(i,a.schema),{$from:E,$to:B}=a.selection,L=a.selection.node;if(L&&L.isBlock||E.depth<2||!E.sameParent(B))return!1;const _=E.node(-1);if(_.type!==S)return!1;const W=p.extensionManager.attributes;if(0===E.parent.content.size&&E.node(-1).childCount===E.indexAfter(-1)){if
vendor: 5,257 bytes, line 1
1(2===E.depth||E.node(-3).type!==S||E.index(-2)!==E.node(-2).childCount-1)return!1;if(u){let Ce=ie.FK.empty;const dt=E.index(-1)?1:E.index(-2)?2:3;for(let je=E.depth-dt;je>=E.depth-3;je-=1)Ce=ie.FK.from(E.node(je).copy(Ce));const mt=E.indexAfter(-1)<E.node(-2).childCount?1:E.indexAfter(-2)<E.node(-3).childCount?2:3,Pt={...br(W,E.node().type.name,E.node().attrs),...n},At=(null===(y=S.contentMatch.defaultType)||void 0===y?void 0:y.createAndFill(Pt))||void 0;Ce=Ce.append(ie.FK.from(S.createAndFill(null,At)||void 0));const en=E.before(E.depth-(dt-1));o.replace(en,E.after(-mt),new ie.Ji(Ce,4-dt,0));let de=-1;o.doc.nodesBetween(en,o.doc.content.size,(je,st)=>{if(de>-1)return!1;je.isTextblock&&0===je.content.size&&(de=st+1)}),de>-1&&o.setSelection(D.U3.near(o.doc.resolve(de))),o.scrollIntoView()}return!0}const j=B.pos===E.end()?_.contentMatchAt(0).defaultType:null,ee={...br(W,_.type.name,_.attrs),...n},re={...br(W,E.node().type.name,E.node().attrs),...n};o.delete(E.pos,B.pos);const pe=j?[{type:S,attrs:ee},{type:j,attrs:re}]:[{type:S,attrs:ee}];if(!(0,ne.zy)(o.doc,E.pos,2))return!1;if(u){const{selection:Ce,storedMarks:dt}=a,{splittableMarks:mt}=p.extensionManager,Pt=dt||Ce.$to.parentOffset&&Ce.$from.marks();if(o.split(E.pos,2,pe).scrollIntoView(),!Pt||!u)return!0;const At=Pt.filter(en=>mt.includes(en.type.name));o.ensureMarks(At)}return!0},toggleList:(i,n,o,a={})=>({editor:u,tr:p,state:y,dispatch:S,chain:E,commands:B,can:L})=>{const{extensions:_,splittableMarks:W}=u.extensionManager,j=F(i,y.schema),ee=F(n,y.schema),{selection:re,storedMarks:pe}=y,{$from:Ce,$to:dt}=re,mt=Ce.blockRange(dt),Pt=pe||re.$to.parentOffset&&re.$from.marks();if(!mt)return!1;const At=ir(en=>Gt(en.type.name,_))(re);if(mt.depth>=1&&At&&mt.depth-At.depth<=1){if(At.node.type===j)return B.liftListItem(ee);if(Gt(At.node.type.name,_)&&j.validContent(At.node.content)&&S)return E().command(()=>(p.setNodeMarkup(At.pos,j),!0)).command(()=>ce(p,j)).command(()=>ue(p,j)).run()}return o&&Pt&&S?E().command(()=>{const en=L().wrapInList(j,a),de=Pt.filter(je=>W.includes(je.type.name));return p.ensureMarks(de),!!en||B.clearNodes()}).wrapInList(j,a).command(()=>ce(p,j)).command(()=>ue(p,j)).run():E().command(()=>!!L().wrapInList(j,a)||B.clearNodes()).wrapInList(j,a).command(()=>ce(p,j)).command(()=>ue(p,j)).run()},toggleMark:(i,n={},o={})=>({state:a,commands:u})=>{const{extendEmptyMarkRange:p=!1}=o,y=cn(i,a.schema);return Bn(a,y,n)?u.unsetMark(y,{extendEmptyMarkRange:p}):u.setMark(y,n)},toggleNode:(i,n,o={})=>({state:a,commands:u})=>{const p=F(i,a.schema),y=F(n,a.schema),S=tr(a,p,o);let E;return a.selection.$anchor.sameParent(a.selection.$head)&&(E=a.selection.$anchor.parent.attrs),S?u.setNode(y,E):u.setNode(p,{...E,...o})},toggleWrap:(i,n={})=>({state:o,commands:a})=>{const u=F(i,o.schema);return tr(o,u,n)?a.lift(u):a.wrapIn(u,n)},undoInputRule:()=>({state:i,dispatch:n})=>{const o=i.plugins;for(let a=0;a<o.length;a+=1){const u=o[a];let p;if(u.spec.isInputRules&&(p=u.getState(i))){if(n){const y=i.tr,S=p.transform;for(let E=S.steps.length-1;E>=0;E-=1)y.step(S.steps[E].invert(S.docs[E]));if(p.text){const E=y.doc.resolve(p.from).marks();y.replaceWith(p.from,p.to,i.schema.text(p.text,E))}else y.delete(p.from,p.to)}return!0}}return!1},unsetAllMarks:()=>({tr:i,dispatch:n})=>{const{selection:o}=i,{empty:a,ranges:u}=o;return a||n&&u.forEach(p=>{i.removeMark(p.$from.pos,p.$to.pos)}),!0},unsetMark:(i,n={})=>({tr:o,state:a,dispatch:u})=>{var p;const{extendEmptyMarkRange:y=!1}=n,{selection:S}=o,E=cn(i,a.schema),{$from:B,empty:L,ranges:_}=S;if(!u)return!0;if(L&&y){let{from:W,to:j}=S;const ee=null===(p=B.marks().find(pe=>pe.type===E))||void 0===p?void 0:p.attrs,re=Qn(B,E,ee);re&&(W=re.from,j=re.to),o.removeMark(W,j,E)}else _.forEach(W=>{o.removeMark(W.$from.pos,W.$to.pos,E)});return o.removeStoredMark(E),!0},updateAttributes:(i,n={})=>({tr:o,state:a,dispatch:u})=>{let p=null,y=null;const S=Wn("string"==typeof i?i:i.name,a.schema);return!!S&&("node"===S&&(p=F(i,a.schema)),"mark"===S&&(y=cn(i,a.schema)),u&&o.selection.ranges.forEach(E=>{const B=E.$from.pos,L=E.$to.pos;let _,W,j,ee;a.doc.nodesBetween(B,L,o.selection.empty?(re,pe)=>{p&&p===re.type&&(j=Math.max(pe,B),ee=Math.min(pe+re.nodeSize,L),_=pe,W=re)}:(re,pe)=>{pe<B&&p&&p===re.type&&(j=Math.max(pe,B),ee=Math.min(pe+re.nodeSize,L),_=pe,W=re),pe>=B&&pe<=L&&(p&&p===re.type&&o.setNodeMarkup(pe,void 0,{...re.attrs,...n}),y&&re.marks.length&&re.marks.forEach(Ce=>{if(y===Ce.type){const dt=Math.max(pe,B),mt=Math.min(pe+re.nodeSize,L);o.addMark(dt,mt,y.create({...Ce.attrs,...n}))}}))}),W&&(void 0!==_&&o.setNodeMarkup(_,void 0,{...W.attrs,...n}),y&&W.marks.length&&W.marks.forEach(re=>{y===re.type&&o.addMark(j,ee,y.create({...re.attrs,...n}))}))}),!0)},wrapIn:(i,n={})=>({state:o,dispatch:a})=>function Q(i,n=null){return function(o,a){let{$from:u,$to:p}=o.selection,y=u.blockRange(p),S=y&&(0,ne.oM)(y,i,n);return!!S&&(a&&a(o.tr.wrap(y,S).scrollIntoView()),!0)}}(F(i,o.schema),n)(o,a),wrapInList:(i,n={})=>({state:o,dispatch:a})=>function Kt(i,n=null){return function(o,a){let{$from:u,$to:p}=o.selection,y=u.blockRange(p);if(!y)return!1;let S=a?o.tr:null;return!!function Yn(i,n,o,a=null){let u=!1,p=n,y=n.$from.doc;if(n.depth>=2&&n.$from.node(n.depth-1).type.compatibleContent(o)&&0==n.startIndex){
1if(0==n.$from.index(n.depth-1))return!1;let E=y.resolve(n.start-2);p=new ie.u$(E,E,n.depth),n.endIndex<n.parent.childCount&&(n=new ie.u$(n.$from,y.resolve(n.$to.end(n.depth)),n.depth)),u=!0}let S=(0,ne.oM)(p,o,a,n);return!!S&&(i&&function on(i,n,o,a,u){let p=ie.FK.empty;for(let L=o.length-1;L>=0;L--)p=ie.FK.from(o[L].type.create(o[L].attrs,p));i.step(new ne.Wg(n.start-(a?2:0),n.end,n.start,n.end,new ie.Ji(p,0,0),o.length,!0));let y=0;for(let L=0;L<o.length;L++)o[L].type==u&&(y=L+1);let S=o.length-y,E=n.start+o.length-(a?2:0),B=n.parent;for(let L=n.startIndex,_=n.endIndex,W=!0;L<_;L++,W=!1)!W&&(0,ne.zy)(i.doc,E,S)&&(i.split(E,S),E+=2*S),E+=B.child(L).nodeSize}(i,n,S,u,o),!0)}(S,y,i,n)&&(a&&a(S.scrollIntoView()),!0)}}(F(i,o.schema),n)(o,a)});const z=Ut.create({name:"commands",addCommands:()=>({...lt})}),Je=Ut.create({name:"drop",addProseMirrorPlugins(){return[new D.k_({key:new D.hs("tiptapDrop"),props:{handleDrop:(i,n,o,a)=>{this.editor.emit("drop",{editor:this.editor,event:n,slice:o,moved:a})}}})]}}),Le=Ut.create({name:"editable",addProseMirrorPlugins(){return[new D.k_({key:new D.hs("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ut=new D.hs("focusEvents"),pt=Ut.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:i}=this;return[new D.k_({key:ut,props:{handleDOMEvents:{focus:(n,o)=>{i.isFocused=!0;const a=i.state.tr.setMeta("focus",{event:o}).setMeta("addToHistory",!1);return n.dispatch(a),!1},blur:(n,o)=>{i.isFocused=!1;const a=i.state.tr.setMeta("blur",{event:o}).setMeta("addToHistory",!1);return n.dispatch(a),!1}}}})]}}),vt=Ut.create({name:"keymap",addKeyboardShortcuts(){const i=()=>this.editor.commands.first(({commands:y})=>[()=>y.undoInputRule(),()=>y.command(({tr:S})=>{const{selection:E,doc:B}=S,{empty:L,$anchor:_}=E,{pos:W,parent:j}=_,ee=_.parent.isTextblock&&W>0?S.doc.resolve(W-1):_,Ce=ee.parent.type.spec.isolating&&1===ee.parent.childCount?_.pos-_.parentOffset===_.pos:D.LN.atStart(B).from===W;return!(!L||!j.type.isTextblock||j.textContent.length||!Ce||Ce&&"paragraph"===_.parent.type.name)&&y.clearNodes()}),()=>y.deleteSelection(),()=>y.joinBackward(),()=>y.selectNodeBackward()]),n=()=>this.editor.commands.first(({commands:y})=>[()=>y.deleteSelection(),()=>y.deleteCurrentNode(),()=>y.joinForward(),()=>y.selectNodeForward()]),a={Enter:()=>this.editor.commands.first(({commands:y})=>[()=>y.newlineInCode(),()=>y.createParagraphNear(),()=>y.liftEmptyBlock(),()=>y.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:i,"Mod-Backspace":i,"Shift-Backspace":i,Delete:n,"Mod-Delete":n,"Mod-a":()=>this.editor.commands.selectAll()},u={...a},p={...a,"Ctrl-h":i,"Alt-Backspace":i,"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 cr()||qr()?p:u},addProseMirrorPlugins(){return[new D.k_({key:new D.hs("clearDocument"),appendTransaction:(i,n,o)=>{if(i.some(re=>re.getMeta("composition")))return;const a=i.some(re=>re.docChanged)&&!n.doc.eq(o.doc),u=i.some(re=>re.getMeta("preventClearDocument"));if(!a||u)return;const{empty:p,from:y,to:S}=n.selection,E=D.LN.atStart(n.doc).from,B=D.LN.atEnd(n.doc).to;if(p||y!==E||S!==B||!kn(o.doc))return;const W=o.tr,j=an({state:o,transaction:W}),{commands:ee}=new K({editor:this.editor,state:j});return ee.clearNodes(),W.steps.length?W:void 0}})]}}),kt=Ut.create({name:"paste",addProseMirrorPlugins(){return[new D.k_({key:new D.hs("tiptapPaste"),props:{handlePaste:(i,n,o)=>{this.editor.emit("paste",{editor:this.editor,event:n,slice:o})}}})]}}),Dt=Ut.create({name:"tabindex",addProseMirrorPlugins(){return[new D.k_({key:new D.hs("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class gt{get name(){return this.node.type.name}constructor(n,o,a=!1,u=null){this.currentNode=null,this.actualDepth=null,this.isBlock=a,this.resolvedPos=n,this.editor=o,this.currentNode=u}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var n;return null!==(n=this.actualDepth)&&void 0!==n?n:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(n){let o=this.from,a=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);o=this.from+1,a=this.to-1}this.editor.commands.insertContentAt({from:o,to:a},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(0===this.depth)return null;const n=this.resolvedPos.start(this.resolvedPos.depth-1),o=this.resolvedPos.doc.resolve(n);return new gt(o,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 gt(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 gt(n,this.editor)}get children(){const n=[];return this.node.content.forEach((o,a)=>{const u=o.isBlock&&!o.isTextblock,y=this.pos+a+(o.isAtom&&!o.isText?0:1);if(y<0||y>this.resolvedPos.doc.nodeSize-2)return;const S=this.resolvedPos.doc.resolve(y);if(!u&&S.depth<=this.depth)return;const E=new gt(S,this.editor,u,u?o:null);u&&(E.actualDepth=this.depth+1),n.push(new gt(S,this.editor,u,u?o:null))}),n}get firstChild(){return this.children[0]||null}get lastChild(){const n=this.children;return n[n.length-1]||null}closest(n,o={}){let a=null,u=this.parent;for(;u&&!a;
1){if(u.node.type.name===n)if(Object.keys(o).length>0){const p=u.node.attrs,y=Object.keys(o);for(let S=0;S<y.length;S+=1){const E=y[S];if(p[E]!==o[E])break}}else a=u;u=u.parent}return a}querySelector(n,o={}){return this.querySelectorAll(n,o,!0)[0]||null}querySelectorAll(n,o={},a=!1){let u=[];if(!this.children||0===this.children.length)return u;const p=Object.keys(o);return this.children.forEach(y=>{a&&u.length>0||(y.node.type.name===n&&p.every(E=>o[E]===y.node.attrs[E])&&u.push(y),!(a&&u.length>0)&&(u=u.concat(y.querySelectorAll(n,o,a))))}),u}setAttribute(n){const{tr:o}=this.editor.state;o.setNodeMarkup(this.from,void 0,{...this.node.attrs,...n}),this.editor.view.dispatch(o)}}class _t extends g{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:o})=>{throw o},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:o,slice:a,moved:u})=>this.options.onDrop(o,a,u)),this.on("paste",({event:o,slice:a})=>this.options.onPaste(o,a)),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=function qt(i,n,o){const a=document.querySelector(`style[data-tiptap-style${o?`-${o}`:""}]`);if(null!==a)return a;const u=document.createElement("style");return n&&u.setAttribute("nonce",n),u.setAttribute("data-tiptap-style"+(o?`-${o}`:""),""),u.innerHTML=i,document.getElementsByTagName("head")[0].appendChild(u),u}('.ProseMirror {\n  position: relative;\n}\n\n.ProseMirror {\n  word-wrap: break-word;\n  white-space: pre-wrap;\n  white-space: break-spaces;\n  -webkit-font-variant-ligatures: none;\n  font-variant-ligatures: none;\n  font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n  white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n  white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n  white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n  display: inline !important;\n  border: none !important;\n  margin: 0 !important;\n  width: 0 !important;\n  height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n  display: none;\n  pointer-events: none;\n  position: absolute;\n  margin: 0;\n}
1\n\n.ProseMirror-gapcursor:after {\n  content: "";\n  display: block;\n  position: absolute;\n  top: -2px;\n  width: 20px;\n  border-top: 1px solid black;\n  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n  to {\n    visibility: hidden;\n  }\n}\n\n.ProseMirror-hideselection *::selection {\n  background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n  background: transparent;\n}\n\n.ProseMirror-hideselection * {\n  caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n  display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n  opacity: 0\n}',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,o=!0){this.setOptions({editable:n}),o&&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,o){const a=ke(o)?o(n,[...this.state.plugins]):[...this.state.plugins,n],u=this.state.reconfigure({plugins:a});return this.view.updateState(u),u}unregisterPlugin(n){if(this.isDestroyed)return;const o=this.state.plugins;let a=o;if([].concat(n).forEach(p=>{const y="string"==typeof p?`${p}$`:p.key;a=a.filter(S=>!S.key.startsWith(y))}),o.length===a.length)return;const u=this.state.reconfigure({plugins:a});return this.view.updateState(u),u}createExtensionManager(){var n,o;const u=[...this.options.enableCoreExtensions?[Le,Kr.configure({blockSeparator:null===(o=null===(n=this.options.coreExtensionOptions)||void 0===n?void 0:n.clipboardTextSerializer)||void 0===o?void 0:o.blockSeparator}),z,pt,vt,Dt,Je,kt].filter(p=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[p.name]):[],...this.options.extensions].filter(p=>["extension","node","mark"].includes(p?.type));this.extensionManager=new Sn(u,this)}createCommandManager(){this.commandManager=new K({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var n;let o;try{o=Br(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(y){if(!(y instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(y.message)))throw y;this.emit("contentError",{editor:this,error:y,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(S=>"collaboration"!==S.name),this.createExtensionManager()}}),o=Br(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const a=dn(o,this.options.autofocus);this.view=new Ee.Lz(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...null===(n=this.options.editorProps)||void 0===n?void 0:n.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:D.$t.create({doc:o,selection:a||void 0})});const u=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(u),this.createNodeViews(),this.prependClass(),this.view.dom.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 o=this.capturedTransaction;return this.capturedTransaction=null,o}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void n.steps.forEach(y=>{var S;return null===(S=this.capturedTransaction)||void 0===S?void 0:S.step(y)}):void(this.capturedTransaction=n);const o=this.state.apply(n),a=!this.state.selection.eq(o.selection);this.emit("beforeTransaction",{editor:this,transaction:n,nextState:o}
1),this.view.updateState(o),this.emit("transaction",{editor:this,transaction:n}),a&&this.emit("selectionUpdate",{editor:this,transaction:n});const u=n.getMeta("focus"),p=n.getMeta("blur");u&&this.emit("focus",{editor:this,event:u.event,transaction:n}),p&&this.emit("blur",{editor:this,event:p.event,transaction:n}),n.docChanged&&!n.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:n})}getAttributes(n){return Un(this.state,n)}isActive(n,o){return function Jn(i,n,o={}){if(!n)return tr(i,null,o)||Bn(i,null,o);const a=Wn(n,i.schema);return"node"===a?tr(i,n,o):"mark"===a&&Bn(i,n,o)}(this.state,"string"==typeof n?n:null,"string"==typeof n?o:n)}getJSON(){return this.state.doc.toJSON()}getHTML(){return P(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:o="\n\n",textSerializers:a={}}=n||{};return Fr(this.state.doc,{blockSeparator:o,textSerializers:{...lr(this.schema),...a}})}get isEmpty(){return kn(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!(null!==(n=this.view)&&void 0!==n&&n.docView)}$node(n,o){var a;return(null===(a=this.$doc)||void 0===a?void 0:a.querySelector(n,o))||null}$nodes(n,o){var a;return(null===(a=this.$doc)||void 0===a?void 0:a.querySelectorAll(n,o))||null}$pos(n){const o=this.state.doc.resolve(n);return new gt(o,this)}get $doc(){return this.$pos(0)}}function $t(i){return new Me({find:i.find,handler:({state:n,range:o,match:a})=>{const u=he(i.getAttributes,void 0,a);if(!1===u||null===u)return null;const{tr:p}=n,y=a[a.length-1],S=a[0];if(y){const E=S.search(/\S/),B=o.from+S.indexOf(y),L=B+y.length;if(yr(o.from,o.to,n.doc).filter(j=>j.mark.type.excluded.find(re=>re===i.type&&re!==j.mark.type)).filter(j=>j.to>B).length)return null;L<o.to&&p.delete(L,o.to),B>o.from&&p.delete(o.from+E,B),p.addMark(o.from+E,o.from+E+y.length,i.type.create(u||{})),p.removeStoredMark(i.type)}}})}function Lt(i){return new Me({find:i.find,handler:({state:n,range:o,match:a})=>{const u=he(i.getAttributes,void 0,a)||{},{tr:p}=n,y=o.from;let S=o.to;const E=i.type.create(u);if(a[1]){let L=y+a[0].lastIndexOf(a[1]);L>S?L=S:S=L+a[1].length,p.insertText(a[0][a[0].length-1],y+a[0].length-1),p.replaceWith(L,S,E)}else a[0]&&p.insert(i.type.isInline?y:y-1,i.type.create(u)).delete(p.mapping.map(y),p.mapping.map(S));p.scrollIntoView()}})}function hn(i){return new Me({find:i.find,handler:({state:n,range:o,match:a})=>{const u=n.doc.resolve(o.from),p=he(i.getAttributes,void 0,a)||{};if(!u.node(-1).canReplaceWith(u.index(-1),u.indexAfter(-1),i.type))return null;n.tr.delete(o.from,o.to).setBlockType(o.from,o.from,i.type,p)}})}function t(i){return new Me({find:i.find,handler:({state:n,range:o,match:a,chain:u})=>{const p=he(i.getAttributes,void 0,a)||{},y=n.tr.delete(o.from,o.to),E=y.doc.resolve(o.from).blockRange(),B=E&&(0,ne.oM)(E,i.type,p);if(!B)return null;if(y.wrap(E,B),i.keepMarks&&i.editor){const{selection:_,storedMarks:W}=n,{splittableMarks:j}=i.editor.extensionManager,ee=W||_.$to.parentOffset&&_.$from.marks();if(ee){const re=ee.filter(pe=>j.includes(pe.type.name));y.ensureMarks(re)}}if(i.keepAttributes){const _="bulletList"===i.type.name||"orderedList"===i.type.name?"listItem":"taskList";u().updateAttributes(_,p).run()}const L=y.doc.resolve(o.from-1).nodeBefore;L&&L.type===i.type&&(0,ne.n9)(y.doc,o.from-1)&&(!i.joinPredicate||i.joinPredicate(a,L))&&y.join(o.from-1)}})}class e{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=he(m(this,"addOptions",{name:this.name}))),this.storage=he(m(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new e(n)}configure(n={}){const o=this.extend({...this.config,addOptions:()=>Xn(this.options,n)});return o.name=this.name,o.parent=this.parent,o}extend(n={}){const o=new e(n);return o.parent=this,this.child=o,o.name=n.name?n.name:o.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: "${o.name}".`),o.options=he(m(o,"addOptions",{name:o.name})),o.storage=he(m(o,"addStorage",{name:o.name,options:o.options})),o}}
1class r{constructor(n,o,a){this.isDragging=!1,this.component=n,this.editor=o.editor,this.options={stopEvent:null,ignoreMutation:null,...a},this.extension=o.extension,this.node=o.node,this.decorations=o.decorations,this.innerDecorations=o.innerDecorations,this.view=o.view,this.HTMLAttributes=o.HTMLAttributes,this.getPos=o.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(n){var o,a,u,p,y,S,E;const{view:B}=this.editor,L=n.target,_=3===L.nodeType?null===(o=L.parentElement)||void 0===o?void 0:o.closest("[data-drag-handle]"):L.closest("[data-drag-handle]");if(!this.dom||null!==(a=this.contentDOM)&&void 0!==a&&a.contains(L)||!_)return;let W=0,j=0;if(this.dom!==_){const dt=this.dom.getBoundingClientRect(),mt=_.getBoundingClientRect(),Pt=null!==(u=n.offsetX)&&void 0!==u?u:null===(p=n.nativeEvent)||void 0===p?void 0:p.offsetX,At=null!==(y=n.offsetY)&&void 0!==y?y:null===(S=n.nativeEvent)||void 0===S?void 0:S.offsetY;W=mt.x-dt.x+Pt,j=mt.y-dt.y+At}const ee=this.dom.cloneNode(!0);
1null===(E=n.dataTransfer)||void 0===E||E.setDragImage(ee,W,j);const re=this.getPos();if("number"!=typeof re)return;const pe=D.nh.create(B.state.doc,re),Ce=B.state.tr.setSelection(pe);B.dispatch(Ce)}stopEvent(n){var o;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:n});const a=n.target;if(!this.dom.contains(a)||null!==(o=this.contentDOM)&&void 0!==o&&o.contains(a))return!1;const p=n.type.startsWith("drag"),y="drop"===n.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(a.tagName)||a.isContentEditable)&&!y&&!p)return!0;const{isEditable:E}=this.editor,{isDragging:B}=this,L=!!this.node.type.spec.draggable,_=D.nh.isSelectable(this.node),W="copy"===n.type,j="paste"===n.type,ee="cut"===n.type,re="mousedown"===n.type;if(!L&&_&&p&&n.target===this.dom&&n.preventDefault(),L&&p&&!B&&n.target===this.dom)return n.preventDefault(),!1;if(L&&E&&!B&&re){const pe=a.closest("[data-drag-handle]");pe&&(this.dom===pe||this.dom.contains(pe))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(B||y||W||j||ee||re&&_)}ignoreMutation(n){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:n}):!(!this.node.isLeaf&&!this.node.isAtom&&("selection"===n.type||this.dom.contains(n.target)&&"childList"===n.type&&(cr()||Ar())&&this.editor.isFocused&&[...Array.from(n.addedNodes),...Array.from(n.removedNodes)].every(a=>a.isContentEditable)||(this.contentDOM!==n.target||"attributes"!==n.type)&&this.contentDOM.contains(n.target))))}updateAttributes(n){this.editor.commands.command(({tr:o})=>{const a=this.getPos();return"number"==typeof a&&(o.setNodeMarkup(a,void 0,{...this.node.attrs,...n}),!0)})}deleteNode(){const n=this.getPos();"number"==typeof n&&this.editor.commands.deleteRange({from:n,to:n+this.node.nodeSize})}}function l(i){return new vr({find:i.find,handler:({state:n,range:o,match:a,pasteEvent:u})=>{const p=he(i.getAttributes,void 0,a,u);if(!1===p||null===p)return null;const{tr:y}=n,S=a[a.length-1],E=a[0];let B=o.to;if(S){const L=E.search(/\S/),_=o.from+E.indexOf(S),W=_+S.length;if(yr(o.from,o.to,n.doc).filter(ee=>ee.mark.type.excluded.find(pe=>pe===i.type&&pe!==ee.mark.type)).filter(ee=>ee.to>_).length)return null;W<o.to&&y.delete(W,o.to),_>o.from&&y.delete(o.from+L,_),B=o.from+L+S.length,y.addMark(o.from+L,B,i.type.create(p||{})),y.removeStoredMark(i.type)}}})}function d(i,n){const{selection:o}=i,{$from:a}=o;if(o instanceof D.nh){const p=a.index();return a.parent.canReplaceWith(p,p+1,n)}let u=a.depth;for(;u>=0;){const p=a.index(u);if(a.node(u).contentMatchAt(p).matchType(n))return!0;u-=1}return!1}},18532:(Nt,it,Oe)=>{Oe.d(it,{Cv:()=>ye});var D=Oe(89153);const Ee=/^\s*>\s$/,ye=D.bP.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:ie}){return["blockquote",(0,D.KV)(this.options.HTMLAttributes,ie),0]},addCommands(){return{setBlockquote:()=>({commands:ie})=>ie.wrapIn(this.name),toggleBlockquote:()=>({commands:ie})=>ie.toggleWrap(this.name),unsetBlockquote:()=>({commands:ie})=>ie.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,D.tG)({find:Ee,type:this.type})]}})},31204:(Nt,it,Oe)=>{Oe.d(it,{Ay:()=>Te,yN:()=>Te});var D=Oe(89153);const Ee=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ye=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,ie=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,ne=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Te=D.CU.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:Pe=>"normal"!==Pe.style.fontWeight&&null},{style:"font-weight=400",clearMark:Pe=>Pe.type.name===this.name},{style:"font-weight",getAttrs:Pe=>/^(bold(er)?|[5-9]\d{2,})$/.test(Pe)&&null}]},renderHTML({HTMLAttributes:Pe}){return["strong",(0,D.KV)(this.options.HTMLAttributes,Pe),0]},addCommands(){return{setBold:()=>({commands:Pe})=>Pe.setMark(this.name),toggleBold:()=>({commands:Pe})=>Pe.toggleMark(this.name),unsetBold:()=>({commands:Pe})=>Pe.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
1,addInputRules(){return[(0,D.OX)({find:Ee,type:this.type}),(0,D.OX)({find:ie,type:this.type})]},addPasteRules(){return[(0,D.Zc)({find:ye,type:this.type}),(0,D.Zc)({find:ne,type:this.type})]}})},2760:(Nt,it,Oe)=>{Oe.d(it,{Ay:()=>ne,Rg:()=>ne});var D=Oe(89153);const ye="textStyle",ie=/^\s*([-+*])\s$/,ne=D.bP.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:Te}){return["ul",(0,D.KV)(this.options.HTMLAttributes,Te),0]},addCommands(){return{toggleBulletList:()=>({commands:Te,chain:Pe})=>this.options.keepAttributes?Pe().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(ye)).run():Te.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let Te=(0,D.tG)({find:ie,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(Te=(0,D.tG)({find:ie,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(ye),editor:this.editor})),[Te]}})},48236:(Nt,it,Oe)=>{Oe.d(it,{Q:()=>Te,A:()=>Te});var D=Oe(89153),Ee=Oe(17398),ye=Oe(66085);function ie(Pe={}){return new Ee.k_({view:Fe=>new ne(Fe,Pe)})}class ne{constructor(Fe,Ae){var $e;this.editorView=Fe,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==($e=Ae.width)&&void 0!==$e?$e:1,this.color=!1===Ae.color?void 0:Ae.color||"black",this.class=Ae.class,this.handlers=["dragover","dragend","drop","dragleave"].map(He=>{let De=Xe=>{this[He](Xe)};return Fe.dom.addEventListener(He,De),{name:He,handler:De}})}destroy(){this.handlers.forEach(({name:Fe,handler:Ae})=>this.editorView.dom.removeEventListener(Fe,Ae))}update(Fe,Ae){null!=this.cursorPos&&Ae.doc!=Fe.state.doc&&(this.cursorPos>Fe.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(Fe){Fe!=this.cursorPos&&(this.cursorPos=Fe,null==Fe?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let $e,Fe=this.editorView.state.doc.resolve(this.cursorPos),Ae=!Fe.parent.inlineContent,He=this.editorView.dom,De=He.getBoundingClientRect(),Xe=De.width/He.offsetWidth,Qe=De.height/He.offsetHeight;if(Ae){let Z=Fe.nodeBefore,fe=Fe.nodeAfter;if(Z||fe){let me=this.editorView.nodeDOM(this.cursorPos-(Z?Z.nodeSize:0));if(me){let oe=me.getBoundingClientRect(),Se=Z?oe.bottom:oe.top;Z&&fe&&(Se=(Se+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let Ve=this.width/2*Qe;$e={left:oe.left,right:oe.right,top:Se-Ve,bottom:Se+Ve}}}}if(!$e){let Z=this.editorView.coordsAtPos(this.cursorPos),fe=this.width/2*Xe;$e={left:Z.left-fe,right:Z.left+fe,top:Z.top,bottom:Z.bottom}}let Ne,xe,Ke=this.editorView.dom.offsetParent;if(this.element||(this.element=Ke.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",Ae),this.element.classList.toggle("prosemirror-dropcursor-inline",!Ae),!Ke||Ke==document.body&&"static"==getComputedStyle(Ke).position)Ne=-pageXOffset,xe=-pageYOffset;else{let Z=Ke.getBoundingClientRect();Ne=Z.left-Ke.scrollLeft*(Z.width/Ke.offsetWidth),xe=Z.top-Ke.scrollTop*(Z.height/Ke.offsetHeight)}this.element.style.left=($e.left-Ne)/Xe+"px",this.element.style.top=($e.top-xe)/Qe+"px",this.element.style.width=($e.right-$e.left)/Xe+"px",this.element.style.height=($e.bottom-$e.top)/Qe+"px"}scheduleRemoval(Fe){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),Fe)}dragover(Fe){if(!this.editorView.editable)return;let Ae=this.editorView.posAtCoords({left:Fe.clientX,top:Fe.clientY}),$e=Ae&&Ae.inside>=0&&this.editorView.state.doc.nodeAt(Ae.inside),He=$e&&$e.type.spec.disableDropCursor,De="function"==typeof He?He(this.editorView,Ae,Fe):He;if(Ae&&!De){let Xe=Ae.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let Qe=(0,ye.Um)(this.editorView.state.doc,Xe,this.editorView.dragging.slice);null!=Qe&&(Xe=Qe)}this.setCursor(Xe),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(Fe){this.editorView.dom.contains(Fe.relatedTarget)||this.setCursor(null)}}const Te=D.YY.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[ie(this.options)]}})},45354:(Nt,it,Oe)=>{Oe.d(it,{v:()=>Ne,A:()=>Ne});var D=Oe(89153),Ee=Oe(8620),ye=Oe(17398),ie=Oe(17533),ne=Oe(77154);class Te extends ye.LN{constructor(Z){super(Z,Z)}map(Z,fe){let me=Z.resolve(fe.map(this.head));
1return Te.valid(me)?new Te(me):ye.LN.near(me)}content(){return ie.Ji.empty}eq(Z){return Z instanceof Te&&Z.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(Z,fe){if("number"!=typeof fe.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new Te(Z.resolve(fe.pos))}getBookmark(){return new Pe(this.anchor)}static valid(Z){let fe=Z.parent;if(fe.isTextblock||!function Fe(xe){for(let Z=xe.depth;Z>=0;Z--){let fe=xe.index(Z),me=xe.node(Z);if(0!=fe)for(let oe=me.child(fe-1);;oe=oe.lastChild){if(0==oe.childCount&&!oe.inlineContent||oe.isAtom||oe.type.spec.isolating)return!0;if(oe.inlineContent)return!1}else if(me.type.spec.isolating)return!0}return!0}(Z)||!function Ae(xe){for(let Z=xe.depth;Z>=0;Z--){let fe=xe.indexAfter(Z),me=xe.node(Z);if(fe!=me.childCount)for(let oe=me.child(fe);;oe=oe.firstChild){if(0==oe.childCount&&!oe.inlineContent||oe.isAtom||oe.type.spec.isolating)return!0;if(oe.inlineContent)return!1}else if(me.type.spec.isolating)return!0}return!0}(Z))return!1;let me=fe.type.spec.allowGapCursor;if(null!=me)return me;let oe=fe.contentMatchAt(Z.index()).defaultType;return oe&&oe.isTextblock}static findGapCursorFrom(Z,fe,me=!1){e:for(;;){if(!me&&Te.valid(Z))return Z;let oe=Z.pos,Se=null;for(let Ve=Z.depth;;Ve--){let qe=Z.node(Ve);if(fe>0?Z.indexAfter(Ve)<qe.childCount:Z.index(Ve)>0){Se=qe.child(fe>0?Z.indexAfter(Ve):Z.index(Ve)-1);break}if(0==Ve)return null;oe+=fe;let wt=Z.doc.resolve(oe);if(Te.valid(wt))return wt}for(;;){let Ve=fe>0?Se.firstChild:Se.lastChild;if(!Ve){if(Se.isAtom&&!Se.isText&&!ye.nh.isSelectable(Se)){Z=Z.doc.resolve(oe+Se.nodeSize*fe),me=!1;continue e}break}Se=Ve,oe+=fe;let qe=Z.doc.resolve(oe);if(Te.valid(qe))return qe}return null}}}Te.prototype.visible=!1,Te.findFrom=Te.findGapCursorFrom,ye.LN.jsonID("gapcursor",Te);class Pe{constructor(Z){this.pos=Z}map(Z){return new Pe(Z.map(this.pos))}resolve(Z){let fe=Z.resolve(this.pos);return Te.valid(fe)?new Te(fe):ye.LN.near(fe)}}const He=(0,Ee.K)({ArrowLeft:De("horiz",-1),ArrowRight:De("horiz",1),ArrowUp:De("vert",-1),ArrowDown:De("vert",1)});function De(xe,Z){const fe="vert"==xe?Z>0?"down":"up":Z>0?"right":"left";return function(me,oe,Se){let Ve=me.selection,qe=Z>0?Ve.$to:Ve.$from,wt=Ve.empty;if(Ve instanceof ye.U3){if(!Se.endOfTextblock(fe)||0==qe.depth)return!1;wt=!1,qe=me.doc.resolve(Z>0?qe.after():qe.before())}let ct=Te.findGapCursorFrom(qe,Z,wt);return!!ct&&(oe&&oe(me.tr.setSelection(new Te(ct))),!0)}}function Xe(xe,Z,fe){if(!xe||!xe.editable)return!1;let me=xe.state.doc.resolve(Z);if(!Te.valid(me))return!1;let oe=xe.posAtCoords({left:fe.clientX,top:fe.clientY});return!(oe&&oe.inside>-1&&ye.nh.isSelectable(xe.state.doc.nodeAt(oe.inside))||(xe.dispatch(xe.state.tr.setSelection(new Te(me))),0))}function Qe(xe,Z){if("insertCompositionText"!=Z.inputType||!(xe.state.selection instanceof Te))return!1;let{$from:fe}=xe.state.selection,me=fe.parent.contentMatchAt(fe.index()).findWrapping(xe.state.schema.nodes.text);if(!me)return!1;let oe=ie.FK.empty;for(let Ve=me.length-1;Ve>=0;Ve--)oe=ie.FK.from(me[Ve].createAndFill(null,oe));let Se=xe.state.tr.replace(fe.pos,fe.pos,new ie.Ji(oe,0,0));return Se.setSelection(ye.U3.near(Se.doc.resolve(fe.pos+1))),xe.dispatch(Se),!1}function Ke(xe){if(!(xe.selection instanceof Te))return null;let Z=document.createElement("div");return Z.className="ProseMirror-gapcursor",ne.zF.create(xe.doc,[ne.NZ.widget(xe.selection.head,Z,{key:"gapcursor"})])}const Ne=D.YY.create({name:"gapCursor",addProseMirrorPlugins:()=>[new ye.k_({props:{decorations:Ke,createSelectionBetween:(xe,Z,fe)=>Z.pos==fe.pos&&Te.valid(fe)?new Te(fe):null,handleClick:Xe,handleKeyDown:He,handleDOMEvents:{beforeinput
1:Qe}}})],extendNodeSchema(xe){var Z;return{allowGapCursor:null!==(Z=(0,D.gk)((0,D.iI)(xe,"allowGapCursor",{name:xe.name,options:xe.options,storage:xe.storage})))&&void 0!==Z?Z:null}}})},90056:(Nt,it,Oe)=>{Oe.d(it,{A:()=>Ee,B:()=>Ee});var D=Oe(89153);const Ee=D.bP.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:ye}){return["br",(0,D.KV)(this.options.HTMLAttributes,ye)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:ye,chain:ie,state:ne,editor:Te})=>ye.first([()=>ye.exitCode(),()=>ye.command(()=>{const{selection:Pe,storedMarks:Fe}=ne;if(Pe.$from.parent.type.spec.isolating)return!1;const{keepMarks:Ae}=this.options,{splittableMarks:$e}=Te.extensionManager,He=Fe||Pe.$to.parentOffset&&Pe.$from.marks();return ie().insertContent({type:this.name}).command(({tr:De,dispatch:Xe})=>{if(Xe&&He&&Ae){const Qe=He.filter(Ke=>$e.includes(Ke.type.name));De.ensureMarks(Qe)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}})},11103:(Nt,it,Oe)=>{Oe.d(it,{A:()=>Ee,D:()=>Ee});var D=Oe(89153);const Ee=D.bP.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(ye=>({tag:`h${ye}`,attrs:{level:ye}}))},renderHTML({node:ye,HTMLAttributes:ie}){return[`h${this.options.levels.includes(ye.attrs.level)?ye.attrs.level:this.options.levels[0]}`,(0,D.KV)(this.options.HTMLAttributes,ie),0]},addCommands(){return{setHeading:ye=>({commands:ie})=>!!this.options.levels.includes(ye.level)&&ie.setNode(this.name,ye),toggleHeading:ye=>({commands:ie})=>!!this.options.levels.includes(ye.level)&&ie.toggleNode(this.name,"paragraph",ye)}},addKeyboardShortcuts(){return this.options.levels.reduce((ye,ie)=>({...ye,[`Mod-Alt-${ie}`]:()=>this.editor.commands.toggleHeading({level:ie})}),{})},addInputRules(){return this.options.levels.map(ye=>(0,D.JJ)({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${ye}}
1)\\s$`),type:this.type,getAttributes:{level:ye}}))}})},81186:(Nt,it,Oe)=>{Oe.d(it,{B:()=>ve,A:()=>ve});var D=Oe(89153),ye=function(){};ye.prototype.append=function($){return $.length?($=ye.from($),!this.length&&$||$.length<200&&this.leafAppend($)||this.length<200&&$.leafPrepend(this)||this.appendInner($)):this},ye.prototype.prepend=function($){return $.length?ye.from($).append(this):this},ye.prototype.appendInner=function($){return new ne(this,$)},ye.prototype.slice=function($,Q){return void 0===$&&($=0),void 0===Q&&(Q=this.length),$>=Q?ye.empty:this.sliceInner(Math.max(0,$),Math.min(this.length,Q))},ye.prototype.get=function($){if(!($<0||$>=this.length))return this.getInner($)},ye.prototype.forEach=function($,Q,se){void 0===Q&&(Q=0),void 0===se&&(se=this.length),Q<=se?this.forEachInner($,Q,se,0):this.forEachInvertedInner($,Q,se,0)},ye.prototype.map=function($,Q,se){void 0===Q&&(Q=0),void 0===se&&(se=this.length);var ge=[];return this.forEach(function(we,_e){return ge.push($(we,_e))},Q,se),ge},ye.from=function($){return $ instanceof ye?$:$&&$.length?new ie($):ye.empty};var ie=function(Y){function $(se){Y.call(this),this.values=se}Y&&($.__proto__=Y),($.prototype=Object.create(Y&&Y.prototype)).constructor=$;var Q={length:{configurable:!0},depth:{configurable:!0}};return $.prototype.flatten=function(){return this.values},$.prototype.sliceInner=function(ge,we){return 0==ge&&we==this.length?this:new $(this.values.slice(ge,we))},$.prototype.getInner=function(ge){return this.values[ge]},$.prototype.forEachInner=function(ge,we,_e,Ze){for(var ft=we;ft<_e;ft++)if(!1===ge(this.values[ft],Ze+ft))return!1},$.prototype.forEachInvertedInner=function(ge,we,_e,Ze){for(var ft=we-1;ft>=_e;ft--)if(!1===ge(this.values[ft],Ze+ft))return!1},$.prototype.leafAppend=function(ge){if(this.length+ge.length<=200)return new $(this.values.concat(ge.flatten()))},$.prototype.leafPrepend=function(ge){if(this.length+ge.length<=200)return new $(ge.flatten().concat(this.values))},Q.length.get=function(){return this.values.length},Q.depth.get=function(){return 0},Object.defineProperties($.prototype,Q),$}(ye);ye.empty=new ie([]);var ne=function(Y){function $(Q,se){Y.call(this),this.left=Q,this.right=se,this.length=Q.length+se.length,this.depth=Math.max(Q.depth,se.depth)+1}return Y&&($.__proto__=Y),($.prototype=Object.create(Y&&Y.prototype)).constructor=$,$.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},$.prototype.getInner=function(se){return se<this.left.length?this.left.get(se):this.right.get(se-this.left.length)},$.prototype.forEachInner=function(se,ge,we,_e){var Ze=this.left.length;if(ge<Ze&&!1===this.left.forEachInner(se,ge,Math.min(we,Ze),_e)||we>Ze&&!1===this.right.forEachInner(se,Math.max(ge-Ze,0),Math.min(this.length,we)-Ze,_e+Ze))return!1},$.prototype.forEachInvertedInner=function(se,ge,we,_e){var Ze=this.left.length;if(ge>Ze&&!1===this.right.forEachInvertedInner(se,ge-Ze,Math.max(we,Ze)-Ze,_e+Ze)||we<Ze&&!1===this.left.forEachInvertedInner(se,Math.min(ge,Ze),we,_e))return!1},$.prototype.sliceInner=function(se,ge){if(0==se&&ge==this.length)return this;var we=this.left.length;return ge<=we?this.left.slice(se,ge):se>=we?this.right.slice(se-we,ge-we):this.left.slice(se,we).append(this.right.slice(0,ge-we))},$.prototype.leafAppend=function(se){var ge=this.right.leafAppend(se);if(ge)return new $(this.left,ge)},$.prototype.leafPrepend=function(se){var ge=this.left.leafPrepend(se);if(ge)return new $(ge,this.right)},$.prototype.appendInner=function(se){return this.left.depth>=Math.max(this.right.depth,se.depth)+1?new $(this.left,new $(this.right,se)):new $(this,se)},$}(ye);const Te=ye;var Pe=Oe(66085),Fe=Oe(17398);class $e{constructor($,Q){this.items=$,this.eventCount=Q}popEvent($,Q){if(0==this.eventCount)return null;let ge,we,se=this.items.length;for(;;se--)if(this.items.get(se-1).selection){--se;break}Q&&(ge=this.remapping(se,this.items.length),we=ge.maps.length);let Ze,ft,_e=$.tr,Ot=[],St=[];return this.items.forEach((Mt,ht)=>{if(!Mt.step)return ge||(ge=this.remapping(se,ht+1),we=ge.maps.length),we--,void St.push(Mt);if(ge){St.push(new De(Mt.map));let Yt,xt=Mt.step.map(ge.slice(we));xt&&_e.maybeStep(xt).doc&&(Yt=_e.mapping.maps[_e.mapping.maps.length-1],Ot.push(new De(Yt,void 0,void 0,Ot.length+St.length))),we--,Yt&&ge.appendMap(Yt,we)}else _e.maybeStep(Mt.step);return Mt.selection?(Ze=ge?Mt.selection.map(ge.slice(we)):Mt.selection,ft=new $e(this.items.slice(0,se).append(St.reverse().concat(Ot)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:ft,transform:_e,selection:Ze}}addTransform($,Q,se,ge){let we=[],_e=this.eventCount,Ze=this.items,ft=!ge&&Ze.length?Ze.get(Ze.length-1):null;for(let St=0;St<$.steps.length;St++){let xt,Mt=$.steps[St].invert($.docs[St]),ht=new De($.mapping.maps[St],Mt,Q);(xt=ft&&ft.merge(ht))&&(ht=xt,St?we.pop():Ze=Ze.slice(0,Ze.length-1)),we.push(ht),Q&&(_e++,Q=void 0),ge||(ft=ht)}let Ot=_e-se.depth;return Ot>Qe&&(Ze=function He(Y,$){let Q;return Y.forEach((se,ge)=>{if(se.selection&&0==$--)return Q=ge,!1}),Y.slice(Q)}(Ze,Ot),_e-=Ot),new $e(Ze.append(we),_e)}remapping($,Q){let se=new Pe.X9;
1return this.items.forEach((ge,we)=>{se.appendMap(ge.map,null!=ge.mirrorOffset&&we-ge.mirrorOffset>=$?se.maps.length-ge.mirrorOffset:void 0)},$,Q),se}addMaps($){return 0==this.eventCount?this:new $e(this.items.append($.map(Q=>new De(Q))),this.eventCount)}rebased($,Q){if(!this.eventCount)return this;let se=[],ge=Math.max(0,this.items.length-Q),we=$.mapping,_e=$.steps.length,Ze=this.eventCount;this.items.forEach(ht=>{ht.selection&&Ze--},ge);let ft=Q;this.items.forEach(ht=>{let xt=we.getMirror(--ft);if(null==xt)return;_e=Math.min(_e,xt);let Yt=we.maps[xt];if(ht.step){let gn=$.steps[xt].invert($.docs[xt]),Xt=ht.selection&&ht.selection.map(we.slice(ft+1,xt));Xt&&Ze++,se.push(new De(Yt,gn,Xt))}else se.push(new De(Yt))},ge);let Ot=[];for(let ht=Q;ht<_e;ht++)Ot.push(new De(we.maps[ht]));let St=this.items.slice(0,ge).append(Ot).append(se),Mt=new $e(St,Ze);return Mt.emptyItemCount()>500&&(Mt=Mt.compress(this.items.length-se.length)),Mt}emptyItemCount(){let $=0;return this.items.forEach(Q=>{Q.step||$++}),$}compress($=this.items.length){let Q=this.remapping(0,$),se=Q.maps.length,ge=[],we=0;return this.items.forEach((_e,Ze)=>{if(Ze>=$)ge.push(_e),_e.selection&&we++;else if(_e.step){let ft=_e.step.map(Q.slice(se)),Ot=ft&&ft.getMap();if(se--,Ot&&Q.appendMap(Ot,se),ft){let St=_e.selection&&_e.selection.map(Q.slice(se));St&&we++;let ht,Mt=new De(Ot.invert(),ft,St),xt=ge.length-1;(ht=ge.length&&ge[xt].merge(Mt))?ge[xt]=ht:ge.push(Mt)}}else _e.map&&se--},this.items.length,0),new $e(Te.from(ge.reverse()),we)}}$e.empty=new $e(Te.empty,0);class De{constructor($,Q,se,ge){this.map=$,this.step=Q,this.selection=se,this.mirrorOffset=ge}merge($){if(this.step&&$.step&&!$.selection){let Q=$.step.merge(this.step);if(Q)return new De(Q.getMap().invert(),Q,this.selection)}}}class Xe{constructor($,Q,se,ge,we){this.done=$,this.undone=Q,this.prevRanges=se,this.prevTime=ge,this.prevComposition=we}}const Qe=20;function xe(Y){let $=[];for(let Q=Y.length-1;Q>=0&&0==$.length;Q--)Y[Q].forEach((se,ge,we,_e)=>$.push(we,_e));return $}function Z(Y,$){if(!Y)return null;let Q=[];for(let se=0;se<Y.length;se+=2){let ge=$.map(Y[se],1),we=$.map(Y[se+1],-1);ge<=we&&Q.push(ge,we)}return Q}let me=!1,oe=null;function Se(Y){let $=Y.plugins;if(oe!=$){me=!1,oe=$;for(let Q=0;Q<$.length;Q++)if($[Q].spec.historyPreserveItems){me=!0;break}}return me}const qe=new Fe.hs("history"),wt=new Fe.hs("closeHistory");function ct(Y={}){return new Fe.k_({key:qe,state:{init:()=>new Xe($e.empty,$e.empty,null,0,-1),apply:($,Q,se)=>function Ke(Y,$,Q,se){let we,ge=Q.getMeta(qe);if(ge)return ge.historyState;Q.getMeta(wt)&&(Y=new Xe(Y.done,Y.undone,null,0,-1));let _e=Q.getMeta("appendedTransaction");if(0==Q.steps.length)return Y;if(_e&&_e.getMeta(qe))return _e.getMeta(qe).redo?new Xe(Y.done.addTransform(Q,void 0,se,Se($)),Y.undone,xe(Q.mapping.maps),Y.prevTime,Y.prevComposition):new Xe(Y.done,Y.undone.addTransform(Q,void 0,se,Se($)),null,Y.prevTime,Y.prevComposition);if(!1===Q.getMeta("addToHistory")||_e&&!1===_e.getMeta("addToHistory"))return(we=Q.getMeta("rebased"))?new Xe(Y.done.rebased(Q,we),Y.undone.rebased(Q,we),Z(Y.prevRanges,Q.mapping),Y.prevTime,Y.prevComposition):new Xe(Y.done.addMaps(Q.mapping.maps),Y.undone.addMaps(Q.mapping.maps),Z(Y.prevRanges,Q.mapping),Y.prevTime,Y.prevComposition);{let Ze=Q.getMeta("composition"),ft=0==Y.prevTime||!_e&&Y.prevComposition!=Ze&&(Y.prevTime<(Q.time||0)-se.newGroupDelay||!function Ne(Y,$){if(!$)return!1;if(!Y.docChanged)return!0;let Q=!1;return Y.mapping.maps[0].forEach((se,ge)=>{for(let we=0;we<$.length;we+=2)se<=$[we+1]&&ge>=$[we]&&(Q=!0)}),Q}(Q,Y.prevRanges)),Ot=_e?Z(Y.prevRanges,Q.mapping):xe(Q.mapping.maps);return new Xe(Y.done.addTransform(Q,ft?$.selection.getBookmark():void 0,se,Se($)),$e.empty,Ot,Q.time,Ze??Y.prevComposition)}}(Q,se,$,Y)},config:Y={depth:Y.depth||100,newGroupDelay:Y.newGroupDelay||500},props:{handleDOMEvents:{beforeinput($,Q){let se=Q.inputType,ge="historyUndo"==se?yt:"historyRedo"==se?at:null;return!!ge&&(Q.preventDefault(),ge($.state,$.dispatch))}}}})}function rt(Y,$){return(Q,se)=>{let ge=qe.getState(Q);if(!ge||0==(Y?ge.undone:ge.done).eventCount)return!1;if(se){let we=function fe(Y,$,Q){let se=Se($),ge=qe.get($).spec.config,we=(Q?Y.undone:Y.done).popEvent($,se);
1if(!we)return null;let _e=we.selection.resolve(we.transform.doc),Ze=(Q?Y.done:Y.undone).addTransform(we.transform,$.selection.getBookmark(),ge,se),ft=new Xe(Q?Ze:we.remaining,Q?we.remaining:Ze,null,0,-1);return we.transform.setSelection(_e).setMeta(qe,{redo:Q,historyState:ft})}(ge,Q,Y);we&&se($?we.scrollIntoView():we)}return!0}}const yt=rt(!1,!0),at=rt(!0,!0);rt(!1,!1),rt(!0,!1);const ve=D.YY.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:Y,dispatch:$})=>yt(Y,$),redo:()=>({state:Y,dispatch:$})=>at(Y,$)}),addProseMirrorPlugins(){return[ct(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044f":()=>this.editor.commands.undo(),"Shift-Mod-\u044f":()=>this.editor.commands.redo()}}})},26449:(Nt,it,Oe)=>{Oe.d(it,{Ay:()=>Te,J2:()=>Te});var D=Oe(89153);const Ee=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ye=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,ie=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ne=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Te=D.CU.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:Pe=>"normal"!==Pe.style.fontStyle&&null},{style:"font-style=normal",clearMark:Pe=>Pe.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:Pe}){return["em",(0,D.KV)(this.options.HTMLAttributes,Pe),0]},addCommands(){return{setItalic:()=>({commands:Pe})=>Pe.setMark(this.name),toggleItalic:()=>({commands:Pe})=>Pe.toggleMark(this.name),unsetItalic:()=>({commands:Pe})=>Pe.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,D.OX)({find:Ee,type:this.type}),(0,D.OX)({find:ie,type:this.type})]},addPasteRules(){return[(0,D.Zc)({find:ye,type:this.type}),(0,D.Zc)({find:ne,type:this.type})]}})},51793:(Nt,it,Oe)=>{Oe.d(it,{A:()=>Ee,c:()=>Ee});var D=Oe(89153);const Ee=D.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:ye}){return["li",(0,D.KV)(this.options.HTMLAttributes,ye),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)}}})},95181:(Nt,it,Oe)=>{Oe.d(it,{Ay:()=>ne,_J:()=>ne});var D=Oe(89153);const ye="textStyle",ie=/^(\d+)\.\s$/,ne=D.bP.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:Te=>Te.hasAttribute("start")?parseInt(Te.getAttribute("start")||"",10):1},type:{default:null,parseHTML:Te=>Te.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:Te}){const{start:Pe,...Fe}=Te;return 1===Pe?["ol",(0,D.KV)(this.options.HTMLAttributes,Fe),0]:["ol",(0,D.KV)(this.options.HTMLAttributes,Te),0]},addCommands(){return{toggleOrderedList:()=>({commands:Te,chain:Pe})=>this.options.keepAttributes?Pe().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(ye)).run():Te.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let Te=(0,D.tG)({find:ie,type:this.type,getAttributes:Pe=>({start:+Pe[1]}),joinPredicate:(Pe,Fe)=>Fe.childCount+Fe.attrs.start===+Pe[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(Te=(0,D.tG)({find:ie,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:Pe=>({start:+Pe[1],...this.editor.getAttributes(ye)}),joinPredicate:(Pe,Fe)=>Fe.childCount+Fe.attrs.start===+Pe[1],editor:this.editor})),[Te]}})},32126:(Nt,it,Oe)=>{Oe.d(it,{A:()=>ie,O:()=>ie});var D=Oe(89153),Ee=Oe(17398),ye=Oe(77154);const ie=D.YY.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Ee.k_({key:new Ee.hs("placeholder"),props:{decorations:({doc:ne,selection:Te})=>{const Pe=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:Fe}=Te,Ae=[];
1if(!Pe)return null;const $e=this.editor.isEmpty;return ne.descendants((He,De)=>{const Xe=Fe>=De&&Fe<=De+He.nodeSize,Qe=!He.isLeaf&&(0,D.Op)(He);if((Xe||!this.options.showOnlyCurrent)&&Qe){const Ke=[this.options.emptyNodeClass];$e&&Ke.push(this.options.emptyEditorClass);const Ne=ye.NZ.node(De,De+He.nodeSize,{class:Ke.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:He,pos:De,hasAnchor:Xe}):this.options.placeholder});Ae.push(Ne)}return this.options.includeChildren}),ye.zF.create(ne,Ae)}}})]}})},48907:(Nt,it,Oe)=>{Oe.d(it,{Ay:()=>ie,n:()=>ie});var D=Oe(89153);const Ee=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,ye=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,ie=D.CU.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:ne=>!!ne.includes("line-through")&&{}}],renderHTML({HTMLAttributes:ne}){return["s",(0,D.KV)(this.options.HTMLAttributes,ne),0]},addCommands(){return{setStrike:()=>({commands:ne})=>ne.setMark(this.name),toggleStrike:()=>({commands:ne})=>ne.toggleMark(this.name),unsetStrike:()=>({commands:ne})=>ne.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,D.OX)({find:Ee,type:this.type})]},addPasteRules(){return[(0,D.Zc)({find:ye,type:this.type})]}})},41632:(Nt,it,Oe)=>{Oe.d(it,{A:()=>Ee,E:()=>Ee});const Ee=Oe(89153).bP.create({name:"text",group:"inline"})},21797:(Nt,it,Oe)=>{Oe.d(it,{A:()=>Ee,z:()=>Ee});var D=Oe(89153);const Ee=D.CU.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:ye=>!!ye.includes("underline")&&{}}],renderHTML({HTMLAttributes:ye}){return["u",(0,D.KV)(this.options.HTMLAttributes,ye),0]},addCommands(){return{setUnderline:()=>({commands:ye})=>ye.setMark(this.name),toggleUnderline:()=>({commands:ye})=>ye.toggleMark(this.name),unsetUnderline:()=>({commands:ye})=>ye.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}})},28106:(Nt,it,Oe)=>{Oe.d(it,{HG:()=>Qe,ry:()=>Z,Pf:()=>He,Pj:()=>Ae,YP:()=>Ke});var D=Oe(17705),Ee=Oe(89417),ye=Oe(89153),ie=Oe(17398),ne=Oe(57967);class Te{constructor({editor:me,element:oe,view:Se,tippyOptions:Ve={},updateDelay:qe=250,shouldShow:wt}){this.preventHide=!1,this.shouldShow=({view:ct,state:rt,from:yt,to:at})=>{const{doc:Ie,selection:N}=rt,{empty:J}=N,X=!Ie.textBetween(yt,at).length&&(0,ye.eE)(rt.selection),ve=this.element.contains(document.activeElement);return!(!ct.hasFocus()&&!ve||J||X||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:ct})=>{var rt;this.preventHide?this.preventHide=!1:ct?.relatedTarget&&null!==(rt=this.element.parentNode)&&void 0!==rt&&rt.contains(ct.relatedTarget)||ct?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=ct=>{this.blurHandler({event:ct})},this.handleDebouncedUpdate=(ct,rt)=>{const yt=!rt?.selection.eq(ct.state.selection),at=!rt?.doc.eq(ct.state.doc);!yt&&!at||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(ct,yt,at,rt)},this.updateDelay))},this.updateHandler=(ct,rt,yt,at)=>{var Ie,N,J;const{state:X,composing:ve}=ct,{selection:Y}=X;if(ve||!rt&&!yt)return;this.createTooltip();const{ranges:Q}=Y,se=Math.min(...Q.map(_e=>_e.$from.pos)),ge=Math.max(...Q.map(_e=>_e.$to.pos));(null===(Ie=this.shouldShow)||void 0===Ie?void 0:Ie.call(this,{editor:this.editor,element:this.element,view:ct,state:X,oldState:at,from:se,to:ge}))?(null===(N=this.tippy)||void 0===N||N.setProps({getReferenceClientRect:(null===(J=this.tippyOptions)||void 0===J?void 0:J.getReferenceClientRect)||(()=>{if((0,ye.BQ)(X.selection)){let _e=ct.nodeDOM(se);if(_e){const Ze=_e.dataset.nodeViewWrapper?_e:_e.querySelector("[data-node-view-wrapper]");if(Ze&&(_e=Ze.firstChild),_e)return _e.getBoundingClientRect()}}return(0,ye.MG)(ct,se,ge)})}),this.show()):this.hide()},this.editor=me,this.element=oe,this.view=Se,this.updateDelay=qe,wt&&(this.shouldShow=wt),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=Ve,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:me}=this.editor.options;this.tippy||!me.parentElement||(this.tippy=(0,ne.Ay)(me,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(me,oe){const{state:Se}=me;if(this.updateDelay>0&&Se.selection.from!==Se.selection.to)return void this.handleDebouncedUpdate(me,oe);const qe=!oe?.selection.eq(me.state.selection),wt=!oe?.doc.eq(me.state.doc);this.updateHandler(me,qe,wt,oe)}show(){var me;null===(me=this.tippy)||void 0===me||me.show()}hide(){var me;null===(me=this.tippy)||void 0===me||me.hide()}destroy(){var me,oe;!(null===(me=this.tippy)||void 0===me)&&me.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(oe=this.tippy)||void 0===oe||oe.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Pe=fe=>new ie.k_({key:"string"==typeof fe.pluginKey?new ie.hs(fe.pluginKey):fe.pluginKey,view:me=>new Te({view:me,...fe})});ye.YY.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}
1),addProseMirrorPlugins(){return this.options.element?[Pe({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let Ae=(()=>{class fe{constructor(oe,Se,Ve){this.elRef=oe,this.renderer=Se,this.changeDetectorRef=Ve,this.outputFormat="html",this.onChange=()=>{},this.onTouched=()=>{},this.handleChange=({editor:qe,transaction:wt})=>{if(wt.docChanged){if(this.changeDetectorRef.markForCheck(),"html"===this.outputFormat)return void this.onChange(qe.getHTML());this.onChange(qe.getJSON())}}}writeValue(oe){!this.outputFormat&&"string"==typeof oe&&(this.outputFormat="html"),this.editor.chain().setContent(oe,!1).run()}registerOnChange(oe){this.onChange=oe}registerOnTouched(oe){this.onTouched=oe}setDisabledState(oe){this.editor.setEditable(!oe),this.renderer.setProperty(this.elRef.nativeElement,"disabled",oe)}ngOnInit(){if(!this.editor)throw new Error("Required: Input `editor`");const{innerHTML:oe}=this.elRef.nativeElement;this.elRef.nativeElement.innerHTML="",this.elRef.nativeElement.append(...Array.from(this.editor.options.element.childNodes)),this.editor.setOptions({element:this.elRef.nativeElement}),oe&&this.editor.chain().setContent(oe,!1).run(),this.editor.on("blur",()=>{this.onTouched()}),this.editor.on("update",this.handleChange),this.editor.on("selectionUpdate",()=>this.changeDetectorRef.markForCheck())}ngAfterViewInit(){this.changeDetectorRef.detectChanges()}static{this.\u0275fac=function(Se){return new(Se||fe)(D.rXU(D.aKT),D.rXU(D.sFG),D.rXU(D.gRc))}}static{this.\u0275dir=D.FsC({type:fe,selectors:[["tiptap","editor",""],["","tiptap","","editor",""],["tiptap-editor","editor",""],["","tiptapEditor","","editor",""]],inputs:{editor:"editor",outputFormat:"outputFormat"},features:[D.Jv_([{provide:Ee.kq,useExisting:(0,D.Rfq)(()=>fe),multi:!0}])]})}}return fe})(),He=(()=>{class fe{constructor(oe){this.elRef=oe,this.pluginKey="NgxTiptapBubbleMenu",this.tippyOptions={},this.shouldShow=null}ngOnInit(){if(!this.editor)throw new Error("Required: Input `editor`");this.editor.registerPlugin(Pe({pluginKey:this.pluginKey,editor:this.editor,element:this.elRef.nativeElement,tippyOptions:this.tippyOptions,shouldShow:this.shouldShow}))}ngOnDestroy(){this.editor.unregisterPlugin(this.pluginKey)}static{this.\u0275fac=function(Se){return new(Se||fe)(D.rXU(D.aKT))}}static{this.\u0275dir=D.FsC({type:fe,selectors:[["tiptap-bubble-menu","editor",""],["","tiptapBubbleMenu","","editor",""]],inputs:{pluginKey:"pluginKey",editor:"editor",tippyOptions:"tippyOptions",shouldShow:"shouldShow"}})}}return fe})(),Qe=(()=>{class fe{static{this.\u0275fac=function(Se){return new(Se||fe)}}static{this.\u0275cmp=D.VBU({type:fe,selectors:[["ng-component"]],inputs:{editor:"editor",node:"node",decorations:"decorations",selected:"selected",extension:"extension",getPos:"getPos",updateAttributes:"updateAttributes",deleteNode:"deleteNode"},decls:0,vars:0,template:function(Se,Ve){},encapsulation:2})}}return fe})(),Ke=(()=>{class fe{static{this.\u0275fac=function(Se){return new(Se||fe)}}static{this.\u0275mod=D.$C({type:fe})}static{this.\u0275inj=D.G2t({})}}return fe})();class Ne{constructor(me,oe,Se){this.applicationRef=oe.get(D.o8S),this.componentRef=(0,D.a0P)(me,{environmentInjector:this.applicationRef.injector,elementInjector:oe}),this.updateProps(Se),this.applicationRef.attachView(this.componentRef.hostView)}get instance(){return this.componentRef.instance}get elementRef(){return this.componentRef.injector.get(D.aKT)}get dom(){return this.elementRef.nativeElement}updateProps(me){Object.entries(me).forEach(([oe,Se])=>{this.componentRef.setInput(oe,Se)})}detectChanges(){this.componentRef.changeDetectorRef.detectChanges()}destroy(){this.componentRef.destroy(),this.applicationRef.detachView(this.componentRef.hostView)}}class xe extends ye.Yv{mount(){const me=this.options.injector,oe={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(Se={})=>this.updateAttributes(Se),deleteNode:()=>this.deleteNode()};this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new Ne(this.component,me,oe),this.extension.config.draggable&&(this.renderer.elementRef.nativeElement.ondragstart=Se=>{this.onDragStart(Se)}
1),this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit",this.renderer.detectChanges()),this.appendContendDom()}get dom(){return this.renderer.dom}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}appendContendDom(){const me=this.dom.querySelector("[data-node-view-content]");this.contentDOMElement&&me&&!me.contains(this.contentDOMElement)&&me.appendChild(this.contentDOMElement)}handleSelectionUpdate(){const{from:me,to:oe}=this.editor.state.selection;me<=this.getPos()&&oe>=this.getPos()+this.node.nodeSize?this.selectNode():this.deselectNode()}update(me,oe){const Se=()=>{this.renderer.updateProps({node:me,decorations:oe})};if(this.options.update){const Ve=this.node,qe=this.decorations;return this.node=me,this.decorations=oe,this.options.update({oldNode:Ve,oldDecorations:qe,newNode:me,newDecorations:oe,updateProps:()=>Se()})}return me.type===this.node.type&&(me===this.node&&this.decorations===oe||(this.node=me,this.decorations=oe,Se()),!0)}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}}const Z=(fe,me)=>oe=>new xe(fe,oe,me)},8620:(Nt,it,Oe)=>{Oe.d(it,{K:()=>Ke,w:()=>Qe});for(var D={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:"'"},Ee={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ye=typeof navigator<"u"&&/Mac/.test(navigator.platform),ie=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ne=0;ne<10;ne++)D[48+ne]=D[96+ne]=String(ne);for(ne=1;ne<=24;ne++)D[ne+111]="F"+ne;for(ne=65;ne<=90;ne++)D[ne]=String.fromCharCode(ne+32),Ee[ne]=String.fromCharCode(ne);for(var Te in D)Ee.hasOwnProperty(Te)||(Ee[Te]=D[Te]);var Fe=Oe(17398);const Ae=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),$e=typeof navigator<"u"&&/Win/.test(navigator.platform);function He(Ne){let fe,me,oe,Se,xe=Ne.split(/-(?!$)/),Z=xe[xe.length-1];"Space"==Z&&(Z=" ");for(let Ve=0;Ve<xe.length-1;Ve++){let qe=xe[Ve];if(/^(cmd|meta|m)$/i.test(qe))Se=!0;else if(/^a(lt)?$/i.test(qe))fe=!0;else if(/^(c|ctrl|control)$/i.test(qe))me=!0;else if(/^s(hift)?$/i.test(qe))oe=!0;else{if(!/^mod$/i.test(qe))throw new Error("Unrecognized modifier name: "+qe);Ae?Se=!0:me=!0}}return fe&&(Z="Alt-"+Z),me&&(Z="Ctrl-"+Z),Se&&(Z="Meta-"+Z),oe&&(Z="Shift-"+Z),Z}function Xe(Ne,xe,Z=!0){return xe.altKey&&(Ne="Alt-"+Ne),xe.ctrlKey&&(Ne="Ctrl-"+Ne),xe.metaKey&&(Ne="Meta-"+Ne),Z&&xe.shiftKey&&(Ne="Shift-"+Ne),Ne}function Qe(Ne){return new Fe.k_({props:{handleKeyDown:Ke(Ne)}})}function Ke(Ne){let xe=function De(Ne){let xe=Object.create(null);for(let Z in Ne)xe[He(Z)]=Ne[Z];return xe}(Ne);return function(Z,fe){let oe,me=function Pe(Ne){var Z=!(ye&&Ne.metaKey&&Ne.shiftKey&&!Ne.ctrlKey&&!Ne.altKey||ie&&Ne.shiftKey&&Ne.key&&1==Ne.key.length||"Unidentified"==Ne.key)&&Ne.key||(Ne.shiftKey?Ee:D)[Ne.keyCode]||Ne.key||"Unidentified";return"Esc"==Z&&(Z="Escape"),"Del"==Z&&(Z="Delete"),"Left"==Z&&(Z="ArrowLeft"),"Up"==Z&&(Z="ArrowUp"),"Right"==Z&&(Z="ArrowRight"),"Down"==Z&&(Z="ArrowDown"),Z}(fe),Se=xe[Xe(me,fe)];if(Se&&Se(Z.state,Z.dispatch,Z))return!0;if(1==me.length&&" "!=me){if(fe.shiftKey){let Ve=xe[Xe(me,fe,!1)];if(Ve&&Ve(Z.state,Z.dispatch,Z))return!0}if((fe.altKey||fe.metaKey||fe.ctrlKey)&&!($e&&fe.ctrlKey&&fe.altKey)&&(oe=D[fe.keyCode])&&oe!=me){let Ve=xe[Xe(oe,fe)];if(Ve&&Ve(Z.state,Z.dispatch,Z))return!0}}return!1}}},17533:(Nt,it,Oe)=>{function D(T){this.content=T}Oe.d(it,{S4:()=>Kt,ZF:()=>R,FK:()=>ne,CU:()=>Ae,sX:()=>Zt,bP:()=>Ie,u$:()=>yt,vI:()=>$e,Sj:()=>Nn,Ji:()=>He}),D.prototype={constructor:D,find:function(T){for(var s=0;s<this.content.length;s+=2)if(this.content[s]===T)return s;return-1},get:function(T){var s=this.find(T);return-1==s?void 0:this.content[s+1]},update:function(T,s,c){var h=c&&c!=T?this.remove(c):this,w=h.find(T),C=h.content.slice();
vendor: 10,446 bytes, line 1
1return-1==w?C.push(c||T,s):(C[w+1]=s,c&&(C[w]=c)),new D(C)},remove:function(T){var s=this.find(T);if(-1==s)return this;var c=this.content.slice();return c.splice(s,2),new D(c)},addToStart:function(T,s){return new D([T,s].concat(this.remove(T).content))},addToEnd:function(T,s){var c=this.remove(T).content.slice();return c.push(T,s),new D(c)},addBefore:function(T,s,c){var h=this.remove(s),w=h.content.slice(),C=h.find(T);return w.splice(-1==C?w.length:C,0,s,c),new D(w)},forEach:function(T){for(var s=0;s<this.content.length;s+=2)T(this.content[s],this.content[s+1])},prepend:function(T){return(T=D.from(T)).size?new D(T.content.concat(this.subtract(T).content)):this},append:function(T){return(T=D.from(T)).size?new D(this.subtract(T).content.concat(T.content)):this},subtract:function(T){var s=this;T=D.from(T);for(var c=0;c<T.content.length;c+=2)s=s.remove(T.content[c]);return s},toObject:function(){var T={};return this.forEach(function(s,c){T[s]=c}),T},get size(){return this.content.length>>1}},D.from=function(T){if(T instanceof D)return T;var s=[];if(T)for(var c in T)s.push(c,T[c]);return new D(s)};const Ee=D;function ye(T,s,c){for(let h=0;;h++){if(h==T.childCount||h==s.childCount)return T.childCount==s.childCount?null:c;let w=T.child(h),C=s.child(h);if(w!=C){if(!w.sameMarkup(C))return c;if(w.isText&&w.text!=C.text){for(let P=0;w.text[P]==C.text[P];P++)c++;return c}if(w.content.size||C.content.size){let P=ye(w.content,C.content,c+1);if(null!=P)return P}c+=w.nodeSize}else c+=w.nodeSize}}function ie(T,s,c,h){for(let w=T.childCount,C=s.childCount;;){if(0==w||0==C)return w==C?null:{a:c,b:h};let P=T.child(--w),U=s.child(--C),G=P.nodeSize;if(P!=U){if(!P.sameMarkup(U))return{a:c,b:h};if(P.isText&&P.text!=U.text){let Me=0,ot=Math.min(P.text.length,U.text.length);for(;Me<ot&&P.text[P.text.length-Me-1]==U.text[U.text.length-Me-1];)Me++,c--,h--;return{a:c,b:h}}if(P.content.size||U.content.size){let Me=ie(P.content,U.content,c-1,h-1);if(Me)return Me}c-=G,h-=G}else c-=G,h-=G}}class ne{constructor(s,c){if(this.content=s,this.size=c||0,null==c)for(let h=0;h<s.length;h++)this.size+=s[h].nodeSize}nodesBetween(s,c,h,w=0,C){for(let P=0,U=0;U<c;P++){let G=this.content[P],Me=U+G.nodeSize;if(Me>s&&!1!==h(G,w+U,C||null,P)&&G.content.size){let ot=U+1;G.nodesBetween(Math.max(0,s-ot),Math.min(G.content.size,c-ot),h,w+ot)}U=Me}}descendants(s){this.nodesBetween(0,this.size,s)}textBetween(s,c,h,w){let C="",P=!0;return this.nodesBetween(s,c,(U,G)=>{let Me=U.isText?U.text.slice(Math.max(s,G)-G,c-G):U.isLeaf?w?"function"==typeof w?w(U):w:U.type.spec.leafText?U.type.spec.leafText(U):"":"";U.isBlock&&(U.isLeaf&&Me||U.isTextblock)&&h&&(P?P=!1:C+=h),C+=Me},0),C}append(s){if(!s.size)return this;if(!this.size)return s;let c=this.lastChild,h=s.firstChild,w=this.content.slice(),C=0;for(c.isText&&c.sameMarkup(h)&&(w[w.length-1]=c.withText(c.text+h.text),C=1);C<s.content.length;C++)w.push(s.content[C]);return new ne(w,this.size+s.size)}cut(s,c=this.size){if(0==s&&c==this.size)return this;let h=[],w=0;if(c>s)for(let C=0,P=0;P<c;C++){let U=this.content[C],G=P+U.nodeSize;G>s&&((P<s||G>c)&&(U=U.isText?U.cut(Math.max(0,s-P),Math.min(U.text.length,c-P)):U.cut(Math.max(0,s-P-1),Math.min(U.content.size,c-P-1))),h.push(U),w+=U.nodeSize),P=G}return new ne(h,w)}cutByIndex(s,c){return s==c?ne.empty:0==s&&c==this.content.length?this:new ne(this.content.slice(s,c))}replaceChild(s,c){let h=this.content[s];if(h==c)return this;let w=this.content.slice(),C=this.size+c.nodeSize-h.nodeSize;return w[s]=c,new ne(w,C)}addToStart(s){return new ne([s].concat(this.content),this.size+s.nodeSize)}addToEnd(s){return new ne(this.content.concat(s),this.size+s.nodeSize)}eq(s){if(this.content.length!=s.content.length)return!1;for(let c=0;c<this.content.length;c++)if(!this.content[c].eq(s.content[c]))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(s){let c=this.content[s];if(!c)throw new RangeError("Index "+s+" out of range for "+this);return c}maybeChild(s){return this.content[s]||null}forEach(s){for(let c=0,h=0;c<this.content.length;c++){let w=this.content[c];s(w,h,c),h+=w.nodeSize}}findDiffStart(s,c=0){return ye(this,s,c)}findDiffEnd(s,c=this.size,h=s.size){return ie(this,s,c,h)}findIndex(s,c=-1){if(0==s)return Pe(0,s);if(s==this.size)return Pe(this.content.length,s);if(s>this.size||s<0)throw new RangeError(`Position ${s} outside of fragment (${this})`);for(let h=0,w=0;;h++){let P=w+this.child(h).nodeSize;if(P>=s)return P==s||c>0?Pe(h+1,P):Pe(h,w);w=P}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(s=>s.toJSON()):null}static fromJSON(s,c){if(!c)return ne.empty;if(!Array.isArray(c))throw new RangeError("Invalid input for Fragment.fromJSON");return new ne(c.map(s.nodeFromJSON))}static fromArray(s){if(!s.length)return ne.empty;let c,h=0;for(let w=0;w<s.length;w++){let C=s[w];h+=C.nodeSize,w&&C.isText&&s[w-1].sameMarkup(C)?(c||(c=s.slice(0,w)),c[c.length-1]=C.withText(c[c.length-1].text+C.text)):c&&c.push(C)}return new ne(c||s,h)}static from(s){if(!s)return ne.empty;if(s instanceof ne)return s;if(Array.isArray(s))return this.fromArray(s);if(s.attrs)return new ne([s],s.nodeSize);throw new RangeError("Can not convert "+s+" to a Fragment"+(s.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ne.empty=new ne([],0);const Te={index:0,offset:0};function Pe(T,s){return Te.index=T,Te.offset=s,Te}function Fe(T,s){if(T===s)return!0;if(!T||"object"!=typeof T||!s||"object"!=typeof s)return!1;let c=Array.isArray(T);if(Array.isArray(s)!=c)return!1;if(c){if(T.length!=s.length)return!1;for(let h=0;h<T.length;h++)if(!Fe(T[h],s[h]))return!1}else{for(let h in T)if(!(h in s)||!Fe(T[h],s[h]))return!1;for(let h in s)if(!(h in T))return!1}return!0}let Ae=(()=>{class T{constructor(c,h){this.type=c,this.attrs=h}addToSet(c){let h,w=!1;for(let C=0;C<c.length;C++){let P=c[C];if(this.eq(P))return c;if(this.type.excludes(P.type))h||(h=c.slice(0,C));else{if(P.type.excludes(this.type))return c;!w&&P.type.rank>this.type.rank&&(h||(h=c.slice(0,C)),h.push(this),w=!0),h&&h.push(P)}}return h||(h=c.slice()),w||h.push(this),h}removeFromSet(c){for(let h=0;h<c.length;h++)if(this.eq(c[h]))return c.slice(0,h).concat(c.slice(h+1));return c}isInSet(c){for(let h=0;h<c.length;h++)if(this.eq(c[h]))return!0;return!1}eq(c){return this==c||this.type==c.type&&Fe(this.attrs,c.attrs)}toJSON(){let c={type:this.type.name};for(let h in this.attrs){c.attrs=this.attrs;break}return c}static fromJSON(c,h){if(!h)throw new RangeError("Invalid input for Mark.fromJSON");let w=c.marks[h.type];if(!w)throw new RangeError(`There is no mark type ${h.type} in this schema`);let C=w.create(h.attrs);return w.checkAttrs(C.attrs),C}static sameSet(c,h){if(c==h)return!0;if(c.length!=h.length)return!1;for(let w=0;w<c.length;w++)if(!c[w].eq(h[w]))return!1;return!0}static setFrom(c){if(!c||Array.isArray(c)&&0==c.length)return T.none;if(c instanceof T)return[c];let h=c.slice();return h.sort((w,C)=>w.type.rank-C.type.rank),h}}return T.none=[],T})();class $e extends Error{}class He{constructor(s,c,h){this.content=s,this.openStart=c,this.openEnd=h}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(s,c){let h=Xe(this.content,s+this.openStart,c);return h&&new He(h,this.openStart,this.openEnd)}removeBetween(s,c){return new He(De(this.content,s+this.openStart,c+this.openStart),this.openStart,this.openEnd)}eq(s){return this.content.eq(s.content)&&this.openStart==s.openStart&&this.openEnd==s.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let s={content:this.content.toJSON()};return this.openStart>0&&(s.openStart=this.openStart),this.openEnd>0&&(s.openEnd=this.openEnd),s}static fromJSON(s,c){if(!c)return He.empty;let h=c.openStart||0,w=c.openEnd||0;if("number"!=typeof h||"number"!=typeof w)throw new RangeError("Invalid input for Slice.fromJSON");return new He(ne.fromJSON(s,c.content),h,w)}static maxOpen(s,c=!0){let h=0,w=0;for(let C=s.firstChild;C&&!C.isLeaf&&(c||!C.type.spec.isolating);C=C.firstChild)h++;for(let C=s.lastChild;C&&!C.isLeaf&&(c||!C.type.spec.isolating);C=C.lastChild)w++;return new He(s,h,w)}}function De(T,s,c){let{index:h,offset:w}=T.findIndex(s),C=T.maybeChild(h),{index:P,offset:U}=T.findIndex(c);if(w==s||C.isText){if(U!=c&&!T.child(P).isText)throw new RangeError("Removing non-flat range");return T.cut(0,s).append(T.cut(c))}if(h!=P)throw new RangeError("Removing non-flat range");return T.replaceChild(h,C.copy(De(C.content,s-w-1,c-w-1)))}function Xe(T,s,c,h){let{index:w,offset:C}=T.findIndex(s),P=T.maybeChild(w);if(C==s||P.isText)return h&&!h.canReplace(w,w,c)?null:T.cut(0,s).append(c).append(T.cut(s));let U=Xe(P.content,s-C-1,c);return U&&T.replaceChild(w,P.copy(U))}function Qe(T,s,c){if(c.openStart>T.depth)throw new $e("Inserted content deeper than insertion position");if(T.depth-c.openStart!=s.depth-c.openEnd)throw new $e("Inconsistent open depths");return Ke(T,s,c,0)}function Ke(T,s,c,h){let w=T.index(h),C=T.node(h);if(w==s.index(h)&&h<T.depth-c.openStart){let P=Ke(T,s,c,h+1);return C.copy(C.content.replaceChild(w,P))}if(c.content.size){if(c.openStart||c.openEnd||T.depth!=h||s.depth!=h){let{start:P,end:U}=function Ve(T,s){let c=s.depth-T.openStart,w=s.node(c).copy(T.content);for(let C=c-1;C>=0;C--)w=s.node(C).copy(ne.from(w));return{start:w.resolveNoCache(T.openStart+c),end:w.resolveNoCache(w.content.size-T.openEnd-c)}}(c,T);return me(C,oe(T,P,U,s,h))}{let P=T.parent,U=P.content;return me(P,U.cut(0,T.parentOffset).append(c.content).append(U.cut(s.parentOffset)))}}return me(C,Se(T,s,h))}function Ne(T,s){if(!s.type.compatibleContent(T.type))throw new $e("Cannot join "+s.type.name+" onto "+T.type.name)}function xe(T,s,c){let h=T.node(c);return Ne(h,s.node(c)),h}function Z(T,s){let c=s.length-1;c>=0&&T.isText&&T.sameMarkup(s[c])?s[c]=T.withText(s[c].text+T.text):s.push(T)}function fe(T,s,c,h){let w=(s||T).node(c),C=0,P=s?s.index(c):w.childCount;T&&(C=T.index(c),T.depth>c?C++:T.textOffset&&(Z(T.nodeAfter,h),C++));for(let U=C;U<P;U++)Z(w.child(U),h);s&&s.depth==c&&s.textOffset&&Z(s.nodeBefore,h)}function me(T,s){return T.type.checkContent(s),T.copy(s)}function oe(T,s,c,h,w){let C=T.depth>w&&xe(T,s,w+1),P=h.depth>
vendor: 4,498 bytes, line 1
1w&&xe(c,h,w+1),U=[];return fe(null,T,w,U),C&&P&&s.index(w)==c.index(w)?(Ne(C,P),Z(me(C,oe(T,s,c,h,w+1)),U)):(C&&Z(me(C,Se(T,s,w+1)),U),fe(s,c,w,U),P&&Z(me(P,Se(c,h,w+1)),U)),fe(h,null,w,U),new ne(U)}function Se(T,s,c){let h=[];return fe(null,T,c,h),T.depth>c&&Z(me(xe(T,s,c+1),Se(T,s,c+1)),h),fe(s,null,c,h),new ne(h)}He.empty=new He(ne.empty,0,0);class qe{constructor(s,c,h){this.pos=s,this.path=c,this.parentOffset=h,this.depth=c.length/3-1}resolveDepth(s){return null==s?this.depth:s<0?this.depth+s:s}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(s){return this.path[3*this.resolveDepth(s)]}index(s){return this.path[3*this.resolveDepth(s)+1]}indexAfter(s){return s=this.resolveDepth(s),this.index(s)+(s!=this.depth||this.textOffset?1:0)}start(s){return 0==(s=this.resolveDepth(s))?0:this.path[3*s-1]+1}end(s){return s=this.resolveDepth(s),this.start(s)+this.node(s).content.size}before(s){if(!(s=this.resolveDepth(s)))throw new RangeError("There is no position before the top-level node");return s==this.depth+1?this.pos:this.path[3*s-1]}after(s){if(!(s=this.resolveDepth(s)))throw new RangeError("There is no position after the top-level node");return s==this.depth+1?this.pos:this.path[3*s-1]+this.path[3*s].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let s=this.parent,c=this.index(this.depth);if(c==s.childCount)return null;let h=this.pos-this.path[this.path.length-1],w=s.child(c);return h?s.child(c).cut(h):w}get nodeBefore(){let s=this.index(this.depth),c=this.pos-this.path[this.path.length-1];return c?this.parent.child(s).cut(0,c):0==s?null:this.parent.child(s-1)}posAtIndex(s,c){c=this.resolveDepth(c);let h=this.path[3*c],w=0==c?0:this.path[3*c-1]+1;for(let C=0;C<s;C++)w+=h.child(C).nodeSize;return w}marks(){let s=this.parent,c=this.index();if(0==s.content.size)return Ae.none;if(this.textOffset)return s.child(c).marks;let h=s.maybeChild(c-1),w=s.maybeChild(c);if(!h){let U=h;h=w,w=U}let C=h.marks;for(var P=0;P<C.length;P++)!1===C[P].type.spec.inclusive&&(!w||!C[P].isInSet(w.marks))&&(C=C[P--].removeFromSet(C));return C}marksAcross(s){let c=this.parent.maybeChild(this.index());if(!c||!c.isInline)return null;let h=c.marks,w=s.parent.maybeChild(s.index());for(var C=0;C<h.length;C++)!1===h[C].type.spec.inclusive&&(!w||!h[C].isInSet(w.marks))&&(h=h[C--].removeFromSet(h));return h}sharedDepth(s){for(let c=this.depth;c>0;c--)if(this.start(c)<=s&&this.end(c)>=s)return c;return 0}blockRange(s=this,c){if(s.pos<this.pos)return s.blockRange(this);for(let h=this.depth-(this.parent.inlineContent||this.pos==s.pos?1:0);h>=0;h--)if(s.pos<=this.end(h)&&(!c||c(this.node(h))))return new yt(this,s,h);return null}sameParent(s){return this.pos-this.parentOffset==s.pos-s.parentOffset}max(s){return s.pos>this.pos?s:this}min(s){return s.pos<this.pos?s:this}toString(){let s="";for(let c=1;c<=this.depth;c++)s+=(s?"/":"")+this.node(c).type.name+"_"+this.index(c-1);return s+":"+this.parentOffset}static resolve(s,c){if(!(c>=0&&c<=s.content.size))throw new RangeError("Position "+c+" out of range");let h=[],w=0,C=c;for(let P=s;;){let{index:U,offset:G}=P.content.findIndex(C),Me=C-G;if(h.push(P,U,w+G),!Me||(P=P.child(U),P.isText))break;C=Me-1,w+=G+1}return new qe(c,h,C)}static resolveCached(s,c){let h=rt.get(s);if(h)for(let C=0;C<h.elts.length;C++){let P=h.elts[C];if(P.pos==c)return P}else rt.set(s,h=new wt);let w=h.elts[h.i]=qe.resolve(s,c);return h.i=(h.i+1)%ct,w}}class wt{constructor(){this.elts=[],this.i=0}}const ct=12,rt=new WeakMap;class yt{constructor(s,c,h){this.$from=s,this.$to=c,this.depth=h}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 at=Object.create(null);class Ie{constructor(s,c,h,w=Ae.none){this.type=s,this.attrs=c,this.marks=w,this.content=h||ne.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(s){return this.content.child(s)}maybeChild(s){return this.content.maybeChild(s)}forEach(s){this.content.forEach(s)}nodesBetween(s,c,h,w=0){this.content.nodesBetween(s,c,h,w,this)}descendants(s){this.nodesBetween(0,this.content.size,s)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}
vendor: 5,722 bytes, line 1
1textBetween(s,c,h,w){return this.content.textBetween(s,c,h,w)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(s){return this==s||this.sameMarkup(s)&&this.content.eq(s.content)}sameMarkup(s){return this.hasMarkup(s.type,s.attrs,s.marks)}hasMarkup(s,c,h){return this.type==s&&Fe(this.attrs,c||s.defaultAttrs||at)&&Ae.sameSet(this.marks,h||Ae.none)}copy(s=null){return s==this.content?this:new Ie(this.type,this.attrs,s,this.marks)}mark(s){return s==this.marks?this:new Ie(this.type,this.attrs,this.content,s)}cut(s,c=this.content.size){return 0==s&&c==this.content.size?this:this.copy(this.content.cut(s,c))}slice(s,c=this.content.size,h=!1){if(s==c)return He.empty;let w=this.resolve(s),C=this.resolve(c),P=h?0:w.sharedDepth(c),U=w.start(P),Me=w.node(P).content.cut(w.pos-U,C.pos-U);return new He(Me,w.depth-P,C.depth-P)}replace(s,c,h){return Qe(this.resolve(s),this.resolve(c),h)}nodeAt(s){for(let c=this;;){let{index:h,offset:w}=c.content.findIndex(s);if(c=c.maybeChild(h),!c)return null;if(w==s||c.isText)return c;s-=w+1}}childAfter(s){let{index:c,offset:h}=this.content.findIndex(s);return{node:this.content.maybeChild(c),index:c,offset:h}}childBefore(s){if(0==s)return{node:null,index:0,offset:0};let{index:c,offset:h}=this.content.findIndex(s);if(h<s)return{node:this.content.child(c),index:c,offset:h};let w=this.content.child(c-1);return{node:w,index:c-1,offset:h-w.nodeSize}}resolve(s){return qe.resolveCached(this,s)}resolveNoCache(s){return qe.resolve(this,s)}rangeHasMark(s,c,h){let w=!1;return c>s&&this.nodesBetween(s,c,C=>(h.isInSet(C.marks)&&(w=!0),!w)),w}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 s=this.type.name;return this.content.size&&(s+="("+this.content.toStringInner()+")"),J(this.marks,s)}contentMatchAt(s){let c=this.type.contentMatch.matchFragment(this.content,0,s);if(!c)throw new Error("Called contentMatchAt on a node with invalid content");return c}canReplace(s,c,h=ne.empty,w=0,C=h.childCount){let P=this.contentMatchAt(s).matchFragment(h,w,C),U=P&&P.matchFragment(this.content,c);if(!U||!U.validEnd)return!1;for(let G=w;G<C;G++)if(!this.type.allowsMarks(h.child(G).marks))return!1;return!0}canReplaceWith(s,c,h,w){if(w&&!this.type.allowsMarks(w))return!1;let C=this.contentMatchAt(s).matchType(h),P=C&&C.matchFragment(this.content,c);return!!P&&P.validEnd}canAppend(s){return s.content.size?this.canReplace(this.childCount,this.childCount,s.content):this.type.compatibleContent(s.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let s=Ae.none;for(let c=0;c<this.marks.length;c++){let h=this.marks[c];h.type.checkAttrs(h.attrs),s=h.addToSet(s)}if(!Ae.sameSet(s,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(c=>c.type.name)}`);this.content.forEach(c=>c.check())}toJSON(){let s={type:this.type.name};for(let c in this.attrs){s.attrs=this.attrs;break}return this.content.size&&(s.content=this.content.toJSON()),this.marks.length&&(s.marks=this.marks.map(c=>c.toJSON())),s}static fromJSON(s,c){if(!c)throw new RangeError("Invalid input for Node.fromJSON");let h;if(c.marks){if(!Array.isArray(c.marks))throw new RangeError("Invalid mark data for Node.fromJSON");h=c.marks.map(s.markFromJSON)}if("text"==c.type){if("string"!=typeof c.text)throw new RangeError("Invalid text node in JSON");return s.text(c.text,h)}let w=ne.fromJSON(s,c.content),C=s.nodeType(c.type).create(c.attrs,w,h);return C.type.checkAttrs(C.attrs),C}}Ie.prototype.text=void 0;class N extends Ie{constructor(s,c,h,w){if(super(s,c,null,w),!h)throw new RangeError("Empty text nodes are not allowed");this.text=h}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):J(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(s,c){return this.text.slice(s,c)}get nodeSize(){return this.text.length}mark(s){return s==this.marks?this:new N(this.type,this.attrs,this.text,s)}withText(s){return s==this.text?this:new N(this.type,this.attrs,s,this.marks)}cut(s=0,c=this.text.length){return 0==s&&c==this.text.length?this:this.withText(this.text.slice(s,c))}eq(s){return this.sameMarkup(s)&&this.text==s.text}toJSON(){let s=super.toJSON();return s.text=this.text,s}}function J(T,s){for(let c=T.length-1;c>=0;c--)s=T[c].type.name+"("+s+")";return s}class X{constructor(s){this.validEnd=s,this.next=[],this.wrapCache=[]}static parse(s,c){let h=new ve(s,c);if(null==h.next)return X.empty;let w=Y(h);h.next&&h.err("Unexpected trailing text");let C=function St(T){let s=Object.create(null);return function c(h){let w=[];h.forEach(P=>{T[P].forEach(({term:U,to:G})=>{if(!U)return;let Me;for(let ot=0;ot<w.length;ot++)w[ot][0]==U&&(Me=w[ot][1]);Ot(T,G).forEach(ot=>{Me||w.push([U,Me=[]]),-1==Me.indexOf(ot)&&Me.push(ot)})})});let C=s[h.join(",")]=new X(h.indexOf(T.length-1)>-1);for(let P=0;P<w.length;P++){let U=w[P][1].sort(ft);C.next.push({type:w[P][0],next:s[U.join(",")]||c(U)})}return C}(Ot(T,0))}(function Ze(T){let s=[[]];return w(function C(P,U){if("choice"==P.type)return P.exprs.reduce((G,Me)=>G.concat(C(Me,U)),[]);if("seq"!=P.type){if("star"==P.type){let G=c();return h(U,G),w(C(P.expr,G),G),[h(G)]}if("plus"==P.type){let G=c();return w(C(P.expr,U),G),w(C(P.expr,G),G),[h(G)]}if("opt"==P.type)return[h(U)].concat(C(P.expr,U));if("range"==P.type){let G=U;for(let Me=0;Me<P.min;Me++){let ot=c();
vendor: 5,179 bytes, line 1
1w(C(P.expr,G),ot),G=ot}if(-1==P.max)w(C(P.expr,G),G);else for(let Me=P.min;Me<P.max;Me++){let ot=c();h(G,ot),w(C(P.expr,G),ot),G=ot}return[h(G)]}if("name"==P.type)return[h(U,void 0,P.value)];throw new Error("Unknown expr type")}for(let G=0;;G++){let Me=C(P.exprs[G],U);if(G==P.exprs.length-1)return Me;w(Me,U=c())}}(T,0),c()),s;function c(){return s.push([])-1}function h(P,U,G){let Me={term:G,to:U};return s[P].push(Me),Me}function w(P,U){P.forEach(G=>G.to=U)}}(w));return function Mt(T,s){for(let c=0,h=[T];c<h.length;c++){let w=h[c],C=!w.validEnd,P=[];for(let U=0;U<w.next.length;U++){let{type:G,next:Me}=w.next[U];P.push(G.name),C&&!(G.isText||G.hasRequiredAttrs())&&(C=!1),-1==h.indexOf(Me)&&h.push(Me)}C&&s.err("Only non-generatable nodes ("+P.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(C,h),C}matchType(s){for(let c=0;c<this.next.length;c++)if(this.next[c].type==s)return this.next[c].next;return null}matchFragment(s,c=0,h=s.childCount){let w=this;for(let C=c;w&&C<h;C++)w=w.matchType(s.child(C).type);return w}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let s=0;s<this.next.length;s++){let{type:c}=this.next[s];if(!c.isText&&!c.hasRequiredAttrs())return c}return null}compatible(s){for(let c=0;c<this.next.length;c++)for(let h=0;h<s.next.length;h++)if(this.next[c].type==s.next[h].type)return!0;return!1}fillBefore(s,c=!1,h=0){let w=[this];return function C(P,U){let G=P.matchFragment(s,h);if(G&&(!c||G.validEnd))return ne.from(U.map(Me=>Me.createAndFill()));for(let Me=0;Me<P.next.length;Me++){let{type:ot,next:Ct}=P.next[Me];if(!ot.isText&&!ot.hasRequiredAttrs()&&-1==w.indexOf(Ct)){w.push(Ct);let jt=C(Ct,U.concat(ot));if(jt)return jt}}return null}(this,[])}findWrapping(s){for(let h=0;h<this.wrapCache.length;h+=2)if(this.wrapCache[h]==s)return this.wrapCache[h+1];let c=this.computeWrapping(s);return this.wrapCache.push(s,c),c}computeWrapping(s){let c=Object.create(null),h=[{match:this,type:null,via:null}];for(;h.length;){let w=h.shift(),C=w.match;if(C.matchType(s)){let P=[];for(let U=w;U.type;U=U.via)P.push(U.type);return P.reverse()}for(let P=0;P<C.next.length;P++){let{type:U,next:G}=C.next[P];!U.isLeaf&&!U.hasRequiredAttrs()&&!(U.name in c)&&(!w.type||G.validEnd)&&(h.push({match:U.contentMatch,type:U,via:w}),c[U.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(s){if(s>=this.next.length)throw new RangeError(`There's no ${s}th edge in this content match`);return this.next[s]}toString(){let s=[];return function c(h){s.push(h);for(let w=0;w<h.next.length;w++)-1==s.indexOf(h.next[w].next)&&c(h.next[w].next)}(this),s.map((h,w)=>{let C=w+(h.validEnd?"*":" ")+" ";for(let P=0;P<h.next.length;P++)C+=(P?", ":"")+h.next[P].type.name+"->"+s.indexOf(h.next[P].next);return C}).join("\n")}}X.empty=new X(!0);class ve{constructor(s,c){this.string=s,this.nodeTypes=c,this.inline=null,this.pos=0,this.tokens=s.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(s){return this.next==s&&(this.pos++||!0)}err(s){throw new SyntaxError(s+" (in content expression '"+this.string+"')")}}function Y(T){let s=[];do{s.push($(T))}while(T.eat("|"));return 1==s.length?s[0]:{type:"choice",exprs:s}}function $(T){let s=[];do{s.push(Q(T))}while(T.next&&")"!=T.next&&"|"!=T.next);return 1==s.length?s[0]:{type:"seq",exprs:s}}function Q(T){let s=function _e(T){if(T.eat("(")){let s=Y(T);return T.eat(")")||T.err("Missing closing paren"),s}if(!/\W/.test(T.next)){let s=function we(T,s){let c=T.nodeTypes,h=c[s];if(h)return[h];let w=[];for(let C in c){let P=c[C];P.isInGroup(s)&&w.push(P)}return 0==w.length&&T.err("No node type or group '"+s+"' found"),w}(T,T.next).map(c=>(null==T.inline?T.inline=c.isInline:T.inline!=c.isInline&&T.err("Mixing inline and block content"),{type:"name",value:c}));return T.pos++,1==s.length?s[0]:{type:"choice",exprs:s}}T.err("Unexpected token '"+T.next+"'")}(T);for(;;)if(T.eat("+"))s={type:"plus",expr:s};else if(T.eat("*"))s={type:"star",expr:s};else if(T.eat("?"))s={type:"opt",expr:s};else{if(!T.eat("{"))break;s=ge(T,s)}return s}function se(T){/\D/.test(T.next)&&T.err("Expected number, got '"+T.next+"'");let s=Number(T.next);return T.pos++,s}function ge(T,s){let c=se(T),h=c;return T.eat(",")&&(h="}"!=T.next?se(T):-1),T.eat("}")||T.err("Unclosed braced range"),{type:"range",min:c,max:h,expr:s}}function ft(T,s){return s-T}function Ot(T,s){let c=[];return function h(w){let C=T[w];if(1==C.length&&!C[0].term)return h(C[0].to);c.push(w);for(let P=0;P<C.length;P++){let{term:U,to:G}=C[P];!U&&-1==c.indexOf(G)&&h(G)}}(s),c.sort(ft)}function ht(T){let s=Object.create(null);for(let c in T){let h=T[c];if(!h.hasDefault)return null;s[c]=h.default}return s}function xt(T,s){let c=Object.create(null);for(let h in T){let w=s&&s[h];if(void 0===w){let C=T[h];if(!C.hasDefault)throw new RangeError("No value supplied for attribute "+h);w=C.default}c[h]=w}return c}function Yt(T,s,c,h){for(let w in s)if(!(w in T))throw new RangeError(`Unsupported attribute ${w} for ${c} of type ${w}`);for(let w in T){let C=T[w];
vendor: 5,824 bytes, line 1
1C.validate&&C.validate(s[w])}}function gn(T,s){let c=Object.create(null);if(s)for(let h in s)c[h]=new yn(T,h,s[h]);return c}class Xt{constructor(s,c,h){this.name=s,this.schema=c,this.spec=h,this.markSet=null,this.groups=h.group?h.group.split(" "):[],this.attrs=gn(s,h.attrs),this.defaultAttrs=ht(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(h.inline||"text"==s),this.isText="text"==s}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==X.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(s){return this.groups.indexOf(s)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let s in this.attrs)if(this.attrs[s].isRequired)return!0;return!1}compatibleContent(s){return this==s||this.contentMatch.compatible(s.contentMatch)}computeAttrs(s){return!s&&this.defaultAttrs?this.defaultAttrs:xt(this.attrs,s)}create(s=null,c,h){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ie(this,this.computeAttrs(s),ne.from(c),Ae.setFrom(h))}createChecked(s=null,c,h){return c=ne.from(c),this.checkContent(c),new Ie(this,this.computeAttrs(s),c,Ae.setFrom(h))}createAndFill(s=null,c,h){if(s=this.computeAttrs(s),(c=ne.from(c)).size){let P=this.contentMatch.fillBefore(c);if(!P)return null;c=P.append(c)}let w=this.contentMatch.matchFragment(c),C=w&&w.fillBefore(ne.empty,!0);return C?new Ie(this,s,c.append(C),Ae.setFrom(h)):null}validContent(s){let c=this.contentMatch.matchFragment(s);if(!c||!c.validEnd)return!1;for(let h=0;h<s.childCount;h++)if(!this.allowsMarks(s.child(h).marks))return!1;return!0}checkContent(s){if(!this.validContent(s))throw new RangeError(`Invalid content for node ${this.name}: ${s.toString().slice(0,50)}`)}checkAttrs(s){Yt(this.attrs,s,"node")}allowsMarkType(s){return null==this.markSet||this.markSet.indexOf(s)>-1}allowsMarks(s){if(null==this.markSet)return!0;for(let c=0;c<s.length;c++)if(!this.allowsMarkType(s[c].type))return!1;return!0}allowedMarks(s){if(null==this.markSet)return s;let c;for(let h=0;h<s.length;h++)this.allowsMarkType(s[h].type)?c&&c.push(s[h]):c||(c=s.slice(0,h));return c?c.length?c:Ae.none:s}static compile(s,c){let h=Object.create(null);s.forEach((C,P)=>h[C]=new Xt(C,c,P));let w=c.spec.topNode||"doc";if(!h[w])throw new RangeError("Schema is missing its top node type ('"+w+"')");if(!h.text)throw new RangeError("Every schema needs a 'text' type");for(let C in h.text.attrs)throw new RangeError("The text node type should not have attributes");return h}}class yn{constructor(s,c,h){this.hasDefault=Object.prototype.hasOwnProperty.call(h,"default"),this.default=h.default,this.validate="string"==typeof h.validate?function An(T,s,c){let h=c.split("|");return w=>{let C=null===w?"null":typeof w;if(h.indexOf(C)<0)throw new RangeError(`Expected value of type ${h} for attribute ${s} on type ${T}, got ${C}`)}}(s,c,h.validate):h.validate}get isRequired(){return!this.hasDefault}}class Zt{constructor(s,c,h,w){this.name=s,this.rank=c,this.schema=h,this.spec=w,this.attrs=gn(s,w.attrs),this.excluded=null;let C=ht(this.attrs);this.instance=C?new Ae(this,C):null}create(s=null){return!s&&this.instance?this.instance:new Ae(this,xt(this.attrs,s))}static compile(s,c){let h=Object.create(null),w=0;return s.forEach((C,P)=>h[C]=new Zt(C,w++,c,P)),h}removeFromSet(s){for(var c=0;c<s.length;c++)s[c].type==this&&(s=s.slice(0,c).concat(s.slice(c+1)),c--);return s}isInSet(s){for(let c=0;c<s.length;c++)if(s[c].type==this)return s[c]}checkAttrs(s){Yt(this.attrs,s,"mark")}excludes(s){return this.excluded.indexOf(s)>-1}}class Nn{constructor(s){this.linebreakReplacement=null,this.cached=Object.create(null);let c=this.spec={};for(let w in s)c[w]=s[w];c.nodes=Ee.from(s.nodes),c.marks=Ee.from(s.marks||{}),this.nodes=Xt.compile(this.spec.nodes,this),this.marks=Zt.compile(this.spec.marks,this);let h=Object.create(null);for(let w in this.nodes){if(w in this.marks)throw new RangeError(w+" can not be both a node and a mark");let C=this.nodes[w],P=C.spec.content||"",U=C.spec.marks;if(C.contentMatch=h[P]||(h[P]=X.parse(P,this.nodes)),C.inlineContent=C.contentMatch.inlineContent,C.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!C.isInline||!C.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=C}C.markSet="_"==U?null:U?xn(this,U.split(" ")):""!=U&&C.inlineContent?null:[]}for(let w in this.marks){let C=this.marks[w],P=C.spec.excludes;C.excluded=null==P?[C]:""==P?[]:xn(this,P.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(s,c=null,h,w){if("string"==typeof s)s=this.nodeType(s);else{if(!(s instanceof Xt))throw new RangeError("Invalid node type: "+s);if(s.schema!=this)throw new RangeError("Node type from different schema used ("+s.name+")")}return s.createChecked(c,h,w)}text(s,c){let h=this.nodes.text;return new N(h,h.defaultAttrs,s,Ae.setFrom(c))}mark(s,c){return"string"==typeof s&&(s=this.marks[s]),s.create(c)}nodeFromJSON(s){return Ie.fromJSON(this,s)}markFromJSON(s){return Ae.fromJSON(this,s)}nodeType(s){let c=this.nodes[s];if(!c)throw new RangeError("Unknown node type: "+s);return c}}function xn(T,s){let c=[];for(let h=0;h<s.length;h++){let w=s[h],C=T.marks[w],P=C;if(C)c.push(C);else for(let U in T.marks){let G=T.marks[U];("_"==w||G.spec.group&&G.spec.group.split(" ").indexOf(w)>-1)&&c.push(P=G)}if(!P)throw new SyntaxError("Unknown mark type: '"+s[h]+"'")}return c}class Kt{constructor(s,c){this.schema=s,this.rules=c,this.tags=[],this.styles=[];let h=this.matchedStyles=[];
vendor: 4,290 bytes, line 1
1c.forEach(w=>{if(function rn(T){return null!=T.tag}(w))this.tags.push(w);else if(function Fn(T){return null!=T.style}(w)){let C=/[^=]*/.exec(w.style)[0];h.indexOf(C)<0&&h.push(C),this.styles.push(w)}}),this.normalizeLists=!this.tags.some(w=>{if(!/^(ul|ol)\b/.test(w.tag)||!w.node)return!1;let C=s.nodes[w.node];return C.contentMatch.matchType(C)})}parse(s,c={}){let h=new an(this,c,!1);return h.addAll(s,Ae.none,c.from,c.to),h.finish()}parseSlice(s,c={}){let h=new an(this,c,!0);return h.addAll(s,Ae.none,c.from,c.to),He.maxOpen(h.finish())}matchTag(s,c,h){for(let w=h?this.tags.indexOf(h)+1:0;w<this.tags.length;w++){let C=this.tags[w];if(g(s,C.tag)&&(void 0===C.namespace||s.namespaceURI==C.namespace)&&(!C.context||c.matchesContext(C.context))){if(C.getAttrs){let P=C.getAttrs(s);if(!1===P)continue;C.attrs=P||void 0}return C}}}matchStyle(s,c,h,w){for(let C=w?this.styles.indexOf(w)+1:0;C<this.styles.length;C++){let P=this.styles[C],U=P.style;if(!(0!=U.indexOf(s)||P.context&&!h.matchesContext(P.context)||U.length>s.length&&(61!=U.charCodeAt(s.length)||U.slice(s.length+1)!=c))){if(P.getAttrs){let G=P.getAttrs(c);if(!1===G)continue;P.attrs=G||void 0}return P}}}static schemaRules(s){let c=[];function h(w){let C=null==w.priority?50:w.priority,P=0;for(;P<c.length;P++){let U=c[P];if((null==U.priority?50:U.priority)<C)break}c.splice(P,0,w)}for(let w in s.marks){let C=s.marks[w].spec.parseDOM;C&&C.forEach(P=>{h(P=m(P)),P.mark||P.ignore||P.clearMark||(P.mark=w)})}for(let w in s.nodes){let C=s.nodes[w].spec.parseDOM;C&&C.forEach(P=>{h(P=m(P)),P.node||P.ignore||P.mark||(P.node=w)})}return c}static fromSchema(s){return s.cached.domParser||(s.cached.domParser=new Kt(s,Kt.schemaRules(s)))}}const Yn={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},on={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},sn={ol:!0,ul:!0};function Qt(T,s,c){return null!=s?(s?1:0)|("full"===s?2:0):T&&"pre"==T.whitespace?3:-5&c}class Wt{constructor(s,c,h,w,C,P){this.type=s,this.attrs=c,this.marks=h,this.solid=w,this.options=P,this.content=[],this.activeMarks=Ae.none,this.match=C||(4&P?null:s.contentMatch)}findWrapping(s){if(!this.match){if(!this.type)return[];let c=this.type.contentMatch.fillBefore(ne.from(s));if(!c){let w,h=this.type.contentMatch;return(w=h.findWrapping(s.type))?(this.match=h,w):null}this.match=this.type.contentMatch.matchFragment(c)}return this.match.findWrapping(s.type)}finish(s){if(!(1&this.options)){let w,h=this.content[this.content.length-1];if(h&&h.isText&&(w=/[ \t\r\n\u000c]+$/.exec(h.text))){let C=h;h.text.length==w[0].length?this.content.pop():this.content[this.content.length-1]=C.withText(C.text.slice(0,C.text.length-w[0].length))}}let c=ne.from(this.content);return!s&&this.match&&(c=c.append(this.match.fillBefore(ne.empty,!0))),this.type?this.type.create(this.attrs,c,this.marks):c}inlineContext(s){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:s.parentNode&&!Yn.hasOwnProperty(s.parentNode.nodeName.toLowerCase())}}class an{constructor(s,c,h){this.parser=s,this.options=c,this.isOpen=h,this.open=0,this.localPreserveWS=!1;let C,w=c.topNode,P=Qt(null,c.preserveWhitespace,0)|(h?4:0);C=w?new Wt(w.type,w.attrs,Ae.none,!0,c.topMatch||w.type.contentMatch,P):new Wt(h?null:s.schema.topNodeType,null,Ae.none,!0,null,P),this.nodes=[C],this.find=c.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(s,c){3==s.nodeType?this.addTextNode(s,c):1==s.nodeType&&this.addElement(s,c)}addTextNode(s,c){let h=s.nodeValue,w=this.top,C=2&w.options?"full":this.localPreserveWS||(1&w.options)>0;if("full"===C||w.inlineContext(s)||/[^ \t\r\n\u000c]/.test(h)){if(C)h="full"!==C?h.replace(/\r?\n|\r/g," "):h.replace(/\r\n?/g,"\n");else if(h=h.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(h)&&this.open==this.nodes.length-1){let P=w.content[w.content.length-1],U=s.previousSibling;(!P||U&&"BR"==U.nodeName||P.isText&&/[ \t\r\n\u000c]$/.test(P.text))&&(h=h.slice(1))}h&&this.insertNode(this.parser.schema.text(h),c,!/\S/.test(h)),this.findInText(s)}else this.findInside(s)}
vendor: 4,221 bytes, line 1
1addElement(s,c,h){let w=this.localPreserveWS,C=this.top;("PRE"==s.tagName||/pre/.test(s.style&&s.style.whiteSpace))&&(this.localPreserveWS=!0);let U,P=s.nodeName.toLowerCase();sn.hasOwnProperty(P)&&this.parser.normalizeLists&&function K(T){for(let s=T.firstChild,c=null;s;s=s.nextSibling){let h=1==s.nodeType?s.nodeName.toLowerCase():null;h&&sn.hasOwnProperty(h)&&c?(c.appendChild(s),s=c):"li"==h?c=s:h&&(c=null)}}(s);let G=this.options.ruleFromNode&&this.options.ruleFromNode(s)||(U=this.parser.matchTag(s,this,h));e:if(G?G.ignore:on.hasOwnProperty(P))this.findInside(s),this.ignoreFallback(s,c);else if(!G||G.skip||G.closeParent){G&&G.closeParent?this.open=Math.max(0,this.open-1):G&&G.skip.nodeType&&(s=G.skip);let Me,ot=this.needsBlock;if(Yn.hasOwnProperty(P))C.content.length&&C.content[0].isInline&&this.open&&(this.open--,C=this.top),Me=!0,C.type||(this.needsBlock=!0);else if(!s.firstChild){this.leafFallback(s,c);break e}let Ct=G&&G.skip?c:this.readStyles(s,c);Ct&&this.addAll(s,Ct),Me&&this.sync(C),this.needsBlock=ot}else{let Me=this.readStyles(s,c);Me&&this.addElementByRule(s,G,Me,!1===G.consuming?U:void 0)}this.localPreserveWS=w}leafFallback(s,c){"BR"==s.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(s.ownerDocument.createTextNode("\n"),c)}ignoreFallback(s,c){"BR"==s.nodeName&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),c,!0)}readStyles(s,c){let h=s.style;if(h&&h.length)for(let w=0;w<this.parser.matchedStyles.length;w++){let C=this.parser.matchedStyles[w],P=h.getPropertyValue(C);if(P)for(let U;;){let G=this.parser.matchStyle(C,P,this,U);if(!G)break;if(G.ignore)return null;if(c=G.clearMark?c.filter(Me=>!G.clearMark(Me)):c.concat(this.parser.schema.marks[G.mark].create(G.attrs)),!1!==G.consuming)break;U=G}}return c}addElementByRule(s,c,h,w){let C,P;if(c.node)if(P=this.parser.schema.nodes[c.node],P.isLeaf)this.insertNode(P.create(c.attrs),h,"BR"==s.nodeName)||this.leafFallback(s,h);else{let G=this.enter(P,c.attrs||null,h,c.preserveWhitespace);G&&(C=!0,h=G)}else h=h.concat(this.parser.schema.marks[c.mark].create(c.attrs));let U=this.top;if(P&&P.isLeaf)this.findInside(s);else if(w)this.addElement(s,h,w);else if(c.getContent)this.findInside(s),c.getContent(s,this.parser.schema).forEach(G=>this.insertNode(G,h,!1));else{let G=s;"string"==typeof c.contentElement?G=s.querySelector(c.contentElement):"function"==typeof c.contentElement?G=c.contentElement(s):c.contentElement&&(G=c.contentElement),this.findAround(s,G,!0),this.addAll(G,h),this.findAround(s,G,!1)}C&&this.sync(U)&&this.open--}addAll(s,c,h,w){let C=h||0;for(let P=h?s.childNodes[h]:s.firstChild,U=null==w?null:s.childNodes[w];P!=U;P=P.nextSibling,++C)this.findAtPoint(s,C),this.addDOM(P,c);this.findAtPoint(s,C)}findPlace(s,c,h){let w,C;for(let P=this.open,U=0;P>=0;P--){let G=this.nodes[P],Me=G.findWrapping(s);if(Me&&(!w||w.length>Me.length+U)&&(w=Me,C=G,!Me.length))break;if(G.solid){if(h)break;U+=2}}if(!w)return null;this.sync(C);for(let P=0;P<w.length;P++)c=this.enterInner(w[P],null,c,!1);return c}insertNode(s,c,h){if(s.isInline&&this.needsBlock&&!this.top.type){let C=this.textblockFromContext();C&&(c=this.enterInner(C,null,c))}let w=this.findPlace(s,c,h);if(w){this.closeExtra();let C=this.top;C.match&&(C.match=C.match.matchType(s.type));let P=Ae.none;for(let U of w.concat(s.marks))(C.type?C.type.allowsMarkType(U.type):M(U.type,s.type))&&(P=U.addToSet(P));return C.content.push(s.mark(P)),!0}return!1}enter(s,c,h,w){let C=this.findPlace(s.create(c),h,!1);return C&&(C=this.enterInner(s,c,h,!0,w)),C}enterInner(s,c,h,w=!1,C){this.closeExtra();let P=this.top;P.match=P.match&&P.match.matchType(s);let U=Qt(s,C,P.options);4&P.options&&0==P.content.length&&(U|=4);let G=Ae.none;return h=h.filter(Me=>!(P.type?P.type.allowsMarkType(Me.type):M(Me.type,s))||(G=Me.addToSet(G),!1)),this.nodes.push(new Wt(s,c,G,w,null,U)),this.open++,h}closeExtra(s=!1){let c=this.nodes.length-1;if(c>this.open){for(;c>this.open;c--)this.nodes[c-1].content.push(this.nodes[c].finish(s));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(s){for(let c=this.open;c>=0;
vendor: 4,434 bytes, line 1
1c--){if(this.nodes[c]==s)return this.open=c,!0;this.localPreserveWS&&(this.nodes[c].options|=1)}return!1}get currentPos(){this.closeExtra();let s=0;for(let c=this.open;c>=0;c--){let h=this.nodes[c].content;for(let w=h.length-1;w>=0;w--)s+=h[w].nodeSize;c&&s++}return s}findAtPoint(s,c){if(this.find)for(let h=0;h<this.find.length;h++)this.find[h].node==s&&this.find[h].offset==c&&(this.find[h].pos=this.currentPos)}findInside(s){if(this.find)for(let c=0;c<this.find.length;c++)null==this.find[c].pos&&1==s.nodeType&&s.contains(this.find[c].node)&&(this.find[c].pos=this.currentPos)}findAround(s,c,h){if(s!=c&&this.find)for(let w=0;w<this.find.length;w++)null==this.find[w].pos&&1==s.nodeType&&s.contains(this.find[w].node)&&c.compareDocumentPosition(this.find[w].node)&(h?2:4)&&(this.find[w].pos=this.currentPos)}findInText(s){if(this.find)for(let c=0;c<this.find.length;c++)this.find[c].node==s&&(this.find[c].pos=this.currentPos-(s.nodeValue.length-this.find[c].offset))}matchesContext(s){if(s.indexOf("|")>-1)return s.split(/\s*\|\s*/).some(this.matchesContext,this);let c=s.split("/"),h=this.options.context,w=!(this.isOpen||h&&h.parent.type!=this.nodes[0].type),C=(w?0:1)-(h?h.depth+1:0),P=(U,G)=>{for(;U>=0;U--){let Me=c[U];if(""==Me){if(U==c.length-1||0==U)continue;for(;G>=C;G--)if(P(U-1,G))return!0;return!1}{let ot=G>0||0==G&&w?this.nodes[G].type:h&&G>=C?h.node(G-C).type:null;if(!ot||ot.name!=Me&&!ot.isInGroup(Me))return!1;G--}}return!0};return P(c.length-1,this.open)}textblockFromContext(){let s=this.options.context;if(s)for(let c=s.depth;c>=0;c--){let h=s.node(c).contentMatchAt(s.indexAfter(c)).defaultType;if(h&&h.isTextblock&&h.defaultAttrs)return h}for(let c in this.parser.schema.nodes){let h=this.parser.schema.nodes[c];if(h.isTextblock&&h.defaultAttrs)return h}}}function g(T,s){return(T.matches||T.msMatchesSelector||T.webkitMatchesSelector||T.mozMatchesSelector).call(T,s)}function m(T){let s={};for(let c in T)s[c]=T[c];return s}function M(T,s){let c=s.schema.nodes;for(let h in c){let w=c[h];if(!w.allowsMarkType(T))continue;let C=[],P=U=>{C.push(U);for(let G=0;G<U.edgeCount;G++){let{type:Me,next:ot}=U.edge(G);if(Me==s||C.indexOf(ot)<0&&P(ot))return!0}};if(P(w.contentMatch))return!0}}class R{constructor(s,c){this.nodes=s,this.marks=c}serializeFragment(s,c={},h){h||(h=H(c).createDocumentFragment());let w=h,C=[];return s.forEach(P=>{if(C.length||P.marks.length){let U=0,G=0;for(;U<C.length&&G<P.marks.length;){let Me=P.marks[G];if(this.marks[Me.type.name]){if(!Me.eq(C[U][0])||!1===Me.type.spec.spanning)break;U++,G++}else G++}for(;U<C.length;)w=C.pop()[1];for(;G<P.marks.length;){let Me=P.marks[G++],ot=this.serializeMark(Me,P.isInline,c);ot&&(C.push([Me,w]),w.appendChild(ot.dom),w=ot.contentDOM||ot.dom)}}w.appendChild(this.serializeNodeInner(P,c))}),h}serializeNodeInner(s,c){let{dom:h,contentDOM:w}=ze(H(c),this.nodes[s.type.name](s),null,s.attrs);if(w){if(s.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(s.content,c,w)}return h}serializeNode(s,c={}){let h=this.serializeNodeInner(s,c);for(let w=s.marks.length-1;w>=0;w--){let C=this.serializeMark(s.marks[w],s.isInline,c);C&&((C.contentDOM||C.dom).appendChild(h),h=C.dom)}return h}serializeMark(s,c,h={}){let w=this.marks[s.type.name];return w&&ze(H(h),w(s,c),null,s.attrs)}static renderSpec(s,c,h=null,w){return ze(s,c,h,w)}static fromSchema(s){return s.cached.domSerializer||(s.cached.domSerializer=new R(this.nodesFromSchema(s),this.marksFromSchema(s)))}static nodesFromSchema(s){let c=F(s.nodes);return c.text||(c.text=h=>h.text),c}static marksFromSchema(s){return F(s.marks)}}function F(T){let s={};for(let c in T){let h=T[c].spec.toDOM;h&&(s[c]=h)}return s}function H(T){return T.document||window.document}const le=new WeakMap;function ze(T,s,c,h){if("string"==typeof s)return{dom:T.createTextNode(s)};if(null!=s.nodeType)return{dom:s};if(s.dom&&null!=s.dom.nodeType)return s;let C,w=s[0];if("string"!=typeof w)throw new RangeError("Invalid array passed to renderSpec");if(h&&(C=function ke(T){let s=le.get(T);return void 0===s&&le.set(T,s=function he(T){let s=null;return function c(h){if(h&&"object"==typeof h)if(Array.isArray(h))if("string"==typeof h[0])s||(s=[]),s.push(h);else for(let w=0;w<h.length;w++)c(h[w]);else for(let w in h)c(h[w])}(T),s}(T)),s}(h))&&C.indexOf(s)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross 
1site scripting attack.");let P=w.indexOf(" ");P>0&&(c=w.slice(0,P),w=w.slice(P+1));let U,G=c?T.createElementNS(c,w):T.createElement(w),Me=s[1],ot=1;if(Me&&"object"==typeof Me&&null==Me.nodeType&&!Array.isArray(Me)){ot=2;for(let Ct in Me)if(null!=Me[Ct]){let jt=Ct.indexOf(" ");jt>0?G.setAttributeNS(Ct.slice(0,jt),Ct.slice(jt+1),Me[Ct]):G.setAttribute(Ct,Me[Ct])}}for(let Ct=ot;Ct<s.length;Ct++){let jt=s[Ct];if(0===jt){if(Ct<s.length-1||Ct>ot)throw new RangeError("Content hole must be the only child of its parent node");return{dom:G,contentDOM:G}}{let{dom:Gn,contentDOM:wn}=ze(T,jt,c,h);if(G.appendChild(Gn),wn){if(U)throw new RangeError("Multiple content holes");U=wn}}}return{dom:G,contentDOM:U}}},17398:(Nt,it,Oe)=>{Oe.d(it,{$t:()=>qe,LN:()=>ie,U3:()=>Fe,hs:()=>at,i5:()=>De,k_:()=>ct,nh:()=>$e});var D=Oe(17533),Ee=Oe(66085);const ye=Object.create(null);class ie{constructor(N,J,X){this.$anchor=N,this.$head=J,this.ranges=X||[new ne(N.min(J),N.max(J))]}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 J=0;J<N.length;J++)if(N[J].$from.pos!=N[J].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(N,J=D.Ji.empty){let X=J.content.lastChild,ve=null;for(let Q=0;Q<J.openEnd;Q++)ve=X,X=X.lastChild;let Y=N.steps.length,$=this.ranges;for(let Q=0;Q<$.length;Q++){let{$from:se,$to:ge}=$[Q],we=N.mapping.slice(Y);N.replaceRange(we.map(se.pos),we.map(ge.pos),Q?D.Ji.empty:J),0==Q&&Ke(N,Y,(X?X.isInline:ve&&ve.isTextblock)?-1:1)}}replaceWith(N,J){let X=N.steps.length,ve=this.ranges;for(let Y=0;Y<ve.length;Y++){let{$from:$,$to:Q}=ve[Y],se=N.mapping.slice(X),ge=se.map($.pos),we=se.map(Q.pos);Y?N.deleteRange(ge,we):(N.replaceRangeWith(ge,we,J),Ke(N,X,J.isInline?-1:1))}}static findFrom(N,J,X=!1){let ve=N.parent.inlineContent?new Fe(N):Qe(N.node(0),N.parent,N.pos,N.index(),J,X);if(ve)return ve;for(let Y=N.depth-1;Y>=0;Y--){let $=J<0?Qe(N.node(0),N.node(Y),N.before(Y+1),N.index(Y),J,X):Qe(N.node(0),N.node(Y),N.after(Y+1),N.index(Y)+1,J,X);if($)return $}return null}static near(N,J=1){return this.findFrom(N,J)||this.findFrom(N,-J)||new De(N.node(0))}static atStart(N){return Qe(N,N,0,0,1)||new De(N)}static atEnd(N){return Qe(N,N,N.content.size,N.childCount,-1)||new De(N)}static fromJSON(N,J){if(!J||!J.type)throw new RangeError("Invalid input for Selection.fromJSON");let X=ye[J.type];if(!X)throw new RangeError(`No selection type ${J.type} defined`);return X.fromJSON(N,J)}static jsonID(N,J){if(N in ye)throw new RangeError("Duplicate use of selection JSON ID "+N);return ye[N]=J,J.prototype.jsonID=N,J}getBookmark(){return Fe.between(this.$anchor,this.$head).getBookmark()}}ie.prototype.visible=!0;class ne{constructor(N,J){this.$from=N,this.$to=J}}let Te=!1;function Pe(Ie){!Te&&!Ie.parent.inlineContent&&(Te=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+Ie.parent.type.name+")"))}class Fe extends ie{constructor(N,J=N){Pe(N),Pe(J),super(N,J)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(N,J){let X=N.resolve(J.map(this.head));if(!X.parent.inlineContent)return ie.near(X);let ve=N.resolve(J.map(this.anchor));return new Fe(ve.parent.inlineContent?ve:X,X)}replace(N,J=D.Ji.empty){if(super.replace(N,J),J==D.Ji.empty){let X=this.$from.marksAcross(this.$to);X&&N.ensureMarks(X)}}eq(N){return N instanceof Fe&&N.anchor==this.anchor&&N.head==this.head}getBookmark(){return new Ae(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(N,J){if("number"!=typeof J.anchor||"number"!=typeof J.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Fe(N.resolve(J.anchor),N.resolve(J.head))}static create(N,J,X=J){let ve=N.resolve(J);return new this(ve,X==J?ve:N.resolve(X))}static between(N,J,X){let ve=N.pos-J.pos;if((!X||ve)&&(X=ve>=0?1:-1),!J.parent.inlineContent){let Y=ie.findFrom(J,X,!0)||ie.findFrom(J,-X,!0);if(!Y)return ie.near(J,X);J=Y.$head}return N.parent.inlineContent||(0==ve||(N=(ie.findFrom(N,-X,!0)||ie.findFrom(N,X,!0)).$anchor).pos<J.pos!=ve<0)&&(N=J),new Fe(N,J)}}ie.jsonID("text",Fe);class Ae{constructor(N,J){this.anchor=N,this.head=J}map(N){return new Ae(N.map(this.anchor),N.map(this.head))}resolve(N){return Fe.between(N.resolve(this.anchor),N.resolve(this.head))}}class $e extends ie{constructor(N){let J=N.nodeAfter,X=N.node(0).resolve(N.pos+J.nodeSize);super(N,X),this.node=J}map(N,J){let{deleted:X,pos:ve}=J.mapResult(this.anchor),Y=N.resolve(ve);return X?ie.near(Y):new $e(Y)}content(){return new D.Ji(D.FK.from(this.node),0,0)}eq(N){return N instanceof $e&&N.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new He(this.anchor)}static fromJSON(N,J){if("number"!=typeof J.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new $e(N.resolve(J.anchor))}static create(N,J){return new $e(N.resolve(J))}static isSelectable(N){return!N.isText&&!1!==N.type.spec.selectable}}$e.prototype.visible=!1,ie.jsonID("node",$e);class He{constructor(N){this.anchor=N}map(N){let{deleted:J,pos:X}=N.mapResult(this.anchor);return J?new Ae(X,X):new He(X)}resolve(N){let J=N.resolve(this.anchor),X=J.nodeAfter;return X&&$e.isSelectable(X)?new $e(J):ie.near(J)}}class De extends ie{constructor(N){super(N.resolve(0),N.resolve(N.content.size))}
vendor: 19,053 bytes, line 1
1replace(N,J=D.Ji.empty){if(J==D.Ji.empty){N.delete(0,N.doc.content.size);let X=ie.atStart(N.doc);X.eq(N.selection)||N.setSelection(X)}else super.replace(N,J)}toJSON(){return{type:"all"}}static fromJSON(N){return new De(N)}map(N){return new De(N)}eq(N){return N instanceof De}getBookmark(){return Xe}}ie.jsonID("all",De);const Xe={map(){return this},resolve:Ie=>new De(Ie)};function Qe(Ie,N,J,X,ve,Y=!1){if(N.inlineContent)return Fe.create(Ie,J);for(let $=X-(ve>0?0:1);ve>0?$<N.childCount:$>=0;$+=ve){let Q=N.child($);if(Q.isAtom){if(!Y&&$e.isSelectable(Q))return $e.create(Ie,J-(ve<0?Q.nodeSize:0))}else{let se=Qe(Ie,Q,J+ve,ve<0?Q.childCount:0,ve,Y);if(se)return se}J+=Q.nodeSize*ve}return null}function Ke(Ie,N,J){let X=Ie.steps.length-1;if(X<N)return;let $,ve=Ie.steps[X];(ve instanceof Ee.Ln||ve instanceof Ee.Wg)&&(Ie.mapping.maps[X].forEach((Q,se,ge,we)=>{null==$&&($=we)}),Ie.setSelection(ie.near(Ie.doc.resolve($),J)))}class fe extends Ee.dL{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=-3&(1|this.updated),this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(N){return this.storedMarks=N,this.updated|=2,this}ensureMarks(N){return D.CU.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(2&this.updated)>0}addStep(N,J){super.addStep(N,J),this.updated=-3&this.updated,this.storedMarks=null}setTime(N){return this.time=N,this}replaceSelection(N){return this.selection.replace(this,N),this}replaceSelectionWith(N,J=!0){let X=this.selection;return J&&(N=N.mark(this.storedMarks||(X.empty?X.$from.marks():X.$from.marksAcross(X.$to)||D.CU.none))),X.replaceWith(this,N),this}deleteSelection(){return this.selection.replace(this),this}insertText(N,J,X){let ve=this.doc.type.schema;if(null==J)return N?this.replaceSelectionWith(ve.text(N),!0):this.deleteSelection();{if(null==X&&(X=J),X=X??J,!N)return this.deleteRange(J,X);let Y=this.storedMarks;if(!Y){let $=this.doc.resolve(J);Y=X==J?$.marks():$.marksAcross(this.doc.resolve(X))}return this.replaceRangeWith(J,X,ve.text(N,Y)),this.selection.empty||this.setSelection(ie.near(this.selection.$to)),this}}setMeta(N,J){return this.meta["string"==typeof N?N:N.key]=J,this}getMeta(N){return this.meta["string"==typeof N?N:N.key]}get isGeneric(){for(let N in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function me(Ie,N){return N&&Ie?Ie.bind(N):Ie}class oe{constructor(N,J,X){this.name=N,this.init=me(J.init,X),this.apply=me(J.apply,X)}}const Se=[new oe("doc",{init:Ie=>Ie.doc||Ie.schema.topNodeType.createAndFill(),apply:Ie=>Ie.doc}),new oe("selection",{init:(Ie,N)=>Ie.selection||ie.atStart(N.doc),apply:Ie=>Ie.selection}),new oe("storedMarks",{init:Ie=>Ie.storedMarks||null,apply:(Ie,N,J,X)=>X.selection.$cursor?Ie.storedMarks:null}),new oe("scrollToSelection",{init:()=>0,apply:(Ie,N)=>Ie.scrolledIntoView?N+1:N})];class Ve{constructor(N,J){this.schema=N,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Se.slice(),J&&J.forEach(X=>{if(this.pluginsByKey[X.key])throw new RangeError("Adding different instances of a keyed plugin ("+X.key+")");this.plugins.push(X),this.pluginsByKey[X.key]=X,X.spec.state&&this.fields.push(new oe(X.key,X.spec.state,X))})}}class qe{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,J=-1){for(let X=0;X<this.config.plugins.length;X++)if(X!=J){let ve=this.config.plugins[X];if(ve.spec.filterTransaction&&!ve.spec.filterTransaction.call(ve,N,this))return!1}return!0}applyTransaction(N){if(!this.filterTransaction(N))return{state:this,transactions:[]};let J=[N],X=this.applyInner(N),ve=null;for(;;){let Y=!1;for(let $=0;$<this.config.plugins.length;$++){let Q=this.config.plugins[$];if(Q.spec.appendTransaction){let se=ve?ve[$].n:0,ge=ve?ve[$].state:this,we=se<J.length&&Q.spec.appendTransaction.call(Q,se?J.slice(se):J,ge,X);if(we&&X.filterTransaction(we,$)){if(we.setMeta("appendedTransaction",N),!ve){ve=[];for(let _e=0;_e<this.config.plugins.length;_e++)ve.push(_e<$?{state:X,n:J.length}:{state:this,n:0})}J.push(we),X=X.applyInner(we),Y=!0}ve&&(ve[$]={state:X,n:J.length})}}if(!Y)return{state:X,transactions:J}}}applyInner(N){if(!N.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let J=new qe(this.config),X=this.config.fields;for(let ve=0;ve<X.length;ve++){let Y=X[ve];J[Y.name]=Y.apply(N,this[Y.name],this,J)}return J}get tr(){return new fe(this)}static create(N){let J=new Ve(N.doc?N.doc.type.schema:N.schema,N.plugins),X=new qe(J);for(let ve=0;ve<J.fields.length;ve++)X[J.fields[ve].name]=J.fields[ve].init(N,X);return X}reconfigure(N){let J=new Ve(this.schema,N.plugins),X=J.fields,ve=new qe(J);for(let Y=0;Y<X.length;Y++){let $=X[Y].name;ve[$]=this.hasOwnProperty($)?this[$]:X[Y].init(N,ve)}return ve}toJSON(N){let J={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(J.storedMarks=this.storedMarks.map(X=>X.toJSON())),N&&"object"==typeof N)for(let X in N){if("doc"==X||"selection"==X)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let ve=N[X],Y=ve.spec.state;Y&&Y.toJSON&&(J[X]=Y.toJSON.call(ve,this[ve.key]))}return J}static fromJSON(N,J,X){if(!J)throw new RangeError("Invalid input for EditorState.fromJSON");if(!N.schema)throw new RangeError("Required config field 'schema' missing");let ve=new Ve(N.schema,N.plugins),Y=new qe(ve);return ve.fields.forEach($=>{if("doc"==$.name)Y.doc=D.bP.fromJSON(N.schema,J.doc);else if("selection"==$.name)Y.selection=ie.fromJSON(Y.doc,J.selection);else if("storedMarks"==$.name)J.storedMarks&&(Y.storedMarks=J.storedMarks.map(N.schema.markFromJSON));else{if(X)for(let Q in X){let se=X[Q],ge=se.spec.state;if(se.key==$.name&&ge&&ge.fromJSON&&Object.prototype.hasOwnProperty.call(J,Q))return void(Y[$.name]=ge.fromJSON.call(se,N,J[Q],Y))}Y[$.name]=$.init(N,Y)}}),Y}}function wt(Ie,N,J){for(let X in Ie){let ve=Ie[X];ve instanceof Function?ve=ve.bind(N):"handleDOMEvents"==X&&(ve=wt(ve,N,{})),J[X]=ve}return J}class ct{constructor(N){this.spec=N,this.props={},N.props&&wt(N.props,this,this.props),this.key=N.key?N.key.key:yt("plugin")}getState(N){return N[this.key]}}const rt=Object.create(null);function yt(Ie){return Ie in rt?Ie+"$"+ ++rt[Ie]:(rt[Ie]=0,Ie+"$")}class at{constructor(N="key"){this.key=yt(N)}get(N){return N.config.pluginsByKey[this.key]}getState(N){return N[this.key]}}},66085:(Nt,it,Oe)=>{Oe.d(it,{$L:()=>gn,Ln:()=>Se,N0:()=>Mt,Um:()=>Yt,Wg:()=>Ve,X9:()=>Xe,dL:()=>an,jP:()=>at,n9:()=>ft,oM:()=>N,zy:()=>_e});var D=Oe(17533);const ye=Math.pow(2,16);function ie(K,g){return K+g*ye}function ne(K){return 65535&K}class He{constructor(g,m,M){this.pos=g,this.delInfo=m,this.recover=M}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class De{constructor(g,m=!1){if(this.ranges=g,this.inverted=m,!g.length&&De.empty)return De.empty}recover(g){let m=0,M=ne(g);if(!this.inverted)for(let R=0;R<M;R++)m+=this.ranges[3*R+2]-this.ranges[3*R+1];return this.ranges[3*M]+m+function Te(K){return(K-(65535&K))/ye}(g)}mapResult(g,m=1){return this._map(g,m,!1)}map(g,m=1){return this._map(g,m,!0)}_map(g,m,M){let R=0,F=this.inverted?2:1,H=this.inverted?1:2;for(let le=0;le<this.ranges.length;le+=3){let ke=this.ranges[le]-(this.inverted?R:0);if(ke>g)break;let he=this.ranges[le+F],ze=this.ranges[le+H],T=ke+he;if(g<=T){let c=ke+R+((he?g==ke?-1:g==T?1:m:m)<0?0:ze);if(M)return c;let h=g==(m<0?ke:T)?null:ie(le/3,g-ke),w=g==ke?2:g==T?1:4;return(m<0?g!=ke:g!=T)&&(w|=8),new He(c,w,h)}R+=ze-he}return M?g+R:new He(g+R,0,null)}touches(g,m){let M=0,R=ne(m),F=this.inverted?2:1,H=this.inverted?1:2;for(let le=0;le<this.ranges.length;le+=3){let ke=this.ranges[le]-(this.inverted?M:0);if(ke>g)break;let he=this.ranges[le+F];if(g<=ke+he&&le==3*R)return!0;M+=this.ranges[le+H]-he}return!1}forEach(g){let m=this.inverted?2:1,M=this.inverted?1:2;for(let R=0,F=0;R<this.ranges.length;R+=3){let H=this.ranges[R],le=H-(this.inverted?F:0),ke=H+(this.inverted?0:F),he=this.ranges[R+m],ze=this.ranges[R+M];g(le,le+he,ke,ke+ze),F+=ze-he}}invert(){return new De(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(g){return 0==g?De.empty:new De(g<0?[0,-g,0]:[0,0,g])}}De.empty=new De([]);class Xe{constructor(g,m,M=0,R=(g?g.length:0)){this.mirror=m,this.from=M,this.to=R,this._maps=g||[],this.ownData=!(g||m)}get maps(){return this._maps}slice(g=0,m=this.maps.length){return new Xe(this._maps,this.mirror,g,m)}appendMap(g,m){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(g),null!=m&&this.setMirror(this._maps.length-1,m)}appendMapping(g){for(let m=0,M=this._maps.length;m<g._maps.length;m++){let R=g.getMirror(m);this.appendMap(g._maps[m],null!=R&&R<m?M+R:void 0)}}getMirror(g){if(this.mirror)for(let m=0;m<this.mirror.length;m++)if(this.mirror[m]==g)return this.mirror[m+(m%2?-1:1)]}setMirror(g,m){this.mirror||(this.mirror=[]),this.mirror.push(g,m)}appendMappingInverted(g){for(let m=g.maps.length-1,M=this._maps.length+g._maps.length;m>=0;m--){let R=g.getMirror(m);this.appendMap(g._maps[m].invert(),null!=R&&R>m?M-R-1:void 0)}}invert(){let g=new Xe;return g.appendMappingInverted(this),g}map(g,m=1){if(this.mirror)return this._map(g,m,!0);for(let M=this.from;M<this.to;M++)g=this._maps[M].map(g,m);return g}mapResult(g,m=1){return this._map(g,m,!1)}_map(g,m,M){let R=0;for(let F=this.from;F<this.to;F++){let le=this._maps[F].mapResult(g,m);if(null!=le.recover){let ke=this.getMirror(F);if(null!=ke&&ke>F&&ke<this.to){F=ke,g=this._maps[ke].recover(le.recover);continue}}R|=le.delInfo,g=le.pos}return M?g:new He(g,R,null)}}const Qe=Object.create(null);class Ke{getMap(){return De.empty}merge(g){return null}static fromJSON(g,m){if(!m||!m.stepType)throw new RangeError("Invalid input for Step.fromJSON");let M=Qe[m.stepType];if(!M)throw new RangeError(`No step type ${m.stepType} defined`);return M.fromJSON(g,m)}static jsonID(g,m){if(g in Qe)throw new RangeError("Duplicate use of step JSON ID "+g);return Qe[g]=m,m.prototype.jsonID=g,m}}class Ne{constructor(g,m){this.doc=g,this.failed=m}static ok(g){return new Ne(g,null)}static fail(g){return new Ne(null,g)}static fromReplace(g,m,M,R){try{return Ne.ok(g.replace(m,M,R))}catch(F){if(F instanceof D.vI)return Ne.fail(F.message);throw F}}}function xe(K,g,m){let M=[];for(let R=0;R<K.childCount;R++){let F=K.child(R);F.content.size&&(F=F.copy(xe(F.content,g,F))),F.isInline&&(F=g(F,m,R)),M.push(F)}return D.FK.fromArray(M)}class Z extends Ke{constructor(g,m,M){super(),this.from=g,this.to=m,this.mark=M}apply(g){let m=g.slice(this.from,this.to),M=g.resolve(this.from),R=M.node(M.sharedDepth(this.to)),F=new D.Ji(xe(m.content,(H,le)=>H.isAtom&&le.type.allowsMarkType(this.mark.type)?H.mark(this.mark.addToSet(H.marks)):H,R),m.openStart,m.openEnd);return Ne.fromReplace(g,this.from,this.to,F)}invert(){return new fe(this.from,this.to,this.mark)}map(g){let m=g.mapResult(this.from,1),M=g.mapResult(this.to,-1);return m.deleted&&M.deleted||m.pos>=M.pos?null:new Z(m.pos,M.pos,this.mark)}merge(g){return g instanceof Z&&g.mark.eq(this.mark)&&this.from<=g.to&&this.to>=g.from?new Z(Math.min(this.from,g.from),Math.max(this.to,g.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(g,m){if("number"!=typeof m.from||"number"!=typeof m.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Z(m.from,m.to,g.markFromJSON(m.mark))}}Ke.jsonID("addMark",Z);class fe extends Ke{constructor(g,m,M){super(),this.from=g,this.to=m,this.mark=M}apply(g){let m=g.slice(this.from,this.to),M=new D.Ji(xe(m.content,R=>R.mark(this.mark.removeFromSet(R.marks)),g),m.openStart,m.openEnd);return Ne.fromReplace(g,this.from,this.to,M)}invert(){return new Z(this.from,this.to,this.mark)}map(g){let m=g.mapResult(this.from,1),M=g.mapResult(this.to,-1);return m.deleted&&M.deleted||m.pos>=M.pos?null:new fe(m.pos,M.pos,this.mark)}merge(g){return g instanceof fe&&g.mark.eq(this.mark)&&this.from<=g.to&&this.to>=g.from?new fe(Math.min(this.from,g.from),Math.max(this.to,g.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(g,m){if("number"!=typeof m.from||"number"!=typeof m.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new fe(m.from,m.to,g.markFromJSON(m.mark))}}Ke.jsonID("removeMark",fe);class me extends Ke{constructor(g,m){super(),this.pos=g,this.mark=m}apply(g){let m=g.nodeAt(this.pos);if(!m)return Ne.fail("No node at mark step's position");let M=m.type.create(m.attrs,null,this.mark.addToSet(m.marks));return Ne.fromReplace(g,this.pos,this.pos+1,new D.Ji(D.FK.from(M),0,m.isLeaf?0:1))}invert(g){let m=g.nodeAt(this.pos);if(m){let M=this.mark.addToSet(m.marks);if(M.length==m.marks.length){for(let R=0;R<m.marks.length;R++)if(!m.marks[R].isInSet(M))return new me(this.pos,m.marks[R]);return new me(this.pos,this.mark)}}return new oe(this.pos,this.mark)}map(g){let m=g.mapResult(this.pos,1);return m.deletedAfter?null:new me(m.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(g,m){if("number"!=typeof m.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new me(m.pos,g.markFromJSON(m.mark))}}Ke.jsonID("addNodeMark",me);class oe extends Ke{constructor(g,m){super(),this.pos=g,this.mark=m}apply(g){let m=g.nodeAt(this.pos);if(!m)return Ne.fail("No node at mark step's position");let M=m.type.create(m.attrs,null,this.mark.removeFromSet(m.marks));return Ne.fromReplace(g,this.pos,this.pos+1,new D.Ji(D.FK.from(M),0,m.isLeaf?0:1))}invert(g){let m=g.nodeAt(this.pos);return m&&this.mark.isInSet(m.marks)?new me(this.pos,this.mark):this}map(g){let m=g.mapResult(this.pos,1);return m.deletedAfter?null:new oe(m.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(g,m){if("number"!=typeof m.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new oe(m.pos,g.markFromJSON(m.mark))}}Ke.jsonID("removeNodeMark",oe);class Se extends Ke{constructor(g,m,M,R=!1){super(),this.from=g,this.to=m,this.slice=M,this.structure=R}apply(g){return this.structure&&qe(g,this.from,this.to)?Ne.fail("Structure replace would overwrite content"):Ne.fromReplace(g,this.from,this.to,this.slice)}getMap(){return new De([this.from,this.to-this.from,this.slice.size])}invert(g){return new Se(this.from,this.from+this.slice.size,g.slice(this.from,this.to))}map(g){let m=g.mapResult(this.from,1),M=g.mapResult(this.to,-1);return m.deletedAcross&&M.deletedAcross?null:new Se(m.pos,Math.max(m.pos,M.pos),this.slice,this.structure)}merge(g){if(!(g instanceof Se)||g.structure||this.structure)return null;if(this.from+this.slice.size!=g.from||this.slice.openEnd||g.slice.openStart){if(g.to!=this.from||this.slice.openStart||g.slice.openEnd)return null;{let m=this.slice.size+g.slice.size==0?D.Ji.empty:new D.Ji(g.slice.content.append(this.slice.content),g.slice.openStart,this.slice.openEnd);return new Se(g.from,this.to,m,this.structure)}}{let m=this.slice.size+g.slice.size==0?D.Ji.empty:new D.Ji(this.slice.content.append(g.slice.content),this.slice.openStart,g.slice.openEnd);return new Se(this.from,this.to+(g.to-g.from),m,this.structure)}}toJSON(){let g={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(g.slice=this.slice.toJSON()),this.structure&&(g.structure=!0),g}static fromJSON(g,m){if("number"!=typeof m.from||"number"!=typeof m.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Se(m.from,m.to,D.Ji.fromJSON(g,m.slice),!!m.structure)}}Ke.jsonID("replace",Se);class Ve extends Ke{constructor(g,m,M,R,F,H,le=!1){super(),this.from=g,this.to=m,this.gapFrom=M,this.gapTo=R,this.slice=F,this.insert=H,this.structure=le}apply(g){if(this.structure&&(qe(g,this.from,this.gapFrom)||qe(g,this.gapTo,this.to)))return Ne.fail("Structure gap-replace would overwrite content");let m=g.slice(this.gapFrom,this.gapTo);if(m.openStart||m.openEnd)return Ne.fail("Gap is not a flat range");let M=this.slice.insertAt(this.insert,m.content);return M?Ne.fromReplace(g,this.from,this.to,M):Ne.fail("Content does not fit in gap")}getMap(){return new De([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(g){let m=this.gapTo-this.gapFrom;return new Ve(this.from,this.from+this.slice.size+m,this.from+this.insert,this.from+this.insert+m,g.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(g){let m=g.mapResult(this.from,1),M=g.mapResult(this.to,-1),R=this.from==this.gapFrom?m.pos:g.map(this.gapFrom,-1),F=this.to==this.gapTo?M.pos:g.map(this.gapTo,1);return m.deletedAcross&&M.deletedAcross||R<m.pos||F>M.pos?null:new Ve(m.pos,M.pos,R,F,this.slice,this.insert,this.structure)}toJSON(){let g={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(g.slice=this.slice.toJSON()),this.structure&&(g.structure=!0),g}static fromJSON(g,m){if("number"!=typeof m.from||"number"!=typeof m.to||"number"!=typeof m.gapFrom||"number"!=typeof m.gapTo||"number"!=typeof m.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ve(m.from,m.to,m.gapFrom,m.gapTo,D.Ji.fromJSON(g,m.slice),m.insert,!!m.structure)}}function qe(K,g,m){let M=K.resolve(g),R=m-g,F=M.depth;for(;R>0&&F>0&&M.indexAfter(F)==M.node(F).childCount;)F--,R--;if(R>0){let H=M.node(F).maybeChild(M.indexAfter(F));for(;R>0;){if(!H||H.isLeaf)return!0;H=H.firstChild,R--}}return!1}function rt(K,g,m,M=m.contentMatch,R=!0){let F=K.doc.nodeAt(g),H=[],le=g+1;for(let ke=0;ke<F.childCount;ke++){let he=F.child(ke),ze=le+he.nodeSize,T=M.matchType(he.type);if(T){M=T;for(let s=0;s<he.marks.length;s++)m.allowsMarkType(he.marks[s].type)||K.step(new fe(le,ze,he.marks[s]));if(R&&he.isText&&"pre"!=m.whitespace){let s,h,c=/\r?\n|\r/g;
vendor: 9,736 bytes, line 1
1for(;s=c.exec(he.text);)h||(h=new D.Ji(D.FK.from(m.schema.text(" ",m.allowedMarks(he.marks))),0,0)),H.push(new Se(le+s.index,le+s.index+s[0].length,h))}}else H.push(new Se(le,ze,D.Ji.empty));le=ze}if(!M.validEnd){let ke=M.fillBefore(D.FK.empty,!0);K.replace(le,le,new D.Ji(ke,0,0))}for(let ke=H.length-1;ke>=0;ke--)K.step(H[ke])}function yt(K,g,m){return(0==g||K.canReplace(g,K.childCount))&&(m==K.childCount||K.canReplace(0,m))}function at(K){let m=K.parent.content.cutByIndex(K.startIndex,K.endIndex);for(let M=K.depth;;--M){let R=K.$from.node(M),F=K.$from.index(M),H=K.$to.indexAfter(M);if(M<K.depth&&R.canReplace(F,H,m))return M;if(0==M||R.type.spec.isolating||!yt(R,F,H))break}return null}function N(K,g,m=null,M=K){let R=function X(K,g){let{parent:m,startIndex:M,endIndex:R}=K,F=m.contentMatchAt(M).findWrapping(g);return F&&m.canReplaceWith(M,R,F.length?F[0]:g)?F:null}(K,g),F=R&&function ve(K,g){let{parent:m,startIndex:M,endIndex:R}=K,F=m.child(M),H=g.contentMatch.findWrapping(F.type);if(!H)return null;let ke=(H.length?H[H.length-1]:g).contentMatch;for(let he=M;ke&&he<R;he++)ke=ke.matchType(m.child(he).type);return ke&&ke.validEnd?H:null}(M,g);return F?R.map(J).concat({type:g,attrs:m}).concat(F.map(J)):null}function J(K){return{type:K,attrs:null}}function Q(K,g,m,M){g.forEach((R,F)=>{if(R.isText){let H,le=/\r?\n|\r/g;for(;H=le.exec(R.text);){let ke=K.mapping.slice(M).map(m+1+F+H.index);K.replaceWith(ke,ke+1,g.type.schema.linebreakReplacement.create())}}})}function se(K,g,m,M){g.forEach((R,F)=>{if(R.type==R.type.schema.linebreakReplacement){let H=K.mapping.slice(M).map(m+1+F);K.replaceWith(H,H+1,g.type.schema.text("\n"))}})}function _e(K,g,m=1,M){let R=K.resolve(g),F=R.depth-m,H=M&&M[M.length-1]||R.parent;if(F<0||R.parent.type.spec.isolating||!R.parent.canReplace(R.index(),R.parent.childCount)||!H.type.validContent(R.parent.content.cutByIndex(R.index(),R.parent.childCount)))return!1;for(let he=R.depth-1,ze=m-2;he>F;he--,ze--){let T=R.node(he),s=R.index(he);if(T.type.spec.isolating)return!1;let c=T.content.cutByIndex(s,T.childCount),h=M&&M[ze+1];h&&(c=c.replaceChild(0,h.type.create(h.attrs)));let w=M&&M[ze]||T;if(!T.canReplace(s+1,T.childCount)||!w.type.validContent(c))return!1}let le=R.indexAfter(F),ke=M&&M[0];return R.node(F).canReplaceWith(le,le,ke?ke.type:R.node(F+1).type)}function ft(K,g){let m=K.resolve(g),M=m.index();return St(m.nodeBefore,m.nodeAfter)&&m.parent.canReplace(M,M+1)}function St(K,g){return!(!K||!g||K.isLeaf||!function Ot(K,g){g.content.size||K.type.compatibleContent(g.type);let m=K.contentMatchAt(K.childCount),{linebreakReplacement:M}=K.type.schema;for(let R=0;R<g.childCount;R++){let F=g.child(R);if(m=m.matchType(F.type==M?K.type.schema.nodes.text:F.type),!m||!K.type.allowsMarks(F.marks))return!1}return m.validEnd}(K,g))}function Mt(K,g,m=-1){let M=K.resolve(g);for(let R=M.depth;;R--){let F,H,le=M.index(R);if(R==M.depth?(F=M.nodeBefore,H=M.nodeAfter):m>0?(F=M.node(R+1),le++,H=M.node(R).maybeChild(le)):(F=M.node(R).maybeChild(le-1),H=M.node(R+1)),F&&!F.isTextblock&&St(F,H)&&M.node(R).canReplace(le,le+1))return g;if(0==R)break;g=m<0?M.before(R):M.after(R)}}function Yt(K,g,m){let M=K.resolve(g);if(!m.content.size)return g;let R=m.content;for(let F=0;F<m.openStart;F++)R=R.firstChild.content;for(let F=1;F<=(0==m.openStart&&m.size?2:1);F++)for(let H=M.depth;H>=0;H--){let le=H==M.depth?0:M.pos<=(M.start(H+1)+M.end(H+1))/2?-1:1,ke=M.index(H)+(le>0?1:0),he=M.node(H),ze=!1;if(1==F)ze=he.canReplace(ke,ke,R);else{let T=he.contentMatchAt(ke).findWrapping(R.firstChild.type);ze=T&&he.canReplaceWith(ke,ke,T[0])}if(ze)return 0==le?M.pos:le<0?M.before(H+1):M.after(H+1)}return null}function gn(K,g,m=g,M=D.Ji.empty){if(g==m&&!M.size)return null;let R=K.resolve(g),F=K.resolve(m);return Xt(R,F,M)?new Se(g,m,M):new An(R,F,M).fit()}function Xt(K,g,m){return!m.openStart&&!m.openEnd&&K.start()==g.start()&&K.parent.canReplace(K.index(),g.index(),m.content)}Ke.jsonID("replaceAround",Ve);class An{constructor(g,m,M){this.$from=g,this.$to=m,this.unplaced=M,this.frontier=[],this.placed=D.FK.empty;for(let R=0;R<=g.depth;R++){let F=g.node(R);this.frontier.push({type:F.type,match:F.contentMatchAt(g.indexAfter(R))})}for(let R=g.depth;R>0;R--)this.placed=D.FK.from(g.node(R).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let he=this.findFittable();he?this.placeNodes(he):this.openMore()||this.dropNode()}let g=this.mustMoveInline(),m=this.placed.size-this.depth-this.$from.depth,M=this.$from,R=this.close(g<0?this.$to:M.doc.resolve(g));if(!R)return null;let F=this.placed,H=M.depth,le=R.depth;for(;H&&le&&1==F.childCount;)F=F.firstChild.content,H--,le--;let ke=new D.Ji(F,H,le);return g>-1?new Ve(M.pos,g,this.$to.pos,this.$to.end(),ke,m):ke.size||M.pos!=this.$to.pos?new Se(M.pos,R.pos,ke):null}findFittable(){let g=this.unplaced.openStart;for(let m=this.unplaced.content,M=0,R=this.unplaced.openEnd;M<g;M++){let F=m.firstChild;if(m.childCount>1&&(R=0),F.type.spec.isolating&&R<=M){g=M;break}m=F.content}for(let m=1;m<=2;m++)for(let M=1==m?g:this.unplaced.openStart;M>=0;M--){let R,F=null;M?(F=Nn(this.unplaced.content,M-1).firstChild,R=F.content):R=this.unplaced.content;let H=R.firstChild;for(let le=this.depth;le>=0;le--){let ze,{type:ke,match:he}=this.frontier[le],T=null;if(1==m&&(H?he.matchType(H.type)||(T=he.fillBefore(D.FK.from(H),!1)):F&&ke.compatibleContent(F.type)))return{sliceDepth:M,frontierDepth:le,parent:F,inject:T};if(2==m&&H&&(ze=he.findWrapping(H.type)))return{sliceDepth:M,frontierDepth:le,parent:F,wrap:ze};if(F&&he.matchType(F.type))break}}}openMore(){let{content:g,openStart:m,openEnd:M}=this.unplaced,R=Nn(g,m);return!(!R.childCount||R.firstChild.isLeaf||(this.unplaced=new D.Ji(g,m+1,Math.max(M,R.size+m>=g.size-M?m+1:0)),0))}dropNode(){let{content:g,openStart:m,openEnd:M}=this.unplaced,R=Nn(g,m);if(R.childCount<=1&&m>0){let F=g.size-m<=m+R.size;this.unplaced=new D.Ji(yn(g,m-1,1),m-1,F?m-1:M)}else this.unplaced=new D.Ji(yn(g,m,1),m,M)}placeNodes({sliceDepth:g,frontierDepth:m,parent:M,inject:R,wrap:F}){for(;this.depth>m;)this.closeFrontierNode();if(F)for(let w=0;w<F.length;w++)this.openFrontierNode(F[w]);let H=this.unplaced,le=M?M.content:H.content,ke=H.openStart-g,he=0,ze=[],{match:T,type:s}=this.frontier[m];if(R){for(let w=0;w<R.childCount;w++)ze.push(R.child(w));T=T.matchFragment(R)}let c=le.size+g-(H.content.size-H.openEnd);for(;he<le.childCount;){let w=le.child(he),C=T.matchType(w.type);if(!C)break;he++,(he>1||0==ke||w.content.size)&&(T=C,ze.push(xn(w.mark(s.allowedMarks(w.marks)),1==he?ke:0,he==le.childCount?c:-1)))}let h=he==le.childCount;h||(c=-1),this.placed=Zt(this.placed,m,D.FK.from(ze)),this.frontier[m].match=T,h&&c<0&&M&&M.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let w=0,C=le;w<c;w++){let P=C.lastChild;this.frontier.push({type:P.type,match:P.contentMatchAt(P.childCount)}),C=P.content}this.unplaced=h?0==g?D.Ji.empty:new D.Ji(yn(H.content,g-1,1),g-1,c<0?H.openEnd:g-1):new D.Ji(yn(H.content,g,he),H.openStart,H.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let m,g=this.frontier[this.depth];if(!g.type.isTextblock||!rn(this.$to,this.$to.depth,g.type,g.match,!1)||this.$to.depth==this.depth&&(m=this.findCloseLevel(this.$to))&&m.depth==this.depth)return-1;let{depth:M}=this.$to,R=this.$to.after(M);for(;M>1&&R==this.$to.end(--M);)++R;return R}findCloseLevel(g){e:for(let m=Math.min(this.depth,g.depth);m>=0;m--){let{match:M,type:R}=this.frontier[m],F=m<g.depth&&g.end(m+1)==g.pos+(g.depth-(m+1)),H=rn(g,m,R,M,F);if(H){for(let le=m-1;le>=0;le--){let{match:ke,type:he}=this.frontier[le],ze=rn(g,le,he,ke,!0);if(!ze||ze.childCount)continue e}return{depth:m,fit:H,move:F?g.doc.resolve(g.after(m+1)):g}}}}close(g){let m=this.findCloseLevel(g);if(!m)return null;for(;this.depth>m.depth;)this.closeFrontierNode();m.fit.childCount&&(this.placed=Zt(this.placed,m.depth,m.fit)),g=m.move;for(let M=m.depth+1;M<=g.depth;M++){let R=g.node(M),F=R.type.contentMatch.fillBefore(R.content,!0,g.index(M));this.openFrontierNode(R.type,R.attrs,F)}return g}openFrontierNode(g,m=null,M){let R=this.frontier[this.depth];R.match=R.match.matchType(g),this.placed=Zt(this.placed,this.depth,D.FK.from(g.create(m,M))),this.frontier.push({type:g,match:g.contentMatch})}closeFrontierNode(){let m=this.frontier.pop().match.fillBefore(D.FK.empty,!0);m.childCount&&(this.placed=Zt(this.placed,this.frontier.length,m))}}function yn(K,g,m){return 0==g?K.cutByIndex(m,K.childCount):K.replaceChild(0,K.firstChild.copy(yn(K.firstChild.content,g-1,m)))}function Zt(K,g,m){return 0==g?K.append(m):K.replaceChild(K.childCount-1,K.lastChild.copy(Zt(K.lastChild.content,g-1,m)))}function Nn(K,g){for(let m=0;m<g;m++)K=K.firstChild.content;return K}function xn(K,g,m){if(g<=0)return K;let M=K.content;return g>1&&(M=M.replaceChild(0,xn(M.firstChild,g-1,1==M.childCount?m-1:0))),g>0&&(M=K.type.contentMatch.fillBefore(M).append(M),m<=0&&(M=M.append(K.type.contentMatch.matchFragment(M).fillBefore(D.FK.empty,!0)))),K.copy(M)}function rn(K,g,m,M,R){let F=K.node(g),H=R?K.indexAfter(g):K.index(g);if(H==F.childCount&&!m.compatibleContent(F.type))return null;let le=M.fillBefore(F.content,!0,H);return le&&!function Fn(K,g,m){for(let M=m;M<g.childCount;M++)if(!K.allowsMarks(g.child(M).marks))return!0;return!1}(m,F.content,H)?le:null}function Kt(K){return K.spec.defining||K.spec.definingForContent}function on(K,g,m,M,R){if(g<m){let F=K.firstChild;K=K.replaceChild(0,F.copy(on(F.content,g+1,m,M,F)))}if(g>M){let F=R.contentMatchAt(0),H=F.fillBefore(K).append(K);K=H.append(F.matchFragment(H).fillBefore(D.FK.empty,!0))}return K}function Bt(K,g){let m=[];for(let R=Math.min(K.depth,g.depth);R>=0;R--){let F=K.start(R);if(F<K.pos-(K.depth-R)||g.end(R)>
vendor: 5,816 bytes, line 1
1g.pos+(g.depth-R)||K.node(R).type.spec.isolating||g.node(R).type.spec.isolating)break;(F==g.start(R)||R==K.depth&&R==g.depth&&K.parent.inlineContent&&g.parent.inlineContent&&R&&g.start(R-1)==F-1)&&m.push(R)}return m}class Rt extends Ke{constructor(g,m,M){super(),this.pos=g,this.attr=m,this.value=M}apply(g){let m=g.nodeAt(this.pos);if(!m)return Ne.fail("No node at attribute step's position");let M=Object.create(null);for(let F in m.attrs)M[F]=m.attrs[F];M[this.attr]=this.value;let R=m.type.create(M,null,m.marks);return Ne.fromReplace(g,this.pos,this.pos+1,new D.Ji(D.FK.from(R),0,m.isLeaf?0:1))}getMap(){return De.empty}invert(g){return new Rt(this.pos,this.attr,g.nodeAt(this.pos).attrs[this.attr])}map(g){let m=g.mapResult(this.pos,1);return m.deletedAfter?null:new Rt(m.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(g,m){if("number"!=typeof m.pos||"string"!=typeof m.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Rt(m.pos,m.attr,m.value)}}Ke.jsonID("attr",Rt);class Qt extends Ke{constructor(g,m){super(),this.attr=g,this.value=m}apply(g){let m=Object.create(null);for(let R in g.attrs)m[R]=g.attrs[R];m[this.attr]=this.value;let M=g.type.create(m,g.content,g.marks);return Ne.ok(M)}getMap(){return De.empty}invert(g){return new Qt(this.attr,g.attrs[this.attr])}map(g){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(g,m){if("string"!=typeof m.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Qt(m.attr,m.value)}}Ke.jsonID("docAttr",Qt);let Wt=class extends Error{};Wt=function K(g){let m=Error.call(this,g);return m.__proto__=K.prototype,m},(Wt.prototype=Object.create(Error.prototype)).constructor=Wt,Wt.prototype.name="TransformError";class an{constructor(g){this.doc=g,this.steps=[],this.docs=[],this.mapping=new Xe}get before(){return this.docs.length?this.docs[0]:this.doc}step(g){let m=this.maybeStep(g);if(m.failed)throw new Wt(m.failed);return this}maybeStep(g){let m=g.apply(this.doc);return m.failed||this.addStep(g,m.doc),m}get docChanged(){return this.steps.length>0}addStep(g,m){this.docs.push(this.doc),this.steps.push(g),this.mapping.appendMap(g.getMap()),this.doc=m}replace(g,m=g,M=D.Ji.empty){let R=gn(this.doc,g,m,M);return R&&this.step(R),this}replaceWith(g,m,M){return this.replace(g,m,new D.Ji(D.FK.from(M),0,0))}delete(g,m){return this.replace(g,m,D.Ji.empty)}insert(g,m){return this.replaceWith(g,g,m)}replaceRange(g,m,M){return function Yn(K,g,m,M){if(!M.size)return K.deleteRange(g,m);let R=K.doc.resolve(g),F=K.doc.resolve(m);if(Xt(R,F,M))return K.step(new Se(g,m,M));let H=Bt(R,K.doc.resolve(m));0==H[H.length-1]&&H.pop();let le=-(R.depth+1);H.unshift(le);for(let s=R.depth,c=R.pos-1;s>0;s--,c--){let h=R.node(s).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;H.indexOf(s)>-1?le=s:R.before(s)==c&&H.splice(1,0,-s)}let ke=H.indexOf(le),he=[],ze=M.openStart;for(let s=M.content,c=0;;c++){let h=s.firstChild;if(he.push(h),c==M.openStart)break;s=h.content}for(let s=ze-1;s>=0;s--){let c=he[s],h=Kt(c.type);if(h&&!c.sameMarkup(R.node(Math.abs(le)-1)))ze=s;else if(h||!c.type.isTextblock)break}for(let s=M.openStart;s>=0;s--){let c=(s+ze+1)%(M.openStart+1),h=he[c];if(h)for(let w=0;w<H.length;w++){let C=H[(w+ke)%H.length],P=!0;C<0&&(P=!1,C=-C);let U=R.node(C-1),G=R.index(C-1);if(U.canReplaceWith(G,G,h.type,h.marks))return K.replace(R.before(C),P?F.after(C):m,new D.Ji(on(M.content,0,M.openStart,c),c,M.openEnd))}}let T=K.steps.length;for(let s=H.length-1;s>=0&&(K.replace(g,m,M),!(K.steps.length>T));s--){let c=H[s];c<0||(g=R.before(c),m=F.after(c))}}(this,g,m,M),this}replaceRangeWith(g,m,M){return function sn(K,g,m,M){if(!M.isInline&&g==m&&K.doc.resolve(g).parent.content.size){let R=function xt(K,g,m){let M=K.resolve(g);if(M.parent.canReplaceWith(M.index(),M.index(),m))return g;if(0==M.parentOffset)for(let R=M.depth-1;R>=0;R--){let F=M.index(R);if(M.node(R).canReplaceWith(F,F,m))return M.before(R+1);if(F>0)return null}if(M.parentOffset==M.parent.content.size)for(let R=M.depth-1;R>=0;R--){let F=M.indexAfter(R);if(M.node(R).canReplaceWith(F,F,m))return M.after(R+1);if(F<M.node(R).childCount)return null}return null}(K.doc,g,M.type);null!=R&&(g=m=R)}K.replaceRange(g,m,new D.Ji(D.FK.from(M),0,0))}(this,g,m,M),this}deleteRange(g,m){return function ln(K,g,m){let M=K.doc.resolve(g),R=K.doc.resolve(m),F=Bt(M,R);for(let H=0;H<F.length;H++){let le=F[H],ke=H==F.length-1;if(ke&&0==le||M.node(le).type.contentMatch.validEnd)return K.delete(M.start(le),R.end(le));if(le>0&&(ke||M.node(le-1).canReplace(M.index(le-1),R.indexAfter(le-1))))return K.delete(M.before(le),R.after(le))}for(let H=1;H<=M.depth&&H<=R.depth;H++)if(g-M.start(H)==M.depth-H&&m>M.end(H)&&R.end(H)-m!=R.depth-H&&M.start(H-1)==R.start(H-1)&&M.node(H-1).canReplace(M.index(H-1),R.index(H-1)))return K.delete(M.before(H),m);K.delete(g,m)}(this,g,m),this}lift(g,m){return function Ie(K,g,m){let{$from:M,$to:R,depth:F}=g,H=M.before(F+1),le=R.after(F+1),ke=H,he=le,ze=D.FK.empty,T=0;for(let h=F,w=!1;h>m;h--)w||M.index(h)>0?(w=!0,ze=D.FK.from(M.node(h).copy(ze)),T++):ke--;let s=D.FK.empty,c=0;for(let h=F,w=!1;h>m;h--)w||R.after(h+1)<R.end(h)?(w=!0,s=D.FK.from(R.node(h).copy(s)),c++):he++;K.step(new Ve(ke,he,H,le,new D.Ji(ze.append(s),T,c),ze.size-T,!0))}(this,g,m),this}join(g,m=1){return function ht(K,g,m){let M=null,{linebreakReplacement:R}=K.doc.type.schema,F=K.doc.resolve(g-m),H=F.node().type;if(R&&H.inlineContent){let ze="pre"==H.whitespace,T=!!H.contentMatch.matchType(R);ze&&!T?M=!1:!ze&&T&&(M=!0)}let le=K.steps.length;if(!1===M){let ze=K.doc.resolve(g+m);se(K,ze.node(),ze.before(),le)}H.inlineContent&&rt(K,g+m-1,H,F.node().contentMatchAt(F.index()),null==M);let ke=K.mapping.slice(le),he=ke.map(g-m);
1if(K.step(new Se(he,ke.map(g+m,-1),D.Ji.empty,!0)),!0===M){let ze=K.doc.resolve(he);Q(K,ze.node(),ze.before(),K.steps.length)}}(this,g,m),this}wrap(g,m){return function Y(K,g,m){let M=D.FK.empty;for(let H=m.length-1;H>=0;H--){if(M.size){let le=m[H].type.contentMatch.matchFragment(M);if(!le||!le.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}M=D.FK.from(m[H].type.create(m[H].attrs,M))}let R=g.start,F=g.end;K.step(new Ve(R,F,R,F,new D.Ji(M,0,0),m.length,!0))}(this,g,m),this}setBlockType(g,m=g,M,R=null){return function $(K,g,m,M,R){if(!M.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let F=K.steps.length;K.doc.nodesBetween(g,m,(H,le)=>{let ke="function"==typeof R?R(H):R;if(H.isTextblock&&!H.hasMarkup(M,ke)&&function ge(K,g,m){let M=K.resolve(g),R=M.index();return M.parent.canReplaceWith(R,R+1,m)}(K.doc,K.mapping.slice(F).map(le),M)){let he=null;if(M.schema.linebreakReplacement){let c="pre"==M.whitespace,h=!!M.contentMatch.matchType(M.schema.linebreakReplacement);c&&!h?he=!1:!c&&h&&(he=!0)}!1===he&&se(K,H,le,F),rt(K,K.mapping.slice(F).map(le,1),M,void 0,null===he);let ze=K.mapping.slice(F),T=ze.map(le,1),s=ze.map(le+H.nodeSize,1);return K.step(new Ve(T,s,T+1,s-1,new D.Ji(D.FK.from(M.create(ke,null,H.marks)),0,0),1,!0)),!0===he&&Q(K,H,le,F),!1}})}(this,g,m,M,R),this}setNodeMarkup(g,m,M=null,R){return function we(K,g,m,M,R){let F=K.doc.nodeAt(g);if(!F)throw new RangeError("No node at given position");m||(m=F.type);let H=m.create(M,null,R||F.marks);if(F.isLeaf)return K.replaceWith(g,g+F.nodeSize,H);if(!m.validContent(F.content))throw new RangeError("Invalid content for node type "+m.name);K.step(new Ve(g,g+F.nodeSize,g+1,g+F.nodeSize-1,new D.Ji(D.FK.from(H),0,0),1,!0))}(this,g,m,M,R),this}setNodeAttribute(g,m,M){return this.step(new Rt(g,m,M)),this}setDocAttribute(g,m){return this.step(new Qt(g,m)),this}addNodeMark(g,m){return this.step(new me(g,m)),this}removeNodeMark(g,m){let M=this.doc.nodeAt(g);if(!M)throw new RangeError("No node at position "+g);if(m instanceof D.CU)m.isInSet(M.marks)&&this.step(new oe(g,m));else{let F,R=M.marks,H=[];for(;F=m.isInSet(R);)H.push(new oe(g,F)),R=F.removeFromSet(R);for(let le=H.length-1;le>=0;le--)this.step(H[le])}return this}split(g,m=1,M){return function Ze(K,g,m=1,M){let R=K.doc.resolve(g),F=D.FK.empty,H=D.FK.empty;for(let le=R.depth,ke=R.depth-m,he=m-1;le>ke;le--,he--){F=D.FK.from(R.node(le).copy(F));let ze=M&&M[he];H=D.FK.from(ze?ze.type.create(ze.attrs,H):R.node(le).copy(H))}K.step(new Se(g,g,new D.Ji(F.append(H),m,m),!0))}(this,g,m,M),this}addMark(g,m,M){return function wt(K,g,m,M){let H,le,R=[],F=[];K.doc.nodesBetween(g,m,(ke,he,ze)=>{if(!ke.isInline)return;let T=ke.marks;if(!M.isInSet(T)&&ze.type.allowsMarkType(M.type)){let s=Math.max(he,g),c=Math.min(he+ke.nodeSize,m),h=M.addToSet(T);for(let w=0;w<T.length;w++)T[w].isInSet(h)||(H&&H.to==s&&H.mark.eq(T[w])?H.to=c:R.push(H=new fe(s,c,T[w])));le&&le.to==s?le.to=c:F.push(le=new Z(s,c,M))}}),R.forEach(ke=>K.step(ke)),F.forEach(ke=>K.step(ke))}(this,g,m,M),this}removeMark(g,m,M){return function ct(K,g,m,M){let R=[],F=0;K.doc.nodesBetween(g,m,(H,le)=>{if(!H.isInline)return;F++;let ke=null;if(M instanceof D.sX){let ze,he=H.marks;for(;ze=M.isInSet(he);)(ke||(ke=[])).push(ze),he=ze.removeFromSet(he)}else M?M.isInSet(H.marks)&&(ke=[M]):ke=H.marks;if(ke&&ke.length){let he=Math.min(le+H.nodeSize,m);for(let ze=0;ze<ke.length;ze++){let s,T=ke[ze];for(let c=0;c<R.length;c++){let h=R[c];h.step==F-1&&T.eq(R[c].style)&&(s=h)}s?(s.to=he,s.step=F):R.push({style:T,from:Math.max(le,g),to:he,step:F})}}}),R.forEach(H=>K.step(new fe(H.from,H.to,H.style)))}(this,g,m,M),this}clearIncompatible(g,m,M){return rt(this,g,m,M),this}}},77154:(Nt,it,Oe)=>{Oe.d(it,{Lz:()=>gt,NZ:()=>Gt,zF:()=>It});var D=Oe(17398),Ee=Oe(17533),ye=Oe(66085);const ie=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},ne=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let Te=null;const Pe=function(t,e,r){let l=Te||(Te=document.createRange());return l.setEnd(t,r??t.nodeValue.length),l.setStart(t,e||0),l},Ae=function(t,e,r,l){return r&&(He(t,e,r,l,-1)||He(t,e,r,l,1))},$e=/^(img|br|input|textarea|hr)$/i;function He(t,e,r,l,d){for(var f;;){if(t==r&&e==l)return!0;
vendor: 26,179 bytes, line 1
1if(e==(d<0?0:De(t))){let b=t.parentNode;if(!b||1!=b.nodeType||Ne(t)||$e.test(t.nodeName)||"false"==t.contentEditable)return!1;e=ie(t)+(d<0?0:1),t=b}else{if(1!=t.nodeType)return!1;{let b=t.childNodes[e+(d<0?-1:0)];if(1==b.nodeType&&"false"==b.contentEditable){if(null===(f=b.pmViewDesc)||void 0===f||!f.ignoreForSelection)return!1;e+=d}else t=b,e=d<0?De(t):0}}}}function De(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ne(t){let e;for(let r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const xe=function(t){return t.focusNode&&Ae(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Z(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}const oe=typeof navigator<"u"?navigator:null,Se=typeof document<"u"?document:null,Ve=oe&&oe.userAgent||"",qe=/Edge\/(\d+)/.exec(Ve),wt=/MSIE \d/.exec(Ve),ct=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ve),rt=!!(wt||ct||qe),yt=wt?document.documentMode:ct?+ct[1]:qe?+qe[1]:0,at=!rt&&/gecko\/(\d+)/i.test(Ve);at&&/Firefox\/(\d+)/.exec(Ve);const Ie=!rt&&/Chrome\/(\d+)/.exec(Ve),N=!!Ie,J=Ie?+Ie[1]:0,X=!rt&&!!oe&&/Apple Computer/.test(oe.vendor),ve=X&&(/Mobile\/\w+/.test(Ve)||!!oe&&oe.maxTouchPoints>2),Y=ve||!!oe&&/Mac/.test(oe.platform),$=!!oe&&/Win/.test(oe.platform),Q=/Android \d/.test(Ve),se=!!Se&&"webkitFontSmoothing"in Se.documentElement.style,ge=se?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function we(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function _e(t,e){return"number"==typeof t?t:t[e]}function Ze(t){let e=t.getBoundingClientRect();return{left:e.left,right:e.left+t.clientWidth*(e.width/t.offsetWidth||1),top:e.top,bottom:e.top+t.clientHeight*(e.height/t.offsetHeight||1)}}function ft(t,e,r){let l=t.someProp("scrollThreshold")||0,d=t.someProp("scrollMargin")||5,f=t.dom.ownerDocument;for(let b=r||t.dom;b;){if(1!=b.nodeType){b=ne(b);continue}let x=b,A=x==f.body,I=A?we(f):Ze(x),i=0,n=0;if(e.top<I.top+_e(l,"top")?n=-(I.top-e.top+_e(d,"top")):e.bottom>I.bottom-_e(l,"bottom")&&(n=e.bottom-e.top>I.bottom-I.top?e.top+_e(d,"top")-I.top:e.bottom-I.bottom+_e(d,"bottom")),e.left<I.left+_e(l,"left")?i=-(I.left-e.left+_e(d,"left")):e.right>I.right-_e(l,"right")&&(i=e.right-I.right+_e(d,"right")),i||n)if(A)f.defaultView.scrollBy(i,n);else{let a=x.scrollLeft,u=x.scrollTop;n&&(x.scrollTop+=n),i&&(x.scrollLeft+=i);let p=x.scrollLeft-a,y=x.scrollTop-u;e={left:e.left-p,top:e.top-y,right:e.right-p,bottom:e.bottom-y}}let o=A?"fixed":getComputedStyle(b).position;if(/^(fixed|sticky)$/.test(o))break;b="absolute"==o?b.offsetParent:ne(b)}}function St(t){let e=[],r=t.ownerDocument;for(let l=t;l&&(e.push({dom:l,top:l.scrollTop,left:l.scrollLeft}),t!=r);l=ne(l));return e}function ht(t,e){for(let r=0;r<t.length;r++){let{dom:l,top:d,left:f}=t[r];l.scrollTop!=d+e&&(l.scrollTop=d+e),l.scrollLeft!=f&&(l.scrollLeft=f)}}let xt=null;function gn(t,e){let r,d,A,I,l=2e8,f=0,b=e.top,x=e.top;for(let i=t.firstChild,n=0;i;i=i.nextSibling,n++){let o;if(1==i.nodeType)o=i.getClientRects();else{if(3!=i.nodeType)continue;o=Pe(i).getClientRects()}for(let a=0;a<o.length;a++){let u=o[a];if(u.top<=b&&u.bottom>=x){b=Math.max(u.bottom,b),x=Math.min(u.top,x);let p=u.left>e.left?u.left-e.left:u.right<e.left?e.left-u.right:0;if(p<l){r=i,l=p,d=p&&3==r.nodeType?{left:u.right<e.left?u.right:u.left,top:e.top}:e,1==i.nodeType&&p&&(f=n+(e.left>=(u.left+u.right)/2?1:0));continue}}else u.top>e.top&&!A&&u.left<=e.left&&u.right>=e.left&&(A=i,I={left:Math.max(u.left,Math.min(u.right,e.left)),top:u.top});!r&&(e.left>=u.right&&e.top>=u.top||e.left>=u.left&&e.top>=u.bottom)&&(f=n+1)}}return!r&&A&&(r=A,d=I,l=0),r&&3==r.nodeType?function Xt(t,e){let r=t.nodeValue.length,l=document.createRange();for(let d=0;d<r;d++){l.setEnd(t,d+1),l.setStart(t,d);let f=Kt(l,1);if(f.top!=f.bottom&&An(e,f))return{node:t,offset:d+(e.left>=(f.left+f.right)/2?1:0)}}return{node:t,offset:0}}(r,d):!r||l&&1==r.nodeType?{node:t,offset:f}:gn(r,d)}function An(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function xn(t,e,r){let l=t.childNodes.length;if(l&&r.top<r.bottom)for(let d=Math.max(0,Math.min(l-1,Math.floor(l*(e.top-r.top)/(r.bottom-r.top))-2)),f=d;;){let b=t.childNodes[f];if(1==b.nodeType){let x=b.getClientRects();for(let A=0;A<x.length;A++){let I=x[A];if(An(e,I))return xn(b,e,I)}}if((f=(f+1)%l)==d)break}return t}function rn(t,e){let l,r=t.dom.ownerDocument,d=0,f=function me(t,e,r){if(t.caretPositionFromPoint)try{let l=t.caretPositionFromPoint(e,r);if(l)return{node:l.offsetNode,offset:Math.min(De(l.offsetNode),l.offset)}}catch{}if(t.caretRangeFromPoint){let l=t.caretRangeFromPoint(e,r);if(l)return{node:l.startContainer,offset:Math.min(De(l.startContainer),l.startOffset)}}}(r,e.left,e.top);f&&({node:l,offset:d}=f);let x,b=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top);if(!b||!t.dom.contains(1!=b.nodeType?b.parentNode:b)){let I=t.dom.getBoundingClientRect();if(!An(e,I)||(b=xn(t.dom,e,I),!b))return null}if(X)for(let I=b;l&&I;I=ne(I))I.draggable&&(l=void 0);if(b=function yn(t,e){let r=t.parentNode;return r&&/^li$/i.test(r.nodeName)&&e.left<t.getBoundingClientRect().left?r:t}(b,e),l){if(at&&1==l.nodeType&&(d=Math.min(d,l.childNodes.length),d<l.childNodes.length)){let n,i=l.childNodes[d];"IMG"==i.nodeName&&(n=i.getBoundingClientRect()).right<=e.left&&n.bottom>e.top&&d++}let I;se&&d&&1==l.nodeType&&1==(I=l.childNodes[d-1]).nodeType&&"false"==I.contentEditable&&I.getBoundingClientRect().top>=e.top&&d--,l==t.dom&&d==l.childNodes.length-1&&1==l.lastChild.nodeType&&e.top>l.lastChild.getBoundingClientRect().bottom?x=t.state.doc.content.size:(0==d||1!=l.nodeType||"BR"!=l.childNodes[d-1].nodeName)&&(x=function Nn(t,e,r,l){let d=-1;for(let f=e,b=!1;f!=t.dom;){let A,x=t.docView.nearestDesc(f,!0);if(!x)return null;if(1==x.dom.nodeType&&(x.node.isBlock&&x.parent||!x.contentDOM)&&((A=x.dom.getBoundingClientRect()).width||A.height)&&(x.node.isBlock&&x.parent&&(!b&&A.left>l.left||A.top>l.top?d=x.posBefore:(!b&&A.right<l.left||A.bottom<l.top)&&(d=x.posAfter),b=!0),!x.contentDOM&&d<0&&!x.node.isText))return(x.node.isBlock?l.top<(A.top+A.bottom)/2:l.left<(A.left+A.right)/2)?x.posBefore:x.posAfter;f=x.dom.parentNode}return d>-1?d:t.docView.posFromDOM(e,r,-1)}(t,l,d,e))}null==x&&(x=function Zt(t,e,r){let{node:l,offset:d}=gn(e,r),f=-1;if(1==l.nodeType&&!l.firstChild){let b=l.getBoundingClientRect();f=b.left!=b.right&&r.left>(b.left+b.right)/2?1:-1}return t.docView.posFromDOM(l,d,f)}(t,b,e));let A=t.docView.nearestDesc(b,!0);return{pos:x,inside:A?A.posAtStart-A.border:-1}}function Fn(t){return t.top<t.bottom||t.left<t.right}function Kt(t,e){let r=t.getClientRects();if(r.length){let l=r[e<0?0:r.length-1];if(Fn(l))return l}return Array.prototype.find.call(r,Fn)||t.getBoundingClientRect()}const Yn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function on(t,e,r){let{node:l,offset:d,atom:f}=t.docView.domFromPos(e,r<0?-1:1),b=se||at;if(3==l.nodeType){if(!b||!Yn.test(l.nodeValue)&&(r<0?d:d!=l.nodeValue.length)){let A=d,I=d,i=r<0?1:-1;return r<0&&!d?(I++,i=-1):r>=0&&d==l.nodeValue.length?(A--,i=1):r<0?A--:I++,sn(Kt(Pe(l,A,I),i),i<0)}{let A=Kt(Pe(l,d,d),r);if(at&&d&&/\s/.test(l.nodeValue[d-1])&&d<l.nodeValue.length){let I=Kt(Pe(l,d-1,d-1),-1);if(I.top==A.top){let i=Kt(Pe(l,d,d+1),-1);if(i.top!=A.top)return sn(i,i.left<I.left)}}return A}}if(!t.state.doc.resolve(e-(f||0)).parent.inlineContent){if(null==f&&d&&(r<0||d==De(l))){let A=l.childNodes[d-1];if(1==A.nodeType)return ln(A.getBoundingClientRect(),!1)}if(null==f&&d<De(l)){let A=l.childNodes[d];if(1==A.nodeType)return ln(A.getBoundingClientRect(),!0)}return ln(l.getBoundingClientRect(),r>=0)}if(null==f&&d&&(r<0||d==De(l))){let A=l.childNodes[d-1],I=3==A.nodeType?Pe(A,De(A)-(b?0:1)):1!=A.nodeType||"BR"==A.nodeName&&A.nextSibling?null:A;if(I)return sn(Kt(I,1),!1)}if(null==f&&d<De(l)){let A=l.childNodes[d];for(;A.pmViewDesc&&A.pmViewDesc.ignoreForCoords;)A=A.nextSibling;let I=A?3==A.nodeType?Pe(A,0,b?0:1):1==A.nodeType?A:null:null;if(I)return sn(Kt(I,-1),!0)}return sn(Kt(3==l.nodeType?Pe(l):l,-r),r>=0)}function sn(t,e){if(0==t.width)return t;let r=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function ln(t,e){if(0==t.height)return t;let r=e?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function Bt(t,e,r){let l=t.state,d=t.root.activeElement;l!=e&&t.updateState(e),d!=t.dom&&t.focus();try{return r()}finally{l!=e&&t.updateState(l),d!=t.dom&&d&&d.focus()}}const Qt=/[\u0590-\u08ac]/;let an=null,K=null,g=!1;class le{constructor(e,r,l,d){this.parent=e,this.children=r,this.dom=l,this.contentDOM=d,this.dirty=0,l.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,r,l){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let r=0;r<this.children.length;r++)e+=this.children[r].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let r=0,l=this.posAtStart;;r++){let d=this.children[r];if(d==e)return l;l+=d.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,r,l){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(l<0){let f,b;if(e==this.contentDOM)f=e.childNodes[r-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;f=e.previousSibling}for(;f&&(!(b=f.pmViewDesc)||b.parent!=this);)f=f.previousSibling;return f?this.posBeforeChild(b)+b.size:this.posAtStart}{let f,b;if(e==this.contentDOM)f=e.childNodes[r];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;f=e.nextSibling}for(;f&&(!(b=f.pmViewDesc)||b.parent!=this);)f=f.nextSibling;return f?this.posBeforeChild(b):this.posAtEnd}}let d;if(e==this.dom&&this.contentDOM)d=r>ie(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))d=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==r)for(let f=e;;f=f.parentNode){if(f==this.dom){d=!1;break}if(f.previousSibling)break}if(null==d&&r==e.childNodes.length)for(let f=e;;f=f.parentNode){if(f==this.dom){d=!0;break}if(f.nextSibling)break}}return d??l>0?this.posAtEnd:this.posAtStart}nearestDesc(e,r=!1){for(let l=!0,d=e;d;d=d.parentNode){let b,f=this.getDesc(d);if(f&&(!r||f.node)){if(!l||!(b=f.nodeDOM)||(1==b.nodeType?b.contains(1==e.nodeType?e:e.parentNode):b==e))return f;l=!1}}}getDesc(e){let r=e.pmViewDesc;for(let l=r;l;l=l.parent)if(l==this)return r}posFromDOM(e,r,l){for(let d=e;d;d=d.parentNode){let f=this.getDesc(d);if(f)return f.localPosFromDOM(e,r,l)}return-1}descAt(e){for(let r=0,l=0;r<this.children.length;r++){let d=this.children[r],f=l+d.size;if(l==e&&f!=l){for(;!d.border&&d.children.length;)for(let b=0;b<d.children.length;b++){let x=d.children[b];if(x.size){d=x;break}}return d}if(e<f)return d.descAt(e-l-d.border);l=f}}domFromPos(e,r){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let l=0,d=0;for(let f=0;l<this.children.length;l++){let b=this.children[l],x=f+b.size;if(x>e||b instanceof h){d=e-f;break}f=x}if(d)return this.children[l].domFromPos(d-this.children[l].border,r);for(let f;l&&!(f=this.children[l-1]).size&&f instanceof ke&&f.side>=0;l--);if(r<=0){let f,b=!0;for(;f=l?this.children[l-1]:null,f&&f.dom.parentNode!=this.contentDOM;l--,b=!1);return f&&r&&b&&!f.border&&!f.domAtom?f.domFromPos(f.size,r):{node:this.contentDOM,offset:f?ie(f.dom)+1:0}}{let f,b=!0;for(;f=l<this.children.length?this.children[l]:null,f&&f.dom.parentNode!=this.contentDOM;l++,b=!1);return f&&b&&!f.border&&!f.domAtom?f.domFromPos(0,r):{node:this.contentDOM,offset:f?ie(f.dom):this.contentDOM.childNodes.length}}}parseRange(e,r,l=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let d=-1,f=-1;for(let b=l,x=0;;x++){let A=this.children[x],I=b+A.size;if(-1==d&&e<=I){let i=b+A.border;if(e>=i&&r<=I-A.border&&A.node&&A.contentDOM&&this.contentDOM.contains(A.contentDOM))return A.parseRange(e,r,i);e=b;for(let n=x;n>0;n--){let o=this.children[n-1];if(o.size&&o.dom.parentNode==this.contentDOM&&!o.emptyChildAt(1)){d=ie(o.dom)+1;break}e-=o.size}-1==d&&(d=0)}if(d>-1&&(I>r||x==this.children.length-1)){r=I;for(let i=x+1;i<this.children.length;i++){let n=this.children[i];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){f=ie(n.dom);break}r+=n.size}-1==f&&(f=this.contentDOM.childNodes.length);break}b=I}return{node:this.contentDOM,from:e,to:r,fromOffset:d,toOffset:f}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let r=this.children[e<0?0:this.children.length-1];return 0==r.size||r.emptyChildAt(e)}domAfterPos(e){let{node:r,offset:l}=this.domFromPos(e,0);if(1!=r.nodeType||l==r.childNodes.length)throw new RangeError("No node after pos "+e);return r.childNodes[l]}setSelection(e,r,l,d=!1){let f=Math.min(e,r),b=Math.max(e,r);for(let a=0,u=0;a<this.children.length;a++){let p=this.children[a],y=u+p.size;if(f>u&&b<y)return p.setSelection(e-u-p.border,r-u-p.border,l,d);u=y}let x=this.domFromPos(e,e?-1:1),A=r==e?x:this.domFromPos(r,r?-1:1),I=l.root.getSelection(),i=l.domSelectionRange(),n=!1;if((at||X)&&e==r){let{node:a,offset:u}=x;if(3==a.nodeType){if(n=!(!u||"\n"!=a.nodeValue[u-1]),n&&u==a.nodeValue.length)for(let y,p=a;p;p=p.parentNode){if(y=p.nextSibling){"BR"==y.nodeName&&(x=A={node:y.parentNode,offset:ie(y)+1});break}let S=p.pmViewDesc;if(S&&S.node&&S.node.isBlock)break}}else{let p=a.childNodes[u-1];n=p&&("BR"==p.nodeName||"false"==p.contentEditable)}}if(at&&i.focusNode&&i.focusNode!=A.node&&1==i.focusNode.nodeType){let a=i.focusNode.childNodes[i.focusOffset];a&&"false"==a.contentEditable&&(d=!0)}if(!(d||n&&X)&&Ae(x.node,x.offset,i.anchorNode,i.anchorOffset)&&Ae(A.node,A.offset,i.focusNode,i.focusOffset))return;let o=!1;if((I.extend||e==r)&&!n){I.collapse(x.node,x.offset);try{e!=r&&I.extend(A.node,A.offset),o=!0}catch{}}if(!o){if(e>r){let u=x;x=A,A=u}let a=document.createRange();a.setEnd(A.node,A.offset),a.setStart(x.node,x.offset),I.removeAllRanges(),I.addRange(a)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,r){for(let l=0,d=0;d<this.children.length;d++){let f=this.children[d],b=l+f.size;if(l==b?e<=b&&r>=l:e<b&&r>l){let x=l+f.border,A=b-f.border;if(e>=x&&r<=A)return this.dirty=e==l||r==b?2:1,void(e!=x||r!=A||!f.contentLost&&f.dom.parentNode==this.contentDOM?f.markDirty(e-x,r-x):f.dirty=3);f.dirty=f.dom!=f.contentDOM||f.dom.parentNode!=this.contentDOM||f.children.length?3:2}l=b}this.dirty=2}markParentsDirty(){let e=1;for(let r=this.parent;r;r=r.parent,e++){let l=1==e?2:1;r.dirty<l&&(r.dirty=l)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class ke extends le{constructor(e,r,l,d){let f,b=r.type.toDOM;if("function"==typeof b&&(b=b(l,()=>f?f.parent?f.parent.posBeforeChild(f):void 0:d)),!r.type.spec.raw){if(1!=b.nodeType){let x=document.createElement("span");x.appendChild(b),b=x}b.contentEditable="false",b.classList.add("ProseMirror-widget")}super(e,[],b,null),this.widget=r,this.widget=r,f=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let r=this.widget.spec.stopEvent;return!!r&&r(e)}ignoreMutation(e){return"selection"!=e.type||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 he extends le{constructor(e,r,l,d){super(e,[],r,null),this.textDOM=l,this.text=d}get size(){return this.text.length}localPosFromDOM(e,r){return e!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class ze extends le{constructor(e,r,l,d,f){super(e,[],l,d),this.mark=r,this.spec=f}static create(e,r,l,d){let f=d.nodeViews[r.type.name],b=f&&f(r,d,l);return(!b||!b.dom)&&(b=Ee.ZF.renderSpec(document,r.type.spec.toDOM(r,l),null,r.attrs)),new ze(e,r,b.dom,b.contentDOM||b.dom,b)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,r){if(super.markDirty(e,r),0!=this.dirty){let l=this.parent;for(;!l.node;)l=l.parent;l.dirty<this.dirty&&(l.dirty=this.dirty),this.dirty=0}}slice(e,r,l){let d=ze.create(this.parent,this.mark,!0,l),f=this.children,b=this.size;r<b&&(f=kr(f,r,b,l)),e>0&&(f=kr(f,0,e,l));for(let x=0;x<f.length;x++)f[x].parent=d;return d.children=f,d}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class T extends le{constructor(e,r,l,d,f,b,x,A,I){super(e,[],f,b),this.node=r,this.outerDeco=l,this.innerDeco=d,this.nodeDOM=x}static create(e,r,l,d,f,b){let A,x=f.nodeViews[r.type.name],I=x&&x(r,f,()=>A?A.parent?A.parent.posBeforeChild(A):void 0:b,l,d),i=I&&I.dom,n=I&&I.contentDOM;if(r.isText)if(i){if(3!=i.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else i=document.createTextNode(r.text);else i||({dom:i,contentDOM:n}=Ee.ZF.renderSpec(document,r.type.spec.toDOM(r),null,r.attrs));!n&&!r.isText&&"BR"!=i.nodeName&&(i.hasAttribute("contenteditable")||(i.contentEditable="false"),r.type.spec.draggable&&(i.draggable=!0));let o=i;return i=Ct(i,l,r),I?A=new w(e,r,l,d,i,n||null,o,I,f,b+1):r.isText?new c(e,r,l,d,i,o,f):new T(e,r,l,d,i,n||null,o,f,b+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let r=this.children.length-1;r>=0;r--){let l=this.children[r];if(this.dom.contains(l.dom.parentNode)){e.contentElement=l.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Ee.FK.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,r,l){return 0==this.dirty&&e.eq(this.node)&&jt(r,this.outerDeco)&&l.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,r){let l=this.node.inlineContent,d=r,f=e.composing?this.localCompositionInfo(e,r):null,b=f&&f.pos>-1?f:null,x=f&&f.pos<0,A=new wn(this,b&&b.node,e);(function ei(t,e,r,l){let d=e.locals(t),f=0;if(0==d.length){for(let I=0;I<t.childCount;I++){let i=t.child(I);l(i,d,e.forChild(f,i),I),f+=i.nodeSize}return}let b=0,x=[],A=null;for(let I=0;;){let i,n,o,a;for(;b<d.length&&d[b].to==f;){let y=d[b++];y.widget&&(i?(n||(n=[i])).push(y):i=y)}if(i)if(n){n.sort(bn);for(let y=0;y<n.length;y++)r(n[y],I,!!A)}else r(i,I,!!A);if(A)a=-1,o=A,A=null;else{if(!(I<t.childCount))break;a=I,o=t.child(I++)}for(let y=0;y<x.length;y++)x[y].to<=f&&x.splice(y--,1);for(;b<d.length&&d[b].from<=f&&d[b].to>f;)x.push(d[b++]);let u=f+o.nodeSize;if(o.isText){let y=u;b<d.length&&d[b].from<y&&(y=d[b].from);for(let S=0;S<x.length;S++)x[S].to<y&&(y=x[S].to);y<u&&(A=o.cut(y-f),o=o.cut(0,y-f),u=y,a=-1)}else for(;b<d.length&&d[b].to<u;)b++;l(o,o.isInline&&!o.isLeaf?x.filter(y=>!y.inline):x.slice(),e.forChild(f,o),a),f=u}})(this.node,this.innerDeco,(I,i,n)=>{I.spec.marks?A.syncToMarks(I.spec.marks,l,e):I.type.side>=0&&!n&&A.syncToMarks(i==this.node.childCount?Ee.CU.none:this.node.child(i).marks,l,e),A.placeWidget(I,e,d)},(I,i,n,o)=>{let a;A.syncToMarks(I.marks,l,e),A.findNodeMatch(I,i,n,o)||x&&e.state.selection.from>d&&e.state.selection.to<d+I.nodeSize&&(a=A.findIndexWithChild(f.node))>-1&&A.updateNodeAt(I,i,n,a,e)||A.updateNextNode(I,i,n,e,o,d)||A.addNode(I,i,n,e,d),d+=I.nodeSize}),A.syncToMarks([],l,e),this.node.isTextblock&&A.addTextblockHacks(),A.destroyRest(),(A.changed||2==this.dirty)&&(b&&this.protectLocalComposition(e,b),C(this.contentDOM,this.children,e),ve&&function vr(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t),t.style.cssText=e}}(this.dom))}localCompositionInfo(e,r){let{from:l,to:d}=e.state.selection;if(!(e.state.selection instanceof D.U3)||l<r||d>r+this.node.content.size)return null;let f=e.input.compositionNode;if(!f||!this.dom.contains(f.parentNode))return null;if(this.node.inlineContent){let b=f.nodeValue,x=function ti(t,e,r,l){for(let d=0,f=0;d<t.childCount&&f<=l;){let b=t.child(d++),x=f;if(f+=b.nodeSize,!b.isText)continue;let A=b.text;for(;d<t.childCount;){let I=t.child(d++);if(f+=I.nodeSize,!I.isText)break;A+=I.text}if(f>=r){if(f>=l&&A.slice(l-e.length-x,l-x)==e)return l-e.length;let I=x<l?A.lastIndexOf(e,l-x-1):-1;if(I>=0&&I+e.length+x>=r)return x+I;if(r==l&&A.length>=l+e.length-x&&A.slice(l-x,l-x+e.length)==e)return l}}return-1}(this.node.content,b,l-r,d-r);return x<0?null:{node:f,pos:x,text:b}}return{node:f,pos:-1,text:""}}protectLocalComposition(e,{node:r,pos:l,text:d}){if(this.getDesc(r))return;let f=r;for(;f.parentNode!=this.contentDOM;f=f.parentNode){for(;f.previousSibling;)f.parentNode.removeChild(f.previousSibling);for(;f.nextSibling;)f.parentNode.removeChild(f.nextSibling);f.pmViewDesc&&(f.pmViewDesc=void 0)}let b=new he(this,f,r,d);e.input.compositionNodes.push(b),this.children=kr(this.children,l,l+d.length,e,b)}update(e,r,l,d){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,r,l,d),0))}updateInner(e,r,l,d){this.updateOuterDeco(r),this.node=e,this.innerDeco=l,this.contentDOM&&this.updateChildren(d,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(jt(e,this.outerDeco))return;let r=1!=this.nodeDOM.nodeType,l=this.dom;this.dom=Me(this.dom,this.nodeDOM,G(this.outerDeco,this.node,r),G(e,this.node,r)),this.dom!=l&&(l.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function s(t,e,r,l,d){Ct(l,e,t);let f=new T(void 0,t,e,r,l,l,l,d,0);return f.contentDOM&&f.updateChildren(d,0),f}class c extends T{constructor(e,r,l,d,f,b,x){super(e,r,l,d,f,null,b,x,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,r,l,d){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(r),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,d.trackWrites==this.nodeDOM&&(d.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,r,l){return e==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(e,r,l)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,r,l){let d=this.node.cut(e,r),f=document.createTextNode(d.text);return new c(this.parent,d,this.outerDeco,this.innerDeco,f,f,l)}markDirty(e,r){super.markDirty(e,r),this.dom!=this.nodeDOM&&(0==e||r==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class h extends le{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class w extends T{constructor(e,r,l,d,f,b,x,A,I,i){super(e,r,l,d,f,b,x,I,i),this.spec=A}update(e,r,l,d){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let f=this.spec.update(e,r,l);return f&&this.updateInner(e,r,l,d),f}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,r,l,d)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,r,l,d){this.spec.setSelection?this.spec.setSelection(e,r,l.root):super.setSelection(e,r,l,d)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function C(t,e,r){let l=t.firstChild,d=!1;for(let f=0;f<e.length;f++){let b=e[f],x=b.dom;if(x.parentNode==t){for(;x!=l;)l=Gn(l),d=!0;l=l.nextSibling}else d=!0,t.insertBefore(x,l);if(b instanceof ze){let A=l?l.previousSibling:t.lastChild;C(b.contentDOM,b.children,r),l=A?A.nextSibling:t.firstChild}}for(;l;)l=Gn(l),d=!0;d&&r.trackWrites==t&&(r.trackWrites=null)}const P=function(t){t&&(this.nodeName=t)};P.prototype=Object.create(null);const U=[new P];function G(t,e,r){if(0==t.length)return U;let l=r?U[0]:new P,d=[l];for(let f=0;f<t.length;f++){let b=t[f].type.attrs;if(b){b.nodeName&&d.push(l=new P(b.nodeName));for(let x in b){let A=b[x];null!=A&&(r&&1==d.length&&d.push(l=new P(e.isInline?"span":"div")),"class"==x?l.class=(l.class?l.class+" ":"")+A:"style"==x?l.style=(l.style?l.style+";":"")+A:"nodeName"!=x&&(l[x]=A))}}}return d}function Me(t,e,r,l){if(r==U&&l==U)return e;let d=e;for(let f=0;f<l.length;f++){let b=l[f],x=r[f];if(f){let A;x&&x.nodeName==b.nodeName&&d!=t&&(A=d.parentNode)&&A.nodeName.toLowerCase()==b.nodeName||(A=document.createElement(b.
vendor: 4,514 bytes, line 1
1nodeName),A.pmIsDeco=!0,A.appendChild(d),x=U[0]),d=A}ot(d,x||U[0],b)}return d}function ot(t,e,r){for(let l in e)"class"!=l&&"style"!=l&&"nodeName"!=l&&!(l in r)&&t.removeAttribute(l);for(let l in r)"class"!=l&&"style"!=l&&"nodeName"!=l&&r[l]!=e[l]&&t.setAttribute(l,r[l]);if(e.class!=r.class){let l=e.class?e.class.split(" ").filter(Boolean):[],d=r.class?r.class.split(" ").filter(Boolean):[];for(let f=0;f<l.length;f++)-1==d.indexOf(l[f])&&t.classList.remove(l[f]);for(let f=0;f<d.length;f++)-1==l.indexOf(d[f])&&t.classList.add(d[f]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=r.style){if(e.style){let d,l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;d=l.exec(e.style);)t.style.removeProperty(d[1])}r.style&&(t.style.cssText+=r.style)}}function Ct(t,e,r){return Me(t,t,U,G(e,r,1!=t.nodeType))}function jt(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(e[r].type))return!1;return!0}function Gn(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class wn{constructor(e,r,l){this.lock=r,this.view=l,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function Xn(t,e){let r=e,l=r.children.length,d=t.childCount,f=new Map,b=[];e:for(;d>0;){let x;for(;;)if(l){let I=r.children[l-1];if(!(I instanceof ze)){x=I,l--;break}r=I,l=I.children.length}else{if(r==e)break e;l=r.parent.children.indexOf(r),r=r.parent}let A=x.node;if(A){if(A!=t.child(d-1))break;--d,f.set(x,d),b.push(x)}}return{index:d,matched:f,matches:b.reverse()}}(e.node.content,e)}destroyBetween(e,r){if(e!=r){for(let l=e;l<r;l++)this.top.children[l].destroy();this.top.children.splice(e,r-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,r,l){let d=0,f=this.stack.length>>1,b=Math.min(f,e.length);for(;d<b&&(d==f-1?this.top:this.stack[d+1<<1]).matchesMark(e[d])&&!1!==e[d].type.spec.spanning;)d++;for(;d<f;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),f--;for(;f<e.length;){this.stack.push(this.top,this.index+1);let x=-1;for(let A=this.index;A<Math.min(this.index+3,this.top.children.length);A++){let I=this.top.children[A];if(I.matchesMark(e[f])&&!this.isLocked(I.dom)){x=A;break}}if(x>-1)x>this.index&&(this.changed=!0,this.destroyBetween(this.index,x)),this.top=this.top.children[this.index];else{let A=ze.create(this.top,e[f],r,l);this.top.children.splice(this.index,0,A),this.top=A,this.changed=!0}this.index=0,f++}}findNodeMatch(e,r,l,d){let b,f=-1;if(d>=this.preMatch.index&&(b=this.preMatch.matches[d-this.preMatch.index]).parent==this.top&&b.matchesNode(e,r,l))f=this.top.children.indexOf(b,this.index);else for(let x=this.index,A=Math.min(this.top.children.length,x+5);x<A;x++){let I=this.top.children[x];if(I.matchesNode(e,r,l)&&!this.preMatch.matched.has(I)){f=x;break}}return!(f<0||(this.destroyBetween(this.index,f),this.index++,0))}updateNodeAt(e,r,l,d,f){let b=this.top.children[d];return 3==b.dirty&&b.dom==b.contentDOM&&(b.dirty=2),!!b.update(e,r,l,f)&&(this.destroyBetween(this.index,d),this.index++,!0)}findIndexWithChild(e){for(;;){let r=e.parentNode;if(!r)return-1;if(r==this.top.contentDOM){let l=e.pmViewDesc;if(l)for(let d=this.index;d<this.top.children.length;d++)if(this.top.children[d]==l)return d;return-1}e=r}}updateNextNode(e,r,l,d,f,b){for(let x=this.index;x<this.top.children.length;x++){let A=this.top.children[x];if(A instanceof T){let I=this.preMatch.matched.get(A);if(null!=I&&I!=f)return!1;let n,i=A.dom,o=this.isLocked(i)&&!(e.isText&&A.node&&A.node.isText&&A.nodeDOM.nodeValue==e.text&&3!=A.dirty&&jt(r,A.outerDeco));if(!o&&A.update(e,r,l,d))return this.destroyBetween(this.index,x),A.dom!=i&&(this.changed=!0),this.index++,!0;if(!o&&(n=this.recreateWrapper(A,e,r,l,d,b)))return this.destroyBetween(this.index,x),this.top.children[this.index]=n,n.contentDOM&&(n.dirty=2,n.updateChildren(d,b+1),n.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,r,l,d,f,b){if(e.dirty||r.isAtom||!e.children.length||!e.node.content.eq(r.content)||!jt(l,e.outerDeco)||!d.eq(e.innerDeco))return null;let x=T.create(this.top,r,l,d,f,b);if(x.contentDOM){x.children=e.children,e.children=[];for(let A of x.children)A.parent=x}return e.destroy(),x}addNode(e,r,l,d,f){let b=T.create(this.top,e,r,l,d,f);b.contentDOM&&b.updateChildren(d,f+1),this.top.children.splice(this.index++,0,b),this.changed=!0}placeWidget(e,r,l){let d=this.index<this.top.children.length?this.top.children[this.index]:null;
vendor: 22,266 bytes, line 1
1if(!d||!d.matchesWidget(e)||e!=d.widget&&d.widget.type.toDOM.parentNode){let f=new ke(this.top,e,r,l);this.top.children.splice(this.index++,0,f),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],r=this.top;for(;e instanceof ze;)r=e,e=r.children[r.children.length-1];(!e||!(e instanceof c)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((X||N)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",r),this.addHackNode("BR",this.top))}addHackNode(e,r){if(r==this.top&&this.index<r.children.length&&r.children[this.index].matchesHack(e))this.index++;else{let l=document.createElement(e);"IMG"==e&&(l.className="ProseMirror-separator",l.alt=""),"BR"==e&&(l.className="ProseMirror-trailingBreak");let d=new h(this.top,[],l,null);r!=this.top?r.children.push(d):r.children.splice(this.index++,0,d),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function bn(t,e){return t.type.side-e.type.side}function kr(t,e,r,l,d){let f=[];for(let b=0,x=0;b<t.length;b++){let A=t[b],I=x,i=x+=A.size;I>=r||i<=e?f.push(A):(I<e&&f.push(A.slice(0,e-I,l)),d&&(f.push(d),d=void 0),i>r&&f.push(A.slice(r-I,A.size,l)))}return f}function _n(t,e=null){let r=t.domSelectionRange(),l=t.state.doc;if(!r.focusNode)return null;let d=t.docView.nearestDesc(r.focusNode),f=d&&0==d.size,b=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(b<0)return null;let A,I,x=l.resolve(b);if(xe(r)){for(A=b;d&&!d.node;)d=d.parent;let n=d.node;if(d&&n.isAtom&&D.nh.isSelectable(n)&&d.parent&&(!n.isInline||!function Ke(t,e,r){for(let l=0==e,d=e==De(t);l||d;){if(t==r)return!0;let f=ie(t);if(!(t=t.parentNode))return!1;l=l&&0==f,d=d&&f==De(t)}}(r.focusNode,r.focusOffset,d.dom))){let o=d.posBefore;I=new D.nh(b==o?x:l.resolve(o))}}else{if(r instanceof t.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let n=b,o=b;for(let a=0;a<r.rangeCount;a++){let u=r.getRangeAt(a);n=Math.min(n,t.docView.posFromDOM(u.startContainer,u.startOffset,1)),o=Math.max(o,t.docView.posFromDOM(u.endContainer,u.endOffset,-1))}if(n<0)return null;[A,b]=o==t.state.selection.anchor?[o,n]:[n,o],x=l.resolve(b)}else A=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(A<0)return null}let i=l.resolve(A);return I||(I=Mr(t,i,x,"pointer"==e||t.state.selection.head<x.pos&&!f?1:-1)),I}function zn(t){return t.editable?t.hasFocus():Hr(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function vn(t,e=!1){let r=t.state.selection;if(wr(t,r),zn(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&N){let l=t.domSelectionRange(),d=t.domObserver.currentSelection;if(l.anchorNode&&d.anchorNode&&Ae(l.anchorNode,l.anchorOffset,d.anchorNode,d.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function Kr(t){let e=t.domSelection(),r=document.createRange();if(!e)return;let l=t.cursorWrapper.dom,d="IMG"==l.nodeName;d?r.setStart(l.parentNode,ie(l)+1):r.setStart(l,0),r.collapse(!0),e.removeAllRanges(),e.addRange(r),!d&&!t.state.selection.visible&&rt&&yt<=11&&(l.disabled=!0,l.disabled=!1)}(t);else{let f,b,{anchor:l,head:d}=r;$r&&!(r instanceof D.U3)&&(r.$from.parent.inlineContent||(f=Sn(t,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(b=Sn(t,r.to))),t.docView.setSelection(l,d,t,e),$r&&(f&&xr(f),b&&xr(b)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function lr(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let r=t.domSelectionRange(),l=r.anchorNode,d=r.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(r.anchorNode!=l||r.anchorOffset!=d)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!zn(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const $r=X||N&&J<63;function Sn(t,e){let{node:r,offset:l}=t.docView.domFromPos(e,0),d=l<r.childNodes.length?r.childNodes[l]:null,f=l?r.childNodes[l-1]:null;if(X&&d&&"false"==d.contentEditable)return Ut(d);if(!(d&&"false"!=d.contentEditable||f&&"false"!=f.contentEditable)){if(d)return Ut(d);if(f)return Ut(f)}}function Ut(t){return t.contentEditable="true",X&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function xr(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function wr(t,e){if(e instanceof D.nh){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(Sr(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else Sr(t)}function Sr(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Mr(t,e,r,l){return t.someProp("createSelectionBetween",d=>d(t,e,r))||D.U3.between(e,r,l)}function ni(t){return!(t.editable&&!t.hasFocus())&&Hr(t)}function Hr(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Cr(t,e){let{$anchor:r,$head:l}=t.selection,d=e>0?r.max(l):r.min(l),f=d.parent.inlineContent?d.depth?t.doc.resolve(e>0?d.after():d.before()):null:d;return f&&D.LN.findFrom(f,e)}function Mn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Or(t,e,r){let l=t.state.selection;if(!(l instanceof D.U3)){if(l instanceof D.nh&&l.node.isInline)return Mn(t,new D.U3(e>0?l.$to:l.$from));{let d=Cr(t.state,e);return!!d&&Mn(t,d)}}if(r.indexOf("s")>-1){let{$head:d}=l,f=d.textOffset?null:e<0?d.nodeBefore:d.nodeAfter;if(!f||f.isText||!f.isLeaf)return!1;let b=t.state.doc.resolve(d.pos+f.nodeSize*(e<0?-1:1));return Mn(t,new D.U3(l.$anchor,b))}if(!l.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let d=Cr(t.state,e);return!!(d&&d instanceof D.nh)&&Mn(t,d)}if(!(Y&&r.indexOf("m")>-1)){let b,d=l.$head,f=d.textOffset?null:e<0?d.nodeBefore:d.nodeAfter;if(!f||f.isText)return!1;let x=e<0?d.pos-f.nodeSize:d.pos;return!!(f.isAtom||(b=t.docView.descAt(x))&&!b.contentDOM)&&(D.nh.isSelectable(f)?Mn(t,new D.nh(e<0?t.state.doc.resolve(d.pos-f.nodeSize):d)):!!se&&Mn(t,new D.U3(t.state.doc.resolve(e<0?x:x+f.nodeSize))))}}function Zn(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Vn(t,e){let r=t.pmViewDesc;return r&&0==r.size&&(e<0||t.nextSibling||"BR"!=t.nodeName)}function Pn(t,e){return e<0?function tn(t){let e=t.domSelectionRange(),r=e.focusNode,l=e.focusOffset;if(!r)return;let d,f,b=!1;for(at&&1==r.nodeType&&l<Zn(r)&&Vn(r.childNodes[l],-1)&&(b=!0);;)if(l>0){if(1!=r.nodeType)break;{let x=r.childNodes[l-1];if(Vn(x,-1))d=r,f=--l;else{if(3!=x.nodeType)break;r=x,l=r.nodeValue.length}}}else{if(Tr(r))break;{let x=r.previousSibling;for(;x&&Vn(x,-1);)d=r.parentNode,f=ie(x),x=x.previousSibling;if(x)r=x,l=Zn(r);else{if(r=r.parentNode,r==t.dom)break;l=0}}}b?ar(t,r,l):d&&ar(t,d,f)}(t):function Er(t){let e=t.domSelectionRange(),r=e.focusNode,l=e.focusOffset;if(!r)return;let f,b,d=Zn(r);for(;;)if(l<d){if(1!=r.nodeType)break;if(!Vn(r.childNodes[l],1))break;f=r,b=++l}else{if(Tr(r))break;{let x=r.nextSibling;for(;x&&Vn(x,1);)f=x.parentNode,b=ie(x)+1,x=x.nextSibling;if(x)r=x,l=0,d=Zn(r);else{if(r=r.parentNode,r==t.dom)break;l=d=0}}}f&&ar(t,f,b)}(t)}function Tr(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function ar(t,e,r){if(3!=e.nodeType){let f,b;(b=function Qn(t,e){for(;t&&e==t.childNodes.length&&!Ne(t);)e=ie(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let r=t.childNodes[e];if(3==r.nodeType)return r;if(1==r.nodeType&&"false"==r.contentEditable)break;t=r,e=0}}(e,r))?(e=b,r=0):(f=function cn(t,e){for(;t&&!e&&!Ne(t);)e=ie(t),t=t.parentNode;for(;t&&e;){let r=t.childNodes[e-1];if(3==r.nodeType)return r;if(1==r.nodeType&&"false"==r.contentEditable)break;e=(t=r).childNodes.length}}(e,r))&&(e=f,r=f.nodeValue.length)}let l=t.domSelection();if(!l)return;if(xe(l)){let f=document.createRange();f.setEnd(e,r),f.setStart(e,r),l.removeAllRanges(),l.addRange(f)}else l.extend&&l.extend(e,r);t.domObserver.setCurSelection();let{state:d}=t;setTimeout(()=>{t.state==d&&vn(t)},50)}function Dr(t,e){let r=t.state.doc.resolve(e);if(!N&&!$&&r.parent.inlineContent){let d=t.coordsAtPos(e);if(e>r.start()){let f=t.coordsAtPos(e-1),b=(f.top+f.bottom)/2;if(b>d.top&&b<d.bottom&&Math.abs(f.left-d.left)>1)return f.left<d.left?"ltr":"rtl"}if(e<r.end()){let f=t.coordsAtPos(e+1),b=(f.top+f.bottom)/2;if(b>d.top&&b<d.bottom&&Math.abs(f.left-d.left)>1)return f.left>d.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function $n(t,e,r){let l=t.state.selection;if(l instanceof D.U3&&!l.empty||r.indexOf("s")>-1||Y&&r.indexOf("m")>-1)return!1;let{$from:d,$to:f}=l;if(!d.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let b=Cr(t.state,e);if(b&&b instanceof D.nh)return Mn(t,b)}if(!d.parent.inlineContent){let b=e<0?d:f,x=l instanceof D.i5?D.LN.near(b,e):D.LN.findFrom(b,e);return!!x&&Mn(t,x)}return!1}function un(t,e){if(!(t.state.selection instanceof D.U3))return!0;let{$head:r,$anchor:l,empty:d}=t.state.selection;if(!r.sameParent(l))return!0;if(!d)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let f=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(f&&!f.isText){let b=t.state.tr;return e<0?b.delete(r.pos-f.nodeSize,r.pos):b.delete(r.pos,r.pos+f.nodeSize),t.dispatch(b),!0}return!1}function dn(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function Cn(t,e){t.someProp("transformCopied",a=>{e=a(e,t)});let r=[],{content:l,openStart:d,openEnd:f}=e;for(;d>1&&f>1&&1==l.childCount&&1==l.firstChild.childCount;){d--,f--;let a=l.firstChild;r.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),l=a.content}let b=t.someProp("clipboardSerializer")||Ee.ZF.fromSchema(t.state.schema),x=jr(),A=x.createElement("div");A.appendChild(b.serializeFragment(l,{document:x}));let i,I=A.firstChild,n=0;for(;I&&1==I.nodeType&&(i=Hn[I.nodeName.toLowerCase()]);){for(let a=i.length-1;a>=0;a--){let u=x.createElement(i[a]);for(;A.firstChild;)u.appendChild(A.firstChild);A.appendChild(u),n++}I=A.firstChild}return I&&1==I.nodeType&&I.setAttribute("data-pm-slice",`${d} ${f}${n?` -${n}`:""} ${JSON.stringify(r)}`),{dom:A,text:t.someProp("clipboardTextSerializer",a=>a(e,t))||e.content.textBetween(0,e.content.size,"\n\n"),slice:e}}function Nr(t,e,r,l,d){let b,x,f=d.parent.type.spec.code;if(!r&&!e)return null;let A=e&&(l||f||!r);if(A){if(t.someProp("transformPastedText",o=>{e=o(e,f||l,t)}),f)return e?new Ee.Ji(Ee.FK.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):Ee.Ji.empty;let n=t.someProp("clipboardTextParser",o=>o(e,d,l,t));if(n)x=n;else{let o=d.marks(),{schema:a}=t.state,u=Ee.ZF.fromSchema(a);b=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(p=>{let y=b.appendChild(document.createElement("p"));p&&y.appendChild(u.serializeNode(a.text(p,o)))})}}else t.someProp("transformPastedHTML",n=>{r=n(r,t)}),b=function fn(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let d,r=jr().createElement("div"),l=/<([a-z][^>\s]+)/i.exec(t);if((d=l&&Hn[l[1].toLowerCase()])&&(t=d.map(f=>"<"+f+">").join("")+t+d.map(f=>"</"+f+">").reverse().join("")),r.innerHTML=function Ur(t){let e=window.trustedTypes;return e?(er||(er=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:r=>r})),er.createHTML(t)):t}(t),d)for(let f=0;f<d.length;f++)r=r.querySelector(d[f])||r;return r}(r),se&&function Jr(t){let e=t.querySelectorAll(N?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<e.length;r++){let l=e[r];1==l.childNodes.length&&"\xa0"==l.textContent&&l.parentNode&&l.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),l)}}(b);let I=b&&b.querySelector("[data-pm-slice]"),i=I&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(I.getAttribute("data-pm-slice")||"");if(i&&i[3])for(let n=+i[3];n>0;n--){let o=b.firstChild;for(;o&&1!=o.nodeType;)o=o.nextSibling;if(!o)break;b=o}if(x||(x=(t.someProp("clipboardParser")||t.someProp("domParser")||Ee.S4.fromSchema(t.state.schema)).parseSlice(b,{preserveWhitespace:!(!A&&!i),context:d,ruleFromNode:o=>"BR"!=o.nodeName||o.nextSibling||!o.parentNode||On.test(o.parentNode.nodeName)?null:{ignore:!0}})),i)x=function qr(t,e){if(!t.size)return t;let l,r=t.content.firstChild.type.schema;try{l=JSON.parse(e)}catch{return t}let{content:d,openStart:f,openEnd:b}=t;for(let x=l.length-2;x>=0;x-=2){let A=r.nodes[l[x]];if(!A||A.hasRequiredAttrs())break;d=Ee.FK.from(A.create(l[x+1],d)),f++,b++}return new Ee.Ji(d,f,b)}(dr(x,+i[1],+i[2]),i[4]);else if(x=Ee.Ji.maxOpen(function En(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let f,d=e.node(r).contentMatchAt(e.index(r)),b=[];if(t.forEach(x=>{if(!b)return;let I,A=d.findWrapping(x.type);if(!A)return b=null;if(I=b.length&&f.length&&ur(A,f,x,b[b.length-1],0))b[b.length-1]=I;else{b.length&&(b[b.length-1]=Pr(b[b.length-1],f.length));let i=Kn(x,A);b.push(i),d=d.matchType(i.type),f=A}}),b)return Ee.FK.from(b)}return t}(x.content,d),!0),x.openStart||x.openEnd){let n=0,o=0;for(let a=x.content.firstChild;n<x.openStart&&!a.type.spec.isolating;n++,a=a.firstChild);for(let a=x.content.lastChild;o<x.openEnd&&!a.type.spec.isolating;o++,a=a.lastChild);x=dr(x,n,o)}return t.someProp("transformPasted",n=>{x=n(x,t)}),x}const On=/^(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 Kn(t,e,r=0){for(let l=e.length-1;l>=r;l--)t=e[l].create(null,Ee.FK.from(t));return t}function ur(t,e,r,l,d){if(d<t.length&&d<e.length&&t[d]==e[d]){let f=ur(t,e,r,l.lastChild,d+1);if(f)return l.copy(l.content.replaceChild(l.childCount-1,f));if(l.contentMatchAt(l.childCount).matchType(d==t.length-1?r.type:t[d+1]))return l.copy(l.content.append(Ee.FK.from(Kn(r,t,d+1))))}}function Pr(t,e){if(0==e)return t;let r=t.content.replaceChild(t.childCount-1,Pr(t.lastChild,e-1)),l=t.contentMatchAt(t.childCount).fillBefore(Ee.FK.empty,!0);return t.copy(r.append(l))}function Rr(t,e,r,l,d,f){let b=e<0?t.firstChild:t.lastChild,x=b.content;return t.childCount>1&&(f=0),d<l-1&&(x=Rr(x,e,r,l,d+1,f)),d>=r&&(x=e<0?b.contentMatchAt(0).fillBefore(x,f<=d).append(x):x.append(b.contentMatchAt(b.childCount).fillBefore(Ee.FK.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,b.copy(x))}function dr(t,e,r){return e<t.openStart&&(t=new Ee.Ji(Rr(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),r<t.openEnd&&(t=new Ee.Ji(Rr(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}const Hn={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 Ir=null;function jr(){return Ir||(Ir=document.implementation.createHTMLDocument("title"))}let er=null;const zt={},Ht={},tr={touchstart:!0,touchmove:!0};class ii{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.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Rn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Wn(t){t.someProp("handleDOMEvents",e=>{for(let r in e)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=l=>nr(t,l))})}function nr(t,e){return t.someProp("handleDOMEvents",r=>{let l=r[e.type];return!!l&&(l(t,e)||e.defaultPrevented)})}function rr(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target;r!=t.dom;r=r.parentNode)if(!r||11==r.nodeType||r.pmViewDesc&&r.pmViewDesc.stopEvent(e))return!1;return!0}function fr(t){return{left:t.clientX,top:t.clientY}}function Xr(t,e,r,l,d){if(-1==l)return!1;let f=t.state.doc.resolve(l);for(let b=f.depth+1;b>0;b--)if(t.someProp(e,x=>b>f.depth?x(t,r,f.nodeAfter,f.before(b),d,!0):x(t,r,f.node(b),f.before(b),d,!1)))return!0;return!1}function In(t,e,r){if(t.focused||t.focus(),t.state.selection.eq(e))return;let l=t.state.tr.setSelection(e);"pointer"==r&&l.setMeta("pointer",!0),t.dispatch(l)}function li(t,e,r,l){return Xr(t,"handleDoubleClickOn",e,r,l)||t.someProp("handleDoubleClick",d=>d(t,e,l))}function Lr(t,e,r,l){return Xr(t,"handleTripleClickOn",e,r,l)||t.someProp("handleTripleClick",d=>d(t,e,l))||function ai(t,e,r){if(0!=r.button)return!1;let l=t.state.doc;if(-1==e)return!!l.inlineContent&&(In(t,D.U3.create(l,0,l.content.size),"pointer"),!0);let d=l.resolve(e);for(let f=d.depth+1;f>0;f--){let b=f>d.depth?d.nodeAfter:d.node(f),x=d.before(f);if(b.inlineContent)In(t,D.U3.create(l,x+1,x+1+b.content.size),"pointer");else{if(!D.nh.isSelectable(b))continue;In(t,D.nh.create(l,x),"pointer")}return!0}}(t,r,l)}function pr(t){return jn(t)}Ht.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=16==r.keyCode||r.shiftKey,!hr(t,r)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!Q||!N||13!=r.keyCode))if(229!=r.keyCode&&t.domObserver.forceFlush(),!ve||13!=r.keyCode||r.ctrlKey||r.altKey||r.metaKey)t.someProp("handleKeyDown",l=>l(t,r))||function Wr(t,e){let r=e.keyCode,l=function cr(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);if(8==r||Y&&72==r&&"c"==l)return un(t,-1)||Pn(t,-1);if(46==r&&!e.shiftKey||Y&&68==r&&"c"==l)return un(t,1)||Pn(t,1);if(13==r||27==r)return!0;if(37==r||Y&&66==r&&"c"==l){let d=37==r?"ltr"==Dr(t,t.state.selection.from)?-1:1:-1;return Or(t,d,l)||Pn(t,d)}if(39==r||Y&&70==r&&"c"==l){let d=39==r?"ltr"==Dr(t,t.state.selection.from)?1:-1:1;return Or(t,d,l)||Pn(t,d)}return 38==r||Y&&80==r&&"c"==l?$n(t,-1,l)||Pn(t,-1):40==r||Y&&78==r&&"c"==l?function Ar(t){if(!X||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&1==e.nodeType&&0==r&&e.firstChild&&"false"==e.firstChild.contentEditable){let l=e.firstChild;dn(t,l,"true"),setTimeout(()=>dn(t,l,"false"),20)}return!1}(t)||$n(t,1,l)||Pn(t,1):l==(Y?"m":"c")&&(66==r||73==r||89==r||90==r)}(t,r)?r.preventDefault():Rn(t,"key");else{let l=Date.now();t.input.lastIOSEnter=l,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==l&&(t.someProp("handleKeyDown",d=>d(t,Z(13,"Enter"))),t.input.lastIOSEnter=0)},200)}},Ht.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},Ht.keypress=(t,e)=>{let r=e;if(hr(t,r)||!r.charCode||r.ctrlKey&&!r.altKey||Y&&r.metaKey)return;if(t.someProp("handleKeyPress",d=>d(t,r)))return void r.preventDefault();let l=t.state.selection;if(!(l instanceof D.U3&&l.$from.sameParent(l.$to))){let d=String.fromCharCode(r.charCode),f=()=>t.state.tr.insertText(d).scrollIntoView();!/[\r\n]/.test(d)&&!t.someProp("handleTextInput",b=>b(t,l.$from.pos,l.$to.pos,d,f))&&t.dispatch(f()),r.preventDefault()}};const hi=Y?"metaKey":"ctrlKey";zt.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let l=pr(t),d=Date.now(),f="singleClick";d-t.input.lastClick.time<500&&function Gr(t,e){let r=e.x-t.clientX,l=e.y-t.clientY;return r*r+l*l<100}(r,t.input.lastClick)&&!r[hi]&&t.input.lastClick.button==r.button&&("singleClick"==t.input.lastClick.type?f="doubleClick":"doubleClick"==t.input.lastClick.type&&(f="tripleClick")),t.input.lastClick={time:d,x:r.clientX,y:r.clientY,type:f,button:r.button};let b=t.posAtCoords(fr(r));b&&("singleClick"==f?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new ci(t,b,r,!!l)):("doubleClick"==f?li:Lr)(t,b.pos,b.inside,r)?r.preventDefault():Rn(t,"pointer"))};class ci{constructor(e,r,l,d){let f,b;if(this.view=e,this.pos=r,this.event=l,this.flushed=d,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!l[hi],this.allowDefault=l.shiftKey,r.inside>-1)f=e.state.doc.nodeAt(r.inside),b=r.inside;else{let i=e.state.doc.resolve(r.pos);f=i.parent,b=i.depth?i.before():0}const x=d?null:l.target,A=x?e.docView.nearestDesc(x,!0):null;this.target=A&&1==A.dom.nodeType?A.dom:null;let{selection:I}=e.state;(0==l.button&&f.type.spec.draggable&&!1!==f.type.spec.selectable||I instanceof D.nh&&I.from<=b&&I.to>b)&&(this.mightDrag={node:f,pos:b,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!at||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Rn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>vn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(fr(e))),this.updateAllowDefault(e),this.allowDefault||!r?Rn(this.view,"pointer"):function Br(t,e,r,l,d){return Xr(t,"handleClickOn",e,r,l)||t.someProp("handleClick",f=>f(t,e,l))||(d?function Jt(t,e){if(-1==e)return!1;let l,d,r=t.state.selection;r instanceof D.nh&&(l=r.node);let f=t.state.doc.resolve(e);for(let b=f.depth+1;b>0;b--){let x=b>f.depth?f.nodeAfter:f.node(b);if(D.nh.isSelectable(x)){d=l&&r.$from.depth>0&&b>=r.$from.depth&&f.before(r.$from.depth+1)==r.$from.pos?f.before(r.$from.depth):f.before(b);break}}
1return null!=d&&(In(t,D.nh.create(t.state.doc,d),"pointer"),!0)}(t,r):function si(t,e){if(-1==e)return!1;let r=t.state.doc.resolve(e),l=r.nodeAfter;return!!(l&&l.isAtom&&D.nh.isSelectable(l))&&(In(t,new D.nh(r),"pointer"),!0)}(t,r))}(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||X&&this.mightDrag&&!this.mightDrag.node.isAtom||N&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(In(this.view,D.LN.near(this.view.state.doc.resolve(r.pos)),"pointer"),e.preventDefault()):Rn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Rn(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function hr(t,e){return!!t.composing||!!(X&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}zt.touchstart=t=>{t.input.lastTouch=Date.now(),pr(t),Rn(t,"pointer")},zt.touchmove=t=>{t.input.lastTouch=Date.now(),Rn(t,"pointer")},zt.contextmenu=t=>pr(t);const ir=Q?5e3:-1;function or(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>jn(t),e))}function mr(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function Fr(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function jn(t,e=!1){if(!(Q&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),mr(t),e||t.docView&&t.docView.dirty){let r=_n(t),l=t.state.selection;return r&&!r.eq(l)?t.dispatch(t.state.tr.setSelection(r)):!t.markCursor&&!e||l.$from.node(l.$from.sharedDepth(l.to)).inlineContent?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0}return!1}}Ht.compositionstart=Ht.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$to;if(e.selection instanceof D.U3&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(l=>!1===l.type.spec.inclusive)))t.markCursor=t.state.storedMarks||r.marks(),jn(t,!0),t.markCursor=null;else if(jn(t,!e.selection.empty),at&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let l=t.domSelectionRange();for(let d=l.focusNode,f=l.focusOffset;d&&1==d.nodeType&&0!=f;){let b=f<0?d.lastChild:d.childNodes[f-1];if(!b)break;if(3==b.nodeType){let x=t.domSelection();x&&x.collapse(b,b.nodeValue.length);break}d=b,f=-1}}t.input.composing=!0}or(t,ir)},Ht.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,or(t,20))};const Un=rt&&yt<15||ve&&ge<604;function sr(t,e,r,l,d){let f=Nr(t,e,r,l,t.state.selection.$from);if(t.someProp("handlePaste",A=>A(t,d,f||Ee.Ji.empty)))return!0;if(!f)return!1;let b=function Tn(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(f),x=b?t.state.tr.replaceSelectionWith(b,l):t.state.tr.replaceSelection(f);return t.dispatch(x.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function di(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let r=t.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}zt.copy=Ht.cut=(t,e)=>{let r=e,l=t.state.selection,d="cut"==r.type;if(l.empty)return;let f=Un?null:r.clipboardData,b=l.content(),{dom:x,text:A}=Cn(t,b);f?(r.preventDefault(),f.clearData(),f.setData("text/html",x.innerHTML),f.setData("text/plain",A)):function gr(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let l=getSelection(),d=document.createRange();d.selectNodeContents(e),t.dom.blur(),l.removeAllRanges(),l.addRange(d),setTimeout(()=>
1{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}(t,x),d&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Ht.paste=(t,e)=>{let r=e;if(t.composing&&!Q)return;let l=Un?null:r.clipboardData,d=t.input.shiftKey&&45!=t.input.lastKeyCode;l&&sr(t,di(l),l.getData("text/html"),d,r)?r.preventDefault():function mi(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,l=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(l.contentEditable="true"),l.style.cssText="position: fixed; left: -10000px; top: 10px",l.focus();let d=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout(()=>{t.focus(),l.parentNode&&l.parentNode.removeChild(l),r?sr(t,l.value,null,d,e):sr(t,l.textContent,l.innerHTML,d,e)},50)}(t,r)};class yr{constructor(e,r,l){this.slice=e,this.move=r,this.node=l}}const vi=Y?"altKey":"ctrlKey";function br(t,e){return t.someProp("dragCopies",l=>!l(e))??!e[vi]}zt.dragstart=(t,e)=>{let r=e,l=t.input.mouseDown;if(l&&l.done(),!r.dataTransfer)return;let b,d=t.state.selection,f=d.empty?null:t.posAtCoords(fr(r));if(!(f&&f.pos>=d.from&&f.pos<=(d instanceof D.nh?d.to-1:d.to)))if(l&&l.mightDrag)b=D.nh.create(t.state.doc,l.mightDrag.pos);else if(r.target&&1==r.target.nodeType){let n=t.docView.nearestDesc(r.target,!0);n&&n.node.type.spec.draggable&&n!=t.docView&&(b=D.nh.create(t.state.doc,n.posBefore))}let x=(b||t.state.selection).content(),{dom:A,text:I,slice:i}=Cn(t,x);(!r.dataTransfer.files.length||!N||J>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(Un?"Text":"text/html",A.innerHTML),r.dataTransfer.effectAllowed="copyMove",Un||r.dataTransfer.setData("text/plain",I),t.dragging=new yr(i,br(t,r),b)},zt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},Ht.dragover=Ht.dragenter=(t,e)=>e.preventDefault(),Ht.drop=(t,e)=>{let r=e,l=t.dragging;if(t.dragging=null,!r.dataTransfer)return;let d=t.posAtCoords(fr(r));if(!d)return;let f=t.state.doc.resolve(d.pos),b=l&&l.slice;b?t.someProp("transformPasted",u=>{b=u(b,t)}):b=Nr(t,di(r.dataTransfer),Un?null:r.dataTransfer.getData("text/html"),!1,f);let x=!(!l||!br(t,r));if(t.someProp("handleDrop",u=>u(t,r,b||Ee.Ji.empty,x)))return void r.preventDefault();if(!b)return;r.preventDefault();let A=b?(0,ye.Um)(t.state.doc,f.pos,b):f.pos;null==A&&(A=f.pos);let I=t.state.tr;if(x){let{node:u}=l;u?u.replace(I):I.deleteSelection()}let i=I.mapping.map(A),n=0==b.openStart&&0==b.openEnd&&1==b.content.childCount,o=I.doc;if(n?I.replaceRangeWith(i,i,b.content.firstChild):I.replaceRange(i,i,b),I.doc.eq(o))return;let a=I.doc.resolve(i);if(n&&D.nh.isSelectable(b.content.firstChild)&&a.nodeAfter&&a.nodeAfter.sameMarkup(b.content.firstChild))I.setSelection(new D.nh(a));else{let u=I.mapping.map(A);I.mapping.maps[I.mapping.maps.length-1].forEach((p,y,S,E)=>u=E),I.setSelection(Mr(t,a,I.doc.resolve(u)))}t.focus(),t.dispatch(I.setMeta("uiEvent","drop"))},zt.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())&&vn(t)},20))},zt.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},zt.beforeinput=(t,e)=>{if(N&&Q&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:l}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=l||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",f=>f(t,Z(8,"Backspace")))))return;let{$cursor:d}=t.state.selection;d&&d.pos>0&&t.dispatch(t.state.tr.delete(d.pos-1,d.pos).scrollIntoView())},50)}};for(let t in Ht)zt[t]=Ht[t];function Bn(t,e){if(t==e)return!0;for(let r in t)if(t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}class Jn{constructor(e,r){this.toDOM=e,this.spec=r||qn,this.side=this.spec.side||0}map(e,r,l,d){let{pos:f,deleted:b}=e.mapResult(r.from+d,this.side<0?-1:1);return b?null:new Gt(f-l,f-l,this)}valid(){return!0}eq(e){return this==e||e instanceof Jn&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Bn(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class pn{constructor(e,r){this.attrs=e,this.spec=r||qn}map(e,r,l,d){let f=e.map(r.from+d,this.spec.inclusiveStart?-1:1)-l,b=e.map(r.to+d,this.spec.inclusiveEnd?1:-1)-l;return f>=b?null:new Gt(f,b,this)}valid(e,r){return r.from<r.to}eq(e){return this==e||e instanceof pn&&Bn(this.attrs,e.attrs)&&Bn(this.spec,e.spec)}static is(e){return e.type instanceof pn}destroy(){}}class _r{constructor(e,r){this.attrs=e,this.spec=r||qn}map(e,r,l,d){let f=e.mapResult(r.from+d,1);if(f.deleted)return null;let b=e.mapResult(r.to+d,-1);return b.deleted||b.pos<=f.pos?null:new Gt(f.pos-l,b.pos-l,this)}valid(e,r){let f,{index:l,offset:d}=e.content.findIndex(r.from);return d==r.from&&!(f=e.child(l)).isText&&d+f.nodeSize==r.to}eq(e){return this==e||e instanceof _r&&Bn(this.attrs,e.attrs)&&Bn(this.spec,e.spec)}destroy(){}}class Gt{constructor(e,r,l){this.from=e,this.to=r,this.type=l}copy(e,r){return new Gt(e,r,this.type)}eq(e,r=0){return this.type.eq(e.type)&&this.from+r==e.from&&this.to+r==e.to}map(e,r,l){return this.type.map(e,this,r,l)}static widget(e,r,l){return new Gt(e,e,new Jn(r,l))}static inline(e,r,l,d){return new Gt(e,r,new pn(l,d))}
vendor: 10,316 bytes, line 1
1static node(e,r,l,d){return new Gt(e,r,new _r(l,d))}get spec(){return this.type.spec}get inline(){return this.type instanceof pn}get widget(){return this.type instanceof Jn}}const kn=[],qn={};class It{constructor(e,r){this.local=e.length?e:kn,this.children=r.length?r:kn}static create(e,r){return r.length?O(r,e,0,qn):Vt}find(e,r,l){let d=[];return this.findInner(e??0,r??1e9,d,0,l),d}findInner(e,r,l,d,f){for(let b=0;b<this.local.length;b++){let x=this.local[b];x.from<=r&&x.to>=e&&(!f||f(x.spec))&&l.push(x.copy(x.from+d,x.to+d))}for(let b=0;b<this.children.length;b+=3)if(this.children[b]<r&&this.children[b+1]>e){let x=this.children[b]+1;this.children[b+2].findInner(e-x,r-x,l,d+x,f)}}map(e,r,l){return this==Vt||0==e.maps.length?this:this.mapInner(e,r,0,0,l||qn)}mapInner(e,r,l,d,f){let b;for(let x=0;x<this.local.length;x++){let A=this.local[x].map(e,l,d);A&&A.type.valid(r,A)?(b||(b=[])).push(A):f.onRemove&&f.onRemove(this.local[x].spec)}return this.children.length?function gi(t,e,r,l,d,f,b){let x=t.slice();for(let I=0,i=f;I<r.maps.length;I++){let n=0;r.maps[I].forEach((o,a,u,p)=>{let y=p-u-(a-o);for(let S=0;S<x.length;S+=3){let E=x[S+1];if(E<0||o>E+i-n)continue;let B=x[S]+i-n;a>=B?x[S+1]=o<=B?-2:-1:o>=i&&y&&(x[S]+=y,x[S+1]+=y)}n+=y}),i=r.maps[I].map(i,-1)}let A=!1;for(let I=0;I<x.length;I+=3)if(x[I+1]<0){if(-2==x[I+1]){A=!0,x[I+1]=-1;continue}let i=r.map(t[I]+f),n=i-d;if(n<0||n>=l.content.size){A=!0;continue}let a=r.map(t[I+1]+f,-1)-d,{index:u,offset:p}=l.content.findIndex(n),y=l.maybeChild(u);if(y&&p==n&&p+y.nodeSize==a){let S=x[I+2].mapInner(r,y,i+1,t[I]+f+1,b);S!=Vt?(x[I]=n,x[I+1]=a,x[I+2]=S):(x[I+1]=-2,A=!0)}else A=!0}if(A){let I=function fi(t,e,r,l,d,f,b){function x(A,I){for(let i=0;i<A.local.length;i++){let n=A.local[i].map(l,d,I);n?r.push(n):b.onRemove&&b.onRemove(A.local[i].spec)}for(let i=0;i<A.children.length;i+=3)x(A.children[i+2],A.children[i]+I+1)}for(let A=0;A<t.length;A+=3)-1==t[A+1]&&x(t[A+2],e[A]+f+1);return r}(x,t,e,r,d,f,b),i=O(I,l,0,b);e=i.local;for(let n=0;n<x.length;n+=3)x[n+1]<0&&(x.splice(n,3),n-=3);for(let n=0,o=0;n<i.children.length;n+=3){let a=i.children[n];for(;o<x.length&&x[o]<a;)o+=3;x.splice(o,0,i.children[n],i.children[n+1],i.children[n+2])}}return new It(e.sort(V),x)}(this.children,b||[],e,r,l,d,f):b?new It(b.sort(V),kn):Vt}add(e,r){return r.length?this==Vt?It.create(e,r):this.addInner(e,r,0):this}addInner(e,r,l){let d,f=0;e.forEach((x,A)=>{let i,I=A+l;if(i=v(r,x,I)){for(d||(d=this.children.slice());f<d.length&&d[f]<A;)f+=3;d[f]==A?d[f+2]=d[f+2].addInner(x,i,I+1):d.splice(f,0,A,A+x.nodeSize,O(i,x,I+1,qn)),f+=3}});let b=zr(f?k(r):r,-l);for(let x=0;x<b.length;x++)b[x].type.valid(e,b[x])||b.splice(x--,1);return new It(b.length?this.local.concat(b).sort(V):this.local,d||this.children)}remove(e){return 0==e.length||this==Vt?this:this.removeInner(e,0)}removeInner(e,r){let l=this.children,d=this.local;for(let f=0;f<l.length;f+=3){let b,x=l[f]+r,A=l[f+1]+r;for(let n,i=0;i<e.length;i++)(n=e[i])&&n.from>x&&n.to<A&&(e[i]=null,(b||(b=[])).push(n));if(!b)continue;l==this.children&&(l=this.children.slice());let I=l[f+2].removeInner(b,x+1);I!=Vt?l[f+2]=I:(l.splice(f,3),f-=3)}if(d.length)for(let b,f=0;f<e.length;f++)if(b=e[f])for(let x=0;x<d.length;x++)d[x].eq(b,r)&&(d==this.local&&(d=this.local.slice()),d.splice(x--,1));return l==this.children&&d==this.local?this:d.length||l.length?new It(d,l):Vt}forChild(e,r){if(this==Vt)return this;if(r.isLeaf)return It.empty;let l,d;for(let x=0;x<this.children.length;x+=3)if(this.children[x]>=e){this.children[x]==e&&(l=this.children[x+2]);break}let f=e+1,b=f+r.content.size;for(let x=0;x<this.local.length;x++){let A=this.local[x];if(A.from<b&&A.to>f&&A.type instanceof pn){let I=Math.max(f,A.from)-f,i=Math.min(b,A.to)-f;I<i&&(d||(d=[])).push(A.copy(I,i))}}if(d){let x=new It(d.sort(V),kn);return l?new Ln([x,l]):x}return l||Vt}eq(e){if(this==e)return!0;if(!(e instanceof It)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let r=0;r<this.local.length;r++)if(!this.local[r].eq(e.local[r]))return!1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=e.children[r]||this.children[r+1]!=e.children[r+1]||!this.children[r+2].eq(e.children[r+2]))return!1;return!0}locals(e){return q(this.localsInner(e))}localsInner(e){if(this==Vt)return kn;if(e.inlineContent||!this.local.some(pn.is))return this.local;let r=[];for(let l=0;l<this.local.length;l++)this.local[l].type instanceof pn||r.push(this.local[l]);return r}forEachSet(e){e(this)}}It.empty=new It([],[]),It.removeOverlap=q;const Vt=It.empty;class Ln{constructor(e){this.members=e}map(e,r){const l=this.members.map(d=>d.map(e,r,qn));return Ln.from(l)}forChild(e,r){if(r.isLeaf)return It.empty;let l=[];for(let d=0;d<this.members.length;d++){let f=this.members[d].forChild(e,r);f!=Vt&&(f instanceof Ln?l=l.concat(f.members):l.push(f))}return Ln.from(l)}eq(e){if(!(e instanceof Ln)||e.members.length!=this.members.length)return!1;for(let r=0;r<this.members.length;r++)if(!this.members[r].eq(e.members[r]))return!1;return!0}locals(e){let r,l=!0;for(let d=0;d<this.members.length;d++){let f=this.members[d].localsInner(e);if(f.length)if(r){l&&(r=r.slice(),l=!1);for(let b=0;b<f.length;b++)r.push(f[b])}else r=f}return r?q(l?r:r.sort(V)):kn}static from(e){switch(e.length){case 0:return Vt;case 1:return e[0];default:return new Ln(e.every(r=>r instanceof It)?e:e.reduce((r,l)=>r.concat(l instanceof It?l:l.members),[]))}}forEachSet(e){for(let r=0;r<this.members.length;r++)this.members[r].forEachSet(e)}}function zr(t,e){if(!e||!t.length)return t;let r=[];for(let l=0;l<t.length;l++){let d=t[l];r.push(new Gt(d.from+e,d.to+e,d.type))}return r}function v(t,e,r){if(e.isLeaf)return null;let l=r+e.nodeSize,d=null;for(let b,f=0;f<t.length;f++)(b=t[f])&&b.from>r&&b.to<l&&((d||(d=[])).push(b),t[f]=null);return d}function k(t){let e=[];for(let r=0;r<t.length;r++)null!=t[r]&&e.push(t[r]);return e}function O(t,e,r,l){let d=[],f=!1;e.forEach((x,A)=>{let I=v(t,x,A+r);if(I){f=!0;let i=O(I,x,r+A+1,l);i!=Vt&&d.push(A,A+x.nodeSize,i)}});let b=zr(f?k(t):t,-r).sort(V);for(let x=0;x<b.length;x++)b[x].type.valid(e,b[x])||(l.onRemove&&l.onRemove(b[x].spec),b.splice(x--,1));return b.length||d.length?new It(b,d):Vt}function V(t,e){return t.from-e.from||t.to-e.to}function q(t){let e=t;for(let r=0;r<e.length-1;r++){let l=e[r];if(l.from!=l.to)for(let d=r+1;d<e.length;d++){let f=e[d];if(f.from!=l.from){f.from<l.to&&(e==t&&(e=t.slice()),e[r]=l.copy(l.from,f.from),te(e,d,l.copy(f.from,l.to)));break}f.to!=l.to&&(e==t&&(e=t.slice()),e[d]=f.copy(f.from,l.to),te(e,d+1,f.copy(l.to,f.to)))}}return e}function te(t,e,r){for(;e<t.length&&V(r,t[e])>0;)e++;t.splice(e,0,r)}function ae(t){let e=[];return t.someProp("decorations",r=>{let l=r(t.state);l&&l!=Vt&&e.push(l)}),t.cursorWrapper&&e.push(It.create(t.state.doc,[t.cursorWrapper.deco])),Ln.from(e)}const ce={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ue=rt&&yt<=11;class Re{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class be{constructor(e,r){this.view=e,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Re,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(l=>{for(let d=0;d<l.length;d++)this.queue.push(l[d]);rt&&yt<=11&&l.some(d=>"childList"==d.type&&d.removedNodes.length||"characterData"==d.type&&d.oldValue.length>d.target.nodeValue.length)?this.flushSoon():this.flush()}),ue&&(this.onCharData=l=>{this.queue.push({target:l.target,type:"characterData",oldValue:l.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,ce)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let r=0;r<e.length;r++)this.queue.push(e[r]);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(ni(this.view)){if(this.suppressingSelectionUpdates)return vn(this.view);if(rt&&yt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ae(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let l,r=new Set;for(let f=e.focusNode;f;f=ne(f))r.add(f);for(let f=e.anchorNode;f;f=ne(f))if(r.has(f)){l=f;break}let d=l&&this.view.docView.nearestDesc(l);return d&&d.ignoreMutation({type:"selection",target:3==l.nodeType?l.parentNode:l})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let l=e.domSelectionRange(),d=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(l)&&ni(e)&&!this.ignoreSelectionChange(l),f=-1,b=-1,x=!1,A=[];if(e.editable)for(let i=0;i<r.length;i++){let n=this.registerMutation(r[i],A);
vendor: 5,510 bytes, line 1
1n&&(f=f<0?n.from:Math.min(n.from,f),b=b<0?n.to:Math.max(n.to,b),n.typeOver&&(x=!0))}if(at&&A.length){let i=A.filter(n=>"BR"==n.nodeName);if(2==i.length){let[n,o]=i;n.parentNode&&n.parentNode.parentNode==o.parentNode?o.remove():n.remove()}else{let{focusNode:n}=this.currentSelection;for(let o of i){let a=o.parentNode;a&&"LI"==a.nodeName&&(!n||We(e,n)!=a)&&o.remove()}}}let I=null;f<0&&d&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&xe(l)&&(I=_n(e))&&I.eq(D.LN.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,vn(e),this.currentSelection.set(l),e.scrollToSelection()):(f>-1||d)&&(f>-1&&(e.docView.markDirty(f,b),function Ye(t){if(!nt.has(t)&&(nt.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))){if(t.requiresGeckoHackNode=at,et)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."),et=!0}}(e)),this.handleDOMChange(f,b,x,A),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(l)||vn(e),this.currentSelection.set(l))}registerMutation(e,r){if(r.indexOf(e.target)>-1)return null;let l=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(l==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!l||l.ignoreMutation(e))return null;if("childList"==e.type){for(let i=0;i<e.addedNodes.length;i++){let n=e.addedNodes[i];r.push(n),3==n.nodeType&&(this.lastChangedTextNode=n)}if(l.contentDOM&&l.contentDOM!=l.dom&&!l.contentDOM.contains(e.target))return{from:l.posBefore,to:l.posAfter};let d=e.previousSibling,f=e.nextSibling;if(rt&&yt<=11&&e.addedNodes.length)for(let i=0;i<e.addedNodes.length;i++){let{previousSibling:n,nextSibling:o}=e.addedNodes[i];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(d=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(f=o)}let b=d&&d.parentNode==e.target?ie(d)+1:0,x=l.localPosFromDOM(e.target,b,-1),A=f&&f.parentNode==e.target?ie(f):e.target.childNodes.length;return{from:x,to:l.localPosFromDOM(e.target,A,1)}}return"attributes"==e.type?{from:l.posAtStart-l.border,to:l.posAtEnd+l.border}:(this.lastChangedTextNode=e.target,{from:l.posAtStart,to:l.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let nt=new WeakMap,et=!1;function Ge(t,e){let r=e.startContainer,l=e.startOffset,d=e.endContainer,f=e.endOffset,b=t.domAtPos(t.state.selection.anchor);return Ae(b.node,b.offset,d,f)&&([r,l,d,f]=[d,f,r,l]),{anchorNode:r,anchorOffset:l,focusNode:d,focusOffset:f}}function We(t,e){for(let r=e.parentNode;r&&r!=t.dom;r=r.parentNode){let l=t.docView.nearestDesc(r,!0);if(l&&l.node.isBlock)return r}return null}function tt(t){let e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(X&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}if(t.parentNode.lastChild==t||X&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const lt=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Je(t,e,r){return Math.max(r.anchor,r.head)>e.content.size?null:Mr(t,e.resolve(r.anchor),e.resolve(r.head))}function pt(t,e,r){let l=t.depth,d=e?t.end():t.pos;for(;l>0&&(e||t.indexAfter(l)==t.node(l).childCount);)l--,d++,e=!1;if(r){let f=t.node(l).maybeChild(t.indexAfter(l));for(;f&&!f.isLeaf;)f=f.firstChild,d++}return d}function kt(t){if(2!=t.length)return!1;let e=t.charCodeAt(0),r=t.charCodeAt(1);return e>=56320&&e<=57343&&r>=55296&&r<=56319}class gt{constructor(e,r){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 ii,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(mn),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=_t(this),qt(this),this.nodeViews=Lt(this),this.docView=s(this.state.doc,Ft(this),ae(this),this.dom,this),this.domObserver=new be(this,(l,d,f,b)=>function z(t,e,r,l,d){let f=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let ee=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,re=_n(t,ee);if(re&&!t.state.selection.eq(re)){if(N&&Q&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",Ce=>Ce(t,Z(13,"Enter"))))return;let pe=t.state.tr.setSelection(re);"pointer"==ee?pe.setMeta("pointer",!0):"key"==ee&&pe.scrollIntoView(),f&&pe.setMeta("composition",f),t.dispatch(pe)}return}let b=t.state.doc.resolve(e),x=b.sharedDepth(r);e=b.before(x+1),r=t.state.doc.resolve(r).after(x+1);let o,a,A=t.state.selection,I=function Be(t,e,r){let I,{node:l,fromOffset:d,toOffset:f,from:b,to:x}=t.docView.parseRange(e,r),A=t.domSelectionRange(),i=A.anchorNode;if(i&&t.dom.contains(1==i.nodeType?i:i.parentNode)&&(I=[{node:i,offset:A.anchorOffset}
vendor: 1,384 bytes, line 1
1],xe(A)||I.push({node:A.focusNode,offset:A.focusOffset})),N&&8===t.input.lastKeyCode)for(let y=f;y>d;y--){let S=l.childNodes[y-1],E=S.pmViewDesc;if("BR"==S.nodeName&&!E){f=y;break}if(!E||E.size)break}let n=t.state.doc,o=t.someProp("domParser")||Ee.S4.fromSchema(t.state.schema),a=n.resolve(b),u=null,p=o.parse(l,{topNode:a.parent,topMatch:a.parent.contentMatchAt(a.index()),topOpen:!0,from:d,to:f,preserveWhitespace:"pre"!=a.parent.type.whitespace||"full",findPositions:I,ruleFromNode:tt,context:a});if(I&&null!=I[0].pos){let y=I[0].pos,S=I[1]&&I[1].pos;null==S&&(S=y),u={anchor:y+b,head:S+b}}return{doc:p,sel:u,from:b,to:x}}(t,e,r),i=t.state.doc,n=i.slice(I.from,I.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(o=t.state.selection.to,a="end"):(o=t.state.selection.from,a="start"),t.input.lastKeyCode=null;let u=function vt(t,e,r,l,d){let f=t.findDiffStart(e,r);if(null==f)return null;let{a:b,b:x}=t.findDiffEnd(e,r+t.size,r+e.size);if("end"==d&&(l-=b+Math.max(0,f-Math.min(b,x))-f),b<f&&t.size<e.size){let A=l<=f&&l>=b?f-l:0;f-=A,f&&f<e.size&&kt(e.textBetween(f-1,f+1))&&(f+=A?1:-1),x=f+(x-b),b=f}else if(x<f){let A=l<=f&&l>=x?f-l:0;f-=A,f&&f<t.size&&kt(t.textBetween(f-1,f+1))&&(f+=A?1:-1),b=f+(b-x),x=f}return{start:f,endA:b,endB:x}}(n.content,I.doc.content,I.from,o,a);if(u&&t.input.domChangeCount++,(ve&&t.input.lastIOSEnter>Date.now()-225||Q)&&d.some(ee=>
vendor: 14,987 bytes, line 1
11==ee.nodeType&&!lt.test(ee.nodeName))&&(!u||u.endA>=u.endB)&&t.someProp("handleKeyDown",ee=>ee(t,Z(13,"Enter"))))return void(t.input.lastIOSEnter=0);if(!u){if(!(l&&A instanceof D.U3&&!A.empty&&A.$head.sameParent(A.$anchor))||t.composing||I.sel&&I.sel.anchor!=I.sel.head){if(I.sel){let ee=Je(t,t.state.doc,I.sel);if(ee&&!ee.eq(t.state.selection)){let re=t.state.tr.setSelection(ee);f&&re.setMeta("composition",f),t.dispatch(re)}}return}u={start:A.from,endA:A.to,endB:A.to}}t.state.selection.from<t.state.selection.to&&u.start==u.endB&&t.state.selection instanceof D.U3&&(u.start>t.state.selection.from&&u.start<=t.state.selection.from+2&&t.state.selection.from>=I.from?u.start=t.state.selection.from:u.endA<t.state.selection.to&&u.endA>=t.state.selection.to-2&&t.state.selection.to<=I.to&&(u.endB+=t.state.selection.to-u.endA,u.endA=t.state.selection.to)),rt&&yt<=11&&u.endB==u.start+1&&u.endA==u.start&&u.start>I.from&&" \xa0"==I.doc.textBetween(u.start-I.from-1,u.start-I.from+1)&&(u.start--,u.endA--,u.endB--);let B,p=I.doc.resolveNoCache(u.start-I.from),y=I.doc.resolveNoCache(u.endB-I.from),S=i.resolve(u.start),E=p.sameParent(y)&&p.parent.inlineContent&&S.end()>=u.endA;if((ve&&t.input.lastIOSEnter>Date.now()-225&&(!E||d.some(ee=>"DIV"==ee.nodeName||"P"==ee.nodeName))||!E&&p.pos<I.doc.content.size&&(!p.sameParent(y)||!p.parent.inlineContent)&&!/\S/.test(I.doc.textBetween(p.pos,y.pos,"",""))&&(B=D.LN.findFrom(I.doc.resolve(p.pos+1),1,!0))&&B.head>p.pos)&&t.someProp("handleKeyDown",ee=>ee(t,Z(13,"Enter"))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>u.start&&function ut(t,e,r,l,d){if(r-e<=d.pos-l.pos||pt(l,!0,!1)<d.pos)return!1;let f=t.resolve(e);if(!l.parent.isTextblock){let x=f.nodeAfter;return null!=x&&r==e+x.nodeSize}if(f.parentOffset<f.parent.content.size||!f.parent.isTextblock)return!1;let b=t.resolve(pt(f,!0,!0));return!(!b.parent.isTextblock||b.pos>r||pt(b,!0,!1)<r)&&l.parent.content.cut(l.parentOffset).eq(b.parent.content)}(i,u.start,u.endA,p,y)&&t.someProp("handleKeyDown",ee=>ee(t,Z(8,"Backspace"))))return void(Q&&N&&t.domObserver.suppressSelectionUpdates());N&&u.endB==u.start&&(t.input.lastChromeDelete=Date.now()),Q&&!E&&p.start()!=y.start()&&0==y.parentOffset&&p.depth==y.depth&&I.sel&&I.sel.anchor==I.sel.head&&I.sel.head==u.endA&&(u.endB-=2,y=I.doc.resolveNoCache(u.endB-I.from),setTimeout(()=>{t.someProp("handleKeyDown",function(ee){return ee(t,Z(13,"Enter"))})},20));let j,L=u.start,_=u.endA,W=ee=>{let re=ee||t.state.tr.replace(L,_,I.doc.slice(u.start-I.from,u.endB-I.from));if(I.sel){let pe=Je(t,re.doc,I.sel);pe&&!(N&&t.composing&&pe.empty&&(u.start!=u.endB||t.input.lastChromeDelete<Date.now()-100)&&(pe.head==L||pe.head==re.mapping.map(_)-1)||rt&&pe.empty&&pe.head==L)&&re.setSelection(pe)}return f&&re.setMeta("composition",f),re.scrollIntoView()};if(E){if(p.pos==y.pos){rt&&yt<=11&&0==p.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>vn(t),20));let ee=W(t.state.tr.delete(L,_)),re=i.resolve(u.start).marksAcross(i.resolve(u.endA));re&&ee.ensureMarks(re),t.dispatch(ee)}else if(u.endA==u.endB&&(j=function Le(t,e){let b,x,A,r=t.firstChild.marks,l=e.firstChild.marks,d=r,f=l;for(let i=0;i<l.length;i++)d=l[i].removeFromSet(d);for(let i=0;i<r.length;i++)f=r[i].removeFromSet(f);if(1==d.length&&0==f.length)x=d[0],b="add",A=i=>i.mark(x.addToSet(i.marks));else{if(0!=d.length||1!=f.length)return null;x=f[0],b="remove",A=i=>i.mark(x.removeFromSet(i.marks))}let I=[];for(let i=0;i<e.childCount;i++)I.push(A(e.child(i)));if(Ee.FK.from(I).eq(t))return{mark:x,type:b}}(p.parent.content.cut(p.parentOffset,y.parentOffset),S.parent.content.cut(S.parentOffset,u.endA-S.start())))){let ee=W(t.state.tr);"add"==j.type?ee.addMark(L,_,j.mark):ee.removeMark(L,_,j.mark),t.dispatch(ee)}else if(p.parent.child(p.index()).isText&&p.index()==y.index()-(y.textOffset?0:1)){let ee=p.parent.textBetween(p.parentOffset,y.parentOffset),re=()=>W(t.state.tr.insertText(ee,L,_));t.someProp("handleTextInput",pe=>pe(t,L,_,ee,re))||t.dispatch(re())}}else t.dispatch(W())}(this,l,d,f,b)),this.domObserver.start(),function oi(t){for(let e in zt){let r=zt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=l=>{rr(t,l)&&!nr(t,l)&&(t.editable||!(l.type in Ht))&&r(t,l)},tr[e]?{passive:!0}:void 0)}X&&t.dom.addEventListener("input",()=>null),Wn(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let r in e)this._props[r]=e[r];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Wn(this);let r=this._props;this._props=e,e.plugins&&(e.plugins.forEach(mn),this.directPlugins=e.plugins),this.updateStateInner(e.state,r)}setProps(e){let r={};for(let l in this._props)r[l]=this._props[l];r.state=this.state;for(let l in e)r[l]=e[l];this.update(r)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,r){var l;let d=this.state,f=!1,b=!1;e.storedMarks&&this.composing&&(mr(this),b=!0),this.state=e;let x=d.plugins!=e.plugins||this._props.plugins!=r.plugins;if(x||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let a=Lt(this);(function hn(t,e){let r=0,l=0;for(let d in t){if(t[d]!=e[d])return!0;r++}for(let d in e)l++;return r!=l})(a,this.nodeViews)&&(this.nodeViews=a,f=!0)}(x||r.handleDOMEvents!=this._props.handleDOMEvents)&&Wn(this),this.editable=_t(this),qt(this);let A=ae(this),I=Ft(this),i=d.plugins==e.plugins||d.doc.eq(e.doc)?e.scrollToSelection>d.scrollToSelection?"to selection":"preserve":"reset",n=f||!this.docView.matchesNode(e.doc,I,A);(n||!e.selection.eq(d.selection))&&(b=!0);let o="preserve"==i&&b&&null==this.dom.style.overflowAnchor&&function Ot(t){let l,d,e=t.dom.getBoundingClientRect(),r=Math.max(0,e.top);for(let f=(e.left+e.right)/2,b=r+1;b<Math.min(innerHeight,e.bottom);b+=5){let x=t.root.elementFromPoint(f,b);if(!x||x==t.dom||!t.dom.contains(x))continue;let A=x.getBoundingClientRect();if(A.top>=r-20){l=x,d=A.top;break}}return{refDOM:l,refTop:d,stack:St(t.dom)}}(this);if(b){this.domObserver.stop();let a=n&&(rt||N)&&!this.composing&&!d.selection.empty&&!e.selection.empty&&function $t(t,e){let r=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(r)!=e.$anchor.start(r)}(d.selection,e.selection);if(n){let u=N?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function ui(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let r=function Xe(t,e){for(;;){if(3==t.nodeType&&e)return t;if(1==t.nodeType&&e>0){if("false"==t.contentEditable)return null;e=De(t=t.childNodes[e-1])}else{if(!t.parentNode||Ne(t))return null;e=ie(t),t=t.parentNode}}}(e.focusNode,e.focusOffset),l=function Qe(t,e){for(;;){if(3==t.nodeType&&e<t.nodeValue.length)return t;if(1==t.nodeType&&e<t.childNodes.length){if("false"==t.contentEditable)return null;t=t.childNodes[e],e=0}else{if(!t.parentNode||Ne(t))return null;e=ie(t)+1,t=t.parentNode}}}(e.focusNode,e.focusOffset);if(r&&l&&r!=l){let d=l.pmViewDesc,f=t.domObserver.lastChangedTextNode;if(r==f||l==f)return f;if(!d||!d.isText(l.nodeValue))return l;if(t.input.compositionNode==l){let b=r.pmViewDesc;if(b&&b.isText(r.nodeValue))return l}}return r||l}(this)),(f||!this.docView.update(e.doc,I,A,this))&&(this.docView.updateOuterDeco(I),this.docView.destroy(),this.docView=s(e.doc,I,A,this.dom,this)),u&&!this.trackWrites&&(a=!0)}a||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function ri(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.domSelectionRange();return Ae(e.node,e.offset,r.anchorNode,r.anchorOffset)}(this))?vn(this,a):(wr(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(d),!(null===(l=this.dragging)||void 0===l)&&l.node&&!d.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,d),"reset"==i?this.dom.scrollTop=0:"to selection"==i?this.scrollToSelection():o&&function Mt({refDOM:t,refTop:e,stack:r}){let l=t?t.getBoundingClientRect().top:0;ht(r,0==l?0:l-e)}(o)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode)&&!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof D.nh){let r=this.docView.domAfterPos(this.state.selection.from);1==r.nodeType&&ft(this,r.getBoundingClientRect(),e)}else ft(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let r=0;r<this.pluginViews.length;r++){let l=this.pluginViews[r];l.update&&l.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;r<this.directPlugins.length;r++){let l=this.directPlugins[r];l.spec.view&&this.pluginViews.push(l.spec.view(this))}for(let r=0;r<this.state.plugins.length;r++){let l=this.state.plugins[r];l.spec.view&&this.pluginViews.push(l.spec.view(this))}}}updateDraggedNode(e,r){let l=e.node,d=-1;if(this.state.doc.nodeAt(l.from)==l.node)d=l.from;else{let f=l.from+(this.state.doc.content.size-r.doc.content.size);(f>0&&this.state.doc.nodeAt(f))==l.node&&(d=f)}this.dragging=new yr(e.slice,e.move,d<0?void 0:D.nh.create(this.state.doc,d))}someProp(e,r){let d,l=this._props&&this._props[e];if(null!=l&&(d=r?r(l):l))return d;for(let b=0;b<this.directPlugins.length;b++){let x=this.directPlugins[b].props[e];if(null!=x&&(d=r?r(x):x))return d}let f=this.state.plugins;if(f)for(let b=0;b<f.length;b++){let x=f[b].props[e];if(null!=x&&(d=r?r(x):x))return d}}hasFocus(){if(rt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function Yt(t){if(t.setActive)return t.setActive();if(xt)return t.focus(xt);let e=St(t);t.focus(null==xt?{get preventScroll(){return xt={preventScroll:!0},!0}}:void 0),xt||(xt=!1,ht(e,0))}(this.dom),vn(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let r=this.dom.parentNode;r;r=r.parentNode)if(9==r.nodeType||11==r.nodeType&&r.host)return r.getSelection||(Object.getPrototypeOf(r).getSelection=()=>r.ownerDocument.getSelection()),this._root=r;return e||document}updateRoot(){this._root=null}posAtCoords(e){return rn(this,e)}coordsAtPos(e,r=1){return on(this,e,r)}domAtPos(e,r=0){return this.docView.domFromPos(e,r)}nodeDOM(e){let r=this.docView.descAt(e);return r?r.nodeDOM:null}posAtDOM(e,r,l=-1){let d=this.docView.posFromDOM(e,r,l);if(null==d)throw new RangeError("DOM position not inside the editor");return d}endOfTextblock(e,r){return function m(t,e,r){return an==e&&K==r?g:(an=e,K=r,g="up"==r||"down"==r?function Rt(t,e,r){let l=e.selection,d="up"==r?l.$from:l.$to;return Bt(t,e,()=>{let{node:f}=t.docView.domFromPos(d.pos,"up"==r?-1:1);for(;;){let x=t.docView.nearestDesc(f,!0);if(!x)break;if(x.node.isBlock){f=x.contentDOM||x.dom;break}f=x.dom.parentNode}let b=on(t,d.pos,1);for(let x=f.firstChild;x;x=x.nextSibling){let A;if(1==x.nodeType)A=x.getClientRects();else{if(3!=x.nodeType)continue;A=Pe(x,0,x.nodeValue.length).getClientRects()}for(let I=0;I<A.length;I++){let i=A[I];if(i.bottom>i.top+1&&("up"==r?b.top-i.top>2*(i.bottom-b.top):i.bottom-b.bottom>2*(b.bottom-i.top)))return!1}}return!0})}(t,e,r):function Wt(t,e,r){let{$head:l}=e.selection;if(!l.parent.isTextblock)return!1;let d=l.parentOffset,f=!d,b=d==l.parent.content.size,x=t.domSelection();return x?Qt.test(l.parent.textContent)&&x.modify?Bt(t,e,()=>{let{focusNode:A,focusOffset:I,anchorNode:i,anchorOffset:n}=t.domSelectionRange(),o=x.caretBidiLevel;x.modify("move",r,"character");let a=l.depth?t.docView.domAfterPos(l.before()):t.dom,{focusNode:u,focusOffset:p}=t.domSelectionRange(),y=u&&!a.contains(1==u.nodeType?u:u.parentNode)||A==u&&I==p;try{x.collapse(i,n),A&&(A!=i||I!=n)&&x.extend&&x.extend(A,I)}catch{}return null!=o&&(x.caretBidiLevel=o),y}):"left"==r||"backward"==r?f:b:l.pos==l.start()||l.pos==l.end()}(t,e,r))}(this,r||this.state,e)}pasteHTML(e,r){return sr(this,"",e,!1,r||new ClipboardEvent("paste"))}pasteText(e,r){return sr(this,e,null,!0,r||new ClipboardEvent("paste"))}serializeForClipboard(e){return Cn(this,e)}destroy(){this.docView&&(function Yr(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ae(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Te=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function pi(t,e){!nr(t,e)&&zt[e.type]&&(t.editable||!(e.type in Ht))&&zt[e.type](t,e)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?X&&11===this.root.nodeType&&function fe(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom&&function Ue(t,e){if(e.getComposedRanges){let d=e.getComposedRanges(t.root)[0];if(d)return Ge(t,d)}let r;function l(d){d.preventDefault(),d.stopImmediatePropagation(),r=d.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",l,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",l,!0),r?Ge(t,r):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Ft(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",r=>{if("function"==typeof r&&(r=r(t.state)),r)for(let l in r)"class"==l?e.class+=" "+r[l]:"style"==l?e.style=(e.style?e.style+";":"")+r[l]:!e[l]&&"contenteditable"!=l&&"nodeName"!=l&&(e[l]=String(r[l]))}),e.translate||(e.translate="no"),[Gt.node(0,t.state.doc.content.size,e)]}function qt(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Gt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function _t(t){return!t.someProp("editable",e=>!1===e(t.state))}function Lt(t){let e=Object.create(null);function r(l){for(let d in l)Object.prototype.hasOwnProperty.call(e,d)||(e[d]=l[d])}return t.someProp("nodeViews",r),t.someProp("markViews",r),e}function mn(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")}gt.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}}}]);

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