@pretextbook/web-editor 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions/Url.d.ts +3 -0
- package/dist/index.es.js +8354 -7200
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +122 -87
- package/dist/index.js.map +1 -1
- package/dist/web-editor.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Bt,B){typeof exports=="object"&&typeof module<"u"?B(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],B):(Bt=typeof globalThis<"u"?globalThis:Bt||self,B(Bt.PretextWebEditor={},Bt.React,Bt.ReactDOM))})(this,(function(Bt,B,Cs){"use strict";function Hg(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const H=Hg(B);var Ms={exports:{}},ki={};var Fu;function jg(){if(Fu)return ki;Fu=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var a in i)a!=="key"&&(s[a]=i[a])}else s=i;return i=s.ref,{$$typeof:r,type:n,key:o,ref:i!==void 0?i:null,props:s}}return ki.Fragment=e,ki.jsx=t,ki.jsxs=t,ki}var Ti={};var $u;function _g(){return $u||($u=1,process.env.NODE_ENV!=="production"&&(function(){function r(x){if(x==null)return null;if(typeof x=="function")return x.$$typeof===re?null:x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case y:return"Fragment";case k:return"Profiler";case w:return"StrictMode";case N:return"Suspense";case P:return"SuspenseList";case F:return"Activity"}if(typeof x=="object")switch(typeof x.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),x.$$typeof){case v:return"Portal";case I:return x.displayName||"Context";case E:return(x._context.displayName||"Context")+".Consumer";case A:var D=x.render;return x=x.displayName,x||(x=D.displayName||D.name||"",x=x!==""?"ForwardRef("+x+")":"ForwardRef"),x;case L:return D=x.displayName||null,D!==null?D:r(x.type)||"Memo";case z:D=x._payload,x=x._init;try{return r(x(D))}catch{}}return null}function e(x){return""+x}function t(x){try{e(x);var D=!1}catch{D=!0}if(D){D=console;var q=D.error,J=typeof Symbol=="function"&&Symbol.toStringTag&&x[Symbol.toStringTag]||x.constructor.name||"Object";return q.call(D,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",J),e(x)}}function n(x){if(x===y)return"<>";if(typeof x=="object"&&x!==null&&x.$$typeof===z)return"<...>";try{var D=r(x);return D?"<"+D+">":"<...>"}catch{return"<...>"}}function i(){var x=oe.A;return x===null?null:x.getOwner()}function s(){return Error("react-stack-top-frame")}function o(x){if(ye.call(x,"key")){var D=Object.getOwnPropertyDescriptor(x,"key").get;if(D&&D.isReactWarning)return!1}return x.key!==void 0}function a(x,D){function q(){ee||(ee=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",D))}q.isReactWarning=!0,Object.defineProperty(x,"key",{get:q,configurable:!0})}function l(){var x=r(this.type);return ke[x]||(ke[x]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),x=this.props.ref,x!==void 0?x:null}function u(x,D,q,J,he,Pe){var pe=q.ref;return x={$$typeof:m,type:x,key:D,props:q,_owner:J},(pe!==void 0?pe:null)!==null?Object.defineProperty(x,"ref",{enumerable:!1,get:l}):Object.defineProperty(x,"ref",{enumerable:!1,value:null}),x._store={},Object.defineProperty(x._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(x,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(x,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:he}),Object.defineProperty(x,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Pe}),Object.freeze&&(Object.freeze(x.props),Object.freeze(x)),x}function c(x,D,q,J,he,Pe){var pe=D.children;if(pe!==void 0)if(J)if(ae(pe)){for(J=0;J<pe.length;J++)d(pe[J]);Object.freeze&&Object.freeze(pe)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(pe);if(ye.call(D,"key")){pe=r(x);var Fe=Object.keys(D).filter(function(Qt){return Qt!=="key"});J=0<Fe.length?"{key: someKey, "+Fe.join(": ..., ")+": ...}":"{key: someKey}",C[pe+J]||(Fe=0<Fe.length?"{"+Fe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,
|
|
7
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
8
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
9
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return o=u.done,u},e:function(u){a=!0,s=u},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}function V1(r,e){if(r){if(typeof r=="string")return Y0(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Y0(r,e):void 0}}function Y0(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}var Me=(function(){function r(){G0(this,r)}return J0(r,null,[{key:"innerWidth",value:function(t){if(t){var n=t.offsetWidth,i=getComputedStyle(t);return n=n+(parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)),n}return 0}},{key:"width",value:function(t){if(t){var n=t.offsetWidth,i=getComputedStyle(t);return n=n-(parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)),n}return 0}},{key:"getBrowserLanguage",value:function(){return navigator.userLanguage||navigator.languages&&navigator.languages.length&&navigator.languages[0]||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"en"}},{key:"getWindowScrollTop",value:function(){var t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}},{key:"getWindowScrollLeft",value:function(){var t=document.documentElement;return(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}},{key:"getOuterWidth",value:function(t,n){if(t){var i=t.getBoundingClientRect().width||t.offsetWidth;if(n){var s=getComputedStyle(t);i=i+(parseFloat(s.marginLeft)+parseFloat(s.marginRight))}return i}return 0}},{key:"getOuterHeight",value:function(t,n){if(t){var i=t.getBoundingClientRect().height||t.offsetHeight;if(n){var s=getComputedStyle(t);i=i+(parseFloat(s.marginTop)+parseFloat(s.marginBottom))}return i}return 0}},{key:"getClientHeight",value:function(t,n){if(t){var i=t.clientHeight;if(n){var s=getComputedStyle(t);i=i+(parseFloat(s.marginTop)+parseFloat(s.marginBottom))}return i}return 0}},{key:"getClientWidth",value:function(t,n){if(t){var i=t.clientWidth;if(n){var s=getComputedStyle(t);i=i+(parseFloat(s.marginLeft)+parseFloat(s.marginRight))}return i}return 0}},{key:"getViewport",value:function(){var t=window,n=document,i=n.documentElement,s=n.getElementsByTagName("body")[0],o=t.innerWidth||i.clientWidth||s.clientWidth,a=t.innerHeight||i.clientHeight||s.clientHeight;return{width:o,height:a}}},{key:"getOffset",value:function(t){if(t){var n=t.getBoundingClientRect();return{top:n.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:n.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}}},{key:"index",value:function(t){if(t)for(var n=t.parentNode.childNodes,i=0,s=0;s<n.length;s++){if(n[s]===t)return i;n[s].nodeType===1&&i++}return-1}},{key:"addMultipleClasses",value:function(t,n){if(t&&n)if(t.classList)for(var i=n.split(" "),s=0;s<i.length;s++)t.classList.add(i[s]);else for(var o=n.split(" "),a=0;a<o.length;a++)t.className=t.className+(" "+o[a])}},{key:"removeMultipleClasses",value:function(t,n){if(t&&n)if(t.classList)for(var i=n.split(" "),s=0;s<i.length;s++)t.classList.remove(i[s]);else for(var o=n.split(" "),a=0;a<o.length;a++)t.className=t.className.replace(new RegExp("(^|\\b)"+o[a].split(" ").join("|")+"(\\b|$)","gi")," ")}},{key:"addClass",value:function(t,n){t&&n&&(t.classList?t.classList.add(n):t.className=t.className+(" "+n))}},{key:"removeClass",value:function(t,n){t&&n&&(t.classList?t.classList.remove(n):t.className=t.className.replace(new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi")," "))}},{key:"hasClass",value:function(t,n){return t?t.classList?t.classList.contains(n):new RegExp("(^| )"+n+"( |$)","gi").test(t.className):!1}},{key:"addStyles",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};t&&Object.entries(n).forEach(function(i){var s=Ki(i,2),o=s[0],a=s[1];return t.style[o]=a})}},{key:"find",value:function(t,n){return t?Array.from(t.querySelectorAll(n)):[]}},{key:"findSingle",value:function(t,n){return t?t.querySelector(n):null}},{key:"setAttributes",value:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t){var s=function(a,l){var u,c,d=t!=null&&(u=t.$attrs)!==null&&u!==void 0&&u[a]?[t==null||(c=t.$attrs)===null||c===void 0?void 0:c[a]]:[];return[l].flat().reduce(function(h,f){if(f!=null){var m=De(f);if(m==="string"||m==="number")h.push(f);else if(m==="object"){var v=Array.isArray(f)?s(a,f):Object.entries(f).map(function(y){var w=Ki(y,2),k=w[0],E=w[1];return a==="style"&&(E||E===0)?"".concat(k.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),":").concat(E):E?k:void 0});h=v.length?h.concat(v.filter(function(y){return!!y})):h}}return h},d)};Object.entries(i).forEach(function(o){var a=Ki(o,2),l=a[0],u=a[1];if(u!=null){var c=l.match(/^on(.+)/);c?t.addEventListener(c[1].toLowerCase(),u):l==="p-bind"?n.setAttributes(t,u):(u=l==="class"?$o(new Set(s("class",u))).join(" ").trim():l==="style"?s("style",u).join(";").trim():u,(t.$attrs=t.$attrs||{})&&(t.$attrs[l]=u),t.setAttribute(l,u))}})}}},{key:"getAttribute",value:function(t,n){if(t){var i=t.getAttribute(n);return isNaN(i)?i==="true"||i==="false"?i==="true":i:+i}}},{key:"isAttributeEquals",value:function(t,n,i){return t?this.getAttribute(t,n)===i:!1}},{key:"isAttributeNotEquals",value:function(t,n,i){return!this.isAttributeEquals(t,n,i)}},{key:"getHeight",value:function(t){if(t){var n=t.offsetHeight,i=getComputedStyle(t);return n=n-(parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth)),n}return 0}},{key:"getWidth",value:function(t){if(t){var n=t.offsetWidth,i=getComputedStyle(t);return n=n-(parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth)),n}return 0}},{key:"alignOverlay",value:function(t,n,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;t&&n&&(i==="self"?this.relativePosition(t,n):(s&&(t.style.minWidth=r.getOuterWidth(n)+"px"),this.absolutePosition(t,n)))}},{key:"absolutePosition",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"left";if(t&&n){var s=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:this.getHiddenElementDimensions(t),o=s.height,a=s.width,l=n.offsetHeight,u=n.offsetWidth,c=n.getBoundingClientRect(),d=this.getWindowScrollTop(),h=this.getWindowScrollLeft(),f=this.getViewport(),m,v;c.top+l+o>f.height?(m=c.top+d-o,m<0&&(m=d),t.style.transformOrigin="bottom"):(m=l+c.top+d,t.style.transformOrigin="top");var y=c.left;i==="left"?y+a>f.width?v=Math.max(0,y+h+u-a):v=y+h:y+u-a<0?v=h:v=y+u-a+h,t.style.top=m+"px",t.style.left=v+"px"}}},{key:"relativePosition",value:function(t,n){if(t&&n){var i=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:this.getHiddenElementDimensions(t),s=n.offsetHeight,o=n.getBoundingClientRect(),a=this.getViewport(),l,u;o.top+s+i.height>a.height?(l=-1*i.height,o.top+l<0&&(l=-1*o.top),t.style.transformOrigin="bottom"):(l=s,t.style.transformOrigin="top"),i.width>a.width?u=o.left*-1:o.left+i.width>a.width?u=(o.left+i.width-a.width)*-1:u=0,t.style.top=l+"px",t.style.left=u+"px"}}},{key:"flipfitCollision",value:function(t,n){var i=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"left top",o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"left bottom",a=arguments.length>4?arguments[4]:void 0;if(t&&n){var l=n.getBoundingClientRect(),u=this.getViewport(),c=s.split(" "),d=o.split(" "),h=function(w,k){return k?+w.substring(w.search(/(\+|-)/g))||0:w.substring(0,w.search(/(\+|-)/g))||w},f={my:{x:h(c[0]),y:h(c[1]||c[0]),offsetX:h(c[0],!0),offsetY:h(c[1]||c[0],!0)},at:{x:h(d[0]),y:h(d[1]||d[0]),offsetX:h(d[0],!0),offsetY:h(d[1]||d[0],!0)}},m={left:function(){var w=f.my.offsetX+f.at.offsetX;return w+l.left+(f.my.x==="left"?0:-1*(f.my.x==="center"?i.getOuterWidth(t)/2:i.getOuterWidth(t)))},top:function(){var w=f.my.offsetY+f.at.offsetY;return w+l.top+(f.my.y==="top"?0:-1*(f.my.y==="center"?i.getOuterHeight(t)/2:i.getOuterHeight(t)))}},v={count:{x:0,y:0},left:function(){var w=m.left(),k=r.getWindowScrollLeft();t.style.left=w+k+"px",this.count.x===2?(t.style.left=k+"px",this.count.x=0):w<0&&(this.count.x++,f.my.x="left",f.at.x="right",f.my.offsetX*=-1,f.at.offsetX*=-1,this.right())},right:function(){var w=m.left()+r.getOuterWidth(n),k=r.getWindowScrollLeft();t.style.left=w+k+"px",this.count.x===2?(t.style.left=u.width-r.getOuterWidth(t)+k+"px",this.count.x=0):w+r.getOuterWidth(t)>u.width&&(this.count.x++,f.my.x="right",f.at.x="left",f.my.offsetX*=-1,f.at.offsetX*=-1,this.left())},top:function(){var w=m.top(),k=r.getWindowScrollTop();t.style.top=w+k+"px",this.count.y===2?(t.style.left=k+"px",this.count.y=0):w<0&&(this.count.y++,f.my.y="top",f.at.y="bottom",f.my.offsetY*=-1,f.at.offsetY*=-1,this.bottom())},bottom:function(){var w=m.top()+r.getOuterHeight(n),k=r.getWindowScrollTop();t.style.top=w+k+"px",this.count.y===2?(t.style.left=u.height-r.getOuterHeight(t)+k+"px",this.count.y=0):w+r.getOuterHeight(n)>u.height&&(this.count.y++,f.my.y="bottom",f.at.y="top",f.my.offsetY*=-1,f.at.offsetY*=-1,this.top())},center:function(w){if(w==="y"){var k=m.top()+r.getOuterHeight(n)/2;t.style.top=k+r.getWindowScrollTop()+"px",k<0?this.bottom():k+r.getOuterHeight(n)>u.height&&this.top()}else{var E=m.left()+r.getOuterWidth(n)/2;t.style.left=E+r.getWindowScrollLeft()+"px",E<0?this.left():E+r.getOuterWidth(t)>u.width&&this.right()}}};v[f.at.x]("x"),v[f.at.y]("y"),this.isFunction(a)&&a(f)}}},{key:"findCollisionPosition",value:function(t){if(t){var n=t==="top"||t==="bottom",i=t==="left"?"right":"left",s=t==="top"?"bottom":"top";return n?{axis:"y",my:"center ".concat(s),at:"center ".concat(t)}:{axis:"x",my:"".concat(i," center"),at:"".concat(t," center")}}}},{key:"getParents",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.parentNode===null?n:this.getParents(t.parentNode,n.concat([t.parentNode]))}},{key:"getScrollableParents",value:function(t){var n=this,i=[];if(t){var s=this.getParents(t),o=/(auto|scroll)/,a=function(R){var O=R?getComputedStyle(R):null;return O&&(o.test(O.getPropertyValue("overflow"))||o.test(O.getPropertyValue("overflow-x"))||o.test(O.getPropertyValue("overflow-y")))},l=function(R){i.push(R.nodeName==="BODY"||R.nodeName==="HTML"||n.isDocument(R)?window:R)},u=Vo(s),c;try{for(u.s();!(c=u.n()).done;){var d,h=c.value,f=h.nodeType===1&&((d=h.dataset)===null||d===void 0?void 0:d.scrollselectors);if(f){var m=f.split(","),v=Vo(m),y;try{for(v.s();!(y=v.n()).done;){var w=y.value,k=this.findSingle(h,w);k&&a(k)&&l(k)}}catch(E){v.e(E)}finally{v.f()}}h.nodeType===1&&a(h)&&l(h)}}catch(E){u.e(E)}finally{u.f()}}return i}},{key:"getHiddenElementOuterHeight",value:function(t){if(t){t.style.visibility="hidden",t.style.display="block";var n=t.offsetHeight;return t.style.display="none",t.style.visibility="visible",n}return 0}},{key:"getHiddenElementOuterWidth",value:function(t){if(t){t.style.visibility="hidden",t.style.display="block";var n=t.offsetWidth;return t.style.display="none",t.style.visibility="visible",n}return 0}},{key:"getHiddenElementDimensions",value:function(t){var n={};return t&&(t.style.visibility="hidden",t.style.display="block",n.width=t.offsetWidth,n.height=t.offsetHeight,t.style.display="none",t.style.visibility="visible"),n}},{key:"fadeIn",value:function(t,n){if(t){t.style.opacity=0;var i=+new Date,s=0,o=function(){s=+t.style.opacity+(new Date().getTime()-i)/n,t.style.opacity=s,i=+new Date,+s<1&&(window.requestAnimationFrame&&requestAnimationFrame(o)||setTimeout(o,16))};o()}}},{key:"fadeOut",value:function(t,n){if(t)var i=1,s=50,o=s/n,a=setInterval(function(){i=i-o,i<=0&&(i=0,clearInterval(a)),t.style.opacity=i},s)}},{key:"getUserAgent",value:function(){return navigator.userAgent}},{key:"isIOS",value:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}},{key:"isAndroid",value:function(){return/(android)/i.test(navigator.userAgent)}},{key:"isChrome",value:function(){return/(chrome)/i.test(navigator.userAgent)}},{key:"isClient",value:function(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},{key:"isFunction",value:function(t){return!!(t&&t.constructor&&t.call&&t.apply)}},{key:"appendChild",value:function(t,n){if(this.isElement(n))n.appendChild(t);else if(n.el&&n.el.nativeElement)n.el.nativeElement.appendChild(t);else throw new Error("Cannot append "+n+" to "+t)}},{key:"removeChild",value:function(t,n){if(this.isElement(n))n.removeChild(t);else if(n.el&&n.el.nativeElement)n.el.nativeElement.removeChild(t);else throw new Error("Cannot remove "+t+" from "+n)}},{key:"isElement",value:function(t){return(typeof HTMLElement>"u"?"undefined":De(HTMLElement))==="object"?t instanceof HTMLElement:t&&De(t)==="object"&&t!==null&&t.nodeType===1&&typeof t.nodeName=="string"}},{key:"isDocument",value:function(t){return(typeof Document>"u"?"undefined":De(Document))==="object"?t instanceof Document:t&&De(t)==="object"&&t!==null&&t.nodeType===9}},{key:"scrollInView",value:function(t,n){var i=getComputedStyle(t).getPropertyValue("border-top-width"),s=i?parseFloat(i):0,o=getComputedStyle(t).getPropertyValue("padding-top"),a=o?parseFloat(o):0,l=t.getBoundingClientRect(),u=n.getBoundingClientRect(),c=u.top+document.body.scrollTop-(l.top+document.body.scrollTop)-s-a,d=t.scrollTop,h=t.clientHeight,f=this.getOuterHeight(n);c<0?t.scrollTop=d+c:c+f>h&&(t.scrollTop=d+c-h+f)}},{key:"clearSelection",value:function(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch{}}},{key:"calculateScrollbarWidth",value:function(t){if(t){var n=getComputedStyle(t);return t.offsetWidth-t.clientWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.borderRightWidth)}if(this.calculatedScrollbarWidth!=null)return this.calculatedScrollbarWidth;var i=document.createElement("div");i.className="p-scrollbar-measure",document.body.appendChild(i);var s=i.offsetWidth-i.clientWidth;return document.body.removeChild(i),this.calculatedScrollbarWidth=s,s}},{key:"calculateBodyScrollbarWidth",value:function(){return window.innerWidth-document.documentElement.offsetWidth}},{key:"getBrowser",value:function(){if(!this.browser){var t=this.resolveUserAgent();this.browser={},t.browser&&(this.browser[t.browser]=!0,this.browser.version=t.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser}},{key:"resolveUserAgent",value:function(){var t=navigator.userAgent.toLowerCase(),n=/(chrome)[ ]([\w.]+)/.exec(t)||/(webkit)[ ]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[];return{browser:n[1]||"",version:n[2]||"0"}}},{key:"blockBodyScroll",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"p-overflow-hidden",n=!!document.body.style.getPropertyValue("--scrollbar-width");!n&&document.body.style.setProperty("--scrollbar-width",this.calculateBodyScrollbarWidth()+"px"),this.addClass(document.body,t)}},{key:"unblockBodyScroll",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"p-overflow-hidden";document.body.style.removeProperty("--scrollbar-width"),this.removeClass(document.body,t)}},{key:"isVisible",value:function(t){return t&&(t.clientHeight!==0||t.getClientRects().length!==0||getComputedStyle(t).display!=="none")}},{key:"isExist",value:function(t){return!!(t!==null&&typeof t<"u"&&t.nodeName&&t.parentNode)}},{key:"getFocusableElements",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=r.find(t,'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(n,`,
|
|
6
|
+
<%s key={someKey} {...props} />`,J,pe,Fe,pe),C[pe+J]=!0)}if(pe=null,q!==void 0&&(t(q),pe=""+q),o(D)&&(t(D.key),pe=""+D.key),"key"in D){q={};for(var wt in D)wt!=="key"&&(q[wt]=D[wt])}else q=D;return pe&&a(q,typeof x=="function"?x.displayName||x.name||"Unknown":x),u(x,pe,q,i(),he,Pe)}function d(x){h(x)?x._store&&(x._store.validated=1):typeof x=="object"&&x!==null&&x.$$typeof===z&&(x._payload.status==="fulfilled"?h(x._payload.value)&&x._payload.value._store&&(x._payload.value._store.validated=1):x._store&&(x._store.validated=1))}function h(x){return typeof x=="object"&&x!==null&&x.$$typeof===m}var f=B,m=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),I=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),re=Symbol.for("react.client.reference"),oe=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=Object.prototype.hasOwnProperty,ae=Array.isArray,G=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(x){return x()}};var ee,ke={},se=f.react_stack_bottom_frame.bind(f,s)(),Te=G(n(s)),C={};Ti.Fragment=y,Ti.jsx=function(x,D,q){var J=1e4>oe.recentlyCreatedOwnerStacks++;return c(x,D,q,!1,J?Error("react-stack-top-frame"):se,J?G(n(x)):Te)},Ti.jsxs=function(x,D,q){var J=1e4>oe.recentlyCreatedOwnerStacks++;return c(x,D,q,!0,J?Error("react-stack-top-frame"):se,J?G(n(x)):Te)}})()),Ti}var Hu;function Vg(){return Hu||(Hu=1,process.env.NODE_ENV==="production"?Ms.exports=jg():Ms.exports=_g()),Ms.exports}var X=Vg();function qg(r){if(Array.isArray(r))return r}function Wg(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,s,o,a=[],l=!0,u=!1;try{if(s=(t=t.call(r)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function ba(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function ju(r,e){if(r){if(typeof r=="string")return ba(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ba(r,e):void 0}}function Ug(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
7
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Es(r,e){return qg(r)||Wg(r,e)||ju(r,e)||Ug()}function Le(r){"@babel/helpers - typeof";return Le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Le(r)}function Et(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(e){for(var n=[],i=0;i<e.length;i++){var s=e[i];if(s){var o=Le(s);if(o==="string"||o==="number")n.push(s);else if(o==="object"){var a=Array.isArray(s)?s:Object.entries(s).map(function(l){var u=Es(l,2),c=u[0],d=u[1];return d?c:null});n=a.length?n.concat(a.filter(function(l){return!!l})):n}}}return n.join(" ").trim()}}function Kg(r){if(Array.isArray(r))return ba(r)}function Gg(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Jg(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
8
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wa(r){return Kg(r)||Gg(r)||ju(r)||Jg()}function xa(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Yg(r,e){if(Le(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(Le(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function _u(r){var e=Yg(r,"string");return Le(e)=="symbol"?e:e+""}function Xg(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,_u(n.key),n)}}function Sa(r,e,t){return t&&Xg(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function As(r,e,t){return(e=_u(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ka(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Zg(r))||e){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
9
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return o=u.done,u},e:function(u){a=!0,s=u},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}function Zg(r,e){if(r){if(typeof r=="string")return Vu(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Vu(r,e):void 0}}function Vu(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}var ce=(function(){function r(){xa(this,r)}return Sa(r,null,[{key:"innerWidth",value:function(t){if(t){var n=t.offsetWidth,i=getComputedStyle(t);return n=n+(parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)),n}return 0}},{key:"width",value:function(t){if(t){var n=t.offsetWidth,i=getComputedStyle(t);return n=n-(parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)),n}return 0}},{key:"getBrowserLanguage",value:function(){return navigator.userLanguage||navigator.languages&&navigator.languages.length&&navigator.languages[0]||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"en"}},{key:"getWindowScrollTop",value:function(){var t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}},{key:"getWindowScrollLeft",value:function(){var t=document.documentElement;return(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}},{key:"getOuterWidth",value:function(t,n){if(t){var i=t.getBoundingClientRect().width||t.offsetWidth;if(n){var s=getComputedStyle(t);i=i+(parseFloat(s.marginLeft)+parseFloat(s.marginRight))}return i}return 0}},{key:"getOuterHeight",value:function(t,n){if(t){var i=t.getBoundingClientRect().height||t.offsetHeight;if(n){var s=getComputedStyle(t);i=i+(parseFloat(s.marginTop)+parseFloat(s.marginBottom))}return i}return 0}},{key:"getClientHeight",value:function(t,n){if(t){var i=t.clientHeight;if(n){var s=getComputedStyle(t);i=i+(parseFloat(s.marginTop)+parseFloat(s.marginBottom))}return i}return 0}},{key:"getClientWidth",value:function(t,n){if(t){var i=t.clientWidth;if(n){var s=getComputedStyle(t);i=i+(parseFloat(s.marginLeft)+parseFloat(s.marginRight))}return i}return 0}},{key:"getViewport",value:function(){var t=window,n=document,i=n.documentElement,s=n.getElementsByTagName("body")[0],o=t.innerWidth||i.clientWidth||s.clientWidth,a=t.innerHeight||i.clientHeight||s.clientHeight;return{width:o,height:a}}},{key:"getOffset",value:function(t){if(t){var n=t.getBoundingClientRect();return{top:n.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:n.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}}},{key:"index",value:function(t){if(t)for(var n=t.parentNode.childNodes,i=0,s=0;s<n.length;s++){if(n[s]===t)return i;n[s].nodeType===1&&i++}return-1}},{key:"addMultipleClasses",value:function(t,n){if(t&&n)if(t.classList)for(var i=n.split(" "),s=0;s<i.length;s++)t.classList.add(i[s]);else for(var o=n.split(" "),a=0;a<o.length;a++)t.className=t.className+(" "+o[a])}},{key:"removeMultipleClasses",value:function(t,n){if(t&&n)if(t.classList)for(var i=n.split(" "),s=0;s<i.length;s++)t.classList.remove(i[s]);else for(var o=n.split(" "),a=0;a<o.length;a++)t.className=t.className.replace(new RegExp("(^|\\b)"+o[a].split(" ").join("|")+"(\\b|$)","gi")," ")}},{key:"addClass",value:function(t,n){t&&n&&(t.classList?t.classList.add(n):t.className=t.className+(" "+n))}},{key:"removeClass",value:function(t,n){t&&n&&(t.classList?t.classList.remove(n):t.className=t.className.replace(new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi")," "))}},{key:"hasClass",value:function(t,n){return t?t.classList?t.classList.contains(n):new RegExp("(^| )"+n+"( |$)","gi").test(t.className):!1}},{key:"addStyles",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};t&&Object.entries(n).forEach(function(i){var s=Es(i,2),o=s[0],a=s[1];return t.style[o]=a})}},{key:"find",value:function(t,n){return t?Array.from(t.querySelectorAll(n)):[]}},{key:"findSingle",value:function(t,n){return t?t.querySelector(n):null}},{key:"setAttributes",value:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t){var s=function(a,l){var u,c,d=t!=null&&(u=t.$attrs)!==null&&u!==void 0&&u[a]?[t==null||(c=t.$attrs)===null||c===void 0?void 0:c[a]]:[];return[l].flat().reduce(function(h,f){if(f!=null){var m=Le(f);if(m==="string"||m==="number")h.push(f);else if(m==="object"){var v=Array.isArray(f)?s(a,f):Object.entries(f).map(function(y){var w=Es(y,2),k=w[0],E=w[1];return a==="style"&&(E||E===0)?"".concat(k.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),":").concat(E):E?k:void 0});h=v.length?h.concat(v.filter(function(y){return!!y})):h}}return h},d)};Object.entries(i).forEach(function(o){var a=Es(o,2),l=a[0],u=a[1];if(u!=null){var c=l.match(/^on(.+)/);c?t.addEventListener(c[1].toLowerCase(),u):l==="p-bind"?n.setAttributes(t,u):(u=l==="class"?wa(new Set(s("class",u))).join(" ").trim():l==="style"?s("style",u).join(";").trim():u,(t.$attrs=t.$attrs||{})&&(t.$attrs[l]=u),t.setAttribute(l,u))}})}}},{key:"getAttribute",value:function(t,n){if(t){var i=t.getAttribute(n);return isNaN(i)?i==="true"||i==="false"?i==="true":i:+i}}},{key:"isAttributeEquals",value:function(t,n,i){return t?this.getAttribute(t,n)===i:!1}},{key:"isAttributeNotEquals",value:function(t,n,i){return!this.isAttributeEquals(t,n,i)}},{key:"getHeight",value:function(t){if(t){var n=t.offsetHeight,i=getComputedStyle(t);return n=n-(parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth)),n}return 0}},{key:"getWidth",value:function(t){if(t){var n=t.offsetWidth,i=getComputedStyle(t);return n=n-(parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth)),n}return 0}},{key:"alignOverlay",value:function(t,n,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;t&&n&&(i==="self"?this.relativePosition(t,n):(s&&(t.style.minWidth=r.getOuterWidth(n)+"px"),this.absolutePosition(t,n)))}},{key:"absolutePosition",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"left";if(t&&n){var s=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:this.getHiddenElementDimensions(t),o=s.height,a=s.width,l=n.offsetHeight,u=n.offsetWidth,c=n.getBoundingClientRect(),d=this.getWindowScrollTop(),h=this.getWindowScrollLeft(),f=this.getViewport(),m,v;c.top+l+o>f.height?(m=c.top+d-o,m<0&&(m=d),t.style.transformOrigin="bottom"):(m=l+c.top+d,t.style.transformOrigin="top");var y=c.left;i==="left"?y+a>f.width?v=Math.max(0,y+h+u-a):v=y+h:y+u-a<0?v=h:v=y+u-a+h,t.style.top=m+"px",t.style.left=v+"px"}}},{key:"relativePosition",value:function(t,n){if(t&&n){var i=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:this.getHiddenElementDimensions(t),s=n.offsetHeight,o=n.getBoundingClientRect(),a=this.getViewport(),l,u;o.top+s+i.height>a.height?(l=-1*i.height,o.top+l<0&&(l=-1*o.top),t.style.transformOrigin="bottom"):(l=s,t.style.transformOrigin="top"),i.width>a.width?u=o.left*-1:o.left+i.width>a.width?u=(o.left+i.width-a.width)*-1:u=0,t.style.top=l+"px",t.style.left=u+"px"}}},{key:"flipfitCollision",value:function(t,n){var i=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"left top",o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"left bottom",a=arguments.length>4?arguments[4]:void 0;if(t&&n){var l=n.getBoundingClientRect(),u=this.getViewport(),c=s.split(" "),d=o.split(" "),h=function(w,k){return k?+w.substring(w.search(/(\+|-)/g))||0:w.substring(0,w.search(/(\+|-)/g))||w},f={my:{x:h(c[0]),y:h(c[1]||c[0]),offsetX:h(c[0],!0),offsetY:h(c[1]||c[0],!0)},at:{x:h(d[0]),y:h(d[1]||d[0]),offsetX:h(d[0],!0),offsetY:h(d[1]||d[0],!0)}},m={left:function(){var w=f.my.offsetX+f.at.offsetX;return w+l.left+(f.my.x==="left"?0:-1*(f.my.x==="center"?i.getOuterWidth(t)/2:i.getOuterWidth(t)))},top:function(){var w=f.my.offsetY+f.at.offsetY;return w+l.top+(f.my.y==="top"?0:-1*(f.my.y==="center"?i.getOuterHeight(t)/2:i.getOuterHeight(t)))}},v={count:{x:0,y:0},left:function(){var w=m.left(),k=r.getWindowScrollLeft();t.style.left=w+k+"px",this.count.x===2?(t.style.left=k+"px",this.count.x=0):w<0&&(this.count.x++,f.my.x="left",f.at.x="right",f.my.offsetX*=-1,f.at.offsetX*=-1,this.right())},right:function(){var w=m.left()+r.getOuterWidth(n),k=r.getWindowScrollLeft();t.style.left=w+k+"px",this.count.x===2?(t.style.left=u.width-r.getOuterWidth(t)+k+"px",this.count.x=0):w+r.getOuterWidth(t)>u.width&&(this.count.x++,f.my.x="right",f.at.x="left",f.my.offsetX*=-1,f.at.offsetX*=-1,this.left())},top:function(){var w=m.top(),k=r.getWindowScrollTop();t.style.top=w+k+"px",this.count.y===2?(t.style.left=k+"px",this.count.y=0):w<0&&(this.count.y++,f.my.y="top",f.at.y="bottom",f.my.offsetY*=-1,f.at.offsetY*=-1,this.bottom())},bottom:function(){var w=m.top()+r.getOuterHeight(n),k=r.getWindowScrollTop();t.style.top=w+k+"px",this.count.y===2?(t.style.left=u.height-r.getOuterHeight(t)+k+"px",this.count.y=0):w+r.getOuterHeight(n)>u.height&&(this.count.y++,f.my.y="bottom",f.at.y="top",f.my.offsetY*=-1,f.at.offsetY*=-1,this.top())},center:function(w){if(w==="y"){var k=m.top()+r.getOuterHeight(n)/2;t.style.top=k+r.getWindowScrollTop()+"px",k<0?this.bottom():k+r.getOuterHeight(n)>u.height&&this.top()}else{var E=m.left()+r.getOuterWidth(n)/2;t.style.left=E+r.getWindowScrollLeft()+"px",E<0?this.left():E+r.getOuterWidth(t)>u.width&&this.right()}}};v[f.at.x]("x"),v[f.at.y]("y"),this.isFunction(a)&&a(f)}}},{key:"findCollisionPosition",value:function(t){if(t){var n=t==="top"||t==="bottom",i=t==="left"?"right":"left",s=t==="top"?"bottom":"top";return n?{axis:"y",my:"center ".concat(s),at:"center ".concat(t)}:{axis:"x",my:"".concat(i," center"),at:"".concat(t," center")}}}},{key:"getParents",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.parentNode===null?n:this.getParents(t.parentNode,n.concat([t.parentNode]))}},{key:"getScrollableParents",value:function(t){var n=this,i=[];if(t){var s=this.getParents(t),o=/(auto|scroll)/,a=function(I){var A=I?getComputedStyle(I):null;return A&&(o.test(A.getPropertyValue("overflow"))||o.test(A.getPropertyValue("overflow-x"))||o.test(A.getPropertyValue("overflow-y")))},l=function(I){i.push(I.nodeName==="BODY"||I.nodeName==="HTML"||n.isDocument(I)?window:I)},u=ka(s),c;try{for(u.s();!(c=u.n()).done;){var d,h=c.value,f=h.nodeType===1&&((d=h.dataset)===null||d===void 0?void 0:d.scrollselectors);if(f){var m=f.split(","),v=ka(m),y;try{for(v.s();!(y=v.n()).done;){var w=y.value,k=this.findSingle(h,w);k&&a(k)&&l(k)}}catch(E){v.e(E)}finally{v.f()}}h.nodeType===1&&a(h)&&l(h)}}catch(E){u.e(E)}finally{u.f()}}return i}},{key:"getHiddenElementOuterHeight",value:function(t){if(t){t.style.visibility="hidden",t.style.display="block";var n=t.offsetHeight;return t.style.display="none",t.style.visibility="visible",n}return 0}},{key:"getHiddenElementOuterWidth",value:function(t){if(t){t.style.visibility="hidden",t.style.display="block";var n=t.offsetWidth;return t.style.display="none",t.style.visibility="visible",n}return 0}},{key:"getHiddenElementDimensions",value:function(t){var n={};return t&&(t.style.visibility="hidden",t.style.display="block",n.width=t.offsetWidth,n.height=t.offsetHeight,t.style.display="none",t.style.visibility="visible"),n}},{key:"fadeIn",value:function(t,n){if(t){t.style.opacity=0;var i=+new Date,s=0,o=function(){s=+t.style.opacity+(new Date().getTime()-i)/n,t.style.opacity=s,i=+new Date,+s<1&&(window.requestAnimationFrame&&requestAnimationFrame(o)||setTimeout(o,16))};o()}}},{key:"fadeOut",value:function(t,n){if(t)var i=1,s=50,o=s/n,a=setInterval(function(){i=i-o,i<=0&&(i=0,clearInterval(a)),t.style.opacity=i},s)}},{key:"getUserAgent",value:function(){return navigator.userAgent}},{key:"isIOS",value:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}},{key:"isAndroid",value:function(){return/(android)/i.test(navigator.userAgent)}},{key:"isChrome",value:function(){return/(chrome)/i.test(navigator.userAgent)}},{key:"isClient",value:function(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},{key:"isFunction",value:function(t){return!!(t&&t.constructor&&t.call&&t.apply)}},{key:"appendChild",value:function(t,n){if(this.isElement(n))n.appendChild(t);else if(n.el&&n.el.nativeElement)n.el.nativeElement.appendChild(t);else throw new Error("Cannot append "+n+" to "+t)}},{key:"removeChild",value:function(t,n){if(this.isElement(n))n.removeChild(t);else if(n.el&&n.el.nativeElement)n.el.nativeElement.removeChild(t);else throw new Error("Cannot remove "+t+" from "+n)}},{key:"isElement",value:function(t){return(typeof HTMLElement>"u"?"undefined":Le(HTMLElement))==="object"?t instanceof HTMLElement:t&&Le(t)==="object"&&t!==null&&t.nodeType===1&&typeof t.nodeName=="string"}},{key:"isDocument",value:function(t){return(typeof Document>"u"?"undefined":Le(Document))==="object"?t instanceof Document:t&&Le(t)==="object"&&t!==null&&t.nodeType===9}},{key:"scrollInView",value:function(t,n){var i=getComputedStyle(t).getPropertyValue("border-top-width"),s=i?parseFloat(i):0,o=getComputedStyle(t).getPropertyValue("padding-top"),a=o?parseFloat(o):0,l=t.getBoundingClientRect(),u=n.getBoundingClientRect(),c=u.top+document.body.scrollTop-(l.top+document.body.scrollTop)-s-a,d=t.scrollTop,h=t.clientHeight,f=this.getOuterHeight(n);c<0?t.scrollTop=d+c:c+f>h&&(t.scrollTop=d+c-h+f)}},{key:"clearSelection",value:function(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch{}}},{key:"calculateScrollbarWidth",value:function(t){if(t){var n=getComputedStyle(t);return t.offsetWidth-t.clientWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.borderRightWidth)}if(this.calculatedScrollbarWidth!=null)return this.calculatedScrollbarWidth;var i=document.createElement("div");i.className="p-scrollbar-measure",document.body.appendChild(i);var s=i.offsetWidth-i.clientWidth;return document.body.removeChild(i),this.calculatedScrollbarWidth=s,s}},{key:"calculateBodyScrollbarWidth",value:function(){return window.innerWidth-document.documentElement.offsetWidth}},{key:"getBrowser",value:function(){if(!this.browser){var t=this.resolveUserAgent();this.browser={},t.browser&&(this.browser[t.browser]=!0,this.browser.version=t.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser}},{key:"resolveUserAgent",value:function(){var t=navigator.userAgent.toLowerCase(),n=/(chrome)[ ]([\w.]+)/.exec(t)||/(webkit)[ ]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[];return{browser:n[1]||"",version:n[2]||"0"}}},{key:"blockBodyScroll",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"p-overflow-hidden",n=!!document.body.style.getPropertyValue("--scrollbar-width");!n&&document.body.style.setProperty("--scrollbar-width",this.calculateBodyScrollbarWidth()+"px"),this.addClass(document.body,t)}},{key:"unblockBodyScroll",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"p-overflow-hidden";document.body.style.removeProperty("--scrollbar-width"),this.removeClass(document.body,t)}},{key:"isVisible",value:function(t){return t&&(t.clientHeight!==0||t.getClientRects().length!==0||getComputedStyle(t).display!=="none")}},{key:"isExist",value:function(t){return!!(t!==null&&typeof t<"u"&&t.nodeName&&t.parentNode)}},{key:"getFocusableElements",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=r.find(t,'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(n,`,
|
|
10
10
|
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(n,`,
|
|
11
11
|
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(n,`,
|
|
12
12
|
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(n,`,
|
|
13
13
|
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(n,`,
|
|
14
14
|
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(n,`,
|
|
15
|
-
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(n)),s=[],o=
|
|
16
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return o=u.done,u},e:function(u){a=!0,s=u},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}function _1(r,e){if(r){if(typeof r=="string")return Z0(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Z0(r,e):void 0}}function Z0(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}var Ee=(function(){function r(){G0(this,r)}return J0(r,null,[{key:"equals",value:function(t,n,i){return i&&t&&De(t)==="object"&&n&&De(n)==="object"?this.deepEquals(this.resolveFieldData(t,i),this.resolveFieldData(n,i)):this.deepEquals(t,n)}},{key:"deepEquals",value:function(t,n){if(t===n)return!0;if(t&&n&&De(t)==="object"&&De(n)==="object"){var i=Array.isArray(t),s=Array.isArray(n),o,a,l;if(i&&s){if(a=t.length,a!==n.length)return!1;for(o=a;o--!==0;)if(!this.deepEquals(t[o],n[o]))return!1;return!0}if(i!==s)return!1;var u=t instanceof Date,c=n instanceof Date;if(u!==c)return!1;if(u&&c)return t.getTime()===n.getTime();var d=t instanceof RegExp,h=n instanceof RegExp;if(d!==h)return!1;if(d&&h)return t.toString()===n.toString();var f=Object.keys(t);if(a=f.length,a!==Object.keys(n).length)return!1;for(o=a;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,f[o]))return!1;for(o=a;o--!==0;)if(l=f[o],!this.deepEquals(t[l],n[l]))return!1;return!0}return t!==t&&n!==n}},{key:"resolveFieldData",value:function(t,n){if(!t||!n)return null;try{var i=t[n];if(this.isNotEmpty(i))return i}catch{}if(Object.keys(t).length){if(this.isFunction(n))return n(t);if(this.isNotEmpty(t[n]))return t[n];if(n.indexOf(".")===-1)return t[n];for(var s=n.split("."),o=t,a=0,l=s.length;a<l;++a){if(o==null)return null;o=o[s[a]]}return o}return null}},{key:"findDiffKeys",value:function(t,n){return!t||!n?{}:Object.keys(t).filter(function(i){return!n.hasOwnProperty(i)}).reduce(function(i,s){return i[s]=t[s],i},{})}},{key:"reduceKeys",value:function(t,n){var i={};return!t||!n||n.length===0||Object.keys(t).filter(function(s){return n.some(function(o){return s.startsWith(o)})}).forEach(function(s){i[s]=t[s],delete t[s]}),i}},{key:"reorderArray",value:function(t,n,i){t&&n!==i&&(i>=t.length&&(i=i%t.length,n=n%t.length),t.splice(i,0,t.splice(n,1)[0]))}},{key:"findIndexInList",value:function(t,n,i){var s=this;return n?i?n.findIndex(function(o){return s.equals(o,t,i)}):n.findIndex(function(o){return o===t}):-1}},{key:"getJSXElement",value:function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return this.isFunction(t)?t.apply(void 0,i):t}},{key:"getItemValue",value:function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return this.isFunction(t)?t.apply(void 0,i):t}},{key:"getProp",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=t?t[n]:void 0;return s===void 0?i[n]:s}},{key:"getPropCaseInsensitive",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=this.toFlatCase(n);for(var o in t)if(t.hasOwnProperty(o)&&this.toFlatCase(o)===s)return t[o];for(var a in i)if(i.hasOwnProperty(a)&&this.toFlatCase(a)===s)return i[a]}},{key:"getMergedProps",value:function(t,n){return Object.assign({},n,t)}},{key:"getDiffProps",value:function(t,n){return this.findDiffKeys(t,n)}},{key:"getPropValue",value:function(t){if(!this.isFunction(t))return t;for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];if(i.length===1){var o=i[0];return t(Array.isArray(o)?o[0]:o)}return t.apply(void 0,i)}},{key:"getComponentProp",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.isNotEmpty(t)?this.getProp(t.props,n,i):void 0}},{key:"getComponentProps",value:function(t,n){return this.isNotEmpty(t)?this.getMergedProps(t.props,n):void 0}},{key:"getComponentDiffProps",value:function(t,n){return this.isNotEmpty(t)?this.getDiffProps(t.props,n):void 0}},{key:"isValidChild",value:function(t,n,i){if(t){var s,o=this.getComponentProp(t,"__TYPE")||(t.type?t.type.displayName:void 0);!o&&t!==null&&t!==void 0&&(s=t.type)!==null&&s!==void 0&&(s=s._payload)!==null&&s!==void 0&&s.value&&(o=t.type._payload.value.find(function(u){return u===n}));var a=o===n;try{var l}catch{}return a}return!1}},{key:"getRefElement",value:function(t){return t?De(t)==="object"&&t.hasOwnProperty("current")?t.current:t:null}},{key:"combinedRefs",value:function(t,n){t&&n&&(typeof n=="function"?n(t.current):n.current=t.current)}},{key:"removeAccents",value:function(t){return t&&t.search(/[\xC0-\xFF]/g)>-1&&(t=t.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),t}},{key:"toFlatCase",value:function(t){return this.isNotEmpty(t)&&this.isString(t)?t.replace(/(-|_)/g,"").toLowerCase():t}},{key:"toCapitalCase",value:function(t){return this.isNotEmpty(t)&&this.isString(t)?t[0].toUpperCase()+t.slice(1):t}},{key:"trim",value:function(t){return this.isNotEmpty(t)&&this.isString(t)?t.trim():t}},{key:"isEmpty",value:function(t){return t==null||t===""||Array.isArray(t)&&t.length===0||!(t instanceof Date)&&De(t)==="object"&&Object.keys(t).length===0}},{key:"isNotEmpty",value:function(t){return!this.isEmpty(t)}},{key:"isFunction",value:function(t){return!!(t&&t.constructor&&t.call&&t.apply)}},{key:"isObject",value:function(t){return t!==null&&t instanceof Object&&t.constructor===Object}},{key:"isDate",value:function(t){return t!==null&&t instanceof Date&&t.constructor===Date}},{key:"isArray",value:function(t){return t!==null&&Array.isArray(t)}},{key:"isString",value:function(t){return t!==null&&typeof t=="string"}},{key:"isPrintableCharacter",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return this.isNotEmpty(t)&&t.length===1&&t.match(/\S| /)}},{key:"isLetter",value:function(t){return/^[a-zA-Z\u00C0-\u017F]$/.test(t)}},{key:"isScalar",value:function(t){return t!=null&&(typeof t=="string"||typeof t=="number"||typeof t=="bigint"||typeof t=="boolean")}},{key:"findLast",value:function(t,n){var i;if(this.isNotEmpty(t))try{i=t.findLast(n)}catch{i=$o(t).reverse().find(n)}return i}},{key:"findLastIndex",value:function(t,n){var i=-1;if(this.isNotEmpty(t))try{i=t.findLastIndex(n)}catch{i=t.lastIndexOf($o(t).reverse().find(n))}return i}},{key:"sort",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1,a=this.compare(t,n,s,i),l=i;return(this.isEmpty(t)||this.isEmpty(n))&&(l=o===1?i:o),l*a}},{key:"compare",value:function(t,n,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,o=-1,a=this.isEmpty(t),l=this.isEmpty(n);return a&&l?o=0:a?o=s:l?o=-s:typeof t=="string"&&typeof n=="string"?o=i(t,n):o=t<n?-1:t>n?1:0,o}},{key:"localeComparator",value:function(t){return new Intl.Collator(t,{numeric:!0}).compare}},{key:"findChildrenByKey",value:function(t,n){var i=X0(t),s;try{for(i.s();!(s=i.n()).done;){var o=s.value;if(o.key===n)return o.children||[];if(o.children){var a=this.findChildrenByKey(o.children,n);if(a.length>0)return a}}}catch(l){i.e(l)}finally{i.f()}return[]}},{key:"mutateFieldData",value:function(t,n,i){if(!(De(t)!=="object"||typeof n!="string"))for(var s=n.split("."),o=t,a=0,l=s.length;a<l;++a){if(a+1-l===0){o[s[a]]=i;break}o[s[a]]||(o[s[a]]={}),o=o[s[a]]}}},{key:"getNestedValue",value:function(t,n){return n.split(".").reduce(function(i,s){return i&&i[s]!==void 0?i[s]:void 0},t)}},{key:"absoluteCompare",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(!t||!n||s>i)return!0;if(De(t)!==De(n))return!1;var o=Object.keys(t),a=Object.keys(n);if(o.length!==a.length)return!1;for(var l=0,u=o;l<u.length;l++){var c=u[l],d=t[c],h=n[c],f=r.isObject(d)&&r.isObject(h),m=r.isFunction(d)&&r.isFunction(h);if((f||m)&&!this.absoluteCompare(d,h,i,s+1)||!f&&d!==h)return!1}return!0}},{key:"selectiveCompare",value:function(t,n,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(t===n)return!0;if(!t||!n||De(t)!=="object"||De(n)!=="object")return!1;if(!i)return this.absoluteCompare(t,n,1);var o=X0(i),a;try{for(o.s();!(a=o.n()).done;){var l=a.value,u=this.getNestedValue(t,l),c=this.getNestedValue(n,l),d=De(u)==="object"&&u!==null&&De(c)==="object"&&c!==null;if(d&&!this.absoluteCompare(u,c,s)||!d&&u!==c)return!1}}catch(h){o.e(h)}finally{o.f()}return!0}}])})(),Q0=0;function j1(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"pr_id_";return Q0++,"".concat(r).concat(Q0)}function eu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function tu(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?eu(Object(t),!0).forEach(function(n){Ho(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):eu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ji(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r){var t=function(o){return typeof o=="function"},n=e.classNameMergeFunction,i=t(n);return r.reduce(function(s,o){if(!o)return s;var a=function(){var c=o[l];if(l==="style")s.style=tu(tu({},s.style),o.style);else if(l==="className"){var d="";i?d=n(s.className,o.className):d=[s.className,o.className].join(" ").trim(),s.className=d||void 0}else if(t(c)){var h=s[l];s[l]=h?function(){h.apply(void 0,arguments),c.apply(void 0,arguments)}:c}else s[l]=c};for(var l in o)a();return s},{})}}var rt=Object.freeze({STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",NOT_IN:"notIn",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter",CUSTOM:"custom"});function ri(r){"@babel/helpers - typeof";return ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ri(r)}function q1(r,e){if(ri(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(ri(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function W1(r){var e=q1(r,"string");return ri(e)=="symbol"?e:e+""}function wt(r,e,t){return(e=W1(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function U1(r,e,t){return Object.defineProperty(r,"prototype",{writable:!1}),r}function G1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var pt=U1(function r(){G1(this,r)});wt(pt,"ripple",!1),wt(pt,"inputStyle","outlined"),wt(pt,"locale","en"),wt(pt,"appendTo",null),wt(pt,"cssTransition",!0),wt(pt,"autoZIndex",!0),wt(pt,"hideOverlaysOnDocumentScrolling",!1),wt(pt,"nonce",null),wt(pt,"nullSortOrder",1),wt(pt,"zIndex",{modal:1100,overlay:1e3,menu:1e3,tooltip:1100,toast:1200}),wt(pt,"pt",void 0),wt(pt,"filterMatchModeOptions",{text:[rt.STARTS_WITH,rt.CONTAINS,rt.NOT_CONTAINS,rt.ENDS_WITH,rt.EQUALS,rt.NOT_EQUALS],numeric:[rt.EQUALS,rt.NOT_EQUALS,rt.LESS_THAN,rt.LESS_THAN_OR_EQUAL_TO,rt.GREATER_THAN,rt.GREATER_THAN_OR_EQUAL_TO],date:[rt.DATE_IS,rt.DATE_IS_NOT,rt.DATE_BEFORE,rt.DATE_AFTER]}),wt(pt,"changeTheme",function(r,e,t,n){var i,s=document.getElementById(t);if(!s)throw Error("Element with id ".concat(t," not found."));var o=s.getAttribute("href").replace(r,e),a=document.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("id",t),a.setAttribute("href",o),a.addEventListener("load",function(){n&&n()}),(i=s.parentNode)===null||i===void 0||i.replaceChild(a,s)});var _o=z.createContext(),Yi=pt;function K1(r){if(Array.isArray(r))return r}function J1(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,s,o,a=[],l=!0,u=!1;try{if(s=(t=t.call(r)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function ru(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function Y1(r,e){if(r){if(typeof r=="string")return ru(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ru(r,e):void 0}}function X1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
17
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
15
|
+
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(n)),s=[],o=ka(i),a;try{for(o.s();!(a=o.n()).done;){var l=a.value;getComputedStyle(l).display!=="none"&&getComputedStyle(l).visibility!=="hidden"&&s.push(l)}}catch(u){o.e(u)}finally{o.f()}return s}},{key:"getFirstFocusableElement",value:function(t,n){var i=r.getFocusableElements(t,n);return i.length>0?i[0]:null}},{key:"getLastFocusableElement",value:function(t,n){var i=r.getFocusableElements(t,n);return i.length>0?i[i.length-1]:null}},{key:"focus",value:function(t,n){var i=n===void 0?!0:!n;t&&document.activeElement!==t&&t.focus({preventScroll:i})}},{key:"focusFirstElement",value:function(t,n){if(t){var i=r.getFirstFocusableElement(t);return i&&r.focus(i,n),i}}},{key:"getCursorOffset",value:function(t,n,i,s){if(t){var o=getComputedStyle(t),a=document.createElement("div");a.style.position="absolute",a.style.top="0px",a.style.left="0px",a.style.visibility="hidden",a.style.pointerEvents="none",a.style.overflow=o.overflow,a.style.width=o.width,a.style.height=o.height,a.style.padding=o.padding,a.style.border=o.border,a.style.overflowWrap=o.overflowWrap,a.style.whiteSpace=o.whiteSpace,a.style.lineHeight=o.lineHeight,a.innerHTML=n.replace(/\r\n|\r|\n/g,"<br />");var l=document.createElement("span");l.textContent=s,a.appendChild(l);var u=document.createTextNode(i);a.appendChild(u),document.body.appendChild(a);var c=l.offsetLeft,d=l.offsetTop,h=l.clientHeight;return document.body.removeChild(a),{left:Math.abs(c-t.scrollLeft),top:Math.abs(d-t.scrollTop)+h}}return{top:"auto",left:"auto"}}},{key:"invokeElementMethod",value:function(t,n,i){t[n].apply(t,i)}},{key:"isClickable",value:function(t){var n=t.nodeName,i=t.parentElement&&t.parentElement.nodeName;return n==="INPUT"||n==="TEXTAREA"||n==="BUTTON"||n==="A"||i==="INPUT"||i==="TEXTAREA"||i==="BUTTON"||i==="A"||this.hasClass(t,"p-button")||this.hasClass(t.parentElement,"p-button")||this.hasClass(t.parentElement,"p-checkbox")||this.hasClass(t.parentElement,"p-radiobutton")}},{key:"applyStyle",value:function(t,n){if(typeof n=="string")t.style.cssText=n;else for(var i in n)t.style[i]=n[i]}},{key:"exportCSV",value:function(t,n){var i=new Blob([t],{type:"application/csv;charset=utf-8;"});if(window.navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(i,n+".csv");else{var s=r.saveAs({name:n+".csv",src:URL.createObjectURL(i)});s||(t="data:text/csv;charset=utf-8,"+t,window.open(encodeURI(t)))}}},{key:"saveAs",value:function(t){if(t){var n=document.createElement("a");if(n.download!==void 0){var i=t.name,s=t.src;return n.setAttribute("href",s),n.setAttribute("download",i),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n),!0}}return!1}},{key:"createInlineStyle",value:function(t,n){var i=document.createElement("style");return r.addNonce(i,t),n||(n=document.head),n.appendChild(i),i}},{key:"removeInlineStyle",value:function(t){if(this.isExist(t)){try{t.parentNode.removeChild(t)}catch{}t=null}return t}},{key:"addNonce",value:function(t,n){try{n||(n=process.env.REACT_APP_CSS_NONCE)}catch{}n&&t.setAttribute("nonce",n)}},{key:"getTargetElement",value:function(t){if(!t)return null;if(t==="document")return document;if(t==="window")return window;if(Le(t)==="object"&&t.hasOwnProperty("current"))return this.isExist(t.current)?t.current:null;var n=function(o){return!!(o&&o.constructor&&o.call&&o.apply)},i=n(t)?t():t;return this.isDocument(i)||this.isExist(i)?i:null}},{key:"getAttributeNames",value:function(t){var n,i,s;for(i=[],s=t.attributes,n=0;n<s.length;++n)i.push(s[n].nodeName);return i.sort(),i}},{key:"isEqualElement",value:function(t,n){var i,s,o,a,l;if(i=r.getAttributeNames(t),s=r.getAttributeNames(n),i.join(",")!==s.join(","))return!1;for(var u=0;u<i.length;++u)if(o=i[u],o==="style")for(var c=t.style,d=n.style,h=/^\d+$/,f=0,m=Object.keys(c);f<m.length;f++){var v=m[f];if(!h.test(v)&&c[v]!==d[v])return!1}else if(t.getAttribute(o)!==n.getAttribute(o))return!1;for(a=t.firstChild,l=n.firstChild;a&&l;a=a.nextSibling,l=l.nextSibling){if(a.nodeType!==l.nodeType)return!1;if(a.nodeType===1){if(!r.isEqualElement(a,l))return!1}else if(a.nodeValue!==l.nodeValue)return!1}return!(a||l)}},{key:"hasCSSAnimation",value:function(t){if(t){var n=getComputedStyle(t),i=parseFloat(n.getPropertyValue("animation-duration")||"0");return i>0}return!1}},{key:"hasCSSTransition",value:function(t){if(t){var n=getComputedStyle(t),i=parseFloat(n.getPropertyValue("transition-duration")||"0");return i>0}return!1}}])})();As(ce,"DATA_PROPS",["data-"]),As(ce,"ARIA_PROPS",["aria","focus-target"]);function Ta(){return Ta=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Ta.apply(null,arguments)}function qu(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Qg(r))||e){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
16
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return o=u.done,u},e:function(u){a=!0,s=u},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}function Qg(r,e){if(r){if(typeof r=="string")return Wu(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Wu(r,e):void 0}}function Wu(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}var Se=(function(){function r(){xa(this,r)}return Sa(r,null,[{key:"equals",value:function(t,n,i){return i&&t&&Le(t)==="object"&&n&&Le(n)==="object"?this.deepEquals(this.resolveFieldData(t,i),this.resolveFieldData(n,i)):this.deepEquals(t,n)}},{key:"deepEquals",value:function(t,n){if(t===n)return!0;if(t&&n&&Le(t)==="object"&&Le(n)==="object"){var i=Array.isArray(t),s=Array.isArray(n),o,a,l;if(i&&s){if(a=t.length,a!==n.length)return!1;for(o=a;o--!==0;)if(!this.deepEquals(t[o],n[o]))return!1;return!0}if(i!==s)return!1;var u=t instanceof Date,c=n instanceof Date;if(u!==c)return!1;if(u&&c)return t.getTime()===n.getTime();var d=t instanceof RegExp,h=n instanceof RegExp;if(d!==h)return!1;if(d&&h)return t.toString()===n.toString();var f=Object.keys(t);if(a=f.length,a!==Object.keys(n).length)return!1;for(o=a;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,f[o]))return!1;for(o=a;o--!==0;)if(l=f[o],!this.deepEquals(t[l],n[l]))return!1;return!0}return t!==t&&n!==n}},{key:"resolveFieldData",value:function(t,n){if(!t||!n)return null;try{var i=t[n];if(this.isNotEmpty(i))return i}catch{}if(Object.keys(t).length){if(this.isFunction(n))return n(t);if(this.isNotEmpty(t[n]))return t[n];if(n.indexOf(".")===-1)return t[n];for(var s=n.split("."),o=t,a=0,l=s.length;a<l;++a){if(o==null)return null;o=o[s[a]]}return o}return null}},{key:"findDiffKeys",value:function(t,n){return!t||!n?{}:Object.keys(t).filter(function(i){return!n.hasOwnProperty(i)}).reduce(function(i,s){return i[s]=t[s],i},{})}},{key:"reduceKeys",value:function(t,n){var i={};return!t||!n||n.length===0||Object.keys(t).filter(function(s){return n.some(function(o){return s.startsWith(o)})}).forEach(function(s){i[s]=t[s],delete t[s]}),i}},{key:"reorderArray",value:function(t,n,i){t&&n!==i&&(i>=t.length&&(i=i%t.length,n=n%t.length),t.splice(i,0,t.splice(n,1)[0]))}},{key:"findIndexInList",value:function(t,n,i){var s=this;return n?i?n.findIndex(function(o){return s.equals(o,t,i)}):n.findIndex(function(o){return o===t}):-1}},{key:"getJSXElement",value:function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return this.isFunction(t)?t.apply(void 0,i):t}},{key:"getItemValue",value:function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return this.isFunction(t)?t.apply(void 0,i):t}},{key:"getProp",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=t?t[n]:void 0;return s===void 0?i[n]:s}},{key:"getPropCaseInsensitive",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=this.toFlatCase(n);for(var o in t)if(t.hasOwnProperty(o)&&this.toFlatCase(o)===s)return t[o];for(var a in i)if(i.hasOwnProperty(a)&&this.toFlatCase(a)===s)return i[a]}},{key:"getMergedProps",value:function(t,n){return Object.assign({},n,t)}},{key:"getDiffProps",value:function(t,n){return this.findDiffKeys(t,n)}},{key:"getPropValue",value:function(t){if(!this.isFunction(t))return t;for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];if(i.length===1){var o=i[0];return t(Array.isArray(o)?o[0]:o)}return t.apply(void 0,i)}},{key:"getComponentProp",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.isNotEmpty(t)?this.getProp(t.props,n,i):void 0}},{key:"getComponentProps",value:function(t,n){return this.isNotEmpty(t)?this.getMergedProps(t.props,n):void 0}},{key:"getComponentDiffProps",value:function(t,n){return this.isNotEmpty(t)?this.getDiffProps(t.props,n):void 0}},{key:"isValidChild",value:function(t,n,i){if(t){var s,o=this.getComponentProp(t,"__TYPE")||(t.type?t.type.displayName:void 0);!o&&t!==null&&t!==void 0&&(s=t.type)!==null&&s!==void 0&&(s=s._payload)!==null&&s!==void 0&&s.value&&(o=t.type._payload.value.find(function(u){return u===n}));var a=o===n;try{var l}catch{}return a}return!1}},{key:"getRefElement",value:function(t){return t?Le(t)==="object"&&t.hasOwnProperty("current")?t.current:t:null}},{key:"combinedRefs",value:function(t,n){t&&n&&(typeof n=="function"?n(t.current):n.current=t.current)}},{key:"removeAccents",value:function(t){return t&&t.search(/[\xC0-\xFF]/g)>-1&&(t=t.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),t}},{key:"toFlatCase",value:function(t){return this.isNotEmpty(t)&&this.isString(t)?t.replace(/(-|_)/g,"").toLowerCase():t}},{key:"toCapitalCase",value:function(t){return this.isNotEmpty(t)&&this.isString(t)?t[0].toUpperCase()+t.slice(1):t}},{key:"trim",value:function(t){return this.isNotEmpty(t)&&this.isString(t)?t.trim():t}},{key:"isEmpty",value:function(t){return t==null||t===""||Array.isArray(t)&&t.length===0||!(t instanceof Date)&&Le(t)==="object"&&Object.keys(t).length===0}},{key:"isNotEmpty",value:function(t){return!this.isEmpty(t)}},{key:"isFunction",value:function(t){return!!(t&&t.constructor&&t.call&&t.apply)}},{key:"isObject",value:function(t){return t!==null&&t instanceof Object&&t.constructor===Object}},{key:"isDate",value:function(t){return t!==null&&t instanceof Date&&t.constructor===Date}},{key:"isArray",value:function(t){return t!==null&&Array.isArray(t)}},{key:"isString",value:function(t){return t!==null&&typeof t=="string"}},{key:"isPrintableCharacter",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return this.isNotEmpty(t)&&t.length===1&&t.match(/\S| /)}},{key:"isLetter",value:function(t){return/^[a-zA-Z\u00C0-\u017F]$/.test(t)}},{key:"isScalar",value:function(t){return t!=null&&(typeof t=="string"||typeof t=="number"||typeof t=="bigint"||typeof t=="boolean")}},{key:"findLast",value:function(t,n){var i;if(this.isNotEmpty(t))try{i=t.findLast(n)}catch{i=wa(t).reverse().find(n)}return i}},{key:"findLastIndex",value:function(t,n){var i=-1;if(this.isNotEmpty(t))try{i=t.findLastIndex(n)}catch{i=t.lastIndexOf(wa(t).reverse().find(n))}return i}},{key:"sort",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1,a=this.compare(t,n,s,i),l=i;return(this.isEmpty(t)||this.isEmpty(n))&&(l=o===1?i:o),l*a}},{key:"compare",value:function(t,n,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,o=-1,a=this.isEmpty(t),l=this.isEmpty(n);return a&&l?o=0:a?o=s:l?o=-s:typeof t=="string"&&typeof n=="string"?o=i(t,n):o=t<n?-1:t>n?1:0,o}},{key:"localeComparator",value:function(t){return new Intl.Collator(t,{numeric:!0}).compare}},{key:"findChildrenByKey",value:function(t,n){var i=qu(t),s;try{for(i.s();!(s=i.n()).done;){var o=s.value;if(o.key===n)return o.children||[];if(o.children){var a=this.findChildrenByKey(o.children,n);if(a.length>0)return a}}}catch(l){i.e(l)}finally{i.f()}return[]}},{key:"mutateFieldData",value:function(t,n,i){if(!(Le(t)!=="object"||typeof n!="string"))for(var s=n.split("."),o=t,a=0,l=s.length;a<l;++a){if(a+1-l===0){o[s[a]]=i;break}o[s[a]]||(o[s[a]]={}),o=o[s[a]]}}},{key:"getNestedValue",value:function(t,n){return n.split(".").reduce(function(i,s){return i&&i[s]!==void 0?i[s]:void 0},t)}},{key:"absoluteCompare",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(!t||!n||s>i)return!0;if(Le(t)!==Le(n))return!1;var o=Object.keys(t),a=Object.keys(n);if(o.length!==a.length)return!1;for(var l=0,u=o;l<u.length;l++){var c=u[l],d=t[c],h=n[c],f=r.isObject(d)&&r.isObject(h),m=r.isFunction(d)&&r.isFunction(h);if((f||m)&&!this.absoluteCompare(d,h,i,s+1)||!f&&d!==h)return!1}return!0}},{key:"selectiveCompare",value:function(t,n,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(t===n)return!0;if(!t||!n||Le(t)!=="object"||Le(n)!=="object")return!1;if(!i)return this.absoluteCompare(t,n,1);var o=qu(i),a;try{for(o.s();!(a=o.n()).done;){var l=a.value,u=this.getNestedValue(t,l),c=this.getNestedValue(n,l),d=Le(u)==="object"&&u!==null&&Le(c)==="object"&&c!==null;if(d&&!this.absoluteCompare(u,c,s)||!d&&u!==c)return!1}}catch(h){o.e(h)}finally{o.f()}return!0}}])})(),Uu=0;function Ca(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"pr_id_";return Uu++,"".concat(r).concat(Uu)}function Ku(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function e4(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ku(Object(t),!0).forEach(function(n){As(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ku(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Ci=(function(){function r(){xa(this,r)}return Sa(r,null,[{key:"getJSXIcon",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=null;if(t!==null){var o=Le(t),a=Et(n.className,o==="string"&&t);if(s=H.createElement("span",Ta({},n,{className:a,key:Ca("icon")})),o!=="string"){var l=e4({iconProps:n,element:s},i);return Se.getJSXElement(t,l)}}return s}}])})();function Gu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ju(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gu(Object(t),!0).forEach(function(n){As(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Gu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Os(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r){var t=function(o){return typeof o=="function"},n=e.classNameMergeFunction,i=t(n);return r.reduce(function(s,o){if(!o)return s;var a=function(){var c=o[l];if(l==="style")s.style=Ju(Ju({},s.style),o.style);else if(l==="className"){var d="";i?d=n(s.className,o.className):d=[s.className,o.className].join(" ").trim(),s.className=d||void 0}else if(t(c)){var h=s[l];s[l]=h?function(){h.apply(void 0,arguments),c.apply(void 0,arguments)}:c}else s[l]=c};for(var l in o)a();return s},{})}}var at=Object.freeze({STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",NOT_IN:"notIn",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter",CUSTOM:"custom"});function Mi(r){"@babel/helpers - typeof";return Mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mi(r)}function t4(r,e){if(Mi(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function r4(r){var e=t4(r,"string");return Mi(e)=="symbol"?e:e+""}function At(r,e,t){return(e=r4(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function n4(r,e,t){return Object.defineProperty(r,"prototype",{writable:!1}),r}function i4(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var lt=n4(function r(){i4(this,r)});At(lt,"ripple",!1),At(lt,"inputStyle","outlined"),At(lt,"locale","en"),At(lt,"appendTo",null),At(lt,"cssTransition",!0),At(lt,"autoZIndex",!0),At(lt,"hideOverlaysOnDocumentScrolling",!1),At(lt,"nonce",null),At(lt,"nullSortOrder",1),At(lt,"zIndex",{modal:1100,overlay:1e3,menu:1e3,tooltip:1100,toast:1200}),At(lt,"pt",void 0),At(lt,"filterMatchModeOptions",{text:[at.STARTS_WITH,at.CONTAINS,at.NOT_CONTAINS,at.ENDS_WITH,at.EQUALS,at.NOT_EQUALS],numeric:[at.EQUALS,at.NOT_EQUALS,at.LESS_THAN,at.LESS_THAN_OR_EQUAL_TO,at.GREATER_THAN,at.GREATER_THAN_OR_EQUAL_TO],date:[at.DATE_IS,at.DATE_IS_NOT,at.DATE_BEFORE,at.DATE_AFTER]}),At(lt,"changeTheme",function(r,e,t,n){var i,s=document.getElementById(t);if(!s)throw Error("Element with id ".concat(t," not found."));var o=s.getAttribute("href").replace(r,e),a=document.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("id",t),a.setAttribute("href",o),a.addEventListener("load",function(){n&&n()}),(i=s.parentNode)===null||i===void 0||i.replaceChild(a,s)});var s4={en:{accept:"Yes",addRule:"Add Rule",am:"AM",apply:"Apply",cancel:"Cancel",choose:"Choose",chooseDate:"Choose Date",chooseMonth:"Choose Month",chooseYear:"Choose Year",clear:"Clear",completed:"Completed",contains:"Contains",custom:"Custom",dateAfter:"Date is after",dateBefore:"Date is before",dateFormat:"mm/dd/yy",dateIs:"Date is",dateIsNot:"Date is not",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],emptyFilterMessage:"No results found",emptyMessage:"No available options",emptySearchMessage:"No results found",emptySelectionMessage:"No selected item",endsWith:"Ends with",equals:"Equals",fileChosenMessage:"{0} files",fileSizeTypes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"],filter:"Filter",firstDayOfWeek:0,gt:"Greater than",gte:"Greater than or equal to",lt:"Less than",lte:"Less than or equal to",matchAll:"Match All",matchAny:"Match Any",medium:"Medium",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],nextDecade:"Next Decade",nextHour:"Next Hour",nextMinute:"Next Minute",nextMonth:"Next Month",nextSecond:"Next Second",nextYear:"Next Year",noFileChosenMessage:"No file chosen",noFilter:"No Filter",notContains:"Not contains",notEquals:"Not equals",now:"Now",passwordPrompt:"Enter a password",pending:"Pending",pm:"PM",prevDecade:"Previous Decade",prevHour:"Previous Hour",prevMinute:"Previous Minute",prevMonth:"Previous Month",prevSecond:"Previous Second",prevYear:"Previous Year",reject:"No",removeRule:"Remove Rule",searchMessage:"{0} results are available",selectionMessage:"{0} items selected",showMonthAfterYear:!1,startsWith:"Starts with",strong:"Strong",today:"Today",upload:"Upload",weak:"Weak",weekHeader:"Wk",aria:{cancelEdit:"Cancel Edit",close:"Close",collapseLabel:"Collapse",collapseRow:"Row Collapsed",editRow:"Edit Row",expandLabel:"Expand",expandRow:"Row Expanded",falseLabel:"False",filterConstraint:"Filter Constraint",filterOperator:"Filter Operator",firstPageLabel:"First Page",gridView:"Grid View",hideFilterMenu:"Hide Filter Menu",jumpToPageDropdownLabel:"Jump to Page Dropdown",jumpToPageInputLabel:"Jump to Page Input",lastPageLabel:"Last Page",listLabel:"Option List",listView:"List View",moveAllToSource:"Move All to Source",moveAllToTarget:"Move All to Target",moveBottom:"Move Bottom",moveDown:"Move Down",moveToSource:"Move to Source",moveToTarget:"Move to Target",moveTop:"Move Top",moveUp:"Move Up",navigation:"Navigation",next:"Next",nextPageLabel:"Next Page",nullLabel:"Not Selected",otpLabel:"Please enter one time password character {0}",pageLabel:"Page {page}",passwordHide:"Hide Password",passwordShow:"Show Password",previous:"Previous",prevPageLabel:"Previous Page",removeLabel:"Remove",rotateLeft:"Rotate Left",rotateRight:"Rotate Right",rowsPerPageLabel:"Rows per page",saveEdit:"Save Edit",scrollTop:"Scroll Top",selectAll:"All items selected",selectLabel:"Select",selectRow:"Row Selected",showFilterMenu:"Show Filter Menu",slide:"Slide",slideNumber:"{slideNumber}",star:"1 star",stars:"{star} stars",trueLabel:"True",unselectAll:"All items unselected",unselectLabel:"Unselect",unselectRow:"Row Unselected",zoomImage:"Zoom Image",zoomIn:"Zoom In",zoomOut:"Zoom Out"}}};function Ma(r,e){if(r.includes("__proto__")||r.includes("prototype"))throw new Error("Unsafe ariaKey detected");var t=lt.locale;try{var n=o4(t).aria[r];if(n)for(var i in e)e.hasOwnProperty(i)&&(n=n.replace("{".concat(i,"}"),e[i]));return n}catch{throw new Error("The ".concat(r," option is not found in the current locale('").concat(t,"')."))}}function o4(r){var e=r||lt.locale;if(e.includes("__proto__")||e.includes("prototype"))throw new Error("Unsafe locale detected");return s4[e]}var Ei=B.createContext(),Ai=lt;function a4(r){if(Array.isArray(r))return r}function l4(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,s,o,a=[],l=!0,u=!1;try{if(s=(t=t.call(r)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function Yu(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function u4(r,e){if(r){if(typeof r=="string")return Yu(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Yu(r,e):void 0}}function c4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
17
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d4(r,e){return a4(r)||l4(r,e)||u4(r,e)||c4()}var Xu=function(e){var t=H.useRef(null);return H.useEffect(function(){return t.current=e,function(){t.current=null}},[e]),t.current},Ea=function(e){return H.useEffect(function(){return e},[])},Zu=function(e){var t=e.target,n=t===void 0?"document":t,i=e.type,s=e.listener,o=e.options,a=e.when,l=a===void 0?!0:a,u=H.useRef(null),c=H.useRef(null),d=Xu(s),h=Xu(o),f=function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},E=k.target;Se.isNotEmpty(E)&&(m(),(k.when||l)&&(u.current=ce.getTargetElement(E))),!c.current&&u.current&&(c.current=function(I){return s&&s(I)},u.current.addEventListener(i,c.current,o))},m=function(){c.current&&(u.current.removeEventListener(i,c.current,o),c.current=null)},v=function(){m(),d=null,h=null},y=H.useCallback(function(){l?u.current=ce.getTargetElement(n):(m(),u.current=null)},[n,l]);return H.useEffect(function(){y()},[y]),H.useEffect(function(){var w="".concat(d)!=="".concat(s),k=h!==o,E=c.current;E&&(w||k)?(m(),l&&f()):E||v()},[s,o,l]),Ea(function(){v()}),[f,m]},Aa=function(){var e=B.useContext(Ei);return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Os(n,e?.ptOptions)}},Ns=function(e){var t=H.useRef(!1);return H.useEffect(function(){if(!t.current)return t.current=!0,e&&e()},[])},f4=0,Oi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=B.useState(!1),i=d4(n,2),s=i[0],o=i[1],a=B.useRef(null),l=B.useContext(Ei),u=ce.isClient()?window.document:void 0,c=t.document,d=c===void 0?u:c,h=t.manual,f=h===void 0?!1:h,m=t.name,v=m===void 0?"style_".concat(++f4):m,y=t.id,w=y===void 0?void 0:y,k=t.media,E=k===void 0?void 0:k,I=function(z){var F=z.querySelector('style[data-primereact-style-id="'.concat(v,'"]'));if(F)return F;if(w!==void 0){var re=d.getElementById(w);if(re)return re}return d.createElement("style")},A=function(z){s&&e!==z&&(a.current.textContent=z)},N=function(){if(!(!d||s)){var z=l?.styleContainer||d.head;a.current=I(z),a.current.isConnected||(a.current.type="text/css",w&&(a.current.id=w),E&&(a.current.media=E),ce.addNonce(a.current,l&&l.nonce||Ai.nonce),z.appendChild(a.current),v&&a.current.setAttribute("data-primereact-style-id",v)),a.current.textContent=e,o(!0)}},P=function(){!d||!a.current||(ce.removeInlineStyle(a.current),o(!1))};return B.useEffect(function(){f||N()},[f]),{id:w,name:v,update:A,unload:P,load:N,isLoaded:s}},Ni=function(e,t){var n=H.useRef(!1);return H.useEffect(function(){if(!n.current){n.current=!0;return}return e&&e()},t)};function Oa(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function h4(r){if(Array.isArray(r))return Oa(r)}function p4(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function m4(r,e){if(r){if(typeof r=="string")return Oa(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Oa(r,e):void 0}}function g4(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qu(r){return h4(r)||p4(r)||m4(r)||g4()}function Di(r){"@babel/helpers - typeof";return Di=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Di(r)}function v4(r,e){if(Di(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(Di(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function y4(r){var e=v4(r,"string");return Di(e)=="symbol"?e:e+""}function Na(r,e,t){return(e=y4(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ec(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Qe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ec(Object(t),!0).forEach(function(n){Na(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ec(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var b4=`
|
|
19
19
|
.p-hidden-accessible {
|
|
20
20
|
border: 0;
|
|
21
21
|
clip: rect(0 0 0 0);
|
|
@@ -34,7 +34,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
34
34
|
overflow: hidden;
|
|
35
35
|
padding-right: var(--scrollbar-width);
|
|
36
36
|
}
|
|
37
|
-
`,
|
|
37
|
+
`,w4=`
|
|
38
38
|
.p-button {
|
|
39
39
|
margin: 0;
|
|
40
40
|
display: inline-flex;
|
|
@@ -117,7 +117,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
117
117
|
border-top-left-radius: var(--border-radius) !important;
|
|
118
118
|
border-bottom-left-radius: var(--border-radius) !important;
|
|
119
119
|
}
|
|
120
|
-
`,
|
|
120
|
+
`,x4=`
|
|
121
121
|
.p-inputtext {
|
|
122
122
|
margin: 0;
|
|
123
123
|
}
|
|
@@ -224,7 +224,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
224
224
|
display: block;
|
|
225
225
|
width: 100%;
|
|
226
226
|
}
|
|
227
|
-
`,
|
|
227
|
+
`,S4=`
|
|
228
228
|
.p-icon {
|
|
229
229
|
display: inline-block;
|
|
230
230
|
}
|
|
@@ -264,7 +264,7 @@ svg.p-icon g,
|
|
|
264
264
|
transform: rotate(359deg);
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
`,
|
|
267
|
+
`,k4=`
|
|
268
268
|
@layer primereact {
|
|
269
269
|
.p-component, .p-component * {
|
|
270
270
|
box-sizing: border-box;
|
|
@@ -415,13 +415,13 @@ svg.p-icon g,
|
|
|
415
415
|
position: relative;
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
-
`.concat(
|
|
419
|
-
`).concat(
|
|
420
|
-
`).concat(
|
|
418
|
+
`.concat(w4,`
|
|
419
|
+
`).concat(x4,`
|
|
420
|
+
`).concat(S4,`
|
|
421
421
|
}
|
|
422
|
-
`)
|
|
423
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
424
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
422
|
+
`),$e={cProps:void 0,cParams:void 0,cName:void 0,defaultProps:{pt:void 0,ptOptions:void 0,unstyled:!1},context:{},globalCSS:void 0,classes:{},styles:"",extend:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.css,n=Qe(Qe({},e.defaultProps),$e.defaultProps),i={},s=function(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return $e.context=d,$e.cProps=c,Se.getMergedProps(c,n)},o=function(c){return Se.getDiffProps(c,n)},a=function(){var c,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;d.hasOwnProperty("pt")&&d.pt!==void 0&&(d=d.pt);var v=h,y=/./g.test(v)&&!!f[v.split(".")[0]],w=y?Se.toFlatCase(v.split(".")[1]):Se.toFlatCase(v),k=f.hostName&&Se.toFlatCase(f.hostName),E=k||f.props&&f.props.__TYPE&&Se.toFlatCase(f.props.__TYPE)||"",I=w==="transition",A="data-pc-",N=function(se){return se!=null&&se.props?se.hostName?se.props.__TYPE===se.hostName?se.props:N(se.parent):se.parent:void 0},P=function(se){var Te,C;return((Te=f.props)===null||Te===void 0?void 0:Te[se])||((C=N(f))===null||C===void 0?void 0:C[se])};$e.cParams=f,$e.cName=E;var L=P("ptOptions")||$e.context.ptOptions||{},z=L.mergeSections,F=z===void 0?!0:z,re=L.mergeProps,oe=re===void 0?!1:re,ye=function(){var se=vr.apply(void 0,arguments);return Array.isArray(se)?{className:Et.apply(void 0,Qu(se))}:Se.isString(se)?{className:se}:se!=null&&se.hasOwnProperty("className")&&Array.isArray(se.className)?{className:Et.apply(void 0,Qu(se.className))}:se},ae=m?y?tc(ye,v,f):rc(ye,v,f):void 0,G=y?void 0:Ps(Ds(d,E),ye,v,f),ee=!I&&Qe(Qe({},w==="root"&&Na({},"".concat(A,"name"),f.props&&f.props.__parentMetadata?Se.toFlatCase(f.props.__TYPE):E)),{},Na({},"".concat(A,"section"),w));return F||!F&&G?oe?Os([ae,G,Object.keys(ee).length?ee:{}],{classNameMergeFunction:(c=$e.context.ptOptions)===null||c===void 0?void 0:c.classNameMergeFunction}):Qe(Qe(Qe({},ae),G),Object.keys(ee).length?ee:{}):Qe(Qe({},G),Object.keys(ee).length?ee:{})},l=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=c.props,h=c.state,f=function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a((d||{}).pt,E,Qe(Qe({},c),I))},m=function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return a(E,I,A,!1)},v=function(){return $e.context.unstyled||Ai.unstyled||d.unstyled},y=function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return v()?void 0:vr(t&&t.classes,E,Qe({props:d,state:h},I))},w=function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(A){var N,P=vr(t&&t.inlineStyles,E,Qe({props:d,state:h},I)),L=vr(i,E,Qe({props:d,state:h},I));return Os([L,P],{classNameMergeFunction:(N=$e.context.ptOptions)===null||N===void 0?void 0:N.classNameMergeFunction})}};return{ptm:f,ptmo:m,sx:w,cx:y,isUnstyled:v}};return Qe(Qe({getProps:s,getOtherProps:o,setMetaData:l},e),{},{defaultProps:n})}},vr=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=String(Se.toFlatCase(t)).split("."),s=i.shift(),o=Se.isNotEmpty(e)?Object.keys(e).find(function(a){return Se.toFlatCase(a)===s}):"";return s?Se.isObject(e)?vr(Se.getItemValue(e[o],n),i.join("."),n):void 0:Se.getItemValue(e,n)},Ds=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=e?._usept,s=function(a){var l,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,c=n?n(a):a,d=Se.toFlatCase(t);return(l=u?d!==$e.cName?c?.[d]:void 0:c?.[d])!==null&&l!==void 0?l:c};return Se.isNotEmpty(i)?{_usept:i,originalValue:s(e.originalValue),value:s(e.value)}:s(e,!0)},Ps=function(e,t,n,i){var s=function(v){return t(v,n,i)};if(e!=null&&e.hasOwnProperty("_usept")){var o=e._usept||$e.context.ptOptions||{},a=o.mergeSections,l=a===void 0?!0:a,u=o.mergeProps,c=u===void 0?!1:u,d=o.classNameMergeFunction,h=s(e.originalValue),f=s(e.value);return h===void 0&&f===void 0?void 0:Se.isString(f)?f:Se.isString(h)?h:l||!l&&f?c?Os([h,f],{classNameMergeFunction:d}):Qe(Qe({},h),f):f}return s(e)},T4=function(){return Ds($e.context.pt||Ai.pt,void 0,function(e){return Se.getItemValue(e,$e.cParams)})},C4=function(){return Ds($e.context.pt||Ai.pt,void 0,function(e){return vr(e,$e.cName,$e.cParams)||Se.getItemValue(e,$e.cParams)})},tc=function(e,t,n){return Ps(T4(),e,t,n)},rc=function(e,t,n){return Ps(C4(),e,t,n)},nc=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,i=n.name,s=n.styled,o=s===void 0?!1:s,a=n.hostName,l=a===void 0?"":a,u=tc(vr,"global.css",$e.cParams),c=Se.toFlatCase(i),d=Oi(b4,{name:"base",manual:!0}),h=d.load,f=Oi(k4,{name:"common",manual:!0}),m=f.load,v=Oi(u,{name:"global",manual:!0}),y=v.load,w=Oi(e,{name:i,manual:!0}),k=w.load,E=function(A){if(!l){var N=Ps(Ds(($e.cProps||{}).pt,c),vr,"hooks.".concat(A)),P=rc(vr,"hooks.".concat(A));N?.(),P?.()}};E("useMountEffect"),Ns(function(){h(),y(),t()||(m(),o||k())}),Ni(function(){E("useUpdateEffect")}),Ea(function(){E("useUnmountEffect")})};function Da(){return Da=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Da.apply(null,arguments)}function Pa(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function M4(r){if(Array.isArray(r))return Pa(r)}function E4(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function ic(r,e){if(r){if(typeof r=="string")return Pa(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Pa(r,e):void 0}}function A4(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
423
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sc(r){return M4(r)||E4(r)||ic(r)||A4()}function Pi(r){"@babel/helpers - typeof";return Pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pi(r)}function O4(r,e){if(Pi(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(Pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function N4(r){var e=O4(r,"string");return Pi(e)=="symbol"?e:e+""}function D4(r,e,t){return(e=N4(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function P4(r){if(Array.isArray(r))return r}function I4(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,s,o,a=[],l=!0,u=!1;try{if(s=(t=t.call(r)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function R4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
424
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Is(r,e){return P4(r)||I4(r,e)||ic(r,e)||R4()}var z4={root:function(e){var t=e.props;return Et("p-splitter p-component p-splitter-".concat(t.layout))},gutter:"p-splitter-gutter",gutterHandler:"p-splitter-gutter-handle",panel:{root:"p-splitter-panel"}},L4=`
|
|
425
425
|
@layer primereact {
|
|
426
426
|
.p-splitter {
|
|
427
427
|
display: flex;
|
|
@@ -483,8 +483,42 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
485
|
|
|
486
|
-
`,ts=He.extend({defaultProps:{__TYPE:"Splitter",className:null,gutterSize:4,id:null,step:5,layout:"horizontal",onResizeEnd:null,stateKey:null,stateStorage:"session",style:null,children:void 0},css:{classes:Mg,styles:Cg}}),rs=He.extend({defaultProps:{__TYPE:"SplitterPanel",className:null,minSize:null,size:null,style:null,children:void 0},getCProps:function(e){return Ee.getComponentProps(e,rs.defaultProps)},getCOtherProps:function(e){return Ee.getComponentDiffProps(e,rs.defaultProps)},getCProp:function(e,t){return Ee.getComponentProp(e,t,rs.defaultProps)}});function hu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Go(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hu(Object(t),!0).forEach(function(n){xg(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):hu(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Ko=function(){},pu=ce.memo(ce.forwardRef(function(r,e){var t=Q1(),n=ce.useContext(_o),i=ts.getProps(r,n),s=ce.useRef(""),o=ce.useRef(null),a=ce.useRef(),l=ce.useRef({}),u=ce.useRef(null),c=ce.useRef(null),d=ce.useRef(null),h=ce.useRef(null),f=ce.useRef(null),m=ce.useRef(null),v=ce.useRef(null),y=ce.useRef(null),w=ce.useRef(null),k=ce.useRef(null),E=ce.useRef(null),R=ce.useRef(null),O=ce.useState([]),N=es(O,2),D=N[0],B=N[1],L=ce.useState(!1),V=es(L,2),te=V[0],ne=V[1],fe=i.stateKey!=null,re=i.children&&i.children.length||1,G=function(K,Q){return Q in K?K[Q]:i.children&&[].concat(i.children)[Q].props.size||100/re},Z=i.layout==="horizontal",ye={props:i,state:{panelSizes:D,nested:Me.getAttribute(o.current&&o.current.parentElement,"data-p-splitter-panel-nested")===!0}},ee=ts.setMetaData(Go({},ye)),ke=ee.ptm,C=ee.cx,x=ee.isUnstyled;mg(ts.css.styles,x,{name:"splitter"});var I=function(K){return ke(K,{context:{nested:te}})},j=su({type:"mousemove",listener:function(K){return P0(K)}}),W=es(j,2),he=W[0],Le=W[1],me=su({type:"mouseup",listener:function(K){z0(K),R0()}}),Ue=es(me,2),At=Ue[0],en=Ue[1],I0=function(){he(),At()},R0=function(){Le(),en()},qt=function(K,Q){return rs.getCProp(K,Q)},_i=function(K,Q){return!(K>100||K<0||Q>100||Q<0||i.children[E.current].props&&i.children[E.current].props.minSize&&i.children[E.current].props.minSize>K||i.children[E.current+1].props&&i.children[E.current+1].props.minSize&&i.children[E.current+1].props.minSize>Q)},Lo=function(){c.current=!1,u.current=null,d.current=null,h.current=null,f.current=null,m.current=null,y.current=null,w.current=null,k.current=null,E.current=null},Yn=ce.useCallback(function(){switch(i.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(i.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}},[i.stateStorage]),ji=function(K){Ee.isArray(K)&&Yn().setItem(i.stateKey,JSON.stringify(K))},kn=ce.useCallback(function(){var xe=Yn().getItem(i.stateKey);xe&&B(JSON.parse(xe))},[Yn,i.stateKey]),tn=function(K,Q,Te){var rn=K.type==="touchstart"?K.touches[0].pageX:K.pageX,nn=K.type==="touchstart"?K.touches[0].pageY:K.pageY;a.current=l.current[Q],u.current=Z?Me.getWidth(o.current):Me.getHeight(o.current),c.current=!0,d.current=Z?rn:nn,h.current=a.current.previousElementSibling,f.current=a.current.nextElementSibling,Te?(m.current=Z?Me.getOuterWidth(h.current,!0):Me.getOuterHeight(h.current,!0),w.current=Z?Me.getOuterWidth(f.current,!0):Me.getOuterHeight(f.current,!0)):(m.current=100*(Z?Me.getOuterWidth(h.current,!0):Me.getOuterHeight(h.current,!0))/u.current,w.current=100*(Z?Me.getOuterWidth(f.current,!0):Me.getOuterHeight(f.current,!0))/u.current),y.current=m.current,k.current=w.current,E.current=Q,!x()&&Me.addClass(a.current,"p-splitter-gutter-resizing"),a.current.setAttribute("data-p-splitter-gutter-resizing",!0),!x()&&Me.addClass(o.current,"p-splitter-resizing"),o.current.setAttribute("data-p-splitter-resizing",!0)},P0=function(K){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,rn,nn,Xn,F0=K.type==="touchmove"?K.touches[0].pageX:K.pageX,$0=K.type==="touchmove"?K.touches[0].pageY:K.pageY;Te?Z?(Xn=100*(m.current+Q)/u.current,nn=100*(w.current-Q)/u.current):(Xn=100*(m.current-Q)/u.current,nn=100*(w.current+Q)/u.current):(Z?rn=F0*100/u.current-d.current*100/u.current:rn=$0*100/u.current-d.current*100/u.current,Xn=m.current+rn,nn=w.current-rn),qi(E.current,Xn,nn)},z0=function(K){var Q=fu(D);Q[E.current]=y.current,Q[E.current+1]=k.current,i.onResizeEnd&&i.onResizeEnd({originalEvent:K,sizes:Q}),fe&&ji(Q),B(Q),!x()&&Me.removeClass(a.current,"p-splitter-gutter-resizing"),l.current&&Object.keys(l.current).forEach(function(Te){return l.current[Te].setAttribute("data-p-splitter-gutter-resizing",!1)}),!x()&&Me.removeClass(o.current,"p-splitter-resizing"),o.current.setAttribute("data-p-splitter-resizing",!1),Lo()},Ox=function(){Ix(),z0()},Nx=function(K,Q){var Te=i.children[Q].props&&i.children[Q].props.minSize||0;switch(K.code){case"ArrowLeft":{Z&&Bo(K,Q,i.step*-1),K.preventDefault();break}case"ArrowRight":{Z&&Bo(K,Q,i.step),K.preventDefault();break}case"ArrowDown":{Z||Bo(K,Q,i.step*-1),K.preventDefault();break}case"ArrowUp":{Z||Bo(K,Q,i.step),K.preventDefault();break}case"Home":{qi(Q,100-Te,Te),K.preventDefault();break}case"End":{qi(Q,Te,100-Te),K.preventDefault();break}case"NumpadEnter":case"Enter":{v.current>=100-(Te||5)?qi(Q,Te,100-Te):qi(Q,100-Te,Te),K.preventDefault();break}}},qi=function(K,Q,Te){E.current=K,a.current=l.current[K],u.current=Z?Me.getWidth(o.current):Me.getHeight(o.current),h.current=a.current.previousElementSibling,f.current=a.current.nextElementSibling,_i(Q,Te)&&(y.current=Q,k.current=Te,h.current.style.flexBasis="calc("+Q+"% - "+(i.children.length-1)*i.gutterSize+"px)",f.current.style.flexBasis="calc("+Te+"% - "+(i.children.length-1)*i.gutterSize+"px)",v.current=parseFloat(Q).toFixed(4))},Dx=function(K,Q,Te){tn(K,Q,!0),P0(K,Te,!0)},Bo=function(K,Q,Te){R.current||(R.current=setInterval(function(){Dx(K,Q,Te)},40))},Ix=function(){R.current&&(clearInterval(R.current),R.current=null)},Rx=function(K,Q){tn(K,Q,!1),I0()},Px=function(K,Q){tn(K,Q,!1),window.addEventListener("touchmove",L0,{passive:!1,cancelable:!1}),window.addEventListener("touchend",B0)},L0=function(K){P0(K)},B0=function(K){z0(K),window.removeEventListener("touchmove",L0),window.removeEventListener("touchend",B0)};ce.useImperativeHandle(e,function(){return{props:i,getElement:function(){return o.current}}}),ou(function(){o.current&&(s.current=j1())}),ce.useEffect(function(){var xe=fu(o.current.children).filter(function(Q){return Me.getAttribute(Q,"data-pc-section")==="splitterpanel.root"}),K=[];xe.map(function(Q,Te){v.current=G(D,0),K[Te]=G(D,Te),Q.childNodes&&Ee.isNotEmpty(Me.find(Q,"[data-pc-name='splitter']")&&Me.find(Q,"[data-pc-section='root']"))&&(!x()&&Me.addClass(Q,"p-splitter-panel-nested"),Q.setAttribute("data-p-splitter-panel-nested",!0),ne(!0))}),B(K)},[]),ce.useEffect(function(){fe&&kn()},[kn,fe]);var zx=function(K,Q){var Te=qt(K,"id")||"".concat(s.current,"_").concat(Q),rn=ti(qt(K,"className"),C("panel.root")),nn=t({ref:function(Wt){return l.current[Q]=Wt},className:C("gutter"),style:Z?{width:i.gutterSize+"px"}:{height:i.gutterSize+"px"},onMouseDown:function(Wt){return Rx(Wt,Q)},onKeyDown:function(Wt){return Nx(Wt,Q)},onKeyUp:Ox,onTouchStart:function(Wt){return Px(Wt,Q)},onTouchMove:function(Wt){return L0(Wt)},onTouchEnd:function(Wt){return B0(Wt)},"data-p-splitter-gutter-resizing":!1},ke("gutter")),Xn=t({tabIndex:qt(K,"tabIndex")||0,className:C("gutterHandler"),role:"separator","aria-orientation":Z?"vertical":"horizontal","aria-controls":Te,"aria-label":qt(K,"aria-label"),"aria-labelledby":qt(K,"aria-labelledby"),"aria-valuenow":v.current,"aria-valuetext":parseFloat(v.current).toFixed(0)+"%","aria-valuemin":qt(K,"minSize")||"0","aria-valuemax":"100"},ke("gutterHandler")),F0=Q!==i.children.length-1&&ce.createElement("div",nn,ce.createElement("div",Xn)),$0="calc("+G(D,Q)+"% - "+(re-1)*i.gutterSize+"px)",$x=t({key:Q,id:Te,className:rn,style:Go(Go({},qt(K,"style")),{},{flexBasis:$0}),role:"presentation","data-p-splitter-panel-nested":!1,onClick:qt(K,"onClick")},I("splitterpanel.root"));return ce.createElement(ce.Fragment,null,ce.createElement("div",$x,qt(K,"children")),F0)},Lx=function(){return ce.Children.map(i.children,zx)},Bx=t({id:i.id,style:i.style,className:ti(i.className,C("root")),"data-p-splitter-resizing":!1},ts.getOtherProps(i),ke("root")),Fx=Lx();return ce.createElement("div",Wo({ref:o},Bx),Fx)}));Ko.displayName="SplitterPanel",pu.displayName="Splitter";function mu(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function Eg(r){if(Array.isArray(r))return r}function Ag(r,e,t){return(e=zg(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Og(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,s,o,a=[],l=!0,u=!1;try{if(s=(t=t.call(r)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function Ng(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
487
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
486
|
+
`,Rs=$e.extend({defaultProps:{__TYPE:"Splitter",className:null,gutterSize:4,id:null,step:5,layout:"horizontal",onResizeEnd:null,stateKey:null,stateStorage:"session",style:null,children:void 0},css:{classes:z4,styles:L4}}),zs=$e.extend({defaultProps:{__TYPE:"SplitterPanel",className:null,minSize:null,size:null,style:null,children:void 0},getCProps:function(e){return Se.getComponentProps(e,zs.defaultProps)},getCOtherProps:function(e){return Se.getComponentDiffProps(e,zs.defaultProps)},getCProp:function(e,t){return Se.getComponentProp(e,t,zs.defaultProps)}});function oc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Ia(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oc(Object(t),!0).forEach(function(n){D4(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):oc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Ra=function(){},ac=H.memo(H.forwardRef(function(r,e){var t=Aa(),n=H.useContext(Ei),i=Rs.getProps(r,n),s=H.useRef(""),o=H.useRef(null),a=H.useRef(),l=H.useRef({}),u=H.useRef(null),c=H.useRef(null),d=H.useRef(null),h=H.useRef(null),f=H.useRef(null),m=H.useRef(null),v=H.useRef(null),y=H.useRef(null),w=H.useRef(null),k=H.useRef(null),E=H.useRef(null),I=H.useRef(null),A=H.useState([]),N=Is(A,2),P=N[0],L=N[1],z=H.useState(!1),F=Is(z,2),re=F[0],oe=F[1],ye=i.stateKey!=null,ae=i.children&&i.children.length||1,G=function(Y,ne){return ne in Y?Y[ne]:i.children&&[].concat(i.children)[ne].props.size||100/ae},ee=i.layout==="horizontal",ke={props:i,state:{panelSizes:P,nested:ce.getAttribute(o.current&&o.current.parentElement,"data-p-splitter-panel-nested")===!0}},se=Rs.setMetaData(Ia({},ke)),Te=se.ptm,C=se.cx,x=se.isUnstyled;nc(Rs.css.styles,x,{name:"splitter"});var D=function(Y){return Te(Y,{context:{nested:re}})},q=Zu({type:"mousemove",listener:function(Y){return ws(Y)}}),J=Is(q,2),he=J[0],Pe=J[1],pe=Zu({type:"mouseup",listener:function(Y){Ln(Y),gi()}}),Fe=Is(pe,2),wt=Fe[0],Qt=Fe[1],Rn=function(){he(),wt()},gi=function(){Pe(),Qt()},Mt=function(Y,ne){return zs.getCProp(Y,ne)},zn=function(Y,ne){return!(Y>100||Y<0||ne>100||ne<0||i.children[E.current].props&&i.children[E.current].props.minSize&&i.children[E.current].props.minSize>Y||i.children[E.current+1].props&&i.children[E.current+1].props.minSize&&i.children[E.current+1].props.minSize>ne)},vi=function(){c.current=!1,u.current=null,d.current=null,h.current=null,f.current=null,m.current=null,y.current=null,w.current=null,k.current=null,E.current=null},Br=H.useCallback(function(){switch(i.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(i.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}},[i.stateStorage]),pn=function(Y){Se.isArray(Y)&&Br().setItem(i.stateKey,JSON.stringify(Y))},Fr=H.useCallback(function(){var Ae=Br().getItem(i.stateKey);Ae&&L(JSON.parse(Ae))},[Br,i.stateKey]),pr=function(Y,ne,Ne){var mr=Y.type==="touchstart"?Y.touches[0].pageX:Y.pageX,gr=Y.type==="touchstart"?Y.touches[0].pageY:Y.pageY;a.current=l.current[ne],u.current=ee?ce.getWidth(o.current):ce.getHeight(o.current),c.current=!0,d.current=ee?mr:gr,h.current=a.current.previousElementSibling,f.current=a.current.nextElementSibling,Ne?(m.current=ee?ce.getOuterWidth(h.current,!0):ce.getOuterHeight(h.current,!0),w.current=ee?ce.getOuterWidth(f.current,!0):ce.getOuterHeight(f.current,!0)):(m.current=100*(ee?ce.getOuterWidth(h.current,!0):ce.getOuterHeight(h.current,!0))/u.current,w.current=100*(ee?ce.getOuterWidth(f.current,!0):ce.getOuterHeight(f.current,!0))/u.current),y.current=m.current,k.current=w.current,E.current=ne,!x()&&ce.addClass(a.current,"p-splitter-gutter-resizing"),a.current.setAttribute("data-p-splitter-gutter-resizing",!0),!x()&&ce.addClass(o.current,"p-splitter-resizing"),o.current.setAttribute("data-p-splitter-resizing",!0)},ws=function(Y){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,mr,gr,mn,ks=Y.type==="touchmove"?Y.touches[0].pageX:Y.pageX,Ts=Y.type==="touchmove"?Y.touches[0].pageY:Y.pageY;Ne?ee?(mn=100*(m.current+ne)/u.current,gr=100*(w.current-ne)/u.current):(mn=100*(m.current-ne)/u.current,gr=100*(w.current+ne)/u.current):(ee?mr=ks*100/u.current-d.current*100/u.current:mr=Ts*100/u.current-d.current*100/u.current,mn=m.current+mr,gr=w.current-mr),Bn(E.current,mn,gr)},Ln=function(Y){var ne=sc(P);ne[E.current]=y.current,ne[E.current+1]=k.current,i.onResizeEnd&&i.onResizeEnd({originalEvent:Y,sizes:ne}),ye&&pn(ne),L(ne),!x()&&ce.removeClass(a.current,"p-splitter-gutter-resizing"),l.current&&Object.keys(l.current).forEach(function(Ne){return l.current[Ne].setAttribute("data-p-splitter-gutter-resizing",!1)}),!x()&&ce.removeClass(o.current,"p-splitter-resizing"),o.current.setAttribute("data-p-splitter-resizing",!1),vi()},xs=function(){Fn(),Ln()},Tu=function(Y,ne){var Ne=i.children[ne].props&&i.children[ne].props.minSize||0;switch(Y.code){case"ArrowLeft":{ee&&bi(Y,ne,i.step*-1),Y.preventDefault();break}case"ArrowRight":{ee&&bi(Y,ne,i.step),Y.preventDefault();break}case"ArrowDown":{ee||bi(Y,ne,i.step*-1),Y.preventDefault();break}case"ArrowUp":{ee||bi(Y,ne,i.step),Y.preventDefault();break}case"Home":{Bn(ne,100-Ne,Ne),Y.preventDefault();break}case"End":{Bn(ne,Ne,100-Ne),Y.preventDefault();break}case"NumpadEnter":case"Enter":{v.current>=100-(Ne||5)?Bn(ne,Ne,100-Ne):Bn(ne,100-Ne,Ne),Y.preventDefault();break}}},Bn=function(Y,ne,Ne){E.current=Y,a.current=l.current[Y],u.current=ee?ce.getWidth(o.current):ce.getHeight(o.current),h.current=a.current.previousElementSibling,f.current=a.current.nextElementSibling,zn(ne,Ne)&&(y.current=ne,k.current=Ne,h.current.style.flexBasis="calc("+ne+"% - "+(i.children.length-1)*i.gutterSize+"px)",f.current.style.flexBasis="calc("+Ne+"% - "+(i.children.length-1)*i.gutterSize+"px)",v.current=parseFloat(ne).toFixed(4))},yi=function(Y,ne,Ne){pr(Y,ne,!0),ws(Y,Ne,!0)},bi=function(Y,ne,Ne){I.current||(I.current=setInterval(function(){yi(Y,ne,Ne)},40))},Fn=function(){I.current&&(clearInterval(I.current),I.current=null)},ya=function(Y,ne){pr(Y,ne,!1),Rn()},Cu=function(Y,ne){pr(Y,ne,!1),window.addEventListener("touchmove",wi,{passive:!1,cancelable:!1}),window.addEventListener("touchend",Ss)},wi=function(Y){ws(Y)},Ss=function(Y){Ln(Y),window.removeEventListener("touchmove",wi),window.removeEventListener("touchend",Ss)};H.useImperativeHandle(e,function(){return{props:i,getElement:function(){return o.current}}}),Ns(function(){o.current&&(s.current=Ca())}),H.useEffect(function(){var Ae=sc(o.current.children).filter(function(ne){return ce.getAttribute(ne,"data-pc-section")==="splitterpanel.root"}),Y=[];Ae.map(function(ne,Ne){v.current=G(P,0),Y[Ne]=G(P,Ne),ne.childNodes&&Se.isNotEmpty(ce.find(ne,"[data-pc-name='splitter']")&&ce.find(ne,"[data-pc-section='root']"))&&(!x()&&ce.addClass(ne,"p-splitter-panel-nested"),ne.setAttribute("data-p-splitter-panel-nested",!0),oe(!0))}),L(Y)},[]),H.useEffect(function(){ye&&Fr()},[Fr,ye]);var Mu=function(Y,ne){var Ne=Mt(Y,"id")||"".concat(s.current,"_").concat(ne),mr=Et(Mt(Y,"className"),C("panel.root")),gr=t({ref:function(me){return l.current[ne]=me},className:C("gutter"),style:ee?{width:i.gutterSize+"px"}:{height:i.gutterSize+"px"},onMouseDown:function(me){return ya(me,ne)},onKeyDown:function(me){return Tu(me,ne)},onKeyUp:xs,onTouchStart:function(me){return Cu(me,ne)},onTouchMove:function(me){return wi(me)},onTouchEnd:function(me){return Ss(me)},"data-p-splitter-gutter-resizing":!1},Te("gutter")),mn=t({tabIndex:Mt(Y,"tabIndex")||0,className:C("gutterHandler"),role:"separator","aria-orientation":ee?"vertical":"horizontal","aria-controls":Ne,"aria-label":Mt(Y,"aria-label"),"aria-labelledby":Mt(Y,"aria-labelledby"),"aria-valuenow":v.current,"aria-valuetext":parseFloat(v.current).toFixed(0)+"%","aria-valuemin":Mt(Y,"minSize")||"0","aria-valuemax":"100"},Te("gutterHandler")),ks=ne!==i.children.length-1&&H.createElement("div",gr,H.createElement("div",mn)),Ts="calc("+G(P,ne)+"% - "+(ae-1)*i.gutterSize+"px)",Nu=t({key:ne,id:Ne,className:mr,style:Ia(Ia({},Mt(Y,"style")),{},{flexBasis:Ts}),role:"presentation","data-p-splitter-panel-nested":!1,onClick:Mt(Y,"onClick")},D("splitterpanel.root"));return H.createElement(H.Fragment,null,H.createElement("div",Nu,Mt(Y,"children")),ks)},Eu=function(){return H.Children.map(i.children,Mu)},Au=t({id:i.id,style:i.style,className:Et(i.className,C("root")),"data-p-splitter-resizing":!1},Rs.getOtherProps(i),Te("root")),Ou=Eu();return H.createElement("div",Da({ref:o},Au),Ou)}));Ra.displayName="SplitterPanel",ac.displayName="Splitter";var jn={defaultProps:{__TYPE:"IconBase",className:null,label:null,spin:!1},getProps:function(e){return Se.getMergedProps(e,jn.defaultProps)},getOtherProps:function(e){return Se.getDiffProps(e,jn.defaultProps)},getPTI:function(e){var t=Se.isEmpty(e.label),n=jn.getOtherProps(e),i={className:Et("p-icon",{"p-icon-spin":e.spin},e.className),role:t?void 0:"img","aria-label":t?void 0:e.label,"aria-hidden":e.label?t:void 0};return Se.getMergedProps(n,i)}};function za(){return za=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},za.apply(null,arguments)}var lc=H.memo(H.forwardRef(function(r,e){var t=jn.getPTI(r);return H.createElement("svg",za({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),H.createElement("path",{d:"M9.61296 13C9.50997 13.0005 9.40792 12.9804 9.3128 12.9409C9.21767 12.9014 9.13139 12.8433 9.05902 12.7701L3.83313 7.54416C3.68634 7.39718 3.60388 7.19795 3.60388 6.99022C3.60388 6.78249 3.68634 6.58325 3.83313 6.43628L9.05902 1.21039C9.20762 1.07192 9.40416 0.996539 9.60724 1.00012C9.81032 1.00371 10.0041 1.08597 10.1477 1.22959C10.2913 1.37322 10.3736 1.56698 10.3772 1.77005C10.3808 1.97313 10.3054 2.16968 10.1669 2.31827L5.49496 6.99022L10.1669 11.6622C10.3137 11.8091 10.3962 12.0084 10.3962 12.2161C10.3962 12.4238 10.3137 12.6231 10.1669 12.7701C10.0945 12.8433 10.0083 12.9014 9.91313 12.9409C9.81801 12.9804 9.71596 13.0005 9.61296 13Z",fill:"currentColor"}))}));lc.displayName="ChevronLeftIcon";function La(){return La=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},La.apply(null,arguments)}var uc=H.memo(H.forwardRef(function(r,e){var t=jn.getPTI(r);return H.createElement("svg",La({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),H.createElement("path",{d:"M4.38708 13C4.28408 13.0005 4.18203 12.9804 4.08691 12.9409C3.99178 12.9014 3.9055 12.8433 3.83313 12.7701C3.68634 12.6231 3.60388 12.4238 3.60388 12.2161C3.60388 12.0084 3.68634 11.8091 3.83313 11.6622L8.50507 6.99022L3.83313 2.31827C3.69467 2.16968 3.61928 1.97313 3.62287 1.77005C3.62645 1.56698 3.70872 1.37322 3.85234 1.22959C3.99596 1.08597 4.18972 1.00371 4.3928 1.00012C4.59588 0.996539 4.79242 1.07192 4.94102 1.21039L10.1669 6.43628C10.3137 6.58325 10.3962 6.78249 10.3962 6.99022C10.3962 7.19795 10.3137 7.39718 10.1669 7.54416L4.94102 12.7701C4.86865 12.8433 4.78237 12.9014 4.68724 12.9409C4.59212 12.9804 4.49007 13.0005 4.38708 13Z",fill:"currentColor"}))}));uc.displayName="ChevronRightIcon";function Ba(){return Ba=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Ba.apply(null,arguments)}var cc=H.memo(H.forwardRef(function(r,e){var t=jn.getPTI(r);return H.createElement("svg",Ba({ref:e,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),H.createElement("path",{d:"M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z",fill:"currentColor"}))}));cc.displayName="TimesIcon";function Fa(){return Fa=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Fa.apply(null,arguments)}function Ii(r){"@babel/helpers - typeof";return Ii=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ii(r)}function B4(r,e){if(Ii(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(Ii(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function F4(r){var e=B4(r,"string");return Ii(e)=="symbol"?e:e+""}function $4(r,e,t){return(e=F4(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function H4(r){if(Array.isArray(r))return r}function j4(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,s,o,a=[],l=!0,u=!1;try{if(s=(t=t.call(r)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function dc(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function _4(r,e){if(r){if(typeof r=="string")return dc(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?dc(r,e):void 0}}function V4(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
487
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q4(r,e){return H4(r)||j4(r,e)||_4(r,e)||V4()}var W4=`
|
|
488
|
+
@layer primereact {
|
|
489
|
+
.p-ripple {
|
|
490
|
+
overflow: hidden;
|
|
491
|
+
position: relative;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.p-ink {
|
|
495
|
+
display: block;
|
|
496
|
+
position: absolute;
|
|
497
|
+
background: rgba(255, 255, 255, 0.5);
|
|
498
|
+
border-radius: 100%;
|
|
499
|
+
transform: scale(0);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.p-ink-active {
|
|
503
|
+
animation: ripple 0.4s linear;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.p-ripple-disabled .p-ink {
|
|
507
|
+
display: none;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
@keyframes ripple {
|
|
512
|
+
100% {
|
|
513
|
+
opacity: 0;
|
|
514
|
+
transform: scale(2.5);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
`,U4={root:"p-ink"},_n=$e.extend({defaultProps:{__TYPE:"Ripple",children:void 0},css:{styles:W4,classes:U4},getProps:function(e){return Se.getMergedProps(e,_n.defaultProps)},getOtherProps:function(e){return Se.getDiffProps(e,_n.defaultProps)}});function fc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function K4(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fc(Object(t),!0).forEach(function(n){$4(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):fc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Ls=H.memo(H.forwardRef(function(r,e){var t=H.useState(!1),n=q4(t,2),i=n[0],s=n[1],o=H.useRef(null),a=H.useRef(null),l=Aa(),u=H.useContext(Ei),c=_n.getProps(r,u),d=u&&u.ripple||Ai.ripple,h={props:c};Oi(_n.css.styles,{name:"ripple",manual:!d});var f=_n.setMetaData(K4({},h)),m=f.ptm,v=f.cx,y=function(){return o.current&&o.current.parentElement},w=function(){a.current&&a.current.addEventListener("pointerdown",E)},k=function(){a.current&&a.current.removeEventListener("pointerdown",E)},E=function(z){var F=ce.getOffset(a.current),re=z.pageX-F.left+document.body.scrollTop-ce.getWidth(o.current)/2,oe=z.pageY-F.top+document.body.scrollLeft-ce.getHeight(o.current)/2;I(re,oe)},I=function(z,F){!o.current||getComputedStyle(o.current,null).display==="none"||(ce.removeClass(o.current,"p-ink-active"),N(),o.current.style.top=F+"px",o.current.style.left=z+"px",ce.addClass(o.current,"p-ink-active"))},A=function(z){ce.removeClass(z.currentTarget,"p-ink-active")},N=function(){if(o.current&&!ce.getHeight(o.current)&&!ce.getWidth(o.current)){var z=Math.max(ce.getOuterWidth(a.current),ce.getOuterHeight(a.current));o.current.style.height=z+"px",o.current.style.width=z+"px"}};if(H.useImperativeHandle(e,function(){return{props:c,getInk:function(){return o.current},getTarget:function(){return a.current}}}),Ns(function(){s(!0)}),Ni(function(){i&&o.current&&(a.current=y(),N(),w())},[i]),Ni(function(){o.current&&!a.current&&(a.current=y(),N(),w())}),Ea(function(){o.current&&(a.current=null,k())}),!d)return null;var P=l({"aria-hidden":!0,className:Et(v("root"))},_n.getOtherProps(c),m("root"));return H.createElement("span",Fa({role:"presentation",ref:o},P,{onAnimationEnd:A}))}));Ls.displayName="Ripple";function $a(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function G4(r){if(Array.isArray(r))return $a(r)}function J4(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function hc(r,e){if(r){if(typeof r=="string")return $a(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?$a(r,e):void 0}}function Y4(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
519
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X4(r){return G4(r)||J4(r)||hc(r)||Y4()}function Ri(r){"@babel/helpers - typeof";return Ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ri(r)}function Z4(r,e){if(Ri(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(Ri(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Q4(r){var e=Z4(r,"string");return Ri(e)=="symbol"?e:e+""}function pc(r,e,t){return(e=Q4(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function e2(r){if(Array.isArray(r))return r}function t2(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,s,o,a=[],l=!0,u=!1;try{if(s=(t=t.call(r)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function r2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
520
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zi(r,e){return e2(r)||t2(r,e)||hc(r,e)||r2()}function mc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Bs(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mc(Object(t),!0).forEach(function(n){pc(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):mc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var n2={navcontent:"p-tabview-nav-content",nav:"p-tabview-nav",inkbar:"p-tabview-ink-bar",panelcontainer:function(e){var t=e.props;return Et("p-tabview-panels",t.panelContainerClassName)},prevbutton:"p-tabview-nav-prev p-tabview-nav-btn p-link",nextbutton:"p-tabview-nav-next p-tabview-nav-btn p-link",root:function(e){var t=e.props;return Et("p-tabview p-component",{"p-tabview-scrollable":t.scrollable})},navcontainer:"p-tabview-nav-container",tab:{header:function(e){var t=e.selected,n=e.disabled,i=e.headerClassName,s=e._className;return Et("p-unselectable-text",{"p-tabview-selected p-highlight":t,"p-disabled":n},i,s)},headertitle:"p-tabview-title",headeraction:"p-tabview-nav-link",closeIcon:"p-tabview-close",content:function(e){var t=e.props,n=e.selected,i=e.getTabProp,s=e.tab,o=e.isSelected,a=e.shouldUseTab,l=e.index;return a(s,l)&&(!t.renderActiveOnly||o(l))?Et(i(s,"contentClassName"),i(s,"className"),"p-tabview-panel",{"p-hidden":!n}):void 0}}},i2={tab:{header:function(e){var t=e.headerStyle,n=e._style;return Bs(Bs({},t||{}),n||{})},content:function(e){var t=e.props,n=e.getTabProp,i=e.tab,s=e.isSelected,o=e.shouldUseTab,a=e.index;return o(i,a)&&(!t.renderActiveOnly||s(a))?Bs(Bs({},n(i,"contentStyle")||{}),n(i,"style")||{}):void 0}}},Fs=$e.extend({defaultProps:{__TYPE:"TabView",id:null,activeIndex:0,className:null,onBeforeTabChange:null,onBeforeTabClose:null,onTabChange:null,onTabClose:null,panelContainerClassName:null,panelContainerStyle:null,renderActiveOnly:!0,scrollable:!1,style:null,children:void 0},css:{classes:n2,inlineStyles:i2}}),Vn=$e.extend({defaultProps:{__TYPE:"TabPanel",children:void 0,className:null,closable:!1,closeIcon:null,contentClassName:null,contentStyle:null,disabled:!1,header:null,headerClassName:null,headerStyle:null,headerTemplate:null,leftIcon:null,nextButton:null,prevButton:null,rightIcon:null,style:null,visible:!0},getCProp:function(e,t){return Se.getComponentProp(e,t,Vn.defaultProps)},getCProps:function(e){return Se.getComponentProps(e,Vn.defaultProps)},getCOtherProps:function(e){return Se.getComponentDiffProps(e,Vn.defaultProps)}});function gc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function $s(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?gc(Object(t),!0).forEach(function(n){pc(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):gc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var Ha=function(){},vc=H.forwardRef(function(r,e){var t=Aa(),n=H.useContext(Ei),i=Fs.getProps(r,n),s=H.useState(i.id),o=zi(s,2),a=o[0],l=o[1],u=H.useState(!0),c=zi(u,2),d=c[0],h=c[1],f=H.useState(!1),m=zi(f,2),v=m[0],y=m[1],w=H.useState([]),k=zi(w,2),E=k[0],I=k[1],A=H.useState(i.activeIndex),N=zi(A,2),P=N[0],L=N[1],z=H.useRef(null),F=H.useRef(null),re=H.useRef(null),oe=H.useRef(null),ye=H.useRef(null),ae=H.useRef(null),G=H.useRef({}),ee=i.onTabChange?i.activeIndex:P,ke=H.Children.count(i.children),se={props:i,state:{id:a,isPrevButtonDisabled:d,isNextButtonDisabled:v,hiddenTabsState:E,activeIndex:P}},Te=Fs.setMetaData($s({},se)),C=Te.ptm,x=Te.ptmo,D=Te.cx,q=Te.sx,J=Te.isUnstyled;nc(Fs.css.styles,J,{name:"tabview"});var he=function($,K,ie){var be={props:$.props,parent:se,context:{index:ie,count:ke,first:ie===0,last:ie===ke-1,active:ie==P,disabled:pe($,"disabled")}};return t(C("tab.".concat(K),{tab:be}),C("tabpanel.".concat(K),{tabpanel:be}),C("tabpanel.".concat(K),be),x(pe($,"pt"),K,be))},Pe=function($){return $===ee},pe=function($,K){return Vn.getCProp($,K)},Fe=function($){return $&&pe($,"visible")&&Se.isValidChild($,"TabPanel")&&E.every(function(K){return K!==$.key})},wt=function($){var K=H.Children.map(i.children,function(ie,be){if(Fe(ie))return{tab:ie,index:be}});return K.find(function(ie){var be=ie.tab,Ut=ie.index;return!pe(be,"disabled")&&Ut>=$})||K.reverse().find(function(ie){var be=ie.tab,Ut=ie.index;return!pe(be,"disabled")&&$>Ut})},Qt=function($,K){$.preventDefault();var ie=i.onBeforeTabClose,be=i.onTabClose,Ut=i.children,Hn=Ut[K].key;ie&&ie({originalEvent:$,index:K})===!1||(I([].concat(X4(E),[Hn])),be&&be({originalEvent:$,index:K}))},Rn=function($,K,ie){gi($,K,ie)},gi=function($,K,ie){if($&&$.preventDefault(),!pe(K,"disabled")){if(i.onBeforeTabChange&&i.onBeforeTabChange({originalEvent:$,index:ie})===!1)return;i.onTabChange?i.onTabChange({originalEvent:$,index:ie}):L(ie)}Fn({index:ie})},Mt=function($,K,ie){switch($.code){case"ArrowLeft":vi($);break;case"ArrowRight":zn($);break;case"Home":Br($);break;case"End":pn($);break;case"PageDown":Fr($);break;case"PageUp":pr($);break;case"Enter":case"NumpadEnter":case"Space":ws($,K,ie);break}},zn=function($){var K=Ln($.target.parentElement);K?yi(K):Br($),$.preventDefault()},vi=function($){var K=xs($.target.parentElement);K?yi(K):pn($),$.preventDefault()},Br=function($){var K=Tu();yi(K),$.preventDefault()},pn=function($){var K=Bn();yi(K),$.preventDefault()},Fr=function($){Fn({index:H.Children.count(i.children)-1}),$.preventDefault()},pr=function($){Fn({index:0}),$.preventDefault()},ws=function($,K,ie){gi($,K,ie),$.preventDefault()},Ln=function($){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ie=K?$:$.nextElementSibling;return ie?ce.getAttribute(ie,"data-p-disabled")||ce.getAttribute(ie,"data-pc-section")==="inkbar"?Ln(ie):ce.findSingle(ie,'[data-pc-section="headeraction"]'):null},xs=function($){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ie=K?$:$.previousElementSibling;return ie?ce.getAttribute(ie,"data-p-disabled")||ce.getAttribute(ie,"data-pc-section")==="inkbar"?xs(ie):ce.findSingle(ie,'[data-pc-section="headeraction"]'):null},Tu=function(){return Ln(re.current.firstElementChild,!0)},Bn=function(){return xs(re.current.lastElementChild,!0)},yi=function($){$&&(ce.focus($),Fn({element:$}))},bi=function(){var $=G.current["tab_".concat(ee)];oe.current.style.width=ce.getWidth($)+"px",oe.current.style.left=ce.getOffset($).left-ce.getOffset(re.current).left+"px"},Fn=function($){var K=$.index,ie=$.element,be=ie||G.current["tab_".concat(K)];be&&be.scrollIntoView&&be.scrollIntoView({block:"nearest"})},ya=function(){var $=F.current,K=$.scrollLeft,ie=$.scrollWidth,be=ce.getWidth(F.current);h(K===0),y(parseInt(K)===ie-be)},Cu=function($){i.scrollable&&ya(),$.preventDefault()},wi=function(){return[ye.current,ae.current].reduce(function($,K){return K?$+ce.getWidth(K):$},0)},Ss=function(){var $=ce.getWidth(F.current)-wi(),K=F.current.scrollLeft-$;F.current.scrollLeft=K<=0?0:K},Mu=function(){var $=ce.getWidth(F.current)-wi(),K=F.current.scrollLeft+$,ie=F.current.scrollWidth-$;F.current.scrollLeft=K>=ie?ie:K},Eu=function(){h(!0),y(!1),I([]),i.onTabChange?i.onTabChange({index:ee}):L(i.activeIndex)};H.useEffect(function(){bi(),ya()}),Ns(function(){a||l(Ca())}),Ni(function(){if(Se.isNotEmpty(E)){var me=wt(E[E.length-1]);me&&Rn(null,me.tab,me.index)}},[E]),Ni(function(){i.activeIndex!==P&&Fn({index:i.activeIndex})},[i.activeIndex]),H.useImperativeHandle(e,function(){return{props:i,reset:Eu,getElement:function(){return z.current}}});var Au=function($,K){switch($.preventDefault(),$.stopPropagation(),$.code){case"Space":case"NumpadEnter":case"Enter":Qt($,K);break}},Ou=function($,K){var ie=Pe(K),be=Vn.getCProps($),Ut=be.headerStyle,Hn=be.headerClassName,Du=be.style,Pu=be.className,Iu=be.disabled,kg=be.leftIcon,Tg=be.rightIcon,lk=be.header,Cg=be.headerTemplate,uk=be.closable,ck=be.closeIcon,dk=a+"_header_"+K,Mg=a+K+"_content",fk=Iu||!ie?-1:0,Eg=kg&&Ci.getJSXIcon(kg,void 0,{props:i}),hk=t({className:D("tab.headertitle")},he($,"headertitle",K)),Ag=H.createElement("span",hk,lk),Og=Tg&&Ci.getJSXIcon(Tg,void 0,{props:i}),Ng=t({className:D("tab.closeIcon"),onClick:function(Lt){return Qt(Lt,K)},onKeyDown:function(Lt){return Au(Lt,K)},tabIndex:0,"aria-label":Ma("close")||"Close"},he($,"closeIcon",K)),pk=ck||H.createElement(cc,Ng),mk=uk?Ci.getJSXIcon(pk,$s({},Ng),{props:i}):null,gk=t({id:dk,role:"tab",className:D("tab.headeraction"),tabIndex:fk,"aria-controls":Mg,"aria-selected":ie,"aria-disabled":Iu,onClick:function(Lt){return Rn(Lt,$,K)},onKeyDown:function(Lt){return Mt(Lt,$,K)}},he($,"headeraction",K)),Ru=H.createElement("a",gk,Eg,Ag,Og,mk,H.createElement(Ls,null));if(Cg){var vk={className:"p-tabview-nav-link",titleClassName:"p-tabview-title",onClick:function(Lt){return Rn(Lt,$,K)},onKeyDown:function(Lt){return Mt(Lt,$,K)},leftIconElement:Eg,titleElement:Ag,rightIconElement:Og,element:Ru,props:i,index:K,selected:ie,ariaControls:Mg};Ru=Se.getJSXElement(Cg,vk)}var yk=t({ref:function(Lt){return G.current["tab_".concat(K)]=Lt},className:D("tab.header",{selected:ie,disabled:Iu,headerClassName:Hn,_className:Pu}),style:q("tab.header",{headerStyle:Ut,_style:Du}),role:"presentation"},he($,"root",K),he($,"header",K));return H.createElement("li",yk,Ru)},Ae=function(){return H.Children.map(i.children,function($,K){if(Fe($))return Ou($,K)})},Y=function(){var $=Ae(),K=t({id:a+"_navcontent",ref:F,className:D("navcontent"),style:i.style,onScroll:Cu},C("navcontent")),ie=t({ref:re,className:D("nav"),role:"tablist"},C("nav")),be=t({ref:oe,"aria-hidden":"true",role:"presentation",className:D("inkbar")},C("inkbar"));return H.createElement("div",K,H.createElement("ul",ie,$,H.createElement("li",be)))},ne=function(){var $=t({className:D("panelcontainer"),style:i.panelContainerStyle},C("panelcontainer")),K=H.Children.map(i.children,function(ie,be){if(Fe(ie)&&(!i.renderActiveOnly||Pe(be))){var Ut=Pe(be),Hn=a+be+"_content",Du=a+"_header_"+be,Pu=t({id:Hn,className:D("tab.content",{props:i,selected:Ut,getTabProp:pe,tab:ie,isSelected:Pe,shouldUseTab:Fe,index:be}),style:q("tab.content",{props:i,getTabProp:pe,tab:ie,isSelected:Pe,shouldUseTab:Fe,index:be}),role:"tabpanel","aria-labelledby":Du},Vn.getCOtherProps(ie),he(ie,"root",be),he(ie,"content",be));return H.createElement("div",Pu,i.renderActiveOnly?Ut&&pe(ie,"children"):pe(ie,"children"))}});return H.createElement("div",$,K)},Ne=function(){var $=t({"aria-hidden":"true"},C("previcon")),K=i.prevButton||H.createElement(lc,$),ie=Ci.getJSXIcon(K,$s({},$),{props:i}),be=t({ref:ye,type:"button",className:D("prevbutton"),"aria-label":Ma("prevPageLabel"),onClick:function(Hn){return Ss()}},C("prevbutton"));return i.scrollable&&!d?H.createElement("button",be,ie,H.createElement(Ls,null)):null},mr=function(){var $=t({"aria-hidden":"true"},C("nexticon")),K=i.nextButton||H.createElement(uc,$),ie=Ci.getJSXIcon(K,$s({},$),{props:i}),be=t({ref:ae,type:"button",className:D("nextbutton"),"aria-label":Ma("nextPageLabel"),onClick:function(Hn){return Mu()}},C("nextbutton"));if(i.scrollable&&!v)return H.createElement("button",be,ie,H.createElement(Ls,null))},gr=t({id:a,ref:z,style:i.style,className:Et(i.className,D("root"))},Fs.getOtherProps(i),C("root")),mn=t({className:D("navcontainer")},C("navcontainer")),ks=Y(),Ts=ne(),Nu=Ne(),$n=mr();return H.createElement("div",gr,H.createElement("div",mn,Nu,ks,$n),Ts)});Ha.displayName="TabPanel",vc.displayName="TabView";function yc(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function s2(r){if(Array.isArray(r))return r}function o2(r,e,t){return(e=h2(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function a2(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,s,o,a=[],l=!0,u=!1;try{if(s=(t=t.call(r)).next,e!==0)for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function l2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
521
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function wc(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bc(Object(t),!0).forEach(function(n){o2(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):bc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function u2(r,e){if(r==null)return{};var t,n,i=c2(r,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(n=0;n<s.length;n++)t=s[n],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function c2(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function d2(r,e){return s2(r)||a2(r,e)||p2(r,e)||l2()}function f2(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function h2(r){var e=f2(r,"string");return typeof e=="symbol"?e:e+""}function p2(r,e){if(r){if(typeof r=="string")return yc(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?yc(r,e):void 0}}function m2(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Sc(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xc(Object(t),!0).forEach(function(n){m2(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):xc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function g2(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){return e.reduceRight(function(i,s){return s(i)},n)}}function Li(r){return function e(){for(var t=this,n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return i.length>=r.length?r.apply(this,i):function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return e.apply(t,[].concat(i,a))}}}function Hs(r){return{}.toString.call(r).includes("Object")}function v2(r){return!Object.keys(r).length}function Bi(r){return typeof r=="function"}function y2(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function b2(r,e){return Hs(e)||Hr("changeType"),Object.keys(e).some(function(t){return!y2(r,t)})&&Hr("changeField"),e}function w2(r){Bi(r)||Hr("selectorType")}function x2(r){Bi(r)||Hs(r)||Hr("handlerType"),Hs(r)&&Object.values(r).some(function(e){return!Bi(e)})&&Hr("handlersType")}function S2(r){r||Hr("initialIsRequired"),Hs(r)||Hr("initialType"),v2(r)&&Hr("initialContent")}function k2(r,e){throw new Error(r[e]||r.default)}var T2={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Hr=Li(k2)(T2),js={changes:b2,selector:w2,handler:x2,initial:S2};function C2(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};js.initial(r),js.handler(e);var t={current:r},n=Li(A2)(t,e),i=Li(E2)(t),s=Li(js.changes)(r),o=Li(M2)(t);function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(c){return c};return js.selector(u),u(t.current)}function l(u){g2(n,i,s,o)(u)}return[a,l]}function M2(r,e){return Bi(e)?e(r.current):e}function E2(r,e){return r.current=Sc(Sc({},r.current),e),e}function A2(r,e,t){return Bi(e)?e(r.current):Object.keys(t).forEach(function(n){var i;return(i=e[n])===null||i===void 0?void 0:i.call(e,r.current[n])}),t}var O2={create:C2},N2={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function D2(r){return function e(){for(var t=this,n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return i.length>=r.length?r.apply(this,i):function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return e.apply(t,[].concat(i,a))}}}function P2(r){return{}.toString.call(r).includes("Object")}function I2(r){return r||Tc("configIsRequired"),P2(r)||Tc("configType"),r.urls?(R2(),{paths:{vs:r.urls.monacoBase}}):r}function R2(){console.warn(kc.deprecation)}function z2(r,e){throw new Error(r[e]||r.default)}var kc={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
488
522
|
You are using deprecated way of configuration.
|
|
489
523
|
|
|
490
524
|
Instead of using
|
|
@@ -493,19 +527,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
493
527
|
monaco.config({ paths: { vs: '...' } })
|
|
494
528
|
|
|
495
529
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
496
|
-
`},xu=Qg(n4)(wu),i4={config:t4},s4=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(i){return t.reduceRight(function(s,o){return o(s)},i)}};function Su(r,e){return Object.keys(e).forEach(function(t){e[t]instanceof Object&&r[t]&&Object.assign(e[t],Su(r[t],e[t]))}),vu(vu({},r),e)}var o4={type:"cancelation",msg:"operation is manually canceled"};function Jo(r){var e=!1,t=new Promise(function(n,i){r.then(function(s){return e?i(o4):n(s)}),r.catch(i)});return t.cancel=function(){return e=!0},t}var a4=["monaco"],l4=Xg.create({config:Zg,isInitialized:!1,resolve:null,reject:null,monaco:null}),ku=Rg(l4,2),ai=ku[0],ss=ku[1];function u4(r){var e=i4.config(r),t=e.monaco,n=Dg(e,a4);ss(function(i){return{config:Su(i.config,n),monaco:t}})}function c4(){var r=ai(function(e){var t=e.monaco,n=e.isInitialized,i=e.resolve;return{monaco:t,isInitialized:n,resolve:i}});if(!r.isInitialized){if(ss({isInitialized:!0}),r.monaco)return r.resolve(r.monaco),Jo(Yo);if(window.monaco&&window.monaco.editor)return Tu(window.monaco),r.resolve(window.monaco),Jo(Yo);s4(d4,h4)(p4)}return Jo(Yo)}function d4(r){return document.body.appendChild(r)}function f4(r){var e=document.createElement("script");return r&&(e.src=r),e}function h4(r){var e=ai(function(n){var i=n.config,s=n.reject;return{config:i,reject:s}}),t=f4("".concat(e.config.paths.vs,"/loader.js"));return t.onload=function(){return r()},t.onerror=e.reject,t}function p4(){var r=ai(function(t){var n=t.config,i=t.resolve,s=t.reject;return{config:n,resolve:i,reject:s}}),e=window.require;e.config(r.config),e(["vs/editor/editor.main"],function(t){var n=t.m||t;Tu(n),r.resolve(n)},function(t){r.reject(t)})}function Tu(r){ai().monaco||ss({monaco:r})}function m4(){return ai(function(r){var e=r.monaco;return e})}var Yo=new Promise(function(r,e){return ss({resolve:r,reject:e})}),Mu={config:u4,init:c4,__getMonacoInstance:m4},g4={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Xo=g4,v4={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},y4=v4;function b4({children:r}){return z.createElement("div",{style:y4.container},r)}var w4=b4,x4=w4;function S4({width:r,height:e,isEditorReady:t,loading:n,_ref:i,className:s,wrapperProps:o}){return z.createElement("section",{style:{...Xo.wrapper,width:r,height:e},...o},!t&&z.createElement(x4,null,n),z.createElement("div",{ref:i,style:{...Xo.fullWidth,...!t&&Xo.hide},className:s}))}var k4=S4,Cu=z.memo(k4);function T4(r){z.useEffect(r,[])}var Eu=T4;function M4(r,e,t=!0){let n=z.useRef(!0);z.useEffect(n.current||!t?()=>{n.current=!1}:r,e)}var xt=M4;function li(){}function Tn(r,e,t,n){return C4(r,n)||E4(r,e,t,n)}function C4(r,e){return r.editor.getModel(Au(r,e))}function E4(r,e,t,n){return r.editor.createModel(e,t,n?Au(r,n):void 0)}function Au(r,e){return r.Uri.parse(e)}function A4({original:r,modified:e,language:t,originalLanguage:n,modifiedLanguage:i,originalModelPath:s,modifiedModelPath:o,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:u="light",loading:c="Loading...",options:d={},height:h="100%",width:f="100%",className:m,wrapperProps:v={},beforeMount:y=li,onMount:w=li}){let[k,E]=z.useState(!1),[R,O]=z.useState(!0),N=z.useRef(null),D=z.useRef(null),B=z.useRef(null),L=z.useRef(w),V=z.useRef(y),te=z.useRef(!1);Eu(()=>{let G=Mu.init();return G.then(Z=>(D.current=Z)&&O(!1)).catch(Z=>Z?.type!=="cancelation"&&console.error("Monaco initialization: error:",Z)),()=>N.current?re():G.cancel()}),xt(()=>{if(N.current&&D.current){let G=N.current.getOriginalEditor(),Z=Tn(D.current,r||"",n||t||"text",s||"");Z!==G.getModel()&&G.setModel(Z)}},[s],k),xt(()=>{if(N.current&&D.current){let G=N.current.getModifiedEditor(),Z=Tn(D.current,e||"",i||t||"text",o||"");Z!==G.getModel()&&G.setModel(Z)}},[o],k),xt(()=>{let G=N.current.getModifiedEditor();G.getOption(D.current.editor.EditorOption.readOnly)?G.setValue(e||""):e!==G.getValue()&&(G.executeEdits("",[{range:G.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),G.pushUndoStop())},[e],k),xt(()=>{N.current?.getModel()?.original.setValue(r||"")},[r],k),xt(()=>{let{original:G,modified:Z}=N.current.getModel();D.current.editor.setModelLanguage(G,n||t||"text"),D.current.editor.setModelLanguage(Z,i||t||"text")},[t,n,i],k),xt(()=>{D.current?.editor.setTheme(u)},[u],k),xt(()=>{N.current?.updateOptions(d)},[d],k);let ne=z.useCallback(()=>{if(!D.current)return;V.current(D.current);let G=Tn(D.current,r||"",n||t||"text",s||""),Z=Tn(D.current,e||"",i||t||"text",o||"");N.current?.setModel({original:G,modified:Z})},[t,e,i,r,n,s,o]),fe=z.useCallback(()=>{!te.current&&B.current&&(N.current=D.current.editor.createDiffEditor(B.current,{automaticLayout:!0,...d}),ne(),D.current?.editor.setTheme(u),E(!0),te.current=!0)},[d,u,ne]);z.useEffect(()=>{k&&L.current(N.current,D.current)},[k]),z.useEffect(()=>{!R&&!k&&fe()},[R,k,fe]);function re(){let G=N.current?.getModel();a||G?.original?.dispose(),l||G?.modified?.dispose(),N.current?.dispose()}return z.createElement(Cu,{width:f,height:h,isEditorReady:k,loading:c,_ref:B,className:m,wrapperProps:v})}var O4=A4;z.memo(O4);function N4(r){let e=z.useRef();return z.useEffect(()=>{e.current=r},[r]),e.current}var D4=N4,as=new Map;function I4({defaultValue:r,defaultLanguage:e,defaultPath:t,value:n,language:i,path:s,theme:o="light",line:a,loading:l="Loading...",options:u={},overrideServices:c={},saveViewState:d=!0,keepCurrentModel:h=!1,width:f="100%",height:m="100%",className:v,wrapperProps:y={},beforeMount:w=li,onMount:k=li,onChange:E,onValidate:R=li}){let[O,N]=z.useState(!1),[D,B]=z.useState(!0),L=z.useRef(null),V=z.useRef(null),te=z.useRef(null),ne=z.useRef(k),fe=z.useRef(w),re=z.useRef(),G=z.useRef(n),Z=D4(s),ye=z.useRef(!1),ee=z.useRef(!1);Eu(()=>{let x=Mu.init();return x.then(I=>(L.current=I)&&B(!1)).catch(I=>I?.type!=="cancelation"&&console.error("Monaco initialization: error:",I)),()=>V.current?C():x.cancel()}),xt(()=>{let x=Tn(L.current,r||n||"",e||i||"",s||t||"");x!==V.current?.getModel()&&(d&&as.set(Z,V.current?.saveViewState()),V.current?.setModel(x),d&&V.current?.restoreViewState(as.get(s)))},[s],O),xt(()=>{V.current?.updateOptions(u)},[u],O),xt(()=>{!V.current||n===void 0||(V.current.getOption(L.current.editor.EditorOption.readOnly)?V.current.setValue(n):n!==V.current.getValue()&&(ee.current=!0,V.current.executeEdits("",[{range:V.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),V.current.pushUndoStop(),ee.current=!1))},[n],O),xt(()=>{let x=V.current?.getModel();x&&i&&L.current?.editor.setModelLanguage(x,i)},[i],O),xt(()=>{a!==void 0&&V.current?.revealLine(a)},[a],O),xt(()=>{L.current?.editor.setTheme(o)},[o],O);let ke=z.useCallback(()=>{if(!(!te.current||!L.current)&&!ye.current){fe.current(L.current);let x=s||t,I=Tn(L.current,n||r||"",e||i||"",x||"");V.current=L.current?.editor.create(te.current,{model:I,automaticLayout:!0,...u},c),d&&V.current.restoreViewState(as.get(x)),L.current.editor.setTheme(o),a!==void 0&&V.current.revealLine(a),N(!0),ye.current=!0}},[r,e,t,n,i,s,u,c,d,o,a]);z.useEffect(()=>{O&&ne.current(V.current,L.current)},[O]),z.useEffect(()=>{!D&&!O&&ke()},[D,O,ke]),G.current=n,z.useEffect(()=>{O&&E&&(re.current?.dispose(),re.current=V.current?.onDidChangeModelContent(x=>{ee.current||E(V.current.getValue(),x)}))},[O,E]),z.useEffect(()=>{if(O){let x=L.current.editor.onDidChangeMarkers(I=>{let j=V.current.getModel()?.uri;if(j&&I.find(W=>W.path===j.path)){let W=L.current.editor.getModelMarkers({resource:j});R?.(W)}});return()=>{x?.dispose()}}return()=>{}},[O,R]);function C(){re.current?.dispose(),h?d&&as.set(s,V.current.saveViewState()):V.current.getModel()?.dispose(),V.current.dispose()}return z.createElement(Cu,{width:f,height:m,isEditorReady:O,loading:l,_ref:te,className:v,wrapperProps:y})}var R4=I4,P4=z.memo(R4);const z4={automaticLayout:!0,minimap:{enabled:!1},wordWrap:"on",insertSpaces:!0,tabSize:2,padding:{top:10,bottom:10}},Ou=({content:r,onChange:e})=>{const t=z.useRef(null),n=z.useRef(null),i=z.useRef(null),[,s]=z.useState(!1),[,o]=z.useState(!1);z.useEffect(()=>()=>{n.current?.dispose?.(),i.current&&clearTimeout(i.current)},[]);const a=c=>{t.current=c,n.current?.dispose?.(),n.current=c.onDidChangeModelContent(()=>{l()}),l()},l=()=>{const c=t.current?.getModel?.();if(c&&typeof c.canUndo=="function"&&typeof c.canRedo=="function")try{s(c.canUndo()),o(c.canRedo());return}catch{}const d=!!t.current;s(d),o(d)},u=c=>{e(c)};return Y.jsx("div",{style:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},children:Y.jsx("div",{style:{flex:1,width:"100%"},children:Y.jsx(P4,{options:z4,width:"100%",height:"100%",language:"xml",value:r,onMount:a,onChange:c=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{u(c||"")},500)}})})})};function Qe(r){this.content=r}Qe.prototype={constructor:Qe,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),s=n.content.slice();return i==-1?s.push(t||r,e):(s[i+1]=e,t&&(s[i]=t)),new Qe(s)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Qe(t)},addToStart:function(r,e){return new Qe([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Qe(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),s=n.find(r);return i.splice(s==-1?i.length:s,0,e,t),new Qe(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Qe.from(r),r.size?new Qe(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Qe.from(r),r.size?new Qe(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Qe.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}},Qe.from=function(r){if(r instanceof Qe)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Qe(e)};function Nu(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=Nu(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Du(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,n-=l;continue}if(!o.sameMarkup(a))return{a:t,b:n};if(o.isText&&o.text!=a.text){let u=0,c=Math.min(o.text.length,a.text.length);for(;u<c&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,t--,n--;return{a:t,b:n}}if(o.content.size||a.content.size){let u=Du(o.content,a.content,t-1,n-1);if(u)return u}t-=l,n-=l}}class F{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,s){for(let o=0,a=0;a<t;o++){let l=this.content[o],u=a+l.nodeSize;if(u>e&&n(l,i+a,s||null,o)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,t-c),n,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&n&&(o?o=!1:s+=n),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new F(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),n.push(a),i+=a.nodeSize),o=l}return new F(n,i)}cutByIndex(e,t){return e==t?F.empty:e==0&&t==this.content.length?this:new F(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new F(i,s)}addToStart(e){return new F([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new F(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Nu(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Du(this,e,t,n)}findIndex(e){if(e==0)return ls(0,e);if(e==this.size)return ls(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),s=n+i.nodeSize;if(s>=e)return s==e?ls(t+1,s):ls(t,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return F.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new F(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return F.empty;let t,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new F(t||e,n)}static from(e){if(!e)return F.empty;if(e instanceof F)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new F([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}F.empty=new F([],0);const Zo={index:0,offset:0};function ls(r,e){return Zo.index=r,Zo.offset=e,Zo}function us(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!us(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!us(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let Ae=class H0{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&us(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return H0.none;if(e instanceof H0)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};Ae.none=[];class cs extends Error{}class U{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Ru(this.content,e+this.openStart,t);return n&&new U(n,this.openStart,this.openEnd)}removeBetween(e,t){return new U(Iu(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return U.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new U(F.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new U(e,n,i)}}U.empty=new U(F.empty,0,0);function Iu(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:a}=r.findIndex(t);if(i==e||s.isText){if(a!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(Iu(s.content,e-i-1,t-i-1)))}function Ru(r,e,t,n){let{index:i,offset:s}=r.findIndex(e),o=r.maybeChild(i);if(s==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let a=Ru(o.content,e-s-1,t,o);return a&&r.replaceChild(i,o.copy(a))}function L4(r,e,t){if(t.openStart>r.depth)throw new cs("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new cs("Inconsistent open depths");return Pu(r,e,t,0)}function Pu(r,e,t,n){let i=r.index(n),s=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=Pu(r,e,t,n+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,a=o.content;return on(o,a.cut(0,r.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=B4(t,r);return on(s,Lu(r,o,a,e,n))}else return on(s,ds(r,e,n))}function zu(r,e){if(!e.type.compatibleContent(r.type))throw new cs("Cannot join "+e.type.name+" onto "+r.type.name)}function Qo(r,e,t){let n=r.node(t);return zu(n,e.node(t)),n}function sn(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function ui(r,e,t,n){let i=(e||r).node(t),s=0,o=e?e.index(t):i.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(sn(r.nodeAfter,n),s++));for(let a=s;a<o;a++)sn(i.child(a),n);e&&e.depth==t&&e.textOffset&&sn(e.nodeBefore,n)}function on(r,e){return r.type.checkContent(e),r.copy(e)}function Lu(r,e,t,n,i){let s=r.depth>i&&Qo(r,e,i+1),o=n.depth>i&&Qo(t,n,i+1),a=[];return ui(null,r,i,a),s&&o&&e.index(i)==t.index(i)?(zu(s,o),sn(on(s,Lu(r,e,t,n,i+1)),a)):(s&&sn(on(s,ds(r,e,i+1)),a),ui(e,t,i,a),o&&sn(on(o,ds(t,n,i+1)),a)),ui(n,null,i,a),new F(a)}function ds(r,e,t){let n=[];if(ui(null,r,t,n),r.depth>t){let i=Qo(r,e,t+1);sn(on(i,ds(r,e,t+1)),n)}return ui(e,null,t,n),new F(n)}function B4(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(F.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class ci{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=n.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Ae.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let a=n;n=i,i=a}let s=n.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<n.length;s++)n[s].type.spec.inclusive===!1&&(!i||!n[s].isInSet(i.marks))&&(n=n[s--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new fs(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),u=s-l;if(n.push(o,a,i+l),!u||(o=o.child(a),o.isText))break;s=u-1,i+=l+1}return new ci(t,n,s)}static resolveCached(e,t){let n=Bu.get(e);if(n)for(let s=0;s<n.elts.length;s++){let o=n.elts[s];if(o.pos==t)return o}else Bu.set(e,n=new F4);let i=n.elts[n.i]=ci.resolve(e,t);return n.i=(n.i+1)%$4,i}}class F4{constructor(){this.elts=[],this.i=0}}const $4=12,Bu=new WeakMap;class fs{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const H4=Object.create(null);let Ar=class V0{constructor(e,t,n,i=Ae.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||F.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&us(this.attrs,t||e.defaultAttrs||H4)&&Ae.sameSet(this.marks,n||Ae.none)}copy(e=null){return e==this.content?this:new V0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new V0(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return U.empty;let i=this.resolve(e),s=this.resolve(t),o=n?0:i.sharedDepth(t),a=i.start(o),u=i.node(o).content.cut(i.pos-a,s.pos-a);return new U(u,i.depth-o,s.depth-o)}replace(e,t,n){return L4(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return ci.resolveCached(this,e)}resolveNoCache(e){return ci.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Fu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=F.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(n),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ae.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Ae.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=F.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,n);return s.type.checkAttrs(s.attrs),s}};Ar.prototype.text=void 0;let V4=class _0 extends Ar{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Fu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new _0(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new _0(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Fu(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class an{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new _4(e,t);if(n.next==null)return an.empty;let i=$u(n);n.next&&n.err("Unexpected trailing text");let s=J4(K4(i));return Y4(s,n),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let s=t;i&&s<n;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function s(o,a){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return F.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:c,next:d}=o.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let h=s(d,a.concat(c));if(h)return h}}return null}return s(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(n.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)s+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return s}).join(`
|
|
497
|
-
`)}}an.empty=new an(!0);class _4{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function $u(r){let e=[];do e.push(j4(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function j4(r){let e=[];do e.push(q4(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function q4(r){let e=G4(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=W4(r,e);else break;return e}function Hu(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function W4(r,e){let t=Hu(r),n=t;return r.eat(",")&&(r.next!="}"?n=Hu(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function U4(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let s in t){let o=t[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function G4(r){if(r.eat("(")){let e=$u(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=U4(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function K4(r){let e=[[]];return i(s(r,0),t()),e;function t(){return e.push([])-1}function n(o,a,l){let u={term:l,to:a};return e[o].push(u),u}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(s(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=s(o.exprs[l],a);if(l==o.exprs.length-1)return u;i(u,a=t())}else if(o.type=="star"){let l=t();return n(a,l),i(s(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=t();return i(s(o.expr,a),l),i(s(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u<o.min;u++){let c=t();i(s(o.expr,l),c),l=c}if(o.max==-1)i(s(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let c=t();n(l,c),i(s(o.expr,l),c),l=c}return[n(l)]}else{if(o.type=="name")return[n(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Vu(r,e){return e-r}function _u(r,e){let t=[];return n(e),t.sort(Vu);function n(i){let s=r[i];if(s.length==1&&!s[0].term)return n(s[0].to);t.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&t.indexOf(l)==-1&&n(l)}}}function J4(r){let e=Object.create(null);return t(_u(r,0));function t(n){let i=[];n.forEach(o=>{r[o].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c<i.length;c++)i[c][0]==a&&(u=i[c][1]);_u(r,l).forEach(c=>{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=e[n.join(",")]=new an(n.indexOf(r.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(Vu);s.next.push({type:i[o][0],next:e[a.join(",")]||t(a)})}return s}}function Y4(r,e){for(let t=0,n=[r];t<n.length;t++){let i=n[t],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:u}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),n.indexOf(u)==-1&&n.push(u)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ju(r){let e=Object.create(null);for(let t in r){let n=r[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function qu(r,e){let t=Object.create(null);for(let n in r){let i=e&&e[n];if(i===void 0){let s=r[n];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=i}return t}function Wu(r,e,t,n){for(let i in e)if(!(i in r))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in r){let s=r[i];s.validate&&s.validate(e[i])}}function Uu(r,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Z4(r,n,e[n]);return t}let Gu=class w1{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Uu(e,n.attrs),this.defaultAttrs=ju(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==an.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:qu(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ar(this,this.computeAttrs(e),F.from(t),Ae.setFrom(n))}createChecked(e=null,t,n){return t=F.from(t),this.checkContent(t),new Ar(this,this.computeAttrs(e),t,Ae.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=F.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(F.empty,!0);return s?new Ar(this,e,t.append(s),Ae.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Wu(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Ae.none:e}static compile(e,t){let n=Object.create(null);e.forEach((s,o)=>n[s]=new w1(s,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function X4(r,e,t){let n=t.split("|");return i=>{let s=i===null?"null":typeof i;if(n.indexOf(s)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${s}`)}}class Z4{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?X4(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class hs{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=Uu(e,i.attrs),this.excluded=null;let s=ju(this.attrs);this.instance=s?new Ae(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Ae(this,qu(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((s,o)=>n[s]=new hs(s,i++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Wu(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Ku{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Qe.from(e.nodes),t.marks=Qe.from(e.marks||{}),this.nodes=Gu.compile(this.spec.nodes,this),this.marks=hs.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=n[o]||(n[o]=an.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?Ju(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Ju(this,o.split(" "))}this.nodeFromJSON=i=>Ar.fromJSON(this,i),this.markFromJSON=i=>Ae.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Gu){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new V4(n,n.defaultAttrs,e,Ae.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Ju(r,e){let t=[];for(let n=0;n<e.length;n++){let i=e[n],s=r.marks[i],o=s;if(s)t.push(s);else for(let a in r.marks){let l=r.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function Q4(r){return r.tag!=null}function e2(r){return r.style!=null}class Or{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(Q4(i))this.tags.push(i);else if(e2(i)){let s=/[^=]*/.exec(i.style)[0];n.indexOf(s)<0&&n.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let n=new Qu(this,t,!1);return n.addAll(e,Ae.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Qu(this,t,!0);return n.addAll(e,Ae.none,t.from,t.to),U.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(n2(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,n,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let a=t[o];if((a.priority==null?50:a.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{n(o=ec(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=ec(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Or(e,Or.schemaRules(e)))}}const Yu={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},t2={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Xu={ol:!0,ul:!0},di=1,ea=2,fi=4;function Zu(r,e,t){return e!=null?(e?di:0)|(e==="full"?ea:0):r&&r.whitespace=="pre"?di|ea:t&~fi}class ps{constructor(e,t,n,i,s,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=Ae.none,this.match=s||(o&fi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(F.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&di)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=F.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(F.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Yu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Qu{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=Zu(null,t.preserveWhitespace,0)|(n?fi:0);i?s=new ps(i.type,i.attrs,Ae.none,!0,t.topMatch||i.type.contentMatch,o):n?s=new ps(null,null,Ae.none,!0,null,o):s=new ps(e.schema.topNodeType,null,Ae.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,i=this.top,s=i.options&ea?"full":this.localPreserveWS||(i.options&di)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(s)if(s==="full")n=n.replace(/\r\n?/g,`
|
|
498
|
-
`);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=n.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),t,!0),a[l]&&this.insertNode(o.text(a[l]),t,!/\S/.test(a[l]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;
|
|
499
|
-
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=n.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(u=>!l.clearMark(u)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,n,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,t.attrs||null,n,t.preserveWhitespace);l&&(s=!0,n=l)}else{let l=this.parser.schema.marks[t.mark];n=n.concat(l.create(t.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,t,n,i){let s=n||0;for(let o=n?e.childNodes[n]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,n){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+a)&&(i=u,s=l,!u.length))break;if(l.solid){if(n)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=Ae.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):tc(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,t,n,i){let s=this.findPlace(e.create(t),n,!1);return s&&(s=this.enterInner(e,t,n,!0,i)),s}enterInner(e,t,n,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=Zu(e,s,o.options);o.options&fi&&o.content.length==0&&(a|=fi);let l=Ae.none;return n=n.filter(u=>(o.type?o.type.allowsMarkType(u.type):tc(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new ps(e,t,l,i,null,a)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=di)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let u=t[a];if(u==""){if(a==t.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:n&&l>=s?n.node(l-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function r2(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&Xu.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function n2(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function ec(r){let e={};for(let t in r)e[t]=r[t];return e}function tc(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:c}=a.edge(l);if(u==e||s.indexOf(c)<0&&o(c))return!0}};if(o(i.contentMatch))return!0}}class ln{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=ta(t).createDocumentFragment());let i=n,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(s[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],c=this.serializeMark(u,o.isInline,t);c&&(s.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=ms(ta(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&ms(ta(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return ms(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ln(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=rc(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return rc(e.marks)}}function rc(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function ta(r){return r.document||window.document}const nc=new WeakMap;function i2(r){let e=nc.get(r);return e===void 0&&nc.set(r,e=s2(r)),e}function s2(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)t(n[i]);else for(let i in n)t(n[i])}return t(r),e}function ms(r,e,t,n){if(typeof e=="string")return{dom:r.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(s=i2(n))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let a,l=t?r.createElementNS(t,i):r.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let h=d.indexOf(" ");h>0?l.setAttributeNS(d.slice(0,h),d.slice(h+1),u[d]):d=="style"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:m}=ms(r,h,t,n);if(l.appendChild(f),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const ic=65535,sc=Math.pow(2,16);function o2(r,e){return r+e*sc}function oc(r){return r&ic}function a2(r){return(r-(r&ic))/sc}const ac=1,lc=2,gs=4,uc=8;class ra{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&uc)>0}get deletedBefore(){return(this.delInfo&(ac|gs))>0}get deletedAfter(){return(this.delInfo&(lc|gs))>0}get deletedAcross(){return(this.delInfo&gs)>0}}class St{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&St.empty)return St.empty}recover(e){let t=0,n=oc(e);if(!this.inverted)for(let i=0;i<n;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+t+a2(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+s],c=this.ranges[a+o],d=l+u;if(e<=d){let h=u?e==l?-1:e==d?1:t:t,f=l+i+(h<0?0:c);if(n)return f;let m=e==(t<0?l:d)?null:o2(a/3,e-l),v=e==l?lc:e==d?ac:gs;return(t<0?e!=l:e!=d)&&(v|=uc),new ra(f,v,m)}i+=c-u}return n?e+i:new ra(e+i,0,null)}touches(e,t){let n=0,i=oc(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;let u=this.ranges[a+s],c=l+u;if(e<=c&&a==i*3)return!0;n+=this.ranges[a+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+t],c=this.ranges[i+n];e(a,a+u,l,l+c),s+=c-u}}invert(){return new St(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?St.empty:new St(e<0?[0,-e,0]:[0,0,e])}}St.empty=new St([]);class hi{constructor(e,t,n=0,i=e?e.length:0){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new hi(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?n+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new hi;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,t);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return n?e:new ra(e,i,null)}}const na=Object.create(null);class nt{getMap(){return St.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=na[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in na)throw new RangeError("Duplicate use of step JSON ID "+e);return na[e]=t,t.prototype.jsonID=e,t}}class je{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new je(e,null)}static fail(e){return new je(null,e)}static fromReplace(e,t,n,i){try{return je.ok(e.replace(t,n,i))}catch(s){if(s instanceof cs)return je.fail(s.message);throw s}}}function ia(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let s=r.child(i);s.content.size&&(s=s.copy(ia(s.content,e,s))),s.isInline&&(s=e(s,t,i)),n.push(s)}return F.fromArray(n)}class Nr extends nt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),s=new U(ia(t.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return je.fromReplace(e,this.from,this.to,s)}invert(){return new Ft(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Nr(t.pos,n.pos,this.mark)}merge(e){return e instanceof Nr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Nr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Nr(t.from,t.to,e.markFromJSON(t.mark))}}nt.jsonID("addMark",Nr);class Ft extends nt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new U(ia(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return je.fromReplace(e,this.from,this.to,n)}invert(){return new Nr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Ft(t.pos,n.pos,this.mark)}merge(e){return e instanceof Ft&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ft(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ft(t.from,t.to,e.markFromJSON(t.mark))}}nt.jsonID("removeMark",Ft);class Dr extends nt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return je.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return je.fromReplace(e,this.pos,this.pos+1,new U(F.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(n))return new Dr(this.pos,t.marks[i]);return new Dr(this.pos,this.mark)}}return new un(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Dr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Dr(t.pos,e.markFromJSON(t.mark))}}nt.jsonID("addNodeMark",Dr);class un extends nt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return je.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return je.fromReplace(e,this.pos,this.pos+1,new U(F.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Dr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new un(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new un(t.pos,e.markFromJSON(t.mark))}}nt.jsonID("removeNodeMark",un);class Je extends nt{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&sa(e,this.from,this.to)?je.fail("Structure replace would overwrite content"):je.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new St([this.from,this.to-this.from,this.slice.size])}invert(e){return new Je(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Je(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Je)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?U.empty:new U(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Je(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?U.empty:new U(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Je(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Je(t.from,t.to,U.fromJSON(e,t.slice),!!t.structure)}}nt.jsonID("replace",Je);class Ye extends nt{constructor(e,t,n,i,s,o,a=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(sa(e,this.from,this.gapFrom)||sa(e,this.gapTo,this.to)))return je.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return je.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?je.fromReplace(e,this.from,this.to,n):je.fail("Content does not fit in gap")}getMap(){return new St([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Ye(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||s>n.pos?null:new Ye(t.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ye(t.from,t.to,t.gapFrom,t.gapTo,U.fromJSON(e,t.slice),t.insert,!!t.structure)}}nt.jsonID("replaceAround",Ye);function sa(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function l2(r,e,t,n){let i=[],s=[],o,a;r.doc.nodesBetween(e,t,(l,u,c)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&c.type.allowsMarkType(n.type)){let h=Math.max(u,e),f=Math.min(u+l.nodeSize,t),m=n.addToSet(d);for(let v=0;v<d.length;v++)d[v].isInSet(m)||(o&&o.to==h&&o.mark.eq(d[v])?o.to=f:i.push(o=new Ft(h,f,d[v])));a&&a.to==h?a.to=f:s.push(a=new Nr(h,f,n))}}),i.forEach(l=>r.step(l)),s.forEach(l=>r.step(l))}function u2(r,e,t,n){let i=[],s=0;r.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(n instanceof hs){let u=o.marks,c;for(;c=n.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let u=Math.min(a+o.nodeSize,t);for(let c=0;c<l.length;c++){let d=l[c],h;for(let f=0;f<i.length;f++){let m=i[f];m.step==s-1&&d.eq(i[f].style)&&(h=m)}h?(h.to=u,h.step=s):i.push({style:d,from:Math.max(a,e),to:u,step:s})}}}),i.forEach(o=>r.step(new Ft(o.from,o.to,o.style)))}function oa(r,e,t,n=t.contentMatch,i=!0){let s=r.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let u=s.child(l),c=a+u.nodeSize,d=n.matchType(u.type);if(!d)o.push(new Je(a,c,U.empty));else{n=d;for(let h=0;h<u.marks.length;h++)t.allowsMarkType(u.marks[h].type)||r.step(new Ft(a,c,u.marks[h]));if(i&&u.isText&&t.whitespace!="pre"){let h,f=/\r?\n|\r/g,m;for(;h=f.exec(u.text);)m||(m=new U(F.from(t.schema.text(" ",t.allowedMarks(u.marks))),0,0)),o.push(new Je(a+h.index,a+h.index+h[0].length,m))}}a=c}if(!n.validEnd){let l=n.fillBefore(F.empty,!0);r.replace(a,a,new U(l,0,0))}for(let l=o.length-1;l>=0;l--)r.step(o[l])}function c2(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Mn(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth,i=0,s=0;;--n){let o=r.$from.node(n),a=r.$from.index(n)+i,l=r.$to.indexAfter(n)-s;if(n<r.depth&&o.canReplace(a,l,t))return n;if(n==0||o.type.spec.isolating||!c2(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function d2(r,e,t){let{$from:n,$to:i,depth:s}=e,o=n.before(s+1),a=i.after(s+1),l=o,u=a,c=F.empty,d=0;for(let m=s,v=!1;m>t;m--)v||n.index(m)>0?(v=!0,c=F.from(n.node(m).copy(c)),d++):l--;let h=F.empty,f=0;for(let m=s,v=!1;m>t;m--)v||i.after(m+1)<i.end(m)?(v=!0,h=F.from(i.node(m).copy(h)),f++):u++;r.step(new Ye(l,u,o,a,new U(c.append(h),d,f),c.size-d,!0))}function aa(r,e,t=null,n=r){let i=f2(r,e),s=i&&h2(n,e);return s?i.map(cc).concat({type:e,attrs:t}).concat(s.map(cc)):null}function cc(r){return{type:r,attrs:null}}function f2(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.contentMatchAt(n).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(n,i,o)?s:null}function h2(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.child(n),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=n;l&&u<i;u++)l=l.matchType(t.child(u).type);return!l||!l.validEnd?null:o}function p2(r,e,t){let n=F.empty;for(let o=t.length-1;o>=0;o--){if(n.size){let a=t[o].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=F.from(t[o].type.create(t[o].attrs,n))}let i=e.start,s=e.end;r.step(new Ye(i,s,i,s,new U(n,0,0),t.length,!0))}function m2(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=r.steps.length;r.doc.nodesBetween(e,t,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&g2(r.doc,r.mapping.slice(s).map(a),n)){let u=null;if(n.schema.linebreakReplacement){let f=n.whitespace=="pre",m=!!n.contentMatch.matchType(n.schema.linebreakReplacement);f&&!m?u=!1:!f&&m&&(u=!0)}u===!1&&fc(r,o,a,s),oa(r,r.mapping.slice(s).map(a,1),n,void 0,u===null);let c=r.mapping.slice(s),d=c.map(a,1),h=c.map(a+o.nodeSize,1);return r.step(new Ye(d,h,d+1,h-1,new U(F.from(n.create(l,null,o.marks)),0,0),1,!0)),u===!0&&dc(r,o,a,s),!1}})}function dc(r,e,t,n){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=r.mapping.slice(n).map(t+1+s+o.index);r.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function fc(r,e,t,n){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=r.mapping.slice(n).map(t+1+s);r.replaceWith(o,o+1,e.type.schema.text(`
|
|
500
|
-
`))}})}function g2(r,e,t){let n=r.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,t)}function v2(r,e,t,n,i){let s=r.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(n,null,i||s.marks);if(s.isLeaf)return r.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new Ye(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new U(F.from(o),0,0),1,!0))}function ar(r,e,t=1,n){let i=r.resolve(e),s=i.depth-t,o=n&&n[n.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=t-2;u>s;u--,c--){let d=i.node(u),h=i.index(u);if(d.type.spec.isolating)return!1;let f=d.content.cutByIndex(h,d.childCount),m=n&&n[c+1];m&&(f=f.replaceChild(0,m.type.create(m.attrs)));let v=n&&n[c]||d;if(!d.canReplace(h+1,d.childCount)||!v.type.validContent(f))return!1}let a=i.indexAfter(s),l=n&&n[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function y2(r,e,t=1,n){let i=r.doc.resolve(e),s=F.empty,o=F.empty;for(let a=i.depth,l=i.depth-t,u=t-1;a>l;a--,u--){s=F.from(i.node(a).copy(s));let c=n&&n[u];o=F.from(c?c.type.create(c.attrs,o):i.node(a).copy(o))}r.step(new Je(e,e,new U(s.append(o),t,t),!0))}function Ir(r,e){let t=r.resolve(e),n=t.index();return hc(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function b2(r,e){e.content.size||r.type.compatibleContent(e.type);let t=r.contentMatchAt(r.childCount),{linebreakReplacement:n}=r.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==n?r.type.schema.nodes.text:s.type;if(t=t.matchType(o),!t||!r.type.allowsMarks(s.marks))return!1}return t.validEnd}function hc(r,e){return!!(r&&e&&!r.isLeaf&&b2(r,e))}function vs(r,e,t=-1){let n=r.resolve(e);for(let i=n.depth;;i--){let s,o,a=n.index(i);if(i==n.depth?(s=n.nodeBefore,o=n.nodeAfter):t>0?(s=n.node(i+1),a++,o=n.node(i).maybeChild(a)):(s=n.node(i).maybeChild(a-1),o=n.node(i+1)),s&&!s.isTextblock&&hc(s,o)&&n.node(i).canReplace(a,a+1))return e;if(i==0)break;e=t<0?n.before(i):n.after(i)}}function w2(r,e,t){let n=null,{linebreakReplacement:i}=r.doc.type.schema,s=r.doc.resolve(e-t),o=s.node().type;if(i&&o.inlineContent){let c=o.whitespace=="pre",d=!!o.contentMatch.matchType(i);c&&!d?n=!1:!c&&d&&(n=!0)}let a=r.steps.length;if(n===!1){let c=r.doc.resolve(e+t);fc(r,c.node(),c.before(),a)}o.inlineContent&&oa(r,e+t-1,o,s.node().contentMatchAt(s.index()),n==null);let l=r.mapping.slice(a),u=l.map(e-t);if(r.step(new Je(u,l.map(e+t,-1),U.empty,!0)),n===!0){let c=r.doc.resolve(u);dc(r,c.node(),c.before(),r.steps.length)}return r}function x2(r,e,t){let n=r.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,t))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,t))return n.after(i+1);if(s<n.node(i).childCount)return null}return null}function pc(r,e,t){let n=r.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let o=n.depth;o>=0;o--){let a=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,l=n.index(o)+(a>0?1:0),u=n.node(o),c=!1;if(s==1)c=u.canReplace(l,l,i);else{let d=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=d&&u.canReplaceWith(l,l,d[0])}if(c)return a==0?n.pos:a<0?n.before(o+1):n.after(o+1)}return null}function ys(r,e,t=e,n=U.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),s=r.resolve(t);return mc(i,s,n)?new Je(e,t,n):new S2(i,s,n).fit()}function mc(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class S2{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=F.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=F.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new U(s,o,a);return e>-1?new Ye(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new Je(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}t=s.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=la(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,d=null;if(t==1&&(o?u.matchType(o.type)||(d=u.fillBefore(F.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:a,parent:s,inject:d};if(t==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:a,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=la(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new U(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=la(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new U(pi(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new U(pi(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let v=0;v<s.length;v++)this.openFrontierNode(s[v]);let o=this.unplaced,a=n?n.content:o.content,l=o.openStart-e,u=0,c=[],{match:d,type:h}=this.frontier[t];if(i){for(let v=0;v<i.childCount;v++)c.push(i.child(v));d=d.matchFragment(i)}let f=a.size+e-(o.content.size-o.openEnd);for(;u<a.childCount;){let v=a.child(u),y=d.matchType(v.type);if(!y)break;u++,(u>1||l==0||v.content.size)&&(d=y,c.push(gc(v.mark(h.allowedMarks(v.marks)),u==1?l:0,u==a.childCount?f:-1)))}let m=u==a.childCount;m||(f=-1),this.placed=mi(this.placed,t,F.from(c)),this.frontier[t].match=d,m&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,y=a;v<f;v++){let w=y.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),y=w.content}this.unplaced=m?e==0?U.empty:new U(pi(o.content,e-1,1),e-1,f<0?o.openEnd:e-1):new U(pi(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!ua(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=ua(e,t,i,n,s);if(o){for(let a=t-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],c=ua(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=mi(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=mi(this.placed,this.depth,F.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(F.empty,!0);t.childCount&&(this.placed=mi(this.placed,this.frontier.length,t))}}function pi(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(pi(r.firstChild.content,e-1,t)))}function mi(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(mi(r.lastChild.content,e-1,t)))}function la(r,e){for(let t=0;t<e;t++)r=r.firstChild.content;return r}function gc(r,e,t){if(e<=0)return r;let n=r.content;return e>1&&(n=n.replaceChild(0,gc(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(F.empty,!0)))),r.copy(n)}function ua(r,e,t,n,i){let s=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let a=n.fillBefore(s.content,!0,o);return a&&!k2(t,s.content,o)?a:null}function k2(r,e,t){for(let n=t;n<e.childCount;n++)if(!r.allowsMarks(e.child(n).marks))return!0;return!1}function T2(r){return r.spec.defining||r.spec.definingForContent}function M2(r,e,t,n){if(!n.size)return r.deleteRange(e,t);let i=r.doc.resolve(e),s=r.doc.resolve(t);if(mc(i,s,n))return r.step(new Je(e,t,n));let o=yc(i,s);o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let h=i.depth,f=i.pos-1;h>0;h--,f--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(h)>-1?a=h:i.before(h)==f&&o.splice(1,0,-h)}let l=o.indexOf(a),u=[],c=n.openStart;for(let h=n.content,f=0;;f++){let m=h.firstChild;if(u.push(m),f==n.openStart)break;h=m.content}for(let h=c-1;h>=0;h--){let f=u[h],m=T2(f.type);if(m&&!f.sameMarkup(i.node(Math.abs(a)-1)))c=h;else if(m||!f.type.isTextblock)break}for(let h=n.openStart;h>=0;h--){let f=(h+c+1)%(n.openStart+1),m=u[f];if(m)for(let v=0;v<o.length;v++){let y=o[(v+l)%o.length],w=!0;y<0&&(w=!1,y=-y);let k=i.node(y-1),E=i.index(y-1);if(k.canReplaceWith(E,E,m.type,m.marks))return r.replace(i.before(y),w?s.after(y):t,new U(vc(n.content,0,n.openStart,f),f,n.openEnd))}}let d=r.steps.length;for(let h=o.length-1;h>=0&&(r.replace(e,t,n),!(r.steps.length>d));h--){let f=o[h];f<0||(e=i.before(f),t=s.after(f))}}function vc(r,e,t,n,i){if(e<t){let s=r.firstChild;r=r.replaceChild(0,s.copy(vc(s.content,e+1,t,n,s)))}if(e>n){let s=i.contentMatchAt(0),o=s.fillBefore(r).append(r);r=o.append(s.matchFragment(o).fillBefore(F.empty,!0))}return r}function C2(r,e,t,n){if(!n.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let i=x2(r.doc,e,n.type);i!=null&&(e=t=i)}r.replaceRange(e,t,new U(F.from(n),0,0))}function E2(r,e,t){let n=r.doc.resolve(e),i=r.doc.resolve(t),s=yc(n,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||n.node(a).type.contentMatch.validEnd)return r.delete(n.start(a),i.end(a));if(a>0&&(l||n.node(a-1).canReplace(n.index(a-1),i.indexAfter(a-1))))return r.delete(n.before(a),i.after(a))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&i.end(o)-t!=i.depth-o&&n.start(o-1)==i.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),i.index(o-1)))return r.delete(n.before(o),t);r.delete(e,t)}function yc(r,e){let t=[],n=Math.min(r.depth,e.depth);for(let i=n;i>=0;i--){let s=r.start(i);if(s<r.pos-(r.depth-i)||e.end(i)>e.pos+(e.depth-i)||r.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==r.depth&&i==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class Cn extends nt{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return je.fail("No node at attribute step's position");let n=Object.create(null);for(let s in t.attrs)n[s]=t.attrs[s];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return je.fromReplace(e,this.pos,this.pos+1,new U(F.from(i),0,t.isLeaf?0:1))}getMap(){return St.empty}invert(e){return new Cn(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Cn(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Cn(t.pos,t.attr,t.value)}}nt.jsonID("attr",Cn);class gi extends nt{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return je.ok(n)}getMap(){return St.empty}invert(e){return new gi(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new gi(t.attr,t.value)}}nt.jsonID("docAttr",gi);let En=class extends Error{};En=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t},En.prototype=Object.create(Error.prototype),En.prototype.constructor=En,En.prototype.name="TransformError";class bc{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new hi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new En(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=U.empty){let i=ys(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new U(F.from(n),0,0))}delete(e,t){return this.replace(e,t,U.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return M2(this,e,t,n),this}replaceRangeWith(e,t,n){return C2(this,e,t,n),this}deleteRange(e,t){return E2(this,e,t),this}lift(e,t){return d2(this,e,t),this}join(e,t=1){return w2(this,e,t),this}wrap(e,t){return p2(this,e,t),this}setBlockType(e,t=e,n,i=null){return m2(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return v2(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new Cn(e,t,n)),this}setDocAttribute(e,t){return this.step(new gi(e,t)),this}addNodeMark(e,t){return this.step(new Dr(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof Ae)t.isInSet(n.marks)&&this.step(new un(e,t));else{let i=n.marks,s,o=[];for(;s=t.isInSet(i);)o.push(new un(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,t=1,n){return y2(this,e,t,n),this}addMark(e,t,n){return l2(this,e,t,n),this}removeMark(e,t,n){return u2(this,e,t,n),this}clearIncompatible(e,t,n){return oa(this,e,t,n),this}}const ca=Object.create(null);class le{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new wc(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=U.empty){let n=t.content.lastChild,i=null;for(let a=0;a<t.openEnd;a++)i=n,n=n.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:u}=o[a],c=e.mapping.slice(s);e.replaceRange(c.map(l.pos),c.map(u.pos),a?U.empty:t),a==0&&kc(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(n),u=l.map(o.pos),c=l.map(a.pos);s?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),kc(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new de(e):An(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=t<0?An(e.node(0),e.node(s),e.before(s+1),e.index(s),t,n):An(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new kt(e.node(0))}static atStart(e){return An(e,e,0,0,1)||new kt(e)}static atEnd(e){return An(e,e,e.content.size,e.childCount,-1)||new kt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=ca[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ca)throw new RangeError("Duplicate use of selection JSON ID "+e);return ca[e]=t,t.prototype.jsonID=e,t}getBookmark(){return de.between(this.$anchor,this.$head).getBookmark()}}le.prototype.visible=!0;class wc{constructor(e,t){this.$from=e,this.$to=t}}let xc=!1;function Sc(r){!xc&&!r.parent.inlineContent&&(xc=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class de extends le{constructor(e,t=e){Sc(e),Sc(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return le.near(n);let i=e.resolve(t.map(this.anchor));return new de(i.parent.inlineContent?i:n,n)}replace(e,t=U.empty){if(super.replace(e,t),t==U.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof de&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new bs(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new de(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let s=le.findFrom(t,n,!0)||le.findFrom(t,-n,!0);if(s)t=s.$head;else return le.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(le.findFrom(e,-n,!0)||le.findFrom(e,n,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new de(e,t)}}le.jsonID("text",de);class bs{constructor(e,t){this.anchor=e,this.head=t}map(e){return new bs(e.map(this.anchor),e.map(this.head))}resolve(e){return de.between(e.resolve(this.anchor),e.resolve(this.head))}}class ie extends le{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:i}=t.mapResult(this.anchor),s=e.resolve(i);return n?le.near(s):new ie(s)}content(){return new U(F.from(this.node),0,0)}eq(e){return e instanceof ie&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new da(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ie(e.resolve(t.anchor))}static create(e,t){return new ie(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ie.prototype.visible=!1,le.jsonID("node",ie);class da{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new bs(n,n):new da(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&ie.isSelectable(n)?new ie(t):le.near(t)}}class kt extends le{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=U.empty){if(t==U.empty){e.delete(0,e.doc.content.size);let n=le.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new kt(e)}map(e){return new kt(e)}eq(e){return e instanceof kt}getBookmark(){return A2}}le.jsonID("all",kt);const A2={map(){return this},resolve(r){return new kt(r)}};function An(r,e,t,n,i,s=!1){if(e.inlineContent)return de.create(r,t);for(let o=n-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&ie.isSelectable(a))return ie.create(r,t-(i<0?a.nodeSize:0))}else{let l=An(r,a,t+i,i<0?a.childCount:0,i,s);if(l)return l}t+=a.nodeSize*i}return null}function kc(r,e,t){let n=r.steps.length-1;if(n<e)return;let i=r.steps[n];if(!(i instanceof Je||i instanceof Ye))return;let s=r.mapping.maps[n],o;s.forEach((a,l,u,c)=>{o==null&&(o=c)}),r.setSelection(le.near(r.doc.resolve(o),t))}const Tc=1,ws=2,Mc=4;class O2 extends bc{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Tc)&~ws,this.storedMarks=null,this}get selectionSet(){return(this.updated&Tc)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ws,this}ensureMarks(e){return Ae.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ws)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~ws,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Ae.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=t),!e)return this.deleteRange(t,n);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,s)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(le.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Mc,this}get scrolledIntoView(){return(this.updated&Mc)>0}}function Cc(r,e){return!e||!r?r:r.bind(e)}class vi{constructor(e,t,n){this.name=e,this.init=Cc(t.init,n),this.apply=Cc(t.apply,n)}}const N2=[new vi("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new vi("selection",{init(r,e){return r.selection||le.atStart(e.doc)},apply(r){return r.selection}}),new vi("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new vi("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}})];class fa{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=N2.slice(),t&&t.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new vi(n.key,n.spec.state,n))})}}class On{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,u=i?i[o].state:this,c=l<t.length&&a.spec.appendTransaction.call(a,l?t.slice(l):t,u,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),s=!0}i&&(i[o]={state:n,n:t.length})}}if(!s)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new On(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let s=n[i];t[s.name]=s.apply(e,this[s.name],this,t)}return t}get tr(){return new O2(this)}static create(e){let t=new fa(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new On(t);for(let i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n}reconfigure(e){let t=new fa(this.schema,e.plugins),n=t.fields,i=new On(t);for(let s=0;s<n.length;s++){let o=n[s].name;i[o]=this.hasOwnProperty(o)?this[o]:n[s].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],s=i.spec.state;s&&s.toJSON&&(t[n]=s.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new fa(e.schema,e.plugins),s=new On(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Ar.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=le.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){s[o.name]=u.fromJSON.call(l,e,t[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function Ec(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=Ec(i,e,{})),t[n]=i}return t}class Be{constructor(e){this.spec=e,this.props={},e.props&&Ec(e.props,this,this.props),this.key=e.key?e.key.key:Ac("plugin")}getState(e){return e[this.key]}}const ha=Object.create(null);function Ac(r){return r in ha?r+"$"+ ++ha[r]:(ha[r]=0,r+"$")}class Ve{constructor(e="key"){this.key=Ac(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const pa=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function Oc(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const Nc=(r,e,t)=>{let n=Oc(r,t);if(!n)return!1;let i=ma(n);if(!i){let o=n.blockRange(),a=o&&Mn(o);return a==null?!1:(e&&e(r.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if($c(r,i,e,-1))return!0;if(n.parent.content.size==0&&(Nn(s,"end")||ie.isSelectable(s)))for(let o=n.depth;;o--){let a=ys(r.doc,n.before(o),n.after(o),U.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=r.tr.step(a);l.setSelection(Nn(s,"end")?le.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):ie.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||n.node(o-1).childCount>1)break}return s.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},D2=(r,e,t)=>{let n=Oc(r,t);if(!n)return!1;let i=ma(n);return i?Dc(r,i,e):!1},I2=(r,e,t)=>{let n=Rc(r,t);if(!n)return!1;let i=ga(n);return i?Dc(r,i,e):!1};function Dc(r,e,t){let n=e.nodeBefore,i=n,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=ys(r.doc,s,l,U.empty);if(!u||u.from!=s||u instanceof Je&&u.slice.size>=l-s)return!1;if(t){let c=r.tr.step(u);c.setSelection(de.create(c.doc,s)),t(c.scrollIntoView())}return!0}function Nn(r,e,t=!1){for(let n=r;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(t&&n.childCount!=1)return!1}return!1}const Ic=(r,e,t)=>{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;s=ma(n)}let o=s&&s.nodeBefore;return!o||!ie.isSelectable(o)?!1:(e&&e(r.tr.setSelection(ie.create(r.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function ma(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function Rc(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset<t.parent.content.size)?null:t}const Pc=(r,e,t)=>{let n=Rc(r,t);if(!n)return!1;let i=ga(n);if(!i)return!1;let s=i.nodeAfter;if($c(r,i,e,1))return!0;if(n.parent.content.size==0&&(Nn(s,"start")||ie.isSelectable(s))){let o=ys(r.doc,n.before(),n.after(),U.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=r.tr.step(o);a.setSelection(Nn(s,"start")?le.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):ie.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},zc=(r,e,t)=>{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset<n.parent.content.size)return!1;s=ga(n)}let o=s&&s.nodeAfter;return!o||!ie.isSelectable(o)?!1:(e&&e(r.tr.setSelection(ie.create(r.doc,s.pos)).scrollIntoView()),!0)};function ga(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){let t=r.node(e);if(r.index(e)+1<t.childCount)return r.doc.resolve(r.after(e+1));if(t.type.spec.isolating)break}return null}const R2=(r,e)=>{let t=r.selection,n=t instanceof ie,i;if(n){if(t.node.isTextblock||!Ir(r.doc,t.from))return!1;i=t.from}else if(i=vs(r.doc,t.from,-1),i==null)return!1;if(e){let s=r.tr.join(i);n&&s.setSelection(ie.create(s.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},P2=(r,e)=>{let t=r.selection,n;if(t instanceof ie){if(t.node.isTextblock||!Ir(r.doc,t.to))return!1;n=t.to}else if(n=vs(r.doc,t.to,1),n==null)return!1;return e&&e(r.tr.join(n).scrollIntoView()),!0},z2=(r,e)=>{let{$from:t,$to:n}=r.selection,i=t.blockRange(n),s=i&&Mn(i);return s==null?!1:(e&&e(r.tr.lift(i,s).scrollIntoView()),!0)},Lc=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(`
|
|
501
|
-
`).scrollIntoView()),!0)};function va(r){for(let e=0;e<r.edgeCount;e++){let{type:t}=r.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const L2=(r,e)=>{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=va(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=t.after(),l=r.tr.replaceWith(a,a,o.createAndFill());l.setSelection(le.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Bc=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof kt||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=va(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,a=r.tr.insert(o,s.createAndFill());a.setSelection(de.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},Fc=(r,e)=>{let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(ar(r.doc,s))return e&&e(r.tr.split(s).scrollIntoView()),!0}let n=t.blockRange(),i=n&&Mn(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)};function B2(r){return(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof ie&&e.selection.node.isBlock)return!n.parentOffset||!ar(e.doc,n.pos)?!1:(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let s=[],o,a,l=!1,u=!1;for(let f=n.depth;;f--)if(n.node(f).isBlock){l=n.end(f)==n.pos+(n.depth-f),u=n.start(f)==n.pos-(n.depth-f),a=va(n.node(f-1).contentMatchAt(n.indexAfter(f-1))),s.unshift(l&&a?{type:a}:null),o=f;break}else{if(f==1)return!1;s.unshift(null)}let c=e.tr;(e.selection instanceof de||e.selection instanceof kt)&&c.deleteSelection();let d=c.mapping.map(n.pos),h=ar(c.doc,d,s.length,s);if(h||(s[0]=a?{type:a}:null,h=ar(c.doc,d,s.length,s)),!h)return!1;if(c.split(d,s.length,s),!l&&u&&n.node(o).type!=a){let f=c.mapping.map(n.before(o)),m=c.doc.resolve(f);a&&n.node(o-1).canReplaceWith(m.index(),m.index()+1,a)&&c.setNodeMarkup(c.mapping.map(n.before(o)),a)}return t&&t(c.scrollIntoView()),!0}}const F2=B2(),$2=(r,e)=>{let{$from:t,to:n}=r.selection,i,s=t.sharedDepth(n);return s==0?!1:(i=t.before(s),e&&e(r.tr.setSelection(ie.create(r.doc,i))),!0)};function H2(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Ir(r.doc,e.pos))?!1:(t&&t(r.tr.join(e.pos).scrollIntoView()),!0)}function $c(r,e,t,n){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&H2(r,e,t))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(t){let f=e.pos+s.nodeSize,m=F.empty;for(let w=o.length-1;w>=0;w--)m=F.from(o[w].create(null,m));m=F.from(i.copy(m));let v=r.tr.step(new Ye(e.pos-1,f,e.pos,f,new U(m,1,0),o.length,!0)),y=v.doc.resolve(f+2*o.length);y.nodeAfter&&y.nodeAfter.type==i.type&&Ir(v.doc,y.pos)&&v.join(y.pos),t(v.scrollIntoView())}return!0}let c=s.type.spec.isolating||n>0&&l?null:le.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),h=d&&Mn(d);if(h!=null&&h>=e.depth)return t&&t(r.tr.lift(d,h).scrollIntoView()),!0;if(u&&Nn(s,"start",!0)&&Nn(i,"end")){let f=i,m=[];for(;m.push(f),!f.isTextblock;)f=f.lastChild;let v=s,y=1;for(;!v.isTextblock;v=v.firstChild)y++;if(f.canReplace(f.childCount,f.childCount,v.content)){if(t){let w=F.empty;for(let E=m.length-1;E>=0;E--)w=F.from(m[E].copy(w));let k=r.tr.step(new Ye(e.pos-m.length,e.pos+s.nodeSize,e.pos+y,e.pos+s.nodeSize-y,new U(w,m.length,0),0,!0));t(k.scrollIntoView())}return!0}}return!1}function Hc(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(de.create(e.doc,r<0?i.start(s):i.end(s)))),!0):!1}}const V2=Hc(-1),_2=Hc(1);function j2(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),a=o&&aa(o,r,e);return a?(n&&n(t.tr.wrap(o,a).scrollIntoView()),!0):!1}}function Vc(r,e=null){return function(t,n){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=t.selection.ranges[s];t.doc.nodesBetween(o,a,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(r,e)))if(l.type==r)i=!0;else{let c=t.doc.resolve(u),d=c.index();i=c.parent.canReplaceWith(d,d+1,r)}})}if(!i)return!1;if(n){let s=t.tr;for(let o=0;o<t.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=t.selection.ranges[o];s.setBlockType(a,l,r,e)}n(s.scrollIntoView())}return!0}}function ya(...r){return function(e,t,n){for(let i=0;i<r.length;i++)if(r[i](e,t,n))return!0;return!1}}ya(pa,Nc,Ic),ya(pa,Pc,zc),ya(Lc,Bc,Fc,F2),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function q2(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s);if(!o)return!1;let a=n?t.tr:null;return W2(a,o,r,e)?(n&&n(a.scrollIntoView()),!0):!1}}function W2(r,e,t,n=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);s=new fs(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new fs(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=aa(s,t,n,e);return a?(r&&U2(r,e,a,i,t),!0):!1}function U2(r,e,t,n,i){let s=F.empty;for(let c=t.length-1;c>=0;c--)s=F.from(t[c].type.create(t[c].attrs,s));r.step(new Ye(e.start-(n?2:0),e.end,e.start,e.end,new U(s,0,0),t.length,!0));let o=0;for(let c=0;c<t.length;c++)t[c].type==i&&(o=c+1);let a=t.length-o,l=e.start+t.length-(n?2:0),u=e.parent;for(let c=e.startIndex,d=e.endIndex,h=!0;c<d;c++,h=!1)!h&&ar(r.doc,l,a)&&(r.split(l,a),l+=2*a),l+=u.child(c).nodeSize;return r}function G2(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,o=>o.childCount>0&&o.firstChild.type==r);return s?t?n.node(s.depth-1).type==r?K2(e,t,r,s):J2(e,t,s):!0:!1}}function K2(r,e,t,n){let i=r.tr,s=n.end,o=n.$to.end(n.depth);s<o&&(i.step(new Ye(s-1,o,s,o,new U(F.from(t.create(null,n.parent.copy())),1,0),1,!0)),n=new fs(i.doc.resolve(n.$from.pos),i.doc.resolve(o),n.depth));const a=Mn(n);if(a==null)return!1;i.lift(n,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return Ir(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function J2(r,e,t){let n=r.tr,i=t.parent;for(let f=t.end,m=t.endIndex-1,v=t.startIndex;m>v;m--)f-=i.child(m).nodeSize,n.delete(f-1,f+1);let s=n.doc.resolve(t.start),o=s.nodeAfter;if(n.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let a=t.startIndex==0,l=t.endIndex==i.childCount,u=s.node(-1),c=s.index(-1);if(!u.canReplace(c+(a?0:1),c+1,o.content.append(l?F.empty:F.from(i))))return!1;let d=s.pos,h=d+o.nodeSize;return n.step(new Ye(d-(a?1:0),h+(l?1:0),d+1,h-1,new U((a?F.empty:F.from(i.copy(F.empty))).append(l?F.empty:F.from(i.copy(F.empty))),a?0:1,l?0:1),a?0:1)),e(n.scrollIntoView()),!0}function Y2(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==r);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=r)return!1;if(t){let u=l.lastChild&&l.lastChild.type==a.type,c=F.from(u?r.create():null),d=new U(F.from(r.create(null,F.from(a.type.create(null,c)))),u?3:1,0),h=s.start,f=s.end;t(e.tr.step(new Ye(h-(u?3:1),f,h,f,d,1,!0)).scrollIntoView())}return!0}}const et=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},Dn=function(r){let e=r.assignedSlot||r.parentNode;return e&&e.nodeType==11?e.host:e};let ba=null;const lr=function(r,e,t){let n=ba||(ba=document.createRange());return n.setEnd(r,t??r.nodeValue.length),n.setStart(r,e||0),n},X2=function(){ba=null},cn=function(r,e,t,n){return t&&(_c(r,e,t,n,-1)||_c(r,e,t,n,1))},Z2=/^(img|br|input|textarea|hr)$/i;function _c(r,e,t,n,i){for(var s;;){if(r==t&&e==n)return!0;if(e==(i<0?0:Nt(r))){let o=r.parentNode;if(!o||o.nodeType!=1||yi(r)||Z2.test(r.nodeName)||r.contentEditable=="false")return!1;e=et(r)+(i<0?0:1),r=o}else if(r.nodeType==1){let o=r.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else r=o,e=i<0?Nt(r):0}else return!1}}function Nt(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Q2(r,e){for(;;){if(r.nodeType==3&&e)return r;if(r.nodeType==1&&e>0){if(r.contentEditable=="false")return null;r=r.childNodes[e-1],e=Nt(r)}else if(r.parentNode&&!yi(r))e=et(r),r=r.parentNode;else return null}}function ev(r,e){for(;;){if(r.nodeType==3&&e<r.nodeValue.length)return r;if(r.nodeType==1&&e<r.childNodes.length){if(r.contentEditable=="false")return null;r=r.childNodes[e],e=0}else if(r.parentNode&&!yi(r))e=et(r)+1,r=r.parentNode;else return null}}function tv(r,e,t){for(let n=e==0,i=e==Nt(r);n||i;){if(r==t)return!0;let s=et(r);if(r=r.parentNode,!r)return!1;n=n&&s==0,i=i&&s==Nt(r)}}function yi(r){let e;for(let t=r;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==r||e.contentDOM==r)}const xs=function(r){return r.focusNode&&cn(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function dn(r,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=r,t.key=t.code=e,t}function rv(r){let e=r.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function nv(r,e,t){if(r.caretPositionFromPoint)try{let n=r.caretPositionFromPoint(e,t);if(n)return{node:n.offsetNode,offset:Math.min(Nt(n.offsetNode),n.offset)}}catch{}if(r.caretRangeFromPoint){let n=r.caretRangeFromPoint(e,t);if(n)return{node:n.startContainer,offset:Math.min(Nt(n.startContainer),n.startOffset)}}}const Ut=typeof navigator<"u"?navigator:null,jc=typeof document<"u"?document:null,Rr=Ut&&Ut.userAgent||"",wa=/Edge\/(\d+)/.exec(Rr),qc=/MSIE \d/.exec(Rr),xa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rr),mt=!!(qc||xa||wa),Pr=qc?document.documentMode:xa?+xa[1]:wa?+wa[1]:0,Dt=!mt&&/gecko\/(\d+)/i.test(Rr);Dt&&+(/Firefox\/(\d+)/.exec(Rr)||[0,0])[1];const Sa=!mt&&/Chrome\/(\d+)/.exec(Rr),Xe=!!Sa,Wc=Sa?+Sa[1]:0,it=!mt&&!!Ut&&/Apple Computer/.test(Ut.vendor),In=it&&(/Mobile\/\w+/.test(Rr)||!!Ut&&Ut.maxTouchPoints>2),It=In||(Ut?/Mac/.test(Ut.platform):!1),Uc=Ut?/Win/.test(Ut.platform):!1,ur=/Android \d/.test(Rr),bi=!!jc&&"webkitFontSmoothing"in jc.documentElement.style,iv=bi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function sv(r){let e=r.defaultView&&r.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function cr(r,e){return typeof r=="number"?r:r[e]}function ov(r){let e=r.getBoundingClientRect(),t=e.width/r.offsetWidth||1,n=e.height/r.offsetHeight||1;return{left:e.left,right:e.left+r.clientWidth*t,top:e.top,bottom:e.top+r.clientHeight*n}}function Gc(r,e,t){let n=r.someProp("scrollThreshold")||0,i=r.someProp("scrollMargin")||5,s=r.dom.ownerDocument;for(let o=t||r.dom;o;){if(o.nodeType!=1){o=Dn(o);continue}let a=o,l=a==s.body,u=l?sv(s):ov(a),c=0,d=0;if(e.top<u.top+cr(n,"top")?d=-(u.top-e.top+cr(i,"top")):e.bottom>u.bottom-cr(n,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+cr(i,"top")-u.top:e.bottom-u.bottom+cr(i,"bottom")),e.left<u.left+cr(n,"left")?c=-(u.left-e.left+cr(i,"left")):e.right>u.right-cr(n,"right")&&(c=e.right-u.right+cr(i,"right")),c||d)if(l)s.defaultView.scrollBy(c,d);else{let f=a.scrollLeft,m=a.scrollTop;d&&(a.scrollTop+=d),c&&(a.scrollLeft+=c);let v=a.scrollLeft-f,y=a.scrollTop-m;e={left:e.left-v,top:e.top-y,right:e.right-v,bottom:e.bottom-y}}let h=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(h))break;o=h=="absolute"?o.offsetParent:Dn(o)}}function av(r){let e=r.dom.getBoundingClientRect(),t=Math.max(0,e.top),n,i;for(let s=(e.left+e.right)/2,o=t+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=r.root.elementFromPoint(s,o);if(!a||a==r.dom||!r.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=t-20){n=a,i=l.top;break}}return{refDOM:n,refTop:i,stack:Kc(r.dom)}}function Kc(r){let e=[],t=r.ownerDocument;for(let n=r;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),r!=t);n=Dn(n));return e}function lv({refDOM:r,refTop:e,stack:t}){let n=r?r.getBoundingClientRect().top:0;Jc(t,n==0?0:n-e)}function Jc(r,e){for(let t=0;t<r.length;t++){let{dom:n,top:i,left:s}=r[t];n.scrollTop!=i+e&&(n.scrollTop=i+e),n.scrollLeft!=s&&(n.scrollLeft=s)}}let Rn=null;function uv(r){if(r.setActive)return r.setActive();if(Rn)return r.focus(Rn);let e=Kc(r);r.focus(Rn==null?{get preventScroll(){return Rn={preventScroll:!0},!0}}:void 0),Rn||(Rn=!1,Jc(e,0))}function Yc(r,e){let t,n=2e8,i,s=0,o=e.top,a=e.top,l,u;for(let c=r.firstChild,d=0;c;c=c.nextSibling,d++){let h;if(c.nodeType==1)h=c.getClientRects();else if(c.nodeType==3)h=lr(c).getClientRects();else continue;for(let f=0;f<h.length;f++){let m=h[f];if(m.top<=o&&m.bottom>=a){o=Math.max(m.bottom,o),a=Math.min(m.top,a);let v=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(v<n){t=c,n=v,i=v&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,c.nodeType==1&&v&&(s=d+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=c,u={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(s=d+1)}}return!t&&l&&(t=l,i=u,n=0),t&&t.nodeType==3?cv(t,i):!t||n&&t.nodeType==1?{node:r,offset:s}:Yc(t,i)}function cv(r,e){let t=r.nodeValue.length,n=document.createRange(),i;for(let s=0;s<t;s++){n.setEnd(r,s+1),n.setStart(r,s);let o=zr(n,1);if(o.top!=o.bottom&&ka(e,o)){i={node:r,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return n.detach(),i||{node:r,offset:0}}function ka(r,e){return r.left>=e.left-1&&r.left<=e.right+1&&r.top>=e.top-1&&r.top<=e.bottom+1}function dv(r,e){let t=r.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<r.getBoundingClientRect().left?t:r}function fv(r,e,t){let{node:n,offset:i}=Yc(e,t),s=-1;if(n.nodeType==1&&!n.firstChild){let o=n.getBoundingClientRect();s=o.left!=o.right&&t.left>(o.left+o.right)/2?1:-1}return r.docView.posFromDOM(n,i,s)}function hv(r,e,t,n){let i=-1;for(let s=e,o=!1;s!=r.dom;){let a=r.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>n.left||l.top>n.top?i=a.posBefore:(!o&&l.right<n.left||l.bottom<n.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:r.docView.posFromDOM(e,t,-1)}function Xc(r,e,t){let n=r.childNodes.length;if(n&&t.top<t.bottom)for(let i=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-t.top)/(t.bottom-t.top))-2)),s=i;;){let o=r.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(ka(e,u))return Xc(o,e,u)}}if((s=(s+1)%n)==i)break}return r}function pv(r,e){let t=r.dom.ownerDocument,n,i=0,s=nv(t,e.left,e.top);s&&({node:n,offset:i}=s);let o=(r.root.elementFromPoint?r.root:t).elementFromPoint(e.left,e.top),a;if(!o||!r.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=r.dom.getBoundingClientRect();if(!ka(e,u)||(o=Xc(r.dom,e,u),!o))return null}if(it)for(let u=o;n&&u;u=Dn(u))u.draggable&&(n=void 0);if(o=dv(o,e),n){if(Dt&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let c=n.childNodes[i],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let u;bi&&i&&n.nodeType==1&&(u=n.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,n==r.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=r.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(a=hv(r,n,i,e))}a==null&&(a=fv(r,o,e));let l=r.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Zc(r){return r.top<r.bottom||r.left<r.right}function zr(r,e){let t=r.getClientRects();if(t.length){let n=t[e<0?0:t.length-1];if(Zc(n))return n}return Array.prototype.find.call(t,Zc)||r.getBoundingClientRect()}const mv=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Qc(r,e,t){let{node:n,offset:i,atom:s}=r.docView.domFromPos(e,t<0?-1:1),o=bi||Dt;if(n.nodeType==3)if(o&&(mv.test(n.nodeValue)||(t<0?!i:i==n.nodeValue.length))){let l=zr(lr(n,i,i),t);if(Dt&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let u=zr(lr(n,i-1,i-1),-1);if(u.top==l.top){let c=zr(lr(n,i,i+1),-1);if(c.top!=l.top)return wi(c,c.left<u.left)}}return l}else{let l=i,u=i,c=t<0?1:-1;return t<0&&!i?(u++,c=-1):t>=0&&i==n.nodeValue.length?(l--,c=1):t<0?l--:u++,wi(zr(lr(n,l,u),c),c<0)}if(!r.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==Nt(n))){let l=n.childNodes[i-1];if(l.nodeType==1)return Ta(l.getBoundingClientRect(),!1)}if(s==null&&i<Nt(n)){let l=n.childNodes[i];if(l.nodeType==1)return Ta(l.getBoundingClientRect(),!0)}return Ta(n.getBoundingClientRect(),t>=0)}if(s==null&&i&&(t<0||i==Nt(n))){let l=n.childNodes[i-1],u=l.nodeType==3?lr(l,Nt(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return wi(zr(u,1),!1)}if(s==null&&i<Nt(n)){let l=n.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?lr(l,0,o?0:1):l.nodeType==1?l:null:null;if(u)return wi(zr(u,-1),!0)}return wi(zr(n.nodeType==3?lr(n):n,-t),t>=0)}function wi(r,e){if(r.width==0)return r;let t=e?r.left:r.right;return{top:r.top,bottom:r.bottom,left:t,right:t}}function Ta(r,e){if(r.height==0)return r;let t=e?r.top:r.bottom;return{top:t,bottom:t,left:r.left,right:r.right}}function ed(r,e,t){let n=r.state,i=r.root.activeElement;n!=e&&r.updateState(e),i!=r.dom&&r.focus();try{return t()}finally{n!=e&&r.updateState(n),i!=r.dom&&i&&i.focus()}}function gv(r,e,t){let n=e.selection,i=t=="up"?n.$from:n.$to;return ed(r,e,()=>{let{node:s}=r.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let a=r.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=Qc(r,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=lr(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let c=l[u];if(c.bottom>c.top+1&&(t=="up"?o.top-c.top>(c.bottom-o.top)*2:c.bottom-o.bottom>(o.bottom-c.top)*2))return!1}}return!0})}const vv=/[\u0590-\u08ac]/;function yv(r,e,t){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,s=!i,o=i==n.parent.content.size,a=r.domSelection();return a?!vv.test(n.parent.textContent)||!a.modify?t=="left"||t=="backward"?s:o:ed(r,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:d}=r.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",t,"character");let f=n.depth?r.docView.domAfterPos(n.before()):r.dom,{focusNode:m,focusOffset:v}=r.domSelectionRange(),y=m&&!f.contains(m.nodeType==1?m:m.parentNode)||l==m&&u==v;try{a.collapse(c,d),l&&(l!=c||u!=d)&&a.extend&&a.extend(l,u)}catch{}return h!=null&&(a.caretBidiLevel=h),y}):n.pos==n.start()||n.pos==n.end()}let td=null,rd=null,nd=!1;function bv(r,e,t){return td==e&&rd==t?nd:(td=e,rd=t,nd=t=="up"||t=="down"?gv(r,e,t):yv(r,e,t))}const Rt=0,id=1,fn=2,Gt=3;class xi{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=Rt,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let i=this.children[t];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let s,o;if(e==this.contentDOM)s=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>et(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!t||s.node))if(n&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let i=this.children[t],s=n+i.size;if(n==e&&s!=n){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let a=i.children[o];if(a.size){i=a;break}}return i}if(e<s)return i.descAt(e-n-i.border);n=s}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let s=0;n<this.children.length;n++){let o=this.children[n],a=s+o.size;if(a>e||o instanceof ad){i=e-s;break}s=a}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(let s;n&&!(s=this.children[n-1]).size&&s instanceof sd&&s.side>=0;n--);if(t<=0){let s,o=!0;for(;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,o=!1);return s&&t&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?et(s.dom)+1:0}}else{let s,o=!0;for(;s=n<this.children.length?this.children[n]:null,!(!s||s.dom.parentNode==this.contentDOM);n++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,t):{node:this.contentDOM,offset:s?et(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=n,a=0;;a++){let l=this.children[a],u=o+l.size;if(i==-1&&e<=u){let c=o+l.border;if(e>=c&&t<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,c);e=o;for(let d=a;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=et(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(u>t||a==this.children.length-1)){t=u;for(let c=a+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=et(d.dom);break}t+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,i=!1){let s=Math.min(e,t),o=Math.max(e,t);for(let f=0,m=0;f<this.children.length;f++){let v=this.children[f],y=m+v.size;if(s>m&&o<y)return v.setSelection(e-m-v.border,t-m-v.border,n,i);m=y}let a=this.domFromPos(e,e?-1:1),l=t==e?a:this.domFromPos(t,t?-1:1),u=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((Dt||it)&&e==t){let{node:f,offset:m}=a;if(f.nodeType==3){if(d=!!(m&&f.nodeValue[m-1]==`
|
|
502
|
-
`),d&&m==f.nodeValue.length)for(let v=f,y;v;v=v.parentNode){if(y=v.nextSibling){y.nodeName=="BR"&&(a=l={node:y.parentNode,offset:et(y)+1});break}let w=v.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{let v=f.childNodes[m-1];d=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(Dt&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let f=c.focusNode.childNodes[c.focusOffset];f&&f.contentEditable=="false"&&(i=!0)}if(!(i||d&&it)&&cn(a.node,a.offset,c.anchorNode,c.anchorOffset)&&cn(l.node,l.offset,c.focusNode,c.focusOffset))return;let h=!1;if((u.extend||e==t)&&!(d&&Dt)){u.collapse(a.node,a.offset);try{e!=t&&u.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>t){let m=a;a=l,l=m}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i<this.children.length;i++){let s=this.children[i],o=n+s.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let a=n+s.border,l=o-s.border;if(e>=a&&t<=l){this.dirty=e==n||t==o?fn:id,e==a&&t==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Gt:s.markDirty(e-a,t-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?fn:Gt}n=o}this.dirty=fn}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?fn:id;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class sd extends xi{constructor(e,t,n,i){let s,o=t.type.toDOM;if(typeof o=="function"&&(o=o(n,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==Rt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class wv extends xi{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class hn extends xi{constructor(e,t,n,i,s){super(e,[],n,i),this.mark=t,this.spec=s}static create(e,t,n,i){let s=i.nodeViews[t.type.name],o=s&&s(t,i,n);return(!o||!o.dom)&&(o=ln.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new hn(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Gt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Gt&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Rt){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=Rt}}slice(e,t,n){let i=hn.create(this.parent,this.mark,!0,n),s=this.children,o=this.size;t<o&&(s=Ca(s,t,o,n)),e>0&&(s=Ca(s,0,e,n));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Lr extends xi{constructor(e,t,n,i,s,o,a,l,u){super(e,[],s,o),this.node=t,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=a}static create(e,t,n,i,s,o){let a=s.nodeViews[t.type.name],l,u=a&&a(t,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},n,i),c=u&&u.dom,d=u&&u.contentDOM;if(t.isText){if(!c)c=document.createTextNode(t.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:d}=ln.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let h=c;return c=cd(c,n,t),u?l=new xv(e,t,n,i,c,d||null,h,u,s,o+1):t.isText?new Ss(e,t,n,i,c,h,s):new Lr(e,t,n,i,c,d||null,h,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>F.empty)}return e}matchesNode(e,t,n){return this.dirty==Rt&&e.eq(this.node)&&ks(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,i=t,s=e.composing?this.localCompositionInfo(e,t):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new kv(this,o&&o.node,e);Cv(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?l.syncToMarks(u.spec.marks,n,e):u.type.side>=0&&!d&&l.syncToMarks(c==this.node.childCount?Ae.none:this.node.child(c).marks,n,e),l.placeWidget(u,e,i)},(u,c,d,h)=>{l.syncToMarks(u.marks,n,e);let f;l.findNodeMatch(u,c,d,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(f=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(u,c,d,f,e)||l.updateNextNode(u,c,d,e,h,i)||l.addNode(u,c,d,e,i),i+=u.nodeSize}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==fn)&&(o&&this.protectLocalComposition(e,o),ld(this.contentDOM,this.children,e),In&&Ev(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof de)||n<t||i>t+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=Av(this.node.content,o,n-t,i-t);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new wv(this,s,t,i);e.input.compositionNodes.push(o),this.children=Ca(this.children,n,n+i.length,e,o)}update(e,t,n,i){return this.dirty==Gt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Rt}updateOuterDeco(e){if(ks(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=ud(this.dom,this.nodeDOM,Ma(this.outerDeco,this.node,t),Ma(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function od(r,e,t,n,i){cd(n,e,r);let s=new Lr(void 0,r,e,t,n,n,n,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Ss extends Lr{constructor(e,t,n,i,s,o,a){super(e,t,n,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return this.dirty==Gt||this.dirty!=Rt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Rt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Rt,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,n){let i=this.node.cut(e,t),s=document.createTextNode(i.text);return new Ss(this.parent,i,this.outerDeco,this.innerDeco,s,s,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Gt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class ad extends xi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Rt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class xv extends Lr{constructor(e,t,n,i,s,o,a,l,u,c){super(e,t,n,i,s,o,a,u,c),this.spec=l}update(e,t,n,i){if(this.dirty==Gt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,t,n);return s&&this.updateInner(e,t,n,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function ld(r,e,t){let n=r.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==r){for(;a!=n;)n=dd(n),i=!0;n=n.nextSibling}else i=!0,r.insertBefore(a,n);if(o instanceof hn){let l=n?n.previousSibling:r.lastChild;ld(o.contentDOM,o.children,t),n=l?l.nextSibling:r.firstChild}}for(;n;)n=dd(n),i=!0;i&&t.trackWrites==r&&(t.trackWrites=null)}const Si=function(r){r&&(this.nodeName=r)};Si.prototype=Object.create(null);const pn=[new Si];function Ma(r,e,t){if(r.length==0)return pn;let n=t?pn[0]:new Si,i=[n];for(let s=0;s<r.length;s++){let o=r[s].type.attrs;if(o){o.nodeName&&i.push(n=new Si(o.nodeName));for(let a in o){let l=o[a];l!=null&&(t&&i.length==1&&i.push(n=new Si(e.isInline?"span":"div")),a=="class"?n.class=(n.class?n.class+" ":"")+l:a=="style"?n.style=(n.style?n.style+";":"")+l:a!="nodeName"&&(n[a]=l))}}}return i}function ud(r,e,t,n){if(t==pn&&n==pn)return e;let i=e;for(let s=0;s<n.length;s++){let o=n[s],a=t[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=r&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=pn[0]),i=l}Sv(i,a||pn[0],o)}return i}function Sv(r,e,t){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in t)&&r.removeAttribute(n);for(let n in t)n!="class"&&n!="style"&&n!="nodeName"&&t[n]!=e[n]&&r.setAttribute(n,t[n]);if(e.class!=t.class){let n=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let s=0;s<n.length;s++)i.indexOf(n[s])==-1&&r.classList.remove(n[s]);for(let s=0;s<i.length;s++)n.indexOf(i[s])==-1&&r.classList.add(i[s]);r.classList.length==0&&r.removeAttribute("class")}if(e.style!=t.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(e.style);)r.style.removeProperty(i[1])}t.style&&(r.style.cssText+=t.style)}}function cd(r,e,t){return ud(r,r,pn,Ma(e,t,r.nodeType!=1))}function ks(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++)if(!r[t].type.eq(e[t].type))return!1;return!0}function dd(r){let e=r.nextSibling;return r.parentNode.removeChild(r),e}class kv{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Tv(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let i=0,s=this.stack.length>>1,o=Math.min(s,e.length);for(;i<o&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=Rt,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[s])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=hn.create(this.top,e[s],t,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,n,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,t,n)&&!this.preMatch.matched.has(u)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,n,i,s){let o=this.top.children[i];return o.dirty==Gt&&o.dom==o.contentDOM&&(o.dirty=fn),o.update(e,t,n,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i}return-1}e=t}}updateNextNode(e,t,n,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Lr){let u=this.preMatch.matched.get(l);if(u!=null&&u!=s)return!1;let c=l.dom,d,h=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Gt&&ks(t,l.outerDeco));if(!h&&l.update(e,t,n,i))return this.destroyBetween(this.index,a),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!h&&(d=this.recreateWrapper(l,e,t,n,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=fn,d.updateChildren(i,o+1),d.dirty=Rt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,i,s,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ks(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=Lr.create(this.top,t,n,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,t,n,i,s){let o=Lr.create(this.top,e,t,n,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new sd(this.top,e,t,n);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof hn;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Ss)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((it||Xe)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let i=new ad(this.top,[],n,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Tv(r,e){let t=e,n=t.children.length,i=r.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(n){let u=t.children[n-1];if(u instanceof hn)t=u,n=u.children.length;else{a=u,n--;break}}else{if(t==e)break e;n=t.parent.children.indexOf(t),t=t.parent}let l=a.node;if(l){if(l!=r.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function Mv(r,e){return r.type.side-e.type.side}function Cv(r,e,t,n){let i=e.locals(r),s=0;if(i.length==0){for(let u=0;u<r.childCount;u++){let c=r.child(u);n(c,i,e.forChild(s,c),u),s+=c.nodeSize}return}let o=0,a=[],l=null;for(let u=0;;){let c,d;for(;o<i.length&&i[o].to==s;){let y=i[o++];y.widget&&(c?(d||(d=[c])).push(y):c=y)}if(c)if(d){d.sort(Mv);for(let y=0;y<d.length;y++)t(d[y],u,!!l)}else t(c,u,!!l);let h,f;if(l)f=-1,h=l,l=null;else if(u<r.childCount)f=u,h=r.child(u++);else break;for(let y=0;y<a.length;y++)a[y].to<=s&&a.splice(y--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let m=s+h.nodeSize;if(h.isText){let y=m;o<i.length&&i[o].from<y&&(y=i[o].from);for(let w=0;w<a.length;w++)a[w].to<y&&(y=a[w].to);y<m&&(l=h.cut(y-s),h=h.cut(0,y-s),m=y,f=-1)}else for(;o<i.length&&i[o].to<m;)o++;let v=h.isInline&&!h.isLeaf?a.filter(y=>!y.inline):a.slice();n(h,v,e.forChild(s,h),f),s=m}}function Ev(r){if(r.nodeName=="UL"||r.nodeName=="OL"){let e=r.style.cssText;r.style.cssText=e+"; list-style: square !important",window.getComputedStyle(r).listStyle,r.style.cssText=e}}function Av(r,e,t,n){for(let i=0,s=0;i<r.childCount&&s<=n;){let o=r.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<r.childCount;){let u=r.child(i++);if(s+=u.nodeSize,!u.isText)break;l+=u.text}if(s>=t){if(s>=n&&l.slice(n-e.length-a,n-a)==e)return n-e.length;let u=a<n?l.lastIndexOf(e,n-a-1):-1;if(u>=0&&u+e.length+a>=t)return a+u;if(t==n&&l.length>=n+e.length-a&&l.slice(n-a,n-a+e.length)==e)return n}}return-1}function Ca(r,e,t,n,i){let s=[];for(let o=0,a=0;o<r.length;o++){let l=r[o],u=a,c=a+=l.size;u>=t||c<=e?s.push(l):(u<e&&s.push(l.slice(0,e-u,n)),i&&(s.push(i),i=void 0),c>t&&s.push(l.slice(t-u,l.size,n)))}return s}function Ea(r,e=null){let t=r.domSelectionRange(),n=r.state.doc;if(!t.focusNode)return null;let i=r.docView.nearestDesc(t.focusNode),s=i&&i.size==0,o=r.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let a=n.resolve(o),l,u;if(xs(t)){for(l=o;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&ie.isSelectable(d)&&i.parent&&!(d.isInline&&tv(t.focusNode,t.focusOffset,i.dom))){let h=i.posBefore;u=new ie(o==h?a:n.resolve(h))}}else{if(t instanceof r.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=o,h=o;for(let f=0;f<t.rangeCount;f++){let m=t.getRangeAt(f);d=Math.min(d,r.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,r.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(d<0)return null;[l,o]=h==r.state.selection.anchor?[h,d]:[d,h],a=n.resolve(o)}else l=r.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(l<0)return null}let c=n.resolve(l);if(!u){let d=e=="pointer"||r.state.selection.head<a.pos&&!s?1:-1;u=Oa(r,c,a,d)}return u}function fd(r){return r.editable?r.hasFocus():bd(r)&&document.activeElement&&document.activeElement.contains(r.dom)}function dr(r,e=!1){let t=r.state.selection;if(gd(r,t),!!fd(r)){if(!e&&r.input.mouseDown&&r.input.mouseDown.allowDefault&&Xe){let n=r.domSelectionRange(),i=r.domObserver.currentSelection;if(n.anchorNode&&i.anchorNode&&cn(n.anchorNode,n.anchorOffset,i.anchorNode,i.anchorOffset)){r.input.mouseDown.delayedSelectionSync=!0,r.domObserver.setCurSelection();return}}if(r.domObserver.disconnectSelection(),r.cursorWrapper)Nv(r);else{let{anchor:n,head:i}=t,s,o;hd&&!(t instanceof de)&&(t.$from.parent.inlineContent||(s=pd(r,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(o=pd(r,t.to))),r.docView.setSelection(n,i,r,e),hd&&(s&&md(s),o&&md(o)),t.visible?r.dom.classList.remove("ProseMirror-hideselection"):(r.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Ov(r))}r.domObserver.setCurSelection(),r.domObserver.connectSelection()}}const hd=it||Xe&&Wc<63;function pd(r,e){let{node:t,offset:n}=r.docView.domFromPos(e,0),i=n<t.childNodes.length?t.childNodes[n]:null,s=n?t.childNodes[n-1]:null;if(it&&i&&i.contentEditable=="false")return Aa(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Aa(i);if(s)return Aa(s)}}function Aa(r){return r.contentEditable="true",it&&r.draggable&&(r.draggable=!1,r.wasDraggable=!0),r}function md(r){r.contentEditable="false",r.wasDraggable&&(r.draggable=!0,r.wasDraggable=null)}function Ov(r){let e=r.dom.ownerDocument;e.removeEventListener("selectionchange",r.input.hideSelectionGuard);let t=r.domSelectionRange(),n=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(t.anchorNode!=n||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!fd(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})}function Nv(r){let e=r.domSelection();if(!e)return;let t=r.cursorWrapper.dom,n=t.nodeName=="IMG";n?e.collapse(t.parentNode,et(t)+1):e.collapse(t,0),!n&&!r.state.selection.visible&&mt&&Pr<=11&&(t.disabled=!0,t.disabled=!1)}function gd(r,e){if(e instanceof ie){let t=r.docView.descAt(e.from);t!=r.lastSelectedViewDesc&&(vd(r),t&&t.selectNode(),r.lastSelectedViewDesc=t)}else vd(r)}function vd(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function Oa(r,e,t,n){return r.someProp("createSelectionBetween",i=>i(r,e,t))||de.between(e,t,n)}function yd(r){return r.editable&&!r.hasFocus()?!1:bd(r)}function bd(r){let e=r.domSelectionRange();if(!e.anchorNode)return!1;try{return r.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(r.editable||r.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Dv(r){let e=r.docView.domFromPos(r.state.selection.anchor,0),t=r.domSelectionRange();return cn(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Na(r,e){let{$anchor:t,$head:n}=r.selection,i=e>0?t.max(n):t.min(n),s=i.parent.inlineContent?i.depth?r.doc.resolve(e>0?i.after():i.before()):null:i;return s&&le.findFrom(s,e)}function Br(r,e){return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()),!0}function wd(r,e,t){let n=r.state.selection;if(n instanceof de)if(t.indexOf("s")>-1){let{$head:i}=n,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=r.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Br(r,new de(n.$anchor,o))}else if(n.empty){if(r.endOfTextblock(e>0?"forward":"backward")){let i=Na(r.state,e);return i&&i instanceof ie?Br(r,i):!1}else if(!(It&&t.indexOf("m")>-1)){let i=n.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=r.docView.descAt(a))&&!o.contentDOM?ie.isSelectable(s)?Br(r,new ie(e<0?r.state.doc.resolve(i.pos-s.nodeSize):i)):bi?Br(r,new de(r.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(n instanceof ie&&n.node.isInline)return Br(r,new de(e>0?n.$to:n.$from));{let i=Na(r.state,e);return i?Br(r,i):!1}}}function Ts(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function ki(r,e){let t=r.pmViewDesc;return t&&t.size==0&&(e<0||r.nextSibling||r.nodeName!="BR")}function Pn(r,e){return e<0?Iv(r):Rv(r)}function Iv(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i,s,o=!1;for(Dt&&t.nodeType==1&&n<Ts(t)&&ki(t.childNodes[n],-1)&&(o=!0);;)if(n>0){if(t.nodeType!=1)break;{let a=t.childNodes[n-1];if(ki(a,-1))i=t,s=--n;else if(a.nodeType==3)t=a,n=t.nodeValue.length;else break}}else{if(xd(t))break;{let a=t.previousSibling;for(;a&&ki(a,-1);)i=t.parentNode,s=et(a),a=a.previousSibling;if(a)t=a,n=Ts(t);else{if(t=t.parentNode,t==r.dom)break;n=0}}}o?Da(r,t,n):i&&Da(r,i,s)}function Rv(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i=Ts(t),s,o;for(;;)if(n<i){if(t.nodeType!=1)break;let a=t.childNodes[n];if(ki(a,1))s=t,o=++n;else break}else{if(xd(t))break;{let a=t.nextSibling;for(;a&&ki(a,1);)s=a.parentNode,o=et(a)+1,a=a.nextSibling;if(a)t=a,n=0,i=Ts(t);else{if(t=t.parentNode,t==r.dom)break;n=i=0}}}s&&Da(r,s,o)}function xd(r){let e=r.pmViewDesc;return e&&e.node&&e.node.isBlock}function Pv(r,e){for(;r&&e==r.childNodes.length&&!yi(r);)e=et(r)+1,r=r.parentNode;for(;r&&e<r.childNodes.length;){let t=r.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=0}}function zv(r,e){for(;r&&!e&&!yi(r);)e=et(r),r=r.parentNode;for(;r&&e;){let t=r.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=r.childNodes.length}}function Da(r,e,t){if(e.nodeType!=3){let s,o;(o=Pv(e,t))?(e=o,t=0):(s=zv(e,t))&&(e=s,t=s.nodeValue.length)}let n=r.domSelection();if(!n)return;if(xs(n)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),n.removeAllRanges(),n.addRange(s)}else n.extend&&n.extend(e,t);r.domObserver.setCurSelection();let{state:i}=r;setTimeout(()=>{r.state==i&&dr(r)},50)}function Sd(r,e){let t=r.state.doc.resolve(e);if(!(Xe||Uc)&&t.parent.inlineContent){let i=r.coordsAtPos(e);if(e>t.start()){let s=r.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<t.end()){let s=r.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(r.dom).direction=="rtl"?"rtl":"ltr"}function kd(r,e,t){let n=r.state.selection;if(n instanceof de&&!n.empty||t.indexOf("s")>-1||It&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||r.endOfTextblock(e<0?"up":"down")){let o=Na(r.state,e);if(o&&o instanceof ie)return Br(r,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=n instanceof kt?le.near(o,e):le.findFrom(o,e);return a?Br(r,a):!1}return!1}function Td(r,e){if(!(r.state.selection instanceof de))return!0;let{$head:t,$anchor:n,empty:i}=r.state.selection;if(!t.sameParent(n))return!0;if(!i)return!1;if(r.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let o=r.state.tr;return e<0?o.delete(t.pos-s.nodeSize,t.pos):o.delete(t.pos,t.pos+s.nodeSize),r.dispatch(o),!0}return!1}function Md(r,e,t){r.domObserver.stop(),e.contentEditable=t,r.domObserver.start()}function Lv(r){if(!it||r.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;Md(r,n,"true"),setTimeout(()=>Md(r,n,"false"),20)}return!1}function Bv(r){let e="";return r.ctrlKey&&(e+="c"),r.metaKey&&(e+="m"),r.altKey&&(e+="a"),r.shiftKey&&(e+="s"),e}function Fv(r,e){let t=e.keyCode,n=Bv(e);if(t==8||It&&t==72&&n=="c")return Td(r,-1)||Pn(r,-1);if(t==46&&!e.shiftKey||It&&t==68&&n=="c")return Td(r,1)||Pn(r,1);if(t==13||t==27)return!0;if(t==37||It&&t==66&&n=="c"){let i=t==37?Sd(r,r.state.selection.from)=="ltr"?-1:1:-1;return wd(r,i,n)||Pn(r,i)}else if(t==39||It&&t==70&&n=="c"){let i=t==39?Sd(r,r.state.selection.from)=="ltr"?1:-1:1;return wd(r,i,n)||Pn(r,i)}else{if(t==38||It&&t==80&&n=="c")return kd(r,-1,n)||Pn(r,-1);if(t==40||It&&t==78&&n=="c")return Lv(r)||kd(r,1,n)||Pn(r,1);if(n==(It?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Ia(r,e){r.someProp("transformCopied",f=>{e=f(e,r)});let t=[],{content:n,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,s--;let f=n.firstChild;t.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),n=f.content}let o=r.someProp("clipboardSerializer")||ln.fromSchema(r.state.schema),a=Rd(),l=a.createElement("div");l.appendChild(o.serializeFragment(n,{document:a}));let u=l.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=Dd[u.nodeName.toLowerCase()]);){for(let f=c.length-1;f>=0;f--){let m=a.createElement(c[f]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),d++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(t)}`);let h=r.someProp("clipboardTextSerializer",f=>f(e,r))||e.content.textBetween(0,e.content.size,`
|
|
503
|
-
|
|
504
|
-
`);return{dom:l,text:h,slice:e}}function
|
|
505
|
-
`))),0,0),r.someProp("transformPasted",h=>{a=h(a,r,!0)}),a;let d=r.someProp("clipboardTextParser",h=>h(e,i,n,r));if(d)a=d;else{let h=i.marks(),{schema:f}=r.state,m=ln.fromSchema(f);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let y=o.appendChild(document.createElement("p"));v&&y.appendChild(m.serializeNode(f.text(v,h)))})}}else r.someProp("transformPastedHTML",d=>{t=d(t,r)}),o=_v(t),bi&&jv(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(a||(a=(r.someProp("clipboardParser")||r.someProp("domParser")||Or.fromSchema(r.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!$v.test(h.parentNode.nodeName)?{ignore:!0}:null}})),c)a=qv(Nd(a,+c[1],+c[2]),c[4]);else if(a=U.maxOpen(Hv(a.content,i),!0),a.openStart||a.openEnd){let d=0,h=0;for(let f=a.content.firstChild;d<a.openStart&&!f.type.spec.isolating;d++,f=f.firstChild);for(let f=a.content.lastChild;h<a.openEnd&&!f.type.spec.isolating;h++,f=f.lastChild);a=Nd(a,d,h)}return r.someProp("transformPasted",d=>{a=d(a,r,l)}),a}const $v=/^(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 Hv(r,e){if(r.childCount<2)return r;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,o=[];if(r.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),u;if(!l)return o=null;if(u=o.length&&s.length&&Ad(l,s,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=Od(o[o.length-1],s.length));let c=Ed(a,l);o.push(c),i=i.matchType(c.type),s=l}}),o)return F.from(o)}return r}function Ed(r,e,t=0){for(let n=e.length-1;n>=t;n--)r=e[n].create(null,F.from(r));return r}function Ad(r,e,t,n,i){if(i<r.length&&i<e.length&&r[i]==e[i]){let s=Ad(r,e,t,n.lastChild,i+1);if(s)return n.copy(n.content.replaceChild(n.childCount-1,s));if(n.contentMatchAt(n.childCount).matchType(i==r.length-1?t.type:r[i+1]))return n.copy(n.content.append(F.from(Ed(t,r,i+1))))}}function Od(r,e){if(e==0)return r;let t=r.content.replaceChild(r.childCount-1,Od(r.lastChild,e-1)),n=r.contentMatchAt(r.childCount).fillBefore(F.empty,!0);return r.copy(t.append(n))}function Ra(r,e,t,n,i,s){let o=e<0?r.firstChild:r.lastChild,a=o.content;return r.childCount>1&&(s=0),i<n-1&&(a=Ra(a,e,t,n,i+1,s)),i>=t&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(F.empty,!0))),r.replaceChild(e<0?0:r.childCount-1,o.copy(a))}function Nd(r,e,t){return e<r.openStart&&(r=new U(Ra(r.content,-1,e,r.openStart,0,r.openEnd),e,r.openEnd)),t<r.openEnd&&(r=new U(Ra(r.content,1,t,r.openEnd,0,0),r.openStart,t)),r}const Dd={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 Id=null;function Rd(){return Id||(Id=document.implementation.createHTMLDocument("title"))}let Pa=null;function Vv(r){let e=window.trustedTypes;return e?(Pa||(Pa=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),Pa.createHTML(r)):r}function _v(r){let e=/^(\s*<meta [^>]*>)*/.exec(r);e&&(r=r.slice(e[0].length));let t=Rd().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(r),i;if((i=n&&Dd[n[1].toLowerCase()])&&(r=i.map(s=>"<"+s+">").join("")+r+i.map(s=>"</"+s+">").reverse().join("")),t.innerHTML=Vv(r),i)for(let s=0;s<i.length;s++)t=t.querySelector(i[s])||t;return t}function jv(r){let e=r.querySelectorAll(Xe?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let n=e[t];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(r.ownerDocument.createTextNode(" "),n)}}function qv(r,e){if(!r.size)return r;let t=r.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return r}let{content:i,openStart:s,openEnd:o}=r;for(let a=n.length-2;a>=0;a-=2){let l=t.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;i=F.from(l.create(n[a+1],i)),s++,o++}return new U(i,s,o)}const ot={},at={},Wv={touchstart:!0,touchmove:!0};class Uv{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 Gv(r){for(let e in ot){let t=ot[e];r.dom.addEventListener(e,r.input.eventHandlers[e]=n=>{Jv(r,n)&&!La(r,n)&&(r.editable||!(n.type in at))&&t(r,n)},Wv[e]?{passive:!0}:void 0)}it&&r.dom.addEventListener("input",()=>null),za(r)}function Fr(r,e){r.input.lastSelectionOrigin=e,r.input.lastSelectionTime=Date.now()}function Kv(r){r.domObserver.stop();for(let e in r.input.eventHandlers)r.dom.removeEventListener(e,r.input.eventHandlers[e]);clearTimeout(r.input.composingTimeout),clearTimeout(r.input.lastIOSEnterFallbackTimeout)}function za(r){r.someProp("handleDOMEvents",e=>{for(let t in e)r.input.eventHandlers[t]||r.dom.addEventListener(t,r.input.eventHandlers[t]=n=>La(r,n))})}function La(r,e){return r.someProp("handleDOMEvents",t=>{let n=t[e.type];return n?n(r,e)||e.defaultPrevented:!1})}function Jv(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=r.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Yv(r,e){!La(r,e)&&ot[e.type]&&(r.editable||!(e.type in at))&&ot[e.type](r,e)}at.keydown=(r,e)=>{let t=e;if(r.input.shiftKey=t.keyCode==16||t.shiftKey,!zd(r,t)&&(r.input.lastKeyCode=t.keyCode,r.input.lastKeyCodeTime=Date.now(),!(ur&&Xe&&t.keyCode==13)))if(t.keyCode!=229&&r.domObserver.forceFlush(),In&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();r.input.lastIOSEnter=n,r.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{r.input.lastIOSEnter==n&&(r.someProp("handleKeyDown",i=>i(r,dn(13,"Enter"))),r.input.lastIOSEnter=0)},200)}else r.someProp("handleKeyDown",n=>n(r,t))||Fv(r,t)?t.preventDefault():Fr(r,"key")},at.keyup=(r,e)=>{e.keyCode==16&&(r.input.shiftKey=!1)},at.keypress=(r,e)=>{let t=e;if(zd(r,t)||!t.charCode||t.ctrlKey&&!t.altKey||It&&t.metaKey)return;if(r.someProp("handleKeyPress",i=>i(r,t))){t.preventDefault();return}let n=r.state.selection;if(!(n instanceof de)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(t.charCode),s=()=>r.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!r.someProp("handleTextInput",o=>o(r,n.$from.pos,n.$to.pos,i,s))&&r.dispatch(s()),t.preventDefault()}};function Ms(r){return{left:r.clientX,top:r.clientY}}function Xv(r,e){let t=e.x-r.clientX,n=e.y-r.clientY;return t*t+n*n<100}function Ba(r,e,t,n,i){if(n==-1)return!1;let s=r.state.doc.resolve(n);for(let o=s.depth+1;o>0;o--)if(r.someProp(e,a=>o>s.depth?a(r,t,s.nodeAfter,s.before(o),i,!0):a(r,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function zn(r,e,t){if(r.focused||r.focus(),r.state.selection.eq(e))return;let n=r.state.tr.setSelection(e);n.setMeta("pointer",!0),r.dispatch(n)}function Zv(r,e){if(e==-1)return!1;let t=r.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&ie.isSelectable(n)?(zn(r,new ie(t)),!0):!1}function Qv(r,e){if(e==-1)return!1;let t=r.state.selection,n,i;t instanceof ie&&(n=t.node);let s=r.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(ie.isSelectable(a)){n&&t.$from.depth>0&&o>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(o);break}}return i!=null?(zn(r,ie.create(r.state.doc,i)),!0):!1}function ey(r,e,t,n,i){return Ba(r,"handleClickOn",e,t,n)||r.someProp("handleClick",s=>s(r,e,n))||(i?Qv(r,t):Zv(r,t))}function ty(r,e,t,n){return Ba(r,"handleDoubleClickOn",e,t,n)||r.someProp("handleDoubleClick",i=>i(r,e,n))}function ry(r,e,t,n){return Ba(r,"handleTripleClickOn",e,t,n)||r.someProp("handleTripleClick",i=>i(r,e,n))||ny(r,t,n)}function ny(r,e,t){if(t.button!=0)return!1;let n=r.state.doc;if(e==-1)return n.inlineContent?(zn(r,de.create(n,0,n.content.size)),!0):!1;let i=n.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)zn(r,de.create(n,a+1,a+1+o.content.size));else if(ie.isSelectable(o))zn(r,ie.create(n,a));else continue;return!0}}function Fa(r){return Cs(r)}const Pd=It?"metaKey":"ctrlKey";ot.mousedown=(r,e)=>{let t=e;r.input.shiftKey=t.shiftKey;let n=Fa(r),i=Date.now(),s="singleClick";i-r.input.lastClick.time<500&&Xv(t,r.input.lastClick)&&!t[Pd]&&r.input.lastClick.button==t.button&&(r.input.lastClick.type=="singleClick"?s="doubleClick":r.input.lastClick.type=="doubleClick"&&(s="tripleClick")),r.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s,button:t.button};let o=r.posAtCoords(Ms(t));o&&(s=="singleClick"?(r.input.mouseDown&&r.input.mouseDown.done(),r.input.mouseDown=new iy(r,o,t,!!n)):(s=="doubleClick"?ty:ry)(r,o.pos,o.inside,t)?t.preventDefault():Fr(r,"pointer"))};class iy{constructor(e,t,n,i){this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Pd],this.allowDefault=n.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let c=e.state.doc.resolve(t.pos);s=c.parent,o=c.depth?c.before():0}const a=i?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;(n.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof ie&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Dt&&!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)),Fr(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(()=>dr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ms(e))),this.updateAllowDefault(e),this.allowDefault||!t?Fr(this.view,"pointer"):ey(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||it&&this.mightDrag&&!this.mightDrag.node.isAtom||Xe&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(zn(this.view,le.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Fr(this.view,"pointer")}move(e){this.updateAllowDefault(e),Fr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}ot.touchstart=r=>{r.input.lastTouch=Date.now(),Fa(r),Fr(r,"pointer")},ot.touchmove=r=>{r.input.lastTouch=Date.now(),Fr(r,"pointer")},ot.contextmenu=r=>Fa(r);function zd(r,e){return r.composing?!0:it&&Math.abs(e.timeStamp-r.input.compositionEndedAt)<500?(r.input.compositionEndedAt=-2e8,!0):!1}const sy=ur?5e3:-1;at.compositionstart=at.compositionupdate=r=>{if(!r.composing){r.domObserver.flush();let{state:e}=r,t=e.selection.$to;if(e.selection instanceof de&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||Xe&&Uc&&oy(r)))r.markCursor=r.state.storedMarks||t.marks(),Cs(r,!0),r.markCursor=null;else if(Cs(r,!e.selection.empty),Dt&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=r.domSelectionRange();for(let i=n.focusNode,s=n.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=r.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}r.input.composing=!0}Ld(r,sy)};function oy(r){let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let n=e.childNodes[t];return n.nodeType==1&&n.contentEditable=="false"}at.compositionend=(r,e)=>{r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=e.timeStamp,r.input.compositionPendingChanges=r.domObserver.pendingRecords().length?r.input.compositionID:0,r.input.compositionNode=null,r.input.compositionPendingChanges&&Promise.resolve().then(()=>r.domObserver.flush()),r.input.compositionID++,Ld(r,20))};function Ld(r,e){clearTimeout(r.input.composingTimeout),e>-1&&(r.input.composingTimeout=setTimeout(()=>Cs(r),e))}function Bd(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=ly());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function ay(r){let e=r.domSelectionRange();if(!e.focusNode)return null;let t=Q2(e.focusNode,e.focusOffset),n=ev(e.focusNode,e.focusOffset);if(t&&n&&t!=n){let i=n.pmViewDesc,s=r.domObserver.lastChangedTextNode;if(t==s||n==s)return s;if(!i||!i.isText(n.nodeValue))return n;if(r.input.compositionNode==n){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return n}}return t||n}function ly(){let r=document.createEvent("Event");return r.initEvent("event",!0,!0),r.timeStamp}function Cs(r,e=!1){if(!(ur&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),Bd(r),e||r.docView&&r.docView.dirty){let t=Ea(r),n=r.state.selection;return t&&!t.eq(n)?r.dispatch(r.state.tr.setSelection(t)):(r.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?r.dispatch(r.state.tr.deleteSelection()):r.updateState(r.state),!0}return!1}}function uy(r,e){if(!r.dom.parentNode)return;let t=r.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),r.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),r.focus()},50)}const Ti=mt&&Pr<15||In&&iv<604;ot.copy=at.cut=(r,e)=>{let t=e,n=r.state.selection,i=t.type=="cut";if(n.empty)return;let s=Ti?null:t.clipboardData,o=n.content(),{dom:a,text:l}=Ia(r,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):uy(r,a),i&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function cy(r){return r.openStart==0&&r.openEnd==0&&r.content.childCount==1?r.content.firstChild:null}function dy(r,e){if(!r.dom.parentNode)return;let t=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,n=r.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=r.input.shiftKey&&r.input.lastKeyCode!=45;setTimeout(()=>{r.focus(),n.parentNode&&n.parentNode.removeChild(n),t?Mi(r,n.value,null,i,e):Mi(r,n.textContent,n.innerHTML,i,e)},50)}function Mi(r,e,t,n,i){let s=Cd(r,e,t,n,r.state.selection.$from);if(r.someProp("handlePaste",l=>l(r,i,s||U.empty)))return!0;if(!s)return!1;let o=cy(s),a=o?r.state.tr.replaceSelectionWith(o,n):r.state.tr.replaceSelection(s);return r.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Fd(r){let e=r.getData("text/plain")||r.getData("Text");if(e)return e;let t=r.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}at.paste=(r,e)=>{let t=e;if(r.composing&&!ur)return;let n=Ti?null:t.clipboardData,i=r.input.shiftKey&&r.input.lastKeyCode!=45;n&&Mi(r,Fd(n),n.getData("text/html"),i,t)?t.preventDefault():dy(r,t)};class $d{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const fy=It?"altKey":"ctrlKey";function Hd(r,e){let t=r.someProp("dragCopies",n=>!n(e));return t??!e[fy]}ot.dragstart=(r,e)=>{let t=e,n=r.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let i=r.state.selection,s=i.empty?null:r.posAtCoords(Ms(t)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof ie?i.to-1:i.to))){if(n&&n.mightDrag)o=ie.create(r.state.doc,n.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=r.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=r.docView&&(o=ie.create(r.state.doc,d.posBefore))}}let a=(o||r.state.selection).content(),{dom:l,text:u,slice:c}=Ia(r,a);(!t.dataTransfer.files.length||!Xe||Wc>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Ti?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ti||t.dataTransfer.setData("text/plain",u),r.dragging=new $d(c,Hd(r,t),o)},ot.dragend=r=>{let e=r.dragging;window.setTimeout(()=>{r.dragging==e&&(r.dragging=null)},50)},at.dragover=at.dragenter=(r,e)=>e.preventDefault(),at.drop=(r,e)=>{try{hy(r,e,r.dragging)}finally{r.dragging=null}};function hy(r,e,t){if(!e.dataTransfer)return;let n=r.posAtCoords(Ms(e));if(!n)return;let i=r.state.doc.resolve(n.pos),s=t&&t.slice;s?r.someProp("transformPasted",f=>{s=f(s,r,!1)}):s=Cd(r,Fd(e.dataTransfer),Ti?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(t&&Hd(r,e));if(r.someProp("handleDrop",f=>f(r,e,s||U.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?pc(r.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let l=r.state.tr;if(o){let{node:f}=t;f?f.replace(l):l.deleteSelection()}let u=l.mapping.map(a),c=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=l.doc;if(c?l.replaceRangeWith(u,u,s.content.firstChild):l.replaceRange(u,u,s),l.doc.eq(d))return;let h=l.doc.resolve(u);if(c&&ie.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new ie(h));else{let f=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((m,v,y,w)=>f=w),l.setSelection(Oa(r,h,l.doc.resolve(f)))}r.focus(),r.dispatch(l.setMeta("uiEvent","drop"))}ot.focus=r=>{r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(()=>{r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&dr(r)},20))},ot.blur=(r,e)=>{let t=e;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),t.relatedTarget&&r.dom.contains(t.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)},ot.beforeinput=(r,e)=>{if(Xe&&ur&&e.inputType=="deleteContentBackward"){r.domObserver.flushSoon();let{domChangeCount:n}=r.input;setTimeout(()=>{if(r.input.domChangeCount!=n||(r.dom.blur(),r.focus(),r.someProp("handleKeyDown",s=>s(r,dn(8,"Backspace")))))return;let{$cursor:i}=r.state.selection;i&&i.pos>0&&r.dispatch(r.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let r in at)ot[r]=at[r];function Ci(r,e){if(r==e)return!0;for(let t in r)if(r[t]!==e[t])return!1;for(let t in e)if(!(t in r))return!1;return!0}class Es{constructor(e,t){this.toDOM=e,this.spec=t||mn,this.side=this.spec.side||0}map(e,t,n,i){let{pos:s,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new lt(s-n,s-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Es&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ci(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class $r{constructor(e,t){this.attrs=e,this.spec=t||mn}map(e,t,n,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return s>=o?null:new lt(s,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof $r&&Ci(this.attrs,e.attrs)&&Ci(this.spec,e.spec)}static is(e){return e.type instanceof $r}destroy(){}}class $a{constructor(e,t){this.attrs=e,this.spec=t||mn}map(e,t,n,i){let s=e.mapResult(t.from+i,1);if(s.deleted)return null;let o=e.mapResult(t.to+i,-1);return o.deleted||o.pos<=s.pos?null:new lt(s.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:i}=e.content.findIndex(t.from),s;return i==t.from&&!(s=e.child(n)).isText&&i+s.nodeSize==t.to}eq(e){return this==e||e instanceof $a&&Ci(this.attrs,e.attrs)&&Ci(this.spec,e.spec)}destroy(){}}class lt{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new lt(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new lt(e,e,new Es(t,n))}static inline(e,t,n,i){return new lt(e,t,new $r(n,i))}static node(e,t,n,i){return new lt(e,t,new $a(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof $r}get widget(){return this.type instanceof Es}}const Ln=[],mn={};class Re{constructor(e,t){this.local=e.length?e:Ln,this.children=t.length?t:Ln}static create(e,t){return t.length?As(t,e,0,mn):st}find(e,t,n){let i=[];return this.findInner(e??0,t??1e9,i,0,n),i}findInner(e,t,n,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=t&&a.to>=e&&(!s||s(a.spec))&&n.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,t-a,n,i+a,s)}}map(e,t,n){return this==st||e.maps.length==0?this:this.mapInner(e,t,0,0,n||mn)}mapInner(e,t,n,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,n,i);l&&l.type.valid(t,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?py(this.children,o||[],e,t,n,i,s):o?new Re(o.sort(gn),Ln):st}add(e,t){return t.length?this==st?Re.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let i,s=0;e.forEach((a,l)=>{let u=l+n,c;if(c=_d(t,a,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,c,u+1):i.splice(s,0,l,l+a.nodeSize,As(c,a,u+1,mn)),s+=3}});let o=Vd(s?jd(t):t,-n);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new Re(o.length?this.local.concat(o).sort(gn):this.local,i||this.children)}remove(e){return e.length==0||this==st?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,i=this.local;for(let s=0;s<n.length;s+=3){let o,a=n[s]+t,l=n[s+1]+t;for(let c=0,d;c<e.length;c++)(d=e[c])&&d.from>a&&d.to<l&&(e[c]=null,(o||(o=[])).push(d));if(!o)continue;n==this.children&&(n=this.children.slice());let u=n[s+2].removeInner(o,a+1);u!=st?n[s+2]=u:(n.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new Re(i,n):st}forChild(e,t){if(this==st)return this;if(t.isLeaf)return Re.empty;let n,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let s=e+1,o=s+t.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof $r){let u=Math.max(s,l.from)-s,c=Math.min(o,l.to)-s;u<c&&(i||(i=[])).push(l.copy(u,c))}}if(i){let a=new Re(i.sort(gn),Ln);return n?new Hr([a,n]):a}return n||st}eq(e){if(this==e)return!0;if(!(e instanceof Re)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Ha(this.localsInner(e))}localsInner(e){if(this==st)return Ln;if(e.inlineContent||!this.local.some($r.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof $r||t.push(this.local[n]);return t}forEachSet(e){e(this)}}Re.empty=new Re([],[]),Re.removeOverlap=Ha;const st=Re.empty;class Hr{constructor(e){this.members=e}map(e,t){const n=this.members.map(i=>i.map(e,t,mn));return Hr.from(n)}forChild(e,t){if(t.isLeaf)return Re.empty;let n=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,t);s!=st&&(s instanceof Hr?n=n.concat(s.members):n.push(s))}return Hr.from(n)}eq(e){if(!(e instanceof Hr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!t)t=s;else{n&&(t=t.slice(),n=!1);for(let o=0;o<s.length;o++)t.push(s[o])}}return t?Ha(n?t:t.sort(gn)):Ln}static from(e){switch(e.length){case 0:return st;case 1:return e[0];default:return new Hr(e.every(t=>t instanceof Re)?e:e.reduce((t,n)=>t.concat(n instanceof Re?n:n.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function py(r,e,t,n,i,s,o){let a=r.slice();for(let u=0,c=s;u<t.maps.length;u++){let d=0;t.maps[u].forEach((h,f,m,v)=>{let y=v-m-(f-h);for(let w=0;w<a.length;w+=3){let k=a[w+1];if(k<0||h>k+c-d)continue;let E=a[w]+c-d;f>=E?a[w+1]=h<=E?-2:-1:h>=c&&y&&(a[w]+=y,a[w+1]+=y)}d+=y}),c=t.maps[u].map(c,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let c=t.map(r[u]+s),d=c-i;if(d<0||d>=n.content.size){l=!0;continue}let h=t.map(r[u+1]+s,-1),f=h-i,{index:m,offset:v}=n.content.findIndex(d),y=n.maybeChild(m);if(y&&v==d&&v+y.nodeSize==f){let w=a[u+2].mapInner(t,y,c+1,r[u]+s+1,o);w!=st?(a[u]=d,a[u+1]=f,a[u+2]=w):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=my(a,r,e,t,i,s,o),c=As(u,n,0,o);e=c.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,h=0;d<c.children.length;d+=3){let f=c.children[d];for(;h<a.length&&a[h]<f;)h+=3;a.splice(h,0,c.children[d],c.children[d+1],c.children[d+2])}}return new Re(e.sort(gn),a)}function Vd(r,e){if(!e||!r.length)return r;let t=[];for(let n=0;n<r.length;n++){let i=r[n];t.push(new lt(i.from+e,i.to+e,i.type))}return t}function my(r,e,t,n,i,s,o){function a(l,u){for(let c=0;c<l.local.length;c++){let d=l.local[c].map(n,i,u);d?t.push(d):o.onRemove&&o.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)a(l.children[c+2],l.children[c]+u+1)}for(let l=0;l<r.length;l+=3)r[l+1]==-1&&a(r[l+2],e[l]+s+1);return t}function _d(r,e,t){if(e.isLeaf)return null;let n=t+e.nodeSize,i=null;for(let s=0,o;s<r.length;s++)(o=r[s])&&o.from>t&&o.to<n&&((i||(i=[])).push(o),r[s]=null);return i}function jd(r){let e=[];for(let t=0;t<r.length;t++)r[t]!=null&&e.push(r[t]);return e}function As(r,e,t,n){let i=[],s=!1;e.forEach((a,l)=>{let u=_d(r,a,l+t);if(u){s=!0;let c=As(u,a,t+l+1,n);c!=st&&i.push(l,l+a.nodeSize,c)}});let o=Vd(s?jd(r):r,-t).sort(gn);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(n.onRemove&&n.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new Re(o,i):st}function gn(r,e){return r.from-e.from||r.to-e.to}function Ha(r){let e=r;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.from!=n.to)for(let i=t+1;i<e.length;i++){let s=e[i];if(s.from==n.from){s.to!=n.to&&(e==r&&(e=r.slice()),e[i]=s.copy(s.from,n.to),qd(e,i+1,s.copy(n.to,s.to)));continue}else{s.from<n.to&&(e==r&&(e=r.slice()),e[t]=n.copy(n.from,s.from),qd(e,i,n.copy(s.from,n.to)));break}}}return e}function qd(r,e,t){for(;e<r.length&&gn(t,r[e])>0;)e++;r.splice(e,0,t)}function Va(r){let e=[];return r.someProp("decorations",t=>{let n=t(r.state);n&&n!=st&&e.push(n)}),r.cursorWrapper&&e.push(Re.create(r.state.doc,[r.cursorWrapper.deco])),Hr.from(e)}const gy={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},vy=mt&&Pr<=11;class yy{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 by{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new yy,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;i<n.length;i++)this.queue.push(n[i]);mt&&Pr<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),vy&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.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,gy)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(yd(this.view)){if(this.suppressingSelectionUpdates)return dr(this.view);if(mt&&Pr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&cn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let s=e.focusNode;s;s=Dn(s))t.add(s);for(let s=e.anchorNode;s;s=Dn(s))if(t.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&yd(e)&&!this.ignoreSelectionChange(n),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let c=0;c<t.length;c++){let d=this.registerMutation(t[c],l);d&&(s=s<0?d.from:Math.min(d.from,s),o=o<0?d.to:Math.max(d.to,o),d.typeOver&&(a=!0))}if(Dt&&l.length){let c=l.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,h]=c;d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let h of c){let f=h.parentNode;f&&f.nodeName=="LI"&&(!d||Sy(e,d)!=f)&&h.remove()}}}else if((Xe||it)&&l.some(c=>c.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let c of l)if(c.nodeName=="BR"&&c.parentNode){let d=c.nextSibling;d&&d.nodeType==1&&d.contentEditable=="false"&&c.parentNode.removeChild(c)}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&xs(n)&&(u=Ea(e))&&u.eq(le.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,dr(e),this.currentSelection.set(n),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),wy(e)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||dr(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let d=e.addedNodes[c];t.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,s=e.nextSibling;if(mt&&Pr<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:d,nextSibling:h}=e.addedNodes[c];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(s=h)}let o=i&&i.parentNode==e.target?et(i)+1:0,a=n.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?et(s):e.target.childNodes.length,u=n.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Wd=new WeakMap,Ud=!1;function wy(r){if(!Wd.has(r)&&(Wd.set(r,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(r.dom).whiteSpace)!==-1)){if(r.requiresGeckoHackNode=Dt,Ud)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."),Ud=!0}}function Gd(r,e){let t=e.startContainer,n=e.startOffset,i=e.endContainer,s=e.endOffset,o=r.domAtPos(r.state.selection.anchor);return cn(o.node,o.offset,i,s)&&([t,n,i,s]=[i,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:i,focusOffset:s}}function xy(r,e){if(e.getComposedRanges){let i=e.getComposedRanges(r.root)[0];if(i)return Gd(r,i)}let t;function n(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return r.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),r.dom.removeEventListener("beforeinput",n,!0),t?Gd(r,t):null}function Sy(r,e){for(let t=e.parentNode;t&&t!=r.dom;t=t.parentNode){let n=r.docView.nearestDesc(t,!0);if(n&&n.node.isBlock)return t}return null}function ky(r,e,t){let{node:n,fromOffset:i,toOffset:s,from:o,to:a}=r.docView.parseRange(e,t),l=r.domSelectionRange(),u,c=l.anchorNode;if(c&&r.dom.contains(c.nodeType==1?c:c.parentNode)&&(u=[{node:c,offset:l.anchorOffset}],xs(l)||u.push({node:l.focusNode,offset:l.focusOffset})),Xe&&r.input.lastKeyCode===8)for(let y=s;y>i;y--){let w=n.childNodes[y-1],k=w.pmViewDesc;if(w.nodeName=="BR"&&!k){s=y;break}if(!k||k.size)break}let d=r.state.doc,h=r.someProp("domParser")||Or.fromSchema(r.state.schema),f=d.resolve(o),m=null,v=h.parse(n,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:s,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:Ty,context:f});if(u&&u[0].pos!=null){let y=u[0].pos,w=u[1]&&u[1].pos;w==null&&(w=y),m={anchor:y+o,head:w+o}}return{doc:v,sel:m,from:o,to:a}}function Ty(r){let e=r.pmViewDesc;if(e)return e.parseRule();if(r.nodeName=="BR"&&r.parentNode){if(it&&/^(ul|ol)$/i.test(r.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(r.parentNode.lastChild==r||it&&/^(tr|table)$/i.test(r.parentNode.nodeName))return{ignore:!0}}else if(r.nodeName=="IMG"&&r.getAttribute("mark-placeholder"))return{ignore:!0};return null}const My=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Cy(r,e,t,n,i){let s=r.input.compositionPendingChanges||(r.composing?r.input.compositionID:0);if(r.input.compositionPendingChanges=0,e<0){let D=r.input.lastSelectionTime>Date.now()-50?r.input.lastSelectionOrigin:null,B=Ea(r,D);if(B&&!r.state.selection.eq(B)){if(Xe&&ur&&r.input.lastKeyCode===13&&Date.now()-100<r.input.lastKeyCodeTime&&r.someProp("handleKeyDown",V=>V(r,dn(13,"Enter"))))return;let L=r.state.tr.setSelection(B);D=="pointer"?L.setMeta("pointer",!0):D=="key"&&L.scrollIntoView(),s&&L.setMeta("composition",s),r.dispatch(L)}return}let o=r.state.doc.resolve(e),a=o.sharedDepth(t);e=o.before(a+1),t=r.state.doc.resolve(t).after(a+1);let l=r.state.selection,u=ky(r,e,t),c=r.state.doc,d=c.slice(u.from,u.to),h,f;r.input.lastKeyCode===8&&Date.now()-100<r.input.lastKeyCodeTime?(h=r.state.selection.to,f="end"):(h=r.state.selection.from,f="start"),r.input.lastKeyCode=null;let m=Oy(d.content,u.doc.content,u.from,h,f);if(m&&r.input.domChangeCount++,(In&&r.input.lastIOSEnter>Date.now()-225||ur)&&i.some(D=>D.nodeType==1&&!My.test(D.nodeName))&&(!m||m.endA>=m.endB)&&r.someProp("handleKeyDown",D=>D(r,dn(13,"Enter")))){r.input.lastIOSEnter=0;return}if(!m)if(n&&l instanceof de&&!l.empty&&l.$head.sameParent(l.$anchor)&&!r.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let D=Kd(r,r.state.doc,u.sel);if(D&&!D.eq(r.state.selection)){let B=r.state.tr.setSelection(D);s&&B.setMeta("composition",s),r.dispatch(B)}}return}r.state.selection.from<r.state.selection.to&&m.start==m.endB&&r.state.selection instanceof de&&(m.start>r.state.selection.from&&m.start<=r.state.selection.from+2&&r.state.selection.from>=u.from?m.start=r.state.selection.from:m.endA<r.state.selection.to&&m.endA>=r.state.selection.to-2&&r.state.selection.to<=u.to&&(m.endB+=r.state.selection.to-m.endA,m.endA=r.state.selection.to)),mt&&Pr<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)==" "&&(m.start--,m.endA--,m.endB--);let v=u.doc.resolveNoCache(m.start-u.from),y=u.doc.resolveNoCache(m.endB-u.from),w=c.resolve(m.start),k=v.sameParent(y)&&v.parent.inlineContent&&w.end()>=m.endA;if((In&&r.input.lastIOSEnter>Date.now()-225&&(!k||i.some(D=>D.nodeName=="DIV"||D.nodeName=="P"))||!k&&v.pos<u.doc.content.size&&(!v.sameParent(y)||!v.parent.inlineContent)&&v.pos<y.pos&&!/\S/.test(u.doc.textBetween(v.pos,y.pos,"","")))&&r.someProp("handleKeyDown",D=>D(r,dn(13,"Enter")))){r.input.lastIOSEnter=0;return}if(r.state.selection.anchor>m.start&&Ay(c,m.start,m.endA,v,y)&&r.someProp("handleKeyDown",D=>D(r,dn(8,"Backspace")))){ur&&Xe&&r.domObserver.suppressSelectionUpdates();return}Xe&&m.endB==m.start&&(r.input.lastChromeDelete=Date.now()),ur&&!k&&v.start()!=y.start()&&y.parentOffset==0&&v.depth==y.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,y=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{r.someProp("handleKeyDown",function(D){return D(r,dn(13,"Enter"))})},20));let E=m.start,R=m.endA,O=D=>{let B=D||r.state.tr.replace(E,R,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let L=Kd(r,B.doc,u.sel);L&&!(Xe&&r.composing&&L.empty&&(m.start!=m.endB||r.input.lastChromeDelete<Date.now()-100)&&(L.head==E||L.head==B.mapping.map(R)-1)||mt&&L.empty&&L.head==E)&&B.setSelection(L)}return s&&B.setMeta("composition",s),B.scrollIntoView()},N;if(k)if(v.pos==y.pos){mt&&Pr<=11&&v.parentOffset==0&&(r.domObserver.suppressSelectionUpdates(),setTimeout(()=>dr(r),20));let D=O(r.state.tr.delete(E,R)),B=c.resolve(m.start).marksAcross(c.resolve(m.endA));B&&D.ensureMarks(B),r.dispatch(D)}else if(m.endA==m.endB&&(N=Ey(v.parent.content.cut(v.parentOffset,y.parentOffset),w.parent.content.cut(w.parentOffset,m.endA-w.start())))){let D=O(r.state.tr);N.type=="add"?D.addMark(E,R,N.mark):D.removeMark(E,R,N.mark),r.dispatch(D)}else if(v.parent.child(v.index()).isText&&v.index()==y.index()-(y.textOffset?0:1)){let D=v.parent.textBetween(v.parentOffset,y.parentOffset),B=()=>O(r.state.tr.insertText(D,E,R));r.someProp("handleTextInput",L=>L(r,E,R,D,B))||r.dispatch(B())}else r.dispatch(O());else r.dispatch(O())}function Kd(r,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:Oa(r,e.resolve(t.anchor),e.resolve(t.head))}function Ey(r,e){let t=r.firstChild.marks,n=e.firstChild.marks,i=t,s=n,o,a,l;for(let c=0;c<n.length;c++)i=n[c].removeFromSet(i);for(let c=0;c<t.length;c++)s=t[c].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=c=>c.mark(a.addToSet(c.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=c=>c.mark(a.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(l(e.child(c)));if(F.from(u).eq(r))return{mark:a,type:o}}function Ay(r,e,t,n,i){if(t-e<=i.pos-n.pos||_a(n,!0,!1)<i.pos)return!1;let s=r.resolve(e);if(!n.parent.isTextblock){let a=s.nodeAfter;return a!=null&&t==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=r.resolve(_a(s,!0,!0));return!o.parent.isTextblock||o.pos>t||_a(o,!0,!1)<t?!1:n.parent.content.cut(n.parentOffset).eq(o.parent.content)}function _a(r,e,t){let n=r.depth,i=e?r.end():r.pos;for(;n>0&&(e||r.indexAfter(n)==r.node(n).childCount);)n--,i++,e=!1;if(t){let s=r.node(n).maybeChild(r.indexAfter(n));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function Oy(r,e,t,n,i){let s=r.findDiffStart(e,t);if(s==null)return null;let{a:o,b:a}=r.findDiffEnd(e,t+r.size,t+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));n-=o+l-s}if(o<s&&r.size<e.size){let l=n<=s&&n>=o?s-n:0;s-=l,s&&s<e.size&&Jd(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}else if(a<s){let l=n<=s&&n>=a?s-n:0;s-=l,s&&s<r.size&&Jd(r.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function Jd(r){if(r.length!=2)return!1;let e=r.charCodeAt(0),t=r.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class Yd{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Uv,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(tf),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Qd(this),Zd(this),this.nodeViews=ef(this),this.docView=od(this.state.doc,Xd(this),Va(this),this.dom,this),this.domObserver=new by(this,(n,i,s,o)=>Cy(this,n,i,s,o)),this.domObserver.start(),Gv(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&za(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(tf),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(Bd(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let f=ef(this);Dy(f,this.nodeViews)&&(this.nodeViews=f,s=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&za(this),this.editable=Qd(this),Zd(this);let l=Va(this),u=Xd(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,u,l);(d||!e.selection.eq(i.selection))&&(o=!0);let h=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&av(this);if(o){this.domObserver.stop();let f=d&&(mt||Xe)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Ny(i.selection,e.selection);if(d){let m=Xe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ay(this)),(s||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=od(e.doc,u,l,this.dom,this)),m&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Dv(this))?dr(this,f):(gd(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():h&&lv(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof ie){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Gc(this,t.getBoundingClientRect(),e)}else Gc(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let n=this.directPlugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let n=this.state.plugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,i=-1;if(this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let s=n.from+(this.state.doc.content.size-t.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==n.node&&(i=s)}this.dragging=new $d(e.slice,e.move,i<0?void 0:ie.create(this.state.doc,i))}someProp(e,t){let n=this._props&&this._props[e],i;if(n!=null&&(i=t?t(n):n))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=t?t(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=t?t(a):a))return i}}hasFocus(){if(mt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&uv(this.dom),dr(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return pv(this,e)}coordsAtPos(e,t=1){return Qc(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return bv(this,t||this.state,e)}pasteHTML(e,t){return Mi(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Mi(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ia(this,e)}destroy(){this.docView&&(Kv(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Va(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,X2())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Yv(this,e)}domSelectionRange(){let e=this.domSelection();return e?it&&this.root.nodeType===11&&rv(this.dom.ownerDocument)==this.dom&&xy(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Yd.prototype.dispatch=function(r){let e=this._props.dispatchTransaction;e?e.call(this,r):this.updateState(this.state.apply(r))};function Xd(r){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(r.editable),r.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(r.state)),t)for(let n in t)n=="class"?e.class+=" "+t[n]:n=="style"?e.style=(e.style?e.style+";":"")+t[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(t[n]))}),e.translate||(e.translate="no"),[lt.node(0,r.state.doc.content.size,e)]}function Zd(r){if(r.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),r.cursorWrapper={dom:e,deco:lt.widget(r.state.selection.from,e,{raw:!0,marks:r.markCursor})}}else r.cursorWrapper=null}function Qd(r){return!r.someProp("editable",e=>e(r.state)===!1)}function Ny(r,e){let t=Math.min(r.$anchor.sharedDepth(r.head),e.$anchor.sharedDepth(e.head));return r.$anchor.start(t)!=e.$anchor.start(t)}function ef(r){let e=Object.create(null);function t(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return r.someProp("nodeViews",t),r.someProp("markViews",t),e}function Dy(r,e){let t=0,n=0;for(let i in r){if(r[i]!=e[i])return!0;t++}for(let i in e)n++;return t!=n}function tf(r){if(r.spec.state||r.spec.filterTransaction||r.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Vr={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:"'"},Os={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Iy=typeof navigator<"u"&&/Mac/.test(navigator.platform),Ry=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tt=0;tt<10;tt++)Vr[48+tt]=Vr[96+tt]=String(tt);for(var tt=1;tt<=24;tt++)Vr[tt+111]="F"+tt;for(var tt=65;tt<=90;tt++)Vr[tt]=String.fromCharCode(tt+32),Os[tt]=String.fromCharCode(tt);for(var ja in Vr)Os.hasOwnProperty(ja)||(Os[ja]=Vr[ja]);function Py(r){var e=Iy&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||Ry&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?Os:Vr)[r.keyCode]||r.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const zy=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Ly=typeof navigator<"u"&&/Win/.test(navigator.platform);function By(r){let e=r.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let n,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))zy?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(t="Alt-"+t),i&&(t="Ctrl-"+t),o&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function Fy(r){let e=Object.create(null);for(let t in r)e[By(t)]=r[t];return e}function qa(r,e,t=!0){return e.altKey&&(r="Alt-"+r),e.ctrlKey&&(r="Ctrl-"+r),e.metaKey&&(r="Meta-"+r),t&&e.shiftKey&&(r="Shift-"+r),r}function $y(r){return new Be({props:{handleKeyDown:Wa(r)}})}function Wa(r){let e=Fy(r);return function(t,n){let i=Py(n),s,o=e[qa(i,n)];if(o&&o(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let a=e[qa(i,n,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Ly&&n.ctrlKey&&n.altKey)&&(s=Vr[n.keyCode])&&s!=i){let a=e[qa(s,n)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}var Hy=Object.defineProperty,Ua=(r,e)=>{for(var t in e)Hy(r,t,{get:e[t],enumerable:!0})};function Ns(r){const{state:e,transaction:t}=r;let{selection:n}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return n},get doc(){return i},get tr(){return n=t.selection,i=t.doc,s=t.storedMarks,t}}}var Ds=class{constructor(r){this.editor=r.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=r.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:r,editor:e,state:t}=this,{view:n}=e,{tr:i}=t,s=this.buildProps(i);return Object.fromEntries(Object.entries(r).map(([o,a])=>[o,(...u)=>{const c=a(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&n.dispatch(i),c}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(r,e=!0){const{rawCommands:t,editor:n,state:i}=this,{view:s}=n,o=[],a=!!r,l=r||i.tr,u=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(l),o.every(d=>d===!0)),c={...Object.fromEntries(Object.entries(t).map(([d,h])=>[d,(...m)=>{const v=this.buildProps(l,e),y=h(...m)(v);return o.push(y),c}])),run:u};return c}createCan(r){const{rawCommands:e,state:t}=this,n=!1,i=r||t.tr,s=this.buildProps(i,n);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>l(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,n)}}buildProps(r,e=!0){const{rawCommands:t,editor:n,state:i}=this,{view:s}=n,o={tr:r,editor:n,view:s,state:Ns({state:i,transaction:r}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(r,e),can:()=>this.createCan(r),get commands(){return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...u)=>l(...u)(o)]))}};return o}},rf={};Ua(rf,{blur:()=>Vy,clearContent:()=>_y,clearNodes:()=>jy,command:()=>qy,createParagraphNear:()=>Wy,cut:()=>Uy,deleteCurrentNode:()=>Gy,deleteNode:()=>Ky,deleteRange:()=>Jy,deleteSelection:()=>Yy,enter:()=>Xy,exitCode:()=>Zy,extendMarkRange:()=>Qy,first:()=>e5,focus:()=>t5,forEach:()=>r5,insertContent:()=>n5,insertContentAt:()=>o5,joinBackward:()=>u5,joinDown:()=>l5,joinForward:()=>c5,joinItemBackward:()=>d5,joinItemForward:()=>f5,joinTextblockBackward:()=>h5,joinTextblockForward:()=>p5,joinUp:()=>a5,keyboardShortcut:()=>g5,lift:()=>v5,liftEmptyBlock:()=>y5,liftListItem:()=>b5,newlineInCode:()=>w5,resetAttributes:()=>x5,scrollIntoView:()=>S5,selectAll:()=>k5,selectNodeBackward:()=>T5,selectNodeForward:()=>M5,selectParentNode:()=>C5,selectTextblockEnd:()=>E5,selectTextblockStart:()=>A5,setContent:()=>O5,setMark:()=>X5,setMeta:()=>Z5,setNode:()=>Q5,setNodeSelection:()=>e3,setTextDirection:()=>t3,setTextSelection:()=>r3,sinkListItem:()=>n3,splitBlock:()=>i3,splitListItem:()=>s3,toggleList:()=>o3,toggleMark:()=>a3,toggleNode:()=>l3,toggleWrap:()=>u3,undoInputRule:()=>c3,unsetAllMarks:()=>d3,unsetMark:()=>f3,unsetTextDirection:()=>h3,updateAttributes:()=>p3,wrapIn:()=>m3,wrapInList:()=>g3});var Vy=()=>({editor:r,view:e})=>(requestAnimationFrame(()=>{var t;r.isDestroyed||(e.dom.blur(),(t=window?.getSelection())==null||t.removeAllRanges())}),!0),_y=(r=!0)=>({commands:e})=>e.setContent("",{emitUpdate:r}),jy=()=>({state:r,tr:e,dispatch:t})=>{const{selection:n}=e,{ranges:i}=n;return t&&i.forEach(({$from:s,$to:o})=>{r.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,d=u.resolve(c.map(l)),h=u.resolve(c.map(l+a.nodeSize)),f=d.blockRange(h);if(!f)return;const m=Mn(f);if(a.type.isTextblock){const{defaultType:v}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(f.start,v)}(m||m===0)&&e.lift(f,m)})}),!0},qy=r=>e=>r(e),Wy=()=>({state:r,dispatch:e})=>Bc(r,e),Uy=(r,e)=>({editor:t,tr:n})=>{const{state:i}=t,s=i.doc.slice(r.from,r.to);n.deleteRange(r.from,r.to);const o=n.mapping.map(e);return n.insert(o,s.content),n.setSelection(new de(n.doc.resolve(Math.max(o-1,0)))),!0},Gy=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,n=t.$anchor.node();if(n.content.size>0)return!1;const i=r.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===n.type){if(e){const a=i.before(s),l=i.after(s);r.delete(a,l).scrollIntoView()}return!0}return!1};function qe(r,e){if(typeof r=="string"){if(!e.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return e.nodes[r]}return r}var Ky=r=>({tr:e,state:t,dispatch:n})=>{const i=qe(r,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(n){const l=s.before(o),u=s.after(o);e.delete(l,u).scrollIntoView()}return!0}return!1},Jy=r=>({tr:e,dispatch:t})=>{const{from:n,to:i}=r;return t&&e.delete(n,i),!0},Yy=()=>({state:r,dispatch:e})=>pa(r,e),Xy=()=>({commands:r})=>r.keyboardShortcut("Enter"),Zy=()=>({state:r,dispatch:e})=>L2(r,e);function Ga(r){return Object.prototype.toString.call(r)==="[object RegExp]"}function Is(r,e,t={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>t.strict?e[i]===r[i]:Ga(e[i])?e[i].test(r[i]):e[i]===r[i]):!0}function nf(r,e,t={}){return r.find(n=>n.type===e&&Is(Object.fromEntries(Object.keys(t).map(i=>[i,n.attrs[i]])),t))}function sf(r,e,t={}){return!!nf(r,e,t)}function Ka(r,e,t){var n;if(!r||!e)return;let i=r.parent.childAfter(r.parentOffset);if((!i.node||!i.node.marks.some(c=>c.type===e))&&(i=r.parent.childBefore(r.parentOffset)),!i.node||!i.node.marks.some(c=>c.type===e)||(t=t||((n=i.node.marks[0])==null?void 0:n.attrs),!nf([...i.node.marks],e,t)))return;let o=i.index,a=r.start()+i.offset,l=o+1,u=a+i.node.nodeSize;for(;o>0&&sf([...r.parent.child(o-1).marks],e,t);)o-=1,a-=r.parent.child(o).nodeSize;for(;l<r.parent.childCount&&sf([...r.parent.child(l).marks],e,t);)u+=r.parent.child(l).nodeSize,l+=1;return{from:a,to:u}}function fr(r,e){if(typeof r=="string"){if(!e.marks[r])throw Error(`There is no mark type named '${r}'. Maybe you forgot to add the extension?`);return e.marks[r]}return r}var Qy=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const s=fr(r,n.schema),{doc:o,selection:a}=t,{$from:l,from:u,to:c}=a;if(i){const d=Ka(l,s,e);if(d&&d.from<=u&&d.to>=c){const h=de.create(o,d.from,d.to);t.setSelection(h)}}return!0},e5=r=>e=>{const t=typeof r=="function"?r(e):r;for(let n=0;n<t.length;n+=1)if(t[n](e))return!0;return!1};function Ja(r){return r instanceof de}function hr(r=0,e=0,t=0){return Math.min(Math.max(r,e),t)}function of(r,e=null){if(!e)return null;const t=le.atStart(r),n=le.atEnd(r);if(e==="start"||e===!0)return t;if(e==="end")return n;const i=t.from,s=n.to;return e==="all"?de.create(r,hr(0,i,s),hr(r.content.size,i,s)):de.create(r,hr(e,i,s),hr(e,i,s))}function af(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Rs(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var t5=(r=null,e={})=>({editor:t,view:n,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(Rs()||af())&&n.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(n.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(n.hasFocus()&&r===null||r===!1)return!0;if(s&&r===null&&!Ja(t.state.selection))return o(),!0;const a=of(i.doc,r)||t.state.selection,l=t.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},r5=(r,e)=>t=>r.every((n,i)=>e(n,{...t,index:i})),n5=(r,e)=>({tr:t,commands:n})=>n.insertContentAt({from:t.selection.from,to:t.selection.to},r,e),lf=r=>{const e=r.childNodes;for(let t=e.length-1;t>=0;t-=1){const n=e[t];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?r.removeChild(n):n.nodeType===1&&lf(n)}return r};function Ps(r){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${r}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return lf(t)}function Ei(r,e,t){if(r instanceof Ar||r instanceof F)return r;t={slice:!0,parseOptions:{},...t};const n=typeof r=="object"&&r!==null,i=typeof r=="string";if(n)try{if(Array.isArray(r)&&r.length>0)return F.fromArray(r.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(r);return t.errorOnInvalidContent&&o.check(),o}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",s),Ei("",e,t)}if(i){if(t.errorOnInvalidContent){let o=!1,a="";const l=new Ku({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(t.slice?Or.fromSchema(l).parseSlice(Ps(r),t.parseOptions):Or.fromSchema(l).parse(Ps(r),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=Or.fromSchema(e);return t.slice?s.parseSlice(Ps(r),t.parseOptions).content:s.parse(Ps(r),t.parseOptions)}return Ei("",e,t)}function i5(r,e,t){const n=r.steps.length-1;if(n<e)return;const i=r.steps[n];if(!(i instanceof Je||i instanceof Ye))return;const s=r.mapping.maps[n];let o=0;s.forEach((a,l,u,c)=>{o===0&&(o=c)}),r.setSelection(le.near(r.doc.resolve(o),t))}var s5=r=>!("type"in r),o5=(r,e,t)=>({tr:n,dispatch:i,editor:s})=>{var o;if(i){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let a;const l=y=>{s.emit("contentError",{editor:s,error:y,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Ei(e,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(y){l(y)}try{a=Ei(e,s.schema,{parseOptions:u,errorOnInvalidContent:(o=t.errorOnInvalidContent)!=null?o:s.options.enableContentCheck})}catch(y){return l(y),!1}let{from:c,to:d}=typeof r=="number"?{from:r,to:r}:{from:r.from,to:r.to},h=!0,f=!0;if((s5(a)?a:[a]).forEach(y=>{y.check(),h=h?y.isText&&y.marks.length===0:!1,f=f?y.isBlock:!1}),c===d&&f){const{parent:y}=n.doc.resolve(c);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(c-=1,d+=1)}let v;if(h){if(Array.isArray(e))v=e.map(y=>y.text||"").join("");else if(e instanceof F){let y="";e.forEach(w=>{w.text&&(y+=w.text)}),v=y}else typeof e=="object"&&e&&e.text?v=e.text:v=e;n.insertText(v,c,d)}else{v=a;const y=n.doc.resolve(c),w=y.node(),k=y.parentOffset===0,E=w.isText||w.isTextblock,R=w.content.size>0;k&&E&&R&&(c=Math.max(0,c-1)),n.replaceWith(c,d,v)}t.updateSelection&&i5(n,n.steps.length-1,-1),t.applyInputRules&&n.setMeta("applyInputRules",{from:c,text:v}),t.applyPasteRules&&n.setMeta("applyPasteRules",{from:c,text:v})}return!0},a5=()=>({state:r,dispatch:e})=>R2(r,e),l5=()=>({state:r,dispatch:e})=>P2(r,e),u5=()=>({state:r,dispatch:e})=>Nc(r,e),c5=()=>({state:r,dispatch:e})=>Pc(r,e),d5=()=>({state:r,dispatch:e,tr:t})=>{try{const n=vs(r.doc,r.selection.$from.pos,-1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}},f5=()=>({state:r,dispatch:e,tr:t})=>{try{const n=vs(r.doc,r.selection.$from.pos,1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}},h5=()=>({state:r,dispatch:e})=>D2(r,e),p5=()=>({state:r,dispatch:e})=>I2(r,e);function uf(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function m5(r){const e=r.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let n,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))Rs()||uf()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return n&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),o&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}var g5=r=>({editor:e,view:t,tr:n,dispatch:i})=>{const s=m5(r).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{t.someProp("handleKeyDown",u=>u(t,a))});return l?.steps.forEach(u=>{const c=u.map(n.mapping);c&&i&&n.maybeStep(c)}),!0};function _r(r,e,t={}){const{from:n,to:i,empty:s}=r.selection,o=e?qe(e,r.schema):null,a=[];r.doc.nodesBetween(n,i,(d,h)=>{if(d.isText)return;const f=Math.max(n,h),m=Math.min(i,h+d.nodeSize);a.push({node:d,from:f,to:m})});const l=i-n,u=a.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>Is(d.node.attrs,t,{strict:!1}));return s?!!u.length:u.reduce((d,h)=>d+h.to-h.from,0)>=l}var v5=(r,e={})=>({state:t,dispatch:n})=>{const i=qe(r,t.schema);return _r(t,i,e)?z2(t,n):!1},y5=()=>({state:r,dispatch:e})=>Fc(r,e),b5=r=>({state:e,dispatch:t})=>{const n=qe(r,e.schema);return G2(n)(e,t)},w5=()=>({state:r,dispatch:e})=>Lc(r,e);function zs(r,e){return e.nodes[r]?"node":e.marks[r]?"mark":null}function cf(r,e){const t=typeof e=="string"?[e]:e;return Object.keys(r).reduce((n,i)=>(t.includes(i)||(n[i]=r[i]),n),{})}var x5=(r,e)=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const a=zs(typeof r=="string"?r:r.name,n.schema);if(!a)return!1;a==="node"&&(s=qe(r,n.schema)),a==="mark"&&(o=fr(r,n.schema));let l=!1;return t.selection.ranges.forEach(u=>{n.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,d)=>{s&&s===c.type&&(l=!0,i&&t.setNodeMarkup(d,void 0,cf(c.attrs,e))),o&&c.marks.length&&c.marks.forEach(h=>{o===h.type&&(l=!0,i&&t.addMark(d,d+c.nodeSize,o.create(cf(h.attrs,e))))})})}),l},S5=()=>({tr:r,dispatch:e})=>(e&&r.scrollIntoView(),!0),k5=()=>({tr:r,dispatch:e})=>{if(e){const t=new kt(r.doc);r.setSelection(t)}return!0},T5=()=>({state:r,dispatch:e})=>Ic(r,e),M5=()=>({state:r,dispatch:e})=>zc(r,e),C5=()=>({state:r,dispatch:e})=>$2(r,e),E5=()=>({state:r,dispatch:e})=>_2(r,e),A5=()=>({state:r,dispatch:e})=>V2(r,e);function Ya(r,e,t={},n={}){return Ei(r,e,{slice:!1,parseOptions:t,errorOnInvalidContent:n.errorOnInvalidContent})}var O5=(r,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:n={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if(n.preserveWhitespace!=="full"){const u=Ya(r,i.schema,n,{errorOnInvalidContent:e??i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!t),!0}return o&&s.setMeta("preventUpdate",!t),a.insertContentAt({from:0,to:l.content.size},r,{parseOptions:n,errorOnInvalidContent:e??i.options.enableContentCheck})};function df(r,e){const t=fr(e,r.schema),{from:n,to:i,empty:s}=r.selection,o=[];s?(r.storedMarks&&o.push(...r.storedMarks),o.push(...r.selection.$head.marks())):r.doc.nodesBetween(n,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===t.name);return a?{...a.attrs}:{}}function N5(r,e){const t=new bc(r);return e.forEach(n=>{n.steps.forEach(i=>{t.step(i)})}),t}function D5(r){for(let e=0;e<r.edgeCount;e+=1){const{type:t}=r.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function I5(r,e){for(let t=r.depth;t>0;t-=1){const n=r.node(t);if(e(n))return{pos:t>0?r.before(t):0,start:r.start(t),depth:t,node:n}}}function Ls(r){return e=>I5(e.$from,r)}function se(r,e,t){return r.config[e]===void 0&&r.parent?se(r.parent,e,t):typeof r.config[e]=="function"?r.config[e].bind({...t,parent:r.parent?se(r.parent,e,t):null}):r.config[e]}function Xa(r){return r.map(e=>{const t={name:e.name,options:e.options,storage:e.storage},n=se(e,"addExtensions",t);return n?[e,...Xa(n())]:e}).flat(10)}function Za(r,e){const t=ln.fromSchema(e).serializeFragment(r),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function ff(r){return typeof r=="function"}function Ce(r,e=void 0,...t){return ff(r)?e?r.bind(e)(...t):r(...t):r}function R5(r={}){return Object.keys(r).length===0&&r.constructor===Object}function Bn(r){const e=r.filter(i=>i.type==="extension"),t=r.filter(i=>i.type==="node"),n=r.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:n}}function hf(r){const e=[],{nodeExtensions:t,markExtensions:n}=Bn(r),i=[...t,...n],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return r.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage,extensions:i},l=se(o,"addGlobalAttributes",a);if(!l)return;l().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([h,f])=>{e.push({type:d,name:h,attribute:{...s,...f}})})})})}),i.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=se(o,"addAttributes",a);if(!l)return;const u=l();Object.entries(u).forEach(([c,d])=>{const h={...s,...d};typeof h?.default=="function"&&(h.default=h.default()),h?.isRequired&&h?.default===void 0&&delete h.default,e.push({type:o.name,name:c,attribute:h})})}),e}function ge(...r){return r.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([i,s])=>{if(!n[i]){n[i]=s;return}if(i==="class"){const a=s?String(s).split(" "):[],l=n[i]?n[i].split(" "):[],u=a.filter(c=>!l.includes(c));n[i]=[...l,...u].join(" ")}else if(i==="style"){const a=s?s.split(";").map(c=>c.trim()).filter(Boolean):[],l=n[i]?n[i].split(";").map(c=>c.trim()).filter(Boolean):[],u=new Map;l.forEach(c=>{const[d,h]=c.split(":").map(f=>f.trim());u.set(d,h)}),a.forEach(c=>{const[d,h]=c.split(":").map(f=>f.trim());u.set(d,h)}),n[i]=Array.from(u.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else n[i]=s}),n},{})}function Ai(r,e){return e.filter(t=>t.type===r.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(r.attrs)||{}:{[t.name]:r.attrs[t.name]}).reduce((t,n)=>ge(t,n),{})}function P5(r){return typeof r!="string"?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):r==="true"?!0:r==="false"?!1:r}function pf(r,e){return"style"in r?r:{...r,getAttrs:t=>{const n=r.getAttrs?r.getAttrs(t):r.attrs;if(n===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(t):P5(t.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...n,...i}}}}function mf(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>e==="attrs"&&R5(t)?!1:t!=null))}function gf(r){var e,t;const n={};return!((e=r?.attribute)!=null&&e.isRequired)&&"default"in(r?.attribute||{})&&(n.default=r.attribute.default),((t=r?.attribute)==null?void 0:t.validate)!==void 0&&(n.validate=r.attribute.validate),[r.name,n]}function z5(r,e){var t;const n=hf(r),{nodeExtensions:i,markExtensions:s}=Bn(r),o=(t=i.find(u=>se(u,"topNode")))==null?void 0:t.name,a=Object.fromEntries(i.map(u=>{const c=n.filter(w=>w.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},h=r.reduce((w,k)=>{const E=se(k,"extendNodeSchema",d);return{...w,...E?E(u):{}}},{}),f=mf({...h,content:Ce(se(u,"content",d)),marks:Ce(se(u,"marks",d)),group:Ce(se(u,"group",d)),inline:Ce(se(u,"inline",d)),atom:Ce(se(u,"atom",d)),selectable:Ce(se(u,"selectable",d)),draggable:Ce(se(u,"draggable",d)),code:Ce(se(u,"code",d)),whitespace:Ce(se(u,"whitespace",d)),linebreakReplacement:Ce(se(u,"linebreakReplacement",d)),defining:Ce(se(u,"defining",d)),isolating:Ce(se(u,"isolating",d)),attrs:Object.fromEntries(c.map(gf))}),m=Ce(se(u,"parseHTML",d));m&&(f.parseDOM=m.map(w=>pf(w,c)));const v=se(u,"renderHTML",d);v&&(f.toDOM=w=>v({node:w,HTMLAttributes:Ai(w,c)}));const y=se(u,"renderText",d);return y&&(f.toText=y),[u.name,f]})),l=Object.fromEntries(s.map(u=>{const c=n.filter(y=>y.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},h=r.reduce((y,w)=>{const k=se(w,"extendMarkSchema",d);return{...y,...k?k(u):{}}},{}),f=mf({...h,inclusive:Ce(se(u,"inclusive",d)),excludes:Ce(se(u,"excludes",d)),group:Ce(se(u,"group",d)),spanning:Ce(se(u,"spanning",d)),code:Ce(se(u,"code",d)),attrs:Object.fromEntries(c.map(gf))}),m=Ce(se(u,"parseHTML",d));m&&(f.parseDOM=m.map(y=>pf(y,c)));const v=se(u,"renderHTML",d);return v&&(f.toDOM=y=>v({mark:y,HTMLAttributes:Ai(y,c)})),[u.name,f]}));return new Ku({topNode:o,nodes:a,marks:l})}function L5(r){const e=r.filter((t,n)=>r.indexOf(t)!==n);return Array.from(new Set(e))}function Qa(r){return r.sort((t,n)=>{const i=se(t,"priority")||100,s=se(n,"priority")||100;return i>s?-1:i<s?1:0})}function vf(r){const e=Qa(Xa(r)),t=L5(e.map(n=>n.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(n=>`'${n}'`).join(", ")}]. This can lead to issues.`),e}function yf(r,e,t){const{from:n,to:i}=e,{blockSeparator:s=`
|
|
506
|
-
|
|
507
|
-
`,textSerializers:o={}}=t||{};let a="";return r.nodesBetween(n,i,(l,u,c,d)=>{var h;l.isBlock&&u>n&&(a+=s);const f=o?.[l.type.name];if(f)return c&&(a+=f({node:l,pos:u,parent:c,index:d,range:e})),!1;l.isText&&(a+=(h=l?.text)==null?void 0:h.slice(Math.max(n,u)-u,i-u))}),a}function bf(r,e){const t={from:0,to:r.content.size};return yf(r,t,e)}function el(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function B5(r,e){const t=qe(e,r.schema),{from:n,to:i}=r.selection,s=[];r.doc.nodesBetween(n,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===t.name);return o?{...o.attrs}:{}}function F5(r,e){const t=zs(typeof e=="string"?e:e.name,r.schema);return t==="node"?B5(r,e):t==="mark"?df(r,e):{}}function $5(r,e=JSON.stringify){const t={};return r.filter(n=>{const i=e(n);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function H5(r){const e=$5(r);return e.length===1?e:e.filter((t,n)=>!e.filter((s,o)=>o!==n).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function V5(r){const{mapping:e,steps:t}=r,n=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=t[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const u=e.slice(s).map(a,-1),c=e.slice(s).map(l),d=e.invert().map(u,-1),h=e.invert().map(c);n.push({oldRange:{from:d,to:h},newRange:{from:u,to:c}})})}),H5(n)}function wf(r,e,t){const n=[];return r===e?t.resolve(r).marks().forEach(i=>{const s=t.resolve(r),o=Ka(s,i.type);o&&n.push({mark:i,...o})}):t.nodesBetween(r,e,(i,s)=>{!i||i?.nodeSize===void 0||n.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),n}var _5=(r,e,t,n=20)=>{const i=r.doc.resolve(t);let s=n,o=null;for(;s>0&&o===null;){const a=i.node(s);a?.type.name===e?o=a:s-=1}return[o,s]};function tl(r,e){return e.nodes[r]||e.marks[r]||null}function Bs(r,e,t){return Object.fromEntries(Object.entries(t).filter(([n])=>{const i=r.find(s=>s.type===e&&s.name===n);return i?i.attribute.keepOnSplit:!1}))}var j5=(r,e=500)=>{let t="";const n=r.parentOffset;return r.parent.nodesBetween(Math.max(0,n-e),n,(i,s,o,a)=>{var l,u;const c=((u=(l=i.type.spec).toText)==null?void 0:u.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,n-s))}),t};function rl(r,e,t={}){const{empty:n,ranges:i}=r.selection,s=e?fr(e,r.schema):null;if(n)return!!(r.storedMarks||r.selection.$from.marks()).filter(d=>s?s.name===d.type.name:!0).find(d=>Is(d.attrs,t,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:d,$to:h})=>{const f=d.pos,m=h.pos;r.doc.nodesBetween(f,m,(v,y)=>{if(!v.isText&&!v.marks.length)return;const w=Math.max(f,y),k=Math.min(m,y+v.nodeSize),E=k-w;o+=E,a.push(...v.marks.map(R=>({mark:R,from:w,to:k})))})}),o===0)return!1;const l=a.filter(d=>s?s.name===d.mark.type.name:!0).filter(d=>Is(d.mark.attrs,t,{strict:!1})).reduce((d,h)=>d+h.to-h.from,0),u=a.filter(d=>s?d.mark.type!==s&&d.mark.type.excludes(s):!0).reduce((d,h)=>d+h.to-h.from,0);return(l>0?l+u:l)>=o}function q5(r,e,t={}){if(!e)return _r(r,null,t)||rl(r,null,t);const n=zs(e,r.schema);return n==="node"?_r(r,e,t):n==="mark"?rl(r,e,t):!1}var W5=(r,e)=>{const{$from:t,$to:n,$anchor:i}=r.selection;if(e){const s=Ls(a=>a.type.name===e)(r.selection);if(!s)return!1;const o=r.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(n.parentOffset<n.parent.nodeSize-2||t.pos!==n.pos)},U5=r=>{const{$from:e,$to:t}=r.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function xf(r,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===r.name):e}function Sf(r,e){const{nodeExtensions:t}=Bn(e),n=t.find(o=>o.name===r);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},s=Ce(se(n,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Fs(r,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var n;if(t){if(r.type.name==="hardBreak")return!0;if(r.isText)return/^\s*$/m.test((n=r.text)!=null?n:"")}if(r.isText)return!r.text;if(r.isAtom||r.isLeaf)return!1;if(r.content.childCount===0)return!0;if(e){let i=!0;return r.content.forEach(s=>{i!==!1&&(Fs(s,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function G5(r){return r instanceof ie}var kf=class x1{constructor(e){this.position=e}static fromJSON(e){return new x1(e.position)}toJSON(){return{position:this.position}}};function K5(r,e){const t=e.mapping.mapResult(r.position);return{position:new kf(t.pos),mapResult:t}}function J5(r){return new kf(r)}function Tf(r,e,t){const i=r.state.doc.content.size,s=hr(e,0,i),o=hr(t,0,i),a=r.coordsAtPos(s),l=r.coordsAtPos(o,-1),u=Math.min(a.top,l.top),c=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),h=Math.max(a.right,l.right),f=h-d,m=c-u,w={top:u,bottom:c,left:d,right:h,width:f,height:m,x:d,y:u};return{...w,toJSON:()=>w}}function Y5(r,e,t){var n;const{selection:i}=e;let s=null;if(Ja(i)&&(s=i.$cursor),s){const a=(n=r.storedMarks)!=null?n:s.marks();return s.parent.type.allowsMarkType(t)&&(!!t.isInSet(a)||!a.some(u=>u.type.excludes(t)))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let u=a.depth===0?r.doc.inlineContent&&r.doc.type.allowsMarkType(t):!1;return r.doc.nodesBetween(a.pos,l.pos,(c,d,h)=>{if(u)return!1;if(c.isInline){const f=!h||h.type.allowsMarkType(t),m=!!t.isInSet(c.marks)||!c.marks.some(v=>v.type.excludes(t));u=f&&m}return!u}),u})}var X5=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:a}=s,l=fr(r,n.schema);if(i)if(o){const u=df(n,l);t.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;n.doc.nodesBetween(c,d,(h,f)=>{const m=Math.max(f,c),v=Math.min(f+h.nodeSize,d);h.marks.find(w=>w.type===l)?h.marks.forEach(w=>{l===w.type&&t.addMark(m,v,l.create({...w.attrs,...e}))}):t.addMark(m,v,l.create(e))})});return Y5(n,t,l)},Z5=(r,e)=>({tr:t})=>(t.setMeta(r,e),!0),Q5=(r,e={})=>({state:t,dispatch:n,chain:i})=>{const s=qe(r,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>Vc(s,{...o,...e})(t)?!0:a.clearNodes()).command(({state:a})=>Vc(s,{...o,...e})(a,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},e3=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,i=hr(r,0,n.content.size),s=ie.create(n,i);e.setSelection(s)}return!0},t3=(r,e)=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=n;let o,a;return typeof e=="number"?(o=e,a=e):e&&"from"in e&&"to"in e?(o=e.from,a=e.to):(o=s.from,a=s.to),i&&t.doc.nodesBetween(o,a,(l,u)=>{l.isText||t.setNodeMarkup(u,void 0,{...l.attrs,dir:r})}),!0},r3=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,{from:i,to:s}=typeof r=="number"?{from:r,to:r}:r,o=de.atStart(n).from,a=de.atEnd(n).to,l=hr(i,o,a),u=hr(s,o,a),c=de.create(n,l,u);e.setSelection(c)}return!0},n3=r=>({state:e,dispatch:t})=>{const n=qe(r,e.schema);return Y2(n)(e,t)};function Mf(r,e){const t=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(t){const n=t.filter(i=>e?.includes(i.type.name));r.tr.ensureMarks(n)}}var i3=({keepMarks:r=!0}={})=>({tr:e,state:t,dispatch:n,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,u=i.extensionManager.attributes,c=Bs(u,a.node().type.name,a.node().attrs);if(s instanceof ie&&s.node.isBlock)return!a.parentOffset||!ar(o,a.pos)?!1:(n&&(r&&Mf(t,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=a.depth===0?void 0:D5(a.node(-1).contentMatchAt(a.indexAfter(-1)));let f=d&&h?[{type:h,attrs:c}]:void 0,m=ar(e.doc,e.mapping.map(a.pos),1,f);if(!f&&!m&&ar(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(m=!0,f=h?[{type:h,attrs:c}]:void 0),n){if(m&&(s instanceof de&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,f),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const v=e.mapping.map(a.before()),y=e.doc.resolve(v);a.node(-1).canReplaceWith(y.index(),y.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}r&&Mf(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},s3=(r,e={})=>({tr:t,state:n,dispatch:i,editor:s})=>{var o;const a=qe(r,n.schema),{$from:l,$to:u}=n.selection,c=n.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(u))return!1;const d=l.node(-1);if(d.type!==a)return!1;const h=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let w=F.empty;const k=l.index(-1)?1:l.index(-2)?2:3;for(let B=l.depth-k;B>=l.depth-3;B-=1)w=F.from(l.node(B).copy(w));const E=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,R={...Bs(h,l.node().type.name,l.node().attrs),...e},O=((o=a.contentMatch.defaultType)==null?void 0:o.createAndFill(R))||void 0;w=w.append(F.from(a.createAndFill(null,O)||void 0));const N=l.before(l.depth-(k-1));t.replace(N,l.after(-E),new U(w,4-k,0));let D=-1;t.doc.nodesBetween(N,t.doc.content.size,(B,L)=>{if(D>-1)return!1;B.isTextblock&&B.content.size===0&&(D=L+1)}),D>-1&&t.setSelection(de.near(t.doc.resolve(D))),t.scrollIntoView()}return!0}const f=u.pos===l.end()?d.contentMatchAt(0).defaultType:null,m={...Bs(h,d.type.name,d.attrs),...e},v={...Bs(h,l.node().type.name,l.node().attrs),...e};t.delete(l.pos,u.pos);const y=f?[{type:a,attrs:m},{type:f,attrs:v}]:[{type:a,attrs:m}];if(!ar(t.doc,l.pos,2))return!1;if(i){const{selection:w,storedMarks:k}=n,{splittableMarks:E}=s.extensionManager,R=k||w.$to.parentOffset&&w.$from.marks();if(t.split(l.pos,2,y).scrollIntoView(),!R||!i)return!0;const O=R.filter(N=>E.includes(N.type.name));t.ensureMarks(O)}return!0},nl=(r,e)=>{const t=Ls(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===i?.type&&Ir(r.doc,t.pos)&&r.join(t.pos),!0},il=(r,e)=>{const t=Ls(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(t.start).after(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===i?.type&&Ir(r.doc,n)&&r.join(n),!0},o3=(r,e,t,n={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:d,splittableMarks:h}=i.extensionManager,f=qe(r,o.schema),m=qe(e,o.schema),{selection:v,storedMarks:y}=o,{$from:w,$to:k}=v,E=w.blockRange(k),R=y||v.$to.parentOffset&&v.$from.marks();if(!E)return!1;const O=Ls(N=>Sf(N.type.name,d))(v);if(E.depth>=1&&O&&E.depth-O.depth<=1){if(O.node.type===f)return u.liftListItem(m);if(Sf(O.node.type.name,d)&&f.validContent(O.node.content)&&a)return l().command(()=>(s.setNodeMarkup(O.pos,f),!0)).command(()=>nl(s,f)).command(()=>il(s,f)).run()}return!t||!R||!a?l().command(()=>c().wrapInList(f,n)?!0:u.clearNodes()).wrapInList(f,n).command(()=>nl(s,f)).command(()=>il(s,f)).run():l().command(()=>{const N=c().wrapInList(f,n),D=R.filter(B=>h.includes(B.type.name));return s.ensureMarks(D),N?!0:u.clearNodes()}).wrapInList(f,n).command(()=>nl(s,f)).command(()=>il(s,f)).run()},a3=(r,e={},t={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=fr(r,n.schema);return rl(n,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},l3=(r,e,t={})=>({state:n,commands:i})=>{const s=qe(r,n.schema),o=qe(e,n.schema),a=_r(n,s,t);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...t})},u3=(r,e={})=>({state:t,commands:n})=>{const i=qe(r,t.schema);return _r(t,i,e)?n.lift(i):n.wrapIn(i,e)},c3=()=>({state:r,dispatch:e})=>{const t=r.plugins;for(let n=0;n<t.length;n+=1){const i=t[n];let s;if(i.spec.isInputRules&&(s=i.getState(r))){if(e){const o=r.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,r.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},d3=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,{empty:n,ranges:i}=t;return n||e&&i.forEach(s=>{r.removeMark(s.$from.pos,s.$to.pos)}),!0},f3=(r,e={})=>({tr:t,state:n,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=t,l=fr(r,n.schema),{$from:u,empty:c,ranges:d}=a;if(!i)return!0;if(c&&o){let{from:h,to:f}=a;const m=(s=u.marks().find(y=>y.type===l))==null?void 0:s.attrs,v=Ka(u,l,m);v&&(h=v.from,f=v.to),t.removeMark(h,f,l)}else d.forEach(h=>{t.removeMark(h.$from.pos,h.$to.pos,l)});return t.removeStoredMark(l),!0},h3=r=>({tr:e,state:t,dispatch:n})=>{const{selection:i}=t;let s,o;return typeof r=="number"?(s=r,o=r):r&&"from"in r&&"to"in r?(s=r.from,o=r.to):(s=i.from,o=i.to),n&&e.doc.nodesBetween(s,o,(a,l)=>{if(a.isText)return;const u={...a.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},p3=(r,e={})=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const a=zs(typeof r=="string"?r:r.name,n.schema);if(!a)return!1;a==="node"&&(s=qe(r,n.schema)),a==="mark"&&(o=fr(r,n.schema));let l=!1;return t.selection.ranges.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;let h,f,m,v;t.selection.empty?n.doc.nodesBetween(c,d,(y,w)=>{s&&s===y.type&&(l=!0,m=Math.max(w,c),v=Math.min(w+y.nodeSize,d),h=w,f=y)}):n.doc.nodesBetween(c,d,(y,w)=>{w<c&&s&&s===y.type&&(l=!0,m=Math.max(w,c),v=Math.min(w+y.nodeSize,d),h=w,f=y),w>=c&&w<=d&&(s&&s===y.type&&(l=!0,i&&t.setNodeMarkup(w,void 0,{...y.attrs,...e})),o&&y.marks.length&&y.marks.forEach(k=>{if(o===k.type&&(l=!0,i)){const E=Math.max(w,c),R=Math.min(w+y.nodeSize,d);t.addMark(E,R,o.create({...k.attrs,...e}))}}))}),f&&(h!==void 0&&i&&t.setNodeMarkup(h,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(y=>{o===y.type&&i&&t.addMark(m,v,o.create({...y.attrs,...e}))}))}),l},m3=(r,e={})=>({state:t,dispatch:n})=>{const i=qe(r,t.schema);return j2(i,e)(t,n)},g3=(r,e={})=>({state:t,dispatch:n})=>{const i=qe(r,t.schema);return q2(i,e)(t,n)},v3=class{constructor(){this.callbacks={}}on(r,e){return this.callbacks[r]||(this.callbacks[r]=[]),this.callbacks[r].push(e),this}emit(r,...e){const t=this.callbacks[r];return t&&t.forEach(n=>n.apply(this,e)),this}off(r,e){const t=this.callbacks[r];return t&&(e?this.callbacks[r]=t.filter(n=>n!==e):delete this.callbacks[r]),this}once(r,e){const t=(...n)=>{this.off(r,t),e.apply(this,n)};return this.on(r,t)}removeAllListeners(){this.callbacks={}}},sl=class{constructor(r){var e;this.find=r.find,this.handler=r.handler,this.undoable=(e=r.undoable)!=null?e:!0}},y3=(r,e)=>{if(Ga(e))return e.exec(r);const t=e(r);if(!t)return null;const n=[t.text];return n.index=t.index,n.input=r,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(t.replaceWith)),n};function $s(r){var e;const{editor:t,from:n,to:i,text:s,rules:o,plugin:a}=r,{view:l}=t;if(l.composing)return!1;const u=l.state.doc.resolve(n);if(u.parent.type.spec.code||(e=u.nodeBefore||u.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let c=!1;const d=j5(u)+s;return o.forEach(h=>{if(c)return;const f=y3(d,h.find);if(!f)return;const m=l.state.tr,v=Ns({state:l.state,transaction:m}),y={from:n-(f[0].length-s.length),to:i},{commands:w,chain:k,can:E}=new Ds({editor:t,state:v});h.handler({state:v,range:y,match:f,commands:w,chain:k,can:E})===null||!m.steps.length||(h.undoable&&m.setMeta(a,{transform:m,from:n,to:i,text:s}),l.dispatch(m),c=!0)}),c}function b3(r){const{editor:e,rules:t}=r,n=new Be({state:{init(){return null},apply(i,s,o){const a=i.getMeta(n);if(a)return a;const l=i.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:c}=l;typeof c=="string"?c=c:c=Za(F.from(c),o.schema);const{from:d}=l,h=d+c.length;$s({editor:e,from:d,to:h,text:c,rules:t,plugin:n})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return $s({editor:e,from:s,to:o,text:a,rules:t,plugin:n})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&$s({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:n})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?$s({editor:e,from:o.pos,to:o.pos,text:`
|
|
508
|
-
`,rules:t,plugin:n}):!1}},isInputRules:!0});return n}function w3(r){return Object.prototype.toString.call(r).slice(8,-1)}function Hs(r){return w3(r)!=="Object"?!1:r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype}function Cf(r,e){const t={...r};return Hs(r)&&Hs(e)&&Object.keys(e).forEach(n=>{Hs(e[n])&&Hs(r[n])?t[n]=Cf(r[n],e[n]):t[n]=e[n]}),t}var ol=class{constructor(r={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...r},this.name=this.config.name}get options(){return{...Ce(se(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Ce(se(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(r={}){const e=this.extend({...this.config,addOptions:()=>Cf(this.options,r)});return e.name=this.name,e.parent=this.parent,e}extend(r={}){const e=new this.constructor({...this.config,...r});return e.parent=this,this.child=e,e.name="name"in r?r.name:e.parent.name,e}},Oi=class S1 extends ol{constructor(){super(...arguments),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new S1(t)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>u?.type.name===t.name))return!1;const l=o.find(u=>u?.type.name===t.name);return l&&n.removeStoredMark(l),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function x3(r){return typeof r=="number"}var S3=class{constructor(r){this.find=r.find,this.handler=r.handler}},k3=(r,e,t)=>{if(Ga(e))return[...r.matchAll(e)];const n=e(r,t);return n?n.map(i=>{const s=[i.text];return s.index=i.index,s.input=r,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function T3(r){const{editor:e,state:t,from:n,to:i,rule:s,pasteEvent:o,dropEvent:a}=r,{commands:l,chain:u,can:c}=new Ds({editor:e,state:t}),d=[];return t.doc.nodesBetween(n,i,(f,m)=>{var v,y,w,k,E;if((y=(v=f.type)==null?void 0:v.spec)!=null&&y.code||!(f.isText||f.isTextblock||f.isInline))return;const R=(E=(k=(w=f.content)==null?void 0:w.size)!=null?k:f.nodeSize)!=null?E:0,O=Math.max(n,m),N=Math.min(i,m+R);if(O>=N)return;const D=f.isText?f.text||"":f.textBetween(O-m,N-m,void 0,"");k3(D,s.find,o).forEach(L=>{if(L.index===void 0)return;const V=O+L.index+1,te=V+L[0].length,ne={from:t.tr.mapping.map(V),to:t.tr.mapping.map(te)},fe=s.handler({state:t,range:ne,match:L,commands:l,chain:u,can:c,pasteEvent:o,dropEvent:a});d.push(fe)})}),d.every(f=>f!==null)}var Vs=null,M3=r=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)==null||e.setData("text/html",r),t};function C3(r){const{editor:e,rules:t}=r;let n=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:c,from:d,to:h,rule:f,pasteEvt:m})=>{const v=c.tr,y=Ns({state:c,transaction:v});if(!(!T3({editor:e,state:y,from:Math.max(d-1,0),to:h.b-1,rule:f,pasteEvent:m,dropEvent:a})||!v.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v}};return t.map(c=>new Be({view(d){const h=m=>{var v;n=(v=d.dom.parentElement)!=null&&v.contains(m.target)?d.dom.parentElement:null,n&&(Vs=e)},f=()=>{Vs&&(Vs=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,h)=>{if(s=n===d.dom.parentElement,a=h,!s){const f=Vs;f?.isEditable&&setTimeout(()=>{const m=f.state.selection;m&&f.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(d,h)=>{var f;const m=(f=h.clipboardData)==null?void 0:f.getData("text/html");return o=h,i=!!m?.includes("data-pm-slice"),!1}}},appendTransaction:(d,h,f)=>{const m=d[0],v=m.getMeta("uiEvent")==="paste"&&!i,y=m.getMeta("uiEvent")==="drop"&&!s,w=m.getMeta("applyPasteRules"),k=!!w;if(!v&&!y&&!k)return;if(k){let{text:O}=w;typeof O=="string"?O=O:O=Za(F.from(O),f.schema);const{from:N}=w,D=N+O.length,B=M3(O);return l({rule:c,state:f,from:N,to:{b:D},pasteEvt:B})}const E=h.doc.content.findDiffStart(f.doc.content),R=h.doc.content.findDiffEnd(f.doc.content);if(!(!x3(E)||!R||E===R.b))return l({rule:c,state:f,from:E,to:R,pasteEvt:o})}}))}var _s=class{constructor(r,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=r,this.extensions=vf(r),this.schema=z5(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((r,e)=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:tl(e.name,this.schema)},n=se(e,"addCommands",t);return n?{...r,...n()}:r},{})}get plugins(){const{editor:r}=this;return Qa([...this.extensions].reverse()).flatMap(n=>{const i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:r,type:tl(n.name,this.schema)},s=[],o=se(n,"addKeyboardShortcuts",i);let a={};if(n.type==="mark"&&se(n,"exitable",i)&&(a.ArrowRight=()=>Oi.handleExit({editor:r,mark:n})),o){const h=Object.fromEntries(Object.entries(o()).map(([f,m])=>[f,()=>m({editor:r})]));a={...a,...h}}const l=$y(a);s.push(l);const u=se(n,"addInputRules",i);if(xf(n,r.options.enableInputRules)&&u){const h=u();if(h&&h.length){const f=b3({editor:r,rules:h}),m=Array.isArray(f)?f:[f];s.push(...m)}}const c=se(n,"addPasteRules",i);if(xf(n,r.options.enablePasteRules)&&c){const h=c();if(h&&h.length){const f=C3({editor:r,rules:h});s.push(...f)}}const d=se(n,"addProseMirrorPlugins",i);if(d){const h=d();s.push(...h)}return s})}get attributes(){return hf(this.extensions)}get nodeViews(){const{editor:r}=this,{nodeExtensions:e}=Bn(this.extensions);return Object.fromEntries(e.filter(t=>!!se(t,"addNodeView")).map(t=>{const n=this.attributes.filter(l=>l.type===t.name),i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:r,type:qe(t.name,this.schema)},s=se(t,"addNodeView",i);if(!s)return[];const o=s();if(!o)return[];const a=(l,u,c,d,h)=>{const f=Ai(l,n);return o({node:l,view:u,getPos:c,decorations:d,innerDecorations:h,editor:r,extension:t,HTMLAttributes:f})};return[t.name,a]}))}get markViews(){const{editor:r}=this,{markExtensions:e}=Bn(this.extensions);return Object.fromEntries(e.filter(t=>!!se(t,"addMarkView")).map(t=>{const n=this.attributes.filter(a=>a.type===t.name),i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:r,type:fr(t.name,this.schema)},s=se(t,"addMarkView",i);if(!s)return[];const o=(a,l,u)=>{const c=Ai(a,n);return s()({mark:a,view:l,inline:u,editor:r,extension:t,HTMLAttributes:c,updateAttributes:d=>{F3(a,r,d)}})};return[t.name,o]}))}setupExtensions(){const r=this.extensions;this.editor.extensionStorage=Object.fromEntries(r.map(e=>[e.name,e.storage])),r.forEach(e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:tl(e.name,this.schema)};e.type==="mark"&&((t=Ce(se(e,"keepOnSplit",n)))==null||t)&&this.splittableMarks.push(e.name);const i=se(e,"onBeforeCreate",n),s=se(e,"onCreate",n),o=se(e,"onUpdate",n),a=se(e,"onSelectionUpdate",n),l=se(e,"onTransaction",n),u=se(e,"onFocus",n),c=se(e,"onBlur",n),d=se(e,"onDestroy",n);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}};_s.resolve=vf,_s.sort=Qa,_s.flatten=Xa;var E3={};Ua(E3,{ClipboardTextSerializer:()=>Ef,Commands:()=>Af,Delete:()=>Of,Drop:()=>Nf,Editable:()=>Df,FocusEvents:()=>Rf,Keymap:()=>Pf,Paste:()=>zf,Tabindex:()=>Lf,TextDirection:()=>Bf,focusEventsPluginKey:()=>If});var Se=class k1 extends ol{constructor(){super(...arguments),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new k1(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},Ef=Se.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Be({key:new Ve("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:e,schema:t}=r,{doc:n,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(c=>c.$from.pos)),a=Math.max(...s.map(c=>c.$to.pos)),l=el(t);return yf(n,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),Af=Se.create({name:"commands",addCommands(){return{...rf}}}),Of=Se.create({name:"delete",onUpdate({transaction:r,appendedTransactions:e}){var t,n,i;const s=()=>{var o,a,l,u;if((u=(l=(a=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,r))!=null?u:r.getMeta("y-sync$"))return;const c=N5(r.before,[r,...e]);V5(c).forEach(f=>{c.mapping.mapResult(f.oldRange.from).deletedAfter&&c.mapping.mapResult(f.oldRange.to).deletedBefore&&c.before.nodesBetween(f.oldRange.from,f.oldRange.to,(m,v)=>{const y=v+m.nodeSize-2,w=f.oldRange.from<=v&&y<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:v,to:y,newFrom:c.mapping.map(v),newTo:c.mapping.map(y),deletedRange:f.oldRange,newRange:f.newRange,partial:!w,editor:this.editor,transaction:r,combinedTransform:c})})});const h=c.mapping;c.steps.forEach((f,m)=>{var v,y;if(f instanceof Ft){const w=h.slice(m).map(f.from,-1),k=h.slice(m).map(f.to),E=h.invert().map(w,-1),R=h.invert().map(k),O=(v=c.doc.nodeAt(w-1))==null?void 0:v.marks.some(D=>D.eq(f.mark)),N=(y=c.doc.nodeAt(k))==null?void 0:y.marks.some(D=>D.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:E,to:R},newRange:{from:w,to:k},partial:!!(N||O),editor:this.editor,transaction:r,combinedTransform:c})}})};(i=(n=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:n.async)==null||i?setTimeout(s,0):s()}}),Nf=Se.create({name:"drop",addProseMirrorPlugins(){return[new Be({key:new Ve("tiptapDrop"),props:{handleDrop:(r,e,t,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:n})}}})]}}),Df=Se.create({name:"editable",addProseMirrorPlugins(){return[new Be({key:new Ve("editable"),props:{editable:()=>this.editor.options.editable}})]}}),If=new Ve("focusEvents"),Rf=Se.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new Be({key:If,props:{handleDOMEvents:{focus:(e,t)=>{r.isFocused=!0;const n=r.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,t)=>{r.isFocused=!1;const n=r.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),Pf=Se.create({name:"keymap",addKeyboardShortcuts(){const r=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:c,$anchor:d}=l,{pos:h,parent:f}=d,m=d.parent.isTextblock&&h>0?a.doc.resolve(h-1):d,v=m.parent.type.spec.isolating,y=d.pos-d.parentOffset,w=v&&m.parent.childCount===1?y===d.pos:le.atStart(u).from===h;return!c||!f.type.isTextblock||f.textContent.length||!w||w&&d.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:r,"Mod-Backspace":r,"Shift-Backspace":r,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},s={...n,"Ctrl-h":r,"Alt-Backspace":r,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Rs()||uf()?s:i},addProseMirrorPlugins(){return[new Be({key:new Ve("clearDocument"),appendTransaction:(r,e,t)=>{if(r.some(v=>v.getMeta("composition")))return;const n=r.some(v=>v.docChanged)&&!e.doc.eq(t.doc),i=r.some(v=>v.getMeta("preventClearDocument"));if(!n||i)return;const{empty:s,from:o,to:a}=e.selection,l=le.atStart(e.doc).from,u=le.atEnd(e.doc).to;if(s||!(o===l&&a===u)||!Fs(t.doc))return;const h=t.tr,f=Ns({state:t,transaction:h}),{commands:m}=new Ds({editor:this.editor,state:f});if(m.clearNodes(),!!h.steps.length)return h}})]}}),zf=Se.create({name:"paste",addProseMirrorPlugins(){return[new Be({key:new Ve("tiptapPaste"),props:{handlePaste:(r,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Lf=Se.create({name:"tabindex",addProseMirrorPlugins(){return[new Be({key:new Ve("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Bf=Se.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:r}=Bn(this.extensions);return[{types:r.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Be({key:new Ve("textDirection"),props:{attributes:()=>{const r=this.options.direction;return r?{dir:r}:{}}}})]}}),A3=class Zn{constructor(e,t,n=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new Zn(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Zn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Zn(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,n)=>{const i=t.isBlock&&!t.isTextblock,s=t.isAtom&&!t.isText,o=this.pos+n+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(o);if(!i&&a.depth<=this.depth)return;const l=new Zn(a,this.editor,i,i?t:null);i&&(l.actualDepth=this.depth+1),e.push(new Zn(a,this.editor,i,i?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,i=this.parent;for(;i&&!n;){if(i.node.type.name===e)if(Object.keys(t).length>0){const s=i.node.attrs,o=Object.keys(t);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==t[l])break}}else n=i;i=i.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(t);return this.children.forEach(o=>{n&&i.length>0||(o.node.type.name===e&&s.every(l=>t[l]===o.node.attrs[l])&&i.push(o),!(n&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,t,n))))}),i}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},O3=`.ProseMirror {
|
|
530
|
+
`},Tc=D2(z2)(kc),L2={config:I2},B2=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(i){return t.reduceRight(function(s,o){return o(s)},i)}};function Cc(r,e){return Object.keys(e).forEach(function(t){e[t]instanceof Object&&r[t]&&Object.assign(e[t],Cc(r[t],e[t]))}),wc(wc({},r),e)}var F2={type:"cancelation",msg:"operation is manually canceled"};function ja(r){var e=!1,t=new Promise(function(n,i){r.then(function(s){return e?i(F2):n(s)}),r.catch(i)});return t.cancel=function(){return e=!0},t}var $2=["monaco"],H2=O2.create({config:N2,isInitialized:!1,resolve:null,reject:null,monaco:null}),Mc=d2(H2,2),Fi=Mc[0],_s=Mc[1];function j2(r){var e=L2.config(r),t=e.monaco,n=u2(e,$2);_s(function(i){return{config:Cc(i.config,n),monaco:t}})}function _2(){var r=Fi(function(e){var t=e.monaco,n=e.isInitialized,i=e.resolve;return{monaco:t,isInitialized:n,resolve:i}});if(!r.isInitialized){if(_s({isInitialized:!0}),r.monaco)return r.resolve(r.monaco),ja(_a);if(window.monaco&&window.monaco.editor)return Ec(window.monaco),r.resolve(window.monaco),ja(_a);B2(V2,W2)(U2)}return ja(_a)}function V2(r){return document.body.appendChild(r)}function q2(r){var e=document.createElement("script");return r&&(e.src=r),e}function W2(r){var e=Fi(function(n){var i=n.config,s=n.reject;return{config:i,reject:s}}),t=q2("".concat(e.config.paths.vs,"/loader.js"));return t.onload=function(){return r()},t.onerror=e.reject,t}function U2(){var r=Fi(function(t){var n=t.config,i=t.resolve,s=t.reject;return{config:n,resolve:i,reject:s}}),e=window.require;e.config(r.config),e(["vs/editor/editor.main"],function(t){var n=t.m||t;Ec(n),r.resolve(n)},function(t){r.reject(t)})}function Ec(r){Fi().monaco||_s({monaco:r})}function K2(){return Fi(function(r){var e=r.monaco;return e})}var _a=new Promise(function(r,e){return _s({resolve:r,reject:e})}),Ac={config:j2,init:_2,__getMonacoInstance:K2},G2={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Va=G2,J2={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Y2=J2;function X2({children:r}){return B.createElement("div",{style:Y2.container},r)}var Z2=X2,Q2=Z2;function ev({width:r,height:e,isEditorReady:t,loading:n,_ref:i,className:s,wrapperProps:o}){return B.createElement("section",{style:{...Va.wrapper,width:r,height:e},...o},!t&&B.createElement(Q2,null,n),B.createElement("div",{ref:i,style:{...Va.fullWidth,...!t&&Va.hide},className:s}))}var tv=ev,Oc=B.memo(tv);function rv(r){B.useEffect(r,[])}var Nc=rv;function nv(r,e,t=!0){let n=B.useRef(!0);B.useEffect(n.current||!t?()=>{n.current=!1}:r,e)}var Ot=nv;function $i(){}function qn(r,e,t,n){return iv(r,n)||sv(r,e,t,n)}function iv(r,e){return r.editor.getModel(Dc(r,e))}function sv(r,e,t,n){return r.editor.createModel(e,t,n?Dc(r,n):void 0)}function Dc(r,e){return r.Uri.parse(e)}function ov({original:r,modified:e,language:t,originalLanguage:n,modifiedLanguage:i,originalModelPath:s,modifiedModelPath:o,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:u="light",loading:c="Loading...",options:d={},height:h="100%",width:f="100%",className:m,wrapperProps:v={},beforeMount:y=$i,onMount:w=$i}){let[k,E]=B.useState(!1),[I,A]=B.useState(!0),N=B.useRef(null),P=B.useRef(null),L=B.useRef(null),z=B.useRef(w),F=B.useRef(y),re=B.useRef(!1);Nc(()=>{let G=Ac.init();return G.then(ee=>(P.current=ee)&&A(!1)).catch(ee=>ee?.type!=="cancelation"&&console.error("Monaco initialization: error:",ee)),()=>N.current?ae():G.cancel()}),Ot(()=>{if(N.current&&P.current){let G=N.current.getOriginalEditor(),ee=qn(P.current,r||"",n||t||"text",s||"");ee!==G.getModel()&&G.setModel(ee)}},[s],k),Ot(()=>{if(N.current&&P.current){let G=N.current.getModifiedEditor(),ee=qn(P.current,e||"",i||t||"text",o||"");ee!==G.getModel()&&G.setModel(ee)}},[o],k),Ot(()=>{let G=N.current.getModifiedEditor();G.getOption(P.current.editor.EditorOption.readOnly)?G.setValue(e||""):e!==G.getValue()&&(G.executeEdits("",[{range:G.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),G.pushUndoStop())},[e],k),Ot(()=>{N.current?.getModel()?.original.setValue(r||"")},[r],k),Ot(()=>{let{original:G,modified:ee}=N.current.getModel();P.current.editor.setModelLanguage(G,n||t||"text"),P.current.editor.setModelLanguage(ee,i||t||"text")},[t,n,i],k),Ot(()=>{P.current?.editor.setTheme(u)},[u],k),Ot(()=>{N.current?.updateOptions(d)},[d],k);let oe=B.useCallback(()=>{if(!P.current)return;F.current(P.current);let G=qn(P.current,r||"",n||t||"text",s||""),ee=qn(P.current,e||"",i||t||"text",o||"");N.current?.setModel({original:G,modified:ee})},[t,e,i,r,n,s,o]),ye=B.useCallback(()=>{!re.current&&L.current&&(N.current=P.current.editor.createDiffEditor(L.current,{automaticLayout:!0,...d}),oe(),P.current?.editor.setTheme(u),E(!0),re.current=!0)},[d,u,oe]);B.useEffect(()=>{k&&z.current(N.current,P.current)},[k]),B.useEffect(()=>{!I&&!k&&ye()},[I,k,ye]);function ae(){let G=N.current?.getModel();a||G?.original?.dispose(),l||G?.modified?.dispose(),N.current?.dispose()}return B.createElement(Oc,{width:f,height:h,isEditorReady:k,loading:c,_ref:L,className:m,wrapperProps:v})}var av=ov;B.memo(av);function lv(r){let e=B.useRef();return B.useEffect(()=>{e.current=r},[r]),e.current}var uv=lv,Vs=new Map;function cv({defaultValue:r,defaultLanguage:e,defaultPath:t,value:n,language:i,path:s,theme:o="light",line:a,loading:l="Loading...",options:u={},overrideServices:c={},saveViewState:d=!0,keepCurrentModel:h=!1,width:f="100%",height:m="100%",className:v,wrapperProps:y={},beforeMount:w=$i,onMount:k=$i,onChange:E,onValidate:I=$i}){let[A,N]=B.useState(!1),[P,L]=B.useState(!0),z=B.useRef(null),F=B.useRef(null),re=B.useRef(null),oe=B.useRef(k),ye=B.useRef(w),ae=B.useRef(),G=B.useRef(n),ee=uv(s),ke=B.useRef(!1),se=B.useRef(!1);Nc(()=>{let x=Ac.init();return x.then(D=>(z.current=D)&&L(!1)).catch(D=>D?.type!=="cancelation"&&console.error("Monaco initialization: error:",D)),()=>F.current?C():x.cancel()}),Ot(()=>{let x=qn(z.current,r||n||"",e||i||"",s||t||"");x!==F.current?.getModel()&&(d&&Vs.set(ee,F.current?.saveViewState()),F.current?.setModel(x),d&&F.current?.restoreViewState(Vs.get(s)))},[s],A),Ot(()=>{F.current?.updateOptions(u)},[u],A),Ot(()=>{!F.current||n===void 0||(F.current.getOption(z.current.editor.EditorOption.readOnly)?F.current.setValue(n):n!==F.current.getValue()&&(se.current=!0,F.current.executeEdits("",[{range:F.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),F.current.pushUndoStop(),se.current=!1))},[n],A),Ot(()=>{let x=F.current?.getModel();x&&i&&z.current?.editor.setModelLanguage(x,i)},[i],A),Ot(()=>{a!==void 0&&F.current?.revealLine(a)},[a],A),Ot(()=>{z.current?.editor.setTheme(o)},[o],A);let Te=B.useCallback(()=>{if(!(!re.current||!z.current)&&!ke.current){ye.current(z.current);let x=s||t,D=qn(z.current,n||r||"",e||i||"",x||"");F.current=z.current?.editor.create(re.current,{model:D,automaticLayout:!0,...u},c),d&&F.current.restoreViewState(Vs.get(x)),z.current.editor.setTheme(o),a!==void 0&&F.current.revealLine(a),N(!0),ke.current=!0}},[r,e,t,n,i,s,u,c,d,o,a]);B.useEffect(()=>{A&&oe.current(F.current,z.current)},[A]),B.useEffect(()=>{!P&&!A&&Te()},[P,A,Te]),G.current=n,B.useEffect(()=>{A&&E&&(ae.current?.dispose(),ae.current=F.current?.onDidChangeModelContent(x=>{se.current||E(F.current.getValue(),x)}))},[A,E]),B.useEffect(()=>{if(A){let x=z.current.editor.onDidChangeMarkers(D=>{let q=F.current.getModel()?.uri;if(q&&D.find(J=>J.path===q.path)){let J=z.current.editor.getModelMarkers({resource:q});I?.(J)}});return()=>{x?.dispose()}}return()=>{}},[A,I]);function C(){ae.current?.dispose(),h?d&&Vs.set(s,F.current.saveViewState()):F.current.getModel()?.dispose(),F.current.dispose()}return B.createElement(Oc,{width:f,height:m,isEditorReady:A,loading:l,_ref:re,className:v,wrapperProps:y})}var dv=cv,fv=B.memo(dv);const hv={automaticLayout:!0,minimap:{enabled:!1},wordWrap:"on",insertSpaces:!0,tabSize:2,padding:{top:10,bottom:10}},Pc=({content:r,onChange:e})=>{const t=B.useRef(null),n=B.useRef(null),i=B.useRef(null),[,s]=B.useState(!1),[,o]=B.useState(!1);B.useEffect(()=>()=>{n.current?.dispose?.(),i.current&&clearTimeout(i.current)},[]);const a=c=>{t.current=c,n.current?.dispose?.(),n.current=c.onDidChangeModelContent(()=>{l()}),l()},l=()=>{const c=t.current?.getModel?.();if(c&&typeof c.canUndo=="function"&&typeof c.canRedo=="function")try{s(c.canUndo()),o(c.canRedo());return}catch{}const d=!!t.current;s(d),o(d)},u=c=>{e(c)};return X.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:X.jsx("div",{style:{flex:1},children:X.jsx(fv,{options:hv,height:"100%",language:"xml",value:r,onMount:a,onChange:c=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{u(c||"")},500)}})})})};function it(r){this.content=r}it.prototype={constructor:it,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),s=n.content.slice();return i==-1?s.push(t||r,e):(s[i+1]=e,t&&(s[i]=t)),new it(s)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new it(t)},addToStart:function(r,e){return new it([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new it(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),s=n.find(r);return i.splice(s==-1?i.length:s,0,e,t),new it(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=it.from(r),r.size?new it(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=it.from(r),r.size?new it(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=it.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}},it.from=function(r){if(r instanceof it)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new it(e)};function Ic(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=Ic(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Rc(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,n-=l;continue}if(!o.sameMarkup(a))return{a:t,b:n};if(o.isText&&o.text!=a.text){let u=0,c=Math.min(o.text.length,a.text.length);for(;u<c&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,t--,n--;return{a:t,b:n}}if(o.content.size||a.content.size){let u=Rc(o.content,a.content,t-1,n-1);if(u)return u}t-=l,n-=l}}class j{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,s){for(let o=0,a=0;a<t;o++){let l=this.content[o],u=a+l.nodeSize;if(u>e&&n(l,i+a,s||null,o)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,t-c),n,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&n&&(o?o=!1:s+=n),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new j(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),n.push(a),i+=a.nodeSize),o=l}return new j(n,i)}cutByIndex(e,t){return e==t?j.empty:e==0&&t==this.content.length?this:new j(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new j(i,s)}addToStart(e){return new j([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new j(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Ic(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Rc(this,e,t,n)}findIndex(e){if(e==0)return qs(0,e);if(e==this.size)return qs(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),s=n+i.nodeSize;if(s>=e)return s==e?qs(t+1,s):qs(t,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return j.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new j(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return j.empty;let t,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new j(t||e,n)}static from(e){if(!e)return j.empty;if(e instanceof j)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new j([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}j.empty=new j([],0);const qa={index:0,offset:0};function qs(r,e){return qa.index=r,qa.offset=e,qa}function Ws(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!Ws(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!Ws(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let Re=class zu{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ws(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return zu.none;if(e instanceof zu)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};Re.none=[];class Us extends Error{}class Z{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Lc(this.content,e+this.openStart,t);return n&&new Z(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Z(zc(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return Z.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Z(j.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new Z(e,n,i)}}Z.empty=new Z(j.empty,0,0);function zc(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:a}=r.findIndex(t);if(i==e||s.isText){if(a!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(zc(s.content,e-i-1,t-i-1)))}function Lc(r,e,t,n){let{index:i,offset:s}=r.findIndex(e),o=r.maybeChild(i);if(s==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let a=Lc(o.content,e-s-1,t,o);return a&&r.replaceChild(i,o.copy(a))}function pv(r,e,t){if(t.openStart>r.depth)throw new Us("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new Us("Inconsistent open depths");return Bc(r,e,t,0)}function Bc(r,e,t,n){let i=r.index(n),s=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=Bc(r,e,t,n+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,a=o.content;return vn(o,a.cut(0,r.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=mv(t,r);return vn(s,$c(r,o,a,e,n))}else return vn(s,Ks(r,e,n))}function Fc(r,e){if(!e.type.compatibleContent(r.type))throw new Us("Cannot join "+e.type.name+" onto "+r.type.name)}function Wa(r,e,t){let n=r.node(t);return Fc(n,e.node(t)),n}function gn(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function Hi(r,e,t,n){let i=(e||r).node(t),s=0,o=e?e.index(t):i.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(gn(r.nodeAfter,n),s++));for(let a=s;a<o;a++)gn(i.child(a),n);e&&e.depth==t&&e.textOffset&&gn(e.nodeBefore,n)}function vn(r,e){return r.type.checkContent(e),r.copy(e)}function $c(r,e,t,n,i){let s=r.depth>i&&Wa(r,e,i+1),o=n.depth>i&&Wa(t,n,i+1),a=[];return Hi(null,r,i,a),s&&o&&e.index(i)==t.index(i)?(Fc(s,o),gn(vn(s,$c(r,e,t,n,i+1)),a)):(s&&gn(vn(s,Ks(r,e,i+1)),a),Hi(e,t,i,a),o&&gn(vn(o,Ks(t,n,i+1)),a)),Hi(n,null,i,a),new j(a)}function Ks(r,e,t){let n=[];if(Hi(null,r,t,n),r.depth>t){let i=Wa(r,e,t+1);gn(vn(i,Ks(r,e,t+1)),n)}return Hi(e,null,t,n),new j(n)}function mv(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(j.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class ji{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=n.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Re.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let a=n;n=i,i=a}let s=n.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<n.length;s++)n[s].type.spec.inclusive===!1&&(!i||!n[s].isInSet(i.marks))&&(n=n[s--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Gs(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),u=s-l;if(n.push(o,a,i+l),!u||(o=o.child(a),o.isText))break;s=u-1,i+=l+1}return new ji(t,n,s)}static resolveCached(e,t){let n=Hc.get(e);if(n)for(let s=0;s<n.elts.length;s++){let o=n.elts[s];if(o.pos==t)return o}else Hc.set(e,n=new gv);let i=n.elts[n.i]=ji.resolve(e,t);return n.i=(n.i+1)%vv,i}}class gv{constructor(){this.elts=[],this.i=0}}const vv=12,Hc=new WeakMap;class Gs{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const yv=Object.create(null);let jr=class Lu{constructor(e,t,n,i=Re.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||j.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Ws(this.attrs,t||e.defaultAttrs||yv)&&Re.sameSet(this.marks,n||Re.none)}copy(e=null){return e==this.content?this:new Lu(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Lu(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Z.empty;let i=this.resolve(e),s=this.resolve(t),o=n?0:i.sharedDepth(t),a=i.start(o),u=i.node(o).content.cut(i.pos-a,s.pos-a);return new Z(u,i.depth-o,s.depth-o)}replace(e,t,n){return pv(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return ji.resolveCached(this,e)}resolveNoCache(e){return ji.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),jc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=j.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(n),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Re.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Re.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=j.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,n);return s.type.checkAttrs(s.attrs),s}};jr.prototype.text=void 0;let bv=class Bu extends jr{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):jc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Bu(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Bu(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function jc(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class yn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new wv(e,t);if(n.next==null)return yn.empty;let i=_c(n);n.next&&n.err("Unexpected trailing text");let s=Ev(Mv(i));return Av(s,n),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let s=t;i&&s<n;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function s(o,a){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return j.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:c,next:d}=o.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let h=s(d,a.concat(c));if(h)return h}}return null}return s(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(n.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)s+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return s}).join(`
|
|
531
|
+
`)}}yn.empty=new yn(!0);class wv{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function _c(r){let e=[];do e.push(xv(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function xv(r){let e=[];do e.push(Sv(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Sv(r){let e=Cv(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=kv(r,e);else break;return e}function Vc(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function kv(r,e){let t=Vc(r),n=t;return r.eat(",")&&(r.next!="}"?n=Vc(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function Tv(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let s in t){let o=t[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function Cv(r){if(r.eat("(")){let e=_c(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=Tv(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Mv(r){let e=[[]];return i(s(r,0),t()),e;function t(){return e.push([])-1}function n(o,a,l){let u={term:l,to:a};return e[o].push(u),u}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(s(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=s(o.exprs[l],a);if(l==o.exprs.length-1)return u;i(u,a=t())}else if(o.type=="star"){let l=t();return n(a,l),i(s(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=t();return i(s(o.expr,a),l),i(s(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u<o.min;u++){let c=t();i(s(o.expr,l),c),l=c}if(o.max==-1)i(s(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let c=t();n(l,c),i(s(o.expr,l),c),l=c}return[n(l)]}else{if(o.type=="name")return[n(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function qc(r,e){return e-r}function Wc(r,e){let t=[];return n(e),t.sort(qc);function n(i){let s=r[i];if(s.length==1&&!s[0].term)return n(s[0].to);t.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&t.indexOf(l)==-1&&n(l)}}}function Ev(r){let e=Object.create(null);return t(Wc(r,0));function t(n){let i=[];n.forEach(o=>{r[o].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c<i.length;c++)i[c][0]==a&&(u=i[c][1]);Wc(r,l).forEach(c=>{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=e[n.join(",")]=new yn(n.indexOf(r.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(qc);s.next.push({type:i[o][0],next:e[a.join(",")]||t(a)})}return s}}function Av(r,e){for(let t=0,n=[r];t<n.length;t++){let i=n[t],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:u}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),n.indexOf(u)==-1&&n.push(u)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Uc(r){let e=Object.create(null);for(let t in r){let n=r[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function Kc(r,e){let t=Object.create(null);for(let n in r){let i=e&&e[n];if(i===void 0){let s=r[n];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=i}return t}function Gc(r,e,t,n){for(let i in e)if(!(i in r))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in r){let s=r[i];s.validate&&s.validate(e[i])}}function Jc(r,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Nv(r,n,e[n]);return t}let Yc=class Dg{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Jc(e,n.attrs),this.defaultAttrs=Uc(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==yn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Kc(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new jr(this,this.computeAttrs(e),j.from(t),Re.setFrom(n))}createChecked(e=null,t,n){return t=j.from(t),this.checkContent(t),new jr(this,this.computeAttrs(e),t,Re.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=j.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(j.empty,!0);return s?new jr(this,e,t.append(s),Re.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Gc(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Re.none:e}static compile(e,t){let n=Object.create(null);e.forEach((s,o)=>n[s]=new Dg(s,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function Ov(r,e,t){let n=t.split("|");return i=>{let s=i===null?"null":typeof i;if(n.indexOf(s)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${s}`)}}class Nv{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?Ov(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Js{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=Jc(e,i.attrs),this.excluded=null;let s=Uc(this.attrs);this.instance=s?new Re(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Re(this,Kc(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((s,o)=>n[s]=new Js(s,i++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Gc(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Xc{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=it.from(e.nodes),t.marks=it.from(e.marks||{}),this.nodes=Yc.compile(this.spec.nodes,this),this.marks=Js.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=n[o]||(n[o]=yn.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?Zc(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Zc(this,o.split(" "))}this.nodeFromJSON=i=>jr.fromJSON(this,i),this.markFromJSON=i=>Re.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Yc){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new bv(n,n.defaultAttrs,e,Re.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Zc(r,e){let t=[];for(let n=0;n<e.length;n++){let i=e[n],s=r.marks[i],o=s;if(s)t.push(s);else for(let a in r.marks){let l=r.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function Dv(r){return r.tag!=null}function Pv(r){return r.style!=null}class _r{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(Dv(i))this.tags.push(i);else if(Pv(i)){let s=/[^=]*/.exec(i.style)[0];n.indexOf(s)<0&&n.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let n=new rd(this,t,!1);return n.addAll(e,Re.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new rd(this,t,!0);return n.addAll(e,Re.none,t.from,t.to),Z.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(zv(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,n,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let a=t[o];if((a.priority==null?50:a.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{n(o=nd(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=nd(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new _r(e,_r.schemaRules(e)))}}const Qc={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},Iv={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ed={ol:!0,ul:!0},_i=1,Ua=2,Vi=4;function td(r,e,t){return e!=null?(e?_i:0)|(e==="full"?Ua:0):r&&r.whitespace=="pre"?_i|Ua:t&~Vi}class Ys{constructor(e,t,n,i,s,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=Re.none,this.match=s||(o&Vi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(j.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&_i)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=j.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(j.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Qc.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class rd{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=td(null,t.preserveWhitespace,0)|(n?Vi:0);i?s=new Ys(i.type,i.attrs,Re.none,!0,t.topMatch||i.type.contentMatch,o):n?s=new Ys(null,null,Re.none,!0,null,o):s=new Ys(e.schema.topNodeType,null,Re.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,i=this.top,s=i.options&Ua?"full":this.localPreserveWS||(i.options&_i)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(s)if(s==="full")n=n.replace(/\r\n?/g,`
|
|
532
|
+
`);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=n.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),t,!0),a[l]&&this.insertNode(o.text(a[l]),t,!/\S/.test(a[l]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;ed.hasOwnProperty(o)&&this.parser.normalizeLists&&Rv(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,n));e:if(l?l.ignore:Iv.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,c=this.needsBlock;if(Qc.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),u=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=l&&l.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),u&&this.sync(s),this.needsBlock=c}else{let u=this.readStyles(e,t);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
533
|
+
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=n.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(u=>!l.clearMark(u)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,n,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,t.attrs||null,n,t.preserveWhitespace);l&&(s=!0,n=l)}else{let l=this.parser.schema.marks[t.mark];n=n.concat(l.create(t.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,t,n,i){let s=n||0;for(let o=n?e.childNodes[n]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,n){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+a)&&(i=u,s=l,!u.length))break;if(l.solid){if(n)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=Re.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):id(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,t,n,i){let s=this.findPlace(e.create(t),n,!1);return s&&(s=this.enterInner(e,t,n,!0,i)),s}enterInner(e,t,n,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=td(e,s,o.options);o.options&Vi&&o.content.length==0&&(a|=Vi);let l=Re.none;return n=n.filter(u=>(o.type?o.type.allowsMarkType(u.type):id(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Ys(e,t,l,i,null,a)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=_i)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let u=t[a];if(u==""){if(a==t.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:n&&l>=s?n.node(l-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function Rv(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&ed.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function zv(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function nd(r){let e={};for(let t in r)e[t]=r[t];return e}function id(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:c}=a.edge(l);if(u==e||s.indexOf(c)<0&&o(c))return!0}};if(o(i.contentMatch))return!0}}class bn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Ka(t).createDocumentFragment());let i=n,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(s[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],c=this.serializeMark(u,o.isInline,t);c&&(s.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=Xs(Ka(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&Xs(Ka(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return Xs(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new bn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=sd(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return sd(e.marks)}}function sd(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function Ka(r){return r.document||window.document}const od=new WeakMap;function Lv(r){let e=od.get(r);return e===void 0&&od.set(r,e=Bv(r)),e}function Bv(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)t(n[i]);else for(let i in n)t(n[i])}return t(r),e}function Xs(r,e,t,n){if(typeof e=="string")return{dom:r.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(s=Lv(n))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let a,l=t?r.createElementNS(t,i):r.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let h=d.indexOf(" ");h>0?l.setAttributeNS(d.slice(0,h),d.slice(h+1),u[d]):d=="style"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:m}=Xs(r,h,t,n);if(l.appendChild(f),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const ad=65535,ld=Math.pow(2,16);function Fv(r,e){return r+e*ld}function ud(r){return r&ad}function $v(r){return(r-(r&ad))/ld}const cd=1,dd=2,Zs=4,fd=8;class Ga{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&fd)>0}get deletedBefore(){return(this.delInfo&(cd|Zs))>0}get deletedAfter(){return(this.delInfo&(dd|Zs))>0}get deletedAcross(){return(this.delInfo&Zs)>0}}class Nt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Nt.empty)return Nt.empty}recover(e){let t=0,n=ud(e);if(!this.inverted)for(let i=0;i<n;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+t+$v(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+s],c=this.ranges[a+o],d=l+u;if(e<=d){let h=u?e==l?-1:e==d?1:t:t,f=l+i+(h<0?0:c);if(n)return f;let m=e==(t<0?l:d)?null:Fv(a/3,e-l),v=e==l?dd:e==d?cd:Zs;return(t<0?e!=l:e!=d)&&(v|=fd),new Ga(f,v,m)}i+=c-u}return n?e+i:new Ga(e+i,0,null)}touches(e,t){let n=0,i=ud(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;let u=this.ranges[a+s],c=l+u;if(e<=c&&a==i*3)return!0;n+=this.ranges[a+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+t],c=this.ranges[i+n];e(a,a+u,l,l+c),s+=c-u}}invert(){return new Nt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Nt.empty:new Nt(e<0?[0,-e,0]:[0,0,e])}}Nt.empty=new Nt([]);class qi{constructor(e,t,n=0,i=e?e.length:0){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new qi(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?n+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new qi;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,t);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return n?e:new Ga(e,i,null)}}const Ja=Object.create(null);class ut{getMap(){return Nt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Ja[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Ja)throw new RangeError("Duplicate use of step JSON ID "+e);return Ja[e]=t,t.prototype.jsonID=e,t}}class Je{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Je(e,null)}static fail(e){return new Je(null,e)}static fromReplace(e,t,n,i){try{return Je.ok(e.replace(t,n,i))}catch(s){if(s instanceof Us)return Je.fail(s.message);throw s}}}function Ya(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let s=r.child(i);s.content.size&&(s=s.copy(Ya(s.content,e,s))),s.isInline&&(s=e(s,t,i)),n.push(s)}return j.fromArray(n)}class Vr extends ut{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),s=new Z(Ya(t.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return Je.fromReplace(e,this.from,this.to,s)}invert(){return new Kt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Vr(t.pos,n.pos,this.mark)}merge(e){return e instanceof Vr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Vr(t.from,t.to,e.markFromJSON(t.mark))}}ut.jsonID("addMark",Vr);class Kt extends ut{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new Z(Ya(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Je.fromReplace(e,this.from,this.to,n)}invert(){return new Vr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Kt(t.pos,n.pos,this.mark)}merge(e){return e instanceof Kt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Kt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Kt(t.from,t.to,e.markFromJSON(t.mark))}}ut.jsonID("removeMark",Kt);class qr extends ut{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Je.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Je.fromReplace(e,this.pos,this.pos+1,new Z(j.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(n))return new qr(this.pos,t.marks[i]);return new qr(this.pos,this.mark)}}return new wn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new qr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new qr(t.pos,e.markFromJSON(t.mark))}}ut.jsonID("addNodeMark",qr);class wn extends ut{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Je.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Je.fromReplace(e,this.pos,this.pos+1,new Z(j.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new qr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new wn(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new wn(t.pos,e.markFromJSON(t.mark))}}ut.jsonID("removeNodeMark",wn);class et extends ut{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&Xa(e,this.from,this.to)?Je.fail("Structure replace would overwrite content"):Je.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Nt([this.from,this.to-this.from,this.slice.size])}invert(e){return new et(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new et(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof et)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?Z.empty:new Z(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new et(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?Z.empty:new Z(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new et(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new et(t.from,t.to,Z.fromJSON(e,t.slice),!!t.structure)}}ut.jsonID("replace",et);class tt extends ut{constructor(e,t,n,i,s,o,a=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(Xa(e,this.from,this.gapFrom)||Xa(e,this.gapTo,this.to)))return Je.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Je.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Je.fromReplace(e,this.from,this.to,n):Je.fail("Content does not fit in gap")}getMap(){return new Nt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new tt(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||s>n.pos?null:new tt(t.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new tt(t.from,t.to,t.gapFrom,t.gapTo,Z.fromJSON(e,t.slice),t.insert,!!t.structure)}}ut.jsonID("replaceAround",tt);function Xa(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Hv(r,e,t,n){let i=[],s=[],o,a;r.doc.nodesBetween(e,t,(l,u,c)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&c.type.allowsMarkType(n.type)){let h=Math.max(u,e),f=Math.min(u+l.nodeSize,t),m=n.addToSet(d);for(let v=0;v<d.length;v++)d[v].isInSet(m)||(o&&o.to==h&&o.mark.eq(d[v])?o.to=f:i.push(o=new Kt(h,f,d[v])));a&&a.to==h?a.to=f:s.push(a=new Vr(h,f,n))}}),i.forEach(l=>r.step(l)),s.forEach(l=>r.step(l))}function jv(r,e,t,n){let i=[],s=0;r.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(n instanceof Js){let u=o.marks,c;for(;c=n.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let u=Math.min(a+o.nodeSize,t);for(let c=0;c<l.length;c++){let d=l[c],h;for(let f=0;f<i.length;f++){let m=i[f];m.step==s-1&&d.eq(i[f].style)&&(h=m)}h?(h.to=u,h.step=s):i.push({style:d,from:Math.max(a,e),to:u,step:s})}}}),i.forEach(o=>r.step(new Kt(o.from,o.to,o.style)))}function Za(r,e,t,n=t.contentMatch,i=!0){let s=r.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let u=s.child(l),c=a+u.nodeSize,d=n.matchType(u.type);if(!d)o.push(new et(a,c,Z.empty));else{n=d;for(let h=0;h<u.marks.length;h++)t.allowsMarkType(u.marks[h].type)||r.step(new Kt(a,c,u.marks[h]));if(i&&u.isText&&t.whitespace!="pre"){let h,f=/\r?\n|\r/g,m;for(;h=f.exec(u.text);)m||(m=new Z(j.from(t.schema.text(" ",t.allowedMarks(u.marks))),0,0)),o.push(new et(a+h.index,a+h.index+h[0].length,m))}}a=c}if(!n.validEnd){let l=n.fillBefore(j.empty,!0);r.replace(a,a,new Z(l,0,0))}for(let l=o.length-1;l>=0;l--)r.step(o[l])}function _v(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Wn(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth,i=0,s=0;;--n){let o=r.$from.node(n),a=r.$from.index(n)+i,l=r.$to.indexAfter(n)-s;if(n<r.depth&&o.canReplace(a,l,t))return n;if(n==0||o.type.spec.isolating||!_v(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function Vv(r,e,t){let{$from:n,$to:i,depth:s}=e,o=n.before(s+1),a=i.after(s+1),l=o,u=a,c=j.empty,d=0;for(let m=s,v=!1;m>t;m--)v||n.index(m)>0?(v=!0,c=j.from(n.node(m).copy(c)),d++):l--;let h=j.empty,f=0;for(let m=s,v=!1;m>t;m--)v||i.after(m+1)<i.end(m)?(v=!0,h=j.from(i.node(m).copy(h)),f++):u++;r.step(new tt(l,u,o,a,new Z(c.append(h),d,f),c.size-d,!0))}function Qa(r,e,t=null,n=r){let i=qv(r,e),s=i&&Wv(n,e);return s?i.map(hd).concat({type:e,attrs:t}).concat(s.map(hd)):null}function hd(r){return{type:r,attrs:null}}function qv(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.contentMatchAt(n).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(n,i,o)?s:null}function Wv(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.child(n),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=n;l&&u<i;u++)l=l.matchType(t.child(u).type);return!l||!l.validEnd?null:o}function Uv(r,e,t){let n=j.empty;for(let o=t.length-1;o>=0;o--){if(n.size){let a=t[o].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=j.from(t[o].type.create(t[o].attrs,n))}let i=e.start,s=e.end;r.step(new tt(i,s,i,s,new Z(n,0,0),t.length,!0))}function Kv(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=r.steps.length;r.doc.nodesBetween(e,t,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&Gv(r.doc,r.mapping.slice(s).map(a),n)){let u=null;if(n.schema.linebreakReplacement){let f=n.whitespace=="pre",m=!!n.contentMatch.matchType(n.schema.linebreakReplacement);f&&!m?u=!1:!f&&m&&(u=!0)}u===!1&&md(r,o,a,s),Za(r,r.mapping.slice(s).map(a,1),n,void 0,u===null);let c=r.mapping.slice(s),d=c.map(a,1),h=c.map(a+o.nodeSize,1);return r.step(new tt(d,h,d+1,h-1,new Z(j.from(n.create(l,null,o.marks)),0,0),1,!0)),u===!0&&pd(r,o,a,s),!1}})}function pd(r,e,t,n){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=r.mapping.slice(n).map(t+1+s+o.index);r.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function md(r,e,t,n){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=r.mapping.slice(n).map(t+1+s);r.replaceWith(o,o+1,e.type.schema.text(`
|
|
534
|
+
`))}})}function Gv(r,e,t){let n=r.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,t)}function Jv(r,e,t,n,i){let s=r.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(n,null,i||s.marks);if(s.isLeaf)return r.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new tt(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new Z(j.from(o),0,0),1,!0))}function yr(r,e,t=1,n){let i=r.resolve(e),s=i.depth-t,o=n&&n[n.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=t-2;u>s;u--,c--){let d=i.node(u),h=i.index(u);if(d.type.spec.isolating)return!1;let f=d.content.cutByIndex(h,d.childCount),m=n&&n[c+1];m&&(f=f.replaceChild(0,m.type.create(m.attrs)));let v=n&&n[c]||d;if(!d.canReplace(h+1,d.childCount)||!v.type.validContent(f))return!1}let a=i.indexAfter(s),l=n&&n[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function Yv(r,e,t=1,n){let i=r.doc.resolve(e),s=j.empty,o=j.empty;for(let a=i.depth,l=i.depth-t,u=t-1;a>l;a--,u--){s=j.from(i.node(a).copy(s));let c=n&&n[u];o=j.from(c?c.type.create(c.attrs,o):i.node(a).copy(o))}r.step(new et(e,e,new Z(s.append(o),t,t),!0))}function Wr(r,e){let t=r.resolve(e),n=t.index();return gd(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function Xv(r,e){e.content.size||r.type.compatibleContent(e.type);let t=r.contentMatchAt(r.childCount),{linebreakReplacement:n}=r.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==n?r.type.schema.nodes.text:s.type;if(t=t.matchType(o),!t||!r.type.allowsMarks(s.marks))return!1}return t.validEnd}function gd(r,e){return!!(r&&e&&!r.isLeaf&&Xv(r,e))}function Qs(r,e,t=-1){let n=r.resolve(e);for(let i=n.depth;;i--){let s,o,a=n.index(i);if(i==n.depth?(s=n.nodeBefore,o=n.nodeAfter):t>0?(s=n.node(i+1),a++,o=n.node(i).maybeChild(a)):(s=n.node(i).maybeChild(a-1),o=n.node(i+1)),s&&!s.isTextblock&&gd(s,o)&&n.node(i).canReplace(a,a+1))return e;if(i==0)break;e=t<0?n.before(i):n.after(i)}}function Zv(r,e,t){let n=null,{linebreakReplacement:i}=r.doc.type.schema,s=r.doc.resolve(e-t),o=s.node().type;if(i&&o.inlineContent){let c=o.whitespace=="pre",d=!!o.contentMatch.matchType(i);c&&!d?n=!1:!c&&d&&(n=!0)}let a=r.steps.length;if(n===!1){let c=r.doc.resolve(e+t);md(r,c.node(),c.before(),a)}o.inlineContent&&Za(r,e+t-1,o,s.node().contentMatchAt(s.index()),n==null);let l=r.mapping.slice(a),u=l.map(e-t);if(r.step(new et(u,l.map(e+t,-1),Z.empty,!0)),n===!0){let c=r.doc.resolve(u);pd(r,c.node(),c.before(),r.steps.length)}return r}function Qv(r,e,t){let n=r.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,t))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,t))return n.after(i+1);if(s<n.node(i).childCount)return null}return null}function vd(r,e,t){let n=r.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let o=n.depth;o>=0;o--){let a=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,l=n.index(o)+(a>0?1:0),u=n.node(o),c=!1;if(s==1)c=u.canReplace(l,l,i);else{let d=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=d&&u.canReplaceWith(l,l,d[0])}if(c)return a==0?n.pos:a<0?n.before(o+1):n.after(o+1)}return null}function eo(r,e,t=e,n=Z.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),s=r.resolve(t);return yd(i,s,n)?new et(e,t,n):new ey(i,s,n).fit()}function yd(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class ey{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=j.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=j.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new Z(s,o,a);return e>-1?new tt(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new et(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}t=s.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=el(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,d=null;if(t==1&&(o?u.matchType(o.type)||(d=u.fillBefore(j.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:a,parent:s,inject:d};if(t==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:a,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=el(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Z(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=el(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new Z(Wi(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new Z(Wi(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let v=0;v<s.length;v++)this.openFrontierNode(s[v]);let o=this.unplaced,a=n?n.content:o.content,l=o.openStart-e,u=0,c=[],{match:d,type:h}=this.frontier[t];if(i){for(let v=0;v<i.childCount;v++)c.push(i.child(v));d=d.matchFragment(i)}let f=a.size+e-(o.content.size-o.openEnd);for(;u<a.childCount;){let v=a.child(u),y=d.matchType(v.type);if(!y)break;u++,(u>1||l==0||v.content.size)&&(d=y,c.push(bd(v.mark(h.allowedMarks(v.marks)),u==1?l:0,u==a.childCount?f:-1)))}let m=u==a.childCount;m||(f=-1),this.placed=Ui(this.placed,t,j.from(c)),this.frontier[t].match=d,m&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,y=a;v<f;v++){let w=y.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),y=w.content}this.unplaced=m?e==0?Z.empty:new Z(Wi(o.content,e-1,1),e-1,f<0?o.openEnd:e-1):new Z(Wi(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!tl(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=tl(e,t,i,n,s);if(o){for(let a=t-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],c=tl(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ui(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Ui(this.placed,this.depth,j.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(j.empty,!0);t.childCount&&(this.placed=Ui(this.placed,this.frontier.length,t))}}function Wi(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(Wi(r.firstChild.content,e-1,t)))}function Ui(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(Ui(r.lastChild.content,e-1,t)))}function el(r,e){for(let t=0;t<e;t++)r=r.firstChild.content;return r}function bd(r,e,t){if(e<=0)return r;let n=r.content;return e>1&&(n=n.replaceChild(0,bd(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(j.empty,!0)))),r.copy(n)}function tl(r,e,t,n,i){let s=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let a=n.fillBefore(s.content,!0,o);return a&&!ty(t,s.content,o)?a:null}function ty(r,e,t){for(let n=t;n<e.childCount;n++)if(!r.allowsMarks(e.child(n).marks))return!0;return!1}function ry(r){return r.spec.defining||r.spec.definingForContent}function ny(r,e,t,n){if(!n.size)return r.deleteRange(e,t);let i=r.doc.resolve(e),s=r.doc.resolve(t);if(yd(i,s,n))return r.step(new et(e,t,n));let o=xd(i,s);o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let h=i.depth,f=i.pos-1;h>0;h--,f--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(h)>-1?a=h:i.before(h)==f&&o.splice(1,0,-h)}let l=o.indexOf(a),u=[],c=n.openStart;for(let h=n.content,f=0;;f++){let m=h.firstChild;if(u.push(m),f==n.openStart)break;h=m.content}for(let h=c-1;h>=0;h--){let f=u[h],m=ry(f.type);if(m&&!f.sameMarkup(i.node(Math.abs(a)-1)))c=h;else if(m||!f.type.isTextblock)break}for(let h=n.openStart;h>=0;h--){let f=(h+c+1)%(n.openStart+1),m=u[f];if(m)for(let v=0;v<o.length;v++){let y=o[(v+l)%o.length],w=!0;y<0&&(w=!1,y=-y);let k=i.node(y-1),E=i.index(y-1);if(k.canReplaceWith(E,E,m.type,m.marks))return r.replace(i.before(y),w?s.after(y):t,new Z(wd(n.content,0,n.openStart,f),f,n.openEnd))}}let d=r.steps.length;for(let h=o.length-1;h>=0&&(r.replace(e,t,n),!(r.steps.length>d));h--){let f=o[h];f<0||(e=i.before(f),t=s.after(f))}}function wd(r,e,t,n,i){if(e<t){let s=r.firstChild;r=r.replaceChild(0,s.copy(wd(s.content,e+1,t,n,s)))}if(e>n){let s=i.contentMatchAt(0),o=s.fillBefore(r).append(r);r=o.append(s.matchFragment(o).fillBefore(j.empty,!0))}return r}function iy(r,e,t,n){if(!n.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let i=Qv(r.doc,e,n.type);i!=null&&(e=t=i)}r.replaceRange(e,t,new Z(j.from(n),0,0))}function sy(r,e,t){let n=r.doc.resolve(e),i=r.doc.resolve(t),s=xd(n,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||n.node(a).type.contentMatch.validEnd)return r.delete(n.start(a),i.end(a));if(a>0&&(l||n.node(a-1).canReplace(n.index(a-1),i.indexAfter(a-1))))return r.delete(n.before(a),i.after(a))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&i.end(o)-t!=i.depth-o&&n.start(o-1)==i.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),i.index(o-1)))return r.delete(n.before(o),t);r.delete(e,t)}function xd(r,e){let t=[],n=Math.min(r.depth,e.depth);for(let i=n;i>=0;i--){let s=r.start(i);if(s<r.pos-(r.depth-i)||e.end(i)>e.pos+(e.depth-i)||r.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==r.depth&&i==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class Un extends ut{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Je.fail("No node at attribute step's position");let n=Object.create(null);for(let s in t.attrs)n[s]=t.attrs[s];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return Je.fromReplace(e,this.pos,this.pos+1,new Z(j.from(i),0,t.isLeaf?0:1))}getMap(){return Nt.empty}invert(e){return new Un(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Un(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Un(t.pos,t.attr,t.value)}}ut.jsonID("attr",Un);class Ki extends ut{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Je.ok(n)}getMap(){return Nt.empty}invert(e){return new Ki(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ki(t.attr,t.value)}}ut.jsonID("docAttr",Ki);let Kn=class extends Error{};Kn=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t},Kn.prototype=Object.create(Error.prototype),Kn.prototype.constructor=Kn,Kn.prototype.name="TransformError";class Sd{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new qi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Kn(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=Z.empty){let i=eo(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new Z(j.from(n),0,0))}delete(e,t){return this.replace(e,t,Z.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return ny(this,e,t,n),this}replaceRangeWith(e,t,n){return iy(this,e,t,n),this}deleteRange(e,t){return sy(this,e,t),this}lift(e,t){return Vv(this,e,t),this}join(e,t=1){return Zv(this,e,t),this}wrap(e,t){return Uv(this,e,t),this}setBlockType(e,t=e,n,i=null){return Kv(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return Jv(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new Un(e,t,n)),this}setDocAttribute(e,t){return this.step(new Ki(e,t)),this}addNodeMark(e,t){return this.step(new qr(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof Re)t.isInSet(n.marks)&&this.step(new wn(e,t));else{let i=n.marks,s,o=[];for(;s=t.isInSet(i);)o.push(new wn(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,t=1,n){return Yv(this,e,t,n),this}addMark(e,t,n){return Hv(this,e,t,n),this}removeMark(e,t,n){return jv(this,e,t,n),this}clearIncompatible(e,t,n){return Za(this,e,t,n),this}}const rl=Object.create(null);class ge{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new kd(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=Z.empty){let n=t.content.lastChild,i=null;for(let a=0;a<t.openEnd;a++)i=n,n=n.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:u}=o[a],c=e.mapping.slice(s);e.replaceRange(c.map(l.pos),c.map(u.pos),a?Z.empty:t),a==0&&Md(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(n),u=l.map(o.pos),c=l.map(a.pos);s?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),Md(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new we(e):Gn(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=t<0?Gn(e.node(0),e.node(s),e.before(s+1),e.index(s),t,n):Gn(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Dt(e.node(0))}static atStart(e){return Gn(e,e,0,0,1)||new Dt(e)}static atEnd(e){return Gn(e,e,e.content.size,e.childCount,-1)||new Dt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=rl[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in rl)throw new RangeError("Duplicate use of selection JSON ID "+e);return rl[e]=t,t.prototype.jsonID=e,t}getBookmark(){return we.between(this.$anchor,this.$head).getBookmark()}}ge.prototype.visible=!0;class kd{constructor(e,t){this.$from=e,this.$to=t}}let Td=!1;function Cd(r){!Td&&!r.parent.inlineContent&&(Td=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class we extends ge{constructor(e,t=e){Cd(e),Cd(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return ge.near(n);let i=e.resolve(t.map(this.anchor));return new we(i.parent.inlineContent?i:n,n)}replace(e,t=Z.empty){if(super.replace(e,t),t==Z.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof we&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new to(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new we(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let s=ge.findFrom(t,n,!0)||ge.findFrom(t,-n,!0);if(s)t=s.$head;else return ge.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(ge.findFrom(e,-n,!0)||ge.findFrom(e,n,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new we(e,t)}}ge.jsonID("text",we);class to{constructor(e,t){this.anchor=e,this.head=t}map(e){return new to(e.map(this.anchor),e.map(this.head))}resolve(e){return we.between(e.resolve(this.anchor),e.resolve(this.head))}}class le extends ge{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:i}=t.mapResult(this.anchor),s=e.resolve(i);return n?ge.near(s):new le(s)}content(){return new Z(j.from(this.node),0,0)}eq(e){return e instanceof le&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new nl(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new le(e.resolve(t.anchor))}static create(e,t){return new le(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}le.prototype.visible=!1,ge.jsonID("node",le);class nl{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new to(n,n):new nl(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&le.isSelectable(n)?new le(t):ge.near(t)}}class Dt extends ge{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=Z.empty){if(t==Z.empty){e.delete(0,e.doc.content.size);let n=ge.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Dt(e)}map(e){return new Dt(e)}eq(e){return e instanceof Dt}getBookmark(){return oy}}ge.jsonID("all",Dt);const oy={map(){return this},resolve(r){return new Dt(r)}};function Gn(r,e,t,n,i,s=!1){if(e.inlineContent)return we.create(r,t);for(let o=n-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&le.isSelectable(a))return le.create(r,t-(i<0?a.nodeSize:0))}else{let l=Gn(r,a,t+i,i<0?a.childCount:0,i,s);if(l)return l}t+=a.nodeSize*i}return null}function Md(r,e,t){let n=r.steps.length-1;if(n<e)return;let i=r.steps[n];if(!(i instanceof et||i instanceof tt))return;let s=r.mapping.maps[n],o;s.forEach((a,l,u,c)=>{o==null&&(o=c)}),r.setSelection(ge.near(r.doc.resolve(o),t))}const Ed=1,ro=2,Ad=4;class ay extends Sd{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Ed)&~ro,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ed)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ro,this}ensureMarks(e){return Re.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ro)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~ro,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Re.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=t),!e)return this.deleteRange(t,n);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,s)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(ge.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ad,this}get scrolledIntoView(){return(this.updated&Ad)>0}}function Od(r,e){return!e||!r?r:r.bind(e)}class Gi{constructor(e,t,n){this.name=e,this.init=Od(t.init,n),this.apply=Od(t.apply,n)}}const ly=[new Gi("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new Gi("selection",{init(r,e){return r.selection||ge.atStart(e.doc)},apply(r){return r.selection}}),new Gi("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new Gi("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}})];class il{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ly.slice(),t&&t.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Gi(n.key,n.spec.state,n))})}}class Jn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,u=i?i[o].state:this,c=l<t.length&&a.spec.appendTransaction.call(a,l?t.slice(l):t,u,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),s=!0}i&&(i[o]={state:n,n:t.length})}}if(!s)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Jn(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let s=n[i];t[s.name]=s.apply(e,this[s.name],this,t)}return t}get tr(){return new ay(this)}static create(e){let t=new il(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Jn(t);for(let i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n}reconfigure(e){let t=new il(this.schema,e.plugins),n=t.fields,i=new Jn(t);for(let s=0;s<n.length;s++){let o=n[s].name;i[o]=this.hasOwnProperty(o)?this[o]:n[s].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],s=i.spec.state;s&&s.toJSON&&(t[n]=s.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new il(e.schema,e.plugins),s=new Jn(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=jr.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=ge.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){s[o.name]=u.fromJSON.call(l,e,t[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function Nd(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=Nd(i,e,{})),t[n]=i}return t}class qe{constructor(e){this.spec=e,this.props={},e.props&&Nd(e.props,this,this.props),this.key=e.key?e.key.key:Dd("plugin")}getState(e){return e[this.key]}}const sl=Object.create(null);function Dd(r){return r in sl?r+"$"+ ++sl[r]:(sl[r]=0,r+"$")}class Ke{constructor(e="key"){this.key=Dd(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ol=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function Pd(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const Id=(r,e,t)=>{let n=Pd(r,t);if(!n)return!1;let i=al(n);if(!i){let o=n.blockRange(),a=o&&Wn(o);return a==null?!1:(e&&e(r.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(_d(r,i,e,-1))return!0;if(n.parent.content.size==0&&(Yn(s,"end")||le.isSelectable(s)))for(let o=n.depth;;o--){let a=eo(r.doc,n.before(o),n.after(o),Z.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=r.tr.step(a);l.setSelection(Yn(s,"end")?ge.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):le.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||n.node(o-1).childCount>1)break}return s.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},uy=(r,e,t)=>{let n=Pd(r,t);if(!n)return!1;let i=al(n);return i?Rd(r,i,e):!1},cy=(r,e,t)=>{let n=Ld(r,t);if(!n)return!1;let i=ll(n);return i?Rd(r,i,e):!1};function Rd(r,e,t){let n=e.nodeBefore,i=n,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=eo(r.doc,s,l,Z.empty);if(!u||u.from!=s||u instanceof et&&u.slice.size>=l-s)return!1;if(t){let c=r.tr.step(u);c.setSelection(we.create(c.doc,s)),t(c.scrollIntoView())}return!0}function Yn(r,e,t=!1){for(let n=r;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(t&&n.childCount!=1)return!1}return!1}const zd=(r,e,t)=>{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;s=al(n)}let o=s&&s.nodeBefore;return!o||!le.isSelectable(o)?!1:(e&&e(r.tr.setSelection(le.create(r.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function al(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function Ld(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset<t.parent.content.size)?null:t}const Bd=(r,e,t)=>{let n=Ld(r,t);if(!n)return!1;let i=ll(n);if(!i)return!1;let s=i.nodeAfter;if(_d(r,i,e,1))return!0;if(n.parent.content.size==0&&(Yn(s,"start")||le.isSelectable(s))){let o=eo(r.doc,n.before(),n.after(),Z.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=r.tr.step(o);a.setSelection(Yn(s,"start")?ge.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):le.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},Fd=(r,e,t)=>{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset<n.parent.content.size)return!1;s=ll(n)}let o=s&&s.nodeAfter;return!o||!le.isSelectable(o)?!1:(e&&e(r.tr.setSelection(le.create(r.doc,s.pos)).scrollIntoView()),!0)};function ll(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){let t=r.node(e);if(r.index(e)+1<t.childCount)return r.doc.resolve(r.after(e+1));if(t.type.spec.isolating)break}return null}const dy=(r,e)=>{let t=r.selection,n=t instanceof le,i;if(n){if(t.node.isTextblock||!Wr(r.doc,t.from))return!1;i=t.from}else if(i=Qs(r.doc,t.from,-1),i==null)return!1;if(e){let s=r.tr.join(i);n&&s.setSelection(le.create(s.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},fy=(r,e)=>{let t=r.selection,n;if(t instanceof le){if(t.node.isTextblock||!Wr(r.doc,t.to))return!1;n=t.to}else if(n=Qs(r.doc,t.to,1),n==null)return!1;return e&&e(r.tr.join(n).scrollIntoView()),!0},hy=(r,e)=>{let{$from:t,$to:n}=r.selection,i=t.blockRange(n),s=i&&Wn(i);return s==null?!1:(e&&e(r.tr.lift(i,s).scrollIntoView()),!0)},$d=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(`
|
|
535
|
+
`).scrollIntoView()),!0)};function ul(r){for(let e=0;e<r.edgeCount;e++){let{type:t}=r.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const py=(r,e)=>{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=ul(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=t.after(),l=r.tr.replaceWith(a,a,o.createAndFill());l.setSelection(ge.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Hd=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof Dt||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=ul(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,a=r.tr.insert(o,s.createAndFill());a.setSelection(we.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},jd=(r,e)=>{let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(yr(r.doc,s))return e&&e(r.tr.split(s).scrollIntoView()),!0}let n=t.blockRange(),i=n&&Wn(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)};function my(r){return(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof le&&e.selection.node.isBlock)return!n.parentOffset||!yr(e.doc,n.pos)?!1:(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let s=[],o,a,l=!1,u=!1;for(let f=n.depth;;f--)if(n.node(f).isBlock){l=n.end(f)==n.pos+(n.depth-f),u=n.start(f)==n.pos-(n.depth-f),a=ul(n.node(f-1).contentMatchAt(n.indexAfter(f-1))),s.unshift(l&&a?{type:a}:null),o=f;break}else{if(f==1)return!1;s.unshift(null)}let c=e.tr;(e.selection instanceof we||e.selection instanceof Dt)&&c.deleteSelection();let d=c.mapping.map(n.pos),h=yr(c.doc,d,s.length,s);if(h||(s[0]=a?{type:a}:null,h=yr(c.doc,d,s.length,s)),!h)return!1;if(c.split(d,s.length,s),!l&&u&&n.node(o).type!=a){let f=c.mapping.map(n.before(o)),m=c.doc.resolve(f);a&&n.node(o-1).canReplaceWith(m.index(),m.index()+1,a)&&c.setNodeMarkup(c.mapping.map(n.before(o)),a)}return t&&t(c.scrollIntoView()),!0}}const gy=my(),vy=(r,e)=>{let{$from:t,to:n}=r.selection,i,s=t.sharedDepth(n);return s==0?!1:(i=t.before(s),e&&e(r.tr.setSelection(le.create(r.doc,i))),!0)};function yy(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Wr(r.doc,e.pos))?!1:(t&&t(r.tr.join(e.pos).scrollIntoView()),!0)}function _d(r,e,t,n){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&yy(r,e,t))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(t){let f=e.pos+s.nodeSize,m=j.empty;for(let w=o.length-1;w>=0;w--)m=j.from(o[w].create(null,m));m=j.from(i.copy(m));let v=r.tr.step(new tt(e.pos-1,f,e.pos,f,new Z(m,1,0),o.length,!0)),y=v.doc.resolve(f+2*o.length);y.nodeAfter&&y.nodeAfter.type==i.type&&Wr(v.doc,y.pos)&&v.join(y.pos),t(v.scrollIntoView())}return!0}let c=s.type.spec.isolating||n>0&&l?null:ge.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),h=d&&Wn(d);if(h!=null&&h>=e.depth)return t&&t(r.tr.lift(d,h).scrollIntoView()),!0;if(u&&Yn(s,"start",!0)&&Yn(i,"end")){let f=i,m=[];for(;m.push(f),!f.isTextblock;)f=f.lastChild;let v=s,y=1;for(;!v.isTextblock;v=v.firstChild)y++;if(f.canReplace(f.childCount,f.childCount,v.content)){if(t){let w=j.empty;for(let E=m.length-1;E>=0;E--)w=j.from(m[E].copy(w));let k=r.tr.step(new tt(e.pos-m.length,e.pos+s.nodeSize,e.pos+y,e.pos+s.nodeSize-y,new Z(w,m.length,0),0,!0));t(k.scrollIntoView())}return!0}}return!1}function Vd(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(we.create(e.doc,r<0?i.start(s):i.end(s)))),!0):!1}}const by=Vd(-1),wy=Vd(1);function xy(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),a=o&&Qa(o,r,e);return a?(n&&n(t.tr.wrap(o,a).scrollIntoView()),!0):!1}}function qd(r,e=null){return function(t,n){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=t.selection.ranges[s];t.doc.nodesBetween(o,a,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(r,e)))if(l.type==r)i=!0;else{let c=t.doc.resolve(u),d=c.index();i=c.parent.canReplaceWith(d,d+1,r)}})}if(!i)return!1;if(n){let s=t.tr;for(let o=0;o<t.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=t.selection.ranges[o];s.setBlockType(a,l,r,e)}n(s.scrollIntoView())}return!0}}function cl(...r){return function(e,t,n){for(let i=0;i<r.length;i++)if(r[i](e,t,n))return!0;return!1}}cl(ol,Id,zd),cl(ol,Bd,Fd),cl($d,Hd,jd,gy),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Sy(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s);if(!o)return!1;let a=n?t.tr:null;return ky(a,o,r,e)?(n&&n(a.scrollIntoView()),!0):!1}}function ky(r,e,t,n=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);s=new Gs(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new Gs(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=Qa(s,t,n,e);return a?(r&&Ty(r,e,a,i,t),!0):!1}function Ty(r,e,t,n,i){let s=j.empty;for(let c=t.length-1;c>=0;c--)s=j.from(t[c].type.create(t[c].attrs,s));r.step(new tt(e.start-(n?2:0),e.end,e.start,e.end,new Z(s,0,0),t.length,!0));let o=0;for(let c=0;c<t.length;c++)t[c].type==i&&(o=c+1);let a=t.length-o,l=e.start+t.length-(n?2:0),u=e.parent;for(let c=e.startIndex,d=e.endIndex,h=!0;c<d;c++,h=!1)!h&&yr(r.doc,l,a)&&(r.split(l,a),l+=2*a),l+=u.child(c).nodeSize;return r}function Cy(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,o=>o.childCount>0&&o.firstChild.type==r);return s?t?n.node(s.depth-1).type==r?My(e,t,r,s):Ey(e,t,s):!0:!1}}function My(r,e,t,n){let i=r.tr,s=n.end,o=n.$to.end(n.depth);s<o&&(i.step(new tt(s-1,o,s,o,new Z(j.from(t.create(null,n.parent.copy())),1,0),1,!0)),n=new Gs(i.doc.resolve(n.$from.pos),i.doc.resolve(o),n.depth));const a=Wn(n);if(a==null)return!1;i.lift(n,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return Wr(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function Ey(r,e,t){let n=r.tr,i=t.parent;for(let f=t.end,m=t.endIndex-1,v=t.startIndex;m>v;m--)f-=i.child(m).nodeSize,n.delete(f-1,f+1);let s=n.doc.resolve(t.start),o=s.nodeAfter;if(n.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let a=t.startIndex==0,l=t.endIndex==i.childCount,u=s.node(-1),c=s.index(-1);if(!u.canReplace(c+(a?0:1),c+1,o.content.append(l?j.empty:j.from(i))))return!1;let d=s.pos,h=d+o.nodeSize;return n.step(new tt(d-(a?1:0),h+(l?1:0),d+1,h-1,new Z((a?j.empty:j.from(i.copy(j.empty))).append(l?j.empty:j.from(i.copy(j.empty))),a?0:1,l?0:1),a?0:1)),e(n.scrollIntoView()),!0}function Ay(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==r);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=r)return!1;if(t){let u=l.lastChild&&l.lastChild.type==a.type,c=j.from(u?r.create():null),d=new Z(j.from(r.create(null,j.from(a.type.create(null,c)))),u?3:1,0),h=s.start,f=s.end;t(e.tr.step(new tt(h-(u?3:1),f,h,f,d,1,!0)).scrollIntoView())}return!0}}const st=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},Xn=function(r){let e=r.assignedSlot||r.parentNode;return e&&e.nodeType==11?e.host:e};let dl=null;const br=function(r,e,t){let n=dl||(dl=document.createRange());return n.setEnd(r,t??r.nodeValue.length),n.setStart(r,e||0),n},Oy=function(){dl=null},xn=function(r,e,t,n){return t&&(Wd(r,e,t,n,-1)||Wd(r,e,t,n,1))},Ny=/^(img|br|input|textarea|hr)$/i;function Wd(r,e,t,n,i){for(var s;;){if(r==t&&e==n)return!0;if(e==(i<0?0:Ft(r))){let o=r.parentNode;if(!o||o.nodeType!=1||Ji(r)||Ny.test(r.nodeName)||r.contentEditable=="false")return!1;e=st(r)+(i<0?0:1),r=o}else if(r.nodeType==1){let o=r.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else r=o,e=i<0?Ft(r):0}else return!1}}function Ft(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Dy(r,e){for(;;){if(r.nodeType==3&&e)return r;if(r.nodeType==1&&e>0){if(r.contentEditable=="false")return null;r=r.childNodes[e-1],e=Ft(r)}else if(r.parentNode&&!Ji(r))e=st(r),r=r.parentNode;else return null}}function Py(r,e){for(;;){if(r.nodeType==3&&e<r.nodeValue.length)return r;if(r.nodeType==1&&e<r.childNodes.length){if(r.contentEditable=="false")return null;r=r.childNodes[e],e=0}else if(r.parentNode&&!Ji(r))e=st(r)+1,r=r.parentNode;else return null}}function Iy(r,e,t){for(let n=e==0,i=e==Ft(r);n||i;){if(r==t)return!0;let s=st(r);if(r=r.parentNode,!r)return!1;n=n&&s==0,i=i&&s==Ft(r)}}function Ji(r){let e;for(let t=r;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==r||e.contentDOM==r)}const no=function(r){return r.focusNode&&xn(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function Sn(r,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=r,t.key=t.code=e,t}function Ry(r){let e=r.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function zy(r,e,t){if(r.caretPositionFromPoint)try{let n=r.caretPositionFromPoint(e,t);if(n)return{node:n.offsetNode,offset:Math.min(Ft(n.offsetNode),n.offset)}}catch{}if(r.caretRangeFromPoint){let n=r.caretRangeFromPoint(e,t);if(n)return{node:n.startContainer,offset:Math.min(Ft(n.startContainer),n.startOffset)}}}const er=typeof navigator<"u"?navigator:null,Ud=typeof document<"u"?document:null,Ur=er&&er.userAgent||"",fl=/Edge\/(\d+)/.exec(Ur),Kd=/MSIE \d/.exec(Ur),hl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ur),xt=!!(Kd||hl||fl),Kr=Kd?document.documentMode:hl?+hl[1]:fl?+fl[1]:0,$t=!xt&&/gecko\/(\d+)/i.test(Ur);$t&&+(/Firefox\/(\d+)/.exec(Ur)||[0,0])[1];const pl=!xt&&/Chrome\/(\d+)/.exec(Ur),rt=!!pl,Gd=pl?+pl[1]:0,ct=!xt&&!!er&&/Apple Computer/.test(er.vendor),Zn=ct&&(/Mobile\/\w+/.test(Ur)||!!er&&er.maxTouchPoints>2),Ht=Zn||(er?/Mac/.test(er.platform):!1),Jd=er?/Win/.test(er.platform):!1,wr=/Android \d/.test(Ur),Yi=!!Ud&&"webkitFontSmoothing"in Ud.documentElement.style,Ly=Yi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function By(r){let e=r.defaultView&&r.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function xr(r,e){return typeof r=="number"?r:r[e]}function Fy(r){let e=r.getBoundingClientRect(),t=e.width/r.offsetWidth||1,n=e.height/r.offsetHeight||1;return{left:e.left,right:e.left+r.clientWidth*t,top:e.top,bottom:e.top+r.clientHeight*n}}function Yd(r,e,t){let n=r.someProp("scrollThreshold")||0,i=r.someProp("scrollMargin")||5,s=r.dom.ownerDocument;for(let o=t||r.dom;o;){if(o.nodeType!=1){o=Xn(o);continue}let a=o,l=a==s.body,u=l?By(s):Fy(a),c=0,d=0;if(e.top<u.top+xr(n,"top")?d=-(u.top-e.top+xr(i,"top")):e.bottom>u.bottom-xr(n,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+xr(i,"top")-u.top:e.bottom-u.bottom+xr(i,"bottom")),e.left<u.left+xr(n,"left")?c=-(u.left-e.left+xr(i,"left")):e.right>u.right-xr(n,"right")&&(c=e.right-u.right+xr(i,"right")),c||d)if(l)s.defaultView.scrollBy(c,d);else{let f=a.scrollLeft,m=a.scrollTop;d&&(a.scrollTop+=d),c&&(a.scrollLeft+=c);let v=a.scrollLeft-f,y=a.scrollTop-m;e={left:e.left-v,top:e.top-y,right:e.right-v,bottom:e.bottom-y}}let h=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(h))break;o=h=="absolute"?o.offsetParent:Xn(o)}}function $y(r){let e=r.dom.getBoundingClientRect(),t=Math.max(0,e.top),n,i;for(let s=(e.left+e.right)/2,o=t+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=r.root.elementFromPoint(s,o);if(!a||a==r.dom||!r.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=t-20){n=a,i=l.top;break}}return{refDOM:n,refTop:i,stack:Xd(r.dom)}}function Xd(r){let e=[],t=r.ownerDocument;for(let n=r;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),r!=t);n=Xn(n));return e}function Hy({refDOM:r,refTop:e,stack:t}){let n=r?r.getBoundingClientRect().top:0;Zd(t,n==0?0:n-e)}function Zd(r,e){for(let t=0;t<r.length;t++){let{dom:n,top:i,left:s}=r[t];n.scrollTop!=i+e&&(n.scrollTop=i+e),n.scrollLeft!=s&&(n.scrollLeft=s)}}let Qn=null;function jy(r){if(r.setActive)return r.setActive();if(Qn)return r.focus(Qn);let e=Xd(r);r.focus(Qn==null?{get preventScroll(){return Qn={preventScroll:!0},!0}}:void 0),Qn||(Qn=!1,Zd(e,0))}function Qd(r,e){let t,n=2e8,i,s=0,o=e.top,a=e.top,l,u;for(let c=r.firstChild,d=0;c;c=c.nextSibling,d++){let h;if(c.nodeType==1)h=c.getClientRects();else if(c.nodeType==3)h=br(c).getClientRects();else continue;for(let f=0;f<h.length;f++){let m=h[f];if(m.top<=o&&m.bottom>=a){o=Math.max(m.bottom,o),a=Math.min(m.top,a);let v=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(v<n){t=c,n=v,i=v&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,c.nodeType==1&&v&&(s=d+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=c,u={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(s=d+1)}}return!t&&l&&(t=l,i=u,n=0),t&&t.nodeType==3?_y(t,i):!t||n&&t.nodeType==1?{node:r,offset:s}:Qd(t,i)}function _y(r,e){let t=r.nodeValue.length,n=document.createRange(),i;for(let s=0;s<t;s++){n.setEnd(r,s+1),n.setStart(r,s);let o=Gr(n,1);if(o.top!=o.bottom&&ml(e,o)){i={node:r,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return n.detach(),i||{node:r,offset:0}}function ml(r,e){return r.left>=e.left-1&&r.left<=e.right+1&&r.top>=e.top-1&&r.top<=e.bottom+1}function Vy(r,e){let t=r.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<r.getBoundingClientRect().left?t:r}function qy(r,e,t){let{node:n,offset:i}=Qd(e,t),s=-1;if(n.nodeType==1&&!n.firstChild){let o=n.getBoundingClientRect();s=o.left!=o.right&&t.left>(o.left+o.right)/2?1:-1}return r.docView.posFromDOM(n,i,s)}function Wy(r,e,t,n){let i=-1;for(let s=e,o=!1;s!=r.dom;){let a=r.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>n.left||l.top>n.top?i=a.posBefore:(!o&&l.right<n.left||l.bottom<n.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:r.docView.posFromDOM(e,t,-1)}function ef(r,e,t){let n=r.childNodes.length;if(n&&t.top<t.bottom)for(let i=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-t.top)/(t.bottom-t.top))-2)),s=i;;){let o=r.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(ml(e,u))return ef(o,e,u)}}if((s=(s+1)%n)==i)break}return r}function Uy(r,e){let t=r.dom.ownerDocument,n,i=0,s=zy(t,e.left,e.top);s&&({node:n,offset:i}=s);let o=(r.root.elementFromPoint?r.root:t).elementFromPoint(e.left,e.top),a;if(!o||!r.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=r.dom.getBoundingClientRect();if(!ml(e,u)||(o=ef(r.dom,e,u),!o))return null}if(ct)for(let u=o;n&&u;u=Xn(u))u.draggable&&(n=void 0);if(o=Vy(o,e),n){if($t&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let c=n.childNodes[i],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let u;Yi&&i&&n.nodeType==1&&(u=n.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,n==r.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=r.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(a=Wy(r,n,i,e))}a==null&&(a=qy(r,o,e));let l=r.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function tf(r){return r.top<r.bottom||r.left<r.right}function Gr(r,e){let t=r.getClientRects();if(t.length){let n=t[e<0?0:t.length-1];if(tf(n))return n}return Array.prototype.find.call(t,tf)||r.getBoundingClientRect()}const Ky=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function rf(r,e,t){let{node:n,offset:i,atom:s}=r.docView.domFromPos(e,t<0?-1:1),o=Yi||$t;if(n.nodeType==3)if(o&&(Ky.test(n.nodeValue)||(t<0?!i:i==n.nodeValue.length))){let l=Gr(br(n,i,i),t);if($t&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let u=Gr(br(n,i-1,i-1),-1);if(u.top==l.top){let c=Gr(br(n,i,i+1),-1);if(c.top!=l.top)return Xi(c,c.left<u.left)}}return l}else{let l=i,u=i,c=t<0?1:-1;return t<0&&!i?(u++,c=-1):t>=0&&i==n.nodeValue.length?(l--,c=1):t<0?l--:u++,Xi(Gr(br(n,l,u),c),c<0)}if(!r.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==Ft(n))){let l=n.childNodes[i-1];if(l.nodeType==1)return gl(l.getBoundingClientRect(),!1)}if(s==null&&i<Ft(n)){let l=n.childNodes[i];if(l.nodeType==1)return gl(l.getBoundingClientRect(),!0)}return gl(n.getBoundingClientRect(),t>=0)}if(s==null&&i&&(t<0||i==Ft(n))){let l=n.childNodes[i-1],u=l.nodeType==3?br(l,Ft(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return Xi(Gr(u,1),!1)}if(s==null&&i<Ft(n)){let l=n.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?br(l,0,o?0:1):l.nodeType==1?l:null:null;if(u)return Xi(Gr(u,-1),!0)}return Xi(Gr(n.nodeType==3?br(n):n,-t),t>=0)}function Xi(r,e){if(r.width==0)return r;let t=e?r.left:r.right;return{top:r.top,bottom:r.bottom,left:t,right:t}}function gl(r,e){if(r.height==0)return r;let t=e?r.top:r.bottom;return{top:t,bottom:t,left:r.left,right:r.right}}function nf(r,e,t){let n=r.state,i=r.root.activeElement;n!=e&&r.updateState(e),i!=r.dom&&r.focus();try{return t()}finally{n!=e&&r.updateState(n),i!=r.dom&&i&&i.focus()}}function Gy(r,e,t){let n=e.selection,i=t=="up"?n.$from:n.$to;return nf(r,e,()=>{let{node:s}=r.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let a=r.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=rf(r,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=br(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let c=l[u];if(c.bottom>c.top+1&&(t=="up"?o.top-c.top>(c.bottom-o.top)*2:c.bottom-o.bottom>(o.bottom-c.top)*2))return!1}}return!0})}const Jy=/[\u0590-\u08ac]/;function Yy(r,e,t){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,s=!i,o=i==n.parent.content.size,a=r.domSelection();return a?!Jy.test(n.parent.textContent)||!a.modify?t=="left"||t=="backward"?s:o:nf(r,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:d}=r.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",t,"character");let f=n.depth?r.docView.domAfterPos(n.before()):r.dom,{focusNode:m,focusOffset:v}=r.domSelectionRange(),y=m&&!f.contains(m.nodeType==1?m:m.parentNode)||l==m&&u==v;try{a.collapse(c,d),l&&(l!=c||u!=d)&&a.extend&&a.extend(l,u)}catch{}return h!=null&&(a.caretBidiLevel=h),y}):n.pos==n.start()||n.pos==n.end()}let sf=null,of=null,af=!1;function Xy(r,e,t){return sf==e&&of==t?af:(sf=e,of=t,af=t=="up"||t=="down"?Gy(r,e,t):Yy(r,e,t))}const jt=0,lf=1,kn=2,tr=3;class Zi{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=jt,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let i=this.children[t];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let s,o;if(e==this.contentDOM)s=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>st(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!t||s.node))if(n&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let i=this.children[t],s=n+i.size;if(n==e&&s!=n){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let a=i.children[o];if(a.size){i=a;break}}return i}if(e<s)return i.descAt(e-n-i.border);n=s}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let s=0;n<this.children.length;n++){let o=this.children[n],a=s+o.size;if(a>e||o instanceof df){i=e-s;break}s=a}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(let s;n&&!(s=this.children[n-1]).size&&s instanceof uf&&s.side>=0;n--);if(t<=0){let s,o=!0;for(;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,o=!1);return s&&t&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?st(s.dom)+1:0}}else{let s,o=!0;for(;s=n<this.children.length?this.children[n]:null,!(!s||s.dom.parentNode==this.contentDOM);n++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,t):{node:this.contentDOM,offset:s?st(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=n,a=0;;a++){let l=this.children[a],u=o+l.size;if(i==-1&&e<=u){let c=o+l.border;if(e>=c&&t<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,c);e=o;for(let d=a;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=st(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(u>t||a==this.children.length-1)){t=u;for(let c=a+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=st(d.dom);break}t+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,i=!1){let s=Math.min(e,t),o=Math.max(e,t);for(let f=0,m=0;f<this.children.length;f++){let v=this.children[f],y=m+v.size;if(s>m&&o<y)return v.setSelection(e-m-v.border,t-m-v.border,n,i);m=y}let a=this.domFromPos(e,e?-1:1),l=t==e?a:this.domFromPos(t,t?-1:1),u=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if(($t||ct)&&e==t){let{node:f,offset:m}=a;if(f.nodeType==3){if(d=!!(m&&f.nodeValue[m-1]==`
|
|
536
|
+
`),d&&m==f.nodeValue.length)for(let v=f,y;v;v=v.parentNode){if(y=v.nextSibling){y.nodeName=="BR"&&(a=l={node:y.parentNode,offset:st(y)+1});break}let w=v.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{let v=f.childNodes[m-1];d=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if($t&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let f=c.focusNode.childNodes[c.focusOffset];f&&f.contentEditable=="false"&&(i=!0)}if(!(i||d&&ct)&&xn(a.node,a.offset,c.anchorNode,c.anchorOffset)&&xn(l.node,l.offset,c.focusNode,c.focusOffset))return;let h=!1;if((u.extend||e==t)&&!(d&&$t)){u.collapse(a.node,a.offset);try{e!=t&&u.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>t){let m=a;a=l,l=m}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i<this.children.length;i++){let s=this.children[i],o=n+s.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let a=n+s.border,l=o-s.border;if(e>=a&&t<=l){this.dirty=e==n||t==o?kn:lf,e==a&&t==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=tr:s.markDirty(e-a,t-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?kn:tr}n=o}this.dirty=kn}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?kn:lf;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class uf extends Zi{constructor(e,t,n,i){let s,o=t.type.toDOM;if(typeof o=="function"&&(o=o(n,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==jt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Zy extends Zi{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Tn extends Zi{constructor(e,t,n,i,s){super(e,[],n,i),this.mark=t,this.spec=s}static create(e,t,n,i){let s=i.nodeViews[t.type.name],o=s&&s(t,i,n);return(!o||!o.dom)&&(o=bn.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new Tn(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&tr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=tr&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=jt){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=jt}}slice(e,t,n){let i=Tn.create(this.parent,this.mark,!0,n),s=this.children,o=this.size;t<o&&(s=yl(s,t,o,n)),e>0&&(s=yl(s,0,e,n));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Jr extends Zi{constructor(e,t,n,i,s,o,a,l,u){super(e,[],s,o),this.node=t,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=a}static create(e,t,n,i,s,o){let a=s.nodeViews[t.type.name],l,u=a&&a(t,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},n,i),c=u&&u.dom,d=u&&u.contentDOM;if(t.isText){if(!c)c=document.createTextNode(t.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:d}=bn.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let h=c;return c=pf(c,n,t),u?l=new Qy(e,t,n,i,c,d||null,h,u,s,o+1):t.isText?new io(e,t,n,i,c,h,s):new Jr(e,t,n,i,c,d||null,h,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>j.empty)}return e}matchesNode(e,t,n){return this.dirty==jt&&e.eq(this.node)&&so(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,i=t,s=e.composing?this.localCompositionInfo(e,t):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new t5(this,o&&o.node,e);i5(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?l.syncToMarks(u.spec.marks,n,e):u.type.side>=0&&!d&&l.syncToMarks(c==this.node.childCount?Re.none:this.node.child(c).marks,n,e),l.placeWidget(u,e,i)},(u,c,d,h)=>{l.syncToMarks(u.marks,n,e);let f;l.findNodeMatch(u,c,d,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(f=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(u,c,d,f,e)||l.updateNextNode(u,c,d,e,h,i)||l.addNode(u,c,d,e,i),i+=u.nodeSize}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==kn)&&(o&&this.protectLocalComposition(e,o),ff(this.contentDOM,this.children,e),Zn&&s5(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof we)||n<t||i>t+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=o5(this.node.content,o,n-t,i-t);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new Zy(this,s,t,i);e.input.compositionNodes.push(o),this.children=yl(this.children,n,n+i.length,e,o)}update(e,t,n,i){return this.dirty==tr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=jt}updateOuterDeco(e){if(so(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=hf(this.dom,this.nodeDOM,vl(this.outerDeco,this.node,t),vl(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function cf(r,e,t,n,i){pf(n,e,r);let s=new Jr(void 0,r,e,t,n,n,n,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class io extends Jr{constructor(e,t,n,i,s,o,a){super(e,t,n,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return this.dirty==tr||this.dirty!=jt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=jt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=jt,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,n){let i=this.node.cut(e,t),s=document.createTextNode(i.text);return new io(this.parent,i,this.outerDeco,this.innerDeco,s,s,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=tr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class df extends Zi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==jt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Qy extends Jr{constructor(e,t,n,i,s,o,a,l,u,c){super(e,t,n,i,s,o,a,u,c),this.spec=l}update(e,t,n,i){if(this.dirty==tr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,t,n);return s&&this.updateInner(e,t,n,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function ff(r,e,t){let n=r.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==r){for(;a!=n;)n=mf(n),i=!0;n=n.nextSibling}else i=!0,r.insertBefore(a,n);if(o instanceof Tn){let l=n?n.previousSibling:r.lastChild;ff(o.contentDOM,o.children,t),n=l?l.nextSibling:r.firstChild}}for(;n;)n=mf(n),i=!0;i&&t.trackWrites==r&&(t.trackWrites=null)}const Qi=function(r){r&&(this.nodeName=r)};Qi.prototype=Object.create(null);const Cn=[new Qi];function vl(r,e,t){if(r.length==0)return Cn;let n=t?Cn[0]:new Qi,i=[n];for(let s=0;s<r.length;s++){let o=r[s].type.attrs;if(o){o.nodeName&&i.push(n=new Qi(o.nodeName));for(let a in o){let l=o[a];l!=null&&(t&&i.length==1&&i.push(n=new Qi(e.isInline?"span":"div")),a=="class"?n.class=(n.class?n.class+" ":"")+l:a=="style"?n.style=(n.style?n.style+";":"")+l:a!="nodeName"&&(n[a]=l))}}}return i}function hf(r,e,t,n){if(t==Cn&&n==Cn)return e;let i=e;for(let s=0;s<n.length;s++){let o=n[s],a=t[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=r&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Cn[0]),i=l}e5(i,a||Cn[0],o)}return i}function e5(r,e,t){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in t)&&r.removeAttribute(n);for(let n in t)n!="class"&&n!="style"&&n!="nodeName"&&t[n]!=e[n]&&r.setAttribute(n,t[n]);if(e.class!=t.class){let n=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let s=0;s<n.length;s++)i.indexOf(n[s])==-1&&r.classList.remove(n[s]);for(let s=0;s<i.length;s++)n.indexOf(i[s])==-1&&r.classList.add(i[s]);r.classList.length==0&&r.removeAttribute("class")}if(e.style!=t.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(e.style);)r.style.removeProperty(i[1])}t.style&&(r.style.cssText+=t.style)}}function pf(r,e,t){return hf(r,r,Cn,vl(e,t,r.nodeType!=1))}function so(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++)if(!r[t].type.eq(e[t].type))return!1;return!0}function mf(r){let e=r.nextSibling;return r.parentNode.removeChild(r),e}class t5{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=r5(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let i=0,s=this.stack.length>>1,o=Math.min(s,e.length);for(;i<o&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=jt,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[s])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Tn.create(this.top,e[s],t,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,n,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,t,n)&&!this.preMatch.matched.has(u)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,n,i,s){let o=this.top.children[i];return o.dirty==tr&&o.dom==o.contentDOM&&(o.dirty=kn),o.update(e,t,n,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i}return-1}e=t}}updateNextNode(e,t,n,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Jr){let u=this.preMatch.matched.get(l);if(u!=null&&u!=s)return!1;let c=l.dom,d,h=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=tr&&so(t,l.outerDeco));if(!h&&l.update(e,t,n,i))return this.destroyBetween(this.index,a),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!h&&(d=this.recreateWrapper(l,e,t,n,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=kn,d.updateChildren(i,o+1),d.dirty=jt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,i,s,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!so(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=Jr.create(this.top,t,n,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,t,n,i,s){let o=Jr.create(this.top,e,t,n,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new uf(this.top,e,t,n);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Tn;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof io)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ct||rt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let i=new df(this.top,[],n,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function r5(r,e){let t=e,n=t.children.length,i=r.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(n){let u=t.children[n-1];if(u instanceof Tn)t=u,n=u.children.length;else{a=u,n--;break}}else{if(t==e)break e;n=t.parent.children.indexOf(t),t=t.parent}let l=a.node;if(l){if(l!=r.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function n5(r,e){return r.type.side-e.type.side}function i5(r,e,t,n){let i=e.locals(r),s=0;if(i.length==0){for(let u=0;u<r.childCount;u++){let c=r.child(u);n(c,i,e.forChild(s,c),u),s+=c.nodeSize}return}let o=0,a=[],l=null;for(let u=0;;){let c,d;for(;o<i.length&&i[o].to==s;){let y=i[o++];y.widget&&(c?(d||(d=[c])).push(y):c=y)}if(c)if(d){d.sort(n5);for(let y=0;y<d.length;y++)t(d[y],u,!!l)}else t(c,u,!!l);let h,f;if(l)f=-1,h=l,l=null;else if(u<r.childCount)f=u,h=r.child(u++);else break;for(let y=0;y<a.length;y++)a[y].to<=s&&a.splice(y--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let m=s+h.nodeSize;if(h.isText){let y=m;o<i.length&&i[o].from<y&&(y=i[o].from);for(let w=0;w<a.length;w++)a[w].to<y&&(y=a[w].to);y<m&&(l=h.cut(y-s),h=h.cut(0,y-s),m=y,f=-1)}else for(;o<i.length&&i[o].to<m;)o++;let v=h.isInline&&!h.isLeaf?a.filter(y=>!y.inline):a.slice();n(h,v,e.forChild(s,h),f),s=m}}function s5(r){if(r.nodeName=="UL"||r.nodeName=="OL"){let e=r.style.cssText;r.style.cssText=e+"; list-style: square !important",window.getComputedStyle(r).listStyle,r.style.cssText=e}}function o5(r,e,t,n){for(let i=0,s=0;i<r.childCount&&s<=n;){let o=r.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<r.childCount;){let u=r.child(i++);if(s+=u.nodeSize,!u.isText)break;l+=u.text}if(s>=t){if(s>=n&&l.slice(n-e.length-a,n-a)==e)return n-e.length;let u=a<n?l.lastIndexOf(e,n-a-1):-1;if(u>=0&&u+e.length+a>=t)return a+u;if(t==n&&l.length>=n+e.length-a&&l.slice(n-a,n-a+e.length)==e)return n}}return-1}function yl(r,e,t,n,i){let s=[];for(let o=0,a=0;o<r.length;o++){let l=r[o],u=a,c=a+=l.size;u>=t||c<=e?s.push(l):(u<e&&s.push(l.slice(0,e-u,n)),i&&(s.push(i),i=void 0),c>t&&s.push(l.slice(t-u,l.size,n)))}return s}function bl(r,e=null){let t=r.domSelectionRange(),n=r.state.doc;if(!t.focusNode)return null;let i=r.docView.nearestDesc(t.focusNode),s=i&&i.size==0,o=r.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let a=n.resolve(o),l,u;if(no(t)){for(l=o;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&le.isSelectable(d)&&i.parent&&!(d.isInline&&Iy(t.focusNode,t.focusOffset,i.dom))){let h=i.posBefore;u=new le(o==h?a:n.resolve(h))}}else{if(t instanceof r.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=o,h=o;for(let f=0;f<t.rangeCount;f++){let m=t.getRangeAt(f);d=Math.min(d,r.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,r.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(d<0)return null;[l,o]=h==r.state.selection.anchor?[h,d]:[d,h],a=n.resolve(o)}else l=r.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(l<0)return null}let c=n.resolve(l);if(!u){let d=e=="pointer"||r.state.selection.head<a.pos&&!s?1:-1;u=xl(r,c,a,d)}return u}function gf(r){return r.editable?r.hasFocus():kf(r)&&document.activeElement&&document.activeElement.contains(r.dom)}function Sr(r,e=!1){let t=r.state.selection;if(wf(r,t),!!gf(r)){if(!e&&r.input.mouseDown&&r.input.mouseDown.allowDefault&&rt){let n=r.domSelectionRange(),i=r.domObserver.currentSelection;if(n.anchorNode&&i.anchorNode&&xn(n.anchorNode,n.anchorOffset,i.anchorNode,i.anchorOffset)){r.input.mouseDown.delayedSelectionSync=!0,r.domObserver.setCurSelection();return}}if(r.domObserver.disconnectSelection(),r.cursorWrapper)l5(r);else{let{anchor:n,head:i}=t,s,o;vf&&!(t instanceof we)&&(t.$from.parent.inlineContent||(s=yf(r,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(o=yf(r,t.to))),r.docView.setSelection(n,i,r,e),vf&&(s&&bf(s),o&&bf(o)),t.visible?r.dom.classList.remove("ProseMirror-hideselection"):(r.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&a5(r))}r.domObserver.setCurSelection(),r.domObserver.connectSelection()}}const vf=ct||rt&&Gd<63;function yf(r,e){let{node:t,offset:n}=r.docView.domFromPos(e,0),i=n<t.childNodes.length?t.childNodes[n]:null,s=n?t.childNodes[n-1]:null;if(ct&&i&&i.contentEditable=="false")return wl(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return wl(i);if(s)return wl(s)}}function wl(r){return r.contentEditable="true",ct&&r.draggable&&(r.draggable=!1,r.wasDraggable=!0),r}function bf(r){r.contentEditable="false",r.wasDraggable&&(r.draggable=!0,r.wasDraggable=null)}function a5(r){let e=r.dom.ownerDocument;e.removeEventListener("selectionchange",r.input.hideSelectionGuard);let t=r.domSelectionRange(),n=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(t.anchorNode!=n||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!gf(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})}function l5(r){let e=r.domSelection();if(!e)return;let t=r.cursorWrapper.dom,n=t.nodeName=="IMG";n?e.collapse(t.parentNode,st(t)+1):e.collapse(t,0),!n&&!r.state.selection.visible&&xt&&Kr<=11&&(t.disabled=!0,t.disabled=!1)}function wf(r,e){if(e instanceof le){let t=r.docView.descAt(e.from);t!=r.lastSelectedViewDesc&&(xf(r),t&&t.selectNode(),r.lastSelectedViewDesc=t)}else xf(r)}function xf(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function xl(r,e,t,n){return r.someProp("createSelectionBetween",i=>i(r,e,t))||we.between(e,t,n)}function Sf(r){return r.editable&&!r.hasFocus()?!1:kf(r)}function kf(r){let e=r.domSelectionRange();if(!e.anchorNode)return!1;try{return r.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(r.editable||r.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function u5(r){let e=r.docView.domFromPos(r.state.selection.anchor,0),t=r.domSelectionRange();return xn(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Sl(r,e){let{$anchor:t,$head:n}=r.selection,i=e>0?t.max(n):t.min(n),s=i.parent.inlineContent?i.depth?r.doc.resolve(e>0?i.after():i.before()):null:i;return s&&ge.findFrom(s,e)}function Yr(r,e){return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()),!0}function Tf(r,e,t){let n=r.state.selection;if(n instanceof we)if(t.indexOf("s")>-1){let{$head:i}=n,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=r.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Yr(r,new we(n.$anchor,o))}else if(n.empty){if(r.endOfTextblock(e>0?"forward":"backward")){let i=Sl(r.state,e);return i&&i instanceof le?Yr(r,i):!1}else if(!(Ht&&t.indexOf("m")>-1)){let i=n.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=r.docView.descAt(a))&&!o.contentDOM?le.isSelectable(s)?Yr(r,new le(e<0?r.state.doc.resolve(i.pos-s.nodeSize):i)):Yi?Yr(r,new we(r.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(n instanceof le&&n.node.isInline)return Yr(r,new we(e>0?n.$to:n.$from));{let i=Sl(r.state,e);return i?Yr(r,i):!1}}}function oo(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function es(r,e){let t=r.pmViewDesc;return t&&t.size==0&&(e<0||r.nextSibling||r.nodeName!="BR")}function ei(r,e){return e<0?c5(r):d5(r)}function c5(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i,s,o=!1;for($t&&t.nodeType==1&&n<oo(t)&&es(t.childNodes[n],-1)&&(o=!0);;)if(n>0){if(t.nodeType!=1)break;{let a=t.childNodes[n-1];if(es(a,-1))i=t,s=--n;else if(a.nodeType==3)t=a,n=t.nodeValue.length;else break}}else{if(Cf(t))break;{let a=t.previousSibling;for(;a&&es(a,-1);)i=t.parentNode,s=st(a),a=a.previousSibling;if(a)t=a,n=oo(t);else{if(t=t.parentNode,t==r.dom)break;n=0}}}o?kl(r,t,n):i&&kl(r,i,s)}function d5(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i=oo(t),s,o;for(;;)if(n<i){if(t.nodeType!=1)break;let a=t.childNodes[n];if(es(a,1))s=t,o=++n;else break}else{if(Cf(t))break;{let a=t.nextSibling;for(;a&&es(a,1);)s=a.parentNode,o=st(a)+1,a=a.nextSibling;if(a)t=a,n=0,i=oo(t);else{if(t=t.parentNode,t==r.dom)break;n=i=0}}}s&&kl(r,s,o)}function Cf(r){let e=r.pmViewDesc;return e&&e.node&&e.node.isBlock}function f5(r,e){for(;r&&e==r.childNodes.length&&!Ji(r);)e=st(r)+1,r=r.parentNode;for(;r&&e<r.childNodes.length;){let t=r.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=0}}function h5(r,e){for(;r&&!e&&!Ji(r);)e=st(r),r=r.parentNode;for(;r&&e;){let t=r.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=r.childNodes.length}}function kl(r,e,t){if(e.nodeType!=3){let s,o;(o=f5(e,t))?(e=o,t=0):(s=h5(e,t))&&(e=s,t=s.nodeValue.length)}let n=r.domSelection();if(!n)return;if(no(n)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),n.removeAllRanges(),n.addRange(s)}else n.extend&&n.extend(e,t);r.domObserver.setCurSelection();let{state:i}=r;setTimeout(()=>{r.state==i&&Sr(r)},50)}function Mf(r,e){let t=r.state.doc.resolve(e);if(!(rt||Jd)&&t.parent.inlineContent){let i=r.coordsAtPos(e);if(e>t.start()){let s=r.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<t.end()){let s=r.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(r.dom).direction=="rtl"?"rtl":"ltr"}function Ef(r,e,t){let n=r.state.selection;if(n instanceof we&&!n.empty||t.indexOf("s")>-1||Ht&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||r.endOfTextblock(e<0?"up":"down")){let o=Sl(r.state,e);if(o&&o instanceof le)return Yr(r,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=n instanceof Dt?ge.near(o,e):ge.findFrom(o,e);return a?Yr(r,a):!1}return!1}function Af(r,e){if(!(r.state.selection instanceof we))return!0;let{$head:t,$anchor:n,empty:i}=r.state.selection;if(!t.sameParent(n))return!0;if(!i)return!1;if(r.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let o=r.state.tr;return e<0?o.delete(t.pos-s.nodeSize,t.pos):o.delete(t.pos,t.pos+s.nodeSize),r.dispatch(o),!0}return!1}function Of(r,e,t){r.domObserver.stop(),e.contentEditable=t,r.domObserver.start()}function p5(r){if(!ct||r.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;Of(r,n,"true"),setTimeout(()=>Of(r,n,"false"),20)}return!1}function m5(r){let e="";return r.ctrlKey&&(e+="c"),r.metaKey&&(e+="m"),r.altKey&&(e+="a"),r.shiftKey&&(e+="s"),e}function g5(r,e){let t=e.keyCode,n=m5(e);if(t==8||Ht&&t==72&&n=="c")return Af(r,-1)||ei(r,-1);if(t==46&&!e.shiftKey||Ht&&t==68&&n=="c")return Af(r,1)||ei(r,1);if(t==13||t==27)return!0;if(t==37||Ht&&t==66&&n=="c"){let i=t==37?Mf(r,r.state.selection.from)=="ltr"?-1:1:-1;return Tf(r,i,n)||ei(r,i)}else if(t==39||Ht&&t==70&&n=="c"){let i=t==39?Mf(r,r.state.selection.from)=="ltr"?1:-1:1;return Tf(r,i,n)||ei(r,i)}else{if(t==38||Ht&&t==80&&n=="c")return Ef(r,-1,n)||ei(r,-1);if(t==40||Ht&&t==78&&n=="c")return p5(r)||Ef(r,1,n)||ei(r,1);if(n==(Ht?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Tl(r,e){r.someProp("transformCopied",f=>{e=f(e,r)});let t=[],{content:n,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,s--;let f=n.firstChild;t.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),n=f.content}let o=r.someProp("clipboardSerializer")||bn.fromSchema(r.state.schema),a=Bf(),l=a.createElement("div");l.appendChild(o.serializeFragment(n,{document:a}));let u=l.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=zf[u.nodeName.toLowerCase()]);){for(let f=c.length-1;f>=0;f--){let m=a.createElement(c[f]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),d++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(t)}`);let h=r.someProp("clipboardTextSerializer",f=>f(e,r))||e.content.textBetween(0,e.content.size,`
|
|
537
|
+
|
|
538
|
+
`);return{dom:l,text:h,slice:e}}function Nf(r,e,t,n,i){let s=i.parent.type.spec.code,o,a;if(!t&&!e)return null;let l=!!e&&(n||s||!t);if(l){if(r.someProp("transformPastedText",h=>{e=h(e,s||n,r)}),s)return a=new Z(j.from(r.state.schema.text(e.replace(/\r\n?/g,`
|
|
539
|
+
`))),0,0),r.someProp("transformPasted",h=>{a=h(a,r,!0)}),a;let d=r.someProp("clipboardTextParser",h=>h(e,i,n,r));if(d)a=d;else{let h=i.marks(),{schema:f}=r.state,m=bn.fromSchema(f);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let y=o.appendChild(document.createElement("p"));v&&y.appendChild(m.serializeNode(f.text(v,h)))})}}else r.someProp("transformPastedHTML",d=>{t=d(t,r)}),o=w5(t),Yi&&x5(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(a||(a=(r.someProp("clipboardParser")||r.someProp("domParser")||_r.fromSchema(r.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!v5.test(h.parentNode.nodeName)?{ignore:!0}:null}})),c)a=S5(Rf(a,+c[1],+c[2]),c[4]);else if(a=Z.maxOpen(y5(a.content,i),!0),a.openStart||a.openEnd){let d=0,h=0;for(let f=a.content.firstChild;d<a.openStart&&!f.type.spec.isolating;d++,f=f.firstChild);for(let f=a.content.lastChild;h<a.openEnd&&!f.type.spec.isolating;h++,f=f.lastChild);a=Rf(a,d,h)}return r.someProp("transformPasted",d=>{a=d(a,r,l)}),a}const v5=/^(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 y5(r,e){if(r.childCount<2)return r;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,o=[];if(r.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),u;if(!l)return o=null;if(u=o.length&&s.length&&Pf(l,s,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=If(o[o.length-1],s.length));let c=Df(a,l);o.push(c),i=i.matchType(c.type),s=l}}),o)return j.from(o)}return r}function Df(r,e,t=0){for(let n=e.length-1;n>=t;n--)r=e[n].create(null,j.from(r));return r}function Pf(r,e,t,n,i){if(i<r.length&&i<e.length&&r[i]==e[i]){let s=Pf(r,e,t,n.lastChild,i+1);if(s)return n.copy(n.content.replaceChild(n.childCount-1,s));if(n.contentMatchAt(n.childCount).matchType(i==r.length-1?t.type:r[i+1]))return n.copy(n.content.append(j.from(Df(t,r,i+1))))}}function If(r,e){if(e==0)return r;let t=r.content.replaceChild(r.childCount-1,If(r.lastChild,e-1)),n=r.contentMatchAt(r.childCount).fillBefore(j.empty,!0);return r.copy(t.append(n))}function Cl(r,e,t,n,i,s){let o=e<0?r.firstChild:r.lastChild,a=o.content;return r.childCount>1&&(s=0),i<n-1&&(a=Cl(a,e,t,n,i+1,s)),i>=t&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(j.empty,!0))),r.replaceChild(e<0?0:r.childCount-1,o.copy(a))}function Rf(r,e,t){return e<r.openStart&&(r=new Z(Cl(r.content,-1,e,r.openStart,0,r.openEnd),e,r.openEnd)),t<r.openEnd&&(r=new Z(Cl(r.content,1,t,r.openEnd,0,0),r.openStart,t)),r}const zf={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 Lf=null;function Bf(){return Lf||(Lf=document.implementation.createHTMLDocument("title"))}let Ml=null;function b5(r){let e=window.trustedTypes;return e?(Ml||(Ml=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),Ml.createHTML(r)):r}function w5(r){let e=/^(\s*<meta [^>]*>)*/.exec(r);e&&(r=r.slice(e[0].length));let t=Bf().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(r),i;if((i=n&&zf[n[1].toLowerCase()])&&(r=i.map(s=>"<"+s+">").join("")+r+i.map(s=>"</"+s+">").reverse().join("")),t.innerHTML=b5(r),i)for(let s=0;s<i.length;s++)t=t.querySelector(i[s])||t;return t}function x5(r){let e=r.querySelectorAll(rt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let n=e[t];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(r.ownerDocument.createTextNode(" "),n)}}function S5(r,e){if(!r.size)return r;let t=r.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return r}let{content:i,openStart:s,openEnd:o}=r;for(let a=n.length-2;a>=0;a-=2){let l=t.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;i=j.from(l.create(n[a+1],i)),s++,o++}return new Z(i,s,o)}const ft={},ht={},k5={touchstart:!0,touchmove:!0};class T5{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 C5(r){for(let e in ft){let t=ft[e];r.dom.addEventListener(e,r.input.eventHandlers[e]=n=>{E5(r,n)&&!Al(r,n)&&(r.editable||!(n.type in ht))&&t(r,n)},k5[e]?{passive:!0}:void 0)}ct&&r.dom.addEventListener("input",()=>null),El(r)}function Xr(r,e){r.input.lastSelectionOrigin=e,r.input.lastSelectionTime=Date.now()}function M5(r){r.domObserver.stop();for(let e in r.input.eventHandlers)r.dom.removeEventListener(e,r.input.eventHandlers[e]);clearTimeout(r.input.composingTimeout),clearTimeout(r.input.lastIOSEnterFallbackTimeout)}function El(r){r.someProp("handleDOMEvents",e=>{for(let t in e)r.input.eventHandlers[t]||r.dom.addEventListener(t,r.input.eventHandlers[t]=n=>Al(r,n))})}function Al(r,e){return r.someProp("handleDOMEvents",t=>{let n=t[e.type];return n?n(r,e)||e.defaultPrevented:!1})}function E5(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=r.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function A5(r,e){!Al(r,e)&&ft[e.type]&&(r.editable||!(e.type in ht))&&ft[e.type](r,e)}ht.keydown=(r,e)=>{let t=e;if(r.input.shiftKey=t.keyCode==16||t.shiftKey,!$f(r,t)&&(r.input.lastKeyCode=t.keyCode,r.input.lastKeyCodeTime=Date.now(),!(wr&&rt&&t.keyCode==13)))if(t.keyCode!=229&&r.domObserver.forceFlush(),Zn&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();r.input.lastIOSEnter=n,r.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{r.input.lastIOSEnter==n&&(r.someProp("handleKeyDown",i=>i(r,Sn(13,"Enter"))),r.input.lastIOSEnter=0)},200)}else r.someProp("handleKeyDown",n=>n(r,t))||g5(r,t)?t.preventDefault():Xr(r,"key")},ht.keyup=(r,e)=>{e.keyCode==16&&(r.input.shiftKey=!1)},ht.keypress=(r,e)=>{let t=e;if($f(r,t)||!t.charCode||t.ctrlKey&&!t.altKey||Ht&&t.metaKey)return;if(r.someProp("handleKeyPress",i=>i(r,t))){t.preventDefault();return}let n=r.state.selection;if(!(n instanceof we)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(t.charCode),s=()=>r.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!r.someProp("handleTextInput",o=>o(r,n.$from.pos,n.$to.pos,i,s))&&r.dispatch(s()),t.preventDefault()}};function ao(r){return{left:r.clientX,top:r.clientY}}function O5(r,e){let t=e.x-r.clientX,n=e.y-r.clientY;return t*t+n*n<100}function Ol(r,e,t,n,i){if(n==-1)return!1;let s=r.state.doc.resolve(n);for(let o=s.depth+1;o>0;o--)if(r.someProp(e,a=>o>s.depth?a(r,t,s.nodeAfter,s.before(o),i,!0):a(r,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function ti(r,e,t){if(r.focused||r.focus(),r.state.selection.eq(e))return;let n=r.state.tr.setSelection(e);n.setMeta("pointer",!0),r.dispatch(n)}function N5(r,e){if(e==-1)return!1;let t=r.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&le.isSelectable(n)?(ti(r,new le(t)),!0):!1}function D5(r,e){if(e==-1)return!1;let t=r.state.selection,n,i;t instanceof le&&(n=t.node);let s=r.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(le.isSelectable(a)){n&&t.$from.depth>0&&o>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(o);break}}return i!=null?(ti(r,le.create(r.state.doc,i)),!0):!1}function P5(r,e,t,n,i){return Ol(r,"handleClickOn",e,t,n)||r.someProp("handleClick",s=>s(r,e,n))||(i?D5(r,t):N5(r,t))}function I5(r,e,t,n){return Ol(r,"handleDoubleClickOn",e,t,n)||r.someProp("handleDoubleClick",i=>i(r,e,n))}function R5(r,e,t,n){return Ol(r,"handleTripleClickOn",e,t,n)||r.someProp("handleTripleClick",i=>i(r,e,n))||z5(r,t,n)}function z5(r,e,t){if(t.button!=0)return!1;let n=r.state.doc;if(e==-1)return n.inlineContent?(ti(r,we.create(n,0,n.content.size)),!0):!1;let i=n.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)ti(r,we.create(n,a+1,a+1+o.content.size));else if(le.isSelectable(o))ti(r,le.create(n,a));else continue;return!0}}function Nl(r){return lo(r)}const Ff=Ht?"metaKey":"ctrlKey";ft.mousedown=(r,e)=>{let t=e;r.input.shiftKey=t.shiftKey;let n=Nl(r),i=Date.now(),s="singleClick";i-r.input.lastClick.time<500&&O5(t,r.input.lastClick)&&!t[Ff]&&r.input.lastClick.button==t.button&&(r.input.lastClick.type=="singleClick"?s="doubleClick":r.input.lastClick.type=="doubleClick"&&(s="tripleClick")),r.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s,button:t.button};let o=r.posAtCoords(ao(t));o&&(s=="singleClick"?(r.input.mouseDown&&r.input.mouseDown.done(),r.input.mouseDown=new L5(r,o,t,!!n)):(s=="doubleClick"?I5:R5)(r,o.pos,o.inside,t)?t.preventDefault():Xr(r,"pointer"))};class L5{constructor(e,t,n,i){this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Ff],this.allowDefault=n.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let c=e.state.doc.resolve(t.pos);s=c.parent,o=c.depth?c.before():0}const a=i?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;(n.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof le&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&$t&&!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)),Xr(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(()=>Sr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ao(e))),this.updateAllowDefault(e),this.allowDefault||!t?Xr(this.view,"pointer"):P5(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ct&&this.mightDrag&&!this.mightDrag.node.isAtom||rt&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(ti(this.view,ge.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Xr(this.view,"pointer")}move(e){this.updateAllowDefault(e),Xr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}ft.touchstart=r=>{r.input.lastTouch=Date.now(),Nl(r),Xr(r,"pointer")},ft.touchmove=r=>{r.input.lastTouch=Date.now(),Xr(r,"pointer")},ft.contextmenu=r=>Nl(r);function $f(r,e){return r.composing?!0:ct&&Math.abs(e.timeStamp-r.input.compositionEndedAt)<500?(r.input.compositionEndedAt=-2e8,!0):!1}const B5=wr?5e3:-1;ht.compositionstart=ht.compositionupdate=r=>{if(!r.composing){r.domObserver.flush();let{state:e}=r,t=e.selection.$to;if(e.selection instanceof we&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||rt&&Jd&&F5(r)))r.markCursor=r.state.storedMarks||t.marks(),lo(r,!0),r.markCursor=null;else if(lo(r,!e.selection.empty),$t&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=r.domSelectionRange();for(let i=n.focusNode,s=n.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=r.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}r.input.composing=!0}Hf(r,B5)};function F5(r){let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let n=e.childNodes[t];return n.nodeType==1&&n.contentEditable=="false"}ht.compositionend=(r,e)=>{r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=e.timeStamp,r.input.compositionPendingChanges=r.domObserver.pendingRecords().length?r.input.compositionID:0,r.input.compositionNode=null,r.input.compositionPendingChanges&&Promise.resolve().then(()=>r.domObserver.flush()),r.input.compositionID++,Hf(r,20))};function Hf(r,e){clearTimeout(r.input.composingTimeout),e>-1&&(r.input.composingTimeout=setTimeout(()=>lo(r),e))}function jf(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=H5());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function $5(r){let e=r.domSelectionRange();if(!e.focusNode)return null;let t=Dy(e.focusNode,e.focusOffset),n=Py(e.focusNode,e.focusOffset);if(t&&n&&t!=n){let i=n.pmViewDesc,s=r.domObserver.lastChangedTextNode;if(t==s||n==s)return s;if(!i||!i.isText(n.nodeValue))return n;if(r.input.compositionNode==n){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return n}}return t||n}function H5(){let r=document.createEvent("Event");return r.initEvent("event",!0,!0),r.timeStamp}function lo(r,e=!1){if(!(wr&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),jf(r),e||r.docView&&r.docView.dirty){let t=bl(r),n=r.state.selection;return t&&!t.eq(n)?r.dispatch(r.state.tr.setSelection(t)):(r.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?r.dispatch(r.state.tr.deleteSelection()):r.updateState(r.state),!0}return!1}}function j5(r,e){if(!r.dom.parentNode)return;let t=r.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),r.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),r.focus()},50)}const ts=xt&&Kr<15||Zn&&Ly<604;ft.copy=ht.cut=(r,e)=>{let t=e,n=r.state.selection,i=t.type=="cut";if(n.empty)return;let s=ts?null:t.clipboardData,o=n.content(),{dom:a,text:l}=Tl(r,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):j5(r,a),i&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function _5(r){return r.openStart==0&&r.openEnd==0&&r.content.childCount==1?r.content.firstChild:null}function V5(r,e){if(!r.dom.parentNode)return;let t=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,n=r.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=r.input.shiftKey&&r.input.lastKeyCode!=45;setTimeout(()=>{r.focus(),n.parentNode&&n.parentNode.removeChild(n),t?rs(r,n.value,null,i,e):rs(r,n.textContent,n.innerHTML,i,e)},50)}function rs(r,e,t,n,i){let s=Nf(r,e,t,n,r.state.selection.$from);if(r.someProp("handlePaste",l=>l(r,i,s||Z.empty)))return!0;if(!s)return!1;let o=_5(s),a=o?r.state.tr.replaceSelectionWith(o,n):r.state.tr.replaceSelection(s);return r.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function _f(r){let e=r.getData("text/plain")||r.getData("Text");if(e)return e;let t=r.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}ht.paste=(r,e)=>{let t=e;if(r.composing&&!wr)return;let n=ts?null:t.clipboardData,i=r.input.shiftKey&&r.input.lastKeyCode!=45;n&&rs(r,_f(n),n.getData("text/html"),i,t)?t.preventDefault():V5(r,t)};class Vf{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const q5=Ht?"altKey":"ctrlKey";function qf(r,e){let t=r.someProp("dragCopies",n=>!n(e));return t??!e[q5]}ft.dragstart=(r,e)=>{let t=e,n=r.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let i=r.state.selection,s=i.empty?null:r.posAtCoords(ao(t)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof le?i.to-1:i.to))){if(n&&n.mightDrag)o=le.create(r.state.doc,n.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=r.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=r.docView&&(o=le.create(r.state.doc,d.posBefore))}}let a=(o||r.state.selection).content(),{dom:l,text:u,slice:c}=Tl(r,a);(!t.dataTransfer.files.length||!rt||Gd>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(ts?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",ts||t.dataTransfer.setData("text/plain",u),r.dragging=new Vf(c,qf(r,t),o)},ft.dragend=r=>{let e=r.dragging;window.setTimeout(()=>{r.dragging==e&&(r.dragging=null)},50)},ht.dragover=ht.dragenter=(r,e)=>e.preventDefault(),ht.drop=(r,e)=>{try{W5(r,e,r.dragging)}finally{r.dragging=null}};function W5(r,e,t){if(!e.dataTransfer)return;let n=r.posAtCoords(ao(e));if(!n)return;let i=r.state.doc.resolve(n.pos),s=t&&t.slice;s?r.someProp("transformPasted",f=>{s=f(s,r,!1)}):s=Nf(r,_f(e.dataTransfer),ts?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(t&&qf(r,e));if(r.someProp("handleDrop",f=>f(r,e,s||Z.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?vd(r.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let l=r.state.tr;if(o){let{node:f}=t;f?f.replace(l):l.deleteSelection()}let u=l.mapping.map(a),c=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=l.doc;if(c?l.replaceRangeWith(u,u,s.content.firstChild):l.replaceRange(u,u,s),l.doc.eq(d))return;let h=l.doc.resolve(u);if(c&&le.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new le(h));else{let f=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((m,v,y,w)=>f=w),l.setSelection(xl(r,h,l.doc.resolve(f)))}r.focus(),r.dispatch(l.setMeta("uiEvent","drop"))}ft.focus=r=>{r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(()=>{r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&Sr(r)},20))},ft.blur=(r,e)=>{let t=e;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),t.relatedTarget&&r.dom.contains(t.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)},ft.beforeinput=(r,e)=>{if(rt&&wr&&e.inputType=="deleteContentBackward"){r.domObserver.flushSoon();let{domChangeCount:n}=r.input;setTimeout(()=>{if(r.input.domChangeCount!=n||(r.dom.blur(),r.focus(),r.someProp("handleKeyDown",s=>s(r,Sn(8,"Backspace")))))return;let{$cursor:i}=r.state.selection;i&&i.pos>0&&r.dispatch(r.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let r in ht)ft[r]=ht[r];function ns(r,e){if(r==e)return!0;for(let t in r)if(r[t]!==e[t])return!1;for(let t in e)if(!(t in r))return!1;return!0}class uo{constructor(e,t){this.toDOM=e,this.spec=t||Mn,this.side=this.spec.side||0}map(e,t,n,i){let{pos:s,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new pt(s-n,s-n,this)}valid(){return!0}eq(e){return this==e||e instanceof uo&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ns(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Zr{constructor(e,t){this.attrs=e,this.spec=t||Mn}map(e,t,n,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return s>=o?null:new pt(s,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Zr&&ns(this.attrs,e.attrs)&&ns(this.spec,e.spec)}static is(e){return e.type instanceof Zr}destroy(){}}class Dl{constructor(e,t){this.attrs=e,this.spec=t||Mn}map(e,t,n,i){let s=e.mapResult(t.from+i,1);if(s.deleted)return null;let o=e.mapResult(t.to+i,-1);return o.deleted||o.pos<=s.pos?null:new pt(s.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:i}=e.content.findIndex(t.from),s;return i==t.from&&!(s=e.child(n)).isText&&i+s.nodeSize==t.to}eq(e){return this==e||e instanceof Dl&&ns(this.attrs,e.attrs)&&ns(this.spec,e.spec)}destroy(){}}class pt{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new pt(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new pt(e,e,new uo(t,n))}static inline(e,t,n,i){return new pt(e,t,new Zr(n,i))}static node(e,t,n,i){return new pt(e,t,new Dl(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Zr}get widget(){return this.type instanceof uo}}const ri=[],Mn={};class je{constructor(e,t){this.local=e.length?e:ri,this.children=t.length?t:ri}static create(e,t){return t.length?co(t,e,0,Mn):dt}find(e,t,n){let i=[];return this.findInner(e??0,t??1e9,i,0,n),i}findInner(e,t,n,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=t&&a.to>=e&&(!s||s(a.spec))&&n.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,t-a,n,i+a,s)}}map(e,t,n){return this==dt||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Mn)}mapInner(e,t,n,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,n,i);l&&l.type.valid(t,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?U5(this.children,o||[],e,t,n,i,s):o?new je(o.sort(En),ri):dt}add(e,t){return t.length?this==dt?je.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let i,s=0;e.forEach((a,l)=>{let u=l+n,c;if(c=Uf(t,a,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,c,u+1):i.splice(s,0,l,l+a.nodeSize,co(c,a,u+1,Mn)),s+=3}});let o=Wf(s?Kf(t):t,-n);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new je(o.length?this.local.concat(o).sort(En):this.local,i||this.children)}remove(e){return e.length==0||this==dt?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,i=this.local;for(let s=0;s<n.length;s+=3){let o,a=n[s]+t,l=n[s+1]+t;for(let c=0,d;c<e.length;c++)(d=e[c])&&d.from>a&&d.to<l&&(e[c]=null,(o||(o=[])).push(d));if(!o)continue;n==this.children&&(n=this.children.slice());let u=n[s+2].removeInner(o,a+1);u!=dt?n[s+2]=u:(n.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new je(i,n):dt}forChild(e,t){if(this==dt)return this;if(t.isLeaf)return je.empty;let n,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let s=e+1,o=s+t.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof Zr){let u=Math.max(s,l.from)-s,c=Math.min(o,l.to)-s;u<c&&(i||(i=[])).push(l.copy(u,c))}}if(i){let a=new je(i.sort(En),ri);return n?new Qr([a,n]):a}return n||dt}eq(e){if(this==e)return!0;if(!(e instanceof je)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Pl(this.localsInner(e))}localsInner(e){if(this==dt)return ri;if(e.inlineContent||!this.local.some(Zr.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Zr||t.push(this.local[n]);return t}forEachSet(e){e(this)}}je.empty=new je([],[]),je.removeOverlap=Pl;const dt=je.empty;class Qr{constructor(e){this.members=e}map(e,t){const n=this.members.map(i=>i.map(e,t,Mn));return Qr.from(n)}forChild(e,t){if(t.isLeaf)return je.empty;let n=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,t);s!=dt&&(s instanceof Qr?n=n.concat(s.members):n.push(s))}return Qr.from(n)}eq(e){if(!(e instanceof Qr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!t)t=s;else{n&&(t=t.slice(),n=!1);for(let o=0;o<s.length;o++)t.push(s[o])}}return t?Pl(n?t:t.sort(En)):ri}static from(e){switch(e.length){case 0:return dt;case 1:return e[0];default:return new Qr(e.every(t=>t instanceof je)?e:e.reduce((t,n)=>t.concat(n instanceof je?n:n.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function U5(r,e,t,n,i,s,o){let a=r.slice();for(let u=0,c=s;u<t.maps.length;u++){let d=0;t.maps[u].forEach((h,f,m,v)=>{let y=v-m-(f-h);for(let w=0;w<a.length;w+=3){let k=a[w+1];if(k<0||h>k+c-d)continue;let E=a[w]+c-d;f>=E?a[w+1]=h<=E?-2:-1:h>=c&&y&&(a[w]+=y,a[w+1]+=y)}d+=y}),c=t.maps[u].map(c,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let c=t.map(r[u]+s),d=c-i;if(d<0||d>=n.content.size){l=!0;continue}let h=t.map(r[u+1]+s,-1),f=h-i,{index:m,offset:v}=n.content.findIndex(d),y=n.maybeChild(m);if(y&&v==d&&v+y.nodeSize==f){let w=a[u+2].mapInner(t,y,c+1,r[u]+s+1,o);w!=dt?(a[u]=d,a[u+1]=f,a[u+2]=w):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=K5(a,r,e,t,i,s,o),c=co(u,n,0,o);e=c.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,h=0;d<c.children.length;d+=3){let f=c.children[d];for(;h<a.length&&a[h]<f;)h+=3;a.splice(h,0,c.children[d],c.children[d+1],c.children[d+2])}}return new je(e.sort(En),a)}function Wf(r,e){if(!e||!r.length)return r;let t=[];for(let n=0;n<r.length;n++){let i=r[n];t.push(new pt(i.from+e,i.to+e,i.type))}return t}function K5(r,e,t,n,i,s,o){function a(l,u){for(let c=0;c<l.local.length;c++){let d=l.local[c].map(n,i,u);d?t.push(d):o.onRemove&&o.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)a(l.children[c+2],l.children[c]+u+1)}for(let l=0;l<r.length;l+=3)r[l+1]==-1&&a(r[l+2],e[l]+s+1);return t}function Uf(r,e,t){if(e.isLeaf)return null;let n=t+e.nodeSize,i=null;for(let s=0,o;s<r.length;s++)(o=r[s])&&o.from>t&&o.to<n&&((i||(i=[])).push(o),r[s]=null);return i}function Kf(r){let e=[];for(let t=0;t<r.length;t++)r[t]!=null&&e.push(r[t]);return e}function co(r,e,t,n){let i=[],s=!1;e.forEach((a,l)=>{let u=Uf(r,a,l+t);if(u){s=!0;let c=co(u,a,t+l+1,n);c!=dt&&i.push(l,l+a.nodeSize,c)}});let o=Wf(s?Kf(r):r,-t).sort(En);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(n.onRemove&&n.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new je(o,i):dt}function En(r,e){return r.from-e.from||r.to-e.to}function Pl(r){let e=r;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.from!=n.to)for(let i=t+1;i<e.length;i++){let s=e[i];if(s.from==n.from){s.to!=n.to&&(e==r&&(e=r.slice()),e[i]=s.copy(s.from,n.to),Gf(e,i+1,s.copy(n.to,s.to)));continue}else{s.from<n.to&&(e==r&&(e=r.slice()),e[t]=n.copy(n.from,s.from),Gf(e,i,n.copy(s.from,n.to)));break}}}return e}function Gf(r,e,t){for(;e<r.length&&En(t,r[e])>0;)e++;r.splice(e,0,t)}function Il(r){let e=[];return r.someProp("decorations",t=>{let n=t(r.state);n&&n!=dt&&e.push(n)}),r.cursorWrapper&&e.push(je.create(r.state.doc,[r.cursorWrapper.deco])),Qr.from(e)}const G5={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},J5=xt&&Kr<=11;class Y5{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 X5{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Y5,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;i<n.length;i++)this.queue.push(n[i]);xt&&Kr<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),J5&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.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,G5)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Sf(this.view)){if(this.suppressingSelectionUpdates)return Sr(this.view);if(xt&&Kr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&xn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let s=e.focusNode;s;s=Xn(s))t.add(s);for(let s=e.anchorNode;s;s=Xn(s))if(t.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Sf(e)&&!this.ignoreSelectionChange(n),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let c=0;c<t.length;c++){let d=this.registerMutation(t[c],l);d&&(s=s<0?d.from:Math.min(d.from,s),o=o<0?d.to:Math.max(d.to,o),d.typeOver&&(a=!0))}if($t&&l.length){let c=l.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,h]=c;d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let h of c){let f=h.parentNode;f&&f.nodeName=="LI"&&(!d||e3(e,d)!=f)&&h.remove()}}}else if((rt||ct)&&l.some(c=>c.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let c of l)if(c.nodeName=="BR"&&c.parentNode){let d=c.nextSibling;d&&d.nodeType==1&&d.contentEditable=="false"&&c.parentNode.removeChild(c)}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&no(n)&&(u=bl(e))&&u.eq(ge.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Sr(e),this.currentSelection.set(n),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),Z5(e)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Sr(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let d=e.addedNodes[c];t.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,s=e.nextSibling;if(xt&&Kr<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:d,nextSibling:h}=e.addedNodes[c];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(s=h)}let o=i&&i.parentNode==e.target?st(i)+1:0,a=n.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?st(s):e.target.childNodes.length,u=n.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Jf=new WeakMap,Yf=!1;function Z5(r){if(!Jf.has(r)&&(Jf.set(r,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(r.dom).whiteSpace)!==-1)){if(r.requiresGeckoHackNode=$t,Yf)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."),Yf=!0}}function Xf(r,e){let t=e.startContainer,n=e.startOffset,i=e.endContainer,s=e.endOffset,o=r.domAtPos(r.state.selection.anchor);return xn(o.node,o.offset,i,s)&&([t,n,i,s]=[i,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:i,focusOffset:s}}function Q5(r,e){if(e.getComposedRanges){let i=e.getComposedRanges(r.root)[0];if(i)return Xf(r,i)}let t;function n(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return r.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),r.dom.removeEventListener("beforeinput",n,!0),t?Xf(r,t):null}function e3(r,e){for(let t=e.parentNode;t&&t!=r.dom;t=t.parentNode){let n=r.docView.nearestDesc(t,!0);if(n&&n.node.isBlock)return t}return null}function t3(r,e,t){let{node:n,fromOffset:i,toOffset:s,from:o,to:a}=r.docView.parseRange(e,t),l=r.domSelectionRange(),u,c=l.anchorNode;if(c&&r.dom.contains(c.nodeType==1?c:c.parentNode)&&(u=[{node:c,offset:l.anchorOffset}],no(l)||u.push({node:l.focusNode,offset:l.focusOffset})),rt&&r.input.lastKeyCode===8)for(let y=s;y>i;y--){let w=n.childNodes[y-1],k=w.pmViewDesc;if(w.nodeName=="BR"&&!k){s=y;break}if(!k||k.size)break}let d=r.state.doc,h=r.someProp("domParser")||_r.fromSchema(r.state.schema),f=d.resolve(o),m=null,v=h.parse(n,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:s,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:r3,context:f});if(u&&u[0].pos!=null){let y=u[0].pos,w=u[1]&&u[1].pos;w==null&&(w=y),m={anchor:y+o,head:w+o}}return{doc:v,sel:m,from:o,to:a}}function r3(r){let e=r.pmViewDesc;if(e)return e.parseRule();if(r.nodeName=="BR"&&r.parentNode){if(ct&&/^(ul|ol)$/i.test(r.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(r.parentNode.lastChild==r||ct&&/^(tr|table)$/i.test(r.parentNode.nodeName))return{ignore:!0}}else if(r.nodeName=="IMG"&&r.getAttribute("mark-placeholder"))return{ignore:!0};return null}const n3=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function i3(r,e,t,n,i){let s=r.input.compositionPendingChanges||(r.composing?r.input.compositionID:0);if(r.input.compositionPendingChanges=0,e<0){let P=r.input.lastSelectionTime>Date.now()-50?r.input.lastSelectionOrigin:null,L=bl(r,P);if(L&&!r.state.selection.eq(L)){if(rt&&wr&&r.input.lastKeyCode===13&&Date.now()-100<r.input.lastKeyCodeTime&&r.someProp("handleKeyDown",F=>F(r,Sn(13,"Enter"))))return;let z=r.state.tr.setSelection(L);P=="pointer"?z.setMeta("pointer",!0):P=="key"&&z.scrollIntoView(),s&&z.setMeta("composition",s),r.dispatch(z)}return}let o=r.state.doc.resolve(e),a=o.sharedDepth(t);e=o.before(a+1),t=r.state.doc.resolve(t).after(a+1);let l=r.state.selection,u=t3(r,e,t),c=r.state.doc,d=c.slice(u.from,u.to),h,f;r.input.lastKeyCode===8&&Date.now()-100<r.input.lastKeyCodeTime?(h=r.state.selection.to,f="end"):(h=r.state.selection.from,f="start"),r.input.lastKeyCode=null;let m=a3(d.content,u.doc.content,u.from,h,f);if(m&&r.input.domChangeCount++,(Zn&&r.input.lastIOSEnter>Date.now()-225||wr)&&i.some(P=>P.nodeType==1&&!n3.test(P.nodeName))&&(!m||m.endA>=m.endB)&&r.someProp("handleKeyDown",P=>P(r,Sn(13,"Enter")))){r.input.lastIOSEnter=0;return}if(!m)if(n&&l instanceof we&&!l.empty&&l.$head.sameParent(l.$anchor)&&!r.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let P=Zf(r,r.state.doc,u.sel);if(P&&!P.eq(r.state.selection)){let L=r.state.tr.setSelection(P);s&&L.setMeta("composition",s),r.dispatch(L)}}return}r.state.selection.from<r.state.selection.to&&m.start==m.endB&&r.state.selection instanceof we&&(m.start>r.state.selection.from&&m.start<=r.state.selection.from+2&&r.state.selection.from>=u.from?m.start=r.state.selection.from:m.endA<r.state.selection.to&&m.endA>=r.state.selection.to-2&&r.state.selection.to<=u.to&&(m.endB+=r.state.selection.to-m.endA,m.endA=r.state.selection.to)),xt&&Kr<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)==" "&&(m.start--,m.endA--,m.endB--);let v=u.doc.resolveNoCache(m.start-u.from),y=u.doc.resolveNoCache(m.endB-u.from),w=c.resolve(m.start),k=v.sameParent(y)&&v.parent.inlineContent&&w.end()>=m.endA;if((Zn&&r.input.lastIOSEnter>Date.now()-225&&(!k||i.some(P=>P.nodeName=="DIV"||P.nodeName=="P"))||!k&&v.pos<u.doc.content.size&&(!v.sameParent(y)||!v.parent.inlineContent)&&v.pos<y.pos&&!/\S/.test(u.doc.textBetween(v.pos,y.pos,"","")))&&r.someProp("handleKeyDown",P=>P(r,Sn(13,"Enter")))){r.input.lastIOSEnter=0;return}if(r.state.selection.anchor>m.start&&o3(c,m.start,m.endA,v,y)&&r.someProp("handleKeyDown",P=>P(r,Sn(8,"Backspace")))){wr&&rt&&r.domObserver.suppressSelectionUpdates();return}rt&&m.endB==m.start&&(r.input.lastChromeDelete=Date.now()),wr&&!k&&v.start()!=y.start()&&y.parentOffset==0&&v.depth==y.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,y=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{r.someProp("handleKeyDown",function(P){return P(r,Sn(13,"Enter"))})},20));let E=m.start,I=m.endA,A=P=>{let L=P||r.state.tr.replace(E,I,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let z=Zf(r,L.doc,u.sel);z&&!(rt&&r.composing&&z.empty&&(m.start!=m.endB||r.input.lastChromeDelete<Date.now()-100)&&(z.head==E||z.head==L.mapping.map(I)-1)||xt&&z.empty&&z.head==E)&&L.setSelection(z)}return s&&L.setMeta("composition",s),L.scrollIntoView()},N;if(k)if(v.pos==y.pos){xt&&Kr<=11&&v.parentOffset==0&&(r.domObserver.suppressSelectionUpdates(),setTimeout(()=>Sr(r),20));let P=A(r.state.tr.delete(E,I)),L=c.resolve(m.start).marksAcross(c.resolve(m.endA));L&&P.ensureMarks(L),r.dispatch(P)}else if(m.endA==m.endB&&(N=s3(v.parent.content.cut(v.parentOffset,y.parentOffset),w.parent.content.cut(w.parentOffset,m.endA-w.start())))){let P=A(r.state.tr);N.type=="add"?P.addMark(E,I,N.mark):P.removeMark(E,I,N.mark),r.dispatch(P)}else if(v.parent.child(v.index()).isText&&v.index()==y.index()-(y.textOffset?0:1)){let P=v.parent.textBetween(v.parentOffset,y.parentOffset),L=()=>A(r.state.tr.insertText(P,E,I));r.someProp("handleTextInput",z=>z(r,E,I,P,L))||r.dispatch(L())}else r.dispatch(A());else r.dispatch(A())}function Zf(r,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:xl(r,e.resolve(t.anchor),e.resolve(t.head))}function s3(r,e){let t=r.firstChild.marks,n=e.firstChild.marks,i=t,s=n,o,a,l;for(let c=0;c<n.length;c++)i=n[c].removeFromSet(i);for(let c=0;c<t.length;c++)s=t[c].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=c=>c.mark(a.addToSet(c.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=c=>c.mark(a.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(l(e.child(c)));if(j.from(u).eq(r))return{mark:a,type:o}}function o3(r,e,t,n,i){if(t-e<=i.pos-n.pos||Rl(n,!0,!1)<i.pos)return!1;let s=r.resolve(e);if(!n.parent.isTextblock){let a=s.nodeAfter;return a!=null&&t==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=r.resolve(Rl(s,!0,!0));return!o.parent.isTextblock||o.pos>t||Rl(o,!0,!1)<t?!1:n.parent.content.cut(n.parentOffset).eq(o.parent.content)}function Rl(r,e,t){let n=r.depth,i=e?r.end():r.pos;for(;n>0&&(e||r.indexAfter(n)==r.node(n).childCount);)n--,i++,e=!1;if(t){let s=r.node(n).maybeChild(r.indexAfter(n));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function a3(r,e,t,n,i){let s=r.findDiffStart(e,t);if(s==null)return null;let{a:o,b:a}=r.findDiffEnd(e,t+r.size,t+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));n-=o+l-s}if(o<s&&r.size<e.size){let l=n<=s&&n>=o?s-n:0;s-=l,s&&s<e.size&&Qf(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}else if(a<s){let l=n<=s&&n>=a?s-n:0;s-=l,s&&s<r.size&&Qf(r.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function Qf(r){if(r.length!=2)return!1;let e=r.charCodeAt(0),t=r.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class eh{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new T5,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(sh),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=nh(this),rh(this),this.nodeViews=ih(this),this.docView=cf(this.state.doc,th(this),Il(this),this.dom,this),this.domObserver=new X5(this,(n,i,s,o)=>i3(this,n,i,s,o)),this.domObserver.start(),C5(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&El(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(sh),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(jf(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let f=ih(this);u3(f,this.nodeViews)&&(this.nodeViews=f,s=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&El(this),this.editable=nh(this),rh(this);let l=Il(this),u=th(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,u,l);(d||!e.selection.eq(i.selection))&&(o=!0);let h=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&$y(this);if(o){this.domObserver.stop();let f=d&&(xt||rt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&l3(i.selection,e.selection);if(d){let m=rt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=$5(this)),(s||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=cf(e.doc,u,l,this.dom,this)),m&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&u5(this))?Sr(this,f):(wf(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():h&&Hy(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof le){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Yd(this,t.getBoundingClientRect(),e)}else Yd(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let n=this.directPlugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let n=this.state.plugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,i=-1;if(this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let s=n.from+(this.state.doc.content.size-t.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==n.node&&(i=s)}this.dragging=new Vf(e.slice,e.move,i<0?void 0:le.create(this.state.doc,i))}someProp(e,t){let n=this._props&&this._props[e],i;if(n!=null&&(i=t?t(n):n))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=t?t(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=t?t(a):a))return i}}hasFocus(){if(xt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&jy(this.dom),Sr(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Uy(this,e)}coordsAtPos(e,t=1){return rf(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Xy(this,t||this.state,e)}pasteHTML(e,t){return rs(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return rs(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Tl(this,e)}destroy(){this.docView&&(M5(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Il(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Oy())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return A5(this,e)}domSelectionRange(){let e=this.domSelection();return e?ct&&this.root.nodeType===11&&Ry(this.dom.ownerDocument)==this.dom&&Q5(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}eh.prototype.dispatch=function(r){let e=this._props.dispatchTransaction;e?e.call(this,r):this.updateState(this.state.apply(r))};function th(r){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(r.editable),r.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(r.state)),t)for(let n in t)n=="class"?e.class+=" "+t[n]:n=="style"?e.style=(e.style?e.style+";":"")+t[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(t[n]))}),e.translate||(e.translate="no"),[pt.node(0,r.state.doc.content.size,e)]}function rh(r){if(r.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),r.cursorWrapper={dom:e,deco:pt.widget(r.state.selection.from,e,{raw:!0,marks:r.markCursor})}}else r.cursorWrapper=null}function nh(r){return!r.someProp("editable",e=>e(r.state)===!1)}function l3(r,e){let t=Math.min(r.$anchor.sharedDepth(r.head),e.$anchor.sharedDepth(e.head));return r.$anchor.start(t)!=e.$anchor.start(t)}function ih(r){let e=Object.create(null);function t(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return r.someProp("nodeViews",t),r.someProp("markViews",t),e}function u3(r,e){let t=0,n=0;for(let i in r){if(r[i]!=e[i])return!0;t++}for(let i in e)n++;return t!=n}function sh(r){if(r.spec.state||r.spec.filterTransaction||r.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var en={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:"'"},fo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},c3=typeof navigator<"u"&&/Mac/.test(navigator.platform),d3=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ot=0;ot<10;ot++)en[48+ot]=en[96+ot]=String(ot);for(var ot=1;ot<=24;ot++)en[ot+111]="F"+ot;for(var ot=65;ot<=90;ot++)en[ot]=String.fromCharCode(ot+32),fo[ot]=String.fromCharCode(ot);for(var zl in en)fo.hasOwnProperty(zl)||(fo[zl]=en[zl]);function f3(r){var e=c3&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||d3&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?fo:en)[r.keyCode]||r.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const h3=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),p3=typeof navigator<"u"&&/Win/.test(navigator.platform);function m3(r){let e=r.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let n,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))h3?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(t="Alt-"+t),i&&(t="Ctrl-"+t),o&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function g3(r){let e=Object.create(null);for(let t in r)e[m3(t)]=r[t];return e}function Ll(r,e,t=!0){return e.altKey&&(r="Alt-"+r),e.ctrlKey&&(r="Ctrl-"+r),e.metaKey&&(r="Meta-"+r),t&&e.shiftKey&&(r="Shift-"+r),r}function v3(r){return new qe({props:{handleKeyDown:Bl(r)}})}function Bl(r){let e=g3(r);return function(t,n){let i=f3(n),s,o=e[Ll(i,n)];if(o&&o(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let a=e[Ll(i,n,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(p3&&n.ctrlKey&&n.altKey)&&(s=en[n.keyCode])&&s!=i){let a=e[Ll(s,n)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}var y3=Object.defineProperty,Fl=(r,e)=>{for(var t in e)y3(r,t,{get:e[t],enumerable:!0})};function ho(r){const{state:e,transaction:t}=r;let{selection:n}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return n},get doc(){return i},get tr(){return n=t.selection,i=t.doc,s=t.storedMarks,t}}}var po=class{constructor(r){this.editor=r.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=r.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:r,editor:e,state:t}=this,{view:n}=e,{tr:i}=t,s=this.buildProps(i);return Object.fromEntries(Object.entries(r).map(([o,a])=>[o,(...u)=>{const c=a(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&n.dispatch(i),c}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(r,e=!0){const{rawCommands:t,editor:n,state:i}=this,{view:s}=n,o=[],a=!!r,l=r||i.tr,u=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(l),o.every(d=>d===!0)),c={...Object.fromEntries(Object.entries(t).map(([d,h])=>[d,(...m)=>{const v=this.buildProps(l,e),y=h(...m)(v);return o.push(y),c}])),run:u};return c}createCan(r){const{rawCommands:e,state:t}=this,n=!1,i=r||t.tr,s=this.buildProps(i,n);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>l(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,n)}}buildProps(r,e=!0){const{rawCommands:t,editor:n,state:i}=this,{view:s}=n,o={tr:r,editor:n,view:s,state:ho({state:i,transaction:r}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(r,e),can:()=>this.createCan(r),get commands(){return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...u)=>l(...u)(o)]))}};return o}},oh={};Fl(oh,{blur:()=>b3,clearContent:()=>w3,clearNodes:()=>x3,command:()=>S3,createParagraphNear:()=>k3,cut:()=>T3,deleteCurrentNode:()=>C3,deleteNode:()=>M3,deleteRange:()=>E3,deleteSelection:()=>A3,enter:()=>O3,exitCode:()=>N3,extendMarkRange:()=>D3,first:()=>P3,focus:()=>I3,forEach:()=>R3,insertContent:()=>z3,insertContentAt:()=>F3,joinBackward:()=>j3,joinDown:()=>H3,joinForward:()=>_3,joinItemBackward:()=>V3,joinItemForward:()=>q3,joinTextblockBackward:()=>W3,joinTextblockForward:()=>U3,joinUp:()=>$3,keyboardShortcut:()=>G3,lift:()=>J3,liftEmptyBlock:()=>Y3,liftListItem:()=>X3,newlineInCode:()=>Z3,resetAttributes:()=>Q3,scrollIntoView:()=>e6,selectAll:()=>t6,selectNodeBackward:()=>r6,selectNodeForward:()=>n6,selectParentNode:()=>i6,selectTextblockEnd:()=>s6,selectTextblockStart:()=>o6,setContent:()=>a6,setMark:()=>O6,setMeta:()=>N6,setNode:()=>D6,setNodeSelection:()=>P6,setTextDirection:()=>I6,setTextSelection:()=>R6,sinkListItem:()=>z6,splitBlock:()=>L6,splitListItem:()=>B6,toggleList:()=>F6,toggleMark:()=>$6,toggleNode:()=>H6,toggleWrap:()=>j6,undoInputRule:()=>_6,unsetAllMarks:()=>V6,unsetMark:()=>q6,unsetTextDirection:()=>W6,updateAttributes:()=>U6,wrapIn:()=>K6,wrapInList:()=>G6});var b3=()=>({editor:r,view:e})=>(requestAnimationFrame(()=>{var t;r.isDestroyed||(e.dom.blur(),(t=window?.getSelection())==null||t.removeAllRanges())}),!0),w3=(r=!0)=>({commands:e})=>e.setContent("",{emitUpdate:r}),x3=()=>({state:r,tr:e,dispatch:t})=>{const{selection:n}=e,{ranges:i}=n;return t&&i.forEach(({$from:s,$to:o})=>{r.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,d=u.resolve(c.map(l)),h=u.resolve(c.map(l+a.nodeSize)),f=d.blockRange(h);if(!f)return;const m=Wn(f);if(a.type.isTextblock){const{defaultType:v}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(f.start,v)}(m||m===0)&&e.lift(f,m)})}),!0},S3=r=>e=>r(e),k3=()=>({state:r,dispatch:e})=>Hd(r,e),T3=(r,e)=>({editor:t,tr:n})=>{const{state:i}=t,s=i.doc.slice(r.from,r.to);n.deleteRange(r.from,r.to);const o=n.mapping.map(e);return n.insert(o,s.content),n.setSelection(new we(n.doc.resolve(Math.max(o-1,0)))),!0},C3=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,n=t.$anchor.node();if(n.content.size>0)return!1;const i=r.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===n.type){if(e){const a=i.before(s),l=i.after(s);r.delete(a,l).scrollIntoView()}return!0}return!1};function Ye(r,e){if(typeof r=="string"){if(!e.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return e.nodes[r]}return r}var M3=r=>({tr:e,state:t,dispatch:n})=>{const i=Ye(r,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(n){const l=s.before(o),u=s.after(o);e.delete(l,u).scrollIntoView()}return!0}return!1},E3=r=>({tr:e,dispatch:t})=>{const{from:n,to:i}=r;return t&&e.delete(n,i),!0},A3=()=>({state:r,dispatch:e})=>ol(r,e),O3=()=>({commands:r})=>r.keyboardShortcut("Enter"),N3=()=>({state:r,dispatch:e})=>py(r,e);function $l(r){return Object.prototype.toString.call(r)==="[object RegExp]"}function mo(r,e,t={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>t.strict?e[i]===r[i]:$l(e[i])?e[i].test(r[i]):e[i]===r[i]):!0}function ah(r,e,t={}){return r.find(n=>n.type===e&&mo(Object.fromEntries(Object.keys(t).map(i=>[i,n.attrs[i]])),t))}function lh(r,e,t={}){return!!ah(r,e,t)}function Hl(r,e,t){var n;if(!r||!e)return;let i=r.parent.childAfter(r.parentOffset);if((!i.node||!i.node.marks.some(c=>c.type===e))&&(i=r.parent.childBefore(r.parentOffset)),!i.node||!i.node.marks.some(c=>c.type===e)||(t=t||((n=i.node.marks[0])==null?void 0:n.attrs),!ah([...i.node.marks],e,t)))return;let o=i.index,a=r.start()+i.offset,l=o+1,u=a+i.node.nodeSize;for(;o>0&&lh([...r.parent.child(o-1).marks],e,t);)o-=1,a-=r.parent.child(o).nodeSize;for(;l<r.parent.childCount&&lh([...r.parent.child(l).marks],e,t);)u+=r.parent.child(l).nodeSize,l+=1;return{from:a,to:u}}function kr(r,e){if(typeof r=="string"){if(!e.marks[r])throw Error(`There is no mark type named '${r}'. Maybe you forgot to add the extension?`);return e.marks[r]}return r}var D3=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const s=kr(r,n.schema),{doc:o,selection:a}=t,{$from:l,from:u,to:c}=a;if(i){const d=Hl(l,s,e);if(d&&d.from<=u&&d.to>=c){const h=we.create(o,d.from,d.to);t.setSelection(h)}}return!0},P3=r=>e=>{const t=typeof r=="function"?r(e):r;for(let n=0;n<t.length;n+=1)if(t[n](e))return!0;return!1};function jl(r){return r instanceof we}function Tr(r=0,e=0,t=0){return Math.min(Math.max(r,e),t)}function uh(r,e=null){if(!e)return null;const t=ge.atStart(r),n=ge.atEnd(r);if(e==="start"||e===!0)return t;if(e==="end")return n;const i=t.from,s=n.to;return e==="all"?we.create(r,Tr(0,i,s),Tr(r.content.size,i,s)):we.create(r,Tr(e,i,s),Tr(e,i,s))}function ch(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function go(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var I3=(r=null,e={})=>({editor:t,view:n,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(go()||ch())&&n.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(n.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(n.hasFocus()&&r===null||r===!1)return!0;if(s&&r===null&&!jl(t.state.selection))return o(),!0;const a=uh(i.doc,r)||t.state.selection,l=t.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},R3=(r,e)=>t=>r.every((n,i)=>e(n,{...t,index:i})),z3=(r,e)=>({tr:t,commands:n})=>n.insertContentAt({from:t.selection.from,to:t.selection.to},r,e),dh=r=>{const e=r.childNodes;for(let t=e.length-1;t>=0;t-=1){const n=e[t];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?r.removeChild(n):n.nodeType===1&&dh(n)}return r};function vo(r){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${r}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return dh(t)}function is(r,e,t){if(r instanceof jr||r instanceof j)return r;t={slice:!0,parseOptions:{},...t};const n=typeof r=="object"&&r!==null,i=typeof r=="string";if(n)try{if(Array.isArray(r)&&r.length>0)return j.fromArray(r.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(r);return t.errorOnInvalidContent&&o.check(),o}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",s),is("",e,t)}if(i){if(t.errorOnInvalidContent){let o=!1,a="";const l=new Xc({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(t.slice?_r.fromSchema(l).parseSlice(vo(r),t.parseOptions):_r.fromSchema(l).parse(vo(r),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=_r.fromSchema(e);return t.slice?s.parseSlice(vo(r),t.parseOptions).content:s.parse(vo(r),t.parseOptions)}return is("",e,t)}function L3(r,e,t){const n=r.steps.length-1;if(n<e)return;const i=r.steps[n];if(!(i instanceof et||i instanceof tt))return;const s=r.mapping.maps[n];let o=0;s.forEach((a,l,u,c)=>{o===0&&(o=c)}),r.setSelection(ge.near(r.doc.resolve(o),t))}var B3=r=>!("type"in r),F3=(r,e,t)=>({tr:n,dispatch:i,editor:s})=>{var o;if(i){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let a;const l=y=>{s.emit("contentError",{editor:s,error:y,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{is(e,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(y){l(y)}try{a=is(e,s.schema,{parseOptions:u,errorOnInvalidContent:(o=t.errorOnInvalidContent)!=null?o:s.options.enableContentCheck})}catch(y){return l(y),!1}let{from:c,to:d}=typeof r=="number"?{from:r,to:r}:{from:r.from,to:r.to},h=!0,f=!0;if((B3(a)?a:[a]).forEach(y=>{y.check(),h=h?y.isText&&y.marks.length===0:!1,f=f?y.isBlock:!1}),c===d&&f){const{parent:y}=n.doc.resolve(c);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(c-=1,d+=1)}let v;if(h){if(Array.isArray(e))v=e.map(y=>y.text||"").join("");else if(e instanceof j){let y="";e.forEach(w=>{w.text&&(y+=w.text)}),v=y}else typeof e=="object"&&e&&e.text?v=e.text:v=e;n.insertText(v,c,d)}else{v=a;const y=n.doc.resolve(c),w=y.node(),k=y.parentOffset===0,E=w.isText||w.isTextblock,I=w.content.size>0;k&&E&&I&&(c=Math.max(0,c-1)),n.replaceWith(c,d,v)}t.updateSelection&&L3(n,n.steps.length-1,-1),t.applyInputRules&&n.setMeta("applyInputRules",{from:c,text:v}),t.applyPasteRules&&n.setMeta("applyPasteRules",{from:c,text:v})}return!0},$3=()=>({state:r,dispatch:e})=>dy(r,e),H3=()=>({state:r,dispatch:e})=>fy(r,e),j3=()=>({state:r,dispatch:e})=>Id(r,e),_3=()=>({state:r,dispatch:e})=>Bd(r,e),V3=()=>({state:r,dispatch:e,tr:t})=>{try{const n=Qs(r.doc,r.selection.$from.pos,-1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}},q3=()=>({state:r,dispatch:e,tr:t})=>{try{const n=Qs(r.doc,r.selection.$from.pos,1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}},W3=()=>({state:r,dispatch:e})=>uy(r,e),U3=()=>({state:r,dispatch:e})=>cy(r,e);function fh(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function K3(r){const e=r.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let n,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))go()||fh()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return n&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),o&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}var G3=r=>({editor:e,view:t,tr:n,dispatch:i})=>{const s=K3(r).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{t.someProp("handleKeyDown",u=>u(t,a))});return l?.steps.forEach(u=>{const c=u.map(n.mapping);c&&i&&n.maybeStep(c)}),!0};function tn(r,e,t={}){const{from:n,to:i,empty:s}=r.selection,o=e?Ye(e,r.schema):null,a=[];r.doc.nodesBetween(n,i,(d,h)=>{if(d.isText)return;const f=Math.max(n,h),m=Math.min(i,h+d.nodeSize);a.push({node:d,from:f,to:m})});const l=i-n,u=a.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>mo(d.node.attrs,t,{strict:!1}));return s?!!u.length:u.reduce((d,h)=>d+h.to-h.from,0)>=l}var J3=(r,e={})=>({state:t,dispatch:n})=>{const i=Ye(r,t.schema);return tn(t,i,e)?hy(t,n):!1},Y3=()=>({state:r,dispatch:e})=>jd(r,e),X3=r=>({state:e,dispatch:t})=>{const n=Ye(r,e.schema);return Cy(n)(e,t)},Z3=()=>({state:r,dispatch:e})=>$d(r,e);function yo(r,e){return e.nodes[r]?"node":e.marks[r]?"mark":null}function hh(r,e){const t=typeof e=="string"?[e]:e;return Object.keys(r).reduce((n,i)=>(t.includes(i)||(n[i]=r[i]),n),{})}var Q3=(r,e)=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const a=yo(typeof r=="string"?r:r.name,n.schema);if(!a)return!1;a==="node"&&(s=Ye(r,n.schema)),a==="mark"&&(o=kr(r,n.schema));let l=!1;return t.selection.ranges.forEach(u=>{n.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,d)=>{s&&s===c.type&&(l=!0,i&&t.setNodeMarkup(d,void 0,hh(c.attrs,e))),o&&c.marks.length&&c.marks.forEach(h=>{o===h.type&&(l=!0,i&&t.addMark(d,d+c.nodeSize,o.create(hh(h.attrs,e))))})})}),l},e6=()=>({tr:r,dispatch:e})=>(e&&r.scrollIntoView(),!0),t6=()=>({tr:r,dispatch:e})=>{if(e){const t=new Dt(r.doc);r.setSelection(t)}return!0},r6=()=>({state:r,dispatch:e})=>zd(r,e),n6=()=>({state:r,dispatch:e})=>Fd(r,e),i6=()=>({state:r,dispatch:e})=>vy(r,e),s6=()=>({state:r,dispatch:e})=>wy(r,e),o6=()=>({state:r,dispatch:e})=>by(r,e);function _l(r,e,t={},n={}){return is(r,e,{slice:!1,parseOptions:t,errorOnInvalidContent:n.errorOnInvalidContent})}var a6=(r,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:n={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if(n.preserveWhitespace!=="full"){const u=_l(r,i.schema,n,{errorOnInvalidContent:e??i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!t),!0}return o&&s.setMeta("preventUpdate",!t),a.insertContentAt({from:0,to:l.content.size},r,{parseOptions:n,errorOnInvalidContent:e??i.options.enableContentCheck})};function ph(r,e){const t=kr(e,r.schema),{from:n,to:i,empty:s}=r.selection,o=[];s?(r.storedMarks&&o.push(...r.storedMarks),o.push(...r.selection.$head.marks())):r.doc.nodesBetween(n,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===t.name);return a?{...a.attrs}:{}}function l6(r,e){const t=new Sd(r);return e.forEach(n=>{n.steps.forEach(i=>{t.step(i)})}),t}function u6(r){for(let e=0;e<r.edgeCount;e+=1){const{type:t}=r.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function c6(r,e){for(let t=r.depth;t>0;t-=1){const n=r.node(t);if(e(n))return{pos:t>0?r.before(t):0,start:r.start(t),depth:t,node:n}}}function bo(r){return e=>c6(e.$from,r)}function ue(r,e,t){return r.config[e]===void 0&&r.parent?ue(r.parent,e,t):typeof r.config[e]=="function"?r.config[e].bind({...t,parent:r.parent?ue(r.parent,e,t):null}):r.config[e]}function Vl(r){return r.map(e=>{const t={name:e.name,options:e.options,storage:e.storage},n=ue(e,"addExtensions",t);return n?[e,...Vl(n())]:e}).flat(10)}function ql(r,e){const t=bn.fromSchema(e).serializeFragment(r),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function mh(r){return typeof r=="function"}function Ie(r,e=void 0,...t){return mh(r)?e?r.bind(e)(...t):r(...t):r}function d6(r={}){return Object.keys(r).length===0&&r.constructor===Object}function ni(r){const e=r.filter(i=>i.type==="extension"),t=r.filter(i=>i.type==="node"),n=r.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:n}}function gh(r){const e=[],{nodeExtensions:t,markExtensions:n}=ni(r),i=[...t,...n],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return r.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage,extensions:i},l=ue(o,"addGlobalAttributes",a);if(!l)return;l().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([h,f])=>{e.push({type:d,name:h,attribute:{...s,...f}})})})})}),i.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=ue(o,"addAttributes",a);if(!l)return;const u=l();Object.entries(u).forEach(([c,d])=>{const h={...s,...d};typeof h?.default=="function"&&(h.default=h.default()),h?.isRequired&&h?.default===void 0&&delete h.default,e.push({type:o.name,name:c,attribute:h})})}),e}function Ce(...r){return r.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([i,s])=>{if(!n[i]){n[i]=s;return}if(i==="class"){const a=s?String(s).split(" "):[],l=n[i]?n[i].split(" "):[],u=a.filter(c=>!l.includes(c));n[i]=[...l,...u].join(" ")}else if(i==="style"){const a=s?s.split(";").map(c=>c.trim()).filter(Boolean):[],l=n[i]?n[i].split(";").map(c=>c.trim()).filter(Boolean):[],u=new Map;l.forEach(c=>{const[d,h]=c.split(":").map(f=>f.trim());u.set(d,h)}),a.forEach(c=>{const[d,h]=c.split(":").map(f=>f.trim());u.set(d,h)}),n[i]=Array.from(u.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else n[i]=s}),n},{})}function ss(r,e){return e.filter(t=>t.type===r.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(r.attrs)||{}:{[t.name]:r.attrs[t.name]}).reduce((t,n)=>Ce(t,n),{})}function f6(r){return typeof r!="string"?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):r==="true"?!0:r==="false"?!1:r}function vh(r,e){return"style"in r?r:{...r,getAttrs:t=>{const n=r.getAttrs?r.getAttrs(t):r.attrs;if(n===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(t):f6(t.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...n,...i}}}}function yh(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>e==="attrs"&&d6(t)?!1:t!=null))}function bh(r){var e,t;const n={};return!((e=r?.attribute)!=null&&e.isRequired)&&"default"in(r?.attribute||{})&&(n.default=r.attribute.default),((t=r?.attribute)==null?void 0:t.validate)!==void 0&&(n.validate=r.attribute.validate),[r.name,n]}function h6(r,e){var t;const n=gh(r),{nodeExtensions:i,markExtensions:s}=ni(r),o=(t=i.find(u=>ue(u,"topNode")))==null?void 0:t.name,a=Object.fromEntries(i.map(u=>{const c=n.filter(w=>w.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},h=r.reduce((w,k)=>{const E=ue(k,"extendNodeSchema",d);return{...w,...E?E(u):{}}},{}),f=yh({...h,content:Ie(ue(u,"content",d)),marks:Ie(ue(u,"marks",d)),group:Ie(ue(u,"group",d)),inline:Ie(ue(u,"inline",d)),atom:Ie(ue(u,"atom",d)),selectable:Ie(ue(u,"selectable",d)),draggable:Ie(ue(u,"draggable",d)),code:Ie(ue(u,"code",d)),whitespace:Ie(ue(u,"whitespace",d)),linebreakReplacement:Ie(ue(u,"linebreakReplacement",d)),defining:Ie(ue(u,"defining",d)),isolating:Ie(ue(u,"isolating",d)),attrs:Object.fromEntries(c.map(bh))}),m=Ie(ue(u,"parseHTML",d));m&&(f.parseDOM=m.map(w=>vh(w,c)));const v=ue(u,"renderHTML",d);v&&(f.toDOM=w=>v({node:w,HTMLAttributes:ss(w,c)}));const y=ue(u,"renderText",d);return y&&(f.toText=y),[u.name,f]})),l=Object.fromEntries(s.map(u=>{const c=n.filter(y=>y.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},h=r.reduce((y,w)=>{const k=ue(w,"extendMarkSchema",d);return{...y,...k?k(u):{}}},{}),f=yh({...h,inclusive:Ie(ue(u,"inclusive",d)),excludes:Ie(ue(u,"excludes",d)),group:Ie(ue(u,"group",d)),spanning:Ie(ue(u,"spanning",d)),code:Ie(ue(u,"code",d)),attrs:Object.fromEntries(c.map(bh))}),m=Ie(ue(u,"parseHTML",d));m&&(f.parseDOM=m.map(y=>vh(y,c)));const v=ue(u,"renderHTML",d);return v&&(f.toDOM=y=>v({mark:y,HTMLAttributes:ss(y,c)})),[u.name,f]}));return new Xc({topNode:o,nodes:a,marks:l})}function p6(r){const e=r.filter((t,n)=>r.indexOf(t)!==n);return Array.from(new Set(e))}function Wl(r){return r.sort((t,n)=>{const i=ue(t,"priority")||100,s=ue(n,"priority")||100;return i>s?-1:i<s?1:0})}function wh(r){const e=Wl(Vl(r)),t=p6(e.map(n=>n.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(n=>`'${n}'`).join(", ")}]. This can lead to issues.`),e}function xh(r,e,t){const{from:n,to:i}=e,{blockSeparator:s=`
|
|
540
|
+
|
|
541
|
+
`,textSerializers:o={}}=t||{};let a="";return r.nodesBetween(n,i,(l,u,c,d)=>{var h;l.isBlock&&u>n&&(a+=s);const f=o?.[l.type.name];if(f)return c&&(a+=f({node:l,pos:u,parent:c,index:d,range:e})),!1;l.isText&&(a+=(h=l?.text)==null?void 0:h.slice(Math.max(n,u)-u,i-u))}),a}function Sh(r,e){const t={from:0,to:r.content.size};return xh(r,t,e)}function Ul(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function m6(r,e){const t=Ye(e,r.schema),{from:n,to:i}=r.selection,s=[];r.doc.nodesBetween(n,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===t.name);return o?{...o.attrs}:{}}function g6(r,e){const t=yo(typeof e=="string"?e:e.name,r.schema);return t==="node"?m6(r,e):t==="mark"?ph(r,e):{}}function v6(r,e=JSON.stringify){const t={};return r.filter(n=>{const i=e(n);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function y6(r){const e=v6(r);return e.length===1?e:e.filter((t,n)=>!e.filter((s,o)=>o!==n).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function b6(r){const{mapping:e,steps:t}=r,n=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=t[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const u=e.slice(s).map(a,-1),c=e.slice(s).map(l),d=e.invert().map(u,-1),h=e.invert().map(c);n.push({oldRange:{from:d,to:h},newRange:{from:u,to:c}})})}),y6(n)}function kh(r,e,t){const n=[];return r===e?t.resolve(r).marks().forEach(i=>{const s=t.resolve(r),o=Hl(s,i.type);o&&n.push({mark:i,...o})}):t.nodesBetween(r,e,(i,s)=>{!i||i?.nodeSize===void 0||n.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),n}var w6=(r,e,t,n=20)=>{const i=r.doc.resolve(t);let s=n,o=null;for(;s>0&&o===null;){const a=i.node(s);a?.type.name===e?o=a:s-=1}return[o,s]};function Kl(r,e){return e.nodes[r]||e.marks[r]||null}function wo(r,e,t){return Object.fromEntries(Object.entries(t).filter(([n])=>{const i=r.find(s=>s.type===e&&s.name===n);return i?i.attribute.keepOnSplit:!1}))}var x6=(r,e=500)=>{let t="";const n=r.parentOffset;return r.parent.nodesBetween(Math.max(0,n-e),n,(i,s,o,a)=>{var l,u;const c=((u=(l=i.type.spec).toText)==null?void 0:u.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,n-s))}),t};function Gl(r,e,t={}){const{empty:n,ranges:i}=r.selection,s=e?kr(e,r.schema):null;if(n)return!!(r.storedMarks||r.selection.$from.marks()).filter(d=>s?s.name===d.type.name:!0).find(d=>mo(d.attrs,t,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:d,$to:h})=>{const f=d.pos,m=h.pos;r.doc.nodesBetween(f,m,(v,y)=>{if(!v.isText&&!v.marks.length)return;const w=Math.max(f,y),k=Math.min(m,y+v.nodeSize),E=k-w;o+=E,a.push(...v.marks.map(I=>({mark:I,from:w,to:k})))})}),o===0)return!1;const l=a.filter(d=>s?s.name===d.mark.type.name:!0).filter(d=>mo(d.mark.attrs,t,{strict:!1})).reduce((d,h)=>d+h.to-h.from,0),u=a.filter(d=>s?d.mark.type!==s&&d.mark.type.excludes(s):!0).reduce((d,h)=>d+h.to-h.from,0);return(l>0?l+u:l)>=o}function S6(r,e,t={}){if(!e)return tn(r,null,t)||Gl(r,null,t);const n=yo(e,r.schema);return n==="node"?tn(r,e,t):n==="mark"?Gl(r,e,t):!1}var k6=(r,e)=>{const{$from:t,$to:n,$anchor:i}=r.selection;if(e){const s=bo(a=>a.type.name===e)(r.selection);if(!s)return!1;const o=r.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(n.parentOffset<n.parent.nodeSize-2||t.pos!==n.pos)},T6=r=>{const{$from:e,$to:t}=r.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function Th(r,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===r.name):e}function Ch(r,e){const{nodeExtensions:t}=ni(e),n=t.find(o=>o.name===r);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},s=Ie(ue(n,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function xo(r,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var n;if(t){if(r.type.name==="hardBreak")return!0;if(r.isText)return/^\s*$/m.test((n=r.text)!=null?n:"")}if(r.isText)return!r.text;if(r.isAtom||r.isLeaf)return!1;if(r.content.childCount===0)return!0;if(e){let i=!0;return r.content.forEach(s=>{i!==!1&&(xo(s,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function C6(r){return r instanceof le}var Mh=class Pg{constructor(e){this.position=e}static fromJSON(e){return new Pg(e.position)}toJSON(){return{position:this.position}}};function M6(r,e){const t=e.mapping.mapResult(r.position);return{position:new Mh(t.pos),mapResult:t}}function E6(r){return new Mh(r)}function Eh(r,e,t){const i=r.state.doc.content.size,s=Tr(e,0,i),o=Tr(t,0,i),a=r.coordsAtPos(s),l=r.coordsAtPos(o,-1),u=Math.min(a.top,l.top),c=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),h=Math.max(a.right,l.right),f=h-d,m=c-u,w={top:u,bottom:c,left:d,right:h,width:f,height:m,x:d,y:u};return{...w,toJSON:()=>w}}function A6(r,e,t){var n;const{selection:i}=e;let s=null;if(jl(i)&&(s=i.$cursor),s){const a=(n=r.storedMarks)!=null?n:s.marks();return s.parent.type.allowsMarkType(t)&&(!!t.isInSet(a)||!a.some(u=>u.type.excludes(t)))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let u=a.depth===0?r.doc.inlineContent&&r.doc.type.allowsMarkType(t):!1;return r.doc.nodesBetween(a.pos,l.pos,(c,d,h)=>{if(u)return!1;if(c.isInline){const f=!h||h.type.allowsMarkType(t),m=!!t.isInSet(c.marks)||!c.marks.some(v=>v.type.excludes(t));u=f&&m}return!u}),u})}var O6=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:a}=s,l=kr(r,n.schema);if(i)if(o){const u=ph(n,l);t.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;n.doc.nodesBetween(c,d,(h,f)=>{const m=Math.max(f,c),v=Math.min(f+h.nodeSize,d);h.marks.find(w=>w.type===l)?h.marks.forEach(w=>{l===w.type&&t.addMark(m,v,l.create({...w.attrs,...e}))}):t.addMark(m,v,l.create(e))})});return A6(n,t,l)},N6=(r,e)=>({tr:t})=>(t.setMeta(r,e),!0),D6=(r,e={})=>({state:t,dispatch:n,chain:i})=>{const s=Ye(r,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>qd(s,{...o,...e})(t)?!0:a.clearNodes()).command(({state:a})=>qd(s,{...o,...e})(a,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},P6=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,i=Tr(r,0,n.content.size),s=le.create(n,i);e.setSelection(s)}return!0},I6=(r,e)=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=n;let o,a;return typeof e=="number"?(o=e,a=e):e&&"from"in e&&"to"in e?(o=e.from,a=e.to):(o=s.from,a=s.to),i&&t.doc.nodesBetween(o,a,(l,u)=>{l.isText||t.setNodeMarkup(u,void 0,{...l.attrs,dir:r})}),!0},R6=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,{from:i,to:s}=typeof r=="number"?{from:r,to:r}:r,o=we.atStart(n).from,a=we.atEnd(n).to,l=Tr(i,o,a),u=Tr(s,o,a),c=we.create(n,l,u);e.setSelection(c)}return!0},z6=r=>({state:e,dispatch:t})=>{const n=Ye(r,e.schema);return Ay(n)(e,t)};function Ah(r,e){const t=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(t){const n=t.filter(i=>e?.includes(i.type.name));r.tr.ensureMarks(n)}}var L6=({keepMarks:r=!0}={})=>({tr:e,state:t,dispatch:n,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,u=i.extensionManager.attributes,c=wo(u,a.node().type.name,a.node().attrs);if(s instanceof le&&s.node.isBlock)return!a.parentOffset||!yr(o,a.pos)?!1:(n&&(r&&Ah(t,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=a.depth===0?void 0:u6(a.node(-1).contentMatchAt(a.indexAfter(-1)));let f=d&&h?[{type:h,attrs:c}]:void 0,m=yr(e.doc,e.mapping.map(a.pos),1,f);if(!f&&!m&&yr(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(m=!0,f=h?[{type:h,attrs:c}]:void 0),n){if(m&&(s instanceof we&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,f),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const v=e.mapping.map(a.before()),y=e.doc.resolve(v);a.node(-1).canReplaceWith(y.index(),y.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}r&&Ah(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},B6=(r,e={})=>({tr:t,state:n,dispatch:i,editor:s})=>{var o;const a=Ye(r,n.schema),{$from:l,$to:u}=n.selection,c=n.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(u))return!1;const d=l.node(-1);if(d.type!==a)return!1;const h=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let w=j.empty;const k=l.index(-1)?1:l.index(-2)?2:3;for(let L=l.depth-k;L>=l.depth-3;L-=1)w=j.from(l.node(L).copy(w));const E=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,I={...wo(h,l.node().type.name,l.node().attrs),...e},A=((o=a.contentMatch.defaultType)==null?void 0:o.createAndFill(I))||void 0;w=w.append(j.from(a.createAndFill(null,A)||void 0));const N=l.before(l.depth-(k-1));t.replace(N,l.after(-E),new Z(w,4-k,0));let P=-1;t.doc.nodesBetween(N,t.doc.content.size,(L,z)=>{if(P>-1)return!1;L.isTextblock&&L.content.size===0&&(P=z+1)}),P>-1&&t.setSelection(we.near(t.doc.resolve(P))),t.scrollIntoView()}return!0}const f=u.pos===l.end()?d.contentMatchAt(0).defaultType:null,m={...wo(h,d.type.name,d.attrs),...e},v={...wo(h,l.node().type.name,l.node().attrs),...e};t.delete(l.pos,u.pos);const y=f?[{type:a,attrs:m},{type:f,attrs:v}]:[{type:a,attrs:m}];if(!yr(t.doc,l.pos,2))return!1;if(i){const{selection:w,storedMarks:k}=n,{splittableMarks:E}=s.extensionManager,I=k||w.$to.parentOffset&&w.$from.marks();if(t.split(l.pos,2,y).scrollIntoView(),!I||!i)return!0;const A=I.filter(N=>E.includes(N.type.name));t.ensureMarks(A)}return!0},Jl=(r,e)=>{const t=bo(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===i?.type&&Wr(r.doc,t.pos)&&r.join(t.pos),!0},Yl=(r,e)=>{const t=bo(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(t.start).after(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===i?.type&&Wr(r.doc,n)&&r.join(n),!0},F6=(r,e,t,n={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:d,splittableMarks:h}=i.extensionManager,f=Ye(r,o.schema),m=Ye(e,o.schema),{selection:v,storedMarks:y}=o,{$from:w,$to:k}=v,E=w.blockRange(k),I=y||v.$to.parentOffset&&v.$from.marks();if(!E)return!1;const A=bo(N=>Ch(N.type.name,d))(v);if(E.depth>=1&&A&&E.depth-A.depth<=1){if(A.node.type===f)return u.liftListItem(m);if(Ch(A.node.type.name,d)&&f.validContent(A.node.content)&&a)return l().command(()=>(s.setNodeMarkup(A.pos,f),!0)).command(()=>Jl(s,f)).command(()=>Yl(s,f)).run()}return!t||!I||!a?l().command(()=>c().wrapInList(f,n)?!0:u.clearNodes()).wrapInList(f,n).command(()=>Jl(s,f)).command(()=>Yl(s,f)).run():l().command(()=>{const N=c().wrapInList(f,n),P=I.filter(L=>h.includes(L.type.name));return s.ensureMarks(P),N?!0:u.clearNodes()}).wrapInList(f,n).command(()=>Jl(s,f)).command(()=>Yl(s,f)).run()},$6=(r,e={},t={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=kr(r,n.schema);return Gl(n,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},H6=(r,e,t={})=>({state:n,commands:i})=>{const s=Ye(r,n.schema),o=Ye(e,n.schema),a=tn(n,s,t);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...t})},j6=(r,e={})=>({state:t,commands:n})=>{const i=Ye(r,t.schema);return tn(t,i,e)?n.lift(i):n.wrapIn(i,e)},_6=()=>({state:r,dispatch:e})=>{const t=r.plugins;for(let n=0;n<t.length;n+=1){const i=t[n];let s;if(i.spec.isInputRules&&(s=i.getState(r))){if(e){const o=r.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,r.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},V6=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,{empty:n,ranges:i}=t;return n||e&&i.forEach(s=>{r.removeMark(s.$from.pos,s.$to.pos)}),!0},q6=(r,e={})=>({tr:t,state:n,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=t,l=kr(r,n.schema),{$from:u,empty:c,ranges:d}=a;if(!i)return!0;if(c&&o){let{from:h,to:f}=a;const m=(s=u.marks().find(y=>y.type===l))==null?void 0:s.attrs,v=Hl(u,l,m);v&&(h=v.from,f=v.to),t.removeMark(h,f,l)}else d.forEach(h=>{t.removeMark(h.$from.pos,h.$to.pos,l)});return t.removeStoredMark(l),!0},W6=r=>({tr:e,state:t,dispatch:n})=>{const{selection:i}=t;let s,o;return typeof r=="number"?(s=r,o=r):r&&"from"in r&&"to"in r?(s=r.from,o=r.to):(s=i.from,o=i.to),n&&e.doc.nodesBetween(s,o,(a,l)=>{if(a.isText)return;const u={...a.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},U6=(r,e={})=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const a=yo(typeof r=="string"?r:r.name,n.schema);if(!a)return!1;a==="node"&&(s=Ye(r,n.schema)),a==="mark"&&(o=kr(r,n.schema));let l=!1;return t.selection.ranges.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;let h,f,m,v;t.selection.empty?n.doc.nodesBetween(c,d,(y,w)=>{s&&s===y.type&&(l=!0,m=Math.max(w,c),v=Math.min(w+y.nodeSize,d),h=w,f=y)}):n.doc.nodesBetween(c,d,(y,w)=>{w<c&&s&&s===y.type&&(l=!0,m=Math.max(w,c),v=Math.min(w+y.nodeSize,d),h=w,f=y),w>=c&&w<=d&&(s&&s===y.type&&(l=!0,i&&t.setNodeMarkup(w,void 0,{...y.attrs,...e})),o&&y.marks.length&&y.marks.forEach(k=>{if(o===k.type&&(l=!0,i)){const E=Math.max(w,c),I=Math.min(w+y.nodeSize,d);t.addMark(E,I,o.create({...k.attrs,...e}))}}))}),f&&(h!==void 0&&i&&t.setNodeMarkup(h,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(y=>{o===y.type&&i&&t.addMark(m,v,o.create({...y.attrs,...e}))}))}),l},K6=(r,e={})=>({state:t,dispatch:n})=>{const i=Ye(r,t.schema);return xy(i,e)(t,n)},G6=(r,e={})=>({state:t,dispatch:n})=>{const i=Ye(r,t.schema);return Sy(i,e)(t,n)},J6=class{constructor(){this.callbacks={}}on(r,e){return this.callbacks[r]||(this.callbacks[r]=[]),this.callbacks[r].push(e),this}emit(r,...e){const t=this.callbacks[r];return t&&t.forEach(n=>n.apply(this,e)),this}off(r,e){const t=this.callbacks[r];return t&&(e?this.callbacks[r]=t.filter(n=>n!==e):delete this.callbacks[r]),this}once(r,e){const t=(...n)=>{this.off(r,t),e.apply(this,n)};return this.on(r,t)}removeAllListeners(){this.callbacks={}}},Xl=class{constructor(r){var e;this.find=r.find,this.handler=r.handler,this.undoable=(e=r.undoable)!=null?e:!0}},Y6=(r,e)=>{if($l(e))return e.exec(r);const t=e(r);if(!t)return null;const n=[t.text];return n.index=t.index,n.input=r,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(t.replaceWith)),n};function So(r){var e;const{editor:t,from:n,to:i,text:s,rules:o,plugin:a}=r,{view:l}=t;if(l.composing)return!1;const u=l.state.doc.resolve(n);if(u.parent.type.spec.code||(e=u.nodeBefore||u.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let c=!1;const d=x6(u)+s;return o.forEach(h=>{if(c)return;const f=Y6(d,h.find);if(!f)return;const m=l.state.tr,v=ho({state:l.state,transaction:m}),y={from:n-(f[0].length-s.length),to:i},{commands:w,chain:k,can:E}=new po({editor:t,state:v});h.handler({state:v,range:y,match:f,commands:w,chain:k,can:E})===null||!m.steps.length||(h.undoable&&m.setMeta(a,{transform:m,from:n,to:i,text:s}),l.dispatch(m),c=!0)}),c}function X6(r){const{editor:e,rules:t}=r,n=new qe({state:{init(){return null},apply(i,s,o){const a=i.getMeta(n);if(a)return a;const l=i.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:c}=l;typeof c=="string"?c=c:c=ql(j.from(c),o.schema);const{from:d}=l,h=d+c.length;So({editor:e,from:d,to:h,text:c,rules:t,plugin:n})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return So({editor:e,from:s,to:o,text:a,rules:t,plugin:n})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&So({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:n})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?So({editor:e,from:o.pos,to:o.pos,text:`
|
|
542
|
+
`,rules:t,plugin:n}):!1}},isInputRules:!0});return n}function Z6(r){return Object.prototype.toString.call(r).slice(8,-1)}function ko(r){return Z6(r)!=="Object"?!1:r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype}function Oh(r,e){const t={...r};return ko(r)&&ko(e)&&Object.keys(e).forEach(n=>{ko(e[n])&&ko(r[n])?t[n]=Oh(r[n],e[n]):t[n]=e[n]}),t}var Zl=class{constructor(r={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...r},this.name=this.config.name}get options(){return{...Ie(ue(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Ie(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(r={}){const e=this.extend({...this.config,addOptions:()=>Oh(this.options,r)});return e.name=this.name,e.parent=this.parent,e}extend(r={}){const e=new this.constructor({...this.config,...r});return e.parent=this,this.child=e,e.name="name"in r?r.name:e.parent.name,e}},as=class Ig extends Zl{constructor(){super(...arguments),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new Ig(t)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>u?.type.name===t.name))return!1;const l=o.find(u=>u?.type.name===t.name);return l&&n.removeStoredMark(l),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function Q6(r){return typeof r=="number"}var eb=class{constructor(r){this.find=r.find,this.handler=r.handler}},tb=(r,e,t)=>{if($l(e))return[...r.matchAll(e)];const n=e(r,t);return n?n.map(i=>{const s=[i.text];return s.index=i.index,s.input=r,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function rb(r){const{editor:e,state:t,from:n,to:i,rule:s,pasteEvent:o,dropEvent:a}=r,{commands:l,chain:u,can:c}=new po({editor:e,state:t}),d=[];return t.doc.nodesBetween(n,i,(f,m)=>{var v,y,w,k,E;if((y=(v=f.type)==null?void 0:v.spec)!=null&&y.code||!(f.isText||f.isTextblock||f.isInline))return;const I=(E=(k=(w=f.content)==null?void 0:w.size)!=null?k:f.nodeSize)!=null?E:0,A=Math.max(n,m),N=Math.min(i,m+I);if(A>=N)return;const P=f.isText?f.text||"":f.textBetween(A-m,N-m,void 0,"");tb(P,s.find,o).forEach(z=>{if(z.index===void 0)return;const F=A+z.index+1,re=F+z[0].length,oe={from:t.tr.mapping.map(F),to:t.tr.mapping.map(re)},ye=s.handler({state:t,range:oe,match:z,commands:l,chain:u,can:c,pasteEvent:o,dropEvent:a});d.push(ye)})}),d.every(f=>f!==null)}var To=null,nb=r=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)==null||e.setData("text/html",r),t};function ib(r){const{editor:e,rules:t}=r;let n=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:c,from:d,to:h,rule:f,pasteEvt:m})=>{const v=c.tr,y=ho({state:c,transaction:v});if(!(!rb({editor:e,state:y,from:Math.max(d-1,0),to:h.b-1,rule:f,pasteEvent:m,dropEvent:a})||!v.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v}};return t.map(c=>new qe({view(d){const h=m=>{var v;n=(v=d.dom.parentElement)!=null&&v.contains(m.target)?d.dom.parentElement:null,n&&(To=e)},f=()=>{To&&(To=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,h)=>{if(s=n===d.dom.parentElement,a=h,!s){const f=To;f?.isEditable&&setTimeout(()=>{const m=f.state.selection;m&&f.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(d,h)=>{var f;const m=(f=h.clipboardData)==null?void 0:f.getData("text/html");return o=h,i=!!m?.includes("data-pm-slice"),!1}}},appendTransaction:(d,h,f)=>{const m=d[0],v=m.getMeta("uiEvent")==="paste"&&!i,y=m.getMeta("uiEvent")==="drop"&&!s,w=m.getMeta("applyPasteRules"),k=!!w;if(!v&&!y&&!k)return;if(k){let{text:A}=w;typeof A=="string"?A=A:A=ql(j.from(A),f.schema);const{from:N}=w,P=N+A.length,L=nb(A);return l({rule:c,state:f,from:N,to:{b:P},pasteEvt:L})}const E=h.doc.content.findDiffStart(f.doc.content),I=h.doc.content.findDiffEnd(f.doc.content);if(!(!Q6(E)||!I||E===I.b))return l({rule:c,state:f,from:E,to:I,pasteEvt:o})}}))}var Co=class{constructor(r,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=r,this.extensions=wh(r),this.schema=h6(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((r,e)=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Kl(e.name,this.schema)},n=ue(e,"addCommands",t);return n?{...r,...n()}:r},{})}get plugins(){const{editor:r}=this;return Wl([...this.extensions].reverse()).flatMap(n=>{const i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:r,type:Kl(n.name,this.schema)},s=[],o=ue(n,"addKeyboardShortcuts",i);let a={};if(n.type==="mark"&&ue(n,"exitable",i)&&(a.ArrowRight=()=>as.handleExit({editor:r,mark:n})),o){const h=Object.fromEntries(Object.entries(o()).map(([f,m])=>[f,()=>m({editor:r})]));a={...a,...h}}const l=v3(a);s.push(l);const u=ue(n,"addInputRules",i);if(Th(n,r.options.enableInputRules)&&u){const h=u();if(h&&h.length){const f=X6({editor:r,rules:h}),m=Array.isArray(f)?f:[f];s.push(...m)}}const c=ue(n,"addPasteRules",i);if(Th(n,r.options.enablePasteRules)&&c){const h=c();if(h&&h.length){const f=ib({editor:r,rules:h});s.push(...f)}}const d=ue(n,"addProseMirrorPlugins",i);if(d){const h=d();s.push(...h)}return s})}get attributes(){return gh(this.extensions)}get nodeViews(){const{editor:r}=this,{nodeExtensions:e}=ni(this.extensions);return Object.fromEntries(e.filter(t=>!!ue(t,"addNodeView")).map(t=>{const n=this.attributes.filter(l=>l.type===t.name),i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:r,type:Ye(t.name,this.schema)},s=ue(t,"addNodeView",i);if(!s)return[];const o=s();if(!o)return[];const a=(l,u,c,d,h)=>{const f=ss(l,n);return o({node:l,view:u,getPos:c,decorations:d,innerDecorations:h,editor:r,extension:t,HTMLAttributes:f})};return[t.name,a]}))}get markViews(){const{editor:r}=this,{markExtensions:e}=ni(this.extensions);return Object.fromEntries(e.filter(t=>!!ue(t,"addMarkView")).map(t=>{const n=this.attributes.filter(a=>a.type===t.name),i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:r,type:kr(t.name,this.schema)},s=ue(t,"addMarkView",i);if(!s)return[];const o=(a,l,u)=>{const c=ss(a,n);return s()({mark:a,view:l,inline:u,editor:r,extension:t,HTMLAttributes:c,updateAttributes:d=>{gb(a,r,d)}})};return[t.name,o]}))}setupExtensions(){const r=this.extensions;this.editor.extensionStorage=Object.fromEntries(r.map(e=>[e.name,e.storage])),r.forEach(e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Kl(e.name,this.schema)};e.type==="mark"&&((t=Ie(ue(e,"keepOnSplit",n)))==null||t)&&this.splittableMarks.push(e.name);const i=ue(e,"onBeforeCreate",n),s=ue(e,"onCreate",n),o=ue(e,"onUpdate",n),a=ue(e,"onSelectionUpdate",n),l=ue(e,"onTransaction",n),u=ue(e,"onFocus",n),c=ue(e,"onBlur",n),d=ue(e,"onDestroy",n);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}};Co.resolve=wh,Co.sort=Wl,Co.flatten=Vl;var sb={};Fl(sb,{ClipboardTextSerializer:()=>Nh,Commands:()=>Dh,Delete:()=>Ph,Drop:()=>Ih,Editable:()=>Rh,FocusEvents:()=>Lh,Keymap:()=>Bh,Paste:()=>Fh,Tabindex:()=>$h,TextDirection:()=>Hh,focusEventsPluginKey:()=>zh});var De=class Rg extends Zl{constructor(){super(...arguments),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new Rg(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},Nh=De.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new qe({key:new Ke("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:e,schema:t}=r,{doc:n,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(c=>c.$from.pos)),a=Math.max(...s.map(c=>c.$to.pos)),l=Ul(t);return xh(n,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),Dh=De.create({name:"commands",addCommands(){return{...oh}}}),Ph=De.create({name:"delete",onUpdate({transaction:r,appendedTransactions:e}){var t,n,i;const s=()=>{var o,a,l,u;if((u=(l=(a=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,r))!=null?u:r.getMeta("y-sync$"))return;const c=l6(r.before,[r,...e]);b6(c).forEach(f=>{c.mapping.mapResult(f.oldRange.from).deletedAfter&&c.mapping.mapResult(f.oldRange.to).deletedBefore&&c.before.nodesBetween(f.oldRange.from,f.oldRange.to,(m,v)=>{const y=v+m.nodeSize-2,w=f.oldRange.from<=v&&y<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:v,to:y,newFrom:c.mapping.map(v),newTo:c.mapping.map(y),deletedRange:f.oldRange,newRange:f.newRange,partial:!w,editor:this.editor,transaction:r,combinedTransform:c})})});const h=c.mapping;c.steps.forEach((f,m)=>{var v,y;if(f instanceof Kt){const w=h.slice(m).map(f.from,-1),k=h.slice(m).map(f.to),E=h.invert().map(w,-1),I=h.invert().map(k),A=(v=c.doc.nodeAt(w-1))==null?void 0:v.marks.some(P=>P.eq(f.mark)),N=(y=c.doc.nodeAt(k))==null?void 0:y.marks.some(P=>P.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:E,to:I},newRange:{from:w,to:k},partial:!!(N||A),editor:this.editor,transaction:r,combinedTransform:c})}})};(i=(n=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:n.async)==null||i?setTimeout(s,0):s()}}),Ih=De.create({name:"drop",addProseMirrorPlugins(){return[new qe({key:new Ke("tiptapDrop"),props:{handleDrop:(r,e,t,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:n})}}})]}}),Rh=De.create({name:"editable",addProseMirrorPlugins(){return[new qe({key:new Ke("editable"),props:{editable:()=>this.editor.options.editable}})]}}),zh=new Ke("focusEvents"),Lh=De.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new qe({key:zh,props:{handleDOMEvents:{focus:(e,t)=>{r.isFocused=!0;const n=r.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,t)=>{r.isFocused=!1;const n=r.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),Bh=De.create({name:"keymap",addKeyboardShortcuts(){const r=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:c,$anchor:d}=l,{pos:h,parent:f}=d,m=d.parent.isTextblock&&h>0?a.doc.resolve(h-1):d,v=m.parent.type.spec.isolating,y=d.pos-d.parentOffset,w=v&&m.parent.childCount===1?y===d.pos:ge.atStart(u).from===h;return!c||!f.type.isTextblock||f.textContent.length||!w||w&&d.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:r,"Mod-Backspace":r,"Shift-Backspace":r,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},s={...n,"Ctrl-h":r,"Alt-Backspace":r,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return go()||fh()?s:i},addProseMirrorPlugins(){return[new qe({key:new Ke("clearDocument"),appendTransaction:(r,e,t)=>{if(r.some(v=>v.getMeta("composition")))return;const n=r.some(v=>v.docChanged)&&!e.doc.eq(t.doc),i=r.some(v=>v.getMeta("preventClearDocument"));if(!n||i)return;const{empty:s,from:o,to:a}=e.selection,l=ge.atStart(e.doc).from,u=ge.atEnd(e.doc).to;if(s||!(o===l&&a===u)||!xo(t.doc))return;const h=t.tr,f=ho({state:t,transaction:h}),{commands:m}=new po({editor:this.editor,state:f});if(m.clearNodes(),!!h.steps.length)return h}})]}}),Fh=De.create({name:"paste",addProseMirrorPlugins(){return[new qe({key:new Ke("tiptapPaste"),props:{handlePaste:(r,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),$h=De.create({name:"tabindex",addProseMirrorPlugins(){return[new qe({key:new Ke("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Hh=De.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:r}=ni(this.extensions);return[{types:r.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new qe({key:new Ke("textDirection"),props:{attributes:()=>{const r=this.options.direction;return r?{dir:r}:{}}}})]}}),ob=class Si{constructor(e,t,n=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new Si(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Si(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Si(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,n)=>{const i=t.isBlock&&!t.isTextblock,s=t.isAtom&&!t.isText,o=this.pos+n+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(o);if(!i&&a.depth<=this.depth)return;const l=new Si(a,this.editor,i,i?t:null);i&&(l.actualDepth=this.depth+1),e.push(new Si(a,this.editor,i,i?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,i=this.parent;for(;i&&!n;){if(i.node.type.name===e)if(Object.keys(t).length>0){const s=i.node.attrs,o=Object.keys(t);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==t[l])break}}else n=i;i=i.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(t);return this.children.forEach(o=>{n&&i.length>0||(o.node.type.name===e&&s.every(l=>t[l]===o.node.attrs[l])&&i.push(o),!(n&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,t,n))))}),i}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},ab=`.ProseMirror {
|
|
509
543
|
position: relative;
|
|
510
544
|
}
|
|
511
545
|
|
|
@@ -575,35 +609,35 @@ img.ProseMirror-separator {
|
|
|
575
609
|
|
|
576
610
|
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
577
611
|
display: block;
|
|
578
|
-
}`;function
|
|
612
|
+
}`;function lb(r,e,t){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(i),i}var ub=class extends J6{constructor(r={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:M6,createMappablePosition:E6},this.setOptions(r),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:i,moved:s})=>this.options.onDrop(n,i,s)),this.on("paste",({event:n,slice:i})=>this.options.onPaste(n,i)),this.on("delete",this.options.onDelete);const e=this.createDoc(),t=uh(e,this.options.autofocus);this.editorState=Jn.create({doc:e,schema:this.schema,selection:t||void 0}),this.options.element&&this.mount(this.options.element)}mount(r){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(r),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const r=this.editorView.dom;r?.editor&&delete r.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(r){console.warn("Failed to remove CSS element:",r)}this.css=null,this.emit("unmount",{editor:this})}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&&typeof document<"u"&&(this.css=lb(ab,this.options.injectNonce))}setOptions(r={}){this.options={...this.options,...r},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(r,e=!0){this.setOptions({editable:r}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:r=>{this.editorState=r},dispatch:r=>{this.dispatchTransaction(r)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(r,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in r)return Reflect.get(r,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(r,e){const t=mh(e)?e(r,[...this.state.plugins]):[...this.state.plugins,r],n=this.state.reconfigure({plugins:t});return this.view.updateState(n),n}unregisterPlugin(r){if(this.isDestroyed)return;const e=this.state.plugins;let t=e;if([].concat(r).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;t=t.filter(o=>!o.key.startsWith(s))}),e.length===t.length)return;const n=this.state.reconfigure({plugins:t});return this.view.updateState(n),n}createExtensionManager(){var r,e;const n=[...this.options.enableCoreExtensions?[Rh,Nh.configure({blockSeparator:(e=(r=this.options.coreExtensionOptions)==null?void 0:r.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Dh,Lh,Bh,$h,Ih,Fh,Ph,Hh.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i?.type));this.extensionManager=new Co(n,this)}createCommandManager(){this.commandManager=new po({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let r;try{r=_l(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>t.name!=="collaboration"),this.createExtensionManager()}}),r=_l(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return r}createView(r){var e;this.editorView=new eh(r,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.prependClass(),this.injectCSS();const n=this.view.dom;n.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(r){this.isCapturingTransaction=!0,r(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(r){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=r;return}r.steps.forEach(u=>{var c;return(c=this.capturedTransaction)==null?void 0:c.step(u)});return}const{state:e,transactions:t}=this.state.applyTransaction(r),n=!this.state.selection.eq(e.selection),i=t.includes(r),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:r,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:r,appendedTransactions:t.slice(1)}),n&&this.emit("selectionUpdate",{editor:this,transaction:r});const o=t.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),a=o?.getMeta("focus"),l=o?.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(r.getMeta("preventUpdate")||!t.some(u=>u.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:r,appendedTransactions:t.slice(1)})}getAttributes(r){return g6(this.state,r)}isActive(r,e){const t=typeof r=="string"?r:null,n=typeof r=="string"?e:r;return S6(this.state,t,n)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ql(this.state.doc.content,this.schema)}getText(r){const{blockSeparator:e=`
|
|
579
613
|
|
|
580
|
-
`,textSerializers:t={}}=r||{};return
|
|
614
|
+
`,textSerializers:t={}}=r||{};return Sh(this.state.doc,{blockSeparator:e,textSerializers:{...Ul(this.schema),...t}})}get isEmpty(){return xo(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var r,e;return(e=(r=this.editorView)==null?void 0:r.isDestroyed)!=null?e:!0}$node(r,e){var t;return((t=this.$doc)==null?void 0:t.querySelector(r,e))||null}$nodes(r,e){var t;return((t=this.$doc)==null?void 0:t.querySelectorAll(r,e))||null}$pos(r){const e=this.state.doc.resolve(r);return new ob(e,this)}get $doc(){return this.$pos(0)}};function rn(r){return new Xl({find:r.find,handler:({state:e,range:t,match:n})=>{const i=Ie(r.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:s}=e,o=n[n.length-1],a=n[0];if(o){const l=a.search(/\S/),u=t.from+a.indexOf(o),c=u+o.length;if(kh(t.from,t.to,e.doc).filter(f=>f.mark.type.excluded.find(v=>v===r.type&&v!==f.mark.type)).filter(f=>f.to>u).length)return null;c<t.to&&s.delete(c,t.to),u>t.from&&s.delete(t.from+l,u);const h=t.from+l+o.length;s.addMark(t.from+l,h,r.type.create(i||{})),s.removeStoredMark(r.type)}},undoable:r.undoable})}function Ql(r){return new Xl({find:r.find,handler:({state:e,range:t,match:n})=>{const i=e.doc.resolve(t.from),s=Ie(r.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),r.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,r.type,s)},undoable:r.undoable})}function mt(r){return new Xl({find:r.find,handler:({state:e,range:t,match:n,chain:i})=>{const s=Ie(r.getAttributes,void 0,n)||{},o=e.tr.delete(t.from,t.to),l=o.doc.resolve(t.from).blockRange(),u=l&&Qa(l,r.type,s);if(!u)return null;if(o.wrap(l,u),r.keepMarks&&r.editor){const{selection:d,storedMarks:h}=e,{splittableMarks:f}=r.editor.extensionManager,m=h||d.$to.parentOffset&&d.$from.marks();if(m){const v=m.filter(y=>f.includes(y.type.name));o.ensureMarks(v)}}if(r.keepAttributes){const d=r.type.name==="bulletList"||r.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,s).run()}const c=o.doc.resolve(t.from-1).nodeBefore;c&&c.type===r.type&&Wr(o.doc,t.from-1)&&(!r.joinPredicate||r.joinPredicate(n,c))&&o.join(t.from-1)},undoable:r.undoable})}var cb={};Fl(cb,{createAtomBlockMarkdownSpec:()=>db,createBlockMarkdownSpec:()=>fb,createInlineMarkdownSpec:()=>mb,parseAttributes:()=>e0,parseIndentedBlocks:()=>r0,renderNestedMarkdownContent:()=>n0,serializeAttributes:()=>t0});function e0(r){if(!r?.trim())return{};const e={},t=[],n=r.replace(/["']([^"']*)["']/g,u=>(t.push(u),`__QUOTED_${t.length-1}__`)),i=n.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const u=i.map(c=>c.trim().slice(1));e.class=u.join(" ")}const s=n.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(n.matchAll(o)).forEach(([,u,c])=>{var d;const h=parseInt(((d=c.match(/__QUOTED_(\d+)__/))==null?void 0:d[1])||"0",10),f=t[h];f&&(e[u]=f.slice(1,-1))});const l=n.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(c=>{c.match(/^[a-zA-Z][\w-]*$/)&&(e[c]=!0)}),e}function t0(r){if(!r||Object.keys(r).length===0)return"";const e=[];return r.class&&String(r.class).split(/\s+/).filter(Boolean).forEach(n=>e.push(`.${n}`)),r.id&&e.push(`#${r.id}`),Object.entries(r).forEach(([t,n])=>{t==="class"||t==="id"||(n===!0?e.push(t):n!==!1&&n!=null&&e.push(`${t}="${String(n)}"`))}),e.join(" ")}function db(r){const{nodeName:e,name:t,parseAttributes:n=e0,serializeAttributes:i=t0,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=r,l=t||e,u=c=>{if(!a)return c;const d={};return a.forEach(h=>{h in c&&(d[h]=c[h])}),d};return{parseMarkdown:(c,d)=>{const h={...s,...c.attributes};return d.createNode(e,h,[])},markdownTokenizer:{name:e,level:"block",start(c){var d;const h=new RegExp(`^:::${l}(?:\\s|$)`,"m"),f=(d=c.match(h))==null?void 0:d.index;return f!==void 0?f:-1},tokenize(c,d,h){const f=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=c.match(f);if(!m)return;const v=m[1]||"",y=n(v);if(!o.find(k=>!(k in y)))return{type:e,raw:m[0],attributes:y}}},renderMarkdown:c=>{const d=u(c.attrs||{}),h=i(d),f=h?` {${h}}`:"";return`:::${l}${f} :::`}}}function fb(r){const{nodeName:e,name:t,getContent:n,parseAttributes:i=e0,serializeAttributes:s=t0,defaultAttributes:o={},content:a="block",allowedAttributes:l}=r,u=t||e,c=d=>{if(!l)return d;const h={};return l.forEach(f=>{f in d&&(h[f]=d[f])}),h};return{parseMarkdown:(d,h)=>{let f;if(n){const v=n(d);f=typeof v=="string"?[{type:"text",text:v}]:v}else a==="block"?f=h.parseChildren(d.tokens||[]):f=h.parseInline(d.tokens||[]);const m={...o,...d.attributes};return h.createNode(e,m,f)},markdownTokenizer:{name:e,level:"block",start(d){var h;const f=new RegExp(`^:::${u}`,"m"),m=(h=d.match(f))==null?void 0:h.index;return m!==void 0?m:-1},tokenize(d,h,f){var m;const v=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),y=d.match(v);if(!y)return;const[w,k=""]=y,E=i(k);let I=1;const A=w.length;let N="";const P=/^:::([\w-]*)(\s.*)?/gm,L=d.slice(A);for(P.lastIndex=0;;){const z=P.exec(L);if(z===null)break;const F=z.index,re=z[1];if(!((m=z[2])!=null&&m.endsWith(":::"))){if(re)I+=1;else if(I-=1,I===0){const oe=L.slice(0,F);N=oe.trim();const ye=d.slice(0,A+F+z[0].length);let ae=[];if(N)if(a==="block")for(ae=f.blockTokens(oe),ae.forEach(G=>{G.text&&(!G.tokens||G.tokens.length===0)&&(G.tokens=f.inlineTokens(G.text))});ae.length>0;){const G=ae[ae.length-1];if(G.type==="paragraph"&&(!G.text||G.text.trim()===""))ae.pop();else break}else ae=f.inlineTokens(N);return{type:e,raw:ye,attributes:E,content:N,tokens:ae}}}}}},renderMarkdown:(d,h)=>{const f=c(d.attrs||{}),m=s(f),v=m?` {${m}}`:"",y=h.renderChildren(d.content||[],`
|
|
581
615
|
|
|
582
616
|
`);return`:::${u}${v}
|
|
583
617
|
|
|
584
618
|
${y}
|
|
585
619
|
|
|
586
|
-
:::`}}}function
|
|
620
|
+
:::`}}}function hb(r){if(!r.trim())return{};const e={},t=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let n=t.exec(r);for(;n!==null;){const[,i,s,o]=n;e[i]=s||o,n=t.exec(r)}return e}function pb(r){return Object.entries(r).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(" ")}function mb(r){const{nodeName:e,name:t,getContent:n,parseAttributes:i=hb,serializeAttributes:s=pb,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=r,u=t||e,c=h=>{if(!l)return h;const f={};return l.forEach(m=>{const v=typeof m=="string"?m:m.name,y=typeof m=="string"?void 0:m.skipIfDefault;if(v in h){const w=h[v];if(y!==void 0&&w===y)return;f[v]=w}}),f},d=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(h,f)=>{const m={...o,...h.attributes};if(a)return f.createNode(e,m);const v=n?n(h):h.content||"";return v?f.createNode(e,m,[f.createTextNode(v)]):f.createNode(e,m,[])},markdownTokenizer:{name:e,level:"inline",start(h){const f=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),m=h.match(f),v=m?.index;return v!==void 0?v:-1},tokenize(h,f,m){const v=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),y=h.match(v);if(!y)return;let w="",k="";if(a){const[,I]=y;k=I}else{const[,I,A]=y;k=I,w=A||""}const E=i(k.trim());return{type:e,raw:y[0],content:w.trim(),attributes:E}}},renderMarkdown:h=>{let f="";n?f=n(h):h.content&&h.content.length>0&&(f=h.content.filter(w=>w.type==="text").map(w=>w.text).join(""));const m=c(h.attrs||{}),v=s(m),y=v?` ${v}`:"";return a?`[${u}${y}]`:`[${u}${y}]${f}[/${u}]`}}}function r0(r,e,t){var n,i,s,o;const a=r.split(`
|
|
587
621
|
`),l=[];let u="",c=0;const d=e.baseIndentSize||2;for(;c<a.length;){const h=a[c],f=h.match(e.itemPattern);if(!f){if(l.length>0)break;if(h.trim()===""){c+=1,u=`${u}${h}
|
|
588
622
|
`;continue}else return}const m=e.extractItemData(f),{indentLevel:v,mainContent:y}=m;u=`${u}${h}
|
|
589
|
-
`;const w=[y];for(c+=1;c<a.length;){const
|
|
590
|
-
`,c+=1;continue}else break}if((((o=(s=
|
|
591
|
-
`,c+=1;else break}let k;const E=w.slice(1);if(E.length>0){const
|
|
592
|
-
`);
|
|
623
|
+
`;const w=[y];for(c+=1;c<a.length;){const A=a[c];if(A.trim()===""){const P=a.slice(c+1).findIndex(F=>F.trim()!=="");if(P===-1)break;if((((i=(n=a[c+1+P].match(/^(\s*)/))==null?void 0:n[1])==null?void 0:i.length)||0)>v){w.push(A),u=`${u}${A}
|
|
624
|
+
`,c+=1;continue}else break}if((((o=(s=A.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:o.length)||0)>v)w.push(A),u=`${u}${A}
|
|
625
|
+
`,c+=1;else break}let k;const E=w.slice(1);if(E.length>0){const A=E.map(N=>N.slice(v+d)).join(`
|
|
626
|
+
`);A.trim()&&(e.customNestedParser?k=e.customNestedParser(A):k=t.blockTokens(A))}const I=e.createToken(m,k);l.push(I)}if(l.length!==0)return{items:l,raw:u}}function n0(r,e,t,n){if(!r||!Array.isArray(r.content))return"";const i=typeof t=="function"?t(n):t,[s,...o]=r.content,a=e.renderChildren([s]),l=[`${i}${a}`];return o&&o.length>0&&o.forEach(u=>{const c=e.renderChildren([u]);if(c){const d=c.split(`
|
|
593
627
|
`).map(h=>h?e.indent(h):"").join(`
|
|
594
628
|
`);l.push(d)}}),l.join(`
|
|
595
|
-
`)}function F3(r,e,t={}){const{state:n}=e,{doc:i,tr:s}=n,o=r;i.descendants((a,l)=>{const u=s.mapping.map(l),c=s.mapping.map(l)+a.nodeSize;let d=null;if(a.marks.forEach(f=>{if(f!==o)return!1;d=f}),!d)return;let h=!1;if(Object.keys(t).forEach(f=>{t[f]!==d.attrs[f]&&(h=!0)}),h){const f=r.type.create({...r.attrs,...t});s.removeMark(u,c,r.type),s.addMark(u,c,f)}}),s.docChanged&&e.view.dispatch(s)}var we=class T1 extends ol{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new T1(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},$3=class{constructor(r,e,t){this.isDragging=!1,this.component=r,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...t},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(r){var e,t,n,i,s,o,a;const{view:l}=this.editor,u=r.target,c=u.nodeType===3?(e=u.parentElement)==null?void 0:e.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||(t=this.contentDOM)!=null&&t.contains(u)||!c)return;let d=0,h=0;if(this.dom!==c){const k=this.dom.getBoundingClientRect(),E=c.getBoundingClientRect(),R=(i=r.offsetX)!=null?i:(n=r.nativeEvent)==null?void 0:n.offsetX,O=(o=r.offsetY)!=null?o:(s=r.nativeEvent)==null?void 0:s.offsetY;d=E.x-k.x+R,h=E.y-k.y+O}const f=this.dom.cloneNode(!0);try{const k=this.dom.getBoundingClientRect();f.style.width=`${Math.round(k.width)}px`,f.style.height=`${Math.round(k.height)}px`,f.style.boxSizing="border-box",f.style.pointerEvents="none"}catch{}let m=null;try{m=document.createElement("div"),m.style.position="absolute",m.style.top="-9999px",m.style.left="-9999px",m.style.pointerEvents="none",m.appendChild(f),document.body.appendChild(m),(a=r.dataTransfer)==null||a.setDragImage(f,d,h)}finally{m&&setTimeout(()=>{try{m?.remove()}catch{}},0)}const v=this.getPos();if(typeof v!="number")return;const y=ie.create(l.state.doc,v),w=l.state.tr.setSelection(y);l.dispatch(w)}stopEvent(r){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:r});const t=r.target;if(!(this.dom.contains(t)&&!((e=this.contentDOM)!=null&&e.contains(t))))return!1;const i=r.type.startsWith("drag"),s=r.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(t.tagName)||t.isContentEditable)&&!s&&!i)return!0;const{isEditable:a}=this.editor,{isDragging:l}=this,u=!!this.node.type.spec.draggable,c=ie.isSelectable(this.node),d=r.type==="copy",h=r.type==="paste",f=r.type==="cut",m=r.type==="mousedown";if(!u&&c&&i&&r.target===this.dom&&r.preventDefault(),u&&i&&!l&&r.target===this.dom)return r.preventDefault(),!1;if(u&&a&&!l&&m){const v=t.closest("[data-drag-handle]");v&&(this.dom===v||this.dom.contains(v))&&(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!(l||s||d||h||f||m&&c)}ignoreMutation(r){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:r}):this.node.isLeaf||this.node.isAtom?!0:r.type==="selection"||this.dom.contains(r.target)&&r.type==="childList"&&(Rs()||af())&&this.editor.isFocused&&[...Array.from(r.addedNodes),...Array.from(r.removedNodes)].every(t=>t.isContentEditable)?!1:this.contentDOM===r.target&&r.type==="attributes"?!0:!this.contentDOM.contains(r.target)}updateAttributes(r){this.editor.commands.command(({tr:e})=>{const t=this.getPos();return typeof t!="number"?!1:(e.setNodeMarkup(t,void 0,{...this.node.attrs,...r}),!0)})}deleteNode(){const r=this.getPos();if(typeof r!="number")return;const e=r+this.node.nodeSize;this.editor.commands.deleteRange({from:r,to:e})}};function js(r){return new S3({find:r.find,handler:({state:e,range:t,match:n,pasteEvent:i})=>{const s=Ce(r.getAttributes,void 0,n,i);if(s===!1||s===null)return null;const{tr:o}=e,a=n[n.length-1],l=n[0];let u=t.to;if(a){const c=l.search(/\S/),d=t.from+l.indexOf(a),h=d+a.length;if(wf(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===r.type&&y!==m.mark.type)).filter(m=>m.to>d).length)return null;h<t.to&&o.delete(h,t.to),d>t.from&&o.delete(t.from+c,d),u=t.from+c+a.length,o.addMark(t.from+c,u,r.type.create(s||{})),o.removeStoredMark(r.type)}}})}function H3(r={}){return new Be({view(e){return new V3(e,r)}})}class V3{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(t){let d=e.nodeBefore,h=e.nodeAfter;if(d||h){let f=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(f){let m=f.getBoundingClientRect(),v=d?m.bottom:m.top;d&&h&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*a;n={left:m.left,right:m.right,top:v-y,bottom:v+y}}}}if(!n){let d=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*o;n={left:d.left-h,right:d.left+h,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let u,c;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,c=-pageYOffset;else{let d=l.getBoundingClientRect(),h=d.width/l.offsetWidth,f=d.height/l.offsetHeight;u=d.left-l.scrollLeft*h,c=d.top-l.scrollTop*f}this.element.style.left=(n.left-u)/o+"px",this.element.style.top=(n.top-c)/a+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!s){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=pc(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Fe extends le{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Fe.valid(n)?new Fe(n):le.near(n)}content(){return U.empty}eq(e){return e instanceof Fe&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Fe(e.resolve(t.pos))}getBookmark(){return new fl(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!_3(e)||!j3(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Fe.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(t>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(Fe.valid(l))return l}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!ie.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),n=!1;continue e}break}s=o,i+=t;let a=e.doc.resolve(i);if(Fe.valid(a))return a}return null}}}Fe.prototype.visible=!1,Fe.findFrom=Fe.findGapCursorFrom,le.jsonID("gapcursor",Fe);class fl{constructor(e){this.pos=e}map(e){return new fl(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Fe.valid(t)?new Fe(t):le.near(t)}}function Ff(r){return r.isAtom||r.spec.isolating||r.spec.createGapCursor}function _3(r){for(let e=r.depth;e>=0;e--){let t=r.index(e),n=r.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Ff(i.type))return!0;if(i.inlineContent)return!1}}return!0}function j3(r){for(let e=r.depth;e>=0;e--){let t=r.indexAfter(e),n=r.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Ff(i.type))return!0;if(i.inlineContent)return!1}}return!0}function q3(){return new Be({props:{decorations:K3,createSelectionBetween(r,e,t){return e.pos==t.pos&&Fe.valid(t)?new Fe(t):null},handleClick:U3,handleKeyDown:W3,handleDOMEvents:{beforeinput:G3}}})}const W3=Wa({ArrowLeft:qs("horiz",-1),ArrowRight:qs("horiz",1),ArrowUp:qs("vert",-1),ArrowDown:qs("vert",1)});function qs(r,e){const t=r=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let o=n.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof de){if(!s.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let u=Fe.findGapCursorFrom(a,e,l);return u?(i&&i(n.tr.setSelection(new Fe(u))),!0):!1}}function U3(r,e,t){if(!r||!r.editable)return!1;let n=r.state.doc.resolve(e);if(!Fe.valid(n))return!1;let i=r.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&ie.isSelectable(r.state.doc.nodeAt(i.inside))?!1:(r.dispatch(r.state.tr.setSelection(new Fe(n))),!0)}function G3(r,e){if(e.inputType!="insertCompositionText"||!(r.state.selection instanceof Fe))return!1;let{$from:t}=r.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);if(!n)return!1;let i=F.empty;for(let o=n.length-1;o>=0;o--)i=F.from(n[o].createAndFill(null,i));let s=r.state.tr.replace(t.pos,t.pos,new U(i,0,0));return s.setSelection(de.near(s.doc.resolve(t.pos+1))),r.dispatch(s),!1}function K3(r){if(!(r.selection instanceof Fe))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Re.create(r.doc,[lt.widget(r.selection.head,e,{key:"gapcursor"})])}var Ws=200,Ze=function(){};Ze.prototype.append=function(e){return e.length?(e=Ze.from(e),!this.length&&e||e.length<Ws&&this.leafAppend(e)||this.length<Ws&&e.leafPrepend(this)||this.appendInner(e)):this},Ze.prototype.prepend=function(e){return e.length?Ze.from(e).append(this):this},Ze.prototype.appendInner=function(e){return new J3(this,e)},Ze.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ze.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ze.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ze.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Ze.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,n),i},Ze.from=function(e){return e instanceof Ze?e:e&&e.length?new $f(e):Ze.empty};var $f=(function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ws)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ws)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(Ze);Ze.empty=new $f([]);var J3=(function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(n,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(n,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(n,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(n,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(n,i):n>=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(Ze);const Y3=500;class $t{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;t&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=e.tr,a,l,u=[],c=[];return this.items.forEach((d,h)=>{if(!d.step){i||(i=this.remapping(n,h+1),s=i.maps.length),s--,c.push(d);return}if(i){c.push(new Kt(d.map));let f=d.step.map(i.slice(s)),m;f&&o.maybeStep(f).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],u.push(new Kt(m,void 0,void 0,u.length+c.length))),s--,m&&i.appendMap(m,s)}else o.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(s)):d.selection,l=new $t(this.items.slice(0,n).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,t,n,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let d=e.steps[c].invert(e.docs[c]),h=new Kt(e.mapping.maps[c],d,t),f;(f=l&&l.merge(h))&&(h=f,c?s.pop():a=a.slice(0,a.length-1)),s.push(h),t&&(o++,t=void 0),i||(l=h)}let u=o-n.depth;return u>Z3&&(a=X3(a,u),o-=u),new $t(a.append(s),o)}remapping(e,t){let n=new hi;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new $t(this.items.append(e.map(t=>new Kt(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=t;this.items.forEach(h=>{let f=s.getMirror(--l);if(f==null)return;o=Math.min(o,f);let m=s.maps[f];if(h.step){let v=e.steps[f].invert(e.docs[f]),y=h.selection&&h.selection.map(s.slice(l+1,f));y&&a++,n.push(new Kt(m,v,y))}else n.push(new Kt(m))},i);let u=[];for(let h=t;h<o;h++)u.push(new Kt(s.maps[h]));let c=this.items.slice(0,i).append(u).append(n),d=new $t(c,a);return d.emptyItemCount()>Y3&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(t.slice(n)),u=l&&l.getMap();if(n--,u&&t.appendMap(u,n),l){let c=o.selection&&o.selection.map(t.slice(n));c&&s++;let d=new Kt(u.invert(),l,c),h,f=i.length-1;(h=i.length&&i[f].merge(d))?i[f]=h:i.push(d)}}else o.map&&n--},this.items.length,0),new $t(Ze.from(i.reverse()),s)}}$t.empty=new $t(Ze.empty,0);function X3(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class Kt{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Kt(t.getMap().invert(),t,this.selection)}}}class qr{constructor(e,t,n,i,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const Z3=20;function Q3(r,e,t,n){let i=t.getMeta(vn),s;if(i)return i.historyState;t.getMeta(r6)&&(r=new qr(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(vn))return o.getMeta(vn).redo?new qr(r.done.addTransform(t,void 0,n,Us(e)),r.undone,Hf(t.mapping.maps),r.prevTime,r.prevComposition):new qr(r.done,r.undone.addTransform(t,void 0,n,Us(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=r.prevTime==0||!o&&r.prevComposition!=a&&(r.prevTime<(t.time||0)-n.newGroupDelay||!e6(t,r.prevRanges)),u=o?hl(r.prevRanges,t.mapping):Hf(t.mapping.maps);return new qr(r.done.addTransform(t,l?e.selection.getBookmark():void 0,n,Us(e)),$t.empty,u,t.time,a??r.prevComposition)}else return(s=t.getMeta("rebased"))?new qr(r.done.rebased(t,s),r.undone.rebased(t,s),hl(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new qr(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),hl(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function e6(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let s=0;s<e.length;s+=2)n<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function Hf(r){let e=[];for(let t=r.length-1;t>=0&&e.length==0;t--)r[t].forEach((n,i,s,o)=>e.push(s,o));return e}function hl(r,e){if(!r)return null;let t=[];for(let n=0;n<r.length;n+=2){let i=e.map(r[n],1),s=e.map(r[n+1],-1);i<=s&&t.push(i,s)}return t}function t6(r,e,t){let n=Us(e),i=vn.get(e).spec.config,s=(t?r.undone:r.done).popEvent(e,n);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(t?r.done:r.undone).addTransform(s.transform,e.selection.getBookmark(),i,n),l=new qr(t?a:s.remaining,t?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(vn,{redo:t,historyState:l})}let pl=!1,Vf=null;function Us(r){let e=r.plugins;if(Vf!=e){pl=!1,Vf=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){pl=!0;break}}return pl}const vn=new Ve("history"),r6=new Ve("closeHistory");function n6(r={}){return r={depth:r.depth||100,newGroupDelay:r.newGroupDelay||500},new Be({key:vn,state:{init(){return new qr($t.empty,$t.empty,null,0,-1)},apply(e,t,n){return Q3(t,n,e,r)}},config:r,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?jf:n=="historyRedo"?qf:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function _f(r,e){return(t,n)=>{let i=vn.getState(t);if(!i||(r?i.undone:i.done).eventCount==0)return!1;if(n){let s=t6(i,t,r);s&&n(e?s.scrollIntoView():s)}return!0}}const jf=_f(!1,!0),qf=_f(!0,!0);Se.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:r=>r.length,wordCounter:r=>r.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=r=>{const e=r?.node||this.editor.state.doc;if((r?.mode||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=r=>{const e=r?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let r=!1;return[new Be({key:new Ve("characterCount"),appendTransaction:(e,t,n)=>{if(r)return;const i=this.options.limit;if(i==null||i===0){r=!0;return}const s=this.storage.characters({node:n.doc});if(s>i){const o=s-i,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=n.tr.deleteRange(a,l);return r=!0,u}r=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:t.doc}),s=this.storage.characters({node:e.doc});if(s<=n||i>n&&s>n&&s<=i)return!0;if(i>n&&s>n&&s>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=s-n,u=a-l,c=a;return e.deleteRange(u,c),!(this.storage.characters({node:e.doc})>n)}})]}}),Se.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[H3(this.options)]}});var i6=Se.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Be({key:new Ve("focus"),props:{decorations:({doc:r,selection:e})=>{const{isEditable:t,isFocused:n}=this.editor,{anchor:i}=e,s=[];if(!t||!n)return Re.create(r,[]);let o=0;this.options.mode==="deepest"&&r.descendants((l,u)=>{if(l.isText)return;if(!(i>=u&&i<=u+l.nodeSize-1))return!1;o+=1});let a=0;return r.descendants((l,u)=>{if(l.isText||!(i>=u&&i<=u+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(lt.node(u,u+l.nodeSize,{class:this.options.className}))}),Re.create(r,s)}}})]}}),s6=Se.create({name:"gapCursor",addProseMirrorPlugins(){return[q3()]},extendNodeSchema(r){var e;const t={name:r.name,options:r.options,storage:r.storage};return{allowGapCursor:(e=Ce(se(r,"allowGapCursor",t)))!=null?e:null}}});Se.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Be({key:new Ve("placeholder"),props:{decorations:({doc:r,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,i=[];if(!t)return null;const s=this.editor.isEmpty;return r.descendants((o,a)=>{const l=n>=a&&n<=a+o.nodeSize,u=!o.isLeaf&&Fs(o);if((l||!this.options.showOnlyCurrent)&&u){const c=[this.options.emptyNodeClass];s&&c.push(this.options.emptyEditorClass);const d=lt.node(a,a+o.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:l}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),Re.create(r,i)}}})]}}),Se.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:r,options:e}=this;return[new Be({key:new Ve("selection"),props:{decorations(t){return t.selection.empty||r.isFocused||!r.isEditable||G5(t.selection)||r.view.dragging?null:Re.create(t.doc,[lt.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function Wf({types:r,node:e}){return e&&Array.isArray(r)&&r.includes(e.type)||e?.type===r}Se.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var r;const e=new Ve(this.name),t=this.options.node||((r=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:r.name)||"paragraph",n=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new Be({key:e,appendTransaction:(i,s,o)=>{const{doc:a,tr:l,schema:u}=o,c=e.getState(o),d=a.content.size,h=u.nodes[t];if(c)return l.insert(d,h.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!Wf({node:o,types:n})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!Wf({node:o,types:n})}}})]}});var o6=Se.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:r,dispatch:e})=>jf(r,e),redo:()=>({state:r,dispatch:e})=>qf(r,e)}},addProseMirrorPlugins(){return[n6(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Gs={exports:{}},ml={};var Uf;function a6(){if(Uf)return ml;Uf=1;var r=z;function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var t=typeof Object.is=="function"?Object.is:e,n=r.useState,i=r.useEffect,s=r.useLayoutEffect,o=r.useDebugValue;function a(d,h){var f=h(),m=n({inst:{value:f,getSnapshot:h}}),v=m[0].inst,y=m[1];return s(function(){v.value=f,v.getSnapshot=h,l(v)&&y({inst:v})},[d,f,h]),i(function(){return l(v)&&y({inst:v}),d(function(){l(v)&&y({inst:v})})},[d]),o(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!t(d,f)}catch{return!0}}function u(d,h){return h()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return ml.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:c,ml}var gl={};var Gf;function l6(){return Gf||(Gf=1,process.env.NODE_ENV!=="production"&&(function(){function r(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}function e(f,m){c||i.startTransition===void 0||(c=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var v=m();if(!d){var y=m();s(v,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}y=o({inst:{value:v,getSnapshot:m}});var w=y[0].inst,k=y[1];return l(function(){w.value=v,w.getSnapshot=m,t(w)&&k({inst:w})},[f,v,m]),a(function(){return t(w)&&k({inst:w}),f(function(){t(w)&&k({inst:w})})},[f]),u(v),v}function t(f){var m=f.getSnapshot;f=f.value;try{var v=m();return!s(f,v)}catch{return!0}}function n(f,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=z,s=typeof Object.is=="function"?Object.is:r,o=i.useState,a=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,c=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:e;gl.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),gl}var Kf;function vl(){return Kf||(Kf=1,process.env.NODE_ENV==="production"?Gs.exports=a6():Gs.exports=l6()),Gs.exports}var Jf=vl();const{getOwnPropertyNames:u6,getOwnPropertySymbols:c6}=Object,{hasOwnProperty:d6}=Object.prototype;function yl(r,e){return function(n,i,s){return r(n,i,s)&&e(n,i,s)}}function Ks(r){return function(t,n,i){if(!t||!n||typeof t!="object"||typeof n!="object")return r(t,n,i);const{cache:s}=i,o=s.get(t),a=s.get(n);if(o&&a)return o===n&&a===t;s.set(t,n),s.set(n,t);const l=r(t,n,i);return s.delete(t),s.delete(n),l}}function f6(r){return r?.[Symbol.toStringTag]}function Yf(r){return u6(r).concat(c6(r))}const h6=Object.hasOwn||((r,e)=>d6.call(r,e));function yn(r,e){return r===e||!r&&!e&&r!==r&&e!==e}const p6="__v",m6="__o",g6="_owner",{getOwnPropertyDescriptor:Xf,keys:Zf}=Object;function v6(r,e){return r.byteLength===e.byteLength&&Js(new Uint8Array(r),new Uint8Array(e))}function y6(r,e,t){let n=r.length;if(e.length!==n)return!1;for(;n-- >0;)if(!t.equals(r[n],e[n],n,n,r,e,t))return!1;return!0}function b6(r,e){return r.byteLength===e.byteLength&&Js(new Uint8Array(r.buffer,r.byteOffset,r.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function w6(r,e){return yn(r.getTime(),e.getTime())}function x6(r,e){return r.name===e.name&&r.message===e.message&&r.cause===e.cause&&r.stack===e.stack}function S6(r,e){return r===e}function Qf(r,e,t){const n=r.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),s=r.entries();let o,a,l=0;for(;(o=s.next())&&!o.done;){const u=e.entries();let c=!1,d=0;for(;(a=u.next())&&!a.done;){if(i[d]){d++;continue}const h=o.value,f=a.value;if(t.equals(h[0],f[0],l,d,r,e,t)&&t.equals(h[1],f[1],h[0],f[0],r,e,t)){c=i[d]=!0;break}d++}if(!c)return!1;l++}return!0}const k6=yn;function T6(r,e,t){const n=Zf(r);let i=n.length;if(Zf(e).length!==i)return!1;for(;i-- >0;)if(!th(r,e,t,n[i]))return!1;return!0}function Ni(r,e,t){const n=Yf(r);let i=n.length;if(Yf(e).length!==i)return!1;let s,o,a;for(;i-- >0;)if(s=n[i],!th(r,e,t,s)||(o=Xf(r,s),a=Xf(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function M6(r,e){return yn(r.valueOf(),e.valueOf())}function C6(r,e){return r.source===e.source&&r.flags===e.flags}function eh(r,e,t){const n=r.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),s=r.values();let o,a;for(;(o=s.next())&&!o.done;){const l=e.values();let u=!1,c=0;for(;(a=l.next())&&!a.done;){if(!i[c]&&t.equals(o.value,a.value,o.value,a.value,r,e,t)){u=i[c]=!0;break}c++}if(!u)return!1}return!0}function Js(r,e){let t=r.byteLength;if(e.byteLength!==t||r.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(r[t]!==e[t])return!1;return!0}function E6(r,e){return r.hostname===e.hostname&&r.pathname===e.pathname&&r.protocol===e.protocol&&r.port===e.port&&r.hash===e.hash&&r.username===e.username&&r.password===e.password}function th(r,e,t,n){return(n===g6||n===m6||n===p6)&&(r.$$typeof||e.$$typeof)?!0:h6(e,n)&&t.equals(r[n],e[n],n,n,r,e,t)}const A6="[object ArrayBuffer]",O6="[object Arguments]",N6="[object Boolean]",D6="[object DataView]",I6="[object Date]",R6="[object Error]",P6="[object Map]",z6="[object Number]",L6="[object Object]",B6="[object RegExp]",F6="[object Set]",$6="[object String]",H6={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},V6="[object URL]",_6=Object.prototype.toString;function j6({areArrayBuffersEqual:r,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:f,unknownTagComparators:m}){return function(y,w,k){if(y===w)return!0;if(y==null||w==null)return!1;const E=typeof y;if(E!==typeof w)return!1;if(E!=="object")return E==="number"?a(y,w,k):E==="function"?s(y,w,k):!1;const R=y.constructor;if(R!==w.constructor)return!1;if(R===Object)return l(y,w,k);if(Array.isArray(y))return e(y,w,k);if(R===Date)return n(y,w,k);if(R===RegExp)return c(y,w,k);if(R===Map)return o(y,w,k);if(R===Set)return d(y,w,k);const O=_6.call(y);if(O===I6)return n(y,w,k);if(O===B6)return c(y,w,k);if(O===P6)return o(y,w,k);if(O===F6)return d(y,w,k);if(O===L6)return typeof y.then!="function"&&typeof w.then!="function"&&l(y,w,k);if(O===V6)return f(y,w,k);if(O===R6)return i(y,w,k);if(O===O6)return l(y,w,k);if(H6[O])return h(y,w,k);if(O===A6)return r(y,w,k);if(O===D6)return t(y,w,k);if(O===N6||O===z6||O===$6)return u(y,w,k);if(m){let N=m[O];if(!N){const D=f6(y);D&&(N=m[D])}if(N)return N(y,w,k)}return!1}}function q6({circular:r,createCustomConfig:e,strict:t}){let n={areArrayBuffersEqual:v6,areArraysEqual:t?Ni:y6,areDataViewsEqual:b6,areDatesEqual:w6,areErrorsEqual:x6,areFunctionsEqual:S6,areMapsEqual:t?yl(Qf,Ni):Qf,areNumbersEqual:k6,areObjectsEqual:t?Ni:T6,arePrimitiveWrappersEqual:M6,areRegExpsEqual:C6,areSetsEqual:t?yl(eh,Ni):eh,areTypedArraysEqual:t?yl(Js,Ni):Js,areUrlsEqual:E6,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),r){const i=Ks(n.areArraysEqual),s=Ks(n.areMapsEqual),o=Ks(n.areObjectsEqual),a=Ks(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:a})}return n}function W6(r){return function(e,t,n,i,s,o,a){return r(e,t,a)}}function U6({circular:r,comparator:e,createState:t,equals:n,strict:i}){if(t)return function(a,l){const{cache:u=r?new WeakMap:void 0,meta:c}=t();return e(a,l,{cache:u,equals:n,meta:c,strict:i})};if(r)return function(a,l){return e(a,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const s={cache:void 0,equals:n,meta:void 0,strict:i};return function(a,l){return e(a,l,s)}}const G6=Wr();Wr({strict:!0}),Wr({circular:!0}),Wr({circular:!0,strict:!0}),Wr({createInternalComparator:()=>yn}),Wr({strict:!0,createInternalComparator:()=>yn}),Wr({circular:!0,createInternalComparator:()=>yn}),Wr({circular:!0,createInternalComparator:()=>yn,strict:!0});function Wr(r={}){const{circular:e=!1,createInternalComparator:t,createState:n,strict:i=!1}=r,s=q6(r),o=j6(s),a=t?t(o):W6(o);return U6({circular:e,comparator:o,createState:n,equals:a,strict:i})}var Ys={exports:{}},bl={};var rh;function K6(){if(rh)return bl;rh=1;var r=z,e=vl();function t(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var n=typeof Object.is=="function"?Object.is:t,i=e.useSyncExternalStore,s=r.useRef,o=r.useEffect,a=r.useMemo,l=r.useDebugValue;return bl.useSyncExternalStoreWithSelector=function(u,c,d,h,f){var m=s(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=a(function(){function w(N){if(!k){if(k=!0,E=N,N=h(N),f!==void 0&&v.hasValue){var D=v.value;if(f(D,N))return R=D}return R=N}if(D=R,n(E,N))return D;var B=h(N);return f!==void 0&&f(D,B)?(E=N,D):(E=N,R=B)}var k=!1,E,R,O=d===void 0?null:d;return[function(){return w(c())},O===null?void 0:function(){return w(O())}]},[c,d,h,f]);var y=i(u,m[0],m[1]);return o(function(){v.hasValue=!0,v.value=y},[y]),l(y),y},bl}var wl={};var nh;function J6(){return nh||(nh=1,process.env.NODE_ENV!=="production"&&(function(){function r(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=z,t=vl(),n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;wl.useSyncExternalStoreWithSelector=function(u,c,d,h,f){var m=s(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=a(function(){function w(N){if(!k){if(k=!0,E=N,N=h(N),f!==void 0&&v.hasValue){var D=v.value;if(f(D,N))return R=D}return R=N}if(D=R,n(E,N))return D;var B=h(N);return f!==void 0&&f(D,B)?(E=N,D):(E=N,R=B)}var k=!1,E,R,O=d===void 0?null:d;return[function(){return w(c())},O===null?void 0:function(){return w(O())}]},[c,d,h,f]);var y=i(u,m[0],m[1]);return o(function(){v.hasValue=!0,v.value=y},[y]),l(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),wl}var ih;function Y6(){return ih||(ih=1,process.env.NODE_ENV==="production"?Ys.exports=K6():Ys.exports=J6()),Ys.exports}var X6=Y6(),Z6=(...r)=>e=>{r.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},Q6=({contentComponent:r})=>{const e=Jf.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getServerSnapshot);return Y.jsx(Y.Fragment,{children:Object.values(e)})};function e7(){const r=new Set;let e={};return{subscribe(t){return r.add(t),()=>{r.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,n){e={...e,[t]:Ui.createPortal(n.reactElement,n.element,t)},r.forEach(i=>i())},removeRenderer(t){const n={...e};delete n[t],e=n,r.forEach(i=>i())}}}var t7=class extends z.Component{constructor(r){var e;super(r),this.editorContentRef=z.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=r.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var r;const e=this.props.editor;if(e&&!e.isDestroyed&&((r=e.view.dom)!=null&&r.parentNode)){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=e7(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var r;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((r=e.view.dom)!=null&&r.parentNode))return;const t=document.createElement("div");t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){const{editor:r,innerRef:e,...t}=this.props;return Y.jsxs(Y.Fragment,{children:[Y.jsx("div",{ref:Z6(e,this.editorContentRef),...t}),r?.contentComponent&&Y.jsx(Q6,{contentComponent:r.contentComponent})]})}},r7=z.forwardRef((r,e)=>{const t=z.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[r.editor]);return z.createElement(t7,{key:t,innerRef:e,...r})}),n7=z.memo(r7),i7=typeof window<"u"?z.useLayoutEffect:z.useEffect,s7=class{constructor(r){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=r,this.lastSnapshot={editor:r,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(r){return this.subscribers.add(r),()=>{this.subscribers.delete(r)}}watch(r){if(this.editor=r,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(n=>n())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function sh(r){var e;const[t]=z.useState(()=>new s7(r.editor)),n=X6.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,r.selector,(e=r.equalityFn)!=null?e:G6);return i7(()=>t.watch(r.editor),[r.editor,t]),z.useDebugValue(n),n}var oh=process.env.NODE_ENV!=="production",xl=typeof window>"u",o7=xl||!!(typeof window<"u"&&window.next),a7=class M1{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(xl||o7){if(oh)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&xl&&oh)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...n)},onBlur:(...n)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...n)},onCreate:(...n)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...n)},onDestroy:(...n)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...n)},onFocus:(...n)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...n)},onSelectionUpdate:(...n)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...n)},onTransaction:(...n)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...n)},onUpdate:(...n)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...n)},onContentError:(...n)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...n)},onDrop:(...n)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...n)},onPaste:(...n)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...n)},onDelete:(...n)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...n)}};return new D3(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)?!0:n==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((i,s)=>{var o;return i===((o=t.extensions)==null?void 0:o[s])}):e[n]===t[n])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?M1.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,i)=>n===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function l7(r={},e=[]){const t=z.useRef(r);t.current=r;const[n]=z.useState(()=>new a7(t)),i=Jf.useSyncExternalStore(n.subscribe,n.getEditor,n.getServerSnapshot);return z.useDebugValue(i),z.useEffect(n.onRender(e)),sh({editor:i,selector:({transactionNumber:s})=>r.shouldRerenderOnTransaction===!1||r.shouldRerenderOnTransaction===void 0?null:r.immediatelyRender&&s===0?0:s+1}),i}var ah=z.createContext({editor:null});ah.Consumer;var lh=()=>z.useContext(ah),uh=z.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),ch=()=>z.useContext(uh);function dh({as:r="div",...e}){const{nodeViewContentRef:t,nodeViewContentChildren:n}=ch();return Y.jsx(r,{...e,ref:t,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style},children:n})}var fh=z.forwardRef((r,e)=>{const{onDragStart:t}=ch(),n=r.as||"div";return Y.jsx(n,{...r,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...r.style}})});function hh(r){return!!(typeof r=="function"&&r.prototype&&r.prototype.isReactComponent)}function ph(r){return!!(typeof r=="object"&&r.$$typeof&&(r.$$typeof.toString()==="Symbol(react.forward_ref)"||r.$$typeof.description==="react.forward_ref"))}function u7(r){return!!(typeof r=="object"&&r.$$typeof&&(r.$$typeof.toString()==="Symbol(react.memo)"||r.$$typeof.description==="react.memo"))}function c7(r){if(hh(r)||ph(r))return!0;if(u7(r)){const e=r.type;if(e)return hh(e)||ph(e)}return!1}function d7(){try{if(z.version)return parseInt(z.version.split(".")[0],10)>=19}catch{}return!1}var f7=class{constructor(r,{editor:e,props:t={},as:n="div",className:i=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=r,this.editor=e,this.props=t,this.element=document.createElement(n),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?Ui.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.render()})}render(){var r;const e=this.component,t=this.props,n=this.editor,i=d7(),s=c7(e),o={...t};o.ref&&!(i||s)&&delete o.ref,!o.ref&&(i||s)&&(o.ref=a=>{this.ref=a}),this.reactElement=Y.jsx(e,{...o}),(r=n?.contentComponent)==null||r.setRenderer(this.id,this)}updateProps(r={}){this.props={...this.props,...r},this.render()}destroy(){var r;const e=this.editor;(r=e?.contentComponent)==null||r.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(r){Object.keys(r).forEach(e=>{this.element.setAttribute(e,r[e])})}};z.createContext({markViewContentRef:()=>{}});var h7=class extends $3{constructor(r,e,t){if(super(r,e,t),this.selectionRafId=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const n=this.dom.querySelector("[data-node-view-content]");if(!n)return;n.appendChild(this.contentDOMElement)}}mount(){const r={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(l={})=>this.updateAttributes(l),deleteNode:()=>this.deleteNode(),ref:z.createRef()};if(!this.component.displayName){const l=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=l(this.extension.name)}const n={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:l=>{l&&this.contentDOMElement&&l.firstChild!==this.contentDOMElement&&(l.hasAttribute("data-node-view-wrapper")&&l.removeAttribute("data-node-view-wrapper"),l.appendChild(this.contentDOMElement))}},i=this.component,s=z.memo(l=>Y.jsx(uh.Provider,{value:n,children:z.createElement(i,l)}));s.displayName="ReactNodeView";let o=this.node.isInline?"span":"div";this.options.as&&(o=this.options.as);const{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new f7(s,{editor:this.editor,props:r,as:o,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var r;if(this.renderer.element.firstElementChild&&!((r=this.renderer.element.firstElementChild)!=null&&r.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const{from:r,to:e}=this.editor.state.selection,t=this.getPos();if(typeof t=="number")if(r<=t&&e>=t+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(r,e,t){const n=i=>{this.renderer.updateProps(i),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(r.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,s=this.decorations,o=this.innerDecorations;return this.node=r,this.decorations=e,this.innerDecorations=t,this.options.update({oldNode:i,oldDecorations:s,newNode:r,newDecorations:e,oldInnerDecorations:o,innerDecorations:t,updateProps:()=>n({node:r,decorations:e,innerDecorations:t})})}return r===this.node&&this.decorations===e&&this.innerDecorations===t||(this.node=r,this.decorations=e,this.innerDecorations=t,n({node:r,decorations:e,innerDecorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let r={};if(typeof this.options.attrs=="function"){const e=this.editor.extensionManager.attributes,t=Ai(this.node,e);r=this.options.attrs({node:this.node,HTMLAttributes:t})}else r=this.options.attrs;this.renderer.updateAttributes(r)}}};function bn(r,e){return t=>t.editor.contentComponent?new h7(r,t,e):{}}var p7=Object.defineProperty,m7=(r,e)=>{for(var t in e)p7(r,t,{get:e[t],enumerable:!0})},g7="listItem",mh="textStyle",gh=/^\s*([-+*])\s$/,vh=we.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:r}){return["ul",ge(this.options.HTMLAttributes,r),0]},markdownTokenName:"list",parseMarkdown:(r,e)=>r.type!=="list"||r.ordered?[]:{type:"bulletList",content:r.items?e.parseChildren(r.items):[]},renderMarkdown:(r,e)=>r.content?e.renderChildren(r.content,`
|
|
596
|
-
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(
|
|
597
|
-
`,d+=1;else if(f.match(
|
|
629
|
+
`)}function gb(r,e,t={}){const{state:n}=e,{doc:i,tr:s}=n,o=r;i.descendants((a,l)=>{const u=s.mapping.map(l),c=s.mapping.map(l)+a.nodeSize;let d=null;if(a.marks.forEach(f=>{if(f!==o)return!1;d=f}),!d)return;let h=!1;if(Object.keys(t).forEach(f=>{t[f]!==d.attrs[f]&&(h=!0)}),h){const f=r.type.create({...r.attrs,...t});s.removeMark(u,c,r.type),s.addMark(u,c,f)}}),s.docChanged&&e.view.dispatch(s)}var Oe=class zg extends Zl{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new zg(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},vb=class{constructor(r,e,t){this.isDragging=!1,this.component=r,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...t},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(r){var e,t,n,i,s,o,a;const{view:l}=this.editor,u=r.target,c=u.nodeType===3?(e=u.parentElement)==null?void 0:e.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||(t=this.contentDOM)!=null&&t.contains(u)||!c)return;let d=0,h=0;if(this.dom!==c){const k=this.dom.getBoundingClientRect(),E=c.getBoundingClientRect(),I=(i=r.offsetX)!=null?i:(n=r.nativeEvent)==null?void 0:n.offsetX,A=(o=r.offsetY)!=null?o:(s=r.nativeEvent)==null?void 0:s.offsetY;d=E.x-k.x+I,h=E.y-k.y+A}const f=this.dom.cloneNode(!0);try{const k=this.dom.getBoundingClientRect();f.style.width=`${Math.round(k.width)}px`,f.style.height=`${Math.round(k.height)}px`,f.style.boxSizing="border-box",f.style.pointerEvents="none"}catch{}let m=null;try{m=document.createElement("div"),m.style.position="absolute",m.style.top="-9999px",m.style.left="-9999px",m.style.pointerEvents="none",m.appendChild(f),document.body.appendChild(m),(a=r.dataTransfer)==null||a.setDragImage(f,d,h)}finally{m&&setTimeout(()=>{try{m?.remove()}catch{}},0)}const v=this.getPos();if(typeof v!="number")return;const y=le.create(l.state.doc,v),w=l.state.tr.setSelection(y);l.dispatch(w)}stopEvent(r){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:r});const t=r.target;if(!(this.dom.contains(t)&&!((e=this.contentDOM)!=null&&e.contains(t))))return!1;const i=r.type.startsWith("drag"),s=r.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(t.tagName)||t.isContentEditable)&&!s&&!i)return!0;const{isEditable:a}=this.editor,{isDragging:l}=this,u=!!this.node.type.spec.draggable,c=le.isSelectable(this.node),d=r.type==="copy",h=r.type==="paste",f=r.type==="cut",m=r.type==="mousedown";if(!u&&c&&i&&r.target===this.dom&&r.preventDefault(),u&&i&&!l&&r.target===this.dom)return r.preventDefault(),!1;if(u&&a&&!l&&m){const v=t.closest("[data-drag-handle]");v&&(this.dom===v||this.dom.contains(v))&&(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!(l||s||d||h||f||m&&c)}ignoreMutation(r){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:r}):this.node.isLeaf||this.node.isAtom?!0:r.type==="selection"||this.dom.contains(r.target)&&r.type==="childList"&&(go()||ch())&&this.editor.isFocused&&[...Array.from(r.addedNodes),...Array.from(r.removedNodes)].every(t=>t.isContentEditable)?!1:this.contentDOM===r.target&&r.type==="attributes"?!0:!this.contentDOM.contains(r.target)}updateAttributes(r){this.editor.commands.command(({tr:e})=>{const t=this.getPos();return typeof t!="number"?!1:(e.setNodeMarkup(t,void 0,{...this.node.attrs,...r}),!0)})}deleteNode(){const r=this.getPos();if(typeof r!="number")return;const e=r+this.node.nodeSize;this.editor.commands.deleteRange({from:r,to:e})}};function Mo(r){return new eb({find:r.find,handler:({state:e,range:t,match:n,pasteEvent:i})=>{const s=Ie(r.getAttributes,void 0,n,i);if(s===!1||s===null)return null;const{tr:o}=e,a=n[n.length-1],l=n[0];let u=t.to;if(a){const c=l.search(/\S/),d=t.from+l.indexOf(a),h=d+a.length;if(kh(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===r.type&&y!==m.mark.type)).filter(m=>m.to>d).length)return null;h<t.to&&o.delete(h,t.to),d>t.from&&o.delete(t.from+c,d),u=t.from+c+a.length,o.addMark(t.from+c,u,r.type.create(s||{})),o.removeStoredMark(r.type)}}})}function yb(r={}){return new qe({view(e){return new bb(e,r)}})}class bb{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(t){let d=e.nodeBefore,h=e.nodeAfter;if(d||h){let f=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(f){let m=f.getBoundingClientRect(),v=d?m.bottom:m.top;d&&h&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*a;n={left:m.left,right:m.right,top:v-y,bottom:v+y}}}}if(!n){let d=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*o;n={left:d.left-h,right:d.left+h,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let u,c;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,c=-pageYOffset;else{let d=l.getBoundingClientRect(),h=d.width/l.offsetWidth,f=d.height/l.offsetHeight;u=d.left-l.scrollLeft*h,c=d.top-l.scrollTop*f}this.element.style.left=(n.left-u)/o+"px",this.element.style.top=(n.top-c)/a+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!s){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=vd(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class We extends ge{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return We.valid(n)?new We(n):ge.near(n)}content(){return Z.empty}eq(e){return e instanceof We&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new We(e.resolve(t.pos))}getBookmark(){return new i0(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!wb(e)||!xb(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&We.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(t>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(We.valid(l))return l}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!le.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),n=!1;continue e}break}s=o,i+=t;let a=e.doc.resolve(i);if(We.valid(a))return a}return null}}}We.prototype.visible=!1,We.findFrom=We.findGapCursorFrom,ge.jsonID("gapcursor",We);class i0{constructor(e){this.pos=e}map(e){return new i0(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return We.valid(t)?new We(t):ge.near(t)}}function jh(r){return r.isAtom||r.spec.isolating||r.spec.createGapCursor}function wb(r){for(let e=r.depth;e>=0;e--){let t=r.index(e),n=r.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||jh(i.type))return!0;if(i.inlineContent)return!1}}return!0}function xb(r){for(let e=r.depth;e>=0;e--){let t=r.indexAfter(e),n=r.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||jh(i.type))return!0;if(i.inlineContent)return!1}}return!0}function Sb(){return new qe({props:{decorations:Mb,createSelectionBetween(r,e,t){return e.pos==t.pos&&We.valid(t)?new We(t):null},handleClick:Tb,handleKeyDown:kb,handleDOMEvents:{beforeinput:Cb}}})}const kb=Bl({ArrowLeft:Eo("horiz",-1),ArrowRight:Eo("horiz",1),ArrowUp:Eo("vert",-1),ArrowDown:Eo("vert",1)});function Eo(r,e){const t=r=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let o=n.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof we){if(!s.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let u=We.findGapCursorFrom(a,e,l);return u?(i&&i(n.tr.setSelection(new We(u))),!0):!1}}function Tb(r,e,t){if(!r||!r.editable)return!1;let n=r.state.doc.resolve(e);if(!We.valid(n))return!1;let i=r.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&le.isSelectable(r.state.doc.nodeAt(i.inside))?!1:(r.dispatch(r.state.tr.setSelection(new We(n))),!0)}function Cb(r,e){if(e.inputType!="insertCompositionText"||!(r.state.selection instanceof We))return!1;let{$from:t}=r.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);if(!n)return!1;let i=j.empty;for(let o=n.length-1;o>=0;o--)i=j.from(n[o].createAndFill(null,i));let s=r.state.tr.replace(t.pos,t.pos,new Z(i,0,0));return s.setSelection(we.near(s.doc.resolve(t.pos+1))),r.dispatch(s),!1}function Mb(r){if(!(r.selection instanceof We))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",je.create(r.doc,[pt.widget(r.selection.head,e,{key:"gapcursor"})])}var Ao=200,nt=function(){};nt.prototype.append=function(e){return e.length?(e=nt.from(e),!this.length&&e||e.length<Ao&&this.leafAppend(e)||this.length<Ao&&e.leafPrepend(this)||this.appendInner(e)):this},nt.prototype.prepend=function(e){return e.length?nt.from(e).append(this):this},nt.prototype.appendInner=function(e){return new Eb(this,e)},nt.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?nt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},nt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},nt.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},nt.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,n),i},nt.from=function(e){return e instanceof nt?e:e&&e.length?new _h(e):nt.empty};var _h=(function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ao)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ao)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(nt);nt.empty=new _h([]);var Eb=(function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(n,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(n,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(n,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(n,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(n,i):n>=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(nt);const Ab=500;class Gt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;t&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=e.tr,a,l,u=[],c=[];return this.items.forEach((d,h)=>{if(!d.step){i||(i=this.remapping(n,h+1),s=i.maps.length),s--,c.push(d);return}if(i){c.push(new rr(d.map));let f=d.step.map(i.slice(s)),m;f&&o.maybeStep(f).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],u.push(new rr(m,void 0,void 0,u.length+c.length))),s--,m&&i.appendMap(m,s)}else o.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(s)):d.selection,l=new Gt(this.items.slice(0,n).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,t,n,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let d=e.steps[c].invert(e.docs[c]),h=new rr(e.mapping.maps[c],d,t),f;(f=l&&l.merge(h))&&(h=f,c?s.pop():a=a.slice(0,a.length-1)),s.push(h),t&&(o++,t=void 0),i||(l=h)}let u=o-n.depth;return u>Nb&&(a=Ob(a,u),o-=u),new Gt(a.append(s),o)}remapping(e,t){let n=new qi;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new Gt(this.items.append(e.map(t=>new rr(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=t;this.items.forEach(h=>{let f=s.getMirror(--l);if(f==null)return;o=Math.min(o,f);let m=s.maps[f];if(h.step){let v=e.steps[f].invert(e.docs[f]),y=h.selection&&h.selection.map(s.slice(l+1,f));y&&a++,n.push(new rr(m,v,y))}else n.push(new rr(m))},i);let u=[];for(let h=t;h<o;h++)u.push(new rr(s.maps[h]));let c=this.items.slice(0,i).append(u).append(n),d=new Gt(c,a);return d.emptyItemCount()>Ab&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(t.slice(n)),u=l&&l.getMap();if(n--,u&&t.appendMap(u,n),l){let c=o.selection&&o.selection.map(t.slice(n));c&&s++;let d=new rr(u.invert(),l,c),h,f=i.length-1;(h=i.length&&i[f].merge(d))?i[f]=h:i.push(d)}}else o.map&&n--},this.items.length,0),new Gt(nt.from(i.reverse()),s)}}Gt.empty=new Gt(nt.empty,0);function Ob(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class rr{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new rr(t.getMap().invert(),t,this.selection)}}}class nn{constructor(e,t,n,i,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const Nb=20;function Db(r,e,t,n){let i=t.getMeta(An),s;if(i)return i.historyState;t.getMeta(Rb)&&(r=new nn(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(An))return o.getMeta(An).redo?new nn(r.done.addTransform(t,void 0,n,Oo(e)),r.undone,Vh(t.mapping.maps),r.prevTime,r.prevComposition):new nn(r.done,r.undone.addTransform(t,void 0,n,Oo(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=r.prevTime==0||!o&&r.prevComposition!=a&&(r.prevTime<(t.time||0)-n.newGroupDelay||!Pb(t,r.prevRanges)),u=o?s0(r.prevRanges,t.mapping):Vh(t.mapping.maps);return new nn(r.done.addTransform(t,l?e.selection.getBookmark():void 0,n,Oo(e)),Gt.empty,u,t.time,a??r.prevComposition)}else return(s=t.getMeta("rebased"))?new nn(r.done.rebased(t,s),r.undone.rebased(t,s),s0(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new nn(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),s0(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function Pb(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let s=0;s<e.length;s+=2)n<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function Vh(r){let e=[];for(let t=r.length-1;t>=0&&e.length==0;t--)r[t].forEach((n,i,s,o)=>e.push(s,o));return e}function s0(r,e){if(!r)return null;let t=[];for(let n=0;n<r.length;n+=2){let i=e.map(r[n],1),s=e.map(r[n+1],-1);i<=s&&t.push(i,s)}return t}function Ib(r,e,t){let n=Oo(e),i=An.get(e).spec.config,s=(t?r.undone:r.done).popEvent(e,n);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(t?r.done:r.undone).addTransform(s.transform,e.selection.getBookmark(),i,n),l=new nn(t?a:s.remaining,t?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(An,{redo:t,historyState:l})}let o0=!1,qh=null;function Oo(r){let e=r.plugins;if(qh!=e){o0=!1,qh=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){o0=!0;break}}return o0}const An=new Ke("history"),Rb=new Ke("closeHistory");function zb(r={}){return r={depth:r.depth||100,newGroupDelay:r.newGroupDelay||500},new qe({key:An,state:{init(){return new nn(Gt.empty,Gt.empty,null,0,-1)},apply(e,t,n){return Db(t,n,e,r)}},config:r,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?Uh:n=="historyRedo"?Kh:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function Wh(r,e){return(t,n)=>{let i=An.getState(t);if(!i||(r?i.undone:i.done).eventCount==0)return!1;if(n){let s=Ib(i,t,r);s&&n(e?s.scrollIntoView():s)}return!0}}const Uh=Wh(!1,!0),Kh=Wh(!0,!0);De.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:r=>r.length,wordCounter:r=>r.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=r=>{const e=r?.node||this.editor.state.doc;if((r?.mode||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=r=>{const e=r?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let r=!1;return[new qe({key:new Ke("characterCount"),appendTransaction:(e,t,n)=>{if(r)return;const i=this.options.limit;if(i==null||i===0){r=!0;return}const s=this.storage.characters({node:n.doc});if(s>i){const o=s-i,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=n.tr.deleteRange(a,l);return r=!0,u}r=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:t.doc}),s=this.storage.characters({node:e.doc});if(s<=n||i>n&&s>n&&s<=i)return!0;if(i>n&&s>n&&s>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=s-n,u=a-l,c=a;return e.deleteRange(u,c),!(this.storage.characters({node:e.doc})>n)}})]}}),De.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[yb(this.options)]}});var Lb=De.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new qe({key:new Ke("focus"),props:{decorations:({doc:r,selection:e})=>{const{isEditable:t,isFocused:n}=this.editor,{anchor:i}=e,s=[];if(!t||!n)return je.create(r,[]);let o=0;this.options.mode==="deepest"&&r.descendants((l,u)=>{if(l.isText)return;if(!(i>=u&&i<=u+l.nodeSize-1))return!1;o+=1});let a=0;return r.descendants((l,u)=>{if(l.isText||!(i>=u&&i<=u+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(pt.node(u,u+l.nodeSize,{class:this.options.className}))}),je.create(r,s)}}})]}}),Bb=De.create({name:"gapCursor",addProseMirrorPlugins(){return[Sb()]},extendNodeSchema(r){var e;const t={name:r.name,options:r.options,storage:r.storage};return{allowGapCursor:(e=Ie(ue(r,"allowGapCursor",t)))!=null?e:null}}});De.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new qe({key:new Ke("placeholder"),props:{decorations:({doc:r,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,i=[];if(!t)return null;const s=this.editor.isEmpty;return r.descendants((o,a)=>{const l=n>=a&&n<=a+o.nodeSize,u=!o.isLeaf&&xo(o);if((l||!this.options.showOnlyCurrent)&&u){const c=[this.options.emptyNodeClass];s&&c.push(this.options.emptyEditorClass);const d=pt.node(a,a+o.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:l}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),je.create(r,i)}}})]}}),De.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:r,options:e}=this;return[new qe({key:new Ke("selection"),props:{decorations(t){return t.selection.empty||r.isFocused||!r.isEditable||C6(t.selection)||r.view.dragging?null:je.create(t.doc,[pt.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function Gh({types:r,node:e}){return e&&Array.isArray(r)&&r.includes(e.type)||e?.type===r}De.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var r;const e=new Ke(this.name),t=this.options.node||((r=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:r.name)||"paragraph",n=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new qe({key:e,appendTransaction:(i,s,o)=>{const{doc:a,tr:l,schema:u}=o,c=e.getState(o),d=a.content.size,h=u.nodes[t];if(c)return l.insert(d,h.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!Gh({node:o,types:n})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!Gh({node:o,types:n})}}})]}});var Fb=De.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:r,dispatch:e})=>Uh(r,e),redo:()=>({state:r,dispatch:e})=>Kh(r,e)}},addProseMirrorPlugins(){return[zb(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),No={exports:{}},a0={};var Jh;function $b(){if(Jh)return a0;Jh=1;var r=B;function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var t=typeof Object.is=="function"?Object.is:e,n=r.useState,i=r.useEffect,s=r.useLayoutEffect,o=r.useDebugValue;function a(d,h){var f=h(),m=n({inst:{value:f,getSnapshot:h}}),v=m[0].inst,y=m[1];return s(function(){v.value=f,v.getSnapshot=h,l(v)&&y({inst:v})},[d,f,h]),i(function(){return l(v)&&y({inst:v}),d(function(){l(v)&&y({inst:v})})},[d]),o(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!t(d,f)}catch{return!0}}function u(d,h){return h()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return a0.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:c,a0}var l0={};var Yh;function Hb(){return Yh||(Yh=1,process.env.NODE_ENV!=="production"&&(function(){function r(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}function e(f,m){c||i.startTransition===void 0||(c=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var v=m();if(!d){var y=m();s(v,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}y=o({inst:{value:v,getSnapshot:m}});var w=y[0].inst,k=y[1];return l(function(){w.value=v,w.getSnapshot=m,t(w)&&k({inst:w})},[f,v,m]),a(function(){return t(w)&&k({inst:w}),f(function(){t(w)&&k({inst:w})})},[f]),u(v),v}function t(f){var m=f.getSnapshot;f=f.value;try{var v=m();return!s(f,v)}catch{return!0}}function n(f,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=B,s=typeof Object.is=="function"?Object.is:r,o=i.useState,a=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,c=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:e;l0.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),l0}var Xh;function u0(){return Xh||(Xh=1,process.env.NODE_ENV==="production"?No.exports=$b():No.exports=Hb()),No.exports}var Zh=u0();const{getOwnPropertyNames:jb,getOwnPropertySymbols:_b}=Object,{hasOwnProperty:Vb}=Object.prototype;function c0(r,e){return function(n,i,s){return r(n,i,s)&&e(n,i,s)}}function Do(r){return function(t,n,i){if(!t||!n||typeof t!="object"||typeof n!="object")return r(t,n,i);const{cache:s}=i,o=s.get(t),a=s.get(n);if(o&&a)return o===n&&a===t;s.set(t,n),s.set(n,t);const l=r(t,n,i);return s.delete(t),s.delete(n),l}}function qb(r){return r?.[Symbol.toStringTag]}function Qh(r){return jb(r).concat(_b(r))}const Wb=Object.hasOwn||((r,e)=>Vb.call(r,e));function On(r,e){return r===e||!r&&!e&&r!==r&&e!==e}const Ub="__v",Kb="__o",Gb="_owner",{getOwnPropertyDescriptor:ep,keys:tp}=Object;function Jb(r,e){return r.byteLength===e.byteLength&&Po(new Uint8Array(r),new Uint8Array(e))}function Yb(r,e,t){let n=r.length;if(e.length!==n)return!1;for(;n-- >0;)if(!t.equals(r[n],e[n],n,n,r,e,t))return!1;return!0}function Xb(r,e){return r.byteLength===e.byteLength&&Po(new Uint8Array(r.buffer,r.byteOffset,r.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Zb(r,e){return On(r.getTime(),e.getTime())}function Qb(r,e){return r.name===e.name&&r.message===e.message&&r.cause===e.cause&&r.stack===e.stack}function e7(r,e){return r===e}function rp(r,e,t){const n=r.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),s=r.entries();let o,a,l=0;for(;(o=s.next())&&!o.done;){const u=e.entries();let c=!1,d=0;for(;(a=u.next())&&!a.done;){if(i[d]){d++;continue}const h=o.value,f=a.value;if(t.equals(h[0],f[0],l,d,r,e,t)&&t.equals(h[1],f[1],h[0],f[0],r,e,t)){c=i[d]=!0;break}d++}if(!c)return!1;l++}return!0}const t7=On;function r7(r,e,t){const n=tp(r);let i=n.length;if(tp(e).length!==i)return!1;for(;i-- >0;)if(!ip(r,e,t,n[i]))return!1;return!0}function ls(r,e,t){const n=Qh(r);let i=n.length;if(Qh(e).length!==i)return!1;let s,o,a;for(;i-- >0;)if(s=n[i],!ip(r,e,t,s)||(o=ep(r,s),a=ep(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function n7(r,e){return On(r.valueOf(),e.valueOf())}function i7(r,e){return r.source===e.source&&r.flags===e.flags}function np(r,e,t){const n=r.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),s=r.values();let o,a;for(;(o=s.next())&&!o.done;){const l=e.values();let u=!1,c=0;for(;(a=l.next())&&!a.done;){if(!i[c]&&t.equals(o.value,a.value,o.value,a.value,r,e,t)){u=i[c]=!0;break}c++}if(!u)return!1}return!0}function Po(r,e){let t=r.byteLength;if(e.byteLength!==t||r.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(r[t]!==e[t])return!1;return!0}function s7(r,e){return r.hostname===e.hostname&&r.pathname===e.pathname&&r.protocol===e.protocol&&r.port===e.port&&r.hash===e.hash&&r.username===e.username&&r.password===e.password}function ip(r,e,t,n){return(n===Gb||n===Kb||n===Ub)&&(r.$$typeof||e.$$typeof)?!0:Wb(e,n)&&t.equals(r[n],e[n],n,n,r,e,t)}const o7="[object ArrayBuffer]",a7="[object Arguments]",l7="[object Boolean]",u7="[object DataView]",c7="[object Date]",d7="[object Error]",f7="[object Map]",h7="[object Number]",p7="[object Object]",m7="[object RegExp]",g7="[object Set]",v7="[object String]",y7={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},b7="[object URL]",w7=Object.prototype.toString;function x7({areArrayBuffersEqual:r,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:f,unknownTagComparators:m}){return function(y,w,k){if(y===w)return!0;if(y==null||w==null)return!1;const E=typeof y;if(E!==typeof w)return!1;if(E!=="object")return E==="number"?a(y,w,k):E==="function"?s(y,w,k):!1;const I=y.constructor;if(I!==w.constructor)return!1;if(I===Object)return l(y,w,k);if(Array.isArray(y))return e(y,w,k);if(I===Date)return n(y,w,k);if(I===RegExp)return c(y,w,k);if(I===Map)return o(y,w,k);if(I===Set)return d(y,w,k);const A=w7.call(y);if(A===c7)return n(y,w,k);if(A===m7)return c(y,w,k);if(A===f7)return o(y,w,k);if(A===g7)return d(y,w,k);if(A===p7)return typeof y.then!="function"&&typeof w.then!="function"&&l(y,w,k);if(A===b7)return f(y,w,k);if(A===d7)return i(y,w,k);if(A===a7)return l(y,w,k);if(y7[A])return h(y,w,k);if(A===o7)return r(y,w,k);if(A===u7)return t(y,w,k);if(A===l7||A===h7||A===v7)return u(y,w,k);if(m){let N=m[A];if(!N){const P=qb(y);P&&(N=m[P])}if(N)return N(y,w,k)}return!1}}function S7({circular:r,createCustomConfig:e,strict:t}){let n={areArrayBuffersEqual:Jb,areArraysEqual:t?ls:Yb,areDataViewsEqual:Xb,areDatesEqual:Zb,areErrorsEqual:Qb,areFunctionsEqual:e7,areMapsEqual:t?c0(rp,ls):rp,areNumbersEqual:t7,areObjectsEqual:t?ls:r7,arePrimitiveWrappersEqual:n7,areRegExpsEqual:i7,areSetsEqual:t?c0(np,ls):np,areTypedArraysEqual:t?c0(Po,ls):Po,areUrlsEqual:s7,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),r){const i=Do(n.areArraysEqual),s=Do(n.areMapsEqual),o=Do(n.areObjectsEqual),a=Do(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:a})}return n}function k7(r){return function(e,t,n,i,s,o,a){return r(e,t,a)}}function T7({circular:r,comparator:e,createState:t,equals:n,strict:i}){if(t)return function(a,l){const{cache:u=r?new WeakMap:void 0,meta:c}=t();return e(a,l,{cache:u,equals:n,meta:c,strict:i})};if(r)return function(a,l){return e(a,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const s={cache:void 0,equals:n,meta:void 0,strict:i};return function(a,l){return e(a,l,s)}}const C7=sn();sn({strict:!0}),sn({circular:!0}),sn({circular:!0,strict:!0}),sn({createInternalComparator:()=>On}),sn({strict:!0,createInternalComparator:()=>On}),sn({circular:!0,createInternalComparator:()=>On}),sn({circular:!0,createInternalComparator:()=>On,strict:!0});function sn(r={}){const{circular:e=!1,createInternalComparator:t,createState:n,strict:i=!1}=r,s=S7(r),o=x7(s),a=t?t(o):k7(o);return T7({circular:e,comparator:o,createState:n,equals:a,strict:i})}var Io={exports:{}},d0={};var sp;function M7(){if(sp)return d0;sp=1;var r=B,e=u0();function t(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var n=typeof Object.is=="function"?Object.is:t,i=e.useSyncExternalStore,s=r.useRef,o=r.useEffect,a=r.useMemo,l=r.useDebugValue;return d0.useSyncExternalStoreWithSelector=function(u,c,d,h,f){var m=s(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=a(function(){function w(N){if(!k){if(k=!0,E=N,N=h(N),f!==void 0&&v.hasValue){var P=v.value;if(f(P,N))return I=P}return I=N}if(P=I,n(E,N))return P;var L=h(N);return f!==void 0&&f(P,L)?(E=N,P):(E=N,I=L)}var k=!1,E,I,A=d===void 0?null:d;return[function(){return w(c())},A===null?void 0:function(){return w(A())}]},[c,d,h,f]);var y=i(u,m[0],m[1]);return o(function(){v.hasValue=!0,v.value=y},[y]),l(y),y},d0}var f0={};var op;function E7(){return op||(op=1,process.env.NODE_ENV!=="production"&&(function(){function r(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=B,t=u0(),n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;f0.useSyncExternalStoreWithSelector=function(u,c,d,h,f){var m=s(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=a(function(){function w(N){if(!k){if(k=!0,E=N,N=h(N),f!==void 0&&v.hasValue){var P=v.value;if(f(P,N))return I=P}return I=N}if(P=I,n(E,N))return P;var L=h(N);return f!==void 0&&f(P,L)?(E=N,P):(E=N,I=L)}var k=!1,E,I,A=d===void 0?null:d;return[function(){return w(c())},A===null?void 0:function(){return w(A())}]},[c,d,h,f]);var y=i(u,m[0],m[1]);return o(function(){v.hasValue=!0,v.value=y},[y]),l(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),f0}var ap;function A7(){return ap||(ap=1,process.env.NODE_ENV==="production"?Io.exports=M7():Io.exports=E7()),Io.exports}var O7=A7(),N7=(...r)=>e=>{r.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},D7=({contentComponent:r})=>{const e=Zh.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getServerSnapshot);return X.jsx(X.Fragment,{children:Object.values(e)})};function P7(){const r=new Set;let e={};return{subscribe(t){return r.add(t),()=>{r.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,n){e={...e,[t]:Cs.createPortal(n.reactElement,n.element,t)},r.forEach(i=>i())},removeRenderer(t){const n={...e};delete n[t],e=n,r.forEach(i=>i())}}}var I7=class extends B.Component{constructor(r){var e;super(r),this.editorContentRef=B.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=r.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var r;const e=this.props.editor;if(e&&!e.isDestroyed&&((r=e.view.dom)!=null&&r.parentNode)){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=P7(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var r;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((r=e.view.dom)!=null&&r.parentNode))return;const t=document.createElement("div");t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){const{editor:r,innerRef:e,...t}=this.props;return X.jsxs(X.Fragment,{children:[X.jsx("div",{ref:N7(e,this.editorContentRef),...t}),r?.contentComponent&&X.jsx(D7,{contentComponent:r.contentComponent})]})}},R7=B.forwardRef((r,e)=>{const t=B.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[r.editor]);return B.createElement(I7,{key:t,innerRef:e,...r})}),z7=B.memo(R7),L7=typeof window<"u"?B.useLayoutEffect:B.useEffect,B7=class{constructor(r){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=r,this.lastSnapshot={editor:r,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(r){return this.subscribers.add(r),()=>{this.subscribers.delete(r)}}watch(r){if(this.editor=r,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(n=>n())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function lp(r){var e;const[t]=B.useState(()=>new B7(r.editor)),n=O7.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,r.selector,(e=r.equalityFn)!=null?e:C7);return L7(()=>t.watch(r.editor),[r.editor,t]),B.useDebugValue(n),n}var up=process.env.NODE_ENV!=="production",h0=typeof window>"u",F7=h0||!!(typeof window<"u"&&window.next),$7=class Lg{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(h0||F7){if(up)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&h0&&up)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...n)},onBlur:(...n)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...n)},onCreate:(...n)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...n)},onDestroy:(...n)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...n)},onFocus:(...n)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...n)},onSelectionUpdate:(...n)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...n)},onTransaction:(...n)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...n)},onUpdate:(...n)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...n)},onContentError:(...n)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...n)},onDrop:(...n)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...n)},onPaste:(...n)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...n)},onDelete:(...n)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...n)}};return new ub(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)?!0:n==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((i,s)=>{var o;return i===((o=t.extensions)==null?void 0:o[s])}):e[n]===t[n])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?Lg.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,i)=>n===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function H7(r={},e=[]){const t=B.useRef(r);t.current=r;const[n]=B.useState(()=>new $7(t)),i=Zh.useSyncExternalStore(n.subscribe,n.getEditor,n.getServerSnapshot);return B.useDebugValue(i),B.useEffect(n.onRender(e)),lp({editor:i,selector:({transactionNumber:s})=>r.shouldRerenderOnTransaction===!1||r.shouldRerenderOnTransaction===void 0?null:r.immediatelyRender&&s===0?0:s+1}),i}var cp=B.createContext({editor:null});cp.Consumer;var dp=()=>B.useContext(cp),fp=B.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),hp=()=>B.useContext(fp);function pp({as:r="div",...e}){const{nodeViewContentRef:t,nodeViewContentChildren:n}=hp();return X.jsx(r,{...e,ref:t,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style},children:n})}var mp=B.forwardRef((r,e)=>{const{onDragStart:t}=hp(),n=r.as||"div";return X.jsx(n,{...r,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...r.style}})});function gp(r){return!!(typeof r=="function"&&r.prototype&&r.prototype.isReactComponent)}function vp(r){return!!(typeof r=="object"&&r.$$typeof&&(r.$$typeof.toString()==="Symbol(react.forward_ref)"||r.$$typeof.description==="react.forward_ref"))}function j7(r){return!!(typeof r=="object"&&r.$$typeof&&(r.$$typeof.toString()==="Symbol(react.memo)"||r.$$typeof.description==="react.memo"))}function _7(r){if(gp(r)||vp(r))return!0;if(j7(r)){const e=r.type;if(e)return gp(e)||vp(e)}return!1}function V7(){try{if(B.version)return parseInt(B.version.split(".")[0],10)>=19}catch{}return!1}var q7=class{constructor(r,{editor:e,props:t={},as:n="div",className:i=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=r,this.editor=e,this.props=t,this.element=document.createElement(n),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?Cs.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.render()})}render(){var r;const e=this.component,t=this.props,n=this.editor,i=V7(),s=_7(e),o={...t};o.ref&&!(i||s)&&delete o.ref,!o.ref&&(i||s)&&(o.ref=a=>{this.ref=a}),this.reactElement=X.jsx(e,{...o}),(r=n?.contentComponent)==null||r.setRenderer(this.id,this)}updateProps(r={}){this.props={...this.props,...r},this.render()}destroy(){var r;const e=this.editor;(r=e?.contentComponent)==null||r.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(r){Object.keys(r).forEach(e=>{this.element.setAttribute(e,r[e])})}};B.createContext({markViewContentRef:()=>{}});var W7=class extends vb{constructor(r,e,t){if(super(r,e,t),this.selectionRafId=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const n=this.dom.querySelector("[data-node-view-content]");if(!n)return;n.appendChild(this.contentDOMElement)}}mount(){const r={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(l={})=>this.updateAttributes(l),deleteNode:()=>this.deleteNode(),ref:B.createRef()};if(!this.component.displayName){const l=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=l(this.extension.name)}const n={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:l=>{l&&this.contentDOMElement&&l.firstChild!==this.contentDOMElement&&(l.hasAttribute("data-node-view-wrapper")&&l.removeAttribute("data-node-view-wrapper"),l.appendChild(this.contentDOMElement))}},i=this.component,s=B.memo(l=>X.jsx(fp.Provider,{value:n,children:B.createElement(i,l)}));s.displayName="ReactNodeView";let o=this.node.isInline?"span":"div";this.options.as&&(o=this.options.as);const{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new q7(s,{editor:this.editor,props:r,as:o,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var r;if(this.renderer.element.firstElementChild&&!((r=this.renderer.element.firstElementChild)!=null&&r.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const{from:r,to:e}=this.editor.state.selection,t=this.getPos();if(typeof t=="number")if(r<=t&&e>=t+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(r,e,t){const n=i=>{this.renderer.updateProps(i),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(r.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,s=this.decorations,o=this.innerDecorations;return this.node=r,this.decorations=e,this.innerDecorations=t,this.options.update({oldNode:i,oldDecorations:s,newNode:r,newDecorations:e,oldInnerDecorations:o,innerDecorations:t,updateProps:()=>n({node:r,decorations:e,innerDecorations:t})})}return r===this.node&&this.decorations===e&&this.innerDecorations===t||(this.node=r,this.decorations=e,this.innerDecorations=t,n({node:r,decorations:e,innerDecorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let r={};if(typeof this.options.attrs=="function"){const e=this.editor.extensionManager.attributes,t=ss(this.node,e);r=this.options.attrs({node:this.node,HTMLAttributes:t})}else r=this.options.attrs;this.renderer.updateAttributes(r)}}};function Nn(r,e){return t=>t.editor.contentComponent?new W7(r,t,e):{}}var U7=Object.defineProperty,K7=(r,e)=>{for(var t in e)U7(r,t,{get:e[t],enumerable:!0})},G7="listItem",yp="textStyle",bp=/^\s*([-+*])\s$/,wp=Oe.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:r}){return["ul",Ce(this.options.HTMLAttributes,r),0]},markdownTokenName:"list",parseMarkdown:(r,e)=>r.type!=="list"||r.ordered?[]:{type:"bulletList",content:r.items?e.parseChildren(r.items):[]},renderMarkdown:(r,e)=>r.content?e.renderChildren(r.content,`
|
|
630
|
+
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(G7,this.editor.getAttributes(yp)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let r=mt({find:bp,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(r=mt({find:bp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(yp),editor:this.editor})),[r]}}),xp=Oe.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",Ce(this.options.HTMLAttributes,r),0]},markdownTokenName:"list_item",parseMarkdown:(r,e)=>{if(r.type!=="list_item")return[];let t=[];if(r.tokens&&r.tokens.length>0)if(r.tokens.some(i=>i.type==="paragraph"))t=e.parseChildren(r.tokens);else{const i=r.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(t=[{type:"paragraph",content:e.parseInline(i.tokens)}],r.tokens.length>1){const o=r.tokens.slice(1),a=e.parseChildren(o);t.push(...a)}}else t=e.parseChildren(r.tokens)}return t.length===0&&(t=[{type:"paragraph",content:[]}]),{type:"listItem",content:t}},renderMarkdown:(r,e,t)=>n0(r,e,n=>n.parentType==="bulletList"?"- ":n.parentType==="orderedList"?`${n.index+1}. `:"- ",t),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),J7={};K7(J7,{findListItemPos:()=>us,getNextListDepth:()=>p0,handleBackspace:()=>m0,handleDelete:()=>g0,hasListBefore:()=>Sp,hasListItemAfter:()=>Y7,hasListItemBefore:()=>kp,listItemHasSubList:()=>Tp,nextListIsDeeper:()=>Cp,nextListIsHigher:()=>Mp});var us=(r,e)=>{const{$from:t}=e.selection,n=Ye(r,e.schema);let i=null,s=t.depth,o=t.pos,a=null;for(;s>0&&a===null;)i=t.node(s),i.type===n?a=s:(s-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},p0=(r,e)=>{const t=us(r,e);if(!t)return!1;const[,n]=w6(e,r,t.$pos.pos+4);return n},Sp=(r,e,t)=>{const{$anchor:n}=r.selection,i=Math.max(0,n.pos-2),s=r.doc.resolve(i).node();return!(!s||!t.includes(s.type.name))},kp=(r,e)=>{var t;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-2);return!(i.index()===0||((t=i.nodeBefore)==null?void 0:t.type.name)!==r)},Tp=(r,e,t)=>{if(!t)return!1;const n=Ye(r,e.schema);let i=!1;return t.descendants(s=>{s.type===n&&(i=!0)}),i},m0=(r,e,t)=>{if(r.commands.undoInputRule())return!0;if(r.state.selection.from!==r.state.selection.to)return!1;if(!tn(r.state,e)&&Sp(r.state,e,t)){const{$anchor:a}=r.state.selection,l=r.state.doc.resolve(a.before()-1),u=[];l.node().descendants((h,f)=>{h.type.name===e&&u.push({node:h,pos:f})});const c=u.at(-1);if(!c)return!1;const d=r.state.doc.resolve(l.start()+c.pos+1);return r.chain().cut({from:a.start()-1,to:a.end()+1},d.end()).joinForward().run()}if(!tn(r.state,e)||!T6(r.state))return!1;const n=us(e,r.state);if(!n)return!1;const s=r.state.doc.resolve(n.$pos.pos-2).node(n.depth),o=Tp(e,r.state,s);return kp(e,r.state)&&!o?r.commands.joinItemBackward():r.chain().liftListItem(e).run()},Cp=(r,e)=>{const t=p0(r,e),n=us(r,e);return!n||!t?!1:t>n.depth},Mp=(r,e)=>{const t=p0(r,e),n=us(r,e);return!n||!t?!1:t<n.depth},g0=(r,e)=>{if(!tn(r.state,e)||!k6(r.state,e))return!1;const{selection:t}=r.state,{$from:n,$to:i}=t;return!t.empty&&n.sameParent(i)?!1:Cp(e,r.state)?r.chain().focus(r.state.selection.from+4).lift(e).joinBackward().run():Mp(e,r.state)?r.chain().joinForward().joinBackward().run():r.commands.joinItemForward()},Y7=(r,e)=>{var t;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-n.parentOffset-2);return!(i.index()===i.parent.childCount-1||((t=i.nodeAfter)==null?void 0:t.type.name)!==r)},X7=De.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:r})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{r.state.schema.nodes[t]!==void 0&&g0(r,t)&&(e=!0)}),e},"Mod-Delete":({editor:r})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{r.state.schema.nodes[t]!==void 0&&g0(r,t)&&(e=!0)}),e},Backspace:({editor:r})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:n})=>{r.state.schema.nodes[t]!==void 0&&m0(r,t,n)&&(e=!0)}),e},"Mod-Backspace":({editor:r})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:n})=>{r.state.schema.nodes[t]!==void 0&&m0(r,t,n)&&(e=!0)}),e}}}}),Ep=/^(\s*)(\d+)\.\s+(.*)$/,Z7=/^\s/;function Q7(r){const e=[];let t=0,n=0;for(;t<r.length;){const i=r[t],s=i.match(Ep);if(!s)break;const[,o,a,l]=s,u=o.length;let c=l,d=t+1;const h=[i];for(;d<r.length;){const f=r[d];if(f.match(Ep))break;if(f.trim()==="")h.push(f),c+=`
|
|
631
|
+
`,d+=1;else if(f.match(Z7))h.push(f),c+=`
|
|
598
632
|
${f.slice(u+2)}`,d+=1;else break}e.push({indent:u,number:parseInt(a,10),content:c.trim(),raw:h.join(`
|
|
599
|
-
`)}),n=d,t=d}return[e,n]}function
|
|
633
|
+
`)}),n=d,t=d}return[e,n]}function Ap(r,e,t){var n;const i=[];let s=0;for(;s<r.length;){const o=r[s];if(o.indent===e){const a=o.content.split(`
|
|
600
634
|
`),l=((n=a[0])==null?void 0:n.trim())||"",u=[];l&&u.push({type:"paragraph",raw:l,tokens:t.inlineTokens(l)});const c=a.slice(1).join(`
|
|
601
|
-
`).trim();if(c){const f=t.blockTokens(c);u.push(...f)}let d=s+1;const h=[];for(;d<r.length&&r[d].indent>e;)h.push(r[d]),d+=1;if(h.length>0){const f=Math.min(...h.map(v=>v.indent)),m=
|
|
602
|
-
`)})}i.push({type:"list_item",raw:o.raw,tokens:u}),s=d}else s+=1}return i}function
|
|
635
|
+
`).trim();if(c){const f=t.blockTokens(c);u.push(...f)}let d=s+1;const h=[];for(;d<r.length&&r[d].indent>e;)h.push(r[d]),d+=1;if(h.length>0){const f=Math.min(...h.map(v=>v.indent)),m=Ap(h,f,t);u.push({type:"list",ordered:!0,start:h[0].number,items:m,raw:h.map(v=>v.raw).join(`
|
|
636
|
+
`)})}i.push({type:"list_item",raw:o.raw,tokens:u}),s=d}else s+=1}return i}function e8(r,e){return r.map(t=>{if(t.type!=="list_item")return e.parseChildren([t])[0];const n=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")n.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);n.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&n.push(...s)}}),{type:"listItem",content:n}})}var t8="listItem",Op="textStyle",Np=/^(\d+)\.\s$/,Dp=Oe.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:r=>r.hasAttribute("start")?parseInt(r.getAttribute("start")||"",10):1},type:{default:null,parseHTML:r=>r.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:r}){const{start:e,...t}=r;return e===1?["ol",Ce(this.options.HTMLAttributes,t),0]:["ol",Ce(this.options.HTMLAttributes,r),0]},markdownTokenName:"list",parseMarkdown:(r,e)=>{if(r.type!=="list"||!r.ordered)return[];const t=r.start||1,n=r.items?e8(r.items,e):[];return t!==1?{type:"orderedList",attrs:{start:t},content:n}:{type:"orderedList",content:n}},renderMarkdown:(r,e)=>r.content?e.renderChildren(r.content,`
|
|
603
637
|
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:r=>{const e=r.match(/^(\s*)(\d+)\.\s+/),t=e?.index;return t!==void 0?t:-1},tokenize:(r,e,t)=>{var n;const i=r.split(`
|
|
604
|
-
`),[s,o]=
|
|
605
|
-
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(
|
|
606
|
-
`):"",markdownTokenizer:{name:"taskList",level:"block",start(r){var e;const t=(e=r.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(r,e,t){const n=s=>{const o=
|
|
638
|
+
`),[s,o]=Q7(i);if(s.length===0)return;const a=Ap(s,0,t);return a.length===0?void 0:{type:"list",ordered:!0,start:((n=s[0])==null?void 0:n.number)||1,items:a,raw:i.slice(0,o).join(`
|
|
639
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(t8,this.editor.getAttributes(Op)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let r=mt({find:Np,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(r=mt({find:Np,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Op)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[r]}}),r8=/^\s*(\[([( |x])?\])\s$/,n8=Oe.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:r=>{const e=r.getAttribute("data-checked");return e===""||e==="true"},renderHTML:r=>({"data-checked":r.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:r,HTMLAttributes:e}){return["li",Ce(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:r.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(r,e)=>{const t=[];if(r.tokens&&r.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(r.tokens))):r.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:r.text})])):t.push(e.createNode("paragraph",{},[])),r.nestedTokens&&r.nestedTokens.length>0){const n=e.parseChildren(r.nestedTokens);t.push(...n)}return e.createNode("taskItem",{checked:r.checked||!1},t)},renderMarkdown:(r,e)=>{var t;const i=`- [${(t=r.attrs)!=null&&t.checked?"x":" "}] `;return n0(r,e,i)},addKeyboardShortcuts(){const r={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...r,Tab:()=>this.editor.commands.sinkListItem(this.name)}:r},addNodeView(){return({node:r,HTMLAttributes:e,getPos:t,editor:n})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),u=c=>{var d,h;a.ariaLabel=((h=(d=this.options.a11y)==null?void 0:d.checkboxLabel)==null?void 0:h.call(d,c,a.checked))||`Task item checkbox for ${c.textContent||"empty task item"}`};return u(r),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",c=>c.preventDefault()),a.addEventListener("change",c=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:d}=c.target;n.isEditable&&typeof t=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const f=t();if(typeof f!="number")return!1;const m=h.doc.nodeAt(f);return h.setNodeMarkup(f,void 0,{...m?.attrs,checked:d}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(r,d)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([c,d])=>{i.setAttribute(c,d)}),i.dataset.checked=r.attrs.checked,a.checked=r.attrs.checked,s.append(a,o),i.append(s,l),Object.entries(e).forEach(([c,d])=>{i.setAttribute(c,d)}),{dom:i,contentDOM:l,update:c=>c.type!==this.type?!1:(i.dataset.checked=c.attrs.checked,a.checked=c.attrs.checked,u(c),!0)}}},addInputRules(){return[mt({find:r8,type:this.type,getAttributes:r=>({checked:r[r.length-1]==="x"})})]}}),i8=Oe.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:r}){return["ul",Ce(this.options.HTMLAttributes,r,{"data-type":this.name}),0]},parseMarkdown:(r,e)=>e.createNode("taskList",{},e.parseChildren(r.items||[])),renderMarkdown:(r,e)=>r.content?e.renderChildren(r.content,`
|
|
640
|
+
`):"",markdownTokenizer:{name:"taskList",level:"block",start(r){var e;const t=(e=r.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(r,e,t){const n=s=>{const o=r0(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:t.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:n},t);return o?[{type:"taskList",raw:o.raw,items:o.items}]:t.blockTokens(s)},i=r0(r,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,o)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:t.inlineTokens(s.mainContent),nestedTokens:o}),customNestedParser:n},t);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:r})=>r.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});De.create({name:"listKit",addExtensions(){const r=[];return this.options.bulletList!==!1&&r.push(wp.configure(this.options.bulletList)),this.options.listItem!==!1&&r.push(xp.configure(this.options.listItem)),this.options.listKeymap!==!1&&r.push(X7.configure(this.options.listKeymap)),this.options.orderedList!==!1&&r.push(Dp.configure(this.options.orderedList)),this.options.taskItem!==!1&&r.push(n8.configure(this.options.taskItem)),this.options.taskList!==!1&&r.push(i8.configure(this.options.taskList)),r}});class St{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new St(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}class Pt{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Pt(t,St.range(this,e))}}class W{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n="KaTeX parse error: "+e,i,s,o=t&&t.loc;if(o&&o.start<=o.end){var a=o.lexer.input;i=o.start,s=o.end,i===a.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=a.slice(i,s).replace(/[^]/g,"$&̲"),u;i>15?u="…"+a.slice(i-15,i):u=a.slice(0,i);var c;s+15<a.length?c=a.slice(s,s+15)+"…":c=a.slice(s),n+=u+l+c}var d=new Error(n);return d.name="ParseError",d.__proto__=W.prototype,d.position=i,i!=null&&s!=null&&(d.length=s-i),d.rawMessage=e,d}}W.prototype.__proto__=Error.prototype;var s8=function(e,t){return e===void 0?t:e},o8=/([A-Z])/g,a8=function(e){return e.replace(o8,"-$1").toLowerCase()},l8={"&":"&",">":">","<":"<",'"':""","'":"'"},u8=/[&><"']/g;function c8(r){return String(r).replace(u8,e=>l8[e])}var Pp=function r(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?r(e.body[0]):e:e.type==="font"?r(e.body):e},d8=function(e){var t=Pp(e);return t.type==="mathord"||t.type==="textord"||t.type==="atom"},f8=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},h8=function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},Ee={deflt:s8,escape:c8,hyphenate:a8,getBaseElem:Pp,isCharacterBox:d8,protocolFromUrl:h8},Ro={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand <n>",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function p8(r){if(r.default)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class v0{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var t in Ro)if(Ro.hasOwnProperty(t)){var n=Ro[t];this[t]=e[t]!==void 0?n.processor?n.processor(e[t]):e[t]:p8(n)}}reportNonstrict(e,t,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,t,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new W("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,n){var i=this.strict;if(typeof i=="function")try{i=i(e,t,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var t=Ee.protocolFromUrl(e.url);if(t==null)return!1;e.protocol=t}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class on{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return nr[m8[this.id]]}sub(){return nr[g8[this.id]]}fracNum(){return nr[v8[this.id]]}fracDen(){return nr[y8[this.id]]}cramp(){return nr[b8[this.id]]}text(){return nr[w8[this.id]]}isTight(){return this.size>=2}}var y0=0,zo=1,ii=2,Cr=3,cs=4,_t=5,si=6,gt=7,nr=[new on(y0,0,!1),new on(zo,0,!0),new on(ii,1,!1),new on(Cr,1,!0),new on(cs,2,!1),new on(_t,2,!0),new on(si,3,!1),new on(gt,3,!0)],m8=[cs,_t,cs,_t,si,gt,si,gt],g8=[_t,_t,_t,_t,gt,gt,gt,gt],v8=[ii,Cr,cs,_t,si,gt,si,gt],y8=[Cr,Cr,_t,_t,gt,gt,gt,gt],b8=[zo,zo,Cr,Cr,_t,_t,gt,gt],w8=[y0,zo,ii,Cr,ii,Cr,ii,Cr],de={DISPLAY:nr[y0],TEXT:nr[ii],SCRIPT:nr[cs],SCRIPTSCRIPT:nr[si]},b0=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function x8(r){for(var e=0;e<b0.length;e++)for(var t=b0[e],n=0;n<t.blocks.length;n++){var i=t.blocks[n];if(r>=i[0]&&r<=i[1])return t.name}return null}var Lo=[];b0.forEach(r=>r.blocks.forEach(e=>Lo.push(...e)));function Ip(r){for(var e=0;e<Lo.length;e+=2)if(r>=Lo[e]&&r<=Lo[e+1])return!0;return!1}var oi=80,S8=function(e,t){return"M95,"+(622+e+t)+`
|
|
607
641
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
608
642
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
609
643
|
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
@@ -614,7 +648,7 @@ c5.3,-9.3,12,-14,20,-14
|
|
|
614
648
|
H400000v`+(40+e)+`H845.2724
|
|
615
649
|
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
616
650
|
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
617
|
-
M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},
|
|
651
|
+
M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},k8=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119
|
|
618
652
|
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
619
653
|
c340,-704.7,510.7,-1060.3,512,-1067
|
|
620
654
|
l`+e/2.084+" -"+e+`
|
|
@@ -624,7 +658,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,
|
|
|
624
658
|
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|
625
659
|
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
626
660
|
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
627
|
-
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},
|
|
661
|
+
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},T8=function(e,t){return"M983 "+(10+e+t)+`
|
|
628
662
|
l`+e/3.13+" -"+e+`
|
|
629
663
|
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
|
630
664
|
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|
@@ -633,7 +667,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
|
633
667
|
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
634
668
|
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
635
669
|
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
636
|
-
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},
|
|
670
|
+
M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},C8=function(e,t){return"M424,"+(2398+e+t)+`
|
|
637
671
|
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
638
672
|
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|
639
673
|
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
@@ -643,18 +677,18 @@ v`+(40+e)+`H1014.6
|
|
|
643
677
|
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
644
678
|
c-2,6,-10,9,-24,9
|
|
645
679
|
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+`
|
|
646
|
-
h400000v`+(40+e)+"h-400000z"},
|
|
680
|
+
h400000v`+(40+e)+"h-400000z"},M8=function(e,t){return"M473,"+(2713+e+t)+`
|
|
647
681
|
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
|
|
648
682
|
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
|
649
683
|
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
650
684
|
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|
651
685
|
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|
652
686
|
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
653
|
-
606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},
|
|
687
|
+
606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},E8=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},A8=function(e,t,n){var i=n-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+`
|
|
654
688
|
H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|
655
689
|
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
656
690
|
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
657
|
-
219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},
|
|
691
|
+
219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},O8=function(e,t,n){t=1e3*t;var i="";switch(e){case"sqrtMain":i=S8(t,oi);break;case"sqrtSize1":i=k8(t,oi);break;case"sqrtSize2":i=T8(t,oi);break;case"sqrtSize3":i=C8(t,oi);break;case"sqrtSize4":i=M8(t,oi);break;case"sqrtTall":i=A8(t,oi,n)}return i},N8=function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z"+("M367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z");case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257z"+("M478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z");default:return""}},Rp={doubleleftarrow:`M262 157
|
|
658
692
|
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
659
693
|
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
660
694
|
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
@@ -829,7 +863,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`
|
|
|
829
863
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
830
864
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
831
865
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
832
|
-
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},
|
|
866
|
+
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},D8=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 h347 v-84
|
|
833
867
|
H403z M403 1759 V0 H319 V1759 v`+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z
|
|
834
868
|
M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15
|
|
835
869
|
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
@@ -857,61 +891,62 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6
|
|
|
857
891
|
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|
858
892
|
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
859
893
|
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
860
|
-
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Ri{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){var e=t=>t.toText();return this.children.map(e).join("")}}var Yt={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},eo={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Ih={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function eb(r,e){Yt[r]=e}function Al(r,e,t){if(!Yt[e])throw new Error("Font metrics not found for font: "+e+".");var n=r.charCodeAt(0),i=Yt[e][n];if(!i&&r[0]in Ih&&(n=Ih[r[0]].charCodeAt(0),i=Yt[e][n]),!i&&t==="text"&&Nh(n)&&(i=Yt[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Ol={};function tb(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!Ol[e]){var t=Ol[e]={cssEmPerMu:eo.quad[e]/18};for(var n in eo)eo.hasOwnProperty(n)&&(t[n]=eo[n][e])}return Ol[e]}var rb=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Rh=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ph=function(e,t){return t.size<2?e:rb[e-1][t.size-1]};class mr{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||mr.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Rh[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new mr(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Ph(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Rh[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Ph(mr.BASESIZE,e);return this.size===t&&this.textSize===mr.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==mr.BASESIZE?["sizing","reset-size"+this.size,"size"+mr.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=tb(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}mr.BASESIZE=6;var Nl={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},nb={ex:!0,em:!0,mu:!0},zh=function(e){return typeof e!="string"&&(e=e.unit),e in Nl||e in nb||e==="ex"},Pe=function(e,t){var n;if(e.unit in Nl)n=Nl[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")n=t.fontMetrics().cssEmPerMu;else{var i;if(t.style.isTight()?i=t.havingStyle(t.style.text()):i=t,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new _("Invalid unit: '"+e.unit+"'");i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},q=function(e){return+e.toFixed(4)+"em"},Gr=function(e){return e.filter(t=>t).join(" ")},Lh=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},Bh=function(e){var t=document.createElement(e);t.className=Gr(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&t.setAttribute(i,this.attributes[i]);for(var s=0;s<this.children.length;s++)t.appendChild(this.children[s].toNode());return t},ib=/[\s"'>/=\x00-\x1f]/,Fh=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+be.escape(Gr(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=be.hyphenate(i)+":"+this.style[i]+";");n&&(t+=' style="'+be.escape(n)+'"');for(var s in this.attributes)if(this.attributes.hasOwnProperty(s)){if(ib.test(s))throw new _("Invalid attribute name '"+s+"'");t+=" "+s+'="'+be.escape(this.attributes[s])+'"'}t+=">";for(var o=0;o<this.children.length;o++)t+=this.children[o].toMarkup();return t+="</"+e+">",t};class Pi{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Lh.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Bh.call(this,"span")}toMarkup(){return Fh.call(this,"span")}}class Dl{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Lh.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Bh.call(this,"a")}toMarkup(){return Fh.call(this,"a")}}class sb{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+be.escape(this.src)+'"'+(' alt="'+be.escape(this.alt)+'"'),t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=be.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+be.escape(t)+'"'),e+="'/>",e}}var ob={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class zt{constructor(e,t,n,i,s,o,a,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=i||0,this.skew=s||0,this.width=o||0,this.classes=a||[],this.style=l||{},this.maxFontSize=0;var u=j7(this.text.charCodeAt(0));u&&this.classes.push(u+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=ob[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=q(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=Gr(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(t=t||document.createElement("span"),t.style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=be.escape(Gr(this.classes)),t+='"');var n="";this.italic>0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=be.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,t+=' style="'+be.escape(n)+'"');var s=be.escape(this.text);return e?(t+=">",t+=s,t+="</span>",t):s}}class gr{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+be.escape(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>",e}}class Kr{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",Dh[this.pathName]),t}toMarkup(){return this.alternate?'<path d="'+be.escape(this.alternate)+'"/>':'<path d="'+be.escape(Dh[this.pathName])+'"/>'}}class Il{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);return t}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+be.escape(this.attributes[t])+'"');return e+="/>",e}}function $h(r){if(r instanceof zt)return r;throw new Error("Expected symbolNode but got "+String(r)+".")}function ab(r){if(r instanceof Pi)return r;throw new Error("Expected span<HtmlDomNode> but got "+String(r)+".")}var lb={bin:1,close:1,inner:1,open:1,punct:1,rel:1},ub={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Ne={math:{},text:{}};function p(r,e,t,n,i,s){Ne[r][i]={font:e,group:t,replace:n},s&&n&&(Ne[r][n]=Ne[r][i])}var g="math",$="text",b="main",T="ams",Ie="accent-token",X="bin",dt="close",Vn="inner",ae="mathord",We="op-token",Mt="open",to="punct",M="rel",vr="spacing",A="textord";p(g,b,M,"≡","\\equiv",!0),p(g,b,M,"≺","\\prec",!0),p(g,b,M,"≻","\\succ",!0),p(g,b,M,"∼","\\sim",!0),p(g,b,M,"⊥","\\perp"),p(g,b,M,"⪯","\\preceq",!0),p(g,b,M,"⪰","\\succeq",!0),p(g,b,M,"≃","\\simeq",!0),p(g,b,M,"∣","\\mid",!0),p(g,b,M,"≪","\\ll",!0),p(g,b,M,"≫","\\gg",!0),p(g,b,M,"≍","\\asymp",!0),p(g,b,M,"∥","\\parallel"),p(g,b,M,"⋈","\\bowtie",!0),p(g,b,M,"⌣","\\smile",!0),p(g,b,M,"⊑","\\sqsubseteq",!0),p(g,b,M,"⊒","\\sqsupseteq",!0),p(g,b,M,"≐","\\doteq",!0),p(g,b,M,"⌢","\\frown",!0),p(g,b,M,"∋","\\ni",!0),p(g,b,M,"∝","\\propto",!0),p(g,b,M,"⊢","\\vdash",!0),p(g,b,M,"⊣","\\dashv",!0),p(g,b,M,"∋","\\owns"),p(g,b,to,".","\\ldotp"),p(g,b,to,"⋅","\\cdotp"),p(g,b,A,"#","\\#"),p($,b,A,"#","\\#"),p(g,b,A,"&","\\&"),p($,b,A,"&","\\&"),p(g,b,A,"ℵ","\\aleph",!0),p(g,b,A,"∀","\\forall",!0),p(g,b,A,"ℏ","\\hbar",!0),p(g,b,A,"∃","\\exists",!0),p(g,b,A,"∇","\\nabla",!0),p(g,b,A,"♭","\\flat",!0),p(g,b,A,"ℓ","\\ell",!0),p(g,b,A,"♮","\\natural",!0),p(g,b,A,"♣","\\clubsuit",!0),p(g,b,A,"℘","\\wp",!0),p(g,b,A,"♯","\\sharp",!0),p(g,b,A,"♢","\\diamondsuit",!0),p(g,b,A,"ℜ","\\Re",!0),p(g,b,A,"♡","\\heartsuit",!0),p(g,b,A,"ℑ","\\Im",!0),p(g,b,A,"♠","\\spadesuit",!0),p(g,b,A,"§","\\S",!0),p($,b,A,"§","\\S"),p(g,b,A,"¶","\\P",!0),p($,b,A,"¶","\\P"),p(g,b,A,"†","\\dag"),p($,b,A,"†","\\dag"),p($,b,A,"†","\\textdagger"),p(g,b,A,"‡","\\ddag"),p($,b,A,"‡","\\ddag"),p($,b,A,"‡","\\textdaggerdbl"),p(g,b,dt,"⎱","\\rmoustache",!0),p(g,b,Mt,"⎰","\\lmoustache",!0),p(g,b,dt,"⟯","\\rgroup",!0),p(g,b,Mt,"⟮","\\lgroup",!0),p(g,b,X,"∓","\\mp",!0),p(g,b,X,"⊖","\\ominus",!0),p(g,b,X,"⊎","\\uplus",!0),p(g,b,X,"⊓","\\sqcap",!0),p(g,b,X,"∗","\\ast"),p(g,b,X,"⊔","\\sqcup",!0),p(g,b,X,"◯","\\bigcirc",!0),p(g,b,X,"∙","\\bullet",!0),p(g,b,X,"‡","\\ddagger"),p(g,b,X,"≀","\\wr",!0),p(g,b,X,"⨿","\\amalg"),p(g,b,X,"&","\\And"),p(g,b,M,"⟵","\\longleftarrow",!0),p(g,b,M,"⇐","\\Leftarrow",!0),p(g,b,M,"⟸","\\Longleftarrow",!0),p(g,b,M,"⟶","\\longrightarrow",!0),p(g,b,M,"⇒","\\Rightarrow",!0),p(g,b,M,"⟹","\\Longrightarrow",!0),p(g,b,M,"↔","\\leftrightarrow",!0),p(g,b,M,"⟷","\\longleftrightarrow",!0),p(g,b,M,"⇔","\\Leftrightarrow",!0),p(g,b,M,"⟺","\\Longleftrightarrow",!0),p(g,b,M,"↦","\\mapsto",!0),p(g,b,M,"⟼","\\longmapsto",!0),p(g,b,M,"↗","\\nearrow",!0),p(g,b,M,"↩","\\hookleftarrow",!0),p(g,b,M,"↪","\\hookrightarrow",!0),p(g,b,M,"↘","\\searrow",!0),p(g,b,M,"↼","\\leftharpoonup",!0),p(g,b,M,"⇀","\\rightharpoonup",!0),p(g,b,M,"↙","\\swarrow",!0),p(g,b,M,"↽","\\leftharpoondown",!0),p(g,b,M,"⇁","\\rightharpoondown",!0),p(g,b,M,"↖","\\nwarrow",!0),p(g,b,M,"⇌","\\rightleftharpoons",!0),p(g,T,M,"≮","\\nless",!0),p(g,T,M,"","\\@nleqslant"),p(g,T,M,"","\\@nleqq"),p(g,T,M,"⪇","\\lneq",!0),p(g,T,M,"≨","\\lneqq",!0),p(g,T,M,"","\\@lvertneqq"),p(g,T,M,"⋦","\\lnsim",!0),p(g,T,M,"⪉","\\lnapprox",!0),p(g,T,M,"⊀","\\nprec",!0),p(g,T,M,"⋠","\\npreceq",!0),p(g,T,M,"⋨","\\precnsim",!0),p(g,T,M,"⪹","\\precnapprox",!0),p(g,T,M,"≁","\\nsim",!0),p(g,T,M,"","\\@nshortmid"),p(g,T,M,"∤","\\nmid",!0),p(g,T,M,"⊬","\\nvdash",!0),p(g,T,M,"⊭","\\nvDash",!0),p(g,T,M,"⋪","\\ntriangleleft"),p(g,T,M,"⋬","\\ntrianglelefteq",!0),p(g,T,M,"⊊","\\subsetneq",!0),p(g,T,M,"","\\@varsubsetneq"),p(g,T,M,"⫋","\\subsetneqq",!0),p(g,T,M,"","\\@varsubsetneqq"),p(g,T,M,"≯","\\ngtr",!0),p(g,T,M,"","\\@ngeqslant"),p(g,T,M,"","\\@ngeqq"),p(g,T,M,"⪈","\\gneq",!0),p(g,T,M,"≩","\\gneqq",!0),p(g,T,M,"","\\@gvertneqq"),p(g,T,M,"⋧","\\gnsim",!0),p(g,T,M,"⪊","\\gnapprox",!0),p(g,T,M,"⊁","\\nsucc",!0),p(g,T,M,"⋡","\\nsucceq",!0),p(g,T,M,"⋩","\\succnsim",!0),p(g,T,M,"⪺","\\succnapprox",!0),p(g,T,M,"≆","\\ncong",!0),p(g,T,M,"","\\@nshortparallel"),p(g,T,M,"∦","\\nparallel",!0),p(g,T,M,"⊯","\\nVDash",!0),p(g,T,M,"⋫","\\ntriangleright"),p(g,T,M,"⋭","\\ntrianglerighteq",!0),p(g,T,M,"","\\@nsupseteqq"),p(g,T,M,"⊋","\\supsetneq",!0),p(g,T,M,"","\\@varsupsetneq"),p(g,T,M,"⫌","\\supsetneqq",!0),p(g,T,M,"","\\@varsupsetneqq"),p(g,T,M,"⊮","\\nVdash",!0),p(g,T,M,"⪵","\\precneqq",!0),p(g,T,M,"⪶","\\succneqq",!0),p(g,T,M,"","\\@nsubseteqq"),p(g,T,X,"⊴","\\unlhd"),p(g,T,X,"⊵","\\unrhd"),p(g,T,M,"↚","\\nleftarrow",!0),p(g,T,M,"↛","\\nrightarrow",!0),p(g,T,M,"⇍","\\nLeftarrow",!0),p(g,T,M,"⇏","\\nRightarrow",!0),p(g,T,M,"↮","\\nleftrightarrow",!0),p(g,T,M,"⇎","\\nLeftrightarrow",!0),p(g,T,M,"△","\\vartriangle"),p(g,T,A,"ℏ","\\hslash"),p(g,T,A,"▽","\\triangledown"),p(g,T,A,"◊","\\lozenge"),p(g,T,A,"Ⓢ","\\circledS"),p(g,T,A,"®","\\circledR"),p($,T,A,"®","\\circledR"),p(g,T,A,"∡","\\measuredangle",!0),p(g,T,A,"∄","\\nexists"),p(g,T,A,"℧","\\mho"),p(g,T,A,"Ⅎ","\\Finv",!0),p(g,T,A,"⅁","\\Game",!0),p(g,T,A,"‵","\\backprime"),p(g,T,A,"▲","\\blacktriangle"),p(g,T,A,"▼","\\blacktriangledown"),p(g,T,A,"■","\\blacksquare"),p(g,T,A,"⧫","\\blacklozenge"),p(g,T,A,"★","\\bigstar"),p(g,T,A,"∢","\\sphericalangle",!0),p(g,T,A,"∁","\\complement",!0),p(g,T,A,"ð","\\eth",!0),p($,b,A,"ð","ð"),p(g,T,A,"╱","\\diagup"),p(g,T,A,"╲","\\diagdown"),p(g,T,A,"□","\\square"),p(g,T,A,"□","\\Box"),p(g,T,A,"◊","\\Diamond"),p(g,T,A,"¥","\\yen",!0),p($,T,A,"¥","\\yen",!0),p(g,T,A,"✓","\\checkmark",!0),p($,T,A,"✓","\\checkmark"),p(g,T,A,"ℶ","\\beth",!0),p(g,T,A,"ℸ","\\daleth",!0),p(g,T,A,"ℷ","\\gimel",!0),p(g,T,A,"ϝ","\\digamma",!0),p(g,T,A,"ϰ","\\varkappa"),p(g,T,Mt,"┌","\\@ulcorner",!0),p(g,T,dt,"┐","\\@urcorner",!0),p(g,T,Mt,"└","\\@llcorner",!0),p(g,T,dt,"┘","\\@lrcorner",!0),p(g,T,M,"≦","\\leqq",!0),p(g,T,M,"⩽","\\leqslant",!0),p(g,T,M,"⪕","\\eqslantless",!0),p(g,T,M,"≲","\\lesssim",!0),p(g,T,M,"⪅","\\lessapprox",!0),p(g,T,M,"≊","\\approxeq",!0),p(g,T,X,"⋖","\\lessdot"),p(g,T,M,"⋘","\\lll",!0),p(g,T,M,"≶","\\lessgtr",!0),p(g,T,M,"⋚","\\lesseqgtr",!0),p(g,T,M,"⪋","\\lesseqqgtr",!0),p(g,T,M,"≑","\\doteqdot"),p(g,T,M,"≓","\\risingdotseq",!0),p(g,T,M,"≒","\\fallingdotseq",!0),p(g,T,M,"∽","\\backsim",!0),p(g,T,M,"⋍","\\backsimeq",!0),p(g,T,M,"⫅","\\subseteqq",!0),p(g,T,M,"⋐","\\Subset",!0),p(g,T,M,"⊏","\\sqsubset",!0),p(g,T,M,"≼","\\preccurlyeq",!0),p(g,T,M,"⋞","\\curlyeqprec",!0),p(g,T,M,"≾","\\precsim",!0),p(g,T,M,"⪷","\\precapprox",!0),p(g,T,M,"⊲","\\vartriangleleft"),p(g,T,M,"⊴","\\trianglelefteq"),p(g,T,M,"⊨","\\vDash",!0),p(g,T,M,"⊪","\\Vvdash",!0),p(g,T,M,"⌣","\\smallsmile"),p(g,T,M,"⌢","\\smallfrown"),p(g,T,M,"≏","\\bumpeq",!0),p(g,T,M,"≎","\\Bumpeq",!0),p(g,T,M,"≧","\\geqq",!0),p(g,T,M,"⩾","\\geqslant",!0),p(g,T,M,"⪖","\\eqslantgtr",!0),p(g,T,M,"≳","\\gtrsim",!0),p(g,T,M,"⪆","\\gtrapprox",!0),p(g,T,X,"⋗","\\gtrdot"),p(g,T,M,"⋙","\\ggg",!0),p(g,T,M,"≷","\\gtrless",!0),p(g,T,M,"⋛","\\gtreqless",!0),p(g,T,M,"⪌","\\gtreqqless",!0),p(g,T,M,"≖","\\eqcirc",!0),p(g,T,M,"≗","\\circeq",!0),p(g,T,M,"≜","\\triangleq",!0),p(g,T,M,"∼","\\thicksim"),p(g,T,M,"≈","\\thickapprox"),p(g,T,M,"⫆","\\supseteqq",!0),p(g,T,M,"⋑","\\Supset",!0),p(g,T,M,"⊐","\\sqsupset",!0),p(g,T,M,"≽","\\succcurlyeq",!0),p(g,T,M,"⋟","\\curlyeqsucc",!0),p(g,T,M,"≿","\\succsim",!0),p(g,T,M,"⪸","\\succapprox",!0),p(g,T,M,"⊳","\\vartriangleright"),p(g,T,M,"⊵","\\trianglerighteq"),p(g,T,M,"⊩","\\Vdash",!0),p(g,T,M,"∣","\\shortmid"),p(g,T,M,"∥","\\shortparallel"),p(g,T,M,"≬","\\between",!0),p(g,T,M,"⋔","\\pitchfork",!0),p(g,T,M,"∝","\\varpropto"),p(g,T,M,"◀","\\blacktriangleleft"),p(g,T,M,"∴","\\therefore",!0),p(g,T,M,"∍","\\backepsilon"),p(g,T,M,"▶","\\blacktriangleright"),p(g,T,M,"∵","\\because",!0),p(g,T,M,"⋘","\\llless"),p(g,T,M,"⋙","\\gggtr"),p(g,T,X,"⊲","\\lhd"),p(g,T,X,"⊳","\\rhd"),p(g,T,M,"≂","\\eqsim",!0),p(g,b,M,"⋈","\\Join"),p(g,T,M,"≑","\\Doteq",!0),p(g,T,X,"∔","\\dotplus",!0),p(g,T,X,"∖","\\smallsetminus"),p(g,T,X,"⋒","\\Cap",!0),p(g,T,X,"⋓","\\Cup",!0),p(g,T,X,"⩞","\\doublebarwedge",!0),p(g,T,X,"⊟","\\boxminus",!0),p(g,T,X,"⊞","\\boxplus",!0),p(g,T,X,"⋇","\\divideontimes",!0),p(g,T,X,"⋉","\\ltimes",!0),p(g,T,X,"⋊","\\rtimes",!0),p(g,T,X,"⋋","\\leftthreetimes",!0),p(g,T,X,"⋌","\\rightthreetimes",!0),p(g,T,X,"⋏","\\curlywedge",!0),p(g,T,X,"⋎","\\curlyvee",!0),p(g,T,X,"⊝","\\circleddash",!0),p(g,T,X,"⊛","\\circledast",!0),p(g,T,X,"⋅","\\centerdot"),p(g,T,X,"⊺","\\intercal",!0),p(g,T,X,"⋒","\\doublecap"),p(g,T,X,"⋓","\\doublecup"),p(g,T,X,"⊠","\\boxtimes",!0),p(g,T,M,"⇢","\\dashrightarrow",!0),p(g,T,M,"⇠","\\dashleftarrow",!0),p(g,T,M,"⇇","\\leftleftarrows",!0),p(g,T,M,"⇆","\\leftrightarrows",!0),p(g,T,M,"⇚","\\Lleftarrow",!0),p(g,T,M,"↞","\\twoheadleftarrow",!0),p(g,T,M,"↢","\\leftarrowtail",!0),p(g,T,M,"↫","\\looparrowleft",!0),p(g,T,M,"⇋","\\leftrightharpoons",!0),p(g,T,M,"↶","\\curvearrowleft",!0),p(g,T,M,"↺","\\circlearrowleft",!0),p(g,T,M,"↰","\\Lsh",!0),p(g,T,M,"⇈","\\upuparrows",!0),p(g,T,M,"↿","\\upharpoonleft",!0),p(g,T,M,"⇃","\\downharpoonleft",!0),p(g,b,M,"⊶","\\origof",!0),p(g,b,M,"⊷","\\imageof",!0),p(g,T,M,"⊸","\\multimap",!0),p(g,T,M,"↭","\\leftrightsquigarrow",!0),p(g,T,M,"⇉","\\rightrightarrows",!0),p(g,T,M,"⇄","\\rightleftarrows",!0),p(g,T,M,"↠","\\twoheadrightarrow",!0),p(g,T,M,"↣","\\rightarrowtail",!0),p(g,T,M,"↬","\\looparrowright",!0),p(g,T,M,"↷","\\curvearrowright",!0),p(g,T,M,"↻","\\circlearrowright",!0),p(g,T,M,"↱","\\Rsh",!0),p(g,T,M,"⇊","\\downdownarrows",!0),p(g,T,M,"↾","\\upharpoonright",!0),p(g,T,M,"⇂","\\downharpoonright",!0),p(g,T,M,"⇝","\\rightsquigarrow",!0),p(g,T,M,"⇝","\\leadsto"),p(g,T,M,"⇛","\\Rrightarrow",!0),p(g,T,M,"↾","\\restriction"),p(g,b,A,"‘","`"),p(g,b,A,"$","\\$"),p($,b,A,"$","\\$"),p($,b,A,"$","\\textdollar"),p(g,b,A,"%","\\%"),p($,b,A,"%","\\%"),p(g,b,A,"_","\\_"),p($,b,A,"_","\\_"),p($,b,A,"_","\\textunderscore"),p(g,b,A,"∠","\\angle",!0),p(g,b,A,"∞","\\infty",!0),p(g,b,A,"′","\\prime"),p(g,b,A,"△","\\triangle"),p(g,b,A,"Γ","\\Gamma",!0),p(g,b,A,"Δ","\\Delta",!0),p(g,b,A,"Θ","\\Theta",!0),p(g,b,A,"Λ","\\Lambda",!0),p(g,b,A,"Ξ","\\Xi",!0),p(g,b,A,"Π","\\Pi",!0),p(g,b,A,"Σ","\\Sigma",!0),p(g,b,A,"Υ","\\Upsilon",!0),p(g,b,A,"Φ","\\Phi",!0),p(g,b,A,"Ψ","\\Psi",!0),p(g,b,A,"Ω","\\Omega",!0),p(g,b,A,"A","Α"),p(g,b,A,"B","Β"),p(g,b,A,"E","Ε"),p(g,b,A,"Z","Ζ"),p(g,b,A,"H","Η"),p(g,b,A,"I","Ι"),p(g,b,A,"K","Κ"),p(g,b,A,"M","Μ"),p(g,b,A,"N","Ν"),p(g,b,A,"O","Ο"),p(g,b,A,"P","Ρ"),p(g,b,A,"T","Τ"),p(g,b,A,"X","Χ"),p(g,b,A,"¬","\\neg",!0),p(g,b,A,"¬","\\lnot"),p(g,b,A,"⊤","\\top"),p(g,b,A,"⊥","\\bot"),p(g,b,A,"∅","\\emptyset"),p(g,T,A,"∅","\\varnothing"),p(g,b,ae,"α","\\alpha",!0),p(g,b,ae,"β","\\beta",!0),p(g,b,ae,"γ","\\gamma",!0),p(g,b,ae,"δ","\\delta",!0),p(g,b,ae,"ϵ","\\epsilon",!0),p(g,b,ae,"ζ","\\zeta",!0),p(g,b,ae,"η","\\eta",!0),p(g,b,ae,"θ","\\theta",!0),p(g,b,ae,"ι","\\iota",!0),p(g,b,ae,"κ","\\kappa",!0),p(g,b,ae,"λ","\\lambda",!0),p(g,b,ae,"μ","\\mu",!0),p(g,b,ae,"ν","\\nu",!0),p(g,b,ae,"ξ","\\xi",!0),p(g,b,ae,"ο","\\omicron",!0),p(g,b,ae,"π","\\pi",!0),p(g,b,ae,"ρ","\\rho",!0),p(g,b,ae,"σ","\\sigma",!0),p(g,b,ae,"τ","\\tau",!0),p(g,b,ae,"υ","\\upsilon",!0),p(g,b,ae,"ϕ","\\phi",!0),p(g,b,ae,"χ","\\chi",!0),p(g,b,ae,"ψ","\\psi",!0),p(g,b,ae,"ω","\\omega",!0),p(g,b,ae,"ε","\\varepsilon",!0),p(g,b,ae,"ϑ","\\vartheta",!0),p(g,b,ae,"ϖ","\\varpi",!0),p(g,b,ae,"ϱ","\\varrho",!0),p(g,b,ae,"ς","\\varsigma",!0),p(g,b,ae,"φ","\\varphi",!0),p(g,b,X,"∗","*",!0),p(g,b,X,"+","+"),p(g,b,X,"−","-",!0),p(g,b,X,"⋅","\\cdot",!0),p(g,b,X,"∘","\\circ",!0),p(g,b,X,"÷","\\div",!0),p(g,b,X,"±","\\pm",!0),p(g,b,X,"×","\\times",!0),p(g,b,X,"∩","\\cap",!0),p(g,b,X,"∪","\\cup",!0),p(g,b,X,"∖","\\setminus",!0),p(g,b,X,"∧","\\land"),p(g,b,X,"∨","\\lor"),p(g,b,X,"∧","\\wedge",!0),p(g,b,X,"∨","\\vee",!0),p(g,b,A,"√","\\surd"),p(g,b,Mt,"⟨","\\langle",!0),p(g,b,Mt,"∣","\\lvert"),p(g,b,Mt,"∥","\\lVert"),p(g,b,dt,"?","?"),p(g,b,dt,"!","!"),p(g,b,dt,"⟩","\\rangle",!0),p(g,b,dt,"∣","\\rvert"),p(g,b,dt,"∥","\\rVert"),p(g,b,M,"=","="),p(g,b,M,":",":"),p(g,b,M,"≈","\\approx",!0),p(g,b,M,"≅","\\cong",!0),p(g,b,M,"≥","\\ge"),p(g,b,M,"≥","\\geq",!0),p(g,b,M,"←","\\gets"),p(g,b,M,">","\\gt",!0),p(g,b,M,"∈","\\in",!0),p(g,b,M,"","\\@not"),p(g,b,M,"⊂","\\subset",!0),p(g,b,M,"⊃","\\supset",!0),p(g,b,M,"⊆","\\subseteq",!0),p(g,b,M,"⊇","\\supseteq",!0),p(g,T,M,"⊈","\\nsubseteq",!0),p(g,T,M,"⊉","\\nsupseteq",!0),p(g,b,M,"⊨","\\models"),p(g,b,M,"←","\\leftarrow",!0),p(g,b,M,"≤","\\le"),p(g,b,M,"≤","\\leq",!0),p(g,b,M,"<","\\lt",!0),p(g,b,M,"→","\\rightarrow",!0),p(g,b,M,"→","\\to"),p(g,T,M,"≱","\\ngeq",!0),p(g,T,M,"≰","\\nleq",!0),p(g,b,vr," ","\\ "),p(g,b,vr," ","\\space"),p(g,b,vr," ","\\nobreakspace"),p($,b,vr," ","\\ "),p($,b,vr," "," "),p($,b,vr," ","\\space"),p($,b,vr," ","\\nobreakspace"),p(g,b,vr,null,"\\nobreak"),p(g,b,vr,null,"\\allowbreak"),p(g,b,to,",",","),p(g,b,to,";",";"),p(g,T,X,"⊼","\\barwedge",!0),p(g,T,X,"⊻","\\veebar",!0),p(g,b,X,"⊙","\\odot",!0),p(g,b,X,"⊕","\\oplus",!0),p(g,b,X,"⊗","\\otimes",!0),p(g,b,A,"∂","\\partial",!0),p(g,b,X,"⊘","\\oslash",!0),p(g,T,X,"⊚","\\circledcirc",!0),p(g,T,X,"⊡","\\boxdot",!0),p(g,b,X,"△","\\bigtriangleup"),p(g,b,X,"▽","\\bigtriangledown"),p(g,b,X,"†","\\dagger"),p(g,b,X,"⋄","\\diamond"),p(g,b,X,"⋆","\\star"),p(g,b,X,"◃","\\triangleleft"),p(g,b,X,"▹","\\triangleright"),p(g,b,Mt,"{","\\{"),p($,b,A,"{","\\{"),p($,b,A,"{","\\textbraceleft"),p(g,b,dt,"}","\\}"),p($,b,A,"}","\\}"),p($,b,A,"}","\\textbraceright"),p(g,b,Mt,"{","\\lbrace"),p(g,b,dt,"}","\\rbrace"),p(g,b,Mt,"[","\\lbrack",!0),p($,b,A,"[","\\lbrack",!0),p(g,b,dt,"]","\\rbrack",!0),p($,b,A,"]","\\rbrack",!0),p(g,b,Mt,"(","\\lparen",!0),p(g,b,dt,")","\\rparen",!0),p($,b,A,"<","\\textless",!0),p($,b,A,">","\\textgreater",!0),p(g,b,Mt,"⌊","\\lfloor",!0),p(g,b,dt,"⌋","\\rfloor",!0),p(g,b,Mt,"⌈","\\lceil",!0),p(g,b,dt,"⌉","\\rceil",!0),p(g,b,A,"\\","\\backslash"),p(g,b,A,"∣","|"),p(g,b,A,"∣","\\vert"),p($,b,A,"|","\\textbar",!0),p(g,b,A,"∥","\\|"),p(g,b,A,"∥","\\Vert"),p($,b,A,"∥","\\textbardbl"),p($,b,A,"~","\\textasciitilde"),p($,b,A,"\\","\\textbackslash"),p($,b,A,"^","\\textasciicircum"),p(g,b,M,"↑","\\uparrow",!0),p(g,b,M,"⇑","\\Uparrow",!0),p(g,b,M,"↓","\\downarrow",!0),p(g,b,M,"⇓","\\Downarrow",!0),p(g,b,M,"↕","\\updownarrow",!0),p(g,b,M,"⇕","\\Updownarrow",!0),p(g,b,We,"∐","\\coprod"),p(g,b,We,"⋁","\\bigvee"),p(g,b,We,"⋀","\\bigwedge"),p(g,b,We,"⨄","\\biguplus"),p(g,b,We,"⋂","\\bigcap"),p(g,b,We,"⋃","\\bigcup"),p(g,b,We,"∫","\\int"),p(g,b,We,"∫","\\intop"),p(g,b,We,"∬","\\iint"),p(g,b,We,"∭","\\iiint"),p(g,b,We,"∏","\\prod"),p(g,b,We,"∑","\\sum"),p(g,b,We,"⨂","\\bigotimes"),p(g,b,We,"⨁","\\bigoplus"),p(g,b,We,"⨀","\\bigodot"),p(g,b,We,"∮","\\oint"),p(g,b,We,"∯","\\oiint"),p(g,b,We,"∰","\\oiiint"),p(g,b,We,"⨆","\\bigsqcup"),p(g,b,We,"∫","\\smallint"),p($,b,Vn,"…","\\textellipsis"),p(g,b,Vn,"…","\\mathellipsis"),p($,b,Vn,"…","\\ldots",!0),p(g,b,Vn,"…","\\ldots",!0),p(g,b,Vn,"⋯","\\@cdots",!0),p(g,b,Vn,"⋱","\\ddots",!0),p(g,b,A,"⋮","\\varvdots"),p($,b,A,"⋮","\\varvdots"),p(g,b,Ie,"ˊ","\\acute"),p(g,b,Ie,"ˋ","\\grave"),p(g,b,Ie,"¨","\\ddot"),p(g,b,Ie,"~","\\tilde"),p(g,b,Ie,"ˉ","\\bar"),p(g,b,Ie,"˘","\\breve"),p(g,b,Ie,"ˇ","\\check"),p(g,b,Ie,"^","\\hat"),p(g,b,Ie,"⃗","\\vec"),p(g,b,Ie,"˙","\\dot"),p(g,b,Ie,"˚","\\mathring"),p(g,b,ae,"","\\@imath"),p(g,b,ae,"","\\@jmath"),p(g,b,A,"ı","ı"),p(g,b,A,"ȷ","ȷ"),p($,b,A,"ı","\\i",!0),p($,b,A,"ȷ","\\j",!0),p($,b,A,"ß","\\ss",!0),p($,b,A,"æ","\\ae",!0),p($,b,A,"œ","\\oe",!0),p($,b,A,"ø","\\o",!0),p($,b,A,"Æ","\\AE",!0),p($,b,A,"Œ","\\OE",!0),p($,b,A,"Ø","\\O",!0),p($,b,Ie,"ˊ","\\'"),p($,b,Ie,"ˋ","\\`"),p($,b,Ie,"ˆ","\\^"),p($,b,Ie,"˜","\\~"),p($,b,Ie,"ˉ","\\="),p($,b,Ie,"˘","\\u"),p($,b,Ie,"˙","\\."),p($,b,Ie,"¸","\\c"),p($,b,Ie,"˚","\\r"),p($,b,Ie,"ˇ","\\v"),p($,b,Ie,"¨",'\\"'),p($,b,Ie,"˝","\\H"),p($,b,Ie,"◯","\\textcircled");var Hh={"--":!0,"---":!0,"``":!0,"''":!0};p($,b,A,"–","--",!0),p($,b,A,"–","\\textendash"),p($,b,A,"—","---",!0),p($,b,A,"—","\\textemdash"),p($,b,A,"‘","`",!0),p($,b,A,"‘","\\textquoteleft"),p($,b,A,"’","'",!0),p($,b,A,"’","\\textquoteright"),p($,b,A,"“","``",!0),p($,b,A,"“","\\textquotedblleft"),p($,b,A,"”","''",!0),p($,b,A,"”","\\textquotedblright"),p(g,b,A,"°","\\degree",!0),p($,b,A,"°","\\degree"),p($,b,A,"°","\\textdegree",!0),p(g,b,A,"£","\\pounds"),p(g,b,A,"£","\\mathsterling",!0),p($,b,A,"£","\\pounds"),p($,b,A,"£","\\textsterling",!0),p(g,T,A,"✠","\\maltese"),p($,T,A,"✠","\\maltese");for(var Vh='0123456789/@."',Rl=0;Rl<Vh.length;Rl++){var _h=Vh.charAt(Rl);p(g,b,A,_h,_h)}for(var jh='0123456789!@*()-=+";:?/.,',Pl=0;Pl<jh.length;Pl++){var qh=jh.charAt(Pl);p($,b,A,qh,qh)}for(var ro="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",zl=0;zl<ro.length;zl++){var no=ro.charAt(zl);p(g,b,ae,no,no),p($,b,A,no,no)}p(g,T,A,"C","ℂ"),p($,T,A,"C","ℂ"),p(g,T,A,"H","ℍ"),p($,T,A,"H","ℍ"),p(g,T,A,"N","ℕ"),p($,T,A,"N","ℕ"),p(g,T,A,"P","ℙ"),p($,T,A,"P","ℙ"),p(g,T,A,"Q","ℚ"),p($,T,A,"Q","ℚ"),p(g,T,A,"R","ℝ"),p($,T,A,"R","ℝ"),p(g,T,A,"Z","ℤ"),p($,T,A,"Z","ℤ"),p(g,b,ae,"h","ℎ"),p($,b,ae,"h","ℎ");for(var ue="",ft=0;ft<ro.length;ft++){var $e=ro.charAt(ft);ue=String.fromCharCode(55349,56320+ft),p(g,b,ae,$e,ue),p($,b,A,$e,ue),ue=String.fromCharCode(55349,56372+ft),p(g,b,ae,$e,ue),p($,b,A,$e,ue),ue=String.fromCharCode(55349,56424+ft),p(g,b,ae,$e,ue),p($,b,A,$e,ue),ue=String.fromCharCode(55349,56580+ft),p(g,b,ae,$e,ue),p($,b,A,$e,ue),ue=String.fromCharCode(55349,56684+ft),p(g,b,ae,$e,ue),p($,b,A,$e,ue),ue=String.fromCharCode(55349,56736+ft),p(g,b,ae,$e,ue),p($,b,A,$e,ue),ue=String.fromCharCode(55349,56788+ft),p(g,b,ae,$e,ue),p($,b,A,$e,ue),ue=String.fromCharCode(55349,56840+ft),p(g,b,ae,$e,ue),p($,b,A,$e,ue),ue=String.fromCharCode(55349,56944+ft),p(g,b,ae,$e,ue),p($,b,A,$e,ue),ft<26&&(ue=String.fromCharCode(55349,56632+ft),p(g,b,ae,$e,ue),p($,b,A,$e,ue),ue=String.fromCharCode(55349,56476+ft),p(g,b,ae,$e,ue),p($,b,A,$e,ue))}ue="𝕜",p(g,b,ae,"k",ue),p($,b,A,"k",ue);for(var wn=0;wn<10;wn++){var Jr=wn.toString();ue=String.fromCharCode(55349,57294+wn),p(g,b,ae,Jr,ue),p($,b,A,Jr,ue),ue=String.fromCharCode(55349,57314+wn),p(g,b,ae,Jr,ue),p($,b,A,Jr,ue),ue=String.fromCharCode(55349,57324+wn),p(g,b,ae,Jr,ue),p($,b,A,Jr,ue),ue=String.fromCharCode(55349,57334+wn),p(g,b,ae,Jr,ue),p($,b,A,Jr,ue)}for(var Ll="ÐÞþ",Bl=0;Bl<Ll.length;Bl++){var io=Ll.charAt(Bl);p(g,b,ae,io,io),p($,b,A,io,io)}var so=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Wh=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],cb=function(e,t){var n=e.charCodeAt(0),i=e.charCodeAt(1),s=(n-55296)*1024+(i-56320)+65536,o=t==="math"?0:1;if(119808<=s&&s<120484){var a=Math.floor((s-119808)/26);return[so[a][2],so[a][o]]}else if(120782<=s&&s<=120831){var l=Math.floor((s-120782)/10);return[Wh[l][2],Wh[l][o]]}else{if(s===120485||s===120486)return[so[0][2],so[0][o]];if(120486<s&&s<120782)return["",""];throw new _("Unsupported character: "+e)}},oo=function(e,t,n){return Ne[n][e]&&Ne[n][e].replace&&(e=Ne[n][e].replace),{value:e,metrics:Al(e,t,n)}},Ht=function(e,t,n,i,s){var o=oo(e,t,n),a=o.metrics;e=o.value;var l;if(a){var u=a.italic;(n==="text"||i&&i.font==="mathit")&&(u=0),l=new zt(e,a.height,a.depth,u,a.skew,a.width,s)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+t+"' and mode '"+n+"'")),l=new zt(e,0,0,0,0,0,s);if(i){l.maxFontSize=i.sizeMultiplier,i.style.isTight()&&l.classes.push("mtight");var c=i.getColor();c&&(l.style.color=c)}return l},db=function(e,t,n,i){return i===void 0&&(i=[]),n.font==="boldsymbol"&&oo(e,"Main-Bold",t).metrics?Ht(e,"Main-Bold",t,n,i.concat(["mathbf"])):e==="\\"||Ne[t][e].font==="main"?Ht(e,"Main-Regular",t,n,i):Ht(e,"AMS-Regular",t,n,i.concat(["amsrm"]))},fb=function(e,t,n,i,s){return s!=="textord"&&oo(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},hb=function(e,t,n){var i=e.mode,s=e.text,o=["mord"],a=i==="math"||i==="text"&&t.font,l=a?t.font:t.fontFamily,u="",c="";if(s.charCodeAt(0)===55349&&([u,c]=cb(s,i)),u.length>0)return Ht(s,u,i,t,o.concat(c));if(l){var d,h;if(l==="boldsymbol"){var f=fb(s,i,t,o,n);d=f.fontName,h=[f.fontClass]}else a?(d=Kh[l].fontName,h=[l]):(d=ao(l,t.fontWeight,t.fontShape),h=[l,t.fontWeight,t.fontShape]);if(oo(s,d,i).metrics)return Ht(s,d,i,t,o.concat(h));if(Hh.hasOwnProperty(s)&&d.slice(0,10)==="Typewriter"){for(var m=[],v=0;v<s.length;v++)m.push(Ht(s[v],d,i,t,o.concat(h)));return Gh(m)}}if(n==="mathord")return Ht(s,"Math-Italic",i,t,o.concat(["mathnormal"]));if(n==="textord"){var y=Ne[i][s]&&Ne[i][s].font;if(y==="ams"){var w=ao("amsrm",t.fontWeight,t.fontShape);return Ht(s,w,i,t,o.concat("amsrm",t.fontWeight,t.fontShape))}else if(y==="main"||!y){var k=ao("textrm",t.fontWeight,t.fontShape);return Ht(s,k,i,t,o.concat(t.fontWeight,t.fontShape))}else{var E=ao(y,t.fontWeight,t.fontShape);return Ht(s,E,i,t,o.concat(E,t.fontWeight,t.fontShape))}}else throw new Error("unexpected type: "+n+" in makeOrd")},pb=(r,e)=>{if(Gr(r.classes)!==Gr(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize)return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var n in r.style)if(r.style.hasOwnProperty(n)&&r.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&r.style[i]!==e.style[i])return!1;return!0},mb=r=>{for(var e=0;e<r.length-1;e++){var t=r[e],n=r[e+1];t instanceof zt&&n instanceof zt&&pb(t,n)&&(t.text+=n.text,t.height=Math.max(t.height,n.height),t.depth=Math.max(t.depth,n.depth),t.italic=n.italic,r.splice(e+1,1),e--)}return r},Fl=function(e){for(var t=0,n=0,i=0,s=0;s<e.children.length;s++){var o=e.children[s];o.height>t&&(t=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},vt=function(e,t,n,i){var s=new Pi(e,t,n,i);return Fl(s),s},Uh=(r,e,t,n)=>new Pi(r,e,t,n),gb=function(e,t,n){var i=vt([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=q(i.height),i.maxFontSize=1,i},vb=function(e,t,n,i){var s=new Dl(e,t,n,i);return Fl(s),s},Gh=function(e){var t=new Ri(e);return Fl(t),t},yb=function(e,t){return e instanceof Ri?vt([],[e],t):e},bb=function(e){if(e.positionType==="individualShift"){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,s=i,o=1;o<t.length;o++){var a=-t[o].shift-s-t[o].elem.depth,l=a-(t[o-1].elem.height+t[o-1].elem.depth);s=s+a,n.push({type:"kern",size:l}),n.push(t[o])}return{children:n,depth:i}}var u;if(e.positionType==="top"){for(var c=e.positionData,d=0;d<e.children.length;d++){var h=e.children[d];c-=h.type==="kern"?h.size:h.elem.height+h.elem.depth}u=c}else if(e.positionType==="bottom")u=-e.positionData;else{var f=e.children[0];if(f.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")u=-f.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")u=-f.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:u}},wb=function(e,t){for(var{children:n,depth:i}=bb(e),s=0,o=0;o<n.length;o++){var a=n[o];if(a.type==="elem"){var l=a.elem;s=Math.max(s,l.maxFontSize,l.height)}}s+=2;var u=vt(["pstrut"],[]);u.style.height=q(s);for(var c=[],d=i,h=i,f=i,m=0;m<n.length;m++){var v=n[m];if(v.type==="kern")f+=v.size;else{var y=v.elem,w=v.wrapperClasses||[],k=v.wrapperStyle||{},E=vt(w,[u,y],void 0,k);E.style.top=q(-s-f-y.depth),v.marginLeft&&(E.style.marginLeft=v.marginLeft),v.marginRight&&(E.style.marginRight=v.marginRight),c.push(E),f+=y.height+y.depth}d=Math.min(d,f),h=Math.max(h,f)}var R=vt(["vlist"],c);R.style.height=q(h);var O;if(d<0){var N=vt([],[]),D=vt(["vlist"],[N]);D.style.height=q(-d);var B=vt(["vlist-s"],[new zt("")]);O=[vt(["vlist-r"],[R,B]),vt(["vlist-r"],[D])]}else O=[vt(["vlist-r"],[R])];var L=vt(["vlist-t"],O);return O.length===2&&L.classes.push("vlist-t2"),L.height=h,L.depth=-d,L},xb=(r,e)=>{var t=vt(["mspace"],[],e),n=Pe(r,e);return t.style.marginRight=q(n),t},ao=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var s;return t==="textbf"&&n==="textit"?s="BoldItalic":t==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",i+"-"+s},Kh={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Jh={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Sb=function(e,t){var[n,i,s]=Jh[e],o=new Kr(n),a=new gr([o],{width:q(i),height:q(s),style:"width:"+q(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=Uh(["overlay"],[a],t);return l.height=s,l.style.height=q(s),l.style.width=q(i),l},P={fontMap:Kh,makeSymbol:Ht,mathsym:db,makeSpan:vt,makeSvgSpan:Uh,makeLineSpan:gb,makeAnchor:vb,makeFragment:Gh,wrapFragment:yb,makeVList:wb,makeOrd:hb,makeGlue:xb,staticSvg:Sb,svgData:Jh,tryCombineChars:mb},ze={number:3,unit:"mu"},xn={number:4,unit:"mu"},yr={number:5,unit:"mu"},kb={mord:{mop:ze,mbin:xn,mrel:yr,minner:ze},mop:{mord:ze,mop:ze,mrel:yr,minner:ze},mbin:{mord:xn,mop:xn,mopen:xn,minner:xn},mrel:{mord:yr,mop:yr,mopen:yr,minner:yr},mopen:{},mclose:{mop:ze,mbin:xn,mrel:yr,minner:ze},mpunct:{mord:ze,mop:ze,mrel:yr,mopen:ze,mclose:ze,mpunct:ze,minner:ze},minner:{mord:ze,mop:ze,mbin:xn,mrel:yr,mopen:ze,mpunct:ze,minner:ze}},Tb={mord:{mop:ze},mop:{mord:ze,mop:ze},mbin:{},mrel:{},mopen:{},mclose:{mop:ze},mpunct:{},minner:{mop:ze}},Yh={},lo={},uo={};function J(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=r,a={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l<t.length;++l)Yh[t[l]]=a;e&&(s&&(lo[e]=s),o&&(uo[e]=o))}function Sn(r){var{type:e,htmlBuilder:t,mathmlBuilder:n}=r;J({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:t,mathmlBuilder:n})}var co=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},_e=function(e){return e.type==="ordgroup"?e.body:[e]},br=P.makeSpan,Mb=["leftmost","mbin","mopen","mrel","mop","mpunct"],Cb=["rightmost","mrel","mclose","mpunct"],Eb={display:oe.DISPLAY,text:oe.TEXT,script:oe.SCRIPT,scriptscript:oe.SCRIPTSCRIPT},Ab={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Ge=function(e,t,n,i){i===void 0&&(i=[null,null]);for(var s=[],o=0;o<e.length;o++){var a=ve(e[o],t);if(a instanceof Ri){var l=a.children;s.push(...l)}else s.push(a)}if(P.tryCombineChars(s),!n)return s;var u=t;if(e.length===1){var c=e[0];c.type==="sizing"?u=t.havingSize(c.size):c.type==="styling"&&(u=t.havingStyle(Eb[c.style]))}var d=br([i[0]||"leftmost"],[],t),h=br([i[1]||"rightmost"],[],t),f=n==="root";return Xh(s,(m,v)=>{var y=v.classes[0],w=m.classes[0];y==="mbin"&&Cb.includes(w)?v.classes[0]="mord":w==="mbin"&&Mb.includes(y)&&(m.classes[0]="mord")},{node:d},h,f),Xh(s,(m,v)=>{var y=$l(v),w=$l(m),k=y&&w?m.hasClass("mtight")?Tb[y][w]:kb[y][w]:null;if(k)return P.makeGlue(k,u)},{node:d},h,f),s},Xh=function r(e,t,n,i,s){i&&e.push(i);for(var o=0;o<e.length;o++){var a=e[o],l=Zh(a);if(l){r(l.children,t,n,null,s);continue}var u=!a.hasClass("mspace");if(u){var c=t(a,n.node);c&&(n.insertAfter?n.insertAfter(c):(e.unshift(c),o++))}u?n.node=a:s&&a.hasClass("newline")&&(n.node=br(["leftmost"])),n.insertAfter=(d=>h=>{e.splice(d+1,0,h),o++})(o)}i&&e.pop()},Zh=function(e){return e instanceof Ri||e instanceof Dl||e instanceof Pi&&e.hasClass("enclosing")?e:null},Ob=function r(e,t){var n=Zh(e);if(n){var i=n.children;if(i.length){if(t==="right")return r(i[i.length-1],"right");if(t==="left")return r(i[0],"left")}}return e},$l=function(e,t){return e?(t&&(e=Ob(e,t)),Ab[e.classes[0]]||null):null},zi=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return br(t.concat(n))},ve=function(e,t,n){if(!e)return br();if(lo[e.type]){var i=lo[e.type](e,t);if(n&&t.size!==n.size){i=br(t.sizingClasses(n),[i],t);var s=t.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new _("Got group of unknown type: '"+e.type+"'")};function fo(r,e){var t=br(["base"],r,e),n=br(["strut"]);return n.style.height=q(t.height+t.depth),t.depth&&(n.style.verticalAlign=q(-t.depth)),t.children.unshift(n),t}function Hl(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var n=Ge(r,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],o=[],a=0;a<n.length;a++)if(o.push(n[a]),n[a].hasClass("mbin")||n[a].hasClass("mrel")||n[a].hasClass("allowbreak")){for(var l=!1;a<n.length-1&&n[a+1].hasClass("mspace")&&!n[a+1].hasClass("newline");)a++,o.push(n[a]),n[a].hasClass("nobreak")&&(l=!0);l||(s.push(fo(o,e)),o=[])}else n[a].hasClass("newline")&&(o.pop(),o.length>0&&(s.push(fo(o,e)),o=[]),s.push(n[a]));o.length>0&&s.push(fo(o,e));var u;t?(u=fo(Ge(t,e,!0)),u.classes=["tag"],s.push(u)):i&&s.push(i);var c=br(["katex-html"],s);if(c.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=q(c.height+c.depth),c.depth&&(d.style.verticalAlign=q(-c.depth))}return c}function Qh(r){return new Ri(r)}class Ct{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Gr(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Xt&&this.children[n+1]instanceof Xt){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Xt;)i+=this.children[++n].toText();e.appendChild(new Xt(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=be.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+be.escape(Gr(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Xt{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return be.escape(this.toText())}toText(){return this.text}}class Nb{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character=" ":e>=-.05556&&e<=-.05555?this.character=" ":e>=-.1667&&e<=-.1666?this.character=" ":e>=-.2223&&e<=-.2222?this.character=" ":e>=-.2778&&e<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",q(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+q(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var H={MathNode:Ct,TextNode:Xt,SpaceNode:Nb,newDocumentFragment:Qh},Lt=function(e,t,n){return Ne[t][e]&&Ne[t][e].replace&&e.charCodeAt(0)!==55349&&!(Hh.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Ne[t][e].replace),new H.TextNode(e)},Vl=function(e){return e.length===1?e[0]:new H.MathNode("mrow",e)},_l=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var n=t.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var s=e.text;if(["\\imath","\\jmath"].includes(s))return null;Ne[i][s]&&Ne[i][s].replace&&(s=Ne[i][s].replace);var o=P.fontMap[n].fontName;return Al(s,o,i)?P.fontMap[n].variant:null};function jl(r){if(!r)return!1;if(r.type==="mi"&&r.children.length===1){var e=r.children[0];return e instanceof Xt&&e.text==="."}else if(r.type==="mo"&&r.children.length===1&&r.getAttribute("separator")==="true"&&r.getAttribute("lspace")==="0em"&&r.getAttribute("rspace")==="0em"){var t=r.children[0];return t instanceof Xt&&t.text===","}else return!1}var yt=function(e,t,n){if(e.length===1){var i=Oe(e[0],t);return n&&i instanceof Ct&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],o,a=0;a<e.length;a++){var l=Oe(e[a],t);if(l instanceof Ct&&o instanceof Ct){if(l.type==="mtext"&&o.type==="mtext"&&l.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...l.children);continue}else if(l.type==="mn"&&o.type==="mn"){o.children.push(...l.children);continue}else if(jl(l)&&o.type==="mn"){o.children.push(...l.children);continue}else if(l.type==="mn"&&jl(o))l.children=[...o.children,...l.children],s.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(o.type==="mn"||jl(o))){var u=l.children[0];u instanceof Ct&&u.type==="mn"&&(u.children=[...o.children,...u.children],s.pop())}else if(o.type==="mi"&&o.children.length===1){var c=o.children[0];if(c instanceof Xt&&c.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Xt&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),o=l}return s},Yr=function(e,t,n){return Vl(yt(e,t,n))},Oe=function(e,t){if(!e)return new H.MathNode("mrow");if(uo[e.type]){var n=uo[e.type](e,t);return n}else throw new _("Got group of unknown type: '"+e.type+"'")};function ep(r,e,t,n,i){var s=yt(r,t),o;s.length===1&&s[0]instanceof Ct&&["mrow","mtable"].includes(s[0].type)?o=s[0]:o=new H.MathNode("mrow",s);var a=new H.MathNode("annotation",[new H.TextNode(e)]);a.setAttribute("encoding","application/x-tex");var l=new H.MathNode("semantics",[o,a]),u=new H.MathNode("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var c=i?"katex":"katex-mathml";return P.makeSpan([c],[u])}var tp=function(e){return new mr({style:e.displayMode?oe.DISPLAY:oe.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},rp=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=P.makeSpan(n,[e])}return e},Db=function(e,t,n){var i=tp(n),s;if(n.output==="mathml")return ep(e,t,i,n.displayMode,!0);if(n.output==="html"){var o=Hl(e,i);s=P.makeSpan(["katex"],[o])}else{var a=ep(e,t,i,n.displayMode,!1),l=Hl(e,i);s=P.makeSpan(["katex"],[a,l])}return rp(s,n)},Ib=function(e,t,n){var i=tp(n),s=Hl(e,i),o=P.makeSpan(["katex"],[s]);return rp(o,n)},Rb={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Pb=function(e){var t=new H.MathNode("mo",[new H.TextNode(Rb[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},zb={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Lb=function(e){return e.type==="ordgroup"?e.body.length:1},Bb=function(e,t){function n(){var a=4e5,l=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(l)){var u=e,c=Lb(u.base),d,h,f;if(c>5)l==="widehat"||l==="widecheck"?(d=420,a=2364,f=.42,h=l+"4"):(d=312,a=2340,f=.34,h="tilde4");else{var m=[1,1,2,2,3,3][c];l==="widehat"||l==="widecheck"?(a=[0,1062,2364,2364,2364][m],d=[0,239,300,360,420][m],f=[0,.24,.3,.3,.36,.42][m],h=l+m):(a=[0,600,1033,2339,2340][m],d=[0,260,286,306,312][m],f=[0,.26,.286,.3,.306,.34][m],h="tilde"+m)}var v=new Kr(h),y=new gr([v],{width:"100%",height:q(f),viewBox:"0 0 "+a+" "+d,preserveAspectRatio:"none"});return{span:P.makeSvgSpan([],[y],t),minWidth:0,height:f}}else{var w=[],k=zb[l],[E,R,O]=k,N=O/1e3,D=E.length,B,L;if(D===1){var V=k[3];B=["hide-tail"],L=[V]}else if(D===2)B=["halfarrow-left","halfarrow-right"],L=["xMinYMin","xMaxYMin"];else if(D===3)B=["brace-left","brace-center","brace-right"],L=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
861
|
-
`+D+" children.");for(var te=0;te<D;te++){var ne=new Kr(E[te]),fe=new gr([ne],{width:"400em",height:q(N),viewBox:"0 0 "+a+" "+O,preserveAspectRatio:L[te]+" slice"}),re=P.makeSvgSpan([B[te]],[fe],t);if(D===1)return{span:re,minWidth:R,height:N};re.style.height=q(N),w.push(re)}return{span:P.makeSpan(["stretchy"],w,t),minWidth:R,height:N}}}var{span:i,minWidth:s,height:o}=n();return i.height=o,i.style.height=q(o),s>0&&(i.style.minWidth=q(s)),i},Fb=function(e,t,n,i,s){var o,a=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(o=P.makeSpan(["stretchy",t],[],s),t==="fbox"){var l=s.color&&s.getColor();l&&(o.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new Il({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new Il({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new gr(u,{width:"100%",height:q(a)});o=P.makeSvgSpan([],[c],s)}return o.height=a,o.style.height=q(a),o},wr={encloseSpan:Fb,mathMLnode:Pb,svgSpan:Bb};function pe(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function ql(r){var e=ho(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function ho(r){return r&&(r.type==="atom"||ub.hasOwnProperty(r.type))?r:null}var Wl=(r,e)=>{var t,n,i;r&&r.type==="supsub"?(n=pe(r.base,"accent"),t=n.base,r.base=t,i=ab(ve(r,e)),r.base=n):(n=pe(r,"accent"),t=n.base);var s=ve(t,e.havingCrampedStyle()),o=n.isShifty&&be.isCharacterBox(t),a=0;if(o){var l=be.getBaseElem(t),u=ve(l,e.havingCrampedStyle());a=$h(u).skew}var c=n.label==="\\c",d=c?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),h;if(n.isStretchy)h=wr.svgSpan(n,e),h=P.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+q(2*a)+")",marginLeft:q(2*a)}:void 0}]},e);else{var f,m;n.label==="\\vec"?(f=P.staticSvg("vec",e),m=P.svgData.vec[1]):(f=P.makeOrd({mode:n.mode,text:n.label},e,"textord"),f=$h(f),f.italic=0,m=f.width,c&&(d+=f.depth)),h=P.makeSpan(["accent-body"],[f]);var v=n.label==="\\textcircled";v&&(h.classes.push("accent-full"),d=s.height);var y=a;v||(y-=m/2),h.style.left=q(y),n.label==="\\textcircled"&&(h.style.top=".2em"),h=P.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:h}]},e)}var w=P.makeSpan(["mord","accent"],[h],e);return i?(i.children[0]=w,i.height=Math.max(w.height,i.height),i.classes[0]="mord",i):w},np=(r,e)=>{var t=r.isStretchy?wr.mathMLnode(r.label):new H.MathNode("mo",[Lt(r.label,r.mode)]),n=new H.MathNode("mover",[Oe(r.base,e),t]);return n.setAttribute("accent","true"),n},$b=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));J({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=co(e[0]),n=!$b.test(r.funcName),i=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:i,base:t}},htmlBuilder:Wl,mathmlBuilder:np}),J({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:Wl,mathmlBuilder:np}),J({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:i}},htmlBuilder:(r,e)=>{var t=ve(r.base,e),n=wr.svgSpan(r,e),i=r.label==="\\utilde"?.12:0,s=P.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]},e);return P.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=wr.mathMLnode(r.label),n=new H.MathNode("munder",[Oe(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var po=r=>{var e=new H.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};J({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n,funcName:i}=r;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,n=e.havingStyle(t.sup()),i=P.wrapFragment(ve(r.body,n,e),e),s=r.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var o;r.below&&(n=e.havingStyle(t.sub()),o=P.wrapFragment(ve(r.below,n,e),e),o.classes.push(s+"-arrow-pad"));var a=wr.svgSpan(r,e),l=-e.fontMetrics().axisHeight+.5*a.height,u=-e.fontMetrics().axisHeight-.5*a.height-.111;(i.depth>.25||r.label==="\\xleftequilibrium")&&(u-=i.depth);var c;if(o){var d=-e.fontMetrics().axisHeight+o.height+.5*a.height+.111;c=P.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:a,shift:l},{type:"elem",elem:o,shift:d}]},e)}else c=P.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:a,shift:l}]},e);return c.children[0].children[0].children[1].classes.push("svg-align"),P.makeSpan(["mrel","x-arrow"],[c],e)},mathmlBuilder(r,e){var t=wr.mathMLnode(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(r.body){var i=po(Oe(r.body,e));if(r.below){var s=po(Oe(r.below,e));n=new H.MathNode("munderover",[t,s,i])}else n=new H.MathNode("mover",[t,i])}else if(r.below){var o=po(Oe(r.below,e));n=new H.MathNode("munder",[t,o])}else n=po(),n=new H.MathNode("mover",[t,n]);return n}});var Hb=P.makeSpan;function ip(r,e){var t=Ge(r.body,e,!0);return Hb([r.mclass],t,e)}function sp(r,e){var t,n=yt(r.body,e);return r.mclass==="minner"?t=new H.MathNode("mpadded",n):r.mclass==="mord"?r.isCharacterBox?(t=n[0],t.type="mi"):t=new H.MathNode("mi",n):(r.isCharacterBox?(t=n[0],t.type="mo"):t=new H.MathNode("mo",n),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}J({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+n.slice(5),body:_e(i),isCharacterBox:be.isCharacterBox(i)}},htmlBuilder:ip,mathmlBuilder:sp});var mo=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};J({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:mo(e[0]),body:_e(e[1]),isCharacterBox:be.isCharacterBox(e[1])}}}),J({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:n}=r,i=e[1],s=e[0],o;n!=="\\stackrel"?o=mo(i):o="mrel";var a={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:_e(i)},l={type:"supsub",mode:s.mode,base:a,sup:n==="\\underset"?null:s,sub:n==="\\underset"?s:null};return{type:"mclass",mode:t.mode,mclass:o,body:[l],isCharacterBox:be.isCharacterBox(l)}},htmlBuilder:ip,mathmlBuilder:sp}),J({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:mo(e[0]),body:_e(e[0])}},htmlBuilder(r,e){var t=Ge(r.body,e,!0),n=P.makeSpan([r.mclass],t,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(r,e){var t=yt(r.body,e),n=new H.MathNode("mstyle",t);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var Vb={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},op=()=>({type:"styling",body:[],mode:"math",style:"display"}),ap=r=>r.type==="textord"&&r.text==="@",_b=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function jb(r,e,t){var n=Vb[r];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=t.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},o=t.callFunction("\\Big",[s],[]),a=t.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,o,a]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function qb(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new _("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var n=[],i=[n],s=0;s<e.length;s++){for(var o=e[s],a=op(),l=0;l<o.length;l++)if(!ap(o[l]))a.body.push(o[l]);else{n.push(a),l+=1;var u=ql(o[l]).text,c=new Array(2);if(c[0]={type:"ordgroup",mode:"math",body:[]},c[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(u)>-1))if("<>AV".indexOf(u)>-1)for(var d=0;d<2;d++){for(var h=!0,f=l+1;f<o.length;f++){if(_b(o[f],u)){h=!1,l=f;break}if(ap(o[f]))throw new _("Missing a "+u+" character to complete a CD arrow.",o[f]);c[d].body.push(o[f])}if(h)throw new _("Missing a "+u+" character to complete a CD arrow.",o[l])}else throw new _('Expected one of "<>AV=|." after @',o[l]);var m=jb(u,c,r),v={type:"styling",body:[m],mode:"math",style:"display"};n.push(v),a=op()}s%2===0?n.push(a):n.shift(),n=[],i.push(n)}r.gullet.endGroup(),r.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}J({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"cdlabel",mode:t.mode,side:n.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),n=P.wrapFragment(ve(r.label,t,e),e);return n.classes.push("cd-label-"+r.side),n.style.bottom=q(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(r,e){var t=new H.MathNode("mrow",[Oe(r.label,e)]);return t=new H.MathNode("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new H.MathNode("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}}),J({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=P.wrapFragment(ve(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new H.MathNode("mrow",[Oe(r.fragment,e)])}}),J({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,n=pe(e[0],"ordgroup"),i=n.body,s="",o=0;o<i.length;o++){var a=pe(i[o],"textord");s+=a.text}var l=parseInt(s),u;if(isNaN(l))throw new _("\\@char has non-numeric argument "+s);if(l<0||l>=1114111)throw new _("\\@char with invalid code point "+s);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var lp=(r,e)=>{var t=Ge(r.body,e.withColor(r.color),!1);return P.makeFragment(t)},up=(r,e)=>{var t=yt(r.body,e.withColor(r.color)),n=new H.MathNode("mstyle",t);return n.setAttribute("mathcolor",r.color),n};J({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,n=pe(e[0],"color-token").color,i=e[1];return{type:"color",mode:t.mode,color:n,body:_e(i)}},htmlBuilder:lp,mathmlBuilder:up}),J({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:n}=r,i=pe(e[0],"color-token").color;t.gullet.macros.set("\\current@color",i);var s=t.parseExpression(!0,n);return{type:"color",mode:t.mode,color:i,body:s}},htmlBuilder:lp,mathmlBuilder:up}),J({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:n}=r,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&pe(i,"size").value}},htmlBuilder(r,e){var t=P.makeSpan(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=q(Pe(r.size,e)))),t},mathmlBuilder(r,e){var t=new H.MathNode("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",q(Pe(r.size,e)))),t}});var Ul={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},cp=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new _("Expected a control sequence",r);return e},Wb=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},dp=(r,e,t,n)=>{var i=r.gullet.macros.get(t.text);i==null&&(t.noexpand=!0,i={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,i,n)};J({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var n=e.fetch();if(Ul[n.text])return(t==="\\global"||t==="\\\\globallong")&&(n.text=Ul[n.text]),pe(e.parseFunction(),"internal");throw new _("Invalid token after macro prefix",n)}}),J({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new _("Expected a control sequence",n);for(var s=0,o,a=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),a[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new _('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new _('Argument number "'+n.text+'" out of order');s++,a.push([])}else{if(n.text==="EOF")throw new _("Expected a macro definition");a[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return o&&l.unshift(o),(t==="\\edef"||t==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:a},t===Ul[t]),{type:"internal",mode:e.mode}}}),J({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=cp(e.gullet.popToken());e.gullet.consumeSpaces();var i=Wb(e);return dp(e,n,i,t==="\\\\globallet"),{type:"internal",mode:e.mode}}}),J({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=cp(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return dp(e,n,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var Li=function(e,t,n){var i=Ne.math[e]&&Ne.math[e].replace,s=Al(i||e,t,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return s},Gl=function(e,t,n,i){var s=n.havingBaseStyle(t),o=P.makeSpan(i.concat(s.sizingClasses(n)),[e],n),a=s.sizeMultiplier/n.sizeMultiplier;return o.height*=a,o.depth*=a,o.maxFontSize=s.sizeMultiplier,o},fp=function(e,t,n){var i=t.havingBaseStyle(n),s=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=q(s),e.height-=s,e.depth+=s},Ub=function(e,t,n,i,s,o){var a=P.makeSymbol(e,"Main-Regular",s,i),l=Gl(a,t,i,o);return n&&fp(l,i,t),l},Gb=function(e,t,n,i){return P.makeSymbol(e,"Size"+t+"-Regular",n,i)},hp=function(e,t,n,i,s,o){var a=Gb(e,t,s,i),l=Gl(P.makeSpan(["delimsizing","size"+t],[a],i),oe.TEXT,i,o);return n&&fp(l,i,oe.TEXT),l},Kl=function(e,t,n){var i;t==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=P.makeSpan(["delimsizinginner",i],[P.makeSpan([],[P.makeSymbol(e,t,n)])]);return{type:"elem",elem:s}},Jl=function(e,t,n){var i=Yt["Size4-Regular"][e.charCodeAt(0)]?Yt["Size4-Regular"][e.charCodeAt(0)][4]:Yt["Size1-Regular"][e.charCodeAt(0)][4],s=new Kr("inner",Z7(e,Math.round(1e3*t))),o=new gr([s],{width:q(i),height:q(t),style:"width:"+q(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=P.makeSvgSpan([],[o],n);return a.height=t,a.style.height=q(t),a.style.width=q(i),{type:"elem",elem:a}},Yl=.008,go={type:"kern",size:-1*Yl},Kb=["|","\\lvert","\\rvert","\\vert"],Jb=["\\|","\\lVert","\\rVert","\\Vert"],pp=function(e,t,n,i,s,o){var a,l,u,c,d="",h=0;a=u=c=e,l=null;var f="Size1-Regular";e==="\\uparrow"?u=c="⏐":e==="\\Uparrow"?u=c="‖":e==="\\downarrow"?a=u="⏐":e==="\\Downarrow"?a=u="‖":e==="\\updownarrow"?(a="\\uparrow",u="⏐",c="\\downarrow"):e==="\\Updownarrow"?(a="\\Uparrow",u="‖",c="\\Downarrow"):Kb.includes(e)?(u="∣",d="vert",h=333):Jb.includes(e)?(u="∥",d="doublevert",h=556):e==="["||e==="\\lbrack"?(a="⎡",u="⎢",c="⎣",f="Size4-Regular",d="lbrack",h=667):e==="]"||e==="\\rbrack"?(a="⎤",u="⎥",c="⎦",f="Size4-Regular",d="rbrack",h=667):e==="\\lfloor"||e==="⌊"?(u=a="⎢",c="⎣",f="Size4-Regular",d="lfloor",h=667):e==="\\lceil"||e==="⌈"?(a="⎡",u=c="⎢",f="Size4-Regular",d="lceil",h=667):e==="\\rfloor"||e==="⌋"?(u=a="⎥",c="⎦",f="Size4-Regular",d="rfloor",h=667):e==="\\rceil"||e==="⌉"?(a="⎤",u=c="⎥",f="Size4-Regular",d="rceil",h=667):e==="("||e==="\\lparen"?(a="⎛",u="⎜",c="⎝",f="Size4-Regular",d="lparen",h=875):e===")"||e==="\\rparen"?(a="⎞",u="⎟",c="⎠",f="Size4-Regular",d="rparen",h=875):e==="\\{"||e==="\\lbrace"?(a="⎧",l="⎨",c="⎩",u="⎪",f="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(a="⎫",l="⎬",c="⎭",u="⎪",f="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(a="⎧",c="⎩",u="⎪",f="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(a="⎫",c="⎭",u="⎪",f="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(a="⎧",c="⎭",u="⎪",f="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(a="⎫",c="⎩",u="⎪",f="Size4-Regular");var m=Li(a,f,s),v=m.height+m.depth,y=Li(u,f,s),w=y.height+y.depth,k=Li(c,f,s),E=k.height+k.depth,R=0,O=1;if(l!==null){var N=Li(l,f,s);R=N.height+N.depth,O=2}var D=v+E+R,B=Math.max(0,Math.ceil((t-D)/(O*w))),L=D+B*O*w,V=i.fontMetrics().axisHeight;n&&(V*=i.sizeMultiplier);var te=L/2-V,ne=[];if(d.length>0){var fe=L-v-E,re=Math.round(L*1e3),G=Q7(d,Math.round(fe*1e3)),Z=new Kr(d,G),ye=(h/1e3).toFixed(3)+"em",ee=(re/1e3).toFixed(3)+"em",ke=new gr([Z],{width:ye,height:ee,viewBox:"0 0 "+h+" "+re}),C=P.makeSvgSpan([],[ke],i);C.height=re/1e3,C.style.width=ye,C.style.height=ee,ne.push({type:"elem",elem:C})}else{if(ne.push(Kl(c,f,s)),ne.push(go),l===null){var x=L-v-E+2*Yl;ne.push(Jl(u,x,i))}else{var I=(L-v-E-R)/2+2*Yl;ne.push(Jl(u,I,i)),ne.push(go),ne.push(Kl(l,f,s)),ne.push(go),ne.push(Jl(u,I,i))}ne.push(go),ne.push(Kl(a,f,s))}var j=i.havingBaseStyle(oe.TEXT),W=P.makeVList({positionType:"bottom",positionData:te,children:ne},j);return Gl(P.makeSpan(["delimsizing","mult"],[W],j),oe.TEXT,i,o)},Xl=80,Zl=.08,Ql=function(e,t,n,i,s){var o=X7(e,i,n),a=new Kr(e,o),l=new gr([a],{width:"400em",height:q(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return P.makeSvgSpan(["hide-tail"],[l],s)},Yb=function(e,t){var n=t.havingBaseSizing(),i=yp("\\surd",e*n.sizeMultiplier,vp,n),s=n.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),a,l=0,u=0,c=0,d;return i.type==="small"?(c=1e3+1e3*o+Xl,e<1?s=1:e<1.4&&(s=.7),l=(1+o+Zl)/s,u=(1+o)/s,a=Ql("sqrtMain",l,c,o,t),a.style.minWidth="0.853em",d=.833/s):i.type==="large"?(c=(1e3+Xl)*Bi[i.size],u=(Bi[i.size]+o)/s,l=(Bi[i.size]+o+Zl)/s,a=Ql("sqrtSize"+i.size,l,c,o,t),a.style.minWidth="1.02em",d=1/s):(l=e+o+Zl,u=e+o,c=Math.floor(1e3*e+o)+Xl,a=Ql("sqrtTall",l,c,o,t),a.style.minWidth="0.742em",d=1.056),a.height=u,a.style.height=q(l),{span:a,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*s}},mp=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Xb=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],gp=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Bi=[0,1.2,1.8,2.4,3],Zb=function(e,t,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),mp.includes(e)||gp.includes(e))return hp(e,t,!1,n,i,s);if(Xb.includes(e))return pp(e,Bi[t],!1,n,i,s);throw new _("Illegal delimiter: '"+e+"'")},Qb=[{type:"small",style:oe.SCRIPTSCRIPT},{type:"small",style:oe.SCRIPT},{type:"small",style:oe.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],e8=[{type:"small",style:oe.SCRIPTSCRIPT},{type:"small",style:oe.SCRIPT},{type:"small",style:oe.TEXT},{type:"stack"}],vp=[{type:"small",style:oe.SCRIPTSCRIPT},{type:"small",style:oe.SCRIPT},{type:"small",style:oe.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],t8=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},yp=function(e,t,n,i){for(var s=Math.min(2,3-i.style.size),o=s;o<n.length&&n[o].type!=="stack";o++){var a=Li(e,t8(n[o]),"math"),l=a.height+a.depth;if(n[o].type==="small"){var u=i.havingBaseStyle(n[o].style);l*=u.sizeMultiplier}if(l>t)return n[o]}return n[n.length-1]},bp=function(e,t,n,i,s,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var a;gp.includes(e)?a=Qb:mp.includes(e)?a=vp:a=e8;var l=yp(e,t,a,i);return l.type==="small"?Ub(e,l.style,n,i,s,o):l.type==="large"?hp(e,l.size,n,i,s,o):pp(e,t,n,i,s,o)},r8=function(e,t,n,i,s,o){var a=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,c=Math.max(t-a,n+a),d=Math.max(c/500*l,2*c-u);return bp(e,d,!0,i,s,o)},xr={sqrtImage:Yb,sizedDelim:Zb,sizeToMaxHeight:Bi,customSizedDelim:bp,leftRightDelim:r8},wp={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},n8=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function vo(r,e){var t=ho(r);if(t&&n8.includes(t.text))return t;throw t?new _("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new _("Invalid delimiter type '"+r.type+"'",r)}J({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=vo(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:wp[r.funcName].size,mclass:wp[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?P.makeSpan([r.mclass]):xr.sizedDelim(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(Lt(r.delim,r.mode));var t=new H.MathNode("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var n=q(xr.sizeToMaxHeight[r.size]);return t.setAttribute("minsize",n),t.setAttribute("maxsize",n),t}});function xp(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}J({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new _("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:vo(e[0],r).text,color:t}}}),J({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=vo(e[0],r),n=r.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=pe(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:t.text,right:s.delim,rightColor:s.color}},htmlBuilder:(r,e)=>{xp(r);for(var t=Ge(r.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,o=0;o<t.length;o++)t[o].isMiddle?s=!0:(n=Math.max(t[o].height,n),i=Math.max(t[o].depth,i));n*=e.sizeMultiplier,i*=e.sizeMultiplier;var a;if(r.left==="."?a=zi(e,["mopen"]):a=xr.leftRightDelim(r.left,n,i,e,r.mode,["mopen"]),t.unshift(a),s)for(var l=1;l<t.length;l++){var u=t[l],c=u.isMiddle;c&&(t[l]=xr.leftRightDelim(c.delim,n,i,c.options,r.mode,[]))}var d;if(r.right===".")d=zi(e,["mclose"]);else{var h=r.rightColor?e.withColor(r.rightColor):e;d=xr.leftRightDelim(r.right,n,i,h,r.mode,["mclose"])}return t.push(d),P.makeSpan(["minner"],t,e)},mathmlBuilder:(r,e)=>{xp(r);var t=yt(r.body,e);if(r.left!=="."){var n=new H.MathNode("mo",[Lt(r.left,r.mode)]);n.setAttribute("fence","true"),t.unshift(n)}if(r.right!=="."){var i=new H.MathNode("mo",[Lt(r.right,r.mode)]);i.setAttribute("fence","true"),r.rightColor&&i.setAttribute("mathcolor",r.rightColor),t.push(i)}return Vl(t)}}),J({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=vo(e[0],r);if(!r.parser.leftrightDepth)throw new _("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=zi(e,[]);else{t=xr.sizedDelim(r.delim,1,e,r.mode,[]);var n={delim:r.delim,options:e};t.isMiddle=n}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?Lt("|","text"):Lt(r.delim,r.mode),n=new H.MathNode("mo",[t]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var e0=(r,e)=>{var t=P.wrapFragment(ve(r.body,e),e),n=r.label.slice(1),i=e.sizeMultiplier,s,o=0,a=be.isCharacterBox(r.body);if(n==="sout")s=P.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,o=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Pe({number:.6,unit:"pt"},e),u=Pe({number:.35,unit:"ex"},e),c=e.havingBaseSizing();i=i/c.sizeMultiplier;var d=t.height+t.depth+l+u;t.style.paddingLeft=q(d/2+l);var h=Math.floor(1e3*d*i),f=J7(h),m=new gr([new Kr("phase",f)],{width:"400em",height:q(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});s=P.makeSvgSpan(["hide-tail"],[m],e),s.style.height=q(d),o=t.depth+l+u}else{/cancel/.test(n)?a||t.classes.push("cancel-pad"):n==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var v=0,y=0,w=0;/box/.test(n)?(w=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),v=e.fontMetrics().fboxsep+(n==="colorbox"?0:w),y=v):n==="angl"?(w=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),v=4*w,y=Math.max(0,.25-t.depth)):(v=a?.2:0,y=v),s=wr.encloseSpan(t,n,v,y,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=q(w)):n==="angl"&&w!==.049&&(s.style.borderTopWidth=q(w),s.style.borderRightWidth=q(w)),o=t.depth+y,r.backgroundColor&&(s.style.backgroundColor=r.backgroundColor,r.borderColor&&(s.style.borderColor=r.borderColor))}var k;if(r.backgroundColor)k=P.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:t,shift:0}]},e);else{var E=/cancel|phase/.test(n)?["svg-align"]:[];k=P.makeVList({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:E}]},e)}return/cancel/.test(n)&&(k.height=t.height,k.depth=t.depth),/cancel/.test(n)&&!a?P.makeSpan(["mord","cancel-lap"],[k],e):P.makeSpan(["mord"],[k],e)},t0=(r,e)=>{var t=0,n=new H.MathNode(r.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Oe(r.body,e)]);switch(r.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*t+"pt"),n.setAttribute("height","+"+2*t+"pt"),n.setAttribute("lspace",t+"pt"),n.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(r.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&n.setAttribute("mathbackground",r.backgroundColor),n};J({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,s=pe(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:e0,mathmlBuilder:t0}),J({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,s=pe(e[0],"color-token").color,o=pe(e[1],"color-token").color,a=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:e0,mathmlBuilder:t0}),J({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}}),J({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}},htmlBuilder:e0,mathmlBuilder:t0}),J({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var Sp={};function Zt(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=r,a={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<t.length;++l)Sp[t[l]]=a;s&&(lo[e]=s),o&&(uo[e]=o)}var kp={};function S(r,e){kp[r]=e}function Tp(r){var e=[];r.consumeSpaces();var t=r.fetch().text;for(t==="\\relax"&&(r.consume(),r.consumeSpaces(),t=r.fetch().text);t==="\\hline"||t==="\\hdashline";)r.consume(),e.push(t==="\\hdashline"),r.consumeSpaces(),t=r.fetch().text;return e}var yo=r=>{var e=r.parser.settings;if(!e.displayMode)throw new _("{"+r.envName+"} can be used only in display mode.")};function r0(r){if(r.indexOf("ed")===-1)return r.indexOf("*")===-1}function Xr(r,e,t){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:u,emptySingleRow:c,maxNumCols:d,leqno:h}=e;if(r.gullet.beginGroup(),u||r.gullet.macros.set("\\cr","\\\\\\relax"),!o){var f=r.gullet.expandMacroAsText("\\arraystretch");if(f==null)o=1;else if(o=parseFloat(f),!o||o<0)throw new _("Invalid \\arraystretch: "+f)}r.gullet.beginGroup();var m=[],v=[m],y=[],w=[],k=l!=null?[]:void 0;function E(){l&&r.gullet.macros.set("\\@eqnsw","1",!0)}function R(){k&&(r.gullet.macros.get("\\df@tag")?(k.push(r.subparse([new Tt("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):k.push(!!l&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(E(),w.push(Tp(r));;){var O=r.parseExpression(!1,u?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup(),O={type:"ordgroup",mode:r.mode,body:O},t&&(O={type:"styling",mode:r.mode,style:t,body:[O]}),m.push(O);var N=r.fetch().text;if(N==="&"){if(d&&m.length===d){if(u||a)throw new _("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(N==="\\end"){R(),m.length===1&&O.type==="styling"&&O.body[0].body.length===0&&(v.length>1||!c)&&v.pop(),w.length<v.length+1&&w.push([]);break}else if(N==="\\\\"){r.consume();var D=void 0;r.gullet.future().text!==" "&&(D=r.parseSizeGroup(!0)),y.push(D?D.value:null),R(),w.push(Tp(r)),m=[],v.push(m),E()}else throw new _("Expected & or \\\\ or \\cr or \\end",r.nextToken)}return r.gullet.endGroup(),r.gullet.endGroup(),{type:"array",mode:r.mode,addJot:i,arraystretch:o,body:v,cols:s,rowGaps:y,hskipBeforeAndAfter:n,hLinesBeforeRow:w,colSeparationType:a,tags:k,leqno:h}}function n0(r){return r.slice(0,1)==="d"?"display":"text"}var Qt=function(e,t){var n,i,s=e.body.length,o=e.hLinesBeforeRow,a=0,l=new Array(s),u=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,h=5*d;if(e.colSeparationType&&e.colSeparationType==="small"){var f=t.havingStyle(oe.SCRIPT).sizeMultiplier;h=.2778*(f/t.sizeMultiplier)}var m=e.colSeparationType==="CD"?Pe({number:3,unit:"ex"},t):12*d,v=3*d,y=e.arraystretch*m,w=.7*y,k=.3*y,E=0;function R(kn){for(var tn=0;tn<kn.length;++tn)tn>0&&(E+=.25),u.push({pos:E,isDashed:kn[tn]})}for(R(o[0]),n=0;n<e.body.length;++n){var O=e.body[n],N=w,D=k;a<O.length&&(a=O.length);var B=new Array(O.length);for(i=0;i<O.length;++i){var L=ve(O[i],t);D<L.depth&&(D=L.depth),N<L.height&&(N=L.height),B[i]=L}var V=e.rowGaps[n],te=0;V&&(te=Pe(V,t),te>0&&(te+=k,D<te&&(D=te),te=0)),e.addJot&&(D+=v),B.height=N,B.depth=D,E+=N,B.pos=E,E+=D+te,l[n]=B,R(o[n+1])}var ne=E/2+t.fontMetrics().axisHeight,fe=e.cols||[],re=[],G,Z,ye=[];if(e.tags&&e.tags.some(kn=>kn))for(n=0;n<s;++n){var ee=l[n],ke=ee.pos-ne,C=e.tags[n],x=void 0;C===!0?x=P.makeSpan(["eqn-num"],[],t):C===!1?x=P.makeSpan([],[],t):x=P.makeSpan([],Ge(C,t,!0),t),x.depth=ee.depth,x.height=ee.height,ye.push({type:"elem",elem:x,shift:ke})}for(i=0,Z=0;i<a||Z<fe.length;++i,++Z){for(var I=fe[Z]||{},j=!0;I.type==="separator";){if(j||(G=P.makeSpan(["arraycolsep"],[]),G.style.width=q(t.fontMetrics().doubleRuleSep),re.push(G)),I.separator==="|"||I.separator===":"){var W=I.separator==="|"?"solid":"dashed",he=P.makeSpan(["vertical-separator"],[],t);he.style.height=q(E),he.style.borderRightWidth=q(c),he.style.borderRightStyle=W,he.style.margin="0 "+q(-c/2);var Le=E-ne;Le&&(he.style.verticalAlign=q(-Le)),re.push(he)}else throw new _("Invalid separator type: "+I.separator);Z++,I=fe[Z]||{},j=!1}if(!(i>=a)){var me=void 0;(i>0||e.hskipBeforeAndAfter)&&(me=be.deflt(I.pregap,h),me!==0&&(G=P.makeSpan(["arraycolsep"],[]),G.style.width=q(me),re.push(G)));var Ue=[];for(n=0;n<s;++n){var At=l[n],en=At[i];if(en){var I0=At.pos-ne;en.depth=At.depth,en.height=At.height,Ue.push({type:"elem",elem:en,shift:I0})}}Ue=P.makeVList({positionType:"individualShift",children:Ue},t),Ue=P.makeSpan(["col-align-"+(I.align||"c")],[Ue]),re.push(Ue),(i<a-1||e.hskipBeforeAndAfter)&&(me=be.deflt(I.postgap,h),me!==0&&(G=P.makeSpan(["arraycolsep"],[]),G.style.width=q(me),re.push(G)))}}if(l=P.makeSpan(["mtable"],re),u.length>0){for(var R0=P.makeLineSpan("hline",t,c),qt=P.makeLineSpan("hdashline",t,c),_i=[{type:"elem",elem:l,shift:0}];u.length>0;){var Lo=u.pop(),Yn=Lo.pos-ne;Lo.isDashed?_i.push({type:"elem",elem:qt,shift:Yn}):_i.push({type:"elem",elem:R0,shift:Yn})}l=P.makeVList({positionType:"individualShift",children:_i},t)}if(ye.length===0)return P.makeSpan(["mord"],[l],t);var ji=P.makeVList({positionType:"individualShift",children:ye},t);return ji=P.makeSpan(["tag"],[ji],t),P.makeFragment([l,ji])},i8={c:"center ",l:"left ",r:"right "},er=function(e,t){for(var n=[],i=new H.MathNode("mtd",[],["mtr-glue"]),s=new H.MathNode("mtd",[],["mml-eqn-num"]),o=0;o<e.body.length;o++){for(var a=e.body[o],l=[],u=0;u<a.length;u++)l.push(new H.MathNode("mtd",[Oe(a[u],t)]));e.tags&&e.tags[o]&&(l.unshift(i),l.push(i),e.leqno?l.unshift(s):l.push(s)),n.push(new H.MathNode("mtr",l))}var c=new H.MathNode("mtable",n),d=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",q(d));var h="",f="";if(e.cols&&e.cols.length>0){var m=e.cols,v="",y=!1,w=0,k=m.length;m[0].type==="separator"&&(h+="top ",w=1),m[m.length-1].type==="separator"&&(h+="bottom ",k-=1);for(var E=w;E<k;E++)m[E].type==="align"?(f+=i8[m[E].align],y&&(v+="none "),y=!0):m[E].type==="separator"&&y&&(v+=m[E].separator==="|"?"solid ":"dashed ",y=!1);c.setAttribute("columnalign",f.trim()),/[sd]/.test(v)&&c.setAttribute("columnlines",v.trim())}if(e.colSeparationType==="align"){for(var R=e.cols||[],O="",N=1;N<R.length;N++)O+=N%2?"0em ":"1em ";c.setAttribute("columnspacing",O.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?c.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?c.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var D="",B=e.hLinesBeforeRow;h+=B[0].length>0?"left ":"",h+=B[B.length-1].length>0?"right ":"";for(var L=1;L<B.length-1;L++)D+=B[L].length===0?"none ":B[L][0]?"dashed ":"solid ";return/[sd]/.test(D)&&c.setAttribute("rowlines",D.trim()),h!==""&&(c=new H.MathNode("menclose",[c]),c.setAttribute("notation",h.trim())),e.arraystretch&&e.arraystretch<1&&(c=new H.MathNode("mstyle",[c]),c.setAttribute("scriptlevel","1")),c},Mp=function(e,t){e.envName.indexOf("ed")===-1&&yo(e);var n=[],i=e.envName.indexOf("at")>-1?"alignat":"align",s=e.envName==="split",o=Xr(e.parser,{cols:n,addJot:!0,autoTag:s?void 0:r0(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a,l=0,u={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var c="",d=0;d<t[0].body.length;d++){var h=pe(t[0].body[d],"textord");c+=h.text}a=Number(c),l=a*2}var f=!l;o.body.forEach(function(w){for(var k=1;k<w.length;k+=2){var E=pe(w[k],"styling"),R=pe(E.body[0],"ordgroup");R.body.unshift(u)}if(f)l<w.length&&(l=w.length);else{var O=w.length/2;if(a<O)throw new _("Too many math in a row: "+("expected "+a+", but got "+O),w[0])}});for(var m=0;m<l;++m){var v="r",y=0;m%2===1?v="l":m>0&&f&&(y=1),n[m]={type:"align",align:v,pregap:y,postgap:0}}return o.colSeparationType=f?"align":"alignat",o};Zt({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=ho(e[0]),n=t?[e[0]]:pe(e[0],"ordgroup").body,i=n.map(function(o){var a=ql(o),l=a.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new _("Unknown column alignment: "+l,o)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Xr(r.parser,s,n0(r.envName))},htmlBuilder:Qt,mathmlBuilder:er}),Zt({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var i=r.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),t=i.fetch().text,"lcr".indexOf(t)===-1)throw new _("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:t}]}}var s=Xr(r.parser,n,n0(r.envName)),o=Math.max(0,...s.body.map(a=>a.length));return s.cols=new Array(o).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:Qt,mathmlBuilder:er}),Zt({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=Xr(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:Qt,mathmlBuilder:er}),Zt({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=ho(e[0]),n=t?[e[0]]:pe(e[0],"ordgroup").body,i=n.map(function(o){var a=ql(o),l=a.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new _("Unknown column alignment: "+l,o)});if(i.length>1)throw new _("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=Xr(r.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new _("{subarray} can contain only one column");return s},htmlBuilder:Qt,mathmlBuilder:er}),Zt({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=Xr(r.parser,e,n0(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.indexOf("r")>-1?".":"\\{",right:r.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Qt,mathmlBuilder:er}),Zt({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Mp,htmlBuilder:Qt,mathmlBuilder:er}),Zt({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){["gather","gather*"].includes(r.envName)&&yo(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:r0(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return Xr(r.parser,e,"display")},htmlBuilder:Qt,mathmlBuilder:er}),Zt({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Mp,htmlBuilder:Qt,mathmlBuilder:er}),Zt({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){yo(r);var e={autoTag:r0(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return Xr(r.parser,e,"display")},htmlBuilder:Qt,mathmlBuilder:er}),Zt({type:"array",names:["CD"],props:{numArgs:0},handler(r){return yo(r),qb(r.parser)},htmlBuilder:Qt,mathmlBuilder:er}),S("\\nonumber","\\gdef\\@eqnsw{0}"),S("\\notag","\\nonumber"),J({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new _(r.funcName+" valid only within array environment")}});var Cp=Sp;J({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];if(i.type!=="ordgroup")throw new _("Invalid environment name",i);for(var s="",o=0;o<i.body.length;++o)s+=pe(i.body[o],"textord").text;if(n==="\\begin"){if(!Cp.hasOwnProperty(s))throw new _("No such environment: "+s,i);var a=Cp[s],{args:l,optArgs:u}=t.parseArguments("\\begin{"+s+"}",a),c={mode:t.mode,envName:s,parser:t},d=a.handler(c,l,u);t.expect("\\end",!1);var h=t.nextToken,f=pe(t.parseFunction(),"environment");if(f.name!==s)throw new _("Mismatch: \\begin{"+s+"} matched by \\end{"+f.name+"}",h);return d}return{type:"environment",mode:t.mode,name:s,nameGroup:i}}});var Ep=(r,e)=>{var t=r.font,n=e.withFont(t);return ve(r.body,n)},Ap=(r,e)=>{var t=r.font,n=e.withFont(t);return Oe(r.body,n)},Op={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};J({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=co(e[0]),s=n;return s in Op&&(s=Op[s]),{type:"font",mode:t.mode,font:s.slice(1),body:i}},htmlBuilder:Ep,mathmlBuilder:Ap}),J({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,n=e[0],i=be.isCharacterBox(n);return{type:"mclass",mode:t.mode,mclass:mo(n),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}}),J({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,breakOnTokenText:i}=r,{mode:s}=t,o=t.parseExpression(!0,i),a="math"+n.slice(1);return{type:"font",mode:s,font:a,body:{type:"ordgroup",mode:t.mode,body:o}}},htmlBuilder:Ep,mathmlBuilder:Ap});var Np=(r,e)=>{var t=e;return r==="display"?t=t.id>=oe.SCRIPT.id?t.text():oe.DISPLAY:r==="text"&&t.size===oe.DISPLAY.size?t=oe.TEXT:r==="script"?t=oe.SCRIPT:r==="scriptscript"&&(t=oe.SCRIPTSCRIPT),t},i0=(r,e)=>{var t=Np(r.size,e.style),n=t.fracNum(),i=t.fracDen(),s;s=e.havingStyle(n);var o=ve(r.numer,s,e);if(r.continued){var a=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;o.height=o.height<a?a:o.height,o.depth=o.depth<l?l:o.depth}s=e.havingStyle(i);var u=ve(r.denom,s,e),c,d,h;r.hasBarLine?(r.barSize?(d=Pe(r.barSize,e),c=P.makeLineSpan("frac-line",e,d)):c=P.makeLineSpan("frac-line",e),d=c.height,h=c.height):(c=null,d=0,h=e.fontMetrics().defaultRuleThickness);var f,m,v;t.size===oe.DISPLAY.size||r.size==="display"?(f=e.fontMetrics().num1,d>0?m=3*h:m=7*h,v=e.fontMetrics().denom1):(d>0?(f=e.fontMetrics().num2,m=h):(f=e.fontMetrics().num3,m=3*h),v=e.fontMetrics().denom2);var y;if(c){var k=e.fontMetrics().axisHeight;f-o.depth-(k+.5*d)<m&&(f+=m-(f-o.depth-(k+.5*d))),k-.5*d-(u.height-v)<m&&(v+=m-(k-.5*d-(u.height-v)));var E=-(k-.5*d);y=P.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:v},{type:"elem",elem:c,shift:E},{type:"elem",elem:o,shift:-f}]},e)}else{var w=f-o.depth-(u.height-v);w<m&&(f+=.5*(m-w),v+=.5*(m-w)),y=P.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:v},{type:"elem",elem:o,shift:-f}]},e)}s=e.havingStyle(t),y.height*=s.sizeMultiplier/e.sizeMultiplier,y.depth*=s.sizeMultiplier/e.sizeMultiplier;var R;t.size===oe.DISPLAY.size?R=e.fontMetrics().delim1:t.size===oe.SCRIPTSCRIPT.size?R=e.havingStyle(oe.SCRIPT).fontMetrics().delim2:R=e.fontMetrics().delim2;var O,N;return r.leftDelim==null?O=zi(e,["mopen"]):O=xr.customSizedDelim(r.leftDelim,R,!0,e.havingStyle(t),r.mode,["mopen"]),r.continued?N=P.makeSpan([]):r.rightDelim==null?N=zi(e,["mclose"]):N=xr.customSizedDelim(r.rightDelim,R,!0,e.havingStyle(t),r.mode,["mclose"]),P.makeSpan(["mord"].concat(s.sizingClasses(e)),[O,P.makeSpan(["mfrac"],[y]),N],e)},s0=(r,e)=>{var t=new H.MathNode("mfrac",[Oe(r.numer,e),Oe(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var n=Pe(r.barSize,e);t.setAttribute("linethickness",q(n))}var i=Np(r.size,e.style);if(i.size!==e.style.size){t=new H.MathNode("mstyle",[t]);var s=i.size===oe.DISPLAY.size?"true":"false";t.setAttribute("displaystyle",s),t.setAttribute("scriptlevel","0")}if(r.leftDelim!=null||r.rightDelim!=null){var o=[];if(r.leftDelim!=null){var a=new H.MathNode("mo",[new H.TextNode(r.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(t),r.rightDelim!=null){var l=new H.MathNode("mo",[new H.TextNode(r.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return Vl(o)}return t};J({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1],o,a=null,l=null,u="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,a="(",l=")";break;case"\\\\bracefrac":o=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":u="display";break;case"\\tfrac":case"\\tbinom":u="text";break}return{type:"genfrac",mode:t.mode,continued:!1,numer:i,denom:s,hasBarLine:o,leftDelim:a,rightDelim:l,size:u,barSize:null}},htmlBuilder:i0,mathmlBuilder:s0}),J({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1];return{type:"genfrac",mode:t.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),J({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:n}=r,i;switch(t){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var Dp=["display","text","script","scriptscript"],Ip=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};J({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,n=e[4],i=e[5],s=co(e[0]),o=s.type==="atom"&&s.family==="open"?Ip(s.text):null,a=co(e[1]),l=a.type==="atom"&&a.family==="close"?Ip(a.text):null,u=pe(e[2],"size"),c,d=null;u.isBlank?c=!0:(d=u.value,c=d.number>0);var h="auto",f=e[3];if(f.type==="ordgroup"){if(f.body.length>0){var m=pe(f.body[0],"textord");h=Dp[Number(m.text)]}}else f=pe(f,"textord"),h=Dp[Number(f.text)];return{type:"genfrac",mode:t.mode,numer:n,denom:i,continued:!1,hasBarLine:c,barSize:d,leftDelim:o,rightDelim:l,size:h}},htmlBuilder:i0,mathmlBuilder:s0}),J({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:n,token:i}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:pe(e[0],"size").value,token:i}}}),J({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=P7(pe(e[1],"infix").size),o=e[2],a=s.number>0;return{type:"genfrac",mode:t.mode,numer:i,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:i0,mathmlBuilder:s0});var Rp=(r,e)=>{var t=e.style,n,i;r.type==="supsub"?(n=r.sup?ve(r.sup,e.havingStyle(t.sup()),e):ve(r.sub,e.havingStyle(t.sub()),e),i=pe(r.base,"horizBrace")):i=pe(r,"horizBrace");var s=ve(i.base,e.havingBaseStyle(oe.DISPLAY)),o=wr.svgSpan(i,e),a;if(i.isOver?(a=P.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e),a.children[0].children[0].children[1].classes.push("svg-align")):(a=P.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e),a.children[0].children[0].children[0].classes.push("svg-align")),n){var l=P.makeSpan(["mord",i.isOver?"mover":"munder"],[a],e);i.isOver?a=P.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):a=P.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return P.makeSpan(["mord",i.isOver?"mover":"munder"],[a],e)},s8=(r,e)=>{var t=wr.mathMLnode(r.label);return new H.MathNode(r.isOver?"mover":"munder",[Oe(r.base,e),t])};J({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"horizBrace",mode:t.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:Rp,mathmlBuilder:s8}),J({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[1],i=pe(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:t.mode,href:i,body:_e(n)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=Ge(r.body,e,!1);return P.makeAnchor(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=Yr(r.body,e);return t instanceof Ct||(t=new Ct("mrow",[t])),t.setAttribute("href",r.href),t}}),J({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=pe(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:n}))return t.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<n.length;s++){var o=n[s];o==="~"&&(o="\\textasciitilde"),i.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:t.mode,font:"\\texttt",body:i};return{type:"href",mode:t.mode,href:n,body:_e(a)}}}),J({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(r,e){var{parser:t}=r;return{type:"hbox",mode:t.mode,body:_e(e[0])}},htmlBuilder(r,e){var t=Ge(r.body,e,!1);return P.makeFragment(t)},mathmlBuilder(r,e){return new H.MathNode("mrow",yt(r.body,e))}}),J({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,token:i}=r,s=pe(e[0],"raw").string,o=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var a,l={};switch(n){case"\\htmlClass":l.class=s,a={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,a={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,a={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var u=s.split(","),c=0;c<u.length;c++){var d=u[c],h=d.indexOf("=");if(h<0)throw new _("\\htmlData key/value '"+d+"' missing equals sign");var f=d.slice(0,h),m=d.slice(h+1);l["data-"+f.trim()]=m}a={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return t.settings.isTrusted(a)?{type:"html",mode:t.mode,attributes:l,body:_e(o)}:t.formatUnsupportedCmd(n)},htmlBuilder:(r,e)=>{var t=Ge(r.body,e,!1),n=["enclosing"];r.attributes.class&&n.push(...r.attributes.class.trim().split(/\s+/));var i=P.makeSpan(n,t,e);for(var s in r.attributes)s!=="class"&&r.attributes.hasOwnProperty(s)&&i.setAttribute(s,r.attributes[s]);return i},mathmlBuilder:(r,e)=>Yr(r.body,e)}),J({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:_e(e[0]),mathml:_e(e[1])}},htmlBuilder:(r,e)=>{var t=Ge(r.html,e,!1);return P.makeFragment(t)},mathmlBuilder:(r,e)=>Yr(r.mathml,e)});var o0=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new _("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!zh(n))throw new _("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};J({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:n}=r,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(t[0])for(var l=pe(t[0],"raw").string,u=l.split(","),c=0;c<u.length;c++){var d=u[c].split("=");if(d.length===2){var h=d[1].trim();switch(d[0].trim()){case"alt":a=h;break;case"width":i=o0(h);break;case"height":s=o0(h);break;case"totalheight":o=o0(h);break;default:throw new _("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var f=pe(e[0],"url").url;return a===""&&(a=f,a=a.replace(/^.*[\\/]/,""),a=a.substring(0,a.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:f})?{type:"includegraphics",mode:n.mode,alt:a,width:i,height:s,totalheight:o,src:f}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(r,e)=>{var t=Pe(r.height,e),n=0;r.totalheight.number>0&&(n=Pe(r.totalheight,e)-t);var i=0;r.width.number>0&&(i=Pe(r.width,e));var s={height:q(t+n)};i>0&&(s.width=q(i)),n>0&&(s.verticalAlign=q(-n));var o=new sb(r.src,r.alt,s);return o.height=t,o.depth=n,o},mathmlBuilder:(r,e)=>{var t=new H.MathNode("mglyph",[]);t.setAttribute("alt",r.alt);var n=Pe(r.height,e),i=0;if(r.totalheight.number>0&&(i=Pe(r.totalheight,e)-n,t.setAttribute("valign",q(-i))),t.setAttribute("height",q(n+i)),r.width.number>0){var s=Pe(r.width,e);t.setAttribute("width",q(s))}return t.setAttribute("src",r.src),t}}),J({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=pe(e[0],"size");if(t.settings.strict){var s=n[1]==="m",o=i.value.unit==="mu";s?(o||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):o&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:i.value}},htmlBuilder(r,e){return P.makeGlue(r.dimension,e)},mathmlBuilder(r,e){var t=Pe(r.dimension,e);return new H.SpaceNode(t)}}),J({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"lap",mode:t.mode,alignment:n.slice(5),body:i}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=P.makeSpan([],[ve(r.body,e)]),t=P.makeSpan(["inner"],[t],e)):t=P.makeSpan(["inner"],[ve(r.body,e)]);var n=P.makeSpan(["fix"],[]),i=P.makeSpan([r.alignment],[t,n],e),s=P.makeSpan(["strut"]);return s.style.height=q(i.height+i.depth),i.depth&&(s.style.verticalAlign=q(-i.depth)),i.children.unshift(s),i=P.makeSpan(["thinbox"],[i],e),P.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(r,e)=>{var t=new H.MathNode("mpadded",[Oe(r.body,e)]);if(r.alignment!=="rlap"){var n=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",n+"width")}return t.setAttribute("width","0px"),t}}),J({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:n}=r,i=n.mode;n.switchMode("math");var s=t==="\\("?"\\)":"$",o=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:o}}}),J({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new _("Mismatched "+r.funcName)}});var Pp=(r,e)=>{switch(e.style.size){case oe.DISPLAY.size:return r.display;case oe.TEXT.size:return r.text;case oe.SCRIPT.size:return r.script;case oe.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};J({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:_e(e[0]),text:_e(e[1]),script:_e(e[2]),scriptscript:_e(e[3])}},htmlBuilder:(r,e)=>{var t=Pp(r,e),n=Ge(t,e,!1);return P.makeFragment(n)},mathmlBuilder:(r,e)=>{var t=Pp(r,e);return Yr(t,e)}});var zp=(r,e,t,n,i,s,o)=>{r=P.makeSpan([],[r]);var a=t&&be.isCharacterBox(t),l,u;if(e){var c=ve(e,n.havingStyle(i.sup()),n);u={elem:c,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-c.depth)}}if(t){var d=ve(t,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var h;if(u&&l){var f=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+r.depth+o;h=P.makeVList({positionType:"bottom",positionData:f,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:q(-s)},{type:"kern",size:l.kern},{type:"elem",elem:r},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:q(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){var m=r.height-o;h=P.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:q(-s)},{type:"kern",size:l.kern},{type:"elem",elem:r}]},n)}else if(u){var v=r.depth+o;h=P.makeVList({positionType:"bottom",positionData:v,children:[{type:"elem",elem:r},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:q(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return r;var y=[h];if(l&&s!==0&&!a){var w=P.makeSpan(["mspace"],[],n);w.style.marginRight=q(s),y.unshift(w)}return P.makeSpan(["mop","op-limits"],y,n)},Lp=["\\smallint"],_n=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=pe(r.base,"op"),i=!0):s=pe(r,"op");var o=e.style,a=!1;o.size===oe.DISPLAY.size&&s.symbol&&!Lp.includes(s.name)&&(a=!0);var l;if(s.symbol){var u=a?"Size2-Regular":"Size1-Regular",c="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(c=s.name.slice(1),s.name=c==="oiint"?"\\iint":"\\iiint"),l=P.makeSymbol(s.name,u,"math",e,["mop","op-symbol",a?"large-op":"small-op"]),c.length>0){var d=l.italic,h=P.staticSvg(c+"Size"+(a?"2":"1"),e);l=P.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:h,shift:a?.08:0}]},e),s.name="\\"+c,l.classes.unshift("mop"),l.italic=d}}else if(s.body){var f=Ge(s.body,e,!0);f.length===1&&f[0]instanceof zt?(l=f[0],l.classes[0]="mop"):l=P.makeSpan(["mop"],f,e)}else{for(var m=[],v=1;v<s.name.length;v++)m.push(P.mathsym(s.name[v],s.mode,e));l=P.makeSpan(["mop"],m,e)}var y=0,w=0;return(l instanceof zt||s.name==="\\oiint"||s.name==="\\oiiint")&&!s.suppressBaseShift&&(y=(l.height-l.depth)/2-e.fontMetrics().axisHeight,w=l.italic),i?zp(l,t,n,e,o,w,y):(y&&(l.style.position="relative",l.style.top=q(y)),l)},Fi=(r,e)=>{var t;if(r.symbol)t=new Ct("mo",[Lt(r.name,r.mode)]),Lp.includes(r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new Ct("mo",yt(r.body,e));else{t=new Ct("mi",[new Xt(r.name.slice(1))]);var n=new Ct("mo",[Lt("","text")]);r.parentIsSupSub?t=new Ct("mrow",[t,n]):t=Qh([t,n])}return t},o8={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};J({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=n;return i.length===1&&(i=o8[i]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:_n,mathmlBuilder:Fi}),J({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:_e(n)}},htmlBuilder:_n,mathmlBuilder:Fi});var a8={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};J({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:_n,mathmlBuilder:Fi}),J({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:_n,mathmlBuilder:Fi}),J({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(r){var{parser:e,funcName:t}=r,n=t;return n.length===1&&(n=a8[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:_n,mathmlBuilder:Fi});var Bp=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=pe(r.base,"operatorname"),i=!0):s=pe(r,"operatorname");var o;if(s.body.length>0){for(var a=s.body.map(d=>{var h=d.text;return typeof h=="string"?{type:"textord",mode:d.mode,text:h}:d}),l=Ge(a,e.withFont("mathrm"),!0),u=0;u<l.length;u++){var c=l[u];c instanceof zt&&(c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=P.makeSpan(["mop"],l,e)}else o=P.makeSpan(["mop"],[],e);return i?zp(o,t,n,e,e.style,0,0):o},l8=(r,e)=>{for(var t=yt(r.body,e.withFont("mathrm")),n=!0,i=0;i<t.length;i++){var s=t[i];if(!(s instanceof H.SpaceNode))if(s instanceof H.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var o=s.children[0];s.children.length===1&&o instanceof H.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break}default:n=!1}else n=!1}if(n){var a=t.map(c=>c.toText()).join("");t=[new H.TextNode(a)]}var l=new H.MathNode("mi",t);l.setAttribute("mathvariant","normal");var u=new H.MathNode("mo",[Lt("","text")]);return r.parentIsSupSub?new H.MathNode("mrow",[l,u]):H.newDocumentFragment([l,u])};J({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"operatorname",mode:t.mode,body:_e(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Bp,mathmlBuilder:l8}),S("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Sn({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?P.makeFragment(Ge(r.body,e,!1)):P.makeSpan(["mord"],Ge(r.body,e,!0),e)},mathmlBuilder(r,e){return Yr(r.body,e,!0)}}),J({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,n=e[0];return{type:"overline",mode:t.mode,body:n}},htmlBuilder(r,e){var t=ve(r.body,e.havingCrampedStyle()),n=P.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=P.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return P.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(r,e){var t=new H.MathNode("mo",[new H.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new H.MathNode("mover",[Oe(r.body,e),t]);return n.setAttribute("accent","true"),n}}),J({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"phantom",mode:t.mode,body:_e(n)}},htmlBuilder:(r,e)=>{var t=Ge(r.body,e.withPhantom(),!1);return P.makeFragment(t)},mathmlBuilder:(r,e)=>{var t=yt(r.body,e);return new H.MathNode("mphantom",t)}}),J({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"hphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=P.makeSpan([],[ve(r.body,e.withPhantom())]);if(t.height=0,t.depth=0,t.children)for(var n=0;n<t.children.length;n++)t.children[n].height=0,t.children[n].depth=0;return t=P.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e),P.makeSpan(["mord"],[t],e)},mathmlBuilder:(r,e)=>{var t=yt(_e(r.body),e),n=new H.MathNode("mphantom",t),i=new H.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),J({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"vphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=P.makeSpan(["inner"],[ve(r.body,e.withPhantom())]),n=P.makeSpan(["fix"],[]);return P.makeSpan(["mord","rlap"],[t,n],e)},mathmlBuilder:(r,e)=>{var t=yt(_e(r.body),e),n=new H.MathNode("mphantom",t),i=new H.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}}),J({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,n=pe(e[0],"size").value,i=e[1];return{type:"raisebox",mode:t.mode,dy:n,body:i}},htmlBuilder(r,e){var t=ve(r.body,e),n=Pe(r.dy,e);return P.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){var t=new H.MathNode("mpadded",[Oe(r.body,e)]),n=r.dy.number+r.dy.unit;return t.setAttribute("voffset",n),t}}),J({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}}),J({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(r,e,t){var{parser:n}=r,i=t[0],s=pe(e[0],"size"),o=pe(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&pe(i,"size").value,width:s.value,height:o.value}},htmlBuilder(r,e){var t=P.makeSpan(["mord","rule"],[],e),n=Pe(r.width,e),i=Pe(r.height,e),s=r.shift?Pe(r.shift,e):0;return t.style.borderRightWidth=q(n),t.style.borderTopWidth=q(i),t.style.bottom=q(s),t.width=n,t.height=i+s,t.depth=-s,t.maxFontSize=i*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=Pe(r.width,e),n=Pe(r.height,e),i=r.shift?Pe(r.shift,e):0,s=e.color&&e.getColor()||"black",o=new H.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",q(t)),o.setAttribute("height",q(n));var a=new H.MathNode("mpadded",[o]);return i>=0?a.setAttribute("height",q(i)):(a.setAttribute("height",q(i)),a.setAttribute("depth",q(-i))),a.setAttribute("voffset",q(i)),a}});function Fp(r,e,t){for(var n=Ge(r,e,!1),i=e.sizeMultiplier/t.sizeMultiplier,s=0;s<n.length;s++){var o=n[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(n[s].classes,e.sizingClasses(t)):n[s].classes[o+1]==="reset-size"+e.size&&(n[s].classes[o+1]="reset-size"+t.size),n[s].height*=i,n[s].depth*=i}return P.makeFragment(n)}var $p=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],u8=(r,e)=>{var t=e.havingSize(r.size);return Fp(r.body,t,e)};J({type:"sizing",names:$p,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!1,t);return{type:"sizing",mode:i.mode,size:$p.indexOf(n)+1,body:s}},htmlBuilder:u8,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),n=yt(r.body,t),i=new H.MathNode("mstyle",n);return i.setAttribute("mathsize",q(t.sizeMultiplier)),i}}),J({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:n}=r,i=!1,s=!1,o=t[0]&&pe(t[0],"ordgroup");if(o)for(var a="",l=0;l<o.body.length;++l){var u=o.body[l];if(a=u.text,a==="t")i=!0;else if(a==="b")s=!0;else{i=!1,s=!1;break}}else i=!0,s=!0;var c=e[0];return{type:"smash",mode:n.mode,body:c,smashHeight:i,smashDepth:s}},htmlBuilder:(r,e)=>{var t=P.makeSpan([],[ve(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0,t.children))for(var n=0;n<t.children.length;n++)t.children[n].height=0;if(r.smashDepth&&(t.depth=0,t.children))for(var i=0;i<t.children.length;i++)t.children[i].depth=0;var s=P.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e);return P.makeSpan(["mord"],[s],e)},mathmlBuilder:(r,e)=>{var t=new H.MathNode("mpadded",[Oe(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}}),J({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n}=r,i=t[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(r,e){var t=ve(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=P.wrapFragment(t,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.id<oe.TEXT.id&&(s=e.fontMetrics().xHeight);var o=i+s/4,a=t.height+t.depth+o+i,{span:l,ruleWidth:u,advanceWidth:c}=xr.sqrtImage(a,e),d=l.height-u;d>t.height+t.depth+o&&(o=(o+d-t.height-t.depth)/2);var h=l.height-t.height-o-u;t.style.paddingLeft=q(c);var f=P.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+h)},{type:"elem",elem:l},{type:"kern",size:u}]},e);if(r.index){var m=e.havingStyle(oe.SCRIPTSCRIPT),v=ve(r.index,m,e),y=.6*(f.height-f.depth),w=P.makeVList({positionType:"shift",positionData:-y,children:[{type:"elem",elem:v}]},e),k=P.makeSpan(["root"],[w]);return P.makeSpan(["mord","sqrt"],[k,f],e)}else return P.makeSpan(["mord","sqrt"],[f],e)},mathmlBuilder(r,e){var{body:t,index:n}=r;return n?new H.MathNode("mroot",[Oe(t,e),Oe(n,e)]):new H.MathNode("msqrt",[Oe(t,e)])}});var Hp={display:oe.DISPLAY,text:oe.TEXT,script:oe.SCRIPT,scriptscript:oe.SCRIPTSCRIPT};J({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!0,t),o=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(r,e){var t=Hp[r.style],n=e.havingStyle(t).withFont("");return Fp(r.body,n,e)},mathmlBuilder(r,e){var t=Hp[r.style],n=e.havingStyle(t),i=yt(r.body,n),s=new H.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},a=o[r.style];return s.setAttribute("scriptlevel",a[0]),s.setAttribute("displaystyle",a[1]),s}});var c8=function(e,t){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(t.style.size===oe.DISPLAY.size||n.alwaysHandleSupSub);return i?_n:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(t.style.size===oe.DISPLAY.size||n.limits);return s?Bp:null}else{if(n.type==="accent")return be.isCharacterBox(n.base)?Wl:null;if(n.type==="horizBrace"){var o=!e.sub;return o===n.isOver?Rp:null}else return null}else return null};Sn({type:"supsub",htmlBuilder(r,e){var t=c8(r,e);if(t)return t(r,e);var{base:n,sup:i,sub:s}=r,o=ve(n,e),a,l,u=e.fontMetrics(),c=0,d=0,h=n&&be.isCharacterBox(n);if(i){var f=e.havingStyle(e.style.sup());a=ve(i,f,e),h||(c=o.height-f.fontMetrics().supDrop*f.sizeMultiplier/e.sizeMultiplier)}if(s){var m=e.havingStyle(e.style.sub());l=ve(s,m,e),h||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/e.sizeMultiplier)}var v;e.style===oe.DISPLAY?v=u.sup1:e.style.cramped?v=u.sup3:v=u.sup2;var y=e.sizeMultiplier,w=q(.5/u.ptPerEm/y),k=null;if(l){var E=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(o instanceof zt||E)&&(k=q(-o.italic))}var R;if(a&&l){c=Math.max(c,v,a.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var O=u.defaultRuleThickness,N=4*O;if(c-a.depth-(l.height-d)<N){d=N-(c-a.depth)+l.height;var D=.8*u.xHeight-(c-a.depth);D>0&&(c+=D,d-=D)}var B=[{type:"elem",elem:l,shift:d,marginRight:w,marginLeft:k},{type:"elem",elem:a,shift:-c,marginRight:w}];R=P.makeVList({positionType:"individualShift",children:B},e)}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var L=[{type:"elem",elem:l,marginLeft:k,marginRight:w}];R=P.makeVList({positionType:"shift",positionData:d,children:L},e)}else if(a)c=Math.max(c,v,a.depth+.25*u.xHeight),R=P.makeVList({positionType:"shift",positionData:-c,children:[{type:"elem",elem:a,marginRight:w}]},e);else throw new Error("supsub must have either sup or sub.");var V=$l(o,"right")||"mord";return P.makeSpan([V],[o,P.makeSpan(["msupsub"],[R])],e)},mathmlBuilder(r,e){var t=!1,n,i;r.base&&r.base.type==="horizBrace"&&(i=!!r.sup,i===r.base.isOver&&(t=!0,n=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var s=[Oe(r.base,e)];r.sub&&s.push(Oe(r.sub,e)),r.sup&&s.push(Oe(r.sup,e));var o;if(t)o=n?"mover":"munder";else if(r.sub)if(r.sup){var u=r.base;u&&u.type==="op"&&u.limits&&e.style===oe.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===oe.DISPLAY||u.limits)?o="munderover":o="msubsup"}else{var l=r.base;l&&l.type==="op"&&l.limits&&(e.style===oe.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===oe.DISPLAY)?o="munder":o="msub"}else{var a=r.base;a&&a.type==="op"&&a.limits&&(e.style===oe.DISPLAY||a.alwaysHandleSupSub)||a&&a.type==="operatorname"&&a.alwaysHandleSupSub&&(a.limits||e.style===oe.DISPLAY)?o="mover":o="msup"}return new H.MathNode(o,s)}}),Sn({type:"atom",htmlBuilder(r,e){return P.mathsym(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new H.MathNode("mo",[Lt(r.text,r.mode)]);if(r.family==="bin"){var n=_l(r,e);n==="bold-italic"&&t.setAttribute("mathvariant",n)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var Vp={mi:"italic",mn:"normal",mtext:"normal"};Sn({type:"mathord",htmlBuilder(r,e){return P.makeOrd(r,e,"mathord")},mathmlBuilder(r,e){var t=new H.MathNode("mi",[Lt(r.text,r.mode,e)]),n=_l(r,e)||"italic";return n!==Vp[t.type]&&t.setAttribute("mathvariant",n),t}}),Sn({type:"textord",htmlBuilder(r,e){return P.makeOrd(r,e,"textord")},mathmlBuilder(r,e){var t=Lt(r.text,r.mode,e),n=_l(r,e)||"normal",i;return r.mode==="text"?i=new H.MathNode("mtext",[t]):/[0-9]/.test(r.text)?i=new H.MathNode("mn",[t]):r.text==="\\prime"?i=new H.MathNode("mo",[t]):i=new H.MathNode("mi",[t]),n!==Vp[i.type]&&i.setAttribute("mathvariant",n),i}});var a0={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},l0={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Sn({type:"spacing",htmlBuilder(r,e){if(l0.hasOwnProperty(r.text)){var t=l0[r.text].className||"";if(r.mode==="text"){var n=P.makeOrd(r,e,"textord");return n.classes.push(t),n}else return P.makeSpan(["mspace",t],[P.mathsym(r.text,r.mode,e)],e)}else{if(a0.hasOwnProperty(r.text))return P.makeSpan(["mspace",a0[r.text]],[],e);throw new _('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(l0.hasOwnProperty(r.text))t=new H.MathNode("mtext",[new H.TextNode(" ")]);else{if(a0.hasOwnProperty(r.text))return new H.MathNode("mspace");throw new _('Unknown type of space "'+r.text+'"')}return t}});var _p=()=>{var r=new H.MathNode("mtd",[]);return r.setAttribute("width","50%"),r};Sn({type:"tag",mathmlBuilder(r,e){var t=new H.MathNode("mtable",[new H.MathNode("mtr",[_p(),new H.MathNode("mtd",[Yr(r.body,e)]),_p(),new H.MathNode("mtd",[Yr(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var jp={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},qp={"\\textbf":"textbf","\\textmd":"textmd"},d8={"\\textit":"textit","\\textup":"textup"},Wp=(r,e)=>{var t=r.font;if(t){if(jp[t])return e.withTextFontFamily(jp[t]);if(qp[t])return e.withTextFontWeight(qp[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(d8[t])};J({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"text",mode:t.mode,body:_e(i),font:n}},htmlBuilder(r,e){var t=Wp(r,e),n=Ge(r.body,t,!0);return P.makeSpan(["mord","text"],n,t)},mathmlBuilder(r,e){var t=Wp(r,e);return Yr(r.body,t)}}),J({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=ve(r.body,e),n=P.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=P.makeVList({positionType:"top",positionData:t.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:t}]},e);return P.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(r,e){var t=new H.MathNode("mo",[new H.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new H.MathNode("munder",[Oe(r.body,e),t]);return n.setAttribute("accentunder","true"),n}}),J({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=ve(r.body,e),n=e.fontMetrics().axisHeight,i=.5*(t.height-n-(t.depth+n));return P.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){return new H.MathNode("mpadded",[Oe(r.body,e)],["vcenter"])}}),J({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new _("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=Up(r),n=[],i=e.havingStyle(e.style.text()),s=0;s<t.length;s++){var o=t[s];o==="~"&&(o="\\textasciitilde"),n.push(P.makeSymbol(o,"Typewriter-Regular",r.mode,i,["mord","texttt"]))}return P.makeSpan(["mord","text"].concat(i.sizingClasses(e)),P.tryCombineChars(n),i)},mathmlBuilder(r,e){var t=new H.TextNode(Up(r)),n=new H.MathNode("mtext",[t]);return n.setAttribute("mathvariant","monospace"),n}});var Up=r=>r.body.replace(/ /g,r.star?"␣":" "),Zr=Yh,Gp=`[ \r
|
|
862
|
-
]`,
|
|
894
|
+
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class ds{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){var e=t=>t.toText();return this.children.map(e).join("")}}var ir={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Bo={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},zp={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function P8(r,e){ir[r]=e}function w0(r,e,t){if(!ir[e])throw new Error("Font metrics not found for font: "+e+".");var n=r.charCodeAt(0),i=ir[e][n];if(!i&&r[0]in zp&&(n=zp[r[0]].charCodeAt(0),i=ir[e][n]),!i&&t==="text"&&Ip(n)&&(i=ir[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var x0={};function I8(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!x0[e]){var t=x0[e]={cssEmPerMu:Bo.quad[e]/18};for(var n in Bo)Bo.hasOwnProperty(n)&&(t[n]=Bo[n][e])}return x0[e]}var R8=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Lp=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Bp=function(e,t){return t.size<2?e:R8[e-1][t.size-1]};class Mr{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Mr.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Lp[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new Mr(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Bp(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Lp[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Bp(Mr.BASESIZE,e);return this.size===t&&this.textSize===Mr.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Mr.BASESIZE?["sizing","reset-size"+this.size,"size"+Mr.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=I8(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Mr.BASESIZE=6;var S0={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},z8={ex:!0,em:!0,mu:!0},Fp=function(e){return typeof e!="string"&&(e=e.unit),e in S0||e in z8||e==="ex"},_e=function(e,t){var n;if(e.unit in S0)n=S0[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")n=t.fontMetrics().cssEmPerMu;else{var i;if(t.style.isTight()?i=t.havingStyle(t.style.text()):i=t,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new W("Invalid unit: '"+e.unit+"'");i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},U=function(e){return+e.toFixed(4)+"em"},an=function(e){return e.filter(t=>t).join(" ")},$p=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},Hp=function(e){var t=document.createElement(e);t.className=an(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&t.setAttribute(i,this.attributes[i]);for(var s=0;s<this.children.length;s++)t.appendChild(this.children[s].toNode());return t},L8=/[\s"'>/=\x00-\x1f]/,jp=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Ee.escape(an(this.classes))+'"');var n="";for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Ee.hyphenate(i)+":"+this.style[i]+";");n&&(t+=' style="'+Ee.escape(n)+'"');for(var s in this.attributes)if(this.attributes.hasOwnProperty(s)){if(L8.test(s))throw new W("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Ee.escape(this.attributes[s])+'"'}t+=">";for(var o=0;o<this.children.length;o++)t+=this.children[o].toMarkup();return t+="</"+e+">",t};class fs{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,$p.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Hp.call(this,"span")}toMarkup(){return jp.call(this,"span")}}class k0{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,$p.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Hp.call(this,"a")}toMarkup(){return jp.call(this,"a")}}class B8{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+Ee.escape(this.src)+'"'+(' alt="'+Ee.escape(this.alt)+'"'),t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=Ee.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+Ee.escape(t)+'"'),e+="'/>",e}}var F8={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Vt{constructor(e,t,n,i,s,o,a,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=i||0,this.skew=s||0,this.width=o||0,this.classes=a||[],this.style=l||{},this.maxFontSize=0;var u=x8(this.text.charCodeAt(0));u&&this.classes.push(u+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=F8[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=U(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=an(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(t=t||document.createElement("span"),t.style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=Ee.escape(an(this.classes)),t+='"');var n="";this.italic>0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=Ee.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,t+=' style="'+Ee.escape(n)+'"');var s=Ee.escape(this.text);return e?(t+=">",t+=s,t+="</span>",t):s}}class Er{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+Ee.escape(this.attributes[t])+'"');e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>",e}}class ln{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",Rp[this.pathName]),t}toMarkup(){return this.alternate?'<path d="'+Ee.escape(this.alternate)+'"/>':'<path d="'+Ee.escape(Rp[this.pathName])+'"/>'}}class T0{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);return t}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+Ee.escape(this.attributes[t])+'"');return e+="/>",e}}function _p(r){if(r instanceof Vt)return r;throw new Error("Expected symbolNode but got "+String(r)+".")}function $8(r){if(r instanceof fs)return r;throw new Error("Expected span<HtmlDomNode> but got "+String(r)+".")}var H8={bin:1,close:1,inner:1,open:1,punct:1,rel:1},j8={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Be={math:{},text:{}};function p(r,e,t,n,i,s){Be[r][i]={font:e,group:t,replace:n},s&&n&&(Be[r][n]=Be[r][i])}var g="math",_="text",b="main",T="ams",He="accent-token",te="bin",vt="close",ai="inner",fe="mathord",Xe="op-token",It="open",Fo="punct",M="rel",Ar="spacing",O="textord";p(g,b,M,"≡","\\equiv",!0),p(g,b,M,"≺","\\prec",!0),p(g,b,M,"≻","\\succ",!0),p(g,b,M,"∼","\\sim",!0),p(g,b,M,"⊥","\\perp"),p(g,b,M,"⪯","\\preceq",!0),p(g,b,M,"⪰","\\succeq",!0),p(g,b,M,"≃","\\simeq",!0),p(g,b,M,"∣","\\mid",!0),p(g,b,M,"≪","\\ll",!0),p(g,b,M,"≫","\\gg",!0),p(g,b,M,"≍","\\asymp",!0),p(g,b,M,"∥","\\parallel"),p(g,b,M,"⋈","\\bowtie",!0),p(g,b,M,"⌣","\\smile",!0),p(g,b,M,"⊑","\\sqsubseteq",!0),p(g,b,M,"⊒","\\sqsupseteq",!0),p(g,b,M,"≐","\\doteq",!0),p(g,b,M,"⌢","\\frown",!0),p(g,b,M,"∋","\\ni",!0),p(g,b,M,"∝","\\propto",!0),p(g,b,M,"⊢","\\vdash",!0),p(g,b,M,"⊣","\\dashv",!0),p(g,b,M,"∋","\\owns"),p(g,b,Fo,".","\\ldotp"),p(g,b,Fo,"⋅","\\cdotp"),p(g,b,O,"#","\\#"),p(_,b,O,"#","\\#"),p(g,b,O,"&","\\&"),p(_,b,O,"&","\\&"),p(g,b,O,"ℵ","\\aleph",!0),p(g,b,O,"∀","\\forall",!0),p(g,b,O,"ℏ","\\hbar",!0),p(g,b,O,"∃","\\exists",!0),p(g,b,O,"∇","\\nabla",!0),p(g,b,O,"♭","\\flat",!0),p(g,b,O,"ℓ","\\ell",!0),p(g,b,O,"♮","\\natural",!0),p(g,b,O,"♣","\\clubsuit",!0),p(g,b,O,"℘","\\wp",!0),p(g,b,O,"♯","\\sharp",!0),p(g,b,O,"♢","\\diamondsuit",!0),p(g,b,O,"ℜ","\\Re",!0),p(g,b,O,"♡","\\heartsuit",!0),p(g,b,O,"ℑ","\\Im",!0),p(g,b,O,"♠","\\spadesuit",!0),p(g,b,O,"§","\\S",!0),p(_,b,O,"§","\\S"),p(g,b,O,"¶","\\P",!0),p(_,b,O,"¶","\\P"),p(g,b,O,"†","\\dag"),p(_,b,O,"†","\\dag"),p(_,b,O,"†","\\textdagger"),p(g,b,O,"‡","\\ddag"),p(_,b,O,"‡","\\ddag"),p(_,b,O,"‡","\\textdaggerdbl"),p(g,b,vt,"⎱","\\rmoustache",!0),p(g,b,It,"⎰","\\lmoustache",!0),p(g,b,vt,"⟯","\\rgroup",!0),p(g,b,It,"⟮","\\lgroup",!0),p(g,b,te,"∓","\\mp",!0),p(g,b,te,"⊖","\\ominus",!0),p(g,b,te,"⊎","\\uplus",!0),p(g,b,te,"⊓","\\sqcap",!0),p(g,b,te,"∗","\\ast"),p(g,b,te,"⊔","\\sqcup",!0),p(g,b,te,"◯","\\bigcirc",!0),p(g,b,te,"∙","\\bullet",!0),p(g,b,te,"‡","\\ddagger"),p(g,b,te,"≀","\\wr",!0),p(g,b,te,"⨿","\\amalg"),p(g,b,te,"&","\\And"),p(g,b,M,"⟵","\\longleftarrow",!0),p(g,b,M,"⇐","\\Leftarrow",!0),p(g,b,M,"⟸","\\Longleftarrow",!0),p(g,b,M,"⟶","\\longrightarrow",!0),p(g,b,M,"⇒","\\Rightarrow",!0),p(g,b,M,"⟹","\\Longrightarrow",!0),p(g,b,M,"↔","\\leftrightarrow",!0),p(g,b,M,"⟷","\\longleftrightarrow",!0),p(g,b,M,"⇔","\\Leftrightarrow",!0),p(g,b,M,"⟺","\\Longleftrightarrow",!0),p(g,b,M,"↦","\\mapsto",!0),p(g,b,M,"⟼","\\longmapsto",!0),p(g,b,M,"↗","\\nearrow",!0),p(g,b,M,"↩","\\hookleftarrow",!0),p(g,b,M,"↪","\\hookrightarrow",!0),p(g,b,M,"↘","\\searrow",!0),p(g,b,M,"↼","\\leftharpoonup",!0),p(g,b,M,"⇀","\\rightharpoonup",!0),p(g,b,M,"↙","\\swarrow",!0),p(g,b,M,"↽","\\leftharpoondown",!0),p(g,b,M,"⇁","\\rightharpoondown",!0),p(g,b,M,"↖","\\nwarrow",!0),p(g,b,M,"⇌","\\rightleftharpoons",!0),p(g,T,M,"≮","\\nless",!0),p(g,T,M,"","\\@nleqslant"),p(g,T,M,"","\\@nleqq"),p(g,T,M,"⪇","\\lneq",!0),p(g,T,M,"≨","\\lneqq",!0),p(g,T,M,"","\\@lvertneqq"),p(g,T,M,"⋦","\\lnsim",!0),p(g,T,M,"⪉","\\lnapprox",!0),p(g,T,M,"⊀","\\nprec",!0),p(g,T,M,"⋠","\\npreceq",!0),p(g,T,M,"⋨","\\precnsim",!0),p(g,T,M,"⪹","\\precnapprox",!0),p(g,T,M,"≁","\\nsim",!0),p(g,T,M,"","\\@nshortmid"),p(g,T,M,"∤","\\nmid",!0),p(g,T,M,"⊬","\\nvdash",!0),p(g,T,M,"⊭","\\nvDash",!0),p(g,T,M,"⋪","\\ntriangleleft"),p(g,T,M,"⋬","\\ntrianglelefteq",!0),p(g,T,M,"⊊","\\subsetneq",!0),p(g,T,M,"","\\@varsubsetneq"),p(g,T,M,"⫋","\\subsetneqq",!0),p(g,T,M,"","\\@varsubsetneqq"),p(g,T,M,"≯","\\ngtr",!0),p(g,T,M,"","\\@ngeqslant"),p(g,T,M,"","\\@ngeqq"),p(g,T,M,"⪈","\\gneq",!0),p(g,T,M,"≩","\\gneqq",!0),p(g,T,M,"","\\@gvertneqq"),p(g,T,M,"⋧","\\gnsim",!0),p(g,T,M,"⪊","\\gnapprox",!0),p(g,T,M,"⊁","\\nsucc",!0),p(g,T,M,"⋡","\\nsucceq",!0),p(g,T,M,"⋩","\\succnsim",!0),p(g,T,M,"⪺","\\succnapprox",!0),p(g,T,M,"≆","\\ncong",!0),p(g,T,M,"","\\@nshortparallel"),p(g,T,M,"∦","\\nparallel",!0),p(g,T,M,"⊯","\\nVDash",!0),p(g,T,M,"⋫","\\ntriangleright"),p(g,T,M,"⋭","\\ntrianglerighteq",!0),p(g,T,M,"","\\@nsupseteqq"),p(g,T,M,"⊋","\\supsetneq",!0),p(g,T,M,"","\\@varsupsetneq"),p(g,T,M,"⫌","\\supsetneqq",!0),p(g,T,M,"","\\@varsupsetneqq"),p(g,T,M,"⊮","\\nVdash",!0),p(g,T,M,"⪵","\\precneqq",!0),p(g,T,M,"⪶","\\succneqq",!0),p(g,T,M,"","\\@nsubseteqq"),p(g,T,te,"⊴","\\unlhd"),p(g,T,te,"⊵","\\unrhd"),p(g,T,M,"↚","\\nleftarrow",!0),p(g,T,M,"↛","\\nrightarrow",!0),p(g,T,M,"⇍","\\nLeftarrow",!0),p(g,T,M,"⇏","\\nRightarrow",!0),p(g,T,M,"↮","\\nleftrightarrow",!0),p(g,T,M,"⇎","\\nLeftrightarrow",!0),p(g,T,M,"△","\\vartriangle"),p(g,T,O,"ℏ","\\hslash"),p(g,T,O,"▽","\\triangledown"),p(g,T,O,"◊","\\lozenge"),p(g,T,O,"Ⓢ","\\circledS"),p(g,T,O,"®","\\circledR"),p(_,T,O,"®","\\circledR"),p(g,T,O,"∡","\\measuredangle",!0),p(g,T,O,"∄","\\nexists"),p(g,T,O,"℧","\\mho"),p(g,T,O,"Ⅎ","\\Finv",!0),p(g,T,O,"⅁","\\Game",!0),p(g,T,O,"‵","\\backprime"),p(g,T,O,"▲","\\blacktriangle"),p(g,T,O,"▼","\\blacktriangledown"),p(g,T,O,"■","\\blacksquare"),p(g,T,O,"⧫","\\blacklozenge"),p(g,T,O,"★","\\bigstar"),p(g,T,O,"∢","\\sphericalangle",!0),p(g,T,O,"∁","\\complement",!0),p(g,T,O,"ð","\\eth",!0),p(_,b,O,"ð","ð"),p(g,T,O,"╱","\\diagup"),p(g,T,O,"╲","\\diagdown"),p(g,T,O,"□","\\square"),p(g,T,O,"□","\\Box"),p(g,T,O,"◊","\\Diamond"),p(g,T,O,"¥","\\yen",!0),p(_,T,O,"¥","\\yen",!0),p(g,T,O,"✓","\\checkmark",!0),p(_,T,O,"✓","\\checkmark"),p(g,T,O,"ℶ","\\beth",!0),p(g,T,O,"ℸ","\\daleth",!0),p(g,T,O,"ℷ","\\gimel",!0),p(g,T,O,"ϝ","\\digamma",!0),p(g,T,O,"ϰ","\\varkappa"),p(g,T,It,"┌","\\@ulcorner",!0),p(g,T,vt,"┐","\\@urcorner",!0),p(g,T,It,"└","\\@llcorner",!0),p(g,T,vt,"┘","\\@lrcorner",!0),p(g,T,M,"≦","\\leqq",!0),p(g,T,M,"⩽","\\leqslant",!0),p(g,T,M,"⪕","\\eqslantless",!0),p(g,T,M,"≲","\\lesssim",!0),p(g,T,M,"⪅","\\lessapprox",!0),p(g,T,M,"≊","\\approxeq",!0),p(g,T,te,"⋖","\\lessdot"),p(g,T,M,"⋘","\\lll",!0),p(g,T,M,"≶","\\lessgtr",!0),p(g,T,M,"⋚","\\lesseqgtr",!0),p(g,T,M,"⪋","\\lesseqqgtr",!0),p(g,T,M,"≑","\\doteqdot"),p(g,T,M,"≓","\\risingdotseq",!0),p(g,T,M,"≒","\\fallingdotseq",!0),p(g,T,M,"∽","\\backsim",!0),p(g,T,M,"⋍","\\backsimeq",!0),p(g,T,M,"⫅","\\subseteqq",!0),p(g,T,M,"⋐","\\Subset",!0),p(g,T,M,"⊏","\\sqsubset",!0),p(g,T,M,"≼","\\preccurlyeq",!0),p(g,T,M,"⋞","\\curlyeqprec",!0),p(g,T,M,"≾","\\precsim",!0),p(g,T,M,"⪷","\\precapprox",!0),p(g,T,M,"⊲","\\vartriangleleft"),p(g,T,M,"⊴","\\trianglelefteq"),p(g,T,M,"⊨","\\vDash",!0),p(g,T,M,"⊪","\\Vvdash",!0),p(g,T,M,"⌣","\\smallsmile"),p(g,T,M,"⌢","\\smallfrown"),p(g,T,M,"≏","\\bumpeq",!0),p(g,T,M,"≎","\\Bumpeq",!0),p(g,T,M,"≧","\\geqq",!0),p(g,T,M,"⩾","\\geqslant",!0),p(g,T,M,"⪖","\\eqslantgtr",!0),p(g,T,M,"≳","\\gtrsim",!0),p(g,T,M,"⪆","\\gtrapprox",!0),p(g,T,te,"⋗","\\gtrdot"),p(g,T,M,"⋙","\\ggg",!0),p(g,T,M,"≷","\\gtrless",!0),p(g,T,M,"⋛","\\gtreqless",!0),p(g,T,M,"⪌","\\gtreqqless",!0),p(g,T,M,"≖","\\eqcirc",!0),p(g,T,M,"≗","\\circeq",!0),p(g,T,M,"≜","\\triangleq",!0),p(g,T,M,"∼","\\thicksim"),p(g,T,M,"≈","\\thickapprox"),p(g,T,M,"⫆","\\supseteqq",!0),p(g,T,M,"⋑","\\Supset",!0),p(g,T,M,"⊐","\\sqsupset",!0),p(g,T,M,"≽","\\succcurlyeq",!0),p(g,T,M,"⋟","\\curlyeqsucc",!0),p(g,T,M,"≿","\\succsim",!0),p(g,T,M,"⪸","\\succapprox",!0),p(g,T,M,"⊳","\\vartriangleright"),p(g,T,M,"⊵","\\trianglerighteq"),p(g,T,M,"⊩","\\Vdash",!0),p(g,T,M,"∣","\\shortmid"),p(g,T,M,"∥","\\shortparallel"),p(g,T,M,"≬","\\between",!0),p(g,T,M,"⋔","\\pitchfork",!0),p(g,T,M,"∝","\\varpropto"),p(g,T,M,"◀","\\blacktriangleleft"),p(g,T,M,"∴","\\therefore",!0),p(g,T,M,"∍","\\backepsilon"),p(g,T,M,"▶","\\blacktriangleright"),p(g,T,M,"∵","\\because",!0),p(g,T,M,"⋘","\\llless"),p(g,T,M,"⋙","\\gggtr"),p(g,T,te,"⊲","\\lhd"),p(g,T,te,"⊳","\\rhd"),p(g,T,M,"≂","\\eqsim",!0),p(g,b,M,"⋈","\\Join"),p(g,T,M,"≑","\\Doteq",!0),p(g,T,te,"∔","\\dotplus",!0),p(g,T,te,"∖","\\smallsetminus"),p(g,T,te,"⋒","\\Cap",!0),p(g,T,te,"⋓","\\Cup",!0),p(g,T,te,"⩞","\\doublebarwedge",!0),p(g,T,te,"⊟","\\boxminus",!0),p(g,T,te,"⊞","\\boxplus",!0),p(g,T,te,"⋇","\\divideontimes",!0),p(g,T,te,"⋉","\\ltimes",!0),p(g,T,te,"⋊","\\rtimes",!0),p(g,T,te,"⋋","\\leftthreetimes",!0),p(g,T,te,"⋌","\\rightthreetimes",!0),p(g,T,te,"⋏","\\curlywedge",!0),p(g,T,te,"⋎","\\curlyvee",!0),p(g,T,te,"⊝","\\circleddash",!0),p(g,T,te,"⊛","\\circledast",!0),p(g,T,te,"⋅","\\centerdot"),p(g,T,te,"⊺","\\intercal",!0),p(g,T,te,"⋒","\\doublecap"),p(g,T,te,"⋓","\\doublecup"),p(g,T,te,"⊠","\\boxtimes",!0),p(g,T,M,"⇢","\\dashrightarrow",!0),p(g,T,M,"⇠","\\dashleftarrow",!0),p(g,T,M,"⇇","\\leftleftarrows",!0),p(g,T,M,"⇆","\\leftrightarrows",!0),p(g,T,M,"⇚","\\Lleftarrow",!0),p(g,T,M,"↞","\\twoheadleftarrow",!0),p(g,T,M,"↢","\\leftarrowtail",!0),p(g,T,M,"↫","\\looparrowleft",!0),p(g,T,M,"⇋","\\leftrightharpoons",!0),p(g,T,M,"↶","\\curvearrowleft",!0),p(g,T,M,"↺","\\circlearrowleft",!0),p(g,T,M,"↰","\\Lsh",!0),p(g,T,M,"⇈","\\upuparrows",!0),p(g,T,M,"↿","\\upharpoonleft",!0),p(g,T,M,"⇃","\\downharpoonleft",!0),p(g,b,M,"⊶","\\origof",!0),p(g,b,M,"⊷","\\imageof",!0),p(g,T,M,"⊸","\\multimap",!0),p(g,T,M,"↭","\\leftrightsquigarrow",!0),p(g,T,M,"⇉","\\rightrightarrows",!0),p(g,T,M,"⇄","\\rightleftarrows",!0),p(g,T,M,"↠","\\twoheadrightarrow",!0),p(g,T,M,"↣","\\rightarrowtail",!0),p(g,T,M,"↬","\\looparrowright",!0),p(g,T,M,"↷","\\curvearrowright",!0),p(g,T,M,"↻","\\circlearrowright",!0),p(g,T,M,"↱","\\Rsh",!0),p(g,T,M,"⇊","\\downdownarrows",!0),p(g,T,M,"↾","\\upharpoonright",!0),p(g,T,M,"⇂","\\downharpoonright",!0),p(g,T,M,"⇝","\\rightsquigarrow",!0),p(g,T,M,"⇝","\\leadsto"),p(g,T,M,"⇛","\\Rrightarrow",!0),p(g,T,M,"↾","\\restriction"),p(g,b,O,"‘","`"),p(g,b,O,"$","\\$"),p(_,b,O,"$","\\$"),p(_,b,O,"$","\\textdollar"),p(g,b,O,"%","\\%"),p(_,b,O,"%","\\%"),p(g,b,O,"_","\\_"),p(_,b,O,"_","\\_"),p(_,b,O,"_","\\textunderscore"),p(g,b,O,"∠","\\angle",!0),p(g,b,O,"∞","\\infty",!0),p(g,b,O,"′","\\prime"),p(g,b,O,"△","\\triangle"),p(g,b,O,"Γ","\\Gamma",!0),p(g,b,O,"Δ","\\Delta",!0),p(g,b,O,"Θ","\\Theta",!0),p(g,b,O,"Λ","\\Lambda",!0),p(g,b,O,"Ξ","\\Xi",!0),p(g,b,O,"Π","\\Pi",!0),p(g,b,O,"Σ","\\Sigma",!0),p(g,b,O,"Υ","\\Upsilon",!0),p(g,b,O,"Φ","\\Phi",!0),p(g,b,O,"Ψ","\\Psi",!0),p(g,b,O,"Ω","\\Omega",!0),p(g,b,O,"A","Α"),p(g,b,O,"B","Β"),p(g,b,O,"E","Ε"),p(g,b,O,"Z","Ζ"),p(g,b,O,"H","Η"),p(g,b,O,"I","Ι"),p(g,b,O,"K","Κ"),p(g,b,O,"M","Μ"),p(g,b,O,"N","Ν"),p(g,b,O,"O","Ο"),p(g,b,O,"P","Ρ"),p(g,b,O,"T","Τ"),p(g,b,O,"X","Χ"),p(g,b,O,"¬","\\neg",!0),p(g,b,O,"¬","\\lnot"),p(g,b,O,"⊤","\\top"),p(g,b,O,"⊥","\\bot"),p(g,b,O,"∅","\\emptyset"),p(g,T,O,"∅","\\varnothing"),p(g,b,fe,"α","\\alpha",!0),p(g,b,fe,"β","\\beta",!0),p(g,b,fe,"γ","\\gamma",!0),p(g,b,fe,"δ","\\delta",!0),p(g,b,fe,"ϵ","\\epsilon",!0),p(g,b,fe,"ζ","\\zeta",!0),p(g,b,fe,"η","\\eta",!0),p(g,b,fe,"θ","\\theta",!0),p(g,b,fe,"ι","\\iota",!0),p(g,b,fe,"κ","\\kappa",!0),p(g,b,fe,"λ","\\lambda",!0),p(g,b,fe,"μ","\\mu",!0),p(g,b,fe,"ν","\\nu",!0),p(g,b,fe,"ξ","\\xi",!0),p(g,b,fe,"ο","\\omicron",!0),p(g,b,fe,"π","\\pi",!0),p(g,b,fe,"ρ","\\rho",!0),p(g,b,fe,"σ","\\sigma",!0),p(g,b,fe,"τ","\\tau",!0),p(g,b,fe,"υ","\\upsilon",!0),p(g,b,fe,"ϕ","\\phi",!0),p(g,b,fe,"χ","\\chi",!0),p(g,b,fe,"ψ","\\psi",!0),p(g,b,fe,"ω","\\omega",!0),p(g,b,fe,"ε","\\varepsilon",!0),p(g,b,fe,"ϑ","\\vartheta",!0),p(g,b,fe,"ϖ","\\varpi",!0),p(g,b,fe,"ϱ","\\varrho",!0),p(g,b,fe,"ς","\\varsigma",!0),p(g,b,fe,"φ","\\varphi",!0),p(g,b,te,"∗","*",!0),p(g,b,te,"+","+"),p(g,b,te,"−","-",!0),p(g,b,te,"⋅","\\cdot",!0),p(g,b,te,"∘","\\circ",!0),p(g,b,te,"÷","\\div",!0),p(g,b,te,"±","\\pm",!0),p(g,b,te,"×","\\times",!0),p(g,b,te,"∩","\\cap",!0),p(g,b,te,"∪","\\cup",!0),p(g,b,te,"∖","\\setminus",!0),p(g,b,te,"∧","\\land"),p(g,b,te,"∨","\\lor"),p(g,b,te,"∧","\\wedge",!0),p(g,b,te,"∨","\\vee",!0),p(g,b,O,"√","\\surd"),p(g,b,It,"⟨","\\langle",!0),p(g,b,It,"∣","\\lvert"),p(g,b,It,"∥","\\lVert"),p(g,b,vt,"?","?"),p(g,b,vt,"!","!"),p(g,b,vt,"⟩","\\rangle",!0),p(g,b,vt,"∣","\\rvert"),p(g,b,vt,"∥","\\rVert"),p(g,b,M,"=","="),p(g,b,M,":",":"),p(g,b,M,"≈","\\approx",!0),p(g,b,M,"≅","\\cong",!0),p(g,b,M,"≥","\\ge"),p(g,b,M,"≥","\\geq",!0),p(g,b,M,"←","\\gets"),p(g,b,M,">","\\gt",!0),p(g,b,M,"∈","\\in",!0),p(g,b,M,"","\\@not"),p(g,b,M,"⊂","\\subset",!0),p(g,b,M,"⊃","\\supset",!0),p(g,b,M,"⊆","\\subseteq",!0),p(g,b,M,"⊇","\\supseteq",!0),p(g,T,M,"⊈","\\nsubseteq",!0),p(g,T,M,"⊉","\\nsupseteq",!0),p(g,b,M,"⊨","\\models"),p(g,b,M,"←","\\leftarrow",!0),p(g,b,M,"≤","\\le"),p(g,b,M,"≤","\\leq",!0),p(g,b,M,"<","\\lt",!0),p(g,b,M,"→","\\rightarrow",!0),p(g,b,M,"→","\\to"),p(g,T,M,"≱","\\ngeq",!0),p(g,T,M,"≰","\\nleq",!0),p(g,b,Ar," ","\\ "),p(g,b,Ar," ","\\space"),p(g,b,Ar," ","\\nobreakspace"),p(_,b,Ar," ","\\ "),p(_,b,Ar," "," "),p(_,b,Ar," ","\\space"),p(_,b,Ar," ","\\nobreakspace"),p(g,b,Ar,null,"\\nobreak"),p(g,b,Ar,null,"\\allowbreak"),p(g,b,Fo,",",","),p(g,b,Fo,";",";"),p(g,T,te,"⊼","\\barwedge",!0),p(g,T,te,"⊻","\\veebar",!0),p(g,b,te,"⊙","\\odot",!0),p(g,b,te,"⊕","\\oplus",!0),p(g,b,te,"⊗","\\otimes",!0),p(g,b,O,"∂","\\partial",!0),p(g,b,te,"⊘","\\oslash",!0),p(g,T,te,"⊚","\\circledcirc",!0),p(g,T,te,"⊡","\\boxdot",!0),p(g,b,te,"△","\\bigtriangleup"),p(g,b,te,"▽","\\bigtriangledown"),p(g,b,te,"†","\\dagger"),p(g,b,te,"⋄","\\diamond"),p(g,b,te,"⋆","\\star"),p(g,b,te,"◃","\\triangleleft"),p(g,b,te,"▹","\\triangleright"),p(g,b,It,"{","\\{"),p(_,b,O,"{","\\{"),p(_,b,O,"{","\\textbraceleft"),p(g,b,vt,"}","\\}"),p(_,b,O,"}","\\}"),p(_,b,O,"}","\\textbraceright"),p(g,b,It,"{","\\lbrace"),p(g,b,vt,"}","\\rbrace"),p(g,b,It,"[","\\lbrack",!0),p(_,b,O,"[","\\lbrack",!0),p(g,b,vt,"]","\\rbrack",!0),p(_,b,O,"]","\\rbrack",!0),p(g,b,It,"(","\\lparen",!0),p(g,b,vt,")","\\rparen",!0),p(_,b,O,"<","\\textless",!0),p(_,b,O,">","\\textgreater",!0),p(g,b,It,"⌊","\\lfloor",!0),p(g,b,vt,"⌋","\\rfloor",!0),p(g,b,It,"⌈","\\lceil",!0),p(g,b,vt,"⌉","\\rceil",!0),p(g,b,O,"\\","\\backslash"),p(g,b,O,"∣","|"),p(g,b,O,"∣","\\vert"),p(_,b,O,"|","\\textbar",!0),p(g,b,O,"∥","\\|"),p(g,b,O,"∥","\\Vert"),p(_,b,O,"∥","\\textbardbl"),p(_,b,O,"~","\\textasciitilde"),p(_,b,O,"\\","\\textbackslash"),p(_,b,O,"^","\\textasciicircum"),p(g,b,M,"↑","\\uparrow",!0),p(g,b,M,"⇑","\\Uparrow",!0),p(g,b,M,"↓","\\downarrow",!0),p(g,b,M,"⇓","\\Downarrow",!0),p(g,b,M,"↕","\\updownarrow",!0),p(g,b,M,"⇕","\\Updownarrow",!0),p(g,b,Xe,"∐","\\coprod"),p(g,b,Xe,"⋁","\\bigvee"),p(g,b,Xe,"⋀","\\bigwedge"),p(g,b,Xe,"⨄","\\biguplus"),p(g,b,Xe,"⋂","\\bigcap"),p(g,b,Xe,"⋃","\\bigcup"),p(g,b,Xe,"∫","\\int"),p(g,b,Xe,"∫","\\intop"),p(g,b,Xe,"∬","\\iint"),p(g,b,Xe,"∭","\\iiint"),p(g,b,Xe,"∏","\\prod"),p(g,b,Xe,"∑","\\sum"),p(g,b,Xe,"⨂","\\bigotimes"),p(g,b,Xe,"⨁","\\bigoplus"),p(g,b,Xe,"⨀","\\bigodot"),p(g,b,Xe,"∮","\\oint"),p(g,b,Xe,"∯","\\oiint"),p(g,b,Xe,"∰","\\oiiint"),p(g,b,Xe,"⨆","\\bigsqcup"),p(g,b,Xe,"∫","\\smallint"),p(_,b,ai,"…","\\textellipsis"),p(g,b,ai,"…","\\mathellipsis"),p(_,b,ai,"…","\\ldots",!0),p(g,b,ai,"…","\\ldots",!0),p(g,b,ai,"⋯","\\@cdots",!0),p(g,b,ai,"⋱","\\ddots",!0),p(g,b,O,"⋮","\\varvdots"),p(_,b,O,"⋮","\\varvdots"),p(g,b,He,"ˊ","\\acute"),p(g,b,He,"ˋ","\\grave"),p(g,b,He,"¨","\\ddot"),p(g,b,He,"~","\\tilde"),p(g,b,He,"ˉ","\\bar"),p(g,b,He,"˘","\\breve"),p(g,b,He,"ˇ","\\check"),p(g,b,He,"^","\\hat"),p(g,b,He,"⃗","\\vec"),p(g,b,He,"˙","\\dot"),p(g,b,He,"˚","\\mathring"),p(g,b,fe,"","\\@imath"),p(g,b,fe,"","\\@jmath"),p(g,b,O,"ı","ı"),p(g,b,O,"ȷ","ȷ"),p(_,b,O,"ı","\\i",!0),p(_,b,O,"ȷ","\\j",!0),p(_,b,O,"ß","\\ss",!0),p(_,b,O,"æ","\\ae",!0),p(_,b,O,"œ","\\oe",!0),p(_,b,O,"ø","\\o",!0),p(_,b,O,"Æ","\\AE",!0),p(_,b,O,"Œ","\\OE",!0),p(_,b,O,"Ø","\\O",!0),p(_,b,He,"ˊ","\\'"),p(_,b,He,"ˋ","\\`"),p(_,b,He,"ˆ","\\^"),p(_,b,He,"˜","\\~"),p(_,b,He,"ˉ","\\="),p(_,b,He,"˘","\\u"),p(_,b,He,"˙","\\."),p(_,b,He,"¸","\\c"),p(_,b,He,"˚","\\r"),p(_,b,He,"ˇ","\\v"),p(_,b,He,"¨",'\\"'),p(_,b,He,"˝","\\H"),p(_,b,He,"◯","\\textcircled");var Vp={"--":!0,"---":!0,"``":!0,"''":!0};p(_,b,O,"–","--",!0),p(_,b,O,"–","\\textendash"),p(_,b,O,"—","---",!0),p(_,b,O,"—","\\textemdash"),p(_,b,O,"‘","`",!0),p(_,b,O,"‘","\\textquoteleft"),p(_,b,O,"’","'",!0),p(_,b,O,"’","\\textquoteright"),p(_,b,O,"“","``",!0),p(_,b,O,"“","\\textquotedblleft"),p(_,b,O,"”","''",!0),p(_,b,O,"”","\\textquotedblright"),p(g,b,O,"°","\\degree",!0),p(_,b,O,"°","\\degree"),p(_,b,O,"°","\\textdegree",!0),p(g,b,O,"£","\\pounds"),p(g,b,O,"£","\\mathsterling",!0),p(_,b,O,"£","\\pounds"),p(_,b,O,"£","\\textsterling",!0),p(g,T,O,"✠","\\maltese"),p(_,T,O,"✠","\\maltese");for(var qp='0123456789/@."',C0=0;C0<qp.length;C0++){var Wp=qp.charAt(C0);p(g,b,O,Wp,Wp)}for(var Up='0123456789!@*()-=+";:?/.,',M0=0;M0<Up.length;M0++){var Kp=Up.charAt(M0);p(_,b,O,Kp,Kp)}for(var $o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",E0=0;E0<$o.length;E0++){var Ho=$o.charAt(E0);p(g,b,fe,Ho,Ho),p(_,b,O,Ho,Ho)}p(g,T,O,"C","ℂ"),p(_,T,O,"C","ℂ"),p(g,T,O,"H","ℍ"),p(_,T,O,"H","ℍ"),p(g,T,O,"N","ℕ"),p(_,T,O,"N","ℕ"),p(g,T,O,"P","ℙ"),p(_,T,O,"P","ℙ"),p(g,T,O,"Q","ℚ"),p(_,T,O,"Q","ℚ"),p(g,T,O,"R","ℝ"),p(_,T,O,"R","ℝ"),p(g,T,O,"Z","ℤ"),p(_,T,O,"Z","ℤ"),p(g,b,fe,"h","ℎ"),p(_,b,fe,"h","ℎ");for(var ve="",yt=0;yt<$o.length;yt++){var Ue=$o.charAt(yt);ve=String.fromCharCode(55349,56320+yt),p(g,b,fe,Ue,ve),p(_,b,O,Ue,ve),ve=String.fromCharCode(55349,56372+yt),p(g,b,fe,Ue,ve),p(_,b,O,Ue,ve),ve=String.fromCharCode(55349,56424+yt),p(g,b,fe,Ue,ve),p(_,b,O,Ue,ve),ve=String.fromCharCode(55349,56580+yt),p(g,b,fe,Ue,ve),p(_,b,O,Ue,ve),ve=String.fromCharCode(55349,56684+yt),p(g,b,fe,Ue,ve),p(_,b,O,Ue,ve),ve=String.fromCharCode(55349,56736+yt),p(g,b,fe,Ue,ve),p(_,b,O,Ue,ve),ve=String.fromCharCode(55349,56788+yt),p(g,b,fe,Ue,ve),p(_,b,O,Ue,ve),ve=String.fromCharCode(55349,56840+yt),p(g,b,fe,Ue,ve),p(_,b,O,Ue,ve),ve=String.fromCharCode(55349,56944+yt),p(g,b,fe,Ue,ve),p(_,b,O,Ue,ve),yt<26&&(ve=String.fromCharCode(55349,56632+yt),p(g,b,fe,Ue,ve),p(_,b,O,Ue,ve),ve=String.fromCharCode(55349,56476+yt),p(g,b,fe,Ue,ve),p(_,b,O,Ue,ve))}ve="𝕜",p(g,b,fe,"k",ve),p(_,b,O,"k",ve);for(var Dn=0;Dn<10;Dn++){var un=Dn.toString();ve=String.fromCharCode(55349,57294+Dn),p(g,b,fe,un,ve),p(_,b,O,un,ve),ve=String.fromCharCode(55349,57314+Dn),p(g,b,fe,un,ve),p(_,b,O,un,ve),ve=String.fromCharCode(55349,57324+Dn),p(g,b,fe,un,ve),p(_,b,O,un,ve),ve=String.fromCharCode(55349,57334+Dn),p(g,b,fe,un,ve),p(_,b,O,un,ve)}for(var A0="ÐÞþ",O0=0;O0<A0.length;O0++){var jo=A0.charAt(O0);p(g,b,fe,jo,jo),p(_,b,O,jo,jo)}var _o=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Gp=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],_8=function(e,t){var n=e.charCodeAt(0),i=e.charCodeAt(1),s=(n-55296)*1024+(i-56320)+65536,o=t==="math"?0:1;if(119808<=s&&s<120484){var a=Math.floor((s-119808)/26);return[_o[a][2],_o[a][o]]}else if(120782<=s&&s<=120831){var l=Math.floor((s-120782)/10);return[Gp[l][2],Gp[l][o]]}else{if(s===120485||s===120486)return[_o[0][2],_o[0][o]];if(120486<s&&s<120782)return["",""];throw new W("Unsupported character: "+e)}},Vo=function(e,t,n){return Be[n][e]&&Be[n][e].replace&&(e=Be[n][e].replace),{value:e,metrics:w0(e,t,n)}},Jt=function(e,t,n,i,s){var o=Vo(e,t,n),a=o.metrics;e=o.value;var l;if(a){var u=a.italic;(n==="text"||i&&i.font==="mathit")&&(u=0),l=new Vt(e,a.height,a.depth,u,a.skew,a.width,s)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+t+"' and mode '"+n+"'")),l=new Vt(e,0,0,0,0,0,s);if(i){l.maxFontSize=i.sizeMultiplier,i.style.isTight()&&l.classes.push("mtight");var c=i.getColor();c&&(l.style.color=c)}return l},V8=function(e,t,n,i){return i===void 0&&(i=[]),n.font==="boldsymbol"&&Vo(e,"Main-Bold",t).metrics?Jt(e,"Main-Bold",t,n,i.concat(["mathbf"])):e==="\\"||Be[t][e].font==="main"?Jt(e,"Main-Regular",t,n,i):Jt(e,"AMS-Regular",t,n,i.concat(["amsrm"]))},q8=function(e,t,n,i,s){return s!=="textord"&&Vo(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},W8=function(e,t,n){var i=e.mode,s=e.text,o=["mord"],a=i==="math"||i==="text"&&t.font,l=a?t.font:t.fontFamily,u="",c="";if(s.charCodeAt(0)===55349&&([u,c]=_8(s,i)),u.length>0)return Jt(s,u,i,t,o.concat(c));if(l){var d,h;if(l==="boldsymbol"){var f=q8(s,i,t,o,n);d=f.fontName,h=[f.fontClass]}else a?(d=Xp[l].fontName,h=[l]):(d=qo(l,t.fontWeight,t.fontShape),h=[l,t.fontWeight,t.fontShape]);if(Vo(s,d,i).metrics)return Jt(s,d,i,t,o.concat(h));if(Vp.hasOwnProperty(s)&&d.slice(0,10)==="Typewriter"){for(var m=[],v=0;v<s.length;v++)m.push(Jt(s[v],d,i,t,o.concat(h)));return Yp(m)}}if(n==="mathord")return Jt(s,"Math-Italic",i,t,o.concat(["mathnormal"]));if(n==="textord"){var y=Be[i][s]&&Be[i][s].font;if(y==="ams"){var w=qo("amsrm",t.fontWeight,t.fontShape);return Jt(s,w,i,t,o.concat("amsrm",t.fontWeight,t.fontShape))}else if(y==="main"||!y){var k=qo("textrm",t.fontWeight,t.fontShape);return Jt(s,k,i,t,o.concat(t.fontWeight,t.fontShape))}else{var E=qo(y,t.fontWeight,t.fontShape);return Jt(s,E,i,t,o.concat(E,t.fontWeight,t.fontShape))}}else throw new Error("unexpected type: "+n+" in makeOrd")},U8=(r,e)=>{if(an(r.classes)!==an(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize)return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var n in r.style)if(r.style.hasOwnProperty(n)&&r.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&r.style[i]!==e.style[i])return!1;return!0},K8=r=>{for(var e=0;e<r.length-1;e++){var t=r[e],n=r[e+1];t instanceof Vt&&n instanceof Vt&&U8(t,n)&&(t.text+=n.text,t.height=Math.max(t.height,n.height),t.depth=Math.max(t.depth,n.depth),t.italic=n.italic,r.splice(e+1,1),e--)}return r},N0=function(e){for(var t=0,n=0,i=0,s=0;s<e.children.length;s++){var o=e.children[s];o.height>t&&(t=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},kt=function(e,t,n,i){var s=new fs(e,t,n,i);return N0(s),s},Jp=(r,e,t,n)=>new fs(r,e,t,n),G8=function(e,t,n){var i=kt([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=U(i.height),i.maxFontSize=1,i},J8=function(e,t,n,i){var s=new k0(e,t,n,i);return N0(s),s},Yp=function(e){var t=new ds(e);return N0(t),t},Y8=function(e,t){return e instanceof ds?kt([],[e],t):e},X8=function(e){if(e.positionType==="individualShift"){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,s=i,o=1;o<t.length;o++){var a=-t[o].shift-s-t[o].elem.depth,l=a-(t[o-1].elem.height+t[o-1].elem.depth);s=s+a,n.push({type:"kern",size:l}),n.push(t[o])}return{children:n,depth:i}}var u;if(e.positionType==="top"){for(var c=e.positionData,d=0;d<e.children.length;d++){var h=e.children[d];c-=h.type==="kern"?h.size:h.elem.height+h.elem.depth}u=c}else if(e.positionType==="bottom")u=-e.positionData;else{var f=e.children[0];if(f.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")u=-f.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")u=-f.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:u}},Z8=function(e,t){for(var{children:n,depth:i}=X8(e),s=0,o=0;o<n.length;o++){var a=n[o];if(a.type==="elem"){var l=a.elem;s=Math.max(s,l.maxFontSize,l.height)}}s+=2;var u=kt(["pstrut"],[]);u.style.height=U(s);for(var c=[],d=i,h=i,f=i,m=0;m<n.length;m++){var v=n[m];if(v.type==="kern")f+=v.size;else{var y=v.elem,w=v.wrapperClasses||[],k=v.wrapperStyle||{},E=kt(w,[u,y],void 0,k);E.style.top=U(-s-f-y.depth),v.marginLeft&&(E.style.marginLeft=v.marginLeft),v.marginRight&&(E.style.marginRight=v.marginRight),c.push(E),f+=y.height+y.depth}d=Math.min(d,f),h=Math.max(h,f)}var I=kt(["vlist"],c);I.style.height=U(h);var A;if(d<0){var N=kt([],[]),P=kt(["vlist"],[N]);P.style.height=U(-d);var L=kt(["vlist-s"],[new Vt("")]);A=[kt(["vlist-r"],[I,L]),kt(["vlist-r"],[P])]}else A=[kt(["vlist-r"],[I])];var z=kt(["vlist-t"],A);return A.length===2&&z.classes.push("vlist-t2"),z.height=h,z.depth=-d,z},Q8=(r,e)=>{var t=kt(["mspace"],[],e),n=_e(r,e);return t.style.marginRight=U(n),t},qo=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var s;return t==="textbf"&&n==="textit"?s="BoldItalic":t==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",i+"-"+s},Xp={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Zp={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},e9=function(e,t){var[n,i,s]=Zp[e],o=new ln(n),a=new Er([o],{width:U(i),height:U(s),style:"width:"+U(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=Jp(["overlay"],[a],t);return l.height=s,l.style.height=U(s),l.style.width=U(i),l},R={fontMap:Xp,makeSymbol:Jt,mathsym:V8,makeSpan:kt,makeSvgSpan:Jp,makeLineSpan:G8,makeAnchor:J8,makeFragment:Yp,wrapFragment:Y8,makeVList:Z8,makeOrd:W8,makeGlue:Q8,staticSvg:e9,svgData:Zp,tryCombineChars:K8},Ve={number:3,unit:"mu"},Pn={number:4,unit:"mu"},Or={number:5,unit:"mu"},t9={mord:{mop:Ve,mbin:Pn,mrel:Or,minner:Ve},mop:{mord:Ve,mop:Ve,mrel:Or,minner:Ve},mbin:{mord:Pn,mop:Pn,mopen:Pn,minner:Pn},mrel:{mord:Or,mop:Or,mopen:Or,minner:Or},mopen:{},mclose:{mop:Ve,mbin:Pn,mrel:Or,minner:Ve},mpunct:{mord:Ve,mop:Ve,mrel:Or,mopen:Ve,mclose:Ve,mpunct:Ve,minner:Ve},minner:{mord:Ve,mop:Ve,mbin:Pn,mrel:Or,mopen:Ve,mpunct:Ve,minner:Ve}},r9={mord:{mop:Ve},mop:{mord:Ve,mop:Ve},mbin:{},mrel:{},mopen:{},mclose:{mop:Ve},mpunct:{},minner:{mop:Ve}},Qp={},Wo={},Uo={};function Q(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=r,a={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},l=0;l<t.length;++l)Qp[t[l]]=a;e&&(s&&(Wo[e]=s),o&&(Uo[e]=o))}function In(r){var{type:e,htmlBuilder:t,mathmlBuilder:n}=r;Q({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:t,mathmlBuilder:n})}var Ko=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},Ge=function(e){return e.type==="ordgroup"?e.body:[e]},Nr=R.makeSpan,n9=["leftmost","mbin","mopen","mrel","mop","mpunct"],i9=["rightmost","mrel","mclose","mpunct"],s9={display:de.DISPLAY,text:de.TEXT,script:de.SCRIPT,scriptscript:de.SCRIPTSCRIPT},o9={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Ze=function(e,t,n,i){i===void 0&&(i=[null,null]);for(var s=[],o=0;o<e.length;o++){var a=Me(e[o],t);if(a instanceof ds){var l=a.children;s.push(...l)}else s.push(a)}if(R.tryCombineChars(s),!n)return s;var u=t;if(e.length===1){var c=e[0];c.type==="sizing"?u=t.havingSize(c.size):c.type==="styling"&&(u=t.havingStyle(s9[c.style]))}var d=Nr([i[0]||"leftmost"],[],t),h=Nr([i[1]||"rightmost"],[],t),f=n==="root";return em(s,(m,v)=>{var y=v.classes[0],w=m.classes[0];y==="mbin"&&i9.includes(w)?v.classes[0]="mord":w==="mbin"&&n9.includes(y)&&(m.classes[0]="mord")},{node:d},h,f),em(s,(m,v)=>{var y=D0(v),w=D0(m),k=y&&w?m.hasClass("mtight")?r9[y][w]:t9[y][w]:null;if(k)return R.makeGlue(k,u)},{node:d},h,f),s},em=function r(e,t,n,i,s){i&&e.push(i);for(var o=0;o<e.length;o++){var a=e[o],l=tm(a);if(l){r(l.children,t,n,null,s);continue}var u=!a.hasClass("mspace");if(u){var c=t(a,n.node);c&&(n.insertAfter?n.insertAfter(c):(e.unshift(c),o++))}u?n.node=a:s&&a.hasClass("newline")&&(n.node=Nr(["leftmost"])),n.insertAfter=(d=>h=>{e.splice(d+1,0,h),o++})(o)}i&&e.pop()},tm=function(e){return e instanceof ds||e instanceof k0||e instanceof fs&&e.hasClass("enclosing")?e:null},a9=function r(e,t){var n=tm(e);if(n){var i=n.children;if(i.length){if(t==="right")return r(i[i.length-1],"right");if(t==="left")return r(i[0],"left")}}return e},D0=function(e,t){return e?(t&&(e=a9(e,t)),o9[e.classes[0]]||null):null},hs=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Nr(t.concat(n))},Me=function(e,t,n){if(!e)return Nr();if(Wo[e.type]){var i=Wo[e.type](e,t);if(n&&t.size!==n.size){i=Nr(t.sizingClasses(n),[i],t);var s=t.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new W("Got group of unknown type: '"+e.type+"'")};function Go(r,e){var t=Nr(["base"],r,e),n=Nr(["strut"]);return n.style.height=U(t.height+t.depth),t.depth&&(n.style.verticalAlign=U(-t.depth)),t.children.unshift(n),t}function P0(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var n=Ze(r,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],o=[],a=0;a<n.length;a++)if(o.push(n[a]),n[a].hasClass("mbin")||n[a].hasClass("mrel")||n[a].hasClass("allowbreak")){for(var l=!1;a<n.length-1&&n[a+1].hasClass("mspace")&&!n[a+1].hasClass("newline");)a++,o.push(n[a]),n[a].hasClass("nobreak")&&(l=!0);l||(s.push(Go(o,e)),o=[])}else n[a].hasClass("newline")&&(o.pop(),o.length>0&&(s.push(Go(o,e)),o=[]),s.push(n[a]));o.length>0&&s.push(Go(o,e));var u;t?(u=Go(Ze(t,e,!0)),u.classes=["tag"],s.push(u)):i&&s.push(i);var c=Nr(["katex-html"],s);if(c.setAttribute("aria-hidden","true"),u){var d=u.children[0];d.style.height=U(c.height+c.depth),c.depth&&(d.style.verticalAlign=U(-c.depth))}return c}function rm(r){return new ds(r)}class Rt{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=an(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof sr&&this.children[n+1]instanceof sr){for(var i=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof sr;)i+=this.children[++n].toText();e.appendChild(new sr(i).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=Ee.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Ee.escape(an(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class sr{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ee.escape(this.toText())}toText(){return this.text}}class l9{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character=" ":e>=-.05556&&e<=-.05555?this.character=" ":e>=-.1667&&e<=-.1666?this.character=" ":e>=-.2223&&e<=-.2222?this.character=" ":e>=-.2778&&e<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",U(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+U(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var V={MathNode:Rt,TextNode:sr,SpaceNode:l9,newDocumentFragment:rm},qt=function(e,t,n){return Be[t][e]&&Be[t][e].replace&&e.charCodeAt(0)!==55349&&!(Vp.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=Be[t][e].replace),new V.TextNode(e)},I0=function(e){return e.length===1?e[0]:new V.MathNode("mrow",e)},R0=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var n=t.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathsfit")return"sans-serif-italic";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var s=e.text;if(["\\imath","\\jmath"].includes(s))return null;Be[i][s]&&Be[i][s].replace&&(s=Be[i][s].replace);var o=R.fontMap[n].fontName;return w0(s,o,i)?R.fontMap[n].variant:null};function z0(r){if(!r)return!1;if(r.type==="mi"&&r.children.length===1){var e=r.children[0];return e instanceof sr&&e.text==="."}else if(r.type==="mo"&&r.children.length===1&&r.getAttribute("separator")==="true"&&r.getAttribute("lspace")==="0em"&&r.getAttribute("rspace")==="0em"){var t=r.children[0];return t instanceof sr&&t.text===","}else return!1}var Tt=function(e,t,n){if(e.length===1){var i=ze(e[0],t);return n&&i instanceof Rt&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],o,a=0;a<e.length;a++){var l=ze(e[a],t);if(l instanceof Rt&&o instanceof Rt){if(l.type==="mtext"&&o.type==="mtext"&&l.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...l.children);continue}else if(l.type==="mn"&&o.type==="mn"){o.children.push(...l.children);continue}else if(z0(l)&&o.type==="mn"){o.children.push(...l.children);continue}else if(l.type==="mn"&&z0(o))l.children=[...o.children,...l.children],s.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(o.type==="mn"||z0(o))){var u=l.children[0];u instanceof Rt&&u.type==="mn"&&(u.children=[...o.children,...u.children],s.pop())}else if(o.type==="mi"&&o.children.length===1){var c=o.children[0];if(c instanceof sr&&c.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof sr&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),o=l}return s},cn=function(e,t,n){return I0(Tt(e,t,n))},ze=function(e,t){if(!e)return new V.MathNode("mrow");if(Uo[e.type]){var n=Uo[e.type](e,t);return n}else throw new W("Got group of unknown type: '"+e.type+"'")};function nm(r,e,t,n,i){var s=Tt(r,t),o;s.length===1&&s[0]instanceof Rt&&["mrow","mtable"].includes(s[0].type)?o=s[0]:o=new V.MathNode("mrow",s);var a=new V.MathNode("annotation",[new V.TextNode(e)]);a.setAttribute("encoding","application/x-tex");var l=new V.MathNode("semantics",[o,a]),u=new V.MathNode("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var c=i?"katex":"katex-mathml";return R.makeSpan([c],[u])}var im=function(e){return new Mr({style:e.displayMode?de.DISPLAY:de.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},sm=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=R.makeSpan(n,[e])}return e},u9=function(e,t,n){var i=im(n),s;if(n.output==="mathml")return nm(e,t,i,n.displayMode,!0);if(n.output==="html"){var o=P0(e,i);s=R.makeSpan(["katex"],[o])}else{var a=nm(e,t,i,n.displayMode,!1),l=P0(e,i);s=R.makeSpan(["katex"],[a,l])}return sm(s,n)},c9=function(e,t,n){var i=im(n),s=P0(e,i),o=R.makeSpan(["katex"],[s]);return sm(o,n)},d9={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},f9=function(e){var t=new V.MathNode("mo",[new V.TextNode(d9[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},h9={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},p9=function(e){return e.type==="ordgroup"?e.body.length:1},m9=function(e,t){function n(){var a=4e5,l=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(l)){var u=e,c=p9(u.base),d,h,f;if(c>5)l==="widehat"||l==="widecheck"?(d=420,a=2364,f=.42,h=l+"4"):(d=312,a=2340,f=.34,h="tilde4");else{var m=[1,1,2,2,3,3][c];l==="widehat"||l==="widecheck"?(a=[0,1062,2364,2364,2364][m],d=[0,239,300,360,420][m],f=[0,.24,.3,.3,.36,.42][m],h=l+m):(a=[0,600,1033,2339,2340][m],d=[0,260,286,306,312][m],f=[0,.26,.286,.3,.306,.34][m],h="tilde"+m)}var v=new ln(h),y=new Er([v],{width:"100%",height:U(f),viewBox:"0 0 "+a+" "+d,preserveAspectRatio:"none"});return{span:R.makeSvgSpan([],[y],t),minWidth:0,height:f}}else{var w=[],k=h9[l],[E,I,A]=k,N=A/1e3,P=E.length,L,z;if(P===1){var F=k[3];L=["hide-tail"],z=[F]}else if(P===2)L=["halfarrow-left","halfarrow-right"],z=["xMinYMin","xMaxYMin"];else if(P===3)L=["brace-left","brace-center","brace-right"],z=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
895
|
+
`+P+" children.");for(var re=0;re<P;re++){var oe=new ln(E[re]),ye=new Er([oe],{width:"400em",height:U(N),viewBox:"0 0 "+a+" "+A,preserveAspectRatio:z[re]+" slice"}),ae=R.makeSvgSpan([L[re]],[ye],t);if(P===1)return{span:ae,minWidth:I,height:N};ae.style.height=U(N),w.push(ae)}return{span:R.makeSpan(["stretchy"],w,t),minWidth:I,height:N}}}var{span:i,minWidth:s,height:o}=n();return i.height=o,i.style.height=U(o),s>0&&(i.style.minWidth=U(s)),i},g9=function(e,t,n,i,s){var o,a=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(o=R.makeSpan(["stretchy",t],[],s),t==="fbox"){var l=s.color&&s.getColor();l&&(o.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new T0({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new T0({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new Er(u,{width:"100%",height:U(a)});o=R.makeSvgSpan([],[c],s)}return o.height=a,o.style.height=U(a),o},Dr={encloseSpan:g9,mathMLnode:f9,svgSpan:m9};function xe(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function L0(r){var e=Jo(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function Jo(r){return r&&(r.type==="atom"||j8.hasOwnProperty(r.type))?r:null}var B0=(r,e)=>{var t,n,i;r&&r.type==="supsub"?(n=xe(r.base,"accent"),t=n.base,r.base=t,i=$8(Me(r,e)),r.base=n):(n=xe(r,"accent"),t=n.base);var s=Me(t,e.havingCrampedStyle()),o=n.isShifty&&Ee.isCharacterBox(t),a=0;if(o){var l=Ee.getBaseElem(t),u=Me(l,e.havingCrampedStyle());a=_p(u).skew}var c=n.label==="\\c",d=c?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),h;if(n.isStretchy)h=Dr.svgSpan(n,e),h=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+U(2*a)+")",marginLeft:U(2*a)}:void 0}]},e);else{var f,m;n.label==="\\vec"?(f=R.staticSvg("vec",e),m=R.svgData.vec[1]):(f=R.makeOrd({mode:n.mode,text:n.label},e,"textord"),f=_p(f),f.italic=0,m=f.width,c&&(d+=f.depth)),h=R.makeSpan(["accent-body"],[f]);var v=n.label==="\\textcircled";v&&(h.classes.push("accent-full"),d=s.height);var y=a;v||(y-=m/2),h.style.left=U(y),n.label==="\\textcircled"&&(h.style.top=".2em"),h=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:h}]},e)}var w=R.makeSpan(["mord","accent"],[h],e);return i?(i.children[0]=w,i.height=Math.max(w.height,i.height),i.classes[0]="mord",i):w},om=(r,e)=>{var t=r.isStretchy?Dr.mathMLnode(r.label):new V.MathNode("mo",[qt(r.label,r.mode)]),n=new V.MathNode("mover",[ze(r.base,e),t]);return n.setAttribute("accent","true"),n},v9=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));Q({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=Ko(e[0]),n=!v9.test(r.funcName),i=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:i,base:t}},htmlBuilder:B0,mathmlBuilder:om}),Q({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:B0,mathmlBuilder:om}),Q({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:i}},htmlBuilder:(r,e)=>{var t=Me(r.base,e),n=Dr.svgSpan(r,e),i=r.label==="\\utilde"?.12:0,s=R.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]},e);return R.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=Dr.mathMLnode(r.label),n=new V.MathNode("munder",[ze(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var Yo=r=>{var e=new V.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};Q({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n,funcName:i}=r;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,n=e.havingStyle(t.sup()),i=R.wrapFragment(Me(r.body,n,e),e),s=r.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var o;r.below&&(n=e.havingStyle(t.sub()),o=R.wrapFragment(Me(r.below,n,e),e),o.classes.push(s+"-arrow-pad"));var a=Dr.svgSpan(r,e),l=-e.fontMetrics().axisHeight+.5*a.height,u=-e.fontMetrics().axisHeight-.5*a.height-.111;(i.depth>.25||r.label==="\\xleftequilibrium")&&(u-=i.depth);var c;if(o){var d=-e.fontMetrics().axisHeight+o.height+.5*a.height+.111;c=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:a,shift:l},{type:"elem",elem:o,shift:d}]},e)}else c=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:a,shift:l}]},e);return c.children[0].children[0].children[1].classes.push("svg-align"),R.makeSpan(["mrel","x-arrow"],[c],e)},mathmlBuilder(r,e){var t=Dr.mathMLnode(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(r.body){var i=Yo(ze(r.body,e));if(r.below){var s=Yo(ze(r.below,e));n=new V.MathNode("munderover",[t,s,i])}else n=new V.MathNode("mover",[t,i])}else if(r.below){var o=Yo(ze(r.below,e));n=new V.MathNode("munder",[t,o])}else n=Yo(),n=new V.MathNode("mover",[t,n]);return n}});var y9=R.makeSpan;function am(r,e){var t=Ze(r.body,e,!0);return y9([r.mclass],t,e)}function lm(r,e){var t,n=Tt(r.body,e);return r.mclass==="minner"?t=new V.MathNode("mpadded",n):r.mclass==="mord"?r.isCharacterBox?(t=n[0],t.type="mi"):t=new V.MathNode("mi",n):(r.isCharacterBox?(t=n[0],t.type="mo"):t=new V.MathNode("mo",n),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}Q({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+n.slice(5),body:Ge(i),isCharacterBox:Ee.isCharacterBox(i)}},htmlBuilder:am,mathmlBuilder:lm});var Xo=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};Q({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:Xo(e[0]),body:Ge(e[1]),isCharacterBox:Ee.isCharacterBox(e[1])}}}),Q({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:n}=r,i=e[1],s=e[0],o;n!=="\\stackrel"?o=Xo(i):o="mrel";var a={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Ge(i)},l={type:"supsub",mode:s.mode,base:a,sup:n==="\\underset"?null:s,sub:n==="\\underset"?s:null};return{type:"mclass",mode:t.mode,mclass:o,body:[l],isCharacterBox:Ee.isCharacterBox(l)}},htmlBuilder:am,mathmlBuilder:lm}),Q({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:Xo(e[0]),body:Ge(e[0])}},htmlBuilder(r,e){var t=Ze(r.body,e,!0),n=R.makeSpan([r.mclass],t,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(r,e){var t=Tt(r.body,e),n=new V.MathNode("mstyle",t);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var b9={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},um=()=>({type:"styling",body:[],mode:"math",style:"display"}),cm=r=>r.type==="textord"&&r.text==="@",w9=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function x9(r,e,t){var n=b9[r];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=t.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},o=t.callFunction("\\Big",[s],[]),a=t.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,o,a]};return t.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function S9(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new W("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var n=[],i=[n],s=0;s<e.length;s++){for(var o=e[s],a=um(),l=0;l<o.length;l++)if(!cm(o[l]))a.body.push(o[l]);else{n.push(a),l+=1;var u=L0(o[l]).text,c=new Array(2);if(c[0]={type:"ordgroup",mode:"math",body:[]},c[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(u)>-1))if("<>AV".indexOf(u)>-1)for(var d=0;d<2;d++){for(var h=!0,f=l+1;f<o.length;f++){if(w9(o[f],u)){h=!1,l=f;break}if(cm(o[f]))throw new W("Missing a "+u+" character to complete a CD arrow.",o[f]);c[d].body.push(o[f])}if(h)throw new W("Missing a "+u+" character to complete a CD arrow.",o[l])}else throw new W('Expected one of "<>AV=|." after @',o[l]);var m=x9(u,c,r),v={type:"styling",body:[m],mode:"math",style:"display"};n.push(v),a=um()}s%2===0?n.push(a):n.shift(),n=[],i.push(n)}r.gullet.endGroup(),r.gullet.endGroup();var y=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:y,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}Q({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"cdlabel",mode:t.mode,side:n.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),n=R.wrapFragment(Me(r.label,t,e),e);return n.classes.push("cd-label-"+r.side),n.style.bottom=U(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(r,e){var t=new V.MathNode("mrow",[ze(r.label,e)]);return t=new V.MathNode("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new V.MathNode("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}}),Q({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=R.wrapFragment(Me(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new V.MathNode("mrow",[ze(r.fragment,e)])}}),Q({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,n=xe(e[0],"ordgroup"),i=n.body,s="",o=0;o<i.length;o++){var a=xe(i[o],"textord");s+=a.text}var l=parseInt(s),u;if(isNaN(l))throw new W("\\@char has non-numeric argument "+s);if(l<0||l>=1114111)throw new W("\\@char with invalid code point "+s);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var dm=(r,e)=>{var t=Ze(r.body,e.withColor(r.color),!1);return R.makeFragment(t)},fm=(r,e)=>{var t=Tt(r.body,e.withColor(r.color)),n=new V.MathNode("mstyle",t);return n.setAttribute("mathcolor",r.color),n};Q({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,n=xe(e[0],"color-token").color,i=e[1];return{type:"color",mode:t.mode,color:n,body:Ge(i)}},htmlBuilder:dm,mathmlBuilder:fm}),Q({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:n}=r,i=xe(e[0],"color-token").color;t.gullet.macros.set("\\current@color",i);var s=t.parseExpression(!0,n);return{type:"color",mode:t.mode,color:i,body:s}},htmlBuilder:dm,mathmlBuilder:fm}),Q({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:n}=r,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&xe(i,"size").value}},htmlBuilder(r,e){var t=R.makeSpan(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=U(_e(r.size,e)))),t},mathmlBuilder(r,e){var t=new V.MathNode("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",U(_e(r.size,e)))),t}});var F0={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},hm=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new W("Expected a control sequence",r);return e},k9=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},pm=(r,e,t,n)=>{var i=r.gullet.macros.get(t.text);i==null&&(t.noexpand=!0,i={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,i,n)};Q({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var n=e.fetch();if(F0[n.text])return(t==="\\global"||t==="\\\\globallong")&&(n.text=F0[n.text]),xe(e.parseFunction(),"internal");throw new W("Invalid token after macro prefix",n)}}),Q({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new W("Expected a control sequence",n);for(var s=0,o,a=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),a[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new W('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new W('Argument number "'+n.text+'" out of order');s++,a.push([])}else{if(n.text==="EOF")throw new W("Expected a macro definition");a[s].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return o&&l.unshift(o),(t==="\\edef"||t==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:a},t===F0[t]),{type:"internal",mode:e.mode}}}),Q({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=hm(e.gullet.popToken());e.gullet.consumeSpaces();var i=k9(e);return pm(e,n,i,t==="\\\\globallet"),{type:"internal",mode:e.mode}}}),Q({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=hm(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return pm(e,n,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var ps=function(e,t,n){var i=Be.math[e]&&Be.math[e].replace,s=w0(i||e,t,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return s},$0=function(e,t,n,i){var s=n.havingBaseStyle(t),o=R.makeSpan(i.concat(s.sizingClasses(n)),[e],n),a=s.sizeMultiplier/n.sizeMultiplier;return o.height*=a,o.depth*=a,o.maxFontSize=s.sizeMultiplier,o},mm=function(e,t,n){var i=t.havingBaseStyle(n),s=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=U(s),e.height-=s,e.depth+=s},T9=function(e,t,n,i,s,o){var a=R.makeSymbol(e,"Main-Regular",s,i),l=$0(a,t,i,o);return n&&mm(l,i,t),l},C9=function(e,t,n,i){return R.makeSymbol(e,"Size"+t+"-Regular",n,i)},gm=function(e,t,n,i,s,o){var a=C9(e,t,s,i),l=$0(R.makeSpan(["delimsizing","size"+t],[a],i),de.TEXT,i,o);return n&&mm(l,i,de.TEXT),l},H0=function(e,t,n){var i;t==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=R.makeSpan(["delimsizinginner",i],[R.makeSpan([],[R.makeSymbol(e,t,n)])]);return{type:"elem",elem:s}},j0=function(e,t,n){var i=ir["Size4-Regular"][e.charCodeAt(0)]?ir["Size4-Regular"][e.charCodeAt(0)][4]:ir["Size1-Regular"][e.charCodeAt(0)][4],s=new ln("inner",N8(e,Math.round(1e3*t))),o=new Er([s],{width:U(i),height:U(t),style:"width:"+U(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=R.makeSvgSpan([],[o],n);return a.height=t,a.style.height=U(t),a.style.width=U(i),{type:"elem",elem:a}},_0=.008,Zo={type:"kern",size:-1*_0},M9=["|","\\lvert","\\rvert","\\vert"],E9=["\\|","\\lVert","\\rVert","\\Vert"],vm=function(e,t,n,i,s,o){var a,l,u,c,d="",h=0;a=u=c=e,l=null;var f="Size1-Regular";e==="\\uparrow"?u=c="⏐":e==="\\Uparrow"?u=c="‖":e==="\\downarrow"?a=u="⏐":e==="\\Downarrow"?a=u="‖":e==="\\updownarrow"?(a="\\uparrow",u="⏐",c="\\downarrow"):e==="\\Updownarrow"?(a="\\Uparrow",u="‖",c="\\Downarrow"):M9.includes(e)?(u="∣",d="vert",h=333):E9.includes(e)?(u="∥",d="doublevert",h=556):e==="["||e==="\\lbrack"?(a="⎡",u="⎢",c="⎣",f="Size4-Regular",d="lbrack",h=667):e==="]"||e==="\\rbrack"?(a="⎤",u="⎥",c="⎦",f="Size4-Regular",d="rbrack",h=667):e==="\\lfloor"||e==="⌊"?(u=a="⎢",c="⎣",f="Size4-Regular",d="lfloor",h=667):e==="\\lceil"||e==="⌈"?(a="⎡",u=c="⎢",f="Size4-Regular",d="lceil",h=667):e==="\\rfloor"||e==="⌋"?(u=a="⎥",c="⎦",f="Size4-Regular",d="rfloor",h=667):e==="\\rceil"||e==="⌉"?(a="⎤",u=c="⎥",f="Size4-Regular",d="rceil",h=667):e==="("||e==="\\lparen"?(a="⎛",u="⎜",c="⎝",f="Size4-Regular",d="lparen",h=875):e===")"||e==="\\rparen"?(a="⎞",u="⎟",c="⎠",f="Size4-Regular",d="rparen",h=875):e==="\\{"||e==="\\lbrace"?(a="⎧",l="⎨",c="⎩",u="⎪",f="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(a="⎫",l="⎬",c="⎭",u="⎪",f="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(a="⎧",c="⎩",u="⎪",f="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(a="⎫",c="⎭",u="⎪",f="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(a="⎧",c="⎭",u="⎪",f="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(a="⎫",c="⎩",u="⎪",f="Size4-Regular");var m=ps(a,f,s),v=m.height+m.depth,y=ps(u,f,s),w=y.height+y.depth,k=ps(c,f,s),E=k.height+k.depth,I=0,A=1;if(l!==null){var N=ps(l,f,s);I=N.height+N.depth,A=2}var P=v+E+I,L=Math.max(0,Math.ceil((t-P)/(A*w))),z=P+L*A*w,F=i.fontMetrics().axisHeight;n&&(F*=i.sizeMultiplier);var re=z/2-F,oe=[];if(d.length>0){var ye=z-v-E,ae=Math.round(z*1e3),G=D8(d,Math.round(ye*1e3)),ee=new ln(d,G),ke=(h/1e3).toFixed(3)+"em",se=(ae/1e3).toFixed(3)+"em",Te=new Er([ee],{width:ke,height:se,viewBox:"0 0 "+h+" "+ae}),C=R.makeSvgSpan([],[Te],i);C.height=ae/1e3,C.style.width=ke,C.style.height=se,oe.push({type:"elem",elem:C})}else{if(oe.push(H0(c,f,s)),oe.push(Zo),l===null){var x=z-v-E+2*_0;oe.push(j0(u,x,i))}else{var D=(z-v-E-I)/2+2*_0;oe.push(j0(u,D,i)),oe.push(Zo),oe.push(H0(l,f,s)),oe.push(Zo),oe.push(j0(u,D,i))}oe.push(Zo),oe.push(H0(a,f,s))}var q=i.havingBaseStyle(de.TEXT),J=R.makeVList({positionType:"bottom",positionData:re,children:oe},q);return $0(R.makeSpan(["delimsizing","mult"],[J],q),de.TEXT,i,o)},V0=80,q0=.08,W0=function(e,t,n,i,s){var o=O8(e,i,n),a=new ln(e,o),l=new Er([a],{width:"400em",height:U(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return R.makeSvgSpan(["hide-tail"],[l],s)},A9=function(e,t){var n=t.havingBaseSizing(),i=xm("\\surd",e*n.sizeMultiplier,wm,n),s=n.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),a,l=0,u=0,c=0,d;return i.type==="small"?(c=1e3+1e3*o+V0,e<1?s=1:e<1.4&&(s=.7),l=(1+o+q0)/s,u=(1+o)/s,a=W0("sqrtMain",l,c,o,t),a.style.minWidth="0.853em",d=.833/s):i.type==="large"?(c=(1e3+V0)*ms[i.size],u=(ms[i.size]+o)/s,l=(ms[i.size]+o+q0)/s,a=W0("sqrtSize"+i.size,l,c,o,t),a.style.minWidth="1.02em",d=1/s):(l=e+o+q0,u=e+o,c=Math.floor(1e3*e+o)+V0,a=W0("sqrtTall",l,c,o,t),a.style.minWidth="0.742em",d=1.056),a.height=u,a.style.height=U(l),{span:a,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*s}},ym=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],O9=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],bm=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],ms=[0,1.2,1.8,2.4,3],N9=function(e,t,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),ym.includes(e)||bm.includes(e))return gm(e,t,!1,n,i,s);if(O9.includes(e))return vm(e,ms[t],!1,n,i,s);throw new W("Illegal delimiter: '"+e+"'")},D9=[{type:"small",style:de.SCRIPTSCRIPT},{type:"small",style:de.SCRIPT},{type:"small",style:de.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],P9=[{type:"small",style:de.SCRIPTSCRIPT},{type:"small",style:de.SCRIPT},{type:"small",style:de.TEXT},{type:"stack"}],wm=[{type:"small",style:de.SCRIPTSCRIPT},{type:"small",style:de.SCRIPT},{type:"small",style:de.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],I9=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},xm=function(e,t,n,i){for(var s=Math.min(2,3-i.style.size),o=s;o<n.length&&n[o].type!=="stack";o++){var a=ps(e,I9(n[o]),"math"),l=a.height+a.depth;if(n[o].type==="small"){var u=i.havingBaseStyle(n[o].style);l*=u.sizeMultiplier}if(l>t)return n[o]}return n[n.length-1]},Sm=function(e,t,n,i,s,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var a;bm.includes(e)?a=D9:ym.includes(e)?a=wm:a=P9;var l=xm(e,t,a,i);return l.type==="small"?T9(e,l.style,n,i,s,o):l.type==="large"?gm(e,l.size,n,i,s,o):vm(e,t,n,i,s,o)},R9=function(e,t,n,i,s,o){var a=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,c=Math.max(t-a,n+a),d=Math.max(c/500*l,2*c-u);return Sm(e,d,!0,i,s,o)},Pr={sqrtImage:A9,sizedDelim:N9,sizeToMaxHeight:ms,customSizedDelim:Sm,leftRightDelim:R9},km={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},z9=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Qo(r,e){var t=Jo(r);if(t&&z9.includes(t.text))return t;throw t?new W("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new W("Invalid delimiter type '"+r.type+"'",r)}Q({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=Qo(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:km[r.funcName].size,mclass:km[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?R.makeSpan([r.mclass]):Pr.sizedDelim(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(qt(r.delim,r.mode));var t=new V.MathNode("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var n=U(Pr.sizeToMaxHeight[r.size]);return t.setAttribute("minsize",n),t.setAttribute("maxsize",n),t}});function Tm(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Q({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new W("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:Qo(e[0],r).text,color:t}}}),Q({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=Qo(e[0],r),n=r.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=xe(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:t.text,right:s.delim,rightColor:s.color}},htmlBuilder:(r,e)=>{Tm(r);for(var t=Ze(r.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,o=0;o<t.length;o++)t[o].isMiddle?s=!0:(n=Math.max(t[o].height,n),i=Math.max(t[o].depth,i));n*=e.sizeMultiplier,i*=e.sizeMultiplier;var a;if(r.left==="."?a=hs(e,["mopen"]):a=Pr.leftRightDelim(r.left,n,i,e,r.mode,["mopen"]),t.unshift(a),s)for(var l=1;l<t.length;l++){var u=t[l],c=u.isMiddle;c&&(t[l]=Pr.leftRightDelim(c.delim,n,i,c.options,r.mode,[]))}var d;if(r.right===".")d=hs(e,["mclose"]);else{var h=r.rightColor?e.withColor(r.rightColor):e;d=Pr.leftRightDelim(r.right,n,i,h,r.mode,["mclose"])}return t.push(d),R.makeSpan(["minner"],t,e)},mathmlBuilder:(r,e)=>{Tm(r);var t=Tt(r.body,e);if(r.left!=="."){var n=new V.MathNode("mo",[qt(r.left,r.mode)]);n.setAttribute("fence","true"),t.unshift(n)}if(r.right!=="."){var i=new V.MathNode("mo",[qt(r.right,r.mode)]);i.setAttribute("fence","true"),r.rightColor&&i.setAttribute("mathcolor",r.rightColor),t.push(i)}return I0(t)}}),Q({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=Qo(e[0],r);if(!r.parser.leftrightDepth)throw new W("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=hs(e,[]);else{t=Pr.sizedDelim(r.delim,1,e,r.mode,[]);var n={delim:r.delim,options:e};t.isMiddle=n}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?qt("|","text"):qt(r.delim,r.mode),n=new V.MathNode("mo",[t]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var U0=(r,e)=>{var t=R.wrapFragment(Me(r.body,e),e),n=r.label.slice(1),i=e.sizeMultiplier,s,o=0,a=Ee.isCharacterBox(r.body);if(n==="sout")s=R.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,o=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=_e({number:.6,unit:"pt"},e),u=_e({number:.35,unit:"ex"},e),c=e.havingBaseSizing();i=i/c.sizeMultiplier;var d=t.height+t.depth+l+u;t.style.paddingLeft=U(d/2+l);var h=Math.floor(1e3*d*i),f=E8(h),m=new Er([new ln("phase",f)],{width:"400em",height:U(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});s=R.makeSvgSpan(["hide-tail"],[m],e),s.style.height=U(d),o=t.depth+l+u}else{/cancel/.test(n)?a||t.classes.push("cancel-pad"):n==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var v=0,y=0,w=0;/box/.test(n)?(w=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),v=e.fontMetrics().fboxsep+(n==="colorbox"?0:w),y=v):n==="angl"?(w=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),v=4*w,y=Math.max(0,.25-t.depth)):(v=a?.2:0,y=v),s=Dr.encloseSpan(t,n,v,y,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=U(w)):n==="angl"&&w!==.049&&(s.style.borderTopWidth=U(w),s.style.borderRightWidth=U(w)),o=t.depth+y,r.backgroundColor&&(s.style.backgroundColor=r.backgroundColor,r.borderColor&&(s.style.borderColor=r.borderColor))}var k;if(r.backgroundColor)k=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:t,shift:0}]},e);else{var E=/cancel|phase/.test(n)?["svg-align"]:[];k=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:E}]},e)}return/cancel/.test(n)&&(k.height=t.height,k.depth=t.depth),/cancel/.test(n)&&!a?R.makeSpan(["mord","cancel-lap"],[k],e):R.makeSpan(["mord"],[k],e)},K0=(r,e)=>{var t=0,n=new V.MathNode(r.label.indexOf("colorbox")>-1?"mpadded":"menclose",[ze(r.body,e)]);switch(r.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*t+"pt"),n.setAttribute("height","+"+2*t+"pt"),n.setAttribute("lspace",t+"pt"),n.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(r.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&n.setAttribute("mathbackground",r.backgroundColor),n};Q({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,s=xe(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:U0,mathmlBuilder:K0}),Q({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,s=xe(e[0],"color-token").color,o=xe(e[1],"color-token").color,a=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:U0,mathmlBuilder:K0}),Q({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}}),Q({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}},htmlBuilder:U0,mathmlBuilder:K0}),Q({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var Cm={};function or(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=r,a={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<t.length;++l)Cm[t[l]]=a;s&&(Wo[e]=s),o&&(Uo[e]=o)}var Mm={};function S(r,e){Mm[r]=e}function Em(r){var e=[];r.consumeSpaces();var t=r.fetch().text;for(t==="\\relax"&&(r.consume(),r.consumeSpaces(),t=r.fetch().text);t==="\\hline"||t==="\\hdashline";)r.consume(),e.push(t==="\\hdashline"),r.consumeSpaces(),t=r.fetch().text;return e}var ea=r=>{var e=r.parser.settings;if(!e.displayMode)throw new W("{"+r.envName+"} can be used only in display mode.")};function G0(r){if(r.indexOf("ed")===-1)return r.indexOf("*")===-1}function dn(r,e,t){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:u,emptySingleRow:c,maxNumCols:d,leqno:h}=e;if(r.gullet.beginGroup(),u||r.gullet.macros.set("\\cr","\\\\\\relax"),!o){var f=r.gullet.expandMacroAsText("\\arraystretch");if(f==null)o=1;else if(o=parseFloat(f),!o||o<0)throw new W("Invalid \\arraystretch: "+f)}r.gullet.beginGroup();var m=[],v=[m],y=[],w=[],k=l!=null?[]:void 0;function E(){l&&r.gullet.macros.set("\\@eqnsw","1",!0)}function I(){k&&(r.gullet.macros.get("\\df@tag")?(k.push(r.subparse([new Pt("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):k.push(!!l&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(E(),w.push(Em(r));;){var A=r.parseExpression(!1,u?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup(),A={type:"ordgroup",mode:r.mode,body:A},t&&(A={type:"styling",mode:r.mode,style:t,body:[A]}),m.push(A);var N=r.fetch().text;if(N==="&"){if(d&&m.length===d){if(u||a)throw new W("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(N==="\\end"){I(),m.length===1&&A.type==="styling"&&A.body[0].body.length===0&&(v.length>1||!c)&&v.pop(),w.length<v.length+1&&w.push([]);break}else if(N==="\\\\"){r.consume();var P=void 0;r.gullet.future().text!==" "&&(P=r.parseSizeGroup(!0)),y.push(P?P.value:null),I(),w.push(Em(r)),m=[],v.push(m),E()}else throw new W("Expected & or \\\\ or \\cr or \\end",r.nextToken)}return r.gullet.endGroup(),r.gullet.endGroup(),{type:"array",mode:r.mode,addJot:i,arraystretch:o,body:v,cols:s,rowGaps:y,hskipBeforeAndAfter:n,hLinesBeforeRow:w,colSeparationType:a,tags:k,leqno:h}}function J0(r){return r.slice(0,1)==="d"?"display":"text"}var ar=function(e,t){var n,i,s=e.body.length,o=e.hLinesBeforeRow,a=0,l=new Array(s),u=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,h=5*d;if(e.colSeparationType&&e.colSeparationType==="small"){var f=t.havingStyle(de.SCRIPT).sizeMultiplier;h=.2778*(f/t.sizeMultiplier)}var m=e.colSeparationType==="CD"?_e({number:3,unit:"ex"},t):12*d,v=3*d,y=e.arraystretch*m,w=.7*y,k=.3*y,E=0;function I(Fr){for(var pr=0;pr<Fr.length;++pr)pr>0&&(E+=.25),u.push({pos:E,isDashed:Fr[pr]})}for(I(o[0]),n=0;n<e.body.length;++n){var A=e.body[n],N=w,P=k;a<A.length&&(a=A.length);var L=new Array(A.length);for(i=0;i<A.length;++i){var z=Me(A[i],t);P<z.depth&&(P=z.depth),N<z.height&&(N=z.height),L[i]=z}var F=e.rowGaps[n],re=0;F&&(re=_e(F,t),re>0&&(re+=k,P<re&&(P=re),re=0)),e.addJot&&(P+=v),L.height=N,L.depth=P,E+=N,L.pos=E,E+=P+re,l[n]=L,I(o[n+1])}var oe=E/2+t.fontMetrics().axisHeight,ye=e.cols||[],ae=[],G,ee,ke=[];if(e.tags&&e.tags.some(Fr=>Fr))for(n=0;n<s;++n){var se=l[n],Te=se.pos-oe,C=e.tags[n],x=void 0;C===!0?x=R.makeSpan(["eqn-num"],[],t):C===!1?x=R.makeSpan([],[],t):x=R.makeSpan([],Ze(C,t,!0),t),x.depth=se.depth,x.height=se.height,ke.push({type:"elem",elem:x,shift:Te})}for(i=0,ee=0;i<a||ee<ye.length;++i,++ee){for(var D=ye[ee]||{},q=!0;D.type==="separator";){if(q||(G=R.makeSpan(["arraycolsep"],[]),G.style.width=U(t.fontMetrics().doubleRuleSep),ae.push(G)),D.separator==="|"||D.separator===":"){var J=D.separator==="|"?"solid":"dashed",he=R.makeSpan(["vertical-separator"],[],t);he.style.height=U(E),he.style.borderRightWidth=U(c),he.style.borderRightStyle=J,he.style.margin="0 "+U(-c/2);var Pe=E-oe;Pe&&(he.style.verticalAlign=U(-Pe)),ae.push(he)}else throw new W("Invalid separator type: "+D.separator);ee++,D=ye[ee]||{},q=!1}if(!(i>=a)){var pe=void 0;(i>0||e.hskipBeforeAndAfter)&&(pe=Ee.deflt(D.pregap,h),pe!==0&&(G=R.makeSpan(["arraycolsep"],[]),G.style.width=U(pe),ae.push(G)));var Fe=[];for(n=0;n<s;++n){var wt=l[n],Qt=wt[i];if(Qt){var Rn=wt.pos-oe;Qt.depth=wt.depth,Qt.height=wt.height,Fe.push({type:"elem",elem:Qt,shift:Rn})}}Fe=R.makeVList({positionType:"individualShift",children:Fe},t),Fe=R.makeSpan(["col-align-"+(D.align||"c")],[Fe]),ae.push(Fe),(i<a-1||e.hskipBeforeAndAfter)&&(pe=Ee.deflt(D.postgap,h),pe!==0&&(G=R.makeSpan(["arraycolsep"],[]),G.style.width=U(pe),ae.push(G)))}}if(l=R.makeSpan(["mtable"],ae),u.length>0){for(var gi=R.makeLineSpan("hline",t,c),Mt=R.makeLineSpan("hdashline",t,c),zn=[{type:"elem",elem:l,shift:0}];u.length>0;){var vi=u.pop(),Br=vi.pos-oe;vi.isDashed?zn.push({type:"elem",elem:Mt,shift:Br}):zn.push({type:"elem",elem:gi,shift:Br})}l=R.makeVList({positionType:"individualShift",children:zn},t)}if(ke.length===0)return R.makeSpan(["mord"],[l],t);var pn=R.makeVList({positionType:"individualShift",children:ke},t);return pn=R.makeSpan(["tag"],[pn],t),R.makeFragment([l,pn])},L9={c:"center ",l:"left ",r:"right "},lr=function(e,t){for(var n=[],i=new V.MathNode("mtd",[],["mtr-glue"]),s=new V.MathNode("mtd",[],["mml-eqn-num"]),o=0;o<e.body.length;o++){for(var a=e.body[o],l=[],u=0;u<a.length;u++)l.push(new V.MathNode("mtd",[ze(a[u],t)]));e.tags&&e.tags[o]&&(l.unshift(i),l.push(i),e.leqno?l.unshift(s):l.push(s)),n.push(new V.MathNode("mtr",l))}var c=new V.MathNode("mtable",n),d=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",U(d));var h="",f="";if(e.cols&&e.cols.length>0){var m=e.cols,v="",y=!1,w=0,k=m.length;m[0].type==="separator"&&(h+="top ",w=1),m[m.length-1].type==="separator"&&(h+="bottom ",k-=1);for(var E=w;E<k;E++)m[E].type==="align"?(f+=L9[m[E].align],y&&(v+="none "),y=!0):m[E].type==="separator"&&y&&(v+=m[E].separator==="|"?"solid ":"dashed ",y=!1);c.setAttribute("columnalign",f.trim()),/[sd]/.test(v)&&c.setAttribute("columnlines",v.trim())}if(e.colSeparationType==="align"){for(var I=e.cols||[],A="",N=1;N<I.length;N++)A+=N%2?"0em ":"1em ";c.setAttribute("columnspacing",A.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?c.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?c.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var P="",L=e.hLinesBeforeRow;h+=L[0].length>0?"left ":"",h+=L[L.length-1].length>0?"right ":"";for(var z=1;z<L.length-1;z++)P+=L[z].length===0?"none ":L[z][0]?"dashed ":"solid ";return/[sd]/.test(P)&&c.setAttribute("rowlines",P.trim()),h!==""&&(c=new V.MathNode("menclose",[c]),c.setAttribute("notation",h.trim())),e.arraystretch&&e.arraystretch<1&&(c=new V.MathNode("mstyle",[c]),c.setAttribute("scriptlevel","1")),c},Am=function(e,t){e.envName.indexOf("ed")===-1&&ea(e);var n=[],i=e.envName.indexOf("at")>-1?"alignat":"align",s=e.envName==="split",o=dn(e.parser,{cols:n,addJot:!0,autoTag:s?void 0:G0(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a,l=0,u={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var c="",d=0;d<t[0].body.length;d++){var h=xe(t[0].body[d],"textord");c+=h.text}a=Number(c),l=a*2}var f=!l;o.body.forEach(function(w){for(var k=1;k<w.length;k+=2){var E=xe(w[k],"styling"),I=xe(E.body[0],"ordgroup");I.body.unshift(u)}if(f)l<w.length&&(l=w.length);else{var A=w.length/2;if(a<A)throw new W("Too many math in a row: "+("expected "+a+", but got "+A),w[0])}});for(var m=0;m<l;++m){var v="r",y=0;m%2===1?v="l":m>0&&f&&(y=1),n[m]={type:"align",align:v,pregap:y,postgap:0}}return o.colSeparationType=f?"align":"alignat",o};or({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=Jo(e[0]),n=t?[e[0]]:xe(e[0],"ordgroup").body,i=n.map(function(o){var a=L0(o),l=a.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new W("Unknown column alignment: "+l,o)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return dn(r.parser,s,J0(r.envName))},htmlBuilder:ar,mathmlBuilder:lr}),or({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var i=r.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),t=i.fetch().text,"lcr".indexOf(t)===-1)throw new W("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:t}]}}var s=dn(r.parser,n,J0(r.envName)),o=Math.max(0,...s.body.map(a=>a.length));return s.cols=new Array(o).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:ar,mathmlBuilder:lr}),or({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=dn(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:ar,mathmlBuilder:lr}),or({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=Jo(e[0]),n=t?[e[0]]:xe(e[0],"ordgroup").body,i=n.map(function(o){var a=L0(o),l=a.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new W("Unknown column alignment: "+l,o)});if(i.length>1)throw new W("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=dn(r.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new W("{subarray} can contain only one column");return s},htmlBuilder:ar,mathmlBuilder:lr}),or({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=dn(r.parser,e,J0(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.indexOf("r")>-1?".":"\\{",right:r.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:ar,mathmlBuilder:lr}),or({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Am,htmlBuilder:ar,mathmlBuilder:lr}),or({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){["gather","gather*"].includes(r.envName)&&ea(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:G0(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return dn(r.parser,e,"display")},htmlBuilder:ar,mathmlBuilder:lr}),or({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Am,htmlBuilder:ar,mathmlBuilder:lr}),or({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){ea(r);var e={autoTag:G0(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return dn(r.parser,e,"display")},htmlBuilder:ar,mathmlBuilder:lr}),or({type:"array",names:["CD"],props:{numArgs:0},handler(r){return ea(r),S9(r.parser)},htmlBuilder:ar,mathmlBuilder:lr}),S("\\nonumber","\\gdef\\@eqnsw{0}"),S("\\notag","\\nonumber"),Q({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new W(r.funcName+" valid only within array environment")}});var Om=Cm;Q({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];if(i.type!=="ordgroup")throw new W("Invalid environment name",i);for(var s="",o=0;o<i.body.length;++o)s+=xe(i.body[o],"textord").text;if(n==="\\begin"){if(!Om.hasOwnProperty(s))throw new W("No such environment: "+s,i);var a=Om[s],{args:l,optArgs:u}=t.parseArguments("\\begin{"+s+"}",a),c={mode:t.mode,envName:s,parser:t},d=a.handler(c,l,u);t.expect("\\end",!1);var h=t.nextToken,f=xe(t.parseFunction(),"environment");if(f.name!==s)throw new W("Mismatch: \\begin{"+s+"} matched by \\end{"+f.name+"}",h);return d}return{type:"environment",mode:t.mode,name:s,nameGroup:i}}});var Nm=(r,e)=>{var t=r.font,n=e.withFont(t);return Me(r.body,n)},Dm=(r,e)=>{var t=r.font,n=e.withFont(t);return ze(r.body,n)},Pm={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Q({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=Ko(e[0]),s=n;return s in Pm&&(s=Pm[s]),{type:"font",mode:t.mode,font:s.slice(1),body:i}},htmlBuilder:Nm,mathmlBuilder:Dm}),Q({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,n=e[0],i=Ee.isCharacterBox(n);return{type:"mclass",mode:t.mode,mclass:Xo(n),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}}),Q({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,breakOnTokenText:i}=r,{mode:s}=t,o=t.parseExpression(!0,i),a="math"+n.slice(1);return{type:"font",mode:s,font:a,body:{type:"ordgroup",mode:t.mode,body:o}}},htmlBuilder:Nm,mathmlBuilder:Dm});var Im=(r,e)=>{var t=e;return r==="display"?t=t.id>=de.SCRIPT.id?t.text():de.DISPLAY:r==="text"&&t.size===de.DISPLAY.size?t=de.TEXT:r==="script"?t=de.SCRIPT:r==="scriptscript"&&(t=de.SCRIPTSCRIPT),t},Y0=(r,e)=>{var t=Im(r.size,e.style),n=t.fracNum(),i=t.fracDen(),s;s=e.havingStyle(n);var o=Me(r.numer,s,e);if(r.continued){var a=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;o.height=o.height<a?a:o.height,o.depth=o.depth<l?l:o.depth}s=e.havingStyle(i);var u=Me(r.denom,s,e),c,d,h;r.hasBarLine?(r.barSize?(d=_e(r.barSize,e),c=R.makeLineSpan("frac-line",e,d)):c=R.makeLineSpan("frac-line",e),d=c.height,h=c.height):(c=null,d=0,h=e.fontMetrics().defaultRuleThickness);var f,m,v;t.size===de.DISPLAY.size||r.size==="display"?(f=e.fontMetrics().num1,d>0?m=3*h:m=7*h,v=e.fontMetrics().denom1):(d>0?(f=e.fontMetrics().num2,m=h):(f=e.fontMetrics().num3,m=3*h),v=e.fontMetrics().denom2);var y;if(c){var k=e.fontMetrics().axisHeight;f-o.depth-(k+.5*d)<m&&(f+=m-(f-o.depth-(k+.5*d))),k-.5*d-(u.height-v)<m&&(v+=m-(k-.5*d-(u.height-v)));var E=-(k-.5*d);y=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:v},{type:"elem",elem:c,shift:E},{type:"elem",elem:o,shift:-f}]},e)}else{var w=f-o.depth-(u.height-v);w<m&&(f+=.5*(m-w),v+=.5*(m-w)),y=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:v},{type:"elem",elem:o,shift:-f}]},e)}s=e.havingStyle(t),y.height*=s.sizeMultiplier/e.sizeMultiplier,y.depth*=s.sizeMultiplier/e.sizeMultiplier;var I;t.size===de.DISPLAY.size?I=e.fontMetrics().delim1:t.size===de.SCRIPTSCRIPT.size?I=e.havingStyle(de.SCRIPT).fontMetrics().delim2:I=e.fontMetrics().delim2;var A,N;return r.leftDelim==null?A=hs(e,["mopen"]):A=Pr.customSizedDelim(r.leftDelim,I,!0,e.havingStyle(t),r.mode,["mopen"]),r.continued?N=R.makeSpan([]):r.rightDelim==null?N=hs(e,["mclose"]):N=Pr.customSizedDelim(r.rightDelim,I,!0,e.havingStyle(t),r.mode,["mclose"]),R.makeSpan(["mord"].concat(s.sizingClasses(e)),[A,R.makeSpan(["mfrac"],[y]),N],e)},X0=(r,e)=>{var t=new V.MathNode("mfrac",[ze(r.numer,e),ze(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var n=_e(r.barSize,e);t.setAttribute("linethickness",U(n))}var i=Im(r.size,e.style);if(i.size!==e.style.size){t=new V.MathNode("mstyle",[t]);var s=i.size===de.DISPLAY.size?"true":"false";t.setAttribute("displaystyle",s),t.setAttribute("scriptlevel","0")}if(r.leftDelim!=null||r.rightDelim!=null){var o=[];if(r.leftDelim!=null){var a=new V.MathNode("mo",[new V.TextNode(r.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(t),r.rightDelim!=null){var l=new V.MathNode("mo",[new V.TextNode(r.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return I0(o)}return t};Q({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1],o,a=null,l=null,u="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,a="(",l=")";break;case"\\\\bracefrac":o=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":u="display";break;case"\\tfrac":case"\\tbinom":u="text";break}return{type:"genfrac",mode:t.mode,continued:!1,numer:i,denom:s,hasBarLine:o,leftDelim:a,rightDelim:l,size:u,barSize:null}},htmlBuilder:Y0,mathmlBuilder:X0}),Q({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1];return{type:"genfrac",mode:t.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),Q({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:n}=r,i;switch(t){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var Rm=["display","text","script","scriptscript"],zm=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};Q({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,n=e[4],i=e[5],s=Ko(e[0]),o=s.type==="atom"&&s.family==="open"?zm(s.text):null,a=Ko(e[1]),l=a.type==="atom"&&a.family==="close"?zm(a.text):null,u=xe(e[2],"size"),c,d=null;u.isBlank?c=!0:(d=u.value,c=d.number>0);var h="auto",f=e[3];if(f.type==="ordgroup"){if(f.body.length>0){var m=xe(f.body[0],"textord");h=Rm[Number(m.text)]}}else f=xe(f,"textord"),h=Rm[Number(f.text)];return{type:"genfrac",mode:t.mode,numer:n,denom:i,continued:!1,hasBarLine:c,barSize:d,leftDelim:o,rightDelim:l,size:h}},htmlBuilder:Y0,mathmlBuilder:X0}),Q({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:n,token:i}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:xe(e[0],"size").value,token:i}}}),Q({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=f8(xe(e[1],"infix").size),o=e[2],a=s.number>0;return{type:"genfrac",mode:t.mode,numer:i,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Y0,mathmlBuilder:X0});var Lm=(r,e)=>{var t=e.style,n,i;r.type==="supsub"?(n=r.sup?Me(r.sup,e.havingStyle(t.sup()),e):Me(r.sub,e.havingStyle(t.sub()),e),i=xe(r.base,"horizBrace")):i=xe(r,"horizBrace");var s=Me(i.base,e.havingBaseStyle(de.DISPLAY)),o=Dr.svgSpan(i,e),a;if(i.isOver?(a=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e),a.children[0].children[0].children[1].classes.push("svg-align")):(a=R.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e),a.children[0].children[0].children[0].classes.push("svg-align")),n){var l=R.makeSpan(["mord",i.isOver?"mover":"munder"],[a],e);i.isOver?a=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):a=R.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return R.makeSpan(["mord",i.isOver?"mover":"munder"],[a],e)},B9=(r,e)=>{var t=Dr.mathMLnode(r.label);return new V.MathNode(r.isOver?"mover":"munder",[ze(r.base,e),t])};Q({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"horizBrace",mode:t.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:Lm,mathmlBuilder:B9}),Q({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[1],i=xe(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:t.mode,href:i,body:Ge(n)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=Ze(r.body,e,!1);return R.makeAnchor(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=cn(r.body,e);return t instanceof Rt||(t=new Rt("mrow",[t])),t.setAttribute("href",r.href),t}}),Q({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=xe(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:n}))return t.formatUnsupportedCmd("\\url");for(var i=[],s=0;s<n.length;s++){var o=n[s];o==="~"&&(o="\\textasciitilde"),i.push({type:"textord",mode:"text",text:o})}var a={type:"text",mode:t.mode,font:"\\texttt",body:i};return{type:"href",mode:t.mode,href:n,body:Ge(a)}}}),Q({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(r,e){var{parser:t}=r;return{type:"hbox",mode:t.mode,body:Ge(e[0])}},htmlBuilder(r,e){var t=Ze(r.body,e,!1);return R.makeFragment(t)},mathmlBuilder(r,e){return new V.MathNode("mrow",Tt(r.body,e))}}),Q({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,token:i}=r,s=xe(e[0],"raw").string,o=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var a,l={};switch(n){case"\\htmlClass":l.class=s,a={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,a={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,a={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var u=s.split(","),c=0;c<u.length;c++){var d=u[c],h=d.indexOf("=");if(h<0)throw new W("\\htmlData key/value '"+d+"' missing equals sign");var f=d.slice(0,h),m=d.slice(h+1);l["data-"+f.trim()]=m}a={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return t.settings.isTrusted(a)?{type:"html",mode:t.mode,attributes:l,body:Ge(o)}:t.formatUnsupportedCmd(n)},htmlBuilder:(r,e)=>{var t=Ze(r.body,e,!1),n=["enclosing"];r.attributes.class&&n.push(...r.attributes.class.trim().split(/\s+/));var i=R.makeSpan(n,t,e);for(var s in r.attributes)s!=="class"&&r.attributes.hasOwnProperty(s)&&i.setAttribute(s,r.attributes[s]);return i},mathmlBuilder:(r,e)=>cn(r.body,e)}),Q({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:Ge(e[0]),mathml:Ge(e[1])}},htmlBuilder:(r,e)=>{var t=Ze(r.html,e,!1);return R.makeFragment(t)},mathmlBuilder:(r,e)=>cn(r.mathml,e)});var Z0=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new W("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!Fp(n))throw new W("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Q({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:n}=r,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(t[0])for(var l=xe(t[0],"raw").string,u=l.split(","),c=0;c<u.length;c++){var d=u[c].split("=");if(d.length===2){var h=d[1].trim();switch(d[0].trim()){case"alt":a=h;break;case"width":i=Z0(h);break;case"height":s=Z0(h);break;case"totalheight":o=Z0(h);break;default:throw new W("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var f=xe(e[0],"url").url;return a===""&&(a=f,a=a.replace(/^.*[\\/]/,""),a=a.substring(0,a.lastIndexOf("."))),n.settings.isTrusted({command:"\\includegraphics",url:f})?{type:"includegraphics",mode:n.mode,alt:a,width:i,height:s,totalheight:o,src:f}:n.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(r,e)=>{var t=_e(r.height,e),n=0;r.totalheight.number>0&&(n=_e(r.totalheight,e)-t);var i=0;r.width.number>0&&(i=_e(r.width,e));var s={height:U(t+n)};i>0&&(s.width=U(i)),n>0&&(s.verticalAlign=U(-n));var o=new B8(r.src,r.alt,s);return o.height=t,o.depth=n,o},mathmlBuilder:(r,e)=>{var t=new V.MathNode("mglyph",[]);t.setAttribute("alt",r.alt);var n=_e(r.height,e),i=0;if(r.totalheight.number>0&&(i=_e(r.totalheight,e)-n,t.setAttribute("valign",U(-i))),t.setAttribute("height",U(n+i)),r.width.number>0){var s=_e(r.width,e);t.setAttribute("width",U(s))}return t.setAttribute("src",r.src),t}}),Q({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=xe(e[0],"size");if(t.settings.strict){var s=n[1]==="m",o=i.value.unit==="mu";s?(o||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):o&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:i.value}},htmlBuilder(r,e){return R.makeGlue(r.dimension,e)},mathmlBuilder(r,e){var t=_e(r.dimension,e);return new V.SpaceNode(t)}}),Q({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"lap",mode:t.mode,alignment:n.slice(5),body:i}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=R.makeSpan([],[Me(r.body,e)]),t=R.makeSpan(["inner"],[t],e)):t=R.makeSpan(["inner"],[Me(r.body,e)]);var n=R.makeSpan(["fix"],[]),i=R.makeSpan([r.alignment],[t,n],e),s=R.makeSpan(["strut"]);return s.style.height=U(i.height+i.depth),i.depth&&(s.style.verticalAlign=U(-i.depth)),i.children.unshift(s),i=R.makeSpan(["thinbox"],[i],e),R.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(r,e)=>{var t=new V.MathNode("mpadded",[ze(r.body,e)]);if(r.alignment!=="rlap"){var n=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",n+"width")}return t.setAttribute("width","0px"),t}}),Q({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:n}=r,i=n.mode;n.switchMode("math");var s=t==="\\("?"\\)":"$",o=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:o}}}),Q({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new W("Mismatched "+r.funcName)}});var Bm=(r,e)=>{switch(e.style.size){case de.DISPLAY.size:return r.display;case de.TEXT.size:return r.text;case de.SCRIPT.size:return r.script;case de.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};Q({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:Ge(e[0]),text:Ge(e[1]),script:Ge(e[2]),scriptscript:Ge(e[3])}},htmlBuilder:(r,e)=>{var t=Bm(r,e),n=Ze(t,e,!1);return R.makeFragment(n)},mathmlBuilder:(r,e)=>{var t=Bm(r,e);return cn(t,e)}});var Fm=(r,e,t,n,i,s,o)=>{r=R.makeSpan([],[r]);var a=t&&Ee.isCharacterBox(t),l,u;if(e){var c=Me(e,n.havingStyle(i.sup()),n);u={elem:c,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-c.depth)}}if(t){var d=Me(t,n.havingStyle(i.sub()),n);l={elem:d,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-d.height)}}var h;if(u&&l){var f=n.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+r.depth+o;h=R.makeVList({positionType:"bottom",positionData:f,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:U(-s)},{type:"kern",size:l.kern},{type:"elem",elem:r},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:U(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(l){var m=r.height-o;h=R.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:U(-s)},{type:"kern",size:l.kern},{type:"elem",elem:r}]},n)}else if(u){var v=r.depth+o;h=R.makeVList({positionType:"bottom",positionData:v,children:[{type:"elem",elem:r},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:U(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return r;var y=[h];if(l&&s!==0&&!a){var w=R.makeSpan(["mspace"],[],n);w.style.marginRight=U(s),y.unshift(w)}return R.makeSpan(["mop","op-limits"],y,n)},$m=["\\smallint"],li=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=xe(r.base,"op"),i=!0):s=xe(r,"op");var o=e.style,a=!1;o.size===de.DISPLAY.size&&s.symbol&&!$m.includes(s.name)&&(a=!0);var l;if(s.symbol){var u=a?"Size2-Regular":"Size1-Regular",c="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(c=s.name.slice(1),s.name=c==="oiint"?"\\iint":"\\iiint"),l=R.makeSymbol(s.name,u,"math",e,["mop","op-symbol",a?"large-op":"small-op"]),c.length>0){var d=l.italic,h=R.staticSvg(c+"Size"+(a?"2":"1"),e);l=R.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:h,shift:a?.08:0}]},e),s.name="\\"+c,l.classes.unshift("mop"),l.italic=d}}else if(s.body){var f=Ze(s.body,e,!0);f.length===1&&f[0]instanceof Vt?(l=f[0],l.classes[0]="mop"):l=R.makeSpan(["mop"],f,e)}else{for(var m=[],v=1;v<s.name.length;v++)m.push(R.mathsym(s.name[v],s.mode,e));l=R.makeSpan(["mop"],m,e)}var y=0,w=0;return(l instanceof Vt||s.name==="\\oiint"||s.name==="\\oiiint")&&!s.suppressBaseShift&&(y=(l.height-l.depth)/2-e.fontMetrics().axisHeight,w=l.italic),i?Fm(l,t,n,e,o,w,y):(y&&(l.style.position="relative",l.style.top=U(y)),l)},gs=(r,e)=>{var t;if(r.symbol)t=new Rt("mo",[qt(r.name,r.mode)]),$m.includes(r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new Rt("mo",Tt(r.body,e));else{t=new Rt("mi",[new sr(r.name.slice(1))]);var n=new Rt("mo",[qt("","text")]);r.parentIsSupSub?t=new Rt("mrow",[t,n]):t=rm([t,n])}return t},F9={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Q({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=n;return i.length===1&&(i=F9[i]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:li,mathmlBuilder:gs}),Q({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ge(n)}},htmlBuilder:li,mathmlBuilder:gs});var $9={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Q({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:li,mathmlBuilder:gs}),Q({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:li,mathmlBuilder:gs}),Q({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(r){var{parser:e,funcName:t}=r,n=t;return n.length===1&&(n=$9[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:li,mathmlBuilder:gs});var Hm=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=xe(r.base,"operatorname"),i=!0):s=xe(r,"operatorname");var o;if(s.body.length>0){for(var a=s.body.map(d=>{var h=d.text;return typeof h=="string"?{type:"textord",mode:d.mode,text:h}:d}),l=Ze(a,e.withFont("mathrm"),!0),u=0;u<l.length;u++){var c=l[u];c instanceof Vt&&(c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=R.makeSpan(["mop"],l,e)}else o=R.makeSpan(["mop"],[],e);return i?Fm(o,t,n,e,e.style,0,0):o},H9=(r,e)=>{for(var t=Tt(r.body,e.withFont("mathrm")),n=!0,i=0;i<t.length;i++){var s=t[i];if(!(s instanceof V.SpaceNode))if(s instanceof V.MathNode)switch(s.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var o=s.children[0];s.children.length===1&&o instanceof V.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break}default:n=!1}else n=!1}if(n){var a=t.map(c=>c.toText()).join("");t=[new V.TextNode(a)]}var l=new V.MathNode("mi",t);l.setAttribute("mathvariant","normal");var u=new V.MathNode("mo",[qt("","text")]);return r.parentIsSupSub?new V.MathNode("mrow",[l,u]):V.newDocumentFragment([l,u])};Q({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"operatorname",mode:t.mode,body:Ge(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Hm,mathmlBuilder:H9}),S("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),In({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?R.makeFragment(Ze(r.body,e,!1)):R.makeSpan(["mord"],Ze(r.body,e,!0),e)},mathmlBuilder(r,e){return cn(r.body,e,!0)}}),Q({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,n=e[0];return{type:"overline",mode:t.mode,body:n}},htmlBuilder(r,e){var t=Me(r.body,e.havingCrampedStyle()),n=R.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return R.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(r,e){var t=new V.MathNode("mo",[new V.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new V.MathNode("mover",[ze(r.body,e),t]);return n.setAttribute("accent","true"),n}}),Q({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"phantom",mode:t.mode,body:Ge(n)}},htmlBuilder:(r,e)=>{var t=Ze(r.body,e.withPhantom(),!1);return R.makeFragment(t)},mathmlBuilder:(r,e)=>{var t=Tt(r.body,e);return new V.MathNode("mphantom",t)}}),Q({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"hphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=R.makeSpan([],[Me(r.body,e.withPhantom())]);if(t.height=0,t.depth=0,t.children)for(var n=0;n<t.children.length;n++)t.children[n].height=0,t.children[n].depth=0;return t=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e),R.makeSpan(["mord"],[t],e)},mathmlBuilder:(r,e)=>{var t=Tt(Ge(r.body),e),n=new V.MathNode("mphantom",t),i=new V.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),Q({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"vphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=R.makeSpan(["inner"],[Me(r.body,e.withPhantom())]),n=R.makeSpan(["fix"],[]);return R.makeSpan(["mord","rlap"],[t,n],e)},mathmlBuilder:(r,e)=>{var t=Tt(Ge(r.body),e),n=new V.MathNode("mphantom",t),i=new V.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}}),Q({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,n=xe(e[0],"size").value,i=e[1];return{type:"raisebox",mode:t.mode,dy:n,body:i}},htmlBuilder(r,e){var t=Me(r.body,e),n=_e(r.dy,e);return R.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){var t=new V.MathNode("mpadded",[ze(r.body,e)]),n=r.dy.number+r.dy.unit;return t.setAttribute("voffset",n),t}}),Q({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}}),Q({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(r,e,t){var{parser:n}=r,i=t[0],s=xe(e[0],"size"),o=xe(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&xe(i,"size").value,width:s.value,height:o.value}},htmlBuilder(r,e){var t=R.makeSpan(["mord","rule"],[],e),n=_e(r.width,e),i=_e(r.height,e),s=r.shift?_e(r.shift,e):0;return t.style.borderRightWidth=U(n),t.style.borderTopWidth=U(i),t.style.bottom=U(s),t.width=n,t.height=i+s,t.depth=-s,t.maxFontSize=i*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=_e(r.width,e),n=_e(r.height,e),i=r.shift?_e(r.shift,e):0,s=e.color&&e.getColor()||"black",o=new V.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",U(t)),o.setAttribute("height",U(n));var a=new V.MathNode("mpadded",[o]);return i>=0?a.setAttribute("height",U(i)):(a.setAttribute("height",U(i)),a.setAttribute("depth",U(-i))),a.setAttribute("voffset",U(i)),a}});function jm(r,e,t){for(var n=Ze(r,e,!1),i=e.sizeMultiplier/t.sizeMultiplier,s=0;s<n.length;s++){var o=n[s].classes.indexOf("sizing");o<0?Array.prototype.push.apply(n[s].classes,e.sizingClasses(t)):n[s].classes[o+1]==="reset-size"+e.size&&(n[s].classes[o+1]="reset-size"+t.size),n[s].height*=i,n[s].depth*=i}return R.makeFragment(n)}var _m=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],j9=(r,e)=>{var t=e.havingSize(r.size);return jm(r.body,t,e)};Q({type:"sizing",names:_m,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!1,t);return{type:"sizing",mode:i.mode,size:_m.indexOf(n)+1,body:s}},htmlBuilder:j9,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),n=Tt(r.body,t),i=new V.MathNode("mstyle",n);return i.setAttribute("mathsize",U(t.sizeMultiplier)),i}}),Q({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:n}=r,i=!1,s=!1,o=t[0]&&xe(t[0],"ordgroup");if(o)for(var a="",l=0;l<o.body.length;++l){var u=o.body[l];if(a=u.text,a==="t")i=!0;else if(a==="b")s=!0;else{i=!1,s=!1;break}}else i=!0,s=!0;var c=e[0];return{type:"smash",mode:n.mode,body:c,smashHeight:i,smashDepth:s}},htmlBuilder:(r,e)=>{var t=R.makeSpan([],[Me(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0,t.children))for(var n=0;n<t.children.length;n++)t.children[n].height=0;if(r.smashDepth&&(t.depth=0,t.children))for(var i=0;i<t.children.length;i++)t.children[i].depth=0;var s=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e);return R.makeSpan(["mord"],[s],e)},mathmlBuilder:(r,e)=>{var t=new V.MathNode("mpadded",[ze(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}}),Q({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n}=r,i=t[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(r,e){var t=Me(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=R.wrapFragment(t,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.id<de.TEXT.id&&(s=e.fontMetrics().xHeight);var o=i+s/4,a=t.height+t.depth+o+i,{span:l,ruleWidth:u,advanceWidth:c}=Pr.sqrtImage(a,e),d=l.height-u;d>t.height+t.depth+o&&(o=(o+d-t.height-t.depth)/2);var h=l.height-t.height-o-u;t.style.paddingLeft=U(c);var f=R.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+h)},{type:"elem",elem:l},{type:"kern",size:u}]},e);if(r.index){var m=e.havingStyle(de.SCRIPTSCRIPT),v=Me(r.index,m,e),y=.6*(f.height-f.depth),w=R.makeVList({positionType:"shift",positionData:-y,children:[{type:"elem",elem:v}]},e),k=R.makeSpan(["root"],[w]);return R.makeSpan(["mord","sqrt"],[k,f],e)}else return R.makeSpan(["mord","sqrt"],[f],e)},mathmlBuilder(r,e){var{body:t,index:n}=r;return n?new V.MathNode("mroot",[ze(t,e),ze(n,e)]):new V.MathNode("msqrt",[ze(t,e)])}});var Vm={display:de.DISPLAY,text:de.TEXT,script:de.SCRIPT,scriptscript:de.SCRIPTSCRIPT};Q({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!0,t),o=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(r,e){var t=Vm[r.style],n=e.havingStyle(t).withFont("");return jm(r.body,n,e)},mathmlBuilder(r,e){var t=Vm[r.style],n=e.havingStyle(t),i=Tt(r.body,n),s=new V.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},a=o[r.style];return s.setAttribute("scriptlevel",a[0]),s.setAttribute("displaystyle",a[1]),s}});var _9=function(e,t){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(t.style.size===de.DISPLAY.size||n.alwaysHandleSupSub);return i?li:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(t.style.size===de.DISPLAY.size||n.limits);return s?Hm:null}else{if(n.type==="accent")return Ee.isCharacterBox(n.base)?B0:null;if(n.type==="horizBrace"){var o=!e.sub;return o===n.isOver?Lm:null}else return null}else return null};In({type:"supsub",htmlBuilder(r,e){var t=_9(r,e);if(t)return t(r,e);var{base:n,sup:i,sub:s}=r,o=Me(n,e),a,l,u=e.fontMetrics(),c=0,d=0,h=n&&Ee.isCharacterBox(n);if(i){var f=e.havingStyle(e.style.sup());a=Me(i,f,e),h||(c=o.height-f.fontMetrics().supDrop*f.sizeMultiplier/e.sizeMultiplier)}if(s){var m=e.havingStyle(e.style.sub());l=Me(s,m,e),h||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/e.sizeMultiplier)}var v;e.style===de.DISPLAY?v=u.sup1:e.style.cramped?v=u.sup3:v=u.sup2;var y=e.sizeMultiplier,w=U(.5/u.ptPerEm/y),k=null;if(l){var E=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(o instanceof Vt||E)&&(k=U(-o.italic))}var I;if(a&&l){c=Math.max(c,v,a.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var A=u.defaultRuleThickness,N=4*A;if(c-a.depth-(l.height-d)<N){d=N-(c-a.depth)+l.height;var P=.8*u.xHeight-(c-a.depth);P>0&&(c+=P,d-=P)}var L=[{type:"elem",elem:l,shift:d,marginRight:w,marginLeft:k},{type:"elem",elem:a,shift:-c,marginRight:w}];I=R.makeVList({positionType:"individualShift",children:L},e)}else if(l){d=Math.max(d,u.sub1,l.height-.8*u.xHeight);var z=[{type:"elem",elem:l,marginLeft:k,marginRight:w}];I=R.makeVList({positionType:"shift",positionData:d,children:z},e)}else if(a)c=Math.max(c,v,a.depth+.25*u.xHeight),I=R.makeVList({positionType:"shift",positionData:-c,children:[{type:"elem",elem:a,marginRight:w}]},e);else throw new Error("supsub must have either sup or sub.");var F=D0(o,"right")||"mord";return R.makeSpan([F],[o,R.makeSpan(["msupsub"],[I])],e)},mathmlBuilder(r,e){var t=!1,n,i;r.base&&r.base.type==="horizBrace"&&(i=!!r.sup,i===r.base.isOver&&(t=!0,n=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var s=[ze(r.base,e)];r.sub&&s.push(ze(r.sub,e)),r.sup&&s.push(ze(r.sup,e));var o;if(t)o=n?"mover":"munder";else if(r.sub)if(r.sup){var u=r.base;u&&u.type==="op"&&u.limits&&e.style===de.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===de.DISPLAY||u.limits)?o="munderover":o="msubsup"}else{var l=r.base;l&&l.type==="op"&&l.limits&&(e.style===de.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===de.DISPLAY)?o="munder":o="msub"}else{var a=r.base;a&&a.type==="op"&&a.limits&&(e.style===de.DISPLAY||a.alwaysHandleSupSub)||a&&a.type==="operatorname"&&a.alwaysHandleSupSub&&(a.limits||e.style===de.DISPLAY)?o="mover":o="msup"}return new V.MathNode(o,s)}}),In({type:"atom",htmlBuilder(r,e){return R.mathsym(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new V.MathNode("mo",[qt(r.text,r.mode)]);if(r.family==="bin"){var n=R0(r,e);n==="bold-italic"&&t.setAttribute("mathvariant",n)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var qm={mi:"italic",mn:"normal",mtext:"normal"};In({type:"mathord",htmlBuilder(r,e){return R.makeOrd(r,e,"mathord")},mathmlBuilder(r,e){var t=new V.MathNode("mi",[qt(r.text,r.mode,e)]),n=R0(r,e)||"italic";return n!==qm[t.type]&&t.setAttribute("mathvariant",n),t}}),In({type:"textord",htmlBuilder(r,e){return R.makeOrd(r,e,"textord")},mathmlBuilder(r,e){var t=qt(r.text,r.mode,e),n=R0(r,e)||"normal",i;return r.mode==="text"?i=new V.MathNode("mtext",[t]):/[0-9]/.test(r.text)?i=new V.MathNode("mn",[t]):r.text==="\\prime"?i=new V.MathNode("mo",[t]):i=new V.MathNode("mi",[t]),n!==qm[i.type]&&i.setAttribute("mathvariant",n),i}});var Q0={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},eu={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};In({type:"spacing",htmlBuilder(r,e){if(eu.hasOwnProperty(r.text)){var t=eu[r.text].className||"";if(r.mode==="text"){var n=R.makeOrd(r,e,"textord");return n.classes.push(t),n}else return R.makeSpan(["mspace",t],[R.mathsym(r.text,r.mode,e)],e)}else{if(Q0.hasOwnProperty(r.text))return R.makeSpan(["mspace",Q0[r.text]],[],e);throw new W('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(eu.hasOwnProperty(r.text))t=new V.MathNode("mtext",[new V.TextNode(" ")]);else{if(Q0.hasOwnProperty(r.text))return new V.MathNode("mspace");throw new W('Unknown type of space "'+r.text+'"')}return t}});var Wm=()=>{var r=new V.MathNode("mtd",[]);return r.setAttribute("width","50%"),r};In({type:"tag",mathmlBuilder(r,e){var t=new V.MathNode("mtable",[new V.MathNode("mtr",[Wm(),new V.MathNode("mtd",[cn(r.body,e)]),Wm(),new V.MathNode("mtd",[cn(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var Um={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Km={"\\textbf":"textbf","\\textmd":"textmd"},V9={"\\textit":"textit","\\textup":"textup"},Gm=(r,e)=>{var t=r.font;if(t){if(Um[t])return e.withTextFontFamily(Um[t]);if(Km[t])return e.withTextFontWeight(Km[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(V9[t])};Q({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"text",mode:t.mode,body:Ge(i),font:n}},htmlBuilder(r,e){var t=Gm(r,e),n=Ze(r.body,t,!0);return R.makeSpan(["mord","text"],n,t)},mathmlBuilder(r,e){var t=Gm(r,e);return cn(r.body,t)}}),Q({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=Me(r.body,e),n=R.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=R.makeVList({positionType:"top",positionData:t.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:t}]},e);return R.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(r,e){var t=new V.MathNode("mo",[new V.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new V.MathNode("munder",[ze(r.body,e),t]);return n.setAttribute("accentunder","true"),n}}),Q({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=Me(r.body,e),n=e.fontMetrics().axisHeight,i=.5*(t.height-n-(t.depth+n));return R.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){return new V.MathNode("mpadded",[ze(r.body,e)],["vcenter"])}}),Q({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new W("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=Jm(r),n=[],i=e.havingStyle(e.style.text()),s=0;s<t.length;s++){var o=t[s];o==="~"&&(o="\\textasciitilde"),n.push(R.makeSymbol(o,"Typewriter-Regular",r.mode,i,["mord","texttt"]))}return R.makeSpan(["mord","text"].concat(i.sizingClasses(e)),R.tryCombineChars(n),i)},mathmlBuilder(r,e){var t=new V.TextNode(Jm(r)),n=new V.MathNode("mtext",[t]);return n.setAttribute("mathvariant","monospace"),n}});var Jm=r=>r.body.replace(/ /g,r.star?"␣":" "),fn=Qp,Ym=`[ \r
|
|
896
|
+
]`,q9="\\\\[a-zA-Z@]+",W9="\\\\[^\uD800-\uDFFF]",U9="("+q9+")"+Ym+"*",K9=`\\\\(
|
|
863
897
|
|[ \r ]+
|
|
864
|
-
?)[ \r ]*`,
|
|
865
|
-
`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new Tt(i,new gt(this,t,this.tokenRegex.lastIndex))}}class y8{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new _("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var b8=kp;S("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),S("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}}),S("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}}),S("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}}),S("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),S("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),S("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Jp={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};S("\\char",function(r){var e=r.popToken(),t,n="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new _("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=Jp[e.text],n==null||n>=t)throw new _("Invalid base-"+t+" digit "+e.text);for(var i;(i=Jp[r.future().text])!=null&&i<t;)n*=t,n+=i,r.popToken()}return"\\@char{"+n+"}"});var c0=(r,e,t,n)=>{var i=r.consumeArg().tokens;if(i.length!==1)throw new _("\\newcommand's first argument must be a macro name");var s=i[0].text,o=r.isDefined(s);if(o&&!e)throw new _("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!o&&!t)throw new _("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(i=r.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=r.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=r.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new _("Invalid number of arguments: "+l);a=parseInt(l),i=r.consumeArg().tokens}return o&&n||r.macros.set(s,{tokens:i,numArgs:a}),""};S("\\newcommand",r=>c0(r,!1,!0,!1)),S("\\renewcommand",r=>c0(r,!0,!1,!1)),S("\\providecommand",r=>c0(r,!0,!0,!0)),S("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""}),S("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""}),S("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),Zr[t],Ne.math[t],Ne.text[t]),""}),S("\\bgroup","{"),S("\\egroup","}"),S("~","\\nobreakspace"),S("\\lq","`"),S("\\rq","'"),S("\\aa","\\r a"),S("\\AA","\\r A"),S("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),S("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),S("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),S("ℬ","\\mathscr{B}"),S("ℰ","\\mathscr{E}"),S("ℱ","\\mathscr{F}"),S("ℋ","\\mathscr{H}"),S("ℐ","\\mathscr{I}"),S("ℒ","\\mathscr{L}"),S("ℳ","\\mathscr{M}"),S("ℛ","\\mathscr{R}"),S("ℭ","\\mathfrak{C}"),S("ℌ","\\mathfrak{H}"),S("ℨ","\\mathfrak{Z}"),S("\\Bbbk","\\Bbb{k}"),S("·","\\cdotp"),S("\\llap","\\mathllap{\\textrm{#1}}"),S("\\rlap","\\mathrlap{\\textrm{#1}}"),S("\\clap","\\mathclap{\\textrm{#1}}"),S("\\mathstrut","\\vphantom{(}"),S("\\underbar","\\underline{\\text{#1}}"),S("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),S("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),S("\\ne","\\neq"),S("≠","\\neq"),S("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),S("∉","\\notin"),S("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),S("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),S("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),S("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),S("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),S("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),S("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),S("⟂","\\perp"),S("‼","\\mathclose{!\\mkern-0.8mu!}"),S("∌","\\notni"),S("⌜","\\ulcorner"),S("⌝","\\urcorner"),S("⌞","\\llcorner"),S("⌟","\\lrcorner"),S("©","\\copyright"),S("®","\\textregistered"),S("️","\\textregistered"),S("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),S("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),S("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),S("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),S("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),S("⋮","\\vdots"),S("\\varGamma","\\mathit{\\Gamma}"),S("\\varDelta","\\mathit{\\Delta}"),S("\\varTheta","\\mathit{\\Theta}"),S("\\varLambda","\\mathit{\\Lambda}"),S("\\varXi","\\mathit{\\Xi}"),S("\\varPi","\\mathit{\\Pi}"),S("\\varSigma","\\mathit{\\Sigma}"),S("\\varUpsilon","\\mathit{\\Upsilon}"),S("\\varPhi","\\mathit{\\Phi}"),S("\\varPsi","\\mathit{\\Psi}"),S("\\varOmega","\\mathit{\\Omega}"),S("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),S("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),S("\\boxed","\\fbox{$\\displaystyle{#1}$}"),S("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),S("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),S("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),S("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),S("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Yp={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};S("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in Yp?e=Yp[t]:(t.slice(0,4)==="\\not"||t in Ne.math&&["bin","rel"].includes(Ne.math[t].group))&&(e="\\dotsb"),e});var d0={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};S("\\dotso",function(r){var e=r.future().text;return e in d0?"\\ldots\\,":"\\ldots"}),S("\\dotsc",function(r){var e=r.future().text;return e in d0&&e!==","?"\\ldots\\,":"\\ldots"}),S("\\cdots",function(r){var e=r.future().text;return e in d0?"\\@cdots\\,":"\\@cdots"}),S("\\dotsb","\\cdots"),S("\\dotsm","\\cdots"),S("\\dotsi","\\!\\cdots"),S("\\dotsx","\\ldots\\,"),S("\\DOTSI","\\relax"),S("\\DOTSB","\\relax"),S("\\DOTSX","\\relax"),S("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),S("\\,","\\tmspace+{3mu}{.1667em}"),S("\\thinspace","\\,"),S("\\>","\\mskip{4mu}"),S("\\:","\\tmspace+{4mu}{.2222em}"),S("\\medspace","\\:"),S("\\;","\\tmspace+{5mu}{.2777em}"),S("\\thickspace","\\;"),S("\\!","\\tmspace-{3mu}{.1667em}"),S("\\negthinspace","\\!"),S("\\negmedspace","\\tmspace-{4mu}{.2222em}"),S("\\negthickspace","\\tmspace-{5mu}{.277em}"),S("\\enspace","\\kern.5em "),S("\\enskip","\\hskip.5em\\relax"),S("\\quad","\\hskip1em\\relax"),S("\\qquad","\\hskip2em\\relax"),S("\\tag","\\@ifstar\\tag@literal\\tag@paren"),S("\\tag@paren","\\tag@literal{({#1})}"),S("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new _("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),S("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),S("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),S("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),S("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),S("\\newline","\\\\\\relax"),S("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Xp=q(Yt["Main-Regular"][84][1]-.7*Yt["Main-Regular"][65][1]);S("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Xp+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),S("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Xp+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),S("\\hspace","\\@ifstar\\@hspacer\\@hspace"),S("\\@hspace","\\hskip #1\\relax"),S("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),S("\\ordinarycolon",":"),S("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),S("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),S("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),S("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),S("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),S("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),S("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),S("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),S("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),S("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),S("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),S("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),S("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),S("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),S("∷","\\dblcolon"),S("∹","\\eqcolon"),S("≔","\\coloneqq"),S("≕","\\eqqcolon"),S("⩴","\\Coloneqq"),S("\\ratio","\\vcentcolon"),S("\\coloncolon","\\dblcolon"),S("\\colonequals","\\coloneqq"),S("\\coloncolonequals","\\Coloneqq"),S("\\equalscolon","\\eqqcolon"),S("\\equalscoloncolon","\\Eqqcolon"),S("\\colonminus","\\coloneq"),S("\\coloncolonminus","\\Coloneq"),S("\\minuscolon","\\eqcolon"),S("\\minuscoloncolon","\\Eqcolon"),S("\\coloncolonapprox","\\Colonapprox"),S("\\coloncolonsim","\\Colonsim"),S("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),S("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),S("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),S("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),S("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),S("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),S("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),S("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),S("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),S("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),S("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),S("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),S("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),S("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),S("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),S("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),S("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),S("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),S("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),S("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),S("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),S("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),S("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),S("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),S("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),S("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),S("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),S("\\imath","\\html@mathml{\\@imath}{ı}"),S("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),S("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),S("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),S("⟦","\\llbracket"),S("⟧","\\rrbracket"),S("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),S("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),S("⦃","\\lBrace"),S("⦄","\\rBrace"),S("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),S("⦵","\\minuso"),S("\\darr","\\downarrow"),S("\\dArr","\\Downarrow"),S("\\Darr","\\Downarrow"),S("\\lang","\\langle"),S("\\rang","\\rangle"),S("\\uarr","\\uparrow"),S("\\uArr","\\Uparrow"),S("\\Uarr","\\Uparrow"),S("\\N","\\mathbb{N}"),S("\\R","\\mathbb{R}"),S("\\Z","\\mathbb{Z}"),S("\\alef","\\aleph"),S("\\alefsym","\\aleph"),S("\\Alpha","\\mathrm{A}"),S("\\Beta","\\mathrm{B}"),S("\\bull","\\bullet"),S("\\Chi","\\mathrm{X}"),S("\\clubs","\\clubsuit"),S("\\cnums","\\mathbb{C}"),S("\\Complex","\\mathbb{C}"),S("\\Dagger","\\ddagger"),S("\\diamonds","\\diamondsuit"),S("\\empty","\\emptyset"),S("\\Epsilon","\\mathrm{E}"),S("\\Eta","\\mathrm{H}"),S("\\exist","\\exists"),S("\\harr","\\leftrightarrow"),S("\\hArr","\\Leftrightarrow"),S("\\Harr","\\Leftrightarrow"),S("\\hearts","\\heartsuit"),S("\\image","\\Im"),S("\\infin","\\infty"),S("\\Iota","\\mathrm{I}"),S("\\isin","\\in"),S("\\Kappa","\\mathrm{K}"),S("\\larr","\\leftarrow"),S("\\lArr","\\Leftarrow"),S("\\Larr","\\Leftarrow"),S("\\lrarr","\\leftrightarrow"),S("\\lrArr","\\Leftrightarrow"),S("\\Lrarr","\\Leftrightarrow"),S("\\Mu","\\mathrm{M}"),S("\\natnums","\\mathbb{N}"),S("\\Nu","\\mathrm{N}"),S("\\Omicron","\\mathrm{O}"),S("\\plusmn","\\pm"),S("\\rarr","\\rightarrow"),S("\\rArr","\\Rightarrow"),S("\\Rarr","\\Rightarrow"),S("\\real","\\Re"),S("\\reals","\\mathbb{R}"),S("\\Reals","\\mathbb{R}"),S("\\Rho","\\mathrm{P}"),S("\\sdot","\\cdot"),S("\\sect","\\S"),S("\\spades","\\spadesuit"),S("\\sub","\\subset"),S("\\sube","\\subseteq"),S("\\supe","\\supseteq"),S("\\Tau","\\mathrm{T}"),S("\\thetasym","\\vartheta"),S("\\weierp","\\wp"),S("\\Zeta","\\mathrm{Z}"),S("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),S("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),S("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),S("\\bra","\\mathinner{\\langle{#1}|}"),S("\\ket","\\mathinner{|{#1}\\rangle}"),S("\\braket","\\mathinner{\\langle{#1}\\rangle}"),S("\\Bra","\\left\\langle#1\\right|"),S("\\Ket","\\left|#1\\right\\rangle");var Zp=r=>e=>{var t=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,o=e.macros.get("|"),a=e.macros.get("\\|");e.macros.beginGroup();var l=d=>h=>{r&&(h.macros.set("|",o),i.length&&h.macros.set("\\|",a));var f=d;if(!d&&i.length){var m=h.future();m.text==="|"&&(h.popToken(),f=!0)}return{tokens:f?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,c=e.expandTokens([...s,...u,...t]);return e.macros.endGroup(),{tokens:c.reverse(),numArgs:0}};S("\\bra@ket",Zp(!1)),S("\\bra@set",Zp(!0)),S("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),S("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),S("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),S("\\angln","{\\angl n}"),S("\\blue","\\textcolor{##6495ed}{#1}"),S("\\orange","\\textcolor{##ffa500}{#1}"),S("\\pink","\\textcolor{##ff00af}{#1}"),S("\\red","\\textcolor{##df0030}{#1}"),S("\\green","\\textcolor{##28ae7b}{#1}"),S("\\gray","\\textcolor{gray}{#1}"),S("\\purple","\\textcolor{##9d38bd}{#1}"),S("\\blueA","\\textcolor{##ccfaff}{#1}"),S("\\blueB","\\textcolor{##80f6ff}{#1}"),S("\\blueC","\\textcolor{##63d9ea}{#1}"),S("\\blueD","\\textcolor{##11accd}{#1}"),S("\\blueE","\\textcolor{##0c7f99}{#1}"),S("\\tealA","\\textcolor{##94fff5}{#1}"),S("\\tealB","\\textcolor{##26edd5}{#1}"),S("\\tealC","\\textcolor{##01d1c1}{#1}"),S("\\tealD","\\textcolor{##01a995}{#1}"),S("\\tealE","\\textcolor{##208170}{#1}"),S("\\greenA","\\textcolor{##b6ffb0}{#1}"),S("\\greenB","\\textcolor{##8af281}{#1}"),S("\\greenC","\\textcolor{##74cf70}{#1}"),S("\\greenD","\\textcolor{##1fab54}{#1}"),S("\\greenE","\\textcolor{##0d923f}{#1}"),S("\\goldA","\\textcolor{##ffd0a9}{#1}"),S("\\goldB","\\textcolor{##ffbb71}{#1}"),S("\\goldC","\\textcolor{##ff9c39}{#1}"),S("\\goldD","\\textcolor{##e07d10}{#1}"),S("\\goldE","\\textcolor{##a75a05}{#1}"),S("\\redA","\\textcolor{##fca9a9}{#1}"),S("\\redB","\\textcolor{##ff8482}{#1}"),S("\\redC","\\textcolor{##f9685d}{#1}"),S("\\redD","\\textcolor{##e84d39}{#1}"),S("\\redE","\\textcolor{##bc2612}{#1}"),S("\\maroonA","\\textcolor{##ffbde0}{#1}"),S("\\maroonB","\\textcolor{##ff92c6}{#1}"),S("\\maroonC","\\textcolor{##ed5fa6}{#1}"),S("\\maroonD","\\textcolor{##ca337c}{#1}"),S("\\maroonE","\\textcolor{##9e034e}{#1}"),S("\\purpleA","\\textcolor{##ddd7ff}{#1}"),S("\\purpleB","\\textcolor{##c6b9fc}{#1}"),S("\\purpleC","\\textcolor{##aa87ff}{#1}"),S("\\purpleD","\\textcolor{##7854ab}{#1}"),S("\\purpleE","\\textcolor{##543b78}{#1}"),S("\\mintA","\\textcolor{##f5f9e8}{#1}"),S("\\mintB","\\textcolor{##edf2df}{#1}"),S("\\mintC","\\textcolor{##e0e5cc}{#1}"),S("\\grayA","\\textcolor{##f6f7f7}{#1}"),S("\\grayB","\\textcolor{##f0f1f2}{#1}"),S("\\grayC","\\textcolor{##e3e5e6}{#1}"),S("\\grayD","\\textcolor{##d6d8da}{#1}"),S("\\grayE","\\textcolor{##babec2}{#1}"),S("\\grayF","\\textcolor{##888d93}{#1}"),S("\\grayG","\\textcolor{##626569}{#1}"),S("\\grayH","\\textcolor{##3b3e40}{#1}"),S("\\grayI","\\textcolor{##21242c}{#1}"),S("\\kaBlue","\\textcolor{##314453}{#1}"),S("\\kaGreen","\\textcolor{##71B307}{#1}");var Qp={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class w8{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new y8(b8,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Kp(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new Tt("EOF",n.loc)),this.pushTokens(i),new Tt("",gt.range(t,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),s,o=0,a=0;do{if(s=this.popToken(),t.push(s),s.text==="{")++o;else if(s.text==="}"){if(--o,o===-1)throw new _("Extra }",s)}else if(s.text==="EOF")throw new _("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",s);if(e&&n)if((o===0||o===1&&e[a]==="{")&&s.text===e[a]){if(++a,a===e.length){t.splice(-a,a);break}}else a=0}while(o!==0||n);return i.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new _("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;i<n.length;i++){var s=this.popToken();if(n[i]!==s.text)throw new _("Use of the macro doesn't match its definition",s)}}for(var o=[],a=0;a<e;a++)o.push(this.consumeArg(t&&t[a+1]).tokens);return o}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new _("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,i=t.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new _("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var s=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var a=s.length-1;a>=0;--a){var l=s[a];if(l.text==="#"){if(a===0)throw new _("Incomplete placeholder at end of macro body",l);if(l=s[--a],l.text==="#")s.splice(a+1,1);else if(/^[1-9]$/.test(l.text))s.splice(a,2,...o[+l.text-1]);else throw new _("Not a valid argument number",l)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Tt(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(n=>n.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof t=="function"?t(this):t;if(typeof i=="string"){var s=0;if(i.indexOf("#")!==-1)for(var o=i.replace(/##/g,"");o.indexOf("#"+(s+1))!==-1;)++s;for(var a=new Kp(i,this.settings),l=[],u=a.lex();u.text!=="EOF";)l.push(u),u=a.lex();l.reverse();var c={tokens:l,numArgs:s};return c}return i}isDefined(e){return this.macros.has(e)||Zr.hasOwnProperty(e)||Ne.math.hasOwnProperty(e)||Ne.text.hasOwnProperty(e)||Qp.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:Zr.hasOwnProperty(e)&&!Zr[e].primitive}}var em=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,bo=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),f0={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},tm={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class wo{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new w8(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new _("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Tt("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(wo.endOfExpression.indexOf(i.text)!==-1||t&&i.text===t||e&&Zr[i.text]&&Zr[i.text].infix)break;var s=this.parseAtom(t);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t=-1,n,i=0;i<e.length;i++)if(e[i].type==="infix"){if(t!==-1)throw new _("only one infix operator per group",e[i].token);t=i,n=e[i].replaceWith}if(t!==-1&&n){var s,o,a=e.slice(0,t),l=e.slice(t+1);a.length===1&&a[0].type==="ordgroup"?s=a[0]:s={type:"ordgroup",mode:this.mode,body:a},l.length===1&&l[0].type==="ordgroup"?o=l[0]:o={type:"ordgroup",mode:this.mode,body:l};var u;return n==="\\\\abovefrac"?u=this.callFunction(n,[s,e[t],o],[]):u=this.callFunction(n,[s,o],[]),[u]}else return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var i;do{var s;i=this.parseGroup(e)}while(((s=i)==null?void 0:s.type)==="internal");if(!i)throw new _("Expected group after '"+n+"'",t);return i}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:t},s={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return s}parseAtom(e){var t=this.parseGroup("atom",e);if(t?.type==="internal"||this.mode==="text")return t;for(var n,i;;){this.consumeSpaces();var s=this.fetch();if(s.text==="\\limits"||s.text==="\\nolimits"){if(t&&t.type==="op"){var o=s.text==="\\limits";t.limits=o,t.alwaysHandleSupSub=!0}else if(t&&t.type==="operatorname")t.alwaysHandleSupSub&&(t.limits=s.text==="\\limits");else throw new _("Limit controls must follow a math operator",s);this.consume()}else if(s.text==="^"){if(n)throw new _("Double superscript",s);n=this.handleSupSubscript("superscript")}else if(s.text==="_"){if(i)throw new _("Double subscript",s);i=this.handleSupSubscript("subscript")}else if(s.text==="'"){if(n)throw new _("Double superscript",s);var a={type:"textord",mode:this.mode,text:"\\prime"},l=[a];for(this.consume();this.fetch().text==="'";)l.push(a),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:l}}else if(bo[s.text]){var u=em.test(s.text),c=[];for(c.push(new Tt(bo[s.text])),this.consume();;){var d=this.fetch().text;if(!bo[d]||em.test(d)!==u)break;c.unshift(new Tt(bo[d])),this.consume()}var h=this.subparse(c);u?i={type:"ordgroup",mode:"math",body:h}:n={type:"ordgroup",mode:"math",body:h}}else break}return n||i?{type:"supsub",mode:this.mode,base:t,sup:n,sub:i}:t}parseFunction(e,t){var n=this.fetch(),i=n.text,s=Zr[i];if(!s)return null;if(this.consume(),t&&t!=="atom"&&!s.allowedInArgument)throw new _("Got function '"+i+"' with no arguments"+(t?" as "+t:""),n);if(this.mode==="text"&&!s.allowedInText)throw new _("Can't use function '"+i+"' in text mode",n);if(this.mode==="math"&&s.allowedInMath===!1)throw new _("Can't use function '"+i+"' in math mode",n);var{args:o,optArgs:a}=this.parseArguments(i,s);return this.callFunction(i,o,a,n,e)}callFunction(e,t,n,i,s){var o={funcName:e,parser:this,token:i,breakOnTokenText:s},a=Zr[e];if(a&&a.handler)return a.handler(o,t,n);throw new _("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var i=[],s=[],o=0;o<n;o++){var a=t.argTypes&&t.argTypes[o],l=o<t.numOptionalArgs;(t.primitive&&a==null||t.type==="sqrt"&&o===1&&s[0]==null)&&(a="primitive");var u=this.parseGroupOfType("argument to '"+e+"'",a,l);if(l)s.push(u);else if(u!=null)i.push(u);else throw new _("Null argument, please report this as a bug")}return{args:i,optArgs:s}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":{var i=this.parseArgumentGroup(n,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text"}:null}case"raw":{var s=this.parseStringGroup("raw",n);return s!=null?{type:"raw",mode:"text",string:s.text}:null}case"primitive":{if(n)throw new _("A primitive argument cannot be optional");var o=this.parseGroup(e);if(o==null)throw new _("Expected group as "+e,this.fetch());return o}case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new _("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var i="",s;(s=this.fetch()).text!=="EOF";)i+=s.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(e,t){for(var n=this.fetch(),i=n,s="",o;(o=this.fetch()).text!=="EOF"&&e.test(s+o.text);)i=o,s+=i.text,this.consume();if(s==="")throw new _("Invalid "+t+": '"+n.text+"'",n);return n.range(i,s)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new _("Invalid color: '"+t.text+"'",t);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?t=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):t=this.parseStringGroup("size",e),!t)return null;!e&&t.text.length===0&&(t.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!i)throw new _("Invalid size: '"+t.text+"'",t);var s={number:+(i[1]+i[2]),unit:i[3]};if(!zh(s))throw new _("Invalid unit: '"+s.unit+"'",t);return{type:"size",mode:this.mode,value:s,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var i=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var s=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:n.loc,body:s};return t&&this.switchMode(i),o}parseGroup(e,t){var n=this.fetch(),i=n.text,s;if(i==="{"||i==="\\begingroup"){this.consume();var o=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,o),l=this.fetch();this.expect(o),this.gullet.endGroup(),s={type:"ordgroup",mode:this.mode,loc:gt.range(n,l),body:a,semisimple:i==="\\begingroup"||void 0}}else if(s=this.parseFunction(t,e)||this.parseSymbol(),s==null&&i[0]==="\\"&&!Qp.hasOwnProperty(i)){if(this.settings.throwOnError)throw new _("Undefined control sequence: "+i,n);s=this.formatUnsupportedCmd(i),this.consume()}return s}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var i=e[n],s=i.text;s==="-"&&e[n+1].text==="-"&&(n+1<t&&e[n+2].text==="-"?(e.splice(n,3,{type:"textord",mode:"text",loc:gt.range(i,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:gt.range(i,e[n+1]),text:"--"}),t-=1)),(s==="'"||s==="`")&&e[n+1].text===s&&(e.splice(n,2,{type:"textord",mode:"text",loc:gt.range(i,e[n+1]),text:s+s}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),i=n.charAt(0)==="*";if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new _(`\\verb assertion failed --
|
|
866
|
-
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}
|
|
898
|
+
?)[ \r ]*`,tu="[̀-ͯ]",G9=new RegExp(tu+"+$"),J9="("+Ym+"+)|"+(K9+"|")+"([!-\\[\\]-‧-豈-]"+(tu+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(tu+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+U9)+("|"+W9+")");class Xm{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(J9,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Pt("EOF",new St(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new W("Unexpected character: '"+e[t]+"'",new Pt(e[t],new St(this,t,t+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(`
|
|
899
|
+
`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new Pt(i,new St(this,t,this.tokenRegex.lastIndex))}}class Y9{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new W("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var X9=Mm;S("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),S("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}}),S("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}}),S("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}}),S("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}}),S("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),S("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Zm={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};S("\\char",function(r){var e=r.popToken(),t,n="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new W("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=Zm[e.text],n==null||n>=t)throw new W("Invalid base-"+t+" digit "+e.text);for(var i;(i=Zm[r.future().text])!=null&&i<t;)n*=t,n+=i,r.popToken()}return"\\@char{"+n+"}"});var ru=(r,e,t,n)=>{var i=r.consumeArg().tokens;if(i.length!==1)throw new W("\\newcommand's first argument must be a macro name");var s=i[0].text,o=r.isDefined(s);if(o&&!e)throw new W("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!o&&!t)throw new W("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(i=r.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",u=r.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=r.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new W("Invalid number of arguments: "+l);a=parseInt(l),i=r.consumeArg().tokens}return o&&n||r.macros.set(s,{tokens:i,numArgs:a}),""};S("\\newcommand",r=>ru(r,!1,!0,!1)),S("\\renewcommand",r=>ru(r,!0,!1,!1)),S("\\providecommand",r=>ru(r,!0,!0,!0)),S("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""}),S("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""}),S("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),fn[t],Be.math[t],Be.text[t]),""}),S("\\bgroup","{"),S("\\egroup","}"),S("~","\\nobreakspace"),S("\\lq","`"),S("\\rq","'"),S("\\aa","\\r a"),S("\\AA","\\r A"),S("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),S("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),S("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),S("ℬ","\\mathscr{B}"),S("ℰ","\\mathscr{E}"),S("ℱ","\\mathscr{F}"),S("ℋ","\\mathscr{H}"),S("ℐ","\\mathscr{I}"),S("ℒ","\\mathscr{L}"),S("ℳ","\\mathscr{M}"),S("ℛ","\\mathscr{R}"),S("ℭ","\\mathfrak{C}"),S("ℌ","\\mathfrak{H}"),S("ℨ","\\mathfrak{Z}"),S("\\Bbbk","\\Bbb{k}"),S("·","\\cdotp"),S("\\llap","\\mathllap{\\textrm{#1}}"),S("\\rlap","\\mathrlap{\\textrm{#1}}"),S("\\clap","\\mathclap{\\textrm{#1}}"),S("\\mathstrut","\\vphantom{(}"),S("\\underbar","\\underline{\\text{#1}}"),S("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),S("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),S("\\ne","\\neq"),S("≠","\\neq"),S("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),S("∉","\\notin"),S("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),S("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),S("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),S("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),S("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),S("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),S("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),S("⟂","\\perp"),S("‼","\\mathclose{!\\mkern-0.8mu!}"),S("∌","\\notni"),S("⌜","\\ulcorner"),S("⌝","\\urcorner"),S("⌞","\\llcorner"),S("⌟","\\lrcorner"),S("©","\\copyright"),S("®","\\textregistered"),S("️","\\textregistered"),S("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),S("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),S("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),S("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),S("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),S("⋮","\\vdots"),S("\\varGamma","\\mathit{\\Gamma}"),S("\\varDelta","\\mathit{\\Delta}"),S("\\varTheta","\\mathit{\\Theta}"),S("\\varLambda","\\mathit{\\Lambda}"),S("\\varXi","\\mathit{\\Xi}"),S("\\varPi","\\mathit{\\Pi}"),S("\\varSigma","\\mathit{\\Sigma}"),S("\\varUpsilon","\\mathit{\\Upsilon}"),S("\\varPhi","\\mathit{\\Phi}"),S("\\varPsi","\\mathit{\\Psi}"),S("\\varOmega","\\mathit{\\Omega}"),S("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),S("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),S("\\boxed","\\fbox{$\\displaystyle{#1}$}"),S("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),S("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),S("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),S("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),S("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Qm={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};S("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in Qm?e=Qm[t]:(t.slice(0,4)==="\\not"||t in Be.math&&["bin","rel"].includes(Be.math[t].group))&&(e="\\dotsb"),e});var nu={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};S("\\dotso",function(r){var e=r.future().text;return e in nu?"\\ldots\\,":"\\ldots"}),S("\\dotsc",function(r){var e=r.future().text;return e in nu&&e!==","?"\\ldots\\,":"\\ldots"}),S("\\cdots",function(r){var e=r.future().text;return e in nu?"\\@cdots\\,":"\\@cdots"}),S("\\dotsb","\\cdots"),S("\\dotsm","\\cdots"),S("\\dotsi","\\!\\cdots"),S("\\dotsx","\\ldots\\,"),S("\\DOTSI","\\relax"),S("\\DOTSB","\\relax"),S("\\DOTSX","\\relax"),S("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),S("\\,","\\tmspace+{3mu}{.1667em}"),S("\\thinspace","\\,"),S("\\>","\\mskip{4mu}"),S("\\:","\\tmspace+{4mu}{.2222em}"),S("\\medspace","\\:"),S("\\;","\\tmspace+{5mu}{.2777em}"),S("\\thickspace","\\;"),S("\\!","\\tmspace-{3mu}{.1667em}"),S("\\negthinspace","\\!"),S("\\negmedspace","\\tmspace-{4mu}{.2222em}"),S("\\negthickspace","\\tmspace-{5mu}{.277em}"),S("\\enspace","\\kern.5em "),S("\\enskip","\\hskip.5em\\relax"),S("\\quad","\\hskip1em\\relax"),S("\\qquad","\\hskip2em\\relax"),S("\\tag","\\@ifstar\\tag@literal\\tag@paren"),S("\\tag@paren","\\tag@literal{({#1})}"),S("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new W("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),S("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),S("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),S("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),S("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),S("\\newline","\\\\\\relax"),S("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var e1=U(ir["Main-Regular"][84][1]-.7*ir["Main-Regular"][65][1]);S("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+e1+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),S("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+e1+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),S("\\hspace","\\@ifstar\\@hspacer\\@hspace"),S("\\@hspace","\\hskip #1\\relax"),S("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),S("\\ordinarycolon",":"),S("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),S("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),S("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),S("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),S("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),S("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),S("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),S("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),S("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),S("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),S("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),S("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),S("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),S("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),S("∷","\\dblcolon"),S("∹","\\eqcolon"),S("≔","\\coloneqq"),S("≕","\\eqqcolon"),S("⩴","\\Coloneqq"),S("\\ratio","\\vcentcolon"),S("\\coloncolon","\\dblcolon"),S("\\colonequals","\\coloneqq"),S("\\coloncolonequals","\\Coloneqq"),S("\\equalscolon","\\eqqcolon"),S("\\equalscoloncolon","\\Eqqcolon"),S("\\colonminus","\\coloneq"),S("\\coloncolonminus","\\Coloneq"),S("\\minuscolon","\\eqcolon"),S("\\minuscoloncolon","\\Eqcolon"),S("\\coloncolonapprox","\\Colonapprox"),S("\\coloncolonsim","\\Colonsim"),S("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),S("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),S("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),S("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),S("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),S("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),S("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),S("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),S("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),S("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),S("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),S("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),S("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),S("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),S("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),S("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),S("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),S("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),S("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),S("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),S("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),S("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),S("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),S("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),S("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),S("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),S("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),S("\\imath","\\html@mathml{\\@imath}{ı}"),S("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),S("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),S("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),S("⟦","\\llbracket"),S("⟧","\\rrbracket"),S("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),S("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),S("⦃","\\lBrace"),S("⦄","\\rBrace"),S("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),S("⦵","\\minuso"),S("\\darr","\\downarrow"),S("\\dArr","\\Downarrow"),S("\\Darr","\\Downarrow"),S("\\lang","\\langle"),S("\\rang","\\rangle"),S("\\uarr","\\uparrow"),S("\\uArr","\\Uparrow"),S("\\Uarr","\\Uparrow"),S("\\N","\\mathbb{N}"),S("\\R","\\mathbb{R}"),S("\\Z","\\mathbb{Z}"),S("\\alef","\\aleph"),S("\\alefsym","\\aleph"),S("\\Alpha","\\mathrm{A}"),S("\\Beta","\\mathrm{B}"),S("\\bull","\\bullet"),S("\\Chi","\\mathrm{X}"),S("\\clubs","\\clubsuit"),S("\\cnums","\\mathbb{C}"),S("\\Complex","\\mathbb{C}"),S("\\Dagger","\\ddagger"),S("\\diamonds","\\diamondsuit"),S("\\empty","\\emptyset"),S("\\Epsilon","\\mathrm{E}"),S("\\Eta","\\mathrm{H}"),S("\\exist","\\exists"),S("\\harr","\\leftrightarrow"),S("\\hArr","\\Leftrightarrow"),S("\\Harr","\\Leftrightarrow"),S("\\hearts","\\heartsuit"),S("\\image","\\Im"),S("\\infin","\\infty"),S("\\Iota","\\mathrm{I}"),S("\\isin","\\in"),S("\\Kappa","\\mathrm{K}"),S("\\larr","\\leftarrow"),S("\\lArr","\\Leftarrow"),S("\\Larr","\\Leftarrow"),S("\\lrarr","\\leftrightarrow"),S("\\lrArr","\\Leftrightarrow"),S("\\Lrarr","\\Leftrightarrow"),S("\\Mu","\\mathrm{M}"),S("\\natnums","\\mathbb{N}"),S("\\Nu","\\mathrm{N}"),S("\\Omicron","\\mathrm{O}"),S("\\plusmn","\\pm"),S("\\rarr","\\rightarrow"),S("\\rArr","\\Rightarrow"),S("\\Rarr","\\Rightarrow"),S("\\real","\\Re"),S("\\reals","\\mathbb{R}"),S("\\Reals","\\mathbb{R}"),S("\\Rho","\\mathrm{P}"),S("\\sdot","\\cdot"),S("\\sect","\\S"),S("\\spades","\\spadesuit"),S("\\sub","\\subset"),S("\\sube","\\subseteq"),S("\\supe","\\supseteq"),S("\\Tau","\\mathrm{T}"),S("\\thetasym","\\vartheta"),S("\\weierp","\\wp"),S("\\Zeta","\\mathrm{Z}"),S("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),S("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),S("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),S("\\bra","\\mathinner{\\langle{#1}|}"),S("\\ket","\\mathinner{|{#1}\\rangle}"),S("\\braket","\\mathinner{\\langle{#1}\\rangle}"),S("\\Bra","\\left\\langle#1\\right|"),S("\\Ket","\\left|#1\\right\\rangle");var t1=r=>e=>{var t=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,o=e.macros.get("|"),a=e.macros.get("\\|");e.macros.beginGroup();var l=d=>h=>{r&&(h.macros.set("|",o),i.length&&h.macros.set("\\|",a));var f=d;if(!d&&i.length){var m=h.future();m.text==="|"&&(h.popToken(),f=!0)}return{tokens:f?i:n,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var u=e.consumeArg().tokens,c=e.expandTokens([...s,...u,...t]);return e.macros.endGroup(),{tokens:c.reverse(),numArgs:0}};S("\\bra@ket",t1(!1)),S("\\bra@set",t1(!0)),S("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),S("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),S("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),S("\\angln","{\\angl n}"),S("\\blue","\\textcolor{##6495ed}{#1}"),S("\\orange","\\textcolor{##ffa500}{#1}"),S("\\pink","\\textcolor{##ff00af}{#1}"),S("\\red","\\textcolor{##df0030}{#1}"),S("\\green","\\textcolor{##28ae7b}{#1}"),S("\\gray","\\textcolor{gray}{#1}"),S("\\purple","\\textcolor{##9d38bd}{#1}"),S("\\blueA","\\textcolor{##ccfaff}{#1}"),S("\\blueB","\\textcolor{##80f6ff}{#1}"),S("\\blueC","\\textcolor{##63d9ea}{#1}"),S("\\blueD","\\textcolor{##11accd}{#1}"),S("\\blueE","\\textcolor{##0c7f99}{#1}"),S("\\tealA","\\textcolor{##94fff5}{#1}"),S("\\tealB","\\textcolor{##26edd5}{#1}"),S("\\tealC","\\textcolor{##01d1c1}{#1}"),S("\\tealD","\\textcolor{##01a995}{#1}"),S("\\tealE","\\textcolor{##208170}{#1}"),S("\\greenA","\\textcolor{##b6ffb0}{#1}"),S("\\greenB","\\textcolor{##8af281}{#1}"),S("\\greenC","\\textcolor{##74cf70}{#1}"),S("\\greenD","\\textcolor{##1fab54}{#1}"),S("\\greenE","\\textcolor{##0d923f}{#1}"),S("\\goldA","\\textcolor{##ffd0a9}{#1}"),S("\\goldB","\\textcolor{##ffbb71}{#1}"),S("\\goldC","\\textcolor{##ff9c39}{#1}"),S("\\goldD","\\textcolor{##e07d10}{#1}"),S("\\goldE","\\textcolor{##a75a05}{#1}"),S("\\redA","\\textcolor{##fca9a9}{#1}"),S("\\redB","\\textcolor{##ff8482}{#1}"),S("\\redC","\\textcolor{##f9685d}{#1}"),S("\\redD","\\textcolor{##e84d39}{#1}"),S("\\redE","\\textcolor{##bc2612}{#1}"),S("\\maroonA","\\textcolor{##ffbde0}{#1}"),S("\\maroonB","\\textcolor{##ff92c6}{#1}"),S("\\maroonC","\\textcolor{##ed5fa6}{#1}"),S("\\maroonD","\\textcolor{##ca337c}{#1}"),S("\\maroonE","\\textcolor{##9e034e}{#1}"),S("\\purpleA","\\textcolor{##ddd7ff}{#1}"),S("\\purpleB","\\textcolor{##c6b9fc}{#1}"),S("\\purpleC","\\textcolor{##aa87ff}{#1}"),S("\\purpleD","\\textcolor{##7854ab}{#1}"),S("\\purpleE","\\textcolor{##543b78}{#1}"),S("\\mintA","\\textcolor{##f5f9e8}{#1}"),S("\\mintB","\\textcolor{##edf2df}{#1}"),S("\\mintC","\\textcolor{##e0e5cc}{#1}"),S("\\grayA","\\textcolor{##f6f7f7}{#1}"),S("\\grayB","\\textcolor{##f0f1f2}{#1}"),S("\\grayC","\\textcolor{##e3e5e6}{#1}"),S("\\grayD","\\textcolor{##d6d8da}{#1}"),S("\\grayE","\\textcolor{##babec2}{#1}"),S("\\grayF","\\textcolor{##888d93}{#1}"),S("\\grayG","\\textcolor{##626569}{#1}"),S("\\grayH","\\textcolor{##3b3e40}{#1}"),S("\\grayI","\\textcolor{##21242c}{#1}"),S("\\kaBlue","\\textcolor{##314453}{#1}"),S("\\kaGreen","\\textcolor{##71B307}{#1}");var r1={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Z9{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Y9(X9,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Xm(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new Pt("EOF",n.loc)),this.pushTokens(i),new Pt("",St.range(t,n))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),s,o=0,a=0;do{if(s=this.popToken(),t.push(s),s.text==="{")++o;else if(s.text==="}"){if(--o,o===-1)throw new W("Extra }",s)}else if(s.text==="EOF")throw new W("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",s);if(e&&n)if((o===0||o===1&&e[a]==="{")&&s.text===e[a]){if(++a,a===e.length){t.splice(-a,a);break}}else a=0}while(o!==0||n);return i.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new W("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;i<n.length;i++){var s=this.popToken();if(n[i]!==s.text)throw new W("Use of the macro doesn't match its definition",s)}}for(var o=[],a=0;a<e;a++)o.push(this.consumeArg(t&&t[a+1]).tokens);return o}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new W("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,i=t.noexpand?null:this._getExpansion(n);if(i==null||e&&i.unexpandable){if(e&&i==null&&n[0]==="\\"&&!this.isDefined(n))throw new W("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var s=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var a=s.length-1;a>=0;--a){var l=s[a];if(l.text==="#"){if(a===0)throw new W("Incomplete placeholder at end of macro body",l);if(l=s[--a],l.text==="#")s.splice(a+1,1);else if(/^[1-9]$/.test(l.text))s.splice(a,2,...o[+l.text-1]);else throw new W("Not a valid argument number",l)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Pt(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(n=>n.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof t=="function"?t(this):t;if(typeof i=="string"){var s=0;if(i.indexOf("#")!==-1)for(var o=i.replace(/##/g,"");o.indexOf("#"+(s+1))!==-1;)++s;for(var a=new Xm(i,this.settings),l=[],u=a.lex();u.text!=="EOF";)l.push(u),u=a.lex();l.reverse();var c={tokens:l,numArgs:s};return c}return i}isDefined(e){return this.macros.has(e)||fn.hasOwnProperty(e)||Be.math.hasOwnProperty(e)||Be.text.hasOwnProperty(e)||r1.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:fn.hasOwnProperty(e)&&!fn[e].primitive}}var n1=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,ta=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),iu={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},i1={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class ra{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Z9(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new W("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Pt("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(ra.endOfExpression.indexOf(i.text)!==-1||t&&i.text===t||e&&fn[i.text]&&fn[i.text].infix)break;var s=this.parseAtom(t);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t=-1,n,i=0;i<e.length;i++)if(e[i].type==="infix"){if(t!==-1)throw new W("only one infix operator per group",e[i].token);t=i,n=e[i].replaceWith}if(t!==-1&&n){var s,o,a=e.slice(0,t),l=e.slice(t+1);a.length===1&&a[0].type==="ordgroup"?s=a[0]:s={type:"ordgroup",mode:this.mode,body:a},l.length===1&&l[0].type==="ordgroup"?o=l[0]:o={type:"ordgroup",mode:this.mode,body:l};var u;return n==="\\\\abovefrac"?u=this.callFunction(n,[s,e[t],o],[]):u=this.callFunction(n,[s,o],[]),[u]}else return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var i;do{var s;i=this.parseGroup(e)}while(((s=i)==null?void 0:s.type)==="internal");if(!i)throw new W("Expected group after '"+n+"'",t);return i}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var i={type:"text",mode:this.mode,body:t},s={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return s}parseAtom(e){var t=this.parseGroup("atom",e);if(t?.type==="internal"||this.mode==="text")return t;for(var n,i;;){this.consumeSpaces();var s=this.fetch();if(s.text==="\\limits"||s.text==="\\nolimits"){if(t&&t.type==="op"){var o=s.text==="\\limits";t.limits=o,t.alwaysHandleSupSub=!0}else if(t&&t.type==="operatorname")t.alwaysHandleSupSub&&(t.limits=s.text==="\\limits");else throw new W("Limit controls must follow a math operator",s);this.consume()}else if(s.text==="^"){if(n)throw new W("Double superscript",s);n=this.handleSupSubscript("superscript")}else if(s.text==="_"){if(i)throw new W("Double subscript",s);i=this.handleSupSubscript("subscript")}else if(s.text==="'"){if(n)throw new W("Double superscript",s);var a={type:"textord",mode:this.mode,text:"\\prime"},l=[a];for(this.consume();this.fetch().text==="'";)l.push(a),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:l}}else if(ta[s.text]){var u=n1.test(s.text),c=[];for(c.push(new Pt(ta[s.text])),this.consume();;){var d=this.fetch().text;if(!ta[d]||n1.test(d)!==u)break;c.unshift(new Pt(ta[d])),this.consume()}var h=this.subparse(c);u?i={type:"ordgroup",mode:"math",body:h}:n={type:"ordgroup",mode:"math",body:h}}else break}return n||i?{type:"supsub",mode:this.mode,base:t,sup:n,sub:i}:t}parseFunction(e,t){var n=this.fetch(),i=n.text,s=fn[i];if(!s)return null;if(this.consume(),t&&t!=="atom"&&!s.allowedInArgument)throw new W("Got function '"+i+"' with no arguments"+(t?" as "+t:""),n);if(this.mode==="text"&&!s.allowedInText)throw new W("Can't use function '"+i+"' in text mode",n);if(this.mode==="math"&&s.allowedInMath===!1)throw new W("Can't use function '"+i+"' in math mode",n);var{args:o,optArgs:a}=this.parseArguments(i,s);return this.callFunction(i,o,a,n,e)}callFunction(e,t,n,i,s){var o={funcName:e,parser:this,token:i,breakOnTokenText:s},a=fn[e];if(a&&a.handler)return a.handler(o,t,n);throw new W("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var i=[],s=[],o=0;o<n;o++){var a=t.argTypes&&t.argTypes[o],l=o<t.numOptionalArgs;(t.primitive&&a==null||t.type==="sqrt"&&o===1&&s[0]==null)&&(a="primitive");var u=this.parseGroupOfType("argument to '"+e+"'",a,l);if(l)s.push(u);else if(u!=null)i.push(u);else throw new W("Null argument, please report this as a bug")}return{args:i,optArgs:s}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":{var i=this.parseArgumentGroup(n,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text"}:null}case"raw":{var s=this.parseStringGroup("raw",n);return s!=null?{type:"raw",mode:"text",string:s.text}:null}case"primitive":{if(n)throw new W("A primitive argument cannot be optional");var o=this.parseGroup(e);if(o==null)throw new W("Expected group as "+e,this.fetch());return o}case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new W("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var i="",s;(s=this.fetch()).text!=="EOF";)i+=s.text,this.consume();return this.consume(),n.text=i,n}parseRegexGroup(e,t){for(var n=this.fetch(),i=n,s="",o;(o=this.fetch()).text!=="EOF"&&e.test(s+o.text);)i=o,s+=i.text,this.consume();if(s==="")throw new W("Invalid "+t+": '"+n.text+"'",n);return n.range(i,s)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new W("Invalid color: '"+t.text+"'",t);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?t=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):t=this.parseStringGroup("size",e),!t)return null;!e&&t.text.length===0&&(t.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!i)throw new W("Invalid size: '"+t.text+"'",t);var s={number:+(i[1]+i[2]),unit:i[3]};if(!Fp(s))throw new W("Invalid unit: '"+s.unit+"'",t);return{type:"size",mode:this.mode,value:s,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var i=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var s=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:n.loc,body:s};return t&&this.switchMode(i),o}parseGroup(e,t){var n=this.fetch(),i=n.text,s;if(i==="{"||i==="\\begingroup"){this.consume();var o=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,o),l=this.fetch();this.expect(o),this.gullet.endGroup(),s={type:"ordgroup",mode:this.mode,loc:St.range(n,l),body:a,semisimple:i==="\\begingroup"||void 0}}else if(s=this.parseFunction(t,e)||this.parseSymbol(),s==null&&i[0]==="\\"&&!r1.hasOwnProperty(i)){if(this.settings.throwOnError)throw new W("Undefined control sequence: "+i,n);s=this.formatUnsupportedCmd(i),this.consume()}return s}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var i=e[n],s=i.text;s==="-"&&e[n+1].text==="-"&&(n+1<t&&e[n+2].text==="-"?(e.splice(n,3,{type:"textord",mode:"text",loc:St.range(i,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:St.range(i,e[n+1]),text:"--"}),t-=1)),(s==="'"||s==="`")&&e[n+1].text===s&&(e.splice(n,2,{type:"textord",mode:"text",loc:St.range(i,e[n+1]),text:s+s}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),i=n.charAt(0)==="*";if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new W(`\\verb assertion failed --
|
|
900
|
+
please report what input caused this bug`);return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}i1.hasOwnProperty(t[0])&&!Be[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=i1[t[0]]+t.slice(1));var s=G9.exec(t);s&&(t=t.substring(0,s.index),t==="i"?t="ı":t==="j"&&(t="ȷ"));var o;if(Be[this.mode][t]){this.settings.strict&&this.mode==="math"&&A0.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a=Be[this.mode][t].group,l=St.range(e),u;if(H8.hasOwnProperty(a)){var c=a;u={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else u={type:a,mode:this.mode,loc:l,text:t};o=u}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Ip(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),o={type:"textord",mode:"text",loc:St.range(e),text:t};else return null;if(this.consume(),s)for(var d=0;d<s[0].length;d++){var h=s[0][d];if(!iu[h])throw new W("Unknown accent ' "+h+"'",e);var f=iu[h][this.mode]||iu[h].text;if(!f)throw new W("Accent "+h+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:St.range(e),label:f,isStretchy:!1,isShifty:!0,base:o}}return o}}ra.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var su=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new ra(e,t);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new W("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new Pt("\\df@tag")])}]}return i},s1=function(e,t,n){t.textContent="";var i=ou(e,n).toNode();t.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),s1=function(){throw new W("KaTeX doesn't work in quirks mode.")});var Q9=function(e,t){var n=ou(e,t).toMarkup();return n},ew=function(e,t){var n=new v0(t);return su(e,n)},o1=function(e,t,n){if(n.throwOnError||!(e instanceof W))throw e;var i=R.makeSpan(["katex-error"],[new Vt(t)]);return i.setAttribute("title",e.toString()),i.setAttribute("style","color:"+n.errorColor),i},ou=function(e,t){var n=new v0(t);try{var i=su(e,n);return u9(i,e,n)}catch(s){return o1(s,e,n)}},tw=function(e,t){var n=new v0(t);try{var i=su(e,n);return c9(i,e,n)}catch(s){return o1(s,e,n)}},rw="0.16.27",nw={Span:fs,Anchor:k0,SymbolNode:Vt,SvgNode:Er,PathNode:ln,LineNode:T0},ui={version:rw,render:s1,renderToString:Q9,ParseError:W,SETTINGS_SCHEMA:Ro,__parse:ew,__renderToDomTree:ou,__renderToHTMLTree:tw,__setFontMetrics:P8,__defineSymbol:p,__defineFunction:Q,__defineMacro:S,__domTree:nw};const iw=Oe.create({name:"m",content:"text*",group:"inline math",inline:!0,atom:!1,parseHTML(){return[{tag:"m"}]},renderHTML({HTMLAttributes:r}){return["span",Ce({class:"inlineMath"},r)]},addNodeView(){return({node:r,HTMLAttributes:e})=>{const t=document.createElement("span");t.classList.add("node-view"),Object.entries(e).forEach(([a,l])=>{t.setAttribute(a,l)});const n=document.createElement("span"),i=document.createElement("span"),s=r.textContent.trim();return n.innerHTML=ui.renderToString(s,{throwOnError:!1}),n.contentEditable="true",i.classList.add("edit-math"),i.classList.add("is-editable"),i.innerHTML="<m>"+r.textContent+"</m>",new MutationObserver(()=>{console.log("mutation observer"),n.innerHTML=ui.renderToString(r.textContent,{throwOnError:!1})}).observe(i,{characterData:!0,subtree:!0}),t.append(n,i),{dom:t,contentDOM:i}}}}),sw=Oe.create({name:"me",content:"text*",group:"inline math",inline:!0,parseHTML(){return[{tag:"me"}]},renderHTML({HTMLAttributes:r}){return["div",Ce({class:"displayMath"},r)]},addNodeView(){return({node:r,HTMLAttributes:e})=>{const t=document.createElement("div");t.classList.add("node-view"),t.classList.add("display"),Object.entries(e).forEach(([a,l])=>{t.setAttribute(a,l)});const n=document.createElement("span"),i=document.createElement("span"),s=r.textContent.trim();return n.innerHTML=ui.renderToString(s,{throwOnError:!1}),n.contentEditable="false",i.classList.add("edit-math"),i.classList.add("is-editable"),i.innerHTML="<md>"+r.textContent+"</md>",new MutationObserver(()=>{console.log("mutation observer"),n.innerHTML=ui.renderToString(r.textContent,{throwOnError:!1})}).observe(i,{characterData:!0,subtree:!0}),t.append(n,i),{dom:t,contentDOM:i}}}}),ow=Oe.create({name:"md",content:"text*",group:"inline math",inline:!0,parseHTML(){return[{tag:"md"}]},renderHTML({HTMLAttributes:r}){return["div",Ce({class:"displayMath"},r)]},addNodeView(){return({node:r,HTMLAttributes:e})=>{const t=document.createElement("div");t.classList.add("node-view"),t.classList.add("display"),Object.entries(e).forEach(([a,l])=>{t.setAttribute(a,l)});const n=document.createElement("span"),i=document.createElement("span"),s=r.textContent.trim();return n.innerHTML=ui.renderToString(s,{throwOnError:!1}),n.contentEditable="false",i.classList.add("edit-math"),i.classList.add("is-editable"),i.innerHTML="<md>"+r.textContent+"</md>",new MutationObserver(()=>{console.log("mutation observer"),n.innerHTML=ui.renderToString(r.textContent,{throwOnError:!1})}).observe(i,{characterData:!0,subtree:!0}),t.append(n,i),{dom:t,contentDOM:i}}}}),aw=Oe.create({name:"ptxdoc",content:"title? (BasicBlock|block|rawptx|division)*",group:"root",selectable:!1,draggable:!1,defining:!1,parseHTML(){return[{tag:"ptxdoc"}]},renderHTML({HTMLAttributes:r}){return["article",Ce({class:"ptxdoc",label:"ptxdoc"},r),0]}}),lw=Oe.create({name:"introduction",content:"(BasicBlock|block|rawptx)*",group:"division introduction",selectable:!0,draggable:!0,defining:!1,parseHTML(){return[{tag:"introduction"}]},renderHTML({HTMLAttributes:r}){return["article",Ce({class:"introduction",label:"introduction"},r),0]},addInputRules(){return[mt({find:new RegExp("^#intro\\s$"),type:this.type})]}}),uw=Oe.create({name:"part",content:"title ((introduction?|chapter+)|(BasicBlock|block|rawptx)+)",group:"division",selectable:!0,draggable:!0,defining:!1,parseHTML(){return[{tag:"part"}]},renderHTML({HTMLAttributes:r}){return["section",Ce({class:"part",ptxtag:"part"},r),0]},addInputRules(){return[mt({find:new RegExp("^#part\\s$"),type:this.type})]}}),cw=Oe.create({name:"chapter",content:"title ((introduction?|section+)|(BasicBlock|block|rawptx)+)",group:"division",selectable:!0,draggable:!0,defining:!1,parseHTML(){return[{tag:"chapter"}]},renderHTML({HTMLAttributes:r}){return["section",Ce({class:"chapter",ptxtag:"chapter"},r),0]},addInputRules(){return[mt({find:new RegExp("^#ch\\s$"),type:this.type})]}}),dw=Oe.create({name:"section",content:"title ((introduction?|subsection+)|(BasicBlock|block|rawptx)+)",group:"division",selectable:!0,draggable:!0,defining:!1,parseHTML(){return[{tag:"section"}]},renderHTML({HTMLAttributes:r}){return["section",Ce({class:"section",ptxtag:"section"},r),0]},addInputRules(){return[mt({find:new RegExp("^#sec\\s$"),type:this.type})]}}),fw=Oe.create({name:"subsection",content:"title (BasicBlock|block|rawptx)+",group:"division",selectable:!1,draggable:!0,defining:!1,parseHTML(){return[{tag:"subsection"}]},addAttributes(){return{label:{default:null,parseHTML:r=>r.getAttribute("label")},"xml:id":{parseHTML:r=>r.getAttribute("xml:id")}}},renderHTML({HTMLAttributes:r}){return["section",Ce({class:"subsection",ptxtag:"subsection"},r),0]},addInputRules(){return[mt({find:new RegExp("^#subsec\\s$"),type:this.type})]}}),hw=Oe.create({name:"worksheet",content:"title? ((introduction?)|(BasicBlock|block|rawptx)+)",group:"division",selectable:!1,draggable:!0,defining:!1,parseHTML(){return[{tag:"worksheet"}]},addAttributes(){return{label:{default:null,parseHTML:r=>r.getAttribute("label")},"xml:id":{parseHTML:r=>r.getAttribute("xml:id")}}},renderHTML({HTMLAttributes:r}){return["section",Ce({class:"worksheet",ptxtag:"worksheet"},r),0]},addInputRules(){return[mt({find:new RegExp("^#ws\\s$"),type:this.type})]}}),pw=De.create({name:"divisions",addExtensions(){return[lw,uw,cw,dw,fw,hw,aw]}});var mw=Oe.create({name:"text",group:"inline",parseMarkdown:r=>({type:"text",text:r.text||""}),renderMarkdown:r=>r.text||""}),gw=Oe.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:r}){return["br",Ce(this.options.HTMLAttributes,r)]},renderText(){return`
|
|
867
901
|
`},renderMarkdown:()=>`
|
|
868
|
-
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:r,chain:e,state:t,editor:n})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=n.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&o){const d=l.filter(h=>a.includes(h.type.name));u.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});const
|
|
869
|
-
`?(
|
|
870
|
-
`,x);
|
|
871
|
-
${
|
|
872
|
-
`+" ".repeat(
|
|
873
|
-
`),this.column=
|
|
902
|
+
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:r,chain:e,state:t,editor:n})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=n.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&o){const d=l.filter(h=>a.includes(h.type.name));u.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});const vw=mw.extend({}),yw=gw.extend({}),bw=as.create({name:"term",group:"inline",parseHTML(){return[{tag:"term"}]},renderHTML({HTMLAttributes:r}){return["span",Ce({class:"term"},r),0]},addInputRules(){return[rn({find:/(?:^|\s)(<term>(.*?)<\/term>)$/,type:this.type}),rn({find:/(?:^|\s)(_(.*?)_)$/,type:this.type})]},addPasteRules(){return[Mo({find:/(?:^|\s)(<term>(.*?)<\/term>)/g,type:this.type})]}}),ww=as.create({name:"em",group:"inline",parseHTML(){return[{tag:"em"}]},renderHTML({HTMLAttributes:r}){return["span",Ce({class:"em"},r),0]},addInputRules(){return[rn({find:/(?:^|\s)(<em>(.*?)<\/em>)$/,type:this.type}),rn({find:/(?:^|\s)(\*(.*?)\*)$/,type:this.type})]},addPasteRules(){return[Mo({find:/(?:^|\s)(<em>(.*?)<\/em>)/g,type:this.type})]}}),xw=as.create({name:"alert",group:"inline",parseHTML(){return[{tag:"alert"}]},renderHTML({HTMLAttributes:r}){return["span",Ce({class:"alert"},r),0]},addInputRules(){return[rn({find:/(?:^|\s)(<alert>(.*?)<\/alert>)$/,type:this.type}),rn({find:/(?:^|\s)(\*\*(.*?)\*\*)$/,type:this.type})]},addPasteRules(){return[Mo({find:/(?:^|\s)(<alert>(.*?)<\/alert>)/g,type:this.type})]}}),Sw=as.create({name:"c",group:"inline",parseHTML(){return[{tag:"c"}]},renderHTML({HTMLAttributes:r}){return["span",Ce({class:"c"},r),0]},addInputRules(){return[rn({find:/(?:^|\s)(<c>(.*?)<\/c>)$/,type:this.type}),rn({find:/(?:^|\s)(\*\*(.*?)\*\*)$/,type:this.type})]},addPasteRules(){return[Mo({find:/(?:^|\s)(<c>(.*?)<\/c>)/g,type:this.type})]}}),kw=De.create({name:"myinline",addExtensions(){return[vw,yw,bw,ww,xw,Sw]}}),vs=r=>{const e=r.node.type.name.charAt(0).toUpperCase()+r.node.type.name.slice(1);return X.jsxs(mp,{className:"block-component",ptxtag:r.node.type.name,children:[X.jsxs("div",{className:"block-title",children:[e,"."]}),X.jsx(pp,{className:"thm-component-content"})]})},a1=()=>X.jsxs(mp,{className:"proof",ptxtag:"proof",children:[X.jsx("div",{className:"block-title",children:"Proof."}),X.jsx(pp,{className:"thm-component-content"})]});var au,l1;function Tw(){if(l1)return au;l1=1;var r=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,i=(C,x)=>{for(var D in x)r(C,D,{get:x[D],enumerable:!0})},s=(C,x,D,q)=>{if(x&&typeof x=="object"||typeof x=="function")for(let J of t(x))!n.call(C,J)&&J!==D&&r(C,J,{get:()=>x[J],enumerable:!(q=e(x,J))||q.enumerable});return C},o=C=>s(r({},"__esModule",{value:!0}),C),a={};i(a,{XmlCdata:()=>L,XmlComment:()=>z,XmlDeclaration:()=>F,XmlDocument:()=>oe,XmlDocumentType:()=>ye,XmlElement:()=>re,XmlError:()=>ae,XmlNode:()=>N,XmlProcessingInstruction:()=>G,XmlText:()=>P,parseXml:()=>Te}),au=o(a);var l="",u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=class{constructor(C){if(this.k=this.u(C,!0),this.d=0,this.length=C.length,this.l=this.k!==this.length,this.h=C,this.l){let x=[];for(let D=0,q=0;q<this.k;++q)x[q]=D,D+=C.codePointAt(D)>65535?2:1;this.A=x}}get B(){return this.d>=this.k}u(C,x=this.l){return x?C.replace(u,"_").length:C.length}p(C=1){this.d=Math.min(this.k,this.d+C)}f(C=this.d){var x;return this.l?(x=this.A[C])!=null?x:1/0:C}G(C=1){let x=this.m(C);return this.p(C),x}v(C){let x=this.f(),D=this.h.slice(x,x+C);return this.p(this.u(D)),D}w(C){let{length:x,l:D,h:q}=this,J=this.f(),he=J;if(D)for(;he<x;){let Pe=q[he],pe=Pe>="\uD800"&&Pe<="\uDBFF";if(pe&&(Pe+=q[he+1]),!C(Pe))break;he+=pe?2:1}else for(;he<x&&C(q[he]);)++he;return this.v(he-J)}b(C){let{length:x}=C,D=this.f();return C===this.h.slice(D,D+x)?(this.p(x===1?1:this.u(C)),C):l}x(C){let x=this.h.slice(this.f()).search(C);return x>0?this.v(x):l}s(C){let x=this.f(),D=this.h.indexOf(C,x);return D>0?this.v(D-x):l}m(C=1){let{d:x,h:D}=this;return this.l?D.slice(this.f(x),this.f(x+C)):D.slice(x,x+C)}n(C=0){this.d=C>=0?Math.min(this.k,C):Math.max(0,this.d+C)}},d=/["&<]/,h=/['&<]/,f=/\r\n|[\n\r\t]/g,m=/<|&|]]>/,v=Object.freeze(Object.assign(Object.create(null),{amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}));function y(C){let x=C.codePointAt(0);return x>=97&&x<=122||x>=65&&x<=90||x>=48&&x<=57||x===45||x===46||x===183||x>=768&&x<=879||x===8255||x===8256||w(C,x)}function w(C,x=C.codePointAt(0)){return x>=97&&x<=122||x>=65&&x<=90||x===58||x===95||x>=192&&x<=214||x>=216&&x<=246||x>=248&&x<=767||x>=880&&x<=893||x>=895&&x<=8191||x===8204||x===8205||x>=8304&&x<=8591||x>=11264&&x<=12271||x>=12289&&x<=55295||x>=63744&&x<=64975||x>=65008&&x<=65533||x>=65536&&x<=983039}function k(C){return C==="#"||y(C)}function E(C){let x=C.codePointAt(0);return x===32||x===9||x===10||x===13}function I(C){return C>=32&&C<=55295||C===10||C===9||C===13||C>=57344&&C<=65533||C>=65536&&C<=1114111}var A=class Bg{constructor(){this.parent=null,this.start=-1,this.end=-1}get document(){var x,D;return(D=(x=this.parent)==null?void 0:x.document)!=null?D:null}get isRootNode(){return this.parent!==null&&this.parent===this.document&&this.type===Bg.TYPE_ELEMENT}get preserveWhitespace(){var x;return!!((x=this.parent)!=null&&x.preserveWhitespace)}get type(){return""}toJSON(){let x={type:this.type};return this.isRootNode&&(x.isRootNode=!0),this.preserveWhitespace&&(x.preserveWhitespace=!0),this.start!==-1&&(x.start=this.start,x.end=this.end),x}};A.TYPE_CDATA="cdata",A.TYPE_COMMENT="comment",A.TYPE_DOCUMENT="document",A.TYPE_DOCUMENT_TYPE="doctype",A.TYPE_ELEMENT="element",A.TYPE_PROCESSING_INSTRUCTION="pi",A.TYPE_TEXT="text",A.TYPE_XML_DECLARATION="xmldecl";var N=A,P=class extends N{constructor(C=""){super(),this.text=C}get type(){return N.TYPE_TEXT}toJSON(){return Object.assign(N.prototype.toJSON.call(this),{text:this.text})}},L=class extends P{get type(){return N.TYPE_CDATA}},z=class extends N{constructor(C=""){super(),this.content=C}get type(){return N.TYPE_COMMENT}toJSON(){return Object.assign(N.prototype.toJSON.call(this),{content:this.content})}},F=class extends N{constructor(C,x,D){super(),this.version=C,this.encoding=x??null,this.standalone=D??null}get type(){return N.TYPE_XML_DECLARATION}toJSON(){let C=N.prototype.toJSON.call(this);C.version=this.version;for(let x of["encoding","standalone"])this[x]!==null&&(C[x]=this[x]);return C}},re=class Fg extends N{constructor(x,D=Object.create(null),q=[]){super(),this.name=x,this.attributes=D,this.children=q}get isEmpty(){return this.children.length===0}get preserveWhitespace(){let x=this;for(;x instanceof Fg;){if("xml:space"in x.attributes)return x.attributes["xml:space"]==="preserve";x=x.parent}return!1}get text(){return this.children.map(x=>"text"in x?x.text:"").join("")}get type(){return N.TYPE_ELEMENT}toJSON(){return Object.assign(N.prototype.toJSON.call(this),{name:this.name,attributes:this.attributes,children:this.children.map(x=>x.toJSON())})}},oe=class extends N{constructor(C=[]){super(),this.children=C}get document(){return this}get root(){for(let C of this.children)if(C instanceof re)return C;return null}get text(){return this.children.map(C=>"text"in C?C.text:"").join("")}get type(){return N.TYPE_DOCUMENT}toJSON(){return Object.assign(N.prototype.toJSON.call(this),{children:this.children.map(C=>C.toJSON())})}},ye=class extends N{constructor(C,x,D,q){super(),this.name=C,this.publicId=x??null,this.systemId=D??null,this.internalSubset=q??null}get type(){return N.TYPE_DOCUMENT_TYPE}toJSON(){let C=N.prototype.toJSON.call(this);C.name=this.name;for(let x of["publicId","systemId","internalSubset"])this[x]!==null&&(C[x]=this[x]);return C}},ae=class extends Error{constructor(C,x,D){let q=1,J="",he=1;for(let Fe=0;Fe<x;++Fe){let wt=D[Fe];wt===`
|
|
903
|
+
`?(q=1,J="",he+=1):(q+=1,J+=wt)}let Pe=D.indexOf(`
|
|
904
|
+
`,x);J+=Pe===-1?D.slice(x):D.slice(x,Pe);let pe=0;J.length>50&&(q<40?J=J.slice(0,50):(pe=q-20,J=J.slice(pe,q+30))),super(`${C} (line ${he}, column ${q})
|
|
905
|
+
${J}
|
|
906
|
+
`+" ".repeat(q-pe+1)+`^
|
|
907
|
+
`),this.column=q,this.excerpt=J,this.line=he,this.name="XmlError",this.pos=x}},G=class extends N{constructor(C,x=""){super(),this.name=C,this.content=x}get type(){return N.TYPE_PROCESSING_INSTRUCTION}toJSON(){return Object.assign(N.prototype.toJSON.call(this),{name:this.name,content:this.content})}},ee="",ke=class{constructor(C,x={}){let D=this.document=new oe;this.j=D,this.g=x,this.c=new c(C),this.g.includeOffsets&&(D.start=0,D.end=C.length),this.parse()}i(C,x){return C.parent=this.j,this.g.includeOffsets&&(C.start=this.c.f(x),C.end=this.c.f()),this.j.children.push(C),!0}y(C,x){let{children:D}=this.j,{length:q}=D;if(C=se(C),q>0){let J=D[q-1];if(J?.type===N.TYPE_TEXT){let he=J;return he.text+=C,this.g.includeOffsets&&(he.end=this.c.f()),!0}}return this.i(new P(C),x)}H(){let C=Object.create(null);for(;this.e();){let x=this.q();if(!x)break;let D=this.t()&&this.I();if(D===!1)throw this.a("Attribute value expected");if(x in C)throw this.a(`Duplicate attribute: ${x}`);if(x==="xml:space"&&D!=="default"&&D!=="preserve")throw this.a('Value of the `xml:space` attribute must be "default" or "preserve"');C[x]=D}if(this.g.sortAttributes){let x=Object.keys(C).sort(),D=Object.create(null);for(let q=0;q<x.length;++q){let J=x[q];D[J]=C[J]}C=D}return C}I(){let{c:C}=this,x=C.m();if(x!=='"'&&x!=="'")return!1;C.p();let D,q=!1,J=ee,he=x==='"'?d:h;e:for(;!C.B;)switch(D=C.x(he),D&&(this.o(D),J+=D.replace(f," ")),C.m()){case x:q=!0;break e;case"&":J+=this.C();continue;case"<":throw this.a("Unescaped `<` is not allowed in an attribute value");default:break e}if(!q)throw this.a("Unclosed attribute");return C.p(),J}J(){let{c:C}=this,x=C.d;if(!C.b("<![CDATA["))return!1;let D=C.s("]]>");if(this.o(D),!C.b("]]>"))throw this.a("Unclosed CDATA section");return this.g.preserveCdata?this.i(new L(se(D)),x):this.y(D,x)}K(){let{c:C}=this,x=C.d,D=C.x(m);if(!D)return!1;if(this.o(D),C.m(3)==="]]>")throw this.a("Element content may not contain the CDATA section close delimiter `]]>`");return this.y(D,x)}D(){let{c:C}=this,x=C.d;if(!C.b("<!--"))return!1;let D=C.s("--");if(this.o(D),!C.b("-->"))throw C.m(2)==="--"?this.a("The string `--` isn't allowed inside a comment"):this.a("Unclosed comment");return this.g.preserveComments?this.i(new z(se(D)),x):!0}L(){let C=this.c.d,x=this.C();return x?this.y(x,C):!1}M(){let{c:C}=this,x=C.d;if(!C.b("<!DOCTYPE"))return!1;let D=this.e()&&this.q();if(!D)throw this.a("Expected a name");let q,J;if(this.e()){if(C.b("PUBLIC")){if(q=this.e()&&this.N(),q===!1)throw this.a("Expected a public identifier");this.e()}if(q!==void 0||C.b("SYSTEM")){if(this.e(),J=this.r(),J===!1)throw this.a("Expected a system identifier");this.e()}}let he;if(C.b("[")){if(he=C.x(/\][\x20\t\r\n]*>/),!C.b("]"))throw this.a("Unclosed internal subset");this.e()}if(!C.b(">"))throw this.a("Unclosed doctype declaration");return this.g.preserveDocumentType?this.i(new ye(D,q,J,he),x):!0}E(){let{c:C}=this,x=C.d;if(!C.b("<"))return!1;let D=this.q();if(!D)return C.n(x),!1;let q=this.H(),J=!!C.b("/>"),he=new re(D,q);if(he.parent=this.j,!J){if(!C.b(">"))throw this.a(`Unclosed start tag for element \`${D}\``);this.j=he;do this.K();while(this.E()||this.L()||this.J()||this.F()||this.D());let Pe=C.d,pe;if(!C.b("</")||!(pe=this.q())||pe!==D)throw C.n(Pe),this.a(`Missing end tag for element ${D}`);if(this.e(),!C.b(">"))throw this.a(`Unclosed end tag for element ${D}`);this.j=he.parent}return this.i(he,x)}t(){return this.e(),this.c.b("=")?(this.e(),!0):!1}z(){return this.D()||this.F()||this.e()}q(){return w(this.c.m())?this.c.w(y):ee}F(){let{c:C}=this,x=C.d;if(!C.b("<?"))return!1;let D=this.q();if(D){if(D.toLowerCase()==="xml")throw C.n(x),this.a("XML declaration isn't allowed here")}else throw this.a("Invalid processing instruction");if(!this.e()){if(C.b("?>"))return this.i(new G(D),x);throw this.a("Whitespace is required after a processing instruction name")}let q=C.s("?>");if(this.o(q),!C.b("?>"))throw this.a("Unterminated processing instruction");return this.i(new G(D,se(q)),x)}O(){let{c:C}=this,x=C.d;for(this.P();this.z(););if(this.M())for(;this.z(););return x<C.d}N(){let C=this.c.d,x=this.r();if(x!==!1&&!/^[-\x20\r\na-zA-Z0-9'()+,./:=?;!*#@$_%]*$/.test(x))throw this.c.n(C),this.a("Invalid character in public identifier");return x}C(){let{c:C}=this;if(!C.b("&"))return!1;let x=C.w(k);if(C.G()!==";")throw this.a("Unterminated reference (a reference must end with `;`)");let D;if(x[0]==="#"){let q=x[1]==="x"?parseInt(x.slice(2),16):parseInt(x.slice(1),10);if(isNaN(q))throw this.a("Invalid character reference");if(!I(q))throw this.a("Character reference resolves to an invalid character");D=String.fromCodePoint(q)}else if(D=v[x],D===void 0){let{ignoreUndefinedEntities:q,resolveUndefinedEntity:J}=this.g,he=`&${x};`;if(J){let Pe=J(he);if(Pe!=null){let pe=typeof Pe;if(pe!=="string")throw new TypeError(`\`resolveUndefinedEntity()\` must return a string, \`null\`, or \`undefined\`, but returned a value of type ${pe}`);return Pe}}if(q)return he;throw C.n(-he.length),this.a(`Named entity isn't defined: ${he}`)}return D}r(){let{c:C}=this,x=C.b('"')||C.b("'");if(!x)return!1;let D=C.s(x);if(this.o(D),!C.b(x))throw this.a("Missing end quote");return D}e(){return!!this.c.w(E)}P(){let{c:C}=this,x=C.d;if(!C.b("<?xml"))return!1;if(!this.e())throw this.a("Invalid XML declaration");let D=!!C.b("version")&&this.t()&&this.r();if(D===!1)throw this.a("XML version is missing or invalid");if(!/^1\.[0-9]+$/.test(D))throw this.a("Invalid character in version number");let q,J;if(this.e()){if(q=!!C.b("encoding")&&this.t()&&this.r(),q){if(!/^[A-Za-z][\w.-]*$/.test(q))throw this.a("Invalid character in encoding name");this.e()}if(J=!!C.b("standalone")&&this.t()&&this.r(),J){if(J!=="yes"&&J!=="no")throw this.a('Only "yes" and "no" are permitted as values of `standalone`');this.e()}}if(!C.b("?>"))throw this.a("Invalid or unclosed XML declaration");return this.g.preserveXmlDeclaration?this.i(new F(D,q||void 0,J||void 0),x):!0}a(C){let{c:x}=this;return new ae(C,x.d,x.h)}parse(){if(this.c.b("\uFEFF"),this.O(),!this.E())throw this.a("Root element is missing or invalid");for(;this.z(););if(!this.c.B)throw this.a("Extra content at the end of the document")}o(C){let{length:x}=C;for(let D=0;D<x;++D){let q=C.codePointAt(D);if(!I(q))throw this.c.n(-([...C].length-D)),this.a("Invalid character");q>65535&&(D+=1)}}};function se(C){let x=0;for(;(x=C.indexOf("\r",x))!==-1;)C=C[x+1]===`
|
|
874
908
|
`?C.slice(0,x)+C.slice(x+1):C.slice(0,x)+`
|
|
875
|
-
`+C.slice(x+1);return C}function
|
|
876
|
-
`,e);return n===-1?t:t===-1||t+1===n?n:t<n?t:n}function
|
|
877
|
-
`," ",'"',"&","'","/","<","=",">"];function
|
|
909
|
+
`+C.slice(x+1);return C}function Te(C,x){return new ke(C,x).document}return au}var Cw=Tw();function Mw(r){const e=String(r),t=[];return{toOffset:i,toPoint:n};function n(s){if(typeof s=="number"&&s>-1&&s<=e.length){let o=0;for(;;){let a=t[o];if(a===void 0){const l=u1(e,t[o-1]);a=l===-1?e.length+1:l+1,t[o]=a}if(a>s)return{line:o+1,column:s-(o>0?t[o-1]:0)+1,offset:s};o++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;t.length<s.line;){const a=t[t.length-1],l=u1(e,a),u=l===-1?e.length+1:l+1;if(a===u)break;t.push(u)}const o=(s.line>1?t[s.line-2]:0)+s.column-1;if(o<t[s.line-1])return o}}}function u1(r,e){const t=r.indexOf("\r",e),n=r.indexOf(`
|
|
910
|
+
`,e);return n===-1?t:t===-1||t+1===n?n:t<n?t:n}function Ew(r){return!r||typeof r!="object"?"":"position"in r||"type"in r?c1(r.position):"start"in r||"end"in r?c1(r):"line"in r||"column"in r?lu(r):""}function lu(r){return d1(r&&r.line)+":"+d1(r&&r.column)}function c1(r){return lu(r&&r.start)+"-"+lu(r&&r.end)}function d1(r){return r&&typeof r=="number"?r:1}class Ct extends Error{constructor(e,t,n){super(),typeof t=="string"&&(n=t,t=void 0);let i="",s={},o=!1;if(t&&("line"in t&&"column"in t?s={place:t}:"start"in t&&"end"in t?s={place:t}:"type"in t?s={ancestors:[t],place:t.position}:s={...t}),typeof e=="string"?i=e:!s.cause&&e&&(o=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?s.ruleId=n:(s.source=n.slice(0,l),s.ruleId=n.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ew(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ct.prototype.file="",Ct.prototype.name="",Ct.prototype.reason="",Ct.prototype.message="",Ct.prototype.stack="",Ct.prototype.column=void 0,Ct.prototype.line=void 0,Ct.prototype.ancestors=void 0,Ct.prototype.cause=void 0,Ct.prototype.fatal=void 0,Ct.prototype.place=void 0,Ct.prototype.ruleId=void 0,Ct.prototype.source=void 0;function Aw(r){const e=Mw(r);let t;try{t=Cw.parseXml(String(r),{includeOffsets:!0,preserveCdata:!0,preserveComments:!0,preserveDocumentType:!0,preserveXmlDeclaration:!0})}catch(s){const o=s,a=e.toPoint(o.pos),l=new Ct("Could not parse XML with `@rgrove/parse-xml`",{cause:o,place:a,ruleId:"error",source:"xast-util-from-xml"});throw l.fatal=!0,l.url="https://github.com/syntax-tree/xast-util-from-xml#throws",l}const n={location:e},i=Dw(t,n);return h1(t,i,n),i}function Ow(r){return{type:"cdata",value:r.text}}function Nw(r){return{type:"comment",value:r.content}}function Dw(r,e){return{type:"root",children:f1(r.children,e)}}function Pw(r){return{type:"doctype",name:r.name,public:r.publicId||void 0,system:r.systemId||void 0}}function Iw(r,e){const t=f1(r.children,e);return{type:"element",name:r.name,attributes:{...r.attributes},children:t}}function Rw(r){return{type:"instruction",name:r.name,value:r.content}}function zw(r){return{type:"text",value:r.text}}function Lw(r){const e=[];return r.version&&e.push('version="'+r.version+'"'),r.encoding&&e.push('encoding="'+r.encoding+'"'),r.standalone&&e.push('standalone="'+r.standalone+'"'),{type:"instruction",name:"xml",value:e.join(" ")}}function f1(r,e){const t=[];let n=-1;for(;++n<r.length;){const i=r[n];let s;i.type==="cdata"?s=Ow(i):i.type==="comment"?s=Nw(i):i.type==="doctype"?s=Pw(i):i.type==="element"?s=Iw(i,e):i.type==="pi"?s=Rw(i):i.type==="text"?s=zw(i):i.type==="xmldecl"&&(s=Lw(i)),s&&(h1(i,s,e),t.push(s))}return t}function h1(r,e,t){const n=r.start===-1?void 0:t.location.toPoint(r.start),i=r.end===-1?void 0:t.location.toPoint(r.end);n&&i&&(e.position={start:n,end:i})}const Bw=/["&'<>`]/g,Fw=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$w=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Hw=/[|\\{}()[\]^$+*?.]/g,p1=new WeakMap;function jw(r,e){if(r=r.replace(e.subset?_w(e.subset):Bw,n),e.subset||e.escapeOnly)return r;return r.replace(Fw,t).replace($w,n);function t(i,s,o){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}function n(i,s,o){return e.format(i.charCodeAt(0),o.charCodeAt(s+1),e)}}function _w(r){let e=p1.get(r);return e||(e=Vw(r),p1.set(r,e)),e}function Vw(r){const e=[];let t=-1;for(;++t<r.length;)e.push(r[t].replace(Hw,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}function qw(r){return"&#x"+r.toString(16).toUpperCase()+";"}function Ww(r,e){return jw(r,Object.assign({format:qw},e))}const Uw=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function ci(r,e,t){const n=Kw(r);return t?n.replace(t,i):i(n);function i(s){return Ww(s,{subset:e})}}function Kw(r){return String(r||"").replace(Uw,"")}const Gw=/]]>/g,Jw=[">"];function Yw(r){return"<![CDATA["+ci(r.value,Jw,Gw)+"]]>"}function Xw(r){return"<!--"+ci(r.value,["-"])+"-->"}const Zw=[" ",`
|
|
911
|
+
`," ",'"',"&","'","/","<","=",">"];function na(r){return ci(r,Zw)}function m1(r,e){const t=String(r);if(typeof e!="string")throw new TypeError("Expected character");let n=0,i=t.indexOf(e);for(;i!==-1;)n++,i=t.indexOf(e,i+e.length);return n}function uu(r,e){const t=String(r);let n=e.options.quote||'"';if(e.options.quoteSmart){const i=n==='"'?"'":'"';m1(t,n)>m1(t,i)&&(n=i)}return n+ci(t,["<","&",n])+n}function Qw(r,e){const t=na(r.name),n=r.public,i=r.system;let s="<!DOCTYPE";return t!==""&&(s+=" "+t),n?s+=" PUBLIC "+uu(n,e):i&&(s+=" SYSTEM"),i&&(s+=" "+uu(i,e)),s+">"}const ex={}.hasOwnProperty;function tx(r,e){const t=na(r.name),n=b1(r,e),i=r.attributes||{},s=n?!1:e.options.closeEmptyElements,o=[];let a;for(a in i)if(ex.call(i,a)){const l=i[a];l!=null&&o.push(na(a)+"="+uu(l,e))}return"<"+t+(o.length===0?"":" "+o.join(" "))+(s?(e.options.tightClose?"":" ")+"/":"")+">"+n+(s?"":"</"+t+">")}const rx=/\?>/g,nx=[">"];function ix(r){const e=na(r.name)||"x",t=ci(r.value,nx,rx);return"<?"+e+(t?" "+t:"")+"?>"}const sx=["&","<"];function g1(r){return ci(r.value,sx)}function ox(r,e){return e.options.allowDangerousXml?r.value:g1(r)}const ax={}.hasOwnProperty,v1={cdata:Yw,comment:Xw,doctype:Qw,element:tx,instruction:ix,raw:ox,root:b1,text:g1};function y1(r,e){const t=r&&r.type;if(!t)throw new Error("Expected node, not `"+r+"`");if(!ax.call(v1,t))throw new Error("Cannot compile unknown node `"+t+"`");const n=v1[t];return n(r,e)}function b1(r,e){const t=r&&r.children||[];let n=-1;const i=[];for(;++n<t.length;)i[n]=y1(t[n],e);return i.join("")}function w1(r,e){const t={options:{}};if(typeof t.options.quote=="string"&&t.options.quote!=='"'&&t.options.quote!=="'")throw new Error("Invalid quote `"+t.options.quote+"`, expected `'` or `\"`");const n=Array.isArray(r)?{type:"root",children:r}:r;return y1(n,t)}const x1=(function(r){if(r==null)return dx;if(typeof r=="function")return ia(r);if(typeof r=="object")return Array.isArray(r)?lx(r):ux(r);if(typeof r=="string")return cx(r);throw new Error("Expected function, string, or object as test")});function lx(r){const e=[];let t=-1;for(;++t<r.length;)e[t]=x1(r[t]);return ia(n);function n(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function ux(r){const e=r;return ia(t);function t(n){const i=n;let s;for(s in r)if(i[s]!==e[s])return!1;return!0}}function cx(r){return ia(e);function e(t){return t&&t.type===r}}function ia(r){return e;function e(t,n,i){return!!(fx(t)&&r.call(this,t,typeof n=="number"?n:void 0,i||void 0))}}function dx(){return!0}function fx(r){return r!==null&&typeof r=="object"&&"type"in r}function bk(r){return r}const S1=[],hx=!0,k1=!1,T1="skip";function px(r,e,t,n){let i;typeof e=="function"&&typeof t!="function"?(n=t,t=e):i=e;const s=x1(i),o=n?-1:1;a(r,void 0,[])();function a(l,u,c){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=S1,m,v,y;if((!e||s(l,u,c[c.length-1]||void 0))&&(f=mx(t(l,c)),f[0]===k1))return f;if("children"in l&&l.children){const w=l;if(w.children&&f[0]!==T1)for(v=(n?w.children.length:-1)+o,y=c.concat(w);v>-1&&v<w.children.length;){const k=w.children[v];if(m=a(k,v,y)(),m[0]===k1)return m;v=typeof m[1]=="number"?m[1]:v+o}}return f}}}function mx(r){return Array.isArray(r)?r:typeof r=="number"?[hx,r]:r==null?S1:[r]}function gx(r,e,t,n){let i,s,o;typeof e=="function"&&typeof t!="function"?(s=void 0,o=e,i=t):(s=e,o=t,i=n),px(r,s,a,i);function a(l,u){const c=u[u.length-1],d=c?c.children.indexOf(l):void 0;return o(l,d,c)}}const vx=["theorem","lemma","corollary","proposition","claim","fact","proof"],yx=["convention","insight","note","observation","remark","warning"],bx=["assumption","axiom","conjecture","heuristic","hypothesis","principle"],wx=["introduction","part","chapter","section","subsection","worksheet"],xx=["example","question","problem"],Sx=["solution","answer","hint"],kx=["ptxdoc","p","m","me","md","ol","ul","li",...wx,"title","definition","statement",...vx,...bx,...yx,...xx,...Sx,"term","em","alert","c","pre","url"];function Tx(r){let e=r.trim();if(e.startsWith("<?xml")){const i=e.indexOf("?>");i!==-1&&(e=e.slice(i+2).trim())}e=`<ptxdoc>
|
|
878
912
|
${e}
|
|
879
|
-
</ptxdoc>`;const t=
|
|
913
|
+
</ptxdoc>`;const t=Aw(e);return console.log("xast before: ",t),gx(t,(i,s,o)=>{if(i.type==="element"&&!kx.includes(i.name)){const a={type:"element",name:"rawptx",attributes:{},children:[{type:"text",value:w1(i)}]};return typeof s!="number"||!o?void 0:(o.children.splice(s,1,a),T1)}}),console.log("xast after: ",t),w1(t)}function Cx(){return{label:{parseHTML:r=>r.getAttribute("label")},"xml:id":{parseHTML:r=>r.getAttribute("xml:id")},component:{parseHTML:r=>r.getAttribute("component")}}}function Ir(r,e){return[mt({find:new RegExp(`^#${r}\\s$`,"i"),type:e}),mt({find:new RegExp(`(?:^)(<${r}>(\\s))$`,"i"),type:e}),mt({find:new RegExp(`(?:^)(${r}:(\\s))$`,"i"),type:e})]}const Mx=["theorem","lemma","corollary","proposition","claim","fact"],Ex=De.create({name:"theoremLike",addExtensions(){const r=[];for(const e of Mx)r.push(Oe.create({name:e,content:"title? statement proof*",group:"block theoremLike",selectable:!0,draggable:!0,defining:!1,parseHTML(){return[{tag:e}]},addAttributes(){return Cx()},renderHTML({HTMLAttributes:t}){return["article",Ce({class:`${e} theorem-like`,ptxtag:e},t)]},addNodeView(){return Nn(vs)},addInputRules(){return Ir(e,this.type)}}));return r.push(Oe.create({name:"proof",content:"title? BasicBlock+",group:"block",selectable:!0,draggable:!0,parseHTML(){return[{tag:"proof"}]},renderHTML({HTMLAttributes:e}){return["article",Ce({class:"proof",ptxtag:"proof"},e),0]},addNodeView(){return Nn(a1)},addInputRules(){return Ir("proof",this.type)}})),r}}),Ax=["assumption","axiom","conjecture","heuristic","hypothesis","principle"],Ox=De.create({name:"axiomLike",addExtensions(){const r=[];for(const e of Ax)r.push(Oe.create({name:e,content:"title? statement",group:"block axiomLike",selectable:!0,draggable:!0,parseHTML(){return[{tag:e}]},renderHTML({HTMLAttributes:t}){return["article",Ce({class:`${e} axiom-like`,label:e},t),0]},addNodeView(){return Nn(vs)},addInputRules(){return Ir(e,this.type)}}));return r}}),Nx=Oe.create({name:"statement",content:"BasicBlock+",group:"blockContent",parseHTML(){return[{tag:"statement"}]},renderHTML(){return["div",{class:"statement",ptxtag:"statement"},0]},addInputRules(){return Ir("statement",this.type)}}),Dx=["example","question","problem"],Px=De.create({name:"exampleLike",addExtensions(){const r=[];for(const e of Dx)r.push(Oe.create({name:e,content:"title? (BasicBlock*|(statement hint* answer* solution*))",group:"block exampleLike",selectable:!0,draggable:!0,defining:!1,parseHTML(){return[{tag:e}]},addAttributes(){return{label:{parseHTML:t=>t.getAttribute("label")},"xml:id":{parseHTML:t=>t.getAttribute("xml:id")},component:{parseHTML:t=>t.getAttribute("component")}}},renderHTML({HTMLAttributes:t}){return["article",Ce({class:`${e} theorem-like`,ptxtag:e},t)]},addNodeView(){return Nn(vs)},addInputRules(){return Ir(e,this.type)}}));for(const e of["hint","answer","solution"])r.push(Oe.create({name:e,content:"title? BasicBlock+",group:"block solutionLike",selectable:!0,draggable:!0,defining:!1,parseHTML(){return[{tag:e}]},addAttributes(){return{label:{parseHTML:t=>t.getAttribute("label")},"xml:id":{parseHTML:t=>t.getAttribute("xml:id")},component:{parseHTML:t=>t.getAttribute("component")}}},renderHTML({HTMLAttributes:t}){return["article",Ce({class:"proof",ptxtag:"proof"},t),0]},addNodeView(){return Nn(a1)},addInputRules(){return Ir("proof",this.type)}}));return r}}),Ix=["convention","insight","note","observation","remark","warning"],Rx=De.create({name:"remarkLike",addExtensions(){return Ix.map(r=>Oe.create({name:r,content:"title? BasicBlock+",group:"block remarkLike",selectable:!0,draggable:!0,parseHTML(){return[{tag:r}]},renderHTML({HTMLAttributes:e}){return["article",Ce({class:`${r} remark-like`,label:r},e),0]},addNodeView(){return Nn(vs)},addInputRules(){return Ir(r,this.type)}}))}}),zx=Oe.create({name:"p",content:"inline*",group:"BasicBlock paragraph",draggable:!0,defining:!1,priority:1e3,parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:r}){return["div",Ce({class:"p",ptxtag:"p"},r),0]},addInputRules(){return[mt({find:new RegExp("^#p\\s$"),type:this.type})]}}),Lx=De.create({name:"blocks",addExtensions(){return[zx,Ex,Px,Ox,Rx,Nx]}});var cu=4,Bx=/^```([a-z]+)?[\s\n]$/,Fx=/^~~~([a-z]+)?[\s\n]$/,$x=Oe.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:cu,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:r=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const s=[...((e=r.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:r,HTMLAttributes:e}){return["pre",Ce(this.options.HTMLAttributes,e),["code",{class:r.attrs.language?this.options.languageClassPrefix+r.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(r,e)=>{var t;return((t=r.raw)==null?void 0:t.startsWith("```"))===!1&&r.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:r.lang||null},r.text?[e.createTextNode(r.text)]:[])},renderMarkdown:(r,e)=>{var t;let n="";const i=((t=r.attrs)==null?void 0:t.language)||"";return r.content?n=[`\`\`\`${i}`,e.renderChildren(r.content),"```"].join(`
|
|
880
914
|
`):n=`\`\`\`${i}
|
|
881
915
|
|
|
882
|
-
\`\`\``,n},addCommands(){return{setCodeBlock:r=>({commands:e})=>e.setNode(this.name,r),toggleCodeBlock:r=>({commands:e})=>e.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:r,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!r||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:r})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:
|
|
916
|
+
\`\`\``,n},addCommands(){return{setCodeBlock:r=>({commands:e})=>e.setNode(this.name,r),toggleCodeBlock:r=>({commands:e})=>e.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:r,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!r||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:r})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:cu,{state:n}=r,{selection:i}=n,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;const a=" ".repeat(t);return o?r.commands.insertContent(a):r.commands.command(({tr:l})=>{const{from:u,to:c}=i,f=n.doc.textBetween(u,c,`
|
|
883
917
|
`,`
|
|
884
918
|
`).split(`
|
|
885
919
|
`).map(m=>a+m).join(`
|
|
886
|
-
`);return l.replaceWith(u,c,n.schema.text(f)),!0})},"Shift-Tab":({editor:r})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:
|
|
920
|
+
`);return l.replaceWith(u,c,n.schema.text(f)),!0})},"Shift-Tab":({editor:r})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:cu,{state:n}=r,{selection:i}=n,{$from:s,empty:o}=i;return s.parent.type!==this.type?!1:o?r.commands.command(({tr:a})=>{var l;const{pos:u}=s,c=s.start(),d=s.end(),f=n.doc.textBetween(c,d,`
|
|
887
921
|
`,`
|
|
888
922
|
`).split(`
|
|
889
|
-
`);let m=0,v=0;const y=u-c;for(let N=0;N<f.length;N+=1){if(v+f[N].length>=y){m=N;break}v+=f[N].length+1}const k=((l=f[m].match(/^ */))==null?void 0:l[0])||"",E=Math.min(k.length,t);if(E===0)return!0;let
|
|
923
|
+
`);let m=0,v=0;const y=u-c;for(let N=0;N<f.length;N+=1){if(v+f[N].length>=y){m=N;break}v+=f[N].length+1}const k=((l=f[m].match(/^ */))==null?void 0:l[0])||"",E=Math.min(k.length,t);if(E===0)return!0;let I=c;for(let N=0;N<m;N+=1)I+=f[N].length+1;return a.delete(I,I+E),u-I<=E&&a.setSelection(we.create(a.doc,I)),!0}):r.commands.command(({tr:a})=>{const{from:l,to:u}=i,h=n.doc.textBetween(l,u,`
|
|
890
924
|
`,`
|
|
891
925
|
`).split(`
|
|
892
926
|
`).map(f=>{var m;const v=((m=f.match(/^ */))==null?void 0:m[0])||"",y=Math.min(v.length,t);return f.slice(y)}).join(`
|
|
893
927
|
`);return a.replaceWith(l,u,n.schema.text(h)),!0})},Enter:({editor:r})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=r,{selection:t}=e,{$from:n,empty:i}=t;if(!i||n.parent.type!==this.type)return!1;const s=n.parentOffset===n.parent.nodeSize-2,o=n.parent.textContent.endsWith(`
|
|
894
928
|
|
|
895
|
-
`);return!s||!o?!1:r.chain().command(({tr:a})=>(a.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:r})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=r,{selection:t,doc:n}=e,{$from:i,empty:s}=t;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:n.nodeAt(a)?r.commands.command(({tr:u})=>(u.setSelection(
|
|
896
|
-
`));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(
|
|
897
|
-
`).replace(/\s*<\/ptxdoc>/,""),e):(console.log("No content in json"),"")}function
|
|
898
|
-
`;for(const i of r.content)e=e+
|
|
929
|
+
`);return!s||!o?!1:r.chain().command(({tr:a})=>(a.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:r})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=r,{selection:t,doc:n}=e,{$from:i,empty:s}=t;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:n.nodeAt(a)?r.commands.command(({tr:u})=>(u.setSelection(ge.near(n.resolve(a))),!0)):r.commands.exitCode()}}},addInputRules(){return[Ql({find:Bx,type:this.type,getAttributes:r=>({language:r[1]})}),Ql({find:Fx,type:this.type,getAttributes:r=>({language:r[1]})})]},addProseMirrorPlugins(){return[new qe({key:new Ke("codeBlockVSCodeHandler"),props:{handlePaste:(r,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,s=i?.mode;if(!t||!s)return!1;const{tr:o,schema:a}=r.state,l=a.text(t.replace(/\r\n?/g,`
|
|
930
|
+
`));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(we.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),r.dispatch(o),!0}}})]}}),Hx=$x;const jx=Oe.create({name:"title",content:"text*",parseHTML(){return[{tag:"title"}]},renderHTML({HTMLAttributes:r}){return["div",Ce({class:"title",ptxtag:"title"},r),0]},addInputRules(){return[Ql({find:new RegExp("#t\\s$"),type:this.type}),...Ir("title",this.type)]}}),_x=Oe.create({name:"definition",content:"title? statement",group:"block definitionLike",selectable:!0,draggable:!0,defining:!1,parseHTML(){return[{tag:"definition"}]},renderHTML({HTMLAttributes:r}){return["article",Ce({class:"definition definition-like",label:"definition"},r),0]},addNodeView(){return Nn(vs)},addInputRules(){return Ir("definition",this.type)}}),Vx=Oe.create({name:"url",content:"text*",group:"inline",inline:!0,atom:!1,parseHTML(){return[{tag:"url"}]},addAttributes(){return{href:{parseHTML:r=>r.getAttribute("href")}}},renderHTML({HTMLAttributes:r}){return["a",Ce({ptxtag:"url"},r),0]}}),qx=Oe.create({name:"rawptx",content:"text*",marks:"",selectable:!0,draggable:!0,defining:!0,code:!0,whitespace:"pre",parseHTML(){return[{tag:"rawptx",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:r}){return["pre",Ce({class:"rawptx",ptxtag:"rawptx"},r),0]}}),sa={para:"p",bulletList:"ul",orderedList:"ol",listItem:"li",italic:"em"};function C1(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Wx(r){let e="";return r.type!=="ptxFragment"?(console.log("Top level node is not a ptxFragment"),""):r.content?r.content.length!==1?(console.log("More than one child in json.content"),""):(e+=M1(r.content[0]),e=e.replace(/^<ptxdoc>\s*/,`
|
|
931
|
+
`).replace(/\s*<\/ptxdoc>/,""),e):(console.log("No content in json"),"")}function M1(r){let e="";if(r.content){const t=r.type in sa?sa[r.type]:r.type,n=r.attrs;if(t==="rawptx")for(const i of r.content)i.type!=="text"&&console.log("Unexpected non-text node inside rawptx: "+JSON.stringify(i)),e=e+i.text;else{if(e=e+"<"+t,n)for(const[i,s]of Object.entries(n))s!==null&&(e=e+" "+i+'="'+s+'"');e=e+`>
|
|
932
|
+
`;for(const i of r.content)e=e+M1(i);e=e+`
|
|
899
933
|
</`+t+`>
|
|
900
|
-
`}}else if(r.type==="text")if(r.marks){const t=r.marks[0].type in
|
|
901
|
-
`:e=e+"<!-- Something is missing; got "+JSON.stringify(r)+" -->";return e}const Tm=["top","right","bottom","left"],Mm=["start","end"],Cm=Tm.reduce((r,e)=>r.concat(e,e+"-"+Mm[0],e+"-"+Mm[1]),[]),tr=Math.min,ht=Math.max,To=Math.round,rr=r=>({x:r,y:r}),hw={left:"right",right:"left",bottom:"top",top:"bottom"},pw={start:"end",end:"start"};function b0(r,e,t){return ht(r,tr(e,t))}function kr(r,e){return typeof r=="function"?r(e):r}function Bt(r){return r.split("-")[0]}function Vt(r){return r.split("-")[1]}function Em(r){return r==="x"?"y":"x"}function w0(r){return r==="y"?"height":"width"}const mw=new Set(["top","bottom"]);function nr(r){return mw.has(Bt(r))?"y":"x"}function x0(r){return Em(nr(r))}function Am(r,e,t){t===void 0&&(t=!1);const n=Vt(r),i=x0(r),s=w0(i);let o=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Co(o)),[o,Co(o)]}function gw(r){const e=Co(r);return[Mo(r),e,Mo(e)]}function Mo(r){return r.replace(/start|end/g,e=>pw[e])}const Om=["left","right"],Nm=["right","left"],vw=["top","bottom"],yw=["bottom","top"];function bw(r,e,t){switch(r){case"top":case"bottom":return t?e?Nm:Om:e?Om:Nm;case"left":case"right":return e?vw:yw;default:return[]}}function ww(r,e,t,n){const i=Vt(r);let s=bw(Bt(r),t==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Mo)))),s}function Co(r){return r.replace(/left|right|bottom|top/g,e=>hw[e])}function xw(r){return{top:0,right:0,bottom:0,left:0,...r}}function S0(r){return typeof r!="number"?xw(r):{top:r,right:r,bottom:r,left:r}}function Wn(r){const{x:e,y:t,width:n,height:i}=r;return{width:n,height:i,top:t,left:e,right:e+n,bottom:t+i,x:e,y:t}}function Dm(r,e,t){let{reference:n,floating:i}=r;const s=nr(e),o=x0(e),a=w0(o),l=Bt(e),u=s==="y",c=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,h=n[a]/2-i[a]/2;let f;switch(l){case"top":f={x:c,y:n.y-i.height};break;case"bottom":f={x:c,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:d};break;case"left":f={x:n.x-i.width,y:d};break;default:f={x:n.x,y:n.y}}switch(Vt(e)){case"start":f[o]-=h*(t&&u?-1:1);break;case"end":f[o]+=h*(t&&u?-1:1);break}return f}const Sw=async(r,e,t)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=t,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:r,floating:e,strategy:i}),{x:c,y:d}=Dm(u,n,l),h=n,f={},m=0;for(let v=0;v<a.length;v++){const{name:y,fn:w}=a[v],{x:k,y:E,data:R,reset:O}=await w({x:c,y:d,initialPlacement:n,placement:h,strategy:i,middlewareData:f,rects:u,platform:o,elements:{reference:r,floating:e}});c=k??c,d=E??d,f={...f,[y]:{...f[y],...R}},O&&m<=50&&(m++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(u=O.rects===!0?await o.getElementRects({reference:r,floating:e,strategy:i}):O.rects),{x:c,y:d}=Dm(u,h,l)),v=-1)}return{x:c,y:d,placement:h,strategy:i,middlewareData:f}};async function Un(r,e){var t;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:o,elements:a,strategy:l}=r,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=kr(e,r),m=S0(f),y=a[h?d==="floating"?"reference":"floating":d],w=Wn(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(y)))==null||t?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),k=d==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),R=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},O=Wn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:k,offsetParent:E,strategy:l}):k);return{top:(w.top-O.top+m.top)/R.y,bottom:(O.bottom-w.bottom+m.bottom)/R.y,left:(w.left-O.left+m.left)/R.x,right:(O.right-w.right+m.right)/R.x}}const kw=r=>({name:"arrow",options:r,async fn(e){const{x:t,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=kr(r,e)||{};if(u==null)return{};const d=S0(c),h={x:t,y:n},f=x0(i),m=w0(f),v=await o.getDimensions(u),y=f==="y",w=y?"top":"left",k=y?"bottom":"right",E=y?"clientHeight":"clientWidth",R=s.reference[m]+s.reference[f]-h[f]-s.floating[m],O=h[f]-s.reference[f],N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let D=N?N[E]:0;(!D||!await(o.isElement==null?void 0:o.isElement(N)))&&(D=a.floating[E]||s.floating[m]);const B=R/2-O/2,L=D/2-v[m]/2-1,V=tr(d[w],L),te=tr(d[k],L),ne=V,fe=D-v[m]-te,re=D/2-v[m]/2+B,G=b0(ne,re,fe),Z=!l.arrow&&Vt(i)!=null&&re!==G&&s.reference[m]/2-(re<ne?V:te)-v[m]/2<0,ye=Z?re<ne?re-ne:re-fe:0;return{[f]:h[f]+ye,data:{[f]:G,centerOffset:re-G-ye,...Z&&{alignmentOffset:ye}},reset:Z}}});function Tw(r,e,t){return(r?[...t.filter(i=>Vt(i)===r),...t.filter(i=>Vt(i)!==r)]:t.filter(i=>Bt(i)===i)).filter(i=>r?Vt(i)===r||(e?Mo(i)!==i:!1):!0)}const Mw=function(r){return r===void 0&&(r={}),{name:"autoPlacement",options:r,async fn(e){var t,n,i;const{rects:s,middlewareData:o,placement:a,platform:l,elements:u}=e,{crossAxis:c=!1,alignment:d,allowedPlacements:h=Cm,autoAlignment:f=!0,...m}=kr(r,e),v=d!==void 0||h===Cm?Tw(d||null,f,h):h,y=await Un(e,m),w=((t=o.autoPlacement)==null?void 0:t.index)||0,k=v[w];if(k==null)return{};const E=Am(k,s,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(a!==k)return{reset:{placement:v[0]}};const R=[y[Bt(k)],y[E[0]],y[E[1]]],O=[...((n=o.autoPlacement)==null?void 0:n.overflows)||[],{placement:k,overflows:R}],N=v[w+1];if(N)return{data:{index:w+1,overflows:O},reset:{placement:N}};const D=O.map(V=>{const te=Vt(V.placement);return[V.placement,te&&c?V.overflows.slice(0,2).reduce((ne,fe)=>ne+fe,0):V.overflows[0],V.overflows]}).sort((V,te)=>V[1]-te[1]),L=((i=D.filter(V=>V[2].slice(0,Vt(V[0])?2:3).every(te=>te<=0))[0])==null?void 0:i[0])||D[0][0];return L!==a?{data:{index:w+1,overflows:O},reset:{placement:L}}:{}}}},Cw=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(e){var t,n;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...y}=kr(r,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const w=Bt(i),k=nr(a),E=Bt(a)===a,R=await(l.isRTL==null?void 0:l.isRTL(u.floating)),O=h||(E||!v?[Co(a)]:gw(a)),N=m!=="none";!h&&N&&O.push(...ww(a,v,m,R));const D=[a,...O],B=await Un(e,y),L=[];let V=((n=s.flip)==null?void 0:n.overflows)||[];if(c&&L.push(B[w]),d){const re=Am(i,o,R);L.push(B[re[0]],B[re[1]])}if(V=[...V,{placement:i,overflows:L}],!L.every(re=>re<=0)){var te,ne;const re=(((te=s.flip)==null?void 0:te.index)||0)+1,G=D[re];if(G&&(!(d==="alignment"?k!==nr(G):!1)||V.every(ee=>nr(ee.placement)===k?ee.overflows[0]>0:!0)))return{data:{index:re,overflows:V},reset:{placement:G}};let Z=(ne=V.filter(ye=>ye.overflows[0]<=0).sort((ye,ee)=>ye.overflows[1]-ee.overflows[1])[0])==null?void 0:ne.placement;if(!Z)switch(f){case"bestFit":{var fe;const ye=(fe=V.filter(ee=>{if(N){const ke=nr(ee.placement);return ke===k||ke==="y"}return!0}).map(ee=>[ee.placement,ee.overflows.filter(ke=>ke>0).reduce((ke,C)=>ke+C,0)]).sort((ee,ke)=>ee[1]-ke[1])[0])==null?void 0:fe[0];ye&&(Z=ye);break}case"initialPlacement":Z=a;break}if(i!==Z)return{reset:{placement:Z}}}return{}}}};function Im(r,e){return{top:r.top-e.height,right:r.right-e.width,bottom:r.bottom-e.height,left:r.left-e.width}}function Rm(r){return Tm.some(e=>r[e]>=0)}const Ew=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(e){const{rects:t}=e,{strategy:n="referenceHidden",...i}=kr(r,e);switch(n){case"referenceHidden":{const s=await Un(e,{...i,elementContext:"reference"}),o=Im(s,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Rm(o)}}}case"escaped":{const s=await Un(e,{...i,altBoundary:!0}),o=Im(s,t.floating);return{data:{escapedOffsets:o,escaped:Rm(o)}}}default:return{}}}}};function Pm(r){const e=tr(...r.map(s=>s.left)),t=tr(...r.map(s=>s.top)),n=ht(...r.map(s=>s.right)),i=ht(...r.map(s=>s.bottom));return{x:e,y:t,width:n-e,height:i-t}}function Aw(r){const e=r.slice().sort((i,s)=>i.y-s.y),t=[];let n=null;for(let i=0;i<e.length;i++){const s=e[i];!n||s.y-n.y>n.height/2?t.push([s]):t[t.length-1].push(s),n=s}return t.map(i=>Wn(Pm(i)))}const Ow=function(r){return r===void 0&&(r={}),{name:"inline",options:r,async fn(e){const{placement:t,elements:n,rects:i,platform:s,strategy:o}=e,{padding:a=2,x:l,y:u}=kr(r,e),c=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(n.reference))||[]),d=Aw(c),h=Wn(Pm(c)),f=S0(a);function m(){if(d.length===2&&d[0].left>d[1].right&&l!=null&&u!=null)return d.find(y=>l>y.left-f.left&&l<y.right+f.right&&u>y.top-f.top&&u<y.bottom+f.bottom)||h;if(d.length>=2){if(nr(t)==="y"){const V=d[0],te=d[d.length-1],ne=Bt(t)==="top",fe=V.top,re=te.bottom,G=ne?V.left:te.left,Z=ne?V.right:te.right,ye=Z-G,ee=re-fe;return{top:fe,bottom:re,left:G,right:Z,width:ye,height:ee,x:G,y:fe}}const y=Bt(t)==="left",w=ht(...d.map(V=>V.right)),k=tr(...d.map(V=>V.left)),E=d.filter(V=>y?V.left===k:V.right===w),R=E[0].top,O=E[E.length-1].bottom,N=k,D=w,B=D-N,L=O-R;return{top:R,bottom:O,left:N,right:D,width:B,height:L,x:N,y:R}}return h}const v=await s.getElementRects({reference:{getBoundingClientRect:m},floating:n.floating,strategy:o});return i.reference.x!==v.reference.x||i.reference.y!==v.reference.y||i.reference.width!==v.reference.width||i.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},Nw=new Set(["left","top"]);async function Dw(r,e){const{placement:t,platform:n,elements:i}=r,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Bt(t),a=Vt(t),l=nr(t)==="y",u=Nw.has(o)?-1:1,c=s&&l?-1:1,d=kr(e,r);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(f=a==="end"?m*-1:m),l?{x:f*c,y:h*u}:{x:h*u,y:f*c}}const Iw=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(e){var t,n;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await Dw(e,r);return o===((t=a.offset)==null?void 0:t.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Rw=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(e){const{x:t,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:y=>{let{x:w,y:k}=y;return{x:w,y:k}}},...l}=kr(r,e),u={x:t,y:n},c=await Un(e,l),d=nr(Bt(i)),h=Em(d);let f=u[h],m=u[d];if(s){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",k=f+c[y],E=f-c[w];f=b0(k,f,E)}if(o){const y=d==="y"?"top":"left",w=d==="y"?"bottom":"right",k=m+c[y],E=m-c[w];m=b0(k,m,E)}const v=a.fn({...e,[h]:f,[d]:m});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[h]:s,[d]:o}}}}}},Pw=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(e){var t,n;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...u}=kr(r,e),c=await Un(e,u),d=Bt(i),h=Vt(i),f=nr(i)==="y",{width:m,height:v}=s.floating;let y,w;d==="top"||d==="bottom"?(y=d,w=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(w=d,y=h==="end"?"top":"bottom");const k=v-c.top-c.bottom,E=m-c.left-c.right,R=tr(v-c[y],k),O=tr(m-c[w],E),N=!e.middlewareData.shift;let D=R,B=O;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(B=E),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(D=k),N&&!h){const V=ht(c.left,0),te=ht(c.right,0),ne=ht(c.top,0),fe=ht(c.bottom,0);f?B=m-2*(V!==0||te!==0?V+te:ht(c.left,c.right)):D=v-2*(ne!==0||fe!==0?ne+fe:ht(c.top,c.bottom))}await l({...e,availableWidth:B,availableHeight:D});const L=await o.getDimensions(a.floating);return m!==L.width||v!==L.height?{reset:{rects:!0}}:{}}}};function Eo(){return typeof window<"u"}function Gn(r){return zm(r)?(r.nodeName||"").toLowerCase():"#document"}function Et(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function Tr(r){var e;return(e=(zm(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function zm(r){return Eo()?r instanceof Node||r instanceof Et(r).Node:!1}function _t(r){return Eo()?r instanceof Element||r instanceof Et(r).Element:!1}function ir(r){return Eo()?r instanceof HTMLElement||r instanceof Et(r).HTMLElement:!1}function Lm(r){return!Eo()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Et(r).ShadowRoot}const zw=new Set(["inline","contents"]);function Hi(r){const{overflow:e,overflowX:t,overflowY:n,display:i}=jt(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!zw.has(i)}const Lw=new Set(["table","td","th"]);function Bw(r){return Lw.has(Gn(r))}const Fw=[":popover-open",":modal"];function Ao(r){return Fw.some(e=>{try{return r.matches(e)}catch{return!1}})}const $w=["transform","translate","scale","rotate","perspective"],Hw=["transform","translate","scale","rotate","perspective","filter"],Vw=["paint","layout","strict","content"];function k0(r){const e=T0(),t=_t(r)?jt(r):r;return $w.some(n=>t[n]?t[n]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||Hw.some(n=>(t.willChange||"").includes(n))||Vw.some(n=>(t.contain||"").includes(n))}function _w(r){let e=Qr(r);for(;ir(e)&&!Kn(e);){if(k0(e))return e;if(Ao(e))return null;e=Qr(e)}return null}function T0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const jw=new Set(["html","body","#document"]);function Kn(r){return jw.has(Gn(r))}function jt(r){return Et(r).getComputedStyle(r)}function Oo(r){return _t(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function Qr(r){if(Gn(r)==="html")return r;const e=r.assignedSlot||r.parentNode||Lm(r)&&r.host||Tr(r);return Lm(e)?e.host:e}function Bm(r){const e=Qr(r);return Kn(e)?r.ownerDocument?r.ownerDocument.body:r.body:ir(e)&&Hi(e)?e:Bm(e)}function Fm(r,e,t){var n;e===void 0&&(e=[]);const i=Bm(r),s=i===((n=r.ownerDocument)==null?void 0:n.body),o=Et(i);return s?(M0(o),e.concat(o,o.visualViewport||[],Hi(i)?i:[],[])):e.concat(i,Fm(i,[]))}function M0(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function $m(r){const e=jt(r);let t=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=ir(r),s=i?r.offsetWidth:t,o=i?r.offsetHeight:n,a=To(t)!==s||To(n)!==o;return a&&(t=s,n=o),{width:t,height:n,$:a}}function Hm(r){return _t(r)?r:r.contextElement}function Jn(r){const e=Hm(r);if(!ir(e))return rr(1);const t=e.getBoundingClientRect(),{width:n,height:i,$:s}=$m(e);let o=(s?To(t.width):t.width)/n,a=(s?To(t.height):t.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const qw=rr(0);function Vm(r){const e=Et(r);return!T0()||!e.visualViewport?qw:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ww(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==Et(r)?!1:e}function Vi(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=r.getBoundingClientRect(),s=Hm(r);let o=rr(1);e&&(n?_t(n)&&(o=Jn(n)):o=Jn(r));const a=Ww(s,t,n)?Vm(s):rr(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const h=Et(s),f=n&&_t(n)?Et(n):n;let m=h,v=M0(m);for(;v&&n&&f!==m;){const y=Jn(v),w=v.getBoundingClientRect(),k=jt(v),E=w.left+(v.clientLeft+parseFloat(k.paddingLeft))*y.x,R=w.top+(v.clientTop+parseFloat(k.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=E,u+=R,m=Et(v),v=M0(m)}}return Wn({width:c,height:d,x:l,y:u})}function No(r,e){const t=Oo(r).scrollLeft;return e?e.left+t:Vi(Tr(r)).left+t}function _m(r,e){const t=r.getBoundingClientRect(),n=t.left+e.scrollLeft-No(r,t),i=t.top+e.scrollTop;return{x:n,y:i}}function Uw(r){let{elements:e,rect:t,offsetParent:n,strategy:i}=r;const s=i==="fixed",o=Tr(n),a=e?Ao(e.floating):!1;if(n===o||a&&s)return t;let l={scrollLeft:0,scrollTop:0},u=rr(1);const c=rr(0),d=ir(n);if((d||!d&&!s)&&((Gn(n)!=="body"||Hi(o))&&(l=Oo(n)),ir(n))){const f=Vi(n);u=Jn(n),c.x=f.x+n.clientLeft,c.y=f.y+n.clientTop}const h=o&&!d&&!s?_m(o,l):rr(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:t.y*u.y-l.scrollTop*u.y+c.y+h.y}}function Gw(r){return Array.from(r.getClientRects())}function Kw(r){const e=Tr(r),t=Oo(r),n=r.ownerDocument.body,i=ht(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=ht(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+No(r);const a=-t.scrollTop;return jt(n).direction==="rtl"&&(o+=ht(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}const jm=25;function Jw(r,e){const t=Et(r),n=Tr(r),i=t.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=T0();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=No(n);if(u<=0){const c=n.ownerDocument,d=c.body,h=getComputedStyle(d),f=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(n.clientWidth-d.clientWidth-f);m<=jm&&(s-=m)}else u<=jm&&(s+=u);return{width:s,height:o,x:a,y:l}}const Yw=new Set(["absolute","fixed"]);function Xw(r,e){const t=Vi(r,!0,e==="fixed"),n=t.top+r.clientTop,i=t.left+r.clientLeft,s=ir(r)?Jn(r):rr(1),o=r.clientWidth*s.x,a=r.clientHeight*s.y,l=i*s.x,u=n*s.y;return{width:o,height:a,x:l,y:u}}function qm(r,e,t){let n;if(e==="viewport")n=Jw(r,t);else if(e==="document")n=Kw(Tr(r));else if(_t(e))n=Xw(e,t);else{const i=Vm(r);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Wn(n)}function Wm(r,e){const t=Qr(r);return t===e||!_t(t)||Kn(t)?!1:jt(t).position==="fixed"||Wm(t,e)}function Zw(r,e){const t=e.get(r);if(t)return t;let n=Fm(r,[]).filter(a=>_t(a)&&Gn(a)!=="body"),i=null;const s=jt(r).position==="fixed";let o=s?Qr(r):r;for(;_t(o)&&!Kn(o);){const a=jt(o),l=k0(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&Yw.has(i.position)||Hi(o)&&!l&&Wm(r,o))?n=n.filter(c=>c!==o):i=a,o=Qr(o)}return e.set(r,n),n}function Qw(r){let{element:e,boundary:t,rootBoundary:n,strategy:i}=r;const o=[...t==="clippingAncestors"?Ao(e)?[]:Zw(e,this._c):[].concat(t),n],a=o[0],l=o.reduce((u,c)=>{const d=qm(e,c,i);return u.top=ht(d.top,u.top),u.right=tr(d.right,u.right),u.bottom=tr(d.bottom,u.bottom),u.left=ht(d.left,u.left),u},qm(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ex(r){const{width:e,height:t}=$m(r);return{width:e,height:t}}function tx(r,e,t){const n=ir(e),i=Tr(e),s=t==="fixed",o=Vi(r,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=rr(0);function u(){l.x=No(i)}if(n||!n&&!s)if((Gn(e)!=="body"||Hi(i))&&(a=Oo(e)),n){const f=Vi(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&u();s&&!n&&i&&u();const c=i&&!n&&!s?_m(i,a):rr(0),d=o.left+a.scrollLeft-l.x-c.x,h=o.top+a.scrollTop-l.y-c.y;return{x:d,y:h,width:o.width,height:o.height}}function C0(r){return jt(r).position==="static"}function Um(r,e){if(!ir(r)||jt(r).position==="fixed")return null;if(e)return e(r);let t=r.offsetParent;return Tr(r)===t&&(t=t.ownerDocument.body),t}function Gm(r,e){const t=Et(r);if(Ao(r))return t;if(!ir(r)){let i=Qr(r);for(;i&&!Kn(i);){if(_t(i)&&!C0(i))return i;i=Qr(i)}return t}let n=Um(r,e);for(;n&&Bw(n)&&C0(n);)n=Um(n,e);return n&&Kn(n)&&C0(n)&&!k0(n)?t:n||_w(r)||t}const rx=async function(r){const e=this.getOffsetParent||Gm,t=this.getDimensions,n=await t(r.floating);return{reference:tx(r.reference,await e(r.floating),r.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function nx(r){return jt(r).direction==="rtl"}const ix={convertOffsetParentRelativeRectToViewportRelativeRect:Uw,getDocumentElement:Tr,getClippingRect:Qw,getOffsetParent:Gm,getElementRects:rx,getClientRects:Gw,getDimensions:ex,getScale:Jn,isElement:_t,isRTL:nx},Km=Iw,Jm=Mw,Ym=Rw,Xm=Cw,Zm=Pw,Qm=Ew,e1=kw,t1=Ow,r1=(r,e,t)=>{const n=new Map,i={platform:ix,...t},s={...i.platform,_c:n};return Sw(r,e,{...i,platform:s})};let E0,A0;if(typeof WeakMap<"u"){let r=new WeakMap;E0=e=>r.get(e),A0=(e,t)=>(r.set(e,t),t)}else{const r=[];let t=0;E0=n=>{for(let i=0;i<r.length;i+=2)if(r[i]==n)return r[i+1]},A0=(n,i)=>(t==10&&(t=0),r[t++]=n,r[t++]=i)}var Mr=class{constructor(r,e,t,n){this.width=r,this.height=e,this.map=t,this.problems=n}findCell(r){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=r)continue;const n=e%this.width,i=e/this.width|0;let s=n+1,o=i+1;for(let a=1;s<this.width&&this.map[e+a]==t;a++)s++;for(let a=1;o<this.height&&this.map[e+this.width*a]==t;a++)o++;return{left:n,top:i,right:s,bottom:o}}throw new RangeError(`No cell with offset ${r} found`)}colCount(r){for(let e=0;e<this.map.length;e++)if(this.map[e]==r)return e%this.width;throw new RangeError(`No cell with offset ${r} found`)}nextCell(r,e,t){const{left:n,right:i,top:s,bottom:o}=this.findCell(r);return e=="horiz"?(t<0?n==0:i==this.width)?null:this.map[s*this.width+(t<0?n-1:i)]:(t<0?s==0:o==this.height)?null:this.map[n+this.width*(t<0?s-1:o)]}rectBetween(r,e){const{left:t,right:n,top:i,bottom:s}=this.findCell(r),{left:o,right:a,top:l,bottom:u}=this.findCell(e);return{left:Math.min(t,o),top:Math.min(i,l),right:Math.max(n,a),bottom:Math.max(s,u)}}cellsInRect(r){const e=[],t={};for(let n=r.top;n<r.bottom;n++)for(let i=r.left;i<r.right;i++){const s=n*this.width+i,o=this.map[s];t[o]||(t[o]=!0,!(i==r.left&&i&&this.map[s-1]==o||n==r.top&&n&&this.map[s-this.width]==o)&&e.push(o))}return e}positionAt(r,e,t){for(let n=0,i=0;;n++){const s=i+t.child(n).nodeSize;if(n==r){let o=e+r*this.width;const a=(r+1)*this.width;for(;o<a&&this.map[o]<i;)o++;return o==a?s-1:this.map[o]}i=s}}static get(r){return E0(r)||A0(r,sx(r))}};function sx(r){if(r.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+r.type.name);const e=ox(r),t=r.childCount,n=[];let i=0,s=null;const o=[];for(let u=0,c=e*t;u<c;u++)n[u]=0;for(let u=0,c=0;u<t;u++){const d=r.child(u);c++;for(let m=0;;m++){for(;i<n.length&&n[i]!=0;)i++;if(m==d.childCount)break;const v=d.child(m),{colspan:y,rowspan:w,colwidth:k}=v.attrs;for(let E=0;E<w;E++){if(E+u>=t){(s||(s=[])).push({type:"overlong_rowspan",pos:c,n:w-E});break}const R=i+E*e;for(let O=0;O<y;O++){n[R+O]==0?n[R+O]=c:(s||(s=[])).push({type:"collision",row:u,pos:c,n:y-O});const N=k&&k[O];if(N){const D=(R+O)%e*2,B=o[D];B==null||B!=N&&o[D+1]==1?(o[D]=N,o[D+1]=1):B==N&&o[D+1]++}}}i+=y,c+=v.nodeSize}const h=(u+1)*e;let f=0;for(;i<h;)n[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:u,n:f}),c++}(e===0||t===0)&&(s||(s=[])).push({type:"zero_sized"});const a=new Mr(e,t,n,s);let l=!1;for(let u=0;!l&&u<o.length;u+=2)o[u]!=null&&o[u+1]<t&&(l=!0);return l&&ax(a,o,r),a}function ox(r){let e=-1,t=!1;for(let n=0;n<r.childCount;n++){const i=r.child(n);let s=0;if(t)for(let o=0;o<n;o++){const a=r.child(o);for(let l=0;l<a.childCount;l++){const u=a.child(l);o+u.attrs.rowspan>n&&(s+=u.attrs.colspan)}}for(let o=0;o<i.childCount;o++){const a=i.child(o);s+=a.attrs.colspan,a.attrs.rowspan>1&&(t=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function ax(r,e,t){r.problems||(r.problems=[]);const n={};for(let i=0;i<r.map.length;i++){const s=r.map[i];if(n[s])continue;n[s]=!0;const o=t.nodeAt(s);if(!o)throw new RangeError(`No cell with offset ${s} found`);let a=null;const l=o.attrs;for(let u=0;u<l.colspan;u++){const c=e[(i+u)%r.width*2];c!=null&&(!l.colwidth||l.colwidth[u]!=c)&&((a||(a=lx(l)))[u]=c)}a&&r.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function lx(r){if(r.colwidth)return r.colwidth.slice();const e=[];for(let t=0;t<r.colspan;t++)e.push(0);return e}function O0(r){let e=r.cached.tableNodeTypes;if(!e){e=r.cached.tableNodeTypes={};for(const t in r.nodes){const n=r.nodes[t],i=n.spec.tableRole;i&&(e[i]=n)}}return e}new Ve("selectingCells");function ux(r){for(let e=r.depth-1;e>0;e--)if(r.node(e).type.spec.tableRole=="row")return r.node(0).resolve(r.before(e+1));return null}function n1(r){const e=r.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function cx(r){const e=r.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const t=ux(e.$head)||dx(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function dx(r){for(let e=r.nodeAfter,t=r.pos;e;e=e.firstChild,t++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return r.doc.resolve(t)}for(let e=r.nodeBefore,t=r.pos;e;e=e.lastChild,t--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return r.doc.resolve(t-e.nodeSize)}}function i1(r){return r.parent.type.spec.tableRole=="row"&&!!r.nodeAfter}function s1(r,e){return r.depth==e.depth&&r.pos>=e.start(-1)&&r.pos<=e.end(-1)}function o1(r,e,t){const n=r.node(-1),i=Mr.get(n),s=r.start(-1),o=i.nextCell(r.pos-s,e,t);return o==null?null:r.node(0).resolve(s+o)}function a1(r,e,t=1){const n={...r,colspan:r.colspan-t};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,t),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}var sr=class Cr extends le{constructor(e,t=e){const n=e.node(-1),i=Mr.get(n),s=e.start(-1),o=i.rectBetween(e.pos-s,t.pos-s),a=e.node(0),l=i.cellsInRect(o).filter(c=>c!=t.pos-s);l.unshift(t.pos-s);const u=l.map(c=>{const d=n.nodeAt(c);if(!d)throw new RangeError(`No cell with offset ${c} found`);const h=s+c+1;return new wc(a.resolve(h),a.resolve(h+d.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=t}map(e,t){const n=e.resolve(t.map(this.$anchorCell.pos)),i=e.resolve(t.map(this.$headCell.pos));if(i1(n)&&i1(i)&&s1(n,i)){const s=this.$anchorCell.node(-1)!=n.node(-1);return s&&this.isRowSelection()?Cr.rowSelection(n,i):s&&this.isColSelection()?Cr.colSelection(n,i):new Cr(n,i)}return de.between(n,i)}content(){const e=this.$anchorCell.node(-1),t=Mr.get(e),n=this.$anchorCell.start(-1),i=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),s={},o=[];for(let l=i.top;l<i.bottom;l++){const u=[];for(let c=l*t.width+i.left,d=i.left;d<i.right;d++,c++){const h=t.map[c];if(s[h])continue;s[h]=!0;const f=t.findCell(h);let m=e.nodeAt(h);if(!m)throw new RangeError(`No cell with offset ${h} found`);const v=i.left-f.left,y=f.right-i.right;if(v>0||y>0){let w=m.attrs;if(v>0&&(w=a1(w,0,v)),y>0&&(w=a1(w,w.colspan-y,y)),f.left<i.left){if(m=m.type.createAndFill(w),!m)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else m=m.type.create(w,m.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...m.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?m=m.type.createAndFill(w):m=m.type.create(w,m.content)}u.push(m)}o.push(e.child(l).copy(F.from(u)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new U(F.from(a),1,1)}replace(e,t=U.empty){const n=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){const{$from:a,$to:l}=i[o],u=e.mapping.slice(n);e.replace(u.map(a.pos),u.map(l.pos),o?U.empty:t)}const s=le.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,t){this.replace(e,new U(F.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=Mr.get(t),i=this.$anchorCell.start(-1),s=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<s.length;o++)e(t.nodeAt(s[o]),i+s[o])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const n=e.node(-1),i=Mr.get(n),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(t.pos-s),l=e.node(0);return o.top<=a.top?(o.top>0&&(e=l.resolve(s+i.map[o.left])),a.bottom<i.height&&(t=l.resolve(s+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(t=l.resolve(s+i.map[a.left])),o.bottom<i.height&&(e=l.resolve(s+i.map[i.width*(i.height-1)+o.right-1]))),new Cr(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=Mr.get(e),n=this.$anchorCell.start(-1),i=t.colCount(this.$anchorCell.pos-n),s=t.colCount(this.$headCell.pos-n);if(Math.min(i,s)>0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,a=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==t.width}eq(e){return e instanceof Cr&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const n=e.node(-1),i=Mr.get(n),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(t.pos-s),l=e.node(0);return o.left<=a.left?(o.left>0&&(e=l.resolve(s+i.map[o.top*i.width])),a.right<i.width&&(t=l.resolve(s+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(t=l.resolve(s+i.map[a.top*i.width])),o.right<i.width&&(e=l.resolve(s+i.map[i.width*(o.top+1)-1]))),new Cr(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new Cr(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){return new Cr(e.resolve(t),e.resolve(n))}getBookmark(){return new fx(this.$anchorCell.pos,this.$headCell.pos)}};sr.prototype.visible=!1,le.jsonID("cell",sr);var fx=class A1{constructor(e,t){this.anchor=e,this.head=t}map(e){return new A1(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&n.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&s1(t,n)?new sr(t,n):le.near(n,1)}};new Ve("fix-tables");function l1(r){const e=r.selection,t=cx(r),n=t.node(-1),i=t.start(-1),s=Mr.get(n);return{...e instanceof sr?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(t.pos-i),tableStart:i,map:s,table:n}}function hx(r){return function(e,t){if(!n1(e))return!1;if(t){const n=O0(e.schema),i=l1(e),s=e.tr,o=i.map.cellsInRect(r=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:r=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=o.map(l=>i.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==n.header_cell&&s.setNodeMarkup(i.tableStart+o[l],n.cell,a[l].attrs);if(s.steps.length===0)for(let l=0;l<o.length;l++)s.setNodeMarkup(i.tableStart+o[l],n.header_cell,a[l].attrs);t(s)}return!0}}function u1(r,e,t){const n=e.map.cellsInRect({left:0,top:0,right:r=="row"?e.map.width:1,bottom:r=="column"?e.map.height:1});for(let i=0;i<n.length;i++){const s=e.table.nodeAt(n[i]);if(s&&s.type!==t.header_cell)return!1}return!0}function N0(r,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?hx(r):function(t,n){if(!n1(t))return!1;if(n){const i=O0(t.schema),s=l1(t),o=t.tr,a=u1("row",s,i),l=u1("column",s,i),u=(r==="column"?a:r==="row"&&l)?1:0,c=r=="column"?{left:0,top:u,right:1,bottom:s.map.height}:r=="row"?{left:u,top:0,right:s.map.width,bottom:1}:s,d=r=="column"?l?i.cell:i.header_cell:r=="row"?a?i.cell:i.header_cell:i.cell;s.map.cellsInRect(c).forEach(h=>{const f=h+s.tableStart,m=o.doc.nodeAt(f);m&&o.setNodeMarkup(f,d,m.attrs)}),n(o)}return!0}}N0("row",{useDeprecatedLogic:!0}),N0("column",{useDeprecatedLogic:!0}),N0("cell",{useDeprecatedLogic:!0});function Do(r,e){const t=r.selection;if(!(t instanceof sr))return!1;if(e){const n=r.tr,i=O0(r.schema).cell.createAndFill().content;t.forEachCell((s,o)=>{s.content.eq(i)||n.replace(n.mapping.map(o+1),n.mapping.map(o+s.nodeSize-1),new U(i,0,0))}),n.docChanged&&e(n)}return!0}Wa({ArrowLeft:Ro("horiz",-1),ArrowRight:Ro("horiz",1),ArrowUp:Ro("vert",-1),ArrowDown:Ro("vert",1),"Shift-ArrowLeft":Po("horiz",-1),"Shift-ArrowRight":Po("horiz",1),"Shift-ArrowUp":Po("vert",-1),"Shift-ArrowDown":Po("vert",1),Backspace:Do,"Mod-Backspace":Do,Delete:Do,"Mod-Delete":Do});function Io(r,e,t){return t.eq(r.selection)?!1:(e&&e(r.tr.setSelection(t).scrollIntoView()),!0)}function Ro(r,e){return(t,n,i)=>{if(!i)return!1;const s=t.selection;if(s instanceof sr)return Io(t,n,le.near(s.$headCell,e));if(r!="horiz"&&!s.empty)return!1;const o=c1(i,r,e);if(o==null)return!1;if(r=="horiz")return Io(t,n,le.near(t.doc.resolve(s.head+e),e));{const a=t.doc.resolve(o),l=o1(a,r,e);let u;return l?u=le.near(l,1):e<0?u=le.near(t.doc.resolve(a.before(-1)),-1):u=le.near(t.doc.resolve(a.after(-1)),1),Io(t,n,u)}}}function Po(r,e){return(t,n,i)=>{if(!i)return!1;const s=t.selection;let o;if(s instanceof sr)o=s;else{const l=c1(i,r,e);if(l==null)return!1;o=new sr(t.doc.resolve(l))}const a=o1(o.$headCell,r,e);return a?Io(t,n,new sr(o.$anchorCell,a)):!1}}function c1(r,e,t){if(!(r.state.selection instanceof de))return null;const{$head:n}=r.state.selection;for(let i=n.depth-1;i>=0;i--){const s=n.node(i);if((t<0?n.index(i):n.indexAfter(i))!=(t<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const o=n.before(i),a=e=="vert"?t>0?"down":"up":t>0?"right":"left";return r.endOfTextblock(a)?o:null}}return null}new Ve("tableColumnResizing");function px(r,e){const t=Math.min(r.top,e.top),n=Math.max(r.bottom,e.bottom),i=Math.min(r.left,e.left),o=Math.max(r.right,e.right)-i,a=n-t,l=i,u=t;return new DOMRect(l,u,o,a)}var mx=class{constructor({editor:r,element:e,view:t,updateDelay:n=250,resizeDelay:i=60,shouldShow:s,appendTo:o,getReferencedVirtualElement:a,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:c,state:d,from:h,to:f})=>{const{doc:m,selection:v}=d,{empty:y}=v,w=!m.textBetween(h,f).length&&Ja(d.selection),k=this.element.contains(document.activeElement);return!(!(c.hasFocus()||k)||y||w||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:c})=>{var d;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}c?.relatedTarget&&((d=this.element.parentNode)!=null&&d.contains(c.relatedTarget))||c?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(c,d)=>{const h=!d?.selection.eq(c.state.selection),f=!d?.doc.eq(c.state.doc);!h&&!f||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(c,h,f,d)},this.updateDelay))},this.updateHandler=(c,d,h,f)=>{const{composing:m}=c;if(m||!d&&!h)return;if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()},this.transactionHandler=({transaction:c})=>{c.getMeta("bubbleMenu")==="updatePosition"&&this.updatePosition()};var u;this.editor=r,this.element=e,this.view=t,this.updateDelay=n,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=(u=l?.scrollTarget)!=null?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,s&&(this.shouldShow=s),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.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(t,t.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const r=[];return this.floatingUIOptions.flip&&r.push(Xm(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&r.push(Ym(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&r.push(Km(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&r.push(e1(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&r.push(Zm(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&r.push(Jm(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&r.push(Qm(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&r.push(t1(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),r}get virtualElement(){var r;const{selection:e}=this.editor.state,t=(r=this.getReferencedVirtualElement)==null?void 0:r.call(this);if(t)return t;const n=Tf(this.view,e.from,e.to);let i={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof ie){let s=this.view.nodeDOM(e.from);const o=s.dataset.nodeViewWrapper?s:s.querySelector("[data-node-view-wrapper]");o&&(s=o),s&&(i={getBoundingClientRect:()=>s.getBoundingClientRect(),getClientRects:()=>[s.getBoundingClientRect()]})}if(e instanceof sr){const{$anchorCell:s,$headCell:o}=e,a=s?s.pos:o.pos,l=o?o.pos:s.pos,u=this.view.nodeDOM(a),c=this.view.nodeDOM(l);if(!u||!c)return;const d=u===c?u.getBoundingClientRect():px(u.getBoundingClientRect(),c.getBoundingClientRect());i={getBoundingClientRect:()=>d,getClientRects:()=>[d]}}return i}updatePosition(){const r=this.virtualElement;r&&r1(r,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n})=>{this.element.style.width="max-content",this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(r,e){const{state:t}=r,n=t.selection.from!==t.selection.to;if(this.updateDelay>0&&n){this.handleDebouncedUpdate(r,e);return}const i=!e?.selection.eq(r.state.selection),s=!e?.doc.eq(r.state.doc);this.updateHandler(r,i,s,e)}getShouldShow(r){var e;const{state:t}=this.view,{selection:n}=t,{ranges:i}=n,s=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:r,from:s,to:o}))||!1}show(){var r;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(r=e??this.view.dom.parentElement)==null||r.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},d1=r=>new Be({key:typeof r.pluginKey=="string"?new Ve(r.pluginKey):r.pluginKey,view:e=>new mx({view:e,...r})});Se.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[d1({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var gx=class{constructor({editor:r,element:e,view:t,options:n,appendTo:i,shouldShow:s}){this.preventHide=!1,this.isVisible=!1,this.shouldShow=({view:o,state:a})=>{const{selection:l}=a,{$anchor:u,empty:c}=l,d=u.depth===1,h=u.parent.isTextblock&&!u.parent.type.spec.code&&!u.parent.textContent&&u.parent.childCount===0&&!this.getTextContent(u.parent);return!(!o.hasFocus()||!c||!d||!h||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(o,a,l,u)=>{const{composing:c}=o;if(c||!a&&!l)return;if(!this.getShouldShow(u)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:o})=>{var a;if(this.preventHide){this.preventHide=!1;return}o?.relatedTarget&&((a=this.element.parentNode)!=null&&a.contains(o.relatedTarget))||o?.relatedTarget!==this.editor.view.dom&&this.hide()},this.editor=r,this.element=e,this.view=t,this.appendTo=i,this.floatingUIOptions={...this.floatingUIOptions,...n},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.update(t,t.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(r){return bf(r,{textSerializers:el(this.editor.schema)})}get middlewares(){const r=[];return this.floatingUIOptions.flip&&r.push(Xm(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&r.push(Ym(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&r.push(Km(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&r.push(e1(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&r.push(Zm(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&r.push(Jm(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&r.push(Qm(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&r.push(t1(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),r}getShouldShow(r){var e;const{state:t}=this.view,{selection:n}=t,{ranges:i}=n,s=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:t,oldState:r,from:s,to:o})}updatePosition(){const{selection:r}=this.editor.state,e=Tf(this.view,r.from,r.to);r1({getBoundingClientRect:()=>e,getClientRects:()=>[e]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:n,y:i,strategy:s})=>{this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${n}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(r,e){const t=!e?.selection.eq(r.state.selection),n=!e?.doc.eq(r.state.doc);this.updateHandler(r,t,n,e)}show(){var r;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(r=e??this.view.dom.parentElement)==null||r.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},f1=r=>new Be({key:typeof r.pluginKey=="string"?new Ve(r.pluginKey):r.pluginKey,view:e=>new gx({view:e,...r})});Se.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[f1({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var vx=z.forwardRef(({pluginKey:r="bubbleMenu",editor:e,updateDelay:t,resizeDelay:n,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:o,options:a,children:l,...u},c)=>{const d=z.useRef(document.createElement("div"));typeof c=="function"?c(d.current):c&&(c.current=d.current);const{editor:h}=lh(),f=e||h,m={updateDelay:t,resizeDelay:n,appendTo:i,pluginKey:r,shouldShow:s,getReferencedVirtualElement:o,options:a},v=z.useRef(m);return v.current=m,z.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=d.current;y.style.visibility="hidden",y.style.position="absolute";const w=d1({...v.current,editor:f,element:y});f.registerPlugin(w);const k=v.current.pluginKey;return()=>{f.unregisterPlugin(k),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),Ui.createPortal(Y.jsx("div",{...u,children:l}),d.current)});z.forwardRef(({pluginKey:r="floatingMenu",editor:e,appendTo:t,shouldShow:n=null,options:i,children:s,...o},a)=>{const l=z.useRef(document.createElement("div"));typeof a=="function"?a(l.current):a&&(a.current=l.current);const{editor:u}=lh();return z.useEffect(()=>{const c=l.current;if(c.style.visibility="hidden",c.style.position="absolute",e?.isDestroyed||u?.isDestroyed)return;const d=e||u;if(!d){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const h=f1({editor:d,element:c,pluginKey:r,appendTo:t,shouldShow:n,options:i});return d.registerPlugin(h),()=>{d.unregisterPlugin(r),window.requestAnimationFrame(()=>{c.parentNode&&c.parentNode.removeChild(c)})}},[e,u,t,r,n,i]),Ui.createPortal(Y.jsx("div",{...o,children:s}),l.current)});const yx=({editor:r})=>{if(!r)return null;const[e]=z.useState(!0),[t]=z.useState(!0);z.useEffect(()=>{r&&r.setEditable(t)},[t,r]);const n=sh({editor:r,selector:i=>({isTerm:i.editor.isActive("term"),canTerm:i.editor.can().chain().focus().toggleMark("term").run(),isEm:i.editor.isActive("em"),canEm:i.editor.can().chain().focus().toggleMark("em").run(),isAlert:i.editor.isActive("alert"),canAlert:i.editor.can().chain().focus().toggleMark("alert").run()})});return Y.jsx(Y.Fragment,{children:r&&e&&Y.jsx(vx,{shouldShow:null,editor:r,options:{placement:"bottom",autoPlacement:!0,offset:8},children:Y.jsxs("div",{className:"button-group",children:[Y.jsx("button",{onClick:()=>r.chain().focus().toggleMark("em").run(),disabled:!n.canEm,className:n.isEm?"is-active":"",children:"<em>"}),Y.jsx("button",{onClick:()=>r.chain().focus().toggleMark("term").run(),disabled:!n.canTerm,className:n.isTerm?"is-active":"",children:"<term>"}),Y.jsx("button",{onClick:()=>r.chain().focus().toggleMark("alert").run(),disabled:!n.canAlert,className:n.isAlert?"is-active":"",children:"<alert>"})]})})})},h1=["abstract","acknowledgement","affiliation","appendix","article","author","backmatter","biography","book","chapter","colophon","contributor","contributors","copyright","credit","dedication","docinfo","editor","feedback","frontmatter","google","html","index","macros","mathbook","preface","pretext","references","search","shortlicense","solutions","subsection","titlepage","website"],p1=["assemblage","chapter","conclusion","introduction","objectives","outcomes","paragraphs","part","postlude","prelude","reading-questions","sbsgroup","section","stack","subsection","subsubsection","task","technology","worksheet"],m1=["activity","algorithm","answer","axiom","biblio","blockquote","case","choice","choices","claim","conjecture","console","corollary","definition","demonstration","description","example","exercise","exploration","fact","hint","image","images","insight","investigation","lemma","list","listing","note","openconjecture","openproblem","openquestion","page","poem","principle","problem","program","project","proof","proposition","question","remark","shortdescription","solution","stanza","statement","subtask","table","tabular","theorem","warning","webwork"],bx=["address","attribution","caption","cd","cell","cline","date","department","description","edition","entity","holder","idx","institution","journal","line","location","minilicense","mrow","personname","pg-macros","pubtitle","row","subtitle","support","title","usage","volume","year","xi:include"],wx=["me","men","md","mdn"],g1=["ul","ol","li","p","task","figure","sidebyside","notation","row"],zo=["latex-image-preamble","latex-image","latex-preamble","slate","sage","sageplot","asymptote","macros","prefigure","program","input","output","prompt","pre","pg-code","tikzpicture","tikz","code","c"],xx=[...h1,...p1,...m1,...g1,"xi:include"],D0=[...h1,...p1,...m1,...g1,...wx];function Sx(r){let e=!1,t=r.split(/\r\n|\r|\n/g),n=[t[0].trim()];t.length>1&&n.push(t[1].trim());for(let i=2;i<t.length;i++){let s=/^<(\w\S*?)(\s.*?|>)$/.exec(t[i].trim()),o=/^<\/(\w\S*?)(\s.*?|>)(.?)$/.exec(t[i].trim());if(s&&zo.includes(s[1]))n.push(t[i]),e=!0;else if(o&&zo.includes(o[1]))n.push(t[i]),e=!1;else if(e)n.push(t[i]);else{t[i]=t[i].trim();let a=n.pop();a?n.push(a.trim()+" "+t[i]):n.push(t[i])}}return n.join(`
|
|
902
|
-
`)}function
|
|
934
|
+
`}}else if(r.type==="text")if(r.marks){const t=r.marks[0].type in sa?sa[r.marks[0].type]:r.marks[0].type;e=e+"<"+t+">"+C1(r.text)+"</"+t+">"}else e=e+C1(r.text);else r.type==="hardBreak"?e=e+`
|
|
935
|
+
`:e=e+"<!-- Something is missing; got "+JSON.stringify(r)+" -->";return e}const E1=["top","right","bottom","left"],A1=["start","end"],O1=E1.reduce((r,e)=>r.concat(e,e+"-"+A1[0],e+"-"+A1[1]),[]),ur=Math.min,bt=Math.max,oa=Math.round,cr=r=>({x:r,y:r}),Ux={left:"right",right:"left",bottom:"top",top:"bottom"},Kx={start:"end",end:"start"};function du(r,e,t){return bt(r,ur(e,t))}function Rr(r,e){return typeof r=="function"?r(e):r}function Wt(r){return r.split("-")[0]}function Yt(r){return r.split("-")[1]}function N1(r){return r==="x"?"y":"x"}function fu(r){return r==="y"?"height":"width"}const Gx=new Set(["top","bottom"]);function dr(r){return Gx.has(Wt(r))?"y":"x"}function hu(r){return N1(dr(r))}function D1(r,e,t){t===void 0&&(t=!1);const n=Yt(r),i=hu(r),s=fu(i);let o=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=la(o)),[o,la(o)]}function Jx(r){const e=la(r);return[aa(r),e,aa(e)]}function aa(r){return r.replace(/start|end/g,e=>Kx[e])}const P1=["left","right"],I1=["right","left"],Yx=["top","bottom"],Xx=["bottom","top"];function Zx(r,e,t){switch(r){case"top":case"bottom":return t?e?I1:P1:e?P1:I1;case"left":case"right":return e?Yx:Xx;default:return[]}}function Qx(r,e,t,n){const i=Yt(r);let s=Zx(Wt(r),t==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(aa)))),s}function la(r){return r.replace(/left|right|bottom|top/g,e=>Ux[e])}function eS(r){return{top:0,right:0,bottom:0,left:0,...r}}function pu(r){return typeof r!="number"?eS(r):{top:r,right:r,bottom:r,left:r}}function di(r){const{x:e,y:t,width:n,height:i}=r;return{width:n,height:i,top:t,left:e,right:e+n,bottom:t+i,x:e,y:t}}function R1(r,e,t){let{reference:n,floating:i}=r;const s=dr(e),o=hu(e),a=fu(o),l=Wt(e),u=s==="y",c=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,h=n[a]/2-i[a]/2;let f;switch(l){case"top":f={x:c,y:n.y-i.height};break;case"bottom":f={x:c,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:d};break;case"left":f={x:n.x-i.width,y:d};break;default:f={x:n.x,y:n.y}}switch(Yt(e)){case"start":f[o]-=h*(t&&u?-1:1);break;case"end":f[o]+=h*(t&&u?-1:1);break}return f}const tS=async(r,e,t)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=t,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:r,floating:e,strategy:i}),{x:c,y:d}=R1(u,n,l),h=n,f={},m=0;for(let v=0;v<a.length;v++){const{name:y,fn:w}=a[v],{x:k,y:E,data:I,reset:A}=await w({x:c,y:d,initialPlacement:n,placement:h,strategy:i,middlewareData:f,rects:u,platform:o,elements:{reference:r,floating:e}});c=k??c,d=E??d,f={...f,[y]:{...f[y],...I}},A&&m<=50&&(m++,typeof A=="object"&&(A.placement&&(h=A.placement),A.rects&&(u=A.rects===!0?await o.getElementRects({reference:r,floating:e,strategy:i}):A.rects),{x:c,y:d}=R1(u,h,l)),v=-1)}return{x:c,y:d,placement:h,strategy:i,middlewareData:f}};async function fi(r,e){var t;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:o,elements:a,strategy:l}=r,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=Rr(e,r),m=pu(f),y=a[h?d==="floating"?"reference":"floating":d],w=di(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(y)))==null||t?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),k=d==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),I=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},A=di(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:k,offsetParent:E,strategy:l}):k);return{top:(w.top-A.top+m.top)/I.y,bottom:(A.bottom-w.bottom+m.bottom)/I.y,left:(w.left-A.left+m.left)/I.x,right:(A.right-w.right+m.right)/I.x}}const rS=r=>({name:"arrow",options:r,async fn(e){const{x:t,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=Rr(r,e)||{};if(u==null)return{};const d=pu(c),h={x:t,y:n},f=hu(i),m=fu(f),v=await o.getDimensions(u),y=f==="y",w=y?"top":"left",k=y?"bottom":"right",E=y?"clientHeight":"clientWidth",I=s.reference[m]+s.reference[f]-h[f]-s.floating[m],A=h[f]-s.reference[f],N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let P=N?N[E]:0;(!P||!await(o.isElement==null?void 0:o.isElement(N)))&&(P=a.floating[E]||s.floating[m]);const L=I/2-A/2,z=P/2-v[m]/2-1,F=ur(d[w],z),re=ur(d[k],z),oe=F,ye=P-v[m]-re,ae=P/2-v[m]/2+L,G=du(oe,ae,ye),ee=!l.arrow&&Yt(i)!=null&&ae!==G&&s.reference[m]/2-(ae<oe?F:re)-v[m]/2<0,ke=ee?ae<oe?ae-oe:ae-ye:0;return{[f]:h[f]+ke,data:{[f]:G,centerOffset:ae-G-ke,...ee&&{alignmentOffset:ke}},reset:ee}}});function nS(r,e,t){return(r?[...t.filter(i=>Yt(i)===r),...t.filter(i=>Yt(i)!==r)]:t.filter(i=>Wt(i)===i)).filter(i=>r?Yt(i)===r||(e?aa(i)!==i:!1):!0)}const iS=function(r){return r===void 0&&(r={}),{name:"autoPlacement",options:r,async fn(e){var t,n,i;const{rects:s,middlewareData:o,placement:a,platform:l,elements:u}=e,{crossAxis:c=!1,alignment:d,allowedPlacements:h=O1,autoAlignment:f=!0,...m}=Rr(r,e),v=d!==void 0||h===O1?nS(d||null,f,h):h,y=await fi(e,m),w=((t=o.autoPlacement)==null?void 0:t.index)||0,k=v[w];if(k==null)return{};const E=D1(k,s,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(a!==k)return{reset:{placement:v[0]}};const I=[y[Wt(k)],y[E[0]],y[E[1]]],A=[...((n=o.autoPlacement)==null?void 0:n.overflows)||[],{placement:k,overflows:I}],N=v[w+1];if(N)return{data:{index:w+1,overflows:A},reset:{placement:N}};const P=A.map(F=>{const re=Yt(F.placement);return[F.placement,re&&c?F.overflows.slice(0,2).reduce((oe,ye)=>oe+ye,0):F.overflows[0],F.overflows]}).sort((F,re)=>F[1]-re[1]),z=((i=P.filter(F=>F[2].slice(0,Yt(F[0])?2:3).every(re=>re<=0))[0])==null?void 0:i[0])||P[0][0];return z!==a?{data:{index:w+1,overflows:A},reset:{placement:z}}:{}}}},sS=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(e){var t,n;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...y}=Rr(r,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const w=Wt(i),k=dr(a),E=Wt(a)===a,I=await(l.isRTL==null?void 0:l.isRTL(u.floating)),A=h||(E||!v?[la(a)]:Jx(a)),N=m!=="none";!h&&N&&A.push(...Qx(a,v,m,I));const P=[a,...A],L=await fi(e,y),z=[];let F=((n=s.flip)==null?void 0:n.overflows)||[];if(c&&z.push(L[w]),d){const ae=D1(i,o,I);z.push(L[ae[0]],L[ae[1]])}if(F=[...F,{placement:i,overflows:z}],!z.every(ae=>ae<=0)){var re,oe;const ae=(((re=s.flip)==null?void 0:re.index)||0)+1,G=P[ae];if(G&&(!(d==="alignment"?k!==dr(G):!1)||F.every(se=>dr(se.placement)===k?se.overflows[0]>0:!0)))return{data:{index:ae,overflows:F},reset:{placement:G}};let ee=(oe=F.filter(ke=>ke.overflows[0]<=0).sort((ke,se)=>ke.overflows[1]-se.overflows[1])[0])==null?void 0:oe.placement;if(!ee)switch(f){case"bestFit":{var ye;const ke=(ye=F.filter(se=>{if(N){const Te=dr(se.placement);return Te===k||Te==="y"}return!0}).map(se=>[se.placement,se.overflows.filter(Te=>Te>0).reduce((Te,C)=>Te+C,0)]).sort((se,Te)=>se[1]-Te[1])[0])==null?void 0:ye[0];ke&&(ee=ke);break}case"initialPlacement":ee=a;break}if(i!==ee)return{reset:{placement:ee}}}return{}}}};function z1(r,e){return{top:r.top-e.height,right:r.right-e.width,bottom:r.bottom-e.height,left:r.left-e.width}}function L1(r){return E1.some(e=>r[e]>=0)}const oS=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(e){const{rects:t}=e,{strategy:n="referenceHidden",...i}=Rr(r,e);switch(n){case"referenceHidden":{const s=await fi(e,{...i,elementContext:"reference"}),o=z1(s,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:L1(o)}}}case"escaped":{const s=await fi(e,{...i,altBoundary:!0}),o=z1(s,t.floating);return{data:{escapedOffsets:o,escaped:L1(o)}}}default:return{}}}}};function B1(r){const e=ur(...r.map(s=>s.left)),t=ur(...r.map(s=>s.top)),n=bt(...r.map(s=>s.right)),i=bt(...r.map(s=>s.bottom));return{x:e,y:t,width:n-e,height:i-t}}function aS(r){const e=r.slice().sort((i,s)=>i.y-s.y),t=[];let n=null;for(let i=0;i<e.length;i++){const s=e[i];!n||s.y-n.y>n.height/2?t.push([s]):t[t.length-1].push(s),n=s}return t.map(i=>di(B1(i)))}const lS=function(r){return r===void 0&&(r={}),{name:"inline",options:r,async fn(e){const{placement:t,elements:n,rects:i,platform:s,strategy:o}=e,{padding:a=2,x:l,y:u}=Rr(r,e),c=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(n.reference))||[]),d=aS(c),h=di(B1(c)),f=pu(a);function m(){if(d.length===2&&d[0].left>d[1].right&&l!=null&&u!=null)return d.find(y=>l>y.left-f.left&&l<y.right+f.right&&u>y.top-f.top&&u<y.bottom+f.bottom)||h;if(d.length>=2){if(dr(t)==="y"){const F=d[0],re=d[d.length-1],oe=Wt(t)==="top",ye=F.top,ae=re.bottom,G=oe?F.left:re.left,ee=oe?F.right:re.right,ke=ee-G,se=ae-ye;return{top:ye,bottom:ae,left:G,right:ee,width:ke,height:se,x:G,y:ye}}const y=Wt(t)==="left",w=bt(...d.map(F=>F.right)),k=ur(...d.map(F=>F.left)),E=d.filter(F=>y?F.left===k:F.right===w),I=E[0].top,A=E[E.length-1].bottom,N=k,P=w,L=P-N,z=A-I;return{top:I,bottom:A,left:N,right:P,width:L,height:z,x:N,y:I}}return h}const v=await s.getElementRects({reference:{getBoundingClientRect:m},floating:n.floating,strategy:o});return i.reference.x!==v.reference.x||i.reference.y!==v.reference.y||i.reference.width!==v.reference.width||i.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},uS=new Set(["left","top"]);async function cS(r,e){const{placement:t,platform:n,elements:i}=r,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Wt(t),a=Yt(t),l=dr(t)==="y",u=uS.has(o)?-1:1,c=s&&l?-1:1,d=Rr(e,r);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(f=a==="end"?m*-1:m),l?{x:f*c,y:h*u}:{x:h*u,y:f*c}}const dS=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(e){var t,n;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await cS(e,r);return o===((t=a.offset)==null?void 0:t.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},fS=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(e){const{x:t,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:y=>{let{x:w,y:k}=y;return{x:w,y:k}}},...l}=Rr(r,e),u={x:t,y:n},c=await fi(e,l),d=dr(Wt(i)),h=N1(d);let f=u[h],m=u[d];if(s){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",k=f+c[y],E=f-c[w];f=du(k,f,E)}if(o){const y=d==="y"?"top":"left",w=d==="y"?"bottom":"right",k=m+c[y],E=m-c[w];m=du(k,m,E)}const v=a.fn({...e,[h]:f,[d]:m});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[h]:s,[d]:o}}}}}},hS=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(e){var t,n;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...u}=Rr(r,e),c=await fi(e,u),d=Wt(i),h=Yt(i),f=dr(i)==="y",{width:m,height:v}=s.floating;let y,w;d==="top"||d==="bottom"?(y=d,w=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(w=d,y=h==="end"?"top":"bottom");const k=v-c.top-c.bottom,E=m-c.left-c.right,I=ur(v-c[y],k),A=ur(m-c[w],E),N=!e.middlewareData.shift;let P=I,L=A;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(L=E),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(P=k),N&&!h){const F=bt(c.left,0),re=bt(c.right,0),oe=bt(c.top,0),ye=bt(c.bottom,0);f?L=m-2*(F!==0||re!==0?F+re:bt(c.left,c.right)):P=v-2*(oe!==0||ye!==0?oe+ye:bt(c.top,c.bottom))}await l({...e,availableWidth:L,availableHeight:P});const z=await o.getDimensions(a.floating);return m!==z.width||v!==z.height?{reset:{rects:!0}}:{}}}};function ua(){return typeof window<"u"}function hi(r){return F1(r)?(r.nodeName||"").toLowerCase():"#document"}function zt(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function zr(r){var e;return(e=(F1(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function F1(r){return ua()?r instanceof Node||r instanceof zt(r).Node:!1}function Xt(r){return ua()?r instanceof Element||r instanceof zt(r).Element:!1}function fr(r){return ua()?r instanceof HTMLElement||r instanceof zt(r).HTMLElement:!1}function $1(r){return!ua()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof zt(r).ShadowRoot}const pS=new Set(["inline","contents"]);function ys(r){const{overflow:e,overflowX:t,overflowY:n,display:i}=Zt(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!pS.has(i)}const mS=new Set(["table","td","th"]);function gS(r){return mS.has(hi(r))}const vS=[":popover-open",":modal"];function ca(r){return vS.some(e=>{try{return r.matches(e)}catch{return!1}})}const yS=["transform","translate","scale","rotate","perspective"],bS=["transform","translate","scale","rotate","perspective","filter"],wS=["paint","layout","strict","content"];function mu(r){const e=gu(),t=Xt(r)?Zt(r):r;return yS.some(n=>t[n]?t[n]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||bS.some(n=>(t.willChange||"").includes(n))||wS.some(n=>(t.contain||"").includes(n))}function xS(r){let e=hn(r);for(;fr(e)&&!pi(e);){if(mu(e))return e;if(ca(e))return null;e=hn(e)}return null}function gu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const SS=new Set(["html","body","#document"]);function pi(r){return SS.has(hi(r))}function Zt(r){return zt(r).getComputedStyle(r)}function da(r){return Xt(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function hn(r){if(hi(r)==="html")return r;const e=r.assignedSlot||r.parentNode||$1(r)&&r.host||zr(r);return $1(e)?e.host:e}function H1(r){const e=hn(r);return pi(e)?r.ownerDocument?r.ownerDocument.body:r.body:fr(e)&&ys(e)?e:H1(e)}function j1(r,e,t){var n;e===void 0&&(e=[]);const i=H1(r),s=i===((n=r.ownerDocument)==null?void 0:n.body),o=zt(i);return s?(vu(o),e.concat(o,o.visualViewport||[],ys(i)?i:[],[])):e.concat(i,j1(i,[]))}function vu(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function _1(r){const e=Zt(r);let t=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=fr(r),s=i?r.offsetWidth:t,o=i?r.offsetHeight:n,a=oa(t)!==s||oa(n)!==o;return a&&(t=s,n=o),{width:t,height:n,$:a}}function V1(r){return Xt(r)?r:r.contextElement}function mi(r){const e=V1(r);if(!fr(e))return cr(1);const t=e.getBoundingClientRect(),{width:n,height:i,$:s}=_1(e);let o=(s?oa(t.width):t.width)/n,a=(s?oa(t.height):t.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const kS=cr(0);function q1(r){const e=zt(r);return!gu()||!e.visualViewport?kS:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function TS(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==zt(r)?!1:e}function bs(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=r.getBoundingClientRect(),s=V1(r);let o=cr(1);e&&(n?Xt(n)&&(o=mi(n)):o=mi(r));const a=TS(s,t,n)?q1(s):cr(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const h=zt(s),f=n&&Xt(n)?zt(n):n;let m=h,v=vu(m);for(;v&&n&&f!==m;){const y=mi(v),w=v.getBoundingClientRect(),k=Zt(v),E=w.left+(v.clientLeft+parseFloat(k.paddingLeft))*y.x,I=w.top+(v.clientTop+parseFloat(k.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=E,u+=I,m=zt(v),v=vu(m)}}return di({width:c,height:d,x:l,y:u})}function fa(r,e){const t=da(r).scrollLeft;return e?e.left+t:bs(zr(r)).left+t}function W1(r,e){const t=r.getBoundingClientRect(),n=t.left+e.scrollLeft-fa(r,t),i=t.top+e.scrollTop;return{x:n,y:i}}function CS(r){let{elements:e,rect:t,offsetParent:n,strategy:i}=r;const s=i==="fixed",o=zr(n),a=e?ca(e.floating):!1;if(n===o||a&&s)return t;let l={scrollLeft:0,scrollTop:0},u=cr(1);const c=cr(0),d=fr(n);if((d||!d&&!s)&&((hi(n)!=="body"||ys(o))&&(l=da(n)),fr(n))){const f=bs(n);u=mi(n),c.x=f.x+n.clientLeft,c.y=f.y+n.clientTop}const h=o&&!d&&!s?W1(o,l):cr(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:t.y*u.y-l.scrollTop*u.y+c.y+h.y}}function MS(r){return Array.from(r.getClientRects())}function ES(r){const e=zr(r),t=da(r),n=r.ownerDocument.body,i=bt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=bt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+fa(r);const a=-t.scrollTop;return Zt(n).direction==="rtl"&&(o+=bt(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}const U1=25;function AS(r,e){const t=zt(r),n=zr(r),i=t.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=gu();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=fa(n);if(u<=0){const c=n.ownerDocument,d=c.body,h=getComputedStyle(d),f=c.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(n.clientWidth-d.clientWidth-f);m<=U1&&(s-=m)}else u<=U1&&(s+=u);return{width:s,height:o,x:a,y:l}}const OS=new Set(["absolute","fixed"]);function NS(r,e){const t=bs(r,!0,e==="fixed"),n=t.top+r.clientTop,i=t.left+r.clientLeft,s=fr(r)?mi(r):cr(1),o=r.clientWidth*s.x,a=r.clientHeight*s.y,l=i*s.x,u=n*s.y;return{width:o,height:a,x:l,y:u}}function K1(r,e,t){let n;if(e==="viewport")n=AS(r,t);else if(e==="document")n=ES(zr(r));else if(Xt(e))n=NS(e,t);else{const i=q1(r);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return di(n)}function G1(r,e){const t=hn(r);return t===e||!Xt(t)||pi(t)?!1:Zt(t).position==="fixed"||G1(t,e)}function DS(r,e){const t=e.get(r);if(t)return t;let n=j1(r,[]).filter(a=>Xt(a)&&hi(a)!=="body"),i=null;const s=Zt(r).position==="fixed";let o=s?hn(r):r;for(;Xt(o)&&!pi(o);){const a=Zt(o),l=mu(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&OS.has(i.position)||ys(o)&&!l&&G1(r,o))?n=n.filter(c=>c!==o):i=a,o=hn(o)}return e.set(r,n),n}function PS(r){let{element:e,boundary:t,rootBoundary:n,strategy:i}=r;const o=[...t==="clippingAncestors"?ca(e)?[]:DS(e,this._c):[].concat(t),n],a=o[0],l=o.reduce((u,c)=>{const d=K1(e,c,i);return u.top=bt(d.top,u.top),u.right=ur(d.right,u.right),u.bottom=ur(d.bottom,u.bottom),u.left=bt(d.left,u.left),u},K1(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function IS(r){const{width:e,height:t}=_1(r);return{width:e,height:t}}function RS(r,e,t){const n=fr(e),i=zr(e),s=t==="fixed",o=bs(r,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=cr(0);function u(){l.x=fa(i)}if(n||!n&&!s)if((hi(e)!=="body"||ys(i))&&(a=da(e)),n){const f=bs(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&u();s&&!n&&i&&u();const c=i&&!n&&!s?W1(i,a):cr(0),d=o.left+a.scrollLeft-l.x-c.x,h=o.top+a.scrollTop-l.y-c.y;return{x:d,y:h,width:o.width,height:o.height}}function yu(r){return Zt(r).position==="static"}function J1(r,e){if(!fr(r)||Zt(r).position==="fixed")return null;if(e)return e(r);let t=r.offsetParent;return zr(r)===t&&(t=t.ownerDocument.body),t}function Y1(r,e){const t=zt(r);if(ca(r))return t;if(!fr(r)){let i=hn(r);for(;i&&!pi(i);){if(Xt(i)&&!yu(i))return i;i=hn(i)}return t}let n=J1(r,e);for(;n&&gS(n)&&yu(n);)n=J1(n,e);return n&&pi(n)&&yu(n)&&!mu(n)?t:n||xS(r)||t}const zS=async function(r){const e=this.getOffsetParent||Y1,t=this.getDimensions,n=await t(r.floating);return{reference:RS(r.reference,await e(r.floating),r.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function LS(r){return Zt(r).direction==="rtl"}const BS={convertOffsetParentRelativeRectToViewportRelativeRect:CS,getDocumentElement:zr,getClippingRect:PS,getOffsetParent:Y1,getElementRects:zS,getClientRects:MS,getDimensions:IS,getScale:mi,isElement:Xt,isRTL:LS},X1=dS,Z1=iS,Q1=fS,eg=sS,tg=hS,rg=oS,ng=rS,ig=lS,sg=(r,e,t)=>{const n=new Map,i={platform:BS,...t},s={...i.platform,_c:n};return tS(r,e,{...i,platform:s})};let bu,wu;if(typeof WeakMap<"u"){let r=new WeakMap;bu=e=>r.get(e),wu=(e,t)=>(r.set(e,t),t)}else{const r=[];let t=0;bu=n=>{for(let i=0;i<r.length;i+=2)if(r[i]==n)return r[i+1]},wu=(n,i)=>(t==10&&(t=0),r[t++]=n,r[t++]=i)}var Lr=class{constructor(r,e,t,n){this.width=r,this.height=e,this.map=t,this.problems=n}findCell(r){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=r)continue;const n=e%this.width,i=e/this.width|0;let s=n+1,o=i+1;for(let a=1;s<this.width&&this.map[e+a]==t;a++)s++;for(let a=1;o<this.height&&this.map[e+this.width*a]==t;a++)o++;return{left:n,top:i,right:s,bottom:o}}throw new RangeError(`No cell with offset ${r} found`)}colCount(r){for(let e=0;e<this.map.length;e++)if(this.map[e]==r)return e%this.width;throw new RangeError(`No cell with offset ${r} found`)}nextCell(r,e,t){const{left:n,right:i,top:s,bottom:o}=this.findCell(r);return e=="horiz"?(t<0?n==0:i==this.width)?null:this.map[s*this.width+(t<0?n-1:i)]:(t<0?s==0:o==this.height)?null:this.map[n+this.width*(t<0?s-1:o)]}rectBetween(r,e){const{left:t,right:n,top:i,bottom:s}=this.findCell(r),{left:o,right:a,top:l,bottom:u}=this.findCell(e);return{left:Math.min(t,o),top:Math.min(i,l),right:Math.max(n,a),bottom:Math.max(s,u)}}cellsInRect(r){const e=[],t={};for(let n=r.top;n<r.bottom;n++)for(let i=r.left;i<r.right;i++){const s=n*this.width+i,o=this.map[s];t[o]||(t[o]=!0,!(i==r.left&&i&&this.map[s-1]==o||n==r.top&&n&&this.map[s-this.width]==o)&&e.push(o))}return e}positionAt(r,e,t){for(let n=0,i=0;;n++){const s=i+t.child(n).nodeSize;if(n==r){let o=e+r*this.width;const a=(r+1)*this.width;for(;o<a&&this.map[o]<i;)o++;return o==a?s-1:this.map[o]}i=s}}static get(r){return bu(r)||wu(r,FS(r))}};function FS(r){if(r.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+r.type.name);const e=$S(r),t=r.childCount,n=[];let i=0,s=null;const o=[];for(let u=0,c=e*t;u<c;u++)n[u]=0;for(let u=0,c=0;u<t;u++){const d=r.child(u);c++;for(let m=0;;m++){for(;i<n.length&&n[i]!=0;)i++;if(m==d.childCount)break;const v=d.child(m),{colspan:y,rowspan:w,colwidth:k}=v.attrs;for(let E=0;E<w;E++){if(E+u>=t){(s||(s=[])).push({type:"overlong_rowspan",pos:c,n:w-E});break}const I=i+E*e;for(let A=0;A<y;A++){n[I+A]==0?n[I+A]=c:(s||(s=[])).push({type:"collision",row:u,pos:c,n:y-A});const N=k&&k[A];if(N){const P=(I+A)%e*2,L=o[P];L==null||L!=N&&o[P+1]==1?(o[P]=N,o[P+1]=1):L==N&&o[P+1]++}}}i+=y,c+=v.nodeSize}const h=(u+1)*e;let f=0;for(;i<h;)n[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:u,n:f}),c++}(e===0||t===0)&&(s||(s=[])).push({type:"zero_sized"});const a=new Lr(e,t,n,s);let l=!1;for(let u=0;!l&&u<o.length;u+=2)o[u]!=null&&o[u+1]<t&&(l=!0);return l&&HS(a,o,r),a}function $S(r){let e=-1,t=!1;for(let n=0;n<r.childCount;n++){const i=r.child(n);let s=0;if(t)for(let o=0;o<n;o++){const a=r.child(o);for(let l=0;l<a.childCount;l++){const u=a.child(l);o+u.attrs.rowspan>n&&(s+=u.attrs.colspan)}}for(let o=0;o<i.childCount;o++){const a=i.child(o);s+=a.attrs.colspan,a.attrs.rowspan>1&&(t=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function HS(r,e,t){r.problems||(r.problems=[]);const n={};for(let i=0;i<r.map.length;i++){const s=r.map[i];if(n[s])continue;n[s]=!0;const o=t.nodeAt(s);if(!o)throw new RangeError(`No cell with offset ${s} found`);let a=null;const l=o.attrs;for(let u=0;u<l.colspan;u++){const c=e[(i+u)%r.width*2];c!=null&&(!l.colwidth||l.colwidth[u]!=c)&&((a||(a=jS(l)))[u]=c)}a&&r.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:a})}}function jS(r){if(r.colwidth)return r.colwidth.slice();const e=[];for(let t=0;t<r.colspan;t++)e.push(0);return e}function xu(r){let e=r.cached.tableNodeTypes;if(!e){e=r.cached.tableNodeTypes={};for(const t in r.nodes){const n=r.nodes[t],i=n.spec.tableRole;i&&(e[i]=n)}}return e}new Ke("selectingCells");function _S(r){for(let e=r.depth-1;e>0;e--)if(r.node(e).type.spec.tableRole=="row")return r.node(0).resolve(r.before(e+1));return null}function og(r){const e=r.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function VS(r){const e=r.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const t=_S(e.$head)||qS(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function qS(r){for(let e=r.nodeAfter,t=r.pos;e;e=e.firstChild,t++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return r.doc.resolve(t)}for(let e=r.nodeBefore,t=r.pos;e;e=e.lastChild,t--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return r.doc.resolve(t-e.nodeSize)}}function ag(r){return r.parent.type.spec.tableRole=="row"&&!!r.nodeAfter}function lg(r,e){return r.depth==e.depth&&r.pos>=e.start(-1)&&r.pos<=e.end(-1)}function ug(r,e,t){const n=r.node(-1),i=Lr.get(n),s=r.start(-1),o=i.nextCell(r.pos-s,e,t);return o==null?null:r.node(0).resolve(s+o)}function cg(r,e,t=1){const n={...r,colspan:r.colspan-t};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,t),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}var hr=class $r extends ge{constructor(e,t=e){const n=e.node(-1),i=Lr.get(n),s=e.start(-1),o=i.rectBetween(e.pos-s,t.pos-s),a=e.node(0),l=i.cellsInRect(o).filter(c=>c!=t.pos-s);l.unshift(t.pos-s);const u=l.map(c=>{const d=n.nodeAt(c);if(!d)throw new RangeError(`No cell with offset ${c} found`);const h=s+c+1;return new kd(a.resolve(h),a.resolve(h+d.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=t}map(e,t){const n=e.resolve(t.map(this.$anchorCell.pos)),i=e.resolve(t.map(this.$headCell.pos));if(ag(n)&&ag(i)&&lg(n,i)){const s=this.$anchorCell.node(-1)!=n.node(-1);return s&&this.isRowSelection()?$r.rowSelection(n,i):s&&this.isColSelection()?$r.colSelection(n,i):new $r(n,i)}return we.between(n,i)}content(){const e=this.$anchorCell.node(-1),t=Lr.get(e),n=this.$anchorCell.start(-1),i=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),s={},o=[];for(let l=i.top;l<i.bottom;l++){const u=[];for(let c=l*t.width+i.left,d=i.left;d<i.right;d++,c++){const h=t.map[c];if(s[h])continue;s[h]=!0;const f=t.findCell(h);let m=e.nodeAt(h);if(!m)throw new RangeError(`No cell with offset ${h} found`);const v=i.left-f.left,y=f.right-i.right;if(v>0||y>0){let w=m.attrs;if(v>0&&(w=cg(w,0,v)),y>0&&(w=cg(w,w.colspan-y,y)),f.left<i.left){if(m=m.type.createAndFill(w),!m)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else m=m.type.create(w,m.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...m.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?m=m.type.createAndFill(w):m=m.type.create(w,m.content)}u.push(m)}o.push(e.child(l).copy(j.from(u)))}const a=this.isColSelection()&&this.isRowSelection()?e:o;return new Z(j.from(a),1,1)}replace(e,t=Z.empty){const n=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){const{$from:a,$to:l}=i[o],u=e.mapping.slice(n);e.replace(u.map(a.pos),u.map(l.pos),o?Z.empty:t)}const s=ge.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,t){this.replace(e,new Z(j.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=Lr.get(t),i=this.$anchorCell.start(-1),s=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let o=0;o<s.length;o++)e(t.nodeAt(s[o]),i+s[o])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const n=e.node(-1),i=Lr.get(n),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(t.pos-s),l=e.node(0);return o.top<=a.top?(o.top>0&&(e=l.resolve(s+i.map[o.left])),a.bottom<i.height&&(t=l.resolve(s+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(t=l.resolve(s+i.map[a.left])),o.bottom<i.height&&(e=l.resolve(s+i.map[i.width*(i.height-1)+o.right-1]))),new $r(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=Lr.get(e),n=this.$anchorCell.start(-1),i=t.colCount(this.$anchorCell.pos-n),s=t.colCount(this.$headCell.pos-n);if(Math.min(i,s)>0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,a=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==t.width}eq(e){return e instanceof $r&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const n=e.node(-1),i=Lr.get(n),s=e.start(-1),o=i.findCell(e.pos-s),a=i.findCell(t.pos-s),l=e.node(0);return o.left<=a.left?(o.left>0&&(e=l.resolve(s+i.map[o.top*i.width])),a.right<i.width&&(t=l.resolve(s+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(t=l.resolve(s+i.map[a.top*i.width])),o.right<i.width&&(e=l.resolve(s+i.map[i.width*(o.top+1)-1]))),new $r(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new $r(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){return new $r(e.resolve(t),e.resolve(n))}getBookmark(){return new WS(this.$anchorCell.pos,this.$headCell.pos)}};hr.prototype.visible=!1,ge.jsonID("cell",hr);var WS=class $g{constructor(e,t){this.anchor=e,this.head=t}map(e){return new $g(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&n.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&lg(t,n)?new hr(t,n):ge.near(n,1)}};new Ke("fix-tables");function dg(r){const e=r.selection,t=VS(r),n=t.node(-1),i=t.start(-1),s=Lr.get(n);return{...e instanceof hr?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(t.pos-i),tableStart:i,map:s,table:n}}function US(r){return function(e,t){if(!og(e))return!1;if(t){const n=xu(e.schema),i=dg(e),s=e.tr,o=i.map.cellsInRect(r=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:r=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=o.map(l=>i.table.nodeAt(l));for(let l=0;l<o.length;l++)a[l].type==n.header_cell&&s.setNodeMarkup(i.tableStart+o[l],n.cell,a[l].attrs);if(s.steps.length===0)for(let l=0;l<o.length;l++)s.setNodeMarkup(i.tableStart+o[l],n.header_cell,a[l].attrs);t(s)}return!0}}function fg(r,e,t){const n=e.map.cellsInRect({left:0,top:0,right:r=="row"?e.map.width:1,bottom:r=="column"?e.map.height:1});for(let i=0;i<n.length;i++){const s=e.table.nodeAt(n[i]);if(s&&s.type!==t.header_cell)return!1}return!0}function Su(r,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?US(r):function(t,n){if(!og(t))return!1;if(n){const i=xu(t.schema),s=dg(t),o=t.tr,a=fg("row",s,i),l=fg("column",s,i),u=(r==="column"?a:r==="row"&&l)?1:0,c=r=="column"?{left:0,top:u,right:1,bottom:s.map.height}:r=="row"?{left:u,top:0,right:s.map.width,bottom:1}:s,d=r=="column"?l?i.cell:i.header_cell:r=="row"?a?i.cell:i.header_cell:i.cell;s.map.cellsInRect(c).forEach(h=>{const f=h+s.tableStart,m=o.doc.nodeAt(f);m&&o.setNodeMarkup(f,d,m.attrs)}),n(o)}return!0}}Su("row",{useDeprecatedLogic:!0}),Su("column",{useDeprecatedLogic:!0}),Su("cell",{useDeprecatedLogic:!0});function ha(r,e){const t=r.selection;if(!(t instanceof hr))return!1;if(e){const n=r.tr,i=xu(r.schema).cell.createAndFill().content;t.forEachCell((s,o)=>{s.content.eq(i)||n.replace(n.mapping.map(o+1),n.mapping.map(o+s.nodeSize-1),new Z(i,0,0))}),n.docChanged&&e(n)}return!0}Bl({ArrowLeft:ma("horiz",-1),ArrowRight:ma("horiz",1),ArrowUp:ma("vert",-1),ArrowDown:ma("vert",1),"Shift-ArrowLeft":ga("horiz",-1),"Shift-ArrowRight":ga("horiz",1),"Shift-ArrowUp":ga("vert",-1),"Shift-ArrowDown":ga("vert",1),Backspace:ha,"Mod-Backspace":ha,Delete:ha,"Mod-Delete":ha});function pa(r,e,t){return t.eq(r.selection)?!1:(e&&e(r.tr.setSelection(t).scrollIntoView()),!0)}function ma(r,e){return(t,n,i)=>{if(!i)return!1;const s=t.selection;if(s instanceof hr)return pa(t,n,ge.near(s.$headCell,e));if(r!="horiz"&&!s.empty)return!1;const o=hg(i,r,e);if(o==null)return!1;if(r=="horiz")return pa(t,n,ge.near(t.doc.resolve(s.head+e),e));{const a=t.doc.resolve(o),l=ug(a,r,e);let u;return l?u=ge.near(l,1):e<0?u=ge.near(t.doc.resolve(a.before(-1)),-1):u=ge.near(t.doc.resolve(a.after(-1)),1),pa(t,n,u)}}}function ga(r,e){return(t,n,i)=>{if(!i)return!1;const s=t.selection;let o;if(s instanceof hr)o=s;else{const l=hg(i,r,e);if(l==null)return!1;o=new hr(t.doc.resolve(l))}const a=ug(o.$headCell,r,e);return a?pa(t,n,new hr(o.$anchorCell,a)):!1}}function hg(r,e,t){if(!(r.state.selection instanceof we))return null;const{$head:n}=r.state.selection;for(let i=n.depth-1;i>=0;i--){const s=n.node(i);if((t<0?n.index(i):n.indexAfter(i))!=(t<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const o=n.before(i),a=e=="vert"?t>0?"down":"up":t>0?"right":"left";return r.endOfTextblock(a)?o:null}}return null}new Ke("tableColumnResizing");function KS(r,e){const t=Math.min(r.top,e.top),n=Math.max(r.bottom,e.bottom),i=Math.min(r.left,e.left),o=Math.max(r.right,e.right)-i,a=n-t,l=i,u=t;return new DOMRect(l,u,o,a)}var GS=class{constructor({editor:r,element:e,view:t,updateDelay:n=250,resizeDelay:i=60,shouldShow:s,appendTo:o,getReferencedVirtualElement:a,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:c,state:d,from:h,to:f})=>{const{doc:m,selection:v}=d,{empty:y}=v,w=!m.textBetween(h,f).length&&jl(d.selection),k=this.element.contains(document.activeElement);return!(!(c.hasFocus()||k)||y||w||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:c})=>{var d;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}c?.relatedTarget&&((d=this.element.parentNode)!=null&&d.contains(c.relatedTarget))||c?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(c,d)=>{const h=!d?.selection.eq(c.state.selection),f=!d?.doc.eq(c.state.doc);!h&&!f||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(c,h,f,d)},this.updateDelay))},this.updateHandler=(c,d,h,f)=>{const{composing:m}=c;if(m||!d&&!h)return;if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()},this.transactionHandler=({transaction:c})=>{c.getMeta("bubbleMenu")==="updatePosition"&&this.updatePosition()};var u;this.editor=r,this.element=e,this.view=t,this.updateDelay=n,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=(u=l?.scrollTarget)!=null?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,s&&(this.shouldShow=s),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.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(t,t.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const r=[];return this.floatingUIOptions.flip&&r.push(eg(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&r.push(Q1(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&r.push(X1(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&r.push(ng(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&r.push(tg(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&r.push(Z1(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&r.push(rg(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&r.push(ig(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),r}get virtualElement(){var r;const{selection:e}=this.editor.state,t=(r=this.getReferencedVirtualElement)==null?void 0:r.call(this);if(t)return t;const n=Eh(this.view,e.from,e.to);let i={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof le){let s=this.view.nodeDOM(e.from);const o=s.dataset.nodeViewWrapper?s:s.querySelector("[data-node-view-wrapper]");o&&(s=o),s&&(i={getBoundingClientRect:()=>s.getBoundingClientRect(),getClientRects:()=>[s.getBoundingClientRect()]})}if(e instanceof hr){const{$anchorCell:s,$headCell:o}=e,a=s?s.pos:o.pos,l=o?o.pos:s.pos,u=this.view.nodeDOM(a),c=this.view.nodeDOM(l);if(!u||!c)return;const d=u===c?u.getBoundingClientRect():KS(u.getBoundingClientRect(),c.getBoundingClientRect());i={getBoundingClientRect:()=>d,getClientRects:()=>[d]}}return i}updatePosition(){const r=this.virtualElement;r&&sg(r,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n})=>{this.element.style.width="max-content",this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(r,e){const{state:t}=r,n=t.selection.from!==t.selection.to;if(this.updateDelay>0&&n){this.handleDebouncedUpdate(r,e);return}const i=!e?.selection.eq(r.state.selection),s=!e?.doc.eq(r.state.doc);this.updateHandler(r,i,s,e)}getShouldShow(r){var e;const{state:t}=this.view,{selection:n}=t,{ranges:i}=n,s=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:r,from:s,to:o}))||!1}show(){var r;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(r=e??this.view.dom.parentElement)==null||r.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},pg=r=>new qe({key:typeof r.pluginKey=="string"?new Ke(r.pluginKey):r.pluginKey,view:e=>new GS({view:e,...r})});De.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[pg({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var JS=class{constructor({editor:r,element:e,view:t,options:n,appendTo:i,shouldShow:s}){this.preventHide=!1,this.isVisible=!1,this.shouldShow=({view:o,state:a})=>{const{selection:l}=a,{$anchor:u,empty:c}=l,d=u.depth===1,h=u.parent.isTextblock&&!u.parent.type.spec.code&&!u.parent.textContent&&u.parent.childCount===0&&!this.getTextContent(u.parent);return!(!o.hasFocus()||!c||!d||!h||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(o,a,l,u)=>{const{composing:c}=o;if(c||!a&&!l)return;if(!this.getShouldShow(u)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:o})=>{var a;if(this.preventHide){this.preventHide=!1;return}o?.relatedTarget&&((a=this.element.parentNode)!=null&&a.contains(o.relatedTarget))||o?.relatedTarget!==this.editor.view.dom&&this.hide()},this.editor=r,this.element=e,this.view=t,this.appendTo=i,this.floatingUIOptions={...this.floatingUIOptions,...n},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.update(t,t.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(r){return Sh(r,{textSerializers:Ul(this.editor.schema)})}get middlewares(){const r=[];return this.floatingUIOptions.flip&&r.push(eg(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&r.push(Q1(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&r.push(X1(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&r.push(ng(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&r.push(tg(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&r.push(Z1(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&r.push(rg(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&r.push(ig(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),r}getShouldShow(r){var e;const{state:t}=this.view,{selection:n}=t,{ranges:i}=n,s=Math.min(...i.map(l=>l.$from.pos)),o=Math.max(...i.map(l=>l.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:t,oldState:r,from:s,to:o})}updatePosition(){const{selection:r}=this.editor.state,e=Eh(this.view,r.from,r.to);sg({getBoundingClientRect:()=>e,getClientRects:()=>[e]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:n,y:i,strategy:s})=>{this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${n}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(r,e){const t=!e?.selection.eq(r.state.selection),n=!e?.doc.eq(r.state.doc);this.updateHandler(r,t,n,e)}show(){var r;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(r=e??this.view.dom.parentElement)==null||r.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},mg=r=>new qe({key:typeof r.pluginKey=="string"?new Ke(r.pluginKey):r.pluginKey,view:e=>new JS({view:e,...r})});De.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[mg({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var YS=B.forwardRef(({pluginKey:r="bubbleMenu",editor:e,updateDelay:t,resizeDelay:n,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:o,options:a,children:l,...u},c)=>{const d=B.useRef(document.createElement("div"));typeof c=="function"?c(d.current):c&&(c.current=d.current);const{editor:h}=dp(),f=e||h,m={updateDelay:t,resizeDelay:n,appendTo:i,pluginKey:r,shouldShow:s,getReferencedVirtualElement:o,options:a},v=B.useRef(m);return v.current=m,B.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=d.current;y.style.visibility="hidden",y.style.position="absolute";const w=pg({...v.current,editor:f,element:y});f.registerPlugin(w);const k=v.current.pluginKey;return()=>{f.unregisterPlugin(k),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),Cs.createPortal(X.jsx("div",{...u,children:l}),d.current)});B.forwardRef(({pluginKey:r="floatingMenu",editor:e,appendTo:t,shouldShow:n=null,options:i,children:s,...o},a)=>{const l=B.useRef(document.createElement("div"));typeof a=="function"?a(l.current):a&&(a.current=l.current);const{editor:u}=dp();return B.useEffect(()=>{const c=l.current;if(c.style.visibility="hidden",c.style.position="absolute",e?.isDestroyed||u?.isDestroyed)return;const d=e||u;if(!d){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const h=mg({editor:d,element:c,pluginKey:r,appendTo:t,shouldShow:n,options:i});return d.registerPlugin(h),()=>{d.unregisterPlugin(r),window.requestAnimationFrame(()=>{c.parentNode&&c.parentNode.removeChild(c)})}},[e,u,t,r,n,i]),Cs.createPortal(X.jsx("div",{...o,children:s}),l.current)});const XS=({editor:r})=>{if(!r)return null;const[e]=B.useState(!0),[t]=B.useState(!0);B.useEffect(()=>{r&&r.setEditable(t)},[t,r]);const n=lp({editor:r,selector:i=>({isTerm:i.editor.isActive("term"),canTerm:i.editor.can().chain().focus().toggleMark("term").run(),isEm:i.editor.isActive("em"),canEm:i.editor.can().chain().focus().toggleMark("em").run(),isAlert:i.editor.isActive("alert"),canAlert:i.editor.can().chain().focus().toggleMark("alert").run()})});return X.jsx(X.Fragment,{children:r&&e&&X.jsx(YS,{shouldShow:null,editor:r,options:{placement:"bottom",autoPlacement:!0,offset:8},children:X.jsxs("div",{className:"button-group",children:[X.jsx("button",{onClick:()=>r.chain().focus().toggleMark("em").run(),disabled:!n.canEm,className:n.isEm?"is-active":"",children:"<em>"}),X.jsx("button",{onClick:()=>r.chain().focus().toggleMark("term").run(),disabled:!n.canTerm,className:n.isTerm?"is-active":"",children:"<term>"}),X.jsx("button",{onClick:()=>r.chain().focus().toggleMark("alert").run(),disabled:!n.canAlert,className:n.isAlert?"is-active":"",children:"<alert>"})]})})})},gg=["abstract","acknowledgement","affiliation","appendix","article","author","backmatter","biography","book","chapter","colophon","contributor","contributors","copyright","credit","dedication","docinfo","editor","feedback","frontmatter","google","html","index","macros","mathbook","preface","pretext","references","search","shortlicense","solutions","subsection","titlepage","website"],vg=["assemblage","chapter","conclusion","introduction","objectives","outcomes","paragraphs","part","postlude","prelude","reading-questions","sbsgroup","section","stack","subsection","subsubsection","task","technology","worksheet"],yg=["activity","algorithm","answer","axiom","biblio","blockquote","case","choice","choices","claim","conjecture","console","corollary","definition","demonstration","description","example","exercise","exploration","fact","hint","image","images","insight","investigation","lemma","list","listing","note","openconjecture","openproblem","openquestion","page","poem","principle","problem","program","project","proof","proposition","question","remark","shortdescription","solution","stanza","statement","subtask","table","tabular","theorem","warning","webwork"],ZS=["address","attribution","caption","cd","cell","cline","date","department","description","edition","entity","holder","idx","institution","journal","line","location","minilicense","mrow","personname","pg-macros","pubtitle","row","subtitle","support","title","usage","volume","year","xi:include"],QS=["me","men","md","mdn"],bg=["ul","ol","li","p","task","figure","sidebyside","notation","row"],va=["latex-image-preamble","latex-image","latex-preamble","slate","sage","sageplot","asymptote","macros","prefigure","program","input","output","prompt","pre","pg-code","tikzpicture","tikz","code","c"],ek=[...gg,...vg,...yg,...bg,"xi:include"],ku=[...gg,...vg,...yg,...bg,...QS];function tk(r){let e=!1,t=r.split(/\r\n|\r|\n/g),n=[t[0].trim()];t.length>1&&n.push(t[1].trim());for(let i=2;i<t.length;i++){let s=/^<(\w\S*?)(\s.*?|>)$/.exec(t[i].trim()),o=/^<\/(\w\S*?)(\s.*?|>)(.?)$/.exec(t[i].trim());if(s&&va.includes(s[1]))n.push(t[i]),e=!0;else if(o&&va.includes(o[1]))n.push(t[i]),e=!1;else if(e)n.push(t[i]);else{t[i]=t[i].trim();let a=n.pop();a?n.push(a.trim()+" "+t[i]):n.push(t[i])}}return n.join(`
|
|
936
|
+
`)}function rk(r,e){const n="some";let i=tk(r);console.log("Getting ready to start formatting.");for(let c of ku)if(i.includes("<"+c)){let d=new RegExp("<"+c+"(>|(\\s[^\\/]*?)>|(.*xmlns.*?)>)","g"),h=new RegExp("<\\/"+c+">([\\s\\S]*?[.,!?;:]?)","g");i=i.replace(d,`
|
|
903
937
|
$&
|
|
904
938
|
`),i=i.replace(h,`
|
|
905
939
|
$&
|
|
906
|
-
`)}for(let c of
|
|
940
|
+
`)}for(let c of ZS){let d=new RegExp("<"+c+"(.*?)>","g"),h=new RegExp("<\\/"+c+">([\\s\\S]*?[.,!?;:]?)","g"),f=new RegExp("<"+c+"(.*?)\\/>","g");i=i.replace(d,`
|
|
907
941
|
$&`),i=i.replace(h,`$&
|
|
908
942
|
`),i=i.replace(f,`$&
|
|
909
943
|
`)}let s=" ";s=" ".repeat(2);let o=0,a=!1,l=i.split(/\r\n|\r|\n/g),u=[];for(let c of l){let d=c.trim(),h=/^<(\w\S*?)(\s.*?|>)$/.exec(d),f=/^<\/(\w\S*?)(\s.*?|>)(.?)$/.exec(d);d.length!==0&&(d.startsWith("<?")?u.push(d+`
|
|
910
|
-
`):d.startsWith("<!--")?u.push(s.repeat(o)+d):f?
|
|
944
|
+
`):d.startsWith("<!--")?u.push(s.repeat(o)+d):f?ku.includes(f[1])?(o=Math.max(0,o-1),u.push(s.repeat(o)+d)):(va.includes(f[1])&&(a=!1),u.push(s.repeat(o)+d)):h?(u.push(s.repeat(o)+d),ku.includes(h[1])?o+=1:va.includes(h[1])&&(a=!0)):a?u.push(c):u.push(s.repeat(o)+d))}switch(n){case"few":break;case"some":for(let c=0;c<u.length-1;c++)if(u[c].trim().startsWith("</"))for(let d of ek)new RegExp("<"+d+"(.*?)>","g").test(u[c+1])&&(u[c]+=`
|
|
911
945
|
`);else u[c].trim().startsWith("<title>")&&(u[c]+=`
|
|
912
946
|
`);break;case"many":for(let c=0;c<u.length-1;c++)(u[c].trim().startsWith("</")||u[c].trim().startsWith("<")&&u[c+1].trim().startsWith("<"))&&(u[c]+=`
|
|
913
947
|
`);break}return i=u.join(`
|
|
914
|
-
`),i}const
|
|
948
|
+
`),i}const nk=Oe.create({name:"ptxFragment",topNode:!0,content:"ptxdoc"}),ik=[Hx.configure({defaultLanguage:"xml"}),nk,kw,wp,Dp,xp,Lx,pw,jx,_x,Vx,qx,iw,sw,ow,Lb.configure({mode:"deepest"}),Fb,Bb],wg=({content:r,onChange:e})=>{const t=B.useRef(null),n=B.useRef(!1),i=H7({extensions:ik,content:r,onContentError(l){console.log("Content error: ",l.error),l.disableCollaboration(),l.editor.setEditable(!1,!1)},enableContentCheck:!0,onUpdate:({editor:l})=>{console.log("Editor update detected."),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{n.current&&e(rk(Wx(l.getJSON())))},500)}});B.useEffect(()=>()=>{t.current&&clearTimeout(t.current)},[]);const s=B.useRef(!0);B.useEffect(()=>{if(i&&r!==i.getHTML()&&s.current){const l=r;if(i)try{i.commands.setContent(Tx(l),{emitUpdate:!1}),console.log("External content set in visual editor.")}catch(u){console.error("Error setting content: ",u)}}},[r,i]),B.useEffect(()=>{if(!i)return;const l=()=>{s.current=!1};return i.on("update",l),()=>{i.off("update",l)}},[i]),B.useEffect(()=>{s.current=!0},[r]);const[o,a]=B.useState(!1);return B.useEffect(()=>{n.current=o,i&&i.setEditable(o,!1)},[i,o]),X.jsxs("div",{className:"pretext-plus-editor__visual-editor",children:[X.jsxs("div",{className:"pretext-plus-editor__visual-editor-header",children:[X.jsx("p",{className:"pretext-plus-editor__visual-editor-title",children:"Simple Preview"}),X.jsxs("label",{className:"pretext-plus-editor__edit-toggle",children:[X.jsx("input",{className:"pretext-plus-editor__edit-checkbox",type:"checkbox",checked:o,onChange:()=>a(!o)}),"Edit"]})]}),X.jsx("div",{className:(o?"editable":"read-only")+" ptx-page",children:X.jsx(z7,{editor:i})}),X.jsx(XS,{editor:i})]})},xg=(r,e,t)=>{const n=document.createElement("form");n.method="POST",n.action=r,n.target=t,n.style.display="none";for(const i in e)if(Object.hasOwnProperty.call(e,i)){const s=document.createElement("input");s.type="hidden",s.name=i,s.value=e[i],n.appendChild(s)}document.body.appendChild(n),n.submit(),n.remove()},Sg=({content:r,title:e,onRebuild:t})=>{const[n,i]=B.useState(!1),s=B.useRef(null);B.useEffect(()=>{o()},[]);const o=()=>{const l=r,u=e||"Document Title";if(i(!0),t){t(l,u,(d,h)=>{xg(d,h,"fullPreview")});return}},a=()=>{i(!1)};return X.jsxs("div",{className:"pretext-plus-editor__full-preview",children:[X.jsxs("div",{className:"pretext-plus-editor__preview-header",children:[X.jsx("p",{className:"pretext-plus-editor__preview-title",children:"Full Preview"}),X.jsx("button",{className:"pretext-plus-editor__rebuild-button",onClick:()=>o(),children:"Rebuild"})]}),X.jsxs("div",{className:"pretext-plus-editor__preview-container",children:[n&&X.jsx("div",{className:"pretext-plus-editor__rebuilding-overlay",children:X.jsxs("div",{className:"pretext-plus-editor__rebuilding-popup",children:[X.jsx("div",{className:"pretext-plus-editor__spinner"}),X.jsx("p",{className:"pretext-plus-editor__rebuilding-text",children:"Rebuilding..."})]})}),X.jsx("iframe",{ref:s,className:"pretext-plus-editor__preview-iframe",name:"fullPreview",onLoad:a})]})]})},sk=r=>{let e;return r.showPreviewModeToggle===!1?e=null:e=X.jsxs("label",{className:"pretext-plus-editor__preview-toggle",children:[X.jsx("input",{type:"checkbox",checked:!r.isChecked,onChange:r.onChange,className:"pretext-plus-editor__preview-toggle-input"}),X.jsxs("div",{className:"pretext-plus-editor__preview-toggle-container",children:[X.jsx("span",{className:"pretext-plus-editor__preview-toggle-label",children:"Simple"}),X.jsx("span",{className:`pretext-plus-editor__preview-toggle-slider ${r.isChecked?"pretext-plus-editor__preview-toggle-slider--active":""}`,children:X.jsx("span",{className:`pretext-plus-editor__preview-toggle-dot ${r.isChecked?"pretext-plus-editor__preview-toggle-dot--active":""}`})}),X.jsx("span",{className:"pretext-plus-editor__preview-toggle-label",children:"Full"})]}),X.jsx("span",{className:"pretext-plus-editor__preview-toggle-caption",children:"Preview Mode"}),X.jsx("input",{type:"checkbox",checked:r.isChecked,onChange:r.onChange,className:"pretext-plus-editor__preview-toggle-input"})]}),X.jsxs("div",{className:"pretext-plus-editor__menu-bar",children:[X.jsx("div",{className:"pretext-plus-editor__menu-left",children:r.title!==void 0&&r.onTitleChange&&X.jsxs("label",{className:"pretext-plus-editor__title-label",children:["Title"," ",X.jsx("input",{className:"pretext-plus-editor__title-input",type:"text",value:r.title,onChange:t=>r.onTitleChange?.(t.target.value)})]})}),X.jsxs("div",{className:"pretext-plus-editor__menu-right",children:[r.onSaveButton&&X.jsx("button",{className:"pretext-plus-editor__button pretext-plus-editor__button--save",onClick:r.onSaveButton,children:r.saveButtonLabel||"Save"}),r.onCancelButton&&X.jsx("button",{className:"pretext-plus-editor__button pretext-plus-editor__button--cancel",onClick:r.onCancelButton,children:r.cancelButtonLabel||"Cancel"}),e]})]})},ok=`
|
|
949
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
915
950
|
<section>
|
|
916
951
|
<title>My Section</title>
|
|
917
952
|
<p>
|
|
@@ -990,5 +1025,5 @@ $&`),i=i.replace(h,`$&
|
|
|
990
1025
|
|
|
991
1026
|
<p> And that's the end of the demo. Thanks for coming!</p>
|
|
992
1027
|
</section>
|
|
993
|
-
`,
|
|
1028
|
+
`,ak=r=>{const[e,t]=B.useState(r.content||ok),[n,i]=B.useState(r.title||"Document Title"),[s,o]=B.useState(!1),[a,l]=B.useState(window.innerWidth<800);B.useEffect(()=>{const h=()=>{l(window.innerWidth<800)};return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[]);const u=X.jsx(Pc,{content:e,onChange:h=>{t(h||""),r.onContentChange(h)}});let c;s&&r.onPreviewRebuild?c=X.jsx(Sg,{content:e,title:n,onRebuild:r.onPreviewRebuild}):c=X.jsx(wg,{content:e,onChange:h=>{t(h||""),r.onContentChange(h)}});let d;return a?d=X.jsxs(vc,{children:[X.jsx(Ha,{header:"Editor",children:X.jsx("div",{style:{height:"60vh"},children:u})}),X.jsx(Ha,{header:"Preview",children:X.jsx("div",{style:{height:"60vh"},children:c})})]}):d=X.jsxs(ac,{className:"pretext-plus-editor__splitter",children:[X.jsx(Ra,{className:"pretext-plus-editor__editor-panel",children:u}),X.jsx(Ra,{className:"pretext-plus-editor__preview-panel",children:c})]}),X.jsxs("div",{className:"pretext-plus-editor",children:[X.jsx(sk,{isChecked:s,onChange:()=>o(!s),title:n,onTitleChange:h=>{i(h),r.onTitleChange?.(h)},onSaveButton:r.onSaveButton,saveButtonLabel:r.saveButtonLabel,onCancelButton:r.onCancelButton,cancelButtonLabel:r.cancelButtonLabel,showPreviewModeToggle:r.onPreviewRebuild!==void 0}),d]})};Bt.CodeEditor=Pc,Bt.Editors=ak,Bt.FullPreview=Sg,Bt.VisualEditor=wg,Bt.postToIframe=xg,Object.defineProperty(Bt,Symbol.toStringTag,{value:"Module"})}));
|
|
994
1029
|
//# sourceMappingURL=index.js.map
|